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