From f9fb929b4530b7e0770e37d1a6c19e531610581f Mon Sep 17 00:00:00 2001 From: szumaster Date: Mon, 24 Apr 2023 15:08:35 +0000 Subject: [PATCH] Improved Al Kharid dialogues AliTheFarmer now spawns AliTheGuard now spawns Improved chicken farm spawns --- Server/data/configs/npc_spawns.json | 20 ++- .../desert/alkharid/dialogue/AablaDialogue.kt | 18 +-- .../alkharid/dialogue/AlKharidHealListener.kt | 9 +- .../dialogue/AlKharidShopKeeperDialogue.kt | 21 +-- .../dialogue/AliMorrisaneDialogue.java | 131 ------------------ .../alkharid/dialogue/AliMorrisaneDialogue.kt | 69 +++++++++ .../alkharid/dialogue/AliTheFarmerDialogue.kt | 77 +++++----- .../desert/alkharid/dialogue/AliTheGuard.kt | 74 +++++----- .../dialogue/AliTheLeafletDropperDialogue.kt | 62 ++++----- .../dialogue/AliTheLeafletDropperListener.kt | 16 ++- .../alkharid/dialogue/AliTheSmithDialogue.kt | 65 +++++---- .../alkharid/dialogue/DommikDialogue.java | 72 ---------- .../alkharid/dialogue/DommikDialogue.kt | 47 +++++++ .../desert/alkharid/dialogue/FadliDialogue.kt | 36 ++--- .../alkharid/dialogue/GemTraderDialogue.kt | 14 +- .../alkharid/dialogue/JaraahDialogue.kt | 30 ++-- .../alkharid/dialogue/SabreenDialogue.kt | 18 +-- .../dialogue/SurgeonGeneralTafaniDialogue.kt | 34 ++--- 18 files changed, 355 insertions(+), 458 deletions(-) delete mode 100644 Server/src/main/content/region/desert/alkharid/dialogue/AliMorrisaneDialogue.java create mode 100644 Server/src/main/content/region/desert/alkharid/dialogue/AliMorrisaneDialogue.kt delete mode 100644 Server/src/main/content/region/desert/alkharid/dialogue/DommikDialogue.java create mode 100644 Server/src/main/content/region/desert/alkharid/dialogue/DommikDialogue.kt diff --git a/Server/data/configs/npc_spawns.json b/Server/data/configs/npc_spawns.json index e6bda8222..55cf47aa0 100644 --- a/Server/data/configs/npc_spawns.json +++ b/Server/data/configs/npc_spawns.json @@ -129,7 +129,7 @@ }, { "npc_id": "41", - "loc_data": "{3197,3356,0,1,4}-{3234,3297,0,1,3}-{3230,3296,0,1,5}-{3236,3288,0,1,6}-{3236,3300,0,1,2}-{3231,3308,0,1,3}-{2965,3336,0,1,4}-{3110,9573,0,1,6}-{2655,3441,0,1,6}-{2649,3438,0,1,7}-{2649,3446,0,1,6}-{2653,3444,0,1,6}-{2647,3441,0,1,1}-{2784,3062,0,1,4}-{2789,3063,0,1,4}-{3140,3096,0,1,3}-{3140,3093,0,1,0}-{3138,3094,0,1,1}-{3140,3093,0,1,3}-{3138,3093,0,1,1}-{3138,3094,0,1,0}-{3187,3276,0,1,5}-{3188,3278,0,1,4}-{2851,3370,0,1,3}-{2846,3374,0,1,3}-{2853,3372,0,1,3}-{2847,3373,0,1,3}-{2850,3371,0,1,1}-{2851,3373,0,1,4}-{2852,3370,0,1,4}-{3234,3293,0,1,4}-{3229,3298,0,1,1}-{3228,3296,0,1,4}-{2815,3560,0,1,7}-{2819,3561,0,1,4}-{2818,3559,0,1,6}-{3140,3093,0,1,1}-{2674,3652,0,1,3}-{2672,3655,0,1,6}-{2677,3655,0,1,6}-{2694,3274,0,1,6}-{2695,3275,0,1,3}" + "loc_data": "{3197,3356,0,1,4}-{3234,3297,0,1,3}-{3230,3296,0,1,5}-{3236,3288,0,1,6}-{3236,3300,0,1,2}-{2965,3336,0,1,4}-{3110,9573,0,1,6}-{2655,3441,0,1,6}-{2649,3438,0,1,7}-{2649,3446,0,1,6}-{2653,3444,0,1,6}-{2647,3441,0,1,1}-{2784,3062,0,1,4}-{2789,3063,0,1,4}-{3140,3096,0,1,3}-{3140,3093,0,1,0}-{3138,3094,0,1,1}-{3140,3093,0,1,3}-{3138,3093,0,1,1}-{3138,3094,0,1,0}-{3187,3276,0,1,5}-{3188,3278,0,1,4}-{2851,3370,0,1,3}-{2846,3374,0,1,3}-{2853,3372,0,1,3}-{2847,3373,0,1,3}-{2850,3371,0,1,1}-{2851,3373,0,1,4}-{2852,3370,0,1,4}-{3234,3293,0,1,4}-{3229,3298,0,1,1}-{3228,3296,0,1,4}-{2815,3560,0,1,7}-{2819,3561,0,1,4}-{2818,3559,0,1,6}-{3140,3093,0,1,1}-{2674,3652,0,1,3}-{2672,3655,0,1,6}-{2677,3655,0,1,6}-{2694,3274,0,1,6}-{2695,3275,0,1,3}" }, { "npc_id": "42", @@ -2485,7 +2485,7 @@ }, { "npc_id": "1017", - "loc_data": "{3198,3359,0,1,0}-{3231,3296,0,1,6}-{3233,3300,0,1,4}-{3235,3293,0,1,3}-{3232,3288,0,1,0}-{3234,3298,0,1,6}-{2785,3069,0,1,4}-{2800,3072,0,1,6}-{3234,3297,0,1,3}-{3234,3292,0,1,4}-{3235,3289,0,1,1}-{2677,3656,0,1,2}-{2672,3654,0,1,2}-{2676,3652,0,1,4}-{2681,3652,0,1,4}-{2675,3652,0,1,3}-{2693,3271,0,1,3}-{2692,3272,0,1,3}-{3190,3278,0,1,0}-{3187,3277,0,1,0}--{3189,3278,0,1,3}" + "loc_data": "{3191,3277,0,1,0}-{3188,3279,0,1,0}-{3187,3277,0,1,0}-{3198,3359,0,1,0}-{3231,3296,0,1,6}-{3233,3300,0,1,4}-{3235,3293,0,1,3}-{3232,3288,0,1,0}-{3234,3298,0,1,6}-{2785,3069,0,1,4}-{2800,3072,0,1,6}-{3234,3297,0,1,3}-{3234,3292,0,1,4}-{3235,3289,0,1,1}-{2677,3656,0,1,2}-{2672,3654,0,1,2}-{2676,3652,0,1,4}-{2681,3652,0,1,4}-{2675,3652,0,1,3}-{2693,3271,0,1,3}-{2692,3272,0,1,3}-{3190,3278,0,1,0}-{3187,3277,0,1,0}--{3189,3278,0,1,3}" }, { "npc_id": "1019", @@ -3841,7 +3841,7 @@ }, { "npc_id": "1757", - "loc_data": "{3233,3308,0,0,4}" + "loc_data": "{3233,3308,0,1,4}" }, { "npc_id": "1758", @@ -5203,6 +5203,18 @@ "npc_id": "2819", "loc_data": "{3295,3193,0,0,0}" }, + { + "npc_id": "2820", + "loc_data": "{3302,3185,0,1,4}" + }, + { + "npc_id": "2821", + "loc_data": "{3306,3196,0,0,4}" + }, + { + "npc_id": "2823", + "loc_data": "{3302,3197,0,1,4}" + }, { "npc_id": "2824", "loc_data": "{3275,3193,0,0,0}" @@ -5981,7 +5993,7 @@ }, { "npc_id": "3680", - "loc_data": "{3281,3331,0,1,7}" + "loc_data": "{3282,3327,0,1,7}" }, { "npc_id": "3695", diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AablaDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/AablaDialogue.kt index 80d06b80c..0330f7f7e 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/AablaDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/AablaDialogue.kt @@ -2,26 +2,26 @@ package content.region.desert.alkharid.dialogue import core.game.dialogue.DialoguePlugin import core.game.dialogue.FacialExpression +import core.game.dialogue.Topic import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.plugin.Initializable -import org.rs09.consts.NPCs -import core.game.dialogue.Topic import core.tools.END_DIALOGUE +import org.rs09.consts.NPCs /** * @author bushtail */ @Initializable -class AablaDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) { - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { +class AablaDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun newInstance(player: Player?): DialoguePlugin { return AablaDialogue(player) } override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - player(core.game.dialogue.FacialExpression.FRIENDLY, "Hi!").also { stage = 0 } + playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = 0 } return true } @@ -33,11 +33,11 @@ class AablaDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin( Topic("Do you come here often?", 201) ) - 101 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "I work here, so yes!").also { stage = END_DIALOGUE } + 101 -> npcl(FacialExpression.FRIENDLY, "I work here, so yes!").also { stage = END_DIALOGUE } - 201 -> npcl(core.game.dialogue.FacialExpression.HALF_THINKING, "Yes I do. Thankfully we can cope with almost anything. Jaraah really is a wonderful surgeon, his methods are a little unorthodox but he gets the job done.").also { stage++ } - 202 -> npcl(core.game.dialogue.FacialExpression.HALF_GUILTY, "I shouldn't tell you this but his nickname is 'The Butcher'.").also { stage++ } - 203 -> player(core.game.dialogue.FacialExpression.HALF_WORRIED, "That's reassuring.").also { stage = END_DIALOGUE } + 201 -> npcl(FacialExpression.HALF_THINKING, "Yes I do. Thankfully we can cope with almost anything. Jaraah really is a wonderful surgeon, his methods are a little unorthodox but he gets the job done.").also { stage++ } + 202 -> npcl(FacialExpression.HALF_GUILTY, "I shouldn't tell you this but his nickname is 'The Butcher'.").also { stage++ } + 203 -> playerl(FacialExpression.HALF_WORRIED, "That's reassuring.").also { stage = END_DIALOGUE } } return true } diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AlKharidHealListener.kt b/Server/src/main/content/region/desert/alkharid/dialogue/AlKharidHealListener.kt index a9413393d..b7c0356df 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/AlKharidHealListener.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/AlKharidHealListener.kt @@ -5,6 +5,7 @@ import core.game.node.entity.skill.Skills import org.rs09.consts.Animations import org.rs09.consts.NPCs import core.game.dialogue.DialogueFile +import core.game.dialogue.FacialExpression import core.game.interaction.InteractionListener import core.game.interaction.IntType import core.tools.END_DIALOGUE @@ -35,15 +36,15 @@ class AlKharidHealDialogue(val skipFirst: Boolean) : DialogueFile() { override fun handle(componentID: Int, buttonID: Int) { if (stage == 0 && skipFirst) stage++ when(stage) { - 0 -> player(core.game.dialogue.FacialExpression.ASKING, "Can you heal me?").also { stage++ } - 1 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "Of course!").also { stage++ } + 0 -> playerl(FacialExpression.ASKING, "Can you heal me?").also { stage++ } + 1 -> npcl(FacialExpression.FRIENDLY, "Of course!").also { stage++ } 2 -> { animate(npc!!, Animations.HUMAN_PICKPOCKETING_881) if(player!!.skills.lifepoints < getStatLevel(player!!, Skills.HITPOINTS)) { player!!.skills.heal(21) - npcl(core.game.dialogue.FacialExpression.FRIENDLY, "There you go!") + npcl(FacialExpression.FRIENDLY, "There you go!") } else { - npcl(core.game.dialogue.FacialExpression.FRIENDLY, "You look healthy to me!") + npcl(FacialExpression.FRIENDLY, "You look healthy to me!") } stage = END_DIALOGUE } diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AlKharidShopKeeperDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/AlKharidShopKeeperDialogue.kt index bd1d78359..803581271 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/AlKharidShopKeeperDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/AlKharidShopKeeperDialogue.kt @@ -5,8 +5,8 @@ import core.game.dialogue.FacialExpression import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.plugin.Initializable -import org.rs09.consts.NPCs import core.tools.END_DIALOGUE +import org.rs09.consts.NPCs /** * @author bushtail @@ -21,35 +21,28 @@ class AlKharidShopKeeperDialogue(player: Player? = null) : DialoguePlugin(player override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - npcl(core.game.dialogue.FacialExpression.HALF_ASKING, "Can I help you at all?") + npcl(FacialExpression.HALF_ASKING, "Can I help you at all?") stage = 100 return true } override fun handle(interfaceId: Int, buttonId: Int): Boolean { when(stage) { - 100 -> options( - "Yes, please. What are you selling?", - "How should I use your shop?", - "No, thanks." - ).also { stage++ } + 100 -> options("Yes, please. What are you selling?", "How should I use your shop?", "No, thanks.").also { stage++ } 101 -> when(buttonId) { 1 -> { stage = END_DIALOGUE npc.openShop(player) } - 2 -> player(core.game.dialogue.FacialExpression.ASKING, "How should I use your shop?").also { stage = 201 } - 3 -> player(core.game.dialogue.FacialExpression.NEUTRAL, "No, thanks.").also { stage = END_DIALOGUE } + 2 -> playerl(FacialExpression.ASKING, "How should I use your shop?").also { stage = 201 } + 3 -> playerl(FacialExpression.NEUTRAL, "No, thanks.").also { stage = END_DIALOGUE } } - 201 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "I'm glad you ask! You can buy as many of the items stocked as you wish. You can also sell most items to the shop.").also { stage = END_DIALOGUE } + 201 -> npcl(FacialExpression.FRIENDLY, "I'm glad you ask! You can buy as many of the items stocked as you wish. You can also sell most items to the shop.").also { stage = END_DIALOGUE } } return true } override fun getIds(): IntArray { - return intArrayOf( - NPCs.SHOPKEEPER_524, - NPCs.SHOP_ASSISTANT_525 - ) + return intArrayOf(NPCs.SHOPKEEPER_524, NPCs.SHOP_ASSISTANT_525) } } \ No newline at end of file diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AliMorrisaneDialogue.java b/Server/src/main/content/region/desert/alkharid/dialogue/AliMorrisaneDialogue.java deleted file mode 100644 index 0fbf496d5..000000000 --- a/Server/src/main/content/region/desert/alkharid/dialogue/AliMorrisaneDialogue.java +++ /dev/null @@ -1,131 +0,0 @@ -package content.region.desert.alkharid.dialogue; - -import core.game.dialogue.DialoguePlugin; -import core.game.node.entity.npc.NPC; -import core.plugin.Initializable; -import core.game.node.entity.player.Player; - -/** - * Represents the ali morrisane dialogue. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class AliMorrisaneDialogue extends DialoguePlugin { - - /** - * Constructs a new {@code AliMorrisaneDialogue} {@code Object}. - * @param player the player. - */ - public AliMorrisaneDialogue(final Player player) { - super(player); - } - - /** - * Constructs a new {@code AliMorrisaneDialogue} {@code Object}. - */ - public AliMorrisaneDialogue() { - /** - * empty. - */ - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new AliMorrisaneDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - npc("Good day and welcome back to Al Kharid."); - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - player("Hello to you too."); - stage = 1; - break; - case 1: - npc("My name is Ali Morrisane - the greatest salesman in", "the world."); - stage = 2; - break; - case 2: - options("If you are, then why are you still selling goods from a stall?", "So what are you selling then?"); - stage = 3; - break; - case 3: - switch (buttonId) { - case 1: - player("If you are, then why are you still selling goods from a", "stall?"); - stage = 10; - break; - case 2: - end(); - npc.openShop(player); - break; - } - break; - case 10: - npc("Well one can only do and sell so much. If I had more", "staff I'd be able to sell more, rather than wasting my", "time on menial things I could get on with selling sand", "to the Bedabin and useless tourist trinkets to everyone."); - stage = 11; - break; - case 11: - options("I'm far too busy - adventuring is a full time job you know.", "I'd like to help you but...."); - stage = 12; - break; - case 12: - switch (buttonId) { - case 1: - player("I'm far too busy - adventuring is a full time job you", "know."); - stage = 15; - break; - case 2: - player("I'd like to help you but....."); - stage = 13; - break; - } - break; - case 13: - npc("Yes I know, I know - the life of a shop keeper isn't", "slaying dragon and wooing damsels but it has its", "charms"); - stage = 14; - break; - case 14: - end(); - break; - case 15: - npc("No problem my friend, perhaps another time."); - stage = 16; - break; - case 16: - npc("Anyway, have a look at my wares."); - stage = 17; - break; - case 17: - options("No, I'm really too busy.", "Okay."); - stage = 18; - break; - case 18: - switch (buttonId) { - case 1: - end(); - break; - case 2: - end(); - npc.openShop(player); - break; - } - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 1862 }; - } - -} diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AliMorrisaneDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/AliMorrisaneDialogue.kt new file mode 100644 index 000000000..0550e8579 --- /dev/null +++ b/Server/src/main/content/region/desert/alkharid/dialogue/AliMorrisaneDialogue.kt @@ -0,0 +1,69 @@ +package content.region.desert.alkharid.dialogue + +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.plugin.Initializable +import org.rs09.consts.NPCs + +/** + * Represents the ali morrisane dialogue. + * @author 'Vexia + * @version 1.0 + */ +@Initializable +class AliMorrisaneDialogue(player: Player? = null) : DialoguePlugin(player) { + + override fun newInstance(player: Player?): DialoguePlugin { + return AliMorrisaneDialogue(player) + } + + override fun open(vararg args: Any): Boolean { + npc = args[0] as NPC + npcl(FacialExpression.FRIENDLY, "Good day and welcome back to Al Kharid.") + return true + } + + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + 0 -> playerl(FacialExpression.FRIENDLY, "Hello to you too.").also { stage = 1 } + 1 -> npcl(FacialExpression.ASKING, "My name is Ali Morrisane - the greatest salesman in the world.").also { stage = 2 } + 2 -> options("If you are, then why are you still selling goods from a stall?", "So what are you selling then?").also { stage = 3 } + 3 -> when (buttonId) { + 1 -> playerl(FacialExpression.ASKING, "If you are, then why are you still selling goods from a stall?").also { stage = 10 } + 2 -> { + end() + npc.openShop(player) + } + } + 10 -> npcl(FacialExpression.FRIENDLY, "Well one can only do and sell so much. If I had more staff I'd be able to sell more").also { stage = 11 } + 11 -> npcl(FacialExpression.FRIENDLY,"rather than wasting my time on menial things I could get on with selling sand to the Bedabin and useless tourist trinkets to everyone.").also { stage = 12 } + 12 -> options("I'm far too busy - adventuring is a full time job you know.", "I'd like to help you but....").also { stage = 13 } + 13 -> when (buttonId) { + 1 -> playerl(FacialExpression.FRIENDLY, "I'm far too busy - adventuring is a full time job you know.").also { stage = 16 } + 2 -> playerl(FacialExpression.FRIENDLY, "I'd like to help you but.....").also { stage = 14 } + } + 14 -> npcl(FacialExpression.FRIENDLY, "Yes I know, I know - the life of a shop keeper isn't slaying dragon and wooing damsels but it has its charms").also { stage = 15 } + 15 -> end() + 16 -> npcl(FacialExpression.FRIENDLY,"No problem my friend, perhaps another time.").also { stage = 17 } + 17 -> npcl(FacialExpression.FRIENDLY, "Anyway, have a look at my wares.").also { stage = 18 } + 18 -> options("No, I'm really too busy.", "Okay.").also { stage = 19 } + 19 -> when (buttonId) { + 1 -> { + end() + } + 2 -> { + end() + npc.openShop(player) + } + } + } + return true + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.ALI_MORRISANE_1862) + } +} + diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheFarmerDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheFarmerDialogue.kt index 2465b2a55..46a0e020a 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheFarmerDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheFarmerDialogue.kt @@ -5,69 +5,60 @@ import core.game.dialogue.FacialExpression import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.plugin.Initializable +import org.rs09.consts.NPCs /** * @author qmqz */ @Initializable -class AliTheFarmerDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player){ +class AliTheFarmerDialogue(player: Player? = null) : DialoguePlugin(player){ + + override fun newInstance(player: Player?): DialoguePlugin { + return AliTheFarmerDialogue(player) + } override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - player(core.game.dialogue.FacialExpression.FRIENDLY,"Hello there!") - stage = 0 + playerl(FacialExpression.FRIENDLY,"Hello there!") return true } override fun handle(interfaceId: Int, buttonId: Int): Boolean { when(stage){ - 0 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Oh, er, hello. What do you want?").also { stage++ } - 1 -> options ("What can you tell me about Al Kharid?", "So, what do you do here?", - "I hear you work for Ali Morrisane...", "I hear you've been threatening the other shopkeepers.").also { stage++ } + 0 -> npcl(FacialExpression.FRIENDLY,"Oh, er, hello. What do you want?").also { stage++ } + 1 -> options("What can you tell me about Al Kharid?", "So, what do you do here?", "I hear you work for Ali Morrisane...", "I hear you've been threatening the other shopkeepers.").also { stage++ } 2 -> when(buttonId){ - 1 -> player(core.game.dialogue.FacialExpression.ASKING, "What can you tell me about Al Kharid?").also { stage = 10 } - 2 -> player(core.game.dialogue.FacialExpression.ASKING, "So, what do you do here?").also { stage = 20 } - 3 -> player(core.game.dialogue.FacialExpression.ASKING, "I hear you work for Ali Morrisane...").also { stage = 30 } - 4 -> player(core.game.dialogue.FacialExpression.ASKING, "I hear you've been threatening the other shopkeepers.").also { stage = 40 } - + 1 -> playerl(FacialExpression.ASKING, "What can you tell me about Al Kharid?").also { stage = 10 } + 2 -> playerl(FacialExpression.ASKING, "So, what do you do here?").also { stage = 20 } + 3 -> playerl(FacialExpression.ASKING, "I hear you work for Ali Morrisane...").also { stage = 30 } + 4 -> playerl(FacialExpression.ASKING, "I hear you've been threatening the other shopkeepers.").also { stage = 40 } + } + 10 -> npcl(FacialExpression.FRIENDLY,"There's not much farming land around here. Only that little patch outside.").also { stage++ } + 11 -> playerl(FacialExpression.ASKING,"Can you give me any advice on farming here in the desert?").also { stage++ } + 12 -> npcl(FacialExpression.FRIENDLY,"Like I said, I only know about cactuses...").also { stage++ } + 13 -> playerl(FacialExpression.FRIENDLY,"Just tell me about cactuses, then.").also { stage++ } + 14 -> npcl(FacialExpression.FRIENDLY,"First you have to weed the patch using a rake.").also { stage++ } + 15 -> playerl(FacialExpression.ASKING,"Can you give me any other advice?").also { stage++ } + 16 -> npcl(FacialExpression.FRIENDLY,"Not really. I've not done much farming recently.").also { stage++ } + 17 -> playerl(FacialExpression.ASKING,"Well, can you at least sell me any gardening tools or seeds?").also { stage++ } + 18 -> npcl(FacialExpression.GUILTY,"Sorry. They haven't been delivered yet.").also { stage = 1 } + 20 -> npcl(FacialExpression.FRIENDLY,"I'm going to set up a shop selling farming implements. That patch out there may be small, but it's all we've got.").also { stage = 11 } + 30 -> npcl(FacialExpression.FRIENDLY,"Yes, he bought these tents and had them put up for us. He says he'll also get our goods in, so we can start selling them soon.").also { stage++ } + 31 -> npcl(FacialExpression.FRIENDLY,"I only know how to farm cactuses, so this spot is perfect.").also { stage++ } + 32 -> playerl(FacialExpression.THINKING,"Maybe I should talk to him...").also { stage++ } + 33 -> npcl(FacialExpression.FRIENDLY,"Of course. He's always happy to talk to possible business partners.").also { stage = 1 } + 40 -> npcl(FacialExpression.FRIENDLY,"Now why would you think that?").also { stage++ } + 41 -> playerl(FacialExpression.FRIENDLY,"One of the shopkeepers told they were threatened by a man with a rake...").also { stage++ } + 42 -> npcl(FacialExpression.FRIENDLY,"Those people just don't want us to succeed. Don't listen to them!").also { stage = 99 } + 99 -> { + end() } - - 10 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"There's not much farming land around here.", "Only that little patch outside.").also { stage++ } - 11 -> player(core.game.dialogue.FacialExpression.ASKING,"Can you give me any advice on farming here in","the desert?").also { stage++ } - 12 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Like I said, I only know about cactuses...").also { stage++ } - 13 -> player(core.game.dialogue.FacialExpression.FRIENDLY,"Just tell me about cactuses, then.").also { stage++ } - 14 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"First you have to weed the patch using a rake.").also { stage++ } - 15 -> player(core.game.dialogue.FacialExpression.ASKING,"Can you give me any other advice?").also { stage++ } - 16 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Not really. I've not done much farming recently.").also { stage++ } - 17 -> player(core.game.dialogue.FacialExpression.ASKING,"Well, can you at least sell me any gardening", "tools or seeds?").also { stage++ } - 18 -> npc(core.game.dialogue.FacialExpression.GUILTY,"Sorry. They haven't been delivered yet.").also { stage = 1 } - - 20 -> npc( - core.game.dialogue.FacialExpression.FRIENDLY,"I'm going to set up a shop selling farming implements.", - "That patch out there may be small, ", "but it's all we've got.").also { stage = 11 } - - 30 -> npc( - core.game.dialogue.FacialExpression.FRIENDLY,"Yes, he bought these tents and had them put up for us.", - "He says he'll also get our goods in,", "so we can start selling them soon.").also { stage++ } - 31 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"I only know how to farm cactuses, so this spot", "is perfect.").also { stage++ } - 32 -> player(core.game.dialogue.FacialExpression.THINKING,"Maybe I should talk to him...").also { stage++ } - 33 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Of course.", "He's always happy to talk to possible business", "partners.").also { stage = 1 } - - 40 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Now why would you think that?").also { stage++ } - 41 -> player(core.game.dialogue.FacialExpression.FRIENDLY,"One of the shopkeepers told they were threatened", "by a man with a rake...").also { stage++ } - 42 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Those people just don't want us to succeed.", "Don't listen to them!").also { stage = 99 } - - 99 -> end() } return true } - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { - return AliTheFarmerDialogue(player) - } - override fun getIds(): IntArray { - return intArrayOf(2821) + return intArrayOf(NPCs.ALI_THE_FARMER_2821) } } \ No newline at end of file diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheGuard.kt b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheGuard.kt index a27e67966..7704e0a30 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheGuard.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheGuard.kt @@ -5,66 +5,60 @@ import core.game.dialogue.FacialExpression import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.plugin.Initializable +import org.rs09.consts.NPCs /** * @author qmqz */ @Initializable -class AliTheGuard(player: Player? = null) : core.game.dialogue.DialoguePlugin(player){ +class AliTheGuard(player: Player? = null) : DialoguePlugin(player){ + + override fun newInstance(player: Player?): DialoguePlugin { + return AliTheGuard(player) + } override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - player(core.game.dialogue.FacialExpression.FRIENDLY,"Hello there!") - stage = 0 + playerl(FacialExpression.FRIENDLY,"Hello there!") return true } override fun handle(interfaceId: Int, buttonId: Int): Boolean { when(stage){ - 0 -> npc(core.game.dialogue.FacialExpression.ANNOYED,"I'm working. What do you have to say that's so urgent?").also { stage++ } - 1 -> options ("What can you tell me about Al Kharid?", "So, what do you do here?", - "I hear you work for Ali Morrisane...", "I hear you've been threatening the other shopkeepers.").also { stage++ } + 0 -> npcl(FacialExpression.ANNOYED,"I'm working. What do you have to say that's so urgent?").also { stage++ } + 1 -> options("What can you tell me about Al Kharid?", "So, what do you do here?", "I hear you work for Ali Morrisane...", "I hear you've been threatening the other shopkeepers.").also { stage++ } 2 -> when(buttonId){ - 1 -> player(core.game.dialogue.FacialExpression.ASKING, "What can you tell me about Al Kharid?").also { stage = 10 } - 2 -> player(core.game.dialogue.FacialExpression.ASKING, "So, what do you do here?").also { stage = 20 } - 3 -> player(core.game.dialogue.FacialExpression.ASKING, "I hear you work for Ali Morrisane...").also { stage = 30 } - 4 -> player(core.game.dialogue.FacialExpression.ASKING, "I hear you've been threatening the other shopkeepers.").also { stage = 40 } + 1 -> playerl(FacialExpression.ASKING, "What can you tell me about Al Kharid?").also { stage = 10 } + 2 -> playerl(FacialExpression.ASKING, "So, what do you do here?").also { stage = 20 } + 3 -> playerl(FacialExpression.ASKING, "I hear you work for Ali Morrisane...").also { stage = 30 } + 4 -> playerl(FacialExpression.ASKING, "I hear you've been threatening the other shopkeepers.").also { stage = 40 } + } + 10 -> npcl(FacialExpression.FRIENDLY,"There's a lot of space here. More open space than back home.").also { stage++ } + 11 -> playerl(FacialExpression.ASKING,"So where is back home?").also { stage++ } + 12 -> npcl(FacialExpression.FRIENDLY,"Pollnivneach. It's a town to the south of the Shantay Pass.").also { stage = 1 } + 20 -> npcl(FacialExpression.ANNOYED,"I'm on guard duty. Making sure nobody tries to steal anything from the house and tents in the middle of town.").also { stage++ } + 21 -> playerl(FacialExpression.ASKING,"Why are you only guarding those buildings?").also { stage++ } + 22 -> npcl(FacialExpression.SUSPICIOUS,"That's all I've been hired to guard.").also { stage = 1 } + 30 -> npcl(FacialExpression.FRIENDLY,"Yeah, he hired me. He owns this house and these two tents, too.").also { stage++ } + 31 -> playerl(FacialExpression.HALF_ASKING,"Is the work good?").also { stage++ } + 32 -> npcl(FacialExpression.FRIENDLY,"It pays better than back home.").also { stage++ } + 33 -> playerl(FacialExpression.ASKING,"Why, what did you do back home?").also { stage++ } + 34 -> npcl(FacialExpression.SUSPICIOUS,"Never you mind.").also { stage++ } + 35 -> npcl(FacialExpression.FRIENDLY,"But Ali Morrisane pays us well, at least.").also { stage++ } + 36 -> playerl(FacialExpression.ASKING,"Maybe I should talk to him...").also { stage++ } + 37 -> npcl(FacialExpression.FRIENDLY,"Why not? He always likes to meet potential business partners.").also { stage = 1 } + 40 -> npcl(FacialExpression.ANNOYED,"So? They talk too much.").also { stage++ } + 41 -> playerl(FacialExpression.HALF_ASKING,"You're not going to deny it?").also { stage++ } + 42 -> npcl(FacialExpression.LOUDLY_LAUGHING,"Why bother? None of them can fight back, after all.").also { stage = 99 } + 99 -> { + end() } - - 10 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"There's a lot of space here. More open space than back home.").also { stage++ } - 11 -> player(core.game.dialogue.FacialExpression.ASKING,"So where is back home?").also { stage++ } - 12 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Pollnivneach. It's a town to the south of the", "Shantay Pass.").also { stage = 1 } - - 20 -> npc( - core.game.dialogue.FacialExpression.ANNOYED,"I'm on guard duty.", "Making sure nobody tries to steal anything from", - "the house and tents in the middle of town.").also { stage++ } - 21 -> player(core.game.dialogue.FacialExpression.ASKING,"Why are you only guarding those buildings?").also { stage++ } - 22 -> npc(core.game.dialogue.FacialExpression.SUSPICIOUS,"That's all I've been hired to guard.").also { stage = 1 } - - 30 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Yeah, he hired me.", "He owns this house and these two tents, too.").also { stage++ } - 31 -> player(core.game.dialogue.FacialExpression.HALF_ASKING,"Is the work good?").also { stage++ } - 32 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"It pays better than back home.").also { stage++ } - 33 -> player(core.game.dialogue.FacialExpression.ASKING,"Why, what did you do back home?").also { stage++ } - 34 -> npc(core.game.dialogue.FacialExpression.SUSPICIOUS,"Never you mind.").also { stage++ } - 35 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"But Ali Morrisane pays us well, at least.").also { stage++ } - 36 -> player(core.game.dialogue.FacialExpression.ASKING,"Maybe I should talk to him...").also { stage++ } - 37 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Why not?", "He always likes to meet potential business partners.").also { stage = 1 } - - 40 -> npc(core.game.dialogue.FacialExpression.ANNOYED,"So? They talk too much.").also { stage++ } - 41 -> player(core.game.dialogue.FacialExpression.HALF_ASKING,"You're not going to deny it?").also { stage++ } - 42 -> npc(core.game.dialogue.FacialExpression.LOUDLY_LAUGHING,"Why bother?", "None of them can fight back, after all.").also { stage = 99 } - - 99 -> end() } return true } - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { - return AliTheGuard(player) - } - override fun getIds(): IntArray { - return intArrayOf(2823) + return intArrayOf(NPCs.ALI_THE_GUARD_2823) } } \ No newline at end of file diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheLeafletDropperDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheLeafletDropperDialogue.kt index 5e1305d4a..3ff317b3c 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheLeafletDropperDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheLeafletDropperDialogue.kt @@ -6,9 +6,9 @@ import core.game.dialogue.FacialExpression import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.plugin.Initializable +import core.tools.END_DIALOGUE import org.rs09.consts.Items import org.rs09.consts.NPCs -import core.tools.END_DIALOGUE /** * @author bushtail @@ -16,63 +16,51 @@ import core.tools.END_DIALOGUE */ @Initializable -class AliTheLeafletDropperDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) { - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { +class AliTheLeafletDropperDialogue(player: Player? = null) : DialoguePlugin(player) { + + override fun newInstance(player: Player?): DialoguePlugin { return AliTheLeafletDropperDialogue(player) } override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - npcl(core.game.dialogue.FacialExpression.CHILD_NORMAL, "I don't have the time to talk right now! Ali Morrisane is paying me to hand out these flyers.") + npcl(FacialExpression.CHILD_NORMAL, "I don't have the time to talk right now! Ali Morrisane is paying me to hand out these flyers.") stage = 100 return true } override fun handle(interfaceId: Int, buttonId: Int): Boolean { when(stage) { - 100 -> options( - "Who is Ali Morissane?", - "What are the flyers for?", - "What is there to do round here, boy?" - ).also { stage++ } + 100 -> options("Who is Ali Morissane?", "What are the flyers for?", "What is there to do round here, boy?").also { stage++ } 101 -> when(buttonId) { - 1 -> { - player(core.game.dialogue.FacialExpression.ASKING, "Who is Ali Morissane?").also{ stage = 201 } - } - 2 -> { - player(core.game.dialogue.FacialExpression.ASKING, "What are the flyers for?").also { stage = 301 } - } - 3 -> { - player(core.game.dialogue.FacialExpression.ASKING, "What is there to do round here, boy?").also { stage = 401 } - } + 1 -> playerl(FacialExpression.ASKING, "Who is Ali Morissane?").also{ stage = 201 } + 2 -> playerl(FacialExpression.ASKING, "What are the flyers for?").also { stage = 301 } + 3 -> playerl(FacialExpression.ASKING, "What is there to do round here, boy?").also { stage = 401 } } - - 201 -> npcl(core.game.dialogue.FacialExpression.CHILD_FRIENDLY, "Ali Morrisane is the greatest merchant in the east!").also { stage++ } - 202 -> player(core.game.dialogue.FacialExpression.HALF_ASKING, "Were you paid to say that?").also { stage++ } - 203 -> npcl(core.game.dialogue.FacialExpression.CHILD_LOUDLY_LAUGHING, "Of course I was! You can find him on the north edge of town.").also { stage = END_DIALOGUE } - - 301 -> npcl(core.game.dialogue.FacialExpression.CHILD_THINKING, "Well, Ali Morrisane isn't too popular with the other traders in Al Kharid, mainly because he's from Pollnivneach and they feel he has no business trading in their town.").also { stage++ } - 302 -> npcl(core.game.dialogue.FacialExpression.CHILD_FRIENDLY, "I think they're just sour because he's better at making money than them.").also { stage++ } - 303 -> npcl(core.game.dialogue.FacialExpression.CHILD_FRIENDLY, "The flyer advertises the different shops you can find in Al Kharid.").also { stage++ } - 304 -> npcl(core.game.dialogue.FacialExpression.CHILD_THINKING, "It also entitles you to money off your next purchase in any of the shops listed on it. It's Ali's way of getting on the good side of the traders.").also { stage++ } - 305 -> player(core.game.dialogue.FacialExpression.ASKING, "Which shops?").also { + 201 -> npcl(FacialExpression.CHILD_FRIENDLY, "Ali Morrisane is the greatest merchant in the east!").also { stage++ } + 202 -> playerl(FacialExpression.HALF_ASKING, "Were you paid to say that?").also { stage++ } + 203 -> npcl(FacialExpression.CHILD_LOUDLY_LAUGHING, "Of course I was! You can find him on the north edge of town.").also { stage = END_DIALOGUE } + 301 -> npcl(FacialExpression.CHILD_THINKING, "Well, Ali Morrisane isn't too popular with the other traders in Al Kharid, mainly because he's from Pollnivneach and they feel he has no business trading in their town.").also { stage++ } + 302 -> npcl(FacialExpression.CHILD_FRIENDLY, "I think they're just sour because he's better at making money than them.").also { stage++ } + 303 -> npcl(FacialExpression.CHILD_FRIENDLY, "The flyer advertises the different shops you can find in Al Kharid.").also { stage++ } + 304 -> npcl(FacialExpression.CHILD_THINKING, "It also entitles you to money off your next purchase in any of the shops listed on it. It's Ali's way of getting on the good side of the traders.").also { stage++ } + 305 -> playerl(FacialExpression.ASKING, "Which shops?").also { if(player.inventory.containItems(Items.AL_KHARID_FLYER_7922)) { - npcl(core.game.dialogue.FacialExpression.CHILD_SUSPICIOUS, "Are you trying to be funny or has age turned your brain to mush? Look at the flyer you already have!").also { stage = END_DIALOGUE } + npcl(FacialExpression.CHILD_SUSPICIOUS, "Are you trying to be funny or has age turned your brain to mush? Look at the flyer you already have!").also { stage = END_DIALOGUE } } else { if(addItem(player, Items.AL_KHARID_FLYER_7922)) { - npcl(core.game.dialogue.FacialExpression.CHILD_FRIENDLY, "Here! Take one and let me get back to work.").also { stage = END_DIALOGUE } + npcl(FacialExpression.CHILD_FRIENDLY, "Here! Take one and let me get back to work.").also { stage = END_DIALOGUE } } else { end() } } } - - 401 -> npcl(core.game.dialogue.FacialExpression.CHILD_NORMAL, "I'm very busy, so listen carefully! I shall say this only once.").also { stage++ } - 402 -> npcl(core.game.dialogue.FacialExpression.CHILD_THINKING, "Apart from a busy and wonderous market place in Al Kharid to the south, there is the Duel Arena to the south-east where you can challenge other players to a fight.").also { stage++ } - 403 -> npcl(core.game.dialogue.FacialExpression.CHILD_NORMAL, "If you're here to make money, there is a mine to the south.").also { stage++ } - 404 -> npcl(core.game.dialogue.FacialExpression.CHILD_SUSPICIOUS, "Watch out for scorpions though, they'll take a pop at you if you go too near them. To avoid them just follow the western fence as you travel south.").also { stage++ } - 405 -> npcl(core.game.dialogue.FacialExpression.CHILD_FRIENDLY, "If you're in the mood for a little rest and relaxation, there are a couple of nice fishing spots south of the town.").also { stage++ } - 406 -> player(core.game.dialogue.FacialExpression.FRIENDLY, "Thanks for the help!").also { stage = END_DIALOGUE } + 401 -> npcl(FacialExpression.CHILD_NORMAL, "I'm very busy, so listen carefully! I shall say this only once.").also { stage++ } + 402 -> npcl(FacialExpression.CHILD_THINKING, "Apart from a busy and wonderous market place in Al Kharid to the south, there is the Duel Arena to the south-east where you can challenge other players to a fight.").also { stage++ } + 403 -> npcl(FacialExpression.CHILD_NORMAL, "If you're here to make money, there is a mine to the south.").also { stage++ } + 404 -> npcl(FacialExpression.CHILD_SUSPICIOUS, "Watch out for scorpions though, they'll take a pop at you if you go too near them. To avoid them just follow the western fence as you travel south.").also { stage++ } + 405 -> npcl(FacialExpression.CHILD_FRIENDLY, "If you're in the mood for a little rest and relaxation, there are a couple of nice fishing spots south of the town.").also { stage++ } + 406 -> playerl(FacialExpression.FRIENDLY, "Thanks for the help!").also { stage = END_DIALOGUE } } return true } diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheLeafletDropperListener.kt b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheLeafletDropperListener.kt index 423f7e012..0f662d917 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheLeafletDropperListener.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheLeafletDropperListener.kt @@ -2,13 +2,14 @@ package content.region.desert.alkharid.dialogue import core.api.addItem import core.api.openDialogue +import core.game.dialogue.DialogueFile +import core.game.dialogue.FacialExpression +import core.game.interaction.IntType +import core.game.interaction.InteractionListener import core.game.node.entity.npc.NPC +import core.tools.END_DIALOGUE import org.rs09.consts.Items import org.rs09.consts.NPCs -import core.game.dialogue.DialogueFile -import core.game.interaction.InteractionListener -import core.game.interaction.IntType -import core.tools.END_DIALOGUE /** * @author bushtail @@ -29,16 +30,17 @@ class AliTheLeafletDropperListener : InteractionListener { return@on true } } + } class DropperDialogue(val it : Int) : DialogueFile() { override fun handle(componentID: Int, buttonID: Int) { when(it) { 1 -> when(stage) { - 0 -> npcl(core.game.dialogue.FacialExpression.CHILD_NORMAL, "Here! Take one and let me get back to work.").also { stage++ } - 1 -> npcl(core.game.dialogue.FacialExpression.CHILD_THINKING, "I still have hundreds of these flyers to hand out. I wonder if Ali would notice if I quietly dumped them somewhere?").also { stage = END_DIALOGUE } + 0 -> npcl(FacialExpression.CHILD_NORMAL, "Here! Take one and let me get back to work.").also { stage++ } + 1 -> npcl(FacialExpression.CHILD_THINKING, "I still have hundreds of these flyers to hand out. I wonder if Ali would notice if I quietly dumped them somewhere?").also { stage = END_DIALOGUE } } - 2 -> npcl(core.game.dialogue.FacialExpression.CHILD_SUSPICIOUS, "Are you trying to be funny or has age turned your brain to mush? You already have a flyer!").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.CHILD_SUSPICIOUS, "Are you trying to be funny or has age turned your brain to mush? You already have a flyer!").also { stage = END_DIALOGUE } } } diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheSmithDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheSmithDialogue.kt index 153e3d817..ff79c3deb 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/AliTheSmithDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/AliTheSmithDialogue.kt @@ -5,64 +5,63 @@ import core.game.dialogue.FacialExpression import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.plugin.Initializable +import org.rs09.consts.NPCs /** * @author qmqz */ @Initializable -class AliTheSmithDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player){ +class AliTheSmithDialogue(player: Player? = null) : DialoguePlugin(player){ + + override fun newInstance(player: Player?): DialoguePlugin { + return AliTheSmithDialogue(player) + } override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - player(core.game.dialogue.FacialExpression.FRIENDLY,"Hello there!") - stage = 0 + playerl(FacialExpression.FRIENDLY,"Hello there!") return true } override fun handle(interfaceId: Int, buttonId: Int): Boolean { when(stage){ - 0 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"You seem rather cheerful. Is there anything you're after?").also { stage++ } - 1 -> options ("What can you tell me about Al Kharid?", "So, what do you do here?", - "I hear you work for Ali Morrisane...", "I hear you've been threatening the other shopkeepers.").also { stage++ } + 0 -> npcl(FacialExpression.FRIENDLY,"You seem rather cheerful. Is there anything you're after?").also { stage++ } + 1 -> options("What can you tell me about Al Kharid?", "So, what do you do here?", "I hear you work for Ali Morrisane...", "I hear you've been threatening the other shopkeepers.").also { stage++ } 2 -> when(buttonId){ - 1 -> player(core.game.dialogue.FacialExpression.ASKING, "What can you tell me about Al Kharid?").also { stage = 10 } - 2 -> player(core.game.dialogue.FacialExpression.ASKING, "So, what do you do here?").also { stage = 20 } - 3 -> player(core.game.dialogue.FacialExpression.ASKING, "I hear you work for Ali Morrisane...").also { stage = 30 } - 4 -> player(core.game.dialogue.FacialExpression.HALF_ASKING, "I hear you've been threatening the other shopkeepers.").also { stage = 40 } + 1 -> playerl(FacialExpression.ASKING, "What can you tell me about Al Kharid?").also { stage = 10 } + 2 -> playerl(FacialExpression.ASKING, "So, what do you do here?").also { stage = 20 } + 3 -> playerl(FacialExpression.ASKING, "I hear you work for Ali Morrisane...").also { stage = 30 } + 4 -> playerl(FacialExpression.HALF_ASKING, "I hear you've been threatening the other shopkeepers.").also { stage = 40 } } - 10 ->npc(core.game.dialogue.FacialExpression.FRIENDLY,"Well, it's hot and full of sand.").also { stage++ } - 11 ->player(core.game.dialogue.FacialExpression.ASKING,"Anything else?").also { stage++ } - 12 ->npc(core.game.dialogue.FacialExpression.FRIENDLY,"Don't ask me, I'm not from around here.").also { stage++ } - 13 ->player(core.game.dialogue.FacialExpression.HALF_ASKING,"So where are you from?").also { stage++ } - 14 ->npc(core.game.dialogue.FacialExpression.HALF_GUILTY,"A town to the south of the Shantay Pass,","called Pollnivneach.").also { stage = 1 } + 10 ->npcl(FacialExpression.FRIENDLY,"Well, it's hot and full of sand.").also { stage++ } + 11 ->playerl(FacialExpression.ASKING,"Anything else?").also { stage++ } + 12 ->npcl(FacialExpression.FRIENDLY,"Don't ask me, I'm not from around here.").also { stage++ } + 13 ->playerl(FacialExpression.HALF_ASKING,"So where are you from?").also { stage++ } + 14 ->npcl(FacialExpression.HALF_GUILTY,"A town to the south of the Shantay Pass, called Pollnivneach.").also { stage = 1 } - 20 ->npc(core.game.dialogue.FacialExpression.SAD,"Not very much, at the moment.", "I came from further south to set up a smithy here...").also { stage++ } - 21 ->npc(core.game.dialogue.FacialExpression.SAD,"...but we still haven't set up the shops,", "so we have no customers yet.").also { stage = 1 } + 20 ->npcl(FacialExpression.SAD,"Not very much, at the moment. I came from further south to set up a smithy here...").also { stage++ } + 21 ->npcl(FacialExpression.SAD,"...but we still haven't set up the shops, so we have no customers yet.").also { stage = 1 } - 30 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Yes, he's the one who persuaded us to come here.").also { stage++ } - 31 -> npc( - core.game.dialogue.FacialExpression.HALF_GUILTY,"He said we'd have lots of customers once we set up", - "our shops, and all he asks for is a cut"," of the profits.").also { stage++ } - 32 -> player(core.game.dialogue.FacialExpression.ASKING,"Maybe I should talk to him...").also { stage++ } - 33 -> npc(core.game.dialogue.FacialExpression.FRIENDLY,"Of course.", "He's always happy to talk to possible business partners.").also { stage = 1 } + 30 -> npcl(FacialExpression.FRIENDLY,"Yes, he's the one who persuaded us to come here.").also { stage++ } + 31 -> npcl(FacialExpression.HALF_GUILTY,"He said we'd have lots of customers once we set up our shops, and all he asks for is a cut of the profits.").also { stage++ } + 32 -> playerl(FacialExpression.ASKING,"Maybe I should talk to him...").also { stage++ } + 33 -> npcl(FacialExpression.FRIENDLY,"Of course. He's always happy to talk to possible business partners.").also { stage = 1 } - 40 -> npc(core.game.dialogue.FacialExpression.SUSPICIOUS,"What? Who's spreading that rumour?").also { stage++ } - 41 -> player(core.game.dialogue.FacialExpression.THINKING,"Well, one of the shopkeepers told me a man with", "a large hammer came to threaten them.").also { stage++ } - 42 -> npc(core.game.dialogue.FacialExpression.SUSPICIOUS,"Don't pay any attention to those people.").also { stage++ } - 43 -> npc(core.game.dialogue.FacialExpression.LAUGH,"They're just worried that they'll lose money", "when we open our shops.").also { stage = 99 } + 40 -> npcl(FacialExpression.SUSPICIOUS,"What? Who's spreading that rumour?").also { stage++ } + 41 -> playerl(FacialExpression.THINKING,"Well, one of the shopkeepers told me a man with a large hammer came to threaten them.").also { stage++ } + 42 -> npcl(FacialExpression.SUSPICIOUS,"Don't pay any attention to those people.").also { stage++ } + 43 -> npcl(FacialExpression.LAUGH,"They're just worried that they'll lose money when we open our shops.").also { stage = 99 } + 99 -> { + end() + } - 99 -> end() } return true } - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { - return AliTheSmithDialogue(player) - } - override fun getIds(): IntArray { - return intArrayOf(2820) + return intArrayOf(NPCs.ALI_THE_SMITH_2820) } } \ No newline at end of file diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/DommikDialogue.java b/Server/src/main/content/region/desert/alkharid/dialogue/DommikDialogue.java deleted file mode 100644 index c13d2ab11..000000000 --- a/Server/src/main/content/region/desert/alkharid/dialogue/DommikDialogue.java +++ /dev/null @@ -1,72 +0,0 @@ -package content.region.desert.alkharid.dialogue; - -import core.game.dialogue.DialoguePlugin; -import core.game.dialogue.FacialExpression; -import core.game.node.entity.npc.NPC; -import core.plugin.Initializable; -import core.game.node.entity.player.Player; - -/** - * Handles the DommikDialogue dialogue. - * @author 'Vexia - */ -@Initializable -public class DommikDialogue extends DialoguePlugin { - - public DommikDialogue() { - - } - - public DommikDialogue(Player player) { - super(player); - } - - @Override - public int[] getIds() { - return new int[] { 545 }; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendOptions("Select an Option", "No, thanks, I've got all the Crafting equipment I need.", "Let's see what you've got, then."); - stage = 1; - break; - case 1: - switch (buttonId) { - case 1: - interpreter.sendDialogues(player, FacialExpression.FRIENDLY, "No, thanks, I've got all the Crafting equipment I need."); - stage = 10; - break; - case 2: - end(); - npc.openShop(player); - break; - } - break; - case 10: - interpreter.sendDialogues(npc, FacialExpression.FRIENDLY, "Okay. Fare well on your travels."); - stage = 11; - break; - case 11: - end(); - break; - } - return true; - } - - @Override - public DialoguePlugin newInstance(Player player) { - - return new DommikDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(npc, FacialExpression.HAPPY, "Would you like to buy some Crafting equipment?"); - stage = 0; - return true; - } -} diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/DommikDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/DommikDialogue.kt new file mode 100644 index 000000000..75d9cd46c --- /dev/null +++ b/Server/src/main/content/region/desert/alkharid/dialogue/DommikDialogue.kt @@ -0,0 +1,47 @@ +package content.region.desert.alkharid.dialogue + +import core.api.sendDialogueOptions +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.plugin.Initializable +import org.rs09.consts.NPCs + +/** + * Handles the DommikDialogue dialogue. + * @author 'Vexia + */ +@Initializable +class DommikDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun newInstance(player: Player?): DialoguePlugin { + return DommikDialogue(player) + } + + override fun open(vararg args: Any): Boolean { + npc = args[0] as NPC + npcl(FacialExpression.HAPPY, "Would you like to buy some Crafting equipment?") + stage = 0 + return true + } + + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + 0 -> options("No, thanks, I've got all the Crafting equipment I need.", "Let's see what you've got, then.").also { stage = 1 } + 1 -> when (buttonId) { + 1 -> playerl(FacialExpression.FRIENDLY, "No, thanks, I've got all the Crafting equipment I need.").also { stage = 2 } + 2 -> { + end() + npc.openShop(player) + } + } + 2 -> npcl(FacialExpression.FRIENDLY, "Okay. Fare well on your travels.").also { stage = 3 } + 3 -> end() + } + return true + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.DOMMIK_545) + } +} diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/FadliDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/FadliDialogue.kt index 40c3d6967..c82704891 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/FadliDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/FadliDialogue.kt @@ -1,54 +1,56 @@ package content.region.desert.alkharid.dialogue +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +import core.game.dialogue.Topic +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.plugin.Initializable -import org.rs09.consts.NPCs -import core.game.dialogue.Topic -import core.game.interaction.InteractionListener -import core.game.interaction.IntType import core.tools.END_DIALOGUE +import org.rs09.consts.NPCs /** * @author bushtail */ @Initializable -class FadliDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) { - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { +class FadliDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun newInstance(player: Player?): DialoguePlugin { return FadliDialogue(player) } override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - player(core.game.dialogue.FacialExpression.FRIENDLY, "Hi!").also { stage = 0 } + player(FacialExpression.FRIENDLY, "Hi!").also { stage = 0 } return true } override fun handle(interfaceId: Int, buttonId: Int): Boolean { when(stage) { - 0 -> npcl(core.game.dialogue.FacialExpression.HALF_ASKING, "What?").also { stage++ } + 0 -> npcl(FacialExpression.HALF_ASKING, "What?").also { stage++ } 1 -> showTopics( Topic("What do you do?", 101), Topic("What is this place?", 201), - Topic(core.game.dialogue.FacialExpression.FRIENDLY,"I'd like to store some items, please.", 301), + Topic(FacialExpression.FRIENDLY,"I'd like to store some items, please.", 301), Topic("Do you watch any matches?", 401) ) - 101 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "You can store your stuff here if you want. You can dump anything you don't want to carry whilst your fighting duels and then pick it up again on the way out.").also { stage++ } - 102 -> npcl(core.game.dialogue.FacialExpression.SAD, "To be honest I'm wasted here.").also { stage++ } - 103 -> npcl(core.game.dialogue.FacialExpression.EVIL_LAUGH, "I should be winning duels in an arena! I'm the best warrior in Al Kharid!").also { stage++ } - 104 -> player(core.game.dialogue.FacialExpression.HALF_WORRIED, "Easy, tiger!").also { stage = END_DIALOGUE } + 101 -> npcl(FacialExpression.FRIENDLY, "You can store your stuff here if you want. You can dump anything you don't want to carry whilst your fighting duels and then pick it up again on the way out.").also { stage++ } + 102 -> npcl(FacialExpression.SAD, "To be honest I'm wasted here.").also { stage++ } + 103 -> npcl(FacialExpression.EVIL_LAUGH, "I should be winning duels in an arena! I'm the best warrior in Al Kharid!").also { stage++ } + 104 -> player(FacialExpression.HALF_WORRIED, "Easy, tiger!").also { stage = END_DIALOGUE } - 201 -> npcl(core.game.dialogue.FacialExpression.LAUGH, "Isn't it obvious?").also { stage++ } - 202 -> npcl(core.game.dialogue.FacialExpression.ANNOYED, "This is the Duel Arena...duh!").also { stage = END_DIALOGUE } + 201 -> npcl(FacialExpression.LAUGH, "Isn't it obvious?").also { stage++ } + 202 -> npcl(FacialExpression.ANNOYED, "This is the Duel Arena...duh!").also { stage = END_DIALOGUE } - 301 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "Sure.").also { + 301 -> npcl(FacialExpression.FRIENDLY, "Sure.").also { end() player.bank.open() } - 401 -> npcl(core.game.dialogue.FacialExpression.LAUGH, "Most aren't any good so I throw rotten fruit at them!").also { stage = END_DIALOGUE } + 401 -> npcl(FacialExpression.LAUGH, "Most aren't any good so I throw rotten fruit at them!").also { stage = END_DIALOGUE } } return true } diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/GemTraderDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/GemTraderDialogue.kt index 3e489d020..583113bb5 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/GemTraderDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/GemTraderDialogue.kt @@ -1,9 +1,11 @@ package content.region.desert.alkharid.dialogue -import core.game.dialogue.DialoguePlugin +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.plugin.Initializable +import org.rs09.consts.NPCs /** * Represents the gem trader Dialogue plugin @@ -12,8 +14,8 @@ import core.plugin.Initializable */ @Initializable -class GemTraderDialogue (player: Player? = null): core.game.dialogue.DialoguePlugin(player){ - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { +class GemTraderDialogue (player: Player? = null): DialoguePlugin(player){ + override fun newInstance(player: Player?): DialoguePlugin { return GemTraderDialogue(player) } @@ -45,7 +47,7 @@ class GemTraderDialogue (player: Player? = null): core.game.dialogue.DialoguePlu 10 -> when(buttonId){ 1 -> npc.openShop(player).also { stage = 1000 }; - 2 -> player("No Thank you").also{stage = 1000} + 2 -> player("No, thank you.").also{stage = 1000} 3 -> npc("Fitzharmon, eh? Hmmm... If I'm not mistaken, ", "that's the family name of a member ", "of the Varrockian nobility.").also{stage = 100} @@ -53,7 +55,7 @@ class GemTraderDialogue (player: Player? = null): core.game.dialogue.DialoguePlu 20 -> when(buttonId){ 1 -> npc.openShop(player).also { stage = 1000 }; - 2 -> player("No Thank you").also{stage = 1000} + 2 -> player("No, thank you.").also{stage = 1000} } 100 -> npc("You know, I HAVE seen someone of that" , @@ -81,7 +83,7 @@ class GemTraderDialogue (player: Player? = null): core.game.dialogue.DialoguePlu } override fun getIds(): IntArray { - return intArrayOf(540) + return intArrayOf(NPCs.GEM_TRADER_540) } diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/JaraahDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/JaraahDialogue.kt index a074e972d..fd165eabb 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/JaraahDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/JaraahDialogue.kt @@ -2,36 +2,36 @@ package content.region.desert.alkharid.dialogue import core.api.animate import core.api.getStatLevel -import core.game.dialogue.DialoguePlugin -import core.game.dialogue.FacialExpression +import core.game.dialogue.DialoguePlugin; +import core.game.dialogue.FacialExpression; +import core.game.dialogue.Topic import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.game.node.entity.skill.Skills import core.plugin.Initializable +import core.tools.END_DIALOGUE import org.rs09.consts.Animations import org.rs09.consts.NPCs -import core.game.dialogue.Topic -import core.tools.END_DIALOGUE /** * @author bushtail */ @Initializable -class JaraahDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) { - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { +class JaraahDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun newInstance(player: Player?): DialoguePlugin { return JaraahDialogue(player) } override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - player(core.game.dialogue.FacialExpression.FRIENDLY, "Hi!").also { stage = 0 } + player(FacialExpression.FRIENDLY, "Hi!").also { stage = 0 } return true } override fun handle(interfaceId: Int, buttonId: Int): Boolean { when(stage) { - 0 -> npcl(core.game.dialogue.FacialExpression.ANNOYED, "What? Can't you see I'm busy?!").also { stage++ } + 0 -> npcl(FacialExpression.ANNOYED, "What? Can't you see I'm busy?!").also { stage++ } 1 -> showTopics( Topic("Can you heal me?", 101), Topic("You must see some gruesome things?", 201), @@ -43,19 +43,19 @@ class JaraahDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin animate(npc!!, Animations.HUMAN_PICKPOCKETING_881) if(player!!.skills.lifepoints < getStatLevel(player!!, Skills.HITPOINTS)) { player!!.skills.heal(21) - npcl(core.game.dialogue.FacialExpression.FRIENDLY, "There you go!") + npcl(FacialExpression.FRIENDLY, "There you go!") } else { - npcl(core.game.dialogue.FacialExpression.FRIENDLY, "Okay, this will hurt you more than it will me.") + npcl(FacialExpression.FRIENDLY, "Okay, this will hurt you more than it will me.") } stage = END_DIALOGUE } - 201 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "It's a gruesome business and with the tools they give me it gets mroe gruesome before it gets better!").also { stage = END_DIALOGUE } + 201 -> npcl(FacialExpression.FRIENDLY, "It's a gruesome business and with the tools they give me it gets mroe gruesome before it gets better!").also { stage = END_DIALOGUE } - 301 -> npcl(core.game.dialogue.FacialExpression.HALF_THINKING, "'The Butcher'?").also { stage++ } - 302 -> npcl(core.game.dialogue.FacialExpression.LAUGH, "Ha!").also { stage++ } - 303 -> npcl(core.game.dialogue.FacialExpression.HALF_ASKING, "Would you like me to demonstrate?").also { stage++ } - 304 -> player(core.game.dialogue.FacialExpression.AFRAID, "Er...I'll give it a miss, thanks.").also { stage = END_DIALOGUE } + 301 -> npcl(FacialExpression.HALF_THINKING, "'The Butcher'?").also { stage++ } + 302 -> npcl(FacialExpression.LAUGH, "Ha!").also { stage++ } + 303 -> npcl(FacialExpression.HALF_ASKING, "Would you like me to demonstrate?").also { stage++ } + 304 -> player(FacialExpression.AFRAID, "Er...I'll give it a miss, thanks.").also { stage = END_DIALOGUE } } return true } diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/SabreenDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/SabreenDialogue.kt index e3c20d5e6..7bfeb1651 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/SabreenDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/SabreenDialogue.kt @@ -2,26 +2,26 @@ package content.region.desert.alkharid.dialogue import core.game.dialogue.DialoguePlugin import core.game.dialogue.FacialExpression +import core.game.dialogue.Topic import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.plugin.Initializable -import org.rs09.consts.NPCs -import core.game.dialogue.Topic import core.tools.END_DIALOGUE +import org.rs09.consts.NPCs /** * @author bushtail */ @Initializable -class SabreenDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) { - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { +class SabreenDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun newInstance(player: Player?): DialoguePlugin { return SabreenDialogue(player) } override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - player(core.game.dialogue.FacialExpression.FRIENDLY, "Hi!").also { stage = 0 } + player(FacialExpression.FRIENDLY, "Hi!").also { stage = 0 } return true } @@ -33,11 +33,11 @@ class SabreenDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugi Topic("Do you come here often?", 201) ) - 101 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "I work here, so yes!").also { stage = END_DIALOGUE } + 101 -> npcl(FacialExpression.FRIENDLY, "I work here, so yes!").also { stage = END_DIALOGUE } - 201 -> npcl(core.game.dialogue.FacialExpression.HALF_THINKING, "Yes I do. Thankfully we can cope with almost anything. Jaraah really is a wonderful surgeon, his methods are a little unorthodox but he gets the job done.").also { stage++ } - 202 -> npcl(core.game.dialogue.FacialExpression.HALF_GUILTY, "I shouldn't tell you this but his nickname is 'The Butcher'.").also { stage++ } - 203 -> player(core.game.dialogue.FacialExpression.HALF_WORRIED, "That's reassuring.").also { stage = END_DIALOGUE } + 201 -> npcl(FacialExpression.HALF_THINKING, "Yes I do. Thankfully we can cope with almost anything. Jaraah really is a wonderful surgeon, his methods are a little unorthodox but he gets the job done.").also { stage++ } + 202 -> npcl(FacialExpression.HALF_GUILTY, "I shouldn't tell you this but his nickname is 'The Butcher'.").also { stage++ } + 203 -> playerl(FacialExpression.HALF_WORRIED, "That's reassuring.").also { stage = END_DIALOGUE } } return true } diff --git a/Server/src/main/content/region/desert/alkharid/dialogue/SurgeonGeneralTafaniDialogue.kt b/Server/src/main/content/region/desert/alkharid/dialogue/SurgeonGeneralTafaniDialogue.kt index f23720b63..eb6428519 100644 --- a/Server/src/main/content/region/desert/alkharid/dialogue/SurgeonGeneralTafaniDialogue.kt +++ b/Server/src/main/content/region/desert/alkharid/dialogue/SurgeonGeneralTafaniDialogue.kt @@ -1,7 +1,7 @@ package content.region.desert.alkharid.dialogue +import core.api.hasLevelStat import core.game.dialogue.DialoguePlugin -import core.api.* import core.game.dialogue.FacialExpression import core.game.dialogue.IfTopic import core.game.dialogue.Topic @@ -10,22 +10,22 @@ import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.game.node.entity.skill.Skills import core.plugin.Initializable -import org.rs09.consts.NPCs import core.tools.END_DIALOGUE +import org.rs09.consts.NPCs /** * @author bushtail */ @Initializable -class SurgeonGeneralTafaniDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) { - override fun newInstance(player: Player?): core.game.dialogue.DialoguePlugin { +class SurgeonGeneralTafaniDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun newInstance(player: Player?): DialoguePlugin { return SurgeonGeneralTafaniDialogue(player) } override fun open(vararg args: Any?): Boolean { npc = args[0] as NPC - npcl(core.game.dialogue.FacialExpression.FRIENDLY, "Hi. How can I help?").also { stage = 100 } + npcl(FacialExpression.FRIENDLY, "Hi. How can I help?").also { stage = 100 } return true } @@ -39,26 +39,26 @@ class SurgeonGeneralTafaniDialogue(player: Player? = null) : core.game.dialogue. IfTopic("Where can I get a cape like yours?", 501, !hasLevelStat(player, Skills.HITPOINTS, 99)) ) - 201 -> npcl(core.game.dialogue.FacialExpression.HALF_THINKING, "Yes I do. Thankfully we can cope with almost anything. Jaraah really is a wonderful surgeon, his methods are a little unorthodox but he gets the job done.").also { stage++ } - 202 -> npcl(core.game.dialogue.FacialExpression.HALF_GUILTY, "I shouldn't tell you this but his nickname is 'The Butcher'.").also { stage++ } - 203 -> player(core.game.dialogue.FacialExpression.HALF_WORRIED, "That's reassuring.").also { stage = END_DIALOGUE } + 201 -> npcl(FacialExpression.HALF_THINKING, "Yes I do. Thankfully we can cope with almost anything. Jaraah really is a wonderful surgeon, his methods are a little unorthodox but he gets the job done.").also { stage++ } + 202 -> npcl(FacialExpression.HALF_GUILTY, "I shouldn't tell you this but his nickname is 'The Butcher'.").also { stage++ } + 203 -> playerl(FacialExpression.HALF_WORRIED, "That's reassuring.").also { stage = END_DIALOGUE } - 301 -> npcl(core.game.dialogue.FacialExpression.LAUGH, "I work here, so yes!").also { stage = END_DIALOGUE } + 301 -> npcl(FacialExpression.LAUGH, "I work here, so yes!").also { stage = END_DIALOGUE } - 401 -> npcl(core.game.dialogue.FacialExpression.FRIENDLY, "Why, certainly my friend. However, owning such an item makes you part of an elite group and that privilege will cost you 99000 coins.").also { stage++ } + 401 -> npcl(FacialExpression.FRIENDLY, "Why, certainly my friend. However, owning such an item makes you part of an elite group and that privilege will cost you 99000 coins.").also { stage++ } 402 -> showTopics( - Topic(core.game.dialogue.FacialExpression.HALF_GUILTY, "Sorry, that's much too pricey.", 411), - Topic(core.game.dialogue.FacialExpression.HAPPY, "Sure, that's not too expensive for such a magnificent cape.", 421) + Topic(FacialExpression.HALF_GUILTY, "Sorry, that's much too pricey.", 411), + Topic(FacialExpression.HAPPY, "Sure, that's not too expensive for such a magnificent cape.", 421) ) - 411 -> npcl(core.game.dialogue.FacialExpression.NEUTRAL, "I'm sorry you feel that way. Still, if you change your mind...").also { stage = END_DIALOGUE } - 421 -> if(core.game.global.Skillcape.purchase(player, Skills.HITPOINTS)) { - npcl(core.game.dialogue.FacialExpression.FRIENDLY, "There you go! I hope you enjoy it.").also { stage = END_DIALOGUE } + 411 -> npcl(FacialExpression.NEUTRAL, "I'm sorry you feel that way. Still, if you change your mind...").also { stage = END_DIALOGUE } + 421 -> if(Skillcape.purchase(player, Skills.HITPOINTS)) { + npcl(FacialExpression.FRIENDLY, "There you go! I hope you enjoy it.").also { stage = END_DIALOGUE } } else { - npcl(core.game.dialogue.FacialExpression.HALF_GUILTY, "Sorry, you can't buy that right now.").also { stage = END_DIALOGUE } + npcl(FacialExpression.HALF_GUILTY, "Sorry, you can't buy that right now.").also { stage = END_DIALOGUE } } - 501 -> npcl(core.game.dialogue.FacialExpression.HALF_THINKING, "Well, these capes are only available for people who have achieved a Hitpoint level of 99. You should go and train some more and come back to me when your Hitpoints are higher.").also { stage = END_DIALOGUE } + 501 -> npcl(FacialExpression.HALF_THINKING, "Well, these capes are only available for people who have achieved a Hitpoint level of 99. You should go and train some more and come back to me when your Hitpoints are higher.").also { stage = END_DIALOGUE } } return true }