Refactored how quests are referred to internally
Fixed numerous requirement checks for Rag and Bone Man II, The Lost Tribe, The Tourist Trap, Waterfall Quest and The Fremennik Trials
This commit is contained in:
+10
-9
@@ -8,6 +8,7 @@ import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.NPCs
|
||||
import content.data.Quests
|
||||
|
||||
/**
|
||||
* @author qmqz
|
||||
@@ -18,13 +19,13 @@ class ArchaeologistDialogue(player: Player? = null) : DialoguePlugin(player){
|
||||
|
||||
override fun open(vararg args: Any?): Boolean {
|
||||
npc = args[0] as NPC
|
||||
if (!player.questRepository.hasStarted("Desert Treasure")) {
|
||||
if (player.questRepository.isComplete("The Digsite Quest") &&
|
||||
player.questRepository.isComplete("The Tourist Trap") &&
|
||||
player.questRepository.isComplete("The Temple of Ikov") &&
|
||||
player.questRepository.isComplete("Priest In Peril") &&
|
||||
player.questRepository.isComplete("Waterfall Quest") &&
|
||||
player.questRepository.isComplete("Troll Stronghold") &&
|
||||
if (!player.questRepository.hasStarted(Quests.DESERT_TREASURE)) {
|
||||
if (player.questRepository.isComplete(Quests.THE_DIG_SITE) &&
|
||||
player.questRepository.isComplete(Quests.THE_TOURIST_TRAP) &&
|
||||
player.questRepository.isComplete(Quests.TEMPLE_OF_IKOV) &&
|
||||
player.questRepository.isComplete(Quests.PRIEST_IN_PERIL) &&
|
||||
player.questRepository.isComplete(Quests.WATERFALL_QUEST) &&
|
||||
player.questRepository.isComplete(Quests.TROLL_STRONGHOLD) &&
|
||||
player.skills.getStaticLevel(Skills.SLAYER) >= 10 &&
|
||||
player.skills.getStaticLevel(Skills.FIREMAKING) >= 50 &&
|
||||
player.skills.getStaticLevel(Skills.MAGIC) >= 50 &&
|
||||
@@ -79,8 +80,8 @@ class ArchaeologistDialogue(player: Player? = null) : DialoguePlugin(player){
|
||||
"Come back and let me know what he says, I would hate",
|
||||
"to waste my time excavating anything that isn't worth",
|
||||
"my time as a world famous archaeologist!").also {
|
||||
player.questRepository.getQuest("Desert Treasure").start(player)
|
||||
setQuestStage(player, "Desert Treasure", 1)
|
||||
player.questRepository.getQuest(Quests.DESERT_TREASURE).start(player)
|
||||
setQuestStage(player, Quests.DESERT_TREASURE, 1)
|
||||
stage = 99
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,12 @@ import core.api.removeItem
|
||||
import core.game.interaction.IntType
|
||||
import core.game.interaction.InteractionListener
|
||||
import org.rs09.consts.Items
|
||||
import content.data.Quests
|
||||
|
||||
class DarklightListener : InteractionListener {
|
||||
override fun defineListeners() {
|
||||
onUseWith(IntType.ITEM, Items.BLACK_MUSHROOM_INK_4622, Items.SILVERLIGHT_2402) { player, used, with ->
|
||||
if (!hasRequirement(player, "Shadow of the Storm") || (!player.inventory.contains(Items.BLACK_MUSHROOM_INK_4622, 1) && (!player.inventory.contains(Items.SILVERLIGHT_2402, 1))))
|
||||
if (!hasRequirement(player, Quests.SHADOW_OF_THE_STORM) || (!player.inventory.contains(Items.BLACK_MUSHROOM_INK_4622, 1) && (!player.inventory.contains(Items.SILVERLIGHT_2402, 1))))
|
||||
return@onUseWith false
|
||||
if (removeItem(player, used.id) && removeItem(player, with.id))
|
||||
addItem(player, Items.DARKLIGHT_6746)
|
||||
|
||||
@@ -8,6 +8,7 @@ import core.plugin.Initializable
|
||||
import org.rs09.consts.NPCs
|
||||
import core.game.dialogue.DialogueBuilder
|
||||
import core.game.dialogue.DialogueBuilderFile
|
||||
import content.data.Quests
|
||||
|
||||
@Initializable
|
||||
public final class ClayGolemDialoguePlugin(player: Player? = null) : DialoguePlugin(player) {
|
||||
@@ -29,22 +30,22 @@ public final class ClayGolemDialoguePlugin(player: Player? = null) : DialoguePlu
|
||||
|
||||
class ClayGolemDialogueFile : DialogueBuilderFile() {
|
||||
override fun create(b: DialogueBuilder) {
|
||||
val opt1 = b.onQuestStages("The Golem", 0)
|
||||
val opt1 = b.onQuestStages(Quests.THE_GOLEM, 0)
|
||||
.npc("Damage... severe...", "task... incomplete...")
|
||||
.options()
|
||||
opt1
|
||||
.optionIf("Shall I try to repair you?") { player -> return@optionIf player.questRepository.getQuest("The Golem").hasRequirements(player) }
|
||||
.optionIf("Shall I try to repair you?") { player -> return@optionIf player.questRepository.getQuest(Quests.THE_GOLEM).hasRequirements(player) }
|
||||
.playerl("Shall I try to repair you?")
|
||||
.npcl("Repairs... needed...")
|
||||
.endWith(){ _, player -> if (player.questRepository.getStage("The Golem") < 1 ) { setQuestStage(player, "The Golem", 1) } }
|
||||
.endWith(){ _, player -> if (player.questRepository.getStage(Quests.THE_GOLEM) < 1 ) { setQuestStage(player, Quests.THE_GOLEM, 1) } }
|
||||
opt1
|
||||
.option("I'm not going to find a conversation here!")
|
||||
.playerl("I'm not going to find a conversation here!")
|
||||
.end()
|
||||
b.onQuestStages("The Golem", 1)
|
||||
b.onQuestStages(Quests.THE_GOLEM, 1)
|
||||
.npcl("Repairs... needed...")
|
||||
.end()
|
||||
b.onQuestStages("The Golem", 2)
|
||||
b.onQuestStages(Quests.THE_GOLEM, 2)
|
||||
.npcl("Damage repaired...")
|
||||
.npcl("Thank you. My body and mind are fully healed.")
|
||||
.npcl("Now I must complete my task by defeating the great enemy.")
|
||||
@@ -52,43 +53,43 @@ class ClayGolemDialogueFile : DialogueBuilderFile() {
|
||||
.npcl("A great demon. It broke through from its dimension to attack the city.")
|
||||
.npcl("The golem army was created to fight it. Many were destroyed, but we drove the demon back!")
|
||||
.npcl("The demon is still wounded. You must open the portal so that I can strike the final blow and complete my task.")
|
||||
.endWith() { _, player -> setQuestStage(player, "The Golem", 3) }
|
||||
b.onQuestStages("The Golem", 3)
|
||||
.endWith() { _, player -> setQuestStage(player, Quests.THE_GOLEM, 3) }
|
||||
b.onQuestStages(Quests.THE_GOLEM, 3)
|
||||
.npcl("The demon is still wounded. You must open the portal so that I can strike the final blow and complete my task.")
|
||||
.end()
|
||||
b.onQuestStages("The Golem", 4)
|
||||
b.onQuestStages(Quests.THE_GOLEM, 4)
|
||||
.npcl("My task is incomplete. You must open the portal so I can defeat the great demon.")
|
||||
.playerl("It's ok, the demon is dead!")
|
||||
.npcl("The demon must be defeated...")
|
||||
.playerl("No, you don't understand. I saw the demon's skeleton. It must have died of its wounds.")
|
||||
.npcl("Demon must be defeated! Task incomplete.")
|
||||
.endWith() { _, player -> setQuestStage(player, "The Golem", 5) }
|
||||
b.onQuestStages("The Golem", 5)
|
||||
.endWith() { _, player -> setQuestStage(player, Quests.THE_GOLEM, 5) }
|
||||
b.onQuestStages(Quests.THE_GOLEM, 5)
|
||||
.npcl("Task incomplete.")
|
||||
.playerl("Oh, how am I going to convince you?")
|
||||
.endWith() { _, player -> setQuestStage(player, "The Golem", 6) }
|
||||
b.onQuestStages("The Golem", 6, 7)
|
||||
.endWith() { _, player -> setQuestStage(player, Quests.THE_GOLEM, 6) }
|
||||
b.onQuestStages(Quests.THE_GOLEM, 6, 7)
|
||||
.npcl("My task is incomplete. You must open the portal so I can defeat the great demon.")
|
||||
.playerl("I already told you, he's dead!")
|
||||
.npcl("Task incomplete.")
|
||||
.playerl("Oh, how am I going to convince you?")
|
||||
.endWith() { df, player -> if(player.questRepository.getStage("The Golem") < 7) { setQuestStage(player, "The Golem", 7) } }
|
||||
.endWith() { df, player -> if(player.questRepository.getStage(Quests.THE_GOLEM) < 7) { setQuestStage(player, Quests.THE_GOLEM, 7) } }
|
||||
}
|
||||
}
|
||||
|
||||
class ClayGolemProgramDialogueFile : DialogueBuilderFile() {
|
||||
override fun create(b: DialogueBuilder) {
|
||||
b.onQuestStages("The Golem", 8)
|
||||
b.onQuestStages(Quests.THE_GOLEM, 8)
|
||||
.npc("New instructions...", "Updating program...")
|
||||
.npcl("Task complete!")
|
||||
.npcl("Thank you. Now my mind is at rest.")
|
||||
.endWith() { _, player -> finishQuest(player, "The Golem") }
|
||||
.endWith() { _, player -> finishQuest(player, Quests.THE_GOLEM) }
|
||||
}
|
||||
}
|
||||
|
||||
class CuratorHaigHalenGolemDialogue : DialogueBuilderFile() {
|
||||
override fun create(b: DialogueBuilder) {
|
||||
val opt1 = b.onQuestStages("The Golem", 3)
|
||||
val opt1 = b.onQuestStages(Quests.THE_GOLEM, 3)
|
||||
.npcl("Ah yes, a very impressive artefact. The people of that city were excellent sculptors.")
|
||||
.npcl("It's in the display case upstairs.")
|
||||
.playerl("No, I need to take it away with me.")
|
||||
|
||||
@@ -19,9 +19,10 @@ import core.game.interaction.IntType
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.interaction.InterfaceListener
|
||||
import core.game.world.GameWorld
|
||||
import content.data.Quests
|
||||
|
||||
@Initializable
|
||||
class TheGolemQuest : Quest("The Golem", 70, 69, 1, 437, 0, 1, 10) {
|
||||
class TheGolemQuest : Quest(Quests.THE_GOLEM, 70, 69, 1, 437, 0, 1, 10) {
|
||||
override fun newInstance(`object`: Any?): Quest {
|
||||
return this
|
||||
}
|
||||
@@ -140,7 +141,7 @@ class DisplayCaseListener : InterfaceListener {
|
||||
|
||||
class TheGolemListeners : InteractionListener {
|
||||
fun repairGolem(player: Player): Boolean {
|
||||
if(player.questRepository.getStage("The Golem") == 1) {
|
||||
if(player.questRepository.getStage(Quests.THE_GOLEM) == 1) {
|
||||
var clayUsed = player.getAttribute("the-golem:clay-used", 0)
|
||||
val msg = when(clayUsed) {
|
||||
0 -> "You apply some clay to the golem's wounds. The clay begins to harden in the hot sun."
|
||||
@@ -157,7 +158,7 @@ class TheGolemListeners : InteractionListener {
|
||||
player.setAttribute("/save:the-golem:clay-used", clayUsed)
|
||||
updateVarps(player)
|
||||
if(clayUsed == 4) {
|
||||
setQuestStage(player, "The Golem", 2)
|
||||
setQuestStage(player, Quests.THE_GOLEM, 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,13 +214,13 @@ class TheGolemListeners : InteractionListener {
|
||||
val rotation3 = player.getAttribute("the-golem:statuette-rotation:3", 0)
|
||||
val doorOpen = player.getAttribute("the-golem:door-open", false)
|
||||
var clientStage = 0
|
||||
if(player.questRepository.getStage("The Golem") > 0) {
|
||||
if(player.questRepository.getStage(Quests.THE_GOLEM) > 0) {
|
||||
clientStage = Math.max(clientStage, 1)
|
||||
}
|
||||
if(doorOpen) {
|
||||
clientStage = Math.max(clientStage, 5)
|
||||
}
|
||||
if(player.questRepository.getStage("The Golem") >= 100) {
|
||||
if(player.questRepository.getStage(Quests.THE_GOLEM) >= 100) {
|
||||
clientStage = Math.max(clientStage, 10)
|
||||
}
|
||||
setVarbit(player, 346, clientStage)
|
||||
@@ -346,9 +347,9 @@ class TheGolemListeners : InteractionListener {
|
||||
player.sendMessage("You don't know what that would do.")
|
||||
return true
|
||||
}
|
||||
if(player.questRepository.getStage("The Golem") == 7) {
|
||||
if(player.questRepository.getStage(Quests.THE_GOLEM) == 7) {
|
||||
player.sendMessage("You insert the key and the golem's skull hinges open.")
|
||||
setQuestStage(player, "The Golem", 8)
|
||||
setQuestStage(player, Quests.THE_GOLEM, 8)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -393,7 +394,7 @@ class TheGolemListeners : InteractionListener {
|
||||
if(!player.getAttribute("the-golem:seen-demon", false)) {
|
||||
player.sendMessage("The room is dominated by a colossal horned skeleton!")
|
||||
player.setAttribute("/save:the-golem:seen-demon", true)
|
||||
setQuestStage(player, "The Golem", 4)
|
||||
setQuestStage(player, Quests.THE_GOLEM, 4)
|
||||
}
|
||||
teleport(player, Location.create(3552, 4948, 0))
|
||||
return@on true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import core.game.node.entity.player.Player;
|
||||
@@ -48,7 +49,7 @@ public final class AlShabimDialogue extends DialoguePlugin {
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (quest.getStage(player)) {
|
||||
default:
|
||||
npc("Hello Effendi!");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.interaction.NodeUsageEvent;
|
||||
import core.game.interaction.UseWithHandler;
|
||||
@@ -57,7 +58,7 @@ public final class AnaDialogue extends DialoguePlugin {
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
if ((quest.getStage(player) == 71 || quest.getStage(player) == 72) && args.length > 1) {
|
||||
player.getDialogueInterpreter().sendDialogue("You see a barrel coming to the surface. Before too long you haul it", "onto the side. The barrel seems quite heavy and you hear a muffled", "sound coming from inside.");
|
||||
stage = 400;
|
||||
@@ -277,7 +278,7 @@ public final class AnaDialogue extends DialoguePlugin {
|
||||
@Override
|
||||
public boolean handle(NodeUsageEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
final Quest quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (quest.getStage(player)) {
|
||||
case 61:
|
||||
player.getDialogueInterpreter().open(822, event.getUsedWith(), true);
|
||||
@@ -320,7 +321,7 @@ public final class AnaDialogue extends DialoguePlugin {
|
||||
|
||||
@Override
|
||||
public boolean isHidden(final Player player) {
|
||||
Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
Quest quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
if (quest.getStage(player) > 61) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import core.game.node.entity.player.Player;
|
||||
@@ -46,7 +47,7 @@ public final class BedabinNomadDialogue extends DialoguePlugin {
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (npc.getId()) {
|
||||
case 834:// guard
|
||||
switch (quest.getStage(player)) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import core.game.node.entity.player.Player;
|
||||
@@ -42,7 +43,7 @@ public final class CaptainSiadDialogue extends DialoguePlugin {
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (quest.getStage(player)) {
|
||||
default:
|
||||
player.getPacketDispatch().sendMessage("The captain looks up from his work as you address him.");
|
||||
|
||||
@@ -2,6 +2,7 @@ package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.npc.AbstractNPC;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
@@ -57,7 +58,7 @@ public final class DesertGuardDialogue extends DialoguePlugin {
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (npc.getId()) {
|
||||
case 5001:
|
||||
switch (quest.getStage(player)) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
@@ -48,7 +49,7 @@ public final class IrenaDialogue extends DialoguePlugin {
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
if (quest.getStage(player) == 95 && player.getInventory().containsItem(TouristTrap.ANNA_BARREL)) {
|
||||
npc("Hey, great you've found Ana!");
|
||||
stage = 900;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import core.game.node.entity.player.Player;
|
||||
@@ -47,7 +48,7 @@ public final class MaleSlaveDialogue extends DialoguePlugin {
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (npc.getShownNPC(player).getId()) {
|
||||
case 4985:
|
||||
case 825:
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.Entity;
|
||||
import core.game.node.entity.npc.AbstractNPC;
|
||||
@@ -52,7 +53,7 @@ public final class MercenaryCaptainDialogue extends DialoguePlugin {
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (quest.getStage(player)) {
|
||||
case 11:
|
||||
interpreter.sendDialogue("You approach the Mercenary Captain.");
|
||||
@@ -183,7 +184,7 @@ public final class MercenaryCaptainDialogue extends DialoguePlugin {
|
||||
super.finalizeDeath(killer);
|
||||
if (killer instanceof Player) {
|
||||
final Player player = (Player) killer;
|
||||
final Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
final Quest quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (quest.getStage(player)) {
|
||||
case 0:
|
||||
case 10:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.player.link.quest.Quest;
|
||||
@@ -46,7 +47,7 @@ public final class MercenaryDialogue extends DialoguePlugin {
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (quest.getStage(player)) {
|
||||
default:
|
||||
npc("What are you doing here?");
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.player.link.quest.Quest;
|
||||
@@ -46,7 +47,7 @@ public final class MinecartDriverDialogue extends DialoguePlugin {
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
switch (quest.getStage(player)) {
|
||||
case 90:
|
||||
npc("Quickly, get in the back of the cart.");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.game.interaction.Option;
|
||||
import core.game.node.Node;
|
||||
import core.game.node.entity.Entity;
|
||||
@@ -83,7 +84,7 @@ public final class MiningCampZone extends MapZone implements Plugin<Object> {
|
||||
* @return {@code True} if removed.
|
||||
*/
|
||||
public boolean checkAnna(final Player p) {
|
||||
final Quest quest = p.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
final Quest quest = p.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
if (p.getAttribute("ana-delay", 0) > GameWorld.getTicks()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import core.plugin.Initializable;
|
||||
import core.plugin.ClassScanner;
|
||||
|
||||
import static core.api.ContentAPIKt.*;
|
||||
import content.data.Quests;
|
||||
|
||||
/**
|
||||
* The main type for the tourist trap quest.
|
||||
@@ -23,12 +24,6 @@ import static core.api.ContentAPIKt.*;
|
||||
*/
|
||||
@Initializable
|
||||
public final class TouristTrap extends Quest {
|
||||
|
||||
/**
|
||||
* The name of the quest.
|
||||
*/
|
||||
public static final String NAME = "The Tourist Trap";
|
||||
|
||||
/**
|
||||
* The metal key item.
|
||||
*/
|
||||
@@ -113,7 +108,7 @@ public final class TouristTrap extends Quest {
|
||||
* Constructs a new {@code TouristTrap} {@code Object}.
|
||||
*/
|
||||
public TouristTrap() {
|
||||
super(NAME, 123, 122, 2, 197, 0, 1, 30);
|
||||
super(Quests.THE_TOURIST_TRAP, 123, 122, 2, 197, 0, 1, 30);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package content.region.desert.quest.thetouristrap;
|
||||
|
||||
import content.data.Quests;
|
||||
import core.cache.def.impl.AnimationDefinition;
|
||||
import core.cache.def.impl.NPCDefinition;
|
||||
import core.cache.def.impl.SceneryDefinition;
|
||||
@@ -135,7 +136,7 @@ public final class TouristTrapPlugin extends OptionHandler {
|
||||
|
||||
@Override
|
||||
public boolean handle(final Player player, Node node, String option) {
|
||||
final Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
final Quest quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
final int id = node.getId();
|
||||
switch (option) {
|
||||
case "read":
|
||||
@@ -356,7 +357,7 @@ public final class TouristTrapPlugin extends OptionHandler {
|
||||
player.getInventory().add(TouristTrap.CELL_DOOR_KEY, player);
|
||||
player.getDialogueInterpreter().sendItemMessage(TouristTrap.CELL_DOOR_KEY, "You find a cell door key.");
|
||||
break;
|
||||
} else if (hasItem(player, TouristTrap.WROUGHT_IRON_KEY) && player.getQuestRepository().isComplete(TouristTrap.NAME)) {
|
||||
} else if (hasItem(player, TouristTrap.WROUGHT_IRON_KEY) && player.getQuestRepository().isComplete(Quests.THE_TOURIST_TRAP)) {
|
||||
player.getInventory().add(TouristTrap.WROUGHT_IRON_KEY, player);
|
||||
player.getDialogueInterpreter().sendItemMessage(TouristTrap.WROUGHT_IRON_KEY, "You find the key to the main gate.");
|
||||
break;
|
||||
@@ -633,7 +634,7 @@ public final class TouristTrapPlugin extends OptionHandler {
|
||||
case 516:
|
||||
player.getInventory().remove(TouristTrap.ANNA_BARREL);
|
||||
player.getBank().remove(TouristTrap.ANNA_BARREL);
|
||||
player.getQuestRepository().getQuest(TouristTrap.NAME).setStage(player, 71);
|
||||
player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP).setStage(player, 71);
|
||||
end();
|
||||
break;
|
||||
case 0:
|
||||
@@ -700,7 +701,7 @@ public final class TouristTrapPlugin extends OptionHandler {
|
||||
@Override
|
||||
public boolean handle(final NodeUsageEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
final Quest quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
if (event.getUsedWith().getId() == 18958) {// cart
|
||||
if (quest.getStage(player) == 72) {
|
||||
player.lock(4);
|
||||
@@ -800,7 +801,7 @@ public final class TouristTrapPlugin extends OptionHandler {
|
||||
}
|
||||
break;
|
||||
case 33:
|
||||
player.getQuestRepository().getQuest(TouristTrap.NAME).setStage(player, 70);
|
||||
player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP).setStage(player, 70);
|
||||
player.getInventory().remove(TouristTrap.ANNA_BARREL);
|
||||
player.removeAttribute("ana-delay");
|
||||
AnnaCartCutscene.this.stop(true);
|
||||
@@ -905,7 +906,7 @@ public final class TouristTrapPlugin extends OptionHandler {
|
||||
case 6:
|
||||
player.unlock();
|
||||
player.getInterfaceManager().closeOverlay();
|
||||
player.getQuestRepository().getQuest(TouristTrap.NAME).setStage(player, 95);
|
||||
player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP).setStage(player, 95);
|
||||
player.getInterfaceManager().close();
|
||||
player.getProperties().setTeleportLocation(Location.create(3258, 3029, 0));
|
||||
player.getInventory().add(TouristTrap.ANNA_BARREL);
|
||||
@@ -1303,7 +1304,7 @@ public final class TouristTrapPlugin extends OptionHandler {
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
barrel = (Scenery) args[0];
|
||||
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
if ((quest.getStage(player) == 70 || quest.getStage(player) == 72) && !player.hasItem(TouristTrap.ANNA_BARREL)) {
|
||||
interpreter.sendDialogue("You search the barrels and find Ana.");
|
||||
stage = 400;
|
||||
@@ -1402,7 +1403,7 @@ public final class TouristTrapPlugin extends OptionHandler {
|
||||
@Override
|
||||
public boolean handle(NodeUsageEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
final Quest quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
if (quest.getStage(player) == 54 && player.getInventory().containsItem(TouristTrap.TECHNICAL_PLANS)) {
|
||||
player.getDialogueInterpreter().open("bedabin-anvil");
|
||||
return true;
|
||||
@@ -1436,7 +1437,7 @@ public final class TouristTrapPlugin extends OptionHandler {
|
||||
@Override
|
||||
public boolean handle(NodeUsageEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
|
||||
final Quest quest = player.getQuestRepository().getQuest(Quests.THE_TOURIST_TRAP);
|
||||
if (!event.getUsedWith().getLocation().equals(Location.create(3292, 9423, 0))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user