diff --git a/Server/src/main/content/global/travel/balloon/BalloonCrashSites.kt b/Server/src/main/content/global/travel/balloon/BalloonCrashSites.kt index cdf910f03..12d449738 100644 --- a/Server/src/main/content/global/travel/balloon/BalloonCrashSites.kt +++ b/Server/src/main/content/global/travel/balloon/BalloonCrashSites.kt @@ -1,9 +1,11 @@ package content.global.travel.balloon +import core.api.MapArea import core.api.closeInterface import core.api.closeOverlay import core.api.closeTabInterface import core.api.getAttribute +import core.api.getRegionBorders import core.api.openOverlay import core.api.playAudio import core.api.removeAttribute @@ -19,6 +21,8 @@ import core.game.interaction.InteractionListener import core.game.node.entity.player.Player import core.game.system.task.Pulse import core.game.world.map.Location +import core.game.world.map.zone.ZoneBorders +import core.game.world.map.zone.ZoneRestriction import core.game.world.update.flag.context.Animation import core.net.packet.PacketRepository import core.net.packet.context.MinimapStateContext @@ -31,6 +35,7 @@ import org.rs09.consts.Components */ object BalloonCrashSites { + const val CRASH_SITE_REGION = 7244 const val SCENERY_OCEAN_PLANK = 19126 const val SCENERY_WOODLAND_DIRT = 19125 @@ -115,6 +120,7 @@ object BalloonCrashSites { WoodlandExit.ARDOUGNE -> { teleport(player, WOODLAND_ARDOUGNE_EXIT) + player.faceLocation(WOODLAND_ARDOUGNE_EXIT_FACE_LOCATION) // TODO: Placeholder message, find 09 source. sendPlayerDialogue(player, "The crash must have really sent us off course; I'm near Ardougne!") } @@ -188,7 +194,7 @@ object BalloonCrashSites { } -class BalloonCrashSiteListener : InteractionListener { +class BalloonCrashSiteListener : InteractionListener, MapArea { override fun defineListeners() { on(BalloonCrashSites.SCENERY_OCEAN_PLANK, IntType.SCENERY, "use") { player, _ -> BalloonCrashSites.leaveOceanCrashSite(player) @@ -211,6 +217,14 @@ class BalloonCrashSiteListener : InteractionListener { } } + + override fun defineAreaBorders(): Array { + return arrayOf(getRegionBorders(BalloonCrashSites.CRASH_SITE_REGION)) + } + + override fun getRestrictions(): Array { + return arrayOf(ZoneRestriction.TELEPORT) + } } class BalloonCrashDialogue : DialogueLabeller() { @@ -225,18 +239,18 @@ class BalloonCrashDialogue : DialogueLabeller() { } label("ocean_crash") - npc("Great Scott! Ocean! Ahhh!") - player("What happened?") - npc("Crashed, off course. Ocean! Oh dear... I feel very...") - player("Contemplative? Concerned for your life? Desperate?") - npc("No...more along the lines of ill...You might want to swim away now. Use the plank...") - player("How are you going to get back? What about the balloon?") - npc("I'm sure a fishing trawler will come by and give me a lift. Don't worry, I shall return.") + npc("Great Scott! Ocean! Ahhh!") + player("What happened?") + npc("Crashed, off course. Ocean! Oh dear... I feel very...") + player("Contemplative? Concerned for your life? Desperate?") + npc("No...more along the lines of ill...You might want to swim away now. Use the plank...") + player("How are you going to get back? What about the balloon?") + npc("I'm sure a fishing trawler will come by and give me a lift. Don't worry, I shall return.") label("woodland_crash") - npc("Well, that didn't go as planned.") - player("So what now? How will we get the balloon back?") - npc("I'll have to get one of the monks to come pick it up. You head back on your own; just follow the path. I'll meet you back at Entrana.") + npc("Well, that didn't go as planned.") + player("So what now? How will we get the balloon back?") + npc("I'll have to get one of the monks to come pick it up. You head back on your own; just follow the path. I'll meet you back at Entrana.") } } \ No newline at end of file