Adds 4 Varrock diary tasks and fixes Romily Weaklax pie task

This commit is contained in:
kennethedmonds 2025-11-02 15:57:55 -06:00
parent 8bdfc43fba
commit ef7ed6ed12
3 changed files with 195 additions and 128 deletions

View file

@ -66,10 +66,10 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
} }
@Override @Override
public void init() { public void init() {
super.init(); super.init();
ClassScanner.definePlugin(new RomilyWildPieHandler()); ClassScanner.definePlugin(new RomilyWildPieHandler());
} }
@Override @Override
public boolean open(Object... args) { public boolean open(Object... args) {
@ -78,14 +78,23 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
pieAmt = player.getAttribute(keyAmt, 0); pieAmt = player.getAttribute(keyAmt, 0);
pieReward = PieReward.forId(pieId); pieReward = PieReward.forId(pieId);
// Check if wild pie was used on NPC or is in inventory; partial source here https://www.youtube.com/watch?v=FjlLZnDxofY
boolean hasWildPie = false;
if (args.length > 1) { if (args.length > 1) {
Item usedWith = (Item) args[1]; Item usedWith = (Item) args[1];
if (usedWith.getId() == Items.WILD_PIE_7208) { if (usedWith.getId() == Items.WILD_PIE_7208) {
npc("Is that a wild pie for me?"); // TODO not accurate dialogue, unfortunately offscreen in this video https://www.youtube.com/watch?v=FjlLZnDxofY hasWildPie = true;
stage = 100; }
return true; } else if (player.getInventory().contains(Items.WILD_PIE_7208, 1)) {
} hasWildPie = true;
} }
if (hasWildPie) {
npc("Hello and welcome to my pie shop. My word! That's a nice", "smelling pie you have. Is it for me?");
stage = 100;
return true;
}
npc("Hello and welcome to my pie shop, how can I help you?"); npc("Hello and welcome to my pie shop, how can I help you?");
if (pieId != 0 && pieAmt != 0) { if (pieId != 0 && pieAmt != 0) {
@ -125,10 +134,9 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
break; break;
case 2: case 2:
options("I'd like to buy some pies.", "I've got those pies you wanted.", "I'm good thanks."); options("I'd like to buy some pies.", "I've got those pies you wanted.", "I'm good thanks.");
stage = 1; stage = 3;
break; break;
case 3: case 3:
switch (buttonId) { switch (buttonId) {
case 1: case 1:
player("I'd like to buy some pies."); player("I'd like to buy some pies.");
@ -153,7 +161,7 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
npc.openShop(player); npc.openShop(player);
break; break;
case 20: case 20:
npc("Actually I could, you see I'm running out of stock and I", "don't have tme to bake any more pies. would you be", "willing to bake me some pies? I'll pay you well for them."); npc("Actually I could, you see I'm running out of stock and I", "don't have time to bake any more pies. Would you be", "willing to bake me some pies? I'll pay you well for them.");
stage = 21; stage = 21;
break; break;
case 21: case 21:
@ -178,9 +186,12 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
break; break;
case 50: case 50:
final int piesInInventory = player.getInventory().getAmount(pieId); final int piesInInventory = player.getInventory().getAmount(pieId);
final int deficit = pieAmt - piesInInventory; final int piesNeeded = pieAmt; // How many he still needs
final int piesToGive = Math.min(piesInInventory, piesNeeded); // Don't give more than needed
final int deficit = piesNeeded - piesToGive;
if (piesInInventory == 0) { if (piesInInventory == 0) {
npc("Doesn't look like you have any of the", pieAmt + " " + new Item(pieId).getName() + "s I requested."); npc("Doesn't look like you have any of the", piesNeeded + " " + new Item(pieId).getName() + "s I requested.");
stage = 999; stage = 999;
break; break;
} else if (deficit == 0) { } else if (deficit == 0) {
@ -191,37 +202,57 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
npc("Thank you, if you could bring me the other " + deficit + " that'd", "be great!"); npc("Thank you, if you could bring me the other " + deficit + " that'd", "be great!");
player.setAttribute("/save:" + keyAmt, deficit); player.setAttribute("/save:" + keyAmt, deficit);
} }
player.getInventory().remove(new Item(pieId, piesInInventory)); player.getInventory().remove(new Item(pieId, piesToGive)); // Only remove what we need
player.getInventory().add(new Item(995, pieReward.reward * piesInInventory)); player.getInventory().add(new Item(995, pieReward.reward * piesToGive)); // Only pay for what we took
stage = 999; stage = 999;
break; break;
case 60: case 60:
pieAmt = RandomFunction.random(1, 28); pieAmt = RandomFunction.random(1, 28);
pieId = PieReward.values()[RandomFunction.nextInt(PieReward.values().length)].id; pieId = PieReward.values()[RandomFunction.nextInt(PieReward.values().length)].id;
player.setAttribute("/save:" + keyAmt, pieAmt); player.setAttribute("/save:" + keyAmt, pieAmt);
player.setAttribute("/save:" + keyId, pieId); player.setAttribute("/save:" + keyId, pieId);
npc("Great, can you bake me " + pieAmt + " " + new Item(pieId).getName() + "s please."); npc("Great, can you bake me " + pieAmt + " " + new Item(pieId).getName() + "s please.");
stage = 999; stage = 999;
break; break;
case 100: case 100:
player("Yes, it is."); options("Yes, it is.", "No, it's for...someone else.");
stage++; stage++;
break; break;
case 101: case 101:
npc("Oh, how splendid! Let me take that from you then."); switch (buttonId) {
player.getInventory().remove(new Item(Items.WILD_PIE_7208)); case 1:
player.getAchievementDiaryManager().finishTask(player, DiaryType.VARROCK, 2, 5); player("Yes, it is.");
stage++; stage = 102;
break; break;
case 102: case 2:
npc("Now, was there anything else you needed?"); player("No, it's for...someone else.");
if (pieId != 0 && pieAmt != 0) { stage = 103;
stage = 2; break;
} else { }
stage = 0; break;
} case 102:
break; npc("Oh, how splendid! Let me take that from you then.");
player.getInventory().remove(new Item(Items.WILD_PIE_7208));
player.getAchievementDiaryManager().finishTask(player, DiaryType.VARROCK, 2, 5);
stage++;
break;
case 103:
npc("Oh, I see. Was there something else you needed?");
if (pieId != 0 && pieAmt != 0) {
stage = 2;
} else {
stage = 0;
}
break;
case 104:
npc("Now, was there anything else you needed?");
if (pieId != 0 && pieAmt != 0) {
stage = 2;
} else {
stage = 0;
}
break;
} }
return true; return true;
@ -234,23 +265,21 @@ public class RomilyWeaklaxDialogue extends DialoguePlugin {
} }
public static final class RomilyWildPieHandler extends UseWithHandler { public static final class RomilyWildPieHandler extends UseWithHandler {
public RomilyWildPieHandler() { public RomilyWildPieHandler() {
super(Items.WILD_PIE_7208); super(Items.WILD_PIE_7208);
} }
@Override @Override
public Plugin<Object> newInstance(Object arg) throws Throwable { public Plugin<Object> newInstance(Object arg) throws Throwable {
addHandler(3205, NPC_TYPE, this); addHandler(3205, NPC_TYPE, this);
return this; return this;
} }
@Override @Override
public boolean handle(NodeUsageEvent event) { public boolean handle(NodeUsageEvent event) {
if (!event.getPlayer().getAchievementDiaryManager().getDiary(DiaryType.VARROCK).isComplete(2,5)) { event.getPlayer().getDialogueInterpreter().open(3205, event.getUsedWith(), event.getUsedItem());
event.getPlayer().getDialogueInterpreter().open(3205, event.getUsedItem()); return true;
} }
return true; }
}
}
} }

View file

@ -3,6 +3,7 @@ package content.region.misthalin.varrock.diary
import content.global.skill.prayer.Bones import content.global.skill.prayer.Bones
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.item.Item
import core.game.node.entity.player.link.diary.DiaryType import core.game.node.entity.player.link.diary.DiaryType
import core.game.world.map.zone.ZoneBorders import core.game.world.map.zone.ZoneBorders
import org.rs09.consts.Components import org.rs09.consts.Components
@ -36,6 +37,14 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
NPCs.STRAY_DOG_5917, NPCs.STRAY_DOG_5918 NPCs.STRAY_DOG_5917, NPCs.STRAY_DOG_5918
) )
private val DIGSITE_PENDANTS = arrayOf(
Items.DIGSITE_PENDANT_1_11190,
Items.DIGSITE_PENDANT_2_11191,
Items.DIGSITE_PENDANT_3_11192,
Items.DIGSITE_PENDANT_4_11193,
Items.DIGSITE_PENDANT_5_11194
)
object EasyTasks { object EasyTasks {
const val THESSALIA_BROWSE_CLOTHES = 0 const val THESSALIA_BROWSE_CLOTHES = 0
const val AUBURY_TELEPORT_ESSENCE_MINE = 1 const val AUBURY_TELEPORT_ESSENCE_MINE = 1
@ -103,19 +112,19 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
AreaDiaryTask( AreaDiaryTask(
VARROCK_ROOF_AREA, VARROCK_ROOF_AREA,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.FIND_HIGHEST_POINT EasyTasks.FIND_HIGHEST_POINT
), ),
AreaDiaryTask( AreaDiaryTask(
SOS_LEVEL_2_AREA, SOS_LEVEL_2_AREA,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.VISIT_SOS_LEVEL2 EasyTasks.VISIT_SOS_LEVEL2
), ),
AreaDiaryTask( AreaDiaryTask(
CHAMPIONS_GUILD, CHAMPIONS_GUILD,
DiaryLevel.MEDIUM, DiaryLevel.MEDIUM,
MediumTasks.CHAMPIONS_GUILD_VISIT MediumTasks.CHAMPIONS_GUILD_VISIT
) )
) )
@ -125,7 +134,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.BARBARIAN_VILLAGE_CATCH_TROUT EasyTasks.BARBARIAN_VILLAGE_CATCH_TROUT
) )
} }
@ -133,7 +142,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.MINE_IRON_SOUTHEAST EasyTasks.MINE_IRON_SOUTHEAST
) )
} }
@ -144,7 +153,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.LUMBERYARD_CHOP_DYING_TREE EasyTasks.LUMBERYARD_CHOP_DYING_TREE
) )
} }
} }
@ -153,7 +162,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.PATERDOMUS_MINE_LIMESTONE EasyTasks.PATERDOMUS_MINE_LIMESTONE
) )
} }
} }
@ -165,7 +174,14 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.AUBURY_TELEPORT_ESSENCE_MINE EasyTasks.AUBURY_TELEPORT_ESSENCE_MINE
)
}
is Item -> if (event.source.id in DIGSITE_PENDANTS) {
finishTask(
player,
DiaryLevel.MEDIUM,
MediumTasks.DIGSITE_PENDANT_TELEPORT
) )
} }
} }
@ -177,21 +193,21 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.EDGEVILLE_ENTER_DUNGEON_SOUTH EasyTasks.EDGEVILLE_ENTER_DUNGEON_SOUTH
) )
} }
12598 -> if (event.target.id == 9312 && player.skills.getLevel(Skills.AGILITY, true) >= 21) { 12598 -> if (event.target.id == 9312 && player.skills.getLevel(Skills.AGILITY, true) >= 21) {
finishTask( finishTask(
player, player,
DiaryLevel.MEDIUM, DiaryLevel.MEDIUM,
MediumTasks.USE_GE_UNDER_WALL_SHORTCUT MediumTasks.USE_GE_UNDER_WALL_SHORTCUT
) )
} }
12698 -> if (event.target.id == 29370 && player.skills.getLevel(Skills.AGILITY, true) >= 51) { 12698 -> if (event.target.id == 29370 && player.skills.getLevel(Skills.AGILITY, true) >= 51) {
finishTask( finishTask(
player, player,
DiaryLevel.HARD, DiaryLevel.HARD,
HardTasks.USE_MOSS_GIANT_PIPE_SHORTCUT HardTasks.USE_MOSS_GIANT_PIPE_SHORTCUT
) )
} }
} }
@ -200,7 +216,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.MEDIUM, DiaryLevel.MEDIUM,
MediumTasks.PALACE_PICKPOCKET_GUARD MediumTasks.PALACE_PICKPOCKET_GUARD
) )
} }
@ -209,7 +225,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.MEDIUM, DiaryLevel.MEDIUM,
MediumTasks.OZIACH_BROWSE_STORE MediumTasks.OZIACH_BROWSE_STORE
) )
} }
} }
@ -225,10 +241,25 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.HARD, DiaryLevel.HARD,
HardTasks.EDGEVILLE_MAKE_WAKA_CANOE HardTasks.EDGEVILLE_MAKE_WAKA_CANOE
) )
} }
} }
13109 -> {
// Fancy Dress Shop - buying spottier cape with furs
if (event.iface == 477 && event.buttonId == 26) {
// Verify they have the required items to make the purchase
if (player.inventory.contains(Items.DASHING_KEBBIT_FUR_10127, 2) &&
player.inventory.contains(Items.COINS_995, 800)) {
finishTask(
player,
DiaryLevel.HARD,
HardTasks.FANCY_DRESS_SELLER_TRADE_FURS
)
}
}
}
} }
} }
} }
@ -239,7 +270,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.ELSIE_TELL_A_STORY EasyTasks.ELSIE_TELL_A_STORY
) )
} }
} }
@ -251,7 +282,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.GIVE_STRAY_DOG_A_BONE EasyTasks.GIVE_STRAY_DOG_A_BONE
) )
} }
} }
@ -264,7 +295,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.EASY, DiaryLevel.EASY,
EasyTasks.THESSALIA_BROWSE_CLOTHES EasyTasks.THESSALIA_BROWSE_CLOTHES
) )
} }
} }
@ -275,7 +306,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.MEDIUM, DiaryLevel.MEDIUM,
MediumTasks.CAST_VARROCK_TELEPORT_SPELL MediumTasks.CAST_VARROCK_TELEPORT_SPELL
) )
} }
} }
@ -285,7 +316,7 @@ class VarrockAchivementDiary : DiaryEventHookBase(DiaryType.VARROCK) {
finishTask( finishTask(
player, player,
DiaryLevel.MEDIUM, DiaryLevel.MEDIUM,
MediumTasks.DIAL_FAIRY_RING_WEST MediumTasks.DIAL_FAIRY_RING_WEST
) )
} }
} }

View file

@ -4,6 +4,7 @@ package content.region.misthalin.varrock.quest.familycrest
import core.api.* import core.api.*
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.diary.DiaryType
import core.plugin.Initializable import core.plugin.Initializable
import org.rs09.consts.Items import org.rs09.consts.Items
import content.data.Quests import content.data.Quests
@ -11,9 +12,9 @@ import content.data.Quests
@Initializable @Initializable
/** /**
* Handles DimintheisDialogue Dialogue * Handles DimintheisDialogue Dialogue
* @author Plex * @author Plex
*/ */
class DimintheisDialogue(player: Player? = null): core.game.dialogue.DialoguePlugin(player) { class DimintheisDialogue(player: Player? = null): core.game.dialogue.DialoguePlugin(player) {
override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin {
return DimintheisDialogue(player) return DimintheisDialogue(player)
@ -33,7 +34,7 @@ class DimintheisDialogue(player: Player? = null): core.game.dialogue.DialoguePlu
if (questComplete && hasGauntlets) { if (questComplete && hasGauntlets) {
npc("Thank you for saving our family honour, ", npc("Thank you for saving our family honour, ",
"We will never forget you") "We will never forget you")
stage = 1000 stage = 1000
return true return true
} }
@ -46,7 +47,7 @@ class DimintheisDialogue(player: Player? = null): core.game.dialogue.DialoguePlu
when(questStage) { when(questStage) {
0 -> npc("Hello. My name is Dimintheis, ", 0 -> npc("Hello. My name is Dimintheis, ",
"of the noble family Fitzharmon.").also { stage = 1 } "of the noble family Fitzharmon.").also { stage = 1 }
10 -> player("Where did you say I could find your son Caleb again?").also { stage = 3000 } 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 } 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 } 12 -> npc("Have you found my crest yet?").also{ stage = 4000 }
@ -64,70 +65,70 @@ class DimintheisDialogue(player: Player? = null): core.game.dialogue.DialoguePlu
override fun handle(interfaceId: Int, buttonId: Int): Boolean { override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when(stage){ when(stage){
1 -> options( 1 -> options(
"Why would a nobleman live in a dump like this?", "Why would a nobleman live in a dump like this?",
"You're rich then? Can i have some money?", "You're rich then? Can i have some money?",
"Hi, i am a bold adventurer.").also { stage++ } "Hi, i am a bold adventurer.").also { stage++ }
2 -> when(buttonId){ 2 -> when(buttonId){
1 -> npc("The King has taken my estate from me ", 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 } "until such time as I can show my family crest to him.").also { stage = 3 }
2 -> npc("Gah! Lousy beggar! " , 2 -> npc("Gah! Lousy beggar! " ,
"Your sort is what's ruining this great land! ", "Your sort is what's ruining this great land! ",
"Why don't you just go and get a " , "Why don't you just go and get a " ,
"job if you need money so badly?").also { stage = 1000} "job if you need money so badly?").also { stage = 1000}
3 -> npc("An adventurer hmmm? How lucky. I may have an adventure for you. " , 3 -> npc("An adventurer hmmm? How lucky. I may have an adventure for you. " ,
"I desperately need my family crest returning to me. " , "I desperately need my family crest returning to me. " ,
"It is of utmost importance.").also { stage = 4 } "It is of utmost importance.").also { stage = 4 }
} }
3 -> options("Why would he do that?", 3 -> options("Why would he do that?",
"So where is this crest?").also { stage = 5 } "So where is this crest?").also { stage = 5 }
4 -> options("Why are you so desperate for it?", 4 -> options("Why are you so desperate for it?",
"So where is this crest?", "So where is this crest?",
"I'm not interested in that adventure right now").also { stage = 6 } "I'm not interested in that adventure right now").also { stage = 6 }
5 -> when(buttonId){ 5 -> when(buttonId){
1-> npc("Well, there is a long standing rule of chivalry " , 1-> npc("Well, there is a long standing rule of chivalry " ,
"amongst the Varrockian aristocracy,").also{ stage = 2000 } "amongst the Varrockian aristocracy,").also{ stage = 2000 }
2-> npc("Well, my three sons took it with them " , 2-> npc("Well, my three sons took it with them " ,
"many years ago when they rode ").also { stage = 2007 } "many years ago when they rode ").also { stage = 2007 }
} }
6 -> when(buttonId){ 6 -> when(buttonId){
1 -> npc("Well, there is a long standing rule of chivalry " , 1 -> npc("Well, there is a long standing rule of chivalry " ,
"amongst the Varrockian aristocracy,").also{ stage = 2000 } "amongst the Varrockian aristocracy,").also{ stage = 2000 }
2 -> npc("Well, my three sons took it with them " , 2 -> npc("Well, my three sons took it with them " ,
"many years ago when they rode ").also { stage = 2007 } "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} 3 -> npc("I realise it was a lot to ask of a stranger.").also { stage = 1000}
} }
2000 -> npc( 2000 -> npc(
"where each noble family is in possession of a unique crest, ", "where each noble family is in possession of a unique crest, ",
"which signifies the honour and lineage of the family. ").also { stage++} "which signifies the honour and lineage of the family. ").also { stage++}
2001 -> npc("More than this however, it also represents the ", 2001 -> npc("More than this however, it also represents the ",
"lawful rights of each family to prove their ownership of ", "lawful rights of each family to prove their ownership of ",
"their wealth and lands. If the family crest is lost,").also { stage++ } "their wealth and lands. If the family crest is lost,").also { stage++ }
2002 -> npc( "then the family's estate is handed over to the ", 2002 -> npc( "then the family's estate is handed over to the ",
"current monarch until the crest is restored.").also{ stage++ } "current monarch until the crest is restored.").also{ stage++ }
2003 -> npc("This dates back to the times when there was much in-fighting " , 2003 -> npc("This dates back to the times when there was much in-fighting " ,
"amongst the noble families and their clans, and ", "amongst the noble families and their clans, and ",
"was introduced as a way of reducing the bloodshed that was ", "was introduced as a way of reducing the bloodshed that was ",
"devastating the ranks of the ruling classes at that time.").also { stage++ } "devastating the ranks of the ruling classes at that time.").also { stage++ }
2004 -> npc("When you captured a rival family's clan, " , 2004 -> npc("When you captured a rival family's clan, " ,
"you also captured their lands and wealth.").also{ stage++} "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++} 2005 -> options("So where is this crest?", "I'm not interested in an adventure right now").also{stage++}
2006 -> when(buttonId){ 2006 -> when(buttonId){
1-> npc("Well, my three sons took it ", 1-> npc("Well, my three sons took it ",
"with them many years ago when they rode out ").also { stage++ } "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 } 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 " , 2007 -> npc("to fight in the war against the undead necromancer " ,
"and his army in the battle to save Varrock.").also { stage++ } "and his army in the battle to save Varrock.").also { stage++ }
2008 -> npc("For many years I had assumed them all dead, " , 2008 -> npc("For many years I had assumed them all dead, " ,
"as I had heard no word from them.").also { stage++ } "as I had heard no word from them.").also { stage++ }
2009 -> npc("Recently I heard that my son Caleb is alive and well, " , 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++ } "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++ } 2010 -> options("Ok, I will help you", "I'm not interested in an adventure right now").also { stage++ }
2011 -> when(buttonId){ 2011 -> when(buttonId){
1 -> npc("I thank you greatly adventurer!").also { stage++ } 1 -> npc("I thank you greatly adventurer!").also { stage++ }
@ -141,38 +142,44 @@ class DimintheisDialogue(player: Player? = null): core.game.dialogue.DialoguePlu
} }
3000 ->npc("The only thing I have heard of my son Caleb ", 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++ } "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 ", 3001 ->npc("I believe he is staying with a friend ",
"who lives just outside the west gates of Varrock.").also{ stage = 1000 } "who lives just outside the west gates of Varrock.").also{ stage = 1000 }
4000 -> player("I'm still looking for it").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, " , 5000 -> npc("Adventurer... I can only thank you for your kindness, " ,
"although the words are insufficient " , "although the words are insufficient " ,
"to express the gratitude I feel!").also{ stage++ } "to express the gratitude I feel!").also{ stage++ }
5001 -> npc("You are truly a hero in every sense, " , 5001 -> npc("You are truly a hero in every sense, " ,
"and perhaps your efforts can begin to " , "and perhaps your efforts can begin to " ,
"patch the wounds that have torn this family apart...").also{ stage++ } "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... " , 5002 -> npc("I know not how I can adequately reward you for your efforts... " ,
"although I do have these mystical gauntlets, " , "although I do have these mystical gauntlets, " ,
"a family heirloom that through some power unknown to me, " , "a family heirloom that through some power unknown to me, " ,
"have always returned to the head of the family whenever lost,").also{ stage++ } "have always returned to the head of the family whenever lost,").also{ stage++ }
5003 -> npc(" or if the owner has died. " , 5003 -> npc(" or if the owner has died. " ,
"I will pledge these to you, " , "I will pledge these to you, " ,
"and if you should lose them return to me, " , "and if you should lose them return to me, " ,
"and they will be here.").also{ stage++ } "and they will be here.").also{ stage++ }
5004 -> npc("They can also be granted extra powers. " , 5004 -> npc("They can also be granted extra powers. " ,
"Take them to one of my sons, " , "Take them to one of my sons, " ,
"they should be able to imbue them with a skill for you.").also { "they should be able to imbue them with a skill for you.").also {
stage = 1000 stage = 1000
if (removeItem(player, Items.FAMILY_CREST_782)) { if (removeItem(player, Items.FAMILY_CREST_782)) {
finishQuest(player, Quests.FAMILY_CREST) finishQuest(player, Quests.FAMILY_CREST)
} }
} }
6000 -> npc("Not to worry, here they are").also { 6000 -> npc("Not to worry, here they are").also {
stage = 1000 stage = 1000
addItem(player, getAttribute(player, "family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778)) addItem(player, getAttribute(player, "family-crest:gauntlets", Items.FAMILY_GAUNTLETS_778))
player.achievementDiaryManager.finishTask(
player,
core.game.node.entity.player.link.diary.DiaryType.VARROCK,
2, // Hard tier (0=Easy, 1=Medium, 2=Hard)
9 // HardTasks.OBTAIN_NEW_SET_OF_FAMILY_CREST_GAUNTLETS
)
} }
1000 -> end() 1000 -> end()