Varrock Museum Curator Haig Hele no longer gets stuck in endless "please waiting"

Achievement diary no longer gets completed on every repeated interaction with the Varrock Museum Curator
Grammar fixes for shield of arrav quest
This commit is contained in:
Skal Fate
2023-03-01 00:42:17 +00:00
committed by Ryan
parent f00fd246b9
commit 09f553d998
4 changed files with 51 additions and 41 deletions
@@ -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,12 +38,10 @@ 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;
}
@@ -54,14 +50,18 @@ public final class CuratorHaigHalenDialogue extends DialoguePlugin {
public boolean handle(int interfaceId, int buttonId) {
switch(stage) {
case 0:
showTopics(
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
player.getQuestRepository().getQuest("The Golem").getStage(player) == 3
, false)
);
if(fallthrough) { stage = 1; handle(interfaceId, buttonId); }
break;
case 1:
end();
break;
}
return true;
@@ -94,7 +94,7 @@ public class ShieldofArrav extends Quest {
line(player, "<str>I read about a valuable shield stolen long ago by a gang of", 4+ 7);
line(player, "<str>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, "<str>According to him there is a criminal organisation known as", 9+ 7);
line(player, "<str>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, "<str>Crossbows from the Phoenix Gang's weapons store, and", 9+ 7);
line(player, "<str>Katrine welcomes me as a Black Arm Gang member.", 10+ 7);
line(player, "<str>With the help of my friend in the rival gang, I was able to", 12+ 7);
line(player, "<str>retreive both parts of the fabled Shield of Arrav and", 13+ 7);
line(player, "<str>retrieve both parts of the fabled Shield of Arrav and", 13+ 7);
line(player, "<str>return it to the Museum of Varrock. In Recognition of my", 14+ 7);
line(player, "<str>efforts, King Roald paid me the reward set by his", 15+ 7);
line(player, "<str>ancestor.", 16+ 7);
@@ -188,7 +188,7 @@ public class ShieldofArrav extends Quest {
line(player, "<str>I killed Jonny the Beard and was welcomed into the Phoenix", 7+ 7);
line(player, "<str>Gang. Straven gave me a key to the weapons room.", 8+ 7);
line(player, "<str>With the help of my friend in the rival gang, I was able to", 10+ 7);
line(player, "<str>retreive both parts of the fabled Shield of Arrav and", 11+ 7);
line(player, "<str>retrieve both parts of the fabled Shield of Arrav and", 11+ 7);
line(player, "<str>return it to the Museum of Varrock. In Recognition of my", 12+ 7);
line(player, "<str>efforts, King Roald paid me the reward set by his", 13+ 7);
line(player, "<str>ancestor.", 14+ 7);
@@ -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<String>()
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())
}
}
@@ -362,7 +362,7 @@ public abstract class DialoguePlugin implements Plugin<Player> {
return player(expr, splitLines(msg, 54));
}
public void showTopics(Topic<?>... topics) {
public boolean showTopics(Topic<?>... topics) {
ArrayList<String> validTopics = new ArrayList<>();
for(Topic<?> topic : topics)
{
@@ -370,21 +370,25 @@ public abstract class DialoguePlugin implements Plugin<Player> {
interpreter.activeTopics.add(topic);
validTopics.add(topic.getText());
}
if (validTopics.size() == 1) {
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) {
}
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;
}
}
}