From fee3b02e3dbbc9bf689610994ae91784e5846699 Mon Sep 17 00:00:00 2001 From: bushtail Date: Sat, 14 May 2022 06:14:07 +0000 Subject: [PATCH] Improved handling of buying Dragon Scimitars from Daga in dialogue and declining the Fremennik Trials quest from Brundt --- .../region/apeatoll/marim/DagaDialogue.kt | 4 +- .../ChieftanBrundtDialogue.kt | 62 +++++++++---------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/Server/src/main/kotlin/rs09/game/content/dialogue/region/apeatoll/marim/DagaDialogue.kt b/Server/src/main/kotlin/rs09/game/content/dialogue/region/apeatoll/marim/DagaDialogue.kt index 9f9efd6fc..90e3d726d 100644 --- a/Server/src/main/kotlin/rs09/game/content/dialogue/region/apeatoll/marim/DagaDialogue.kt +++ b/Server/src/main/kotlin/rs09/game/content/dialogue/region/apeatoll/marim/DagaDialogue.kt @@ -42,9 +42,7 @@ class DagaDialogue(player: Player? = null) : DialoguePlugin(player){ 32 -> when (buttonId) { 1 -> if (inInventory(player, Items.COINS_995, 100000)) { - end() - removeItem(player, Item(Items.COINS_995, 100000), Container.INVENTORY) - addItem(player, Items.DRAGON_SCIMITAR_4587, 1) + end().also { return removeItem(player, Item(Items.COINS_995, 100000)) && addItem(player, Items.DRAGON_SCIMITAR_4587, 1) } } else { npcl(FacialExpression.OLD_NORMAL, "Sorry but you don't have enough to buy one, at the moment it costs 100,000 gold coins.").also { stage = END_DIALOGUE } } diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/thefremenniktrials/ChieftanBrundtDialogue.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/thefremenniktrials/ChieftanBrundtDialogue.kt index 84001c1a0..f1c549fa6 100644 --- a/Server/src/main/kotlin/rs09/game/content/quest/members/thefremenniktrials/ChieftanBrundtDialogue.kt +++ b/Server/src/main/kotlin/rs09/game/content/quest/members/thefremenniktrials/ChieftanBrundtDialogue.kt @@ -77,11 +77,11 @@ class ChieftanBrundt(player: Player? = null) : DialoguePlugin(player){ //Pre-Quest 0 -> { options("What is this place?", "Why will no-one talk to me?", "Do you have any quests?", "Nice hat!");stage++} 1 -> when(buttonId){ - 1 -> playerl(FacialExpression.HAPPY,"What is this place?").also { stage ++ } - 2 -> playerl(FacialExpression.ASKING,"Why will no-one talk to me?").also { stage = 5 } - 3 -> player("Do you have any quests?").also {stage = 300} - 4 -> playerl(FacialExpression.HAPPY,"Nice hat!").also { stage = 15 } - } + 1 -> playerl(FacialExpression.HAPPY,"What is this place?").also { stage ++ } + 2 -> playerl(FacialExpression.ASKING,"Why will no-one talk to me?").also { stage = 5 } + 3 -> player("Do you have any quests?").also {stage = 300} + 4 -> playerl(FacialExpression.HAPPY,"Nice hat!").also { stage = 15 } + } 2 -> npcl(FacialExpression.HAPPY,"This place? Why, this is Relleka! Homeland of all Fremennik! I do not recognise your face outerlander; Where do you come from?").also { stage++ } 3 -> playerl(FacialExpression.HAPPY,"Hmmm... I will not press the issue then outerlander. How may my tribe and I help you?").also { stage = 0 } @@ -98,37 +98,37 @@ class ChieftanBrundt(player: Player? = null) : DialoguePlugin(player){ //Do you have any quests? 300 -> {npc("Quests, you say outlander? Well, I would not call it a","quest as such, but if you are brave of heart and strong","of body, perhaps..."); stage++} - 301 -> {npc("No, you would not be interested. Forget I said","anything, outerlander.");stage++} - 302 -> {options("Yes, I am interested.","No, I'm not interested.");stage++} + 301 -> {npc("No, you would not be interested. Forget I said","anything, outerlander."); stage++ } + 302 -> {options("Yes, I am interested.","No, I'm not interested."); stage++ } 303 -> when(buttonId){ - 1 -> {player("Actually, I would be very interested to hear what you","have to offer.");stage = 310} - 2 -> player("No, I'm not interested.").also { stage = END_DIALOGUE } - } + 1 -> {player("Actually, I would be very interested to hear what you","have to offer."); stage = 310 } + 2 -> {player("No, I'm not interested."); stage = END_DIALOGUE } + } - //Yes, I am interested in what you have to say. - 310 -> {npc("You would? These are unusual sentiments to hear from","an outerlander! My suggestion was going to be that if","you crave adventure and battle,"); stage++} - 311 -> {npc("and your heart sings for glory, then perhaps you would","be interested in joining our clan, and becoming a","Fremennik yourself?");stage++} - 312 -> {player("What would that involve exactly?");stage++} - 313 -> {npc("Well, there are two ways to become a member of our","clan and call yourself a Fremennik: be born a","Fremennik, or be voted in by our council of elders.");stage++} - 314 -> {player("Well, I think I've missed the first way, but how can I","get the council of elders to vote to let me join your","clan?");stage++} - 315 -> {npc("Well, that I cannot answer myself. You will need to","speak to each of them and see what they require of you","as proof of your dedication.");stage++} - 316 -> {npc("There are twelve council members around this village;","you will need to gain a majority vote of at least seven","councillors in your favor.");stage++} - 317 -> {npc("So, what say you? Give me the word and I will tell all","of my tribe of your intentions, be they yes or nay.");stage++} - 318 -> {options("I want to become a Fremennik!","I don't want to become a Fremennik.");stage++} - 319 -> when(buttonId){ - 1 -> {player("I think I would enjoy the challenge of becoming an","honorary Fremennik. Where and how do I start?");stage = 320} - 2 -> {player("That sounds too complicated to me.");stage = 322} - } + //Yes, I am interested in what you have to say. + 310 -> {npc("You would? These are unusual sentiments to hear from","an outerlander! My suggestion was going to be that if","you crave adventure and battle,"); stage++} + 311 -> {npc("and your heart sings for glory, then perhaps you would","be interested in joining our clan, and becoming a","Fremennik yourself?");stage++} + 312 -> {player("What would that involve exactly?");stage++} + 313 -> {npc("Well, there are two ways to become a member of our","clan and call yourself a Fremennik: be born a","Fremennik, or be voted in by our council of elders.");stage++} + 314 -> {player("Well, I think I've missed the first way, but how can I","get the council of elders to vote to let me join your","clan?");stage++} + 315 -> {npc("Well, that I cannot answer myself. You will need to","speak to each of them and see what they require of you","as proof of your dedication.");stage++} + 316 -> {npc("There are twelve council members around this village;","you will need to gain a majority vote of at least seven","councillors in your favor.");stage++} + 317 -> {npc("So, what say you? Give me the word and I will tell all","of my tribe of your intentions, be they yes or nay.");stage++} + 318 -> {options("I want to become a Fremennik!","I don't want to become a Fremennik.");stage++} + 319 -> when(buttonId){ + 1 -> {player("I think I would enjoy the challenge of becoming an","honorary Fremennik. Where and how do I start?");stage = 320} + 2 -> {player("That sounds too complicated to me.");stage = 322} + } - //I think I would enjoy the challenge of becoming an honorary fremennik - 320 -> {npc("As I say outerlander, you must find and speak to the","twelve members of the council of elders, and see what","tasks they might set you.");stage++} - 321 -> {npc("If you can gain the support of seven of the twelve, then","you will be accepted as one of us without question.");stage = 1000;player?.questRepository?.getQuest("Fremennik Trials")?.start(player)} + //I think I would enjoy the challenge of becoming an honorary fremennik + 320 -> {npc("As I say outerlander, you must find and speak to the","twelve members of the council of elders, and see what","tasks they might set you.");stage++} + 321 -> {npc("If you can gain the support of seven of the twelve, then","you will be accepted as one of us without question.");stage = 1000;player?.questRepository?.getQuest("Fremennik Trials")?.start(player)} - //That sounds too complicated for me. - 322 -> {npc("Well, that's what I expect from an outerlander.");stage = 1000} + //That sounds too complicated for me. + 322 -> {npc("Well, that's what I expect from an outerlander.");stage = 1000} - //No, I'm not interested - 340 -> TODO("Not implemented yet") + //No, I'm not interested + 340 -> TODO("Not implemented yet") 500 -> npcl(FacialExpression.THINKING,"A reduction on sales taxes? Why, I am the only one in the Fremennik who may authorise such a thing. What does an outerlander want with that?").also { stage++ } 501 -> playerl(FacialExpression.HAPPY,"Actually, it's not for me. I need to get it as part of my trials").also { stage++ }