Repository reorganisation

Unified kotlin and java into just src/main
Unified the rs09 and core packages
Took all content out of the core package, and placed it into the new content package
Reorganised all source code relating to content to be easier to find and explore
This commit is contained in:
Ceikry
2023-01-26 13:59:28 +00:00
committed by Ryan
parent e4b799c44a
commit a100affda2
3156 changed files with 24205 additions and 30585 deletions
@@ -0,0 +1,102 @@
package rs09.game.content.dialogue.region.lletya
import core.api.setQuestStage
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.node.entity.skill.Skills
import core.plugin.Initializable
import org.rs09.consts.NPCs
/**
* @author qmqz
*/
@Initializable
class ArchaeologistDialogue(player: Player? = null) : core.game.dialogue.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") &&
player.skills.getStaticLevel(Skills.SLAYER) >= 10 &&
player.skills.getStaticLevel(Skills.FIREMAKING) >= 50 &&
player.skills.getStaticLevel(Skills.MAGIC) >= 50 &&
player.skills.getStaticLevel(Skills.THIEVING) >= 53 ) {
player(core.game.dialogue.FacialExpression.FRIENDLY,"Hello there.").also { stage = 0 }
} else {
player(core.game.dialogue.FacialExpression.FRIENDLY,"Hello there.").also { stage = 999 }
}
} else {
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when(stage){
999 -> sendDialogue("He seems to be lost in his own thoughts...").also { stage = 99 }
0 -> npc(core.game.dialogue.FacialExpression.FRIENDLY, "Howdy stranger. What brings you out to these parts?").also { stage++ }
1 -> options("What are you doing here?", "Do you have any quests?", "Who are you?", "Nothing really.").also { stage++ }
2 -> when (buttonId) {
//1 -> todo
2 -> player(core.game.dialogue.FacialExpression.FRIENDLY, "Do you have any quests?", "Call it a hunch, but you look like the type of man who", "might...").also { stage = 20 }
//3 -> todo
//4 -> todo
}
20 -> npc(core.game.dialogue.FacialExpression.HALF_THINKING, "Well, it's funny you should say that.",
"I'm not sure if I would really call it a quest as such,",
"but I found this ancient stone tablet in one of my",
"excavations, and it would really help me out if you").also { stage++ }
21 -> npc(core.game.dialogue.FacialExpression.FRIENDLY, "could go and take it back to the digsite for me and get",
"it examined.").also { stage++ }
22 -> npc(core.game.dialogue.FacialExpression.NEUTRAL, "It's very old, and I don't recognise and of the",
"inscriptions on it.").also { stage++ }
23 -> options("Yes, I'll help you.", "No thanks, I don't want to help.").also { stage++ }
24 -> when(buttonId) {
1 -> player(core.game.dialogue.FacialExpression.FRIENDLY, "Sure, I was heading that way anyways.",
"Any particular person at the digsite you want me to",
"talk to?").also { stage = 30 }
// 2 -> todo
}
30 -> npc(core.game.dialogue.FacialExpression.NEUTRAL, "His name's Terry Balando. Give it to nobody but him.",
"I'm sorry, I can't entrust you with the actual tablet I",
"found, but it is far too valuable to give away, but I took",
"these etchings - they should be enough for him to make").also { stage++ }
31 -> npc(core.game.dialogue.FacialExpression.NEUTRAL, "a preliminary translation on.",
"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)
stage = 99
}
99 -> end()
}
return true
}
override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin {
return ArchaeologistDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.ARCHAEOLOGIST_1918)
}
}
@@ -0,0 +1,103 @@
//package rs09.game.content.quest.members.deserttreasure
//import core.game.node.entity.player.Player
//import core.game.node.entity.player.link.quest.Quest
//import core.game.node.entity.skill.Skills
//import core.plugin.Initializable
/**
* @author qmqz
*/
//@Initializable
//class DesertTreasure : Quest("Desert Treasure",15, 44, 3, 440, 0, 1, 15){
//override fun drawJournal(player: Player?, stage: Int) {
// super.drawJournal(player, stage)
// var line = 12
//val stage = player?.questRepository?.getStage("Desert Treasure")!!
//when (stage) {
// 0 -> {
// line(player,"I can start this quest by speaking to !!The Archaeologist??", line++)
// line(player,"who is exploring the !!Bedabin Camp?? South West of the", line++)
// line(player,"!!Shantay Pass.??", line++)
// line(player,"To complete this quest I will need:", line++)
// if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
// line(player,"Level 10 Slayer", line++)
// } else {
// line(player,"---Level 10 Slayer/--", line++)
// }
// if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
// line(player,"Level 50 Firemaking", line++)
// }
// if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
// line(player,"Level 50 Magic", line++)
// }
// if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
// line(player,"Level 53 Thieving", line++)
// }
// line(player,"I must have completed the following quests:", line++)
// if (player.questRepository.isComplete("The Digsite Quest")) {
// line(player,"---!!The digsite Quest??/--", line++)
// } else {
// line(player,"!!The digsite Quest??", line++)
// }
// if (player.questRepository.isComplete("The Tourist Trap")) {
// line(player,"---!!The Tourist Trap??/--", line++)
// } else {
// line(player,"!!The Tourist Trap??", line++)
// }
// if (player.questRepository.isComplete("The Temple of Ikov")) {
// line(player,"---!!The Temple of Ikov??/--", line++)
// } else {
// line(player,"!!The Temple of Ikov??", line++)
// }
// if (player.questRepository.isComplete("Priest In Peril")) {
// line(player,"---!!Priest In Peril??/--", line++)
// } else {
// line(player,"!!Priest In Peril??", line++)
// }
// if (player.questRepository.isComplete("Waterfall Quest")) {
// line(player,"---!!Waterfall Quest??/--", line++)
// } else {
// line(player,"!!Waterfall Quest??", line++)
// }
// if (player.questRepository.isComplete("Troll Stronghold")) {
// line(player,"---!!Troll Stronghold??/--", line++)
// } else {
// line(player,"!!Troll Stronghold??", line++)
// }
// line(player,"", line++)
//}
// }
//}
// override fun finish(player: Player) {
// var ln = 10
// super.finish(player)
// player.packetDispatch.sendString("You have completed Desert Treasure!", 277, 4)
// player.packetDispatch.sendItemZoomOnInterface(1891, 240, 277, 5)
//
// drawReward(player,"3 Quest Points", ln++)
// drawReward(player,"20,000 Magic XP", ln++)
// drawReward(player,"Ability to use", ln++)
// drawReward(player,"Ancient Magicks", ln)
// player.skills.addExperience(Skills.MAGIC, 20000.0)
// }
// override fun newInstance(`object`: Any?): Quest {
// return this
// }
//}
@@ -0,0 +1,49 @@
package content.region.desert.quest.icthlarinslittlehelper;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.player.Player;
/**
* @author Ethan Kyle Millard <skype:pumpklins>
* @since Tue, October 09, 2018 @ 9:02 PM
*/
public class WandererDialogue extends DialoguePlugin {
public WandererDialogue() {
}
public WandererDialogue(Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new WandererDialogue(player);
}
@Override
public boolean open(Object... args) {
player ("Good day, wanderer.");
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage){
case 0:
npc ("Hello to you too adventurer.");
next();
break;
case 1:
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] {};
}
}
@@ -0,0 +1,438 @@
package content.region.desert.quest.thegolem
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.book.Book
import core.game.dialogue.book.BookLine
import core.game.dialogue.book.Page
import core.game.dialogue.book.PageSet
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile
@Initializable
public final class ClayGolemDialoguePlugin(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) {
override fun newInstance(player: Player): core.game.dialogue.DialoguePlugin {
return ClayGolemDialoguePlugin(player)
}
override fun open(vararg objects: Any?): Boolean {
npc = objects[0] as NPC
player.dialogueInterpreter.open(ClayGolemDialogueFile(), npc)
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
return false
}
override fun getIds(): IntArray {
return intArrayOf(1907, NPCs.BROKEN_CLAY_GOLEM_1908, NPCs.DAMAGED_CLAY_GOLEM_1909, NPCs.CLAY_GOLEM_1910)
}
}
class ClayGolemDialogueFile : core.game.dialogue.DialogueBuilderFile() {
override fun create(b: core.game.dialogue.DialogueBuilder) {
val opt1 = b.onQuestStages("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) }
.playerl("Shall I try to repair you?")
.npcl("Repairs... needed...")
.endWith(){ player -> if (player.questRepository.getStage("The Golem") < 1 ) { setQuestStage(player, "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)
.npcl("Repairs... needed...")
.end()
b.onQuestStages("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.")
.playerl("What enemy?")
.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)
.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)
.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)
.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)
.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() { player -> if(player.questRepository.getStage("The Golem") < 7) { setQuestStage(player, "The Golem", 7) } }
}
}
class ClayGolemProgramDialogueFile : core.game.dialogue.DialogueBuilderFile() {
override fun create(b: core.game.dialogue.DialogueBuilder) {
b.onQuestStages("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") }
}
}
class CuratorHaigHalenGolemDialogue : core.game.dialogue.DialogueBuilderFile() {
override fun create(b: core.game.dialogue.DialogueBuilder) {
val opt1 = b.onQuestStages("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.")
.npcl("What do you want it for?")
.options()
opt1
.option("I want to open a portal to the lair of an elder-demon.")
.playerl("I want to open a portal to the lair of an elder-demon.")
.npcl("Good heavens! I'd never let you do such a dangerous thing.")
.end()
opt1
.option("Well, I, er, just want it.")
.playerl("Well, I, er, just want it.")
.end()
}
}
val LETTER_LINES = arrayOf(
"",
"",
"Dearest Varmen,",
"I hope this finds you well. Here are the books you asked for",
"There has been an exciting development closer to home --",
"another city from the same period has been discovered east",
"of Varrock, and we are starting a huge excavation project",
"here. I don't know if the museum will be able to finance your",
"expedition as well as this one, so I fear your current trip will be",
"the last.",
"May Saradomin grant you a safe journey home",
"Your loving Elissa.",
)
val VARMEN_NOTES = arrayOf(
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("Septober 19:", 55),
core.game.dialogue.book.BookLine("The nomads were right:", 56),
core.game.dialogue.book.BookLine("there is a city here,", 57),
core.game.dialogue.book.BookLine("probably buried for", 58),
core.game.dialogue.book.BookLine("millenia and revealed by", 59),
core.game.dialogue.book.BookLine("the random motions of", 60),
core.game.dialogue.book.BookLine("the sand. The", 61),
core.game.dialogue.book.BookLine("architecture is impressive", 62),
core.game.dialogue.book.BookLine("even in ruin, and must", 63),
core.game.dialogue.book.BookLine("once have been amazing.", 64),
core.game.dialogue.book.BookLine("One puzzling factor is the", 65),
),
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("pottery -- there are", 66),
core.game.dialogue.book.BookLine("fragments all over the", 67),
core.game.dialogue.book.BookLine("ruins, surely too much", 68),
core.game.dialogue.book.BookLine("for a city even of this", 69),
core.game.dialogue.book.BookLine("size. We have set up", 70),
core.game.dialogue.book.BookLine("camp and will do a proper", 71),
core.game.dialogue.book.BookLine("survey tomorrow.", 72),
)
),
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("Septober 20:", 55),
core.game.dialogue.book.BookLine("The meaning of the", 56),
core.game.dialogue.book.BookLine("pottery was explained", 57),
core.game.dialogue.book.BookLine("today in a most", 58),
core.game.dialogue.book.BookLine("surprising manner. We", 59),
core.game.dialogue.book.BookLine("found a mostly-intact clay", 60),
core.game.dialogue.book.BookLine("statue buried up to its", 61),
core.game.dialogue.book.BookLine("waist in sand, and as", 62),
core.game.dialogue.book.BookLine("soon as we dug it out, it", 63),
core.game.dialogue.book.BookLine("started to walk around! It", 64),
core.game.dialogue.book.BookLine("is a clay golem, built by", 65),
),
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("the city's inhabitants and", 66),
core.game.dialogue.book.BookLine("dormant all this time. Its", 67),
core.game.dialogue.book.BookLine("head is badly damaged", 68),
core.game.dialogue.book.BookLine("and it is", 69),
core.game.dialogue.book.BookLine("uncommunicative, but its", 70),
core.game.dialogue.book.BookLine("existence tells us that the", 71),
core.game.dialogue.book.BookLine("city's inhabitants were", 72),
core.game.dialogue.book.BookLine("expert magical craftsmen.", 73),
core.game.dialogue.book.BookLine("The huge kilns in some", 74),
core.game.dialogue.book.BookLine("of the buildings indicate", 75),
core.game.dialogue.book.BookLine("that at some point before", 76),
)
),
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("its destruction the whole", 55),
core.game.dialogue.book.BookLine("city was converted to the", 56),
core.game.dialogue.book.BookLine("manufacture of these", 57),
core.game.dialogue.book.BookLine("golems.", 58),
core.game.dialogue.book.BookLine("", 59),
core.game.dialogue.book.BookLine("We have also examined", 60),
core.game.dialogue.book.BookLine("the carvings on the large", 61),
core.game.dialogue.book.BookLine("building in the centre.", 62),
core.game.dialogue.book.BookLine("These are symbols", 63),
core.game.dialogue.book.BookLine("depicting several of the", 64),
core.game.dialogue.book.BookLine("ancient gods, including", 65),
),
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("Saradomin, Zamorak, and", 66),
core.game.dialogue.book.BookLine("Armadyl, but there is", 67),
core.game.dialogue.book.BookLine("another prominent symbol", 68),
core.game.dialogue.book.BookLine("that I cannot identify. As", 69),
core.game.dialogue.book.BookLine("it seems we will need to", 70),
core.game.dialogue.book.BookLine("be here for longer than I", 71),
core.game.dialogue.book.BookLine("had thought, I have sent", 72),
core.game.dialogue.book.BookLine("to Elissa for books on", 73),
core.game.dialogue.book.BookLine("golems and religious", 74),
core.game.dialogue.book.BookLine("symbols.", 75),
)
),
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("Septober 21:", 55),
core.game.dialogue.book.BookLine("As we examine the ruins", 56),
core.game.dialogue.book.BookLine("one thing becomes", 57),
core.game.dialogue.book.BookLine("increasingly clear: most", 58),
core.game.dialogue.book.BookLine("of the damage was not", 59),
core.game.dialogue.book.BookLine("due to weathering. The", 60),
core.game.dialogue.book.BookLine("buildings were destroyed", 61),
core.game.dialogue.book.BookLine("by force, as if torn down", 62),
core.game.dialogue.book.BookLine("by giant hands.", 63),
),
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("Septober 22:", 66),
core.game.dialogue.book.BookLine("A breakthrough! We have", 67),
core.game.dialogue.book.BookLine("found the staircase into", 68),
core.game.dialogue.book.BookLine("the lower levels of the", 69),
core.game.dialogue.book.BookLine("temple. This part has", 70),
core.game.dialogue.book.BookLine("been untouched by the", 71),
core.game.dialogue.book.BookLine("elements, and the", 72),
core.game.dialogue.book.BookLine("carvings here are more", 73),
core.game.dialogue.book.BookLine("intact, especially four", 74),
core.game.dialogue.book.BookLine("beautiful statuettes in", 75),
core.game.dialogue.book.BookLine("alcoves framing the large", 76),
)
),
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("door. I have removed one", 55),
core.game.dialogue.book.BookLine("of them. The door will", 56),
core.game.dialogue.book.BookLine("not open. I am glad I", 57),
core.game.dialogue.book.BookLine("sent for a book on", 58),
core.game.dialogue.book.BookLine("symbols, as the", 59),
core.game.dialogue.book.BookLine("unidentified symbol is", 60),
core.game.dialogue.book.BookLine("even more prominent", 61),
core.game.dialogue.book.BookLine("here, especially on the", 62),
core.game.dialogue.book.BookLine("door.", 63),
),
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("Septober 23:", 66),
core.game.dialogue.book.BookLine("Our messenger returned", 67),
core.game.dialogue.book.BookLine("with the books I asked for", 68),
core.game.dialogue.book.BookLine("and a letter from Elissa.", 69),
core.game.dialogue.book.BookLine("It is unfortunate that the", 70),
core.game.dialogue.book.BookLine("museum will not be able", 71),
core.game.dialogue.book.BookLine("to finance a full-scale", 72),
core.game.dialogue.book.BookLine("excavation here as well as", 73),
core.game.dialogue.book.BookLine("the one closer to Varrock,", 74),
core.game.dialogue.book.BookLine("although I am of course", 75),
core.game.dialogue.book.BookLine("pleased that the other city", 76),
)
),
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("has been uncovered. But", 55),
core.game.dialogue.book.BookLine("with the books I am able", 56),
core.game.dialogue.book.BookLine("to piece together more of", 57),
core.game.dialogue.book.BookLine("the story of this city.", 58),
core.game.dialogue.book.BookLine("", 59),
core.game.dialogue.book.BookLine("The unidentified symbol", 60),
core.game.dialogue.book.BookLine("in the ruins is that of the", 61),
core.game.dialogue.book.BookLine("demon Thammaron, who", 62),
core.game.dialogue.book.BookLine("was Zamorak's chief", 63),
core.game.dialogue.book.BookLine("lieutenant during the", 64),
core.game.dialogue.book.BookLine("godwars of the Third", 65),
),
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("Age. With that", 66),
core.game.dialogue.book.BookLine("information I can say", 67),
core.game.dialogue.book.BookLine("with confidence that these", 68),
core.game.dialogue.book.BookLine("are the ruins of Uzer, an", 69),
core.game.dialogue.book.BookLine("advanced human", 70),
core.game.dialogue.book.BookLine("civilization said to have", 71),
core.game.dialogue.book.BookLine("been destroyed towards", 72),
core.game.dialogue.book.BookLine("the end of the Third Age", 73),
core.game.dialogue.book.BookLine("(roughly 2,500 years", 74),
core.game.dialogue.book.BookLine("ago). It was allied with", 75),
core.game.dialogue.book.BookLine("Saradomin and enjoyed", 76),
)
),
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("his protection, as well as", 55),
core.game.dialogue.book.BookLine("that of its own mages and", 56),
core.game.dialogue.book.BookLine("warriors. Thammaron was", 57),
core.game.dialogue.book.BookLine("able to open a portal from", 58),
core.game.dialogue.book.BookLine("his own domain straight", 59),
core.game.dialogue.book.BookLine("into the heart of the city,", 60),
core.game.dialogue.book.BookLine("bypassing its defences.", 61),
core.game.dialogue.book.BookLine("With Saradomin's help the", 62),
core.game.dialogue.book.BookLine("army of Uzer was able to", 63),
core.game.dialogue.book.BookLine("drive Thammaron back,", 64),
core.game.dialogue.book.BookLine("but the record ends at", 65),
),
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("that point and it has", 66),
core.game.dialogue.book.BookLine("always been assumed that", 67),
core.game.dialogue.book.BookLine("a later attack, either by", 68),
core.game.dialogue.book.BookLine("Thammaron or by", 69),
core.game.dialogue.book.BookLine("Zamorak's other forces,", 70),
core.game.dialogue.book.BookLine("finished the city off.", 71),
core.game.dialogue.book.BookLine("", 72),
core.game.dialogue.book.BookLine("Examining the door", 73),
core.game.dialogue.book.BookLine("again, I now see that it is", 74),
core.game.dialogue.book.BookLine("exactly the sort of door", 75),
core.game.dialogue.book.BookLine("that could be used to seal", 76),
)
),
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("Thammaron's portal. I am", 55),
core.game.dialogue.book.BookLine("suddently glad I was not", 56),
core.game.dialogue.book.BookLine("able to open it! I surmise", 57),
core.game.dialogue.book.BookLine("that the army of golems", 58),
core.game.dialogue.book.BookLine("was created in order to", 59),
core.game.dialogue.book.BookLine("fight the demon, since", 60),
core.game.dialogue.book.BookLine("Uzer's army had been", 61),
core.game.dialogue.book.BookLine("wiped out and", 62),
core.game.dialogue.book.BookLine("Saradomin's forces were", 63),
core.game.dialogue.book.BookLine("increasingly stretched.", 64),
core.game.dialogue.book.BookLine("However, this approach", 65),
),
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("evidently failed, since the", 66),
core.game.dialogue.book.BookLine("city was eventually", 67),
core.game.dialogue.book.BookLine("destroyed.", 68),
core.game.dialogue.book.BookLine("", 69),
core.game.dialogue.book.BookLine("The art of the", 70),
core.game.dialogue.book.BookLine("construction of golems", 71),
core.game.dialogue.book.BookLine("has been lost since the", 72),
core.game.dialogue.book.BookLine("Third Age, and, although", 73),
core.game.dialogue.book.BookLine("they are sometimes", 74),
core.game.dialogue.book.BookLine("discovered lying dormant", 75),
core.game.dialogue.book.BookLine("in the ground, no", 76),
)
),
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("concerted effort has been", 55),
core.game.dialogue.book.BookLine("made to regain it, thanks", 56),
core.game.dialogue.book.BookLine("largely to the modern", 57),
core.game.dialogue.book.BookLine("Saradomist Church's view", 58),
core.game.dialogue.book.BookLine("of them as unnatural.", 59),
core.game.dialogue.book.BookLine("This view is without", 60),
core.game.dialogue.book.BookLine("foundation, as golems are", 61),
core.game.dialogue.book.BookLine("neither good nor evil but", 62),
core.game.dialogue.book.BookLine("follow instructions they", 63),
core.game.dialogue.book.BookLine("are given to the letter", 64),
core.game.dialogue.book.BookLine("and without imagination,", 65),
),
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("indeed experiencing", 66),
core.game.dialogue.book.BookLine("extreme discomfort for as", 67),
core.game.dialogue.book.BookLine("long as a task assigned to", 68),
core.game.dialogue.book.BookLine("them remains incomplete.", 69),
core.game.dialogue.book.BookLine("Some golems were", 70),
core.game.dialogue.book.BookLine("constructed to obey", 71),
core.game.dialogue.book.BookLine("verbal instructions, but", 72),
core.game.dialogue.book.BookLine("the main method of", 73),
core.game.dialogue.book.BookLine("instruction was to place", 74),
core.game.dialogue.book.BookLine("magical words into the", 75),
core.game.dialogue.book.BookLine("golem's skull cavity.", 76),
)
),
core.game.dialogue.book.PageSet(
core.game.dialogue.book.Page(
core.game.dialogue.book.BookLine("These were written on", 55),
core.game.dialogue.book.BookLine("papyrus using a naturally", 56),
core.game.dialogue.book.BookLine("occurring source of ink,", 57),
core.game.dialogue.book.BookLine("and their magical power", 58),
core.game.dialogue.book.BookLine("derived from the use of a", 59),
core.game.dialogue.book.BookLine("phoenix tail feather as a", 60),
core.game.dialogue.book.BookLine("pen. These would be used", 61),
core.game.dialogue.book.BookLine("for long-term or", 62),
core.game.dialogue.book.BookLine("important tasks, and", 63),
core.game.dialogue.book.BookLine("would override any verbal", 64),
core.game.dialogue.book.BookLine("instructions.", 65),
)
)
)
@Initializable
class VarmensNotesHandler : core.game.dialogue.book.Book {
constructor() {}
constructor(player: Player?) : super(player, "The Ruins of Uzer", Items.VARMENS_NOTES_4616, *VARMEN_NOTES) {}
override fun finish() {
player.setAttribute("/save:the-golem:varmen-notes-read", true)
}
override fun display(set: Array<core.game.dialogue.book.Page>) {
player.interfaceManager.open(getInterface())
for (i in 55..76) {
player.packetDispatch.sendString("", getInterface().id, i)
}
player.packetDispatch.sendString("", getInterface().id, 77)
player.packetDispatch.sendString("", getInterface().id, 78)
player.packetDispatch.sendString(getName(), getInterface().id, 6)
for (page in set) {
for (line in page.lines) {
player.packetDispatch.sendString(line.message, getInterface().id, line.child)
}
}
player.packetDispatch.sendInterfaceConfig(getInterface().id, 51, index < 1)
val lastPage = index == sets.size - 1
player.packetDispatch.sendInterfaceConfig(getInterface().id, 53, lastPage)
if (lastPage) {
finish()
}
}
override fun newInstance(player: Player): core.game.dialogue.DialoguePlugin {
return VarmensNotesHandler(player)
}
override fun getIds(): IntArray {
return intArrayOf(Items.VARMENS_NOTES_4616)
}
}
val DISPLAY_CASE_TEXT = arrayOf("3rd age - yr 3000-4000",
"",
"This statuette was found in an underground",
"temple in the ruined city of Uzer, which was",
"destroyed late in the 3rd Age, suddenly, due to",
"causes unknown. It probably represents one of",
"the clay golems that the craftsmen of the city",
"built as warriors and servants. The statuette",
"was originally part of a mechanism whose",
"purpose is unknown.")
@@ -0,0 +1,447 @@
package content.region.desert.quest.thegolem
import core.api.*
import core.game.node.Node
import core.game.node.entity.npc.AbstractNPC
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.quest.Quest
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import core.game.node.scenery.Scenery
import core.game.system.task.Pulse
import core.game.world.map.Location
import core.game.world.update.flag.context.Animation
import core.plugin.Initializable
import core.tools.RandomFunction
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.interaction.InterfaceListener
import core.game.world.GameWorld
@Initializable
class TheGolemQuest : Quest("The Golem", 70, 69, 1, 437, 0, 1, 10) {
override fun newInstance(`object`: Any?): Quest {
return this
}
override fun drawJournal(player: Player, stage: Int) {
super.drawJournal(player, stage)
var ln = 11
if(stage == 0) {
line(player, "I can start this quest by talking to the golem who is in the:", ln++, false)
line(player, "Ruined city of !!Uzer??, which is in the desert to the east of", ln++, false)
line(player, "the !!Shantay Pass.", ln++, false)
line(player, "I will need to have !!level 20 crafting?? and !!level 25 thieving", ln++, false)
}
if(stage >= 1) {
line(player, "I've found the golem, and offered to repair it.", ln++, stage > 1)
}
if(stage >= 2) {
line(player, "I've repaired the golem with some soft clay.", ln++, stage > 2)
}
if(stage >= 3) {
line(player, "The golem wants me to open a portal to help it defeat", ln++, stage > 3)
line(player, "the demon that attacked its city.", ln++, stage > 3)
}
val readLetter = player.getAttribute("the-golem:read-elissa-letter", false)
val readBook = player.getAttribute("the-golem:varmen-notes-read", false)
if(readLetter) {
line(player, "I've found a letter that mentions !!The Digsite", ln++, readBook)
}
if(readBook) {
line(player, "I've found a book that mentions that golems are programmed by", ln++, stage > 7)
line(player, "writing instructions on papyrus with a phoenix quill pen.", ln++, stage > 7)
}
val hasStatuette = TheGolemListeners.hasStatuette(player)
val doorOpen = player.getAttribute("the-golem:door-open", false)
if(hasStatuette) {
line(player, "I've acquired a statuette that fits a mechanism in the ruins", ln++, doorOpen)
line(player, " of !!Uzer?? from the Varrock museum.", ln++, doorOpen)
}
val seenDemon = player.getAttribute("the-golem:seen-demon", false)
if(doorOpen) {
line(player, "I've opened the portal in the ruins of Uzer.", ln++, seenDemon)
}
if(seenDemon) {
line(player, "It turns out that the demon is already dead!", ln++, stage > 4)
line(player, "I should tell the golem the good news.", ln++, stage > 4)
}
if(stage > 4) {
line(player, "The demon doesn't think its task is complete.", ln++, stage > 7)
}
if(stage >= 100) {
line(player, "QUEST COMPLETE", ln++, false)
}
}
override fun hasRequirements(player: Player): Boolean {
return player.skills.getStaticLevel(Skills.CRAFTING) >= 20 && player.skills.getStaticLevel(Skills.THIEVING) >= 25
}
override fun finish(player: Player?) {
super.finish(player)
player ?: return
var ln = 10
player.packetDispatch.sendItemZoomOnInterface(Items.STATUETTE_4618,230,277,5)
drawReward(player, "1 quest point", ln++)
drawReward(player, "1,000 Crafting XP",ln++)
drawReward(player, "1,000 Theiving XP", ln++)
rewardXP(player, Skills.CRAFTING, 3000.0)
rewardXP(player, Skills.THIEVING, 2000.0)
}
override fun updateVarps(player: Player) {
TheGolemListeners.updateVarps(player)
}
}
@Initializable
class ClayGolemNPC : AbstractNPC {
constructor() : super(NPCs.BROKEN_CLAY_GOLEM_1908, null, true) {}
private constructor(id: Int, location: Location) : super(id, location) {}
override fun construct(id: Int, location: Location, vararg objects: Any?): AbstractNPC {
return ClayGolemNPC(id, location)
}
override fun getIds(): IntArray {
return intArrayOf(1907, NPCs.BROKEN_CLAY_GOLEM_1908, NPCs.DAMAGED_CLAY_GOLEM_1909, NPCs.CLAY_GOLEM_1910)
}
}
class LetterListener : InterfaceListener {
override fun defineInterfaceListeners() {
onOpen(220) { player, component ->
val lines: Array<String> = player.getAttribute("ifaces:220:lines", arrayOf())
for(i in 0 until Math.min(lines.size, 15)) {
setInterfaceText(player, lines[i], 220, i+1)
//setInterfaceText(player, "${i}", 220, i+1)
}
return@onOpen true
}
}
}
class DisplayCaseListener : InterfaceListener {
override fun defineInterfaceListeners() {
onOpen(534) { player, component ->
//player.packetDispatch.sendModelOnInterface(25576, 534, 5, 650)
val model = player.getAttribute("ifaces:534:model", 0)
player.packetDispatch.sendModelOnInterface(model, 534, 4, 461)
//player.packetDispatch.sendModelOnInterface(25576, 534, 12, 973)
setInterfaceText(player, DISPLAY_CASE_TEXT.joinToString("<br>"), 534, 2)
setInterfaceText(player, "30", 534, 85)
return@onOpen true
}
}
}
class TheGolemListeners : InteractionListener {
fun repairGolem(player: Player): Boolean {
if(player.questRepository.getStage("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."
1 -> "You fix the golem's legs."
2 -> "The golem is nearly whole."
3 -> "You repair the golem with a final piece of clay."
else -> null
}
if(removeItem(player, Item(Items.SOFT_CLAY_1761, 1))) {
if(msg != null) {
sendItemDialogue(player, Items.SOFT_CLAY_1761, msg)
}
clayUsed = Math.min(clayUsed + 1, 4)
player.setAttribute("/save:the-golem:clay-used", clayUsed)
updateVarps(player)
if(clayUsed == 4) {
setQuestStage(player, "The Golem", 2)
}
}
}
return true
}
fun takeThroneGems(player: Player) {
if(player.getAttribute("the-golem:gems-taken", false)) {
return
}
if(!player.inventory.containsAtLeastOneItem(Items.HAMMER_2347) || !player.inventory.containsAtLeastOneItem(Items.CHISEL_1755)) {
player.sendMessage("You need a hammer and chisel to remove the gems.")
return
}
if(!(player.inventory.freeSlots() >= 6)) {
player.sendMessage("You don't have enough free space to remove all six gems.")
return
}
player.setAttribute("/save:the-golem:gems-taken", true)
updateVarps(player)
for(item in arrayOf(Items.SAPPHIRE_1607, Items.EMERALD_1605, Items.RUBY_1603)) {
player.inventory.add(Item(item, 2))
}
sendItemDialogue(player, Items.RUBY_1603, "You prize the gems from the demon's throne.")
}
companion object {
@JvmStatic
fun hasStatuette(player: Player): Boolean {
return player.inventory.containsAtLeastOneItem(4618) || player.bank.containsAtLeastOneItem(4618) || player.getAttribute("the-golem:placed-statuette", false)
}
@JvmStatic
fun initializeStatuettes(player: Player) {
if(!player.getAttribute("the-golem:statuette-rotation:initialized", false)) {
for(i in 0 until 4) {
player.setAttribute("/save:the-golem:statuette-rotation:${i}", RandomFunction.random(2));
}
player.setAttribute("/save:the-golem:statuette-rotation:initialized", true)
}
}
@JvmStatic
fun updateVarps(player: Player) {
val clayUsed = player.getAttribute("the-golem:clay-used", 0)
val gemsTaken = if(player.getAttribute("the-golem:gems-taken", false)) { 1 } else { 0 }
val statuetteTaken = if(hasStatuette(player)) { 1 } else { 0 }
val statuettePlaced = if(player.getAttribute("the-golem:placed-statuette", false)) { 1 } else { 0 }
initializeStatuettes(player)
val rotation1 = player.getAttribute("the-golem:statuette-rotation:1", 0)
val rotation2 = player.getAttribute("the-golem:statuette-rotation:2", 0)
val rotation3 = player.getAttribute("the-golem:statuette-rotation:3", 0)
val rotation4 = player.getAttribute("the-golem:statuette-rotation:4", 0)
val doorOpen = player.getAttribute("the-golem:door-open", false)
var clientStage = 0
if(player.questRepository.getStage("The Golem") > 0) {
clientStage = Math.max(clientStage, 1)
}
if(doorOpen) {
clientStage = Math.max(clientStage, 5)
}
if(player.questRepository.getStage("The Golem") >= 100) {
clientStage = Math.max(clientStage, 10)
}
player.varpManager.get(437)
.setVarbit(0, clientStage)
.setVarbit(7, clayUsed)
.setVarbit(16, gemsTaken)
.setVarbit(17, statuetteTaken)
.setVarbit(10, rotation1)
.setVarbit(11, rotation2)
.setVarbit(12, rotation3)
.setVarbit(13, statuettePlaced * (rotation4 + 1))
.send(player)
}
}
fun pickpocketCurator(player: Player, node: Node): Boolean {
if(player.inventory.containsAtLeastOneItem(4617) || player.bank.containsAtLeastOneItem(4617)) {
player.sendMessage("You have no reason to do that.")
return true
}
sendItemDialogue(player, 4617, "You steal a tiny key.")
addItemOrDrop(player, 4617, 1)
return true
}
fun displayCase(player: Player, node: Scenery): Boolean {
val model = node.definition.modelIds[0]
player.setAttribute("ifaces:534:model", model)
openInterface(player, 534)
return true
}
fun openDisplayCase(player: Player, node: Node): Boolean {
if(!player.inventory.containsAtLeastOneItem(4617)) {
player.sendMessage("You can't open the display case without the key.")
return true
}
if(hasStatuette(player)) {
return true
}
addItemOrDrop(player, 4618, 1)
updateVarps(player)
return true
}
fun placeStatuette(player: Player): Boolean {
System.out.println("Hello from placeStatuette")
if(player.inventory.remove(Item(4618))) {
player.sendMessage("You insert the statuette into the alcove.")
player.setAttribute("/save:the-golem:placed-statuette", true)
updateVarps(player)
}
return true
}
fun turnStatuette(player: Player, node: Scenery): Boolean {
if(player.getAttribute("the-golem:door-open", false)) {
player.sendMessage("You've already opened the door.")
return true
}
val index = when(node.wrapper.id) {
6303 -> 1
6304 -> 2
6305 -> 3
6306 -> 4
else -> return true
}
initializeStatuettes(player)
val rotation = 1 - player.getAttribute("the-golem:statuette-rotation:${index}", 0)
val dir = if(rotation == 0) { "right" } else { "left" }
player.sendMessage("You turn the statuette to the ${dir}.")
player.setAttribute("the-golem:statuette-rotation:${index}", rotation)
checkDoor(player)
updateVarps(player)
return true
}
fun checkDoor(player: Player) {
if(!player.getAttribute("the-golem:door-open", false)) {
val rotation1 = player.getAttribute("the-golem:statuette-rotation:1", 0)
val rotation2 = player.getAttribute("the-golem:statuette-rotation:2", 0)
val rotation3 = player.getAttribute("the-golem:statuette-rotation:3", 0)
val rotation4 = player.getAttribute("the-golem:statuette-rotation:4", 0)
val placed = player.getAttribute("the-golem:placed-statuette", false)
if(rotation1 == 1 && rotation2 == 1 && rotation3 == 0 && rotation4 == 0 && placed) {
player.sendMessage("The door grinds open.")
player.setAttribute("/save:the-golem:door-open", true)
}
}
}
fun mortarOnMushroom(player: Player): Boolean {
if(!player.inventory.containsAtLeastOneItem(Items.VIAL_229)) {
player.sendMessage("You need a vial to do that.")
return true
}
if(player.inventory.remove(Item(Items.BLACK_MUSHROOM_4620, 1)) && player.inventory.remove(Item(Items.VIAL_229, 1))) {
sendItemDialogue(player, Items.BLACK_MUSHROOM_INK_4622, "You crush the mushroom and pour the juice into a vial.")
player.inventory.add(Item(Items.BLACK_MUSHROOM_INK_4622, 1))
}
return true
}
fun featherOnInk(player: Player): Boolean {
if(player.inventory.remove(Item(Items.PHOENIX_FEATHER_4621, 1))) {
sendItemDialogue(player, Items.PHOENIX_QUILL_PEN_4623, "You dip the phoenix feather into the ink.")
player.inventory.add(Item(Items.PHOENIX_QUILL_PEN_4623, 1))
}
return true
}
fun penOnPapyrus(player: Player): Boolean {
if(!player.getAttribute("the-golem:varmen-notes-read", false)) {
player.sendMessage("You don't know what to write.");
return true
}
if(player.inventory.remove(Item(Items.PAPYRUS_970, 1))) {
sendItemDialogue(player, Items.GOLEM_PROGRAM_4624, "You write on the papyrus:<br>YOUR TASK IS DONE")
player.inventory.add(Item(Items.GOLEM_PROGRAM_4624, 1))
}
return true
}
fun implementOnGolem(player: Player): Boolean {
if(!player.getAttribute("the-golem:varmen-notes-read", false)) {
player.sendMessage("You don't know what that would do.");
return true
}
if(player.questRepository.getStage("The Golem") == 7) {
player.sendMessage("You insert the key and the golem's skull hinges open.")
setQuestStage(player, "The Golem", 8)
}
return true
}
fun programOnGolem(player: Player, used: Node, with: Node): Boolean {
player.dialogueInterpreter.open(ClayGolemProgramDialogueFile(), with)
return true
}
override fun defineDestinationOverrides() {
addClimbDest(Location.create(3492, 3089, 0), Location.create(2722, 4886, 0))
addClimbDest(Location.create(2721, 4884, 0), Location.create(3491, 3090, 0))
setDest(IntType.SCENERY, intArrayOf(34978), "climb-down") { _, _ -> return@setDest Location.create(3491, 3090, 0) }
setDest(IntType.SCENERY, intArrayOf(6372), "climb-up") { _, _ -> return@setDest Location.create(2722, 4886, 0) }
}
override fun defineListeners() {
onUseWith(IntType.NPC, Items.SOFT_CLAY_1761, 1907) { player, used, with -> return@onUseWith repairGolem(player) }
on(34978, IntType.SCENERY, "climb-down") { player, node -> core.game.global.action.ClimbActionHandler.climb(player, core.game.global.action.ClimbActionHandler.CLIMB_DOWN, core.game.global.action.SpecialLadders.getDestination(node.location)); return@on true }
on(6372, IntType.SCENERY, "climb-up") { player, node -> core.game.global.action.ClimbActionHandler.climb(player, core.game.global.action.ClimbActionHandler.CLIMB_UP, core.game.global.action.SpecialLadders.getDestination(node.location)); return@on true }
on(4615, IntType.ITEM, "read") { player, node ->
player.setAttribute("ifaces:220:lines", LETTER_LINES)
player.setAttribute("/save:the-golem:read-elissa-letter", true)
openInterface(player, 220)
return@on true
}
on(35226, IntType.SCENERY, "search") { player, node ->
player.packetDispatch.sendMessage("You search the bookcase.")
val readLetter = player.getAttribute("the-golem:read-elissa-letter", false)
if(!player.inventory.containsAtLeastOneItem(4616) && !player.bank.containsAtLeastOneItem(4616) && readLetter) {
sendItemDialogue(player, 4616, "You find Varmen's expedition notes.")
addItemOrDrop(player, 4616, 1)
} else {
player.packetDispatch.sendMessage("You find nothing of interest.")
}
return@on true
}
on(6363, IntType.SCENERY, "open") { player, node -> player.sendMessage("The door doesn't open."); return@on true }
on(6364, IntType.SCENERY, "enter") { player, node ->
player.sendMessage("You step into the portal.")
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)
}
teleport(player, Location.create(3552, 4948, 0))
return@on true
}
on(6282, IntType.SCENERY, "enter") { player, node ->
player.sendMessage("You step into the portal.")
teleport(player, Location.create(2722, 4911, 0))
return@on true
}
onUseWith(IntType.SCENERY, Items.HAMMER_2347, 6301) { player, _, _ -> takeThroneGems(player); return@onUseWith true }
onUseWith(IntType.SCENERY, Items.CHISEL_1755, 6301) { player, _, _ -> takeThroneGems(player); return@onUseWith true }
on(646, IntType.NPC, "pickpocket") { player, node -> return@on pickpocketCurator(player, node) }
on(intArrayOf(24627, 24550), IntType.SCENERY, "study") { player, node -> return@on displayCase(player, node as Scenery) }
on(24627, IntType.SCENERY, "open") { player, node -> return@on openDisplayCase(player, node) }
onUseWith(IntType.SCENERY, 4618, 6309) { player, used, with -> return@onUseWith placeStatuette(player) }
on(intArrayOf(6307, 6308), IntType.SCENERY, "turn") { player, node -> turnStatuette(player, node as Scenery) }
onUseWith(IntType.ITEM, 233, 4620) { player, used, with -> return@onUseWith mortarOnMushroom(player) }
onUseWith(IntType.ITEM, 4621, 4622) { player, used, with -> return@onUseWith featherOnInk(player) }
onUseWith(IntType.ITEM, 970, 4623) { player, used, with -> return@onUseWith penOnPapyrus(player) }
onUseWith(IntType.NPC, 4619, 1907) { player, used, with -> return@onUseWith implementOnGolem(player) }
onUseWith(IntType.NPC, 4624, 1907) { player, used, with -> return@onUseWith programOnGolem(player, used, with) }
on(1911, IntType.NPC, "grab-feather") { player, node ->
if(player.getAttribute("the-golem:varmen-notes-read", false)) {
player.lock()
GameWorld.Pulser.submit(object : Pulse(){
var counter = 0
override fun pulse(): Boolean {
when(counter++){
0 -> {
player.sendMessage("You attempt to grab the pheonix's tail-feather.")
player.animator.animate(Animation(881))
}
3 -> {
player.sendMessage("You grab a tail-feather.")
player.inventory.add(Item(Items.PHOENIX_FEATHER_4621))
player.unlock()
return true
}
}
return false
}
})
} else {
player.sendMessage("You have no reason to take the phoenix's feathers.")
}
return@on true
}
}
}
@@ -0,0 +1,309 @@
package content.region.desert.quest.thetouristrap;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.Item;
/**
* The dialogue used for the al shabim npc.
* @author 'Vexia
* @version 1.0
*/
public final class AlShabimDialogue extends DialoguePlugin {
/**
* The bronze darts item.
*/
private static final Item BRONZE_DARTS = new Item(806, 6);
/**
* The quest instance.
*/
private Quest quest;
/**
* Constructs a new {@code AlShabimDialogue} {@code Object}.
*/
public AlShabimDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code AlShabimDialogue} {@code Object}.
* @param player the player.
*/
public AlShabimDialogue(final Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new AlShabimDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (quest.getStage(player)) {
default:
npc("Hello Effendi!");
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (quest.getStage(player)) {
case 54:// build tool.
switch (stage) {
case 0:
if (player.getInventory().containsItem(TouristTrap.PROTOTYPE_DART)) {
npc("Wonderful, I see you have made the new weapon!");
stage = 20;
} else {
if (!player.hasItem(TouristTrap.BEDABIN_KEY)) {
player("I seemed to have lost the key...");
stage++;
} else {
npc("Have you figured out the plans yet?");
stage = 3;
}
}
break;
case 1:
npc("Ahh Effendi, it's a good thing I have a spare!");
stage++;
break;
case 2:
player.getInventory().add(TouristTrap.BEDABIN_KEY, player);
interpreter.sendItemMessage(TouristTrap.BEDABIN_KEY, "Al Shabim gives you a key.");
stage = 11;
break;
case 3:
player("No, not yet.");
stage = 11;
break;
case 11:
end();
break;
case 20:
interpreter.sendItemMessage(TouristTrap.PROTOTYPE_DART, "You show Al Shabim the prototype dart.");
;
stage++;
break;
case 21:
npc("This is truly fantastic Effendi!");
stage++;
break;
case 22:
if (player.getInventory().containsItem(TouristTrap.TECHNICAL_PLANS)) {
npc("We will take the technical plans for the weapon as well.");
stage++;
} else {
player.getInventory().remove(TouristTrap.TECHNICAL_PLANS);
npc("We are forever grateful for this gift. My advisor have", "discovered some secrets which we will share with you.");
stage = 25;
}
break;
case 23:
interpreter.sendItemMessage(TouristTrap.TECHNICAL_PLANS, "You hand over the technical plans for the weapon.");
stage++;
break;
case 24:
player.getInventory().remove(TouristTrap.TECHNICAL_PLANS);
npc("We are forever grateful for this gift. My advisor have", "discovered some secrets which we will share with you.");
stage++;
break;
case 25:
interpreter.sendDialogue("Al Shabim's advisors show you some advanced techniques for making", "the new weapon.");
stage++;
break;
case 26:
npc("Please accept this selection of six bronze throwing darts", "as a token of our appreciation.");
stage++;
break;
case 27:
player.getInventory().add(BRONZE_DARTS, player);
interpreter.sendItemMessage(806, "You receive six bronze throwing darts from Al Shabim.");
stage = player.getInventory().containsItem(TouristTrap.BEDABIN_KEY) ? 28 : 29;
break;
case 28:
player.getInventory().remove(TouristTrap.BEDABIN_KEY);
npc("I'll take that key off your hands as well effendi! Many", "thanks.");
stage++;
break;
case 29:
quest.setStage(player, 60);
player.getInventory().remove(TouristTrap.PROTOTYPE_DART);
player.getInventory().add(TouristTrap.TENTI_PINEAPPLE);
interpreter.sendItemMessage(806, "<col=08088A>*** Dart Construction ***", "Congratulations! You can now construct darts.");
stage++;
break;
}
break;
case 50:
switch (stage) {
case 0:
npc("I am Al Shabim, greetings on behalf of the Bedabin", "nomads. Now... what can I do for you?");
stage++;
break;
case 1:
player("I am looking for a pineapple.");
stage++;
break;
case 2:
npc("Oh yes, well that is interesting. Our sweet pineapples", "are renowned throughout the whole of Kharid! and I'll", "give you one if you do me a favour?");
stage++;
break;
case 3:
player("Oh yes?");
stage++;
break;
case 4:
npc("Captain Siad at the mining camp is holding some secret", "information. It is very important to us and we would", "like you to get it for us. It gives details of an", "interesting, yet ancient weapon.");
stage++;
break;
case 5:
npc("We would gladly share this information with you. All", "you have to do is gain access to his private room", "upstairs. We have a key for the chest that contains this", "information. Are you interested in our deal?");
stage++;
break;
case 6:
player("Yes, I'm interested.");
stage++;
break;
case 7:
npc("That's great Effendi!");
stage++;
break;
case 8:
npc("Here is a copy of the key that should give you access", "to the chest.");
stage++;
break;
case 9:
quest.setStage(player, 51);
player.getInventory().add(TouristTrap.BEDABIN_KEY, player);
interpreter.sendItemMessage(TouristTrap.BEDABIN_KEY, "Al Shabim gives you a key.");
stage++;
break;
}
break;
case 51:
case 52:
case 53:
switch (stage) {
case 0:
if (player.getInventory().containsItem(TouristTrap.TECHNICAL_PLANS)) {
npc("Aha! I see you have the plans. This is great! However,", "these plans do indeed look very technical. My people", "have further need of your skills.");
stage = 20;
} else {
if (!player.hasItem(TouristTrap.BEDABIN_KEY)) {
player("I seemed to have lost the key...");
stage++;
} else {
npc("Have you found the plans yet?");
stage = 3;
}
}
break;
case 1:
npc("Ahh Effendi, it's a good thing I have a spare!");
stage++;
break;
case 2:
player.getInventory().add(TouristTrap.BEDABIN_KEY, player);
interpreter.sendItemMessage(TouristTrap.BEDABIN_KEY, "Al Shabim gives you a key.");
stage = 11;
break;
case 3:
player("No, sorry. I'm still looking for them.");
stage++;
break;
case 4:
npc("Okay, Effendi!");
stage = 11;
break;
case 10:
npc("Bring us back the plans inside the chest, they should be", "sealed. All haste to you Effendi!");
stage = 11;
break;
case 11:
end();
break;
case 20:
npc("If you can help us to manufacture this item, we will", "share its secret with you. Does this deal interest you", "effendi?");
stage++;
break;
case 21:
player("Yes, I'm very interested.");
stage++;
break;
case 22:
npc("Okay Effendi, you need to follow the plans. You will", "need some special tools for this... There is an anvil in", "the other tent. You have my permission to use it, but", "show the plans to the guard.");
stage++;
break;
case 23:
quest.setStage(player, 54);
end();
break;
}
break;
case 100:
case 60:
case 70:
case 80:
case 90:
switch (stage) {
case 0:
if (quest.getStage(player) == 60 && !player.hasItem(TouristTrap.TENTI_PINEAPPLE)) {
player.getInventory().add(TouristTrap.TENTI_PINEAPPLE, player);
interpreter.sendItemMessage(TouristTrap.TENTI_PINEAPPLE, "You receive a tasty looking pineapple from Al Shabim.");
stage++;
stage = 32;
break;
}
npc("Many thanks with helping previously Effendi!");
stage++;
break;
case 30:
npc("Oh, and here is your pineapple!");
stage++;
break;
case 31:
interpreter.sendItemMessage(TouristTrap.TENTI_PINEAPPLE, "You receive a tasty looking pineapple from Al Shabim.");
stage++;
break;
case 32:
end();
break;
case 1:
end();
break;
}
break;
default:
switch (stage) {
case 0:
player("Hi");
stage++;
break;
case 1:
end();
break;
}
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 832 };
}
}
@@ -0,0 +1,336 @@
package content.region.desert.quest.thetouristrap;
import core.game.dialogue.DialoguePlugin;
import core.game.interaction.NodeUsageEvent;
import core.game.interaction.UseWithHandler;
import core.game.node.entity.npc.AbstractNPC;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.system.task.Pulse;
import core.game.world.GameWorld;
import core.game.world.map.Location;
import core.game.world.map.RegionManager;
import core.plugin.Plugin;
import core.plugin.ClassScanner;
/**
* The dialogue plugin used to handle the ana npc.
* @author 'Vexia
* @version 1.0
*/
public final class AnaDialogue extends DialoguePlugin {
/**
* The quest instance.
*/
private Quest quest;
/**
* Constructs a new {@code AnaDialogue} {@code Object}.
*/
public AnaDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code AnaDialogue} {@code Object}.
* @param player the player.
*/
public AnaDialogue(final Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new AnaDialogue(player);
}
@Override
public void init() {
super.init();
ClassScanner.definePlugin(new AnaNPC());
ClassScanner.definePlugin(new AnaBarrelHandler());
}
@Override
public boolean open(Object... args) {
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
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;
return true;
}
switch (quest.getStage(player)) {
case 98:
switch (stage) {
case 0:
npc("Great! Thanks for getting me out of that mine! And", "that barrel wasn't too bad anyway! Pop by again", "sometime, I'm sure we'll have a barrel of laughs!");
stage++;
break;
}
break;
case 60:
player("Hello!");
break;
case 61:
if (args.length > 1) {
npc("Hey, what do you think you're doing?");
stage = 20;
return true;
}
player("Hello again!");
break;
default:
player.getPacketDispatch().sendMessage("This slave does not appear interested in talking to you.");
end();
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (quest.getStage(player)) {
case 98:
switch (stage) {
case 1:
npc("Oh! I nearly forgot! Here's a key I found in the", "tunnels. It might be some use to you, not sure what", "it opens. Sorry, but I have to go now.");
stage++;
break;
case 2:
interpreter.sendItemMessage(TouristTrap.WROUGHT_IRON_KEY, "Ana gives you a wrought iron key...");
stage++;
break;
case 3:
player.getInventory().add(TouristTrap.WROUGHT_IRON_KEY, player);
player.getPacketDispatch().sendMessage("Ana spots Irena and waves...");
NPC irena = RegionManager.getNpc(player, 4986);
irena.sendChat("Hi Ana!");
quest.setStage(player, 98);
end();
player.getDialogueInterpreter().open(4986, irena);
break;
}
break;
case 71:
switch (stage) {
case 400:
interpreter.sendDialogues(823, null, "Get me OUT OF HERE!");
stage++;
break;
case 401:
quest.setStage(player, 72);
end();
break;
}
break;
case 61:
switch (stage) {
case 0:
npc("Hello there, how's it going? Do you have a plan to get", "out of here yet?");
stage++;
break;
case 1:
player("Well, I'm working on it, have you got any suggestions?");
stage++;
break;
case 2:
npc("Hmmm.");
stage++;
break;
case 3:
npc("No, sorry...");
stage++;
break;
case 4:
npc("The only thing that gets out of here is the rock that we", "mine.");
stage++;
break;
case 5:
npc("Not even the dead get a decent funeral. Bodies are", "just thrown down disused mine holes. It's very", "disrespectful...");
stage++;
break;
case 6:
player("How does the rock get out?");
stage++;
break;
case 7:
npc("Well, we mine it in this section, then someone scoops it", "into a barrel. The barrels are loaded onto a mine cart.", "Then they're deposited near the surface lift.");
stage++;
break;
case 8:
npc("I have no idea where they go from there. But that's", "not going to help us, is it?");
stage++;
break;
case 9:
player("Where would I get one of those barrels from?");
stage++;
break;
case 10:
npc("Well, you would get one from around by the life area.", "But why would you want one of those?");
stage++;
break;
case 11:
player("I could try to sneak you out if you were in a barrel!");
stage++;
break;
case 12:
npc("There is no way you are getting me into a barrel. No", "WAY! Do you understand?");
stage++;
break;
case 13:
player("Well, we'll see, it might be the only way.");
stage++;
break;
case 14:
end();
break;
case 20:// barrel dialogue.
if (player.getInventory().remove(TouristTrap.BARREL)) {
player.sendChat("Shush... It's for your own good!");
player.getInventory().add(TouristTrap.ANNA_BARREL);
close();
player.lock(3);
GameWorld.getPulser().submit(new Pulse(3, player) {
@Override
public boolean pulse() {
interpreter.sendDialogues(823, null, "<col=08088A>-- You manage to squeeze Ana into the barrel, --", "<col=08088A>-- despite her many complaints. --", "I djont fit in dis bawwel... Wet me out!!");
stage++;
return true;
}
});
}
break;
case 21:
end();
break;
}
break;
case 60:
switch (stage) {
case 0:
npc("Hello there, I don't think I've seen you before.");
stage++;
break;
case 1:
player("What's your name?");
stage++;
break;
case 2:
npc("My name? Oh, how sweet, my name is Ana. I come from", "Al-Kharid though we've only recently moved there. I was", "born, and did most of my growing up, in Varrock. I", "thought the desert might be interesting. What a surprise");
stage++;
break;
case 3:
npc("I got!");
stage++;
break;
case 4:
player("Do you want to go back to Al-Kharid?");
stage++;
break;
case 5:
npc("Sure, I miss my Mum, her name is Irena and she is", "probably waiting for me. How do you propose we get out", "of here though?");
stage++;
break;
case 6:
npc("I'm sure you've noticed the many square jawed guards", "around here. You look like you can handle yourself", "but I have my doubts that you can take them all on!");
stage++;
break;
case 7:
quest.setStage(player, 61);
end();
break;
}
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 822 };
}
/**
* The use with handler for the barrel on ana.
* @author 'Vexia
* @version 1.0
*/
public static final class AnaBarrelHandler extends UseWithHandler {
/**
* Constructs a new {@code AnaBarrelHandler} {@code Object}.
*/
public AnaBarrelHandler() {
super(TouristTrap.BARREL.getId());
}
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
addHandler(822, NPC_TYPE, this);
return this;
}
@Override
public boolean handle(NodeUsageEvent event) {
final Player player = event.getPlayer();
final Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (quest.getStage(player)) {
case 61:
player.getDialogueInterpreter().open(822, event.getUsedWith(), true);
break;
default:
return false;
}
return true;
}
}
/**
* The ana npc.
* @author 'Vexia
* @version 1.0
*/
public static final class AnaNPC extends AbstractNPC {
/**
* Constructs a new {@code AnaNPC} {@code Object}.
*/
public AnaNPC() {
super(0, null);
}
/**
* Constructs a new {@code AnaNPC} {@code Object}.
* @param id the id.
* @param location the location.
*/
public AnaNPC(int id, Location location) {
super(id, location);
}
@Override
public AbstractNPC construct(int id, Location location, Object... objects) {
return new AnaNPC(id, location);
}
@Override
public boolean isHidden(final Player player) {
Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
if (quest.getStage(player) > 61) {
return true;
}
return player.getInventory().containsItem(TouristTrap.ANNA_BARREL) || player.getBank().containsItem(TouristTrap.ANNA_BARREL);
}
@Override
public int[] getIds() {
return new int[] { 822 };
}
}
}
@@ -0,0 +1,202 @@
package content.region.desert.quest.thetouristrap;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.node.scenery.Scenery;
import core.game.node.scenery.SceneryBuilder;
import core.game.world.map.Location;
import core.game.world.map.RegionManager;
/**
* The dialogue plugin used for the bedabin nomad npcs.
* @author 'Vexia
* @version 1.0
*/
public final class BedabinNomadDialogue extends DialoguePlugin {
/**
* The quest instance.
*/
private Quest quest;
/**
* Constructs a new {@code BedabinNomadDialogue} {@code Object}.
*/
public BedabinNomadDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code BedabinNomadDialogue} {@code Object}.
* @param player the player.
*/
public BedabinNomadDialogue(final Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new BedabinNomadDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (npc.getId()) {
case 834:// guard
switch (quest.getStage(player)) {
default:
npc("Sorry, but you can't use the tent without permission.");
break;
case 54:
if (player.getInventory().containsItem(TouristTrap.TECHNICAL_PLANS)) {
player("Al Shabim said I could enter, here are the plans!");
stage++;
} else {
npc("Sorry, but you can't use the tent without permission.");
}
break;
case 100:
npc("Sorry, but you can't use the tent without permission. But", "thanks for all your help with the Bedabin people.");
break;
}
break;
case 833:// nomad
case 1239:// fighter
npc("Hello Effendi! How can I help you?");
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (npc.getId()) {
case 834:// guard
switch (quest.getStage(player)) {
default:
end();
break;
case 54:
switch (stage) {
case 0:
end();
break;
case 1:
npc("Okay, go ahead.");
stage = 2;
break;
case 2:
end();
final Scenery door = RegionManager.getObject(new Location(3169, 3046, 0));
SceneryBuilder.replace(door, door.transform(2701), 2);
player.getWalkingQueue().reset();
player.getWalkingQueue().addPath(3169, 3046);
player.getPacketDispatch().sendMessage("You walk into the tent.");
break;
}
break;
case 100:
end();
break;
}
break;
case 833:// nomad
switch (stage) {
case 0:
options("What is this place?", "Where is Shantay Pass?", "What do you have to sell?", "Okay, thanks.");
stage++;
break;
case 1:
switch (buttonId) {
case 1:
player("What is this place?");
stage = 10;
break;
case 2:
player("Where is Shantay pass?");
stage = 20;
break;
case 3:
npc.openShop(player);
end();
break;
case 4:
player("Okay, thanks.");
stage = 40;
break;
}
case 10:
npc("This is the camp of Bedabin. Talk to our leader, Al", "Shabim, he'll be happy to chat. We can sell you very", "reasonably priced water...");
stage++;
break;
case 11:
end();
break;
case 20:
npc("It is North East of here effendi, across the trackless", "desert. It will be a thirsty trip.");
stage = 41;
break;
case 40:
case 41:
end();
break;
}
break;
case 1239:// fighter
switch (stage) {
case 0:
options("What is this place?", "Where is Shantay Pass?", "Okay, thanks.");
stage++;
break;
case 1:
switch (buttonId) {
case 1:
player("What is this place?");
stage = 10;
break;
case 2:
player("Where is Shantay pass?");
stage = 20;
break;
case 3:
player("Okay, thanks.");
stage = 40;
break;
}
break;
case 10:
npc("This is the camp of Bedabin. Talk to our leader, Al", "Shabim, he'll be happy to chat. We can sell you very", "reasonably priced water...");
stage++;
break;
case 11:
end();
break;
case 20:
npc("It is North East of here effendi, across the trackless", "desert. It will be a thirsty trip.");
stage = 41;
break;
case 40:
case 41:
end();
break;
}
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { /** bedabin nomad guard */
834, /** bedabin nomad */
833, /** bedabin nomad fighter */
1239 };
}
}
@@ -0,0 +1,134 @@
package content.region.desert.quest.thetouristrap;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
/**
* The dialogue used for the captain siad npc.
* @author 'Vexia
* @version 1.0
*/
public final class CaptainSiadDialogue extends DialoguePlugin {
/**
* The quest instance.
*/
private Quest quest;
/**
* Constructs a new {@code CaptainSiadDialogue} {@code Object}.
*/
public CaptainSiadDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code CaptainSiadDialogue} {@code Object}.
* @param player the player.
*/
public CaptainSiadDialogue(final Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new CaptainSiadDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (quest.getStage(player)) {
default:
player.getPacketDispatch().sendMessage("The captain looks up from his work as you address him.");
npc("What are you doing in here?");
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (quest.getStage(player)) {
case 52:
switch (stage) {
case 0:
player("I wanted to have a chat?");
stage++;
break;
case 1:
npc("You don't belong in here, get out!");
stage++;
break;
case 2:
player("You seem to have a lot of books!");
stage++;
break;
case 3:
npc("Yes, I do. Now please get to the point?");
stage++;
break;
case 4:
player("So, you're interested in sailing?");
stage++;
break;
case 5:
interpreter.sendDialogue("The captain's interest seems to perk up.");
stage++;
break;
case 6:
npc("Well, yes actually... It's been a passion of mine for", "some years...");
stage++;
break;
case 7:
player("I could tell by the cut of your jib.");
stage++;
break;
case 8:
npc("Oh yes? Really?");
stage++;
break;
case 9:
npc("Well, I was quite a catch in my day you know!");
stage++;
break;
case 10:
interpreter.sendDialogue("The captain starts rambling on about his days as a salty sea dog. He", "looks quite distracted...");
stage++;
break;
case 11:
end();
quest.setStage(player, 53);
break;
}
break;
default:
switch (stage) {
case 0:
player("I wanted to have a chat?");
stage++;
break;
case 1:
npc("You don't belong in here, get out!");
stage++;
break;
case 2:
end();
break;
}
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 831 };
}
}
@@ -0,0 +1,369 @@
package content.region.desert.quest.thetouristrap;
import java.util.List;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.npc.AbstractNPC;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.system.task.Pulse;
import core.game.world.GameWorld;
import core.game.world.map.Location;
import core.game.world.map.RegionManager;
import core.plugin.ClassScanner;
import core.tools.RandomFunction;
/**
* Represents the mining desert camp guard dialogue.
* @author 'Vexia
* @version 1.0
*/
public final class DesertGuardDialogue extends DialoguePlugin {
/**
* Represents the quest.
*/
private Quest quest;
/**
* Constructs a new {@code DesertGuardDialogue} {@code Object}.
*/
public DesertGuardDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code DesertGuardDialogue} {@code Object}.
* @param player the player.
*/
public DesertGuardDialogue(final Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new DesertGuardDialogue(player);
}
@Override
public void init() {
super.init();
ClassScanner.definePlugin(new DesertGuardNPC());
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (npc.getId()) {
case 5001:
switch (quest.getStage(player)) {
default:
npc("What are you looking at?");
break;
case 40:
npc("Yeah, what do you want?");
break;
case 50:
case 51:
case 52:
case 53:
case 54:
if (player.getInventory().containsItem(TouristTrap.TENTI_PINEAPPLE)) {
player("Hey... I have something for you!");
stage = 0;
} else {
npc("Do you have my tenti pineapple yet?");
stage = 10;
}
break;
case 60:
case 70:
case 80:
case 90:
case 100:
if (stage == 60) {
end();
return true;
}
npc("That pineapple was just delicious, many thanks. I don't", "suppose you could get me another? <col=08088A>-- The guard looks at", "<col=08088A>you pleadingly.");
break;
}
break;
default:
switch (quest.getStage(player)) {
default:
npc("What are you looking at?");
break;
}
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (npc.getId()) {
case 5001:
switch (quest.getStage(player)) {
case 51:
case 52:
case 53:
case 54:
switch (stage) {
case 0:
interpreter.sendItemMessage(TouristTrap.TENTI_PINEAPPLE, "You show the Tenti pineapple to the guard.");
stage++;
break;
case 1:
if (player.getInventory().remove(TouristTrap.TENTI_PINEAPPLE)) {
quest.setStage(player, 60);
npc("Great! Just what I've been looking for! Mmmmmmm...", "Delicious! This is so nice! Mmmmm, *SLURP*", "Yummmm... Oh yes, this is great.");
stage = 10;
}
break;
case -10:
player("Sorry, I don't have it yet.");
stage = -11;
break;
case -11:
end();
break;
case 10:
player("So, can I go through now please?");
stage++;
break;
case 11:
npc("Yes, yes, of course... a deal's a deal!");
stage++;
break;
case 12:
end();
break;
}
break;
case 50:
switch (stage) {
case 0:
interpreter.sendItemMessage(TouristTrap.TENTI_PINEAPPLE, "You show the Tenti pineapple to the guard.");
stage++;
break;
case 1:
if (player.getInventory().remove(TouristTrap.TENTI_PINEAPPLE)) {
quest.setStage(player, 60);
npc("Great! Just what I've been looking for! Mmmmmmm...", "Delicious!! This is so nice! Mmmmm, *SLURP*", "Yummmm... Oh yes, this is great.");
stage = 10;
}
break;
case 10:
player("Sorry, I don't have it yet.");
stage++;
break;
case 11:
end();
break;
}
break;
case 40:
switch (stage) {
case 0:
player("I'd like to mine in a different area.");
stage++;
break;
case 1:
npc("Oh, you want to work in another area of the mine eh?", "<col=08088A>-- The guard seems pleased with his rhetorical question.--", "Well, I can understand that! A change is as good as a", "rest they say.");
stage++;
break;
case 2:
player("Yes sir, you're quite right sir.");
stage++;
break;
case 3:
npc("Of course I'm right. And what goes around comes", "around as they say. And it's been absolutely ages since", "I've had anything different to eat.");
stage++;
break;
case 4:
npc("What I wouldn't give for some whole, fresh, ripe and", "juicy pineapple for a change. And those Tenti's have the", "best pineapple in this entire area.");
stage++;
break;
case 5:
interpreter.sendDialogue("The guard winks at you.");
stage++;
break;
case 6:
npc("I'm sure you get my meaning...");
stage++;
break;
case 7:
player("Yes sir, we understand each other perfectly.");
stage++;
break;
case 8:
npc("Okay, good the. And remember, I prefer my", "pineapples whole, not chopped up with all the juice gone.");
stage++;
break;
case 9:
interpreter.sendDialogue("The guard moves back to his post and winks at you knowingly.");
stage++;
break;
case 10:
quest.setStage(player, 50);
end();
break;
}
break;
case 100:
case 60:
switch (stage) {
case 0:
player("You must be joking! The last one I got you cost me", "double shifts working copper ore! You should be", "grateful you got one at all.");
stage++;
break;
case 1:
end();
break;
case 10:
player("So, can I go through now please?");
stage++;
break;
case 11:
npc("Yes, yes, of course... a deal's a deal!");
stage++;
break;
case 12:
end();
break;
}
break;
default:
end();
break;
}
break;
default:
switch (quest.getStage(player)) {
default:
end();
break;
}
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001 };
}
/**
* The desert guard npc.
* @author 'Vexia
*/
public static final class DesertGuardNPC extends AbstractNPC {
/**
* Represents the last check.
*/
private int lastCheck;
/**
* Constructs a new {@code DesertGuardNPC} {@code Object}.
*/
public DesertGuardNPC() {
super(0, null);
}
/**
* Constructs a new {@code DesertGuardNPC} {@code Object}.
* @param id the id.
* @param location the location.
*/
public DesertGuardNPC(int id, Location location) {
super(id, location);
}
@Override
public AbstractNPC construct(int id, Location location, Object... objects) {
return new DesertGuardNPC(id, location);
}
@Override
public void tick() {
if (lastCheck < GameWorld.getTicks()) {
lastCheck = GameWorld.getTicks() + RandomFunction.random(50, 150);
if (!inCombat()) {
warn();
}
}
super.tick();
}
/**
* Method used to warn players whom are breaking rules.
*/
private void warn() {
final List<Player> players = RegionManager.getLocalPlayers(this);
for (final Player player : players) {
if (player.getAttribute("guard-warning", 0) > GameWorld.getTicks() || !player.getZoneMonitor().isInZone("mining camp") || player.inCombat() || !player.getLocation().withinDistance(this.getLocation(), 8)) {
continue;
}
if (TouristTrap.inJail(player)) {
continue;
}
if (!TouristTrap.hasSlaveClothes(player)) {
player.setAttribute("guard-warning", GameWorld.getTicks() + 300);
player.lock();
GameWorld.getPulser().submit(new Pulse(1, this, player) {
int count;
@Override
public boolean pulse() {
switch (++count) {
case 1:
face(player);
if (!TouristTrap.hasSlaveClothes(player)) {
sendChat("Hey, they're interesting clothes!");
player.getPacketDispatch().sendMessage("Guard: You're no slave.");
} else {
sendChat("Hey - you with the armour!");
player.getPacketDispatch().sendMessage("Guard: Hey - You with the armour!");
}
break;
case 5:
if (!TouristTrap.hasSlaveClothes(player)) {
sendChat("You're no slave.");
player.getPacketDispatch().sendMessage("Guard: What are you doing in here?");
} else {
sendChat("You're not allowed in here!");
player.getPacketDispatch().sendMessage("Guard: You're not allowed in here!");
}
break;
case 8:
sendChat("Intel the cell you go! I hope this teaches you a lesson.");
getProperties().getCombatPulse().attack(player);
break;
case 10:
if (!TouristTrap.inJail(player)) {
TouristTrap.jail(player);
}
break;
}
return false;
}
});
break;
}
}
}
@Override
public int[] getIds() {
return new int[] { 4993, 4994, 4995, 4996, 4997, 4998, 4999, 5000, 5001, 5002 };
}
}
}
@@ -0,0 +1,237 @@
package content.region.desert.quest.thetouristrap;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.skill.Skills;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
/**
* Represents the irena dialogue used during tourist trap.
* @author 'Vexia
* @version 1.0
*/
public final class IrenaDialogue extends DialoguePlugin {
/**
* The array of skills to choose.
*/
private static final int[] SKILLS = new int[] { Skills.FLETCHING, Skills.AGILITY, Skills.SMITHING, Skills.THIEVING };
/**
* Represents the quest.
*/
private Quest quest;
/**
* Constructs a new {@code IrenaDialogue} {@code Object}.
*/
public IrenaDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code IrenaDialogue} {@code Object}.
* @param player the player.
*/
public IrenaDialogue(final Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new IrenaDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
if (quest.getStage(player) == 95 && player.getInventory().containsItem(TouristTrap.ANNA_BARREL)) {
npc("Hey, great you've found Ana!");
stage = 900;
return true;
}
switch (quest.getStage(player)) {
case 98:
npc("Thank you very much for returning my daughter to", "me. I'm really very grateful... I would like to reward", "you for your bravery and daring.");
stage++;
break;
case 0:
interpreter.sendDialogue("Irena seems to be very upset and cries as you approach her.");
break;
case 100:
case 95:
case 99:
player.getPacketDispatch().sendMessage("Irena seems happy now that her daughter has returned home.");
npc("Thanks so much for returning my daughter to me.", "I expect that she will go on another trip soon though.", "She is the adventurous type... a bit like yourself really!", "Okay, see you around then!");
break;
default:
npc("*Sob* Have you found my daughter yet?");
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 900:
interpreter.sendDialogues(823, null, "<col=08088A>-- You show Irena the barrel with Ana in it. --", "Hey great, there's my Mum!");
stage++;
return true;
case 901:
player.getInventory().remove(TouristTrap.ANNA_BARREL);
end();
quest.setStage(player, 98);
player.getDialogueInterpreter().open(822);
return true;
}
switch (quest.getStage(player)) {
case 98:// reward.
switch (stage) {
case 1:
npc("I can offer you increased knowledge in two of the", "following areas.");
stage++;
break;
case 2:
options("Fletching.", "Agility.", "Smithing.", "Thieving.");
stage++;
break;
case 3:
player.setAttribute("first-skill", buttonId);
npc("Okay, now choose your second skills.");
stage++;
break;
case 4:
options("Fletching.", "Agility.", "Smithing.", "Thieving.");
stage++;
break;
case 5:
player.setAttribute("second-skill", buttonId);
npc("Okay, that's all the skills I can teach you!");
stage++;
break;
case 6:
int skills[] = new int[] { SKILLS[player.getAttribute("first-skill", 0) - 1], SKILLS[player.getAttribute("second-skill", 0) - 1] };
for (int i : skills) {
player.getSkills().addExperience(i, 4650);
}
quest.finish(player);
end();
break;
}
break;
case 0:
switch (stage) {
case 0:
if (quest.hasRequirements(player)) {
npc("Boo hoo! Oh dear, my only daughter....");
stage++;
} else {
npc("Boo hoo! Go away!");
stage = 99;
}
break;
case 1:
player("What's the matter?");
stage++;
break;
case 2:
npc("Oh dear... my daughter, Ana, has gone missing in the", "desert. I fear that she is lost, or perhaps... *sob* even", "worse.");
stage++;
break;
case 3:
player("When did she go into the desert?");
stage++;
break;
case 4:
npc("*Sob* she went in there just a few days ago, *Sob*", "she said she would be back yesterday.");
stage++;
break;
case 5:
npc("*Sob* And she's not...");
stage++;
break;
case 6:
player("Is there a reward if I get her back?");
stage++;
break;
case 7:
npc("Well, yes, you'll have my gratitude young man.");
stage++;
break;
case 8:
npc("And I'm sure that Ana will also be very pleased! And I", "may see if I can get a small reward together... But I", "cannot promise anything. So does that mean that you'll", "look for her then?");
stage++;
break;
case 9:
player("Okay Irena, calm down. I'll get your daughter back for", "you.");
stage++;
break;
case 10:
npc("That would be great! That's really very nice of you!", "She was wearing a red silk scarf when she left.");
stage++;
break;
case 11:
npc("Are you 'really' sure you want to do this? I mean, go", "on this quest?");
stage++;
break;
case 12:
player("Yes, I'll go on this quest!");
stage++;
break;
case 13:
npc("Oh thank you! You've made me a very happy mother, I", "just hope it's not too late!");
stage++;
break;
case 14:
player("Do you have any other hints on where she may have", "gone?");
stage++;
break;
case 15:
npc("I did go looking for her myself and I came across some", "footprints just a little way south. I'm worried that they", "lead to the desert mining camp.");
stage++;
break;
case 16:
quest.start(player);
end();
break;
case 99:
end();
break;
}
break;
case 10:
switch (stage) {
case 0:
player("No, not yet.");
stage++;
break;
case 1:
npc("Please! Hurry up.");
stage++;
break;
case 2:
end();
break;
}
break;
case 100:
case 95:
case 99:
player.getPacketDispatch().sendMessage("Irena goes back to work.");
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 4986 };
}
}
@@ -0,0 +1,364 @@
package content.region.desert.quest.thetouristrap;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.Item;
import core.game.system.task.Pulse;
import core.game.world.GameWorld;
import core.game.world.map.Location;
import core.tools.RandomFunction;
/**
* The dialogue for the male slave at the desert camp.
* @author 'Vexia
* @version 1.0
*/
public final class MaleSlaveDialogue extends DialoguePlugin {
/**
* The quest instance.
*/
private Quest quest;
/**
* Constructs a new {@code MaleSlaveDialogue} {@code Object}.
*/
public MaleSlaveDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code MaleSlaveDialogue} {@code Object}.
* @param player the player.
*/
public MaleSlaveDialogue(final Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new MaleSlaveDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (npc.getShownNPC(player).getId()) {
case 4985:
case 825:
switch (quest.getStage(player)) {
case 40:
npc("Do you want to trade clothes now?");
break;
case 30:
npc("Hello again, do you want to try and unlock my chains?", "I'd really appreciate it!");
break;
case 20:
npc("You look like a new 'recruit'. How long have you been", "here?");
break;
case 100:
npc("Oh bother, I was caught by the guards again... Listen, if", "you can get me some Desert Clothes, I'll trade you for my", "slave clothes again... Do you want to trade?");
break;
default:
npc("Please, just leave me alone my life is", "terrible as it is.");
break;
}
break;
case 826:
switch (quest.getStage(player)) {
default:
npc("Yay! I'm finally free.");
stage = 0;
break;
}
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (npc.getShownNPC(player).getId()) {
case 4985:
case 825:
switch (quest.getStage(player)) {
case 30:
switch (stage) {
case 0:
player("Yeah, okay, let's give it a go.");
stage++;
break;
case 1:
quest.setStage(player, 40);
npc("Great! You did it! Do you want to trade clothes now?");
stage = 0;
break;
}
break;
case 40:
switch (stage) {
case 0:
player("Yes, I'll trade.");
stage = 11;
break;
case 11:
if (!TouristTrap.hasDesertClothes(player)) {
npc("I need desert boots, a desert robe and a desert", "shirt if you want these clothes off me.");
stage++;
} else {
npc("Great! You have the Desert Clothes! <col=08088A>-- the slave starts", "<col=08088A>undressing right in front of you --</col> Okay, here's the", "clothes, I won't need them anymore.");
stage += 2;
}
break;
case 12:
end();
break;
case 13:
interpreter.sendItemMessage(1845, "The slave gives you his dirty, flea infested robe.");
stage++;
break;
case 14:
interpreter.sendItemMessage(1844, "The slave gives you his muddy, sweat soaked shirt.");
stage++;
break;
case 15:
interpreter.sendItemMessage(1846, "The slave gives you a smelly pair of decomposing boots.");
stage++;
break;
case 16:
if (player.getEquipment().remove(TouristTrap.DESERT_CLOTHES)) {
stage++;
npc("Right, I'm off! Good luck!");
TouristTrap.addConfig(player, (1 << 4));
for (Item item : TouristTrap.SLAVE_CLOTHES) {
player.getEquipment().add(item, true, false);
}
player.getPacketDispatch().sendMessages("The slave takes your desert robe.", "The slave takes your desert shirt.", "The slave takes your desert boots.");
}
break;
case 17:
player("Yeah, good luck to you too!");
break;
}
break;
case 20:
switch (stage) {
case 0:
player("I've just arrived.");
stage++;
break;
case 1:
npc("Yeah, it looks like it as well. It's a shame that I won't be", "around long enough to get to know you. I'm making a", "break for it today. I have a plan to get out of here! It's", "amazing in its sophistication.");
stage++;
break;
case 2:
player("Oh yes, that sounds interesting.");
stage++;
break;
case 3:
npc("Yes, it is actually. I have all the details figured out", "except for one.");
stage++;
break;
case 4:
player("What's that then?");
stage++;
break;
case 5:
npc("<col=08088A>-- The slave rattles the chains on his arms loudly. --", "</col>These bracelets, I can't seem to get them off. If I", "could get them off, I'd be able to climb my way out of", "here.");
stage++;
break;
case 6:
player("I can try to undo them for you.");
stage++;
break;
case 7:
npc("Really, that would be great... <col=08088A>--The slave looks at you", "<col=08088A>strangely. --</col> Hang on a minute... I suppose you want", "something for doing this?");
stage++;
break;
case 8:
npc("The last time I did a trade in this place, I nearly lost", "the shirt from my back!");
stage++;
break;
case 9:
player("It's funny you should say that actually.");
stage++;
break;
case 10:
npc("<col=08088A>-- the slave looks at you blankly. --");
stage++;
break;
case 11:
npc("Yeah, go on!");
stage++;
break;
case 12:
player("If I can get the chains off, you have to give me", "something, okay?");
stage++;
break;
case 13:
npc("Sure, what do you want?");
stage++;
break;
case 14:
player("I want your clothes!");
stage++;
break;
case 15:
npc("Blimey!");
stage++;
break;
case 16:
player("I can dress like a slave and gain access to the mine", "area to scout it out.");
stage++;
break;
case 17:
npc("You're either incredibly brave or incredibly stupid. But", "what would I wear if you take my clothes? Get me", "some nice desert clothes and I'll think about it?");
stage++;
break;
case 18:
npc("Do you still want to try and undo the locks for me?");
stage++;
break;
case 19:
player("Yeah, okay, let's give it a go.");
stage++;
break;
case 20:
npc("Great!");
stage++;
break;
case 21:
interpreter.sendDialogue("You use some nearby bits of wood and wire to try and pick the lock.");
stage++;
break;
case 22:
final int random = RandomFunction.random(3);
if (random == 1) {
interpreter.sendDialogue("You didn't manage to pick the lock this time would you like another", "go?");
stage++;
} else if (random == 2) {
interpreter.sendDialogue("A nearby guard spots you!");
stage = 24;
} else {
quest.setStage(player, 40);
npc("Great! You did it! Do you want to trade clothes now?");
stage = 0;
}
break;
case 23:
player("Yeah, I'll give it another go.");
stage = 21;
break;
case 24:
player.lock();
interpreter.sendDialogues(getIds()[0], null, true, "Oh oh!");
GameWorld.getPulser().submit(new Pulse(4, player) {
int counter;
@Override
public boolean pulse() {
switch (++counter) {
case 1:
interpreter.sendDialogues(4993, null, true, "Oi, what are you two doing?");
break;
case 2:
end();
player.getPacketDispatch().sendMessage("Slave: Oh oh!");
player.getPacketDispatch().sendMessage("Guard: Oi, what are you two doing?");
;
player.getPacketDispatch().sendMessage("The guards search you!");
break;
case 3:
player.getPacketDispatch().sendMessage("You are roughed up by the guards and manhandled into a cell.");
break;
case 4:
player.unlock();
quest.setStage(player, 30);
player.getProperties().setTeleportLocation(Location.create(3285, 3034, 0));
return true;
}
return false;
}
});
stage++;
break;
case 25:
interpreter.sendDialogues(4993, null, true, "Oi, what are you two doing?");
break;
}
break;
case 100:
switch (stage) {
case 0:
player("Yes, I'll trade.");
stage++;
break;
case 1:
if (!TouristTrap.hasDesertClothes(player)) {
npc("I need desert boots, a desert robe and a desert", "shirt if you want these clothes off me.");
stage++;
break;
}
npc("Great! You have the Desert Clothes! <col=08088A>-- the slave starts", "<col=08088A>undressing right in front of you --</col> Okay, here's the", "clothes, I won't need them anymore.");
stage = 13;
break;
case 2:
end();
break;
case 13:
interpreter.sendItemMessage(1845, "The slave gives you his dirty, flea infested robe.");
stage++;
break;
case 14:
interpreter.sendItemMessage(1844, "The slave gives you his muddy, sweat soaked shirt.");
stage++;
break;
case 15:
interpreter.sendItemMessage(1846, "The slave gives you a smelly pair of decomposing boots.");
stage++;
break;
case 16:
if (player.getEquipment().remove(TouristTrap.DESERT_CLOTHES)) {
stage++;
npc("Right, I'm off! Good luck!");
TouristTrap.addConfig(player, (1 << 4));
player.getEquipment().add(TouristTrap.SLAVE_CLOTHES);
player.getPacketDispatch().sendMessages("The slave takes your desert robe.", "The slave takes your desert shirt.", "The slave takes your desert boots.");
}
break;
case 17:
player("Yeah, good luck to you too!");
break;
}
break;
default:
switch (stage) {
case 0:
end();
break;
}
break;
}
break;
case 826:
switch (quest.getStage(player)) {
default:
end();
break;
}
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 825, 826, 4985 };
}
}
@@ -0,0 +1,209 @@
package content.region.desert.quest.thetouristrap;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.Entity;
import core.game.node.entity.npc.AbstractNPC;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.world.map.Location;
import core.plugin.ClassScanner;
/**
* Represents the mercenary captain dialogue plugin.
* @author 'Vexia
* @version 1.0
*/
public final class MercenaryCaptainDialogue extends DialoguePlugin {
/**
* Represents the quest.
*/
private Quest quest;
/**
* Constructs a new {@code MercenaryCaptainDialogue} {@code Object}.
*/
public MercenaryCaptainDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code MercenaryCaptainDialogue} {@code Object}.
* @param player the player.
*/
public MercenaryCaptainDialogue(final Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new MercenaryCaptainDialogue(player);
}
@Override
public void init() {
super.init();
ClassScanner.definePlugin(new MercenaryCaptain());
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (quest.getStage(player)) {
case 11:
interpreter.sendDialogue("You approach the Mercenary Captain.");
break;
default:
npc("What are you doing here?");
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (quest.getStage(player)) {
default:
switch (stage) {
case 0:
player("Nothing, just passing by.");
stage++;
break;
case 1:
end();
break;
}
break;
case 11:
switch (stage) {
case 0:
player("Wow! A real captain!");
stage++;
break;
case 1:
npc("Be off effendi, you are not wanted around here.");
stage++;
break;
case 2:
player("I'd love to work for a tough guy like you!");
stage++;
break;
case 3:
npc("Hmmm, oh yes, what can you do?");
stage++;
break;
case 4:
player("Can't I do something for a strong Captain like you?");
stage++;
break;
case 5:
interpreter.sendDialogue("The Captain ponders a moment and then looks at you critically.");
stage++;
break;
case 6:
npc("You could bring me the head of Al Zaba Bhasim.");
stage++;
break;
case 7:
npc("He is the leader of the notorious desert bandits, they", "plague us daily. You should find them west of here.", "You should have no problem in finishing them all off.", "Do this for me and maybe I will consider helping you.");
stage++;
break;
case 8:
player("Sorry Sir, I don't think I can do that.");
stage++;
break;
case 9:
npc("Hmm, well yes, I did consider that you might not be", "right for the job. be off with you then before I turn", "my men loose on you.");
stage++;
break;
case 10:
player("It's a funny captain who can't fight his own battles!");
stage++;
break;
case 11:
interpreter.sendDialogue("The men around you fall silent and the Captain silently fumes. All", "eyes turn to the Captain...");
stage++;
break;
case 12:
npc("Very well, if you're challenging me, let's get on with it!");
stage++;
break;
case 13:
interpreter.sendDialogue("The guards gather around to watch the fight.");
stage++;
break;
case 14:
end();
npc.getProperties().getCombatPulse().attack(player);
break;
}
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 830 };
}
/**
* The mercenary captain npc.
* @author 'Vexia
*/
public static final class MercenaryCaptain extends AbstractNPC {
/**
* Constructs a new {@code MercenaryCaptain} {@code Object}.
*/
public MercenaryCaptain() {
super(0, null);
}
/**
* Constructs a new {@code MercenaryCaptain} {@code Object}.
* @param id the id..
* @param location the location.
*/
public MercenaryCaptain(int id, Location location) {
super(id, location);
}
@Override
public AbstractNPC construct(int id, Location location, Object... objects) {
return new MercenaryCaptain(id, location);
}
@Override
public void finalizeDeath(Entity killer) {
super.finalizeDeath(killer);
if (killer instanceof Player) {
final Player player = (Player) killer;
final Quest quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (quest.getStage(player)) {
case 0:
case 10:
break;
default:
if (!player.getInventory().containsItem(TouristTrap.METAL_KEY) && !player.getBank().containsItem(TouristTrap.METAL_KEY)) {
player.getInventory().add(TouristTrap.METAL_KEY, player);
player.getDialogueInterpreter().sendItemMessage(TouristTrap.METAL_KEY, "The mercenary captain drops a metal key on the floor.", "You quickly grab the key and add it to your inventory.");
}
quest.setStage(player, 20);
break;
}
}
}
@Override
public int[] getIds() {
return new int[] { 830 };
}
}
}
@@ -0,0 +1,204 @@
package content.region.desert.quest.thetouristrap;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.Item;
/**
* Represents the mercenary dialogue plugin.
* @author 'Vexia
* @version 1.0
*/
public final class MercenaryDialogue extends DialoguePlugin {
/**
* Represents the coins item to bribe.
*/
private static final Item COINS = new Item(995, 5);
/**
* Represents the quest.
*/
private Quest quest;
/**
* Constructs a new {@code MercenaryDialogue} {@code Object}.
*/
public MercenaryDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code MercenaryDialogue} {@code Object}.
* @param player the player.
*/
public MercenaryDialogue(final Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new MercenaryDialogue(player);
}
@Override
public boolean open(Object... args) {
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (quest.getStage(player)) {
default:
npc("What are you doing here?");
break;
case 10:
npc("Yeah, what do you want?");
break;
case 100:
npc("What are you looking at?");
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (quest.getStage(player)) {
default:
switch (stage) {
case 0:
player("Nothing, just passing by.");
stage++;
break;
case 1:
end();
break;
}
break;
case 10:
switch (stage) {
case 0:
player("I'm looking for a woman called Ana, have you seen her?");
stage++;
break;
case 1:
npc("No, now get lost!");
stage++;
break;
case 2:
player("Perhaps five gold coins will help you remember?");
stage++;
break;
case 3:
npc("Well, it certainly will help!");
stage = 4;
break;
case 4:
if (!player.getInventory().containsItem(COINS)) {
player("Sorry, I don't seem to have enough coins.");
stage++;
break;
}
if (player.getInventory().remove(COINS)) {
interpreter.sendItemMessage(COINS, "-- The guard takes the five gold coins. --");
stage = 6;
}
break;
case 5:
end();
break;
case 6:
npc("Now then, what did you want to know?");
stage++;
break;
case 7:
player("I'm looking for a woman called Ana, have you seen her?");
stage++;
break;
case 8:
npc("Hmm, well, we get a lot of people in here. But not", "many women through... Saw one come in last week....");
stage++;
break;
case 9:
npc("But I don't know if it's the woman you're looking for?");
stage++;
break;
case 10:
player("What are you guarding?");
stage = 11;
break;
case 11:
npc("Well, if you have to know, we're making sure that no", "prisoners get out. <col=08088A>-- The guard gives you a", "<col=08088A>disapproving look. -- </col>And to make sure that", "unauthorised people don't get in.");
stage = 12;
break;
case 12:
npc("<col=08088A>-- The guard looks around nervously. --</col> You'd better", "go soon before the Captain orders us to kill you.");
stage++;
break;
case 13:
player("Does the Captain order you to kill a lot of people?");
stage++;
break;
case 14:
npc("<col=08088A>-- The guard snorts. --</col> *Snort* Just about anyone", "who talks to him.");
stage++;
break;
case 15:
npc("Unless he has a use for you, he'll probably just order", "us to kill you. And it's such a horrible job cleaning up", "the mess afterwards.");
stage++;
break;
case 16:
player("Not to mention the senseless waste of human life.");
stage++;
break;
case 17:
npc("Huh? Them's your words, not mine.");
stage++;
break;
case 18:
player("It doesn't sound as if you respect your Captain much.");
stage++;
break;
case 19:
interpreter.sendDialogue("-- The guard looks around conspiratorially. --");
stage++;
break;
case 20:
npc("Well, to be honest. We think he's not exactly as brave", "as he makes out. But we have to follow his orders. If", "someone called him a coward, or managed to trick him", "into a one-on-one duel many of us bet that he'd be");
stage++;
break;
case 21:
npc("beaten.");
stage++;
break;
case 22:
player("And how could I trick him into a one-on-one duel?");
stage++;
break;
case 23:
npc("Like all cowards, he likes to be made to feel important.", "If anyone insults him outright, he just gets us to do his", "dirty work. However, if he thinks he's better than you,", "if you compliment him, he may feel that he can defeat");
stage = 24;
break;
case 24:
npc("you. And if he initiated a duel, all the men agreed that", "they wouldn't intervene. We think he'd be slaughtered", "in double quick time.");
stage++;
break;
case 25:
quest.setStage(player, 11);
end();
break;
}
break;
case 100:
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 4989, 4990, 4991, 4992 };
}
}
@@ -0,0 +1,60 @@
package content.region.desert.quest.thetouristrap;
import core.game.node.entity.npc.AbstractNPC;
import core.game.world.GameWorld;
import core.game.world.map.Location;
import core.tools.RandomFunction;
/**
* The mining slave npc at the desert camp.
* @author 'Vexia
*/
public final class MineSlaveNPC extends AbstractNPC {
/**
* The random force chats to say.
*/
private static final String[] CHATS = new String[] { "I'm sick of this place.", "What I wouldn't give for a good nights rest.", "I feel so weak I could faint.", "I didn't want to be a miner anyway.", "Ooh my back.", "I'm rich in experience, poor in wealth.", "I can' think straight, i'm so tired." };
/**
* The delay until the next chat.
*/
private int delay;
/**
* Constructs a new {@code MineSlaveNPC} {@code Object}.
*/
public MineSlaveNPC() {
super(0, null);
}
/**
* Constructs a new {@code MineSlaveNPC} {@code Object}.
* @param id the id.
* @param location the location.
*/
public MineSlaveNPC(int id, Location location) {
super(id, location);
delay = GameWorld.getTicks() + RandomFunction.random(20, 100);
}
@Override
public AbstractNPC construct(int id, Location location, Object... objects) {
return new MineSlaveNPC(id, location);
}
@Override
public void tick() {
if (delay < GameWorld.getTicks()) {
sendChat(CHATS[RandomFunction.random(CHATS.length)]);
delay = GameWorld.getTicks() + RandomFunction.random(20, 100);
}
super.tick();
}
@Override
public int[] getIds() {
return new int[] { 4975, 4976, 4977, 4978 };
}
}
@@ -0,0 +1,216 @@
package content.region.desert.quest.thetouristrap;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.Item;
/**
* The dialogue plugin used to handle the minecart driver.
* @author 'Vexia
* @version 1.0
*/
public final class MinecartDriverDialogue extends DialoguePlugin {
/**
* The coins item.
*/
private static final Item COINS = new Item(995, 100);
/**
* The quest npc.
*/
private Quest quest;
/**
* Constructs a new {@code MinecartDriverDialogue} {@code Object}.
* @param player the player.
*/
public MinecartDriverDialogue(final Player player) {
super(player);
}
/**
* Constructs a new {@code MinecartDriverDialogue} {@code Object}.
*/
public MinecartDriverDialogue() {
/**
* empty.
*/
}
@Override
public DialoguePlugin newInstance(Player player) {
return new MinecartDriverDialogue(player);
}
@Override
public boolean open(Object... args) {
quest = player.getQuestRepository().getQuest(TouristTrap.NAME);
switch (quest.getStage(player)) {
case 90:
npc("Quickly, get in the back of the cart.");
break;
case 80:
interpreter.sendDialogue("The cart driver seems to be fastidiously cleaning his cart.", "It doesn't look as if he wants to be disturbed.");
break;
default:
player("Hello!");
break;
}
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (quest.getStage(player)) {
case 90:
switch (stage) {
case 0:
player("Okay, sorry.");
stage++;
break;
case 1:
end();
break;
case 24:
end();
break;
}
break;
case 80:
switch (stage) {
case 0:
player("Nice cart.");
stage++;
break;
case 1:
interpreter.sendDialogue("The cart driver looks around at you and tries to weigh you up.");
stage++;
break;
case 2:
npc("Hmmm.");
stage++;
break;
case 3:
interpreter.sendDialogue("He tuts to himself and starts checking the wheels.");
stage++;
break;
case 4:
player("One wagon wheel says to the other, 'I'll see you", "around'.");
stage++;
break;
case 5:
npc("<col=08088A>-- The cart driver smirks a little. --");
stage++;
break;
case 6:
interpreter.sendDialogue("He starts checking the steering on the cart.");
stage++;
break;
case 7:
player("One good turn deserves another.");
stage++;
break;
case 8:
interpreter.sendDialogue("The cart driver smiles a bit and then turns to you.");
stage++;
break;
case 9:
npc("Are you trying to get me fired?");
stage++;
break;
case 10:
player("Fired.... no, shot perhaps!");
stage++;
break;
case 11:
npc("Ha ha ha! <col=08088A>-- The cart driver checks that", "<col=08088A>guards aren't watching. -- </col>What're you in fer?");
stage++;
break;
case 12:
player("In for a penny in for a pound.");
stage++;
break;
case 13:
interpreter.sendDialogue("The cart drivers laughs at your pun...");
stage++;
break;
case 14:
npc("Ha ha ha, oh stop it!");
stage++;
break;
case 15:
interpreter.sendDialogue("The cart driver seems much happier now.");
stage++;
break;
case 16:
npc("What can I do for you anyway?");
stage++;
break;
case 17:
player("Well, you see, it's like this...");
stage++;
break;
case 18:
npc("Yeah!");
stage++;
break;
case 19:
player("There's ten gold in it for you if you leave now no", "questions asked.");
stage++;
break;
case 20:
npc("If you're going to bribe me, at least make it worth my", "while. Now, let's say 100 Gold pieces should we? Ha ha", "ha!");
stage++;
break;
case 21:
player("A hundred it is!");
stage++;
break;
case 22:
npc("Great!");
stage++;
break;
case 23:
if (!player.getInventory().containsItem(COINS)) {
player.getPacketDispatch().sendMessage("You need 100 gold coins.");
end();
return true;
}
if (player.getInventory().remove(COINS)) {
quest.setStage(player, 90);
npc("Okay, get in the back of the cart then!");
stage++;
}
break;
case 24:
end();
break;
}
break;
default:
switch (stage) {
case 0:
npc("Hello, what do you want?");
stage++;
break;
case 1:
player("Nothing, just passing by.");
stage++;
break;
case 2:
end();
break;
}
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 841 };
}
}
@@ -0,0 +1,113 @@
package content.region.desert.quest.thetouristrap;
import core.game.interaction.Option;
import core.game.node.Node;
import core.game.node.entity.Entity;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.system.task.Pulse;
import core.game.world.GameWorld;
import core.game.world.map.Location;
import core.game.world.map.zone.MapZone;
import core.game.world.map.zone.ZoneBorders;
import core.game.world.map.zone.ZoneBuilder;
import core.plugin.Plugin;
/**
* The map zone for the mining camp.
* @author 'Vexia
* @version 1.0
*/
public final class MiningCampZone extends MapZone implements Plugin<Object> {
/**
* Constructs a new {@code MiningCampZone} {@code Object}.
*/
public MiningCampZone() {
super("mining camp", true);
}
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
ZoneBuilder.configure(this);
return this;
}
@Override
public boolean enter(Entity entity) {
return super.enter(entity);
}
@Override
public boolean leave(Entity e, boolean logout) {
if (!logout && e instanceof Player) {
if (checkAnna((Player) e)) {
return false;
}
}
return super.leave(e, logout);
}
@Override
public boolean interact(Entity e, final Node node, Option option) {
switch (option.getName()) {
case "Equip":
case "Wear":
final Player player = (Player) e;
GameWorld.getPulser().submit(new Pulse(1, player) {
@Override
public boolean pulse() {
if (TouristTrap.isJailable(player)) {
TouristTrap.jail(player, "Hey! What do you think you're doing!?");
}
return true;
}
});
break;
}
return super.interact(e, node, option);
}
@Override
public boolean teleport(Entity entity, final int type, Node node) {
if (entity instanceof Player && type != -1) {
return !checkAnna((Player) entity);
} else {
return super.teleport(entity, type, node);
}
}
/**
* Checks for anna.
* @param p the player.
* @return {@code True} if removed.
*/
public boolean checkAnna(final Player p) {
final Quest quest = p.getQuestRepository().getQuest(TouristTrap.NAME);
if (p.getAttribute("ana-delay", 0) > GameWorld.getTicks()) {
return false;
}
if (quest.getStage(p) > 60 && quest.getStage(p) < 95 && p.getInventory().containsItem(TouristTrap.ANNA_BARREL)) {
p.getInventory().remove(TouristTrap.ANNA_BARREL);
p.lock(5);
TouristTrap.addConfig(p, (1 << 4));
quest.setStage(p, 61);
p.getProperties().setTeleportLocation(Location.create(3285, 3034, 0));
p.getPacketDispatch().sendMessage("The guards spot anna and throw you in jail.");
return true;
}
return false;
}
@Override
public void configure() {
register(new ZoneBorders(3274, 3014, 3305, 3041));
register(new ZoneBorders(3260, 9408, 3331, 9472));
}
@Override
public Object fireEvent(String identifier, Object... args) {
return null;
}
}
@@ -0,0 +1,92 @@
package content.region.desert.quest.thetouristrap;
import core.cache.def.impl.NPCDefinition;
import core.game.interaction.OptionHandler;
import core.game.node.Node;
import core.game.node.entity.Entity;
import core.game.node.entity.npc.AbstractNPC;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.item.GroundItemManager;
import core.game.node.item.Item;
import core.game.world.map.Location;
import core.plugin.Plugin;
import core.plugin.ClassScanner;
import core.tools.RandomFunction;
/**
* The rowdy slave npc.
* @author 'Vexia
* @version 1.0
*/
public final class RowdySlaveNPC extends AbstractNPC {
/**
* The chats to say when talked to.
*/
private static final String[] CHATS = new String[] { "Oi! Are you looking at me?", "I'm going to teach you some respect!", "Hey, you're in for a good beating!" };
/**
* Constructs a new {@code RowdySlaveNPC} {@code Object}.
*/
public RowdySlaveNPC() {
super(0, null);
}
/**
* Constructs a new {@code RowdySlaveNPC} {@code Object}.
* @param id the id.
* @param location the location.
*/
public RowdySlaveNPC(int id, Location location) {
super(id, location);
this.setAggressive(true);
}
@Override
public AbstractNPC construct(int id, Location location, Object... objects) {
return new RowdySlaveNPC(id, location);
}
@Override
public void finalizeDeath(Entity killer) {
super.finalizeDeath(killer);
if (killer instanceof Player) {
final Player player = (Player) killer;
GroundItemManager.create(new Item(526), getLocation(), player);
if (!TouristTrap.hasSlaveClothes(player) && !player.getEquipment().containsItems(TouristTrap.SLAVE_CLOTHES)) {
player.getPacketDispatch().sendMessages("The slave drops his shirt.", "The slave drops his robe.", "The slave drops his boots.");
for (Item i : TouristTrap.SLAVE_CLOTHES) {
GroundItemManager.create(i, getLocation(), player);
}
}
}
}
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
ClassScanner.definePlugin(new OptionHandler() {
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
NPCDefinition.forId(getIds()[0]).getHandlers().put("option:talk-to", this);
return this;
}
@Override
public boolean handle(Player player, Node node, String option) {
((NPC) node).sendChat(CHATS[RandomFunction.random(CHATS.length)]);
((NPC) node).attack(player);
return true;
}
});
return super.newInstance(arg);
}
@Override
public int[] getIds() {
return new int[] { 827 };
}
}
@@ -0,0 +1,310 @@
package content.region.desert.quest.thetouristrap;
import core.game.component.Component;
import core.game.container.impl.EquipmentContainer;
import core.game.node.entity.skill.Skills;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.Item;
import core.game.system.task.Pulse;
import core.game.world.GameWorld;
import core.game.world.map.Location;
import core.game.world.map.zone.ZoneBorders;
import core.plugin.Initializable;
import core.plugin.ClassScanner;
/**
* The main type for the tourist trap quest.
* @author Aero
* @author Vexia
*
*/
@Initializable
public final class TouristTrap extends Quest {
/**
* The name of the quest.
*/
public static final String NAME = "The Tourist Trap";
/**
* The metal key item.
*/
public static final Item METAL_KEY = new Item(1839);
/**
* The desert gear items.
*/
public static final Item[] DESERT_CLOTHES = new Item[] { new Item(1833), new Item(1835), new Item(1837) };
/**
* The slave clothes items.
*/
public static final Item[] SLAVE_CLOTHES = new Item[] { new Item(1846), new Item(1844), new Item(1845) };
/**
* Teh tenti pineapple item.
*/
public static final Item TENTI_PINEAPPLE = new Item(1851);
/**
* The cell door key item.
*/
public static final Item CELL_DOOR_KEY = new Item(1840);
/**
* The wrought iron key item.
*/
public static final Item WROUGHT_IRON_KEY = new Item(1843);
/**
* The bedabin key item.
*/
public static final Item BEDABIN_KEY = new Item(1852);
/**
* The config id for this quest.
*/
public static final int CONFIG_ID = 907;
/**
* The technical plans item.
*/
public static final Item TECHNICAL_PLANS = new Item(1850);
/**
* The prototype dart tip item.
*/
public static final Item PROTOTYPE_DART_TIP = new Item(1853);
/**
* The prototype dart item.
*/
public static final Item PROTOTYPE_DART = new Item(1849);
/**
* The barrel item.
*/
public static final Item BARREL = new Item(1841);
/**
* The anna barrel item.
*/
public static final Item ANNA_BARREL = new Item(1842);
/**
* The jail location.
*/
public static final Location JAIL = Location.create(3285, 3034, 0);
/**
* The zone borders.
*/
public static final ZoneBorders JAIL_BORDER = new ZoneBorders(3284, 3032, 3287, 3037);
/**
* The slots to check for items on.
*/
public static final int[] SLOTS = new int[] { EquipmentContainer.SLOT_WEAPON, EquipmentContainer.SLOT_FEET, EquipmentContainer.SLOT_SHIELD, EquipmentContainer.SLOT_HAT, EquipmentContainer.SLOT_CHEST, EquipmentContainer.SLOT_LEGS };
/**
* Constructs a new {@code TouristTrap} {@code Object}.
*/
public TouristTrap() {
super(NAME, 123, 122, 2, 197, 0, 1, 30);
}
@Override
public Quest newInstance(Object object) {
ClassScanner.definePlugins(new TouristTrapPlugin(), new AnaDialogue(), new CaptainSiadDialogue(), new DesertGuardDialogue(), new IrenaDialogue(), new MaleSlaveDialogue(), new MercenaryCaptainDialogue(), new MercenaryDialogue(), new MinecartDriverDialogue(), new MineSlaveNPC(), new MiningCampZone(), new RowdySlaveNPC(), new AlShabimDialogue(), new BedabinNomadDialogue());
return this;
}
@Override
public void drawJournal(Player player, int stage) {
super.drawJournal(player, stage);
switch (getStage(player)) {
case 0:
line(player, "<blue>I can start this quest by speaking to <red>Irena <blue>after I have<br><br><blue>gone through the <red>Shantay Pass, South of Al-Kharid.<br><br><blue>To complete this quest I need:-<br><br>" + (player.getSkills().getStaticLevel(Skills.FLETCHING) > 9 ? "<str>" : "<blue>") + "Level 10 Fletching<br><br>" + (player.getSkills().getStaticLevel(Skills.SMITHING) > 19 ? "<str>" : "<blue>") + "Level 20 Smithing" + (hasRequirements(player) ? "<br><br><blue>I have all the <red>requirements<blue> to begin and complete this<br><br><red>quest." : ""), 11);
break;
case 10:
case 11:
case 30:
case 40:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I need to head into <red>the desert<blue> and search for <red>Ana", 11);
break;
case 50:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I need to find the guard a <red>Tenti Pineapple<blue> for the guard.", 11);
break;
case 51:
case 52:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I have found a way to get <red>Tenti Pineapple<blue> I need to find<br><br><blue>the research plans that <red>Captain Siad<blue> has.", 11);
break;
case 53:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I have found a way to get <red>Tenti Pineapple<blue><br><br><blue>I found the technical plans <red>Al Shabim<blue> was looking for.", 11);
break;
case 54:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I have found a way to get <red>Tenti Pineapple<blue><br><br><blue>I need to manufacture the <red>Prototype<blue> weapon for <red>Al Shabim<blue>.", 11);
break;
case 60:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I manufactured the <red>Prototype<blue> weapon and received<br><br><blue>a tasty <red>Tenti Pineapple<blue>.", 11);
break;
case 61:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I finally found <red>Anna<blue>. I just need to find a way to smuggle<br><br><blue>her out of here.", 11);
break;
case 71:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I need to operate the <red>Winch<blue> to lift <red>Ana<blue> back up here.", 11);
break;
case 72:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I need to get <red>Ana<blue> from one of the barrels lifted.", 11);
break;
case 80:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I loaded <red>Ana<blue> into the <red>Cart<blue> I now need to get the <red>cart driver<blue> <br><br><blue>to transport it.", 11);
break;
case 90:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I payed the <red>Mine cart driver<blue> and he agreed to smuggle me and <red>Anna<blue><br><br><blue>out of the <red>Mining camp<blue>.", 11);
break;
case 95:
case 98:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I smuggled both me and <red>Anna<blue> from the <red>Mining camp<blue>. I should<br><br><blue>go tell <red>Irena<blue> straight away.", 11);
break;
case 100:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><str>I returned <str>Ana<str> back to her mother and was rewarded<br><br><str>with a <str>key<str> and the knowledge in two skills.<br><br><br><br><col=FF0000>QUEST COMPLETE!", 11);
break;
default:
line(player, "<str>Irena was distraught that her daughter Ana had vanished<br><br><str>somewhere in the desert, and I agreed to help find her.<br><br><blue>I need to head into <red>the desert<blue> and search for <red>Ana", 11);
break;
}
}
@Override
public void finish(Player player) {
super.finish(player);
player.getPacketDispatch().sendString("2 Quest Points", 277, 8+ 2);
player.getPacketDispatch().sendString("4650 XP in each of the two skills", 277, 9+ 2);
player.getPacketDispatch().sendString("Ability to make throwing darts", 277, 10+ 2);
player.getPacketDispatch().sendString("Access to desert mining camp", 277, 11+ 2);
player.getPacketDispatch().sendString("mithril and adamantite rocks.", 277, 12+ 2);
player.getPacketDispatch().sendItemZoomOnInterface(806, 230, 277, 3+ 2);
player.getQuestRepository().syncronizeTab(player);
player.getInventory().remove(new Item(1842, player.getInventory().getAmount(ANNA_BARREL)));
player.getBank().remove(new Item(1842, player.getBank().getAmount(ANNA_BARREL)));
}
/**
* Sends the player to jail.
* @param player the player.
*/
public static void jail(final Player player, String dialogue) {
player.getDialogueInterpreter().sendDialogues(4999, null, dialogue);
player.lock();
GameWorld.getPulser().submit(new Pulse(1) {
int counter;
@Override
public boolean pulse() {
switch (counter++) {
case 1:
player.lock();
player.getInterfaceManager().openOverlay(new Component(115));
break;
case 3:
player.getProperties().setTeleportLocation(Location.create(3285, 3034, 0));
player.getPacketDispatch().sendMessage("You are roughed up by the guards and manhandled into a cell.");
player.getInterfaceManager().closeOverlay();
player.getInterfaceManager().close();
player.unlock();
return true;
}
return false;
}
});
}
/**
* Jails a player.
* @param player the player.
*/
public static void jail(final Player player) {
jail(player, "Hey you! You're not supposed to be in here!");
}
/**
* Checks if the player is jailable.
* @param player the player.
* @return {@code True} if so.
*/
public static boolean isJailable(final Player player) {
if (inJail(player)) {
return false;
}
if (player.getEquipment().itemCount() > 3 || (!hasDesertClothes(player) && !hasSlaveClothes(player))) {
for (int i : SLOTS) {
if (player.getEquipment().get(i) != null) {
return true;
}
}
}
return false;
}
/**
* Adds a config value pertaining to this quest.
* @param player the player.
*/
public static void addConfig(final Player player, final int value) {
player.getConfigManager().set(CONFIG_ID, value, true);
}
/**
* Checks if the player has desert gear.
* @param player the player.
* @return {@code True} if so.
*/
public static boolean hasDesertClothes(final Player player) {
for (Item i : DESERT_CLOTHES) {
if (!player.getEquipment().containsItem(i)) {
return false;
}
}
return true;
}
/**
* Checks if the player has slave clothes.
* @param player the player.
* @return {@code True} if so.
*/
public static boolean hasSlaveClothes(final Player player) {
for (Item i : SLAVE_CLOTHES) {
if (!player.getEquipment().containsItem(i)) {
return false;
}
}
return true;
}
/**
* Checks if the player has armour.
* @param player the player.
* @return
*/
public static boolean hasArmour(final Player player) {
return player.getEquipment().itemCount() > 0 && !hasDesertClothes(player) && !hasSlaveClothes(player);
}
/**
* Checks if the player is in jail.
* @param player the player.
* @return {@code True} if so.
*/
public static boolean inJail(final Player player) {
return JAIL_BORDER.insideBorder(player);
}
@Override
public boolean hasRequirements(Player player) {
return player.getSkills().getStaticLevel(Skills.FLETCHING) > 9 && player.getSkills().getStaticLevel(Skills.SMITHING) > 19;
}
}
File diff suppressed because it is too large Load Diff