Files
sweetgum-server/scripts/npc/9201057.js
ronancpl 7f178a3d80 Multi World NPCs + patch on Player interactions
Made NPCs now work properly on multiworld system. Solved multiple issues
regarding Player Shops not giving back items properly when owner exits.
Added restriction on changing channels at FM rooms, preventing shop
owner entering Cash Shop.
2017-05-28 22:11:39 -03:00

29 lines
1.3 KiB
JavaScript

function start() {
if (cm.c.getPlayer().getMapId() == 103000100 || cm.c.getPlayer().getMapId() == 600010001)
cm.sendYesNo("The ride to " + (cm.c.getPlayer().getMapId() == 103000100 ? "New Leaf City of Masteria" : "Kerning City of Victoria Island") + " takes off every minute, beginning on the hour, and it'll cost you #b5000 mesos#k. Are you sure you want to purchase #b#t" + (4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000)) + "##k?");
else if (cm.c.getPlayer().getMapId() == 600010002 || cm.c.getPlayer().getMapId() == 600010004)
cm.sendYesNo("Do you want to leave before the train start? There will be no refund.");
}
function action(mode, type, selection) {
if(mode != 1){
cm.dispose();
return;
}
if (cm.c.getPlayer().getMapId() == 103000100 || cm.c.getPlayer().getMapId() == 600010001){
var item = 4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000);
if(!cm.canHold(item)) {
cm.sendNext("You don't have a etc. slot available.");
}
else if(cm.getMeso() >= 5000){
cm.gainMeso(-5000);
cm.gainItem(item, 1);
cm.sendNext("There you go.");
}else
cm.sendNext("You don't have enough mesos.");
}else{
cm.warp(cm.c.getPlayer().getMapId() == 600010002 ? 600010001 : 103000100);
}
cm.dispose();
}