From d8fb088e281ea13e29cd0d121d8646dc4feb0b7b Mon Sep 17 00:00:00 2001 From: Ceikry Date: Tue, 10 Mar 2020 15:33:54 -0500 Subject: [PATCH] Added more dialogue to the Guardian Mummy --- .../pyramidplunder/GuardMummyDialogue.java | 82 ++++++++++++++++--- .../pyramidplunder/PyramidOptionHandler.java | 28 ++++++- 2 files changed, 95 insertions(+), 15 deletions(-) diff --git a/Server/src/plugin/activity/pyramidplunder/GuardMummyDialogue.java b/Server/src/plugin/activity/pyramidplunder/GuardMummyDialogue.java index 74cc0efd4..b823f261f 100644 --- a/Server/src/plugin/activity/pyramidplunder/GuardMummyDialogue.java +++ b/Server/src/plugin/activity/pyramidplunder/GuardMummyDialogue.java @@ -7,26 +7,22 @@ import org.crandor.game.node.entity.player.Player; /** * Handles Guardian mummy dialogue. - * @author Emperor + * @author Originally Emperor, completely redone by Ceikry. */ public final class GuardMummyDialogue extends DialoguePlugin { /** * If the player successfully caught the evil twin. + * Will remain unused until the quest is implemented. (if ever) */ - private int type; + //private int type; - /** - * Constructs a new {@code GuardMummyDialogue} {@code Object}. - */ - public GuardMummyDialogue() { - super(); - } /** * Constructs a new {@code GuardMummyDialogue} {@code Object}. * @param player The player. */ + public GuardMummyDialogue() {super();} public GuardMummyDialogue(Player player) { super(player); } @@ -39,18 +35,78 @@ public final class GuardMummyDialogue extends DialoguePlugin { @Override public boolean open(Object... args) { npc = (NPC) args[0]; - type = args.length == 1 ? 0 : (Integer) args[1]; + if(args.length > 1){ + switch((int) args[1]){ + case 0: + npc("You! How did you get into this place?"); + stage = 50; + break; + case 1: + player("I know what I'm doing - let's get on with it."); + stage = 10; + break; + } + } else { + npc("Errr"); + } + /*type = args.length == 1 ? 0 : (Integer) args[1]; if (type == 1) { player("I know what I'm doing - let's get on with it."); } else { - System.out.println("TODO:1"); - } + npc("You! How did you get in?"); + }*/ return true; } @Override public boolean handle(int interfaceId, int buttonId) { - switch (stage++) { + switch(stage){ + case 10: + npc("Fine, I'll take you to the first room now..."); + stage = 60; + break; + case 50: + player("I could ask you the same thing."); + stage = 51; + break; + case 51: + npc("Nevermind that. I suppose since you're here I can tell", "you how to play."); + stage = 52; + break; + case 52: + npc("In each room there are urns, a chest, and a sarcophagus."); + stage = 53; + break; + case 53: + npc("The urns contain artifacts based on the room that you are","currently in. The chest contains valuable artifacts but is","sometimes trapped. The sarcophagus has one of my","brothers in it. And lots of artifacts."); + stage = 54; + break; + case 54: + player("Anything else I should know?"); + stage = 55; + break; + case 55: + npc("Yes, each room requires more thieving knowledge than the"," last. And be careful not to die."); + stage = 56; + break; + case 56: + player("Oh, yes, dying. Not good. Well I suppose that covers it?"); + stage = 57; + break; + case 57: + npc("Yep."); + stage = 58; + break; + case 58: + end(); + break; + case 60: + end(); + ActivityManager.start(player, "Pyramid plunder", false); + break; + + } + /*switch (stage++) { case 0: if (type == 1) { npc("Fine, I'll take you to the first room now..."); @@ -66,7 +122,7 @@ public final class GuardMummyDialogue extends DialoguePlugin { System.out.println("TODO:3"); } return true; - } + }*/ return false; } diff --git a/Server/src/plugin/activity/pyramidplunder/PyramidOptionHandler.java b/Server/src/plugin/activity/pyramidplunder/PyramidOptionHandler.java index 41cf7b846..fe9eda57b 100644 --- a/Server/src/plugin/activity/pyramidplunder/PyramidOptionHandler.java +++ b/Server/src/plugin/activity/pyramidplunder/PyramidOptionHandler.java @@ -8,7 +8,10 @@ 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.game.node.object.GameObject; +import org.crandor.game.system.task.Pulse; +import org.crandor.game.world.GameWorld; import org.crandor.game.world.map.Location; +import org.crandor.game.world.update.flag.context.Animation; import org.crandor.plugin.Plugin; import org.crandor.tools.RandomFunction; @@ -51,6 +54,7 @@ public final class PyramidOptionHandler extends OptionHandler { ObjectDefinition.forId(16458).getConfigurations().put("option:leave tomb", this); ObjectDefinition.forId(16459).getConfigurations().put("option:leave tomb", this); NPCDefinition.forId(4476).getConfigurations().put("option:start-minigame", this); + NPCDefinition.forId(4476).getConfigurations().put("option:talk-to",this); return null; } @@ -59,6 +63,7 @@ public final class PyramidOptionHandler extends OptionHandler { if (node instanceof GameObject) { Location destination = EMPTY_ROOM; GameObject object = (GameObject) node; + boolean willBePushed = (RandomFunction.random(10) > 3); if (object.getId() == 16458 || object.getId() == 16459) { ClimbActionHandler.climb(player, ClimbActionHandler.CLIMB_UP, Location.create(3288, 2801, 0)); return true; @@ -75,9 +80,28 @@ public final class PyramidOptionHandler extends OptionHandler { } player.getConfigManager().set(704, value); player.getPacketDispatch().sendMessage("You use your thieving skills to search the stone panel."); - ClimbActionHandler.climb(player, ClimbActionHandler.CLIMB_UP, destination, "You find a door! You open it."); + if(entrance == currentEntrance && willBePushed){ + player.lock(); + player.animate(new Animation(7299)); + player.getImpactHandler().setDisabledTicks(4); + GameWorld.submit(new Pulse(4, player) { + @Override + public boolean pulse() { + player.unlock(); + player.getAnimator().reset(); + return true; + } + }); + } else { + ClimbActionHandler.climb(player, ClimbActionHandler.CLIMB_UP, destination, "You find a door! You open it."); + } + //ClimbActionHandler.climb(player, ClimbActionHandler.CLIMB_UP, destination, "You find a door! You open it."); } else if (node instanceof NPC) { - player.getDialogueInterpreter().open(node.getId(), node, 1); + if (option.equals("talk-to")) { + player.getDialogueInterpreter().open(node.getId(), node, 0); + } else { + player.getDialogueInterpreter().open(node.getId(), node, 1); + } } return true; }