From f9aea1849703480bb3c9d648e49fe89724540602 Mon Sep 17 00:00:00 2001 From: bushtail Date: Tue, 12 Apr 2022 03:02:55 +0000 Subject: [PATCH] Fix Tribal Totem bug where you could repeatedly claim quest rewards --- .../members/tribaltotem/KangaiMauDialogue.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/tribaltotem/KangaiMauDialogue.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/tribaltotem/KangaiMauDialogue.kt index 1f6da5a70..51e1e2e7b 100644 --- a/Server/src/main/kotlin/rs09/game/content/quest/members/tribaltotem/KangaiMauDialogue.kt +++ b/Server/src/main/kotlin/rs09/game/content/quest/members/tribaltotem/KangaiMauDialogue.kt @@ -1,5 +1,6 @@ package rs09.game.content.quest.members.tribaltotem +import api.isQuestComplete import api.removeItem import core.game.content.dialogue.DialoguePlugin import core.game.content.dialogue.FacialExpression @@ -14,6 +15,9 @@ class KangaiMauDialogue(player: Player? = null) : DialoguePlugin(player) { if(!player.questRepository.hasStarted("Tribal Totem")){ npcl(FacialExpression.HAPPY,"Hello. I'm Kangai Mau of the Rantuki Tribe.") stage = 0 + } else if(isQuestComplete(player, "Tribal Totem")) { + npcl(FacialExpression.HAPPY, "Many greetings esteemed thief.") + stage = 40 } else if(player.inventory.containsAtLeastOneItem(Items.TOTEM_1857)){ npcl(FacialExpression.ASKING,"Have you got our totem back?") @@ -62,11 +66,16 @@ class KangaiMauDialogue(player: Player? = null) : DialoguePlugin(player) { 35 -> playerl(FacialExpression.HAPPY,"Yes I have.").also { stage++ } 36 -> npcl(FacialExpression.HAPPY,"You have??? Many thanks brave adventurer! Here, have some freshly cooked Karamjan fish, caught specially by my tribe.").also { stage++ } 37 -> sendDialogue("You hand over the totem").also { - removeItem(player,Items.TOTEM_1857) - player.questRepository.getQuest("Tribal Totem").finish(player) - stage = 1000 + if(!isQuestComplete(player, "Tribal Totem") && removeItem(player, Items.TOTEM_1857)) { + player.questRepository.getQuest("Tribal Totem").finish(player) + stage = 1000 + } else { + stage = 1000 + } } + 40 -> player(FacialExpression.NEUTRAL, "Hey.").also { stage = 1000 } + 1000 -> end() } return true