diff --git a/Server/data/configs/drop_tables.json b/Server/data/configs/drop_tables.json index 1e0ef5f48..b1929f67c 100644 --- a/Server/data/configs/drop_tables.json +++ b/Server/data/configs/drop_tables.json @@ -16,7 +16,7 @@ } ], "charm": [], - "ids": "1,2,3,16,24,170,351,359,663,726,727,728,729,730,1086,2675,3223,3224,3225,3915,5923", + "ids": "1,2,3,16,24,170,351,359,663,726,727,728,729,730,1084,1085,1086,1087,1088,1089,2675,3223,3224,3225,3915,5923", "description": "", "main": [ { diff --git a/Server/data/configs/npc_configs.json b/Server/data/configs/npc_configs.json index e2dcd34e3..e6ce7126f 100644 --- a/Server/data/configs/npc_configs.json +++ b/Server/data/configs/npc_configs.json @@ -11097,18 +11097,36 @@ "attack_level": "1" }, { + "examine": "A citizen of Burthorpe.", + "melee_animation": "422", + "magic_level": "1", + "respawn_delay": "60", + "defence_animation": "425", "death_animation": "836", - "name": "Ocga", - "defence_level": "1", + "name": "Breoca", + "defence_level": "3", "safespot": null, "lifepoints": "10", + "strength_level": "3", + "id": "1084", + "range_level": "1", + "attack_level": "3" + }, + { + "examine": "A citizen of Burthorpe.", "melee_animation": "422", - "strength_level": "1", + "magic_level": "1", + "respawn_delay": "60", + "defence_animation": "425", + "death_animation": "836", + "name": "Ocga", + "defence_level": "3", + "safespot": null, + "lifepoints": "10", + "strength_level": "3", "id": "1085", "range_level": "1", - "respawn_delay": "60", - "attack_level": "1", - "defence_animation": "425" + "attack_level": "3" }, { "name": "Man", @@ -11123,46 +11141,52 @@ "attack_level": "1" }, { + "examine": "A citizen of Burthorpe.", + "melee_animation": "422", + "magic_level": "1", + "respawn_delay": "60", + "defence_animation": "425", "death_animation": "836", "name": "Penda", - "defence_level": "1", + "defence_level": "3", "safespot": null, "lifepoints": "10", - "melee_animation": "422", - "strength_level": "1", + "strength_level": "3", "id": "1087", "range_level": "1", - "respawn_delay": "60", - "attack_level": "1", - "defence_animation": "425" + "attack_level": "3" }, { + "examine": "A citizen of Burthorpe.", + "melee_animation": "422", + "magic_level": "1", + "respawn_delay": "60", + "defence_animation": "425", "death_animation": "836", "name": "Hygd", - "defence_level": "1", + "defence_level": "3", "safespot": null, "lifepoints": "10", - "melee_animation": "422", - "strength_level": "1", + "strength_level": "2", "id": "1088", "range_level": "1", - "respawn_delay": "60", - "attack_level": "1", - "defence_animation": "425" + "attack_level": "3" }, { + "examine": "A citizen of Burthorpe.", + "melee_animation": "422", + "magic_level": "1", + "respawn_delay": "60", + "defence_animation": "425", "death_animation": "836", "name": "Ceolburg", - "defence_level": "1", + "defence_level": "3", "safespot": null, "lifepoints": "10", - "melee_animation": "422", - "strength_level": "1", + "strength_level": "2", "id": "1089", "range_level": "1", - "respawn_delay": "60", - "attack_level": "1", - "defence_animation": "425" + "attack_level": "3" }, { "examine": "The knight seems to be watching something.", diff --git a/Server/data/configs/npc_spawns.json b/Server/data/configs/npc_spawns.json index fd302d62e..32c088d25 100644 --- a/Server/data/configs/npc_spawns.json +++ b/Server/data/configs/npc_spawns.json @@ -2685,7 +2685,7 @@ }, { "npc_id": "1084", - "loc_data": "{2915,3549,0,0,0}" + "loc_data": "{2915,3549,0,1,0}" }, { "npc_id": "1085", @@ -2697,15 +2697,15 @@ }, { "npc_id": "1087", - "loc_data": "{2911,3540,0,0,7}" + "loc_data": "{2911,3540,0,1,7}" }, { "npc_id": "1088", - "loc_data": "{2918,3545,0,0,0}" + "loc_data": "{2918,3545,0,1,0}" }, { "npc_id": "1089", - "loc_data": "{2919,3529,0,0,0}" + "loc_data": "{2919,3529,0,1,0}" }, { "npc_id": "1090", diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/BreocaDialogue.java b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/BreocaDialogue.java deleted file mode 100644 index 552eeea62..000000000 --- a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/BreocaDialogue.java +++ /dev/null @@ -1,65 +0,0 @@ -package content.region.asgarnia.burthorpe.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 breoca dialogue plugin. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class BreocaDialogue extends DialoguePlugin { - - /** - * Constructs a new {@code BreocaDialogue} {@code Object}. - */ - public BreocaDialogue() { - /** - * empty. - */ - } - - /** - * Constructs a new {@code BreocaDialogue} {@code Object}. - * @param player the player. - */ - public BreocaDialogue(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new BreocaDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hi!"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hello stranger."); - stage = 1; - break; - case 1: - end(); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 1084 }; - } -} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/BreocaDialogue.kt b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/BreocaDialogue.kt new file mode 100644 index 000000000..ca982ff6c --- /dev/null +++ b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/BreocaDialogue.kt @@ -0,0 +1,48 @@ +package content.region.asgarnia.burthorpe.dialogue + +import core.api.isQuestComplete +import core.api.toIntArray +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +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 + +/** + * Breoca Dialogue + * @author 'Vexia + * @author ovenbread + */ +@Initializable +class BreocaDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun handle(interfaceId: Int, buttonId: Int) : Boolean { + if(isQuestComplete(player!!, "Death Plateau")) { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() } + 1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.HAPPY, "Thank you so much!").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.HAPPY, "Surely we are safe now!").also { stage = END_DIALOGUE } + } + } else { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() } + 1 -> npcl(FacialExpression.FRIENDLY, "Hello stranger.").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.FRIENDLY, "Hi!").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.FRIENDLY, "Welcome to Burthorpe!").also { stage++ } + 4 -> playerl(FacialExpression.FRIENDLY, "Thanks!").also { stage = END_DIALOGUE } + } + } + return true + } + + override fun newInstance(player: Player?): DialoguePlugin { + return BreocaDialogue(player) + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.BREOCA_1084) + } +} + diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/CeolburgDialogue.java b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/CeolburgDialogue.java deleted file mode 100644 index ea9ee941a..000000000 --- a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/CeolburgDialogue.java +++ /dev/null @@ -1,65 +0,0 @@ -package content.region.asgarnia.burthorpe.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; - -/** - * Rerpesents the dialogue plugin used for the celburg npc. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class CeolburgDialogue extends DialoguePlugin { - - /** - * Constructs a new {@code CeolburgDialogue} {@code Object}. - */ - public CeolburgDialogue() { - /** - * empty. - */ - } - - /** - * Constructs a new {@code CeolburgDialogue} {@code Object}. - * @param player the player. - */ - public CeolburgDialogue(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new CeolburgDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hi!"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Trolls!"); - stage = 1; - break; - case 1: - end(); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 1089 }; - } -} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/CeolburgDialogue.kt b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/CeolburgDialogue.kt new file mode 100644 index 000000000..6eae6fa18 --- /dev/null +++ b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/CeolburgDialogue.kt @@ -0,0 +1,47 @@ +package content.region.asgarnia.burthorpe.dialogue + +import core.api.isQuestComplete +import core.api.toIntArray +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +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 + +/** + * Ceolburg Dialogue + * @author 'Vexia + * @author ovenbread + */ +@Initializable +class CeolburgDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun handle(interfaceId: Int, buttonId: Int) : Boolean { + if(isQuestComplete(player!!, "Death Plateau")) { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() } + 1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.HAPPY, "Thank you so much!").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.HAPPY, "Surely we are safe now!").also { stage = END_DIALOGUE } + } + } else { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() } + 1 -> npcl(FacialExpression.FRIENDLY, "Hello stranger.").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.FRIENDLY, "Hi!").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.FRIENDLY, "Welcome to Burthorpe!").also { stage++ } + 4 -> playerl(FacialExpression.FRIENDLY, "Thanks!").also { stage = END_DIALOGUE } + } + } + return true + } + + override fun newInstance(player: Player?): DialoguePlugin { + return CeolburgDialogue(player) + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.CEOLBURG_1089) + } +} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/HistanDialogue.java b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/HistanDialogue.java deleted file mode 100644 index 5779369a3..000000000 --- a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/HistanDialogue.java +++ /dev/null @@ -1,89 +0,0 @@ -package content.region.asgarnia.burthorpe.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 histan dialogue plugin. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class HistanDialogue extends DialoguePlugin { - - /** - * Constructs a new {@code HistanDialogue} {@code Object}. - */ - public HistanDialogue() { - /** - * empty. - */ - } - - /** - * Constructs a new {@code HistanDialogue} {@code Object}. - * @param player the player. - */ - public HistanDialogue(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new HistanDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hi!"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Welcome to Burthorpe Supplies. Your last shop before", "heading north into the mountains!"); - stage = 1; - break; - case 1: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Would you like to buy something?"); - stage = 2; - break; - case 2: - interpreter.sendOptions("Select an Option", "Yes, please.", "No, thanks."); - stage = 3; - break; - case 3: - switch (buttonId) { - case 1: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Yes, please."); - stage = 10; - break; - case 2: - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No, thanks."); - stage = 20; - break; - } - break; - case 10: - end(); - npc.openShop(player); - break; - case 20: - end(); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 1083 }; - } -} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/HygdDialogue.java b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/HygdDialogue.java deleted file mode 100644 index fb1e3490f..000000000 --- a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/HygdDialogue.java +++ /dev/null @@ -1,65 +0,0 @@ -package content.region.asgarnia.burthorpe.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 hygd dialogue plugin. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class HygdDialogue extends DialoguePlugin { - - /** - * Constructs a new {@code HygdDialogue} {@code Object}. - */ - public HygdDialogue() { - /** - * empty. - */ - } - - /** - * Constructs a new {@code HygdDialogue} {@code Object}. - * @param player the player. - */ - public HygdDialogue(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - return new HygdDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hi!"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hi!"); - stage = 1; - break; - case 1: - end(); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 1088 }; - } -} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/HygdDialogue.kt b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/HygdDialogue.kt new file mode 100644 index 000000000..2a7f3f280 --- /dev/null +++ b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/HygdDialogue.kt @@ -0,0 +1,48 @@ +package content.region.asgarnia.burthorpe.dialogue + +import core.api.isQuestComplete +import core.api.toIntArray +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +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 + +/** + * Hygd Dialogue + * @author 'Vexia + * @author ovenbread + */ +@Initializable +class HygdDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun handle(interfaceId: Int, buttonId: Int) : Boolean { + if(isQuestComplete(player!!, "Death Plateau")) { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() } + 1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.HAPPY, "Thank you so much!").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.HAPPY, "Surely we are safe now!").also { stage = END_DIALOGUE } + } + } else { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() } + 1 -> npcl(FacialExpression.FRIENDLY, "Hello stranger.").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.FRIENDLY, "Hi!").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.FRIENDLY, "Welcome to Burthorpe!").also { stage++ } + 4 -> playerl(FacialExpression.FRIENDLY, "Thanks!").also { stage = END_DIALOGUE } + } + } + return true + } + + override fun newInstance(player: Player?): DialoguePlugin { + return HygdDialogue(player) + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.HYGD_1088) + } +} + diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/OcaDialogue.java b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/OcaDialogue.java deleted file mode 100644 index 0f5dbb101..000000000 --- a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/OcaDialogue.java +++ /dev/null @@ -1,56 +0,0 @@ -package content.region.asgarnia.burthorpe.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 OcaDialogue dialogue. - * @author 'Vexia - */ -@Initializable -public class OcaDialogue extends DialoguePlugin { - - public OcaDialogue() { - - } - - public OcaDialogue(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - - return new OcaDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hi!"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hello stranger."); - stage = 1; - break; - case 1: - end(); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 1085 }; - } -} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/OcgaDialogue.kt b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/OcgaDialogue.kt new file mode 100644 index 000000000..9f3b57269 --- /dev/null +++ b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/OcgaDialogue.kt @@ -0,0 +1,59 @@ +package content.region.asgarnia.burthorpe.dialogue + +import core.api.isQuestComplete +import core.api.toIntArray +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +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 + + +/** + * Ocga Dialogue + * @author 'Vexia + * @author ovenbread + */ +@Initializable +class OcgaDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun handle(interfaceId: Int, buttonId: Int) : Boolean { + if(isQuestComplete(player!!, "Death Plateau")) { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..5).toIntArray().random() } + 1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.WORRIED, "The White Knights are still going to take over.").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.PANICKED, "I hear the Imperial Guard are preparing an attack!").also { stage = END_DIALOGUE } + 4 -> npcl(FacialExpression.HAPPY, "Thank you so much!").also { stage = END_DIALOGUE } + 5 -> npcl(FacialExpression.HAPPY, "Surely we are safe now!").also { stage = END_DIALOGUE } + } + } else { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..12).toIntArray().random() } + 1 -> npcl(FacialExpression.ANGRY, "Let me at 'em!").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.ANGRY, "Trolls? Schmolls!").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.PANICKED, "The trolls are coming!").also { stage = END_DIALOGUE } + 4 -> npcl(FacialExpression.PANICKED, "The trolls took my baby son!").also { stage = END_DIALOGUE } + 5 -> npcl(FacialExpression.PANICKED, "Trolls!").also { stage = END_DIALOGUE } + 6 -> npcl(FacialExpression.FRIENDLY, "Hello stranger.").also { stage = END_DIALOGUE } + 7 -> npcl(FacialExpression.ANGRY, "Go away!").also { stage = END_DIALOGUE } + 8 -> npcl(FacialExpression.PANICKED, "Run!").also { stage = END_DIALOGUE } + 9 -> npcl(FacialExpression.FRIENDLY, "Hi!").also { stage = END_DIALOGUE } + 10 -> npcl(FacialExpression.SAD, "The Imperial Guard can no longer protect us!").also { stage = END_DIALOGUE } + 11 -> npcl(FacialExpression.WORRIED, "The White Knights will soon have control!").also { stage = END_DIALOGUE } + 12 -> npcl(FacialExpression.FRIENDLY, "Welcome to Burthorpe!").also { stage++ } + 13 -> playerl(FacialExpression.FRIENDLY, "Thanks!").also { stage = END_DIALOGUE } + } + } + return true + } + + override fun newInstance(player: Player?): DialoguePlugin { + return OcgaDialogue(player) + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.OCGA_1085) + } +} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/PendaDialogue.java b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/PendaDialogue.java deleted file mode 100644 index 78f6c8e24..000000000 --- a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/PendaDialogue.java +++ /dev/null @@ -1,56 +0,0 @@ -package content.region.asgarnia.burthorpe.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 PendaDialogue dialogue. - * @author 'Vexia - */ -@Initializable -public class PendaDialogue extends DialoguePlugin { - - public PendaDialogue() { - - } - - public PendaDialogue(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - - return new PendaDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hi!"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "The trolls are coming!"); - stage = 2; - break; - case 2: - end(); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 1087 }; - } -} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/PendaDialogue.kt b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/PendaDialogue.kt new file mode 100644 index 000000000..f16f20dce --- /dev/null +++ b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/PendaDialogue.kt @@ -0,0 +1,47 @@ +package content.region.asgarnia.burthorpe.dialogue + +import core.api.isQuestComplete +import core.api.toIntArray +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +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 + +/** + * Penda Dialogue + * @author 'Vexia + * @author ovenbread + */ +@Initializable +class PendaDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun handle(interfaceId: Int, buttonId: Int) : Boolean { + if(isQuestComplete(player!!, "Death Plateau")) { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() } + 1 -> npcl(FacialExpression.HAPPY, "I heard about what you did, thank you!").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.HAPPY, "Thank you so much!").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.HAPPY, "Surely we are safe now!").also { stage = END_DIALOGUE } + } + } else { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage = (1..3).toIntArray().random() } + 1 -> npcl(FacialExpression.FRIENDLY, "Hello stranger.").also { stage = END_DIALOGUE } + 2 -> npcl(FacialExpression.FRIENDLY, "Hi!").also { stage = END_DIALOGUE } + 3 -> npcl(FacialExpression.FRIENDLY, "Welcome to Burthorpe!").also { stage++ } + 4 -> playerl(FacialExpression.FRIENDLY, "Thanks!").also { stage = END_DIALOGUE } + } + } + return true + } + + override fun newInstance(player: Player?): DialoguePlugin { + return PendaDialogue(player) + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.PENDA_1087) + } +} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/ServantDialogue.java b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/ServantDialogue.java deleted file mode 100644 index c0a6e29ea..000000000 --- a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/ServantDialogue.java +++ /dev/null @@ -1,64 +0,0 @@ -package content.region.asgarnia.burthorpe.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 ServantDialogue dialogue. - * @author 'Vexia - */ -@Initializable -public class ServantDialogue extends DialoguePlugin { - - public ServantDialogue() { - - } - - public ServantDialogue(Player player) { - super(player); - } - - @Override - public DialoguePlugin newInstance(Player player) { - - return new ServantDialogue(player); - } - - @Override - public boolean open(Object... args) { - npc = (NPC) args[0]; - interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hi!"); - stage = 0; - return true; - } - - @Override - public boolean handle(int interfaceId, int buttonId) { - switch (stage) { - case 0: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hi!"); - stage = 1; - break; - case 1: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Look, I'd better not talk. I'll get in trouble."); - stage = 2; - break; - case 2: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "If you want someone to show you round the castle ask", "Eohric, the Head Servant."); - stage = 3; - break; - case 3: - end(); - break; - } - return true; - } - - @Override - public int[] getIds() { - return new int[] { 1081 }; - } -} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/ServantDialogue.kt b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/ServantDialogue.kt new file mode 100644 index 000000000..205f31c41 --- /dev/null +++ b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/ServantDialogue.kt @@ -0,0 +1,35 @@ +package content.region.asgarnia.burthorpe.dialogue + +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +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 + +/** + * Servant Dialogue + * @author 'Vexia + * @author ovenbread + */ +@Initializable +class ServantDialogue(player: Player? = null) : DialoguePlugin(player) { + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ } + 1 -> npcl(FacialExpression.HALF_GUILTY, "Hi").also { stage++ } + 2 -> npcl(FacialExpression.HALF_GUILTY, "Look, I'd better not talk. I'll get in trouble.").also { stage++ } + 3 -> npcl(FacialExpression.HALF_GUILTY, "If you want someone to show you round the castle ask Eohric, the Head Servant.").also { stage = END_DIALOGUE } + } + return true + } + + override fun newInstance(player: Player): DialoguePlugin { + return ServantDialogue(player) + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.SERVANT_1081) + } +} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/dialogue/WistanDialogue.kt b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/WistanDialogue.kt new file mode 100644 index 000000000..97b3f2730 --- /dev/null +++ b/Server/src/main/content/region/asgarnia/burthorpe/dialogue/WistanDialogue.kt @@ -0,0 +1,41 @@ +package content.region.asgarnia.burthorpe.dialogue + +import core.game.dialogue.DialoguePlugin +import core.game.dialogue.FacialExpression +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 + +/** + * Represents the Wistan dialogue plugin. + * @author 'Vexia + * @author ovenbread + */ +@Initializable +class WistanDialogue(player: Player? = null) : DialoguePlugin(player) { + + override fun handle(interfaceId: Int, buttonId: Int): Boolean { + when (stage) { + START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ } + 1 -> npcl(FacialExpression.FRIENDLY, "Welcome to Burthorpe Supplies. Your last shop before heading north into the mountains!").also { stage++ } + 2 -> npcl(FacialExpression.FRIENDLY, "Would you like to buy something?").also { stage++ } + 3 -> options("Yes, please.", "No, thanks.").also { stage++ } + 4 -> when (buttonId) { + 1 -> playerl(FacialExpression.FRIENDLY, "Yes, please.").also { stage = 5 } + 2 -> playerl(FacialExpression.FRIENDLY, "No, thanks.").also { stage = END_DIALOGUE } + } + 5 -> npc.openShop(player).also { stage = END_DIALOGUE } + } + return true + } + + override fun newInstance(player: Player): DialoguePlugin { + return WistanDialogue(player) + } + + override fun getIds(): IntArray { + return intArrayOf(NPCs.WISTAN_1083) + } +}