Files
sweetgum-server/scripts/npc/2060009.js
ronancpl 1ffcf47f79 AmoriaPQ + ItemSort fix + revamped GMShop
Implemented AmoriaPQ. Fixed an issue with ItemIdSortHandler where empty
vectors given to the sorting module would cause an exception thrown,
wiping players inventory items. Thanks to Vcoc, revamped shop data for
GMShop (shop id 1337). Mount quest for explorers now uses event script.
2017-09-15 21:32:15 -03:00

52 lines
1.8 KiB
JavaScript

var status = 0;
var menu;
var payment = false;
var atHerbTown = false;
function start() {
if(cm.getPlayer().getMap().getId() == 251000100)atHerbTown = true;
if (cm.haveItem(4031242)){
if(atHerbTown)
menu = "#L0##bI will use #t4031242##k to move to #b#m230030200##k.#l\r\n#L1#Go to #b#m230000000##k after paying #b10000mesos#k.#l";
else
menu = "#L0##bI will use #t4031242##k to move to #b#m230030200##k.#l\r\n#L1#Go to #b#m251000000##k after paying #b10000mesos#k.#l";
}else {
if(atHerbTown)
menu = "#L0#Go to #b#m230030200##k after paying #b1000mesos#k.#l\r\n#L1#Go to #b#m230000000##k after paying #b10000mesos#k.#l";
else
menu = "#L0#Go to #b#m230030200##k after paying #b1000mesos#k.#l\r\n#L1#Go to #b#m251000000##k after paying #b10000mesos#k.#l";
payment = true;
}
cm.sendSimple ("Ocean are all connected to each other. Place you can't reach by foot can easily reached oversea. How about taking #bDolphin Taxi#k with us today?\r\n"+menu);
}
function action(mode, type, selection) {
if (mode < 1)
cm.dispose();
else {
if (selection == 0) {
if(payment) {
if(cm.getPlayer().getMeso() < 1000) {
cm.sendOk("I don't think you have enough money...");
cm.dispose();
} else
cm.gainMeso(-1000);
} else
cm.gainItem(4031242,-1);
cm.warp(230030200, 2);
cm.dispose();
return;
} else if (selection == 1) {
if (cm.getPlayer().getMeso() < 10000) {
cm.sendOk("I don't think you have enough money...");
cm.dispose();
return;
}else{
cm.gainMeso(-10000);
cm.warp(atHerbTown ? 230000000 : 251000100);
}
}
cm.dispose();
}
}