fixed Family Crest bug where Dimintheis would not replace gauntlets if you lost them (fixes #312)
fixed Family Crest bug where Dimintheis would give you infinite gauntlets (fixes #257) fixed Family Crest bug where Dimintheis didn't check equipped gloves or second bank fixed Family Crest bug where Dimintheis didn't remember which gauntlets you had changing gauntlet enchantment now authentically costs 25k GP (and free the first time) added content API function for checking if a player possesses any particular items anywhere added content API functions for starting and finishing quests
This commit is contained in:
+27
-32
@@ -1,10 +1,12 @@
|
||||
package core.game.content.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
import api.*
|
||||
import core.game.content.dialogue.DialoguePlugin
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
|
||||
@Initializable
|
||||
class AvanDialogue (player: Player? = null): DialoguePlugin(player) {
|
||||
@@ -19,8 +21,8 @@ class AvanDialogue (player: Player? = null): DialoguePlugin(player) {
|
||||
npc = (args[0] as NPC).getShownNPC(player)
|
||||
val qstage = player?.questRepository?.getStage("Family Crest") ?: -1
|
||||
|
||||
if(qstage == 100){
|
||||
options("Can you enchant these gauntlets for me?", "Nevermind")
|
||||
if (qstage == 100) {
|
||||
options("Can you change my gauntlets for me?", "Nevermind")
|
||||
stage = 6000
|
||||
return true
|
||||
}
|
||||
@@ -173,42 +175,35 @@ class AvanDialogue (player: Player? = null): DialoguePlugin(player) {
|
||||
"it is a priceless family heirloom.").also{stage = 1000
|
||||
player.inventory.add(CREST_PIECE_AVAN)}
|
||||
|
||||
6000 -> when(buttonId){
|
||||
1-> if(DoMissingGuantletCheck() != -1){
|
||||
var gauntletID = DoMissingGuantletCheck()
|
||||
|
||||
if(gauntletID == 776){
|
||||
npc("You already have the Goldsmith guantlets.")
|
||||
stage = 1000
|
||||
}
|
||||
else{
|
||||
npc("Here you go")
|
||||
player.inventory.remove(Item(gauntletID))
|
||||
player.inventory.add(Item(776))
|
||||
stage = 1000
|
||||
}
|
||||
6000 -> when (buttonId) {
|
||||
1 -> {
|
||||
var freeThisTime = getAttribute(player, "family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778) == Items.FAMILY_GAUNTLETS_778
|
||||
npc("Yes certainly, though it will cost you 25,000 coins" + if (freeThisTime) " next time." else ".").also { stage = 6001 }
|
||||
}
|
||||
else{
|
||||
npc("You do not have the guantlets with you in your inventory")
|
||||
stage = 1000
|
||||
}
|
||||
2-> player("Never mind").also{stage = 1000}
|
||||
2 -> player("Never mind").also{ stage = 1000 }
|
||||
}
|
||||
6001 -> options("Great thanks!", "No that's okay thanks.").also{ stage++ }
|
||||
6002 -> when (buttonId) {
|
||||
1 -> {
|
||||
stage = 1000
|
||||
val givingGauntletsId = Items.GOLDSMITH_GAUNTLETS_776
|
||||
val npcString = SwapGauntletsHelper.swapGauntlets(player, givingGauntletsId)
|
||||
if (npcString == "")
|
||||
{
|
||||
end()
|
||||
}
|
||||
else {
|
||||
npc(npcString)
|
||||
}
|
||||
}
|
||||
2 -> end()
|
||||
}
|
||||
|
||||
1000 -> end()
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
private fun DoMissingGuantletCheck(): Int{
|
||||
var itemsToCheck = listOf(775, 776, 777, 778)
|
||||
for(item in itemsToCheck){
|
||||
if(player.inventory.containItems(item))
|
||||
return item
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(663)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package core.game.content.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
import core.game.content.dialogue.DialoguePlugin
|
||||
import core.game.content.dialogue.FacialExpression
|
||||
@@ -69,4 +69,4 @@ class BootDialogue (player: Player? = null): DialoguePlugin(player){
|
||||
return intArrayOf(665)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+26
-36
@@ -1,10 +1,12 @@
|
||||
package core.game.content.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
import api.*
|
||||
import core.game.content.dialogue.DialoguePlugin
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
|
||||
|
||||
@Initializable
|
||||
@@ -20,8 +22,8 @@ class CalebDialogue (player: Player? = null): DialoguePlugin(player) {
|
||||
npc = (args[0] as NPC).getShownNPC(player)
|
||||
val qstage = player?.questRepository?.getStage("Family Crest") ?: -1
|
||||
|
||||
if(qstage == 100){
|
||||
options("Can you enchant these gauntlets for me?", "Nevermind")
|
||||
if (qstage == 100) {
|
||||
options("Can you change my gauntlets for me?", "Nevermind")
|
||||
stage = 6000
|
||||
return true
|
||||
}
|
||||
@@ -201,51 +203,39 @@ class CalebDialogue (player: Player? = null): DialoguePlugin(player) {
|
||||
player.inventory.add(CREST_PIECE)
|
||||
}
|
||||
406 -> npc("I suggest you be less careless in the future. ",
|
||||
"The crest is extremely valuable, and utterly irreplacable.").also{stage = 1000}
|
||||
"The crest is extremely valuable, and utterly irreplaceable.").also{stage = 1000}
|
||||
|
||||
6000 -> when(buttonId){
|
||||
1-> if(DoMissingGuantletCheck() != -1){
|
||||
var gauntletID = DoMissingGuantletCheck()
|
||||
|
||||
if(gauntletID == 775){
|
||||
npc("You already have the Cooking Guantlets.")
|
||||
stage = 1000
|
||||
}
|
||||
else{
|
||||
npc("Here you go")
|
||||
player.inventory.remove(Item(gauntletID))
|
||||
player.inventory.add(Item(775))
|
||||
stage = 1000
|
||||
}
|
||||
6000 -> when (buttonId) {
|
||||
1 -> {
|
||||
var freeThisTime = getAttribute(player, "family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778) == Items.FAMILY_GAUNTLETS_778
|
||||
npc("Yes certainly, though it will cost you 25,000 coins" + if (freeThisTime) " next time." else ".").also { stage = 6001 }
|
||||
}
|
||||
else{
|
||||
npc("You do not have the guantlets with you in your inventory")
|
||||
2 -> player("Never mind").also{ stage = 1000 }
|
||||
}
|
||||
6001 -> options("Great thanks!", "No that's okay thanks.").also{ stage++ }
|
||||
6002 -> when (buttonId) {
|
||||
1 -> {
|
||||
stage = 1000
|
||||
val givingGauntletsId = Items.COOKING_GAUNTLETS_775
|
||||
val npcString = SwapGauntletsHelper.swapGauntlets(player, givingGauntletsId)
|
||||
if (npcString == "")
|
||||
{
|
||||
end()
|
||||
}
|
||||
else {
|
||||
npc(npcString)
|
||||
}
|
||||
}
|
||||
2-> player("Never mind").also{stage = 1000}
|
||||
2 -> end()
|
||||
}
|
||||
|
||||
1000 -> end()
|
||||
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun DoMissingGuantletCheck(): Int{
|
||||
var itemsToCheck = listOf(775, 776, 777, 778)
|
||||
for(item in itemsToCheck){
|
||||
if(player.inventory.containItems(item))
|
||||
return item
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(666)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@ import core.game.world.map.zone.ZoneBorders
|
||||
import core.game.world.map.zone.ZoneBuilder
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import rs09.game.content.quest.members.familycrest.ChronozonNPC
|
||||
|
||||
|
||||
@Initializable
|
||||
@@ -62,4 +63,4 @@ class ChronozonCaveZone: MapZone("FC ChronozoneZone", true), Plugin<Unit> {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package plugin.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.combat.BattleState
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package plugin.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
import core.game.interaction.NodeUsageEvent
|
||||
import core.game.interaction.UseWithHandler
|
||||
@@ -50,4 +50,4 @@ class CrestCombiningInteraction: UseWithHandler(779, 780,781) {
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+189
-200
@@ -1,200 +1,189 @@
|
||||
package plugin.quest.members.familycrest
|
||||
|
||||
|
||||
import core.game.content.dialogue.DialoguePlugin
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
|
||||
|
||||
|
||||
|
||||
@Initializable
|
||||
/**
|
||||
* Handles DimintheisDialogue Dialogue
|
||||
* @author Plex
|
||||
*/
|
||||
class DimintheisDialogue(player: Player? = null): DialoguePlugin(player) {
|
||||
override fun newInstance(player: Player?): DialoguePlugin {
|
||||
return DimintheisDialogue(player)
|
||||
}
|
||||
|
||||
|
||||
override fun open(vararg args: Any?): Boolean {
|
||||
npc = (args[0] as NPC).getShownNPC(player)
|
||||
val qstage = player?.questRepository?.getStage("Family Crest") ?: -1
|
||||
|
||||
if(qstage == 100 && !DoMissingGuantletCheck()){
|
||||
npc("Thank you for saving our family honour, ",
|
||||
"We will never forget you")
|
||||
stage = 1000
|
||||
return true
|
||||
}
|
||||
|
||||
if(qstage == 100 && DoMissingGuantletCheck()){
|
||||
player("I've lost the guantlets you gave me")
|
||||
stage = 6000
|
||||
}
|
||||
|
||||
if(qstage == 20 && player.inventory.containItems(782)){
|
||||
player("I have retrieved your crest.").also{stage = 5000}
|
||||
return true;
|
||||
}
|
||||
|
||||
when(qstage) {
|
||||
0 -> npc("Hello. My name is Dimintheis, ",
|
||||
"of the noble family Fitzharmon.").also { stage = 1 }
|
||||
10 -> player("Where did you say I could find your son Caleb again?").also { stage = 3000 }
|
||||
11 -> player("Where did you say I could find your son Caleb again?").also { stage = 3000 }
|
||||
12 -> npc("Have you found my crest yet?").also{stage = 4000}
|
||||
13 -> npc("Have you found my crest yet?").also{stage = 4000}
|
||||
14 -> npc("Have you found my crest yet?").also{stage = 4000}
|
||||
15 -> npc("Have you found my crest yet?").also{stage = 4000}
|
||||
16 -> npc("Have you found my crest yet?").also{stage = 4000}
|
||||
17 -> npc("Have you found my crest yet?").also{stage = 4000}
|
||||
18 -> npc("Have you found my crest yet?").also{stage = 4000}
|
||||
19 -> npc("Have you found my crest yet?").also{stage = 4000}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
when(stage){
|
||||
1 -> options(
|
||||
"Why would a nobleman live in a dump like this?",
|
||||
"You're rich then? Can i have some money?",
|
||||
"Hi, i am a bold adventurer.").also {stage++}
|
||||
2 -> when(buttonId){
|
||||
1 -> npc("The King has taken my estate from me ",
|
||||
"until such time as I can show my family crest to him.").also { stage = 3}
|
||||
2 -> npc("Gah! Lousy beggar! " ,
|
||||
"Your sort is what's ruining this great land! ",
|
||||
"Why don't you just go and get a " ,
|
||||
"job if you need money so badly?").also { stage = 1000}
|
||||
3 -> npc("An adventurer hmmm? How lucky. I may have an adventure for you. " ,
|
||||
"I desperately need my family crest returning to me. " ,
|
||||
"It is of utmost importance.").also { stage = 4 }
|
||||
}
|
||||
3 -> options("Why would he do that?",
|
||||
"So where is this crest?").also {stage = 5}
|
||||
|
||||
4 -> options("Why are you so desperate for it?",
|
||||
"So where is this crest?",
|
||||
"I'm not interested in that adventure right now").also { stage = 6}
|
||||
5 -> when(buttonId){
|
||||
1-> npc("Well, there is a long standing rule of chivalry " ,
|
||||
"amongst the Varrockian aristocracy,").also{stage = 2000}
|
||||
2-> npc("Well, my three sons took it with them " ,
|
||||
"many years ago when they rode ").also { stage = 2007 }
|
||||
}
|
||||
6 -> when(buttonId){
|
||||
1 -> npc("Well, there is a long standing rule of chivalry " ,
|
||||
"amongst the Varrockian aristocracy,").also{stage = 2000}
|
||||
2 -> npc("Well, my three sons took it with them " ,
|
||||
"many years ago when they rode ").also { stage = 2007 }
|
||||
3 -> npc("I realise it was a lot to ask of a stranger.").also { stage = 1000}
|
||||
|
||||
}
|
||||
2000 -> npc(
|
||||
"where each noble family is in possession of a unique crest, ",
|
||||
"which signifies the honour and lineage of the family. ").also { stage++}
|
||||
2001 -> npc("More than this however, it also represents the ",
|
||||
"lawful rights of each family to prove their ownership of ",
|
||||
"their wealth and lands. If the family crest is lost,").also { stage++ }
|
||||
|
||||
2002 -> npc( "then the family's estate is handed over to the ",
|
||||
"current monarch until the crest is restored.").also{stage++}
|
||||
2003 -> npc("This dates back to the times when there was much in-fighting " ,
|
||||
"amongst the noble families and their clans, and ",
|
||||
"was introduced as a way of reducing the bloodshed that was ",
|
||||
"devastating the ranks of the ruling classes at that time.").also { stage++ }
|
||||
2004 -> npc("When you captured a rival family's clan, " ,
|
||||
"you also captured their lands and wealth.").also{ stage++}
|
||||
|
||||
2005 -> options("So where is this crest?", "I'm not interested in an adventure right now").also{stage++}
|
||||
|
||||
2006 -> when(buttonId){
|
||||
1-> npc("Well, my three sons took it ",
|
||||
"with them many years ago when they rode out ").also { stage++ }
|
||||
|
||||
2 -> npc("I realise it was a lot to ask of a stranger.").also { stage = 1000}
|
||||
|
||||
}
|
||||
2007 -> npc("to fight in the war against the undead necromancer " ,
|
||||
"and his army in the battle to save Varrock.").also { stage++}
|
||||
2008 -> npc("For many years I had assumed them all dead, " ,
|
||||
"as I had heard no word from them.").also { stage++}
|
||||
2009 -> npc("Recently I heard that my son Caleb is alive and well, " ,
|
||||
"trying to earn his fortune as a great fish chef in Catherby.").also { stage++ }
|
||||
2010 -> options("Ok, I will help you", "I'm not interested in an adventure right now").also { stage++ }
|
||||
2011 -> when(buttonId){
|
||||
1 -> npc("I thank you greatly adventurer!").also { stage++}
|
||||
2 -> npc("I realise it was a lot to ask of a stranger.").also { stage = 1000 }
|
||||
}
|
||||
2012 -> if(player.questRepository.getQuest("Family Crest").hasRequirements(player)) {
|
||||
npc("If you find Caleb, or my other sons... please... ",
|
||||
"let them know their father still loves them...").also { stage = 1000 }.also { player.questRepository.getQuest("Family Crest").start(player) }.also { player.questRepository.syncronizeTab(player) }
|
||||
}else{
|
||||
npc("But im sorry, but you cannot help me right now").also{stage = 1000}
|
||||
}
|
||||
|
||||
3000 ->npc("The only thing I have heard of my son Caleb ",
|
||||
"is that he is trying to earn his fortune as a great fish chef.").also{stage++}
|
||||
3001 ->npc("I believe he is staying with a friend ",
|
||||
"who lives just outside the west gates of Varrock.").also{stage = 1000}
|
||||
|
||||
4000 -> player("I'm still looking for it").also{stage = 1000}
|
||||
|
||||
|
||||
5000 -> npc("Adventurer... I can only thank you for your kindness, " ,
|
||||
"although the words are insufficient " ,
|
||||
"to express the gratitude I feel!").also{stage++}
|
||||
5001 -> npc("You are truly a hero in every sense, " ,
|
||||
"and perhaps your efforts can begin to " ,
|
||||
"patch the wounds that have torn this family apart...").also{stage++}
|
||||
5002 -> npc("I know not how I can adequately reward you for your efforts... " ,
|
||||
"although I do have these mystical gauntlets, " ,
|
||||
"a family heirloom that through some power unknown to me, " ,
|
||||
"have always returned to the head of the family whenever lost,").also{stage++}
|
||||
|
||||
5003 -> npc(" or if the owner has died. " ,
|
||||
"I will pledge these to you, " ,
|
||||
"and if you should lose them return to me, " ,
|
||||
"and they will be here.").also{stage++
|
||||
}
|
||||
5004 -> npc("They can also be granted extra powers. " ,
|
||||
"Take them to one of my sons, " ,
|
||||
"they should be able to imbue them with a skill for you.").also{stage = 1000
|
||||
player.questRepository.getQuest("Family Crest").finish(player)
|
||||
player.questRepository.getQuest("Family Crest").setStage(player, 100)
|
||||
}
|
||||
|
||||
6000 -> npc("Not to worry, here they are").also{
|
||||
stage = 1000
|
||||
player.inventory.add(Item(778))
|
||||
}
|
||||
1000 -> end()
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private fun DoMissingGuantletCheck(): Boolean{
|
||||
var itemsToCheck = listOf(775, 776, 777, 778)
|
||||
for(item in itemsToCheck){
|
||||
if(player.inventory.containItems(item))
|
||||
return true
|
||||
if(player.bank.containItems(item))
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(8171)
|
||||
}
|
||||
|
||||
}
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
|
||||
import api.*
|
||||
import core.game.content.dialogue.DialoguePlugin
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
|
||||
|
||||
@Initializable
|
||||
/**
|
||||
* Handles DimintheisDialogue Dialogue
|
||||
* @author Plex
|
||||
*/
|
||||
class DimintheisDialogue(player: Player? = null): DialoguePlugin(player) {
|
||||
override fun newInstance(player: Player?): DialoguePlugin {
|
||||
return DimintheisDialogue(player)
|
||||
}
|
||||
|
||||
private val questName = "Family Crest"
|
||||
|
||||
override fun open(vararg args: Any?): Boolean {
|
||||
npc = (args[0] as NPC).getShownNPC(player)
|
||||
val questStage = questStage(player, questName)
|
||||
val questComplete = isQuestComplete(player, questName)
|
||||
|
||||
if (questStage == 20 && inInventory(player, Items.FAMILY_CREST_782)) {
|
||||
player("I have retrieved your crest.").also{ stage = 5000 }
|
||||
return true;
|
||||
}
|
||||
|
||||
val hasGauntlets = hasAnItem(player, Items.COOKING_GAUNTLETS_775, Items.GOLDSMITH_GAUNTLETS_776, Items.CHAOS_GAUNTLETS_777, Items.FAMILY_GAUNTLETS_778).container != null
|
||||
|
||||
if (questComplete && hasGauntlets) {
|
||||
npc("Thank you for saving our family honour, ",
|
||||
"We will never forget you")
|
||||
stage = 1000
|
||||
return true
|
||||
}
|
||||
|
||||
if (questComplete && !hasGauntlets) {
|
||||
player("I've lost the gauntlets you gave me")
|
||||
stage = 6000
|
||||
return true
|
||||
}
|
||||
|
||||
when(questStage) {
|
||||
0 -> npc("Hello. My name is Dimintheis, ",
|
||||
"of the noble family Fitzharmon.").also { stage = 1 }
|
||||
10 -> player("Where did you say I could find your son Caleb again?").also { stage = 3000 }
|
||||
11 -> player("Where did you say I could find your son Caleb again?").also { stage = 3000 }
|
||||
12 -> npc("Have you found my crest yet?").also{ stage = 4000 }
|
||||
13 -> npc("Have you found my crest yet?").also{ stage = 4000 }
|
||||
14 -> npc("Have you found my crest yet?").also{ stage = 4000 }
|
||||
15 -> npc("Have you found my crest yet?").also{ stage = 4000 }
|
||||
16 -> npc("Have you found my crest yet?").also{ stage = 4000 }
|
||||
17 -> npc("Have you found my crest yet?").also{ stage = 4000 }
|
||||
18 -> npc("Have you found my crest yet?").also{ stage = 4000 }
|
||||
19 -> npc("Have you found my crest yet?").also{ stage = 4000 }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
when(stage){
|
||||
1 -> options(
|
||||
"Why would a nobleman live in a dump like this?",
|
||||
"You're rich then? Can i have some money?",
|
||||
"Hi, i am a bold adventurer.").also { stage++ }
|
||||
2 -> when(buttonId){
|
||||
1 -> npc("The King has taken my estate from me ",
|
||||
"until such time as I can show my family crest to him.").also { stage = 3 }
|
||||
2 -> npc("Gah! Lousy beggar! " ,
|
||||
"Your sort is what's ruining this great land! ",
|
||||
"Why don't you just go and get a " ,
|
||||
"job if you need money so badly?").also { stage = 1000}
|
||||
3 -> npc("An adventurer hmmm? How lucky. I may have an adventure for you. " ,
|
||||
"I desperately need my family crest returning to me. " ,
|
||||
"It is of utmost importance.").also { stage = 4 }
|
||||
}
|
||||
3 -> options("Why would he do that?",
|
||||
"So where is this crest?").also { stage = 5 }
|
||||
|
||||
4 -> options("Why are you so desperate for it?",
|
||||
"So where is this crest?",
|
||||
"I'm not interested in that adventure right now").also { stage = 6 }
|
||||
5 -> when(buttonId){
|
||||
1-> npc("Well, there is a long standing rule of chivalry " ,
|
||||
"amongst the Varrockian aristocracy,").also{ stage = 2000 }
|
||||
2-> npc("Well, my three sons took it with them " ,
|
||||
"many years ago when they rode ").also { stage = 2007 }
|
||||
}
|
||||
6 -> when(buttonId){
|
||||
1 -> npc("Well, there is a long standing rule of chivalry " ,
|
||||
"amongst the Varrockian aristocracy,").also{ stage = 2000 }
|
||||
2 -> npc("Well, my three sons took it with them " ,
|
||||
"many years ago when they rode ").also { stage = 2007 }
|
||||
3 -> npc("I realise it was a lot to ask of a stranger.").also { stage = 1000}
|
||||
|
||||
}
|
||||
2000 -> npc(
|
||||
"where each noble family is in possession of a unique crest, ",
|
||||
"which signifies the honour and lineage of the family. ").also { stage++}
|
||||
2001 -> npc("More than this however, it also represents the ",
|
||||
"lawful rights of each family to prove their ownership of ",
|
||||
"their wealth and lands. If the family crest is lost,").also { stage++ }
|
||||
|
||||
2002 -> npc( "then the family's estate is handed over to the ",
|
||||
"current monarch until the crest is restored.").also{ stage++ }
|
||||
2003 -> npc("This dates back to the times when there was much in-fighting " ,
|
||||
"amongst the noble families and their clans, and ",
|
||||
"was introduced as a way of reducing the bloodshed that was ",
|
||||
"devastating the ranks of the ruling classes at that time.").also { stage++ }
|
||||
2004 -> npc("When you captured a rival family's clan, " ,
|
||||
"you also captured their lands and wealth.").also{ stage++}
|
||||
|
||||
2005 -> options("So where is this crest?", "I'm not interested in an adventure right now").also{stage++}
|
||||
|
||||
2006 -> when(buttonId){
|
||||
1-> npc("Well, my three sons took it ",
|
||||
"with them many years ago when they rode out ").also { stage++ }
|
||||
2 -> npc("I realise it was a lot to ask of a stranger.").also { stage = 1000 }
|
||||
|
||||
}
|
||||
2007 -> npc("to fight in the war against the undead necromancer " ,
|
||||
"and his army in the battle to save Varrock.").also { stage++ }
|
||||
2008 -> npc("For many years I had assumed them all dead, " ,
|
||||
"as I had heard no word from them.").also { stage++ }
|
||||
2009 -> npc("Recently I heard that my son Caleb is alive and well, " ,
|
||||
"trying to earn his fortune as a great fish chef in Catherby.").also { stage++ }
|
||||
2010 -> options("Ok, I will help you", "I'm not interested in an adventure right now").also { stage++ }
|
||||
2011 -> when(buttonId){
|
||||
1 -> npc("I thank you greatly adventurer!").also { stage++ }
|
||||
2 -> npc("I realise it was a lot to ask of a stranger.").also { stage = 1000 }
|
||||
}
|
||||
2012 -> if(startQuest(player, questName)) {
|
||||
npc("If you find Caleb, or my other sons... please... ",
|
||||
"let them know their father still loves them...").also { stage = 1000 }
|
||||
} else {
|
||||
npc("But im sorry, but you cannot help me right now").also{ stage = 1000 }
|
||||
}
|
||||
|
||||
3000 ->npc("The only thing I have heard of my son Caleb ",
|
||||
"is that he is trying to earn his fortune as a great fish chef.").also{ stage++ }
|
||||
3001 ->npc("I believe he is staying with a friend ",
|
||||
"who lives just outside the west gates of Varrock.").also{ stage = 1000 }
|
||||
|
||||
4000 -> player("I'm still looking for it").also{ stage = 1000 }
|
||||
|
||||
5000 -> npc("Adventurer... I can only thank you for your kindness, " ,
|
||||
"although the words are insufficient " ,
|
||||
"to express the gratitude I feel!").also{ stage++ }
|
||||
5001 -> npc("You are truly a hero in every sense, " ,
|
||||
"and perhaps your efforts can begin to " ,
|
||||
"patch the wounds that have torn this family apart...").also{ stage++ }
|
||||
5002 -> npc("I know not how I can adequately reward you for your efforts... " ,
|
||||
"although I do have these mystical gauntlets, " ,
|
||||
"a family heirloom that through some power unknown to me, " ,
|
||||
"have always returned to the head of the family whenever lost,").also{ stage++ }
|
||||
5003 -> npc(" or if the owner has died. " ,
|
||||
"I will pledge these to you, " ,
|
||||
"and if you should lose them return to me, " ,
|
||||
"and they will be here.").also{ stage++ }
|
||||
5004 -> npc("They can also be granted extra powers. " ,
|
||||
"Take them to one of my sons, " ,
|
||||
"they should be able to imbue them with a skill for you.").also {
|
||||
stage = 1000
|
||||
if (removeItem(player, Items.FAMILY_CREST_782)) {
|
||||
finishQuest(player, questName)
|
||||
}
|
||||
}
|
||||
|
||||
6000 -> npc("Not to worry, here they are").also {
|
||||
stage = 1000
|
||||
addItem(player, getAttribute(player, "family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778))
|
||||
}
|
||||
|
||||
1000 -> end()
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(8171)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package plugin.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
|
||||
import api.addItem
|
||||
import api.setAttribute
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.quest.Quest
|
||||
import core.game.node.entity.skill.Skills
|
||||
@@ -8,6 +10,7 @@ import core.game.node.item.GroundItemManager
|
||||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
import rs09.game.system.SystemLogger
|
||||
|
||||
/**
|
||||
* Represents the "Family Crest" quest.
|
||||
@@ -116,10 +119,10 @@ class FamilyCrest: Quest("Family Crest", 59, 58, 1, 148, 0, 1, 11) {
|
||||
drawReward(player,"A choice of special abilities for the gauntlets",ln++)
|
||||
drawReward(player,"for the gauntlets",ln++)
|
||||
|
||||
if(!player.inventory.add(Item(Items.FAMILY_GAUNTLETS_778))){
|
||||
GroundItemManager.create(Item(Items.FAMILY_GAUNTLETS_778),player)
|
||||
if (!addItem(player, Items.FAMILY_GAUNTLETS_778)) {
|
||||
SystemLogger.logErr("Failed to give gauntlets to ${player.username} at end of quest, this should not occur due to crest item removal needed to finish quest.")
|
||||
}
|
||||
|
||||
setAttribute(player, "/save:family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778)
|
||||
}
|
||||
|
||||
/*override fun getConfig(player: Player?, stage: Int): IntArray {
|
||||
|
||||
+31
-37
@@ -1,11 +1,13 @@
|
||||
package plugin.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
|
||||
import api.*
|
||||
import core.game.content.dialogue.DialoguePlugin
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
|
||||
@Initializable
|
||||
class JohnathonDialogue(player: Player? = null): DialoguePlugin(player) {
|
||||
@@ -18,14 +20,14 @@ class JohnathonDialogue(player: Player? = null): DialoguePlugin(player) {
|
||||
npc = (args[0] as NPC).getShownNPC(player)
|
||||
val qstage = player?.questRepository?.getStage("Family Crest") ?: -1
|
||||
|
||||
if(qstage == 100){
|
||||
options("Can you enchant these gauntlets for me?", "Nevermind")
|
||||
if (qstage == 100) {
|
||||
options("Can you change my gauntlets for me?", "Nevermind")
|
||||
stage = 6000
|
||||
return true
|
||||
}
|
||||
|
||||
if(qstage < 16){
|
||||
npc("I dont feel so well... maybe we can talk later")
|
||||
npc("I don't feel so well... maybe we can talk later")
|
||||
stage = 1000;
|
||||
}
|
||||
else{
|
||||
@@ -42,7 +44,7 @@ class JohnathonDialogue(player: Player? = null): DialoguePlugin(player) {
|
||||
}
|
||||
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
when(stage){
|
||||
when(stage) {
|
||||
|
||||
1 -> npc("That... I am...").also { stage++ }
|
||||
2 -> player("I am here to retrieve your fragment " ,
|
||||
@@ -50,7 +52,7 @@ class JohnathonDialogue(player: Player? = null): DialoguePlugin(player) {
|
||||
3 -> npc("The... poison... it is all... " ,
|
||||
"too much... My head... " ,
|
||||
"will not... stop spinning...").also { stage++ }
|
||||
4 -> sendDialogue("Sweat is pouring down Jonathons'face.").also { stage = 1000
|
||||
4 -> sendDialogue("Sweat is pouring down Jonathons' face.").also { stage = 1000
|
||||
player.questRepository.getQuest("Family Crest").setStage(player, 17);
|
||||
}
|
||||
|
||||
@@ -89,45 +91,37 @@ class JohnathonDialogue(player: Player? = null): DialoguePlugin(player) {
|
||||
4 -> npc("My thanks for the assistance adventure").also{stage = 1000}
|
||||
|
||||
}
|
||||
6000 -> when(buttonId){
|
||||
1-> if(DoMissingGuantletCheck() != -1){
|
||||
var gauntletID = DoMissingGuantletCheck()
|
||||
|
||||
if(gauntletID == 777){
|
||||
npc("You already have the Chaos Guantlets.")
|
||||
stage = 1000
|
||||
}
|
||||
else{
|
||||
npc("Here you go")
|
||||
player.inventory.remove(Item(gauntletID))
|
||||
player.inventory.add(Item(777))
|
||||
stage = 1000
|
||||
}
|
||||
6000 -> when (buttonId) {
|
||||
1 -> {
|
||||
var freeThisTime = getAttribute(player, "family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778) == Items.FAMILY_GAUNTLETS_778
|
||||
npc("Yes certainly, though it will cost you 25,000 coins" + if (freeThisTime) " next time." else ".").also { stage = 6001 }
|
||||
}
|
||||
else{
|
||||
npc("You do not have the guantlets with you in your inventory")
|
||||
stage = 1000
|
||||
}
|
||||
2-> player("Never mind").also{stage = 1000}
|
||||
2 -> player("Never mind").also{ stage = 1000 }
|
||||
}
|
||||
6001 -> options("Great thanks!", "No that's okay thanks.").also{ stage++ }
|
||||
6002 -> when (buttonId) {
|
||||
1 -> {
|
||||
stage = 1000
|
||||
val givingGauntletsId = Items.CHAOS_GAUNTLETS_777
|
||||
val npcString = SwapGauntletsHelper.swapGauntlets(player, givingGauntletsId)
|
||||
if (npcString == "")
|
||||
{
|
||||
end()
|
||||
}
|
||||
else {
|
||||
npc(npcString)
|
||||
}
|
||||
}
|
||||
2 -> end()
|
||||
}
|
||||
|
||||
|
||||
1000 -> end()
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private fun DoMissingGuantletCheck(): Int{
|
||||
var itemsToCheck = listOf(775, 776, 777, 778)
|
||||
for(item in itemsToCheck){
|
||||
if(player.inventory.containItems(item))
|
||||
return item
|
||||
}
|
||||
return -1
|
||||
return true
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(668)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package plugin.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
|
||||
import api.addItem
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package plugin.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
import core.game.content.dialogue.DialogueInterpreter
|
||||
import core.game.content.dialogue.DialoguePlugin
|
||||
@@ -61,4 +61,4 @@ class PerfectJewelryHandler (player: Player? = null): DialoguePlugin(player){
|
||||
return intArrayOf(DialogueInterpreter.getDialogueKey("perfect-jewelry"))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package plugin.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
import org.rs09.consts.Items
|
||||
|
||||
@@ -25,4 +25,4 @@ class PerfectJewelryOnUseHandler : UseWithHandler(Items.PERFECT_GOLD_BAR_2365){
|
||||
|
||||
}
|
||||
|
||||
//event.getPlayer().getDialogueInterpreter().open("perfect-jewelry");
|
||||
//event.getPlayer().getDialogueInterpreter().open("perfect-jewelry");
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
import api.*
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import org.rs09.consts.Items
|
||||
|
||||
class SwapGauntletsHelper {
|
||||
companion object {
|
||||
private val legalGauntlets = setOf(Items.COOKING_GAUNTLETS_775, Items.GOLDSMITH_GAUNTLETS_776, Items.CHAOS_GAUNTLETS_777, Items.FAMILY_GAUNTLETS_778)
|
||||
|
||||
@JvmStatic
|
||||
fun swapGauntlets(player: Player, givingGauntletsId: Int): String {
|
||||
if (givingGauntletsId !in legalGauntlets) {
|
||||
throw IllegalArgumentException("givingGauntletsId not in list of legal gauntlets.")
|
||||
}
|
||||
if (inInventory(player, givingGauntletsId)) {
|
||||
val gauntletString = Item(givingGauntletsId).name
|
||||
return "You already have the $gauntletString."
|
||||
}
|
||||
var otherGauntlets = -1
|
||||
val otherPossibleGauntlets = legalGauntlets.toMutableSet()
|
||||
otherPossibleGauntlets.remove(givingGauntletsId)
|
||||
for (gauntletId in otherPossibleGauntlets) {
|
||||
if (inInventory(player, gauntletId))
|
||||
{
|
||||
otherGauntlets = gauntletId
|
||||
}
|
||||
}
|
||||
if (otherGauntlets == -1) {
|
||||
return "You do not have the gauntlets with you in your inventory."
|
||||
}
|
||||
val fee = 25000
|
||||
val shouldBeFree = getAttribute(player, "family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778) == Items.FAMILY_GAUNTLETS_778
|
||||
if (!shouldBeFree && !inInventory(player, Items.COINS_995, fee)) {
|
||||
return "You do not have enough coins."
|
||||
}
|
||||
if ((shouldBeFree || removeItem(player, Item(Items.COINS_995, fee))) && removeItem(player, otherGauntlets)) {
|
||||
addItem(player, givingGauntletsId)
|
||||
setAttribute(player, "/save:family-crest:gauntlets", givingGauntletsId)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package core.game.content.quest.members.familycrest
|
||||
package rs09.game.content.quest.members.familycrest
|
||||
|
||||
import core.game.node.entity.impl.ForceMovement
|
||||
import core.game.node.entity.player.Player
|
||||
|
||||
+9
-6
@@ -1,6 +1,8 @@
|
||||
package rs09.game.content.quest.members.monksfriend
|
||||
|
||||
import api.questStage
|
||||
import api.sendItemDialogue
|
||||
import api.setQuestStage
|
||||
import core.game.content.dialogue.FacialExpression
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.item.Item
|
||||
@@ -16,7 +18,8 @@ import rs09.tools.END_DIALOGUE
|
||||
*/
|
||||
class BrotherCedricDialogue : DialogueFile() {
|
||||
override fun handle(componentID: Int, buttonID: Int) {
|
||||
val questStage = player!!.questRepository.getStage("Monk's Friend")
|
||||
val questName = "Monk's Friend"
|
||||
val questStage = questStage(player!!, questName)
|
||||
when {
|
||||
questStage < 30 -> {
|
||||
when(stage) {
|
||||
@@ -33,7 +36,7 @@ class BrotherCedricDialogue : DialogueFile() {
|
||||
0 -> playerl(FacialExpression.HAPPY, "Brother Cedric are you okay?").also{stage++}
|
||||
1 -> npcl(FacialExpression.DRUNK, "Yeesshhh, I'm very, very drunk..hic..up..").also{stage++}
|
||||
2 -> playerl(FacialExpression.NEUTRAL, "Brother Omad needs the wine for the party.").also{stage++}
|
||||
3 -> npcl(FacialExpression.SAD, "Oh dear, oh dear, I knew I had to do something!").also{stage = END_DIALOGUE}.also{setQuest(player!!, 40)}
|
||||
3 -> npcl(FacialExpression.SAD, "Oh dear, oh dear, I knew I had to do something!").also{stage = END_DIALOGUE}.also{ setQuestStage(player!!, questName, 40) }
|
||||
}
|
||||
}
|
||||
questStage == 40 -> {
|
||||
@@ -51,7 +54,7 @@ class BrotherCedricDialogue : DialogueFile() {
|
||||
sendItemDialogue(player!!, Items.JUG_OF_WATER_1937, "You hand the monk a jug of water.")
|
||||
stage=0
|
||||
player!!.inventory.remove(Item(Items.JUG_OF_WATER_1937))
|
||||
setQuest(player!!, 41)
|
||||
setQuestStage(player!!, questName, 41)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +72,7 @@ class BrotherCedricDialogue : DialogueFile() {
|
||||
}
|
||||
5 -> npcl(FacialExpression.HAPPY, "In that case I'd better drink more wine! It helps me think.").also {stage=END_DIALOGUE}
|
||||
10 -> npcl(FacialExpression.HAPPY, "Excellent, I just need some wood.").also{stage++}
|
||||
11 -> playerl(FacialExpression.NEUTRAL, "Ok, I'll see what I can find.").also{stage = END_DIALOGUE}.also{setQuest(player!!, 42)}
|
||||
11 -> playerl(FacialExpression.NEUTRAL, "Ok, I'll see what I can find.").also{stage = END_DIALOGUE}.also{setQuestStage(player!!, questName, 42)}
|
||||
}
|
||||
}
|
||||
questStage == 42 -> {
|
||||
@@ -86,7 +89,7 @@ class BrotherCedricDialogue : DialogueFile() {
|
||||
4 -> playerl(FacialExpression.HAPPY, "Ok! I'll see you later!").also{
|
||||
stage=END_DIALOGUE
|
||||
player!!.inventory.remove(Item(Items.LOGS_1511))
|
||||
setQuest(player!!, 50)
|
||||
setQuestStage(player!!, questName, 50)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,4 +119,4 @@ class BrotherCedricListener : InteractionListener {
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -22,7 +22,8 @@ import rs09.tools.END_DIALOGUE
|
||||
*/
|
||||
class BrotherOmadDialogue : DialogueFile() {
|
||||
override fun handle(componentID: Int, buttonID: Int) {
|
||||
val questStage = player!!.questRepository.getStage("Monk's Friend")
|
||||
val questName = "Monk's Friend"
|
||||
val questStage = questStage(player!!, questName)
|
||||
when (questStage) {
|
||||
0 -> {
|
||||
when(stage) {
|
||||
@@ -69,7 +70,7 @@ class BrotherOmadDialogue : DialogueFile() {
|
||||
}
|
||||
31 -> npcl(FacialExpression.HAPPY, "Really, that's excellent, well done! Maybe now I will be able to get some rest.").also{stage++}
|
||||
32 -> npcl(FacialExpression.SAD, "*yawn*..I'm off to bed! Farewell brave traveller!").also{player!!.inventory.remove(Item(Items.CHILDS_BLANKET_90))
|
||||
setQuest(player!!, 20); stage = END_DIALOGUE}
|
||||
setQuestStage(player!!, questName, 20); stage = END_DIALOGUE}
|
||||
}
|
||||
}
|
||||
20 -> {
|
||||
@@ -103,7 +104,7 @@ class BrotherOmadDialogue : DialogueFile() {
|
||||
996 -> npcl(FacialExpression.NEUTRAL, "Okay traveller, take care.").also{stage = END_DIALOGUE}
|
||||
997 -> npcl(FacialExpression.NEUTRAL, "Of course, but we need the wine first.").also{stage = END_DIALOGUE}
|
||||
42 -> npcl(FacialExpression.FRIENDLY, "Oh, he won't be far. Probably out in the forest.").also{stage++}
|
||||
43 -> playerl(FacialExpression.FRIENDLY, "Ok, I'll go and find him.").also { stage = END_DIALOGUE}.also{ setQuest(player!!, 30);}
|
||||
43 -> playerl(FacialExpression.FRIENDLY, "Ok, I'll go and find him.").also { stage = END_DIALOGUE}.also{ setQuestStage(player!!, questName, 30)}
|
||||
}
|
||||
}
|
||||
30 -> {
|
||||
@@ -191,7 +192,6 @@ class BrotherOmadDialogue : DialogueFile() {
|
||||
}
|
||||
25 -> if (questComplete) {
|
||||
player!!.questRepository.getQuest("Monk's Friend").finish(player)
|
||||
player!!.questRepository.getQuest("Monk's Friend").setStage(player, 100)
|
||||
}
|
||||
}
|
||||
count++
|
||||
@@ -212,4 +212,4 @@ class BrotherOmadListener : InteractionListener {
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,8 +64,3 @@ class MonksFriend: Quest("Monk's Friend", 89, 88, 1, 30, 0, 1, 80) {
|
||||
player.inventory.add(Item(563, 8))
|
||||
}
|
||||
}
|
||||
|
||||
fun setQuest(player: Player, stage: Int){
|
||||
player.questRepository.getQuest("Monk's Friend").setStage(player, stage)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user