From 5f24050d4b11c35e8c290dd2cbbc87fb0984933a Mon Sep 17 00:00:00 2001 From: Bishop Date: Thu, 18 Jun 2026 22:12:16 -0500 Subject: [PATCH 01/20] SirReniteeDialogue.kt and CrestType.kt --- .../global/skill/construction/CrestType.java | 117 --- .../global/skill/construction/CrestType.kt | 35 + .../falador/dialogue/SirReniteeDialogue.java | 469 ----------- .../falador/dialogue/SirReniteeDialogue.kt | 776 ++++++++++++++++++ 4 files changed, 811 insertions(+), 586 deletions(-) delete mode 100644 Server/src/main/content/global/skill/construction/CrestType.java create mode 100644 Server/src/main/content/global/skill/construction/CrestType.kt delete mode 100644 Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.java create mode 100644 Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt diff --git a/Server/src/main/content/global/skill/construction/CrestType.java b/Server/src/main/content/global/skill/construction/CrestType.java deleted file mode 100644 index 277c77231..000000000 --- a/Server/src/main/content/global/skill/construction/CrestType.java +++ /dev/null @@ -1,117 +0,0 @@ -package content.global.skill.construction; - -import core.game.node.entity.player.Player; -import org.rs09.consts.Items; -import core.game.node.entity.skill.Skills; -import content.data.Quests; - -/** - * Family crest types. - * - * @author Emperor - * >ORDINAL BOUND< - */ -public enum CrestType implements CrestRequirement { - - ARRAV("the Shield of Arrav symbol") { // requires Shield of Arrav - - @Override - public boolean eligible(Player player) { - return player.getQuestRepository().isComplete(Quests.SHIELD_OF_ARRAV); - } - }, - ASGARNIA("the symbol of Asgarnia"), // no requirements - DORGESHUUN("the Dorgeshuun brooch") { // requires The Lost Tribe - - @Override - public boolean eligible(Player player) { - return player.getQuestRepository().isComplete(Quests.THE_LOST_TRIBE); - } - }, - DRAGON("a dragon") { // requires Dragon Slayer - - @Override - public boolean eligible(Player player) { - return player.getQuestRepository().isComplete(Quests.DRAGON_SLAYER); - } - }, - FAIRY("a fairy") { // requries Lost City - - @Override - public boolean eligible(Player player) { - return player.getQuestRepository().isComplete(Quests.LOST_CITY); - } - }, - GUTHIX("the symbol of Guthix") { // Requires 70+ Prayer - - @Override - public boolean eligible(Player player) { - return player.getSkills().hasLevel(Skills.PRAYER, 70); - } - }, - HAM("the symbol of the HAM cult."), // no requirements - HORSE("a horse") { // requires Toy Horsey in inventory - - @Override - public boolean eligible(Player player) { - return player.getInventory().containsAtLeastOneItem(new int[]{ - Items.TOY_HORSEY_2524, - Items.TOY_HORSEY_2520, - Items.TOY_HORSEY_2526, - Items.TOY_HORSEY_2522 - }); - } - }, - JOGRE("Jiggig"), // no requirements - KANDARIN("the symbol of Kandarin"), // no requirements - MISTHALIN("the symbol of Misthalin"), // no requirements - MONEY("a bag of money", 500000), // Costs 500k - SARADOMIN("the symbol of Saradomin") { // Requires 70+ Prayer - - @Override - public boolean eligible(Player player) { - return player.getSkills().hasLevel(Skills.PRAYER, 70); - } - }, - SKULL("a skull") { // requires Skulled while talking to Herald - - @Override - public boolean eligible(Player player) { - return player.getSkullManager().isSkulled(); - } - }, - VARROCK("the symbol of Varrock"), // no requirements - ZAMORAK("the symbol of Zamorak") { // Requires 70+ Prayer - - @Override - public boolean eligible(Player player) { - return player.getSkills().hasLevel(Skills.PRAYER, 70); - } - }; - - private String name; - private int cost; - - CrestType(String name, int cost) { - this.name = name; - this.cost = cost; - } - - CrestType(String name) { - this(name, 5000); - } - - public String getName() { - return this.name; - } - - public int getCost() { - return this.cost; - } -} - -interface CrestRequirement { - default boolean eligible(Player player) { - return true; - } -} \ No newline at end of file diff --git a/Server/src/main/content/global/skill/construction/CrestType.kt b/Server/src/main/content/global/skill/construction/CrestType.kt new file mode 100644 index 000000000..550480f40 --- /dev/null +++ b/Server/src/main/content/global/skill/construction/CrestType.kt @@ -0,0 +1,35 @@ +package content.global.skill.construction + +import content.data.Quests +import core.game.node.entity.player.Player +import core.game.node.entity.skill.Skills +import org.rs09.consts.Items + +/** + * >ORDINAL BOUND< + */ +enum class CrestType(val crestName: String, val cost: Int = 5000, private val requirement: (Player) -> Boolean = { true }) { + + ARRAV("the Shield of Arrav symbol", requirement = { it.questRepository.isComplete(Quests.SHIELD_OF_ARRAV) }), + ASGARNIA("the symbol of Asgarnia"), + DORGESHUUN("the Dorgeshuun brooch", requirement = { it.questRepository.isComplete(Quests.THE_LOST_TRIBE) }), + DRAGON("a dragon", requirement = { it.questRepository.isComplete(Quests.DRAGON_SLAYER) }), + FAIRY("a fairy", requirement = { it.questRepository.isComplete(Quests.LOST_CITY) }), + GUTHIX("the symbol of Guthix", requirement = { it.skills.hasLevel(Skills.PRAYER, 70) }), + HAM("the symbol of the HAM cult."), + HORSE("a horse", requirement = { player -> + player.inventory.containsAtLeastOneItem( + intArrayOf(Items.TOY_HORSEY_2524, Items.TOY_HORSEY_2520, Items.TOY_HORSEY_2526, Items.TOY_HORSEY_2522) + ) + }), + JOGRE("Jiggig"), + KANDARIN("the symbol of Kandarin"), + MISTHALIN("the symbol of Misthalin"), + MONEY("a bag of money", cost = 500000), + SARADOMIN("the symbol of Saradomin", requirement = { it.skills.hasLevel(Skills.PRAYER, 70) }), + SKULL("a skull", requirement = { it.skullManager.isSkulled }), + VARROCK("the symbol of Varrock"), + ZAMORAK("the symbol of Zamorak", requirement = { it.skills.hasLevel(Skills.PRAYER, 70) }); + + fun eligible(player: Player): Boolean = requirement(player) +} \ No newline at end of file diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.java b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.java deleted file mode 100644 index f8f9695c9..000000000 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.java +++ /dev/null @@ -1,469 +0,0 @@ -package content.region.asgarnia.falador.dialogue; - -import core.ServerConstants; -import core.Util; -import core.game.dialogue.DialoguePlugin; -import core.game.dialogue.FacialExpression; -import core.plugin.Initializable; -import org.rs09.consts.Items; -import core.game.node.entity.npc.NPC; -import core.game.node.entity.player.Player; -import core.game.node.entity.player.link.diary.DiaryType; -import core.game.node.item.Item; -import core.tools.RandomFunction; -import core.game.node.entity.skill.Skills; -import content.global.skill.construction.CrestType; - -/** - * Represents the dialogue to handle Sir Renitee - * - * @author afaroutdude - */ -@Initializable -public class SirReniteeDialogue extends DialoguePlugin { - /** - * Constructs a new {@code SirReniteeDialogue} {@code Object}. - */ - public SirReniteeDialogue() { - } - - public SirReniteeDialogue(Player player) { - super(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hmm? What's that, young " + (player.getAppearance().isMale() ? "man" : "woman") + "? What can I do for", "you?"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendOptions("Select an Option", "I don't know, what can you do for me?", "Nothing, thanks"); - stage = 10; - break; - case 10: - switch (buttonId) { - case 1: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I don't know, what can you do for me?"); - stage = 100; - break; - case 2: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Nothing, thanks."); - stage = 30; - break; - } - break; - case 30: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Mmm, well, see you some other time maybe."); - stage = 40; - break; - case 40: - end(); - break; - case 100: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hmm, well, mmm, do you have a family crest? I keep", "track of every " + ServerConstants.SERVER_NAME + " family, you know, so I might", "be able to find yours."); - stage = 110; - break; - case 110: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "I'm also something of an, mmm, a painter. If you've", "met any important persons or visited any nice places I", "could paint them for you."); - stage = 120; - break; - case 120: - interpreter.sendOptions("Select an Option", "Can you see if I have a family crest?", "Can I buy a painting?"); - stage = 130; - break; - case 130: - switch (buttonId) { - case 1: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Can you see if I have a family crest?"); - stage = 200; - break; - case 2: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Can I buy a painting?"); - stage = 500; - break; - } - break; - case 200: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "What is your name?"); - stage = 210; - break; - case 210: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, player.getUsername() + "."); - stage = 220; - break; - case 220: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Mmm, " + player.getUsername() + ", let me see..."); - stage = 230; - break; - case 230: - if (player.getSkills().hasLevel(Skills.CONSTRUCTION, 16)) { - if (player.getAttribute("sir-renitee-assigned-crest", false)) { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "According to my records, your crest is ", player.getHouseManager().getCrest().getName() + "."); - } else { - final int c = RandomFunction.random(4); - final CrestType[] crests = {CrestType.VARROCK, CrestType.ASGARNIA, CrestType.KANDARIN, CrestType.MISTHALIN}; - final CrestType crest = crests[c]; - player.getHouseManager().setCrest(crest); - player.setAttribute("/save:sir-renitee-assigned-crest", true); - String message = "that can be your"; - if (crest == CrestType.VARROCK) { - message = "you can use that city's"; - } - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Well, I don't think you have any noble blood,", - "but I see that your ancestors came from " + Util.enumToString(player.getHouseManager().getCrest().name()) + ",", " so " + message + " crest."); - } - if (!player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR).isComplete(0,4)) { - player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR).updateTask(player,0,4,true); - } - stage = 240; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, - "First thing's first, young " + (player.getAppearance().isMale() ? "man" : "woman") + "! There is not much point", - "in having a family crest if you cannot display it."); - stage = 235; - } - break; - case 235: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You should train construction until you can build a wall", "decoration in your dining room."); - stage = 40; - break; - case 240: - interpreter.sendOptions("Select an Option", "I don't like that crest. Can I have a different one?", "Thanks!"); - stage = 250; - break; - case 250: - switch (buttonId) { - case 1: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I don't like that crest. Can I have a different one?"); - stage = 300; - break; - case 2: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Thanks!"); - stage = 260; - break; - } - break; - case 260: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You're welcome, my " + (player.getAppearance().isMale() ? "boy." : "girl.")); - stage = 40; - break; - case 300: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Mmm, very well. Changing your crest will cost", "5,000 coins."); - if (player.getInventory().getAmount(Items.COINS_995) < 5000) { - stage = 302; - } else { - stage = 305; - } - break; - case 302: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I'll have to go and get some money then."); - stage = 40; - break; - case 305: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "There are sixteen different symbols;", "which one would you like?"); - stage = 310; - break; - case 310: - interpreter.sendOptions("Select an Option", "Shield of Arrav", "Asgarnia", "Dorgeshuun Symbol", "Dragon", "More..."); - stage = 320; - break; - case 320: - switch (buttonId) { - case 1: { - CrestType c = CrestType.ARRAV; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Ah yes, the shield that you helped to retrieve. You have", "certainly earned the right to wear its symbol."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 2: { - CrestType c = CrestType.ASGARNIA; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Ah, splendid, splendid. There is no better symbol", "than that of our fair land!"); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 3: { - CrestType c = CrestType.DORGESHUUN; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Ah yes, our new neighbours under Lumbridge. I hear", "you were the one who made contact with them, jolly good."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hmm, have you ever even met the Dorgeshuun? I don't", "think you should wear their symbol until you have", "made contact with that lost tribe."); - stage = 310; - } - break; - } - case 4: { - CrestType c = CrestType.DRAGON; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "I see you are a mighty dragon-slayer! You have", "certainly earned the right to wear a dragon symbol."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 5: - interpreter.sendOptions("Select an option", "Fairy", "Guthix", "HAM", "Horse", "More..."); - stage = 330; - break; - } - break; - case 330: - switch (buttonId) { - case 1: { - CrestType c = CrestType.FAIRY; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hmm, mmm, yes, everyone likes pretty fairies."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 2: { - CrestType c = CrestType.GUTHIX; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Guthix, god of balance! I'm a Saradominist myself,", "you know, but we all find meaning in our own way, what?"); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You do not seem to be very devoted to any god.", "I will not let you have a divine symbol", "unless you have level 70 prayer."); - stage = 310; - } - break; - } - case 3: { - CrestType c = CrestType.HAM; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hmm, I'm not sure I like that HAM group, their", "beliefs are a little extreme for me.", "But if that's what you want."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 4: { - CrestType c = CrestType.HORSE; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Ah, I see you've brought a toy horse for me to see. An", - "interesting beast. Certainly you can use that as your", - "crest if you like, although it seems a bit strange to me."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "A horse? I know people talk about them, but I'm not at all sure", - "they ever existed. I don't think I could let you use as", - "your symbol unless you can fetch me some kind of model of one."); - stage = 310; - } - break; - } - case 5: - interpreter.sendOptions("Select an option", "Jogre", "Kandarin", "Misthalin", "Money", "More..."); - stage = 340; - break; - } - break; - case 340: - switch (buttonId) { - case 1: { - CrestType c = CrestType.JOGRE; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "A Jungle Ogre, eh? Odd beast, very odd."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 2: { - CrestType c = CrestType.KANDARIN; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Our neighbours in the west? Very good, very good."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 3: { - CrestType c = CrestType.MISTHALIN; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Ah, the fair land of Lumbridge and Varrock."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 4: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You wish to represent yourself by a moneybag?", "I think to make that meaningful I should increase", "the price to 500,000 coins. Do you agree?"); - stage = 342; - break; - case 5: - interpreter.sendOptions("Select an option", "Saradomin", "Skull", "Varrock", "Zamorak", "More..."); - stage = 350; - break; - } - break; - case 341: - interpreter.sendOptions("Select an option", "All right.", "No way!"); - stage = 342; - break; - case 342: - switch (buttonId) { - case 1: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "All right."); - CrestType c = CrestType.MONEY; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost()) { - stage = 343; - } else { - stage = 302; - } - break; - case 2: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No way!"); - stage = 344; - break; - } - break; - case 343: { - CrestType c = CrestType.MONEY; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Thank you very much! You may now use a money-bag", "as your symbol."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 344: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Well we can't have just any pauper using a money-bag", "as a symbol, can we? You'll have to choose a", "different symbol."); - stage = 310; - break; - case 350: - switch (buttonId) { - case 1: { - CrestType c = CrestType.SARADOMIN; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Ah, the great god Saradomin! May he smile on your house", "as you adorn it with his symbol!"); - if (!player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR).isComplete(2,1)) { - player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR).updateTask(player,2,1,true); - } - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You do not seem to be very devoted to any god.", "I will not let you have a divine symbol", "unless you have level 70 prayer."); - stage = 310; - } - break; - } - case 2: { - CrestType c = CrestType.SKULL; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Of, of course you can have a skull symbol, " + (player.getAppearance().isMale() ? "sir!" : "madam!")); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "A symbol of death? You do not seem like a killer to me;", "perhaps some other symbol would suit you better."); - stage = 310; - } - break; - } - case 3: { - CrestType c = CrestType.VARROCK; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Ah, Varrock, a fine city!"); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]"); - stage = 310; - } - break; - } - case 4: { - CrestType c = CrestType.ZAMORAK; - if (c.eligible(player) && player.getInventory().getAmount(Items.COINS_995) > c.getCost() - && player.getInventory().remove(new Item(Items.COINS_995, c.getCost()))) { - player.getHouseManager().setCrest(c); - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "The god of Chaos? It is a terrible thing to worship", "that evil being. But if that is what you wish..."); - stage = 40; - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You do not seem to be very devoted to any god.", "I will not let you have a divine symbol", "unless you have level 70 prayer."); - stage = 310; - } - break; - } - case 5: - interpreter.sendOptions("Select an Option", "Shield of Arrav", "Asgarnia", "Dorgeshuun Symbol", "Dragon", "More..."); - stage = 320; - break; - } - break; - case 500: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - UNIMPLIMENTED]"); - stage = 40; - } - return true; - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new SirReniteeDialogue(player); - } - - @Override - public int[] getIds() { - return new int[]{4249}; - } - -} diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt new file mode 100644 index 000000000..3276943a6 --- /dev/null +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -0,0 +1,776 @@ +package content.region.asgarnia.falador.dialogue + +import content.global.skill.construction.CrestType +import core.ServerConstants +import core.Util +import core.api.getAttribute +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +import core.game.node.entity.npc.NPC +import core.game.node.entity.player.Player +import core.game.node.entity.player.link.diary.DiaryType +import core.game.node.entity.skill.Skills +import core.game.node.item.Item +import core.plugin.Initializable +import core.tools.RandomFunction +import org.rs09.consts.Items.COINS_995 +import org.rs09.consts.NPCs + +/** + * Represents the dialogue to handle Sir Renitee + * + * @author afaroutdude + */ +@Initializable +class SirReniteeDialogue : DialoguePlugin { + /** + * Constructs a new `SirReniteeDialogue` `Object`. + */ + constructor() + + constructor(player: Player?) : super(player) + + override fun open(vararg args: Any?): Boolean { + npc = args[0] as NPC? + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Hmm? What's that, young " + (if (player.appearance + .isMale + ) "man" else "woman") + "? What can I do for", + "you?" + ) + stage = 0 + return true + } + + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + 0 -> { + interpreter.sendOptions("Select an Option", "I don't know, what can you do for me?", "Nothing, thanks") + stage = 10 + } + + 10 -> when (buttonId) { + 1 -> { + interpreter.sendDialogues( + player, + FacialExpression.HALF_GUILTY, + "I don't know, what can you do for me?" + ) + stage = 100 + } + + 2 -> { + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Nothing, thanks.") + stage = 30 + } + } + + 30 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Mmm, well, see you some other time maybe." + ) + stage = 40 + } + + 40 -> end() + 100 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Hmm, well, mmm, do you have a family crest? I keep", + "track of every " + ServerConstants.SERVER_NAME + " family, you know, so I might", + "be able to find yours." + ) + stage = 110 + } + + 110 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "I'm also something of an, mmm, a painter. If you've", + "met any important persons or visited any nice places I", + "could paint them for you." + ) + stage = 120 + } + + 120 -> { + interpreter.sendOptions( + "Select an Option", + "Can you see if I have a family crest?", + "Can I buy a painting?" + ) + stage = 130 + } + + 130 -> when (buttonId) { + 1 -> { + interpreter.sendDialogues( + player, + FacialExpression.HALF_GUILTY, + "Can you see if I have a family crest?" + ) + stage = 200 + } + + 2 -> { + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Can I buy a painting?") + stage = 500 + } + } + + 200 -> { + interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "What is your name?") + stage = 210 + } + + 210 -> { + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, player.username + ".") + stage = 220 + } + + 220 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Mmm, " + player.username + ", let me see..." + ) + stage = 230 + } + + 230 -> if (player.getSkills().hasLevel(Skills.CONSTRUCTION, 16)) { + if (getAttribute(player, "sir-renitee-assigned-crest", false)) { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "According to my records, your crest is ", + player.houseManager.crest.crestName + "." + ) + } else { + val c = RandomFunction.random(4) + val crests = arrayOf( + CrestType.VARROCK, + CrestType.ASGARNIA, + CrestType.KANDARIN, + CrestType.MISTHALIN + ) + val crest = crests[c] + player.houseManager.crest = crest + player.setAttribute("/save:sir-renitee-assigned-crest", true) + var message = "that can be your" + if (crest === CrestType.VARROCK) { + message = "you can use that city's" + } + interpreter.sendDialogues( + npc, FacialExpression.HALF_GUILTY, "Well, I don't think you have any noble blood,", + "but I see that your ancestors came from " + Util.enumToString( + player.houseManager.crest.name + ) + ",", " so $message crest." + ) + } + if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(0, 4)) { + player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 0, 4, true) + } + stage = 240 + } else { + interpreter.sendDialogues( + npc, FacialExpression.HALF_GUILTY, + "First thing's first, young " + (if (player.appearance.isMale + ) "man" else "woman") + "! There is not much point", + "in having a family crest if you cannot display it." + ) + stage = 235 + } + + 235 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "You should train construction until you can build a wall", + "decoration in your dining room." + ) + stage = 40 + } + + 240 -> { + interpreter.sendOptions( + "Select an Option", + "I don't like that crest. Can I have a different one?", + "Thanks!" + ) + stage = 250 + } + + 250 -> when (buttonId) { + 1 -> { + interpreter.sendDialogues( + player, + FacialExpression.HALF_GUILTY, + "I don't like that crest. Can I have a different one?" + ) + stage = 300 + } + + 2 -> { + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Thanks!") + stage = 260 + } + } + + 260 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "You're welcome, my " + (if (player.appearance.isMale) "boy." else "girl.") + ) + stage = 40 + } + + 300 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Mmm, very well. Changing your crest will cost", + "5,000 coins." + ) + if (player.inventory.getAmount(COINS_995) < 5000) { + stage = 302 + } else { + stage = 305 + } + } + + 302 -> { + interpreter.sendDialogues( + player, + FacialExpression.HALF_GUILTY, + "I'll have to go and get some money then." + ) + stage = 40 + } + + 305 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "There are sixteen different symbols;", + "which one would you like?" + ) + stage = 310 + } + + 310 -> { + interpreter.sendOptions( + "Select an Option", + "Shield of Arrav", + "Asgarnia", + "Dorgeshuun Symbol", + "Dragon", + "More..." + ) + stage = 320 + } + + 320 -> when (buttonId) { + 1 -> { + val c = CrestType.ARRAV + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Ah yes, the shield that you helped to retrieve. You have", + "certainly earned the right to wear its symbol." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "[MISSING DIALOGUE - NOT ELIGIBLE]" + ) + stage = 310 + } + } + + 2 -> { + val c = CrestType.ASGARNIA + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Ah, splendid, splendid. There is no better symbol", + "than that of our fair land!" + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "[MISSING DIALOGUE - NOT ELIGIBLE]" + ) + stage = 310 + } + } + + 3 -> { + val c = CrestType.DORGESHUUN + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Ah yes, our new neighbours under Lumbridge. I hear", + "you were the one who made contact with them, jolly good." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Hmm, have you ever even met the Dorgeshuun? I don't", + "think you should wear their symbol until you have", + "made contact with that lost tribe." + ) + stage = 310 + } + } + + 4 -> { + val c = CrestType.DRAGON + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "I see you are a mighty dragon-slayer! You have", + "certainly earned the right to wear a dragon symbol." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "[MISSING DIALOGUE - NOT ELIGIBLE]" + ) + stage = 310 + } + } + + 5 -> { + interpreter.sendOptions("Select an option", "Fairy", "Guthix", "HAM", "Horse", "More...") + stage = 330 + } + } + + 330 -> when (buttonId) { + 1 -> { + val c = CrestType.FAIRY + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Hmm, mmm, yes, everyone likes pretty fairies." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "[MISSING DIALOGUE - NOT ELIGIBLE]" + ) + stage = 310 + } + } + + 2 -> { + val c = CrestType.GUTHIX + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Guthix, god of balance! I'm a Saradominist myself,", + "you know, but we all find meaning in our own way, what?" + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "You do not seem to be very devoted to any god.", + "I will not let you have a divine symbol", + "unless you have level 70 prayer." + ) + stage = 310 + } + } + + 3 -> { + val c = CrestType.HAM + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Hmm, I'm not sure I like that HAM group, their", + "beliefs are a little extreme for me.", + "But if that's what you want." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "[MISSING DIALOGUE - NOT ELIGIBLE]" + ) + stage = 310 + } + } + + 4 -> { + val c = CrestType.HORSE + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, FacialExpression.HALF_GUILTY, "Ah, I see you've brought a toy horse for me to see. An", + "interesting beast. Certainly you can use that as your", + "crest if you like, although it seems a bit strange to me." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "A horse? I know people talk about them, but I'm not at all sure", + "they ever existed. I don't think I could let you use as", + "your symbol unless you can fetch me some kind of model of one." + ) + stage = 310 + } + } + + 5 -> { + interpreter.sendOptions("Select an option", "Jogre", "Kandarin", "Misthalin", "Money", "More...") + stage = 340 + } + } + + 340 -> when (buttonId) { + 1 -> { + val c = CrestType.JOGRE + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "A Jungle Ogre, eh? Odd beast, very odd." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "[MISSING DIALOGUE - NOT ELIGIBLE]" + ) + stage = 310 + } + } + + 2 -> { + val c = CrestType.KANDARIN + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Our neighbours in the west? Very good, very good." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "[MISSING DIALOGUE - NOT ELIGIBLE]" + ) + stage = 310 + } + } + + 3 -> { + val c = CrestType.MISTHALIN + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Ah, the fair land of Lumbridge and Varrock." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "[MISSING DIALOGUE - NOT ELIGIBLE]" + ) + stage = 310 + } + } + + 4 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "You wish to represent yourself by a moneybag?", + "I think to make that meaningful I should increase", + "the price to 500,000 coins. Do you agree?" + ) + stage = 342 + } + + 5 -> { + interpreter.sendOptions("Select an option", "Saradomin", "Skull", "Varrock", "Zamorak", "More...") + stage = 350 + } + } + + 341 -> { + interpreter.sendOptions("Select an option", "All right.", "No way!") + stage = 342 + } + + 342 -> when (buttonId) { + 1 -> { + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "All right.") + val c = CrestType.MONEY + if (c.eligible(player) && player.inventory.getAmount(COINS_995) > c.cost) { + stage = 343 + } else { + stage = 302 + } + } + + 2 -> { + interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No way!") + stage = 344 + } + } + + 343 -> { + val c = CrestType.MONEY + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Thank you very much! You may now use a money-bag", + "as your symbol." + ) + stage = 40 + } else { + interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + stage = 310 + } + } + + 344 -> { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Well we can't have just any pauper using a money-bag", + "as a symbol, can we? You'll have to choose a", + "different symbol." + ) + stage = 310 + } + + 350 -> when (buttonId) { + 1 -> { + val c = CrestType.SARADOMIN + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Ah, the great god Saradomin! May he smile on your house", + "as you adorn it with his symbol!" + ) + if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { + player.achievementDiaryManager.getDiary(DiaryType.FALADOR) + .updateTask(player, 2, 1, true) + } + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "You do not seem to be very devoted to any god.", + "I will not let you have a divine symbol", + "unless you have level 70 prayer." + ) + stage = 310 + } + } + + 2 -> { + val c = CrestType.SKULL + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "Of, of course you can have a skull symbol, " + (if (player.appearance + .isMale + ) "sir!" else "madam!") + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "A symbol of death? You do not seem like a killer to me;", + "perhaps some other symbol would suit you better." + ) + stage = 310 + } + } + + 3 -> { + val c = CrestType.VARROCK + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Ah, Varrock, a fine city!") + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "[MISSING DIALOGUE - NOT ELIGIBLE]" + ) + stage = 310 + } + } + + 4 -> { + val c = CrestType.ZAMORAK + if (c.eligible(player) && player.inventory + .getAmount(COINS_995) > c.cost && player.inventory.remove( + Item(COINS_995, c.cost) + ) + ) { + player.houseManager.crest = c + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "The god of Chaos? It is a terrible thing to worship", + "that evil being. But if that is what you wish..." + ) + stage = 40 + } else { + interpreter.sendDialogues( + npc, + FacialExpression.HALF_GUILTY, + "You do not seem to be very devoted to any god.", + "I will not let you have a divine symbol", + "unless you have level 70 prayer." + ) + stage = 310 + } + } + + 5 -> { + interpreter.sendOptions( + "Select an Option", + "Shield of Arrav", + "Asgarnia", + "Dorgeshuun Symbol", + "Dragon", + "More..." + ) + stage = 320 + } + } + + 500 -> { + interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - UNIMPLIMENTED]") + stage = 40 + } + } + return true + } + + override fun newInstance(player: Player?): DialoguePlugin { + return SirReniteeDialogue(player) + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.SIR_RENITEE_4249) + } +} From 51a3ad061f8bf9b09709c38271453afe9d8230ce Mon Sep 17 00:00:00 2001 From: Bishop Date: Thu, 18 Jun 2026 23:07:50 -0500 Subject: [PATCH 02/20] DialogueLabeller and ContentAPI --- .../global/skill/construction/CrestType.kt | 21 +- .../falador/dialogue/SirReniteeDialogue.kt | 1297 +++++++---------- 2 files changed, 547 insertions(+), 771 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/CrestType.kt b/Server/src/main/content/global/skill/construction/CrestType.kt index 550480f40..99d03f3fd 100644 --- a/Server/src/main/content/global/skill/construction/CrestType.kt +++ b/Server/src/main/content/global/skill/construction/CrestType.kt @@ -1,6 +1,7 @@ package content.global.skill.construction import content.data.Quests +import core.api.* import core.game.node.entity.player.Player import core.game.node.entity.skill.Skills import org.rs09.consts.Items @@ -10,26 +11,22 @@ import org.rs09.consts.Items */ enum class CrestType(val crestName: String, val cost: Int = 5000, private val requirement: (Player) -> Boolean = { true }) { - ARRAV("the Shield of Arrav symbol", requirement = { it.questRepository.isComplete(Quests.SHIELD_OF_ARRAV) }), + ARRAV("the Shield of Arrav symbol", requirement = { isQuestComplete(it, Quests.SHIELD_OF_ARRAV) }), ASGARNIA("the symbol of Asgarnia"), - DORGESHUUN("the Dorgeshuun brooch", requirement = { it.questRepository.isComplete(Quests.THE_LOST_TRIBE) }), - DRAGON("a dragon", requirement = { it.questRepository.isComplete(Quests.DRAGON_SLAYER) }), - FAIRY("a fairy", requirement = { it.questRepository.isComplete(Quests.LOST_CITY) }), - GUTHIX("the symbol of Guthix", requirement = { it.skills.hasLevel(Skills.PRAYER, 70) }), + DORGESHUUN("the Dorgeshuun brooch", requirement = { isQuestComplete(it, Quests.THE_LOST_TRIBE) }), + DRAGON("a dragon", requirement = { isQuestComplete(it, Quests.DRAGON_SLAYER) }), + FAIRY("a fairy", requirement = { isQuestComplete(it, Quests.LOST_CITY) }), + GUTHIX("the symbol of Guthix", requirement = { hasLevelStat(it, Skills.PRAYER, 70) }), HAM("the symbol of the HAM cult."), - HORSE("a horse", requirement = { player -> - player.inventory.containsAtLeastOneItem( - intArrayOf(Items.TOY_HORSEY_2524, Items.TOY_HORSEY_2520, Items.TOY_HORSEY_2526, Items.TOY_HORSEY_2522) - ) - }), + HORSE("a horse", requirement = { anyInInventory(it, Items.TOY_HORSEY_2524, Items.TOY_HORSEY_2520, Items.TOY_HORSEY_2526, Items.TOY_HORSEY_2522) }), JOGRE("Jiggig"), KANDARIN("the symbol of Kandarin"), MISTHALIN("the symbol of Misthalin"), MONEY("a bag of money", cost = 500000), - SARADOMIN("the symbol of Saradomin", requirement = { it.skills.hasLevel(Skills.PRAYER, 70) }), + SARADOMIN("the symbol of Saradomin", requirement = { hasLevelStat(it, Skills.PRAYER, 70) }), SKULL("a skull", requirement = { it.skullManager.isSkulled }), VARROCK("the symbol of Varrock"), - ZAMORAK("the symbol of Zamorak", requirement = { it.skills.hasLevel(Skills.PRAYER, 70) }); + ZAMORAK("the symbol of Zamorak", requirement = { hasLevelStat(it, Skills.PRAYER, 70) }); fun eligible(player: Player): Boolean = requirement(player) } \ No newline at end of file diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index 3276943a6..a5d2139ee 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -3,774 +3,553 @@ package content.region.asgarnia.falador.dialogue import content.global.skill.construction.CrestType import core.ServerConstants import core.Util +import core.api.amountInInventory import core.api.getAttribute -import core.game.dialogue.DialoguePlugin -import core.game.dialogue.FacialExpression +import core.api.hasLevelStat +import core.api.removeItem +import core.api.setAttribute +import core.game.dialogue.ChatAnim +import core.game.dialogue.DialogueLabeller +import core.game.dialogue.DialogueOption +import core.game.interaction.IntType +import core.game.interaction.InteractionListener import core.game.node.entity.npc.NPC -import core.game.node.entity.player.Player import core.game.node.entity.player.link.diary.DiaryType import core.game.node.entity.skill.Skills import core.game.node.item.Item -import core.plugin.Initializable import core.tools.RandomFunction import org.rs09.consts.Items.COINS_995 import org.rs09.consts.NPCs -/** - * Represents the dialogue to handle Sir Renitee - * - * @author afaroutdude - */ -@Initializable -class SirReniteeDialogue : DialoguePlugin { - /** - * Constructs a new `SirReniteeDialogue` `Object`. - */ - constructor() - - constructor(player: Player?) : super(player) - - override fun open(vararg args: Any?): Boolean { - npc = args[0] as NPC? - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Hmm? What's that, young " + (if (player.appearance - .isMale - ) "man" else "woman") + "? What can I do for", - "you?" - ) - stage = 0 - return true - } - - override fun handle(interfaceId: Int, buttonId: Int): Boolean { - when (stage) { - 0 -> { - interpreter.sendOptions("Select an Option", "I don't know, what can you do for me?", "Nothing, thanks") - stage = 10 - } - - 10 -> when (buttonId) { - 1 -> { - interpreter.sendDialogues( - player, - FacialExpression.HALF_GUILTY, - "I don't know, what can you do for me?" - ) - stage = 100 - } - - 2 -> { - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Nothing, thanks.") - stage = 30 - } - } - - 30 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Mmm, well, see you some other time maybe." - ) - stage = 40 - } - - 40 -> end() - 100 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Hmm, well, mmm, do you have a family crest? I keep", - "track of every " + ServerConstants.SERVER_NAME + " family, you know, so I might", - "be able to find yours." - ) - stage = 110 - } - - 110 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "I'm also something of an, mmm, a painter. If you've", - "met any important persons or visited any nice places I", - "could paint them for you." - ) - stage = 120 - } - - 120 -> { - interpreter.sendOptions( - "Select an Option", - "Can you see if I have a family crest?", - "Can I buy a painting?" - ) - stage = 130 - } - - 130 -> when (buttonId) { - 1 -> { - interpreter.sendDialogues( - player, - FacialExpression.HALF_GUILTY, - "Can you see if I have a family crest?" - ) - stage = 200 - } - - 2 -> { - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Can I buy a painting?") - stage = 500 - } - } - - 200 -> { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "What is your name?") - stage = 210 - } - - 210 -> { - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, player.username + ".") - stage = 220 - } - - 220 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Mmm, " + player.username + ", let me see..." - ) - stage = 230 - } - - 230 -> if (player.getSkills().hasLevel(Skills.CONSTRUCTION, 16)) { - if (getAttribute(player, "sir-renitee-assigned-crest", false)) { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "According to my records, your crest is ", - player.houseManager.crest.crestName + "." - ) - } else { - val c = RandomFunction.random(4) - val crests = arrayOf( - CrestType.VARROCK, - CrestType.ASGARNIA, - CrestType.KANDARIN, - CrestType.MISTHALIN - ) - val crest = crests[c] - player.houseManager.crest = crest - player.setAttribute("/save:sir-renitee-assigned-crest", true) - var message = "that can be your" - if (crest === CrestType.VARROCK) { - message = "you can use that city's" - } - interpreter.sendDialogues( - npc, FacialExpression.HALF_GUILTY, "Well, I don't think you have any noble blood,", - "but I see that your ancestors came from " + Util.enumToString( - player.houseManager.crest.name - ) + ",", " so $message crest." - ) - } - if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(0, 4)) { - player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 0, 4, true) - } - stage = 240 - } else { - interpreter.sendDialogues( - npc, FacialExpression.HALF_GUILTY, - "First thing's first, young " + (if (player.appearance.isMale - ) "man" else "woman") + "! There is not much point", - "in having a family crest if you cannot display it." - ) - stage = 235 - } - - 235 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "You should train construction until you can build a wall", - "decoration in your dining room." - ) - stage = 40 - } - - 240 -> { - interpreter.sendOptions( - "Select an Option", - "I don't like that crest. Can I have a different one?", - "Thanks!" - ) - stage = 250 - } - - 250 -> when (buttonId) { - 1 -> { - interpreter.sendDialogues( - player, - FacialExpression.HALF_GUILTY, - "I don't like that crest. Can I have a different one?" - ) - stage = 300 - } - - 2 -> { - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Thanks!") - stage = 260 - } - } - - 260 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "You're welcome, my " + (if (player.appearance.isMale) "boy." else "girl.") - ) - stage = 40 - } - - 300 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Mmm, very well. Changing your crest will cost", - "5,000 coins." - ) - if (player.inventory.getAmount(COINS_995) < 5000) { - stage = 302 - } else { - stage = 305 - } - } - - 302 -> { - interpreter.sendDialogues( - player, - FacialExpression.HALF_GUILTY, - "I'll have to go and get some money then." - ) - stage = 40 - } - - 305 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "There are sixteen different symbols;", - "which one would you like?" - ) - stage = 310 - } - - 310 -> { - interpreter.sendOptions( - "Select an Option", - "Shield of Arrav", - "Asgarnia", - "Dorgeshuun Symbol", - "Dragon", - "More..." - ) - stage = 320 - } - - 320 -> when (buttonId) { - 1 -> { - val c = CrestType.ARRAV - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Ah yes, the shield that you helped to retrieve. You have", - "certainly earned the right to wear its symbol." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "[MISSING DIALOGUE - NOT ELIGIBLE]" - ) - stage = 310 - } - } - - 2 -> { - val c = CrestType.ASGARNIA - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Ah, splendid, splendid. There is no better symbol", - "than that of our fair land!" - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "[MISSING DIALOGUE - NOT ELIGIBLE]" - ) - stage = 310 - } - } - - 3 -> { - val c = CrestType.DORGESHUUN - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Ah yes, our new neighbours under Lumbridge. I hear", - "you were the one who made contact with them, jolly good." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Hmm, have you ever even met the Dorgeshuun? I don't", - "think you should wear their symbol until you have", - "made contact with that lost tribe." - ) - stage = 310 - } - } - - 4 -> { - val c = CrestType.DRAGON - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "I see you are a mighty dragon-slayer! You have", - "certainly earned the right to wear a dragon symbol." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "[MISSING DIALOGUE - NOT ELIGIBLE]" - ) - stage = 310 - } - } - - 5 -> { - interpreter.sendOptions("Select an option", "Fairy", "Guthix", "HAM", "Horse", "More...") - stage = 330 - } - } - - 330 -> when (buttonId) { - 1 -> { - val c = CrestType.FAIRY - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Hmm, mmm, yes, everyone likes pretty fairies." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "[MISSING DIALOGUE - NOT ELIGIBLE]" - ) - stage = 310 - } - } - - 2 -> { - val c = CrestType.GUTHIX - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Guthix, god of balance! I'm a Saradominist myself,", - "you know, but we all find meaning in our own way, what?" - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "You do not seem to be very devoted to any god.", - "I will not let you have a divine symbol", - "unless you have level 70 prayer." - ) - stage = 310 - } - } - - 3 -> { - val c = CrestType.HAM - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Hmm, I'm not sure I like that HAM group, their", - "beliefs are a little extreme for me.", - "But if that's what you want." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "[MISSING DIALOGUE - NOT ELIGIBLE]" - ) - stage = 310 - } - } - - 4 -> { - val c = CrestType.HORSE - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, FacialExpression.HALF_GUILTY, "Ah, I see you've brought a toy horse for me to see. An", - "interesting beast. Certainly you can use that as your", - "crest if you like, although it seems a bit strange to me." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "A horse? I know people talk about them, but I'm not at all sure", - "they ever existed. I don't think I could let you use as", - "your symbol unless you can fetch me some kind of model of one." - ) - stage = 310 - } - } - - 5 -> { - interpreter.sendOptions("Select an option", "Jogre", "Kandarin", "Misthalin", "Money", "More...") - stage = 340 - } - } - - 340 -> when (buttonId) { - 1 -> { - val c = CrestType.JOGRE - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "A Jungle Ogre, eh? Odd beast, very odd." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "[MISSING DIALOGUE - NOT ELIGIBLE]" - ) - stage = 310 - } - } - - 2 -> { - val c = CrestType.KANDARIN - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Our neighbours in the west? Very good, very good." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "[MISSING DIALOGUE - NOT ELIGIBLE]" - ) - stage = 310 - } - } - - 3 -> { - val c = CrestType.MISTHALIN - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Ah, the fair land of Lumbridge and Varrock." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "[MISSING DIALOGUE - NOT ELIGIBLE]" - ) - stage = 310 - } - } - - 4 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "You wish to represent yourself by a moneybag?", - "I think to make that meaningful I should increase", - "the price to 500,000 coins. Do you agree?" - ) - stage = 342 - } - - 5 -> { - interpreter.sendOptions("Select an option", "Saradomin", "Skull", "Varrock", "Zamorak", "More...") - stage = 350 - } - } - - 341 -> { - interpreter.sendOptions("Select an option", "All right.", "No way!") - stage = 342 - } - - 342 -> when (buttonId) { - 1 -> { - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "All right.") - val c = CrestType.MONEY - if (c.eligible(player) && player.inventory.getAmount(COINS_995) > c.cost) { - stage = 343 - } else { - stage = 302 - } - } - - 2 -> { - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No way!") - stage = 344 - } - } - - 343 -> { - val c = CrestType.MONEY - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Thank you very much! You may now use a money-bag", - "as your symbol." - ) - stage = 40 - } else { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - stage = 310 - } - } - - 344 -> { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Well we can't have just any pauper using a money-bag", - "as a symbol, can we? You'll have to choose a", - "different symbol." - ) - stage = 310 - } - - 350 -> when (buttonId) { - 1 -> { - val c = CrestType.SARADOMIN - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Ah, the great god Saradomin! May he smile on your house", - "as you adorn it with his symbol!" - ) - if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { - player.achievementDiaryManager.getDiary(DiaryType.FALADOR) - .updateTask(player, 2, 1, true) - } - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "You do not seem to be very devoted to any god.", - "I will not let you have a divine symbol", - "unless you have level 70 prayer." - ) - stage = 310 - } - } - - 2 -> { - val c = CrestType.SKULL - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "Of, of course you can have a skull symbol, " + (if (player.appearance - .isMale - ) "sir!" else "madam!") - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "A symbol of death? You do not seem like a killer to me;", - "perhaps some other symbol would suit you better." - ) - stage = 310 - } - } - - 3 -> { - val c = CrestType.VARROCK - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Ah, Varrock, a fine city!") - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "[MISSING DIALOGUE - NOT ELIGIBLE]" - ) - stage = 310 - } - } - - 4 -> { - val c = CrestType.ZAMORAK - if (c.eligible(player) && player.inventory - .getAmount(COINS_995) > c.cost && player.inventory.remove( - Item(COINS_995, c.cost) - ) - ) { - player.houseManager.crest = c - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "The god of Chaos? It is a terrible thing to worship", - "that evil being. But if that is what you wish..." - ) - stage = 40 - } else { - interpreter.sendDialogues( - npc, - FacialExpression.HALF_GUILTY, - "You do not seem to be very devoted to any god.", - "I will not let you have a divine symbol", - "unless you have level 70 prayer." - ) - stage = 310 - } - } - - 5 -> { - interpreter.sendOptions( - "Select an Option", - "Shield of Arrav", - "Asgarnia", - "Dorgeshuun Symbol", - "Dragon", - "More..." - ) - stage = 320 - } - } - - 500 -> { - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "[MISSING DIALOGUE - UNIMPLIMENTED]") - stage = 40 - } +class SirReniteeDialogue : InteractionListener { + override fun defineListeners() { + on(NPCs.SIR_RENITEE_4249, IntType.NPC, "talk-to") { player, node -> + DialogueLabeller.open(player, SirReniteeDialogueFile(), node as NPC) + return@on true } - return true - } - - override fun newInstance(player: Player?): DialoguePlugin { - return SirReniteeDialogue(player) - } - - override fun getIds(): IntArray { - return intArrayOf(NPCs.SIR_RENITEE_4249) } } + +class SirReniteeDialogueFile : DialogueLabeller() { + + private companion object { + const val attributeCrest = "/save:sir-renitee-assigned-crest" + + const val labelNothing = "nothing" + const val labelIntro = "intro" + const val labelFamilyCrest = "family-crest" + const val labelNoConstructionLevel = "no-construction-level" + const val labelHasConstructionLevel = "has-construction-level" + const val labelShowExistingCrest = "show-existing-crest" + const val labelShowNewCrest = "show-new-crest" + const val labelCrestOptions = "crest-options" + const val labelThanks = "thanks" + const val labelChangeCrest = "change-crest" + const val labelNoMoney = "no-money" + const val labelChooseSymbol = "choose-symbol" + const val labelCrestPage1 = "crest-page1" + const val labelCrestPage2 = "crest-page2" + const val labelCrestPage3 = "crest-page3" + const val labelCrestPage4 = "crest-page4" + const val labelCrestArrav = "crest-arrav" + const val labelCrestArravOk = "crest-arrav-ok" + const val labelCrestArravFail = "crest-arrav-fail" + const val labelCrestAsgarnia = "crest-asgarnia" + const val labelCrestAsgarniaOk = "crest-asgarnia-ok" + const val labelCrestAsgarniaFail = "crest-asgarnia-fail" + const val labelCrestDorgeshuun = "crest-dorgeshuun" + const val labelCrestDorgeshuunOk = "crest-dorgeshuun-ok" + const val labelCrestDorgeshuunFail = "crest-dorgeshuun-fail" + const val labelCrestDragon = "crest-dragon" + const val labelCrestDragonOk = "crest-dragon-ok" + const val labelCrestDragonFail = "crest-dragon-fail" + const val labelCrestFairy = "crest-fairy" + const val labelCrestFairyOk = "crest-fairy-ok" + const val labelCrestFairyFail = "crest-fairy-fail" + const val labelCrestGuthix = "crest-guthix" + const val labelCrestGuthixOk = "crest-guthix-ok" + const val labelCrestGuthixFail = "crest-guthix-fail" + const val labelCrestHam = "crest-ham" + const val labelCrestHamOk = "crest-ham-ok" + const val labelCrestHamFail = "crest-ham-fail" + const val labelCrestHorse = "crest-horse" + const val labelCrestHorseOk = "crest-horse-ok" + const val labelCrestHorseFail = "crest-horse-fail" + const val labelCrestJogre = "crest-jogre" + const val labelCrestJogreOk = "crest-jogre-ok" + const val labelCrestJogreFail = "crest-jogre-fail" + const val labelCrestKandarin = "crest-kandarin" + const val labelCrestKandarinOk = "crest-kandarin-ok" + const val labelCrestKandarinFail = "crest-kandarin-fail" + const val labelCrestMisthalin = "crest-misthalin" + const val labelCrestMisthalinOk = "crest-misthalin-ok" + const val labelCrestMisthalinFail = "crest-misthalin-fail" + const val labelCrestMoney = "crest-money" + const val labelMoneyAgree = "money-agree" + const val labelMoneyOk = "money-ok" + const val labelMoneyRefuse = "money-refuse" + const val labelCrestSaradomin = "crest-saradomin" + const val labelCrestSaradominOk = "crest-saradomin-ok" + const val labelCrestSaradominFail = "crest-saradomin-fail" + const val labelCrestSkull = "crest-skull" + const val labelCrestSkullOk = "crest-skull-ok" + const val labelCrestSkullFail = "crest-skull-fail" + const val labelCrestVarrock = "crest-varrock" + const val labelCrestVarrockOk = "crest-varrock-ok" + const val labelCrestVarrockFail = "crest-varrock-fail" + const val labelCrestZamorak = "crest-zamorak" + const val labelCrestZamorakOk = "crest-zamorak-ok" + const val labelCrestZamorakFail = "crest-zamorak-fail" + const val labelPainting = "painting" + } + + override fun addConversation() { + npc(ChatAnim.HALF_GUILTY, "Hmm? What's that, young ${if (player!!.isMale) "man" else "woman"}? What can I do for", "you?") + options( + DialogueOption(labelIntro, "I don't know, what can you do for me?", expression = ChatAnim.HALF_GUILTY), + DialogueOption(labelNothing, "Nothing, thanks", spokenText = "Nothing, thanks.", expression = ChatAnim.HALF_GUILTY), + ) + + label(labelNothing) + npc(ChatAnim.HALF_GUILTY, "Mmm, well, see you some other time maybe.") + + label(labelIntro) + npc(ChatAnim.HALF_GUILTY, "Hmm, well, mmm, do you have a family crest? I keep", + "track of every ${ServerConstants.SERVER_NAME} family, you know, so I might", "be able to find yours.") + npc(ChatAnim.HALF_GUILTY, "I'm also something of an, mmm, a painter. If you've", + "met any important persons or visited any nice places I", "could paint them for you.") + options( + DialogueOption(labelFamilyCrest, "Can you see if I have a family crest?", expression = ChatAnim.HALF_GUILTY), + DialogueOption(labelPainting, "Can I buy a painting?", expression = ChatAnim.HALF_GUILTY), + ) + + label(labelFamilyCrest) + npc(ChatAnim.HALF_GUILTY, "What is your name?") + player(ChatAnim.HALF_GUILTY, "${player!!.username}.") + npc(ChatAnim.HALF_GUILTY, "Mmm, ${player!!.username}, let me see...") + exec { player, _ -> + if (hasLevelStat(player, Skills.CONSTRUCTION, 16)) { + loadLabel(player, labelHasConstructionLevel) + } else { + loadLabel(player, labelNoConstructionLevel) + } + } + + label(labelNoConstructionLevel) + npc(ChatAnim.HALF_GUILTY, "First thing's first, young ${if (player!!.isMale) "man" else "woman"}! There is not much point", + "in having a family crest if you cannot display it.") + npc(ChatAnim.HALF_GUILTY, "You should train construction until you can build a wall", + "decoration in your dining room.") + + label(labelHasConstructionLevel) + exec { player, _ -> + if (getAttribute(player, attributeCrest, false)) { + loadLabel(player, labelShowExistingCrest) + } else { + val crests = arrayOf(CrestType.VARROCK, CrestType.ASGARNIA, CrestType.KANDARIN, CrestType.MISTHALIN) + player.houseManager.crest = crests[RandomFunction.random(4)] + setAttribute(player, attributeCrest, true) + loadLabel(player, labelShowNewCrest) + } + if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(0, 4)) { + player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 0, 4, true) + } + } + + label(labelShowExistingCrest) + npc(ChatAnim.HALF_GUILTY, "According to my records, your crest is ", + "${player!!.houseManager.crest.crestName}.") + goto(labelCrestOptions) + + label(labelShowNewCrest) + npc(ChatAnim.HALF_GUILTY, "Well, I don't think you have any noble blood,", + "but I see that your ancestors came from ${Util.enumToString(player!!.houseManager.crest.name)},", + "so ${if (player!!.houseManager.crest == CrestType.VARROCK) "you can use that city's" else "that can be your"} crest.") + goto(labelCrestOptions) + + label(labelCrestOptions) + options( + DialogueOption(labelChangeCrest, "I don't like that crest. Can I have a different one?", expression = ChatAnim.HALF_GUILTY), + DialogueOption(labelThanks, "Thanks!", expression = ChatAnim.HALF_GUILTY), + ) + + label(labelThanks) + npc(ChatAnim.HALF_GUILTY, "You're welcome, my ${if (player!!.isMale) "boy" else "girl"}.") + + label(labelChangeCrest) + npc(ChatAnim.HALF_GUILTY, "Mmm, very well. Changing your crest will cost", "5,000 coins.") + exec { player, _ -> + if (amountInInventory(player, COINS_995) < 5000) { + loadLabel(player, labelNoMoney) + } else { + loadLabel(player, labelChooseSymbol) + } + } + + label(labelNoMoney) + player(ChatAnim.HALF_GUILTY, "I'll have to go and get some money then.") + + label(labelChooseSymbol) + npc(ChatAnim.HALF_GUILTY, "There are sixteen different symbols;", "which one would you like?") + goto(labelCrestPage1) + + label(labelCrestPage1) + options( + DialogueOption(labelCrestArrav, "Shield of Arrav", skipPlayer = true), + DialogueOption(labelCrestAsgarnia, "Asgarnia", skipPlayer = true), + DialogueOption(labelCrestDorgeshuun, "Dorgeshuun Symbol", skipPlayer = true), + DialogueOption(labelCrestDragon, "Dragon", skipPlayer = true), + DialogueOption(labelCrestPage2, "More...", skipPlayer = true), + ) + + label(labelCrestPage2) + options( + DialogueOption(labelCrestFairy, "Fairy", skipPlayer = true), + DialogueOption(labelCrestGuthix, "Guthix", skipPlayer = true), + DialogueOption(labelCrestHam, "HAM", skipPlayer = true), + DialogueOption(labelCrestHorse, "Horse", skipPlayer = true), + DialogueOption(labelCrestPage3, "More...", skipPlayer = true), + ) + + label(labelCrestPage3) + options( + DialogueOption(labelCrestJogre, "Jogre", skipPlayer = true), + DialogueOption(labelCrestKandarin, "Kandarin", skipPlayer = true), + DialogueOption(labelCrestMisthalin, "Misthalin", skipPlayer = true), + DialogueOption(labelCrestMoney, "Money", skipPlayer = true), + DialogueOption(labelCrestPage4, "More...", skipPlayer = true), + ) + + label(labelCrestPage4) + options( + DialogueOption(labelCrestSaradomin, "Saradomin", skipPlayer = true), + DialogueOption(labelCrestSkull, "Skull", skipPlayer = true), + DialogueOption(labelCrestVarrock, "Varrock", skipPlayer = true), + DialogueOption(labelCrestZamorak, "Zamorak", skipPlayer = true), + DialogueOption(labelCrestPage1, "More...", skipPlayer = true), + ) + + /** + * CREST HANDLERS + */ + + label(labelCrestArrav) + exec { player, _ -> + val c = CrestType.ARRAV + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestArravOk) + } else { + loadLabel(player, labelCrestArravFail) + } + } + + label(labelCrestArravOk) + npc(ChatAnim.HALF_GUILTY, "Ah yes, the shield that you helped to retrieve. You have", + "certainly earned the right to wear its symbol.") + + label(labelCrestArravFail) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + goto(labelCrestPage1) + + label(labelCrestAsgarnia) + exec { player, _ -> + val c = CrestType.ASGARNIA + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestAsgarniaOk) + } else { + loadLabel(player, labelCrestAsgarniaFail) + } + } + + label(labelCrestAsgarniaOk) + npc(ChatAnim.HALF_GUILTY, "Ah, splendid, splendid. There is no better symbol", + "than that of our fair land!") + + label(labelCrestAsgarniaFail) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + goto(labelCrestPage1) + + label(labelCrestDorgeshuun) + exec { player, _ -> + val c = CrestType.DORGESHUUN + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestDorgeshuunOk) + } else { + loadLabel(player, labelCrestDorgeshuunFail) + } + } + + label(labelCrestDorgeshuunOk) + npc(ChatAnim.HALF_GUILTY, "Ah yes, our new neighbours under Lumbridge. I hear", + "you were the one who made contact with them, jolly good.") + + label(labelCrestDorgeshuunFail) + npc(ChatAnim.HALF_GUILTY, "Hmm, have you ever even met the Dorgeshuun? I don't", + "think you should wear their symbol until you have", "made contact with that lost tribe.") + goto(labelCrestPage1) + + label(labelCrestDragon) + exec { player, _ -> + val c = CrestType.DRAGON + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestDragonOk) + } else { + loadLabel(player, labelCrestDragonFail) + } + } + + label(labelCrestDragonOk) + npc(ChatAnim.HALF_GUILTY, "I see you are a mighty dragon-slayer! You have", + "certainly earned the right to wear a dragon symbol.") + + label(labelCrestDragonFail) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + goto(labelCrestPage1) + + label(labelCrestFairy) + exec { player, _ -> + val c = CrestType.FAIRY + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestFairyOk) + } else { + loadLabel(player, labelCrestFairyFail) + } + } + + label(labelCrestFairyOk) + npc(ChatAnim.HALF_GUILTY, "Hmm, mmm, yes, everyone likes pretty fairies.") + + label(labelCrestFairyFail) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + goto(labelCrestPage1) + + label(labelCrestGuthix) + exec { player, _ -> + val c = CrestType.GUTHIX + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestGuthixOk) + } else { + loadLabel(player, labelCrestGuthixFail) + } + } + + label(labelCrestGuthixOk) + npc(ChatAnim.HALF_GUILTY, "Guthix, god of balance! I'm a Saradominist myself,", + "you know, but we all find meaning in our own way, what?") + + label(labelCrestGuthixFail) + npc(ChatAnim.HALF_GUILTY, "You do not seem to be very devoted to any god.", + "I will not let you have a divine symbol", "unless you have level 70 prayer.") + goto(labelCrestPage1) + + label(labelCrestHam) + exec { player, _ -> + val c = CrestType.HAM + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestHamOk) + } else { + loadLabel(player, labelCrestHamFail) + } + } + + label(labelCrestHamOk) + npc(ChatAnim.HALF_GUILTY, "Hmm, I'm not sure I like that HAM group, their", + "beliefs are a little extreme for me.", "But if that's what you want.") + + label(labelCrestHamFail) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + goto(labelCrestPage1) + + label(labelCrestHorse) + exec { player, _ -> + val c = CrestType.HORSE + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestHorseOk) + } else { + loadLabel(player, labelCrestHorseFail) + } + } + + label(labelCrestHorseOk) + npc(ChatAnim.HALF_GUILTY, "Ah, I see you've brought a toy horse for me to see. An", + "interesting beast. Certainly you can use that as your", + "crest if you like, although it seems a bit strange to me.") + + label(labelCrestHorseFail) + npc(ChatAnim.HALF_GUILTY, "A horse? I know people talk about them, but I'm not at all sure", + "they ever existed. I don't think I could let you use as", + "your symbol unless you can fetch me some kind of model of one.") + goto(labelCrestPage1) + + label(labelCrestJogre) + exec { player, _ -> + val c = CrestType.JOGRE + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestJogreOk) + } else { + loadLabel(player, labelCrestJogreFail) + } + } + + label(labelCrestJogreOk) + npc(ChatAnim.HALF_GUILTY, "A Jungle Ogre, eh? Odd beast, very odd.") + + label(labelCrestJogreFail) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + goto(labelCrestPage1) + + label(labelCrestKandarin) + exec { player, _ -> + val c = CrestType.KANDARIN + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestKandarinOk) + } else { + loadLabel(player, labelCrestKandarinFail) + } + } + + label(labelCrestKandarinOk) + npc(ChatAnim.HALF_GUILTY, "Our neighbours in the west? Very good, very good.") + + label(labelCrestKandarinFail) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + goto(labelCrestPage1) + + label(labelCrestMisthalin) + exec { player, _ -> + val c = CrestType.MISTHALIN + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestMisthalinOk) + } else { + loadLabel(player, labelCrestMisthalinFail) + } + } + + label(labelCrestMisthalinOk) + npc(ChatAnim.HALF_GUILTY, "Ah, the fair land of Lumbridge and Varrock.") + + label(labelCrestMisthalinFail) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + goto(labelCrestPage1) + + label(labelCrestMoney) + npc(ChatAnim.HALF_GUILTY, "You wish to represent yourself by a moneybag?", + "I think to make that meaningful I should increase", "the price to 500,000 coins. Do you agree?") + options( + DialogueOption(labelMoneyAgree, "All right.", expression = ChatAnim.HALF_GUILTY), + DialogueOption(labelMoneyRefuse, "No way!", expression = ChatAnim.HALF_GUILTY), + ) + + label(labelMoneyAgree) + exec { player, _ -> + val c = CrestType.MONEY + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelMoneyOk) + } else { + loadLabel(player, labelNoMoney) + } + } + + label(labelMoneyOk) + npc(ChatAnim.HALF_GUILTY, "Thank you very much! You may now use a money-bag", "as your symbol.") + + label(labelMoneyRefuse) + npc(ChatAnim.HALF_GUILTY, "Well we can't have just any pauper using a money-bag", + "as a symbol, can we? You'll have to choose a", "different symbol.") + goto(labelCrestPage1) + + label(labelCrestSaradomin) + exec { player, _ -> + val c = CrestType.SARADOMIN + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { + player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 2, 1, true) + } + loadLabel(player, labelCrestSaradominOk) + } else { + loadLabel(player, labelCrestSaradominFail) + } + } + + label(labelCrestSaradominOk) + npc(ChatAnim.HALF_GUILTY, "Ah, the great god Saradomin! May he smile on your house", + "as you adorn it with his symbol!") + + label(labelCrestSaradominFail) + npc(ChatAnim.HALF_GUILTY, "You do not seem to be very devoted to any god.", + "I will not let you have a divine symbol", "unless you have level 70 prayer.") + goto(labelCrestPage1) + + label(labelCrestSkull) + exec { player, _ -> + val c = CrestType.SKULL + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestSkullOk) + } else { + loadLabel(player, labelCrestSkullFail) + } + } + + label(labelCrestSkullOk) + npc(ChatAnim.HALF_GUILTY, "Of, of course you can have a skull symbol, ${if (player!!.isMale) "sir" else "madam"}!") + + label(labelCrestSkullFail) + npc(ChatAnim.HALF_GUILTY, "A symbol of death? You do not seem like a killer to me;", "perhaps some other symbol would suit you better.") + goto(labelCrestPage1) + + label(labelCrestVarrock) + exec { player, _ -> + val c = CrestType.VARROCK + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestVarrockOk) + } else { + loadLabel(player, labelCrestVarrockFail) + } + } + + label(labelCrestVarrockOk) + npc(ChatAnim.HALF_GUILTY, "Ah, Varrock, a fine city!") + + label(labelCrestVarrockFail) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") + goto(labelCrestPage1) + + label(labelCrestZamorak) + exec { player, _ -> + val c = CrestType.ZAMORAK + if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { + player.houseManager.crest = c + loadLabel(player, labelCrestZamorakOk) + } else { + loadLabel(player, labelCrestZamorakFail) + } + } + + label(labelCrestZamorakOk) + npc(ChatAnim.HALF_GUILTY, "The god of Chaos? It is a terrible thing to worship", + "that evil being. But if that is what you wish...") + + label(labelCrestZamorakFail) + npc(ChatAnim.HALF_GUILTY, "You do not seem to be very devoted to any god.", + "I will not let you have a divine symbol", "unless you have level 70 prayer.") + goto(labelCrestPage1) + + label(labelPainting) + npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - UNIMPLIMENTED]") + } +} \ No newline at end of file From b5254004df36b01f3d0a087174d8f5c1d72d586d Mon Sep 17 00:00:00 2001 From: Bishop Date: Thu, 18 Jun 2026 23:37:29 -0500 Subject: [PATCH 03/20] Made it snazzy --- .../global/skill/construction/CrestType.kt | 5 +- .../falador/dialogue/SirReniteeDialogue.kt | 671 +++++++----------- 2 files changed, 245 insertions(+), 431 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/CrestType.kt b/Server/src/main/content/global/skill/construction/CrestType.kt index 99d03f3fd..46dba5bc6 100644 --- a/Server/src/main/content/global/skill/construction/CrestType.kt +++ b/Server/src/main/content/global/skill/construction/CrestType.kt @@ -7,8 +7,11 @@ import core.game.node.entity.skill.Skills import org.rs09.consts.Items /** - * >ORDINAL BOUND< + * Enumerates the various crests the player can have for the Construction skill, as well as their requirements. + * ORDINAL BOUND + * @author Bishop */ + enum class CrestType(val crestName: String, val cost: Int = 5000, private val requirement: (Player) -> Boolean = { true }) { ARRAV("the Shield of Arrav symbol", requirement = { isQuestComplete(it, Quests.SHIELD_OF_ARRAV) }), diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index a5d2139ee..033ccbd75 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -3,11 +3,7 @@ package content.region.asgarnia.falador.dialogue import content.global.skill.construction.CrestType import core.ServerConstants import core.Util -import core.api.amountInInventory -import core.api.getAttribute -import core.api.hasLevelStat -import core.api.removeItem -import core.api.setAttribute +import core.api.* import core.game.dialogue.ChatAnim import core.game.dialogue.DialogueLabeller import core.game.dialogue.DialogueOption @@ -18,9 +14,14 @@ import core.game.node.entity.player.link.diary.DiaryType import core.game.node.entity.skill.Skills import core.game.node.item.Item import core.tools.RandomFunction -import org.rs09.consts.Items.COINS_995 +import org.rs09.consts.Items import org.rs09.consts.NPCs +/** + * Dialogue for Sir Renitee, who manages the player's personal crest for the Construction skill, and sells paintings. + * @author Bishop + */ + class SirReniteeDialogue : InteractionListener { override fun defineListeners() { on(NPCs.SIR_RENITEE_4249, IntType.NPC, "talk-to") { player, node -> @@ -33,10 +34,13 @@ class SirReniteeDialogue : InteractionListener { class SirReniteeDialogueFile : DialogueLabeller() { private companion object { + // Attributes const val attributeCrest = "/save:sir-renitee-assigned-crest" - + const val attributeTempCrest = "sir-renitee-temp-crest" + // Generic labels const val labelNothing = "nothing" const val labelIntro = "intro" + // Crest labels const val labelFamilyCrest = "family-crest" const val labelNoConstructionLevel = "no-construction-level" const val labelHasConstructionLevel = "has-construction-level" @@ -52,504 +56,311 @@ class SirReniteeDialogueFile : DialogueLabeller() { const val labelCrestPage3 = "crest-page3" const val labelCrestPage4 = "crest-page4" const val labelCrestArrav = "crest-arrav" - const val labelCrestArravOk = "crest-arrav-ok" - const val labelCrestArravFail = "crest-arrav-fail" const val labelCrestAsgarnia = "crest-asgarnia" - const val labelCrestAsgarniaOk = "crest-asgarnia-ok" - const val labelCrestAsgarniaFail = "crest-asgarnia-fail" const val labelCrestDorgeshuun = "crest-dorgeshuun" - const val labelCrestDorgeshuunOk = "crest-dorgeshuun-ok" - const val labelCrestDorgeshuunFail = "crest-dorgeshuun-fail" const val labelCrestDragon = "crest-dragon" - const val labelCrestDragonOk = "crest-dragon-ok" - const val labelCrestDragonFail = "crest-dragon-fail" const val labelCrestFairy = "crest-fairy" - const val labelCrestFairyOk = "crest-fairy-ok" - const val labelCrestFairyFail = "crest-fairy-fail" const val labelCrestGuthix = "crest-guthix" - const val labelCrestGuthixOk = "crest-guthix-ok" - const val labelCrestGuthixFail = "crest-guthix-fail" const val labelCrestHam = "crest-ham" - const val labelCrestHamOk = "crest-ham-ok" - const val labelCrestHamFail = "crest-ham-fail" const val labelCrestHorse = "crest-horse" - const val labelCrestHorseOk = "crest-horse-ok" - const val labelCrestHorseFail = "crest-horse-fail" const val labelCrestJogre = "crest-jogre" - const val labelCrestJogreOk = "crest-jogre-ok" - const val labelCrestJogreFail = "crest-jogre-fail" const val labelCrestKandarin = "crest-kandarin" - const val labelCrestKandarinOk = "crest-kandarin-ok" - const val labelCrestKandarinFail = "crest-kandarin-fail" const val labelCrestMisthalin = "crest-misthalin" - const val labelCrestMisthalinOk = "crest-misthalin-ok" - const val labelCrestMisthalinFail = "crest-misthalin-fail" const val labelCrestMoney = "crest-money" + const val labelCrestSaradomin = "crest-saradomin" + const val labelCrestSkull = "crest-skull" + const val labelCrestVarrock = "crest-varrock" + const val labelCrestZamorak = "crest-zamorak" + const val labelCrestBuy = "crest-buy" + const val labelCrestBuyOk = "crest-buy-ok" + const val labelCrestBuyFail = "crest-buy-fail" const val labelMoneyAgree = "money-agree" const val labelMoneyOk = "money-ok" const val labelMoneyRefuse = "money-refuse" - const val labelCrestSaradomin = "crest-saradomin" - const val labelCrestSaradominOk = "crest-saradomin-ok" - const val labelCrestSaradominFail = "crest-saradomin-fail" - const val labelCrestSkull = "crest-skull" - const val labelCrestSkullOk = "crest-skull-ok" - const val labelCrestSkullFail = "crest-skull-fail" - const val labelCrestVarrock = "crest-varrock" - const val labelCrestVarrockOk = "crest-varrock-ok" - const val labelCrestVarrockFail = "crest-varrock-fail" - const val labelCrestZamorak = "crest-zamorak" - const val labelCrestZamorakOk = "crest-zamorak-ok" - const val labelCrestZamorakFail = "crest-zamorak-fail" + // Painting labels const val labelPainting = "painting" } + private fun selectCrest(crestType: CrestType, labelName: String) { + label(labelName) + exec { player, _ -> + setAttribute(player, attributeTempCrest, crestType) + loadLabel(player, labelCrestBuy) + } + } + override fun addConversation() { + + /** + * GENERIC DIALOGUE + */ + npc(ChatAnim.HALF_GUILTY, "Hmm? What's that, young ${if (player!!.isMale) "man" else "woman"}? What can I do for", "you?") - options( - DialogueOption(labelIntro, "I don't know, what can you do for me?", expression = ChatAnim.HALF_GUILTY), - DialogueOption(labelNothing, "Nothing, thanks", spokenText = "Nothing, thanks.", expression = ChatAnim.HALF_GUILTY), - ) + options( + DialogueOption(labelIntro, "I don't know, what can you do for me?", expression = ChatAnim.HALF_GUILTY), + DialogueOption(labelNothing, "Nothing, thanks", spokenText = "Nothing, thanks.", expression = ChatAnim.HALF_GUILTY), + ) label(labelNothing) - npc(ChatAnim.HALF_GUILTY, "Mmm, well, see you some other time maybe.") + npc(ChatAnim.HALF_GUILTY, "Mmm, well, see you some other time maybe.") + + /** + * CREST DIALOGUE + */ label(labelIntro) - npc(ChatAnim.HALF_GUILTY, "Hmm, well, mmm, do you have a family crest? I keep", - "track of every ${ServerConstants.SERVER_NAME} family, you know, so I might", "be able to find yours.") - npc(ChatAnim.HALF_GUILTY, "I'm also something of an, mmm, a painter. If you've", - "met any important persons or visited any nice places I", "could paint them for you.") - options( - DialogueOption(labelFamilyCrest, "Can you see if I have a family crest?", expression = ChatAnim.HALF_GUILTY), - DialogueOption(labelPainting, "Can I buy a painting?", expression = ChatAnim.HALF_GUILTY), - ) + npc(ChatAnim.HALF_GUILTY, "Hmm, well, mmm, do you have a family crest? I keep", + "track of every ${ServerConstants.SERVER_NAME} family, you know, so I might", "be able to find yours.") + npc(ChatAnim.HALF_GUILTY, "I'm also something of an, mmm, a painter. If you've", + "met any important persons or visited any nice places I", "could paint them for you.") + options( + DialogueOption(labelFamilyCrest, "Can you see if I have a family crest?", expression = ChatAnim.HALF_GUILTY), + DialogueOption(labelPainting, "Can I buy a painting?", expression = ChatAnim.HALF_GUILTY), + ) label(labelFamilyCrest) - npc(ChatAnim.HALF_GUILTY, "What is your name?") - player(ChatAnim.HALF_GUILTY, "${player!!.username}.") - npc(ChatAnim.HALF_GUILTY, "Mmm, ${player!!.username}, let me see...") - exec { player, _ -> - if (hasLevelStat(player, Skills.CONSTRUCTION, 16)) { - loadLabel(player, labelHasConstructionLevel) - } else { - loadLabel(player, labelNoConstructionLevel) + npc(ChatAnim.HALF_GUILTY, "What is your name?") + player(ChatAnim.HALF_GUILTY, "${player!!.username}.") + npc(ChatAnim.HALF_GUILTY, "Mmm, ${player!!.username}, let me see...") + exec { player, _ -> + if (hasLevelStat(player, Skills.CONSTRUCTION, 16)) { + loadLabel(player, labelHasConstructionLevel) + } else { + loadLabel(player, labelNoConstructionLevel) + } } - } label(labelNoConstructionLevel) - npc(ChatAnim.HALF_GUILTY, "First thing's first, young ${if (player!!.isMale) "man" else "woman"}! There is not much point", - "in having a family crest if you cannot display it.") - npc(ChatAnim.HALF_GUILTY, "You should train construction until you can build a wall", - "decoration in your dining room.") + npc(ChatAnim.HALF_GUILTY, "First thing's first, young ${if (player!!.isMale) "man" else "woman"}! There is not much point", + "in having a family crest if you cannot display it.") + npc(ChatAnim.HALF_GUILTY, "You should train construction until you can build a wall", + "decoration in your dining room.") label(labelHasConstructionLevel) - exec { player, _ -> - if (getAttribute(player, attributeCrest, false)) { - loadLabel(player, labelShowExistingCrest) - } else { - val crests = arrayOf(CrestType.VARROCK, CrestType.ASGARNIA, CrestType.KANDARIN, CrestType.MISTHALIN) - player.houseManager.crest = crests[RandomFunction.random(4)] - setAttribute(player, attributeCrest, true) - loadLabel(player, labelShowNewCrest) + exec { player, _ -> + if (getAttribute(player, attributeCrest, false)) { + loadLabel(player, labelShowExistingCrest) + } else { + val crests = arrayOf(CrestType.VARROCK, CrestType.ASGARNIA, CrestType.KANDARIN, CrestType.MISTHALIN) + player.houseManager.crest = crests[RandomFunction.random(4)] + setAttribute(player, attributeCrest, true) + loadLabel(player, labelShowNewCrest) + } + if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(0, 4)) { + player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 0, 4, true) + } } - if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(0, 4)) { - player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 0, 4, true) - } - } label(labelShowExistingCrest) - npc(ChatAnim.HALF_GUILTY, "According to my records, your crest is ", - "${player!!.houseManager.crest.crestName}.") - goto(labelCrestOptions) + npc(ChatAnim.HALF_GUILTY, "According to my records, your crest is", + "${player!!.houseManager.crest.crestName}.") + goto(labelCrestOptions) label(labelShowNewCrest) - npc(ChatAnim.HALF_GUILTY, "Well, I don't think you have any noble blood,", - "but I see that your ancestors came from ${Util.enumToString(player!!.houseManager.crest.name)},", - "so ${if (player!!.houseManager.crest == CrestType.VARROCK) "you can use that city's" else "that can be your"} crest.") - goto(labelCrestOptions) + npc(ChatAnim.HALF_GUILTY, "Well, I don't think you have any noble blood,", + "but I see that your ancestors came from ${Util.enumToString(player!!.houseManager.crest.name)},", + "so ${if (player!!.houseManager.crest == CrestType.VARROCK) "you can use that city's" else "that can be your"} crest.") + goto(labelCrestOptions) label(labelCrestOptions) - options( - DialogueOption(labelChangeCrest, "I don't like that crest. Can I have a different one?", expression = ChatAnim.HALF_GUILTY), - DialogueOption(labelThanks, "Thanks!", expression = ChatAnim.HALF_GUILTY), - ) + options( + DialogueOption(labelChangeCrest, "I don't like that crest. Can I have a different one?", expression = ChatAnim.HALF_GUILTY), + DialogueOption(labelThanks, "Thanks!", expression = ChatAnim.HALF_GUILTY), + ) label(labelThanks) - npc(ChatAnim.HALF_GUILTY, "You're welcome, my ${if (player!!.isMale) "boy" else "girl"}.") + npc(ChatAnim.HALF_GUILTY, "You're welcome, my ${if (player!!.isMale) "boy" else "girl"}.") label(labelChangeCrest) - npc(ChatAnim.HALF_GUILTY, "Mmm, very well. Changing your crest will cost", "5,000 coins.") - exec { player, _ -> - if (amountInInventory(player, COINS_995) < 5000) { - loadLabel(player, labelNoMoney) - } else { - loadLabel(player, labelChooseSymbol) + npc(ChatAnim.HALF_GUILTY, "Mmm, very well. Changing your crest will cost", "5,000 coins.") + exec { player, _ -> + if (amountInInventory(player, Items.COINS_995) < 5000) { + loadLabel(player, labelNoMoney) + } else { + loadLabel(player, labelChooseSymbol) + } } - } label(labelNoMoney) - player(ChatAnim.HALF_GUILTY, "I'll have to go and get some money then.") + player(ChatAnim.HALF_GUILTY, "I'll have to go and get some money then.") label(labelChooseSymbol) - npc(ChatAnim.HALF_GUILTY, "There are sixteen different symbols;", "which one would you like?") - goto(labelCrestPage1) + npc(ChatAnim.HALF_GUILTY, "There are sixteen different symbols;", "which one would you like?") + goto(labelCrestPage1) label(labelCrestPage1) - options( - DialogueOption(labelCrestArrav, "Shield of Arrav", skipPlayer = true), - DialogueOption(labelCrestAsgarnia, "Asgarnia", skipPlayer = true), - DialogueOption(labelCrestDorgeshuun, "Dorgeshuun Symbol", skipPlayer = true), - DialogueOption(labelCrestDragon, "Dragon", skipPlayer = true), - DialogueOption(labelCrestPage2, "More...", skipPlayer = true), - ) + options( + DialogueOption(labelCrestArrav, "Shield of Arrav", skipPlayer = true), + DialogueOption(labelCrestAsgarnia, "Asgarnia", skipPlayer = true), + DialogueOption(labelCrestDorgeshuun, "Dorgeshuun Symbol", skipPlayer = true), + DialogueOption(labelCrestDragon, "Dragon", skipPlayer = true), + DialogueOption(labelCrestPage2, "More...", skipPlayer = true), + ) label(labelCrestPage2) - options( - DialogueOption(labelCrestFairy, "Fairy", skipPlayer = true), - DialogueOption(labelCrestGuthix, "Guthix", skipPlayer = true), - DialogueOption(labelCrestHam, "HAM", skipPlayer = true), - DialogueOption(labelCrestHorse, "Horse", skipPlayer = true), - DialogueOption(labelCrestPage3, "More...", skipPlayer = true), - ) + options( + DialogueOption(labelCrestFairy, "Fairy", skipPlayer = true), + DialogueOption(labelCrestGuthix, "Guthix", skipPlayer = true), + DialogueOption(labelCrestHam, "HAM", skipPlayer = true), + DialogueOption(labelCrestHorse, "Horse", skipPlayer = true), + DialogueOption(labelCrestPage3, "More...", skipPlayer = true), + ) label(labelCrestPage3) - options( - DialogueOption(labelCrestJogre, "Jogre", skipPlayer = true), - DialogueOption(labelCrestKandarin, "Kandarin", skipPlayer = true), - DialogueOption(labelCrestMisthalin, "Misthalin", skipPlayer = true), - DialogueOption(labelCrestMoney, "Money", skipPlayer = true), - DialogueOption(labelCrestPage4, "More...", skipPlayer = true), - ) + options( + DialogueOption(labelCrestJogre, "Jogre", skipPlayer = true), + DialogueOption(labelCrestKandarin, "Kandarin", skipPlayer = true), + DialogueOption(labelCrestMisthalin, "Misthalin", skipPlayer = true), + DialogueOption(labelCrestMoney, "Money", skipPlayer = true), + DialogueOption(labelCrestPage4, "More...", skipPlayer = true), + ) label(labelCrestPage4) - options( - DialogueOption(labelCrestSaradomin, "Saradomin", skipPlayer = true), - DialogueOption(labelCrestSkull, "Skull", skipPlayer = true), - DialogueOption(labelCrestVarrock, "Varrock", skipPlayer = true), - DialogueOption(labelCrestZamorak, "Zamorak", skipPlayer = true), - DialogueOption(labelCrestPage1, "More...", skipPlayer = true), - ) + options( + DialogueOption(labelCrestSaradomin, "Saradomin", skipPlayer = true), + DialogueOption(labelCrestSkull, "Skull", skipPlayer = true), + DialogueOption(labelCrestVarrock, "Varrock", skipPlayer = true), + DialogueOption(labelCrestZamorak, "Zamorak", skipPlayer = true), + DialogueOption(labelCrestPage1, "More...", skipPlayer = true), + ) /** * CREST HANDLERS */ - label(labelCrestArrav) - exec { player, _ -> - val c = CrestType.ARRAV - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestArravOk) - } else { - loadLabel(player, labelCrestArravFail) + selectCrest(CrestType.ARRAV, labelCrestArrav) + selectCrest(CrestType.ASGARNIA, labelCrestAsgarnia) + selectCrest(CrestType.DORGESHUUN, labelCrestDorgeshuun) + selectCrest(CrestType.DRAGON, labelCrestDragon) + selectCrest(CrestType.FAIRY, labelCrestFairy) + selectCrest(CrestType.GUTHIX, labelCrestGuthix) + selectCrest(CrestType.HAM, labelCrestHam) + selectCrest(CrestType.HORSE, labelCrestHorse) + selectCrest(CrestType.JOGRE, labelCrestJogre) + selectCrest(CrestType.KANDARIN, labelCrestKandarin) + selectCrest(CrestType.MISTHALIN, labelCrestMisthalin) + selectCrest(CrestType.SARADOMIN, labelCrestSaradomin) + selectCrest(CrestType.SKULL, labelCrestSkull) + selectCrest(CrestType.VARROCK, labelCrestVarrock) + selectCrest(CrestType.ZAMORAK, labelCrestZamorak) + + label(labelCrestBuy) + exec { player, _ -> + val crest = getAttribute(player, attributeTempCrest, CrestType.ARRAV) + if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { + player.houseManager.crest = crest + if (crest == CrestType.SARADOMIN && !player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { + player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 2, 1, true) + } + loadLabel(player, labelCrestBuyOk) + } else { + loadLabel(player, labelCrestBuyFail) + } } - } - label(labelCrestArravOk) - npc(ChatAnim.HALF_GUILTY, "Ah yes, the shield that you helped to retrieve. You have", - "certainly earned the right to wear its symbol.") - - label(labelCrestArravFail) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - goto(labelCrestPage1) - - label(labelCrestAsgarnia) - exec { player, _ -> - val c = CrestType.ASGARNIA - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestAsgarniaOk) - } else { - loadLabel(player, labelCrestAsgarniaFail) + label(labelCrestBuyOk) + manual { player, _ -> + val crest = getAttribute(player, attributeTempCrest, CrestType.ARRAV) + val messages = when (crest) { + CrestType.ARRAV -> + arrayOf("Ah yes, the shield that you helped to retrieve. You have", + "certainly earned the right to wear its symbol.") + CrestType.ASGARNIA -> + arrayOf("Ah, splendid, splendid. There is no better symbol", + "than that of our fair land!") + CrestType.DORGESHUUN -> + arrayOf("Ah yes, our new neighbours under Lumbridge. I hear", + "you were the one who made contact with them, jolly good.") + CrestType.DRAGON -> + arrayOf("I see you are a mighty dragon-slayer! You have", + "certainly earned the right to wear a dragon symbol.") + CrestType.FAIRY -> + arrayOf("Hmm, mmm, yes, everyone likes pretty fairies.") + CrestType.GUTHIX -> + arrayOf("Guthix, god of balance! I'm a Saradominist myself,", + "you know, but we all find meaning in our own way, what?") + CrestType.HAM -> + arrayOf("Hmm, I'm not sure I like that HAM group, their", + "beliefs are a little extreme for me.", "But if that's what you want.") + CrestType.HORSE -> + arrayOf("Ah, I see you've brought a toy horse for me to see. An", + "interesting beast. Certainly you can use that as your", + "crest if you like, although it seems a bit strange to me.") + CrestType.JOGRE -> + arrayOf("A Jungle Ogre, eh? Odd beast, very odd.") + CrestType.KANDARIN -> + arrayOf("Our neighbours in the west? Very good, very good.") + CrestType.MISTHALIN -> + arrayOf("Ah, the fair land of Lumbridge and Varrock.") + CrestType.SARADOMIN -> + arrayOf("Ah, the great god Saradomin! May he smile on your house", + "as you adorn it with his symbol!") + CrestType.SKULL -> + arrayOf("Of, of course you can have a skull symbol, ${if (player.isMale) "sir" else "madam"}!") + CrestType.VARROCK -> + arrayOf("Ah, Varrock, a fine city!") + CrestType.ZAMORAK -> + arrayOf("The god of Chaos? It is a terrible thing to worship", + "that evil being. But if that is what you wish...") + else -> + arrayOf("Error! Report this please!") + } + interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) } - } - label(labelCrestAsgarniaOk) - npc(ChatAnim.HALF_GUILTY, "Ah, splendid, splendid. There is no better symbol", - "than that of our fair land!") - - label(labelCrestAsgarniaFail) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - goto(labelCrestPage1) - - label(labelCrestDorgeshuun) - exec { player, _ -> - val c = CrestType.DORGESHUUN - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestDorgeshuunOk) - } else { - loadLabel(player, labelCrestDorgeshuunFail) + label(labelCrestBuyFail) + manual { player, _ -> + val c = getAttribute(player, attributeTempCrest, CrestType.ARRAV) + val messages = when (c) { + CrestType.DORGESHUUN -> arrayOf("Hmm, have you ever even met the Dorgeshuun? I don't", + "think you should wear their symbol until you have", "made contact with that lost tribe.") + CrestType.GUTHIX, CrestType.SARADOMIN, CrestType.ZAMORAK -> arrayOf("You do not seem to be very devoted to any god.", + "I will not let you have a divine symbol", "unless you have level 70 prayer.") + CrestType.HORSE -> arrayOf("A horse? I know people talk about them, but I'm not at all sure", + "they ever existed. I don't think I could let you use as", + "your symbol unless you can fetch me some kind of model of one.") + CrestType.SKULL -> arrayOf("A symbol of death? You do not seem like a killer to me;", + "perhaps some other symbol would suit you better.") + else -> arrayOf("[MISSING DIALOGUE - NOT ELIGIBLE]") + } + interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) } - } - - label(labelCrestDorgeshuunOk) - npc(ChatAnim.HALF_GUILTY, "Ah yes, our new neighbours under Lumbridge. I hear", - "you were the one who made contact with them, jolly good.") - - label(labelCrestDorgeshuunFail) - npc(ChatAnim.HALF_GUILTY, "Hmm, have you ever even met the Dorgeshuun? I don't", - "think you should wear their symbol until you have", "made contact with that lost tribe.") - goto(labelCrestPage1) - - label(labelCrestDragon) - exec { player, _ -> - val c = CrestType.DRAGON - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestDragonOk) - } else { - loadLabel(player, labelCrestDragonFail) - } - } - - label(labelCrestDragonOk) - npc(ChatAnim.HALF_GUILTY, "I see you are a mighty dragon-slayer! You have", - "certainly earned the right to wear a dragon symbol.") - - label(labelCrestDragonFail) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - goto(labelCrestPage1) - - label(labelCrestFairy) - exec { player, _ -> - val c = CrestType.FAIRY - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestFairyOk) - } else { - loadLabel(player, labelCrestFairyFail) - } - } - - label(labelCrestFairyOk) - npc(ChatAnim.HALF_GUILTY, "Hmm, mmm, yes, everyone likes pretty fairies.") - - label(labelCrestFairyFail) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - goto(labelCrestPage1) - - label(labelCrestGuthix) - exec { player, _ -> - val c = CrestType.GUTHIX - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestGuthixOk) - } else { - loadLabel(player, labelCrestGuthixFail) - } - } - - label(labelCrestGuthixOk) - npc(ChatAnim.HALF_GUILTY, "Guthix, god of balance! I'm a Saradominist myself,", - "you know, but we all find meaning in our own way, what?") - - label(labelCrestGuthixFail) - npc(ChatAnim.HALF_GUILTY, "You do not seem to be very devoted to any god.", - "I will not let you have a divine symbol", "unless you have level 70 prayer.") - goto(labelCrestPage1) - - label(labelCrestHam) - exec { player, _ -> - val c = CrestType.HAM - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestHamOk) - } else { - loadLabel(player, labelCrestHamFail) - } - } - - label(labelCrestHamOk) - npc(ChatAnim.HALF_GUILTY, "Hmm, I'm not sure I like that HAM group, their", - "beliefs are a little extreme for me.", "But if that's what you want.") - - label(labelCrestHamFail) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - goto(labelCrestPage1) - - label(labelCrestHorse) - exec { player, _ -> - val c = CrestType.HORSE - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestHorseOk) - } else { - loadLabel(player, labelCrestHorseFail) - } - } - - label(labelCrestHorseOk) - npc(ChatAnim.HALF_GUILTY, "Ah, I see you've brought a toy horse for me to see. An", - "interesting beast. Certainly you can use that as your", - "crest if you like, although it seems a bit strange to me.") - - label(labelCrestHorseFail) - npc(ChatAnim.HALF_GUILTY, "A horse? I know people talk about them, but I'm not at all sure", - "they ever existed. I don't think I could let you use as", - "your symbol unless you can fetch me some kind of model of one.") - goto(labelCrestPage1) - - label(labelCrestJogre) - exec { player, _ -> - val c = CrestType.JOGRE - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestJogreOk) - } else { - loadLabel(player, labelCrestJogreFail) - } - } - - label(labelCrestJogreOk) - npc(ChatAnim.HALF_GUILTY, "A Jungle Ogre, eh? Odd beast, very odd.") - - label(labelCrestJogreFail) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - goto(labelCrestPage1) - - label(labelCrestKandarin) - exec { player, _ -> - val c = CrestType.KANDARIN - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestKandarinOk) - } else { - loadLabel(player, labelCrestKandarinFail) - } - } - - label(labelCrestKandarinOk) - npc(ChatAnim.HALF_GUILTY, "Our neighbours in the west? Very good, very good.") - - label(labelCrestKandarinFail) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - goto(labelCrestPage1) - - label(labelCrestMisthalin) - exec { player, _ -> - val c = CrestType.MISTHALIN - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestMisthalinOk) - } else { - loadLabel(player, labelCrestMisthalinFail) - } - } - - label(labelCrestMisthalinOk) - npc(ChatAnim.HALF_GUILTY, "Ah, the fair land of Lumbridge and Varrock.") - - label(labelCrestMisthalinFail) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - goto(labelCrestPage1) + goto(labelCrestPage1) + // Money crest has a unique flow since Sir Renitee needs to check the player's cash stack a second time label(labelCrestMoney) - npc(ChatAnim.HALF_GUILTY, "You wish to represent yourself by a moneybag?", - "I think to make that meaningful I should increase", "the price to 500,000 coins. Do you agree?") - options( - DialogueOption(labelMoneyAgree, "All right.", expression = ChatAnim.HALF_GUILTY), - DialogueOption(labelMoneyRefuse, "No way!", expression = ChatAnim.HALF_GUILTY), - ) + npc(ChatAnim.HALF_GUILTY, "You wish to represent yourself by a moneybag?", + "I think to make that meaningful I should increase", "the price to 500,000 coins. Do you agree?") + options( + DialogueOption(labelMoneyAgree, "All right.", expression = ChatAnim.HALF_GUILTY), + DialogueOption(labelMoneyRefuse, "No way!", expression = ChatAnim.HALF_GUILTY), + ) label(labelMoneyAgree) - exec { player, _ -> - val c = CrestType.MONEY - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelMoneyOk) - } else { - loadLabel(player, labelNoMoney) + exec { player, _ -> + val crest = CrestType.MONEY + if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { + player.houseManager.crest = crest + loadLabel(player, labelMoneyOk) + } else { + loadLabel(player, labelNoMoney) + } } - } label(labelMoneyOk) - npc(ChatAnim.HALF_GUILTY, "Thank you very much! You may now use a money-bag", "as your symbol.") + npc(ChatAnim.HALF_GUILTY, "Thank you very much! You may now use a money-bag", "as your symbol.") label(labelMoneyRefuse) - npc(ChatAnim.HALF_GUILTY, "Well we can't have just any pauper using a money-bag", - "as a symbol, can we? You'll have to choose a", "different symbol.") - goto(labelCrestPage1) + npc(ChatAnim.HALF_GUILTY, "Well we can't have just any pauper using a money-bag", + "as a symbol, can we? You'll have to choose a", "different symbol.") + goto(labelCrestPage1) - label(labelCrestSaradomin) - exec { player, _ -> - val c = CrestType.SARADOMIN - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { - player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 2, 1, true) - } - loadLabel(player, labelCrestSaradominOk) - } else { - loadLabel(player, labelCrestSaradominFail) - } - } - - label(labelCrestSaradominOk) - npc(ChatAnim.HALF_GUILTY, "Ah, the great god Saradomin! May he smile on your house", - "as you adorn it with his symbol!") - - label(labelCrestSaradominFail) - npc(ChatAnim.HALF_GUILTY, "You do not seem to be very devoted to any god.", - "I will not let you have a divine symbol", "unless you have level 70 prayer.") - goto(labelCrestPage1) - - label(labelCrestSkull) - exec { player, _ -> - val c = CrestType.SKULL - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestSkullOk) - } else { - loadLabel(player, labelCrestSkullFail) - } - } - - label(labelCrestSkullOk) - npc(ChatAnim.HALF_GUILTY, "Of, of course you can have a skull symbol, ${if (player!!.isMale) "sir" else "madam"}!") - - label(labelCrestSkullFail) - npc(ChatAnim.HALF_GUILTY, "A symbol of death? You do not seem like a killer to me;", "perhaps some other symbol would suit you better.") - goto(labelCrestPage1) - - label(labelCrestVarrock) - exec { player, _ -> - val c = CrestType.VARROCK - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestVarrockOk) - } else { - loadLabel(player, labelCrestVarrockFail) - } - } - - label(labelCrestVarrockOk) - npc(ChatAnim.HALF_GUILTY, "Ah, Varrock, a fine city!") - - label(labelCrestVarrockFail) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - NOT ELIGIBLE]") - goto(labelCrestPage1) - - label(labelCrestZamorak) - exec { player, _ -> - val c = CrestType.ZAMORAK - if (c.eligible(player) && amountInInventory(player, COINS_995) > c.cost && removeItem(player, Item(COINS_995, c.cost))) { - player.houseManager.crest = c - loadLabel(player, labelCrestZamorakOk) - } else { - loadLabel(player, labelCrestZamorakFail) - } - } - - label(labelCrestZamorakOk) - npc(ChatAnim.HALF_GUILTY, "The god of Chaos? It is a terrible thing to worship", - "that evil being. But if that is what you wish...") - - label(labelCrestZamorakFail) - npc(ChatAnim.HALF_GUILTY, "You do not seem to be very devoted to any god.", - "I will not let you have a divine symbol", "unless you have level 70 prayer.") - goto(labelCrestPage1) + /** + * PAINTING HANDLERS + */ label(labelPainting) - npc(ChatAnim.HALF_GUILTY, "[MISSING DIALOGUE - UNIMPLIMENTED]") + npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or a map, maybe?") + } } \ No newline at end of file From ece0365f56dd344cbcaea2b62a04104aa329bcef Mon Sep 17 00:00:00 2001 From: Bishop Date: Sat, 20 Jun 2026 22:12:01 -0500 Subject: [PATCH 04/20] Made it less snazzy --- .../falador/dialogue/SirReniteeDialogue.kt | 209 +++++++----------- 1 file changed, 83 insertions(+), 126 deletions(-) diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index 033ccbd75..d431cb410 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -34,58 +34,15 @@ class SirReniteeDialogue : InteractionListener { class SirReniteeDialogueFile : DialogueLabeller() { private companion object { - // Attributes const val attributeCrest = "/save:sir-renitee-assigned-crest" const val attributeTempCrest = "sir-renitee-temp-crest" - // Generic labels - const val labelNothing = "nothing" - const val labelIntro = "intro" - // Crest labels - const val labelFamilyCrest = "family-crest" - const val labelNoConstructionLevel = "no-construction-level" - const val labelHasConstructionLevel = "has-construction-level" - const val labelShowExistingCrest = "show-existing-crest" - const val labelShowNewCrest = "show-new-crest" - const val labelCrestOptions = "crest-options" - const val labelThanks = "thanks" - const val labelChangeCrest = "change-crest" - const val labelNoMoney = "no-money" - const val labelChooseSymbol = "choose-symbol" - const val labelCrestPage1 = "crest-page1" - const val labelCrestPage2 = "crest-page2" - const val labelCrestPage3 = "crest-page3" - const val labelCrestPage4 = "crest-page4" - const val labelCrestArrav = "crest-arrav" - const val labelCrestAsgarnia = "crest-asgarnia" - const val labelCrestDorgeshuun = "crest-dorgeshuun" - const val labelCrestDragon = "crest-dragon" - const val labelCrestFairy = "crest-fairy" - const val labelCrestGuthix = "crest-guthix" - const val labelCrestHam = "crest-ham" - const val labelCrestHorse = "crest-horse" - const val labelCrestJogre = "crest-jogre" - const val labelCrestKandarin = "crest-kandarin" - const val labelCrestMisthalin = "crest-misthalin" - const val labelCrestMoney = "crest-money" - const val labelCrestSaradomin = "crest-saradomin" - const val labelCrestSkull = "crest-skull" - const val labelCrestVarrock = "crest-varrock" - const val labelCrestZamorak = "crest-zamorak" - const val labelCrestBuy = "crest-buy" - const val labelCrestBuyOk = "crest-buy-ok" - const val labelCrestBuyFail = "crest-buy-fail" - const val labelMoneyAgree = "money-agree" - const val labelMoneyOk = "money-ok" - const val labelMoneyRefuse = "money-refuse" - // Painting labels - const val labelPainting = "painting" } private fun selectCrest(crestType: CrestType, labelName: String) { label(labelName) exec { player, _ -> setAttribute(player, attributeTempCrest, crestType) - loadLabel(player, labelCrestBuy) + loadLabel(player, "crest-buy") } } @@ -97,154 +54,154 @@ class SirReniteeDialogueFile : DialogueLabeller() { npc(ChatAnim.HALF_GUILTY, "Hmm? What's that, young ${if (player!!.isMale) "man" else "woman"}? What can I do for", "you?") options( - DialogueOption(labelIntro, "I don't know, what can you do for me?", expression = ChatAnim.HALF_GUILTY), - DialogueOption(labelNothing, "Nothing, thanks", spokenText = "Nothing, thanks.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("intro", "I don't know, what can you do for me?", expression = ChatAnim.HALF_GUILTY), + DialogueOption("nothing", "Nothing, thanks", spokenText = "Nothing, thanks.", expression = ChatAnim.HALF_GUILTY), ) - label(labelNothing) + label("nothing") npc(ChatAnim.HALF_GUILTY, "Mmm, well, see you some other time maybe.") /** * CREST DIALOGUE */ - label(labelIntro) + label("intro") npc(ChatAnim.HALF_GUILTY, "Hmm, well, mmm, do you have a family crest? I keep", "track of every ${ServerConstants.SERVER_NAME} family, you know, so I might", "be able to find yours.") npc(ChatAnim.HALF_GUILTY, "I'm also something of an, mmm, a painter. If you've", "met any important persons or visited any nice places I", "could paint them for you.") options( - DialogueOption(labelFamilyCrest, "Can you see if I have a family crest?", expression = ChatAnim.HALF_GUILTY), - DialogueOption(labelPainting, "Can I buy a painting?", expression = ChatAnim.HALF_GUILTY), + DialogueOption("family-crest", "Can you see if I have a family crest?", expression = ChatAnim.HALF_GUILTY), + DialogueOption("painting", "Can I buy a painting?", expression = ChatAnim.HALF_GUILTY), ) - label(labelFamilyCrest) + label("family-crest") npc(ChatAnim.HALF_GUILTY, "What is your name?") player(ChatAnim.HALF_GUILTY, "${player!!.username}.") npc(ChatAnim.HALF_GUILTY, "Mmm, ${player!!.username}, let me see...") exec { player, _ -> if (hasLevelStat(player, Skills.CONSTRUCTION, 16)) { - loadLabel(player, labelHasConstructionLevel) + loadLabel(player, "has-construction-level") } else { - loadLabel(player, labelNoConstructionLevel) + loadLabel(player, "no-construction-level") } } - label(labelNoConstructionLevel) + label("no-construction-level") npc(ChatAnim.HALF_GUILTY, "First thing's first, young ${if (player!!.isMale) "man" else "woman"}! There is not much point", "in having a family crest if you cannot display it.") npc(ChatAnim.HALF_GUILTY, "You should train construction until you can build a wall", "decoration in your dining room.") - label(labelHasConstructionLevel) + label("has-construction-level") exec { player, _ -> if (getAttribute(player, attributeCrest, false)) { - loadLabel(player, labelShowExistingCrest) + loadLabel(player, "show-existing-crest") } else { val crests = arrayOf(CrestType.VARROCK, CrestType.ASGARNIA, CrestType.KANDARIN, CrestType.MISTHALIN) player.houseManager.crest = crests[RandomFunction.random(4)] setAttribute(player, attributeCrest, true) - loadLabel(player, labelShowNewCrest) + loadLabel(player, "show-new-crest") } if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(0, 4)) { player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 0, 4, true) } } - label(labelShowExistingCrest) + label("show-existing-crest") npc(ChatAnim.HALF_GUILTY, "According to my records, your crest is", "${player!!.houseManager.crest.crestName}.") - goto(labelCrestOptions) + goto("crest-options") - label(labelShowNewCrest) + label("show-new-crest") npc(ChatAnim.HALF_GUILTY, "Well, I don't think you have any noble blood,", "but I see that your ancestors came from ${Util.enumToString(player!!.houseManager.crest.name)},", "so ${if (player!!.houseManager.crest == CrestType.VARROCK) "you can use that city's" else "that can be your"} crest.") - goto(labelCrestOptions) + goto("crest-options") - label(labelCrestOptions) + label("crest-options") options( - DialogueOption(labelChangeCrest, "I don't like that crest. Can I have a different one?", expression = ChatAnim.HALF_GUILTY), - DialogueOption(labelThanks, "Thanks!", expression = ChatAnim.HALF_GUILTY), + DialogueOption("change-crest", "I don't like that crest. Can I have a different one?", expression = ChatAnim.HALF_GUILTY), + DialogueOption("thanks", "Thanks!", expression = ChatAnim.HALF_GUILTY), ) - label(labelThanks) + label("thanks") npc(ChatAnim.HALF_GUILTY, "You're welcome, my ${if (player!!.isMale) "boy" else "girl"}.") - label(labelChangeCrest) + label("change-crest") npc(ChatAnim.HALF_GUILTY, "Mmm, very well. Changing your crest will cost", "5,000 coins.") exec { player, _ -> if (amountInInventory(player, Items.COINS_995) < 5000) { - loadLabel(player, labelNoMoney) + loadLabel(player, "no-money") } else { - loadLabel(player, labelChooseSymbol) + loadLabel(player, "choose-symbol") } } - label(labelNoMoney) + label("no-money") player(ChatAnim.HALF_GUILTY, "I'll have to go and get some money then.") - label(labelChooseSymbol) + label("choose-symbol") npc(ChatAnim.HALF_GUILTY, "There are sixteen different symbols;", "which one would you like?") - goto(labelCrestPage1) + goto("crest-page1") - label(labelCrestPage1) + label("crest-page1") options( - DialogueOption(labelCrestArrav, "Shield of Arrav", skipPlayer = true), - DialogueOption(labelCrestAsgarnia, "Asgarnia", skipPlayer = true), - DialogueOption(labelCrestDorgeshuun, "Dorgeshuun Symbol", skipPlayer = true), - DialogueOption(labelCrestDragon, "Dragon", skipPlayer = true), - DialogueOption(labelCrestPage2, "More...", skipPlayer = true), + DialogueOption("crest-arrav", "Shield of Arrav", skipPlayer = true), + DialogueOption("crest-asgarnia", "Asgarnia", skipPlayer = true), + DialogueOption("crest-dorgeshuun", "Dorgeshuun Symbol", skipPlayer = true), + DialogueOption("crest-dragon", "Dragon", skipPlayer = true), + DialogueOption("crest-page2", "More...", skipPlayer = true), ) - label(labelCrestPage2) + label("crest-page2") options( - DialogueOption(labelCrestFairy, "Fairy", skipPlayer = true), - DialogueOption(labelCrestGuthix, "Guthix", skipPlayer = true), - DialogueOption(labelCrestHam, "HAM", skipPlayer = true), - DialogueOption(labelCrestHorse, "Horse", skipPlayer = true), - DialogueOption(labelCrestPage3, "More...", skipPlayer = true), + DialogueOption("crest-fairy", "Fairy", skipPlayer = true), + DialogueOption("crest-guthix", "Guthix", skipPlayer = true), + DialogueOption("crest-ham", "HAM", skipPlayer = true), + DialogueOption("crest-horse", "Horse", skipPlayer = true), + DialogueOption("crest-page3", "More...", skipPlayer = true), ) - label(labelCrestPage3) + label("crest-page3") options( - DialogueOption(labelCrestJogre, "Jogre", skipPlayer = true), - DialogueOption(labelCrestKandarin, "Kandarin", skipPlayer = true), - DialogueOption(labelCrestMisthalin, "Misthalin", skipPlayer = true), - DialogueOption(labelCrestMoney, "Money", skipPlayer = true), - DialogueOption(labelCrestPage4, "More...", skipPlayer = true), + DialogueOption("crest-jogre", "Jogre", skipPlayer = true), + DialogueOption("crest-kandarin", "Kandarin", skipPlayer = true), + DialogueOption("crest-misthalin", "Misthalin", skipPlayer = true), + DialogueOption("crest-money", "Money", skipPlayer = true), + DialogueOption("crest-page4", "More...", skipPlayer = true), ) - label(labelCrestPage4) + label("crest-page4") options( - DialogueOption(labelCrestSaradomin, "Saradomin", skipPlayer = true), - DialogueOption(labelCrestSkull, "Skull", skipPlayer = true), - DialogueOption(labelCrestVarrock, "Varrock", skipPlayer = true), - DialogueOption(labelCrestZamorak, "Zamorak", skipPlayer = true), - DialogueOption(labelCrestPage1, "More...", skipPlayer = true), + DialogueOption("crest-saradomin", "Saradomin", skipPlayer = true), + DialogueOption("crest-skull", "Skull", skipPlayer = true), + DialogueOption("crest-varrock", "Varrock", skipPlayer = true), + DialogueOption("crest-zamorak", "Zamorak", skipPlayer = true), + DialogueOption("crest-page1", "More...", skipPlayer = true), ) /** * CREST HANDLERS */ - selectCrest(CrestType.ARRAV, labelCrestArrav) - selectCrest(CrestType.ASGARNIA, labelCrestAsgarnia) - selectCrest(CrestType.DORGESHUUN, labelCrestDorgeshuun) - selectCrest(CrestType.DRAGON, labelCrestDragon) - selectCrest(CrestType.FAIRY, labelCrestFairy) - selectCrest(CrestType.GUTHIX, labelCrestGuthix) - selectCrest(CrestType.HAM, labelCrestHam) - selectCrest(CrestType.HORSE, labelCrestHorse) - selectCrest(CrestType.JOGRE, labelCrestJogre) - selectCrest(CrestType.KANDARIN, labelCrestKandarin) - selectCrest(CrestType.MISTHALIN, labelCrestMisthalin) - selectCrest(CrestType.SARADOMIN, labelCrestSaradomin) - selectCrest(CrestType.SKULL, labelCrestSkull) - selectCrest(CrestType.VARROCK, labelCrestVarrock) - selectCrest(CrestType.ZAMORAK, labelCrestZamorak) + selectCrest(CrestType.ARRAV, "crest-arrav") + selectCrest(CrestType.ASGARNIA, "crest-asgarnia") + selectCrest(CrestType.DORGESHUUN, "crest-dorgeshuun") + selectCrest(CrestType.DRAGON, "crest-dragon") + selectCrest(CrestType.FAIRY, "crest-fairy") + selectCrest(CrestType.GUTHIX, "crest-guthix") + selectCrest(CrestType.HAM, "crest-ham") + selectCrest(CrestType.HORSE, "crest-horse") + selectCrest(CrestType.JOGRE, "crest-jogre") + selectCrest(CrestType.KANDARIN, "crest-kandarin") + selectCrest(CrestType.MISTHALIN, "crest-misthalin") + selectCrest(CrestType.SARADOMIN, "crest-saradomin") + selectCrest(CrestType.SKULL, "crest-skull") + selectCrest(CrestType.VARROCK, "crest-varrock") + selectCrest(CrestType.ZAMORAK, "crest-zamorak") - label(labelCrestBuy) + label("crest-buy") exec { player, _ -> val crest = getAttribute(player, attributeTempCrest, CrestType.ARRAV) if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { @@ -252,13 +209,13 @@ class SirReniteeDialogueFile : DialogueLabeller() { if (crest == CrestType.SARADOMIN && !player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 2, 1, true) } - loadLabel(player, labelCrestBuyOk) + loadLabel(player, "crest-buy-ok") } else { - loadLabel(player, labelCrestBuyFail) + loadLabel(player, "crest-buy-fail") } } - label(labelCrestBuyOk) + label("crest-buy-ok") manual { player, _ -> val crest = getAttribute(player, attributeTempCrest, CrestType.ARRAV) val messages = when (crest) { @@ -308,7 +265,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) } - label(labelCrestBuyFail) + label("crest-buy-fail") manual { player, _ -> val c = getAttribute(player, attributeTempCrest, CrestType.ARRAV) val messages = when (c) { @@ -325,41 +282,41 @@ class SirReniteeDialogueFile : DialogueLabeller() { } interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) } - goto(labelCrestPage1) + goto("crest-page1") // Money crest has a unique flow since Sir Renitee needs to check the player's cash stack a second time - label(labelCrestMoney) + label("crest-money") npc(ChatAnim.HALF_GUILTY, "You wish to represent yourself by a moneybag?", "I think to make that meaningful I should increase", "the price to 500,000 coins. Do you agree?") options( - DialogueOption(labelMoneyAgree, "All right.", expression = ChatAnim.HALF_GUILTY), - DialogueOption(labelMoneyRefuse, "No way!", expression = ChatAnim.HALF_GUILTY), + DialogueOption("money-agree", "All right.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("money-refuse", "No way!", expression = ChatAnim.HALF_GUILTY), ) - label(labelMoneyAgree) + label("money-agree") exec { player, _ -> val crest = CrestType.MONEY if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { player.houseManager.crest = crest - loadLabel(player, labelMoneyOk) + loadLabel(player, "money-ok") } else { - loadLabel(player, labelNoMoney) + loadLabel(player, "no-money") } } - label(labelMoneyOk) + label("money-ok") npc(ChatAnim.HALF_GUILTY, "Thank you very much! You may now use a money-bag", "as your symbol.") - label(labelMoneyRefuse) + label("money-refuse") npc(ChatAnim.HALF_GUILTY, "Well we can't have just any pauper using a money-bag", "as a symbol, can we? You'll have to choose a", "different symbol.") - goto(labelCrestPage1) + goto("crest-page1") /** * PAINTING HANDLERS */ - label(labelPainting) + label("painting") npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or a map, maybe?") } From c9db03a8246dcc41267f34b7e980838b04c5aebd Mon Sep 17 00:00:00 2001 From: Bishop Date: Sat, 20 Jun 2026 23:35:23 -0500 Subject: [PATCH 05/20] Started painting flow --- .../global/skill/construction/CrestType.kt | 33 +- .../global/skill/construction/PaintingType.kt | 51 +++ .../falador/dialogue/SirReniteeDialogue.kt | 318 +++++++++++++----- 3 files changed, 303 insertions(+), 99 deletions(-) create mode 100644 Server/src/main/content/global/skill/construction/PaintingType.kt diff --git a/Server/src/main/content/global/skill/construction/CrestType.kt b/Server/src/main/content/global/skill/construction/CrestType.kt index 46dba5bc6..9780c893b 100644 --- a/Server/src/main/content/global/skill/construction/CrestType.kt +++ b/Server/src/main/content/global/skill/construction/CrestType.kt @@ -7,29 +7,38 @@ import core.game.node.entity.skill.Skills import org.rs09.consts.Items /** - * Enumerates the various crests the player can have for the Construction skill, as well as their requirements. - * ORDINAL BOUND + * Enumerates the various crests the player can purchase for the Construction skill, as well as their requirements. * @author Bishop */ enum class CrestType(val crestName: String, val cost: Int = 5000, private val requirement: (Player) -> Boolean = { true }) { - ARRAV("the Shield of Arrav symbol", requirement = { isQuestComplete(it, Quests.SHIELD_OF_ARRAV) }), + ARRAV("the Shield of Arrav symbol", + requirement = { isQuestComplete(it, Quests.SHIELD_OF_ARRAV) }), ASGARNIA("the symbol of Asgarnia"), - DORGESHUUN("the Dorgeshuun brooch", requirement = { isQuestComplete(it, Quests.THE_LOST_TRIBE) }), - DRAGON("a dragon", requirement = { isQuestComplete(it, Quests.DRAGON_SLAYER) }), - FAIRY("a fairy", requirement = { isQuestComplete(it, Quests.LOST_CITY) }), - GUTHIX("the symbol of Guthix", requirement = { hasLevelStat(it, Skills.PRAYER, 70) }), + DORGESHUUN("the Dorgeshuun brooch", + requirement = { isQuestComplete(it, Quests.THE_LOST_TRIBE) }), + DRAGON("a dragon", + requirement = { isQuestComplete(it, Quests.DRAGON_SLAYER) }), + FAIRY("a fairy", + requirement = { isQuestComplete(it, Quests.LOST_CITY) }), + GUTHIX("the symbol of Guthix", + requirement = { hasLevelStat(it, Skills.PRAYER, 70) }), HAM("the symbol of the HAM cult."), - HORSE("a horse", requirement = { anyInInventory(it, Items.TOY_HORSEY_2524, Items.TOY_HORSEY_2520, Items.TOY_HORSEY_2526, Items.TOY_HORSEY_2522) }), + HORSE("a horse", + requirement = { anyInInventory(it,Items.TOY_HORSEY_2524, Items.TOY_HORSEY_2520, Items.TOY_HORSEY_2526, Items.TOY_HORSEY_2522) }), JOGRE("Jiggig"), KANDARIN("the symbol of Kandarin"), MISTHALIN("the symbol of Misthalin"), - MONEY("a bag of money", cost = 500000), - SARADOMIN("the symbol of Saradomin", requirement = { hasLevelStat(it, Skills.PRAYER, 70) }), - SKULL("a skull", requirement = { it.skullManager.isSkulled }), + MONEY("a bag of money", + cost = 500000), + SARADOMIN("the symbol of Saradomin", + requirement = { hasLevelStat(it, Skills.PRAYER, 70) }), + SKULL("a skull", + requirement = { it.skullManager.isSkulled }), VARROCK("the symbol of Varrock"), - ZAMORAK("the symbol of Zamorak", requirement = { hasLevelStat(it, Skills.PRAYER, 70) }); + ZAMORAK("the symbol of Zamorak", + requirement = { hasLevelStat(it, Skills.PRAYER, 70) }); fun eligible(player: Player): Boolean = requirement(player) } \ No newline at end of file diff --git a/Server/src/main/content/global/skill/construction/PaintingType.kt b/Server/src/main/content/global/skill/construction/PaintingType.kt new file mode 100644 index 000000000..abb6ca08b --- /dev/null +++ b/Server/src/main/content/global/skill/construction/PaintingType.kt @@ -0,0 +1,51 @@ +package content.global.skill.construction + +import content.data.Quests +import core.api.getQuestPoints +import core.api.isQuestComplete +import core.game.node.entity.player.Player +import org.rs09.consts.Items + +/** + * Enumerates the various paintings the player can purchase for the Construction skill, as well as their requirements. + * @author Bishop + */ + +enum class PaintingType(val paintingId: Int, val cost: Int = 1000, private val requirement: (Player) -> Boolean = { true }) { + + ARTHUR(Items.ARTHUR_PORTRAIT_7995, + requirement = { isQuestComplete(it, Quests.HOLY_GRAIL) }), + ELENA(Items.ELENA_PORTRAIT_7996, + requirement = { isQuestComplete(it, Quests.PLAGUE_CITY) }), + ALVIS(Items.KELDAGRIM_PORTRAIT_7997, + requirement = { isQuestComplete(it, Quests.THE_GIANT_DWARF) }), + MISC(Items.MISC_PORTRAIT_7998, + requirement = { isQuestComplete(it, Quests.THRONE_OF_MISCELLANIA) }), + DESERT(Items.DESERT_PAINTING_7999, + cost = 2000, + requirement = { isQuestComplete(it, Quests.THE_FEUD) && isQuestComplete(it, Quests.THE_GOLEM) && + isQuestComplete(it, Quests.THE_TOURIST_TRAP)}), + ISAFDAR(Items.ISAFDAR_PAINTING_8000, + cost = 2000, + requirement = { isQuestComplete(it, Quests.ROVING_ELVES) }), + KARAMJA(Items.KARAMJA_PAINTING_8001, + cost = 2000, + requirement = { isQuestComplete(it, Quests.PIRATES_TREASURE) && isQuestComplete(it, Quests.SHILO_VILLAGE) && + isQuestComplete(it, Quests.TAI_BWO_WANNAI_TRIO) }), + LUMBRIDGE(Items.LUMBRIDGE_PAINTING_8002, + cost = 2000, + requirement = { isQuestComplete(it, Quests.COOKS_ASSISTANT) && isQuestComplete(it, Quests.RUNE_MYSTERIES) && + isQuestComplete(it, Quests.THE_RESTLESS_GHOST) }), + MORYTANIA(Items.MORYTANIA_PAINTING_8003, + cost = 2000, + requirement = { isQuestComplete(it, Quests.CREATURE_OF_FENKENSTRAIN) && isQuestComplete(it, Quests.GHOSTS_AHOY) && + isQuestComplete(it, Quests.HAUNTED_MINE) && isQuestComplete(it, Quests.SHADES_OF_MORTTON) }), + MAP_SMALL(Items.SMALL_MAP_8004, + requirement = { getQuestPoints(it) > 50 }), + MAP_MEDIUM(Items.MEDIUM_MAP_8005, + requirement = { getQuestPoints(it) > 100 }), + MAP_LARGE(Items.LARGE_MAP_8006, + requirement = { getQuestPoints(it) > 150 }); + + fun eligible(player: Player): Boolean = requirement(player) +} \ No newline at end of file diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index d431cb410..b170b5792 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -1,6 +1,7 @@ package content.region.asgarnia.falador.dialogue import content.global.skill.construction.CrestType +import content.global.skill.construction.PaintingType import core.ServerConstants import core.Util import core.api.* @@ -36,16 +37,25 @@ class SirReniteeDialogueFile : DialogueLabeller() { private companion object { const val attributeCrest = "/save:sir-renitee-assigned-crest" const val attributeTempCrest = "sir-renitee-temp-crest" + const val attributeTempPainting = "sir-renitee-temp-painting" } private fun selectCrest(crestType: CrestType, labelName: String) { label(labelName) exec { player, _ -> setAttribute(player, attributeTempCrest, crestType) - loadLabel(player, "crest-buy") + loadLabel(player, "crest_buy") } } + private fun selectPainting(painting: PaintingType, labelName: String) { + label(labelName) + exec { player, _ -> + setAttribute(player, attributeTempPainting, painting) + loadLabel(player, "painting_buy") + } + } + override fun addConversation() { /** @@ -71,153 +81,153 @@ class SirReniteeDialogueFile : DialogueLabeller() { npc(ChatAnim.HALF_GUILTY, "I'm also something of an, mmm, a painter. If you've", "met any important persons or visited any nice places I", "could paint them for you.") options( - DialogueOption("family-crest", "Can you see if I have a family crest?", expression = ChatAnim.HALF_GUILTY), + DialogueOption("family_crest", "Can you see if I have a family crest?", expression = ChatAnim.HALF_GUILTY), DialogueOption("painting", "Can I buy a painting?", expression = ChatAnim.HALF_GUILTY), ) - label("family-crest") + label("family_crest") npc(ChatAnim.HALF_GUILTY, "What is your name?") player(ChatAnim.HALF_GUILTY, "${player!!.username}.") npc(ChatAnim.HALF_GUILTY, "Mmm, ${player!!.username}, let me see...") exec { player, _ -> if (hasLevelStat(player, Skills.CONSTRUCTION, 16)) { - loadLabel(player, "has-construction-level") + loadLabel(player, "has_construction_level") } else { - loadLabel(player, "no-construction-level") + loadLabel(player, "no_construction_level") } } - label("no-construction-level") + label("no_construction_level") npc(ChatAnim.HALF_GUILTY, "First thing's first, young ${if (player!!.isMale) "man" else "woman"}! There is not much point", "in having a family crest if you cannot display it.") npc(ChatAnim.HALF_GUILTY, "You should train construction until you can build a wall", "decoration in your dining room.") - label("has-construction-level") + label("has_construction_level") exec { player, _ -> if (getAttribute(player, attributeCrest, false)) { - loadLabel(player, "show-existing-crest") + loadLabel(player, "show_existing_crest") } else { val crests = arrayOf(CrestType.VARROCK, CrestType.ASGARNIA, CrestType.KANDARIN, CrestType.MISTHALIN) player.houseManager.crest = crests[RandomFunction.random(4)] setAttribute(player, attributeCrest, true) - loadLabel(player, "show-new-crest") + loadLabel(player, "show_new_crest") } if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(0, 4)) { player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 0, 4, true) } } - label("show-existing-crest") + label("show_existing_crest") npc(ChatAnim.HALF_GUILTY, "According to my records, your crest is", "${player!!.houseManager.crest.crestName}.") - goto("crest-options") + goto("crest_options") - label("show-new-crest") + label("show_new_crest") npc(ChatAnim.HALF_GUILTY, "Well, I don't think you have any noble blood,", "but I see that your ancestors came from ${Util.enumToString(player!!.houseManager.crest.name)},", "so ${if (player!!.houseManager.crest == CrestType.VARROCK) "you can use that city's" else "that can be your"} crest.") - goto("crest-options") + goto("crest_options") - label("crest-options") + label("crest_options") options( - DialogueOption("change-crest", "I don't like that crest. Can I have a different one?", expression = ChatAnim.HALF_GUILTY), + DialogueOption("change_crest", "I don't like that crest. Can I have a different one?", expression = ChatAnim.HALF_GUILTY), DialogueOption("thanks", "Thanks!", expression = ChatAnim.HALF_GUILTY), ) label("thanks") npc(ChatAnim.HALF_GUILTY, "You're welcome, my ${if (player!!.isMale) "boy" else "girl"}.") - label("change-crest") + label("change_crest") npc(ChatAnim.HALF_GUILTY, "Mmm, very well. Changing your crest will cost", "5,000 coins.") exec { player, _ -> if (amountInInventory(player, Items.COINS_995) < 5000) { - loadLabel(player, "no-money") + loadLabel(player, "no_money") } else { - loadLabel(player, "choose-symbol") + loadLabel(player, "choose_symbol") } } - label("no-money") + label("no_money") player(ChatAnim.HALF_GUILTY, "I'll have to go and get some money then.") - label("choose-symbol") + label("choose_symbol") npc(ChatAnim.HALF_GUILTY, "There are sixteen different symbols;", "which one would you like?") - goto("crest-page1") + goto("crest_page1") - label("crest-page1") + label("crest_page1") options( - DialogueOption("crest-arrav", "Shield of Arrav", skipPlayer = true), - DialogueOption("crest-asgarnia", "Asgarnia", skipPlayer = true), - DialogueOption("crest-dorgeshuun", "Dorgeshuun Symbol", skipPlayer = true), - DialogueOption("crest-dragon", "Dragon", skipPlayer = true), - DialogueOption("crest-page2", "More...", skipPlayer = true), + DialogueOption("crest_arrav", "Shield of Arrav", skipPlayer = true), + DialogueOption("crest_asgarnia", "Asgarnia", skipPlayer = true), + DialogueOption("crest_dorgeshuun", "Dorgeshuun Symbol", skipPlayer = true), + DialogueOption("crest_dragon", "Dragon", skipPlayer = true), + DialogueOption("crest_page2", "More...", skipPlayer = true), ) - label("crest-page2") + label("crest_page2") options( - DialogueOption("crest-fairy", "Fairy", skipPlayer = true), - DialogueOption("crest-guthix", "Guthix", skipPlayer = true), - DialogueOption("crest-ham", "HAM", skipPlayer = true), - DialogueOption("crest-horse", "Horse", skipPlayer = true), - DialogueOption("crest-page3", "More...", skipPlayer = true), + DialogueOption("crest_fairy", "Fairy", skipPlayer = true), + DialogueOption("crest_guthix", "Guthix", skipPlayer = true), + DialogueOption("crest_ham", "HAM", skipPlayer = true), + DialogueOption("crest_horse", "Horse", skipPlayer = true), + DialogueOption("crest_page3", "More...", skipPlayer = true), ) - label("crest-page3") + label("crest_page3") options( - DialogueOption("crest-jogre", "Jogre", skipPlayer = true), - DialogueOption("crest-kandarin", "Kandarin", skipPlayer = true), - DialogueOption("crest-misthalin", "Misthalin", skipPlayer = true), - DialogueOption("crest-money", "Money", skipPlayer = true), - DialogueOption("crest-page4", "More...", skipPlayer = true), + DialogueOption("crest_jogre", "Jogre", skipPlayer = true), + DialogueOption("crest_kandarin", "Kandarin", skipPlayer = true), + DialogueOption("crest_misthalin", "Misthalin", skipPlayer = true), + DialogueOption("crest_money", "Money", skipPlayer = true), + DialogueOption("crest_page4", "More...", skipPlayer = true), ) - label("crest-page4") + label("crest_page4") options( - DialogueOption("crest-saradomin", "Saradomin", skipPlayer = true), - DialogueOption("crest-skull", "Skull", skipPlayer = true), - DialogueOption("crest-varrock", "Varrock", skipPlayer = true), - DialogueOption("crest-zamorak", "Zamorak", skipPlayer = true), - DialogueOption("crest-page1", "More...", skipPlayer = true), + DialogueOption("crest_saradomin", "Saradomin", skipPlayer = true), + DialogueOption("crest_skull", "Skull", skipPlayer = true), + DialogueOption("crest_varrock", "Varrock", skipPlayer = true), + DialogueOption("crest_zamorak", "Zamorak", skipPlayer = true), + DialogueOption("crest_page1", "More...", skipPlayer = true), ) /** - * CREST HANDLERS + * CREST CHECKOUT */ - selectCrest(CrestType.ARRAV, "crest-arrav") - selectCrest(CrestType.ASGARNIA, "crest-asgarnia") - selectCrest(CrestType.DORGESHUUN, "crest-dorgeshuun") - selectCrest(CrestType.DRAGON, "crest-dragon") - selectCrest(CrestType.FAIRY, "crest-fairy") - selectCrest(CrestType.GUTHIX, "crest-guthix") - selectCrest(CrestType.HAM, "crest-ham") - selectCrest(CrestType.HORSE, "crest-horse") - selectCrest(CrestType.JOGRE, "crest-jogre") - selectCrest(CrestType.KANDARIN, "crest-kandarin") - selectCrest(CrestType.MISTHALIN, "crest-misthalin") - selectCrest(CrestType.SARADOMIN, "crest-saradomin") - selectCrest(CrestType.SKULL, "crest-skull") - selectCrest(CrestType.VARROCK, "crest-varrock") - selectCrest(CrestType.ZAMORAK, "crest-zamorak") + selectCrest(CrestType.ARRAV, "crest_arrav") + selectCrest(CrestType.ASGARNIA, "crest_asgarnia") + selectCrest(CrestType.DORGESHUUN, "crest_dorgeshuun") + selectCrest(CrestType.DRAGON, "crest_dragon") + selectCrest(CrestType.FAIRY, "crest_fairy") + selectCrest(CrestType.GUTHIX, "crest_guthix") + selectCrest(CrestType.HAM, "crest_ham") + selectCrest(CrestType.HORSE, "crest_horse") + selectCrest(CrestType.JOGRE, "crest_jogre") + selectCrest(CrestType.KANDARIN, "crest_kandarin") + selectCrest(CrestType.MISTHALIN, "crest_misthalin") + selectCrest(CrestType.SARADOMIN, "crest_saradomin") + selectCrest(CrestType.SKULL, "crest_skull") + selectCrest(CrestType.VARROCK, "crest_varrock") + selectCrest(CrestType.ZAMORAK, "crest_zamorak") - label("crest-buy") + label("crest_buy") exec { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.ARRAV) + val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { player.houseManager.crest = crest if (crest == CrestType.SARADOMIN && !player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 2, 1, true) } - loadLabel(player, "crest-buy-ok") + loadLabel(player, "crest_buy_ok") } else { - loadLabel(player, "crest-buy-fail") + loadLabel(player, "crest_buy_fail") } } - label("crest-buy-ok") + label("crest_buy_ok") manual { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.ARRAV) + val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) val messages = when (crest) { CrestType.ARRAV -> arrayOf("Ah yes, the shield that you helped to retrieve. You have", @@ -265,59 +275,193 @@ class SirReniteeDialogueFile : DialogueLabeller() { interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) } - label("crest-buy-fail") + label("crest_buy_fail") manual { player, _ -> - val c = getAttribute(player, attributeTempCrest, CrestType.ARRAV) - val messages = when (c) { - CrestType.DORGESHUUN -> arrayOf("Hmm, have you ever even met the Dorgeshuun? I don't", - "think you should wear their symbol until you have", "made contact with that lost tribe.") - CrestType.GUTHIX, CrestType.SARADOMIN, CrestType.ZAMORAK -> arrayOf("You do not seem to be very devoted to any god.", - "I will not let you have a divine symbol", "unless you have level 70 prayer.") - CrestType.HORSE -> arrayOf("A horse? I know people talk about them, but I'm not at all sure", + val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) + val messages = when (crest) { + CrestType.ARRAV -> + arrayOf("PLACEHOLDER") + CrestType.ASGARNIA -> + arrayOf("PLACEHOLDER") + CrestType.DORGESHUUN -> + arrayOf("Hmm, have you ever even met the Dorgeshuun? I don't", + "think you should wear their symbol until you have", + "made contact with that lost tribe.") + CrestType.DRAGON -> + arrayOf("PLACEHOLDER") + CrestType.FAIRY -> + arrayOf("PLACEHOLDER") + CrestType.GUTHIX, CrestType.SARADOMIN, CrestType.ZAMORAK -> + arrayOf("You do not seem to be very devoted to any god.", + "I will not let you have a divine symbol", + "unless you have level 70 prayer.") + CrestType.HAM -> + arrayOf("PLACEHOLDER") + CrestType.HORSE -> + arrayOf("A horse? I know people talk about them, but I'm not at all sure", "they ever existed. I don't think I could let you use as", "your symbol unless you can fetch me some kind of model of one.") - CrestType.SKULL -> arrayOf("A symbol of death? You do not seem like a killer to me;", + CrestType.JOGRE -> + arrayOf("PLACEHOLDER") + CrestType.KANDARIN -> + arrayOf("PLACEHOLDER") + CrestType.MISTHALIN -> + arrayOf("PLACEHOLDER") + CrestType.SKULL -> + arrayOf("A symbol of death? You do not seem like a killer to me;", "perhaps some other symbol would suit you better.") + CrestType.VARROCK -> + arrayOf("PLACEHOLDER") else -> arrayOf("[MISSING DIALOGUE - NOT ELIGIBLE]") } interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) } - goto("crest-page1") + goto("crest_page1") // Money crest has a unique flow since Sir Renitee needs to check the player's cash stack a second time - label("crest-money") + label("crest_money") npc(ChatAnim.HALF_GUILTY, "You wish to represent yourself by a moneybag?", "I think to make that meaningful I should increase", "the price to 500,000 coins. Do you agree?") options( - DialogueOption("money-agree", "All right.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("money-refuse", "No way!", expression = ChatAnim.HALF_GUILTY), + DialogueOption("money_accept", "All right.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("money_refuse", "No way!", expression = ChatAnim.HALF_GUILTY), ) - label("money-agree") + label("money_accept") exec { player, _ -> val crest = CrestType.MONEY if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { player.houseManager.crest = crest - loadLabel(player, "money-ok") + loadLabel(player, "money_ok") } else { - loadLabel(player, "no-money") + loadLabel(player, "no_money") } } - label("money-ok") + label("money_ok") npc(ChatAnim.HALF_GUILTY, "Thank you very much! You may now use a money-bag", "as your symbol.") - label("money-refuse") + label("money_refuse") npc(ChatAnim.HALF_GUILTY, "Well we can't have just any pauper using a money-bag", "as a symbol, can we? You'll have to choose a", "different symbol.") - goto("crest-page1") + goto("crest_page1") /** - * PAINTING HANDLERS + * PAINTING DIALOGUE */ label("painting") npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or a map, maybe?") + goto("painting_options") + label("painting_options") + options( + DialogueOption("portrait", "A portrait please.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("landscape", "A landscape please.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("map", "A map please.", expression = ChatAnim.HALF_GUILTY), + ) + + /** + * PORTRAITS + */ + + label("portrait") + npc(ChatAnim.HALF_GUILTY, "Mmm, well, there are a few portraits I can paint. I can only let you have one if you've got some connection with that person though. Who would you like?") + options( + DialogueOption("portrait_arthur", "King Arthur", skipPlayer = true), + DialogueOption("portrait_elena", "Elena of Ardougne", expression = ChatAnim.HALF_GUILTY), + DialogueOption("portrait_alvis", "King Alvis of Keldagrim", expression = ChatAnim.HALF_GUILTY), + DialogueOption("portrait_misc", "The Prince and Princess of Miscellania", expression = ChatAnim.HALF_GUILTY), + ) + + /** + * LANDSCAPES + */ + + label("landscape") + npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or a map, maybe?") + + /** + * MAPS + */ + + label("map") + npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or a map, maybe?") + + /** + * PAINTING CHECKOUT + */ + + selectPainting(PaintingType.ARTHUR, "portrait_arthur") + selectPainting(PaintingType.ELENA, "portrait_elena") + selectPainting(PaintingType.ALVIS, "portrait_alvis") + selectPainting(PaintingType.MISC, "portrait_misc") + selectPainting(PaintingType.DESERT, "landscape_desert") + selectPainting(PaintingType.ISAFDAR, "landscape_isafdar") + selectPainting(PaintingType.KARAMJA, "landscape_karamja") + selectPainting(PaintingType.LUMBRIDGE, "portrait_lumbridge") + selectPainting(PaintingType.MORYTANIA, "landscape_morytania") + selectPainting(PaintingType.MAP_SMALL, "map_small") + selectPainting(PaintingType.MAP_MEDIUM, "map_medium") + selectPainting(PaintingType.MAP_LARGE, "map_large") + + label("painting_buy") + exec { player, _ -> + val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + when { + (painting.eligible(player) && inInventory(player, Items.COINS_995, painting.cost)) -> + loadLabel(player, "painting_buy_ok") + (painting.eligible(player)) -> + loadLabel(player, "painting_buy_poor") + else -> + loadLabel(player, "painting_buy_fail") + } + + label("painting_buy_ok") + npc(ChatAnim.HALF_GUILTY, "That will be, mmm, ${painting.cost} coins please.") + options( + DialogueOption("painting_accept", "All right.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("painting_refuse", "No thanks.", expression = ChatAnim.HALF_GUILTY), + ) + + label("painting_buy_poor") + npc(ChatAnim.HALF_GUILTY, "PLACEHOLDER") + + label("painting_buy_fail") + manual { player, _ -> + val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + val messages = when (painting) { + PaintingType.ARTHUR -> arrayOf("PLACEHOLDER") + PaintingType.ELENA -> arrayOf("PLACEHOLDER") + PaintingType.ALVIS -> arrayOf("PLACEHOLDER") + PaintingType.MISC -> arrayOf("PLACEHOLDER") + PaintingType.DESERT -> arrayOf("PLACEHOLDER") + PaintingType.ISAFDAR -> arrayOf("PLACEHOLDER") + PaintingType.KARAMJA -> arrayOf("PLACEHOLDER") + PaintingType.LUMBRIDGE -> arrayOf("PLACEHOLDER") + PaintingType.MORYTANIA -> arrayOf("PLACEHOLDER") + PaintingType.MAP_SMALL -> arrayOf("PLACEHOLDER") + PaintingType.MAP_MEDIUM -> arrayOf("PLACEHOLDER") + PaintingType.MAP_LARGE -> arrayOf("PLACEHOLDER") + } + interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) + } + goto("painting_options") + + label("painting_accept") + exec { player, _ -> + val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + if (removeItem(player, Item(Items.COINS_995, painting.cost))) { + addItemOrDrop(player, painting.paintingId) + } + } + npc(ChatAnim.HALF_GUILTY, "There you go. Would you like another painting?") + goto("painting_options") + + label("painting_refuse") + npc(ChatAnim.HALF_GUILTY, "well, mmm, maybe a different painting, mmm?") + goto("painting_options") + + } } } \ No newline at end of file From e84df1e46c49a75494e1c0c06451e437986ab58b Mon Sep 17 00:00:00 2001 From: Bishop Date: Sun, 21 Jun 2026 16:01:23 -0500 Subject: [PATCH 06/20] More work --- .../global/skill/construction/PaintingType.kt | 3 +- .../falador/dialogue/SirReniteeDialogue.kt | 255 +++++++++++------- 2 files changed, 166 insertions(+), 92 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/PaintingType.kt b/Server/src/main/content/global/skill/construction/PaintingType.kt index abb6ca08b..6c3dff81d 100644 --- a/Server/src/main/content/global/skill/construction/PaintingType.kt +++ b/Server/src/main/content/global/skill/construction/PaintingType.kt @@ -1,8 +1,7 @@ package content.global.skill.construction import content.data.Quests -import core.api.getQuestPoints -import core.api.isQuestComplete +import core.api.* import core.game.node.entity.player.Player import org.rs09.consts.Items diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index b170b5792..3347dcca6 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -50,10 +50,10 @@ class SirReniteeDialogueFile : DialogueLabeller() { private fun selectPainting(painting: PaintingType, labelName: String) { label(labelName) - exec { player, _ -> - setAttribute(player, attributeTempPainting, painting) - loadLabel(player, "painting_buy") - } + exec { player, _ -> + setAttribute(player, attributeTempPainting, painting) + loadLabel(player, "painting_buy") + } } override fun addConversation() { @@ -141,7 +141,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("change_crest") npc(ChatAnim.HALF_GUILTY, "Mmm, very well. Changing your crest will cost", "5,000 coins.") exec { player, _ -> - if (amountInInventory(player, Items.COINS_995) < 5000) { + if (amountInInventory(player, Items.COINS_995) < CrestType.MISTHALIN.cost) { loadLabel(player, "no_money") } else { loadLabel(player, "choose_symbol") @@ -231,28 +231,28 @@ class SirReniteeDialogueFile : DialogueLabeller() { val messages = when (crest) { CrestType.ARRAV -> arrayOf("Ah yes, the shield that you helped to retrieve. You have", - "certainly earned the right to wear its symbol.") + "certainly earned the right to wear its symbol.") CrestType.ASGARNIA -> arrayOf("Ah, splendid, splendid. There is no better symbol", - "than that of our fair land!") + "than that of our fair land!") CrestType.DORGESHUUN -> arrayOf("Ah yes, our new neighbours under Lumbridge. I hear", - "you were the one who made contact with them, jolly good.") + "you were the one who made contact with them, jolly good.") CrestType.DRAGON -> arrayOf("I see you are a mighty dragon-slayer! You have", - "certainly earned the right to wear a dragon symbol.") + "certainly earned the right to wear a dragon symbol.") CrestType.FAIRY -> arrayOf("Hmm, mmm, yes, everyone likes pretty fairies.") CrestType.GUTHIX -> arrayOf("Guthix, god of balance! I'm a Saradominist myself,", - "you know, but we all find meaning in our own way, what?") + "you know, but we all find meaning in our own way, what?") CrestType.HAM -> arrayOf("Hmm, I'm not sure I like that HAM group, their", - "beliefs are a little extreme for me.", "But if that's what you want.") + "beliefs are a little extreme for me.", "But if that's what you want.") CrestType.HORSE -> arrayOf("Ah, I see you've brought a toy horse for me to see. An", - "interesting beast. Certainly you can use that as your", - "crest if you like, although it seems a bit strange to me.") + "interesting beast. Certainly you can use that as your", + "crest if you like, although it seems a bit strange to me.") CrestType.JOGRE -> arrayOf("A Jungle Ogre, eh? Odd beast, very odd.") CrestType.KANDARIN -> @@ -261,16 +261,16 @@ class SirReniteeDialogueFile : DialogueLabeller() { arrayOf("Ah, the fair land of Lumbridge and Varrock.") CrestType.SARADOMIN -> arrayOf("Ah, the great god Saradomin! May he smile on your house", - "as you adorn it with his symbol!") + "as you adorn it with his symbol!") CrestType.SKULL -> arrayOf("Of, of course you can have a skull symbol, ${if (player.isMale) "sir" else "madam"}!") CrestType.VARROCK -> arrayOf("Ah, Varrock, a fine city!") CrestType.ZAMORAK -> arrayOf("The god of Chaos? It is a terrible thing to worship", - "that evil being. But if that is what you wish...") + "that evil being. But if that is what you wish...") else -> - arrayOf("Error! Report this please!") + arrayOf("This shouldn't be happening. Please report this.") } interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) } @@ -280,39 +280,33 @@ class SirReniteeDialogueFile : DialogueLabeller() { val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) val messages = when (crest) { CrestType.ARRAV -> - arrayOf("PLACEHOLDER") - CrestType.ASGARNIA -> - arrayOf("PLACEHOLDER") + arrayOf("But that legendary shield is still lost! I don't think", + "it would be proper for you to wear its symbol.") CrestType.DORGESHUUN -> arrayOf("Hmm, have you ever even met the Dorgeshuun? I don't", "think you should wear their symbol until you have", "made contact with that lost tribe.") CrestType.DRAGON -> - arrayOf("PLACEHOLDER") + arrayOf("When the dragon on Crandor Isle remains undefeated? I", + "think you should prove yourself a dragon-slayer before", + "you can wear a dragon symbol!") CrestType.FAIRY -> - arrayOf("PLACEHOLDER") + arrayOf("A fairy? Fairies are rumoured to exist in a lost city", + "somewhere. I don't think I should let you use them as", + "a symbol until you have met them in person.") CrestType.GUTHIX, CrestType.SARADOMIN, CrestType.ZAMORAK -> arrayOf("You do not seem to be very devoted to any god.", "I will not let you have a divine symbol", "unless you have level 70 prayer.") - CrestType.HAM -> - arrayOf("PLACEHOLDER") CrestType.HORSE -> arrayOf("A horse? I know people talk about them, but I'm not at all sure", - "they ever existed. I don't think I could let you use as", - "your symbol unless you can fetch me some kind of model of one.") - CrestType.JOGRE -> - arrayOf("PLACEHOLDER") - CrestType.KANDARIN -> - arrayOf("PLACEHOLDER") - CrestType.MISTHALIN -> - arrayOf("PLACEHOLDER") + "they ever existed. I don't think I could let you use as", + "your symbol unless you can fetch me some kind of model of one.") CrestType.SKULL -> arrayOf("A symbol of death? You do not seem like a killer to me;", - "perhaps some other symbol would suit you better.") - CrestType.VARROCK -> - arrayOf("PLACEHOLDER") - else -> arrayOf("[MISSING DIALOGUE - NOT ELIGIBLE]") + "perhaps some other symbol would suit you better.") + else -> + arrayOf("This shouldn't be happening. Please report this.") } interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) } @@ -329,9 +323,8 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("money_accept") exec { player, _ -> - val crest = CrestType.MONEY - if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { - player.houseManager.crest = crest + if (CrestType.MONEY.eligible(player) && removeItem(player, Item(Items.COINS_995, CrestType.MONEY.cost))) { + player.houseManager.crest = CrestType.MONEY loadLabel(player, "money_ok") } else { loadLabel(player, "no_money") @@ -351,42 +344,48 @@ class SirReniteeDialogueFile : DialogueLabeller() { */ label("painting") - npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or a map, maybe?") + npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or", "a map, maybe?") goto("painting_options") label("painting_options") options( - DialogueOption("portrait", "A portrait please.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("landscape", "A landscape please.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("map", "A map please.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("portrait", "A portrait", "A portrait please.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("landscape", "A landscape", "A landscape please.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("map", "A map", "A map please.", expression = ChatAnim.HALF_GUILTY), ) /** - * PORTRAITS + * PAINTING MENUS */ label("portrait") - npc(ChatAnim.HALF_GUILTY, "Mmm, well, there are a few portraits I can paint. I can only let you have one if you've got some connection with that person though. Who would you like?") + npc(ChatAnim.HALF_GUILTY, "Mmm, well, there are a few portraits I can paint. I", + "can only let you have one if you've got some connection", "with that person though. Who would you like?") options( DialogueOption("portrait_arthur", "King Arthur", skipPlayer = true), - DialogueOption("portrait_elena", "Elena of Ardougne", expression = ChatAnim.HALF_GUILTY), - DialogueOption("portrait_alvis", "King Alvis of Keldagrim", expression = ChatAnim.HALF_GUILTY), - DialogueOption("portrait_misc", "The Prince and Princess of Miscellania", expression = ChatAnim.HALF_GUILTY), + DialogueOption("portrait_elena", "Elena of Ardougne", skipPlayer = true), + DialogueOption("portrait_alvis", "King Alvis of Keldagrim", skipPlayer = true), + DialogueOption("portrait_misc", "The Prince and Princess of Miscellania", skipPlayer = true), ) - /** - * LANDSCAPES - */ - label("landscape") - npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or a map, maybe?") - - /** - * MAPS - */ + npc(ChatAnim.HALF_GUILTY, "Mmm, well, I can paint a few places. Where have you", "had your adventures?") + options( + DialogueOption("landscape_lumbridge", "The River Lum", skipPlayer = true), + DialogueOption("landscape_desert", "The Kharid desert", skipPlayer = true), + DialogueOption("landscape_morytania", "Morytania", skipPlayer = true), + DialogueOption("landscape_karamja", "Karamja", skipPlayer = true), + DialogueOption("landscape_isafdar", "Isafdar", skipPlayer = true), + ) label("map") - npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or a map, maybe?") + npc(ChatAnim.HALF_GUILTY, "Mmm, yes, ah, I have painted maps of the known world", + "on several different sizes of parchment. Which size", "would you like?") + options( + DialogueOption("map_small", "Small", skipPlayer = true), + DialogueOption("map_medium", "Medium", skipPlayer = true), + DialogueOption("map_large", "Large", skipPlayer = true), + ) /** * PAINTING CHECKOUT @@ -399,7 +398,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { selectPainting(PaintingType.DESERT, "landscape_desert") selectPainting(PaintingType.ISAFDAR, "landscape_isafdar") selectPainting(PaintingType.KARAMJA, "landscape_karamja") - selectPainting(PaintingType.LUMBRIDGE, "portrait_lumbridge") + selectPainting(PaintingType.LUMBRIDGE, "landscape_lumbridge") selectPainting(PaintingType.MORYTANIA, "landscape_morytania") selectPainting(PaintingType.MAP_SMALL, "map_small") selectPainting(PaintingType.MAP_MEDIUM, "map_medium") @@ -408,45 +407,114 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("painting_buy") exec { player, _ -> val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) - when { - (painting.eligible(player) && inInventory(player, Items.COINS_995, painting.cost)) -> - loadLabel(player, "painting_buy_ok") - (painting.eligible(player)) -> - loadLabel(player, "painting_buy_poor") - else -> - loadLabel(player, "painting_buy_fail") + if (painting.eligible(player)) { + loadLabel(player, "painting_show_cost") + } else { + loadLabel(player, "painting_buy_fail") } + } - label("painting_buy_ok") - npc(ChatAnim.HALF_GUILTY, "That will be, mmm, ${painting.cost} coins please.") + label("painting_show_cost") + manual { player, _ -> + val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, "That will be, mmm, ${painting.cost} coins please.") + } + exec { player, _ -> + val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + if (inInventory(player, Items.COINS_995, painting.cost)) { + loadLabel(player, "painting_buy_confirm") + } else { + loadLabel(player, "no_money") + } + } + + label("painting_buy_confirm") options( DialogueOption("painting_accept", "All right.", expression = ChatAnim.HALF_GUILTY), DialogueOption("painting_refuse", "No thanks.", expression = ChatAnim.HALF_GUILTY), ) - label("painting_buy_poor") - npc(ChatAnim.HALF_GUILTY, "PLACEHOLDER") - label("painting_buy_fail") - manual { player, _ -> - val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) - val messages = when (painting) { - PaintingType.ARTHUR -> arrayOf("PLACEHOLDER") - PaintingType.ELENA -> arrayOf("PLACEHOLDER") - PaintingType.ALVIS -> arrayOf("PLACEHOLDER") - PaintingType.MISC -> arrayOf("PLACEHOLDER") - PaintingType.DESERT -> arrayOf("PLACEHOLDER") - PaintingType.ISAFDAR -> arrayOf("PLACEHOLDER") - PaintingType.KARAMJA -> arrayOf("PLACEHOLDER") - PaintingType.LUMBRIDGE -> arrayOf("PLACEHOLDER") - PaintingType.MORYTANIA -> arrayOf("PLACEHOLDER") - PaintingType.MAP_SMALL -> arrayOf("PLACEHOLDER") - PaintingType.MAP_MEDIUM -> arrayOf("PLACEHOLDER") - PaintingType.MAP_LARGE -> arrayOf("PLACEHOLDER") + manual { player, _ -> + val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + val messages = when (painting) { + PaintingType.ARTHUR -> + arrayOf("Do you have, mmm, a connection with King Arthur? He", + "wouldn't like me to just give his picture to anyone.") + PaintingType.ELENA -> + arrayOf("The last I heard, Elena was, mmm, trapped in West", + "Ardougne. I wouldn't feel right selling her portrait", + "while she was in danger.") + PaintingType.ALVIS -> + arrayOf("Have you ever been to Keldagrim? I think I'd need you", + "to jog my memory...") + PaintingType.MISC -> + arrayOf("Do you have some connection with the prince and", + "princess? I wouldn't want to give out their picture to", + "just anyone?") + PaintingType.DESERT -> + arrayOf("Mmm, I'm not sure you've had enough adventures in the", + "desert to deserve a painting of it.") + PaintingType.ISAFDAR -> + arrayOf("Mmm, I'm not sure you've had enough adventures in", + "Isafdar to deserve a painting of it.") + PaintingType.KARAMJA -> + arrayOf("Mmm, I'm not sure you've had enough adventures in", + "Karamja to deserve a painting of it.") + PaintingType.LUMBRIDGE -> + arrayOf("Mmm, I'm not sure you've had enough adventures in", + "Lumbridge to deserve a painting of it.") + PaintingType.MORYTANIA -> + arrayOf("Mmm, I'm not sure you've had enough adventures in", + "Morytania to deserve a painting of it.") + PaintingType.MAP_SMALL, PaintingType.MAP_MEDIUM, PaintingType.MAP_LARGE -> + arrayOf("Mmm, I'm not sure you've had enough adventures in the", + "world to deserve that map.") + } + interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) } - interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) - } - goto("painting_options") + manual { player, _ -> + val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + val messages = when (painting) { + PaintingType.ARTHUR -> + arrayOf("To buy the portrait of King Arthur you must have", + "completed The Holy Grail.") + PaintingType.ELENA -> + arrayOf("To buy the portrait of Elena you must have completed", + "the Plague City quest.") + PaintingType.ALVIS -> + arrayOf("To buy the portrait of the Giant Dwarf"/*sic*/+" you must have", + "completed The Giant Dwarf.") + PaintingType.MISC -> + arrayOf("To buy the portrait of the Prince and Princess of", + "Miscellania you must have completed The Throne of", + "Miscellania.") + PaintingType.DESERT -> + arrayOf("To buy the painting of the desert you must have", + "completed Tourist Trap, The Feud, and The Golem.") + PaintingType.ISAFDAR -> + arrayOf("To buy the painting of Isafdar you must have completed", + "Roving Elves.") + PaintingType.KARAMJA -> + arrayOf("To buy the painting of Karamja you must have completed", + "Pirate's Treasure, Tai Bwo Wannai Trio, and Shilo Village.") + PaintingType.LUMBRIDGE -> + arrayOf("To buy the painting of the Lum you must have completed", + "Cook's Assistant, Rune Mysteries, and The Restless Ghost.") + PaintingType.MORYTANIA -> + arrayOf("To buy the painting of Morytania you must have completed", + "Shades of Mort'ton, The Creature of Fenkenstrain,", + "Ghosts Ahoy, and The Haunted Mine.") + PaintingType.MAP_SMALL -> + arrayOf("To buy a small map you must have 51 Quest Points.") + PaintingType.MAP_MEDIUM -> + arrayOf("To buy a medium map you must have 101 Quest Points.") + PaintingType.MAP_LARGE -> + arrayOf("To buy a large map you must have 151 Quest Points.") + } + interpreter!!.sendDialogue(*messages) + } + goto("painting_reset") label("painting_accept") exec { player, _ -> @@ -459,9 +527,16 @@ class SirReniteeDialogueFile : DialogueLabeller() { goto("painting_options") label("painting_refuse") - npc(ChatAnim.HALF_GUILTY, "well, mmm, maybe a different painting, mmm?") + npc(ChatAnim.HALF_GUILTY, "Well, mmm, maybe a different painting, mmm?") goto("painting_options") - } + label("painting_reset") + npc(ChatAnim.HALF_GUILTY, "Would you like a different painting?") + options( + DialogueOption("portrait", "Yes - a portrait", "A portrait please.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("landscape", "Yes - a landscape", "A landscape please.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("map", "Yes - a map", "A map please.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("nothing", "No, thanks.", expression = ChatAnim.HALF_GUILTY), + ) } } \ No newline at end of file From d069269884f5db32a410ec32445f6ff68abc0d27 Mon Sep 17 00:00:00 2001 From: Bishop Date: Sun, 21 Jun 2026 20:07:04 -0500 Subject: [PATCH 07/20] Implemented easels --- .../global/skill/construction/CrestType.kt | 1 + .../decoration/workshop/EaselListener.kt | 139 ++++++++++++++++++ .../global/skill/crafting/HeraldicProduct.kt | 31 ++++ .../falador/dialogue/SirReniteeDialogue.kt | 92 ++++++------ 4 files changed, 217 insertions(+), 46 deletions(-) create mode 100644 Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt create mode 100644 Server/src/main/content/global/skill/crafting/HeraldicProduct.kt diff --git a/Server/src/main/content/global/skill/construction/CrestType.kt b/Server/src/main/content/global/skill/construction/CrestType.kt index 9780c893b..d296bb8b3 100644 --- a/Server/src/main/content/global/skill/construction/CrestType.kt +++ b/Server/src/main/content/global/skill/construction/CrestType.kt @@ -8,6 +8,7 @@ import org.rs09.consts.Items /** * Enumerates the various crests the player can purchase for the Construction skill, as well as their requirements. + * ORDINAL BOUND, see HeraldicProduct.kt * @author Bishop */ diff --git a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt new file mode 100644 index 000000000..3c442a659 --- /dev/null +++ b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt @@ -0,0 +1,139 @@ +package content.global.skill.construction.decoration.workshop + +import content.global.skill.crafting.HeraldicProduct +import core.api.* +import core.game.interaction.InteractionListener +import core.game.node.entity.skill.Skills +import org.rs09.consts.Scenery + +/** + * Listens for use of the easel furniture pieces in a POH, with which players may make heraldic items. + * @author Bishop + */ + +class EaselListener : InteractionListener { + + private val easels = intArrayOf(Scenery.HELMET_PLUMING_STAND_13716, Scenery.PAINTING_STAND_13717, Scenery.BANNER_MAKING_STAND_13718) + private val heraldryAnimation = 0 // PLACEHOLDER + + override fun defineListeners() { + on(easels, SCENERY, "use") { player, node -> + val crest = player.houseManager.crest + val options = when (node.id) { + Scenery.HELMET_PLUMING_STAND_13716 -> + arrayOf("Plumed steel helmet", "Plumed rune helmet") + Scenery.PAINTING_STAND_13717 -> + arrayOf("Plumed steel helmet", "Plumed rune helmet", "Steel heraldic shield", "Runite heraldic shield") + Scenery.BANNER_MAKING_STAND_13718 -> + arrayOf("Plumed steel helmet", "Plumed rune helmet", "Steel heraldic shield", "Runite heraldic shield", "Heraldic banner") + else -> + return@on false + } + sendDialogueOptions(player, "What do you want to make?", *options) + addDialogueAction(player) { player, button -> + when (button) { + 2,3 -> { + when { + (!hasLevelDyn(player, Skills.CONSTRUCTION, HeraldicProduct.STEEL_HELM.constructionReq)) -> { + sendDialogue(player, "You need a Construction level of ${HeraldicProduct.STEEL_HELM.constructionReq} to make this.") + return@addDialogueAction + } + (!hasLevelDyn(player, Skills.CRAFTING, HeraldicProduct.STEEL_HELM.craftingReq)) -> { + sendDialogue(player, "You need a Crafting level of ${HeraldicProduct.STEEL_HELM.craftingReq} to make this.") + return@addDialogueAction + } + (button == 2) -> { + if (removeItem(player, HeraldicProduct.STEEL_HELM.primaryMaterialId)) { + addItemOrDrop(player, HeraldicProduct.STEEL_HELM.productForCrest(crest)) + rewardXP(player, Skills.CRAFTING, HeraldicProduct.STEEL_HELM.craftingXp) + animate(player, heraldryAnimation) + sendMessage(player, "You make a helmet in your colours.") + return@addDialogueAction + } else { + sendDialogue(player, "PLACEHOLDER") + return@addDialogueAction + } + } + else -> { + if (removeItem(player, HeraldicProduct.RUNE_HELM.primaryMaterialId)) { + addItemOrDrop(player, HeraldicProduct.RUNE_HELM.productForCrest(crest)) + rewardXP(player, Skills.CRAFTING, HeraldicProduct.RUNE_HELM.craftingXp) + animate(player, heraldryAnimation) + sendMessage(player, "You make a helmet in your colours.") + return@addDialogueAction + } else { + sendDialogue(player, "PLACEHOLDER") + return@addDialogueAction + } + } + } + } + 4,5 -> { + when { + (!hasLevelDyn(player, Skills.CONSTRUCTION, HeraldicProduct.STEEL_SHIELD.constructionReq)) -> { + sendDialogue(player, "You need a Construction level of ${HeraldicProduct.STEEL_SHIELD.constructionReq} to make this.") + return@addDialogueAction + } + (!hasLevelDyn(player, Skills.CRAFTING, HeraldicProduct.STEEL_SHIELD.craftingReq)) -> { + sendDialogue(player, "You need a Crafting level of ${HeraldicProduct.STEEL_SHIELD.craftingReq} to make this.") + return@addDialogueAction + } + (button == 4) -> { + if (removeItem(player, HeraldicProduct.STEEL_SHIELD.primaryMaterialId)) { + addItemOrDrop(player, HeraldicProduct.STEEL_SHIELD.productForCrest(crest)) + rewardXP(player, Skills.CRAFTING, HeraldicProduct.STEEL_SHIELD.craftingXp) + animate(player, heraldryAnimation) + sendMessage(player, "You make a shield with your symbol on.") + return@addDialogueAction + } else { + sendDialogue(player, "PLACEHOLDER") + return@addDialogueAction + } + } + else -> { + if (removeItem(player, HeraldicProduct.RUNE_SHIELD.primaryMaterialId)) { + addItemOrDrop(player, HeraldicProduct.RUNE_SHIELD.productForCrest(crest)) + rewardXP(player, Skills.CRAFTING, HeraldicProduct.RUNE_SHIELD.craftingXp) + animate(player, heraldryAnimation) + sendMessage(player, "You make a shield with your symbol on.") + return@addDialogueAction + } else { + sendDialogue(player, "PLACEHOLDER") + return@addDialogueAction + } + } + } + } + 6 -> { + when { + (!hasLevelDyn(player, Skills.CONSTRUCTION, HeraldicProduct.BANNER.constructionReq)) -> { + sendDialogue(player, "You need a Construction level of ${HeraldicProduct.BANNER.constructionReq} to make this.") + return@addDialogueAction + } + (!hasLevelDyn(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingReq)) -> { + sendDialogue(player, "You need a Crafting level of ${HeraldicProduct.BANNER.craftingReq} to make this.") + return@addDialogueAction + } + (!inInventory(player, HeraldicProduct.BANNER.primaryMaterialId) || !inInventory(player, HeraldicProduct.BANNER.secondaryMaterialId!!)) -> { + sendDialogue(player, "PLACEHOLDER") + } + else -> { + if (removeItem(player, HeraldicProduct.BANNER.primaryMaterialId) && removeItem(player, HeraldicProduct.BANNER.secondaryMaterialId)) { + addItemOrDrop(player, HeraldicProduct.BANNER.productForCrest(crest)) + rewardXP(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingXp) + animate(player, heraldryAnimation) + sendMessage(player, "PLACEHOLDER") + return@addDialogueAction + } else { + sendDialogue(player, "PLACEHOLDER") + return@addDialogueAction + } + } + } + } + } + } + return@on true + } + } +} \ No newline at end of file diff --git a/Server/src/main/content/global/skill/crafting/HeraldicProduct.kt b/Server/src/main/content/global/skill/crafting/HeraldicProduct.kt new file mode 100644 index 000000000..ddb58dec5 --- /dev/null +++ b/Server/src/main/content/global/skill/crafting/HeraldicProduct.kt @@ -0,0 +1,31 @@ +package content.global.skill.crafting + +import content.global.skill.construction.CrestType +import org.rs09.consts.Items + +/** + * Enumerates the heraldic items players can craft with easels in their POHs. + * @author Bishop + */ + +enum class HeraldicProduct( + val primaryMaterialId: Int, + val secondaryMaterialId: Int?, + val baseProductId: Int, + val craftingReq: Int, + val craftingXp: Double, + val constructionReq: Int = 16) { + + STEEL_HELM(Items.STEEL_FULL_HELM_1157, null, + Items.STEEL_HERALDIC_HELM_8682, 38, 37.0), + RUNE_HELM(Items.RUNE_FULL_HELM_1163, null, + Items.RUNE_HERALDIC_HELM_8464, STEEL_HELM.craftingReq, STEEL_HELM.craftingXp), + STEEL_SHIELD(Items.STEEL_KITESHIELD_1193, null, + Items.STEEL_KITESHIELD_8746, 43, 40.0), + RUNE_SHIELD(Items.RUNE_KITESHIELD_1201, null, + Items.RUNE_KITESHIELD_8714, STEEL_SHIELD.craftingReq, STEEL_SHIELD.craftingXp), + BANNER(Items.BOLT_OF_CLOTH_8790, Items.PLANK_960, + Items.BANNER_8650, 48, 42.5); + + fun productForCrest(crest: CrestType): Int = baseProductId + (crest.ordinal * 2) +} \ No newline at end of file diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index 3347dcca6..f0ec194a9 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -62,33 +62,33 @@ class SirReniteeDialogueFile : DialogueLabeller() { * GENERIC DIALOGUE */ - npc(ChatAnim.HALF_GUILTY, "Hmm? What's that, young ${if (player!!.isMale) "man" else "woman"}? What can I do for", "you?") + npc(ChatAnim.NEUTRAL, "Hmm? What's that, young ${if (player!!.isMale) "man" else "woman"}? What can I do for", "you?") options( - DialogueOption("intro", "I don't know, what can you do for me?", expression = ChatAnim.HALF_GUILTY), - DialogueOption("nothing", "Nothing, thanks", spokenText = "Nothing, thanks.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("intro", "I don't know, what can you do for me?", expression = ChatAnim.ASKING), + DialogueOption("nothing", "Nothing, thanks", spokenText = "Nothing, thanks.", expression = ChatAnim.NEUTRAL), ) label("nothing") - npc(ChatAnim.HALF_GUILTY, "Mmm, well, see you some other time maybe.") + npc(ChatAnim.NEUTRAL, "Mmm, well, see you some other time maybe.") /** * CREST DIALOGUE */ label("intro") - npc(ChatAnim.HALF_GUILTY, "Hmm, well, mmm, do you have a family crest? I keep", + npc(ChatAnim.NEUTRAL, "Hmm, well, mmm, do you have a family crest? I keep", "track of every ${ServerConstants.SERVER_NAME} family, you know, so I might", "be able to find yours.") - npc(ChatAnim.HALF_GUILTY, "I'm also something of an, mmm, a painter. If you've", + npc(ChatAnim.NEUTRAL, "I'm also something of an, mmm, a painter. If you've", "met any important persons or visited any nice places I", "could paint them for you.") options( - DialogueOption("family_crest", "Can you see if I have a family crest?", expression = ChatAnim.HALF_GUILTY), - DialogueOption("painting", "Can I buy a painting?", expression = ChatAnim.HALF_GUILTY), + DialogueOption("family_crest", "Can you see if I have a family crest?", expression = ChatAnim.ASKING), + DialogueOption("painting", "Can I buy a painting?", expression = ChatAnim.NEUTRAL), ) label("family_crest") - npc(ChatAnim.HALF_GUILTY, "What is your name?") - player(ChatAnim.HALF_GUILTY, "${player!!.username}.") - npc(ChatAnim.HALF_GUILTY, "Mmm, ${player!!.username}, let me see...") + npc(ChatAnim.NEUTRAL, "What is your name?") + player(ChatAnim.NEUTRAL, "${player!!.username}.") + npc(ChatAnim.NEUTRAL, "Mmm, ${player!!.username}, let me see...") exec { player, _ -> if (hasLevelStat(player, Skills.CONSTRUCTION, 16)) { loadLabel(player, "has_construction_level") @@ -98,9 +98,9 @@ class SirReniteeDialogueFile : DialogueLabeller() { } label("no_construction_level") - npc(ChatAnim.HALF_GUILTY, "First thing's first, young ${if (player!!.isMale) "man" else "woman"}! There is not much point", + npc(ChatAnim.NEUTRAL, "First thing's first, young ${if (player!!.isMale) "man" else "woman"}! There is not much point", "in having a family crest if you cannot display it.") - npc(ChatAnim.HALF_GUILTY, "You should train construction until you can build a wall", + npc(ChatAnim.NEUTRAL, "You should train construction until you can build a wall", "decoration in your dining room.") label("has_construction_level") @@ -119,27 +119,27 @@ class SirReniteeDialogueFile : DialogueLabeller() { } label("show_existing_crest") - npc(ChatAnim.HALF_GUILTY, "According to my records, your crest is", + npc(ChatAnim.NEUTRAL, "According to my records, your crest is", "${player!!.houseManager.crest.crestName}.") goto("crest_options") label("show_new_crest") - npc(ChatAnim.HALF_GUILTY, "Well, I don't think you have any noble blood,", + npc(ChatAnim.NEUTRAL, "Well, I don't think you have any noble blood,", "but I see that your ancestors came from ${Util.enumToString(player!!.houseManager.crest.name)},", "so ${if (player!!.houseManager.crest == CrestType.VARROCK) "you can use that city's" else "that can be your"} crest.") goto("crest_options") label("crest_options") options( - DialogueOption("change_crest", "I don't like that crest. Can I have a different one?", expression = ChatAnim.HALF_GUILTY), - DialogueOption("thanks", "Thanks!", expression = ChatAnim.HALF_GUILTY), + DialogueOption("change_crest", "I don't like that crest. Can I have a different one?", expression = ChatAnim.ASKING), + DialogueOption("thanks", "Thanks!", expression = ChatAnim.NEUTRAL), ) label("thanks") - npc(ChatAnim.HALF_GUILTY, "You're welcome, my ${if (player!!.isMale) "boy" else "girl"}.") + npc(ChatAnim.NEUTRAL, "You're welcome, my ${if (player!!.isMale) "boy" else "girl"}.") label("change_crest") - npc(ChatAnim.HALF_GUILTY, "Mmm, very well. Changing your crest will cost", "5,000 coins.") + npc(ChatAnim.NEUTRAL, "Mmm, very well. Changing your crest will cost", "5,000 coins.") exec { player, _ -> if (amountInInventory(player, Items.COINS_995) < CrestType.MISTHALIN.cost) { loadLabel(player, "no_money") @@ -149,10 +149,10 @@ class SirReniteeDialogueFile : DialogueLabeller() { } label("no_money") - player(ChatAnim.HALF_GUILTY, "I'll have to go and get some money then.") + player(ChatAnim.NEUTRAL, "I'll have to go and get some money then.") label("choose_symbol") - npc(ChatAnim.HALF_GUILTY, "There are sixteen different symbols;", "which one would you like?") + npc(ChatAnim.NEUTRAL, "There are sixteen different symbols;", "which one would you like?") goto("crest_page1") label("crest_page1") @@ -272,7 +272,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { else -> arrayOf("This shouldn't be happening. Please report this.") } - interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) + interpreter!!.sendDialogues(npc, ChatAnim.NEUTRAL, *messages) } label("crest_buy_fail") @@ -308,17 +308,17 @@ class SirReniteeDialogueFile : DialogueLabeller() { else -> arrayOf("This shouldn't be happening. Please report this.") } - interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) + interpreter!!.sendDialogues(npc, ChatAnim.NEUTRAL, *messages) } goto("crest_page1") // Money crest has a unique flow since Sir Renitee needs to check the player's cash stack a second time label("crest_money") - npc(ChatAnim.HALF_GUILTY, "You wish to represent yourself by a moneybag?", + npc(ChatAnim.NEUTRAL, "You wish to represent yourself by a moneybag?", "I think to make that meaningful I should increase", "the price to 500,000 coins. Do you agree?") options( - DialogueOption("money_accept", "All right.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("money_refuse", "No way!", expression = ChatAnim.HALF_GUILTY), + DialogueOption("money_accept", "All right.", expression = ChatAnim.NEUTRAL), + DialogueOption("money_refuse", "No way!", expression = ChatAnim.NEUTRAL), ) label("money_accept") @@ -332,10 +332,10 @@ class SirReniteeDialogueFile : DialogueLabeller() { } label("money_ok") - npc(ChatAnim.HALF_GUILTY, "Thank you very much! You may now use a money-bag", "as your symbol.") + npc(ChatAnim.NEUTRAL, "Thank you very much! You may now use a money-bag", "as your symbol.") label("money_refuse") - npc(ChatAnim.HALF_GUILTY, "Well we can't have just any pauper using a money-bag", + npc(ChatAnim.NEUTRAL, "Well we can't have just any pauper using a money-bag", "as a symbol, can we? You'll have to choose a", "different symbol.") goto("crest_page1") @@ -344,14 +344,14 @@ class SirReniteeDialogueFile : DialogueLabeller() { */ label("painting") - npc(ChatAnim.HALF_GUILTY, "Would you like a portrait or an, mmm, a landscape? Or", "a map, maybe?") + npc(ChatAnim.NEUTRAL, "Would you like a portrait or an, mmm, a landscape? Or", "a map, maybe?") goto("painting_options") label("painting_options") options( - DialogueOption("portrait", "A portrait", "A portrait please.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("landscape", "A landscape", "A landscape please.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("map", "A map", "A map please.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("portrait", "A portrait", "A portrait please.", expression = ChatAnim.NEUTRAL), + DialogueOption("landscape", "A landscape", "A landscape please.", expression = ChatAnim.NEUTRAL), + DialogueOption("map", "A map", "A map please.", expression = ChatAnim.NEUTRAL), ) /** @@ -359,7 +359,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { */ label("portrait") - npc(ChatAnim.HALF_GUILTY, "Mmm, well, there are a few portraits I can paint. I", + npc(ChatAnim.NEUTRAL, "Mmm, well, there are a few portraits I can paint. I", "can only let you have one if you've got some connection", "with that person though. Who would you like?") options( DialogueOption("portrait_arthur", "King Arthur", skipPlayer = true), @@ -369,7 +369,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { ) label("landscape") - npc(ChatAnim.HALF_GUILTY, "Mmm, well, I can paint a few places. Where have you", "had your adventures?") + npc(ChatAnim.NEUTRAL, "Mmm, well, I can paint a few places. Where have you", "had your adventures?") options( DialogueOption("landscape_lumbridge", "The River Lum", skipPlayer = true), DialogueOption("landscape_desert", "The Kharid desert", skipPlayer = true), @@ -379,7 +379,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { ) label("map") - npc(ChatAnim.HALF_GUILTY, "Mmm, yes, ah, I have painted maps of the known world", + npc(ChatAnim.NEUTRAL, "Mmm, yes, ah, I have painted maps of the known world", "on several different sizes of parchment. Which size", "would you like?") options( DialogueOption("map_small", "Small", skipPlayer = true), @@ -417,7 +417,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("painting_show_cost") manual { player, _ -> val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) - interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, "That will be, mmm, ${painting.cost} coins please.") + interpreter!!.sendDialogues(npc, ChatAnim.NEUTRAL, "That will be, mmm, ${painting.cost} coins please.") } exec { player, _ -> val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) @@ -430,8 +430,8 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("painting_buy_confirm") options( - DialogueOption("painting_accept", "All right.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("painting_refuse", "No thanks.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("painting_accept", "All right.", expression = ChatAnim.NEUTRAL), + DialogueOption("painting_refuse", "No thanks.", expression = ChatAnim.NEUTRAL), ) label("painting_buy_fail") @@ -471,7 +471,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { arrayOf("Mmm, I'm not sure you've had enough adventures in the", "world to deserve that map.") } - interpreter!!.sendDialogues(npc, ChatAnim.HALF_GUILTY, *messages) + interpreter!!.sendDialogues(npc, ChatAnim.NEUTRAL, *messages) } manual { player, _ -> val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) @@ -523,20 +523,20 @@ class SirReniteeDialogueFile : DialogueLabeller() { addItemOrDrop(player, painting.paintingId) } } - npc(ChatAnim.HALF_GUILTY, "There you go. Would you like another painting?") + npc(ChatAnim.NEUTRAL, "There you go. Would you like another painting?") goto("painting_options") label("painting_refuse") - npc(ChatAnim.HALF_GUILTY, "Well, mmm, maybe a different painting, mmm?") + npc(ChatAnim.NEUTRAL, "Well, mmm, maybe a different painting, mmm?") goto("painting_options") label("painting_reset") - npc(ChatAnim.HALF_GUILTY, "Would you like a different painting?") + npc(ChatAnim.NEUTRAL, "Would you like a different painting?") options( - DialogueOption("portrait", "Yes - a portrait", "A portrait please.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("landscape", "Yes - a landscape", "A landscape please.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("map", "Yes - a map", "A map please.", expression = ChatAnim.HALF_GUILTY), - DialogueOption("nothing", "No, thanks.", expression = ChatAnim.HALF_GUILTY), + DialogueOption("portrait", "Yes - a portrait", "A portrait please.", expression = ChatAnim.NEUTRAL), + DialogueOption("landscape", "Yes - a landscape", "A landscape please.", expression = ChatAnim.NEUTRAL), + DialogueOption("map", "Yes - a map", "A map please.", expression = ChatAnim.NEUTRAL), + DialogueOption("nothing", "No, thanks.", expression = ChatAnim.NEUTRAL), ) } } \ No newline at end of file From 2174719a4a27689caca94c9df90f656ee3c20939 Mon Sep 17 00:00:00 2001 From: Bishop Date: Sun, 21 Jun 2026 21:35:40 -0500 Subject: [PATCH 08/20] Made crest persist through logout --- .../content/global/skill/construction/BuildingUtils.java | 2 +- .../main/content/global/skill/construction/CrestType.kt | 2 +- .../content/global/skill/construction/Decoration.java | 6 +++++- .../content/global/skill/construction/HouseManager.java | 4 ++++ .../asgarnia/falador/dialogue/SirReniteeDialogue.kt | 8 ++++---- .../game/node/entity/player/info/login/PlayerSaver.kt | 1 + 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/BuildingUtils.java b/Server/src/main/content/global/skill/construction/BuildingUtils.java index 2ee636337..59e116afd 100644 --- a/Server/src/main/content/global/skill/construction/BuildingUtils.java +++ b/Server/src/main/content/global/skill/construction/BuildingUtils.java @@ -346,9 +346,9 @@ public final class BuildingUtils { objectId += player.getHouseManager().getCrest().ordinal(); } if (objectId == object.getId() && hotspot.getCurrentX() == l.getChunkOffsetX() && hotspot.getCurrentY() == l.getChunkOffsetY()) { + Decoration decoration = hotspot.getHotspot().getDecorations()[hotspot.getDecorationIndex()]; player.animate(REMOVE_ANIMATION); removeDecoration(player, region, room, hotspot, object, style); - Decoration decoration = Decoration.forObjectId(object.getId()); for (Item item : decoration.getRefundItems()) { addItemOrDrop(player, item.getId(), item.getAmount()); } diff --git a/Server/src/main/content/global/skill/construction/CrestType.kt b/Server/src/main/content/global/skill/construction/CrestType.kt index d296bb8b3..c9bfc22fd 100644 --- a/Server/src/main/content/global/skill/construction/CrestType.kt +++ b/Server/src/main/content/global/skill/construction/CrestType.kt @@ -8,7 +8,7 @@ import org.rs09.consts.Items /** * Enumerates the various crests the player can purchase for the Construction skill, as well as their requirements. - * ORDINAL BOUND, see HeraldicProduct.kt + * ORDINAL BOUND * @author Bishop */ diff --git a/Server/src/main/content/global/skill/construction/Decoration.java b/Server/src/main/content/global/skill/construction/Decoration.java index 4191cb1a9..b86a78cd5 100644 --- a/Server/src/main/content/global/skill/construction/Decoration.java +++ b/Server/src/main/content/global/skill/construction/Decoration.java @@ -899,7 +899,11 @@ public enum Decoration { if (h.getCurrentX() == l.getChunkOffsetX() && h.getCurrentY() == l.getChunkOffsetY()) { if (h.getDecorationIndex() != -1) { Decoration deco = h.getHotspot().getDecorations()[h.getDecorationIndex()]; - if (deco.getObjectId(player.getHouseManager().getStyle()) == object.getId()) { + int id = deco.getObjectId(player.getHouseManager().getStyle()); + if (h.getHotspot().getType() == BuildHotspotType.CREST) { + id += player.getHouseManager().getCrest().ordinal(); + } + if (id == object.getId()) { return deco; } } diff --git a/Server/src/main/content/global/skill/construction/HouseManager.java b/Server/src/main/content/global/skill/construction/HouseManager.java index 4db8e8191..5a46876e2 100644 --- a/Server/src/main/content/global/skill/construction/HouseManager.java +++ b/Server/src/main/content/global/skill/construction/HouseManager.java @@ -101,6 +101,10 @@ public final class HouseManager { public void parse(JSONObject data){ location = HouseLocation.values()[Integer.parseInt( data.get("location").toString())]; style = HousingStyle.values()[Integer.parseInt( data.get("style").toString())]; + Object crestRaw = data.get("crest"); + if (crestRaw != null) { + crest = CrestType.values()[Integer.parseInt(crestRaw.toString())]; + } Object servRaw = data.get("servant"); if(servRaw != null){ servant = Servant.parse((JSONObject) servRaw); diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index f0ec194a9..f163794b4 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -141,7 +141,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("change_crest") npc(ChatAnim.NEUTRAL, "Mmm, very well. Changing your crest will cost", "5,000 coins.") exec { player, _ -> - if (amountInInventory(player, Items.COINS_995) < CrestType.MISTHALIN.cost) { + if (amountInInventory(player, Items.COINS_995) < CrestType.ASGARNIA.cost) { loadLabel(player, "no_money") } else { loadLabel(player, "choose_symbol") @@ -213,7 +213,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy") exec { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) + val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { player.houseManager.crest = crest if (crest == CrestType.SARADOMIN && !player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { @@ -227,7 +227,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy_ok") manual { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) + val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) val messages = when (crest) { CrestType.ARRAV -> arrayOf("Ah yes, the shield that you helped to retrieve. You have", @@ -277,7 +277,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy_fail") manual { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) + val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) val messages = when (crest) { CrestType.ARRAV -> arrayOf("But that legendary shield is still lost! I don't think", diff --git a/Server/src/main/core/game/node/entity/player/info/login/PlayerSaver.kt b/Server/src/main/core/game/node/entity/player/info/login/PlayerSaver.kt index 351c8dc34..c9676f93f 100644 --- a/Server/src/main/core/game/node/entity/player/info/login/PlayerSaver.kt +++ b/Server/src/main/core/game/node/entity/player/info/login/PlayerSaver.kt @@ -197,6 +197,7 @@ class PlayerSaver (val player: Player){ val houseData = JSONObject() houseData.put("location",manager.location.ordinal.toString()) houseData.put("style",manager.style.ordinal.toString()) + houseData.put("crest",manager.crest.ordinal.toString()) if(manager.hasServant()){ val servant = JSONObject() servant.put("type",manager.servant.type.ordinal.toString()) From cf8e90651bae8cd3ad11264708524d526aa253ac Mon Sep 17 00:00:00 2001 From: Bishop Date: Sun, 21 Jun 2026 23:23:47 -0500 Subject: [PATCH 09/20] Mined every Sir Renitee facial expression on youtube --- .../falador/dialogue/SirReniteeDialogue.kt | 35 +++++++++++-------- .../core/game/dialogue/FacialExpression.java | 1 + 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index f163794b4..51f1a910e 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -2,6 +2,7 @@ package content.region.asgarnia.falador.dialogue import content.global.skill.construction.CrestType import content.global.skill.construction.PaintingType +import content.global.skill.crafting.HeraldicProduct import core.ServerConstants import core.Util import core.api.* @@ -86,11 +87,11 @@ class SirReniteeDialogueFile : DialogueLabeller() { ) label("family_crest") - npc(ChatAnim.NEUTRAL, "What is your name?") + npc(ChatAnim.NEUTRAL2, "What is your name?") player(ChatAnim.NEUTRAL, "${player!!.username}.") - npc(ChatAnim.NEUTRAL, "Mmm, ${player!!.username}, let me see...") + npc(ChatAnim.NEUTRAL2, "Mmm, ${player!!.username}, let me see...") exec { player, _ -> - if (hasLevelStat(player, Skills.CONSTRUCTION, 16)) { + if (hasLevelStat(player, Skills.CONSTRUCTION, HeraldicProduct.STEEL_HELM.constructionReq)) { loadLabel(player, "has_construction_level") } else { loadLabel(player, "no_construction_level") @@ -119,8 +120,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { } label("show_existing_crest") - npc(ChatAnim.NEUTRAL, "According to my records, your crest is", - "${player!!.houseManager.crest.crestName}.") + npc(ChatAnim.NEUTRAL, "According to my records, your crest is ${player!!.houseManager.crest.crestName}.") // test line breaks here goto("crest_options") label("show_new_crest") @@ -139,7 +139,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { npc(ChatAnim.NEUTRAL, "You're welcome, my ${if (player!!.isMale) "boy" else "girl"}.") label("change_crest") - npc(ChatAnim.NEUTRAL, "Mmm, very well. Changing your crest will cost", "5,000 coins.") + npc(ChatAnim.NEUTRAL, "Mmm, very well. Changing your crest will cost 5,000", "coins.") exec { player, _ -> if (amountInInventory(player, Items.COINS_995) < CrestType.ASGARNIA.cost) { loadLabel(player, "no_money") @@ -152,7 +152,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { player(ChatAnim.NEUTRAL, "I'll have to go and get some money then.") label("choose_symbol") - npc(ChatAnim.NEUTRAL, "There are sixteen different symbols;", "which one would you like?") + npc(ChatAnim.NEUTRAL, "There are sixteen different symbols; which one would", "you like?") goto("crest_page1") label("crest_page1") @@ -228,6 +228,11 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy_ok") manual { player, _ -> val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) + val expression = if (crest == CrestType.SKULL) { + ChatAnim.AFRAID + } else { + ChatAnim.HAPPY + } val messages = when (crest) { CrestType.ARRAV -> arrayOf("Ah yes, the shield that you helped to retrieve. You have", @@ -272,7 +277,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { else -> arrayOf("This shouldn't be happening. Please report this.") } - interpreter!!.sendDialogues(npc, ChatAnim.NEUTRAL, *messages) + interpreter!!.sendDialogues(npc, expression, *messages) } label("crest_buy_fail") @@ -359,8 +364,8 @@ class SirReniteeDialogueFile : DialogueLabeller() { */ label("portrait") - npc(ChatAnim.NEUTRAL, "Mmm, well, there are a few portraits I can paint. I", - "can only let you have one if you've got some connection", "with that person though. Who would you like?") + npc(ChatAnim.NEUTRAL, "Mmm, well, there are a few portraits I can paint. I can", + "only let you have one if you've got some connection with", "that person though. Who would you like?") options( DialogueOption("portrait_arthur", "King Arthur", skipPlayer = true), DialogueOption("portrait_elena", "Elena of Ardougne", skipPlayer = true), @@ -369,7 +374,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { ) label("landscape") - npc(ChatAnim.NEUTRAL, "Mmm, well, I can paint a few places. Where have you", "had your adventures?") + npc(ChatAnim.NEUTRAL, "Mmm, well, I can paint a few places. Where have you had", "your adventures?") options( DialogueOption("landscape_lumbridge", "The River Lum", skipPlayer = true), DialogueOption("landscape_desert", "The Kharid desert", skipPlayer = true), @@ -379,8 +384,8 @@ class SirReniteeDialogueFile : DialogueLabeller() { ) label("map") - npc(ChatAnim.NEUTRAL, "Mmm, yes, ah, I have painted maps of the known world", - "on several different sizes of parchment. Which size", "would you like?") + npc(ChatAnim.NEUTRAL, "Mmm, yes, ah, I have painted maps of the known world on", + "several different sizes of parchment. Which size would", "you like?") options( DialogueOption("map_small", "Small", skipPlayer = true), DialogueOption("map_medium", "Medium", skipPlayer = true), @@ -430,8 +435,8 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("painting_buy_confirm") options( - DialogueOption("painting_accept", "All right.", expression = ChatAnim.NEUTRAL), - DialogueOption("painting_refuse", "No thanks.", expression = ChatAnim.NEUTRAL), + DialogueOption("painting_accept", "All right", skipPlayer = true), + DialogueOption("painting_refuse", "No thanks", skipPlayer = true), ) label("painting_buy_fail") diff --git a/Server/src/main/core/game/dialogue/FacialExpression.java b/Server/src/main/core/game/dialogue/FacialExpression.java index 8b4f2eb8c..ce09ffff7 100644 --- a/Server/src/main/core/game/dialogue/FacialExpression.java +++ b/Server/src/main/core/game/dialogue/FacialExpression.java @@ -70,6 +70,7 @@ public enum FacialExpression { SLEEPING(9802), SILENT(9804), NEUTRAL(9808), + NEUTRAL2(9810), // Like neutral but mouth starts moving immediately THINKING(9812), HALF_THINKING(9814), DISGUSTED(9816), From 09bde242d568789a4195e9ee78cd265f7a301fcb Mon Sep 17 00:00:00 2001 From: Bishop Date: Sun, 21 Jun 2026 23:41:17 -0500 Subject: [PATCH 10/20] Easel done --- .../{EaselListener.kt => EaselListeners.kt} | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) rename Server/src/main/content/global/skill/construction/decoration/workshop/{EaselListener.kt => EaselListeners.kt} (75%) diff --git a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt similarity index 75% rename from Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt rename to Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt index 3c442a659..18240f419 100644 --- a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListener.kt +++ b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt @@ -4,6 +4,7 @@ import content.global.skill.crafting.HeraldicProduct import core.api.* import core.game.interaction.InteractionListener import core.game.node.entity.skill.Skills +import org.rs09.consts.Items import org.rs09.consts.Scenery /** @@ -14,7 +15,7 @@ import org.rs09.consts.Scenery class EaselListener : InteractionListener { private val easels = intArrayOf(Scenery.HELMET_PLUMING_STAND_13716, Scenery.PAINTING_STAND_13717, Scenery.BANNER_MAKING_STAND_13718) - private val heraldryAnimation = 0 // PLACEHOLDER + private val heraldryAnimation = 3654 override fun defineListeners() { on(easels, SCENERY, "use") { player, node -> @@ -50,7 +51,7 @@ class EaselListener : InteractionListener { sendMessage(player, "You make a helmet in your colours.") return@addDialogueAction } else { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a steel full helm in order to do this.") return@addDialogueAction } } @@ -62,7 +63,7 @@ class EaselListener : InteractionListener { sendMessage(player, "You make a helmet in your colours.") return@addDialogueAction } else { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a rune full helm in order to do this.") return@addDialogueAction } } @@ -86,7 +87,7 @@ class EaselListener : InteractionListener { sendMessage(player, "You make a shield with your symbol on.") return@addDialogueAction } else { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a steel kiteshield in order to do this.") return@addDialogueAction } } @@ -98,7 +99,7 @@ class EaselListener : InteractionListener { sendMessage(player, "You make a shield with your symbol on.") return@addDialogueAction } else { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a rune kiteshield in order to do this.") return@addDialogueAction } } @@ -115,19 +116,16 @@ class EaselListener : InteractionListener { return@addDialogueAction } (!inInventory(player, HeraldicProduct.BANNER.primaryMaterialId) || !inInventory(player, HeraldicProduct.BANNER.secondaryMaterialId!!)) -> { - sendDialogue(player, "PLACEHOLDER") + sendDialogue(player, "You need a bolt of cloth and a plank in order to do this.") } else -> { if (removeItem(player, HeraldicProduct.BANNER.primaryMaterialId) && removeItem(player, HeraldicProduct.BANNER.secondaryMaterialId)) { addItemOrDrop(player, HeraldicProduct.BANNER.productForCrest(crest)) rewardXP(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingXp) animate(player, heraldryAnimation) - sendMessage(player, "PLACEHOLDER") - return@addDialogueAction - } else { - sendDialogue(player, "PLACEHOLDER") - return@addDialogueAction + sendMessage(player, "You make a banner with your symbol on.") } + return@addDialogueAction } } } @@ -135,5 +133,33 @@ class EaselListener : InteractionListener { } return@on true } + onUseWith(SCENERY, Items.BOLT_OF_CLOTH_8790, Scenery.BANNER_MAKING_STAND_13718) { player, _, _ -> + val crest = player.houseManager.crest + when { + (!hasLevelDyn(player, Skills.CONSTRUCTION, HeraldicProduct.BANNER.constructionReq)) -> { + sendDialogue(player, "You need a Construction level of ${HeraldicProduct.BANNER.constructionReq} to make this.") + return@onUseWith false + } + (!hasLevelDyn(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingReq)) -> { + sendDialogue(player, "You need a Crafting level of ${HeraldicProduct.BANNER.craftingReq} to make this.") + return@onUseWith false + } + (!inInventory(player, HeraldicProduct.BANNER.primaryMaterialId) || !inInventory(player, HeraldicProduct.BANNER.secondaryMaterialId!!)) -> { + sendDialogue(player, "You need a bolt of cloth and a plank in order to do this.") + } + else -> { + if (removeItem(player, HeraldicProduct.BANNER.primaryMaterialId) && removeItem(player, HeraldicProduct.BANNER.secondaryMaterialId)) { + addItemOrDrop(player, HeraldicProduct.BANNER.productForCrest(crest)) + rewardXP(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingXp) + animate(player, heraldryAnimation) + sendMessage(player, "You make a banner with your symbol on.") + return@onUseWith true + } else { + return@onUseWith false + } + } + } + return@onUseWith true + } } } \ No newline at end of file From 9d0c1e1607ab00d0d4f9843baa1ce746da9e48ca Mon Sep 17 00:00:00 2001 From: Bishop Date: Mon, 22 Jun 2026 12:02:05 -0500 Subject: [PATCH 11/20] Helper methods --- .../decoration/workshop/EaselListeners.kt | 184 ++++++------------ 1 file changed, 61 insertions(+), 123 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt index 18240f419..aa3fcd8e9 100644 --- a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt +++ b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt @@ -3,6 +3,7 @@ package content.global.skill.construction.decoration.workshop import content.global.skill.crafting.HeraldicProduct import core.api.* import core.game.interaction.InteractionListener +import core.game.node.entity.player.Player import core.game.node.entity.skill.Skills import org.rs09.consts.Items import org.rs09.consts.Scenery @@ -14,12 +15,65 @@ import org.rs09.consts.Scenery class EaselListener : InteractionListener { - private val easels = intArrayOf(Scenery.HELMET_PLUMING_STAND_13716, Scenery.PAINTING_STAND_13717, Scenery.BANNER_MAKING_STAND_13718) + private val easels = intArrayOf( + Scenery.HELMET_PLUMING_STAND_13716, + Scenery.PAINTING_STAND_13717, + Scenery.BANNER_MAKING_STAND_13718 + ) + private val buttonsToProducts = mapOf( + 2 to HeraldicProduct.STEEL_HELM, + 3 to HeraldicProduct.RUNE_HELM, + 4 to HeraldicProduct.STEEL_SHIELD, + 5 to HeraldicProduct.RUNE_SHIELD, + 6 to HeraldicProduct.BANNER + ) private val heraldryAnimation = 3654 + private fun checkRequirements(player: Player, product: HeraldicProduct) : Boolean { + when { + (!inInventory(player, product.primaryMaterialId)) -> { + sendDialogue(player, "You need a ${product.primaryMaterialId.asItem().name.toLowerCase()} to make this.") + return false + } + (product.secondaryMaterialId != null && !inInventory(player, product.secondaryMaterialId)) -> { + sendDialogue(player, "You need a ${product.secondaryMaterialId.asItem().name.toLowerCase()} to make this.") + return false + } + (!hasLevelDyn(player, Skills.CONSTRUCTION, product.constructionReq)) -> { + sendDialogue(player, "You need a Construction level of ${product.constructionReq} to make this.") + return false + } + (!hasLevelDyn(player, Skills.CRAFTING, product.craftingReq)) -> { + sendDialogue(player, "You need a Crafting level of ${product.craftingReq} to make this.") + return false + } + else -> { + return true + } + } + } + + private fun giveProduct(player: Player, product: HeraldicProduct) { + val crest = player.houseManager.crest + if (removeItem(player, product.primaryMaterialId)) { + if (product.secondaryMaterialId == null || removeItem(player, product.secondaryMaterialId)) { + addItemOrDrop(player, product.productForCrest(crest)) + rewardXP(player, Skills.CRAFTING, product.craftingXp) + animate(player, heraldryAnimation) + when (product) { + HeraldicProduct.STEEL_HELM, HeraldicProduct.RUNE_HELM -> + sendMessage(player, "You make a helmet in your colours.") + HeraldicProduct.STEEL_SHIELD, HeraldicProduct.RUNE_SHIELD -> + sendMessage(player, "You make a shield with your symbol on.") + HeraldicProduct.BANNER -> + sendMessage(player, "You make a banner with your symbol on.") + } + } + } + } + override fun defineListeners() { on(easels, SCENERY, "use") { player, node -> - val crest = player.houseManager.crest val options = when (node.id) { Scenery.HELMET_PLUMING_STAND_13716 -> arrayOf("Plumed steel helmet", "Plumed rune helmet") @@ -32,132 +86,16 @@ class EaselListener : InteractionListener { } sendDialogueOptions(player, "What do you want to make?", *options) addDialogueAction(player) { player, button -> - when (button) { - 2,3 -> { - when { - (!hasLevelDyn(player, Skills.CONSTRUCTION, HeraldicProduct.STEEL_HELM.constructionReq)) -> { - sendDialogue(player, "You need a Construction level of ${HeraldicProduct.STEEL_HELM.constructionReq} to make this.") - return@addDialogueAction - } - (!hasLevelDyn(player, Skills.CRAFTING, HeraldicProduct.STEEL_HELM.craftingReq)) -> { - sendDialogue(player, "You need a Crafting level of ${HeraldicProduct.STEEL_HELM.craftingReq} to make this.") - return@addDialogueAction - } - (button == 2) -> { - if (removeItem(player, HeraldicProduct.STEEL_HELM.primaryMaterialId)) { - addItemOrDrop(player, HeraldicProduct.STEEL_HELM.productForCrest(crest)) - rewardXP(player, Skills.CRAFTING, HeraldicProduct.STEEL_HELM.craftingXp) - animate(player, heraldryAnimation) - sendMessage(player, "You make a helmet in your colours.") - return@addDialogueAction - } else { - sendDialogue(player, "You need a steel full helm in order to do this.") - return@addDialogueAction - } - } - else -> { - if (removeItem(player, HeraldicProduct.RUNE_HELM.primaryMaterialId)) { - addItemOrDrop(player, HeraldicProduct.RUNE_HELM.productForCrest(crest)) - rewardXP(player, Skills.CRAFTING, HeraldicProduct.RUNE_HELM.craftingXp) - animate(player, heraldryAnimation) - sendMessage(player, "You make a helmet in your colours.") - return@addDialogueAction - } else { - sendDialogue(player, "You need a rune full helm in order to do this.") - return@addDialogueAction - } - } - } - } - 4,5 -> { - when { - (!hasLevelDyn(player, Skills.CONSTRUCTION, HeraldicProduct.STEEL_SHIELD.constructionReq)) -> { - sendDialogue(player, "You need a Construction level of ${HeraldicProduct.STEEL_SHIELD.constructionReq} to make this.") - return@addDialogueAction - } - (!hasLevelDyn(player, Skills.CRAFTING, HeraldicProduct.STEEL_SHIELD.craftingReq)) -> { - sendDialogue(player, "You need a Crafting level of ${HeraldicProduct.STEEL_SHIELD.craftingReq} to make this.") - return@addDialogueAction - } - (button == 4) -> { - if (removeItem(player, HeraldicProduct.STEEL_SHIELD.primaryMaterialId)) { - addItemOrDrop(player, HeraldicProduct.STEEL_SHIELD.productForCrest(crest)) - rewardXP(player, Skills.CRAFTING, HeraldicProduct.STEEL_SHIELD.craftingXp) - animate(player, heraldryAnimation) - sendMessage(player, "You make a shield with your symbol on.") - return@addDialogueAction - } else { - sendDialogue(player, "You need a steel kiteshield in order to do this.") - return@addDialogueAction - } - } - else -> { - if (removeItem(player, HeraldicProduct.RUNE_SHIELD.primaryMaterialId)) { - addItemOrDrop(player, HeraldicProduct.RUNE_SHIELD.productForCrest(crest)) - rewardXP(player, Skills.CRAFTING, HeraldicProduct.RUNE_SHIELD.craftingXp) - animate(player, heraldryAnimation) - sendMessage(player, "You make a shield with your symbol on.") - return@addDialogueAction - } else { - sendDialogue(player, "You need a rune kiteshield in order to do this.") - return@addDialogueAction - } - } - } - } - 6 -> { - when { - (!hasLevelDyn(player, Skills.CONSTRUCTION, HeraldicProduct.BANNER.constructionReq)) -> { - sendDialogue(player, "You need a Construction level of ${HeraldicProduct.BANNER.constructionReq} to make this.") - return@addDialogueAction - } - (!hasLevelDyn(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingReq)) -> { - sendDialogue(player, "You need a Crafting level of ${HeraldicProduct.BANNER.craftingReq} to make this.") - return@addDialogueAction - } - (!inInventory(player, HeraldicProduct.BANNER.primaryMaterialId) || !inInventory(player, HeraldicProduct.BANNER.secondaryMaterialId!!)) -> { - sendDialogue(player, "You need a bolt of cloth and a plank in order to do this.") - } - else -> { - if (removeItem(player, HeraldicProduct.BANNER.primaryMaterialId) && removeItem(player, HeraldicProduct.BANNER.secondaryMaterialId)) { - addItemOrDrop(player, HeraldicProduct.BANNER.productForCrest(crest)) - rewardXP(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingXp) - animate(player, heraldryAnimation) - sendMessage(player, "You make a banner with your symbol on.") - } - return@addDialogueAction - } - } - } + if (checkRequirements(player, buttonsToProducts[button] ?: return@addDialogueAction)) { + giveProduct(player, buttonsToProducts[button] ?: return@addDialogueAction) } + return@addDialogueAction } return@on true } onUseWith(SCENERY, Items.BOLT_OF_CLOTH_8790, Scenery.BANNER_MAKING_STAND_13718) { player, _, _ -> - val crest = player.houseManager.crest - when { - (!hasLevelDyn(player, Skills.CONSTRUCTION, HeraldicProduct.BANNER.constructionReq)) -> { - sendDialogue(player, "You need a Construction level of ${HeraldicProduct.BANNER.constructionReq} to make this.") - return@onUseWith false - } - (!hasLevelDyn(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingReq)) -> { - sendDialogue(player, "You need a Crafting level of ${HeraldicProduct.BANNER.craftingReq} to make this.") - return@onUseWith false - } - (!inInventory(player, HeraldicProduct.BANNER.primaryMaterialId) || !inInventory(player, HeraldicProduct.BANNER.secondaryMaterialId!!)) -> { - sendDialogue(player, "You need a bolt of cloth and a plank in order to do this.") - } - else -> { - if (removeItem(player, HeraldicProduct.BANNER.primaryMaterialId) && removeItem(player, HeraldicProduct.BANNER.secondaryMaterialId)) { - addItemOrDrop(player, HeraldicProduct.BANNER.productForCrest(crest)) - rewardXP(player, Skills.CRAFTING, HeraldicProduct.BANNER.craftingXp) - animate(player, heraldryAnimation) - sendMessage(player, "You make a banner with your symbol on.") - return@onUseWith true - } else { - return@onUseWith false - } - } + if (checkRequirements(player, HeraldicProduct.BANNER)) { + giveProduct(player, HeraldicProduct.BANNER) } return@onUseWith true } From 57853050d1dd6009ef811f7ccea96156bd8ba7ea Mon Sep 17 00:00:00 2001 From: Bishop Date: Mon, 22 Jun 2026 17:27:00 -0500 Subject: [PATCH 12/20] JSON data --- Server/data/configs/item_configs.json | 510 ++++++++++++++++++-------- 1 file changed, 367 insertions(+), 143 deletions(-) diff --git a/Server/data/configs/item_configs.json b/Server/data/configs/item_configs.json index a51c6805d..e036a9edf 100644 --- a/Server/data/configs/item_configs.json +++ b/Server/data/configs/item_configs.json @@ -69703,196 +69703,241 @@ { "id": "8464", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent the symbol of Arrav.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8466", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Asgarnia.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8468", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent the Dorgeshuun brooch.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8470", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent a dragon.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8472", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent a fairy.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8474", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Guthix.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8476", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent the HAM cult.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8478", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent the mythical 'horse'.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8480", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent a Jogre.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8482", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Kandarin.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8484", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Misthalin.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8486", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent money.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8488", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Saradomin.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8490", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Zamorak.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { "id": "8492", "name": "Rune heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Varrock.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { @@ -69902,10 +69947,13 @@ "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,40}", + "shop_price": "35200", + "tradeable": "false", "weight": "2.7" }, { @@ -71072,945 +71120,1121 @@ { "id": "8650", "name": "Banner", + "examine": "A banner with the symbol of Arrav.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8652", "name": "Banner", + "examine": "A banner with the symbol of Asgarnia.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8654", "name": "Banner", + "examine": "A banner with a picture of the Dorgeshuun brooch.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8656", "name": "Banner", + "examine": "A banner with the picture of a dragon.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8658", "name": "Banner", + "examine": "A banner with the symbol of a fairy.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8660", "name": "Banner", + "examine": "A banner with the symbol of Guthix.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8662", "name": "Banner", + "examine": "A banner with the symbol of the HAM cult.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8664", "name": "Banner", + "examine": "A banner with the picture of the mythical 'horse'.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8666", "name": "Banner", + "examine": "A banner with the picture of a Jogre.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8668", "name": "Banner", + "examine": "A banner with the symbol of Kandarin.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8670", "name": "Banner", + "examine": "A banner with the symbol of Misthalin.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8672", "name": "Banner", + "examine": "A banner with the picture of a money-bag.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8674", "name": "Banner", + "examine": "A banner with the symbol of Saradomin.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8676", "name": "Banner", + "examine": "A banner with the picture of a skull.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8678", "name": "Banner", + "examine": "A banner with the symbol of Varrock.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8680", "name": "Banner", + "examine": "A banner with the symbol of Zamorak.", "archery_ticket_price": "0", + "attack_anims": "428,2081,429,428", + "attack_speed": "4", + "defence_anim": "420", "durability": null, "equipment_slot": "3", "render_anim": "131", "run_anim": "1427", + "shop_price": "1", "stand_anim": "1421", "stand_turn_anim": "1426", + "tradeable": "false", "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", "two_handed": "true", "walk_anim": "1422", - "weapon_interface": "14" + "weapon_interface": "14", + "weight": "2" }, { "id": "8682", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent the symbol of Arrav.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8684", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Asgarnia.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8686", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent the Dorgeshuun brooch.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8688", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent a dragon.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8690", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent a fairy.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8692", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Guthix.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8694", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent the HAM cult.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8696", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent the mythical 'horse'.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8698", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent a Jogre.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8700", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Kandarin.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8702", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Misthalin.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8704", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent money.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8706", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Saradomin.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8708", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent a skull.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8710", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Varrock.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8712", "name": "Steel heraldic helm", - "examine": "The colours represent crest.", + "examine": "The colours represent Zamorak.", "archery_ticket_price": "0", "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0", "durability": null, + "equip_audio": "2240", "equipment_slot": "0", "remove_beard": "true", "remove_head": "true", "requirements": "{1,5}", + "shop_price": "600", + "tradeable": "false", "weight": "2.7" }, { "id": "8714", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Arrav.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8716", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Asgarnia.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8718", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with a picture of the Dorgeshuun brooch.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8720", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a dragon.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8722", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a fairy.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8724", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Guthix.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8726", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of HAM.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8728", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with a picture of the mythical 'horse'.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8730", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a Jogre.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8732", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Kandarin.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8734", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Misthalin.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8736", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a money-bag.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8738", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Saradomin.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8740", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a skull.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8742", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Varrock.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8744", "name": "Rune kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Zamorak.", "absorb": "3,0,7", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", - "lendable": "true", + "lendable": "", "requirements": "{1,40}", - "tradeable": "true", + "shop_price": "54400", + "tradeable": "false", "weight": "5.4" }, { "id": "8746", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Arrav.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8748", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Asgarnia.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8750", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with a picture of the Dorgeshuun brooch.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8752", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a dragon.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8754", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a fairy.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8756", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Guthix.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8758", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of HAM.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8760", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with a picture of the mythical 'horse'.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8762", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a Jogre.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8764", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Kandarin.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8766", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Misthalin.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8768", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a money-bag.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8770", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Saradomin.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8772", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the picture of a skull.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8774", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Varrock.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { "id": "8776", "name": "Steel kiteshield", - "examine": "A large metal shield.", + "examine": "A shield with the symbol of Zamorak.", "archery_ticket_price": "0", "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0", "durability": null, "equip_audio": "2245", "equipment_slot": "5", "requirements": "{1,5}", - "shop_price": "850", - "tradeable": "true", + "shop_price": "900", + "tradeable": "false", "weight": "5.4" }, { From a52bea7db595fcc116a5dfb865a0721fd867adc8 Mon Sep 17 00:00:00 2001 From: Bishop Date: Mon, 22 Jun 2026 18:16:34 -0500 Subject: [PATCH 13/20] Debug --- Server/data/configs/item_configs.json | 32 +++++++++---------- .../skill/construction/BuildHotspot.java | 4 +-- .../decoration/workshop/EaselListeners.kt | 2 +- .../falador/dialogue/SirReniteeDialogue.kt | 4 +-- .../core/game/dialogue/FacialExpression.java | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Server/data/configs/item_configs.json b/Server/data/configs/item_configs.json index e036a9edf..58410b664 100644 --- a/Server/data/configs/item_configs.json +++ b/Server/data/configs/item_configs.json @@ -71136,7 +71136,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71160,7 +71160,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71184,7 +71184,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71208,7 +71208,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71232,7 +71232,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71256,7 +71256,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71280,7 +71280,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71304,7 +71304,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71328,7 +71328,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71352,7 +71352,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71376,7 +71376,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71400,7 +71400,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71424,7 +71424,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71448,7 +71448,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71472,7 +71472,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" @@ -71496,7 +71496,7 @@ "turn180_anim": "1423", "turn90ccw_anim": "1425", "turn90cw_anim": "1424", - "two_handed": "true", + "two_handed": "false", "walk_anim": "1422", "weapon_interface": "14", "weight": "2" diff --git a/Server/src/main/content/global/skill/construction/BuildHotspot.java b/Server/src/main/content/global/skill/construction/BuildHotspot.java index c5ca6c8e7..640771c62 100644 --- a/Server/src/main/content/global/skill/construction/BuildHotspot.java +++ b/Server/src/main/content/global/skill/construction/BuildHotspot.java @@ -59,7 +59,7 @@ public enum BuildHotspot { DINING_BENCH_1(15300, BuildHotspotType.RECURSIVE, BuildingUtils.BUILD_MID_ANIM, Decoration.BENCH_WOODEN, Decoration.BENCH_OAK, Decoration.BENCH_CARVED_OAK, Decoration.BENCH_TEAK, Decoration.BENCH_CARVED_TEAK, Decoration.BENCH_MAHOGANY, Decoration.BENCH_GILDED), DINING_BENCH_2(15299, BuildHotspotType.RECURSIVE, BuildingUtils.BUILD_MID_ANIM, Decoration.BENCH_WOODEN, Decoration.BENCH_OAK, Decoration.BENCH_CARVED_OAK, Decoration.BENCH_TEAK, Decoration.BENCH_CARVED_TEAK, Decoration.BENCH_MAHOGANY,Decoration.BENCH_GILDED), ROPE_BELL_PULL(15304, BuildHotspotType.INDIVIDUAL, BuildingUtils.BUILD_HIGH_ANIM, Decoration.ROPE_PULL, Decoration.BELL_PULL, Decoration.FANCY_BELL_PULL), - WALL_DECORATION(15303, BuildHotspotType.RECURSIVE, BuildingUtils.BUILD_HIGH_ANIM, Decoration.OAK_DECORATION, Decoration.TEAK_DECORATION, Decoration.GILDED_DECORATION), + WALL_DECORATION(15303, BuildHotspotType.CREST, BuildingUtils.BUILD_HIGH_ANIM, Decoration.OAK_DECO, Decoration.TEAK_DECO, Decoration.GILDED_DECO), /** * Low-level Work shop hotspots. @@ -191,7 +191,7 @@ public enum BuildHotspot { /** * Combat room hotspots. */ - WALL_DECORATION2(15297, BuildHotspotType.RECURSIVE, BuildingUtils.BUILD_HIGH_ANIM, Decoration.OAK_DECORATION, Decoration.TEAK_DECORATION, Decoration.GILDED_DECORATION), + WALL_DECORATION2(15297, BuildHotspotType.CREST, BuildingUtils.BUILD_HIGH_ANIM, Decoration.OAK_DECO, Decoration.TEAK_DECO, Decoration.GILDED_DECO), STORAGE_SPACE(15296, BuildHotspotType.INDIVIDUAL, BuildingUtils.BUILD_MID_ANIM, Decoration.GLOVE_RACK, Decoration.WEAPONS_RACK, Decoration.EXTRA_WEAPONS_RACK), CR_RING(15277, BuildHotspotType.LINKED, BuildingUtils.BUILD_MID_ANIM, Decoration.BOXING_RING, Decoration.FENCING_RING, Decoration.COMBAT_RING, Decoration.NOTHING, Decoration.NOTHING2), CR_CORNER(15278, BuildHotspotType.LINKED, BuildingUtils.BUILD_MID_ANIM, Decoration.BOXING_RING, Decoration.FENCING_RING, Decoration.COMBAT_RING, Decoration.NOTHING, Decoration.NOTHING2), diff --git a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt index aa3fcd8e9..881b049f5 100644 --- a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt +++ b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt @@ -73,7 +73,7 @@ class EaselListener : InteractionListener { } override fun defineListeners() { - on(easels, SCENERY, "use") { player, node -> + on(easels, SCENERY, "use", "make-helmet") { player, node -> val options = when (node.id) { Scenery.HELMET_PLUMING_STAND_13716 -> arrayOf("Plumed steel helmet", "Plumed rune helmet") diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index 51f1a910e..11dc5a4ef 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -87,9 +87,9 @@ class SirReniteeDialogueFile : DialogueLabeller() { ) label("family_crest") - npc(ChatAnim.NEUTRAL2, "What is your name?") + npc(ChatAnim.NEUTRAL_FAST, "What is your name?") player(ChatAnim.NEUTRAL, "${player!!.username}.") - npc(ChatAnim.NEUTRAL2, "Mmm, ${player!!.username}, let me see...") + npc(ChatAnim.NEUTRAL_FAST, "Mmm, ${player!!.username}, let me see...") exec { player, _ -> if (hasLevelStat(player, Skills.CONSTRUCTION, HeraldicProduct.STEEL_HELM.constructionReq)) { loadLabel(player, "has_construction_level") diff --git a/Server/src/main/core/game/dialogue/FacialExpression.java b/Server/src/main/core/game/dialogue/FacialExpression.java index ce09ffff7..ff596dee3 100644 --- a/Server/src/main/core/game/dialogue/FacialExpression.java +++ b/Server/src/main/core/game/dialogue/FacialExpression.java @@ -70,7 +70,7 @@ public enum FacialExpression { SLEEPING(9802), SILENT(9804), NEUTRAL(9808), - NEUTRAL2(9810), // Like neutral but mouth starts moving immediately + NEUTRAL_FAST(9810), // Like neutral but mouth starts moving immediately THINKING(9812), HALF_THINKING(9814), DISGUSTED(9816), From 4fc33cf3fd9c6e93d1cd8e81f6dd91a2348e11f6 Mon Sep 17 00:00:00 2001 From: Bishop Date: Mon, 22 Jun 2026 18:28:40 -0500 Subject: [PATCH 14/20] ContentAPI finishTask --- .../region/asgarnia/falador/dialogue/SirReniteeDialogue.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index 11dc5a4ef..22582d21e 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -9,6 +9,7 @@ import core.api.* import core.game.dialogue.ChatAnim import core.game.dialogue.DialogueLabeller import core.game.dialogue.DialogueOption +import core.game.diary.DiaryLevel import core.game.interaction.IntType import core.game.interaction.InteractionListener import core.game.node.entity.npc.NPC @@ -115,7 +116,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { loadLabel(player, "show_new_crest") } if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(0, 4)) { - player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 0, 4, true) + finishTask(player, DiaryType.FALADOR, DiaryLevel.EASY, 4) } } From 9bf23219744bc60baa7a28ceec3eb729216e6a1b Mon Sep 17 00:00:00 2001 From: Bishop Date: Sun, 28 Jun 2026 00:18:06 -0500 Subject: [PATCH 15/20] Blocked crestless players from making heraldic items --- .../skill/construction/decoration/workshop/EaselListeners.kt | 5 +++++ .../region/asgarnia/falador/dialogue/SirReniteeDialogue.kt | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt index 881b049f5..c7f99b357 100644 --- a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt +++ b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt @@ -1,6 +1,7 @@ package content.global.skill.construction.decoration.workshop import content.global.skill.crafting.HeraldicProduct +import content.region.asgarnia.falador.dialogue.SirReniteeDialogueFile import core.api.* import core.game.interaction.InteractionListener import core.game.node.entity.player.Player @@ -31,6 +32,10 @@ class EaselListener : InteractionListener { private fun checkRequirements(player: Player, product: HeraldicProduct) : Boolean { when { + (!getAttribute(player, SirReniteeDialogueFile.attributeCrest, false)) -> { + sendDialogue(player, "You need a crest to make heraldic items.") // Placeholder + return false + } (!inInventory(player, product.primaryMaterialId)) -> { sendDialogue(player, "You need a ${product.primaryMaterialId.asItem().name.toLowerCase()} to make this.") return false diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index 22582d21e..06440bdc7 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -36,7 +36,7 @@ class SirReniteeDialogue : InteractionListener { class SirReniteeDialogueFile : DialogueLabeller() { - private companion object { + companion object { const val attributeCrest = "/save:sir-renitee-assigned-crest" const val attributeTempCrest = "sir-renitee-temp-crest" const val attributeTempPainting = "sir-renitee-temp-painting" @@ -121,7 +121,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { } label("show_existing_crest") - npc(ChatAnim.NEUTRAL, "According to my records, your crest is ${player!!.houseManager.crest.crestName}.") // test line breaks here + npc(ChatAnim.NEUTRAL, "According to my records, your crest is ${player!!.houseManager.crest.crestName}.") goto("crest_options") label("show_new_crest") From 6972629d773ce2f26c70874ac8c82f54022342ae Mon Sep 17 00:00:00 2001 From: Bishop Date: Sun, 28 Jun 2026 09:08:41 -0500 Subject: [PATCH 16/20] Properly handle crestless players building crest decorations --- .../skill/construction/BuildingUtils.java | 20 ++++++++++++--- .../global/skill/construction/CrestType.kt | 5 +++- .../global/skill/construction/Decoration.java | 25 ++++++++++++++++--- .../skill/construction/HouseManager.java | 5 +++- .../global/skill/construction/Room.java | 10 ++++++-- 5 files changed, 54 insertions(+), 11 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/BuildingUtils.java b/Server/src/main/content/global/skill/construction/BuildingUtils.java index 59e116afd..03cdd009d 100644 --- a/Server/src/main/content/global/skill/construction/BuildingUtils.java +++ b/Server/src/main/content/global/skill/construction/BuildingUtils.java @@ -276,7 +276,7 @@ public final class BuildingUtils { } break; case CREST: - SceneryBuilder.replace(object, object.transform(deco.getObjectId(style) + player.getHouseManager().getCrest().ordinal())); + SceneryBuilder.replace(object, object.transform(deco.getCrestAdjustedId(style, player.getHouseManager().getCrest()))); hotspot.setDecorationIndex(decIndex); break; case INDIVIDUAL: @@ -341,9 +341,13 @@ public final class BuildingUtils { HousingStyle style = player.getHouseManager().getStyle(); for (int i = 0; i < room.getHotspots().length; i++) { Hotspot hotspot = room.getHotspots()[i]; - int objectId = hotspot.getDecorationIndex() < 0 ? -1 : hotspot.getHotspot().getDecorations()[hotspot.getDecorationIndex()].getObjectId(style); - if (hotspot.getHotspot().getType() == BuildHotspotType.CREST) { - objectId += player.getHouseManager().getCrest().ordinal(); + int objectId; + if (hotspot.getDecorationIndex() < 0) { + objectId = -1; + } else if (hotspot.getHotspot().getType() == BuildHotspotType.CREST) { + objectId = hotspot.getHotspot().getDecorations()[hotspot.getDecorationIndex()].getCrestAdjustedId(style, player.getHouseManager().getCrest()); + } else { + objectId = hotspot.getHotspot().getDecorations()[hotspot.getDecorationIndex()].getObjectId(style); } if (objectId == object.getId() && hotspot.getCurrentX() == l.getChunkOffsetX() && hotspot.getCurrentY() == l.getChunkOffsetY()) { Decoration decoration = hotspot.getHotspot().getDecorations()[hotspot.getDecorationIndex()]; @@ -472,6 +476,14 @@ public final class BuildingUtils { return false; } return true; + case ROUND_SHIELD: + case SQUARE_SHIELD: + case KITE_SHIELD: + if (player.getHouseManager().getCrest() == CrestType.NULL) { + sendDialogue(player, "You need a crest to build heraldic shields."); // Placeholder + return false; + } + return true; default: return true; } diff --git a/Server/src/main/content/global/skill/construction/CrestType.kt b/Server/src/main/content/global/skill/construction/CrestType.kt index c9bfc22fd..6998d4193 100644 --- a/Server/src/main/content/global/skill/construction/CrestType.kt +++ b/Server/src/main/content/global/skill/construction/CrestType.kt @@ -8,6 +8,7 @@ import org.rs09.consts.Items /** * Enumerates the various crests the player can purchase for the Construction skill, as well as their requirements. + * The NULL CrestType represents players who have yet to receive a crest from Sir Renitee. * ORDINAL BOUND * @author Bishop */ @@ -39,7 +40,9 @@ enum class CrestType(val crestName: String, val cost: Int = 5000, private val re requirement = { it.skullManager.isSkulled }), VARROCK("the symbol of Varrock"), ZAMORAK("the symbol of Zamorak", - requirement = { hasLevelStat(it, Skills.PRAYER, 70) }); + requirement = { hasLevelStat(it, Skills.PRAYER, 70) }), + NULL("no crest", + cost = 0, requirement = { false }); fun eligible(player: Player): Boolean = requirement(player) } \ No newline at end of file diff --git a/Server/src/main/content/global/skill/construction/Decoration.java b/Server/src/main/content/global/skill/construction/Decoration.java index b86a78cd5..8719d3bbb 100644 --- a/Server/src/main/content/global/skill/construction/Decoration.java +++ b/Server/src/main/content/global/skill/construction/Decoration.java @@ -255,7 +255,7 @@ public enum Decoration { * Wall-mounted decorations */ OAK_DECORATION (13606, 8102, 16, 120, new Item[] { new Item(Items.OAK_PLANK_8778, 2) }), - TEAK_DECORATION (13606, 8103, 36, 180, new Item[] { new Item(Items.TEAK_PLANK_8780, 2) }), + TEAK_DECORATION (13608, 8103, 36, 180, new Item[] { new Item(Items.TEAK_PLANK_8780, 2) }), GILDED_DECORATION(13607, 8104, 56, 1020, new Item[] { new Item(Items.MAHOGANY_PLANK_8782, 3), new Item(Items.GOLD_LEAF_8784, 2) }), /** @@ -899,9 +899,11 @@ public enum Decoration { if (h.getCurrentX() == l.getChunkOffsetX() && h.getCurrentY() == l.getChunkOffsetY()) { if (h.getDecorationIndex() != -1) { Decoration deco = h.getHotspot().getDecorations()[h.getDecorationIndex()]; - int id = deco.getObjectId(player.getHouseManager().getStyle()); + int id; if (h.getHotspot().getType() == BuildHotspotType.CREST) { - id += player.getHouseManager().getCrest().ordinal(); + id = deco.getCrestAdjustedId(player.getHouseManager().getStyle(), player.getHouseManager().getCrest()); + } else { + id = deco.getObjectId(player.getHouseManager().getStyle()); } if (id == object.getId()) { return deco; @@ -968,6 +970,23 @@ public enum Decoration { return objectId; } + /** + * Returns the object ID adjusted for the player's crest. + * For CrestType.NULL, maps _DECO decorations to their blank _DECORATION counterparts. + * Returns -1 for shield decorations with NULL crest (no blank variant exists). + */ + public int getCrestAdjustedId(HousingStyle style, CrestType crest) { + if (crest == CrestType.NULL) { + switch (this) { + case OAK_DECO: return OAK_DECORATION.getObjectId(style); + case TEAK_DECO: return TEAK_DECORATION.getObjectId(style); + case GILDED_DECO: return GILDED_DECORATION.getObjectId(style); + default: return -1; + } + } + return getObjectId(style) + crest.ordinal(); + } + /** * Gets the level. * @return The level. diff --git a/Server/src/main/content/global/skill/construction/HouseManager.java b/Server/src/main/content/global/skill/construction/HouseManager.java index 5a46876e2..fa9e399fe 100644 --- a/Server/src/main/content/global/skill/construction/HouseManager.java +++ b/Server/src/main/content/global/skill/construction/HouseManager.java @@ -86,7 +86,7 @@ public final class HouseManager { /** * The player's crest. */ - private CrestType crest = CrestType.ASGARNIA; + private CrestType crest = CrestType.NULL; /** * Constructs a new {@code HouseManager} {@code Object}. @@ -104,6 +104,8 @@ public final class HouseManager { Object crestRaw = data.get("crest"); if (crestRaw != null) { crest = CrestType.values()[Integer.parseInt(crestRaw.toString())]; + } else { + crest = CrestType.ASGARNIA; } Object servRaw = data.get("servant"); if(servRaw != null){ @@ -352,6 +354,7 @@ public final class HouseManager { room.configure(style); room.getHotspots()[0].setDecorationIndex(0); redecorate(HousingStyle.BASIC_WOOD); + crest = CrestType.NULL; this.location = location; } diff --git a/Server/src/main/content/global/skill/construction/Room.java b/Server/src/main/content/global/skill/construction/Room.java index ac7b56cec..ee6c68300 100644 --- a/Server/src/main/content/global/skill/construction/Room.java +++ b/Server/src/main/content/global/skill/construction/Room.java @@ -140,9 +140,15 @@ public final class Room { Scenery object = objects[x][y]; if (object != null && object.getId() == spot.getHotspot().getObjectId(house.getStyle())) { if (spot.getDecorationIndex() > -1 && spot.getDecorationIndex() < spot.getHotspot().getDecorations().length) { - int id = spot.getHotspot().getDecorations()[spot.getDecorationIndex()].getObjectId(house.getStyle()); + int id; if (spot.getHotspot().getType() == BuildHotspotType.CREST) { - id += house.getCrest().ordinal(); + id = spot.getHotspot().getDecorations()[spot.getDecorationIndex()].getCrestAdjustedId(house.getStyle(), house.getCrest()); + if (id == -1) { + spot.setDecorationIndex(-1); + continue; + } + } else { + id = spot.getHotspot().getDecorations()[spot.getDecorationIndex()].getObjectId(house.getStyle()); } SceneryBuilder.replace(object, object.transform(id, object.getRotation(), chunk.getCurrentBase().transform(x, y, 0))); } From b5c53a47d6838b550d9137db030004434233427c Mon Sep 17 00:00:00 2001 From: Bishop Date: Sun, 28 Jun 2026 09:19:07 -0500 Subject: [PATCH 17/20] Fixed sequence breaking Sir Renitee --- .../main/content/global/skill/construction/HouseManager.java | 1 - Server/src/main/core/api/utils/Permadeath.kt | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/global/skill/construction/HouseManager.java b/Server/src/main/content/global/skill/construction/HouseManager.java index fa9e399fe..58ea96718 100644 --- a/Server/src/main/content/global/skill/construction/HouseManager.java +++ b/Server/src/main/content/global/skill/construction/HouseManager.java @@ -354,7 +354,6 @@ public final class HouseManager { room.configure(style); room.getHotspots()[0].setDecorationIndex(0); redecorate(HousingStyle.BASIC_WOOD); - crest = CrestType.NULL; this.location = location; } diff --git a/Server/src/main/core/api/utils/Permadeath.kt b/Server/src/main/core/api/utils/Permadeath.kt index 478c9b90a..6f1e41039 100644 --- a/Server/src/main/core/api/utils/Permadeath.kt +++ b/Server/src/main/core/api/utils/Permadeath.kt @@ -1,5 +1,6 @@ package core.api.utils +import content.global.skill.construction.CrestType import content.global.skill.construction.HouseLocation import content.minigame.blastfurnace.BFPlayerState import content.minigame.blastfurnace.BlastFurnace @@ -81,6 +82,7 @@ fun permadeath(target: Player) { // House data target.houseManager.createNewHouseAt(HouseLocation.NOWHERE) + target.houseManager.crest = CrestType.NULL target.getPOHStorageState().clear() // Achievements From 9adb43b5ca4766a5fb0ceac6fa6bd1402ca534b5 Mon Sep 17 00:00:00 2001 From: Bishop Date: Sun, 28 Jun 2026 10:11:02 -0500 Subject: [PATCH 18/20] Extra safety check --- .../skill/construction/decoration/workshop/EaselListeners.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt index c7f99b357..fc8167d8d 100644 --- a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt +++ b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt @@ -1,5 +1,6 @@ package content.global.skill.construction.decoration.workshop +import content.global.skill.construction.CrestType import content.global.skill.crafting.HeraldicProduct import content.region.asgarnia.falador.dialogue.SirReniteeDialogueFile import core.api.* @@ -32,7 +33,7 @@ class EaselListener : InteractionListener { private fun checkRequirements(player: Player, product: HeraldicProduct) : Boolean { when { - (!getAttribute(player, SirReniteeDialogueFile.attributeCrest, false)) -> { + (!getAttribute(player, SirReniteeDialogueFile.attributeCrest, false) || player.houseManager.crest == CrestType.NULL) -> { sendDialogue(player, "You need a crest to make heraldic items.") // Placeholder return false } From 59159111cf36004ccec4a9911a3573ddb1058808 Mon Sep 17 00:00:00 2001 From: Bishop Date: Sat, 1 Aug 2026 11:54:23 -0500 Subject: [PATCH 19/20] Constlib --- .../decoration/workshop/EaselListeners.kt | 28 ++++++++------- .../falador/dialogue/SirReniteeDialogue.kt | 34 ++++++++++--------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt index fc8167d8d..e95eef913 100644 --- a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt +++ b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt @@ -7,11 +7,12 @@ import core.api.* import core.game.interaction.InteractionListener import core.game.node.entity.player.Player import core.game.node.entity.skill.Skills +import org.rs09.consts.Animations import org.rs09.consts.Items import org.rs09.consts.Scenery /** - * Listens for use of the easel furniture pieces in a POH, with which players may make heraldic items. + * Handles easel type furniture in a POH, with which players may make heraldic items. * @author Bishop */ @@ -22,27 +23,19 @@ class EaselListener : InteractionListener { Scenery.PAINTING_STAND_13717, Scenery.BANNER_MAKING_STAND_13718 ) - private val buttonsToProducts = mapOf( - 2 to HeraldicProduct.STEEL_HELM, - 3 to HeraldicProduct.RUNE_HELM, - 4 to HeraldicProduct.STEEL_SHIELD, - 5 to HeraldicProduct.RUNE_SHIELD, - 6 to HeraldicProduct.BANNER - ) - private val heraldryAnimation = 3654 private fun checkRequirements(player: Player, product: HeraldicProduct) : Boolean { when { - (!getAttribute(player, SirReniteeDialogueFile.attributeCrest, false) || player.houseManager.crest == CrestType.NULL) -> { + (!getAttribute(player, SirReniteeDialogueFile.ATTRIBUTE_CREST, false) || player.houseManager.crest == CrestType.NULL) -> { sendDialogue(player, "You need a crest to make heraldic items.") // Placeholder return false } (!inInventory(player, product.primaryMaterialId)) -> { - sendDialogue(player, "You need a ${product.primaryMaterialId.asItem().name.toLowerCase()} to make this.") + sendDialogue(player, "You need a ${product.primaryMaterialId.asItem().name.lowercase()} to make this.") return false } (product.secondaryMaterialId != null && !inInventory(player, product.secondaryMaterialId)) -> { - sendDialogue(player, "You need a ${product.secondaryMaterialId.asItem().name.toLowerCase()} to make this.") + sendDialogue(player, "You need a ${product.secondaryMaterialId.asItem().name.lowercase()} to make this.") return false } (!hasLevelDyn(player, Skills.CONSTRUCTION, product.constructionReq)) -> { @@ -65,7 +58,7 @@ class EaselListener : InteractionListener { if (product.secondaryMaterialId == null || removeItem(player, product.secondaryMaterialId)) { addItemOrDrop(player, product.productForCrest(crest)) rewardXP(player, Skills.CRAFTING, product.craftingXp) - animate(player, heraldryAnimation) + animate(player, Animations.HUMAN_CRAFT_POH_CREST_3654) when (product) { HeraldicProduct.STEEL_HELM, HeraldicProduct.RUNE_HELM -> sendMessage(player, "You make a helmet in your colours.") @@ -90,6 +83,13 @@ class EaselListener : InteractionListener { else -> return@on false } + val buttonsToProducts = mapOf( + 2 to HeraldicProduct.STEEL_HELM, + 3 to HeraldicProduct.RUNE_HELM, + 4 to HeraldicProduct.STEEL_SHIELD, + 5 to HeraldicProduct.RUNE_SHIELD, + 6 to HeraldicProduct.BANNER + ) sendDialogueOptions(player, "What do you want to make?", *options) addDialogueAction(player) { player, button -> if (checkRequirements(player, buttonsToProducts[button] ?: return@addDialogueAction)) { @@ -99,6 +99,7 @@ class EaselListener : InteractionListener { } return@on true } + onUseWith(SCENERY, Items.BOLT_OF_CLOTH_8790, Scenery.BANNER_MAKING_STAND_13718) { player, _, _ -> if (checkRequirements(player, HeraldicProduct.BANNER)) { giveProduct(player, HeraldicProduct.BANNER) @@ -106,4 +107,5 @@ class EaselListener : InteractionListener { return@onUseWith true } } + } \ No newline at end of file diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index 06440bdc7..4103a82dd 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -37,15 +37,15 @@ class SirReniteeDialogue : InteractionListener { class SirReniteeDialogueFile : DialogueLabeller() { companion object { - const val attributeCrest = "/save:sir-renitee-assigned-crest" - const val attributeTempCrest = "sir-renitee-temp-crest" - const val attributeTempPainting = "sir-renitee-temp-painting" + const val ATTRIBUTE_CREST = "/save:sir-renitee-assigned-crest" + private const val ATTRIBUTE_CREST_TEMP = "sir-renitee-temp-crest" + private const val ATTRIBUTE_PAINTING_TEMP = "sir-renitee-temp-painting" } private fun selectCrest(crestType: CrestType, labelName: String) { label(labelName) exec { player, _ -> - setAttribute(player, attributeTempCrest, crestType) + setAttribute(player, ATTRIBUTE_CREST_TEMP, crestType) loadLabel(player, "crest_buy") } } @@ -53,7 +53,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { private fun selectPainting(painting: PaintingType, labelName: String) { label(labelName) exec { player, _ -> - setAttribute(player, attributeTempPainting, painting) + setAttribute(player, ATTRIBUTE_PAINTING_TEMP, painting) loadLabel(player, "painting_buy") } } @@ -107,12 +107,12 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("has_construction_level") exec { player, _ -> - if (getAttribute(player, attributeCrest, false)) { + if (getAttribute(player, ATTRIBUTE_CREST, false)) { loadLabel(player, "show_existing_crest") } else { val crests = arrayOf(CrestType.VARROCK, CrestType.ASGARNIA, CrestType.KANDARIN, CrestType.MISTHALIN) player.houseManager.crest = crests[RandomFunction.random(4)] - setAttribute(player, attributeCrest, true) + setAttribute(player, ATTRIBUTE_CREST, true) loadLabel(player, "show_new_crest") } if (!player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(0, 4)) { @@ -214,7 +214,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy") exec { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) + val crest = getAttribute(player, ATTRIBUTE_CREST_TEMP, CrestType.ASGARNIA) if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { player.houseManager.crest = crest if (crest == CrestType.SARADOMIN && !player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { @@ -228,7 +228,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy_ok") manual { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) + val crest = getAttribute(player, ATTRIBUTE_CREST_TEMP, CrestType.ASGARNIA) val expression = if (crest == CrestType.SKULL) { ChatAnim.AFRAID } else { @@ -283,7 +283,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy_fail") manual { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) + val crest = getAttribute(player, ATTRIBUTE_CREST_TEMP, CrestType.ASGARNIA) val messages = when (crest) { CrestType.ARRAV -> arrayOf("But that legendary shield is still lost! I don't think", @@ -412,7 +412,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("painting_buy") exec { player, _ -> - val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + val painting = getAttribute(player, ATTRIBUTE_PAINTING_TEMP, PaintingType.MAP_SMALL) if (painting.eligible(player)) { loadLabel(player, "painting_show_cost") } else { @@ -422,11 +422,11 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("painting_show_cost") manual { player, _ -> - val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + val painting = getAttribute(player, ATTRIBUTE_PAINTING_TEMP, PaintingType.MAP_SMALL) interpreter!!.sendDialogues(npc, ChatAnim.NEUTRAL, "That will be, mmm, ${painting.cost} coins please.") } exec { player, _ -> - val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + val painting = getAttribute(player, ATTRIBUTE_PAINTING_TEMP, PaintingType.MAP_SMALL) if (inInventory(player, Items.COINS_995, painting.cost)) { loadLabel(player, "painting_buy_confirm") } else { @@ -442,7 +442,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("painting_buy_fail") manual { player, _ -> - val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + val painting = getAttribute(player, ATTRIBUTE_PAINTING_TEMP, PaintingType.MAP_SMALL) val messages = when (painting) { PaintingType.ARTHUR -> arrayOf("Do you have, mmm, a connection with King Arthur? He", @@ -480,7 +480,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { interpreter!!.sendDialogues(npc, ChatAnim.NEUTRAL, *messages) } manual { player, _ -> - val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + val painting = getAttribute(player, ATTRIBUTE_PAINTING_TEMP, PaintingType.MAP_SMALL) val messages = when (painting) { PaintingType.ARTHUR -> arrayOf("To buy the portrait of King Arthur you must have", @@ -524,7 +524,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("painting_accept") exec { player, _ -> - val painting = getAttribute(player, attributeTempPainting, PaintingType.MAP_SMALL) + val painting = getAttribute(player, ATTRIBUTE_PAINTING_TEMP, PaintingType.MAP_SMALL) if (removeItem(player, Item(Items.COINS_995, painting.cost))) { addItemOrDrop(player, painting.paintingId) } @@ -544,5 +544,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { DialogueOption("map", "Yes - a map", "A map please.", expression = ChatAnim.NEUTRAL), DialogueOption("nothing", "No, thanks.", expression = ChatAnim.NEUTRAL), ) + } + } \ No newline at end of file From d881a70edf9eed8a47090e758b2af4928a98e9f7 Mon Sep 17 00:00:00 2001 From: Bishop Date: Sat, 1 Aug 2026 14:11:49 -0500 Subject: [PATCH 20/20] F-tier source to replace my "I made it up" source --- .../skill/construction/decoration/workshop/EaselListeners.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt index e95eef913..3434dd269 100644 --- a/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt +++ b/Server/src/main/content/global/skill/construction/decoration/workshop/EaselListeners.kt @@ -27,7 +27,7 @@ class EaselListener : InteractionListener { private fun checkRequirements(player: Player, product: HeraldicProduct) : Boolean { when { (!getAttribute(player, SirReniteeDialogueFile.ATTRIBUTE_CREST, false) || player.houseManager.crest == CrestType.NULL) -> { - sendDialogue(player, "You need a crest to make heraldic items.") // Placeholder + sendDialogueLines(player, "You must speak to the chief herald of Falador before you can make", "heraldic items.") // OSRS return false } (!inInventory(player, product.primaryMaterialId)) -> {