Implemented Heroes Quest

This commit is contained in:
Oven Bread 2025-02-01 12:29:51 +00:00 committed by Ryan
parent 00b5a44c31
commit e34a81ec6c
31 changed files with 1542 additions and 442 deletions

View file

@ -301,7 +301,7 @@
}, },
{ {
"id": "2025", "id": "2025",
"replaceId": "1534", "replaceId": "2026",
"fence": "false", "fence": "false",
"metal": "false" "metal": "false"
}, },
@ -925,7 +925,7 @@
}, },
{ {
"id": "3747", "id": "3747",
"replaceId": "1534", "replaceId": "3748",
"fence": "false", "fence": "false",
"metal": "false" "metal": "false"
}, },

View file

@ -58865,6 +58865,26 @@
"description": "Ram", "description": "Ram",
"main": [] "main": []
}, },
{
"default": [
{
"minAmount": "1",
"weight": "1.0",
"id": "526",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "1.0",
"id": "1583",
"maxAmount": "1"
}
],
"charm": [],
"ids": "6108",
"description": "",
"main": []
},
{ {
"default": [], "default": [],
"charm": [], "charm": [],

View file

@ -16869,7 +16869,7 @@
"id": "1583" "id": "1583"
}, },
{ {
"examine": "Apparently my name is Hartigan", "examine": "Apparently my name is Hartigen.",
"durability": null, "durability": null,
"name": "Id papers", "name": "Id papers",
"tradeable": "false", "tradeable": "false",

View file

@ -52638,7 +52638,7 @@
"name": "Entrana firebird", "name": "Entrana firebird",
"defence_level": "1", "defence_level": "1",
"safespot": null, "safespot": null,
"lifepoints": "1", "lifepoints": "5",
"strength_level": "1", "strength_level": "1",
"id": "6108", "id": "6108",
"range_level": "1", "range_level": "1",

View file

@ -2217,11 +2217,11 @@
}, },
{ {
"npc_id": "789", "npc_id": "789",
"loc_data": "{2811,3167,0,0,0}-" "loc_data": "{2811,3167,0,1,0}-"
}, },
{ {
"npc_id": "792", "npc_id": "792",
"loc_data": "{2774,3197,0,0,0}-" "loc_data": "{2774,3197,0,1,0}-"
}, },
{ {
"npc_id": "793", "npc_id": "793",
@ -4413,7 +4413,7 @@
}, },
{ {
"npc_id": "1884", "npc_id": "1884",
"loc_data": "{2811,3174,0,0,0}-" "loc_data": "{2811,3174,0,1,0}-"
}, },
{ {
"npc_id": "1902", "npc_id": "1902",

View file

@ -52,7 +52,7 @@ public enum Consumables {
COOKED_JUBBLY(new Food(new int[] {7568}, new HealingEffect(15))), COOKED_JUBBLY(new Food(new int[] {7568}, new HealingEffect(15))),
BASS(new Food(new int[] {365}, new HealingEffect(13))), BASS(new Food(new int[] {365}, new HealingEffect(13))),
SWORDFISH(new Food(new int[] {373}, new HealingEffect(14))), SWORDFISH(new Food(new int[] {373}, new HealingEffect(14))),
LAVA_EEL(new Food(new int[] {2149}, new HealingEffect(14))), LAVA_EEL(new Food(new int[] {2149}, new HealingEffect(11))),
MONKFISH(new Food(new int[] {7946}, new HealingEffect(16))), MONKFISH(new Food(new int[] {7946}, new HealingEffect(16))),
SHARK(new Food(new int[] {385}, new HealingEffect(20))), SHARK(new Food(new int[] {385}, new HealingEffect(20))),
SEA_TURTLE(new Food(new int[] {397}, new HealingEffect(21))), SEA_TURTLE(new Food(new int[] {397}, new HealingEffect(21))),

View file

@ -24,7 +24,7 @@ enum class Fish(val id: Int, val level: Int, val experience: Double, val lowChan
LOBSTER(Items.RAW_LOBSTER_377, 40, 90.0, 0.16, 0.375), LOBSTER(Items.RAW_LOBSTER_377, 40, 90.0, 0.16, 0.375),
BASS(Items.RAW_BASS_363, 46, 100.0, 0.078, 0.16), BASS(Items.RAW_BASS_363, 46, 100.0, 0.078, 0.16),
SWORDFISH(Items.RAW_SWORDFISH_371, 50, 100.0, 0.105, 0.191), SWORDFISH(Items.RAW_SWORDFISH_371, 50, 100.0, 0.105, 0.191),
LAVA_EEL(Items.RAW_LAVA_EEL_2148, 53, 30.0, 0.227, 0.379), LAVA_EEL(Items.RAW_LAVA_EEL_2148, 53, 60.0, 0.227, 0.379),
MONKFISH(Items.RAW_MONKFISH_7944, 62, 120.0, 0.293, 0.356), MONKFISH(Items.RAW_MONKFISH_7944, 62, 120.0, 0.293, 0.356),
KARAMBWAN(Items.RAW_KARAMBWAN_3142, 65, 105.0, 0.414, 0.629), KARAMBWAN(Items.RAW_KARAMBWAN_3142, 65, 105.0, 0.414, 0.629),
SHARK(Items.RAW_SHARK_383, 76, 110.0, 0.121, 0.16), SHARK(Items.RAW_SHARK_383, 76, 110.0, 0.121, 0.16),

View file

@ -1,39 +0,0 @@
import core.api.openDialogue
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
/**
* @author qmqz
* @author Trident101
*/
@Initializable
class AchiettiesDialogue(player: Player? = null) : DialoguePlugin(player){
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, AchiettiesDialogueFile(), npc)
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return AchiettiesDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.ACHIETTIES_796)
}
}
class AchiettiesDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.defaultDialogue().npcl(FacialExpression.FRIENDLY,
"Greetings. Welcome to the Heroes' Guild."
)
}
}

View file

@ -0,0 +1,47 @@
package content.region.asgarnia.burthorpe.dialogue
import core.api.*
import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile
import core.game.dialogue.DialoguePlugin
import core.game.node.entity.player.Player
import core.plugin.Initializable
import org.rs09.consts.NPCs
@Initializable
class HelemosDialogue(player: Player? = null) : DialoguePlugin(player){
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, HelemosDialogueFile(), npc)
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return HelemosDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.HELEMOS_797)
}
}
class HelemosDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onPredicate { _ -> true }
.npc("Welcome to the Heroes' Guild!")
.options()
.let { optionBuilder ->
optionBuilder.option("So do you sell anything here?")
.playerl("So do you sell anything good here?")
.npcl("Why yes! We DO run an exclusive shop for our members!")
.endWith { _, player ->
openNpcShop(player, NPCs.HELEMOS_797)
end()
}
optionBuilder.option_playerl("So what can I do here?")
.npcl("Look around... there are all sorts of things to keep our guild members entertained!")
.end()
}
}
}

View file

@ -0,0 +1,179 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import core.api.*
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.Items
import org.rs09.consts.NPCs
@Initializable
class AchiettiesDialogue(player: Player? = null) : DialoguePlugin(player){
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, AchiettiesDialogueFile(), npc)
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return AchiettiesDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.ACHIETTIES_796)
}
}
class AchiettiesDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onQuestStages(HeroesQuest.questName, 0,1)
.branch { player ->
return@branch getQuestStage(player, HeroesQuest.questName)
}.let{ branch ->
branch.onValue(0)
.npcl(FacialExpression.FRIENDLY, "Greetings. Welcome to the Heroes' Guild.")
.npcl("Only the greatest heroes of this land may gain entrance to this guild.")
// - If the player's skill levels are lower than the quest requirements. (I think this is after 2009)
// linel("Before starting this quest, be aware that one or more of your skill levels are lower than what is required to fully complete it.")
.options()
.let { optionBuilder ->
optionBuilder.option("I'm a hero, may I apply to join?")
.playerl("I'm a hero. May I apply to join?")
.branch { player ->
return@branch if (HeroesQuest.hasRequirements(player)) {
1
} else {
0
}
}.let { branch ->
branch.onValue(0)
.npcl("You're a hero? I've never heard of YOU. You are required to possess at least 55 quest points to file an application.")
.npcl("Additionally you must have completed the Shield of Arrav, Lost City, Merlin's Crystal and Dragon Slayer quests.")
.end()
return@let branch
}.onValue(1)
.betweenStage { df, player, _, _ ->
if(getQuestStage(player, HeroesQuest.questName) == 0) {
setQuestStage(player, HeroesQuest.questName, 1)
}
}
.npcl("Well you seem to meet our initial requirements, so you may now begin the tasks to earn membership in the Heroes' Guild.")
.npcl("The three items required for entrance are: An Entranan Firebird feather, a Master Thieves' armband, and a cooked Lava Eel.")
.options()
.let { optionBuilder2 ->
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
.npcl("I'm sure you have the relevant contacts to find out about that.")
.end()
optionBuilder2.option_playerl("Any hints on getting the feather?")
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
.end()
optionBuilder2.option_playerl("Any hints on getting the eel?")
.npcl("Maybe go and find someone who knows a lot about fishing?")
.end()
optionBuilder2.option_playerl("I'll start looking for all those things then.")
.npcl("Good luck with that.")
.end()
}
optionBuilder.option_playerl("Good for the foremost heroes of the land.")
.npcl("Yes. Yes it is.")
.end()
}
branch.onValue(1)
.npcl("Greetings. Welcome to the Heroes' Guild.")
.npcl("How goes thy quest adventurer?")
.playerl("It's tough. I've not done it yet.")
.npcl("Remember, the items you need to enter are:")
.npcl("An Entranan Firebirds' feather, A Master Thieves armband, and a cooked Lava Eel.")
.options()
.let { optionBuilder2 ->
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
.npcl("I'm sure you have the relevant contacts to find out about that.")
.end()
optionBuilder2.option_playerl("Any hints on getting the feather?")
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
.end()
optionBuilder2.option_playerl("Any hints on getting the eel?")
.npcl("Maybe go and find someone who knows a lot about fishing?")
.end()
optionBuilder2.option_playerl("I'll start looking for all those things then.")
.npcl("Good luck with that.")
.end()
}
}
b.onQuestStages(HeroesQuest.questName, 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.")
.npcl("Remember, the items you need to enter are:")
.npcl("An Entranan Firebirds' feather, A Master Thieves armband, and a cooked Lava Eel.")
.options()
.let { optionBuilder2 ->
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
.npcl("I'm sure you have the relevant contacts to find out about that.")
.end()
optionBuilder2.option_playerl("Any hints on getting the feather?")
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
.end()
optionBuilder2.option_playerl("Any hints on getting the eel?")
.npcl("Maybe go and find someone who knows a lot about fishing?")
.end()
optionBuilder2.option_playerl("I'll start looking for all those things then.")
.npcl("Good luck with that.")
.end()
}
b.onQuestStages(HeroesQuest.questName, 6)
.npcl("Greetings. Welcome to the Heroes' Guild.")
.npcl("How goes thy quest adventurer?")
.branch { player ->
return@branch if (HeroesQuest.allItemsInInventory(player)) { 1 } else { 0 }
}.let { branch ->
branch.onValue(0)
.playerl("It's tough. I've not done it yet.")
.npcl("Remember, the items you need to enter are:")
.npcl("An Entranan Firebirds' feather, A Master Thieves armband, and a cooked Lava Eel.")
.options()
.let { optionBuilder2 ->
optionBuilder2.option_playerl("Any hints on getting the thieves armband?")
.npcl("I'm sure you have the relevant contacts to find out about that.")
.end()
optionBuilder2.option_playerl("Any hints on getting the feather?")
.npcl("Not really - other than Entranan firebirds tend to live on Entrana.")
.end()
optionBuilder2.option_playerl("Any hints on getting the eel?")
.npcl("Maybe go and find someone who knows a lot about fishing?")
.end()
optionBuilder2.option_playerl("I'll start looking for all those things then.")
.npcl("Good luck with that.")
.end()
}
branch.onValue(1)
.playerl("I have all the required items.")
.npcl("I see that you have. Well done. Now, to complete the quest, and gain entry to the Heroes' Guild in your final task all that you have to do is...")
.playerl("W-what? What do you mean? There's MORE?")
.npcl("I'm sorry, I was just having a little fun with you. Just a little Heroes' Guild humour there. What I really meant was")
.npcl("Congratulations! You have completed the Heroes' Guild entry requirements! You will find the door now open for you! Enter, Hero! And take this reward!")
.endWith { _, player ->
if (HeroesQuest.allItemsInInventory(player)) {
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)
}
}
}
}
b.onQuestStages(HeroesQuest.questName, 100)
.npcl("Greetings. Welcome to the Heroes' Guild.")
}
}

View file

@ -0,0 +1,59 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
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
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
@Initializable
class AlfonseTheWaiterDialogue (player: Player? = null) : DialoguePlugin(player) {
override fun newInstance(player: Player): DialoguePlugin {
return AlfonseTheWaiterDialogue(player)
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, AlfonseTheWaiterDialogueFile(), npc)
return false
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.ALFONSE_THE_WAITER_793)
}
}
class AlfonseTheWaiterDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onPredicate { _ -> true }
.npc("Welcome to the Shrimp and Parrot.", "Would you like to order, sir?")
.options()
.let { optionBuilder ->
optionBuilder.option_playerl("Yes please.")
.endWith { _, player ->
openNpcShop(player, npc!!.id)
}
optionBuilder.option_playerl("No thank you.")
.end()
optionBuilder.optionIf("Do you sell Gherkins?"){ player -> return@optionIf getQuestStage(player, HeroesQuest.questName) >= 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)
}
}
optionBuilder.option("Where do you get your Karambwan from?")
.npc("We buy directly off Lubufu, a local fisherman. He", "seems to have a monopoly over Karambwan sales.")
.end()
}
}
}

View file

@ -0,0 +1,84 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
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
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
@Initializable
class CharlieTheCookDialogue (player: Player? = null) : DialoguePlugin(player) {
override fun newInstance(player: Player): DialoguePlugin {
return CharlieTheCookDialogue(player)
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, CharlieTheCookDialogueFile(), npc)
return false
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.CHARLIE_THE_COOK_794)
}
}
class CharlieTheCookDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onPredicate { _ -> true }
.npc(FacialExpression.ANGRY, "Hey! What are you doing back here?")
.options()
.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) }
.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) }
.playerl("I'm a fellow member of the Phoenix Gang.")
.goto(continuePath)
optionBuilder.option_playerl("Just exploring.")
.npcl(FacialExpression.ANGRY, "Well, get out! This kitchen isn't for exploring. It's a private establishment! It's out of bounds to customers!")
.end()
return@let continuePath.builder()
}
.npcl("Ah, a fellow Phoenix! So, tell me compadre... What brings you to sunny Brimhaven?")
.options()
.let { optionBuilder ->
optionBuilder.option_playerl("Sun, sand, and the fresh sea air!")
.playerl("Sun, sand, and the fresh sea air!")
.npcl("Well, can't say I blame you, compadre. I used to be a city boy myself, but have to admit it's a lot nicer living here nowadays. Brimhaven's certainly good for it.")
.playerl("I also want to steal Scarface Pete's candlesticks.")
.npcl("Ah yes, of course. The candlesticks. Well, I have to be honest with you, compadre, we haven't made much progress in that task ourselves so far.")
.npcl("We can however offer a little assistance. Setting up this restaurant was the start of things; we have a secret door out the back of here that leads through the back of Cap'n Arnav's garden.")
.npcl("Now, at the other side of Cap'n Arnav's garden, is an old side entrance to Scarface Pete's mansion. It seems to have been blocked off from the rest of the mansion some years ago and we can't seem to find a way through.")
.npcl("We're positive this is the key to entering the house undetected, however, and I promise to let you know if we find anything there.")
.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)
}
}
optionBuilder.option_playerl("I want to steal Scarface Pete's candlesticks.")
.npcl("Ah yes, of course. The candlesticks. Well, I have to be honest with you, compadre, we haven't made much progress in that task ourselves so far.")
.npcl("We can however offer a little assistance. Setting up this restaurant was the start of things; we have a secret door out the back of here that leads through the back of Cap'n Arnav's garden.")
.npcl("Now, at the other side of Cap'n Arnav's garden, is an old side entrance to Scarface Pete's mansion. It seems to have been blocked off from the rest of the mansion some years ago and we can't seem to find a way through.")
.npcl("We're positive this is the key to entering the house undetected, however, and I promise to let you know if we find anything there.")
.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)
}
}
}
}
}

View file

@ -0,0 +1,72 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
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
import org.rs09.consts.NPCs
@Initializable
class GarvDialogue(player: Player? = null) : DialoguePlugin(player){
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, GarvDialogueFile(), npc)
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return GarvDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.GARV_788)
}
}
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)
.npcl("Hello. What do you want?")
.options()
.let { optionBuilder ->
optionBuilder.option_playerl("Can I go in there?")
.npcl("No. In there is private.")
.end()
optionBuilder.option_playerl("I want for nothing!")
.npcl("You're one of a very lucky few then.")
.end()
}
b.onQuestStages(HeroesQuest.questName, 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.")
.branch { player ->
return@branch if (inEquipment(player, Items.BLACK_FULL_HELM_1165) && inEquipment(player, Items.BLACK_PLATEBODY_1125) && inEquipment(player, Items.BLACK_PLATELEGS_1077)) { 1 } else { 0 }
}.let { branch ->
branch.onValue(1)
.npcl("I assume you have your I.D. papers then?")
.branch { player ->
return@branch if (inInventory(player, Items.ID_PAPERS_1584)) { 1 } else { 0 }
}.let { branch2 ->
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)
}
}
branch2.onValue(0)
.playerl("Uh... Yeah. About that...I must have left them in my other suit of armour.")
.end()
}
branch.onValue(0)
.npcl("Hartigen the Black Knight? I don't think so. He doesn't dress like that.")
.end()
}
}
}

View file

@ -0,0 +1,65 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import core.api.*
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.Items
import org.rs09.consts.NPCs
@Initializable
class GerrantDialogue (player: Player? = null) : DialoguePlugin(player) {
override fun newInstance(player: Player): DialoguePlugin {
return GerrantDialogue(player)
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, GerrantDialogueFile(), npc)
return false
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.GERRANT_558)
}
}
class GerrantDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onPredicate { _ -> true }
.npc(FacialExpression.HAPPY, "Welcome! You can buy fishing equipment at my store.", "We'll also buy anything you catch off you.")
.options()
.let { optionBuilder ->
optionBuilder.option_playerl("Let's see what you've got then.")
.endWith { _, player ->
openNpcShop(player, npc!!.id)
}
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 }
.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 ->
return@branch if (inInventory(player, Items.BLAMISH_SNAIL_SLIME_1581)) { 1 } else { 0 }
}.let { branch ->
branch.onValue(1)
.npcl("Of course, you knew that already.")
.playerl("So where can I fish lava eels?")
.npcl("Taverley dungeon or the lava maze in the Wilderness.")
.end()
branch.onValue(0)
.npcl("You know... thinking about it... I may have a jar of blamish slime around here somewhere. Now where did I put it?")
.linel("Gerrant searches around a bit.")
.betweenStage { df, player, _, _ ->
addItemOrDrop(player, Items.BLAMISH_SNAIL_SLIME_1581)
}
.npcl("Aha! Here it is! Take this slime, mix it with some Harralander and water and you'll have the blamish oil you need to treat your fishing rod.")
.end()
}
}
}
}

View file

@ -0,0 +1,58 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.node.entity.Entity
import core.game.node.entity.combat.CombatStyle
import core.game.node.entity.npc.NPC
import core.game.node.entity.npc.NPCBehavior
import core.game.node.entity.player.Player
import core.game.node.item.GroundItem
import core.game.node.item.GroundItemManager
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
class GripBehavior : NPCBehavior(NPCs.GRIP_792) {
// Attacking Grip
override fun canBeAttackedBy(self: NPC, attacker: Entity, style: CombatStyle, shouldSendMessage: Boolean): Boolean {
// You cannot attack if you are a black arm gang member.
if (attacker is Player && HeroesQuest.isBlackArm(attacker)) {
openDialogue(attacker, object : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (stage) {
//"I can't attack the head guard here! There are too", "many witnesses around to see me do it! I'd have the", "whole of Brimhaven after me! Besides, if he dies I want", "the promotion!"
START_DIALOGUE -> sendPlayerDialogue(attacker, "I can't attack the head guard here! There are too many witnesses around to see me do it! I'd have the whole of Brimhaven after me! Besides, if he dies I want the promotion!") .also { stage++ }
1 -> sendDialogueLines(attacker, "Perhaps you need another player's help...?").also {
stage = END_DIALOGUE
}
}
}
})
return false
}
return true
}
override fun onDeathFinished(self: NPC, killer: Entity) {
if (killer is Player) {
if (getQuestStage(killer, HeroesQuest.questName) == 4) {
setQuestStage(killer, HeroesQuest.questName, 5)
}
val gi = GroundItem(
Item(Items.GRIPS_KEY_RING_1588),
self.location,
5000,
null,
)
gi.forceVisible = true
gi.isRemainPrivate = false
val gim = GroundItemManager.create(gi)
gim.isRemainPrivate = false
}
}
}

View file

@ -0,0 +1,118 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import core.api.*
import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile
import core.game.dialogue.DialoguePlugin
import core.game.node.entity.player.Player
import core.plugin.Initializable
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class GripDialogue(player: Player? = null) : DialoguePlugin(player){
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, GripDialogueFile(), npc)
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return GripDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.GRIP_792)
}
}
class GripDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onPredicate { _ -> true }
.branch { player ->
return@branch if (getAttribute(player, HeroesQuest.attributeGripTookPapers, false)) { 1 } else { 0 }
}.let { branch ->
val continuePath = b.placeholder()
branch.onValue(1)
.goto(continuePath)
branch.onValue(0)
.playerl("Hi there. I am Hartigen, reporting for duty as your new deputy sir!")
.npcl("Ah good, at last. You took your time getting here! Now let me see...")
.npcl("I'll get your hours and duty roster sorted out in a while. Oh, and do you have your I.D. papers with you? Internal security is almost as important as external security for a guard.")
.branch { player ->
return@branch if (inInventory(player, Items.ID_PAPERS_1584)) { 1 } else { 0 }
}.let { branch ->
val continuePath2 = b.placeholder()
branch.onValue(1)
.playerl("Right here sir!")
.linel("You hand the ID papers over to Grip.")
.betweenStage { df, player, _, _ ->
if (removeItem(player, Items.ID_PAPERS_1584)) {
setAttribute(player, HeroesQuest.attributeGripTookPapers, true)
}
}
.goto(continuePath2)
branch.onValue(0)
.playerl("Oh, dear. I don't have that with me any more.")
.npcl("Well, that's no good! Go get them immediately, then report back for duty.")
.end()
return@let continuePath2.builder()
}
.goto(continuePath)
return@let continuePath.builder()
}
.options()
.let { optionBuilder ->
val returnJoin = b.placeholder()
optionBuilder.option_playerl("So can I please guard the treasure room please?")
.npcl("Well, I might post you outside it sometimes. I prefer to be the only one allowed inside however.")
.npcl("There's some pretty valuable artefacts in there! Those keys stay ONLY with the head guard and Scarface Pete.")
.goto(returnJoin)
optionBuilder.optionIf("So what do my duties involve?") { player ->
return@optionIf !getAttribute(player, HeroesQuest.attributeGripSaidDuties, false)
}
.betweenStage { _, player, _, _ ->
setAttribute(player, HeroesQuest.attributeGripSaidDuties, true)
}
.playerl("So what do my duties involve?")
.npcl("You'll have various guard related duties on various shifts. I'll assign specific duties as they are required as and when they become necessary. Just so you know, if anything happens to me")
.npcl("you'll need to take over as head guard here. You'll find important keys to the treasure room and Pete's quarters inside my jacket - although I doubt anything bad's going to happen to")
.npcl("me anytime soon!")
.linel("Grip laughs to himself at the thought.")
.goto(returnJoin)
optionBuilder.option_playerl("Well, I'd better sort my new room out.")
.npcl("Yeah, I'll give you time to settle in. Better get a good night's sleep, I expect you to report for duty at oh five hundred hours tomorrow on the dot!")
.end()
optionBuilder.optionIf("Anything I can do now?") { player ->
return@optionIf getAttribute(player, HeroesQuest.attributeGripSaidDuties, false)
}
.playerl("Anything I can do now?")
.branch { player ->
return@branch if (inInventory(player, Items.MISCELLANEOUS_KEY_1586)) {
1
} else {
0
}
}.let { branch ->
branch.onValue(1)
.npcl("Can't think of anything right now.")
.end()
branch.onValue(0)
.npcl("Hmm. Well, you could find out what this key opens for me. Apparently it's for something in this building, but for the life of me I can't find what.")
.linel("Grip hands you a key.")
.endWith { _, player ->
addItemOrDrop(player, Items.MISCELLANEOUS_KEY_1586)
}
}
returnJoin.builder()
}
}
}

View file

@ -0,0 +1,84 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import core.api.*
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
@Initializable
class GruborDialogue (player: Player? = null) : DialoguePlugin(player) {
override fun newInstance(player: Player): DialoguePlugin {
return GruborDialogue(player)
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, GruborDialogueFile(), npc)
return false
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.GRUBOR_789)
}
}
class GruborDialogueFile : DialogueBuilderFile() {
override fun create(b: DialogueBuilder) {
b.onPredicate { player -> getQuestStage(player, HeroesQuest.questName) >= 2 &&
getAttribute(player, HeroesQuest.attributeGruborLetsYouIn, false) &&
HeroesQuest.isBlackArm(player)
}
.playerl("Hi.")
.npcl("Hi, I'm a little busy right now.")
.end()
b.onPredicate { player -> getQuestStage(player, HeroesQuest.questName) >= 2 &&
!getAttribute(player, HeroesQuest.attributeGruborLetsYouIn, false) &&
HeroesQuest.isBlackArm(player)
}
.npcl(FacialExpression.THINKING, "Yes? What do you want?")
.options()
.let { optionBuilder ->
optionBuilder.option_playerl("Rabbit's foot.")
.npcl("Eh? What are you on about? Go away!")
.end()
optionBuilder.option_playerl("Four leaved clover.")
.npcl("Oh you're one of the gang are you? Ok, hold up a second, I'll just let you in through here.")
.linel("You hear the door being unbarred from inside.")
.endWith { _, player ->
setAttribute(player, HeroesQuest.attributeGruborLetsYouIn, true)
}
optionBuilder.option_playerl("Lucky horseshoe.")
.npcl("Eh? What are you on about? Go away!")
.end()
optionBuilder.option_playerl("Black cat.")
.npcl("Eh? What are you on about? Go away!")
.end()
}
b.onPredicate { _ -> true }
.npcl(FacialExpression.THINKING, "Yes? What do you want?")
.options()
.let { optionBuilder ->
optionBuilder.option_playerl("Would you like your hedges trimming?")
.npcl("Eh? Don't be daft! We don't even HAVE any hedges!")
.end()
optionBuilder.option_playerl("I want to come in.")
.npcl("No, go away.")
.end()
optionBuilder.option_playerl("Do you want to trade?")
.npcl("No, I'm busy.")
.end()
}
}
}

View file

@ -0,0 +1,262 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import content.region.misthalin.varrock.quest.shieldofarrav.ShieldofArrav
import core.api.*
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.quest.Quest
import core.game.node.entity.skill.Skills
import core.plugin.Initializable
import org.rs09.consts.Items
/**
* Heroes' Quest
*/
@Initializable
class HeroesQuest : Quest("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
*
* PHOENIX
* 2 - Talked to Katrine
* 3 - Talked to Alfonse
* 4 - Talked to Charlie
* 5 - HIDDEN Killed Grip (You need key from Black Arm Friend)
* 6 - Talked to Katrine with Candlestick
* BLACK ARM
* 2 - Talked to Straven
* 3 - Talked to Trobert
* 4 - Talked to Garv
* 5 - HIDDEN Unlocked Chest (You need Grip killed from Phoenix Friend)
* 6 - Talked to Katrine with Candlestick
*
* 100 - Achiettes with all the items
*/
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"
const val attributeHasOpenedBackdoor = "/save:quest:heroesquest-hasopenedbackdoor"
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") &&
getQuestPoints(player) >= 55
}
/** Abstraction of Shield of Arrav isPhoenix function */
fun isPhoenix(player: Player): Boolean {
return ShieldofArrav.isPhoenix(player)
}
/** Abstraction of Shield of Arrav isBlackArm function */
fun isBlackArm(player: Player): Boolean {
return ShieldofArrav.isBlackArm(player)
}
fun hasRequirements(player: Player): Boolean {
return arrayOf(
hasLevelStat(player, Skills.HERBLORE, 25),
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"),
getQuestPoints(player) >= 55,
).all { it }
}
fun allItemsInInventory(player: Player): Boolean {
return inInventory(player, Items.FIRE_FEATHER_1583) &&
inInventory(player, Items.LAVA_EEL_2149) &&
inInventory(player, Items.THIEVES_ARMBAND_1579)
}
}
override fun drawJournal(player: Player?, stage: Int) {
super.drawJournal(player, stage)
var line = 12
var stage = getStage(player)
var started = getQuestStage(player!!, questName) > 0
if(!started){
if (checkQuestsAreComplete(player)) {
line(player, "I can start this quest by speaking to !!Achietties?? at the", line++)
line(player, "!!Heroes' Guild?? located !!North?? of !!Taverly??", line++)
line(player, "as all required quests are complete, and I have enough QP.", line++)
} 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, "!!and gaining 55 Quest Points??", line++, getQuestPoints(player) >= 55)
}
line(player, "To complete this quest I need:", line++, false)
line(player, "!!Level 25 Herblore??", line++, hasLevelStat(player, Skills.HERBLORE, 25))
line(player, "!!Level 50 Mining??", line++, hasLevelStat(player, Skills.MINING, 50))
line(player, "!!Level 53 Fishing??", line++, hasLevelStat(player, Skills.FISHING, 53))
line(player, "!!Level 53 Cooking??", line++, hasLevelStat(player, Skills.COOKING, 53))
} else if (stage < 100) {
line(player, "!!Achietties?? will let me into the !!Heroes' Guild?? if I can get:", line++)
// This is completely dependent on what you have in your inventory.
if (inInventory(player, Items.FIRE_FEATHER_1583)) {
line(player, "An Entranan Firebird Feather - I now have one on me!", line++, true)
} else {
line(player, "An !!Entranan Firebird Feather?? - I should check on !!Entrana??", line++)
}
// This is completely dependent on what you have in your inventory.
if (inInventory(player, Items.LAVA_EEL_2149)) {
line(player, "A cooked lava eel - I now have one on me!", line++, true)
} else {
line(player, "A !!cooked lava eel?? - I should speak to a !!Fishing Expert??", line++)
}
if (isPhoenix(player)) {
if (inInventory(player, Items.THIEVES_ARMBAND_1579)) {
line(player, "A Master Thieves Armband - I now have one on me!", line++, true)
} else {
line(player, "A !!Master Thieves Armband?? - the !!Phoenix Gang can help me??", line++)
}
if (!inInventory(player, Items.THIEVES_ARMBAND_1579)) {
if (stage >= 2) {
line(player, "I spoke to Straven about the Master Thieves Armband.", line++, true)
}
if (stage >= 3) {
line(player, "Then I told Alfonse the password 'Gherkin'.", line++, true)
} else if (stage >= 2) {
line(player, "He told me I can get one by stealing !!Pete's Candlestick??", line++)
line(player, "I should use the password he gave me at !!Brimhaven??", line++)
}
if (stage >= 4) {
line(player, "Charlie told me about a secret door into Scarface Pete's", line++, true)
line(player, "hideout, but he couldn't find a way of getting through it.", line++, true)
} else if (stage >= 3) {
line(player, "He said, secretly speak to !!Charlie?? round the back.", line++)
}
if (stage >= 6) {
line(player, "A rival gang member collected a candlestick for me after I", line++, true)
line(player, "killed Grip and got the Treasure Room key for them.", line++, true)
line(player, "I gave Straven Scarface Pete's candlestick, and in reward", line++, true)
line(player, "he gave me a Master Thieves Armband to prove my skills.", line++, true)
} else if (stage >= 4) {
line(player, "Maybe !!another player?? can help to get through this !!door???.", line++)
}
}
}
if (isBlackArm(player)) {
if (inInventory(player, Items.THIEVES_ARMBAND_1579)) {
line(player, "A Master Thieves Armband - I now have one on me!", line++, true)
} else {
line(player, "A !!Master Thieves Armband?? - the !!Black Arms can help me??", line++)
}
if (!inInventory(player, Items.THIEVES_ARMBAND_1579)) {
if (stage >= 2) {
line(player, "I spoke to Katrine about the Master Thieves Armband.", line++, true)
}
if (stage >= 3) {
line(player, "I used the Black Arm password to enter the Brimhaven HQ.", line++, true)
} else if (stage >= 2) {
line(player, "She told me I can get one by stealing !!Pete's Candlestick??", line++)
line(player, "I should use the password she gave me at !!Brimhaven??", line++)
}
if (stage >= 4) {
line(player, "I managed to pass myself off as Hartigen and enter the", line++, true)
line(player, "HQ.", line++, true)
} else if (stage >= 3) {
line(player, "I need to disguise myself as !!Hartigen the Black Knight?? in", line++)
line(player, "order to get inside !!Scarface Pete's hideout??", line++)
}
if (stage >= 6) {
line(player, "I collected the candlesticks with the Treasure Room key", line++, true)
line(player, "after a rival gang member killed Grip.", line++, true)
line(player, "I gave Katrine Scarface Pete's candlestick, and in reward", line++, true)
line(player, "she gave me a Master Thieves Armband to prove my skills.", line++, true)
} else if (stage >= 4) {
line(player, "I can move around the hideout, but now I need Grips keys", line++)
line(player, "to get into the treasure room and get the candlesticks.", line++)
line(player, "I need !!another player's help?? with this, as it's so risky.", line++)
}
}
}
if (allItemsInInventory(player)) {
line(player, "Now that I have !!all the required items??, I should go and speak to", line++)
line(player, "!!Achietties?? and give them to her", line++)
}
} else {
// Everything above is replaced by this.
line(player, "I gave Achietties an Entranan Firebird Feather, A cooked", line++, true)
line(player, "lava eel from a dangerous fishing spot and after some", line++, true)
line(player, "difficulty, a Master Thief Armband.", line++, true)
line(player, "Once I had handed these over to Achietties I had proved", line++, true)
line(player, "myself worthy of entrance to the Heroes' Guild.", line++, true)
line++
line++
line(player,"<col=FF0000>QUEST COMPLETE!</col>", line)
}
}
override fun reset(player: Player) {
if (getQuestStage(player, questName) == 0) {
removeAttribute(player, attributeGruborLetsYouIn)
removeAttribute(player, attributeGripTookPapers)
removeAttribute(player, attributeGripSaidDuties)
removeAttribute(player, attributeHasOpenedBackdoor)
removeAttribute(player, attributeHasOpenedChestDoor)
// For testing: if you set quest stage to 0, it will switch your gang (blackarm <-> phoenix)
// Remember to set stage to 0 twice to keep your gang.
println("Swapping gang for Heroes Quest.")
ShieldofArrav.swapGang(player)
}
}
override fun finish(player: Player) {
var ln = 10
super.finish(player)
player.packetDispatch.sendString("You have completed the Heroes Quest!", 277, 4)
player.packetDispatch.sendItemZoomOnInterface(Items.DRAGON_BATTLEAXE_1377, 240, 277, 5)
drawReward(player,"1 Quest Point", ln++)
drawReward(player,"Access to the Heroes' Guild", ln++)
drawReward(player,"A total of 29,232 XP spread", ln++)
drawReward(player,"over twelve skills", ln++)
rewardXP(player, Skills.ATTACK, 3075.0)
rewardXP(player, Skills.DEFENCE, 3075.0)
rewardXP(player, Skills.STRENGTH, 3075.0)
rewardXP(player, Skills.HITPOINTS, 3075.0)
rewardXP(player, Skills.RANGE, 2075.0)
rewardXP(player, Skills.FISHING, 2725.0)
rewardXP(player, Skills.COOKING, 2825.0)
rewardXP(player, Skills.WOODCUTTING, 1575.0)
rewardXP(player, Skills.FIREMAKING, 1575.0)
rewardXP(player, Skills.SMITHING, 2725.0)
rewardXP(player, Skills.MINING, 2575.0)
rewardXP(player, Skills.HERBLORE, 1325.0)
}
override fun newInstance(`object`: Any?): Quest {
return this
}
}

View file

@ -0,0 +1,154 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic
import core.game.global.action.DoorActionHandler
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.combat.ImpactHandler
import core.game.node.entity.npc.NPC
import core.game.node.item.GroundItem
import core.game.world.map.Location
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import org.rs09.consts.Scenery
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 &&
getAttribute(player, HeroesQuest.attributeGruborLetsYouIn, false) &&
HeroesQuest.isBlackArm(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, GruborDialogueFile(), NPC(NPCs.GRUBOR_789))
}
return@on true
}
// Kitchen entrance
on(Scenery.DOOR_2628, IntType.SCENERY, "open") { player, node ->
if (getQuestStage(player, HeroesQuest.questName) >= 3 && HeroesQuest.isPhoenix(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
sendDialogue(player, "This door is locked.")
}
return@on true
}
// Kitchen wall
on(Scenery.WALL_2629, IntType.SCENERY, "push") { player, node ->
if (getQuestStage(player, HeroesQuest.questName) >= 4 && HeroesQuest.isPhoenix(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, CharlieTheCookDialogueFile(), NPC(NPCs.CHARLIE_THE_COOK_794))
}
return@on true
}
// Mansion frontdoor
on(Scenery.DOOR_2627, IntType.SCENERY, "open") { player, node ->
if (getQuestStage(player, HeroesQuest.questName) >= 4 && HeroesQuest.isBlackArm(player)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
openDialogue(player, GarvDialogueFile(), NPC(NPCs.GARV_788))
}
return@on true
}
// Cupboard
on(Scenery.CUPBOARD_2636, IntType.SCENERY, "search") { player, node ->
openDialogue(player, object : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (stage) {
START_DIALOGUE -> sendNPCDialogue(player, NPCs.PIRATE_GUARD_799, "I don't think Mr Grip will like you opening that. That's his private drinks cabinet.") .also { stage++ }
1 -> showTopics(
Topic(FacialExpression.NEUTRAL, "He won't notice me having a quick look.", 2),
Topic(FacialExpression.NEUTRAL, "Ok, I'll leave it.", END_DIALOGUE)
)
2 -> end().also {
val gripNpc = findNPC(NPCs.GRIP_792)
sendChat(gripNpc!!, "Stay out of my drinks cabinet!")
forceWalk(gripNpc, Location(2777, 3198, 0), "smart")
}
}
}
})
return@on true
}
// Mansion backdoor
on(Scenery.DOOR_2622, IntType.SCENERY, "open") { player, node ->
if (getAttribute(player, HeroesQuest.attributeHasOpenedBackdoor, false)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
sendDialogue(player, "This door is locked.")
}
return@on true
}
onUseWith(IntType.SCENERY, Items.MISCELLANEOUS_KEY_1586, Scenery.DOOR_2622) { player, used, with ->
setAttribute(player, HeroesQuest.attributeHasOpenedBackdoor, true)
DoorActionHandler.handleAutowalkDoor(player, with.asScenery())
return@onUseWith true
}
// Chest door
on(Scenery.DOOR_2621, IntType.SCENERY, "open") { player, node ->
if (getAttribute(player, HeroesQuest.attributeHasOpenedChestDoor, false)) {
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
} else {
sendDialogue(player, "This door is locked.")
}
return@on true
}
onUseWith(IntType.SCENERY, Items.GRIPS_KEY_RING_1588, Scenery.DOOR_2621) { player, used, with ->
setAttribute(player, HeroesQuest.attributeHasOpenedChestDoor, true)
DoorActionHandler.handleAutowalkDoor(player, with.asScenery())
return@onUseWith true
}
// Chest
on(Scenery.CHEST_2632, IntType.SCENERY, "open"){ player, node ->
replaceScenery(node as core.game.node.scenery.Scenery, Scenery.CHEST_2633, -1)
return@on true
}
on(Scenery.CHEST_2633, IntType.SCENERY, "close"){ player, node ->
replaceScenery(node as core.game.node.scenery.Scenery, Scenery.CHEST_2632, -1)
return@on true
}
on(Scenery.CHEST_2633, IntType.SCENERY, "search"){ player, node ->
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)
}
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)
}
return@on true
}
//
on(Items.FIRE_FEATHER_1583, IntType.GROUNDITEM, "take") { player, groundItem ->
if (inEquipment(player, Items.ICE_GLOVES_1580)) {
addItem(player, Items.FIRE_FEATHER_1583)
removeGroundItem(groundItem as GroundItem)
} else {
sendChat(player, "Ouch!")
player.impactHandler.manualHit(player, 9, ImpactHandler.HitsplatType.NORMAL)
sendMessage(player, "It is too hot to take. You need something cold to pick it up with.")
}
return@on true
}
// OilFishingRodListener.kt + DrinkBlamishOilListener.kt + FinishedPotion.java
}
}

View file

@ -0,0 +1,126 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import core.api.*
import core.game.dialogue.*
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)
.playerl("Hey.")
.npcl("Hey.")
.options()
.let { optionBuilder ->
optionBuilder.option_playerl("Who are all those people in there?")
.npcl("They're just various rogues and thieves.")
.playerl("They don't say a lot...")
.npcl("Nope.")
.end()
optionBuilder.option_playerl("Is there any way I can get the rank of master thief?")
.npcl("Master thief? Ain't we the ambitious one!")
.npcl("Well, you're gonna have to do something pretty amazing.")
.playerl("Anything you can suggest?")
.npcl("Well, some of the MOST coveted prizes in thiefdom right now are in the pirate town of Brimhaven on Karamja.")
.npcl("The pirate leader Scarface Pete has a pair of extremely valuable candlesticks.")
.npcl("His security is VERY good.")
.npcl("We, of course, have gang members in a town like Brimhaven who may be able to help you.")
.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)
}
}
}
// 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)
.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.")
.npcl("The pirate leader Scarface Pete has a pair of extremely valuable candlesticks.")
.npcl("His security is VERY good.")
.npcl("We, of course, have gang members in a town like Brimhaven who may be able to help you.")
.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'.")
.end()
// As FYI, the fallback for 2,3,4 is
/**
* .options()
* .let { optionBuilder ->
* optionBuilder.option_playerl("Who are all those people in there?")
* .npcl("They're just various rogues and thieves.")
* .playerl("They don't say a lot...")
* .npcl("Nope.")
* .end()
* optionBuilder.option("Teach me to be a top class criminal!")
* .playerl("Teach me to be a top class criminal.")
* .npcl("Teach yourself.")
* .end()
*
*
*
* Player:
* I have a candlestick now!
* Katrine:
* Good for you. I'll give a master thief's armband to the one who retrieved that. I know it wasn't you.
*/
b.onQuestStages(HeroesQuest.questName, 5)
.branch { player ->
return@branch if (inInventory(player, Items.PETES_CANDLESTICK_1577)) { 1 } else { 0 }
}.let { branch ->
branch.onValue(1)
.options()
.let { optionBuilder ->
optionBuilder.option_playerl("Who are all those people in there?")
.npcl("They're just various rogues and thieves.")
.playerl("They don't say a lot...")
.npcl("Nope.")
.end()
optionBuilder.option("I have a candlestick now.")
.playerl("I have a candlestick now!")
.npcl("Wow... is... it REALLY it?")
.npcl("This really is a FINE bit of thievery.")
.npcl("Us thieves have been trying to get hold of this one for a while!")
.npc("You wanted to be ranked as a master thief didn't you?", "Well, I guess this just about ranks as good enough!")
.linel("Katrine gives you a master thief armband.")
.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)
}
}
}
branch.onValue(0)
.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.")
.npcl("The pirate leader Scarface Pete keeps an extremely valuable candlesticks.")
.npcl("His security is VERY good.")
.npcl("We, of course, have gang members in a town like Brimhaven who may be able to help you.")
.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'.")
.end()
}
}
// I lost the armband and some stupid default shit.
b.onQuestStages(HeroesQuest.questName, 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 ->
addItemOrDrop(player, Items.THIEVES_ARMBAND_1579)
}
}
}

View file

@ -0,0 +1,72 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import core.api.*
import core.game.dialogue.*
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)
.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.")
.npcl("His security is excellent, and the target very valuable so that might be enough to get you the rank.")
.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)
}
}
b.onQuestStages(HeroesQuest.questName, 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.")
.npcl("His security is excellent, and the target very valuable so that might be enough to get you the rank.")
.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.")
.end()
b.onQuestStages(HeroesQuest.questName, 5)
.branch { player ->
return@branch if (inInventory(player, Items.PETES_CANDLESTICK_1577)) { 1 } else { 0 }
}.let { branch ->
branch.onValue(1)
.playerl("I have retrieved a candlestick!")
.npcl("Hmmm. Not bad, not bad. Let's see it, make sure it's genuine.")
.linel("You hand Straven the candlestick.")
.playerl("So is this enough to get me a Master Thief armband?")
.npcl("Hmm... I dunno... Aww, go on then. I suppose I'm in a generous mood today.")
.linel("Straven hands you a Master Thief armband.")
.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)
}
}
}
branch.onValue(0)
.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.")
.npcl("His security is excellent, and the target very valuable so that might be enough to get you the rank.")
.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.")
.end()
}
// I lost the armband and some stupid default shit.
b.onQuestStages(HeroesQuest.questName, 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 ->
addItemOrDrop(player, Items.THIEVES_ARMBAND_1579)
}
}
}

View file

@ -0,0 +1,91 @@
package content.region.asgarnia.burthorpe.quest.heroesquest
import core.api.*
import core.game.dialogue.*
import core.game.node.entity.player.Player
import core.plugin.Initializable
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class TrobertDialogue(player: Player? = null) : DialoguePlugin(player){
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
openDialogue(player, TrobertDialogueFile(), npc)
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return TrobertDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.TROBERT_1884)
}
}
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)
.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)
.npcl("Welcome to our Brimhaven headquarters. I'm Trobert and I'm in charge here.")
.options()
.let { optionBuilder ->
val continuePath = b.placeholder()
optionBuilder.option("So can you help me get Scarface Pete's candlesticks?")
.goto(continuePath)
optionBuilder.option_playerl("Pleased to meet you.")
.npcl("Likewise.")
.goto(continuePath)
return@let continuePath.builder()
}
.playerl("So can you help me get Scarface Pete's candlesticks?")
.npcl("Well, we have made some progress there. We know that one of the only keys to Pete's treasure room is carried by Grip, the head guard, so we thought it might be good to get close to him somehow.")
.npcl("Grip was taking on a new deputy called Hartigen, an Asgarnian Black Knight who was deserting the Black Knight Fortress and seeking new employment here on Brimhaven.")
.npcl("We managed to waylay him on the journey here, and steal his I.D. papers. Now all we need is to find somebody willing to impersonate him and take the deputy role to get that key for us.")
.options()
.let { optionBuilder ->
optionBuilder.option_playerl("I volunteer to undertake that mission!")
.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)
}
}
optionBuilder.option_playerl("Well, good luck then.")
.npcl("Someone will show up eventually.")
.end()
}
b.onQuestStages(HeroesQuest.questName, 3,4,5)
.branch { player ->
return@branch if (inInventory(player, Items.ID_PAPERS_1584)) { 1 } else { 0 }
}.let { branch ->
branch.onValue(1)
.npcl("How's it going?")
.playerl("Fine, thanks.")
.end()
branch.onValue(0)
.playerl("I have lost Hartigen's ID papers.")
.npcl("Well, that was careless of you, wasn't it? Fortunately for you, he had a spare. Take this one, but please try to be more careful with this one.")
.endWith { _, player ->
addItemOrDrop(player, Items.ID_PAPERS_1584)
}
}
b.onQuestStages(HeroesQuest.questName, 6,100)
.npcl("How's it going?")
.playerl("Fine, thanks.")
.end()
}
}

View file

@ -1,82 +0,0 @@
package content.region.asgarnia.portsarim.dialogue;
import core.game.dialogue.DialoguePlugin;
import core.game.dialogue.FacialExpression;
import core.game.node.entity.npc.NPC;
import core.plugin.Initializable;
import core.game.node.entity.player.Player;
/**
* Represents the dialogue plugin used for the gerrant npc.
* @author 'Vexia
* @version 1.0
*/
@Initializable
public final class GerrantDialogue extends DialoguePlugin {
/**
* Constructs a new {@code GerrantDialogue} {@code Object}.
*/
public GerrantDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code GerrantDialogue} {@code Object}.
* @param player the player.
*/
public GerrantDialogue(Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new GerrantDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
interpreter.sendDialogues(npc, FacialExpression.HAPPY, "Welcome! You can buy fishing equipment at my store.", "We'll also buy anything you catch off you.");
stage = 0;
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
interpreter.sendOptions("Choose an option:", "Let's see what you've got then.", "Sorry, I'm not interested.");
stage = 1;
break;
case 1:
switch (buttonId) {
case 1:
interpreter.sendDialogues(player, FacialExpression.HAPPY, "Let's see what you've got then.");
stage = 10;
break;
case 2:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Sorry, I'm not interested.");
stage = 20;
break;
}
break;
case 10:
end();
npc.openShop(player);
break;
case 20:
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 558 };
}
}

View file

@ -1,92 +0,0 @@
package content.region.karamja.brimhaven.dialogue;
import core.game.dialogue.DialoguePlugin;
import core.game.dialogue.FacialExpression;
import core.game.node.entity.npc.NPC;
import core.plugin.Initializable;
import core.game.node.entity.player.Player;
/**
* Represents the dialogue plugin for the npc alfonse the waiter.
* @author 'Vexia
* @version 1.0
*/
@Initializable
public final class AlfonseWaiterDialogue extends DialoguePlugin {
/**
* Constructs a new {@code AlfonseWaiterDialogue} {@code Object}.
*/
public AlfonseWaiterDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code AlfonseWaiterDialogue} {@code Object}.
* @param player the player.
*/
public AlfonseWaiterDialogue(Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new AlfonseWaiterDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Welcome to the Shrimp and Parrot.", "Would you like to order, sir?");
stage = 0;
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
interpreter.sendOptions("Select an Option", "Yes, please.", "No, thank you.", "Where do you get your Karambwan from?");
stage = 1;
break;
case 1:
switch (buttonId) {
case 1:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Yes, please.");
stage = 10;
break;
case 2:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No, thank you.");
stage = 20;
break;
case 3:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Where do you get your Karambwan from?");
stage = 30;
break;
}
break;
case 10:
end();
npc.openShop(player);
break;
case 20:
end();
break;
case 30:
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "We buy directly off Lubufu, a local fisherman. He", "seems to have a monopoly over Karambwan sales.");
stage = 31;
break;
case 31:
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 793 };
}
}

View file

@ -1,88 +0,0 @@
package content.region.karamja.brimhaven.dialogue;
import core.game.dialogue.DialoguePlugin;
import core.game.dialogue.FacialExpression;
import core.game.node.entity.npc.NPC;
import core.plugin.Initializable;
import core.game.node.entity.player.Player;
/**
* Represents the garv dialogue plugin.
* @author 'Vexia
* @version 1.0
*/
@Initializable
public final class GarvDialogue extends DialoguePlugin {
/**
* Constructs a new {@code GarvDialogue} {@code Object}.
*/
public GarvDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code GarvDialogue} {@code Object}.
* @param player the player.
*/
public GarvDialogue(Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new GarvDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hello. What do you want?");
stage = 0;
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
interpreter.sendOptions("Select an Option", "Can I go in there?", "I want for nothing!");
stage = 1;
break;
case 1:
switch (buttonId) {
case 1:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Can I go in there?");
stage = 10;
break;
case 2:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I want for nothing!");
stage = 20;
break;
}
break;
case 10:
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "No. In there is private.");
stage = 11;
break;
case 11:
end();
break;
case 20:
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You're one of a very lucky few then.");
stage = 21;
break;
case 21:
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 788 };
}
}

View file

@ -1,99 +0,0 @@
package content.region.karamja.brimhaven.dialogue;
import core.game.dialogue.DialoguePlugin;
import core.game.dialogue.FacialExpression;
import core.game.node.entity.npc.NPC;
import core.plugin.Initializable;
import core.game.node.entity.player.Player;
/**
* Represents the grubor dialogue plugin.
* @author 'Vexia
* @version 1.0
*/
@Initializable
public final class GruborDialogue extends DialoguePlugin {
/**
* Constructs a new {@code GruborDialogue} {@code Object}.
*/
public GruborDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code GruborDialogue} {@code Object}.
* @param player the player.
*/
public GruborDialogue(Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new GruborDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Yes? What do you want?");
stage = 0;
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
interpreter.sendOptions("Select an Option", "Would you like your hedges trimming?", "I want to come in.", "Do you want to trade?");
stage = 1;
break;
case 1:
switch (buttonId) {
case 1:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Would you like your hedges trimming?");
stage = 10;
break;
case 2:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I want to come in.");
stage = 20;
break;
case 3:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Do you want to trade?");
stage = 30;
break;
}
break;
case 10:
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Eh? Don't be daft! We don't even HAVE any hehdges!");
stage = 11;
break;
case 11:
end();
break;
case 20:
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "No, go away.");
stage = 21;
break;
case 21:
end();
break;
case 30:
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "No, I'm busy.");
stage = 31;
break;
case 31:
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 789 };
}
}

View file

@ -44,21 +44,6 @@ class BrimhavenListeners : InteractionListener {
*/ */
private const val RESTAURANT_REAR_DOOR = Scenery.DOOR_1591 private const val RESTAURANT_REAR_DOOR = Scenery.DOOR_1591
/**
* Represents the door of the Black Arm Gang office used in the Heroes' Quest.
*/
private const val GANG_OFFICE_DOOR = Scenery.DOOR_2626
/**
* Represents the door guarded by Garv on ScarFace Pete's mansion used in the Heroes' Quest.
*/
private const val MANSION_DOOR = Scenery.DOOR_2627
/**
* Represents the kitchen door in the Shrimp and Parrot restaurant used in the Heroes' Quest.
*/
private const val RESTAURANT_KITCHEN_DOOR = Scenery.DOOR_2628
/** /**
* Represents Lubufu's karambwan fishing spot unlocked in Tai Bwo Wannai Trio. * Represents Lubufu's karambwan fishing spot unlocked in Tai Bwo Wannai Trio.
*/ */
@ -108,21 +93,6 @@ class BrimhavenListeners : InteractionListener {
return@on true return@on true
} }
on(GANG_OFFICE_DOOR, IntType.SCENERY, "open") { player, _ ->
openDialogue(player, 789, Repository.findNPC(789)!!)
return@on true
}
on(MANSION_DOOR, IntType.SCENERY, "open") { player, _ ->
openDialogue(player, 788, Repository.findNPC(788)!!, true)
return@on true
}
on(RESTAURANT_KITCHEN_DOOR, IntType.SCENERY, "open") { player, _ ->
sendMessage(player, "The door is securely closed.")
return@on true
}
on(KARAMBWAN_FISHING_SPOT, IntType.NPC, "fish") { player, _ -> on(KARAMBWAN_FISHING_SPOT, IntType.NPC, "fish") { player, _ ->
sendNPCDialogue( sendNPCDialogue(
player, player,

View file

@ -1,11 +1,14 @@
package content.region.misthalin.varrock.quest.shieldofarrav; package content.region.misthalin.varrock.quest.shieldofarrav;
import content.region.asgarnia.burthorpe.quest.heroesquest.KatrineDialogueFile;
import core.game.dialogue.DialoguePlugin; import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.npc.NPC; import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player; import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest; import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.Item; import core.game.node.item.Item;
import static core.api.ContentAPIKt.openDialogue;
/** /**
* Represents the katrine NPC dialogue. * Represents the katrine NPC dialogue.
* @author 'Vexia * @author 'Vexia
@ -50,9 +53,17 @@ public final class KatrineDialogue extends DialoguePlugin {
npc = (NPC) args[0]; npc = (NPC) args[0];
quest = player.getQuestRepository().getQuest("Shield of Arrav"); quest = player.getQuestRepository().getQuest("Shield of Arrav");
switch (quest.getStage(player)) { switch (quest.getStage(player)) {
case 80:
case 90:
case 100: case 100:
if (ShieldofArrav.isBlackArm(player)) {
Quest heroesQuest = player.getQuestRepository().getQuest("Heroes' Quest");
if (0 < heroesQuest.getStage(player) && heroesQuest.getStage(player) < 100) {
openDialogue(player, new KatrineDialogueFile(), npc);
break;
}
}
// Continues below if not during the Heroes' Quest
case 90:
case 80:
case 70: case 70:
if (ShieldofArrav.isPhoenix(player)) { if (ShieldofArrav.isPhoenix(player)) {
npc("You've got some guts coming here, Phoenix guy!"); npc("You've got some guts coming here, Phoenix guy!");

View file

@ -225,6 +225,22 @@ public class ShieldofArrav extends Quest {
player.setAttribute("/save:black-arm-gang", true); player.setAttribute("/save:black-arm-gang", true);
} }
/**
* Swaps the gang.
* @param player the player.
*/
public static void swapGang(final Player player) {
if(isPhoenix(player)) {
player.setAttribute("/save:black-arm-gang", true);
player.setAttribute("/save:phoenix-gang", false);
} else if(isBlackArm(player)) {
player.setAttribute("/save:black-arm-gang", false);
player.setAttribute("/save:phoenix-gang", true);
} else {
player.setAttribute("/save:phoenix-gang", true);
}
}
/** /**
* Method used to check if the player is part of the phoenix gang. * Method used to check if the player is part of the phoenix gang.
* @param player the player. * @param player the player.

View file

@ -5,6 +5,9 @@ import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player; import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.quest.Quest; import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.GroundItemManager; import core.game.node.item.GroundItemManager;
import content.region.asgarnia.burthorpe.quest.heroesquest.StravenDialogueFile;
import static core.api.ContentAPIKt.openDialogue;
/** /**
* Represents the dialogue which handles the straven NPC. * Represents the dialogue which handles the straven NPC.
@ -46,6 +49,14 @@ public class StravenDialogue extends DialoguePlugin {
quest = player.getQuestRepository().getQuest("Shield of Arrav"); quest = player.getQuestRepository().getQuest("Shield of Arrav");
switch (quest.getStage(player)) { switch (quest.getStage(player)) {
case 100: case 100:
if (ShieldofArrav.isPhoenix(player)) {
Quest heroesQuest = player.getQuestRepository().getQuest("Heroes' Quest");
if (0 < heroesQuest.getStage(player) && heroesQuest.getStage(player) < 100) {
openDialogue(player, new StravenDialogueFile(), npc);
break;
}
}
// Continues below if not during the Heroes' Quest
case 70: case 70:
if (ShieldofArrav.isPhoenix(player)) { if (ShieldofArrav.isPhoenix(player)) {
npc("Greetings fellow gang member."); npc("Greetings fellow gang member.");

View file

@ -161,7 +161,8 @@ public final class TradeContainer extends Container {
String targetMac = target.getDetails().getMacAddress(); String targetMac = target.getDetails().getMacAddress();
String playerHost = player.getDetails().getCompName(); String playerHost = player.getDetails().getCompName();
String targetHost = target.getDetails().getCompName(); String targetHost = target.getDetails().getCompName();
if (item.getId() == 11174 || item.getId() == 11173 || item.getId() == 759) { // Ironman trading exceptions for Shield of Arrav and Heroes Quest
if (item.getId() == 11174 || item.getId() == 11173 || item.getId() == 759 || item.getId() == 1586 || item.getId() == 1577) {
return true; return true;
} }
if (player.getIronmanManager().isIronman() || target != null && target.getIronmanManager().isIronman()) { if (player.getIronmanManager().isIronman() || target != null && target.getIronmanManager().isIronman()) {