diff --git a/Server/data/configs/shops.json b/Server/data/configs/shops.json index e73e13756..df2d1af5d 100644 --- a/Server/data/configs/shops.json +++ b/Server/data/configs/shops.json @@ -45,22 +45,13 @@ "stock": "{1931,30,100}-{1935,30,100}-{1735,10,100}-{1925,10,100}-{1923,10,100}-{1887,10,100}-{590,10,100}-{1755,10,100}-{2347,10,100}-{550,10,100}-{9003,10,100}" }, { - "npcs": "590", + "npcs": "590,591", "high_alch": "0", "currency": "995", "general_store": "true", "id": "6", - "title": "Aemad's Adventuring Supplies Store", - "stock": "{227,300,100}-{1265,10,100}-{1349,10,100}-{2142,10,100}-{590,10,100}-{1759,100,100}-{882,1000,100}-{954,10,100}-{970,10,100}-{946,10,100}-{1935,10,100}" - }, - { - "npcs": "591", - "high_alch": "0", - "currency": "995", - "general_store": "true", - "id": "7", - "title": "Kortan General Store", - "stock": "{1931,30,100}-{1935,30,100}-{1735,10,100}-{1925,10,100}-{1923,10,100}-{1887,10,100}-{590,10,100}-{1755,10,100}-{2347,10,100}-{550,10,100}-{9003,10,100}" + "title": "Aemad's Adventuring Supplies", + "stock": "{227,10,100}-{1265,10,100}-{1349,10,100}-{2142,10,100}-{590,10,100}-{1759,100,100}-{882,1000,100}-{954,10,100}-{970,10,100}-{946,10,100}-{1935,10,100}" }, { "npcs": "971", diff --git a/Server/src/main/content/global/dialogue/FurTradePlugin.java b/Server/src/main/content/global/dialogue/FurTradePlugin.java deleted file mode 100644 index b079a3b87..000000000 --- a/Server/src/main/content/global/dialogue/FurTradePlugin.java +++ /dev/null @@ -1,77 +0,0 @@ -package content.global.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; - -/** - * Represents the plugin used for the fur trader. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class FurTradePlugin extends DialoguePlugin { - - /** - * Constructs a new {@code FurTradePlugin} {@code Object}. - */ - public FurTradePlugin() { - /** - * empty. - */ - } - - /** - * Constructs a new {@code FurTradePlugin} {@code Object}. - * @param player the player. - */ - public FurTradePlugin(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new FurTradePlugin(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Would you like to trade in fur?"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendOptions("Select an Option", "Yes.", "No."); - stage = 1; - break; - case 1: - switch (buttonId) { - case 1: - end(); - npc.openShop(player); - break; - case 2: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No, thanks."); - stage = 20; - break; - } - break; - case 20: - end(); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 573 }; - } -} diff --git a/Server/src/main/content/global/dialogue/ShopkeeperDialogue.java b/Server/src/main/content/global/dialogue/ShopkeeperDialogue.java deleted file mode 100644 index 2d9b5be25..000000000 --- a/Server/src/main/content/global/dialogue/ShopkeeperDialogue.java +++ /dev/null @@ -1,81 +0,0 @@ -package content.global.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 generic shop keeper dialogue. - * @author Vexia - */ -@Initializable -public final class -ShopkeeperDialogue extends DialoguePlugin { - - /** - * Constructs a new {@code ShopkeeperDialogue} {@code Object}. - */ - public ShopkeeperDialogue() { - /** - * empty. - */ - } - - /** - * Constructs a new {@code ShopkeeperDialogue} {@code Object}. - * @param player the player. - */ - public ShopkeeperDialogue(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new ShopkeeperDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(npc, FacialExpression.HAPPY, "Can I help you at all?"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendOptions("Select an Option", "Yes, please. What are you selling?", "No, thanks."); - stage = 1; - break; - case 1: - switch (buttonId) { - case 1: - player("Yes, please. I'd like to see your stock."); - stage = 11; - break; - case 2: - player("No thanks, I must be going now."); - stage = 10; - break; - } - break; - case 10: - end(); - break; - case 11: - end(); - npc.openShop(player); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 555 }; - } -} diff --git a/Server/src/main/content/region/kandarin/ardougne/dialogue/ArdougneBaker.java b/Server/src/main/content/region/kandarin/ardougne/dialogue/ArdougneBaker.java deleted file mode 100644 index 1fce150d1..000000000 --- a/Server/src/main/content/region/kandarin/ardougne/dialogue/ArdougneBaker.java +++ /dev/null @@ -1,59 +0,0 @@ -package content.region.kandarin.ardougne.dialogue; - -import core.game.dialogue.DialoguePlugin; -import core.game.node.entity.npc.NPC; -import core.game.node.entity.player.Player; -import core.plugin.Initializable; - -/** - * Replacement for ArdougneBaker.asc - * @author ceik - */ - -@Initializable -public class ArdougneBaker extends DialoguePlugin { - public ArdougneBaker(){ - /** - * Empty on purpose - */ - } - public ArdougneBaker(Player player){super(player);} - - @Override - public DialoguePlugin newInstance(Player player){return new ArdougneBaker(player);} - - @Override - public boolean open(Object... args) { - npc = (NPC)args[0]; - npc("Good day, monsieur. Would you like ze nice", "freshly-baked bread? Or perhaps a nice piece of cake?"); - stage = 1; - return true; - } - - @Override - public final boolean handle(int interfaceId, int buttonId){ - switch(stage){ - case 1: - interpreter.sendOptions("Choose an option.", "Let's see what you have.", "No thank you."); - stage = 2; - break; - case 2: - switch(buttonId){ - case 1: - end(); - npc.openShop(player); - stage = 20; - break; - case 2: - end(); - break; - } - break; - } - return true; - } - @Override - public int[] getIds() { - return new int[] { 571 }; - } -} diff --git a/Server/src/main/content/region/kandarin/ardougne/dialogue/ArdougneBakerDialogue.kt b/Server/src/main/content/region/kandarin/ardougne/dialogue/ArdougneBakerDialogue.kt new file mode 100644 index 000000000..b5a080511 --- /dev/null +++ b/Server/src/main/content/region/kandarin/ardougne/dialogue/ArdougneBakerDialogue.kt @@ -0,0 +1,49 @@ +package content.region.kandarin.ardougne.dialogue + +import core.api.openNpcShop +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 core.tools.END_DIALOGUE +import core.tools.START_DIALOGUE +import org.rs09.consts.NPCs + +@Initializable +class ArdougneBakerDialogue(player: Player? = null) : DialoguePlugin(player) { + + override fun newInstance(player: Player?): DialoguePlugin { + return ArdougneBakerDialogue(player) + } + + override fun open(vararg args: Any?): Boolean { + npc = args[0] as NPC + npcl( + FacialExpression.HAPPY, + "Good day, monsieur. Would you like ze nice freshly-baked bread? Or perhaps a nice piece of cake?" + ).also { stage = START_DIALOGUE } + return true + } + + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + 0 -> options("Let's see what you have.", "No thank you.").also { stage++ } + 1 -> when (buttonId) { + 1 -> { + openNpcShop(player, NPCs.BAKER_571) + end() + } + + 2 -> playerl( + FacialExpression.FRIENDLY, "No thank you." + ).also { stage = END_DIALOGUE } + } + } + return true + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.BAKER_571) + } +} \ No newline at end of file diff --git a/Server/src/main/content/region/kandarin/ardougne/dialogue/ArdougneShopKeeperPlugin.java b/Server/src/main/content/region/kandarin/ardougne/dialogue/ArdougneShopKeeperPlugin.java deleted file mode 100644 index 80c35f8d0..000000000 --- a/Server/src/main/content/region/kandarin/ardougne/dialogue/ArdougneShopKeeperPlugin.java +++ /dev/null @@ -1,85 +0,0 @@ -package content.region.kandarin.ardougne.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; - -/** - * Represents the dialogue plugin used for the arougne shop keepers. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class ArdougneShopKeeperPlugin extends DialoguePlugin { - - /** - * Constructs a new {@code ArdouShopKeeperPlugin} {@code Object}. - */ - public ArdougneShopKeeperPlugin() { - /** - * empty. - */ - } - - /** - * Constructs a new {@code ArdouShopKeeperPlugin} {@code Object}. - * @param player the player. - */ - public ArdougneShopKeeperPlugin(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new ArdougneShopKeeperPlugin(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(npc, FacialExpression.HAPPY, "Hello, you look like a bold adventurer. You've come to the", "right place for adventurers' equipment."); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendOptions("Select an Option", "Oh, that sounds interesting.", "How should I use your shop?", "No, sorry, I've come to the wrong place."); - stage = 1; - break; - case 1: - switch (buttonId) { - case 1: - end(); - npc.openShop(player); - break; - case 2: - interpreter.sendDialogues(npc, FacialExpression.HAPPY, "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."); - stage = 20; - break; - case 3: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hmph. Well, perhaps next time you'll need something", "from me?"); - stage = 30; - break; - - } - break; - case 20: - end(); - break; - case 30: - end(); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 590, 591 }; - } -} diff --git a/Server/src/main/content/region/kandarin/ardougne/dialogue/FurTraderDialogue.kt b/Server/src/main/content/region/kandarin/ardougne/dialogue/FurTraderDialogue.kt new file mode 100644 index 000000000..0eafd5c61 --- /dev/null +++ b/Server/src/main/content/region/kandarin/ardougne/dialogue/FurTraderDialogue.kt @@ -0,0 +1,50 @@ +package content.region.kandarin.ardougne.dialogue + +import core.api.openNpcShop +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 core.tools.END_DIALOGUE +import core.tools.START_DIALOGUE +import org.rs09.consts.NPCs + +@Initializable +class FurTraderDialogue(player: Player? = null) : DialoguePlugin(player) { + + override fun newInstance(player: Player?): DialoguePlugin { + return FurTraderDialogue(player) + } + + override fun open(vararg args: Any?): Boolean { + npc = args[0] as NPC + npcl( + FacialExpression.ASKING, "Would you like to trade in fur?" + ).also { stage = START_DIALOGUE } + return true + } + + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + 0 -> options("Yes.", "No.").also { stage++ } + 1 -> when (buttonId) { + 1 -> { + openNpcShop(player, NPCs.FUR_TRADER_573) + end() + } + + 2 -> playerl( + FacialExpression.HALF_GUILTY, "No, thanks." + ).also { stage = END_DIALOGUE } + + } + } + return true + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.FUR_TRADER_573) + } + +} \ No newline at end of file diff --git a/Server/src/main/content/region/kandarin/ardougne/dialogue/GemMerchantDialogue.java b/Server/src/main/content/region/kandarin/ardougne/dialogue/GemMerchantDialogue.java deleted file mode 100644 index b47de8b9a..000000000 --- a/Server/src/main/content/region/kandarin/ardougne/dialogue/GemMerchantDialogue.java +++ /dev/null @@ -1,62 +0,0 @@ -package content.region.kandarin.ardougne.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; - -/** - * Represents the gem merchant dialogue plugin. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class GemMerchantDialogue extends DialoguePlugin { - - /** - * Constructs a new {@code GemMerchantDialogue} {@code Object}. - */ - public GemMerchantDialogue() { - /** - * empty. - */ - } - - /** - * Constructs a new {@code GemMerchantDialogue} {@code Object}. - * @param player the player. - */ - public GemMerchantDialogue(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new GemMerchantDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(npc, FacialExpression.HAPPY, "Here, look at my lovely gems."); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - end(); - npc.openShop(player); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 570 }; - } -} diff --git a/Server/src/main/content/region/kandarin/ardougne/dialogue/GemMerchantDialogue.kt b/Server/src/main/content/region/kandarin/ardougne/dialogue/GemMerchantDialogue.kt new file mode 100644 index 000000000..b7e2fd4d7 --- /dev/null +++ b/Server/src/main/content/region/kandarin/ardougne/dialogue/GemMerchantDialogue.kt @@ -0,0 +1,40 @@ +package content.region.kandarin.ardougne.dialogue + +import core.api.openNpcShop +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 core.tools.START_DIALOGUE +import org.rs09.consts.NPCs + +@Initializable +class GemMerchantDialogue(player: Player? = null) : DialoguePlugin(player) { + + override fun newInstance(player: Player?): DialoguePlugin { + return GemMerchantDialogue(player) + } + + override fun open(vararg args: Any?): Boolean { + npc = args[0] as NPC + npcl( + FacialExpression.HAPPY, "Here, look at my lovely gems." + ).also { stage = START_DIALOGUE } + return true + } + + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + 0 -> { + openNpcShop(player, NPCs.GEM_MERCHANT_570) + end() + } + } + return true + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.GEM_MERCHANT_570) + } +} \ No newline at end of file diff --git a/Server/src/main/content/region/kandarin/ardougne/dialogue/ShopKeeperDialogue.kt b/Server/src/main/content/region/kandarin/ardougne/dialogue/ShopKeeperDialogue.kt new file mode 100644 index 000000000..94051bec4 --- /dev/null +++ b/Server/src/main/content/region/kandarin/ardougne/dialogue/ShopKeeperDialogue.kt @@ -0,0 +1,62 @@ +package content.region.kandarin.ardougne.dialogue + +import content.region.kandarin.dialogue.ShopKeeperDialogue +import core.api.openNpcShop +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 core.tools.END_DIALOGUE +import core.tools.START_DIALOGUE +import org.rs09.consts.NPCs + +@Initializable +class ShopKeeperDialogue(player: Player? = null) : DialoguePlugin(player) { + + override fun newInstance(player: Player?): DialoguePlugin { + return content.region.kandarin.ardougne.dialogue.ShopKeeperDialogue(player) + } + + override fun open(vararg args: Any?): Boolean { + npc = args[0] as NPC + npcl( + FacialExpression.FRIENDLY, + "Hello, you look like a bold adventurer. You've come to the right place for adventurers' equipment." + ).also { stage = START_DIALOGUE } + return true + } + + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + 0 -> options( + "Oh, that sounds interesting.", + "How should I use your shop?", + "No, sorry, I've come to the wrong place." + ).also { stage++ } + + 1 -> when (buttonId) { + 1 -> { + openNpcShop(player, NPCs.AEMAD_590) + end() + } + + 2 -> npcl( + FacialExpression.HAPPY, + "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 } + + 3 -> npcl( + FacialExpression.HALF_GUILTY, "Hmph. Well, perhaps next time you'll need something from me?" + ).also { stage = END_DIALOGUE } + + } + } + return true + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.AEMAD_590, NPCs.KORTAN_591) + } + +} \ No newline at end of file diff --git a/Server/src/main/content/region/kandarin/dialogue/ShopKeeperDialogue.kt b/Server/src/main/content/region/kandarin/dialogue/ShopKeeperDialogue.kt new file mode 100644 index 000000000..cc0713e5f --- /dev/null +++ b/Server/src/main/content/region/kandarin/dialogue/ShopKeeperDialogue.kt @@ -0,0 +1,55 @@ +package content.region.kandarin.dialogue + +import core.api.openNpcShop +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 core.tools.END_DIALOGUE +import core.tools.START_DIALOGUE +import org.rs09.consts.NPCs + +@Initializable +class ShopKeeperDialogue(player: Player? = null) : DialoguePlugin(player) { + + override fun newInstance(player: Player?): DialoguePlugin { + return ShopKeeperDialogue(player) + } + + override fun open(vararg args: Any?): Boolean { + npc = args[0] as NPC + npcl( + FacialExpression.HAPPY, "Can I help you at all?" + ).also { stage = START_DIALOGUE } + return true + } + + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + 0 -> options( + "Yes, please. I'd like to see your stock.", "No thanks, I must be going now." + ).also { stage++ } + + 1 -> when (buttonId) { + 1 -> playerl( + FacialExpression.FRIENDLY, "Yes, please. I'd like to see your stock." + ).also { stage++ } + + 2 -> playerl( + FacialExpression.FRIENDLY, "No thanks, I must be going now." + ).also { stage = END_DIALOGUE } + } + + 2 -> { + openNpcShop(player, NPCs.SHOPKEEPER_555) + end() + } + } + return true + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.SHOPKEEPER_555) + } +} \ No newline at end of file