Requirements Audit
Added a new quest requirement system Ensured that all implemented rewards are obtainable, even if all requirements are not implemented Rewards that should have higher requirements than what is currently obtainable will have those requirements automatically increase as more quests are added The requirements for any quest can be viewed at any time by clicking it in the quest list Things that were previously locked/unavailable but are now available (with prereqs) are: - It is now possible to obtain and equip Barrow's Gloves with the Recipe for Disaster prereqs - It is now possible to obtain and equip an Ancient Staff with the Desert Treasure prereqs - It is now possible to enchant your secateurs into Magic Secateurs with the Fairy Tale I - Growing Pains prereqs and 40k gold - It is now possible to equip the Ancient Mace with the Another Slice of H.A.M prereqs - It is now possible to get Suqahs as a task from Duradel with the Lunar Diplomacy prereqs - It is now possible to obtain a Seal of Passage by speaking with Chieftan Brundt after meeting the Lunar Diplomacy prereqs - It is now possible to obtain Ancient Staves by killing the level 96 and 103 mummies in the Ancient Pyramid (1/500) Things that were freely available but are now locked include: - Sophanem now requires/requires the prereqs of Icthlarin's Little Helper - Pharaoh's Sceptre requires the same^ - Equipping god books now requires Horror from the Deep/its prereqs - Neitiznot helmet now requires the Fremennik Isles prereqs rather than just Fremennik Trials - Cape of Legends now correctly requires the full possible prereqs for Legend's Quest rather than just 55 QP - Dragon Scimitar now correctly requires the Monkey Madness prereqs - Ape Atoll teleport now correctly requires the Monkey Madness prereqs - Slayer Helmet and the Slayer Rewards Shop in general now correctly require the Smoking Kills prereqs (not high) - Dragon Halberd now requires the Regicide prereqs - Climbing Boots now require the Death Plateau prereqs - Dragon SQ Shield now requires the Legend's Quest prereqs to equip (source available in sourcecode) - Initiate Armour now requires the Recruitment Drive prereqs - Proselyte Armour now requires the Slug Menace prereqs - Access to Piscatoris now requires the Swan Song prereqs (effectively Quest Cape here.) - The disease-free herb patch in Trollheim now requires the My Arm's Big Adventure prereqs. - Ardougne Teleport now requires the Plague City prereqs - Watchtower Teleport now requires the Watchtower prereqs - Trollheim Teleport now requires the Eadgar's Ruse prereqs - The Lunar spellbook now requires the Lunar Diplomacy prereqs - The Ancient spellbook now requires the Desert Treasure prereqs - Crafting Astral Runes now requires the Lunar Diplomacy prereqs - Crafting Death Runes now requires the Mourning's End Part II prereqs - Crafting Blood Runes now requires the Legacy of Seergaze prereqs - Access to Cave Horrors now requires the Cabin Fever prereqs - Sorceress' Garden now requires Prince Ali Rescue - Access to the Heroes' Guild now requires the Heroes' Quest prereqs - Access to GWD now requires the Troll Stronghold prereqs - Access to Neitiznot and Jatizso now requires Fremennik Trials - Access to Shilo Villa now requires the Shilo Village prereqs - The Keldagrim cart system now requires The Giant Dwarf prereqs - Fairy Rings now require the full Fairy Tale I - Growing Pains prereqs - Ectophial now requires the Ghosts Ahoy prereqs - Access to Tormented Demons now requires the While Guthix Sleeps prereqs - Access to the Halberd Shop and the ability to equip Dragon Halberds now requires the Regicide prereqs - Access to Lletya now requires the Mourning's End Part I prereqs - Access to Corporeal Beast now requires the Summer's End prereqs - Chivalry and Piety prayers now require the King's Ransom prereqs - Ali Morrisane's rune shop now requires the The Feud prereqs - Armoured Zombies now require the Defender of Varrock prereqs - Experiments now require the Creature of Fenkenstrain prereqs - The carpet to Sophanem now requires the Icthlarin's Little Helper prereqs - The carpet to Uzer now requires The Golem - The carpet to Bedabin Camp now requires The Tourist Trap - The bank in Sophanem now requires the Contact! prereqs - The Dragon Battleaxe now requires the prereqs of Heroes' Quest to equip. - The Dragon Mace now requires the prereqs of Heroes' Quest to equip. - Spirit shields of all varieties (improved, blessed, unblessed) now require the prereqs of Summer's End to equip. - Bork access now requires What Lies Below
This commit is contained in:
@@ -8,6 +8,8 @@ import core.game.node.entity.player.link.prayer.PrayerType;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* Represents the prayer interface.
|
||||
* @author 'Vexia
|
||||
@@ -24,6 +26,9 @@ public final class PrayerTabInterface extends ComponentPlugin {
|
||||
@Override
|
||||
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"))
|
||||
return true;
|
||||
if (type == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class QuestTabInterface extends ComponentPlugin {
|
||||
p.getInterfaceManager().open(new Component(275));
|
||||
quest.drawJournal(p, quest.getStage(p));
|
||||
return true;
|
||||
}
|
||||
} else QuestTabUtils.showRequirementsInterface(p, button);
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
@@ -68,4 +68,4 @@ public class QuestTabInterface extends ComponentPlugin {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
package content.global.handlers.iface
|
||||
|
||||
import core.game.requirement.*
|
||||
import core.api.*
|
||||
import core.tools.*
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.skill.Skills
|
||||
|
||||
import kotlin.math.*
|
||||
import java.util.*
|
||||
|
||||
import org.rs09.consts.*
|
||||
|
||||
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
|
||||
var (isMet, unmetReqs) = QuestReq(questReq).evaluate(player)
|
||||
|
||||
var messageList = ArrayList<String>()
|
||||
|
||||
val statMap = HashMap<Int, Int>()
|
||||
val questList = HashSet<String>()
|
||||
var maxQpReq = 0
|
||||
var qpPenalty = 0
|
||||
|
||||
for (req in unmetReqs) {
|
||||
if (req is QuestReq)
|
||||
questList.add(req.questReq.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
|
||||
}
|
||||
else if (req is QPReq && req.amount > maxQpReq)
|
||||
maxQpReq = req.amount
|
||||
else if (req is QPCumulative)
|
||||
qpPenalty += req.amount
|
||||
}
|
||||
|
||||
messageList.add(colorize("%B[Quests Needed]"))
|
||||
messageList.addAll(questList.map { "Completion of $it" })
|
||||
|
||||
messageList.add(" ")
|
||||
messageList.add(colorize("%B[Skills Needed]"))
|
||||
|
||||
for ((skillId, level) in statMap) {
|
||||
val name = Skills.SKILL_NAME[skillId]
|
||||
messageList.add("$level $name")
|
||||
}
|
||||
|
||||
messageList.add(" ")
|
||||
messageList.add(colorize("%B[Other Reqs]"))
|
||||
|
||||
val totalQpRequirement = QPReq(min(max(maxQpReq, qpPenalty), player.questRepository.getAvailablePoints()))
|
||||
val (meetsQp, _) = totalQpRequirement.evaluate(player)
|
||||
isMet = isMet && meetsQp
|
||||
|
||||
if (isMet)
|
||||
messageList.add(colorize("%GCongratulations! You've earned this one."))
|
||||
|
||||
if (!meetsQp) messageList.add("A total of ${totalQpRequirement.amount} Quest Points.")
|
||||
|
||||
messageList.add("")
|
||||
messageList.add(colorize("%BDISCLAIMER: If you're seeing this screen, this quest is not"))
|
||||
messageList.add(colorize("%Bimplemented yet. These are the requirements that you need in order"))
|
||||
messageList.add(colorize("%Bto access implemented content that would normally require this quest"))
|
||||
messageList.add("")
|
||||
messageList.add("If you want to see more quests enter the game, consider")
|
||||
messageList.add("contributing dialogue transcripts!")
|
||||
|
||||
|
||||
setInterfaceText(player, questName, Components.QUESTJOURNAL_SCROLL_275, 2)
|
||||
var lineId = 11
|
||||
for(i in 0..299) {
|
||||
val entry = messageList.elementAtOrNull(i)
|
||||
if (entry != null)
|
||||
setInterfaceText(player, entry, Components.QUESTJOURNAL_SCROLL_275, lineId++)
|
||||
else
|
||||
setInterfaceText(player, "", Components.QUESTJOURNAL_SCROLL_275, lineId++)
|
||||
}
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
else -> ""
|
||||
}
|
||||
return name
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,19 @@ class ItemQuestRequirementListener : InteractionListener {
|
||||
|
||||
private val questCapes = intArrayOf(9813,9814)
|
||||
|
||||
private val godBooks = intArrayOf (
|
||||
Items.HOLY_BOOK_3840,
|
||||
Items.UNHOLY_BOOK_3842
|
||||
)
|
||||
|
||||
private val pharaohScepters = (9044..9051).toIntArray()
|
||||
|
||||
private val initiateArmour = (5574..5576).toIntArray()
|
||||
|
||||
private val proselyteArmour = (9672..9678).toIntArray()
|
||||
|
||||
private val spiritShields = (13734..13745).toIntArray()
|
||||
|
||||
override fun defineListeners() {
|
||||
|
||||
/*
|
||||
@@ -109,20 +122,24 @@ class ItemQuestRequirementListener : InteractionListener {
|
||||
}
|
||||
*/
|
||||
|
||||
onEquip(fremennikTrialsEquipment.plus(fremennikIslesEquipment)) { player, _ ->
|
||||
return@onEquip requireQuest(player, "Fremennik Trials", "to equip this.")
|
||||
onEquip(fremennikTrialsEquipment) { player, _ ->
|
||||
return@onEquip hasRequirement(player, "Fremennik Trials")
|
||||
}
|
||||
|
||||
onEquip(fremennikIslesEquipment) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "The Fremennik Isles")
|
||||
}
|
||||
|
||||
onEquip(avasBackpacks){ player, _ ->
|
||||
return@onEquip requireQuest(player, "Animal Magnetism", "to equip this.")
|
||||
return@onEquip hasRequirement(player, "Animal Magnetism")
|
||||
}
|
||||
|
||||
onEquip(lostCityWeapons){ player, _ ->
|
||||
return@onEquip requireQuest(player, "Lost City", "to equip this.")
|
||||
return@onEquip hasRequirement(player, "Lost City")
|
||||
}
|
||||
|
||||
onEquip(Items.CAPE_OF_LEGENDS_1052) { player, _ ->
|
||||
return@onEquip requireQuest(player, "Legends' Quest", "to equip this.")
|
||||
return@onEquip hasRequirement(player, "Legend's Quest")
|
||||
}
|
||||
|
||||
onEquip(questCapes) { player, _ ->
|
||||
@@ -135,27 +152,84 @@ class ItemQuestRequirementListener : InteractionListener {
|
||||
}
|
||||
|
||||
onEquip(Items.WOLFBANE_2952){ player, _ ->
|
||||
return@onEquip requireQuest(player, "Priest in Peril", "to equip this.")
|
||||
return@onEquip hasRequirement(player, "Priest in Peril")
|
||||
}
|
||||
|
||||
onEquip(Items.ANCIENT_MACE_11061){ player, _ ->
|
||||
return@onEquip requireQuest(player, "Another Slice of H.A.M.", "to equip this.")
|
||||
return@onEquip hasRequirement(player, "Another Slice of H.A.M")
|
||||
}
|
||||
|
||||
onEquip(Items.ANCIENT_STAFF_4675){ player, _ ->
|
||||
return@onEquip requireQuest(player, "Desert Treasure", "to equip this.")
|
||||
return@onEquip hasRequirement(player, "Desert Treasure")
|
||||
}
|
||||
|
||||
onEquip(Items.ELEMENTAL_SHIELD_2890) { player, _ ->
|
||||
return@onEquip requireQuest(player, "Elemental Workshop I", "to equip this.")
|
||||
return@onEquip hasRequirement(player, "Elemental Workshop I")
|
||||
}
|
||||
|
||||
onEquip(crystalEquipment){ player, _ ->
|
||||
return@onEquip requireQuest(player, "Roving Elves", "to equip this.")
|
||||
return@onEquip hasRequirement(player, "Roving Elves")
|
||||
}
|
||||
|
||||
onEquip(dragonSlayerEquipment) {player, _ ->
|
||||
return@onEquip requireQuest(player, "Dragon Slayer", "to equip this.")
|
||||
return@onEquip hasRequirement(player, "Dragon Slayer")
|
||||
}
|
||||
|
||||
onEquip(Items.DRAGON_SCIMITAR_4587) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Monkey Madness")
|
||||
}
|
||||
|
||||
onEquip(Items.GLOVES_7462) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Recipe for Disaster")
|
||||
}
|
||||
|
||||
onEquip(Items.SLAYER_HELMET_13263) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Smoking Kills")
|
||||
}
|
||||
|
||||
onEquip (Items.DRAGON_HALBERD_3204) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Regicide")
|
||||
}
|
||||
|
||||
onEquip (Items.CLIMBING_BOOTS_3105) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Death Plateau")
|
||||
}
|
||||
|
||||
onEquip (godBooks) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Horror from the Deep")
|
||||
}
|
||||
|
||||
onEquip (pharaohScepters) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Icthlarin's 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")
|
||||
}
|
||||
|
||||
onEquip (initiateArmour) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Recruitment Drive")
|
||||
}
|
||||
|
||||
onEquip (proselyteArmour) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "The Slug Menace")
|
||||
}
|
||||
|
||||
onEquip (spiritShields) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Summer's End")
|
||||
}
|
||||
|
||||
onEquip (Items.DRAGON_MACE_1434) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Heroes' Quest")
|
||||
}
|
||||
|
||||
onEquip (Items.DRAGON_BATTLEAXE_1377) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Heroes' Quest")
|
||||
}
|
||||
|
||||
onEquip (Items.DARKLIGHT_6746) {player, _ ->
|
||||
return@onEquip hasRequirement(player, "Shadow of the Storm")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import core.game.world.map.Location;
|
||||
import core.game.world.map.zone.impl.WildernessZone;
|
||||
import core.plugin.Plugin;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* Represents the rotten potato plugin.
|
||||
* @author 'Vexia
|
||||
@@ -32,6 +34,8 @@ public final class TeleportCrystalPlugin extends OptionHandler {
|
||||
|
||||
@Override
|
||||
public boolean handle(Player player, Node node, String option) {
|
||||
if (!hasRequirement(player, "Mourning's End Part I"))
|
||||
return true;
|
||||
if (!WildernessZone.checkTeleport(player, 20)) {
|
||||
player.getPacketDispatch().sendMessage("The crystal is unresponsive.");
|
||||
return true;
|
||||
|
||||
@@ -14,6 +14,8 @@ import core.game.world.update.flag.context.Animation;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* Handles a tunnel shortcut.
|
||||
* @author Vexia
|
||||
@@ -70,6 +72,10 @@ 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"))
|
||||
return;
|
||||
}
|
||||
player.lock(6);
|
||||
final Scenery o = object;
|
||||
final Location start = player.getLocation();
|
||||
|
||||
@@ -33,6 +33,11 @@ class UseWithPatchHandler : InteractionListener {
|
||||
val patch = FarmingPatch.forObject(with.asScenery()) ?: return@onUseWith true
|
||||
val usedItem = used.asItem()
|
||||
|
||||
if (patch == FarmingPatch.TROLL_STRONGHOLD_HERB) {
|
||||
if (!hasRequirement(player, "My Arm's Big Adventure"))
|
||||
return@onUseWith true
|
||||
}
|
||||
|
||||
player.faceLocation(with.location)
|
||||
when(usedItem.id){
|
||||
RAKE -> PatchRaker.rake(player,patch)
|
||||
|
||||
@@ -92,21 +92,29 @@ class ModernListeners : SpellListener("modern"){
|
||||
}
|
||||
|
||||
onCast(Modern.ARDOUGNE_TELEPORT, NONE){ player, _ ->
|
||||
if (!hasRequirement(player, "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"))
|
||||
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"))
|
||||
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"))
|
||||
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))
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import core.game.world.map.Location;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.plugin.Plugin;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* Handles the praying at an alter.
|
||||
* @author Vexia
|
||||
@@ -104,6 +106,8 @@ public class PrayerAltarPlugin extends OptionHandler {
|
||||
ANCIENT(6552, SpellBook.ANCIENT.getInterfaceId(), "You feel a strange wisdom fill your mind...", "You feel a strange drain upon your memory...") {
|
||||
@Override
|
||||
public void pray(Player player) {
|
||||
if (!hasRequirement(player, "Desert Treasure"))
|
||||
return;
|
||||
if (player.getSkills().getStaticLevel(Skills.MAGIC) < 50) {
|
||||
player.sendMessage("You need a Magic level of at least 50 in order to do this.");
|
||||
return;
|
||||
@@ -121,6 +125,8 @@ public class PrayerAltarPlugin extends OptionHandler {
|
||||
LUNAR(17010, SpellBook.LUNAR.getInterfaceId(), "Lunar spells activated!", "Modern spells activated!") {
|
||||
@Override
|
||||
public void pray(Player player) {
|
||||
if (!hasRequirement(player, "Lunar Diplomacy"))
|
||||
return;
|
||||
if (player.getSkills().getStaticLevel(Skills.MAGIC) < 65) {
|
||||
player.sendMessage("You need a Magic level of at least 65 in order to do this.");
|
||||
return;
|
||||
|
||||
@@ -4,6 +4,8 @@ import core.cache.def.impl.ItemDefinition;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.scenery.Scenery;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* Represents an altar an it's relative information(corresponding ruin, etc)
|
||||
* @author 'Vexia
|
||||
@@ -69,6 +71,18 @@ public enum Altar {
|
||||
* @param player the player.
|
||||
*/
|
||||
public void enterRift(Player player) {
|
||||
if (this == ASTRAL) {
|
||||
if (!hasRequirement(player, "Lunar Diplomacy"))
|
||||
return;
|
||||
}
|
||||
if (this == DEATH) {
|
||||
if (!hasRequirement(player, "Mourning's End Part II"))
|
||||
return;
|
||||
}
|
||||
if (this == BLOOD) {
|
||||
if (!hasRequirement(player, "Legacy of Seergaze"))
|
||||
return;
|
||||
}
|
||||
if (this == LAW) {
|
||||
if (!ItemDefinition.canEnterEntrana(player)) {
|
||||
player.sendMessage("You can't take weapons and armour into the law rift.");
|
||||
|
||||
@@ -5,6 +5,8 @@ import core.game.node.entity.player.Player;
|
||||
import core.game.node.scenery.Scenery;
|
||||
import core.game.world.map.Location;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* Represents a mysterious ruin.
|
||||
* @author 'Vexia
|
||||
@@ -70,6 +72,14 @@ public enum MysteriousRuin {
|
||||
* @param player the player.
|
||||
*/
|
||||
public void enter(Player player) {
|
||||
if (this == DEATH) {
|
||||
if (!hasRequirement(player, "Mourning's End Part II"))
|
||||
return;
|
||||
}
|
||||
if (this == BLOOD) {
|
||||
if (!hasRequirement(player, "Legacy of Seergaze"))
|
||||
return;
|
||||
}
|
||||
if (player.getEquipment().get(EquipmentContainer.SLOT_HAT) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import core.tools.RandomFunction;
|
||||
import static core.api.ContentAPIKt.inEquipment;
|
||||
import static core.game.system.command.sets.StatAttributeKeysKt.STATS_BASE;
|
||||
import static core.game.system.command.sets.StatAttributeKeysKt.STATS_RC;
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
import core.game.world.GameWorld;
|
||||
import org.rs09.consts.Items;
|
||||
|
||||
@@ -96,6 +97,18 @@ public final class RuneCraftPulse extends SkillPulse<Item> {
|
||||
|
||||
@Override
|
||||
public boolean checkRequirements() {
|
||||
if (altar == Altar.ASTRAL) {
|
||||
if (!hasRequirement(player, "Lunar Diplomacy"))
|
||||
return false;
|
||||
}
|
||||
if (altar == Altar.DEATH) {
|
||||
if (!hasRequirement(player, "Mourning's End Part II"))
|
||||
return false;
|
||||
}
|
||||
if (altar == Altar.BLOOD) {
|
||||
if (!hasRequirement(player, "Legacy of Seergaze"))
|
||||
return false;
|
||||
}
|
||||
if (!altar.isOurania() && player.getSkills().getLevel(Skills.RUNECRAFTING) < rune.getLevel()) {
|
||||
player.getPacketDispatch().sendMessage("You need a Runecrafting level of at least " + rune.getLevel() + " to craft this rune.");
|
||||
return false;
|
||||
|
||||
@@ -23,6 +23,8 @@ import content.global.travel.EssenceTeleport;
|
||||
import core.game.world.GameWorld;
|
||||
import core.plugin.ClassScanner;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* Handles runecraftign related options.
|
||||
* @author Vexia
|
||||
@@ -94,7 +96,12 @@ public class RunecraftingPlugin extends OptionHandler {
|
||||
player.sendMessage("You can only craft Astral runes on Lunar Isle.");
|
||||
return true;
|
||||
}
|
||||
player.getPulseManager().run(new RuneCraftPulse(player, null, Altar.forObject(((Scenery) node)), false, null));
|
||||
Altar a = Altar.forObject(((Scenery) node));
|
||||
if (a == Altar.ASTRAL) {
|
||||
if (!hasRequirement(player, "Lunar Diplomacy"))
|
||||
return true;
|
||||
}
|
||||
player.getPulseManager().run(new RuneCraftPulse(player, null, a, false, null));
|
||||
break;
|
||||
case "locate":
|
||||
final Talisman talisman = Talisman.forItem(((Item) node));
|
||||
|
||||
@@ -5,12 +5,14 @@ import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.SpellBookManager
|
||||
import core.game.node.entity.player.link.TeleportManager
|
||||
import content.global.skill.runecrafting.Altar
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.map.zone.impl.DarkZone
|
||||
import core.plugin.Initializable
|
||||
import core.game.world.GameWorld
|
||||
import content.global.skill.farming.*
|
||||
import core.api.getAttribute
|
||||
import core.api.sendDialogue
|
||||
import core.api.hasRequirement
|
||||
|
||||
enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)? = null) {
|
||||
BAREFISTED_SMITHING("cape_perks:barefisted-smithing"),
|
||||
@@ -184,12 +186,20 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
|
||||
else -> null
|
||||
}
|
||||
|
||||
end()
|
||||
if(spellbook != null){
|
||||
if (spellbook == SpellBookManager.SpellBook.ANCIENT) {
|
||||
if (!hasRequirement(player, "Desert Treasure"))
|
||||
return true
|
||||
}
|
||||
else if (spellbook == SpellBookManager.SpellBook.LUNAR) {
|
||||
if (!hasRequirement(player, "Lunar Diplomacy"))
|
||||
return true
|
||||
}
|
||||
player.spellBookManager.setSpellBook(spellbook)
|
||||
player.interfaceManager.openTab(Component(spellbook.interfaceId))
|
||||
player.incrementAttribute("/save:cape_perks:librarian-magus-charges",-1)
|
||||
}
|
||||
end()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -244,7 +254,16 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
|
||||
|
||||
fun sendAltar(player: Player,altar: Altar){
|
||||
end()
|
||||
player.teleporter.send(altar.ruin.end,TeleportManager.TeleportType.TELE_OTHER)
|
||||
if (altar == Altar.DEATH && !hasRequirement(player, "Mourning's End Part II"))
|
||||
return
|
||||
else if (altar == Altar.ASTRAL && !hasRequirement(player, "Lunar Diplomacy"))
|
||||
return
|
||||
else if (altar == Altar.BLOOD && !hasRequirement(player, "Legacy of Seergaze"))
|
||||
return
|
||||
|
||||
var endLoc = if (altar == Altar.ASTRAL) Location.create(2151, 3864, 0) else altar.ruin.end
|
||||
|
||||
player.teleporter.send(endLoc, TeleportManager.TeleportType.TELE_OTHER)
|
||||
player.incrementAttribute("/save:cape_perks:abyssal_warp",-1)
|
||||
}
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ public enum Master {
|
||||
new Task(Tasks.SPIRTUAL_RANGERS,2),
|
||||
new Task(Tasks.SPIRTUAL_WARRIORS,2),
|
||||
new Task(Tasks.STEEL_DRAGONS,7),
|
||||
//new Task(Tasks.SUQAHS,8),
|
||||
new Task(Tasks.SUQAHS,8),
|
||||
new Task(Tasks.TROLLS,6),
|
||||
new Task(Tasks.TZHAAR, 10),
|
||||
new Task(Tasks.VAMPIRES,8),
|
||||
@@ -306,4 +306,4 @@ public enum Master {
|
||||
this.weight = weight;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import core.game.world.map.Location;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* Handles related slayer nodes.
|
||||
* @author Vexia
|
||||
@@ -61,6 +63,8 @@ public class SlayerPlugin extends OptionHandler {
|
||||
player.teleport(new Location(2729, 3733, 0));
|
||||
break;
|
||||
case 15767:
|
||||
if (!hasRequirement(player, "Cabin Fever"))
|
||||
return true;
|
||||
player.teleport(new Location(3748, 9373, 0));
|
||||
break;
|
||||
case 15811:
|
||||
|
||||
@@ -16,6 +16,8 @@ import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
import core.plugin.ClassScanner;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* Handles the slayer reward interface plugin.
|
||||
* @author Vexia
|
||||
@@ -307,6 +309,8 @@ public class SlayerRewardPlugin extends ComponentPlugin {
|
||||
|
||||
@Override
|
||||
public boolean handle(Player player, Node node, String option) {
|
||||
if (!hasRequirement(player, "Smoking Kills"))
|
||||
return true;
|
||||
openTab(player, BUY);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ object SlayerUtils {
|
||||
|
||||
fun canBeAssigned(player: Player, task: Tasks): Boolean
|
||||
{
|
||||
return player.getSkills().getLevel(Skills.SLAYER) >= task.levelReq && !SlayerManager.getInstance(player).flags.removed.contains(task)
|
||||
return player.getSkills().getLevel(Skills.SLAYER) >= task.levelReq && !SlayerManager.getInstance(player).flags.removed.contains(task) && task.hasQuestRequirements(player)
|
||||
}
|
||||
|
||||
fun assign(player: Player, task: Tasks, master: Master)
|
||||
@@ -56,4 +56,4 @@ object SlayerUtils {
|
||||
.spellBook == SpellBook.MODERN.interfaceId
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ import core.cache.def.impl.NPCDefinition;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import core.game.node.entity.player.Player;
|
||||
|
||||
import static core.api.ContentAPIKt.hasRequirement;
|
||||
|
||||
/**
|
||||
* A non-garbage way of representing tasks
|
||||
@@ -29,7 +32,7 @@ public enum Tasks {
|
||||
CATABLEPONS(35, new int[] { 4397, 4398, 4399, }, new String[] { "They use the magic spell Weaken to drain up to 15% of their", "opponent's maximum Strength level." }, 1, false, false),
|
||||
CAVE_BUG(1, new int[] { 1832, 5750, }, new String[] { "It regenerates life points quickly and seems to be a good", "herblore monster." }, 7, false, false),
|
||||
CAVE_CRAWLERS(10, new int[] { 1600, 1601, 1602, 1603, }, new String[] { "The poisonous parts of them are presumably removed." }, 10, false, false),
|
||||
CAVE_HORRORS(85, new int[] { 4353, 4354, 4355, 4356, 4357, }, new String[] { "A Cave horror wears a creepy mask, it is", "prefered to wear a witchwood icon." }, 58, false, false),
|
||||
CAVE_HORRORS(85, new int[] { 4353, 4354, 4355, 4356, 4357, }, new String[] { "A Cave horror wears a creepy mask, it is", "prefered to wear a witchwood icon." }, 58, "Cabin Fever"),
|
||||
CAVE_SLIMES(15, new int[] { 1831 }, new String[] { "These are lesser versions of jellies, watch out they can poison you." }, 17, false, false),
|
||||
COCKATRICES(25, new int[] { 1620, 1621, 4227, }, new String[] { "A Mirror shield is necessary when fighting these monsters." }, 25, false, false),
|
||||
COWS(5, new int[] { 1766, 1768, 2310, 81, 397, 955, 1767, 3309 }, new String[] { "Cow's may seem stupid, however they know more then", "you think. Don't under estimate them." }, 1, false, false),
|
||||
@@ -88,6 +91,7 @@ public enum Tasks {
|
||||
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, }, new String[] { "Trolls have a crushing attack, it's bets to wear a high crushing defence." }, 1, false, false),
|
||||
TUROTHS(60, new int[] { 1626, 1627, 1628, 1629, 1630 }, new String[] { "Turoths are Slayer monsters that require a Slayer level of 55 to kill" }, 55, false, false),
|
||||
TZHAAR(45, new int[] { 2591, 2592, 2593, 2745, 2594, 2595, 2596, 2597, 2604, 2605, 2606, 2607, 2608, 2609, 7755, 7753, 2598, 2599, 2600, 2601, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2624, 2617, 2618, 2625, 2602, 2603, 7754, 7767, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2624, 2625, 2627, 2628, 2629, 2630, 2631, 2632, 7746, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7754, 7755, 7756, 7757, 7758, 7759, 7760, 7761, 7762, 7763, 7764, 7765, 7766, 7767, 7768, 7769, 7770, 7771, 7747, 7747, 7748, 7749, 7750, 7751, 7752, 7753, 7757, 7765, 7769, 7768 }, new String[] { "Young Tzhaar's of the century are furious with your kind." }, 1, false, false),
|
||||
SUQAHS (65, new int[] { 4527, 4528, 4529, 4530, 4531, 4532, 4533 }, new String[] { "Suquah are big, angry folk that inhabit Lunar Isle." }, 1, "Lunar Diplomacy"),
|
||||
VAMPIRES(35, new int[] { 1023, 1220, 1223, 1225, 6214 }, new String[] { "Vampies arr equiped with large fangs", "they can do serious damage." }, 1, false, false),
|
||||
WATERFIENDS(75, new int[] { 5361 }, new String[] { "A waterfiend takes no damage from fire!" }, 1, false, false),
|
||||
WEREWOLFS(60, new int[] { 1665, 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[] { "There temper is alot more nasty then a regular wolf!" }, 1, false, false),
|
||||
@@ -111,9 +115,10 @@ public enum Tasks {
|
||||
public final int combatCheck;
|
||||
public final String[] info;
|
||||
public final int[] ids;
|
||||
public final boolean undead;
|
||||
public final boolean dragon;
|
||||
public boolean undead = false;
|
||||
public boolean dragon = false;
|
||||
public int amtHash;
|
||||
public String questReq = "";
|
||||
Tasks(int combatCheck, int[] ids, String[] info, int levelReq, boolean undead, boolean dragon){
|
||||
this.levelReq = levelReq;
|
||||
this.ids = ids;
|
||||
@@ -133,6 +138,14 @@ public enum Tasks {
|
||||
this.combatCheck = combatCheck;
|
||||
}
|
||||
|
||||
Tasks (int combatCheck, int[] ids, String[] info, int levelReq, String questReq) {
|
||||
this.combatCheck = combatCheck;
|
||||
this.ids = ids;
|
||||
this.info = info;
|
||||
this.levelReq = levelReq;
|
||||
this.questReq = questReq;
|
||||
}
|
||||
|
||||
public int[] getNpcs(){
|
||||
return ids;
|
||||
}
|
||||
@@ -141,6 +154,10 @@ public enum Tasks {
|
||||
return info;
|
||||
}
|
||||
|
||||
public boolean hasQuestRequirements (Player player) {
|
||||
return questReq.equals("") || hasRequirement(player, questReq, false);
|
||||
}
|
||||
|
||||
public static Tasks forId(int id){
|
||||
return taskMap.get(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user