From e89d43bf24593bae45c6209f23baa709e4a88511 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Thu, 12 Mar 2020 11:23:27 -0500 Subject: [PATCH] Added Sphinx dialogue --- .../city/sophanem/SphinxDialogue.java | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 Server/src/plugin/interaction/city/sophanem/SphinxDialogue.java diff --git a/Server/src/plugin/interaction/city/sophanem/SphinxDialogue.java b/Server/src/plugin/interaction/city/sophanem/SphinxDialogue.java new file mode 100644 index 000000000..baaba9160 --- /dev/null +++ b/Server/src/plugin/interaction/city/sophanem/SphinxDialogue.java @@ -0,0 +1,109 @@ +package plugin.interaction.city.sophanem; + +import org.crandor.cache.def.impl.NPCDefinition; +import org.crandor.game.content.dialogue.DialoguePlugin; +import org.crandor.game.content.dialogue.FacialExpression; +import org.crandor.game.node.entity.npc.NPC; +import org.crandor.game.node.entity.player.Player; +import org.crandor.plugin.InitializablePlugin; + +@InitializablePlugin +public final class SphinxDialogue extends DialoguePlugin { + public SphinxDialogue() { + /** + * Empty + */ + } + public SphinxDialogue(Player player){super(player);} + + @Override + public DialoguePlugin newInstance(Player player) { + return new SphinxDialogue(player); + } + + @Override + public boolean open(Object... args){ + npc = (NPC) args[0]; + if(player.getFamiliarManager().hasPet() && player.getFamiliarManager().getFamiliar().getId() >= 761 && player.getFamiliarManager().getFamiliar().getId() < 767){ + player("Good day."); + stage = 50; + } else { + player("Good day."); + stage = 0; + } + return true; + } + + @Override + public boolean handle(int interfaceId, int buttonId){ + switch(stage){ + case 0: + npc("You have the feel of a cat person","about you. Do you look after one?"); + stage = 1; + break; + case 1: + interpreter.sendOptions("Select one.","Yes, but I don't bring it to harsh places like this.","No, you are mistaken.","Yes, but I have left mine in the bank."); + stage = 2; + break; + case 2: + switch(buttonId){ + case 1: + player("Yes, but I don't bring it to harsh places like this."); + stage = 3; + break; + case 2: + player("No, you are mistaken."); + stage = 5; + break; + case 3: + player("Yes, but I have left mine in the bank."); + stage = 7; + break; + } + break; + case 3: + npc(FacialExpression.SAD,"A pity, they can be of great help in","some adventures. I would like to talk to","your cat. Would you bring it to me?"); + stage = 4; + break; + case 4: + player("I might, but I have a few things to sort out first."); + stage = 10; + break; + case 5: + npc(FacialExpression.SUSPICIOUS,"Really? I'm generally quite good at knowing","these things."); + stage = 10; + break; + case 7: + npc(FacialExpression.AFRAID,"What? That's no place for a cat!"); + stage = 10; + break; + case 10: + end(); + break; + case 50: + npc(FacialExpression.ANNOYED,"*ignores you*"); + stage = 51; + break; + case 51: + npc("Ah, how interesting... a cat. Come here to","me, kitty."); + stage = 52; + break; + case 52: + player.getFamiliarManager().getFamiliar().sendChat("Meow"); + stage = 53; + case 53: + player.getDialogueInterpreter().sendDialogue("The Sphinx and the cat have a chat."); + stage = 54; + break; + case 54: + //TODO : Add dialogue for quest-related bits after the quests are added, ends here for now. + end(); + break; + } + return true; + } + @Override + public int[] getIds() { + return new int[] { 1990 }; + } +}