Refactored how quests are referred to internally

Fixed numerous requirement checks for Rag and Bone Man II, The Lost Tribe, The Tourist Trap, Waterfall Quest and The Fremennik Trials
This commit is contained in:
Player Name 2025-02-09 02:37:14 +00:00 committed by Ryan
parent c03947e0b0
commit d91f77c294
577 changed files with 2634 additions and 2138 deletions

View file

@ -1984,16 +1984,14 @@
"replaceId": "28518",
"fence": "false",
"metal": "true",
"autowalk": "true",
"questRequirement": "Icthlarin's Little Helper"
"autowalk": "true"
},
{
"id": "28514",
"replaceId": "28518",
"fence": "false",
"metal": "true",
"autowalk": "true",
"questRequirement": "Icthlarin's Little Helper"
"autowalk": "true"
},
{
"id": "21065",

View file

@ -100,7 +100,7 @@ public enum GodBook {
* @param page the page.
*/
public void insertPage(Player player, Item book, Item page) {
if (!hasRequirement(player, "Horror from the Deep"))
if (!hasRequirement(player, Quests.HORROR_FROM_THE_DEEP))
return;
if (hasPage(player, book, page)) {
player.sendMessage("The book already has that page.");

View file

@ -0,0 +1,158 @@
package content.data
enum class Quests(val questName: String) {
MYTHS_OF_THE_WHITE_LANDS("Myths of the White Lands"),
BLACK_KNIGHTS_FORTRESS("Black Knights' Fortress"),
COOKS_ASSISTANT("Cook's Assistant"),
DEMON_SLAYER("Demon Slayer"),
DORICS_QUEST("Doric's Quest"),
DRAGON_SLAYER("Dragon Slayer"),
ERNEST_THE_CHICKEN("Ernest the Chicken"),
GOBLIN_DIPLOMACY("Goblin Diplomacy"),
IMP_CATCHER("Imp Catcher"),
THE_KNIGHTS_SWORD("The Knight's Sword"),
PIRATES_TREASURE("Pirate's Treasure"),
PRINCE_ALI_RESCUE("Prince Ali Rescue"),
THE_RESTLESS_GHOST("The Restless Ghost"),
ROMEO_JULIET("Romeo & Juliet"),
RUNE_MYSTERIES("Rune Mysteries"),
SHEEP_SHEARER("Sheep Shearer"),
SHIELD_OF_ARRAV("Shield of Arrav"),
VAMPIRE_SLAYER("Vampire Slayer"),
WITCHS_POTION("Witch's Potion"),
ANIMAL_MAGNETISM("Animal Magnetism"),
BETWEEN_A_ROCK("Between a Rock..."),
BIG_CHOMPY_BIRD_HUNTING("Big Chompy Bird Hunting"),
BIOHAZARD("Biohazard"),
CABIN_FEVER("Cabin Fever"),
CLOCK_TOWER("Clock Tower"),
CONTACT("Contact!"),
ZOGRE_FLESH_EATERS("Zogre Flesh Eaters"),
CREATURE_OF_FENKENSTRAIN("Creature of Fenkenstrain"),
DARKNESS_OF_HALLOWVALE("Darkness of Hallowvale"),
DEATH_TO_THE_DORGESHUUN("Death to the Dorgeshuun"),
DEATH_PLATEAU("Death Plateau"),
DESERT_TREASURE("Desert Treasure"),
DEVIOUS_MINDS("Devious Minds"),
THE_DIG_SITE("The Dig Site"),
DRUIDIC_RITUAL("Druidic Ritual"),
DWARF_CANNON("Dwarf Cannon"),
EADGARS_RUSE("Eadgar's Ruse"),
EAGLES_PEAK("Eagles' Peak"),
ELEMENTAL_WORKSHOP_I("Elemental Workshop I"),
ELEMENTAL_WORKSHOP_II("Elemental Workshop II"),
ENAKHRAS_LAMENT("Enakhra's Lament"),
ENLIGHTENED_JOURNEY("Enlightened Journey"),
THE_EYES_OF_GLOUPHRIE("The Eyes of Glouphrie"),
FAIRYTALE_I_GROWING_PAINS("Fairytale I - Growing Pains"),
FAIRYTALE_II_CURE_A_QUEEN("Fairytale II - Cure a Queen"),
FAMILY_CREST("Family Crest"),
THE_FEUD("The Feud"),
FIGHT_ARENA("Fight Arena"),
FISHING_CONTEST("Fishing Contest"),
FORGETTABLE_TALE("Forgettable Tale..."),
THE_FREMENNIK_TRIALS("The Fremennik Trials"),
WATERFALL_QUEST("Waterfall Quest"),
GARDEN_OF_TRANQUILITY("Garden of Tranquility"),
GERTRUDES_CAT("Gertrude's Cat"),
GHOSTS_AHOY("Ghosts Ahoy"),
THE_GIANT_DWARF("The Giant Dwarf"),
THE_GOLEM("The Golem"),
THE_GRAND_TREE("The Grand Tree"),
THE_HAND_IN_THE_SAND("The Hand in the Sand"),
HAUNTED_MINE("Haunted Mine"),
HAZEEL_CULT("Hazeel Cult"),
HEROES_QUEST("Heroes' Quest"),
HOLY_GRAIL("Holy Grail"),
HORROR_FROM_THE_DEEP("Horror from the Deep"),
ICTHLARINS_LITTLE_HELPER("Icthlarin's Little Helper"),
IN_AID_OF_THE_MYREQUE("In Aid of the Myreque"),
IN_SEARCH_OF_THE_MYREQUE("In Search of the Myreque"),
JUNGLE_POTION("Jungle Potion"),
LEGENDS_QUEST("Legend's Quest"),
LOST_CITY("Lost City"),
THE_LOST_TRIBE("The Lost Tribe"),
LUNAR_DIPLOMACY("Lunar Diplomacy"),
MAKING_HISTORY("Making History"),
MERLINS_CRYSTAL("Merlin's Crystal"),
MONKEY_MADNESS("Monkey Madness"),
MONKS_FRIEND("Monk's Friend"),
MOUNTAIN_DAUGHTER("Mountain Daughter"),
MOURNINGS_END_PART_I("Mourning's End Part I"),
MOURNINGS_END_PART_II("Mourning's End Part II"),
MURDER_MYSTERY("Murder Mystery"),
MY_ARMS_BIG_ADVENTURE("My Arm's Big Adventure"),
NATURE_SPIRIT("Nature Spirit"),
OBSERVATORY_QUEST("Observatory Quest"),
ONE_SMALL_FAVOUR("One Small Favour"),
PLAGUE_CITY("Plague City"),
PRIEST_IN_PERIL("Priest in Peril"),
RAG_AND_BONE_MAN("Rag and Bone Man"),
RATCATCHERS("Ratcatchers"),
RECIPE_FOR_DISASTER("Recipe for Disaster"),
RECRUITMENT_DRIVE("Recruitment Drive"),
REGICIDE("Regicide"),
ROVING_ELVES("Roving Elves"),
ROYAL_TROUBLE("Royal Trouble"),
RUM_DEAL("Rum Deal"),
SCORPION_CATCHER("Scorpion Catcher"),
SEA_SLUG("Sea Slug"),
THE_SLUG_MENACE("The Slug Menace"),
SHADES_OF_MORTTON("Shades of Mort'ton"),
SHADOW_OF_THE_STORM("Shadow of the Storm"),
SHEEP_HERDER("Sheep Herder"),
SHILO_VILLAGE("Shilo Village"),
A_SOULS_BANE("A Soul's Bane"),
SPIRITS_OF_THE_ELID("Spirits of the Elid"),
SWAN_SONG("Swan Song"),
TAI_BWO_WANNAI_TRIO("Tai Bwo Wannai Trio"),
A_TAIL_OF_TWO_CATS("A Tail of Two Cats"),
TEARS_OF_GUTHIX("Tears of Guthix"),
TEMPLE_OF_IKOV("Temple of Ikov"),
THRONE_OF_MISCELLANIA("Throne of Miscellania"),
THE_TOURIST_TRAP("The Tourist Trap"),
WITCHS_HOUSE("Witch's House"),
TREE_GNOME_VILLAGE("Tree Gnome Village"),
TRIBAL_TOTEM("Tribal Totem"),
TROLL_ROMANCE("Troll Romance"),
TROLL_STRONGHOLD("Troll Stronghold"),
UNDERGROUND_PASS("Underground Pass"),
WANTED("Wanted!"),
WATCHTOWER("Watchtower"),
COLD_WAR("Cold War"),
THE_FREMENNIK_ISLES("The Fremennik Isles"),
TOWER_OF_LIFE("Tower of Life"),
THE_GREAT_BRAIN_ROBBERY("The Great Brain Robbery"),
WHAT_LIES_BELOW("What Lies Below"),
OLAFS_QUEST("Olaf's Quest"),
ANOTHER_SLICE_OF_HAM("Another Slice of H.A.M"),
DREAM_MENTOR("Dream Mentor"),
GRIM_TALES("Grim Tales"),
KINGS_RANSOM("King's Ransom"),
THE_PATH_OF_GLOUPHRIE("The Path of Glouphrie"),
BACK_TO_MY_ROOTS("Back to my Roots"),
LAND_OF_THE_GOBLINS("Land of the Goblins"),
DEALING_WITH_SCABARAS("Dealing with Scabaras"),
WOLF_WHISTLE("Wolf Whistle"),
AS_A_FIRST_RESORT("As a First Resort..."),
CATAPULT_CONSTRUCTION("Catapult Construction"),
KENNITHS_CONCERNS("Kennith's Concerns"),
LEGACY_OF_SEERGAZE("Legacy of Seergaze"),
PERILS_OF_ICE_MOUNTAIN("Perils of Ice Mountain"),
TOKTZ_KET_DILL("TokTz-Ket-Dill"),
SMOKING_KILLS("Smoking Kills"),
ROCKING_OUT("Rocking Out"),
SPIRIT_OF_SUMMER("Spirit of Summer"),
MEETING_HISTORY("Meeting History"),
ALL_FIRED_UP("All Fired Up"),
SUMMERS_END("Summer's End"),
DEFENDER_OF_VARROCK("Defender of Varrock"),
SWEPT_AWAY("Swept Away"),
WHILE_GUTHIX_SLEEPS("While Guthix Sleeps"),
IN_PYRE_NEED("In Pyre Need"),
TEST_QUEST("Test Quest");
override fun toString(): String {
return questName
}
}

View file

@ -30,7 +30,7 @@ class ShootingStar(var level: ShootingStarType = ShootingStarType.values().rando
"Relleka mining site" to Location.create(2682, 3700, 0), // Rellekka mining site
"Jatizso mine" to Location.create(2393, 3815, 0), //Jatiszo mining site (requires Fremennik Isles prereqs)
"Lunar Isle mine" to Location.create(2140, 3939, 0), // Lunar Isle mine (requires Lunar Diplomacy prereqs)
"Miscellania coal mine" to Location.create(2529, 3887, 0), // Miscellania coal mine (requires Fremennik Trials)
"Miscellania coal mine" to Location.create(2529, 3887, 0), // Miscellania coal mine (requires The Fremennik Trials)
//"Neitiznot runite mine" to Location.create(2376, 3835, 0), // Near the Neitiznot runite mine (requires Fremennik Isles prereqs) currently inaccessible as bridge does not work
"Ardougne mining site" to Location.create(2600, 3232, 0), // Ardougne mining site (Monastery)
"Ardougne eastern mine" to Location.create(2706, 3334, 0), // Ardougne mining site (Legends Guild)

View file

@ -12,11 +12,11 @@ import core.ServerStore.Companion.getBoolean
import core.game.dialogue.DialogueFile
import core.game.interaction.InteractionListener
import core.game.interaction.IntType
import core.tools.SystemLogger
import core.game.system.command.Privilege
import core.game.world.GameWorld
import core.tools.Log
import core.tools.secondsToTicks
import content.data.Quests
class ShootingStarPlugin : LoginListener, InteractionListener, TickListener, Commands, StartupListener {
override fun login(player: Player) {
@ -80,17 +80,17 @@ class ShootingStarPlugin : LoginListener, InteractionListener, TickListener, Com
override fun handle(componentID: Int, buttonID: Int) {
fun teleportToStar(player: Player) {
val condition: (p: Player) -> Boolean = when (star.location.toLowerCase()) {
"canifis bank" -> {p -> requireQuest(p, "Priest in Peril", "to access this.") }
//"burgh de rott bank" -> {p -> hasRequirement(p, "In Aid of the Myreque") } //disabled: crash
"crafting guild" -> {p -> hasLevelStat(p, Skills.CRAFTING, 40) }
"lletya bank" -> {p -> hasRequirement(p, "Mourning's End Part I") }
"jatizso mine" -> {p -> hasRequirement(p, "The Fremennik Isles") }
"south crandor mining site" -> {p -> hasRequirement(p, "Dragon Slayer") }
"shilo village mining site" -> {p -> hasRequirement(p, "Shilo Village") }
"mos le'harmless bank" -> {p -> hasRequirement(p, "Cabin Fever") } //needs to be updated to check for completion when the quest releases; https://runescape.wiki/w/Mos_Le%27Harmless?oldid=913025
"lunar isle mine" -> {p -> hasRequirement(p, "Lunar Diplomacy") }
"miscellania coal mine" -> {p -> requireQuest(p, "The Fremennik Trials", "to access this.") }
//"neitiznot runite mine" -> {p -> hasRequirement(p, "The Fremennik Isles") } //disabled: currently not reachable
"canifis bank" -> {p -> requireQuest(p, Quests.PRIEST_IN_PERIL, "to access this.")}
//"burgh de rott bank" -> {p -> hasRequirement(p, Quests.IN_AID_OF_THE_MYREQUE)} //disabled: crash
"crafting guild" -> {p -> hasLevelStat(p, Skills.CRAFTING, 40)}
"lletya bank" -> {p -> hasRequirement(p, Quests.MOURNINGS_END_PART_I)}
"jatizso mine" -> {p -> hasRequirement(p, Quests.THE_FREMENNIK_ISLES)}
"south crandor mining site" -> {p -> hasRequirement(p, Quests.DRAGON_SLAYER)}
"shilo village mining site" -> {p -> hasRequirement(p, Quests.SHILO_VILLAGE)}
"mos le'harmless bank" -> {p -> hasRequirement(p, Quests.CABIN_FEVER)} //needs to be updated to check for completion when the quest releases; https://runescape.wiki/w/Mos_Le%27Harmless?oldid=913025
"lunar isle mine" -> {p -> hasRequirement(p, Quests.LUNAR_DIPLOMACY)}
"miscellania coal mine" -> {p -> requireQuest(p, Quests.THE_FREMENNIK_TRIALS, "to access this.")}
//"neitiznot runite mine" -> {p -> hasRequirement(p, Quests.THE_FREMENNIK_ISLES)} //disabled: currently not reachable
else -> {_ -> true}
}
if (!condition.invoke(player)) {

View file

@ -7,8 +7,6 @@ import core.api.*
import core.game.bots.*
import core.game.ge.GrandExchange
import core.game.interaction.DestinationFlag
import core.game.interaction.IntType
import core.game.interaction.InteractionListeners
import core.game.interaction.MovementPulse
import core.game.node.Node
import core.game.node.entity.skill.Skills
@ -16,6 +14,7 @@ import core.game.node.item.Item
import core.game.world.map.Location
import core.game.world.map.zone.ZoneBorders
import org.rs09.consts.Items
import content.data.Quests
@PlayerCompatible
@ScriptName("Falador Cannonball Smelter")
@ -273,6 +272,6 @@ class CannonballSmelter : Script() {
skills.put(Skills.HITPOINTS,99)
skills.put(Skills.DEFENCE,99)
skills.put(Skills.SMITHING,35)
quests.add("Dwarf Cannon")
quests.add(Quests.DWARF_CANNON)
}
}

View file

@ -10,6 +10,7 @@ import core.plugin.Initializable
import core.plugin.Plugin
import core.tools.Log
import org.rs09.consts.Sounds
import content.data.Quests
/**
* Represents the experience interface.
@ -78,15 +79,15 @@ class ExperienceInterface() : ComponentPlugin() {
}
private fun checkHerblore(player: Player): Boolean{
return (player.questRepository.isComplete("Druidic Ritual"))
return (player.questRepository.isComplete(Quests.DRUIDIC_RITUAL))
}
private fun checkSummoning(player: Player): Boolean{
return player.questRepository.isComplete("Wolf Whistle")
return player.questRepository.isComplete(Quests.WOLF_WHISTLE)
}
private fun checkRunecrafting(player: Player): Boolean{
return player.questRepository.isComplete("Rune Mysteries")
return player.questRepository.isComplete(Quests.RUNE_MYSTERIES)
}
companion object {

View file

@ -10,7 +10,7 @@ import core.game.world.GameWorld
import core.game.world.map.Location
import core.game.world.map.RegionManager
import core.tools.RandomFunction
import content.data.Quests
/**
* Handles the fairy ring interface
@ -179,7 +179,7 @@ enum class FairyRing(val tile: Location?, val tip: String = "", val childId: Int
AKS(Location.create(2571, 2956, 0), "Feldip Hills: Jungle Hunter area", 25),
ALQ(Location.create(3597, 3495, 0), "Morytania: Haunted Woods east of Canifis", 27) {
override fun checkAccess(player: Player) : Boolean {
return requireQuest(player, "Priest in Peril", "to use this ring.")
return requireQuest(player, Quests.PRIEST_IN_PERIL, "to use this ring.")
}
},
ALS(Location.create(2644, 3495, 0), "Kandarin: McGrubor's Wood", 29),
@ -191,7 +191,7 @@ enum class FairyRing(val tile: Location?, val tip: String = "", val childId: Int
BKQ(Location.create(3041, 4532, 0), "Other realms: Enchanted Valley", 39),
BKR(Location.create(3469, 3431, 0), "Morytania: Mort Myre, south of Canifis", 40) {
override fun checkAccess(player: Player) : Boolean {
return requireQuest(player, "Priest in Peril", "to use this ring.")
return requireQuest(player, Quests.PRIEST_IN_PERIL, "to use this ring.")
}
},
BLP(Location.create(2437, 5126, 0), "Dungeons: TzHaar area", 42),
@ -199,7 +199,7 @@ enum class FairyRing(val tile: Location?, val tip: String = "", val childId: Int
BLR(Location.create(2740, 3351, 0), "Kandarin: Legends' Guild", 44),
CIP(Location.create(2513, 3884, 0), "Islands: Miscellania", 46) {
override fun checkAccess(player: Player): Boolean {
return requireQuest(player, "Fremennik Trials", "to use this ring.")
return requireQuest(player, Quests.THE_FREMENNIK_TRIALS, "to use this ring.")
}
},
CIQ(Location.create(2528, 3127, 0), "Kandarin: North-west of Yanille", 47),
@ -208,7 +208,7 @@ enum class FairyRing(val tile: Location?, val tip: String = "", val childId: Int
CKR(Location.create(2801, 3003, 0), "Karamja: South of Tai Bwo Wannai Village", 56),
CKS(Location.create(3447, 3470, 0), "Morytania: Canifis", 57) {
override fun checkAccess(player: Player) : Boolean {
return requireQuest(player, "Priest in Peril", "to use this ring.")
return requireQuest(player, Quests.PRIEST_IN_PERIL, "to use this ring.")
}
},
CLP(Location.create(3082, 3206, 0), "Islands: South of Draynor Village", 58),

View file

@ -9,6 +9,7 @@ import core.plugin.Initializable;
import core.plugin.Plugin;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* Represents the prayer interface.
@ -27,7 +28,7 @@ public final class PrayerTabInterface extends ComponentPlugin {
public boolean handle(Player player, Component component, int opcode, int button, int slot, int itemId) {
final PrayerType type = PrayerType.get(button);
if (type == PrayerType.CHIVALRY || type == PrayerType.PIETY)
if (!hasRequirement(player, "King's Ransom"))
if (!hasRequirement(player, Quests.KINGS_RANSOM))
return true;
if (type == null) {
return true;

View file

@ -10,12 +10,13 @@ import kotlin.math.*
import java.util.*
import org.rs09.consts.*
import content.data.Quests
object QuestTabUtils {
@JvmStatic
fun showRequirementsInterface (player: Player, button: Int) {
val questName = getNameForButton (button)
val questReq = QuestRequirements.values().filter { it.questName.equals(questName, true) }.firstOrNull() ?: return
fun showRequirementsInterface(player: Player, button: Int) {
val questName = getNameForButton(button)
val questReq = QuestRequirements.values().filter { it.quest.questName == questName }.firstOrNull() ?: return
var (isMet, unmetReqs) = QuestReq(questReq).evaluate(player)
var messageList = ArrayList<String>()
@ -27,7 +28,7 @@ object QuestTabUtils {
closeInterface(player)
for (req in unmetReqs) {
if (req is QuestReq)
questList.add(req.questReq.questName)
questList.add(req.questReq.quest.questName)
else if (req is SkillReq) {
if (statMap[req.skillId] == null || (statMap[req.skillId] != null && statMap[req.skillId]!! < req.level))
statMap[req.skillId] = req.level
@ -82,163 +83,163 @@ object QuestTabUtils {
openInterface(player, Components.QUESTJOURNAL_SCROLL_275)
}
fun getNameForButton (button: Int) : String {
val name = when (button) {
10 -> "Myths of the White Lands"
11 -> "Myths of the White Lands"
private fun getNameForButton(button: Int) : String {
val quest = when (button) {
10 -> Quests.MYTHS_OF_THE_WHITE_LANDS.questName
11 -> Quests.MYTHS_OF_THE_WHITE_LANDS.questName
12 -> "Free Quests"
13 -> "Black Knights' Fortress"
14 -> "Cook's Assistant"
15 -> "Demon Slayer"
16 -> "Doric's Quest"
17 -> "Dragon Slayer"
18 -> "Ernest the Chicken"
19 -> "Goblin Diplomacy"
20 -> "Imp Catcher"
21 -> "The Knight's Sword"
22 -> "Pirate's Treasure"
23 -> "Prince Ali Rescue"
24 -> "The Restless Ghost"
25 -> "Romeo & Juliet"
26 -> "Rune Mysteries"
27 -> "Sheep Shearer"
28 -> "Shield of Arrav"
29 -> "Vampire Slayer"
30 -> "Witch's Potion"
13 -> Quests.BLACK_KNIGHTS_FORTRESS.questName
14 -> Quests.COOKS_ASSISTANT.questName
15 -> Quests.DEMON_SLAYER.questName
16 -> Quests.DORICS_QUEST.questName
17 -> Quests.DRAGON_SLAYER.questName
18 -> Quests.ERNEST_THE_CHICKEN.questName
19 -> Quests.GOBLIN_DIPLOMACY.questName
20 -> Quests.IMP_CATCHER.questName
21 -> Quests.THE_KNIGHTS_SWORD.questName
22 -> Quests.PIRATES_TREASURE.questName
23 -> Quests.PRINCE_ALI_RESCUE.questName
24 -> Quests.THE_RESTLESS_GHOST.questName
25 -> Quests.ROMEO_JULIET.questName
26 -> Quests.RUNE_MYSTERIES.questName
27 -> Quests.SHEEP_SHEARER.questName
28 -> Quests.SHIELD_OF_ARRAV.questName
29 -> Quests.VAMPIRE_SLAYER.questName
30 -> Quests.WITCHS_POTION.questName
31 -> "Members' Quests"
32 -> "Animal Magnetism"
33 -> "Between a Rock..."
34 -> "Big Chompy Bird Hunting"
35 -> "Biohazard"
36 -> "Cabin Fever"
37 -> "Clock Tower"
38 -> "Contact!"
39 -> "Zogre Flesh Eaters"
40 -> "Creature of Fenkenstrain"
41 -> "Darkness of Hallowvale"
42 -> "Death to the Dorgeshuun"
43 -> "Death Plateau"
44 -> "Desert Treasure"
45 -> "Devious Minds"
46 -> "The Dig Site"
47 -> "Druidic Ritual"
48 -> "Dwarf Cannon"
49 -> "Eadgar's Ruse"
50 -> "Eagles' Peak"
51 -> "Elemental Workshop I"
52 -> "Elemental Workshop II"
53 -> "Enakhra's Lament"
54 -> "Enlightened Journey"
55 -> "The Eyes of Glouphrie"
56 -> "Fairytale I - Growing Pains"
57 -> "Fairytale II - Cure a Queen"
58 -> "Family Crest"
59 -> "The Feud"
60 -> "Fight Arena"
61 -> "Fishing Contest"
62 -> "Forgettable Tale..."
63 -> "The Fremennik Trials"
64 -> "Waterfall Quest"
65 -> "Garden of Tranquillity"
66 -> "Gertrude's Cat"
67 -> "Ghosts Ahoy"
68 -> "The Giant Dwarf"
69 -> "The Golem"
70 -> "The Grand Tree"
71 -> "The Hand in the Sand"
72 -> "Haunted Mine"
73 -> "Hazeel Cult"
74 -> "Heroes' Quest"
75 -> "Holy Grail"
76 -> "Horror from the Deep"
77 -> "Icthlarin's Little Helper"
78 -> "In Aid of the Myreque"
79 -> "In Search of the Myreque"
80 -> "Jungle Potion"
81 -> "Legend's Quest"
82 -> "Lost City"
83 -> "The Lost Tribe"
84 -> "Lunar Diplomacy"
85 -> "Making History"
86 -> "Merlin's Crystal"
87 -> "Monkey Madness"
88 -> "Monk's Friend"
89 -> "Mountain Daughter"
90 -> "Mourning's End Part I"
91 -> "Mourning's End Part II"
92 -> "Murder Mystery"
93 -> "My Arm's Big Adventure"
94 -> "Nature Spirit"
95 -> "Observatory Quest"
96 -> "One Small Favour"
97 -> "Plague City"
98 -> "Priest in Peril"
99 -> "Rag and Bone Man"
100 -> "Ratcatchers"
101 -> "Recipe for Disaster"
102 -> "Recruitment Drive"
103 -> "Regicide"
104 -> "Roving Elves"
105 -> "Royal Trouble"
106 -> "Rum Deal"
107 -> "Scorpion Catcher"
108 -> "Sea Slug"
109 -> "The Slug Menace"
110 -> "Shades of Mort'ton"
111 -> "Shadow of the Storm"
112 -> "Sheep Herder"
113 -> "Shilo Village"
114 -> "A Soul's Bane"
115 -> "Spirits of the Elid"
116 -> "Swan Song"
117 -> "Tai Bwo Wannai Trio"
118 -> "A Tail of Two Cats"
119 -> "Tears of Guthix"
120 -> "Temple of Ikov"
121 -> "Throne of Miscellania"
122 -> "The Tourist Trap"
123 -> "Witch's House"
124 -> "Tree Gnome Village"
125 -> "Tribal Totem"
126 -> "Troll Romance"
127 -> "Troll Stronghold"
128 -> "Underground Pass"
129 -> "Wanted!"
130 -> "Watchtower"
131 -> "Cold War"
132 -> "The Fremennik Isles"
133 -> "Tower of Life"
134 -> "The Great Brain Robbery"
135 -> "What Lies Below"
136 -> "Olaf's Quest"
137 -> "Another Slice of H.A.M"
138 -> "Dream Mentor"
139 -> "Grim Tales"
140 -> "King's Ransom"
141 -> "The Path of Glouphrie"
142 -> "Back to my Roots"
143 -> "Land of the Goblins"
144 -> "Dealing with Scabaras"
145 -> "Wolf Whistle"
146 -> "As a First Resort..."
147 -> "Catapult Construction"
148 -> "Kennith's Concerns"
149 -> "Legacy of Seergaze"
150 -> "Perils of Ice Mountain"
151 -> "TokTz-Ket-Dill"
152 -> "Smoking Kills"
153 -> "Rocking Out"
154 -> "Spirit of Summer"
155 -> "Meeting History"
156 -> "All Fired Up"
157 -> "Summer's End"
158 -> "Defender of Varrock"
159 -> "Swept Away"
160 -> "While Guthix Sleeps"
161 -> "In Pyre Need"
162 -> "Myths of the White Lands"
32 -> Quests.ANIMAL_MAGNETISM.questName
33 -> Quests.BETWEEN_A_ROCK.questName
34 -> Quests.BIG_CHOMPY_BIRD_HUNTING.questName
35 -> Quests.BIOHAZARD.questName
36 -> Quests.CABIN_FEVER.questName
37 -> Quests.CLOCK_TOWER.questName
38 -> Quests.CONTACT.questName
39 -> Quests.ZOGRE_FLESH_EATERS.questName
40 -> Quests.CREATURE_OF_FENKENSTRAIN.questName
41 -> Quests.DARKNESS_OF_HALLOWVALE.questName
42 -> Quests.DEATH_TO_THE_DORGESHUUN.questName
43 -> Quests.DEATH_PLATEAU.questName
44 -> Quests.DESERT_TREASURE.questName
45 -> Quests.DEVIOUS_MINDS.questName
46 -> Quests.THE_DIG_SITE.questName
47 -> Quests.DRUIDIC_RITUAL.questName
48 -> Quests.DWARF_CANNON.questName
49 -> Quests.EADGARS_RUSE.questName
50 -> Quests.EAGLES_PEAK.questName
51 -> Quests.ELEMENTAL_WORKSHOP_I.questName
52 -> Quests.ELEMENTAL_WORKSHOP_II.questName
53 -> Quests.ENAKHRAS_LAMENT.questName
54 -> Quests.ENLIGHTENED_JOURNEY.questName
55 -> Quests.THE_EYES_OF_GLOUPHRIE.questName
56 -> Quests.FAIRYTALE_I_GROWING_PAINS.questName
57 -> Quests.FAIRYTALE_II_CURE_A_QUEEN.questName
58 -> Quests.FAMILY_CREST.questName
59 -> Quests.THE_FEUD.questName
60 -> Quests.FIGHT_ARENA.questName
61 -> Quests.FISHING_CONTEST.questName
62 -> Quests.FORGETTABLE_TALE.questName
63 -> Quests.THE_FREMENNIK_TRIALS.questName
64 -> Quests.WATERFALL_QUEST.questName
65 -> Quests.GARDEN_OF_TRANQUILITY.questName
66 -> Quests.GERTRUDES_CAT.questName
67 -> Quests.GHOSTS_AHOY.questName
68 -> Quests.THE_GIANT_DWARF.questName
69 -> Quests.THE_GOLEM.questName
70 -> Quests.THE_GRAND_TREE.questName
71 -> Quests.THE_HAND_IN_THE_SAND.questName
72 -> Quests.HAUNTED_MINE.questName
73 -> Quests.HAZEEL_CULT.questName
74 -> Quests.HEROES_QUEST.questName
75 -> Quests.HOLY_GRAIL.questName
76 -> Quests.HORROR_FROM_THE_DEEP.questName
77 -> Quests.ICTHLARINS_LITTLE_HELPER.questName
78 -> Quests.IN_AID_OF_THE_MYREQUE.questName
79 -> Quests.IN_SEARCH_OF_THE_MYREQUE.questName
80 -> Quests.JUNGLE_POTION.questName
81 -> Quests.LEGENDS_QUEST.questName
82 -> Quests.LOST_CITY.questName
83 -> Quests.THE_LOST_TRIBE.questName
84 -> Quests.LUNAR_DIPLOMACY.questName
85 -> Quests.MAKING_HISTORY.questName
86 -> Quests.MERLINS_CRYSTAL.questName
87 -> Quests.MONKEY_MADNESS.questName
88 -> Quests.MONKS_FRIEND.questName
89 -> Quests.MOUNTAIN_DAUGHTER.questName
90 -> Quests.MOURNINGS_END_PART_I.questName
91 -> Quests.MOURNINGS_END_PART_II.questName
92 -> Quests.MURDER_MYSTERY.questName
93 -> Quests.MY_ARMS_BIG_ADVENTURE.questName
94 -> Quests.NATURE_SPIRIT.questName
95 -> Quests.OBSERVATORY_QUEST.questName
96 -> Quests.ONE_SMALL_FAVOUR.questName
97 -> Quests.PLAGUE_CITY.questName
98 -> Quests.PRIEST_IN_PERIL.questName
99 -> Quests.RAG_AND_BONE_MAN.questName
100 -> Quests.RATCATCHERS.questName
101 -> Quests.RECIPE_FOR_DISASTER.questName
102 -> Quests.RECRUITMENT_DRIVE.questName
103 -> Quests.REGICIDE.questName
104 -> Quests.ROVING_ELVES.questName
105 -> Quests.ROYAL_TROUBLE.questName
106 -> Quests.RUM_DEAL.questName
107 -> Quests.SCORPION_CATCHER.questName
108 -> Quests.SEA_SLUG.questName
109 -> Quests.THE_SLUG_MENACE.questName
110 -> Quests.SHADES_OF_MORTTON.questName
111 -> Quests.SHADOW_OF_THE_STORM.questName
112 -> Quests.SHEEP_HERDER.questName
113 -> Quests.SHILO_VILLAGE.questName
114 -> Quests.A_SOULS_BANE.questName
115 -> Quests.SPIRITS_OF_THE_ELID.questName
116 -> Quests.SWAN_SONG.questName
117 -> Quests.TAI_BWO_WANNAI_TRIO.questName
118 -> Quests.A_TAIL_OF_TWO_CATS.questName
119 -> Quests.TEARS_OF_GUTHIX.questName
120 -> Quests.TEMPLE_OF_IKOV.questName
121 -> Quests.THRONE_OF_MISCELLANIA.questName
122 -> Quests.THE_TOURIST_TRAP.questName
123 -> Quests.WITCHS_HOUSE.questName
124 -> Quests.TREE_GNOME_VILLAGE.questName
125 -> Quests.TRIBAL_TOTEM.questName
126 -> Quests.TROLL_ROMANCE.questName
127 -> Quests.TROLL_STRONGHOLD.questName
128 -> Quests.UNDERGROUND_PASS.questName
129 -> Quests.WANTED.questName
130 -> Quests.WATCHTOWER.questName
131 -> Quests.COLD_WAR.questName
132 -> Quests.THE_FREMENNIK_ISLES.questName
133 -> Quests.TOWER_OF_LIFE.questName
134 -> Quests.THE_GREAT_BRAIN_ROBBERY.questName
135 -> Quests.WHAT_LIES_BELOW.questName
136 -> Quests.OLAFS_QUEST.questName
137 -> Quests.ANOTHER_SLICE_OF_HAM.questName
138 -> Quests.DREAM_MENTOR.questName
139 -> Quests.GRIM_TALES.questName
140 -> Quests.KINGS_RANSOM.questName
141 -> Quests.THE_PATH_OF_GLOUPHRIE.questName
142 -> Quests.BACK_TO_MY_ROOTS.questName
143 -> Quests.LAND_OF_THE_GOBLINS.questName
144 -> Quests.DEALING_WITH_SCABARAS.questName
145 -> Quests.WOLF_WHISTLE.questName
146 -> Quests.AS_A_FIRST_RESORT.questName
147 -> Quests.CATAPULT_CONSTRUCTION.questName
148 -> Quests.KENNITHS_CONCERNS.questName
149 -> Quests.LEGACY_OF_SEERGAZE.questName
150 -> Quests.PERILS_OF_ICE_MOUNTAIN.questName
151 -> Quests.TOKTZ_KET_DILL.questName
152 -> Quests.SMOKING_KILLS.questName
153 -> Quests.ROCKING_OUT.questName
154 -> Quests.SPIRIT_OF_SUMMER.questName
155 -> Quests.MEETING_HISTORY.questName
156 -> Quests.ALL_FIRED_UP.questName
157 -> Quests.SUMMERS_END.questName
158 -> Quests.DEFENDER_OF_VARROCK.questName
159 -> Quests.SWEPT_AWAY.questName
160 -> Quests.WHILE_GUTHIX_SLEEPS.questName
161 -> Quests.IN_PYRE_NEED.questName
162 -> Quests.MYTHS_OF_THE_WHITE_LANDS.questName
else -> ""
}
return name
return quest as String
}
}

View file

@ -13,6 +13,7 @@ import core.game.world.update.flag.context.Graphics
import org.rs09.consts.Items
import org.rs09.consts.Scenery
import org.rs09.consts.Sounds
import content.data.Quests
@Suppress("unused")
class EctophialListener : InteractionListener {
@ -37,7 +38,7 @@ class EctophialListener : InteractionListener {
}
on(Items.ECTOPHIAL_4251, IntType.ITEM, "empty") { player, node ->
if (!hasRequirement(player, "Ghosts Ahoy"))
if (!hasRequirement(player, Quests.GHOSTS_AHOY))
return@on true
if (player.isTeleBlocked) {

View file

@ -4,6 +4,7 @@ import core.api.*
import core.game.node.entity.player.link.quest.QuestRepository
import org.rs09.consts.Items
import core.game.interaction.InteractionListener
import content.data.Quests
class ItemQuestRequirementListener : InteractionListener {
@ -106,7 +107,7 @@ class ItemQuestRequirementListener : InteractionListener {
/*
onEquip(fremennikIslesEquipment) { player, _ ->
if (!isQuestComplete(player, "Fremennik Isles")) {
if (!isQuestComplete(player, Quests.THE_FREMENNIK_ISLES)) {
sendMessage(player, "You must have completed The Fremennik Isles to equip this.")
return@onEquip false
}
@ -114,7 +115,7 @@ class ItemQuestRequirementListener : InteractionListener {
}
onEquip(fremennikIslesDuringQuestEquipment){ player, _ ->
if (questStage(player, "Fremennik Isles") > 0) {
if (questStage(player, Quests.THE_FREMENNIK_ISLES) > 0) {
sendMessage(player, "You must have started The Fremennik Isles to equip this.")
return@onEquip false
}
@ -123,23 +124,23 @@ class ItemQuestRequirementListener : InteractionListener {
*/
onEquip(fremennikTrialsEquipment) { player, _ ->
return@onEquip hasRequirement(player, "Fremennik Trials")
return@onEquip hasRequirement(player, Quests.THE_FREMENNIK_TRIALS)
}
onEquip(fremennikIslesEquipment) {player, _ ->
return@onEquip hasRequirement(player, "The Fremennik Isles")
return@onEquip hasRequirement(player, Quests.THE_FREMENNIK_ISLES)
}
onEquip(avasBackpacks){ player, _ ->
return@onEquip hasRequirement(player, "Animal Magnetism")
return@onEquip hasRequirement(player, Quests.ANIMAL_MAGNETISM)
}
onEquip(lostCityWeapons){ player, _ ->
return@onEquip hasRequirement(player, "Lost City")
return@onEquip hasRequirement(player, Quests.LOST_CITY)
}
onEquip(Items.CAPE_OF_LEGENDS_1052) { player, _ ->
return@onEquip hasRequirement(player, "Legend's Quest")
return@onEquip hasRequirement(player, Quests.LEGENDS_QUEST)
}
onEquip(questCapes) { player, _ ->
@ -152,84 +153,84 @@ class ItemQuestRequirementListener : InteractionListener {
}
onEquip(Items.WOLFBANE_2952){ player, _ ->
return@onEquip hasRequirement(player, "Priest in Peril")
return@onEquip hasRequirement(player, Quests.PRIEST_IN_PERIL)
}
onEquip(Items.ANCIENT_MACE_11061){ player, _ ->
return@onEquip hasRequirement(player, "Another Slice of H.A.M")
return@onEquip hasRequirement(player, Quests.ANOTHER_SLICE_OF_HAM)
}
onEquip(Items.ANCIENT_STAFF_4675){ player, _ ->
return@onEquip hasRequirement(player, "Desert Treasure")
return@onEquip hasRequirement(player, Quests.DESERT_TREASURE)
}
onEquip(Items.ELEMENTAL_SHIELD_2890) { player, _ ->
return@onEquip hasRequirement(player, "Elemental Workshop I")
return@onEquip hasRequirement(player, Quests.ELEMENTAL_WORKSHOP_I)
}
onEquip(crystalEquipment){ player, _ ->
return@onEquip hasRequirement(player, "Roving Elves")
return@onEquip hasRequirement(player, Quests.ROVING_ELVES)
}
onEquip(dragonSlayerEquipment) {player, _ ->
return@onEquip hasRequirement(player, "Dragon Slayer")
return@onEquip hasRequirement(player, Quests.DRAGON_SLAYER)
}
onEquip(Items.DRAGON_SCIMITAR_4587) {player, _ ->
return@onEquip hasRequirement(player, "Monkey Madness")
return@onEquip hasRequirement(player, Quests.MONKEY_MADNESS)
}
onEquip(Items.GLOVES_7462) {player, _ ->
return@onEquip hasRequirement(player, "Recipe for Disaster")
return@onEquip hasRequirement(player, Quests.RECIPE_FOR_DISASTER)
}
onEquip(Items.SLAYER_HELMET_13263) {player, _ ->
return@onEquip hasRequirement(player, "Smoking Kills")
return@onEquip hasRequirement(player, Quests.SMOKING_KILLS)
}
onEquip (Items.DRAGON_HALBERD_3204) {player, _ ->
return@onEquip hasRequirement(player, "Regicide")
return@onEquip hasRequirement(player, Quests.REGICIDE)
}
onEquip (Items.CLIMBING_BOOTS_3105) {player, _ ->
return@onEquip hasRequirement(player, "Death Plateau")
return@onEquip hasRequirement(player, Quests.DEATH_PLATEAU)
}
onEquip (godBooks) {player, _ ->
return@onEquip hasRequirement(player, "Horror from the Deep")
return@onEquip hasRequirement(player, Quests.HORROR_FROM_THE_DEEP)
}
onEquip (pharaohScepters) {player, _ ->
return@onEquip hasRequirement(player, "Icthlarin's Little Helper")
return@onEquip hasRequirement(player, Quests.ICTHLARINS_LITTLE_HELPER)
}
onEquip (Items.DRAGON_SQ_SHIELD_1187) {player, _ ->
//because I know people won't believe it: https://runescape.wiki/w/Dragon_sq_shield?oldid=899636
return@onEquip hasRequirement(player, "Legend's Quest")
return@onEquip hasRequirement(player, Quests.LEGENDS_QUEST)
}
onEquip (initiateArmour) {player, _ ->
return@onEquip hasRequirement(player, "Recruitment Drive")
return@onEquip hasRequirement(player, Quests.RECRUITMENT_DRIVE)
}
onEquip (proselyteArmour) {player, _ ->
return@onEquip hasRequirement(player, "The Slug Menace")
return@onEquip hasRequirement(player, Quests.THE_SLUG_MENACE)
}
onEquip (spiritShields) {player, _ ->
return@onEquip hasRequirement(player, "Summer's End")
return@onEquip hasRequirement(player, Quests.SUMMERS_END)
}
onEquip (Items.DRAGON_MACE_1434) {player, _ ->
return@onEquip hasRequirement(player, "Heroes' Quest")
return@onEquip hasRequirement(player, Quests.HEROES_QUEST)
}
onEquip (Items.DRAGON_BATTLEAXE_1377) {player, _ ->
return@onEquip hasRequirement(player, "Heroes' Quest")
return@onEquip hasRequirement(player, Quests.HEROES_QUEST)
}
onEquip (Items.DARKLIGHT_6746) {player, _ ->
return@onEquip hasRequirement(player, "Shadow of the Storm")
return@onEquip hasRequirement(player, Quests.SHADOW_OF_THE_STORM)
}
}
}

View file

@ -8,6 +8,7 @@ import core.game.node.entity.player.Player;
import core.plugin.Initializable;
import core.plugin.Plugin;
import content.region.morytania.quest.naturespirit.NSUtils;
import content.data.Quests;
/**
* Handles the Silver Sickle (b) to collect Mort Myre Fungus.
@ -28,7 +29,7 @@ public final class SilverSicklePlugin extends OptionHandler {
switch (option) {
case "operate":
case "cast bloom":
if(player.getQuestRepository().getQuest("Nature Spirit").getStage(player) >= 75) {
if(player.getQuestRepository().getQuest(Quests.NATURE_SPIRIT).getStage(player) >= 75) {
player.getPacketDispatch().sendAnimation(9021);
NSUtils.castBloom(player);
} else {

View file

@ -10,12 +10,13 @@ import core.game.node.entity.player.link.TeleportManager
import core.game.node.item.Item
import core.game.world.map.Location
import core.api.hasRequirement;
import content.data.Quests
class TeleTabsListener : InteractionListener {
enum class TeleTabs(val item: Int, val location: Location, val exp: Double, val requirementCheck: (Player) -> Boolean = { true }) {
ADDOUGNE_TELEPORT(8011, Location.create(2662, 3307, 0), 61.0, {
player -> hasRequirement(player, "Plague City");
player -> hasRequirement(player, Quests.PLAGUE_CITY);
}),
AIR_ALTAR_TELEPORT(13599, Location.create(2978, 3296, 0), 0.0),
ASTRAL_ALTAR_TELEPORT(13611, Location.create(2156, 3862, 0), 0.0),

View file

@ -14,6 +14,7 @@ import core.game.world.map.zone.impl.WildernessZone;
import core.plugin.Plugin;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* Represents the rotten potato plugin.
@ -34,7 +35,7 @@ public final class TeleportCrystalPlugin extends OptionHandler {
@Override
public boolean handle(Player player, Node node, String option) {
if (!hasRequirement(player, "Mourning's End Part I"))
if (!hasRequirement(player, Quests.MOURNINGS_END_PART_I))
return true;
if (!WildernessZone.checkTeleport(player, 20)) {
player.getPacketDispatch().sendMessage("The crystal is unresponsive.");

View file

@ -10,27 +10,27 @@ import org.rs09.consts.NPCs
import core.game.interaction.InteractionListener
import core.game.interaction.IntType
import core.game.world.GameWorld.Pulser
import content.data.Quests
class GCItemOnCat : InteractionListener {
override fun defineListeners() {
val GERTCAT = "Gertrude's Cat"
val BEND_DOWN = 827
onUseWith(IntType.NPC, Items.BUCKET_OF_MILK_1927, NPCs.GERTRUDES_CAT_2997) { player, used, with ->
if(getQuestStage(player, GERTCAT) == 20 && removeItem(player, used.asItem())){
if(getQuestStage(player, Quests.GERTRUDES_CAT) == 20 && removeItem(player, used.asItem())){
addItem(player, Items.BUCKET_1925)
animate(player, BEND_DOWN) //bend down
sendChat(with.asNpc(), "Mew!")
setQuestStage(player, GERTCAT, 30)
setQuestStage(player, Quests.GERTRUDES_CAT, 30)
}
return@onUseWith true
}
onUseWith(IntType.NPC, Items.DOOGLE_SARDINE_1552, NPCs.GERTRUDES_CAT_2997){ player, used, with ->
if(getQuestStage(player, GERTCAT) == 30 && removeItem(player, used.asItem())){
if(getQuestStage(player, Quests.GERTRUDES_CAT) == 30 && removeItem(player, used.asItem())){
animate(player, BEND_DOWN)
sendChat(with.asNpc(), "Mew!")
setQuestStage(player, GERTCAT, 40)
setQuestStage(player, Quests.GERTRUDES_CAT, 40)
}
return@onUseWith true
}
@ -42,7 +42,7 @@ class GCItemOnCat : InteractionListener {
onUseWith(IntType.NPC, Items.THREE_LITTLE_KITTENS_13236, NPCs.GERTRUDES_CAT_2997){ player, used, with ->
if(removeItem(player, used.asItem())){
setQuestStage(player, GERTCAT, 60)
setQuestStage(player, Quests.GERTRUDES_CAT, 60)
//below copied verbatim from original, I don't like it.
Pulser.submit(object : Pulse(1) {
var count = 0

View file

@ -14,6 +14,7 @@ import core.game.world.map.path.Pathfinder;
import core.game.world.update.flag.context.Animation;
import core.plugin.Initializable;
import core.plugin.Plugin;
import content.data.Quests;
/**
* Represents the plugin used to handle the use with interactions.
@ -50,7 +51,7 @@ public final class GertrudeCatUsePlugin extends UseWithHandler {
public boolean handle(NodeUsageEvent event) {
final Player player = event.getPlayer();
final NPC npc = ((NPC) event.getUsedWith());
final Quest quest = player.getQuestRepository().getQuest("Gertrude's Cat");
final Quest quest = player.getQuestRepository().getQuest(Quests.GERTRUDES_CAT);
if (event.getUsedItem().getId() == 1927 && quest.getStage(player) == 20) {
if (player.getInventory().remove(event.getUsedItem())) {
player.getInventory().add(EMPTY_BUCKET);

View file

@ -5,20 +5,19 @@ import org.rs09.consts.Items
import org.rs09.consts.NPCs
import core.game.interaction.InteractionListener
import core.game.interaction.IntType
import content.data.Quests
class RopeOnLadyKeli : InteractionListener {
override fun defineListeners() {
val PAR = "Prince Ali Rescue"
onUseWith(IntType.NPC, Items.ROPE_954, NPCs.LADY_KELI_919) { player, used, with ->
if(getQuestStage(player, PAR) in 40..50 && getAttribute(player, "guard-drunk", false)){
if(getQuestStage(player, Quests.PRINCE_ALI_RESCUE) in 40..50 && getAttribute(player, "guard-drunk", false)){
if(removeItem(player, used.asItem())){
sendDialogue(player, "You overpower Keli, tie her up, and put her in a cupboard.")
setQuestStage(player, PAR, 50)
setQuestStage(player, Quests.PRINCE_ALI_RESCUE, 50)
setAttribute(player, "keli-gone", getWorldTicks() + 350)
}
} else {
if (getQuestStage(player, PAR) == 40){
if (getQuestStage(player, Quests.PRINCE_ALI_RESCUE) == 40){
sendMessage(player, "You need to do something about the guard first.")
}
}

View file

@ -1,7 +1,7 @@
package content.global.handlers.item.withobject
import content.data.Quests
import core.api.*
import content.region.kandarin.quest.dwarfcannon.DwarfCannon
import core.game.node.Node
import core.game.node.entity.player.Player
import core.game.node.entity.skill.Skills
@ -19,8 +19,8 @@ class AmmoMouldOnFurnace : InteractionListener {
private fun cannonBallOnUseWithHandler(player: Player, used: Node, with: Node): Boolean {
face(player, with.centerLocation)
if(!isQuestComplete(player, DwarfCannon.NAME)) {
sendDialogue(player, "You need to complete the ${DwarfCannon.NAME} quest in order to do this.")
if(!isQuestComplete(player, Quests.DWARF_CANNON)) {
sendDialogue(player, "You need to complete the ${Quests.DWARF_CANNON} quest in order to do this.")
return true
}
if (getDynLevel(player, Skills.SMITHING) < levelRequirement) {

View file

@ -15,6 +15,7 @@ import core.game.node.scenery.Scenery;
import core.plugin.Plugin;
import core.plugin.Initializable;
import core.plugin.ClassScanner;
import content.data.Quests;
/**
* Represents the option handler used for smithing.
@ -68,7 +69,7 @@ public final class SmithingPlugin extends UseWithHandler {
@Override
public boolean handle(NodeUsageEvent event) {
final Player player = event.getPlayer();
if (((Scenery) event.getUsedWith()).getId() == 2782 && !player.getQuestRepository().isComplete("Doric's Quest")) {
if (((Scenery) event.getUsedWith()).getId() == 2782 && !player.getQuestRepository().isComplete(Quests.DORICS_QUEST)) {
player.getDialogueInterpreter().sendDialogue("Property of Doric the Dwarf.");
return true;
}

View file

@ -7,6 +7,7 @@ import core.game.node.item.GroundItemManager;
import core.game.node.item.Item;
import core.plugin.Initializable;
import core.game.world.map.Location;
import content.data.Quests;
/**
* Represents a rat npc.
@ -51,7 +52,7 @@ public class RatNPC extends AbstractNPC {
super.finalizeDeath(killer);
if (killer instanceof Player) {
final Player p = ((Player) killer);
if (p.getQuestRepository().getQuest("Witch's Potion").isStarted(p)) {
if (p.getQuestRepository().getQuest(Quests.WITCHS_POTION).isStarted(p)) {
GroundItemManager.create(RAT_TAIL, getLocation(), p);
}
}

View file

@ -17,6 +17,7 @@ import org.rs09.consts.NPCs
import org.rs09.consts.Sounds
import core.game.world.map.Location
import core.game.world.map.Direction
import content.data.Quests
private val sheepIds = intArrayOf(
NPCs.SHEEP_42,
@ -74,7 +75,7 @@ class SheepBehavior : NPCBehavior(*sheepIds), InteractionListener {
val sheep = node as NPC
sheep.faceTemporary(player, 1)
if (sheep.id == NPCs.SHEEP_3579) {
if (player.questRepository.getQuest("Sheep Shearer").isStarted(player)) {
if (player.questRepository.getQuest(Quests.SHEEP_SHEARER).isStarted(player)) {
setAttribute(player, ATTR_IS_PENGUIN_SHEEP_SHEARED, true)
}
animate(player, Animation(893))

View file

@ -9,6 +9,7 @@ import core.game.world.map.Location;
import core.game.world.update.flag.context.Animation;
import core.plugin.Initializable;
import core.plugin.Plugin;
import content.data.Quests;
/**
* Handles the bar squeezing shortcut.
@ -61,7 +62,7 @@ public class BarSqueezeShortcut extends AgilityShortcut {
@Override
public boolean checkRequirements(Player player) {
if (!player.getQuestRepository().isComplete("Priest in Peril") && !(player.getLocation().getY() >= 3159 && player.getLocation().getY() <= 3161)) {
if (!player.getQuestRepository().isComplete(Quests.PRIEST_IN_PERIL) && !(player.getLocation().getY() >= 3159 && player.getLocation().getY() <= 3161)) {
player.getDialogueInterpreter().sendDialogue("You need to have completed Priest in Peril in order to do this.");
return false;
}

View file

@ -15,6 +15,7 @@ import core.plugin.Initializable;
import core.plugin.Plugin;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* Handles a tunnel shortcut.
@ -73,7 +74,7 @@ public class TunnelShortcut extends AgilityShortcut {
@Override
public void run(final Player player, Scenery object, String option, boolean failed) {
if (object.getId() == 14922) {
if (!hasRequirement(player, "Swan Song"))
if (!hasRequirement(player, Quests.SWAN_SONG))
return;
}
player.lock(6);

View file

@ -3,6 +3,7 @@ package content.global.skill.construction;
import core.game.node.entity.player.Player;
import org.rs09.consts.Items;
import core.game.node.entity.skill.Skills;
import content.data.Quests;
/**
* Family crest types.
@ -16,7 +17,7 @@ public enum CrestType implements CrestRequirement {
@Override
public boolean eligible(Player player) {
return player.getQuestRepository().isComplete("Shield of Arrav");
return player.getQuestRepository().isComplete(Quests.SHIELD_OF_ARRAV);
}
},
ASGARNIA("the symbol of Asgarnia"), // no requirements
@ -24,21 +25,21 @@ public enum CrestType implements CrestRequirement {
@Override
public boolean eligible(Player player) {
return player.getQuestRepository().isComplete("The Lost Tribe");
return player.getQuestRepository().isComplete(Quests.THE_LOST_TRIBE);
}
},
DRAGON("a dragon") { // requires Dragon Slayer
@Override
public boolean eligible(Player player) {
return player.getQuestRepository().isComplete("Dragon Slayer");
return player.getQuestRepository().isComplete(Quests.DRAGON_SLAYER);
}
},
FAIRY("a fairy") { // requries Lost City
@Override
public boolean eligible(Player player) {
return player.getQuestRepository().isComplete("Lost City");
return player.getQuestRepository().isComplete(Quests.LOST_CITY);
}
},
GUTHIX("the symbol of Guthix") { // Requires 70+ Prayer

View file

@ -16,6 +16,7 @@ import org.rs09.consts.Items;
import org.rs09.consts.Sounds;
import static core.api.ContentAPIKt.playAudio;
import content.data.Quests;
public class StandardCookingPulse extends Pulse {
//range animation
@ -72,7 +73,7 @@ public class StandardCookingPulse extends Pulse {
this.experience = 0;
if (properties != null) {
// Handle Cook's Assistant range
if (object.getId() == LUMBRIDGE_RANGE && !player.getQuestRepository().isComplete("Cook's Assistant")) {
if (object.getId() == LUMBRIDGE_RANGE && !player.getQuestRepository().isComplete(Quests.COOKS_ASSISTANT)) {
player.getPacketDispatch().sendMessage("You need to have completed the Cook's Assistant quest in order to use that range.");
return false;
}

View file

@ -12,6 +12,7 @@ import core.game.interaction.QueueStrength
import core.tools.StringUtils
import core.tools.prependArticle
import org.rs09.consts.Sounds
import content.data.Quests
class UseWithPatchHandler : InteractionListener {
val RAKE = Items.RAKE_5341
@ -39,7 +40,7 @@ class UseWithPatchHandler : InteractionListener {
val usedItem = used.asItem()
if (patch == FarmingPatch.TROLL_STRONGHOLD_HERB) {
if (!hasRequirement(player, "My Arm's Big Adventure"))
if (!hasRequirement(player, Quests.MY_ARMS_BIG_ADVENTURE))
return@onUseWith true
}

View file

@ -9,6 +9,7 @@ import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import core.game.world.update.flag.context.Animation;
import core.tools.StringUtils;
import content.data.Quests;
/**
* fletching skill pulse
@ -57,7 +58,7 @@ public final class FletchingPulse extends SkillPulse<Item> {
amount = player.getInventory().getAmount(node);
}
if (fletch == Fletching.FletchingItems.OGRE_ARROW_SHAFT) {
if (player.getQuestRepository().getQuest("Big Chompy Bird Hunting").getStage(player) == 0) {
if (player.getQuestRepository().getQuest(Quests.BIG_CHOMPY_BIRD_HUNTING).getStage(player) == 0) {
player.getPacketDispatch().sendMessage("You must have started Big Chompy Bird Hunting to make those.");
return false;
}

View file

@ -7,6 +7,7 @@ import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import static core.api.ContentAPIKt.*;
import content.data.Quests;
/**
* Represents the dart pulse.
@ -46,7 +47,7 @@ public final class DartPulse extends SkillPulse<Item> {
player.getDialogueInterpreter().sendDialogue("You need a fletching level of " + dart.level + " to do this.");
return false;
}
if (!player.getQuestRepository().isComplete("The Tourist Trap")){
if (!player.getQuestRepository().isComplete(Quests.THE_TOURIST_TRAP)){
player.getDialogueInterpreter().sendDialogue("You need to have completed Tourist Trap to fletch darts.");
return false;
}

View file

@ -6,6 +6,7 @@ import core.game.interaction.InteractionListener
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import java.util.*
import content.data.Quests
/**
* Dirty herb cleaning listener
@ -15,7 +16,7 @@ class HerbCleanListener : InteractionListener {
override fun defineListeners() {
on(IntType.ITEM, "clean") { player, node ->
lock(player, 1)
if (!requireQuest(player, "Druidic Ritual", "before you can use Herblore.")) return@on true
if (!requireQuest(player, Quests.DRUIDIC_RITUAL, "before you can use Herblore.")) return@on true
val herb: Herbs = Herbs.forItem(node as Item) ?: return@on true
if (getDynLevel(player, Skills.HERBLORE) < herb.level) {

View file

@ -5,6 +5,7 @@ import core.game.node.entity.skill.Skills;
import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import core.game.world.update.flag.context.Animation;
import content.data.Quests;
/**
* Represents the pulse used to create herb tars.
@ -52,7 +53,7 @@ public final class HerbTarPulse extends SkillPulse<Item> {
@Override
public boolean checkRequirements() {
if (!player.getQuestRepository().isComplete("Druidic Ritual")) {
if (!player.getQuestRepository().isComplete(Quests.DRUIDIC_RITUAL)) {
player.getPacketDispatch().sendMessage("You must complete the Druidic Ritual quest before you can use Herblore.");
return false;
}

View file

@ -12,6 +12,7 @@ import core.tools.RandomFunction;
import org.rs09.consts.Sounds;
import static core.api.ContentAPIKt.playAudio;
import content.data.Quests;
/**
@ -69,7 +70,7 @@ public final class HerblorePulse extends SkillPulse<Item> {
@Override
public boolean checkRequirements() {
if (!player.getQuestRepository().isComplete("Druidic Ritual")) {
if (!player.getQuestRepository().isComplete(Quests.DRUIDIC_RITUAL)) {
player.getPacketDispatch().sendMessage("You must complete the Druidic Ritual quest before you can use Herblore.");
return false;
}

View file

@ -9,6 +9,7 @@ import core.game.node.entity.player.link.SpellBookManager.SpellBook
import core.game.node.entity.skill.Skills
import org.rs09.consts.Scenery
import org.rs09.consts.Sounds
import content.data.Quests
class MagicAltarListener : InteractionListener {
override fun defineListeners() {
@ -24,7 +25,7 @@ class MagicAltarListener : InteractionListener {
private fun meetsRequirements(player: Player, altar: Node): Boolean {
val level = if (altar.id == ANCIENT_ALTAR) 50 else 65
if (!hasRequirement(player, if (altar.id == ANCIENT_ALTAR) "Desert Treasure" else "Lunar Diplomacy")) {
if (!hasRequirement(player, if (altar.id == ANCIENT_ALTAR) Quests.DESERT_TREASURE else Quests.LUNAR_DIPLOMACY)) {
return false
}

View file

@ -29,6 +29,7 @@ import core.game.world.update.flag.context.Graphics
import org.rs09.consts.Items
import org.rs09.consts.Scenery
import org.rs09.consts.Sounds
import content.data.Quests
class ModernListeners : SpellListener("modern"){
override fun defineListeners() {
@ -65,28 +66,28 @@ class ModernListeners : SpellListener("modern"){
}
onCast(Modern.ARDOUGNE_TELEPORT, NONE){ player, _ ->
if (!hasRequirement(player, "Plague City"))
if (!hasRequirement(player, Quests.PLAGUE_CITY))
return@onCast
requires(player,51, arrayOf(Item(Items.WATER_RUNE_555,2),Item(Items.LAW_RUNE_563,2)))
sendTeleport(player,61.0, Location.create(2662, 3307, 0))
}
onCast(Modern.WATCHTOWER_TELEPORT, NONE){ player, _ ->
if (!hasRequirement(player, "Watchtower"))
if (!hasRequirement(player, Quests.WATCHTOWER))
return@onCast
requires(player,58, arrayOf(Item(Items.EARTH_RUNE_557,2),Item(Items.LAW_RUNE_563,2)))
sendTeleport(player,68.0, Location.create(2549, 3112, 0))
}
onCast(Modern.TROLLHEIM_TELEPORT, NONE){ player, _ ->
if (!hasRequirement(player, "Eadgar's Ruse"))
if (!hasRequirement(player, Quests.EADGARS_RUSE))
return@onCast
requires(player,61, arrayOf(Item(Items.FIRE_RUNE_554,2),Item(Items.LAW_RUNE_563,2)))
sendTeleport(player,68.0, Location.create(2891, 3678, 0))
}
onCast(Modern.APE_ATOLL_TELEPORT, NONE){ player, _ ->
if (!hasRequirement(player, "Monkey Madness"))
if (!hasRequirement(player, Quests.MONKEY_MADNESS))
return@onCast
requires(player,64, arrayOf(Item(Items.FIRE_RUNE_554,2),Item(Items.WATER_RUNE_555,2),Item(Items.LAW_RUNE_563,2),Item(Items.BANANA_1963)))
sendTeleport(player,74.0, Location.create(2754, 2784, 0))

View file

@ -12,11 +12,12 @@ import core.game.node.entity.skill.Skills
import core.game.world.map.Location
import org.rs09.consts.Scenery
import org.rs09.consts.Sounds
import content.data.Quests
class PrayerAltarListener : InteractionListener {
override fun defineListeners() {
on(altars, IntType.SCENERY, "pray", "pray-at") { player, node ->
if (node.id == Scenery.TRIBAL_STATUE_3863 && !hasRequirement(player, "Tai Bwo Wannai Trio")) {
if (node.id == Scenery.TRIBAL_STATUE_3863 && !hasRequirement(player, Quests.TAI_BWO_WANNAI_TRIO)) {
// https://runescape.wiki/w/Tribal_Statue?oldid=1940922
return@on true
}
@ -43,9 +44,9 @@ class PrayerAltarListener : InteractionListener {
}
on(Scenery.CHAOS_ALTAR_61, IntType.SCENERY, "check") { player, _ ->
if (getQuestStage(player, "Merlin's Crystal") == 70) {
if (getQuestStage(player, Quests.MERLINS_CRYSTAL) == 70) {
sendDialogue(player, "You find a small inscription at the bottom of the altar. It reads: 'Snarthon Candtrick Termanto'.")
setQuestStage(player, "Merlin's Crystal", 80)
setQuestStage(player, Quests.MERLINS_CRYSTAL, 80)
} else {
sendMessage(player, "An altar of the evil god Zamorak.")
}

View file

@ -5,6 +5,7 @@ import core.game.node.entity.player.Player;
import core.game.node.scenery.Scenery;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* Represents an altar an it's relative information(corresponding ruin, etc)
@ -72,15 +73,15 @@ public enum Altar {
*/
public void enterRift(Player player) {
if (this == ASTRAL) {
if (!hasRequirement(player, "Lunar Diplomacy"))
if (!hasRequirement(player, Quests.LUNAR_DIPLOMACY))
return;
}
if (this == DEATH) {
if (!hasRequirement(player, "Mourning's End Part II"))
if (!hasRequirement(player, Quests.MOURNINGS_END_PART_II))
return;
}
if (this == BLOOD) {
if (!hasRequirement(player, "Legacy of Seergaze"))
if (!hasRequirement(player, Quests.LEGACY_OF_SEERGAZE))
return;
}
if (this == LAW) {
@ -89,7 +90,7 @@ public enum Altar {
return;
}
}
if (this == COSMIC && !player.getQuestRepository().isComplete("Lost City")) {
if (this == COSMIC && !player.getQuestRepository().isComplete(Quests.LOST_CITY)) {
player.getPacketDispatch().sendMessage("You need to have completed the Lost City quest in order to do that.");
return;
}

View file

@ -1,5 +1,6 @@
package content.global.skill.runecrafting
import content.data.Quests
import content.region.misthalin.varrock.diary.VarrockAchivementDiary.Companion.EasyTasks.ENTER_EARTH_ALTAR
import core.api.*
import core.game.container.impl.EquipmentContainer.SLOT_HAT
@ -19,7 +20,7 @@ class MysteriousRuinListener : InteractionListener {
private val animation = Animation(827)
private val allowedUsed = arrayOf(1438, 1448, 1444, 1440, 1442, 5516, 1446, 1454, 1452, 1462, 1458, 1456, 1450, 1460).toIntArray()
private val allowedWith = allRuins()
private val nothingInteresting = "Nothing interesting happens"
private val nothingInteresting = "Nothing interesting happens."
override fun defineListeners() {
onUseWith(IntType.SCENERY, allowedUsed, *allowedWith) { player, used, with ->
@ -76,9 +77,9 @@ class MysteriousRuinListener : InteractionListener {
private fun checkQuestCompletion(player: Player, ruin: MysteriousRuin): Boolean {
return when (ruin) {
MysteriousRuin.DEATH -> hasRequirement(player, QuestReq(MEP_2), true)
MysteriousRuin.BLOOD -> hasRequirement(player, QuestReq(SEERGAZE), true)
else -> hasRequirement(player, QuestReq(RUNE_MYSTERIES), true)
MysteriousRuin.DEATH -> hasRequirement(player, Quests.MOURNINGS_END_PART_II, true)
MysteriousRuin.BLOOD -> hasRequirement(player, Quests.LEGACY_OF_SEERGAZE, true)
else -> hasRequirement(player, Quests.RUNE_MYSTERIES, true)
}
}
@ -102,4 +103,4 @@ class MysteriousRuinListener : InteractionListener {
})
}
}
}

View file

@ -24,6 +24,7 @@ import org.rs09.consts.Sounds;
import java.util.ArrayList;
import java.util.Arrays;
import content.data.Quests;
/**
* A class used to craft runes.
@ -102,15 +103,15 @@ public final class RuneCraftPulse extends SkillPulse<Item> {
@Override
public boolean checkRequirements() {
if (altar == Altar.ASTRAL) {
if (!hasRequirement(player, "Lunar Diplomacy"))
if (!hasRequirement(player, Quests.LUNAR_DIPLOMACY))
return false;
}
if (altar == Altar.DEATH) {
if (!hasRequirement(player, "Mourning's End Part II"))
if (!hasRequirement(player, Quests.MOURNINGS_END_PART_II))
return false;
}
if (altar == Altar.BLOOD) {
if (!hasRequirement(player, "Legacy of Seergaze"))
if (!hasRequirement(player, Quests.LEGACY_OF_SEERGAZE))
return false;
}
if (!altar.isOurania() && getDynLevel(player, Skills.RUNECRAFTING) < rune.getLevel()) {

View file

@ -24,6 +24,7 @@ import core.plugin.Initializable;
import core.plugin.Plugin;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* Handles runecraftign related options.
@ -52,7 +53,7 @@ public class RunecraftingPlugin extends OptionHandler {
@Override
public boolean handle(final Player player, Node node, String option) {
if (!player.getQuestRepository().isComplete("Rune Mysteries") && player.getDetails().getRights() != Rights.ADMINISTRATOR) {
if (!player.getQuestRepository().isComplete(Quests.RUNE_MYSTERIES) && player.getDetails().getRights() != Rights.ADMINISTRATOR) {
player.getPacketDispatch().sendMessage("You need to finish the Rune Mysteries Quest in order to do this.");
return true;
}
@ -97,7 +98,7 @@ public class RunecraftingPlugin extends OptionHandler {
}
Altar a = Altar.forObject(((Scenery) node));
if (a == Altar.ASTRAL) {
if (!hasRequirement(player, "Lunar Diplomacy"))
if (!hasRequirement(player, Quests.LUNAR_DIPLOMACY))
return true;
}
player.getPulseManager().run(new RuneCraftPulse(player, null, a, false, null));

View file

@ -7,6 +7,7 @@ import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import static core.api.ContentAPIKt.*;
import content.data.Quests;
/**
@ -51,7 +52,7 @@ public final class ZamorakMageDialogue extends DialoguePlugin {
public boolean open(Object... args) {
npc = (NPC) args[0];
varrockMage = npc.getId() == 2261 || npc.getId() == 2260;
if (!player.getQuestRepository().isComplete("Rune Mysteries")) {
if (!player.getQuestRepository().isComplete(Quests.RUNE_MYSTERIES)) {
end();
player.sendMessage("The mage doesn't seem interested in talking to you.");
return true;

View file

@ -16,6 +16,7 @@ import core.ServerStore.Companion.getInt
import core.api.*
import core.cache.def.impl.ItemDefinition
import org.rs09.consts.Items
import content.data.Quests
enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)? = null) {
BAREFISTED_SMITHING("cape_perks:barefisted-smithing"),
@ -195,11 +196,11 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
end()
if(spellbook != null){
if (spellbook == SpellBookManager.SpellBook.ANCIENT) {
if (!hasRequirement(player, "Desert Treasure"))
if (!hasRequirement(player, Quests.DESERT_TREASURE))
return true
}
else if (spellbook == SpellBookManager.SpellBook.LUNAR) {
if (!hasRequirement(player, "Lunar Diplomacy"))
if (!hasRequirement(player, Quests.LUNAR_DIPLOMACY))
return true
}
player.spellBookManager.setSpellBook(spellbook)
@ -260,9 +261,9 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
fun sendAltar(player: Player,altar: Altar){
end()
if (altar == Altar.DEATH && !hasRequirement(player, "Mourning's End Part II")) return
if (altar == Altar.ASTRAL && !hasRequirement(player, "Lunar Diplomacy")) return
if (altar == Altar.BLOOD && !hasRequirement(player, "Legacy of Seergaze")) return
if (altar == Altar.DEATH && !hasRequirement(player, Quests.MOURNINGS_END_PART_II)) return
if (altar == Altar.ASTRAL && !hasRequirement(player, Quests.LUNAR_DIPLOMACY)) return
if (altar == Altar.BLOOD && !hasRequirement(player, Quests.LEGACY_OF_SEERGAZE)) return
if (altar == Altar.LAW && !ItemDefinition.canEnterEntrana(player)) {
sendItemDialogue(player, Items.SARADOMIN_SYMBOL_8055, "No weapons or armour are permitted on holy Entrana.")
return

View file

@ -17,6 +17,7 @@ import core.plugin.Initializable;
import static core.tools.DialogueConstKt.END_DIALOGUE;
import content.data.Quests;
/**
* Represents the dialogue plugin used for a slayer master.
@ -99,7 +100,7 @@ public final class SlayerMasterDialogue extends DialoguePlugin {
npc = (NPC) args[0];
}
master = Master.forId(args[0] instanceof NPC ? ((NPC) args[0]).getId() : (int) args[0]);
quest = player.getQuestRepository().getQuest("Animal Magnetism");
quest = player.getQuestRepository().getQuest(Quests.ANIMAL_MAGNETISM);
if (master == Master.DURADEL) {
if (Skillcape.isMaster(player, Skills.SLAYER)) {

View file

@ -12,6 +12,7 @@ import core.plugin.Initializable;
import core.plugin.Plugin;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* Handles related slayer nodes.
@ -63,7 +64,7 @@ public class SlayerPlugin extends OptionHandler {
player.teleport(new Location(2729, 3733, 0));
break;
case 15767:
if (!hasRequirement(player, "Cabin Fever"))
if (!hasRequirement(player, Quests.CABIN_FEVER))
return true;
player.teleport(new Location(3748, 9373, 0));
break;

View file

@ -17,6 +17,7 @@ import core.plugin.Plugin;
import core.plugin.ClassScanner;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* Handles the slayer reward interface plugin.
@ -309,7 +310,7 @@ public class SlayerRewardPlugin extends ComponentPlugin {
@Override
public boolean handle(Player player, Node node, String option) {
if (!hasRequirement(player, "Smoking Kills"))
if (!hasRequirement(player, Quests.SMOKING_KILLS))
return true;
openTab(player, BUY);
return true;

View file

@ -8,6 +8,7 @@ import java.util.HashMap;
import core.game.node.entity.player.Player;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* A non-garbage way of representing tasks
@ -30,34 +31,34 @@ public enum Tasks {
BLACK_DRAGONS(80, new int[] {54, 4673, 4674, 4675, 4676, 3376, 50 }, new String[] { "Black dragons are the strongest dragons;", "watch out for their fiery breath." }, 1, false, true),
BLOODVELDS(50, new int[] { 1618, 1619, 6215, 7643, 7642 }, new String[] { "Bloodvelds are strange demonic creatures, they use their", "long rasping tongue to feed on just about", "anything they can find." }, 50, false, false),
BLUE_DRAGONS(65, new int[] { 55, 4681, 4682, 4683, 4684, 5178, 52, 4665, 4666, }, new String[] { "Blue dragons aren't as strong as other dragons but they're", "still very powerful, watch out for their fiery breath." }, 1, false, true),
BRINE_RATS(45, new int[] { 3707 }, new String[] { "Brine rats can be found in caves that are near the", "sea. They are hairless, bad-tempered and generally", "unfriendly." }, 47, "Olaf's Quest"),
BRINE_RATS(45, new int[] { 3707 }, new String[] { "Brine rats can be found in caves that are near the", "sea. They are hairless, bad-tempered and generally", "unfriendly." }, 47, Quests.OLAFS_QUEST),
BRONZE_DRAGONS(75, new int[] { 1590 }, new String[] { "Bronze Dragons are the weakest of the metallic", "dragons, their bronze scales are far thicker than", "normal bronze armour." }, 1, false, true),
CATABLEPONS(35, new int[] { 4397, 4398, 4399, }, new String[] { "Catablepon are mythical, cow like, magical creatures", "Beware their weakening glare." }, 1, false, false),
CAVE_BUG(1, new int[] { 1832, 5750, }, new String[] { "Cave Bugs are like Cave Crawlers, except smaller and", "easier to squish, though they still have a fondness", "for plants." }, 7, false, false),
CAVE_CRAWLERS(10, new int[] { 1600, 1601, 1602, 1603, }, new String[] { "Cave Crawlers are small and fast, often hiding in", "ambush. Avoid their barbed tongue or you'll", "get poisoned." }, 10, false, false),
CAVE_HORRORS(85, new int[] { 4353, 4354, 4355, 4356, 4357, }, new String[] { "Cave Horrors can be found under Mos Le'Harmless. You", "will need a Witchwood Icon to fight them effectively." }, 58, "Cabin Fever"),
CAVE_HORRORS(85, new int[] { 4353, 4354, 4355, 4356, 4357, }, new String[] { "Cave Horrors can be found under Mos Le'Harmless. You", "will need a Witchwood Icon to fight them effectively." }, 58, Quests.CABIN_FEVER),
CAVE_SLIMES(15, new int[] { 1831 }, new String[] { "Cave Slimes are the lesser cousins of Jellies, though", "don't be fooled they can still be dangerous as", "they're often poisonous." }, 17, false, false),
COCKATRICES(25, new int[] { 1620, 1621, 4227, }, new String[] { "Cockatrice, like Basilisks, have a gaze which will", "paralyse and harm their prey. You'll need a Mirror", "Shield to protect you." }, 25, false, false),
COWS(5, new int[] { 81, 1766, 1768, 2310, 397, 955, 1767, 3309 }, new String[] { "Cows are bigger than you, so they'll often hit fairly", "hard but are usually fairly slow to react." }, 1, false, false),
CRAWLING_HAND(1,new int[] { 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 4226, 7640, 7641 }, new String[] { "Crawling Hands are undead severed hands, fast and", "dexterous they claw their victims." }, 5, true, false),
CROCODILES(50, new int[] { 1993, 6779 }, new String[] { "Crocodiles are large reptiles which live near water.", "You'll want to have a stabbing weapon handy for", "puncturing their thick scaly hides." }, 1, false, false),
DAGANNOTHS(75, new int[] { 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 2454, 2455, 2456, 2881, 2882, 2883, 2887, 2888, 3591, }, new String[] { "Dagannoth are large sea dwelling creatures which are", "very aggressive. You'll often find them in caves", "near sea water." }, 1, "Horror from the Deep"),
DARK_BEASTS(90, new int[] { 2783 }, new String[] { "Dark Beasts are large, dog-like predators.", "Their massively muscled bodies protect", "them from crushing weapons." }, 90, "Mourning's Ends Part II"),
DAGANNOTHS(75, new int[] { 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 2454, 2455, 2456, 2881, 2882, 2883, 2887, 2888, 3591, }, new String[] { "Dagannoth are large sea dwelling creatures which are", "very aggressive. You'll often find them in caves", "near sea water." }, 1, Quests.HORROR_FROM_THE_DEEP),
DARK_BEASTS(90, new int[] { 2783 }, new String[] { "Dark Beasts are large, dog-like predators.", "Their massively muscled bodies protect", "them from crushing weapons." }, 90, Quests.MOURNINGS_END_PART_II),
DESERT_LIZARDS(15, new int[] { 2803, 2804, 2805, 2806, 2807, 2808 }, new String[] { "Lizards are large reptiles with tough skin. Those", "found in the desert will need you to douse them with", "freezing water to finish them off after a tough battle." }, 22, false, false),
DOG(15, new int[] { 99, 3582, 1994, 1593, 1594, 3582 }, new String[] { "Dogs are much like Wolves, they are", "pack creatures which will hunt in groups." }, 1, false, false),
DUST_DEVILS(70, new int[] { 1624 }, new String[] { "Dust Devils use clouds of dust, sand, ash and whatever", "else they can inhale to blind and disorientate", "their victims." }, 65, false, false),
DWARF(6, new int[] { 118, 120, 121, 382, 3219, 3220, 3221, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3294, 3295, 4316, 5880, 5881, 5882, 5883, 5884, 5885, 2130, 2131, 2132, 2133, 3276, 3277, 3278, 3279, 119, 2423 }, new String[] { "Dwarves are a small but tough race of miners, often", "using pickaxes to pierce their opponents armour." }, 1, false, false),
EARTH_WARRIORS(35, new int[] { 124 }, new String[] { "Earth Warriors are a kind of earth elemental,", "grind them to dust with blunt weapons." }, 1, false, false),
ELVES(70, new int[] { 1183, 1184, 2359, 2360, 2361, 2362, 2373, 7438, 7439, 7440, 7441 }, new String[]{ "Elves are quick, agile, and vicious fighters which", "often favour bows and polearms."}, 1, "Regicide"),
ELVES(70, new int[] { 1183, 1184, 2359, 2360, 2361, 2362, 2373, 7438, 7439, 7440, 7441 }, new String[]{ "Elves are quick, agile, and vicious fighters which", "often favour bows and polearms."}, 1, Quests.REGICIDE),
// Waiting for either Rum Deal or Pirate Pete and Fever Spiders before adding this assignment
FEVER_SPIDER(1, new int[] { 2850 }, new String[] { "Fever Spiders are giant spiders that carry the deadly", "Spider Fever. If you don't want to catch it I suggest", "you wear Slayer Gloves to fight them." }, 42, "Rum Deal"),
FEVER_SPIDER(1, new int[] { 2850 }, new String[] { "Fever Spiders are giant spiders that carry the deadly", "Spider Fever. If you don't want to catch it I suggest", "you wear Slayer Gloves to fight them." }, 42, Quests.RUM_DEAL),
FIRE_GIANTS(65, new int[] { 110, 1582, 1583, 1584, 1585, 1586, 7003, 7004 }, new String[] { "Like other giants, Fire Giants often wield large weapons", "learn to recognise what kind of weapon it is,", "and act accordingly." }, 1, false, false),
FLESH_CRAWLERS(15, new int[] { 4389, 4390, 4391 }, new String[] { "Flesh Crawlers are scavengers and will eat you - and", "anyone else, given the chance." }, 1, false, false),
GARGOYLES(80, new int[] { 1610, 6389 }, new String[] { "Gargoyles are winged creatures of stone. You'll need", "to fight them to near death before breaking them apart", "with a rock hammer." }, 75, false, false),
GHOSTS(13, new int[] { 103, 104, 491, 1541, 1549, 2716, 2931, 4387, 388, 5342, 5343, 5344, 5345, 5346, 5347, 5348, 1698, 5349, 5350, 5351, 5352, 5369, 5370, 5371, 5372, 5373, 5374, 5572, 6094, 6095, 6096, 6097, 6098, 6504, 13645, 13466, 13467, 13468, 13469, 13470, 13471, 13472, 13473, 13474, 13475, 13476, 13477, 13478, 13479, 13480, 13481 }, new String[] { "Ghosts are undead so magic is your best bet against", "them, there is even a spell specially for fighting", "the undead." }, 1, true, false),
GHOULS(25, new int[] { 1218, 3059 }, new String[] { "Ghouls aren't undead but they are stronger and", "tougher than they look. However they're also very", "cowardly and will run if they're losing a fight." }, 1, false, false),
GOBLINS(1, new int[] { 100, 101, 102, 444, 445, 489, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2678, 2679, 2680, 2681, 3060, 3264, 3265, 3266, 3267, 3413, 3414, 3415, 3726, 4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 4407, 4408, 4409, 4410, 4411, 4412, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4499, 4633, 4634, 4635, 4636, 4637, 5786, 5824, 5855, 5856, 6125, 6126, 6132, 6133, 6279, 6280, 6281, 6282, 6283, 6402, 6403, 6404, 6405, 6406, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 6422, 6423, 6424, 6425, 6426, 6427, 6428, 6429, 6430, 6431, 6432, 6433, 6434, 6435, 6436, 6437, 6438, 6439, 6440, 6441, 6442, 6443, 6444, 6445, 6446, 6447, 6448, 6449, 6450, 6451, 6452, 6453, 6454, 6455, 6456, 6457, 6458, 6459, 6460, 6461, 6462, 6463, 6464, 6465, 6466, 6467, 6490, 6491, 6492, 6493, 6494, 6495, 6496, 6497 }, new String[] { "Goblins are mostly just annoying, but they can be vicious.", "Watch out for the spears they sometimes carry." }, 1, false, false),
GORAKS(70, new int[] { 4418, 6218 }, new String[] { "Goraks are extremely aggressive creatures. They have", "been imprisoned on an alternative plane, which is", "only accessible by using the fairyrings. Be extremely", "careful, their touch drains health as well as skills!" }, 1, "A Fairy Tale I - Growing Pains"),
GORAKS(70, new int[] { 4418, 6218 }, new String[] { "Goraks are extremely aggressive creatures. They have", "been imprisoned on an alternative plane, which is", "only accessible by using the fairyrings. Be extremely", "careful, their touch drains health as well as skills!" }, 1, Quests.FAIRYTALE_I_GROWING_PAINS),
GREATER_DEMONS(75, new int[] { 83, 4698, 4699, 4700, 4701, 6204 }, new String[] { "Greater Demons are magic creatures so they are weak", "to magical attacks. Though not the strongest demon,", "they are still dangerous." }, 1, false, false),
GREEN_DRAGONS(52, new int[] { 941, 4677, 4678, 4679, 4680, 5362, 742 }, new String[] { "Green Dragons are the weakest dragon but still very", "powerful, watch out for their fiery breath." }, 1, false, true),
HARPIE_BUG_SWARMS(45, new int[] { 3153 }, new String[] { "Harpie Bug Swarms are pesky critters that are hard to", "hit. You need a lit bug lantern to distract them with", "its hypnotic light." }, 33, false, false),
@ -70,21 +71,21 @@ public enum Tasks {
INFERNAL_MAGES(40, new int[] { 1643, 1644, 1645, 1646, 1647 }, new String[] { "Infernal Mages are dangerous spell users, beware of", "their magic spells and go properly prepared" }, 45, false, false),
IRON_DRAGONS(80, new int[] { 1591 }, new String[] { "Iron Dragons are some of the weaker metallic dragons,", "their iron scales are far thicker than normal", "iron armour." }, 1, false, true),
JELLIES(57, new int[] { 1637, 1638, 1639, 1640, 1641, 1642 }, new String[] { "Jellies are nasty cube-like gelatinous creatures which", "absorb everything they come across into themselves." }, 52, false, false),
JUNGLE_HORRORS(65, new int[] { 4348, 4349, 4350, 4351, 4352 }, new String[] { "Jungle Horrors can be found all over Mos Le'Harmless.", "They are strong and aggressive, so watch out!" }, 1, "Cabin Fever"),
JUNGLE_HORRORS(65, new int[] { 4348, 4349, 4350, 4351, 4352 }, new String[] { "Jungle Horrors can be found all over Mos Le'Harmless.", "They are strong and aggressive, so watch out!" }, 1, Quests.CABIN_FEVER),
KALPHITES(15, new int[] { 1153, 1154, 1155, 1156, 1157, 1159, 1160, 1161 }, new String[] { "Kalphites are large insects which live in great hives", "under the desert sands." }, 1, false, false),
// Waiting for the killer watt plane to be implemented before adding to assignments
KILLERWATTS(1, new int[] { 3201 }, new String[] { "Killerwatts store huge amounts of energy in their", "bodies, which is released if they are touched. You'll", "need to wear heavily insulated boots to counter this", "shocking effect." }, 37, "Ernest the Chicken"),
KILLERWATTS(1, new int[] { 3201 }, new String[] { "Killerwatts store huge amounts of energy in their", "bodies, which is released if they are touched. You'll", "need to wear heavily insulated boots to counter this", "shocking effect." }, 37, Quests.ERNEST_THE_CHICKEN),
KURASKS(65, new int[] { 1608, 1609, 4229, 7805, 7797 }, new String[] { "Kurasks are large brutal creatures with very thick", "hides. You'll need a Leaf-Tipped Spear Sword or", "Battle-axe, Broad Arrows, or a Magic Dart to harm them." }, 70, false, false),
LESSER_DEMONS(60, new int[] { 82, 6203, 3064, 4694, 4695, 6206, 3064, 4696, 4697, 6101 }, new String[] { "Lesser Demons are magic creatures so they are weak to", "magical attacks. Though they're relatively weak they", "are still dangerous." }, 1, false, false),
MINOTAURS(7, new int[] { 4404, 4405, 4406 }, new String[] { "Minotaurs are large manlike creatures but you'll", "want to be careful of their horns." }, 1, false, false),
MITHRIL_DRAGONS(60, new int[] { 5363 }, new String[] { "Mithril dragons are more vulnerable to magic and to", "stab-based melee attacks than to anything else." }, 1, false, true),
MOGRES(1, new int[] { 114 }, new String[] { "Mogres are a type of aquatic Ogre that is", "often mistaken for a giant mudskipper. You have to force", "them out of the water with a fishing explosive." }, 32, false, false),
// Waiting for molanisks transform to be implemented before adding this to assignments
MOLANISKS(1, new int[] { 5751 }, new String[] { "Molanisks are subterranean creatures. You can find", "them in caves deep below the ground. I heard that the", "goblins have recently had trouble with some, but they", "use a bell of some sort to deal with them."}, 39, "Death to the Dorgeshuun"),
MOLANISKS(1, new int[] { 5751 }, new String[] { "Molanisks are subterranean creatures. You can find", "them in caves deep below the ground. I heard that the", "goblins have recently had trouble with some, but they", "use a bell of some sort to deal with them."}, 39, Quests.DEATH_TO_THE_DORGESHUUN),
MONKEYS(1, new int[] { 132, 1463, 1464, 2301, 4344, 4363, 6943, 7211, 7213, 7215, 7217, 7219, 7221, 7223, 7225, 7227, 1455, 1459, 1460, 1456, 1457, 1458 }, new String[] { "Monkeys are tricky creatures, they are agile and", "fairly fast. Learn to anticipate their movements." }, 1, false, false),
MOSS_GIANTS(40, new int[] { 112, 1587, 1588, 1681, 4534, 4688, 4706 }, new String[] { "Like other giants, Moss Giants often wield large", "weapons, learn to recognise what kind of weapon it is", "and act accordingly." }, 1, false, false),
// Waiting for zygomite transform to be implemented before adding this to assignments
MUTATED_ZYGOMITES(1, new int[] { 3346, 3347 }, new String[] { "Mutated Zygomites are hard to destroy. They regenerate", "quickly so you will need to finish them with fungicide." }, 57, "Lost City"),
MUTATED_ZYGOMITES(1, new int[] { 3346, 3347 }, new String[] { "Mutated Zygomites are hard to destroy. They regenerate", "quickly so you will need to finish them with fungicide." }, 57, Quests.LOST_CITY),
NECHRYAELS(85, new int[] { 1613 }, new String[] { "Nechryael are demons of decay which summon small", "winged beings to help them fight their victims." }, 80, false, false),
OGRES(40, new int[] { 115, 374, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2060, 2801, 3419, 7078, 7079, 7080, 7081, 7082 }, new String[] { "Ogres are brutal creatures, favouring large blunt", "maces and clubs they often attack without warning." }, 1, false, false),
OTHERWORDLY_BEING(40, new int[] { 126 }, new String[] { "Otherworldly Beings are ethereal beings making them", "weak to magical attack." }, 1, false, false),
@ -92,22 +93,22 @@ public enum Tasks {
RED_DRAGONS(1, new int[] { 53, 1589, 3588, 4667, 4668, 4669, 4670, 4671, 4672 }, new String[] { "Red Dragons are very powerful, stronger than most", "dragons, watch out for their fiery breath." }, 1, false, false),
ROCK_SLUGS(20, new int[] { 1631, 1632 }, new String[] { "Rockslugs are strange stoney slugs. You'll need to", "fight them to near death before finishing them off", "with Salt." }, 20, false, false),
// Seems to need Contact or the NPCs added to dungeons before adding this assignment as a task
SCABARITES(1, new int[] { 2001, 4500, 5251, 5252, 5255, 5256, 5250, 5254, 6777, 6778, 6774, 6780, 6781, 6773 }, new String[] {"Scabarites are insectoid creatures, found beyond the", "Kharidian deserts. They can be extremely dangerous."}, 1, "Contact!"),
SCABARITES(1, new int[] { 2001, 4500, 5251, 5252, 5255, 5256, 5250, 5254, 6777, 6778, 6774, 6780, 6781, 6773 }, new String[] {"Scabarites are insectoid creatures, found beyond the", "Kharidian deserts. They can be extremely dangerous."}, 1, Quests.CONTACT),
SCORPIONS(7, new int[] { 107, 1477, 4402, 4403, 144 }, new String[] { "Scorpions are almost always poisonous, their hard", "carapace makes them resistant to crushing and", "stabbing attacks." }, 1, false, false),
SEA_SNAKES(1, new int[] { 3939, 3940 }, new String[] { "Sea Snakes are long and slithery with a venomous bite.", "The larger ones are more poisonous, so keep an eye on", "your health." }, 1, "Royal Trouble"),
SEA_SNAKES(1, new int[] { 3939, 3940 }, new String[] { "Sea Snakes are long and slithery with a venomous bite.", "The larger ones are more poisonous, so keep an eye on", "your health." }, 1, Quests.ROYAL_TROUBLE),
SHADE(30, new int[] { 3617, 1250, 1241, 1246, 1248, 1250, 428, 1240 }, new String[] { "Shades are undead so magic is your best best against", "them, you can find Shades at Mort'ton." }, 1, true, false),
// Dungeon needs to be connected to the Legend's Guild before adding this assignment as a task
SHADOW_WARRIORS(1, new int[] { 158 }, new String[] { "Shadow Warriors are dark and mysterious, they hide in", "the shadows so be wary of ambushes." }, 1, "Legends' Quest"),
SHADOW_WARRIORS(1, new int[] { 158 }, new String[] { "Shadow Warriors are dark and mysterious, they hide in", "the shadows so be wary of ambushes." }, 1, Quests.LEGENDS_QUEST),
SKELETAL_WYVERN(70, new int[] { 3068, 3069, 3070, 3071 }, new String[] { "Skeletal Wyverns are extremely dangerous and they are", "hard to hit with arrows as they slip right through.", "To stand a good chance of surviving you'll need some", "elemental shielding from its icy breath." }, 72, false, false),
SKELETONS(15, new int[] { 90, 91, 92, 93, 94, 459, 1471, 1575, 1973, 2036, 2037, 2715, 2717, 3065, 3151, 3291, 3581, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3844, 3850, 3851, 4384, 4385, 4386, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5359, 5365, 5366, 5367, 5368, 5381, 5384, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5411, 5412, 5422, 6091, 6092, 6093, 6103, 6104, 6105, 6106, 6107, 6764, 6765, 6766, 6767, 6768, 2050, 2056, 2057, 1539, 7640 }, new String[] { "Skeletons are undead so magic is your best bet against", "them, there is even a spell specially for fighting the undead." }, 1, true, false),
SPIDERS(1, new int[] { 61, 1004, 1221, 1473, 1474, 63, 4401, 2034, 977, 7207, 134, 1009, 59, 60, 4400, 58, 62, 1478, 2491, 2492, 6376, 6377, }, new String[] { "Spiders are often poisonous, and many varieties are", "camouflaged too." }, 1, false, false),
SPIRTUAL_MAGES(60, new int[] { 6221, 6231, 6257, 6278 }, new String[] { "Spiritual mages can be found in the icy caverns near", "Trollheim, supporting the cause of their chosen god." }, 83, "Death Plateau"),
SPIRTUAL_RANGERS(60, new int[] { 6220, 6230, 6256, 6276 }, new String[] { "Spiritual rangers can be found in the icy caverns near", "Trollheim, supporting the cause of their chosen god." }, 63, "Death Plateau"),
SPIRTUAL_WARRIORS(60, new int[] { 6219, 6229, 6255, 6277, }, new String[] { "Spiritual warriors can be found in the icy caverns near", "Trollheim, supporting the cause of their chosen god." }, 68, "Death Plateau"),
SPIRTUAL_MAGES(60, new int[] { 6221, 6231, 6257, 6278 }, new String[] { "Spiritual mages can be found in the icy caverns near", "Trollheim, supporting the cause of their chosen god." }, 83, Quests.DEATH_PLATEAU),
SPIRTUAL_RANGERS(60, new int[] { 6220, 6230, 6256, 6276 }, new String[] { "Spiritual rangers can be found in the icy caverns near", "Trollheim, supporting the cause of their chosen god." }, 63, Quests.DEATH_PLATEAU),
SPIRTUAL_WARRIORS(60, new int[] { 6219, 6229, 6255, 6277, }, new String[] { "Spiritual warriors can be found in the icy caverns near", "Trollheim, supporting the cause of their chosen god." }, 68, Quests.DEATH_PLATEAU),
STEEL_DRAGONS( 85,new int[] { 1592, 3590 }, new String[] { "Steel dragons are dangerous and metallic, with steel", "scales that are far thicker than normal steel armour. As", "you are an accomplished slayer, I am sure you'll be", "able to deal with them easily."}, 1, false, true),
SUQAHS (65, new int[] { 4527, 4528, 4529, 4530, 4531, 4532, 4533 }, new String[] { "Suqahs can only be found on the mystical Lunar Isle.", "They are capable of melee and magic attacks and often", "drop hide, teeth and herbs!" }, 1, "Lunar Diplomacy"),
SUQAHS (65, new int[] { 4527, 4528, 4529, 4530, 4531, 4532, 4533 }, new String[] { "Suqahs can only be found on the mystical Lunar Isle.", "They are capable of melee and magic attacks and often", "drop hide, teeth and herbs!" }, 1, Quests.LUNAR_DIPLOMACY),
// No access to Lair of Tarn Razorlor but this should be added as a task when there is access
TERROR_DOGS(1, new int[] { 5417, 5418 }, new String[] { "Terror dogs are the personal pets of Tarn Razorlor.", "Wherever you find him, you will find them. They are", "bad-tempered and generally unfriendly." }, 40, "Haunted Mine"),
TERROR_DOGS(1, new int[] { 5417, 5418 }, new String[] { "Terror dogs are the personal pets of Tarn Razorlor.", "Wherever you find him, you will find them. They are", "bad-tempered and generally unfriendly." }, 40, Quests.HAUNTED_MINE),
TROLLS(60, new int[] { 72, 3584, 1098, 1096, 1097, 1095, 1101, 1105, 1102, 1103, 1104, 1130, 1131, 1132, 1133, 1134, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1138, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 3840, 3841, 3842, 3843, 3845, 1933, 1934, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 391, 392, 393, 394, 395, 396}, new String[] { "Trolls regenerate damage quickly but are still", "vulnerable to poisons, they usually use crushing", "weapons." }, 1, false, false),
TUROTHS(60, new int[] { 1622, 1611, 1623, 1626, 1627, 1628, 1629, 1630, 7800}, new String[] { "Turoth are large vicious creatures with thick hides.", "You'll need a Leaf-Tipped Spear Sword or Battle-axe,", "Broad Arrows, or a Magic Dart to harm them." }, 55, false, false),
VAMPIRES(35, new int[] { 1220, 1223, 1225, 6214 }, new String[] { "Vampires are extremely powerful beings. They feed on", "the blood of the living so watch out you don't", "get bitten." }, 1, false, false),
@ -117,8 +118,8 @@ public enum Tasks {
// If a grapple is implemented from W Castle Wars to E Posion Swamps
// The dungeon connected and populated
// then these could be added as a task
WARPED_TERROR_BIRD(1, new int[] { 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6608 }, new String[] { "Warped Creatures can supposedly be found within a", "mysterious dungeon on the eastern edge of the Poison", "Waste. Be aware that to defeat them, you'll need to", "purify them in some way." },56, "The Path of Glouphrie"),
WARPED_TORTOISE(1, new int[] { 6296, 6297 }, new String[] { "Warped Creatures can supposedly be found within a", "mysterious dungeon on the eastern edge of the Poison", "Waste. Be aware that to defeat them, you'll need to", "purify them in some way." },56, "The Path of Glouphrie"),
WARPED_TERROR_BIRD(1, new int[] { 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6295, 6323, 6324, 6325, 6326, 6327, 6328, 6329, 6330, 6331, 6332, 6608 }, new String[] { "Warped Creatures can supposedly be found within a", "mysterious dungeon on the eastern edge of the Poison", "Waste. Be aware that to defeat them, you'll need to", "purify them in some way." },56, Quests.THE_PATH_OF_GLOUPHRIE),
WARPED_TORTOISE(1, new int[] { 6296, 6297 }, new String[] { "Warped Creatures can supposedly be found within a", "mysterious dungeon on the eastern edge of the Poison", "Waste. Be aware that to defeat them, you'll need to", "purify them in some way." },56, Quests.THE_PATH_OF_GLOUPHRIE),
WATERFIENDS(75, new int[] { 5361 }, new String[] { "Waterfiends are creatures of water, which live under", "the Baxtorian Lake. Their watery form is well defended", "against slashing and piercing weapons, so use", "something blunt." }, 1, false, false),
WEREWOLVES(60, new int[] { 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 6025, 6212, 6213, 6607, 6609, 6614, 6617, 6625, 6632, 6644, 6663, 6675, 6686, 6701, 6712, 6724, 6728, }, new String[] { "Werewolves are feral creatures, they are strong and", "tough with sharp claws and teeth." }, 1, false, false),
WOLVES(20, new int[] { 95, 96, 97, 141, 142, 143, 839, 1198, 1330, 1558, 1559, 1951, 1952, 1953, 1954, 1955, 1956, 4413, 4414, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6829, 6830, 7005 }, new String[] { "Wolves are pack animals, so you'll always find them", "in groups. Watch out for their bite, it can be nasty." }, 1, false, false),
@ -144,7 +145,7 @@ public enum Tasks {
public final int[] ids;
public boolean undead = false;
public boolean dragon = false;
public String questReq = "";
public Quests questReq = null;
Tasks(int combatCheck, int[] ids, String[] info, int levelReq, boolean undead, boolean dragon){
this.levelReq = levelReq;
this.ids = ids;
@ -154,7 +155,7 @@ public enum Tasks {
this.combatCheck = combatCheck;
}
Tasks (int combatCheck, int[] ids, String[] info, int levelReq, String questReq) {
Tasks (int combatCheck, int[] ids, String[] info, int levelReq, Quests questReq) {
this.combatCheck = combatCheck;
this.ids = ids;
this.info = info;
@ -171,7 +172,7 @@ public enum Tasks {
}
public boolean hasQuestRequirements (Player player) {
return questReq.isEmpty() || hasRequirement(player, questReq, false);
return questReq == null || hasRequirement(player, questReq, false);
}
public static Tasks forId(int id){

View file

@ -19,6 +19,7 @@ import core.plugin.Plugin;
import java.util.ArrayList;
import java.util.List;
import content.data.Quests;
/**
* Represents the plugin used for the furnace.
@ -64,7 +65,7 @@ public final class FurnaceOptionPlugin extends OptionHandler {
private static void show(final Player player) {
player.getInterfaceManager().openChatbox(311);
player.getPacketDispatch().sendItemZoomOnInterface(2349, 150, 311, 4);
if (player.getQuestRepository().isComplete("The Knight's Sword")) {
if (player.getQuestRepository().isComplete(Quests.THE_KNIGHTS_SWORD)) {
player.getPacketDispatch().sendString("<br><br><br><br><col=000000>Blurite", 311, 20);
}
player.getPacketDispatch().sendItemZoomOnInterface(Bar.BLURITE.getProduct().getId(), 150, 311, 5);

View file

@ -14,6 +14,7 @@ import core.tools.StringUtils;
import static core.api.ContentAPIKt.hasRequirement;
import static core.api.ContentAPIKt.sendDialogue;
import content.data.Quests;
/**
* Represents the pulse used to smith a bar.
@ -67,11 +68,11 @@ public class SmithingPulse extends SkillPulse<Item> {
player.getDialogueInterpreter().sendDialogue("You need a hammer to work the metal with.");
return false;
}
if (!player.getQuestRepository().isComplete("The Tourist Trap") && bar.getSmithingType() == SmithingType.TYPE_DART_TIP) {
if (!player.getQuestRepository().isComplete(Quests.THE_TOURIST_TRAP) && bar.getSmithingType() == SmithingType.TYPE_DART_TIP) {
player.getDialogueInterpreter().sendDialogue("You need to complete Tourist Trap to smith dart tips.");
return false;
}
if (!hasRequirement(player, "Death Plateau", false) && bar.getSmithingType() == SmithingType.TYPE_CLAWS) {
if (!hasRequirement(player, Quests.DEATH_PLATEAU, false) && bar.getSmithingType() == SmithingType.TYPE_CLAWS) {
sendDialogue(player, "You need to complete Death Plateau to smith claws.");
return false;
}

View file

@ -3,7 +3,6 @@ package content.global.skill.smithing.smelting;
import static core.api.ContentAPIKt.*;
import core.api.Container;
import core.api.EquipmentSlot;
import core.game.event.ResourceProducedEvent;
import core.game.container.impl.EquipmentContainer;
import core.tools.Log;
@ -19,6 +18,7 @@ import core.game.world.update.flag.context.Graphics;
import core.tools.RandomFunction;
import core.tools.StringUtils;
import org.rs09.consts.Sounds;
import content.data.Quests;
/**
* Represents the pulse used to smelt.
@ -90,7 +90,7 @@ public class SmeltingPulse extends SkillPulse<Item> {
if (bar == null || player == null) {
return false;
}
if (bar == Bar.BLURITE && !player.getQuestRepository().isComplete("The Knight's Sword")) {
if (bar == Bar.BLURITE && !player.getQuestRepository().isComplete(Quests.THE_KNIGHTS_SWORD)) {
return false;
}
if (player.getSkills().getLevel(Skills.SMITHING) < bar.getLevel()) {

View file

@ -34,6 +34,7 @@ import core.plugin.Plugin;
import core.plugin.ClassScanner;
import static core.api.ContentAPIKt.*;
import content.data.Quests;
/**
* Handles the summoning training room.
@ -81,7 +82,7 @@ public final class SummoningTrainingRoom extends OptionHandler {
public boolean handle(final Player player, Node node, String option) {
Scenery object = (Scenery) node;
Location loc = null;
Quest quest = player.getQuestRepository().getQuest("Wolf Whistle");
Quest quest = player.getQuestRepository().getQuest(Quests.WOLF_WHISTLE);
int questVal = quest.getStage(player) == 0 ? 0 : quest.getStage(player) > 0 && quest.getStage(player) < 100 ? 5 : 28893;
switch (option) {
case "close":
@ -312,7 +313,7 @@ public final class SummoningTrainingRoom extends OptionHandler {
@Override
public boolean open(Object... args) {
cutscene = (CutscenePlugin) args[0];
quest = player.getQuestRepository().getQuest("Wolf Whistle");
quest = player.getQuestRepository().getQuest(Quests.WOLF_WHISTLE);
fluffy = NPC.create(6990, cutscene.getBase().transform(41, 52, 1));
fluffy.init();
fluffy.faceTemporary(player, 1);

View file

@ -9,6 +9,7 @@ import core.game.node.item.Item;
import core.game.world.map.zone.ZoneBorders;
import core.plugin.Initializable;
import core.plugin.Plugin;
import content.data.Quests;
/**
* Handles summoning a familiar.
@ -26,7 +27,7 @@ public final class SummonFamiliarPlugin extends OptionHandler {
@Override
public boolean handle(Player player, Node node, String option) {
Item item = (Item) node;
if (!player.getQuestRepository().isComplete("Wolf Whistle") && player.getAttribute("in-cutscene", null) == null) {
if (!player.getQuestRepository().isComplete(Quests.WOLF_WHISTLE) && player.getAttribute("in-cutscene", null) == null) {
player.getPacketDispatch().sendMessage("You have to complete Wolf Whistle before you can summon a familiar.");
return true;
}

View file

@ -10,14 +10,13 @@ import core.game.node.item.Item;
import core.game.node.scenery.Scenery;
import core.game.node.scenery.SceneryBuilder;
import core.game.world.GameWorld;
import core.game.world.map.Direction;
import core.game.world.map.Location;
import core.game.world.map.RegionManager;
import core.game.world.update.flag.context.Animation;
import core.tools.RandomFunction;
import core.tools.StringUtils;
import static core.api.ContentAPIKt.*;
import content.data.Quests;
/**
* Represents the pulse used to thieve a stall.
@ -74,12 +73,12 @@ public final class StallThiefPulse extends SkillPulse<Scenery> {
player.getPacketDispatch().sendMessage("You don't have enough inventory space.");
return false;
}
if (player.getLocation().isInRegion(10553) && !isQuestComplete(player, "Fremennik Trials") && stall.full_ids.contains(4278)) {
if (player.getLocation().isInRegion(10553) && !isQuestComplete(player, Quests.THE_FREMENNIK_TRIALS) && stall.full_ids.contains(4278)) {
sendDialogue(player, "The fur trader is staring at you suspiciously. You cannot steal from his stall while he distrusts you.");
return false;
}
if (player.getLocation().isInRegion(10553) && !isQuestComplete(player, "Fremennik Trials") && stall.full_ids.contains(4277)) {
if (player.getLocation().isInRegion(10553) && !isQuestComplete(player, Quests.THE_FREMENNIK_TRIALS) && stall.full_ids.contains(4277)) {
sendDialogue(player, "The fishmonger is staring at you suspiciously. You cannot steal from his stall while he distrusts you.");
return false;
}

View file

@ -1,6 +1,6 @@
package content.global.travel.glider;
import content.region.kandarin.quest.grandtree.TheGrandTree;
import content.data.Quests;
import core.game.component.Component;
import core.game.dialogue.DialoguePlugin;
import core.game.dialogue.FacialExpression;
@ -58,7 +58,7 @@ public final class CaptainDalburDialogue extends DialoguePlugin {
stage = 1;
break;
case 1:
if(!isQuestComplete(player, TheGrandTree.questName)){
if(!isQuestComplete(player, Quests.THE_GRAND_TREE)){
interpreter.sendDialogues(npc, FacialExpression.ANNOYED, "I only fly friends of the gnomes!");
stage = END_DIALOGUE;
}

View file

@ -1,6 +1,6 @@
package content.global.travel.glider;
import content.region.kandarin.quest.grandtree.TheGrandTree;
import content.data.Quests;
import core.api.ContentAPIKt;
import core.cache.def.impl.NPCDefinition;
import core.game.component.Component;
@ -31,7 +31,7 @@ public final class GliderPlugin extends OptionHandler {
@Override
public boolean handle(Player player, Node node, String option) {
if(isQuestComplete(player, TheGrandTree.questName)){
if(isQuestComplete(player, Quests.THE_GRAND_TREE)){
player.getInterfaceManager().open(new Component(138));
Gliders.sendConfig(node.asNpc(), player);
} else {

View file

@ -11,6 +11,7 @@ import core.game.node.entity.player.link.diary.DiaryType;
import core.game.node.item.Item;
import static core.api.ContentAPIKt.*;
import content.data.Quests;
/**
* Represents the dialogue used to handle the sailing from and to karamja.
@ -46,7 +47,7 @@ public class SeamanDialoguePlugin extends DialoguePlugin {
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
if (args.length > 1 && player.getQuestRepository().isComplete("Pirate's Treasure")) {
if (args.length > 1 && player.getQuestRepository().isComplete(Quests.PIRATES_TREASURE)) {
if (player.getEquipment().get(EquipmentContainer.SLOT_RING) != null && player.getEquipment().get(EquipmentContainer.SLOT_RING).getId() == Items.RING_OF_CHAROSA_6465) {
travel();
} else if (player.getAchievementDiaryManager().getDiary(DiaryType.KARAMJA).isComplete(0)) {

View file

@ -17,6 +17,7 @@ import java.util.ArrayList;
import java.util.List;
import static core.api.ContentAPIKt.*;
import content.data.Quests;
/**
* Represents a class used to charter ships.
@ -84,7 +85,7 @@ public final class ShipCharter {
*/
public static int getCost(final Player player, Destination destination) {
int cost = destination.getCost(player, destination);
if (player.getQuestRepository().isComplete("Cabin Fever")) {
if (player.getQuestRepository().isComplete(Quests.CABIN_FEVER)) {
cost -= Math.round((cost / 2.));
}
if (player.getEquipment().containsItem(RING_OF_CHAROS)) {
@ -142,13 +143,13 @@ public final class ShipCharter {
PORT_PHASMATYS(Location.create(3705, 3503, 1), 24, new int[] { 3650, 3250, 1850, 0, 0, 0, 2050, 1850, 3200, 1100 }, Location.create(3702, 3502, 0), 2, 13) {
@Override
public boolean checkTravel(Player player) {
return requireQuest(player, "Priest in Peril", "to go there.");
return requireQuest(player, Quests.PRIEST_IN_PERIL, "to go there.");
}
},
CRANDOR(Location.create(2792, 3417, 1), 32, new int[] { 0, 480, 480, 925, 400, 3650, 1600, 400, 3200, 3800 }, null, 10, 21) {
@Override
public boolean checkTravel(Player player) {
return requireQuest(player, "Dragon Slayer", "to go there.");
return requireQuest(player, Quests.DRAGON_SLAYER, "to go there.");
}
},
BRIMHAVEN(Location.create(2763, 3238, 1), 28, new int[] { 0, 480, 480, 925, 400, 3650, 1600, 400, 3200, 3800 }, Location.create(2760, 3238, 0), 6, 17){
@ -170,7 +171,7 @@ public final class ShipCharter {
PORT_TYRAS(Location.create(2142, 3122, 0), 23, new int[] { 3200, 3200, 3200, 1600, 3200, 3200, 3200, 3200, 0, 3200 }, Location.create(2143, 3122, 0), 1, 12) {
@Override
public boolean checkTravel(Player player) {
return hasRequirement(player, "Regicide");
return hasRequirement(player, Quests.REGICIDE);
}
},
@ -193,14 +194,14 @@ public final class ShipCharter {
SHIPYARD(Location.create(3001, 3032, 0), 26, new int[] { 400, 1600, 200, 225, 720, 1850, 400, 0, 3200, 900 }, Location.create(3001, 3032, 0), 4, 15) {
@Override
public boolean checkTravel(Player player) {
return requireQuest(player, "The Grand Tree", "to go there.");
return requireQuest(player, Quests.THE_GRAND_TREE, "to go there.");
}
},
OO_GLOG(Location.create(2623, 2857, 0), 33, new int[] { 300, 3400, 2000, 550, 5000, 2800, 1400, 900, 3200, 0}, Location.create(2622, 2857, 0), 11, 22),
MOS_LE_HARMLESS(Location.create(3671, 2931, 0), 31, new int[] { 725, 625, 1025, 0, 1025, 0, 325, 275, 1600, 500 }, Location.create(3671, 2933, 0), 9, 20) {
@Override
public boolean checkTravel(Player player) {
return hasRequirement(player, "Cabin Fever");
return hasRequirement(player, Quests.CABIN_FEVER);
}
};

View file

@ -12,12 +12,12 @@ import core.game.world.map.Location
import core.game.world.update.flag.context.Animation
import core.game.world.update.flag.context.Graphics
import org.rs09.consts.NPCs
import content.region.kandarin.quest.tree.TreeGnomeVillage
import core.game.dialogue.DialogueFile
import core.game.interaction.InteractionListener
import core.game.interaction.IntType
import core.game.world.GameWorld.Pulser
import core.tools.END_DIALOGUE
import content.data.Quests
class GnomeSpiritTreeListener: InteractionListener {
val spiritTrees = intArrayOf(1317,1293,1294)
@ -46,7 +46,7 @@ class GnomeSpiritTreeTeleportDialogue: DialogueFile() {
private val GRAPHICS = arrayOf(Graphics(1228), Graphics(1229))
fun hasQuestCompleted(player: Player): Boolean {
if (!isQuestComplete(player, TreeGnomeVillage.questName)) {
if (!isQuestComplete(player, Quests.TREE_GNOME_VILLAGE)) {
sendDialogue(player, "The tree doesn't feel like talking.")
stage = END_DIALOGUE
return false

View file

@ -10,6 +10,7 @@ import org.rs09.consts.Items
import core.game.interaction.InteractionListener
import core.game.interaction.IntType
import core.game.world.GameWorld
import content.data.Quests
private val VALID_LOGS = intArrayOf(Items.LOGS_1511, Items.OAK_LOGS_1521,Items.WILLOW_LOGS_1519,Items.MAPLE_LOGS_1517,Items.YEW_LOGS_1515,Items.MAGIC_LOGS_1513)
private val FILL_ANIM = Animation(9136)
@ -24,8 +25,8 @@ class AFUBeaconListeners : InteractionListener {
override fun defineListeners() {
on(IntType.SCENERY,"add-logs","light"){ player, node ->
val beacon = AFUBeacon.forLocation(node.location)
val questComplete = player.questRepository.isComplete("All Fired Up")
val questStage = player.questRepository.getStage("All Fired Up")
val questComplete = player.questRepository.isComplete(Quests.ALL_FIRED_UP)
val questStage = player.questRepository.getStage(Quests.ALL_FIRED_UP)
if ((beacon != AFUBeacon.RIVER_SALVE && beacon != AFUBeacon.RAG_AND_BONE && !questComplete)
|| (beacon == AFUBeacon.RIVER_SALVE && questStage < 20 && !questComplete)
@ -68,7 +69,7 @@ class AFUBeaconListeners : InteractionListener {
}
AFUBeacon.GOBLIN_VILLAGE -> {
if(!player.questRepository.isComplete("Lost Tribe")){
if(!player.questRepository.isComplete(Quests.THE_LOST_TRIBE)){
player.dialogueInterpreter.sendDialogues(NPC(beacon.keeper).getShownNPC(player), core.game.dialogue.FacialExpression.THINKING,"We no trust you outsider. You no light our beacon.","(Complete Lost Tribe to use this beacon.)")
return
}
@ -151,7 +152,7 @@ class AFUBeaconListeners : InteractionListener {
experience += session?.getBonusExperience() ?: 0.0
player.skills.addExperience(Skills.FIREMAKING,experience)
} else {
player.questRepository.getQuest("All Fired Up").setStage(player, player.questRepository.getStage("All Fired Up") + 10)
player.questRepository.getQuest(Quests.ALL_FIRED_UP).setStage(player, player.questRepository.getStage(Quests.ALL_FIRED_UP) + 10)
}
}
2 -> player.unlock().also { return true }
@ -183,7 +184,7 @@ class AFUBeaconListeners : InteractionListener {
if(questComplete){
session?.refreshTimer(beacon,logs.id)
} else {
player.questRepository.getQuest("All Fired Up").setStage(player, 80)
player.questRepository.getQuest(Quests.ALL_FIRED_UP).setStage(player, 80)
}
}
2 -> player.unlock().also { return true }

View file

@ -1,5 +1,6 @@
package content.minigame.allfiredup
import content.data.Quests
import core.game.node.entity.impl.ForceMovement
import core.game.node.entity.player.Player
import core.game.node.entity.skill.Skills
@ -26,7 +27,7 @@ class AFURepairClimbHandler : InteractionListener {
override fun defineListeners() {
on(repairIDs, IntType.SCENERY, "repair"){ player, _ ->
if (hasRequirement(player, "All Fired Up")){
if (hasRequirement(player, Quests.ALL_FIRED_UP)){
val rco: RepairClimbObject? = getClimbingObject(player)
repair(player,rco!!)
return@on true

View file

@ -13,6 +13,7 @@ import org.rs09.consts.Items
import core.game.dialogue.DialogueFile
import core.game.interaction.InteractionListener
import core.game.interaction.IntType
import content.data.Quests
/**
* Adds functionality to the pharoah's scepter
@ -23,7 +24,7 @@ class PharaohSceptre : InteractionListener {
val SCEPTRES = intArrayOf(Items.PHARAOHS_SCEPTRE_9044, Items.PHARAOHS_SCEPTRE_9046, Items.PHARAOHS_SCEPTRE_9048, Items.PHARAOHS_SCEPTRE_9050)
on(SCEPTRES, IntType.ITEM, "teleport", "operate"){ player, node ->
if (!hasRequirement(player, "Icthlarin's Little Helper"))
if (!hasRequirement(player, Quests.ICTHLARINS_LITTLE_HELPER))
return@on true
val sceptre = node.asItem()

View file

@ -23,6 +23,7 @@ import core.game.interaction.InteractionListener
import core.game.interaction.IntType
import core.game.world.GameWorld
import core.plugin.ClassScanner
import content.data.Quests
class GardenObjectsPlugin : InteractionListener {
@ -503,7 +504,7 @@ class GardenObjectsPlugin : InteractionListener {
override fun open(vararg args: Any): Boolean {
npc = args[0] as NPC
quest = player.questRepository.getQuest("Prince Ali Rescue")
quest = player.questRepository.getQuest(Quests.PRINCE_ALI_RESCUE)
when (quest!!.getStage(player)) {
100 -> {
interpreter.sendDialogues(player, null, "I'd like to talk about sq'irks.")

View file

@ -11,6 +11,7 @@ import core.game.world.map.Location;
import core.game.world.update.flag.context.Graphics;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* Dialogue for Sorceress Apprentice
@ -238,7 +239,7 @@ public class SorceressApprenticeDialogue extends DialoguePlugin {
}
public static void teleport(final NPC npc, final Player player) {
if (!hasRequirement(player, "Prince Ali Rescue"))
if (!hasRequirement(player, Quests.PRINCE_ALI_RESCUE))
return;
npc.faceTemporary(player, 4);
npc.graphics(new Graphics(108));

View file

@ -20,8 +20,8 @@ class BernaldDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
// // Garden of Tranquility has not been implemented.
// if(hasRequirement(player!!, "Garden of Tranquility")) {
// if (isQuestComplete(player!!, DeathPlateau.questName)) {
// if(hasRequirement(player!!, Quests.GARDEN_OF_TRANQUILITY)) {
// if (isQuestComplete(player!!, Quests.DEATH_PLATEAU)) {
// when (stage) {
// 0 -> playerl(FacialExpression.FRIENDLY, "How are your grapes coming along?").also { stage++ }
// 1 -> npc(FacialExpression.FRIENDLY, "Marvellous, thanks to your help, " + player.username + "!").also { stage = END_DIALOGUE }

View file

@ -9,6 +9,7 @@ import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
/**
* Breoca Dialogue
@ -18,7 +19,7 @@ import org.rs09.consts.NPCs
@Initializable
class BreocaDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int) : Boolean {
if(isQuestComplete(player!!, "Death Plateau")) {
if(isQuestComplete(player!!, Quests.DEATH_PLATEAU)) {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() }
1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE }

View file

@ -9,6 +9,7 @@ import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
/**
* Ceolburg Dialogue
@ -18,7 +19,7 @@ import org.rs09.consts.NPCs
@Initializable
class CeolburgDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int) : Boolean {
if(isQuestComplete(player!!, "Death Plateau")) {
if(isQuestComplete(player!!, Quests.DEATH_PLATEAU)) {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() }
1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE }

View file

@ -1,8 +1,7 @@
package content.region.asgarnia.burthorpe.dialogue
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
import content.data.Quests
import content.region.asgarnia.burthorpe.quest.deathplateau.DenulthDialogueFile
import content.region.asgarnia.burthorpe.quest.trollstronghold.TrollStronghold
import core.api.isQuestComplete
import core.api.isQuestInProgress
import core.api.openDialogue
@ -25,7 +24,7 @@ class DenulthDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
// When Troll Stronghold is complete
if (isQuestComplete(player!!, TrollStronghold.questName)) {
if (isQuestComplete(player!!, Quests.TROLL_STRONGHOLD)) {
when(stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
1 -> npcl(FacialExpression.HAPPY, "Welcome back friend!").also { stage++ }
@ -49,13 +48,13 @@ class DenulthDialogue(player: Player? = null) : DialoguePlugin(player) {
}
// Troll Stronghold in progress
if (isQuestInProgress(player!!, TrollStronghold.questName, 1, 99)) {
if (isQuestInProgress(player!!, Quests.TROLL_STRONGHOLD, 1, 99)) {
openDialogue(player!!, content.region.asgarnia.burthorpe.quest.trollstronghold.DenulthDialogueFile(), npc)
return true
}
// When Death Plateau is completed, start Troll Stronghold
if (isQuestComplete(player!!, DeathPlateau.questName)) {
if (isQuestComplete(player!!, Quests.DEATH_PLATEAU)) {
when(stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
1 -> npcl(FacialExpression.HAPPY, "Welcome back friend!").also { stage++ }
@ -78,7 +77,7 @@ class DenulthDialogue(player: Player? = null) : DialoguePlugin(player) {
)
16 -> npcl(FacialExpression.HAPPY, "God speed friend! I would send some of my men with you, but none of them are brave enough to follow.").also {
stage = END_DIALOGUE
setQuestStage(player!!, TrollStronghold.questName, 1)
setQuestStage(player!!, Quests.TROLL_STRONGHOLD, 1)
}
20 -> npcl(FacialExpression.ANGRY, "You are right citizen. The White Knights have taken advantage of the old and weak king, they control most of Asgarnia, including Falador. However they do not control Burthorpe!").also { stage++ }

View file

@ -1,7 +1,6 @@
package content.region.asgarnia.burthorpe.dialogue
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
import content.region.asgarnia.burthorpe.quest.trollstronghold.TrollStronghold
import content.data.Quests
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
@ -24,7 +23,7 @@ class DunstanDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
// When Troll Stronghold is complete
if (isQuestComplete(player!!, TrollStronghold.questName)) {
if (isQuestComplete(player!!, Quests.TROLL_STRONGHOLD)) {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "Hi! What can I do for you?").also { stage++ }
@ -47,13 +46,13 @@ class DunstanDialogue(player: Player? = null) : DialoguePlugin(player) {
}
// Troll Stronghold in progress
if (isQuestInProgress(player!!, TrollStronghold.questName, 1, 99)) {
if (isQuestInProgress(player!!, Quests.TROLL_STRONGHOLD, 1, 99)) {
openDialogue(player!!, content.region.asgarnia.burthorpe.quest.trollstronghold.DunstanDialogueFile(), npc)
return true
}
// When Death Plateau is complete
if (isQuestComplete(player!!, DeathPlateau.questName)) {
if (isQuestComplete(player!!, Quests.DEATH_PLATEAU)) {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "Hi! What can I do for you?").also { stage++ }
@ -75,7 +74,7 @@ class DunstanDialogue(player: Player? = null) : DialoguePlugin(player) {
}
// Death Plateau in progress
if (isQuestInProgress(player!!, DeathPlateau.questName, 21, 24)) {
if (isQuestInProgress(player!!, Quests.DEATH_PLATEAU, 21, 24)) {
// Call the dialogue file for Dunstan from the deathplateau quest folder.
openDialogue(player!!, content.region.asgarnia.burthorpe.quest.deathplateau.DunstanDialogueFile(), npc)
return true

View file

@ -1,6 +1,6 @@
package content.region.asgarnia.burthorpe.dialogue
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
import content.data.Quests
import content.region.asgarnia.burthorpe.quest.deathplateau.EohricDialogueFile
import core.api.getQuestStage
import core.api.openDialogue
@ -19,7 +19,7 @@ import org.rs09.consts.NPCs
@Initializable
class EohricDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
if (getQuestStage(player!!, DeathPlateau.questName) >= 5) {
if (getQuestStage(player!!, Quests.DEATH_PLATEAU) >= 5) {
// Call the dialogue file for Eohric from the deathplateau quest folder.
openDialogue(player!!, EohricDialogueFile(), npc)
return true

View file

@ -1,14 +1,12 @@
package content.region.asgarnia.burthorpe.dialogue
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
import content.data.Quests
import content.region.asgarnia.burthorpe.quest.deathplateau.HaroldDialogueFile
import core.api.*
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.world.update.flag.context.Animation
import core.game.world.update.flag.context.Graphics
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
@ -23,7 +21,7 @@ import org.rs09.consts.NPCs
@Initializable
class HaroldDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
if (isQuestInProgress(player!!, DeathPlateau.questName, 10, 29)) {
if (isQuestInProgress(player!!, Quests.DEATH_PLATEAU, 10, 29)) {
// Call the dialogue file for Harold from the deathplateau quest folder.
openDialogue(player!!, HaroldDialogueFile(), npc)
}

View file

@ -9,6 +9,7 @@ import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
/**
* Hild Dialogue
@ -18,7 +19,7 @@ import org.rs09.consts.NPCs
@Initializable
class HildDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int) : Boolean {
if(isQuestComplete(player!!, "Death Plateau")) {
if(isQuestComplete(player!!, Quests.DEATH_PLATEAU)) {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() }
1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE }

View file

@ -9,6 +9,7 @@ import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
/**
* Hygd Dialogue
@ -18,7 +19,7 @@ import org.rs09.consts.NPCs
@Initializable
class HygdDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int) : Boolean {
if(isQuestComplete(player!!, "Death Plateau")) {
if(isQuestComplete(player!!, Quests.DEATH_PLATEAU)) {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() }
1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE }

View file

@ -9,6 +9,7 @@ import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
/**
@ -19,7 +20,7 @@ import org.rs09.consts.NPCs
@Initializable
class OcgaDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int) : Boolean {
if(isQuestComplete(player!!, "Death Plateau")) {
if(isQuestComplete(player!!, Quests.DEATH_PLATEAU)) {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() }
1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE }

View file

@ -9,6 +9,7 @@ import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
/**
* Penda Dialogue
@ -18,7 +19,7 @@ import org.rs09.consts.NPCs
@Initializable
class PendaDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int) : Boolean {
if(isQuestComplete(player!!, "Death Plateau")) {
if(isQuestComplete(player!!, Quests.DEATH_PLATEAU)) {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..5).toIntArray().random() }
1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE }

View file

@ -8,9 +8,8 @@ import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
/**
* Unferth Dialogue
@ -37,7 +36,7 @@ class UnferthDialogue(player: Player? = null) : DialoguePlugin(player) {
class UnferthDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onPredicate { player -> isQuestComplete(player, "A Tail of Two Cats") }.playerl(
b.onPredicate { player -> isQuestComplete(player, Quests.A_TAIL_OF_TWO_CATS) }.playerl(
FacialExpression.FRIENDLY, "Hi Unferth. How are you doing?"
).npcl(
FacialExpression.GUILTY, "It's just not the same without Bob around."

View file

@ -18,6 +18,7 @@ import core.plugin.Initializable;
import core.plugin.ClassScanner;
import static core.api.ContentAPIKt.hasRequirement;
import content.data.Quests;
/**
* Represents the hero guild.
@ -42,7 +43,7 @@ public final class HeroGuildPlugin extends OptionHandler {
switch (id) {
case 2624:
case 2625:
if (!hasRequirement(player, "Heroes' Quest"))
if (!hasRequirement(player, Quests.HEROES_QUEST))
return true;
DoorActionHandler.handleAutowalkDoor(player, (Scenery) node);
break;
@ -82,15 +83,15 @@ public final class HeroGuildPlugin extends OptionHandler {
@Override
public boolean handle(NodeUsageEvent event) {
final Player player = event.getPlayer();
if (!hasRequirement(player, "Heroes' Quest"))
if (!hasRequirement(player, Quests.HEROES_QUEST))
return true;
final EnchantedJewellery jewellery;
assert event.getUsedItem() != null;
jewellery = EnchantedJewellery.Companion.getIdMap().get(event.getUsedItem().getId());
if (!hasRequirement(player, "Heroes' Quest"))
if (!hasRequirement(player, Quests.HEROES_QUEST))
return true;
if (jewellery == EnchantedJewellery.COMBAT_BRACELET || jewellery == EnchantedJewellery.SKILLS_NECKLACE)
if (!hasRequirement(player, "Legend's Quest"))
if (!hasRequirement(player, Quests.LEGENDS_QUEST))
return true;
if (jewellery == null && event.getUsedItem().getId() != 2572) {
return true;

View file

@ -5,9 +5,9 @@ import core.api.getAttribute
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.world.map.Location
import core.plugin.Initializable
import org.rs09.consts.Items
import content.data.Quests
/**
* Death Plateau Quest
@ -15,16 +15,13 @@ import org.rs09.consts.Items
* @author ovenbread
*/
@Initializable
class DeathPlateau : Quest("Death Plateau",44, 43, 1, 314, 0, 1, 80) {
companion object {
const val questName = "Death Plateau"
}
class DeathPlateau : Quest(Quests.DEATH_PLATEAU,44, 43, 1, 314, 0, 1, 80) {
override fun drawJournal(player: Player?, stage: Int) {
super.drawJournal(player, stage)
var line = 12
var stage = getStage(player)
var started = player?.questRepository?.getStage(questName)!! > 0
var started = player?.questRepository?.getStage(Quests.DEATH_PLATEAU)!! > 0
if(!started){
line(player, "I can start this quest by speaking to !!Denulth?? who is in his", line++)

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.deathplateau
import content.data.Quests
import core.api.getQuestStage
import core.api.getScenery
import core.api.sendDialogue
@ -26,7 +27,7 @@ class DeathPlateauDoorDialogueFile(val door: Int) : DialogueFile() {
if(door == 2) {
npc = NPC(NPCs.TENZING_1071)
when (getQuestStage(player!!, DeathPlateau.questName)) {
when (getQuestStage(player!!, Quests.DEATH_PLATEAU)) {
in 0 .. 19 -> {
when (stage) {
0 -> sendDialogue(player!!, "You knock on the door.").also { stage++ }
@ -53,7 +54,7 @@ class DeathPlateauDoorDialogueFile(val door: Int) : DialogueFile() {
}
if(door == 3) {
npc = NPC(NPCs.TENZING_1071)
when (getQuestStage(player!!, DeathPlateau.questName)) {
when (getQuestStage(player!!, Quests.DEATH_PLATEAU)) {
in 0..24 -> {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "Where do you think you're going? This is private property!").also { stage = END_DIALOGUE }

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.deathplateau
import content.data.Quests
import core.api.*
import core.game.global.action.DoorActionHandler
import core.game.interaction.IntType
@ -74,16 +75,16 @@ class DeathPlateauInteractionListener : InteractionListener {
GroundItemManager.get(Items.STONE_BALL_3111, location(2895, 3562, 0), player) != null &&
GroundItemManager.get(Items.STONE_BALL_3112, location(2895, 3563, 0), player) != null &&
GroundItemManager.get(Items.STONE_BALL_3113, location(2895, 3564, 0), player) != null) {
if (getQuestStage(player, DeathPlateau.questName) == 16) {
if (getQuestStage(player, Quests.DEATH_PLATEAU) == 16) {
sendMessage(player, "The equipment room door has unlocked.")
setQuestStage(player, DeathPlateau.questName, 19)
setQuestStage(player, Quests.DEATH_PLATEAU, 19)
}
}
return@onUseWith true
}
on(Scenery.LARGE_DOOR_3743, SCENERY, "open") { player, node ->
if (getQuestStage(player, DeathPlateau.questName) > 16) {
if (getQuestStage(player, Quests.DEATH_PLATEAU) > 16) {
DoorActionHandler.handleAutowalkDoor(player, node as core.game.node.scenery.Scenery)
} else {
sendMessage(player, "The door is locked.")

View file

@ -1,14 +1,13 @@
package content.region.asgarnia.burthorpe.quest.deathplateau
import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.node.entity.npc.NPC
import core.game.node.item.Item
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
/**
@ -20,7 +19,7 @@ import org.rs09.consts.NPCs
class DenulthDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (getQuestStage(player!!, DeathPlateau.questName)) {
when (getQuestStage(player!!, Quests.DEATH_PLATEAU)) {
in 0..4 -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
@ -54,7 +53,7 @@ class DenulthDialogueFile : DialogueFile() {
309 -> playerl(FacialExpression.FRIENDLY, "A stone what...?!").also { stage++ }
310 -> npcl(FacialExpression.FRIENDLY, "Well citizen, the Prince is fond of puzzles. Why we couldn't just have a key is beyond me!").also { stage++ }
311 -> playerl(FacialExpression.SUSPICIOUS, "I'll get on it right away!").also {
setQuestStage(player!!, DeathPlateau.questName, 5)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 5)
stage = END_DIALOGUE
}
}
@ -104,7 +103,7 @@ class DenulthDialogueFile : DialogueFile() {
}
11 -> npcl(FacialExpression.FRIENDLY, "This certificate proves that we have accepted Dunstan's son for training in the Imperial Guard!").also { stage++ }
12 -> playerl(FacialExpression.FRIENDLY, "Thank you Denulth, I shall be back shortly!").also {
setQuestStage(player!!, DeathPlateau.questName, 23)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 23)
stage = END_DIALOGUE
}
}
@ -169,7 +168,7 @@ class DenulthDialogueFile : DialogueFile() {
12 -> npcl(FacialExpression.FRIENDLY, "You are now an honourary member of the Imperial Guard!").also { stage++ }
13 -> {
stage = END_DIALOGUE
finishQuest(player!!, DeathPlateau.questName)
finishQuest(player!!, Quests.DEATH_PLATEAU)
}
}
}

View file

@ -3,17 +3,16 @@ package content.region.asgarnia.burthorpe.quest.deathplateau
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.item.Item
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import content.data.Quests
class DunstanDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (getQuestStage(player!!, DeathPlateau.questName)) {
when (getQuestStage(player!!, Quests.DEATH_PLATEAU)) {
21 -> {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
@ -29,7 +28,7 @@ class DunstanDialogueFile : DialogueFile() {
10 -> npcl(FacialExpression.FRIENDLY, "My son has just turned 16 and I'd very much like him to join the Imperial Guard. The Prince's elite forces are invite only so it's very unlikely he'll get in. If you can arrange that you have a deal!").also { stage++ }
11 -> playerl(FacialExpression.FRIENDLY, "That won't be a problem as I'm helping out the Imperial Guard!").also { stage++ }
12 -> npcl(FacialExpression.FRIENDLY, "Excellent! You'll need to bring an Iron bar for the spikes!").also {
setQuestStage(player!!, "Death Plateau", 22)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 22)
stage = END_DIALOGUE
}
}
@ -60,7 +59,7 @@ class DunstanDialogueFile : DialogueFile() {
5 -> npcl(FacialExpression.FRIENDLY, "Thank you!").also {
// Jumps to the next stage immediately in one continuous dialogue (questStage 24, stage 2).
setQuestStage(player!!, "Death Plateau", 24)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 24)
stage = 2
}
}

View file

@ -4,10 +4,9 @@ import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.node.entity.npc.NPC
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.NPCs
import content.data.Quests
/**
* Eohric sub dialogue file for death plateau.
@ -17,7 +16,7 @@ import org.rs09.consts.NPCs
*/
class EohricDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (getQuestStage(player!!, DeathPlateau.questName)) {
when (getQuestStage(player!!, Quests.DEATH_PLATEAU)) {
in 5..9 -> {
when (stage) {
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
@ -31,7 +30,7 @@ class EohricDialogueFile : DialogueFile() {
11 -> player(FacialExpression.FRIENDLY, "Do you know where he is staying?").also { stage++ }
12 -> npc(FacialExpression.FRIENDLY, "Harold is staying at the Toad and Chicken.").also { stage++ }
13 -> player(FacialExpression.FRIENDLY, "Thanks!").also {
setQuestStage(player!!, "Death Plateau", 10)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 10)
HaroldDialogueFile.resetNpc(player!!)
stage = END_DIALOGUE
}
@ -58,7 +57,7 @@ class EohricDialogueFile : DialogueFile() {
2 -> playerl(FacialExpression.HALF_GUILTY, "I found Harold but he won't talk to me!.").also { stage++ }
3 -> npcl(FacialExpression.THINKING, "Hmm. Harold has got in trouble a few over his drinking and gambling. Perhaps he'd open up after a drink?").also { stage++ }
4 -> playerl(FacialExpression.FRIENDLY, "Thanks, I'll try that!").also {
setQuestStage(player!!, "Death Plateau", 12)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 12)
stage = END_DIALOGUE
}
}

View file

@ -11,6 +11,7 @@ import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.Animations
import org.rs09.consts.Items
import content.data.Quests
/**
* Harold sub dialogue file for death plateau.
@ -38,7 +39,7 @@ class HaroldDialogueFile : DialogueFile() {
setAttribute(player!!, ATTRIBUTE_JUMPSTAGE, 0)
}
println(getAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, -1))
when (getQuestStage(player!!, DeathPlateau.questName)) {
when (getQuestStage(player!!, Quests.DEATH_PLATEAU)) {
10 -> { // First time meeting.
when (stage) {
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
@ -47,7 +48,7 @@ class HaroldDialogueFile : DialogueFile() {
3 -> npcl(FacialExpression.FRIENDLY, "Yeah.").also { stage++ }
4 -> playerl(FacialExpression.HAPPY, "Denulth said that you lost the combination to the equipment room ?").also { stage++ }
5 -> npcl(FacialExpression.FRIENDLY, "I don't want to talk about it!").also {
setQuestStage(player!!, "Death Plateau", 11)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 11)
stage = END_DIALOGUE
}
}
@ -71,7 +72,7 @@ class HaroldDialogueFile : DialogueFile() {
4 -> {
if (inInventory(player!!, Items.ASGARNIAN_ALE_1905, 1)) {
removeItem(player!!, Items.ASGARNIAN_ALE_1905)
setQuestStage(player!!, "Death Plateau", 12)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 12)
sendMessage(player!!, "You give Harold an Asgarnian Ale.")
setAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, 200)
sendItemDialogue(player!!, Items.ASGARNIAN_ALE_1905, "You give Harold an Asgarnian Ale.").also { stage++ }
@ -81,7 +82,7 @@ class HaroldDialogueFile : DialogueFile() {
}
5 -> {
end()
setQuestStage(player!!, "Death Plateau", 13)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 13)
animate(npc!!, Animations.HUMAN_EATTING_829)
runTask(npc!!, 5) {
npcl(FacialExpression.FRIENDLY, "Arrh. That hit the spot!").also { stage = END_DIALOGUE }
@ -120,7 +121,7 @@ class HaroldDialogueFile : DialogueFile() {
}
24 -> {
end()
setQuestStage(player!!, DeathPlateau.questName, 14)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 14)
npc!!.isWalks = false
animate(npc!!, Animations.HUMAN_EATTING_829)
runTask(npc!!, 4) {
@ -204,7 +205,7 @@ class HaroldDialogueFile : DialogueFile() {
37 -> npcl(FacialExpression.FRIENDLY, "I'll write you out an IOU for the rest.").also { stage++ }
38 -> {
addItemOrDrop(player!!, Items.IOU_3103)
setQuestStage(player!!, DeathPlateau.questName, 15)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 15)
sendMessage(player!!, "Harold has given you an IOU scribbled on some paper.")
sendItemDialogue(player!!, Items.IOU_3103, "Harold has given you an IOU scribbled on some paper.").also {stage = END_DIALOGUE}
}
@ -292,7 +293,7 @@ class HaroldDialogueFile : DialogueFile() {
34 -> npcl(FacialExpression.DRUNK, "I owe you the resht!").also { stage++ }
35 -> {
addItemOrDrop(player!!, Items.IOU_3103)
setQuestStage(player!!, DeathPlateau.questName, 15)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 15)
sendMessage(player!!, "Harold has given you an IOU scribbled on some paper.")
sendItemDialogue(player!!, Items.IOU_3103, "Harold has given you an IOU scribbled on some paper.").also {stage = END_DIALOGUE}
}

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.deathplateau
import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
@ -9,7 +10,7 @@ import org.rs09.consts.Items
class IOUNoteDialogueFile : DialogueFile() {
var a = 0
override fun handle(componentID: Int, buttonID: Int) {
when (getQuestStage(player!!, DeathPlateau.questName)) {
when (getQuestStage(player!!, Quests.DEATH_PLATEAU)) {
in 15..16 -> {
when (stage) {
0 -> player(FacialExpression.NEUTRAL, "The IOU says that Harold owes me some money.").also { stage++ }
@ -18,7 +19,7 @@ class IOUNoteDialogueFile : DialogueFile() {
3 -> {
if (removeItem(player!!, Items.IOU_3103)) {
addItemOrDrop(player!!, Items.COMBINATION_3102)
setQuestStage(player!!, DeathPlateau.questName, 16)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 16)
sendItemDialogue(player!!, Items.COMBINATION_3102, "You have found the combination!").also { stage++ }
}
}

View file

@ -5,11 +5,12 @@ import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.tools.END_DIALOGUE
import content.data.Quests
class SabaDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (getQuestStage(player!!, DeathPlateau.questName)) {
when (getQuestStage(player!!, Quests.DEATH_PLATEAU)) {
19 -> {
when (stage) {
0 -> player(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
@ -34,7 +35,7 @@ class SabaDialogueFile : DialogueFile() {
29 -> npcl(FacialExpression.HALF_GUILTY,"Before the trolls came there used to be a nettlesome Sherpa that took humans exploring or something equally stupid. Perhaps he'd know another way.").also { stage++ }
30 -> playerl(FacialExpression.FRIENDLY, "Where does this Sherpa live?").also { stage++ }
31 -> npcl(FacialExpression.ANNOYED,"I don't know but it can't be far as he used to be around all the time!").also {
setQuestStage(player!!, "Death Plateau", 20)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 20)
stage = END_DIALOGUE }
}
}

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.deathplateau
import content.data.Quests
import core.api.*
import core.game.node.entity.Entity
import core.game.node.entity.player.Player
@ -11,9 +12,9 @@ class SecretWayLocation : MapArea {
}
override fun areaEnter(entity: Entity) {
if (entity is Player && getQuestStage(entity, DeathPlateau.questName) == 25) {
if (entity is Player && getQuestStage(entity, Quests.DEATH_PLATEAU) == 25) {
sendPlayerDialogue(entity, "I think this is far enough, I can see Death Plateau and it looks like the trolls haven't found the path. I'd better go and tell Denulth.")
setQuestStage(entity, DeathPlateau.questName, 26)
setQuestStage(entity, Quests.DEATH_PLATEAU, 26)
}
}
}

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.deathplateau
import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
@ -12,7 +13,7 @@ import org.rs09.consts.Items
class TenzingDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (getQuestStage(player!!, DeathPlateau.questName)) {
when (getQuestStage(player!!, Quests.DEATH_PLATEAU)) {
20 -> {
when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
@ -34,7 +35,7 @@ class TenzingDialogueFile : DialogueFile() {
20 -> npcl(FacialExpression.FRIENDLY, "Thank you traveller!").also { stage++ }
21 -> sendItemDialogue(player!!, Items.CLIMBING_BOOTS_3105, "Tenzing has given you his Climbing boots.").also {
addItemOrDrop(player!!, Items.CLIMBING_BOOTS_3105, 1)
setQuestStage(player!!, DeathPlateau.questName, 21)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 21)
stage = END_DIALOGUE
}
30 -> npcl(FacialExpression.ANNOYED, "Hmph.").also { stage = END_DIALOGUE }
@ -104,7 +105,7 @@ class TenzingDialogueFile : DialogueFile() {
9 -> npcl(FacialExpression.FRIENDLY, "I don't think the Trolls have found the secret way yet, if they had I would've been attacked by now.").also { stage++ }
10 -> playerl(FacialExpression.FRIENDLY, "OK thanks but I think I'd better check the path. I don't want to send the Imperial Guards to their death!").also { stage++ }
11 -> npcl(FacialExpression.FRIENDLY, "You are wise for one so young.").also {
setQuestStage(player!!, DeathPlateau.questName, 25)
setQuestStage(player!!, Quests.DEATH_PLATEAU, 25)
stage = END_DIALOGUE
}
}

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile
@ -31,9 +32,9 @@ class AchiettiesDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onQuestStages(HeroesQuest.questName, 0,1)
b.onQuestStages(Quests.HEROES_QUEST, 0,1)
.branch { player ->
return@branch getQuestStage(player, HeroesQuest.questName)
return@branch getQuestStage(player, Quests.HEROES_QUEST)
}.let{ branch ->
branch.onValue(0)
.npcl(FacialExpression.FRIENDLY, "Greetings. Welcome to the Heroes' Guild.")
@ -58,8 +59,8 @@ class AchiettiesDialogueFile : DialogueBuilderFile() {
return@let branch
}.onValue(1)
.betweenStage { df, player, _, _ ->
if(getQuestStage(player, HeroesQuest.questName) == 0) {
setQuestStage(player, HeroesQuest.questName, 1)
if(getQuestStage(player, Quests.HEROES_QUEST) == 0) {
setQuestStage(player, Quests.HEROES_QUEST, 1)
}
}
.npcl("Well you seem to meet our initial requirements, so you may now begin the tasks to earn membership in the Heroes' Guild.")
@ -107,7 +108,7 @@ class AchiettiesDialogueFile : DialogueBuilderFile() {
}
}
b.onQuestStages(HeroesQuest.questName, 2,3,4)
b.onQuestStages(Quests.HEROES_QUEST, 2, 3, 4)
.npcl("Greetings. Welcome to the Heroes' Guild.")
.npcl("How goes thy quest adventurer?")
.playerl("It's tough. I've not done it yet.")
@ -129,7 +130,7 @@ class AchiettiesDialogueFile : DialogueBuilderFile() {
.end()
}
b.onQuestStages(HeroesQuest.questName, 6)
b.onQuestStages(Quests.HEROES_QUEST, 6)
.npcl("Greetings. Welcome to the Heroes' Guild.")
.npcl("How goes thy quest adventurer?")
.branch { player ->
@ -166,14 +167,14 @@ class AchiettiesDialogueFile : DialogueBuilderFile() {
removeItem(player, Items.FIRE_FEATHER_1583)
removeItem(player, Items.LAVA_EEL_2149)
removeItem(player, Items.THIEVES_ARMBAND_1579)
if (getQuestStage(player, HeroesQuest.questName) == 6) {
finishQuest(player, HeroesQuest.questName)
if (getQuestStage(player, Quests.HEROES_QUEST) == 6) {
finishQuest(player, Quests.HEROES_QUEST)
}
}
}
}
b.onQuestStages(HeroesQuest.questName, 100)
b.onQuestStages(Quests.HEROES_QUEST, 100)
.npcl("Greetings. Welcome to the Heroes' Guild.")
}
}

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.getQuestStage
import core.api.openDialogue
import core.api.openNpcShop
@ -7,7 +8,6 @@ import core.api.setQuestStage
import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.player.Player
import core.plugin.Initializable
import org.rs09.consts.NPCs
@ -40,13 +40,16 @@ class AlfonseTheWaiterDialogueFile : DialogueBuilderFile() {
optionBuilder.option_playerl("No thank you.")
.end()
optionBuilder.optionIf("Do you sell Gherkins?"){ player -> return@optionIf getQuestStage(player, HeroesQuest.questName) >= 2 && HeroesQuest.isPhoenix(player) }
optionBuilder.optionIf("Do you sell Gherkins?"){ player -> return@optionIf getQuestStage(
player,
Quests.HEROES_QUEST
) >= 2 && HeroesQuest.isPhoenix(player) }
.playerl("Do you sell Gherkins?")
.npc("Hmmmm Gherkins eh? Ask Charlie the cook, round the", "back. He may have some 'gherkins' for you!")
.linel("Alfonse winks at you.")
.endWith { _, player ->
if(getQuestStage(player, HeroesQuest.questName) == 2) {
setQuestStage(player, HeroesQuest.questName, 3)
if(getQuestStage(player, Quests.HEROES_QUEST) == 2) {
setQuestStage(player, Quests.HEROES_QUEST, 3)
}
}

View file

@ -1,8 +1,8 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.getQuestStage
import core.api.openDialogue
import core.api.openNpcShop
import core.api.setQuestStage
import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile
@ -33,11 +33,11 @@ class CharlieTheCookDialogueFile : DialogueBuilderFile() {
.let { optionBuilder ->
val continuePath = b.placeholder()
optionBuilder.optionIf("I'm looking for a gherkin..."){ player -> return@optionIf getQuestStage(player, HeroesQuest.questName) >= 3 && HeroesQuest.isPhoenix(player) }
optionBuilder.optionIf("I'm looking for a gherkin...") { player -> return@optionIf getQuestStage(player, Quests.HEROES_QUEST) >= 3 && HeroesQuest.isPhoenix(player) }
.playerl("I'm looking for a gherkin...")
.goto(continuePath)
optionBuilder.optionIf("I'm a fellow member of the Phoenix Gang."){ player -> return@optionIf getQuestStage(player, HeroesQuest.questName) >= 3 && HeroesQuest.isPhoenix(player) }
optionBuilder.optionIf("I'm a fellow member of the Phoenix Gang.") { player -> return@optionIf getQuestStage(player, Quests.HEROES_QUEST) >= 3 && HeroesQuest.isPhoenix(player) }
.playerl("I'm a fellow member of the Phoenix Gang.")
.goto(continuePath)
@ -61,8 +61,8 @@ class CharlieTheCookDialogueFile : DialogueBuilderFile() {
.playerl("Mind if I check it out for myself?")
.npcl("Not at all! The more minds we have working on the problem, the quicker we get that loot!")
.endWith { _, player ->
if (getQuestStage(player, HeroesQuest.questName) == 3) {
setQuestStage(player, HeroesQuest.questName, 4)
if (getQuestStage(player, Quests.HEROES_QUEST) == 3) {
setQuestStage(player, Quests.HEROES_QUEST, 4)
}
}
@ -74,8 +74,8 @@ class CharlieTheCookDialogueFile : DialogueBuilderFile() {
.playerl("Mind if I check it out for myself?")
.npcl("Not at all! The more minds we have working on the problem, the quicker we get that loot!")
.endWith { _, player ->
if (getQuestStage(player, HeroesQuest.questName) == 3) {
setQuestStage(player, HeroesQuest.questName, 4)
if (getQuestStage(player, Quests.HEROES_QUEST) == 3) {
setQuestStage(player, Quests.HEROES_QUEST, 4)
}
}
}

View file

@ -1,8 +1,8 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.*
import core.game.dialogue.*
import core.game.global.action.DoorActionHandler
import core.game.node.entity.player.Player
import core.plugin.Initializable
import org.rs09.consts.Items
@ -28,7 +28,7 @@ class GarvDialogue(player: Player? = null) : DialoguePlugin(player){
class GarvDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
// Technically this won't happen since you have to get past Grubor.
b.onQuestStages(HeroesQuest.questName, 0,1,2)
b.onQuestStages(Quests.HEROES_QUEST, 0, 1, 2)
.npcl("Hello. What do you want?")
.options()
.let { optionBuilder ->
@ -40,7 +40,7 @@ class GarvDialogueFile : DialogueBuilderFile() {
.end()
}
b.onQuestStages(HeroesQuest.questName, 3,4,5,6,100)
b.onQuestStages(Quests.HEROES_QUEST, 3, 4, 5, 6, 100)
// .npcl("Oi! Where do you think you're going pal?") - When you click on the door instead of Garv.
.npcl("Hello. What do you want?")
.playerl("Hi. I'm Hartigen. I've come to work here.")
@ -55,8 +55,8 @@ class GarvDialogueFile : DialogueBuilderFile() {
branch2.onValue(1)
.npcl("You'd better come in then, Grip will want to talk to you.")
.endWith { _, player ->
if(getQuestStage(player, HeroesQuest.questName) == 3) {
setQuestStage(player, HeroesQuest.questName, 4)
if(getQuestStage(player, Quests.HEROES_QUEST) == 3) {
setQuestStage(player, Quests.HEROES_QUEST, 4)
}
}
branch2.onValue(0)

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile
@ -38,7 +39,7 @@ class GerrantDialogueFile : DialogueBuilderFile() {
optionBuilder.option_playerl("Sorry, I'm not interested.")
.end()
optionBuilder.optionIf("I want to find out how to catch a lava eel.") { player -> return@optionIf getQuestStage(player, HeroesQuest.questName) >= 1 }
optionBuilder.optionIf("I want to find out how to catch a lava eel.") { player -> return@optionIf getQuestStage(player, Quests.HEROES_QUEST) >= 1 }
.playerl("I want to find out how to catch a lava eel.")
.npcl("Lava eels, eh? That's a tricky one, that is. You'll need a lava-proof fishing rod. The method for making this would be to take an ordinary fishing rod, and then cover it with fire-proof blamish oil.")
.branch { player ->

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.node.entity.Entity
@ -38,8 +39,8 @@ class GripBehavior : NPCBehavior(NPCs.GRIP_792) {
override fun onDeathFinished(self: NPC, killer: Entity) {
if (killer is Player) {
if (getQuestStage(killer, HeroesQuest.questName) == 4) {
setQuestStage(killer, HeroesQuest.questName, 5)
if (getQuestStage(killer, Quests.HEROES_QUEST) == 4) {
setQuestStage(killer, Quests.HEROES_QUEST, 5)
}
val gi = GroundItem(

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile
@ -26,7 +27,8 @@ class GruborDialogue (player: Player? = null) : DialoguePlugin(player) {
class GruborDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onPredicate { player -> getQuestStage(player, HeroesQuest.questName) >= 2 &&
b.onPredicate { player ->
getQuestStage(player, Quests.HEROES_QUEST) >= 2 &&
getAttribute(player, HeroesQuest.attributeGruborLetsYouIn, false) &&
HeroesQuest.isBlackArm(player)
}
@ -34,7 +36,8 @@ class GruborDialogueFile : DialogueBuilderFile() {
.npcl("Hi, I'm a little busy right now.")
.end()
b.onPredicate { player -> getQuestStage(player, HeroesQuest.questName) >= 2 &&
b.onPredicate { player ->
getQuestStage(player, Quests.HEROES_QUEST) >= 2 &&
!getAttribute(player, HeroesQuest.attributeGruborLetsYouIn, false) &&
HeroesQuest.isBlackArm(player)
}

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import content.region.misthalin.varrock.quest.shieldofarrav.ShieldofArrav
import core.api.*
import core.game.node.entity.player.Player
@ -12,7 +13,7 @@ import org.rs09.consts.Items
* Heroes' Quest
*/
@Initializable
class HeroesQuest : Quest("Heroes' Quest",75, 74, 1, 188, 0, 1, 15) {
class HeroesQuest : Quest(Quests.HEROES_QUEST,75, 74, 1, 188, 0, 1, 15) {
/**
* Do note: "other players can help you even if they have already finished Heroes' Quest"
* 1 - Talked to Achietties to start the quest
@ -34,7 +35,6 @@ class HeroesQuest : Quest("Heroes' Quest",75, 74, 1, 188, 0, 1, 15) {
*/
companion object {
const val questName = "Heroes' Quest"
const val attributeGruborLetsYouIn = "/save:quest:heroesquest-gruborletsyouin"
const val attributeGripTookPapers = "/save:quest:heroesquest-griptookpapers"
const val attributeGripSaidDuties = "/save:quest:heroesquest-gripsaidduties"
@ -42,10 +42,10 @@ class HeroesQuest : Quest("Heroes' Quest",75, 74, 1, 188, 0, 1, 15) {
const val attributeHasOpenedChestDoor = "/save:quest:heroesquest-hasopenedchestdoor"
fun checkQuestsAreComplete(player: Player): Boolean {
return isQuestComplete(player, "Shield of Arrav") &&
isQuestComplete(player, "Lost City") &&
isQuestComplete(player, "Merlin's Crystal") &&
isQuestComplete(player, "Dragon Slayer") &&
return isQuestComplete(player, Quests.SHIELD_OF_ARRAV) &&
isQuestComplete(player, Quests.LOST_CITY) &&
isQuestComplete(player, Quests.MERLINS_CRYSTAL) &&
isQuestComplete(player, Quests.DRAGON_SLAYER) &&
getQuestPoints(player) >= 55
}
@ -65,10 +65,10 @@ class HeroesQuest : Quest("Heroes' Quest",75, 74, 1, 188, 0, 1, 15) {
hasLevelStat(player, Skills.MINING, 50),
hasLevelStat(player, Skills.FISHING, 53),
hasLevelStat(player, Skills.COOKING, 53),
isQuestComplete(player, "Shield of Arrav"),
isQuestComplete(player, "Lost City"),
isQuestComplete(player, "Merlin's Crystal"),
isQuestComplete(player, "Dragon Slayer"),
isQuestComplete(player, Quests.SHIELD_OF_ARRAV),
isQuestComplete(player, Quests.LOST_CITY),
isQuestComplete(player, Quests.MERLINS_CRYSTAL),
isQuestComplete(player, Quests.DRAGON_SLAYER),
getQuestPoints(player) >= 55,
).all { it }
}
@ -85,7 +85,7 @@ class HeroesQuest : Quest("Heroes' Quest",75, 74, 1, 188, 0, 1, 15) {
var line = 12
var stage = getStage(player)
var started = getQuestStage(player!!, questName) > 0
var started = getQuestStage(player!!, Quests.HEROES_QUEST) > 0
if(!started){
if (checkQuestsAreComplete(player)) {
@ -95,10 +95,10 @@ class HeroesQuest : Quest("Heroes' Quest",75, 74, 1, 188, 0, 1, 15) {
} else {
line(player, "I can start this quest by speaking to !!Achietties?? at the", line++)
line(player, "!!Heroes' Guild?? located !!North?? of !!Taverly?? after completing", line++)
line(player, "!!The Shield of Arrav??", line++, isQuestComplete(player, "Shield of Arrav"))
line(player, "!!The Lost City??", line++, isQuestComplete(player, "Lost City"))
line(player, "!!Merlin's Crystal??", line++, isQuestComplete(player, "Merlin's Crystal"))
line(player, "!!The Dragon Slayer??", line++, isQuestComplete(player, "Dragon Slayer"))
line(player, "!!The Shield of Arrav??", line++, isQuestComplete(player, Quests.SHIELD_OF_ARRAV))
line(player, "!!The Lost City??", line++, isQuestComplete(player, Quests.LOST_CITY))
line(player, "!!Merlin's Crystal??", line++, isQuestComplete(player, Quests.MERLINS_CRYSTAL))
line(player, "!!The Dragon Slayer??", line++, isQuestComplete(player, Quests.DRAGON_SLAYER))
line(player, "!!and gaining 55 Quest Points??", line++, getQuestPoints(player) >= 55)
}
line(player, "To complete this quest I need:", line++, false)
@ -217,7 +217,7 @@ class HeroesQuest : Quest("Heroes' Quest",75, 74, 1, 188, 0, 1, 15) {
}
override fun reset(player: Player) {
if (getQuestStage(player, questName) == 0) {
if (getQuestStage(player, Quests.HEROES_QUEST) == 0) {
removeAttribute(player, attributeGruborLetsYouIn)
removeAttribute(player, attributeGripTookPapers)
removeAttribute(player, attributeGripSaidDuties)

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
@ -22,7 +23,7 @@ class HeroesQuestListener: InteractionListener {
override fun defineListeners() {
// Black arm gang office door.
on(Scenery.DOOR_2626, IntType.SCENERY, "open") { player, node ->
if (getQuestStage(player, HeroesQuest.questName) >= 2 &&
if (getQuestStage(player, Quests.HEROES_QUEST) >= 2 &&
getAttribute(player, HeroesQuest.attributeGruborLetsYouIn, false) &&
HeroesQuest.isBlackArm(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
@ -34,7 +35,7 @@ class HeroesQuestListener: InteractionListener {
// Kitchen entrance
on(Scenery.DOOR_2628, IntType.SCENERY, "open") { player, node ->
if (getQuestStage(player, HeroesQuest.questName) >= 3 && HeroesQuest.isPhoenix(player)) {
if (getQuestStage(player, Quests.HEROES_QUEST) >= 3 && HeroesQuest.isPhoenix(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
sendDialogue(player, "This door is locked.")
@ -44,7 +45,7 @@ class HeroesQuestListener: InteractionListener {
// Kitchen wall
on(Scenery.WALL_2629, IntType.SCENERY, "push") { player, node ->
if (getQuestStage(player, HeroesQuest.questName) >= 4 && HeroesQuest.isPhoenix(player)) {
if (getQuestStage(player, Quests.HEROES_QUEST) >= 4 && HeroesQuest.isPhoenix(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, CharlieTheCookDialogueFile(), NPC(NPCs.CHARLIE_THE_COOK_794))
@ -54,7 +55,7 @@ class HeroesQuestListener: InteractionListener {
// Mansion frontdoor
on(Scenery.DOOR_2627, IntType.SCENERY, "open") { player, node ->
if (getQuestStage(player, HeroesQuest.questName) >= 4 && HeroesQuest.isBlackArm(player)) {
if (getQuestStage(player, Quests.HEROES_QUEST) >= 4 && HeroesQuest.isBlackArm(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, GarvDialogueFile(), NPC(NPCs.GARV_788))
@ -127,8 +128,8 @@ class HeroesQuestListener: InteractionListener {
if (inInventory(player, Items.PETES_CANDLESTICK_1577)) {
sendMessage(player, "You search the chest but find nothing.")
} else {
if (getQuestStage(player, HeroesQuest.questName) == 4) {
setQuestStage(player, HeroesQuest.questName, 5)
if (getQuestStage(player, Quests.HEROES_QUEST) == 4) {
setQuestStage(player, Quests.HEROES_QUEST, 5)
}
sendDialogue(player, "You find two candlesticks in the chest. So that will be one for you, and one for the person who killed Grip for you.")
addItemOrDrop(player, Items.PETES_CANDLESTICK_1577, 2)

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.*
import core.game.dialogue.*
import org.rs09.consts.Items
@ -7,7 +8,7 @@ import org.rs09.consts.Items
class KatrineDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
// 0 is handled by default in the old KatrineDialogue.
b.onQuestStages(HeroesQuest.questName, 1)
b.onQuestStages(Quests.HEROES_QUEST, 1)
.playerl("Hey.")
.npcl("Hey.")
.options()
@ -30,15 +31,15 @@ class KatrineDialogueFile : DialogueBuilderFile() {
.npcl("Visit our hideout in the alleyway on palm street.")
.npcl("To get in you will need to tell them the secret password 'four leaved clover'.")
.endWith { _, player ->
if(getQuestStage(player, HeroesQuest.questName) == 1) {
setQuestStage(player, HeroesQuest.questName, 2)
if(getQuestStage(player, Quests.HEROES_QUEST) == 1) {
setQuestStage(player, Quests.HEROES_QUEST, 2)
}
}
}
// This is not authentic, she falls back to a boring default conversation, but I guess people might need help during the quest
b.onQuestStages(HeroesQuest.questName, 2,3,4)
b.onQuestStages(Quests.HEROES_QUEST, 2, 3, 4)
.playerl("What am I supposed to be doing again?")
.npcl("You told me you wanted to get the rank of master thief! Now pay attention.")
.npcl("Some of the MOST coveted prizes in thiefdom right now are in the pirate town of Brimhaven on Karamja.")
@ -72,7 +73,7 @@ class KatrineDialogueFile : DialogueBuilderFile() {
*/
b.onQuestStages(HeroesQuest.questName, 5)
b.onQuestStages(Quests.HEROES_QUEST, 5)
.branch { player ->
return@branch if (inInventory(player, Items.PETES_CANDLESTICK_1577)) { 1 } else { 0 }
}.let { branch ->
@ -94,8 +95,8 @@ class KatrineDialogueFile : DialogueBuilderFile() {
.endWith { _, player ->
if (removeItem(player, Items.PETES_CANDLESTICK_1577)) {
addItemOrDrop(player, Items.THIEVES_ARMBAND_1579)
if (getQuestStage(player, HeroesQuest.questName) == 5) {
setQuestStage(player, HeroesQuest.questName, 6)
if (getQuestStage(player, Quests.HEROES_QUEST) == 5) {
setQuestStage(player, Quests.HEROES_QUEST, 6)
}
}
}
@ -114,7 +115,7 @@ class KatrineDialogueFile : DialogueBuilderFile() {
}
// I lost the armband and some stupid default shit.
b.onQuestStages(HeroesQuest.questName, 6)
b.onQuestStages(Quests.HEROES_QUEST, 6)
.playerl("I have lost my master thief's armband...")
.npcl("Lucky I 'ave a spare ain't it? Don't lose it again.")
.endWith { _, player ->

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.*
import core.game.dialogue.*
import org.rs09.consts.Items
@ -7,7 +8,7 @@ import org.rs09.consts.Items
class StravenDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
// 0 is handled by default in the old StravenDialogue.
b.onQuestStages(HeroesQuest.questName, 1)
b.onQuestStages(Quests.HEROES_QUEST, 1)
.playerl("How would I go about getting a Master Thief armband?")
.npcl("Ooh... tricky stuff. Took me YEARS to get that rank.")
.npcl("Well, what some of the more aspiring thieves in our gang are working on right now is to steal some very valuable candlesticks from Scarface Pete - the pirate leader on Karamja.")
@ -15,12 +16,12 @@ class StravenDialogueFile : DialogueBuilderFile() {
.npcl("Go talk to our man Alfonse, the waiter in the Shrimp and Parrot.")
.npcl("Use the secret word 'gherkin' to show you're one of us.")
.endWith { _, player ->
if(getQuestStage(player, HeroesQuest.questName) == 1) {
setQuestStage(player, HeroesQuest.questName, 2)
if(getQuestStage(player, Quests.HEROES_QUEST) == 1) {
setQuestStage(player, Quests.HEROES_QUEST, 2)
}
}
b.onQuestStages(HeroesQuest.questName, 2,3,4)
b.onQuestStages(Quests.HEROES_QUEST, 2, 3, 4)
.playerl("What am I supposed to be doing again?")
.npcl("You told me you wanted to get a Master thief's armband! Now pay attention.")
.npcl("Some of the more aspiring thieves in our gang are working on right now is to steal some very valuable candlesticks from Scarface Pete - the pirate leader on Karamja.")
@ -30,7 +31,7 @@ class StravenDialogueFile : DialogueBuilderFile() {
.end()
b.onQuestStages(HeroesQuest.questName, 5)
b.onQuestStages(Quests.HEROES_QUEST, 5)
.branch { player ->
return@branch if (inInventory(player, Items.PETES_CANDLESTICK_1577)) { 1 } else { 0 }
}.let { branch ->
@ -44,8 +45,8 @@ class StravenDialogueFile : DialogueBuilderFile() {
.endWith { _, player ->
if (removeItem(player, Items.PETES_CANDLESTICK_1577)) {
addItemOrDrop(player, Items.THIEVES_ARMBAND_1579)
if (getQuestStage(player, HeroesQuest.questName) == 5) {
setQuestStage(player, HeroesQuest.questName, 6)
if (getQuestStage(player, Quests.HEROES_QUEST) == 5) {
setQuestStage(player, Quests.HEROES_QUEST, 6)
}
}
}
@ -61,7 +62,7 @@ class StravenDialogueFile : DialogueBuilderFile() {
}
// I lost the armband and some stupid default shit.
b.onQuestStages(HeroesQuest.questName, 6)
b.onQuestStages(Quests.HEROES_QUEST, 6)
.playerl("I'm afraid I've lost my master thief's armband.")
.npcl("Lucky for you I have a spare. Don't lose it again!")
.endWith { _, player ->

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.data.Quests
import core.api.*
import core.game.dialogue.*
import core.game.node.entity.player.Player
@ -27,13 +28,13 @@ class TrobertDialogue(player: Player? = null) : DialoguePlugin(player){
class TrobertDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
// Technically this won't happen since you have to get past Grubor.
b.onQuestStages(HeroesQuest.questName, 0,1)
b.onQuestStages(Quests.HEROES_QUEST, 0, 1)
.npcl("Welcome to our Brimhaven headquarters. I'm Trobert and I'm in charge here.")
.playerl("Pleased to meet you.")
.npcl("Likewise.")
.end()
b.onQuestStages(HeroesQuest.questName, 2)
b.onQuestStages(Quests.HEROES_QUEST, 2)
.npcl("Welcome to our Brimhaven headquarters. I'm Trobert and I'm in charge here.")
.options()
.let { optionBuilder ->
@ -56,8 +57,8 @@ class TrobertDialogueFile : DialogueBuilderFile() {
.npcl("Good good. Well, here's the ID papers, take them and introduce yourself to the guards at Scarface Pete's mansion, we'll have that treasure in no time.")
.endWith { _, player ->
addItemOrDrop(player, Items.ID_PAPERS_1584)
if(getQuestStage(player, HeroesQuest.questName) == 2) {
setQuestStage(player, HeroesQuest.questName, 3)
if(getQuestStage(player, Quests.HEROES_QUEST) == 2) {
setQuestStage(player, Quests.HEROES_QUEST, 3)
}
}
@ -66,7 +67,7 @@ class TrobertDialogueFile : DialogueBuilderFile() {
.end()
}
b.onQuestStages(HeroesQuest.questName, 3,4,5)
b.onQuestStages(Quests.HEROES_QUEST, 3, 4, 5)
.branch { player ->
return@branch if (inInventory(player, Items.ID_PAPERS_1584)) { 1 } else { 0 }
}.let { branch ->
@ -82,7 +83,7 @@ class TrobertDialogueFile : DialogueBuilderFile() {
}
}
b.onQuestStages(HeroesQuest.questName, 6,100)
b.onQuestStages(Quests.HEROES_QUEST, 6, 100)
.npcl("How's it going?")
.playerl("Fine, thanks.")
.end()

View file

@ -1,8 +1,8 @@
package content.region.asgarnia.burthorpe.quest.trollstronghold
import content.data.Quests
import core.api.isQuestInProgress
import core.api.produceGroundItem
import core.api.transformNpc
import core.game.node.entity.Entity
import core.game.node.entity.combat.CombatStyle
import core.game.node.entity.npc.AbstractNPC
@ -44,7 +44,7 @@ class BerryNpc(id: Int = 0, location: Location? = null) : AbstractNPC(id, locati
}
override fun finalizeDeath(killer: Entity?) {
if (isQuestInProgress(killer as Player, TrollStronghold.questName, 8, 10)) {
if (isQuestInProgress(killer as Player, Quests.TROLL_STRONGHOLD, 8, 10)) {
produceGroundItem(killer, Items.CELL_KEY_2_3137, 1, this.location)
}
super.finalizeDeath(killer)

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.trollstronghold
import content.data.Quests
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
@ -13,7 +14,7 @@ import org.rs09.consts.NPCs
@Initializable
class DadDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (getQuestStage(player!!, TrollStronghold.questName)) {
when (getQuestStage(player!!, Quests.TROLL_STRONGHOLD)) {
in 3..4 -> {
when (stage) {
START_DIALOGUE -> npcl(FacialExpression.OLD_HAPPY, "What tiny human do in troll arena? Dad challenge human to fight!").also { stage++ }
@ -27,7 +28,7 @@ class DadDialogue(player: Player? = null) : DialoguePlugin(player) {
3 -> npcl(FacialExpression.OLD_HAPPY, "Tiny human brave. Dad squish!").also { stage++ }
4 -> npc!!.attack(player).also {
npc!!.skills.lifepoints = npc!!.skills.maximumLifepoints // Reset dad to max hitpoints.
setQuestStage(player!!, TrollStronghold.questName, 4)
setQuestStage(player!!, Quests.TROLL_STRONGHOLD, 4)
stage = END_DIALOGUE
}
}

View file

@ -1,5 +1,6 @@
package content.region.asgarnia.burthorpe.quest.trollstronghold
import content.data.Quests
import core.api.setQuestStage
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
@ -13,14 +14,14 @@ class DadDialogueFile(private val dialogueNum: Int = 0) : DialogueFile() {
1 -> when (stage) {
START_DIALOGUE -> npcl(FacialExpression.OLD_HAPPY, "No human pass through arena without defeating Dad!").also {
stage = END_DIALOGUE
setQuestStage(player!!, TrollStronghold.questName, 3)
setQuestStage(player!!, Quests.TROLL_STRONGHOLD, 3)
}
}
2 -> when (stage) {
START_DIALOGUE -> npcl(FacialExpression.OLD_NORMAL, "Tiny human brave. Dad squish!").also { stage++ }
1 -> npc!!.attack(player).also {
npc!!.skills.lifepoints = npc!!.skills.maximumLifepoints // Reset dad to max hitpoints.
setQuestStage(player!!, TrollStronghold.questName, 4)
setQuestStage(player!!, Quests.TROLL_STRONGHOLD, 4)
stage = END_DIALOGUE
}
}
@ -31,7 +32,7 @@ class DadDialogueFile(private val dialogueNum: Int = 0) : DialogueFile() {
Topic(FacialExpression.ANGRY_WITH_SMILE, "I'm not done yet! Prepare to die!", 2)
)
2 -> player!!.attack(npc).also {
setQuestStage(player!!, TrollStronghold.questName, 5)
setQuestStage(player!!, Quests.TROLL_STRONGHOLD, 5)
stage = END_DIALOGUE
}
}

Some files were not shown because too many files have changed in this diff Show more