From c52948489f996315efb7f14e78fb5e372e5d52d7 Mon Sep 17 00:00:00 2001 From: psyopcutie Date: Sun, 26 Jul 2026 07:54:39 +0200 Subject: [PATCH] jingle and dialogue box added --- .../travel/balloon/BalloonTravelInterface.kt | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Server/src/main/content/global/travel/balloon/BalloonTravelInterface.kt b/Server/src/main/content/global/travel/balloon/BalloonTravelInterface.kt index 81bfd59d5..d006b3261 100644 --- a/Server/src/main/content/global/travel/balloon/BalloonTravelInterface.kt +++ b/Server/src/main/content/global/travel/balloon/BalloonTravelInterface.kt @@ -16,9 +16,11 @@ import core.api.isQuestComplete import core.api.lock import core.api.openDialogue import core.api.openInterface +import core.api.playJingle import core.api.queueScript import core.api.removeItem import core.api.rewardXP +import core.api.sendDialogue import core.api.sendMessage import core.api.setAttribute import core.api.setComponentVisibility @@ -27,6 +29,7 @@ import core.api.stopExecuting import core.api.teleport import core.api.unlock import core.cache.def.impl.ItemDefinition +import core.game.dialogue.DialogueFile import core.game.interaction.IntType import core.game.interaction.InteractionListener import core.game.interaction.InterfaceListener @@ -77,6 +80,7 @@ private val BALLOON_BASKET_LOCS = intArrayOf(19128, 19129) class BalloonTravelInterface : InterfaceListener, InteractionListener { companion object { + private const val JINGLE_A_HOT_AIR_JOURNEY_118 = 118 private const val BALLOON_MAP_INTERFACE_469 = 469 private const val BALLOON_MAP_MODEL_12 = 12 @@ -160,6 +164,7 @@ class BalloonTravelInterface : InterfaceListener, InteractionListener { val duration = animationDuration(Animation(animation)) lock(player, duration) + playJingle(player, JINGLE_A_HOT_AIR_JOURNEY_118) setComponentVisibility(player, BALLOON_MAP_INTERFACE_469, start.mapComponent, true) setComponentVisibility(player, BALLOON_MAP_INTERFACE_469, BALLOON_MAP_MODEL_12, false) animateInterface(player, BALLOON_MAP_INTERFACE_469, BALLOON_MAP_MODEL_12, animation) @@ -182,9 +187,8 @@ class BalloonTravelInterface : InterfaceListener, InteractionListener { } private fun unlockRoute(player: Player, destination: BalloonTravelLocation) { - if (removeItem(player, Item(destination.log, destination.unlockLogAmount))) { - BalloonFlightInterface.startUnlockFlight(player, destination) - } + closeInterface(player) + openDialogue(player, BalloonBoardingDialogue(destination)) } fun unlockDestination(player: Player, destination: BalloonTravelLocation) { @@ -396,4 +400,22 @@ enum class BalloonTravelLocation( } } -} \ No newline at end of file +} + +private class BalloonBoardingDialogue(private val destination: BalloonTravelLocation) : DialogueFile() { + override fun handle(componentID: Int, buttonID: Int) { + when (stage) { + 0 -> sendDialogue(player!!, "You board the balloon.").also { stage++ } + + 1 -> { + if (removeItem(player!!, Item(destination.log, destination.unlockLogAmount))) { + end() + BalloonFlightInterface.startUnlockFlight(player!!, destination) + } else { + end() + sendMessage(player!!, "You need some logs to fuel the balloon.") + } + } + } + } +}