Files
sweetgum-server/scripts/npc/1052007.js
ronancpl ba6b5bc191 Crafters & keybinding & commands fix + updated MobBook info
Fixed player receiving DOT even if protected on Orbis Tower <B2>, added
HPbar on Rombot, fixed keybinding issue with clashing skill-item id's,
fixed some mischeckings on NPC crafters, fixed "travelling events"
sending players to random spawnpoints when arriving, fixed hair&face
commands, fixed dispel effect not showing to others, updated drop data
on mobbook.
2017-08-18 19:35:23 -03:00

88 lines
3.3 KiB
JavaScript

var status = 0;
var ticketSelection = -1;
var text = "Here's the ticket reader.";
var hasTicket = false;
var NLC = false;
var em;
function start() {
cm.sendSimple("Pick your destination.\n\r\n#L0##bKerning Square Shopping Center#l\n\n\r\n#L1#Enter Contruction Site#l\r\n#L2#New Leaf City#l");
}
function action(mode, type, selection) {
em = cm.getEventManager("Subway");
if (mode == -1) {
cm.dispose();
return;
} else if (mode == 0) {
cm.dispose();
return;
} else {
status++;
}
if (status == 1) {
if (selection == 0) {
var train = cm.getEventManager("KerningTrain");
train.newInstance("KerningTrain");
train.setProperty("player", cm.getPlayer().getName());
train.startInstance(cm.getPlayer());
cm.dispose();
return;
} else if (selection == 1) {
if (cm.haveItem(4031036) || cm.haveItem(4031037) || cm.haveItem(4031038)) {
text += " You will be brought in immediately. Which ticket you would like to use?#b";
for (var i = 0; i < 3; i++) {
if (cm.haveItem(4031036 + i)) {
text += "\r\n#b#L" + (i + 1) + "##t" + (4031036 + i) +"#";
}
}
cm.sendSimple(text);
hasTicket = true;
} else {
cm.sendOk("It seems as though you don't have a ticket!");
cm.dispose();
return;
}
} else if (selection == 2) {
if (!cm.haveItem(4031711) && cm.getPlayer().getMapId() == 103000100) {
cm.sendOk("It seems you don't have a ticket! You can buy one from Bell.");
cm.dispose();
return;
}
if (em.getProperty("entry") == "true") {
cm.sendYesNo("It looks like there's plenty of room for this ride. Please have your ticket ready so I can let you in. The ride will be long, but you'll get to your destination just fine. What do you think? Do you want to get on this ride?");
} else {
cm.sendNext("We will begin boarding 1 minute before the takeoff. Please be patient and wait for a few minutes. Be aware that the subway will take off right on time, and we stop receiving tickets 1 minute before that, so please make sure to be here on time.");
cm.dispose();
return;
}
}
} else if (status == 2) {
if (hasTicket) {
ticketSelection = selection;
if (ticketSelection > -1) {
cm.gainItem(4031035 + ticketSelection, -1);
cm.warp(103000897 + (ticketSelection * 3));
hasTicket = false;
cm.dispose();
return;
}
}
if (cm.haveItem(4031711)) {
if(em.getProperty("entry") == "false") {
cm.sendNext("We will begin boarding 1 minute before the takeoff. Please be patient and wait for a few minutes. Be aware that the subway will take off right on time, and we stop receiving tickets 1 minute before that, so please make sure to be here on time.");
}
else {
cm.gainItem(4031711, -1);
cm.warp(600010004);
}
cm.dispose();
return;
}
}
}