diff --git a/Server/src/main/content/region/misthalin/varrock/quest/shieldofarrav/CuratorHaigHalenDialogue.java b/Server/src/main/content/region/misthalin/varrock/quest/shieldofarrav/CuratorHaigHalenDialogue.java index 639679253..aa8676778 100644 --- a/Server/src/main/content/region/misthalin/varrock/quest/shieldofarrav/CuratorHaigHalenDialogue.java +++ b/Server/src/main/content/region/misthalin/varrock/quest/shieldofarrav/CuratorHaigHalenDialogue.java @@ -10,8 +10,6 @@ import content.region.desert.quest.thegolem.CuratorHaigHalenGolemDialogue; /** * Represents the curator haig halen dialogue. - * @author 'Vexia - * @version 1.0 */ public final class CuratorHaigHalenDialogue extends DialoguePlugin { @@ -40,29 +38,31 @@ public final class CuratorHaigHalenDialogue extends DialoguePlugin { @Override public boolean open(Object... args) { npc = (NPC) args[0]; - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Welcome to the museum of Varrock."); - - if (player.getQuestRepository().getPoints() >= 50) { + interpreter.sendDialogues(npc, FacialExpression.HAPPY, "Welcome to the museum of Varrock."); + if (player.getQuestRepository().getPoints() >= 50 && !player.getAchievementDiaryManager().hasCompletedTask(DiaryType.VARROCK, 0 ,12)) { player.getAchievementDiaryManager().finishTask(player, DiaryType.VARROCK, 0, 12); } - stage = 0; return true; } @Override public boolean handle(int interfaceId, int buttonId) { - switch(stage) { - case 0: - showTopics( - new IfTopic("I have the Shield of Arrav", new CuratorHaigHalenSOADialogue(), - player.getQuestRepository().getQuest("Shield of Arrav").getStage(player) == 70 - , false), - new IfTopic("I'm looking for a statuette recovered from the city of Uzer.", new CuratorHaigHalenGolemDialogue(), - player.getQuestRepository().getQuest("The Golem").getStage(player) >= 3 - , false) - ); - break; + switch(stage) { + case 0: + boolean fallthrough = showTopics( + new IfTopic("I have the Shield of Arrav", new CuratorHaigHalenSOADialogue(), + player.getQuestRepository().getQuest("Shield of Arrav").getStage(player) == 70 + , false), + new IfTopic("I'm looking for a statuette recovered from the city of Uzer.", new CuratorHaigHalenGolemDialogue(), + player.getQuestRepository().getQuest("The Golem").getStage(player) == 3 + , false) + ); + if(fallthrough) { stage = 1; handle(interfaceId, buttonId); } + break; + case 1: + end(); + break; } return true; } diff --git a/Server/src/main/content/region/misthalin/varrock/quest/shieldofarrav/ShieldofArrav.java b/Server/src/main/content/region/misthalin/varrock/quest/shieldofarrav/ShieldofArrav.java index 46fce160e..e43adf660 100644 --- a/Server/src/main/content/region/misthalin/varrock/quest/shieldofarrav/ShieldofArrav.java +++ b/Server/src/main/content/region/misthalin/varrock/quest/shieldofarrav/ShieldofArrav.java @@ -94,7 +94,7 @@ public class ShieldofArrav extends Quest { line(player, "I read about a valuable shield stolen long ago by a gang of", 4+ 7); line(player, "thieves with an outstanding reward upon it.", 5+ 7); line(player, BLUE + "Baraek told me that the " + RED + "'Phoenix Gang' " + BLUE + "have a hideout in", 6+ 7); - line(player, BLUE + "the " + RED + "south-eastern part of Varrock" + BLUE + ", disgusing themselves", 7+ 7); + line(player, BLUE + "the " + RED + "south-eastern part of Varrock" + BLUE + ", disguising themselves", 7+ 7); line(player, BLUE + "as the " + RED + "VTAM Corporation" + BLUE + ". I should find them and join.", 8+ 7); break; case 50: @@ -124,14 +124,14 @@ public class ShieldofArrav extends Quest { line(player, "According to him there is a criminal organisation known as", 9+ 7); line(player, "the " + RED + "'Black Arm Gang'" + BLUE + "down the alley near to him.", 10+ 7); line(player, BLUE + "If I want to join the " + RED + "Phoenix Gang " + BLUE + "I need to kill" + RED + " Jonny The", 11+ 7); - line(player, RED + "Beard " + BLUE + "in the " + RED + "Blue Moon Inn " + BLUE + "and retreive his " + RED + "report.", 12+ 7); + line(player, RED + "Beard " + BLUE + "in the " + RED + "Blue Moon Inn " + BLUE + "and retrieve his " + RED + "report.", 12+ 7); line(player, RED + "Katrine " + BLUE + "said if I wanted to join the " + RED + "Black Arm Gang," + BLUE + " I'd", 13+ 7); line(player, BLUE + "have to steal " + RED + "two Phoenix crossbows " + BLUE + "from the rival gang.", 14+ 7); line(player, BLUE + "Maybe " + RED + "Charlie the tramp " + BLUE + "can give me some ideas about", 15+ 7); line(player, BLUE + "how to do this.", 16+ 7); } else if (isPhoenixMission(player)) { line(player, BLUE + "If I want to join the " + RED + "Phoenix Gang " + BLUE + "I need to kill" + RED + " Jonny The", 10+ 7); - line(player, RED + "Beard " + BLUE + "in the " + RED + "Blue Moon Inn " + BLUE + "and retreive his " + RED + "report.", 11+ 7); + line(player, RED + "Beard " + BLUE + "in the " + RED + "Blue Moon Inn " + BLUE + "and retrieve his " + RED + "report.", 11+ 7); line(player, BLUE + "Alternatively, if I want to join the " + RED + "Blackarm gang " + BLUE + "I should", 12+ 7); line(player, BLUE + "speak to their " + RED + "leader, Katrine, " + BLUE + "about joining.", 13+ 7); } else if (isBlackArmMission(player)) { @@ -178,7 +178,7 @@ public class ShieldofArrav extends Quest { line(player, "Crossbows from the Phoenix Gang's weapons store, and", 9+ 7); line(player, "Katrine welcomes me as a Black Arm Gang member.", 10+ 7); line(player, "With the help of my friend in the rival gang, I was able to", 12+ 7); - line(player, "retreive both parts of the fabled Shield of Arrav and", 13+ 7); + line(player, "retrieve both parts of the fabled Shield of Arrav and", 13+ 7); line(player, "return it to the Museum of Varrock. In Recognition of my", 14+ 7); line(player, "efforts, King Roald paid me the reward set by his", 15+ 7); line(player, "ancestor.", 16+ 7); @@ -188,7 +188,7 @@ public class ShieldofArrav extends Quest { line(player, "I killed Jonny the Beard and was welcomed into the Phoenix", 7+ 7); line(player, "Gang. Straven gave me a key to the weapons room.", 8+ 7); line(player, "With the help of my friend in the rival gang, I was able to", 10+ 7); - line(player, "retreive both parts of the fabled Shield of Arrav and", 11+ 7); + line(player, "retrieve both parts of the fabled Shield of Arrav and", 11+ 7); line(player, "return it to the Museum of Varrock. In Recognition of my", 12+ 7); line(player, "efforts, King Roald paid me the reward set by his", 13+ 7); line(player, "ancestor.", 14+ 7); diff --git a/Server/src/main/core/game/dialogue/DialogueFile.kt b/Server/src/main/core/game/dialogue/DialogueFile.kt index 7fcf7ccd2..37d3cea88 100644 --- a/Server/src/main/core/game/dialogue/DialogueFile.kt +++ b/Server/src/main/core/game/dialogue/DialogueFile.kt @@ -130,13 +130,16 @@ abstract class DialogueFile { player?.dialogueInterpreter?.sendDialogue(*messages) } - fun showTopics(vararg topics: Topic<*>) { + fun showTopics(vararg topics: Topic<*>): Boolean { val validTopics = ArrayList() topics.filter { if(it is IfTopic) it.showCondition else true }.forEach { topic -> interpreter!!.activeTopics.add(topic) validTopics.add(topic.text) } - if (validTopics.size == 1) { + if(validTopics.size == 0) { + return true + } + else if (validTopics.size == 1) { val topic = topics[0] if(topic.toStage is DialogueFile) { val topicFile = topic.toStage as DialogueFile @@ -146,7 +149,10 @@ abstract class DialogueFile { } player(topic.text) interpreter!!.activeTopics.clear() + return false + } + else { options(*validTopics.toTypedArray()) + return false } - else options(*validTopics.toTypedArray()) } } diff --git a/Server/src/main/core/game/dialogue/DialoguePlugin.java b/Server/src/main/core/game/dialogue/DialoguePlugin.java index 26fb26129..04710cfb2 100644 --- a/Server/src/main/core/game/dialogue/DialoguePlugin.java +++ b/Server/src/main/core/game/dialogue/DialoguePlugin.java @@ -362,7 +362,7 @@ public abstract class DialoguePlugin implements Plugin { return player(expr, splitLines(msg, 54)); } - public void showTopics(Topic... topics) { + public boolean showTopics(Topic... topics) { ArrayList validTopics = new ArrayList<>(); for(Topic topic : topics) { @@ -370,21 +370,25 @@ public abstract class DialoguePlugin implements Plugin { interpreter.activeTopics.add(topic); validTopics.add(topic.getText()); } - - if (validTopics.size() == 1) { - Topic topic = interpreter.activeTopics.get(0); - - if(topic.getToStage() instanceof DialogueFile) { - DialogueFile topicFile = (DialogueFile) topic.getToStage(); - interpreter.getDialogue().loadFile(topicFile); - } else if(topic.getToStage() instanceof Integer) { - stage = (Integer) topic.getToStage(); - } - - player(topic.getText()); - interpreter.activeTopics.clear(); + if(validTopics.size() == 0) { + return true; + } + else if (validTopics.size() == 1) { + Topic topic = interpreter.activeTopics.get(0); + if(topic.getToStage() instanceof DialogueFile) { + DialogueFile topicFile = (DialogueFile) topic.getToStage(); + interpreter.getDialogue().loadFile(topicFile); + } + else if(topic.getToStage() instanceof Integer) { + stage = (Integer) topic.getToStage(); + } + player(topic.getText()); + interpreter.activeTopics.clear(); + return false; + } + else { + options(validTopics.toArray(new String[0])); + return false; } - - options(validTopics.toArray(new String[0])); } }