From 01a4292123090ddc2abc2f7354146bbacaf5723d Mon Sep 17 00:00:00 2001 From: Ryan <2804894-ryannathans@users.noreply.gitlab.com> Date: Thu, 19 May 2022 23:11:47 +0000 Subject: [PATCH] simplified ring of the star sprite teleport dialogue, now tells you if star has been mined --- .../shootingstar/ShootingStarPlugin.kt | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/Server/src/main/kotlin/rs09/game/content/global/worldevents/shootingstar/ShootingStarPlugin.kt b/Server/src/main/kotlin/rs09/game/content/global/worldevents/shootingstar/ShootingStarPlugin.kt index d8305627c..252aea1eb 100644 --- a/Server/src/main/kotlin/rs09/game/content/global/worldevents/shootingstar/ShootingStarPlugin.kt +++ b/Server/src/main/kotlin/rs09/game/content/global/worldevents/shootingstar/ShootingStarPlugin.kt @@ -113,22 +113,13 @@ class ShootingStarPlugin : LoginListener, InteractionListener, TickListener, Com private class RingDialogue(val shouldWarn: Boolean, val star: ShootingStar) : DialogueFile(){ override fun handle(componentID: Int, buttonID: Int) { - if(shouldWarn){ - when(stage) { - 0 -> dialogue("WARNING: That mining site is located in the wilderness.").also { stage++ } - 1 -> player!!.dialogueInterpreter.sendOptions("Continue?","Yes","No").also { stage++ } - 2 -> when(buttonID){ - 1 -> teleport(player!!, star).also { end() } - 2 -> end() - } - } - } else { - when(stage){ - 0 -> player!!.dialogueInterpreter.sendOptions("Teleport to the Star?", "Yes", "No").also { stage++ } - 1 -> when(buttonID){ - 1 -> teleport(player!!, star).also { end() } - 2 -> end() - } + when (stage) { + 0 -> dialogue(if (star.spriteSpawned) "The star sprite has already been freed." else "The star sprite is still trapped.").also { if (shouldWarn) stage++ else stage += 2 } + 1 -> dialogue("WARNING: The star is located in the wilderness.").also { stage++ } + 2 -> player!!.dialogueInterpreter.sendOptions("Teleport to the star?", "Yes", "No").also { stage++ } + 3 -> when (buttonID) { + 1 -> teleport(player!!, star).also { end() } + 2 -> end() } } } @@ -173,4 +164,4 @@ class ShootingStarPlugin : LoginListener, InteractionListener, TickListener, Com return player.inventory.getAmount(STAR_DUST) + player.bank.getAmount(STAR_DUST) } } -} \ No newline at end of file +}