Server/09HDscape-server/src/plugin/dialogue/MorrisDialogue.java
2019-05-28 22:15:17 -08:00

65 lines
1.4 KiB
Java

package plugin.dialogue;
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.plugin.InitializablePlugin;
import org.crandor.game.node.entity.player.Player;
/**
* Represents the morris dialogue plugin.
* @author 'Vexia
* @version 1.0
*/
@InitializablePlugin
public final class MorrisDialogue extends DialoguePlugin {
/**
* Constructs a new {@code MorrisDialogue} {@code Object}.
*/
public MorrisDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code MorrisDialogue} {@code Object}.
* @param player the player.
*/
public MorrisDialogue(Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new MorrisDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
interpreter.sendDialogues(player, FacialExpression.NORMAL, "What are you sitting around here for?");
stage = 0;
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
interpreter.sendDialogues(npc, FacialExpression.NORMAL, "I'm making sure only those with a competition pass enter", "the fishing contest.");
stage = 1;
break;
case 1:
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 227 };
}
}