forked from 2009Scape/Server
Rebase with upstream
This commit is contained in:
commit
101b8314c9
2889 changed files with 481914 additions and 0 deletions
82
09HDscape-server/src/plugin/dialogue/GerrantDialogue.java
Normal file
82
09HDscape-server/src/plugin/dialogue/GerrantDialogue.java
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
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 dialogue plugin used for the gerrant npc.
|
||||
* @author 'Vexia
|
||||
* @version 1.0
|
||||
*/
|
||||
@InitializablePlugin
|
||||
public final class GerrantDialogue extends DialoguePlugin {
|
||||
|
||||
/**
|
||||
* Constructs a new {@code GerrantDialogue} {@code Object}.
|
||||
*/
|
||||
public GerrantDialogue() {
|
||||
/**
|
||||
* empty.
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code GerrantDialogue} {@code Object}.
|
||||
* @param player the player.
|
||||
*/
|
||||
public GerrantDialogue(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialoguePlugin newInstance(Player player) {
|
||||
return new GerrantDialogue(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
interpreter.sendDialogues(npc, FacialExpression.NORMAL, "Welcome! You can buy fishing equipment at my store.", "We'll also buy anything you catch off you.");
|
||||
stage = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(int interfaceId, int buttonId) {
|
||||
switch (stage) {
|
||||
case 0:
|
||||
interpreter.sendOptions("Choose an option:", "Let's see what you've got then.", "Sorry, I'm not interested.");
|
||||
stage = 1;
|
||||
break;
|
||||
case 1:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
interpreter.sendDialogues(player, FacialExpression.NORMAL, "Let's see what you've got then.");
|
||||
stage = 10;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(player, FacialExpression.NORMAL, "Sorry, I'm not interested.");
|
||||
stage = 20;
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
end();
|
||||
npc.openShop(player);
|
||||
break;
|
||||
case 20:
|
||||
end();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIds() {
|
||||
return new int[] { 558 };
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue