mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-23 03:15:10 -06:00
jingle and dialogue box added
This commit is contained in:
parent
7f1b1ef685
commit
c52948489f
1 changed files with 26 additions and 4 deletions
|
|
@ -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(
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue