mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-28 05:45:10 -06:00
handle the instanced stairs
This commit is contained in:
parent
ab35b71420
commit
3cc9e8e8c8
1 changed files with 38 additions and 5 deletions
|
|
@ -28,6 +28,7 @@ import content.region.kandarin.seers.quest.elementalworkshop2.ElementalWorkshop2
|
|||
import core.api.*
|
||||
import core.api.utils.PlayerCamera
|
||||
import core.game.dialogue.DialogueLabeller
|
||||
import core.game.global.action.ClimbActionHandler
|
||||
import core.game.interaction.IntType
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.interaction.QueueStrength
|
||||
|
|
@ -598,11 +599,10 @@ class EW2Listeners : InteractionListener {
|
|||
|
||||
// bookcase at digsite where you start quest
|
||||
on(Scenery.BOOKCASE_17382, IntType.SCENERY, "search") { player, _ ->
|
||||
if (isQuestComplete(player, Quests.ELEMENTAL_WORKSHOP_I) &&
|
||||
!inInventory(player, Items.BEATEN_BOOK_9717) &&
|
||||
!inBank(player, Items.BEATEN_BOOK_9717) &&
|
||||
hasLevelStat(player, Skills.MAGIC, 20) &&
|
||||
hasLevelStat(player, Skills.SMITHING, 30)
|
||||
if (isQuestComplete(player, Quests.ELEMENTAL_WORKSHOP_I)
|
||||
&& !hasAnItem(player, Items.BEATEN_BOOK_9717).exists()
|
||||
&& hasLevelStat(player, Skills.MAGIC, 20)
|
||||
&& hasLevelStat(player, Skills.SMITHING, 30)
|
||||
) {
|
||||
sendItemDialogue(player, Items.BEATEN_BOOK_9717, "You find an old-looking book.")
|
||||
addItemOrDrop(player, Items.BEATEN_BOOK_9717)
|
||||
|
|
@ -723,6 +723,39 @@ class EW2Listeners : InteractionListener {
|
|||
return@on true
|
||||
}
|
||||
|
||||
// stairs in the main level of the workshop
|
||||
on(intArrayOf(Scenery.DOOR_18702, Scenery.STAIRS_18610, Scenery.STAIRS_18611), IntType.SCENERY, "climb-up", "climb-down") { player, node ->
|
||||
// locations
|
||||
val playerLoc = toInstance(player, player.location)
|
||||
val northTop = toInstance(player, Location.create(1959, 5159, 3))
|
||||
val northBottom = toInstance(player, Location.create(1957, 5159, 2))
|
||||
val southTop = toInstance(player, Location.create(1948, 5149, 3))
|
||||
val southBottom = toInstance(player, Location.create(1950, 5149, 2))
|
||||
|
||||
// handlers
|
||||
val climb = Animation(Animations.HUMAN_CLIMB_STAIRS_828)
|
||||
val up = "You climb up the stairs."
|
||||
val down = "You climb down the stairs."
|
||||
when(node.id) {
|
||||
// up
|
||||
Scenery.STAIRS_18610 -> {
|
||||
when(playerLoc) {
|
||||
northBottom -> ClimbActionHandler.climb(player, climb, northTop, up)
|
||||
southBottom -> ClimbActionHandler.climb(player, climb, southTop, up)
|
||||
}
|
||||
}
|
||||
|
||||
// down
|
||||
Scenery.STAIRS_18611 -> {
|
||||
when(playerLoc) {
|
||||
northTop -> ClimbActionHandler.climb(player, climb, northBottom, down)
|
||||
southTop -> ClimbActionHandler.climb(player, climb, southBottom, down)
|
||||
}
|
||||
}
|
||||
}
|
||||
return@on true
|
||||
}
|
||||
|
||||
// schematic crate
|
||||
on(Scenery.SCHEMATIC_CRATE_18711, IntType.SCENERY, "take-from") { player, _ ->
|
||||
sendDialogueOptions(player, "There are two schematics here...", "Crane schematic", "Lever schematic")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue