Code:
package com.feather.game.player.dialogues;
import com.feather.Settings;
import com.feather.cache.parser.NPCDefinitions;
import com.feather.game.WorldTile;
import com.feather.game.player.content.Magic;
public class MrEx extends Dialogue {
private int npcId;
@Override
public void start() {
if (Settings.ECONOMY) {
player.getPackets().sendGameMessage("Mr.Ex is in no mood to talk to you.");
end();
return;
}
npcId = (Integer) parameters[0];
sendEntityDialogue(SEND_2_TEXT_CHAT,
new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
"Hello, I can teleport you all around DragonFall,",
" would you like to?" }, IS_NPC, npcId, 9827);
}
@Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), "Sure, why not." },
IS_PLAYER, player.getIndex(), 9827);
stage = 1;
}
else if (stage == 1) {
sendOptionsDialogue("What kind of teleports are you looking for?", "Skilling",
"Combat", "Minigames", "Other");
stage = 2;
}
else if (stage == 2) {
if (componentId == OPTION_1){ // Skilling
stage = 3;
sendOptionsDialogue("What would you like train?", "Thieving",
"Woodcutting", "Farming", "Agility", "Mining", "Next Page", "Back");
stage = 4;
}
else if (stage == 4){
if (componentId == OPTION_1) // Thieving
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2662, 3305, 0));
else if (componentId == OPTION_2){// Woodcutting
stage = 5;
sendOptionsDialogue("Where would you like to go?", "Draynor Willows", "Seer's Village Woodcutting");
}
else if(stage == 5){
if (componentId == OPTION_1)
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3086, 3233, 0));
else if (componentId == OPTION_2)
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2722, 3461, 0));
}
}
else if (componentId == OPTION_3){ // Farming
stage = 6;
sendOptionsDialogue("Where would you like to go?", "Catherby Farming", " ");
}
else if(stage == 6){
if (componentId == OPTION_1){
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2815, 3462, 0));
}
else if (componentId == OPTION_2){
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2722, 3461, 0)); // TODO
}
}
}
else if (componentId == OPTION_4){ // Agility
stage = 7;
sendOptionsDialogue("Where would you like to go?", "Barbarian", "Gnome Training");
}
else if(stage == 7){
if (componentId == OPTION_1){
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3094, 3502, 0)); // TODO Change coords
}
else if (componentId == OPTION_2){
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2474, 3437, 0));
}
}
if(componentId == OPTION_5){ // Mining
stage = 6;
sendOptionsDialogue("Where would you like to go?", "Desert Camp Mining", "Mining Guild");
}
if (stage == 6){
if(componentId == OPTION_1){
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3300, 3313, 0));
}
if(componentId == OPTION_2){
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3038, 9737, 0));
}
}
}
@Override
public void finish() {
}
}
Thanks for any feedback ^-^