Reformat and clean up npc scripts

This commit is contained in:
P0nk
2021-09-09 23:35:02 +02:00
parent 0c1545f81d
commit d893309b4f
665 changed files with 19932 additions and 19046 deletions

View File

@@ -5,11 +5,11 @@ var selectedMap = -1;
var mesos;
function start() {
if (cm.hasItem(4032313,1)) {
cm.sendNext("I see that you have a coupon to go to Henesys. One moment, I'll bring you there right over!");
} else {
cm.sendNext("Hello, I drive the Regular Cab. If you want to go from town to town safely and fast, then ride our cab. We'll glady take you to your destination with an affordable price.");
}
if (cm.hasItem(4032313, 1)) {
cm.sendNext("I see that you have a coupon to go to Henesys. One moment, I'll bring you there right over!");
} else {
cm.sendNext("Hello, I drive the Regular Cab. If you want to go from town to town safely and fast, then ride our cab. We'll glady take you to your destination with an affordable price.");
}
}
function action(mode, type, selection) {
@@ -24,41 +24,44 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
if (mode == 1)
if (mode == 1) {
status++;
else
} else {
status--;
}
if (status == 1) {
if (cm.hasItem(4032313,1)) {
if (cm.hasItem(4032313, 1)) {
cm.gainItem(4032313, -1);
cm.warp(maps[0], 0);
cm.dispose();
return;
}
var selStr = "";
if (cm.getJobId() == 0)
if (cm.getJobId() == 0) {
selStr += "We have a special 90% discount for beginners.";
}
selStr += "Choose your destination, for fees will change from place to place.#b";
for (var i = 0; i < maps.length; i++)
for (var i = 0; i < maps.length; i++) {
selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + (cm.getJobId() == 0 ? cost[i] / 10 : cost[i]) + " mesos)#l";
}
cm.sendSimple(selStr);
} else if (status == 2) {
cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k.");
cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b" + (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k.");
selectedMap = selection;
} else if (status == 3) {
if (cm.getJobId() == 0) {
mesos = cost[selectedMap] / 10;
mesos = cost[selectedMap] / 10;
} else {
mesos = cost[selectedMap];
mesos = cost[selectedMap];
}
if (cm.getMeso() < mesos) {
cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab.");
cm.dispose();
return;
}
cm.gainMeso(-mesos);
cm.warp(maps[selectedMap], 0);
cm.dispose();