diff --git a/Server/server.sql b/Server/server.sql index 988f53b06..c34d39f66 100644 --- a/Server/server.sql +++ b/Server/server.sql @@ -23608,10 +23608,11 @@ INSERT INTO `shops` (`id`, `title`, `general_store`, `stock`, `npcs`, `currency` (204, '2009Scape Weapon Store (Bronze - Mithril)', 0, '{1205,10}-{1237,10}-{1265,10}-{1277,10}-{1291,10}-{1307,10}-{1321,10}-{1337,10}-{1351,10}-{1375,10}-{1203,10}-{1239,10}-{1267,10}-{1279,10}-{1293,10}-{1309,10}-{1323,10}-{1335,10}-{1349,10}-{1363,10}-{1207,10}-{1241,10}-{1269,10}-{1281,10}-{1295,10}-{1311,10}-{1325,10}-{1339,10}-{1353,10}-{1365,10}-{1209,10}-{1243,10}-{1273,10}-{1285,10}-{1299,10}-{1315,10}-{1329,10}-{1343,10}-{1355,10}-{1369,10}', '', 995, 0), (205, '2009Scape Weapon Store (Adamant - Dragon)', 0, '{1211,10}-{1245,10}-{1271,10}-{1287,10}-{1301,10}-{1317,10}-{1331,10}-{1345,10}-{1357,10}-{1371,10}-{1213,10}-{1247,10}-{1275,10}-{1289,10}-{1303,10}-{1319,10}-{1333,10}-{1347,10}-{1359,10}-{1373,10}-{1215,10}-{4587,10}', '', 995, 0), (206, '2009Scape Tool Store', 0, '{1925,10}-{2347,10}-{590,10}-{946,10}-{952,10}-{301,10}-{305,10}-{307,10}-{309,10}-{311,10}-{313,1000}-{1734,10}-{233,10}-{1349,10}-{1353,10}-{1355,10}-{1267,10}-{1269,10}-{1271,10}-{1273,10}-{1734,100}-{1733,100}-{1779,1000}-{526, 500}-{532,500}', '8174', 995, 0), -(207, '2009Scape General Store', 1, '{1931,30}-{1935,30}-{1735,10}-{1925,10}-{1923,10}-{1887,10}-{590,10}-{1755,10}-{2347,10}-{550,10}-{9003,10}', '7967', 995, 0), +(207, '2009Scape General Store', 1, '{1931,30}-{1935,30}-{1735,10}-{1925,10}-{1923,10}-{1887,10}-{590,10}-{1755,10}-{2347,10}-{550,10}-{9003,10}', '7967, 3039', 995, 0), (208, 'Hartwin\'s Longrange Tools', 0, '{882,10000000}-{884,10000000}-{886,10000000}-{888,10000000}-{890,10000000}-{877,10000000}-{9140,10000000}-{9141,10000000}-{841,10}-{843,10}-{849,10}-{853,10}-{857,10}-{861,10}-{837,10}-{9177,10}-{9179,10}-{9181,10}-{9183,10}-{11864,10}-{11866,10}-{11868,10}-{11870,10}-{1063,10}-{1095,10}-{1129,10}-{1129,10}-{1131,10}-{1167,10}-{1133,10}-{1097,10}-{6328,10}-{3749,10}-{1478,10}-{8880,10}-{8882,10000000}-{863,10000000}', '8139', 995, 0), (209, 'Holy Wares', 0, '{6746, 20}-{732, 100000}', '1369', 995, 0), -(210, 'Ranging Guild Ticket Exchange', 0, '{47,10000000}-{1133,10000000}-{892,10000000}-{1169,10000000}-{1135,10000000}-{829,10000000}', '694', 1464, 0); +(210, 'Ranging Guild Ticket Exchange', 0, '{47,10000000}-{1133,10000000}-{892,10000000}-{1169,10000000}-{1135,10000000}-{829,10000000}', '694', 1464, 0), +(211, 'Rok\'s Choc Box', 0, '{6794,30}-{1973,25}','3045',995,0); -- -------------------------------------------------------- diff --git a/Server/src/plugin/activity/pyramidplunder/PyramidPlunderOptions.java b/Server/src/plugin/activity/pyramidplunder/PyramidPlunderOptions.java index 9957eff74..bedad924c 100644 --- a/Server/src/plugin/activity/pyramidplunder/PyramidPlunderOptions.java +++ b/Server/src/plugin/activity/pyramidplunder/PyramidPlunderOptions.java @@ -154,7 +154,7 @@ public final class PyramidPlunderOptions extends OptionHandler { boolean success = success(player, Skills.THIEVING); player.animate(animations[success ? 1 : 0]); player.lock(2); - if (success || manager.ObjectList.contains(object) ? manager.ObjectList.get(manager.ObjectList.indexOf(object)).snakeCharmed : false) { + if (manager.ObjectList.contains(object) ? manager.ObjectList.get(manager.ObjectList.indexOf(object)).snakeCharmed : success) { player.getPacketDispatch().sendMessage("You successfully search the urn..."); player.getSkills().addExperience(Skills.THIEVING, 25 + (room * 20), true); player.getInventory().add(ARTIFACTS[((int)Math.floor(droom / 3))][RandomFunction.random(3)]); diff --git a/Server/src/plugin/interaction/city/nardah/AliTheCarter.java b/Server/src/plugin/interaction/city/nardah/AliTheCarter.java new file mode 100644 index 000000000..987bca6d1 --- /dev/null +++ b/Server/src/plugin/interaction/city/nardah/AliTheCarter.java @@ -0,0 +1,99 @@ +package plugin.interaction.city.nardah; + +import org.crandor.game.content.dialogue.DialoguePlugin; +import org.crandor.game.node.entity.npc.NPC; +import org.crandor.game.node.entity.player.Player; +import org.crandor.game.node.item.GroundItemManager; +import org.crandor.game.node.item.Item; +import org.crandor.plugin.InitializablePlugin; + +/** + * Handles Ali the Carter, TODO: Add more dialogue after Spirits of the Elid is added + * @author ceik + */ + +@InitializablePlugin +public class AliTheCarter extends DialoguePlugin { + public AliTheCarter(){ + /** + * Empty + */ + } + public AliTheCarter(Player player){super(player);} + @Override + public DialoguePlugin newInstance(Player player){return new AliTheCarter(player);} + public boolean open(Object... args){ + NPC npc = (NPC)args[0]; + player("Hello"); + return true; + } + + public boolean handle(int interfaceId, int buttonId){ + switch(stage){ + case 0: + npc("Hello, friend! Welcome to Nardah.","Do you happen to be in need of water?"); + stage++; + break; + case 1: + interpreter.sendOptions("Select one","Yes I am!","No thank you I'm good."); + stage++; + break; + case 2: + switch(buttonId){ + case 1: + player("Yes I am!"); + stage = 3; + break; + case 2: + player("No thank you."); + stage = 10; + break; + } + break; + case 3: + npc("It'll be 1000 coins for a full waterskin."); + stage++; + break; + case 4: + interpreter.sendOptions("Select one","Oh, wow. Um, sure.","Oh my! No thank you."); + stage++; + break; + case 5: + switch(buttonId){ + case 1: + player("Oh, wow. Um, sure."); + stage++; + break; + case 2: + player("Oh my! No thank you."); + stage = 10; + break; + } + break; + case 6: + if(player.getInventory().contains(995,1000)){ + player.getInventory().remove(new Item(995,1000)); + if(player.getInventory().freeSlots() > 0) { + player.getInventory().add(new Item(1823)); + } else { + GroundItemManager.create(new Item(1823),player.getLocation()); + } + end(); + } else { + player("Err, I seem to not have enough gold."); + stage++; + } + break; + case 7: + npc("Too bad, friend."); + stage = 10; + break; + case 10: + end(); + break; + } + return true; + } + @Override + public int[] getIds() {return new int[] {3030};} +} diff --git a/Server/src/plugin/interaction/city/nardah/ArtimeusDialogue.java b/Server/src/plugin/interaction/city/nardah/ArtimeusDialogue.java new file mode 100644 index 000000000..d5b7907f7 --- /dev/null +++ b/Server/src/plugin/interaction/city/nardah/ArtimeusDialogue.java @@ -0,0 +1,68 @@ +package plugin.interaction.city.nardah; + +import org.crandor.game.content.dialogue.DialoguePlugin; +import org.crandor.game.node.entity.npc.NPC; +import org.crandor.game.node.entity.player.Player; +import org.crandor.plugin.InitializablePlugin; + +/** + * Handles dialogue for Artimeus + * @author ceik + */ + +@InitializablePlugin +public class ArtimeusDialogue extends DialoguePlugin { + public ArtimeusDialogue(){ + /** + * Empty + */ + } + public ArtimeusDialogue(Player player){ + super(player); + } + + @Override + public DialoguePlugin newInstance(Player player){return new ArtimeusDialogue(player);} + + @Override + public boolean open(Object... args){ + npc("Greetings, friend; my business here deals with Hunter","related items. Is there anything in which I can interest you?"); + return true; + } + + @Override + public boolean handle(int interfaceId, int buttonId){ + switch(stage){ + case 0: + interpreter.sendOptions("Select one","What kind of items do you stock?","I'm not in the market for Hunter equipment right now, thanks."); + stage++; + break; + case 1: + switch(buttonId){ + case 1: + player("What kind of items do you stock?"); + stage++; + break; + case 2: + player("I'm not in the market for Hunter equipment","right now, thanks."); + stage = 10; + break; + } + break; + case 2: + npc("Have a look for yourself."); + stage++; + break; + case 3: + end(); + NPC Artimeus = new NPC(5109); + Artimeus.openShop(player); + break; + case 10: + end(); + break; + } + return true; + } + public int[] getIds() {return new int[] {5109};} +} diff --git a/Server/src/plugin/interaction/city/nardah/Awusah.java b/Server/src/plugin/interaction/city/nardah/Awusah.java new file mode 100644 index 000000000..b474c3f19 --- /dev/null +++ b/Server/src/plugin/interaction/city/nardah/Awusah.java @@ -0,0 +1,42 @@ +package plugin.interaction.city.nardah; + +import org.crandor.game.content.dialogue.DialoguePlugin; +import org.crandor.game.node.entity.player.Player; +import org.crandor.plugin.InitializablePlugin; + +/** + * Handles Awusah pre-quest + * @author ceik + */ +@InitializablePlugin +public class Awusah extends DialoguePlugin { + //TODO: Add dialogue for after the quest Spirits of Elid + public Awusah(){ + /** + * Empty + */ + } + public Awusah(Player player){ + super(player); + } + + @Override + public DialoguePlugin newInstance(Player player){return new Awusah(player);} + + @Override + public boolean open(Object... args){ + interpreter.sendDialogue("The mayor doesn't seem interested in talking to you right now."); + return true; + } + + @Override + public boolean handle(int interfaceId, int buttonId){ + switch(stage){ + case 0: + end(); + break; + } + return true; + } + public int[] getIds() {return new int[] {3040};} +} diff --git a/Server/src/plugin/interaction/city/nardah/Ghaslor.java b/Server/src/plugin/interaction/city/nardah/Ghaslor.java new file mode 100644 index 000000000..88c83375b --- /dev/null +++ b/Server/src/plugin/interaction/city/nardah/Ghaslor.java @@ -0,0 +1,44 @@ +package plugin.interaction.city.nardah; + +import org.crandor.game.content.dialogue.DialoguePlugin; +import org.crandor.game.node.entity.player.Player; +import org.crandor.plugin.InitializablePlugin; + +/** + * Handles Ghaslor dialogue + * @author ceik + */ + +//TODO: Add post-quest dialogue +@InitializablePlugin +public class Ghaslor extends DialoguePlugin { + public Ghaslor(){ + /** + * empty + */ + } + public Ghaslor(Player player){ + super(player); + } + + @Override + public DialoguePlugin newInstance(Player player){return new Ghaslor(player);} + + @Override + public boolean open(Object... args){ + String gender = player.isMale() ? "gentleman" : "lady"; + npc("Good day young " + gender); + return true; + } + + @Override + public boolean handle(int interfaceId, int buttonId){ + switch(stage) { + case 0: + end(); + break; + } + return true; + } + public int[] getIds() {return new int[] {3029};} +} diff --git a/Server/src/plugin/interaction/city/nardah/Kazemde.java b/Server/src/plugin/interaction/city/nardah/Kazemde.java new file mode 100644 index 000000000..2bac87ae3 --- /dev/null +++ b/Server/src/plugin/interaction/city/nardah/Kazemde.java @@ -0,0 +1,85 @@ +package plugin.interaction.city.nardah; + +import org.crandor.cache.def.impl.NPCDefinition; +import org.crandor.game.content.dialogue.DialoguePlugin; +import org.crandor.game.interaction.OptionHandler; +import org.crandor.game.node.Node; +import org.crandor.game.node.entity.npc.NPC; +import org.crandor.game.node.entity.player.Player; +import org.crandor.plugin.InitializablePlugin; +import org.crandor.plugin.Plugin; + +/** + * Handles Kazemde, who runs the general store in Nardah. + * @author ceik + */ + +@InitializablePlugin +public class Kazemde extends OptionHandler { + public final int NPC_ID = 3039; + + @Override + public Plugin newInstance(Object arg) throws Throwable { + new KazemdeDialogue().init(); + NPCDefinition.forId(NPC_ID).getConfigurations().put("option:trade",this); + NPCDefinition.forId(NPC_ID).getConfigurations().put("option:talk-to",this); + return this; + } + + @Override + public final boolean handle(Player player, Node node, String string){ + NPC npc = node.asNpc(); + switch(string){ + case "trade": + npc.openShop(player); + break; + case "talk-to": + player.getDialogueInterpreter().open(NPC_ID); + break; + } + return true; + } + + final class KazemdeDialogue extends DialoguePlugin { + public KazemdeDialogue(){ + /** + * Empty + */ + } + public KazemdeDialogue(Player player){ + super(player); + } + + @Override + public DialoguePlugin newInstance(Player player){return new KazemdeDialogue(player);} + + @Override + public boolean open(Object... args){ + npc("Hello, and welcome to my shop."); + return true; + } + + @Override + public boolean handle(int interfaceId, int buttonId){ + switch(stage){ + case 0: + interpreter.sendOptions("Select one","Let me see what you have.","Goodbye."); + stage++; + break; + case 1: + switch(buttonId){ + case 1: + end(); + NPC Kazemde = new NPC(NPC_ID); + Kazemde.openShop(player); + break; + case 2: + end(); + break; + } + } + return true; + } + public int[] getIds() {return new int[] {NPC_ID};} + } +} diff --git a/Server/src/plugin/interaction/city/nardah/Rokuh.java b/Server/src/plugin/interaction/city/nardah/Rokuh.java new file mode 100644 index 000000000..7e2ae1d8c --- /dev/null +++ b/Server/src/plugin/interaction/city/nardah/Rokuh.java @@ -0,0 +1,103 @@ +package plugin.interaction.city.nardah; + +import org.crandor.cache.def.impl.NPCDefinition; +import org.crandor.game.content.dialogue.DialoguePlugin; +import org.crandor.game.interaction.OptionHandler; +import org.crandor.game.node.Node; +import org.crandor.game.node.entity.npc.NPC; +import org.crandor.game.node.entity.player.Player; +import org.crandor.plugin.InitializablePlugin; +import org.crandor.plugin.Plugin; + +/** + * Handles Rokuh, who runs the Nardah chocolate stall + * @author ceik + */ + +@InitializablePlugin +public class Rokuh extends OptionHandler { + public final int NPC_ID = 3045; + + @Override + public Plugin newInstance(Object arg) throws Throwable { + new RokuhDialogue().init(); + NPCDefinition.forId(NPC_ID).getConfigurations().put("option:trade",this); + NPCDefinition.forId(NPC_ID).getConfigurations().put("option:talk-to",this); + return this; + } + + @Override + public final boolean handle(Player player, Node node, String string){ + NPC npc = node.asNpc(); + switch(string){ + case "trade": + npc.openShop(player); + break; + case "talk-to": + player.getDialogueInterpreter().open(NPC_ID); + break; + } + return true; + } + + final class RokuhDialogue extends DialoguePlugin { + public RokuhDialogue(){ + /** + * Empty + */ + } + public RokuhDialogue(Player player){ + super(player); + } + @Override + public DialoguePlugin newInstance(Player player){return new RokuhDialogue(player);} + + @Override + public boolean open(Object... args){ + npc("Come one, come all, buy my amazing choc ice invention here!","Chocolate on the outside. Iced cream on the inside.","Oh I also have some chocolate left over from making","choc ices which I'm selling too."); + return true; + } + + @Override + public boolean handle(int interfaceId, int buttonId){ + switch(stage) { + case 0: + //TODO: Add more options after Spirit of the Elid. + interpreter.sendOptions("Select one", "Cool I'd like to buy some", "No thanks, I'm not interested.", "How do you stop your icy snacks melting?"); + stage++; + break; + case 1: + switch(buttonId){ + case 1: + end(); + NPC Rokuh = new NPC(NPC_ID); + Rokuh.openShop(player); + break; + case 2: + player("No thanks, I'm not interested"); + stage = 10; + break; + case 3: + player("How do you stop your icy snacks melting?","The middle of the desert is the last place I'd expect to see ice."); + stage++; + break; + } + break; + case 2: + npc("It's quite a surprise, isn't it, my friend. I actually have this","special magic box of ice, which I bought for a princely sum","from a strange man while adventuring in lands far away","He said it is imbued with some sort of"); + stage++; + break; + case 3: + npc("powerful ice magic which keeps it cold all the time. I had","never seen any ice magic before, it's clearly very rare","and powerful, so I felt I had to buy it."); + stage = 10; + break; + case 10: + end(); + break; + } + return true; + } + @Override + public int[] getIds() {return new int[]{NPC_ID};} + } +} diff --git a/Server/src/plugin/interaction/city/nardah/Seddu.java b/Server/src/plugin/interaction/city/nardah/Seddu.java new file mode 100644 index 000000000..72108d20e --- /dev/null +++ b/Server/src/plugin/interaction/city/nardah/Seddu.java @@ -0,0 +1,60 @@ +package plugin.interaction.city.nardah; + +import org.crandor.game.content.dialogue.DialoguePlugin; +import org.crandor.game.node.entity.npc.NPC; +import org.crandor.game.node.entity.player.Player; +import org.crandor.plugin.InitializablePlugin; + +/** + * Added some dialogue for Seddu + * @author ceik + */ + +@InitializablePlugin +public class Seddu extends DialoguePlugin { + public Seddu(){ + /** + * Empty + */ + } + public Seddu(Player player){ + super(player); + } + + @Override + public DialoguePlugin newInstance(Player player){return new Seddu(player);} + + @Override + public boolean open(Object... args){ + npc("I buy and sell adventurer's equipment, do you want to trade?"); + return true; + } + + @Override + public boolean handle(int interfaceId, int buttonId){ + switch(stage){ + case 0: + interpreter.sendOptions("Select one","Yes, please","No, thanks"); + stage++; + break; + case 1: + switch(buttonId){ + case 1: + end(); + NPC seddu = new NPC(3038); + seddu.openShop(player); + break; + case 2: + player("No, thanks."); + stage++; + break; + case 3: + end(); + break; + } + break; + } + return true; + } + public int[] getIds(){return new int[] {3038};} +}