var status = 0;
var maps = Array(240050400, 801040100, 211042300, 801040003,220080000, 220080000, 800020130, 682000001, 240020401, 240020101, 105090900, 105070002, 100000005);
var cost = Array(1000000, 950000, 900000, 850000, 800000, 750000, 500000, 400000, 300000, 300000, 200000, 100000, 70000);
var costBeginner = Array(100000, 95000, 90000, 85000, 80000, 75000, 50000, 40000, 30000, 30000, 20000, 10000, 7000);
var selectedMap = -1;
var job;
importPackage(net.sf.odinms.client);
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (status >= 2 && mode == 0) {
cm.sendOk("Alright, see you next time.");
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendNext("Hey I am Amos the strong the #bBoss Warper#k of #rAkatsukiMs#k, You always can find me in the Free Market!");
} else if (status == 1) {
cm.sendNextPrev("I can take you to many bosses for just a small fee.")
} else if (status == 2) {
var selStr = "Select your destination.#b";
if (cm.getJob().equals(net.sf.odinms.client.MapleJob. BEGINNER)) {
for (var i = 0; i < maps.length; i++) {
selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + costBeginner[i] + " meso)#l";
}
} else {
for (var i = 0; i < maps.length; i++) {
selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + cost[i] + " meso)#l";
}
}
cm.sendSimple(selStr);
} else if (status == 3) {
if (cm.getJob().equals(net.sf.odinms.client.MapleJob. BEGINNER)) {
if (cm.getMeso() < costBeginner[selection]) {
cm.sendOk("You do not have enough mesos.")
cm.dispose();
} else {
cm.sendYesNo("So you have nothing left to do here? Do you want to go to #m" + maps[selection] + "#?");
selectedMap = selection;
}
}
else {
if (cm.getMeso() < cost[selection]) {
cm.sendOk("You do not have enough mesos.")
cm.dispose();
} else {
cm.sendYesNo("So you have nothing left to do here? Do you want to go to #m" + maps[selection] + "#?");
selectedMap = selection;
}
}
} else if (status == 4) {
if (cm.getJob().equals(net.sf.odinms.client.MapleJob. BEGINNER)) {
cm.gainMeso(-costBeginner[selectedMap]);
}
else {
cm.gainMeso(-cost[selectedMap]);
}
cm.warp(maps[selectedMap], 0);
cm.dispose();
}
}
}