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

@@ -1,31 +1,32 @@
var ticket = new Array(4031047, 4031074, 4031331, 4031576);
var cost = new Array(5000, 6000, 30000, 6000);
var mapNames = new Array("Ellinia of Victoria Island", "Ludibrium", "Leafre", "Ariant");
var mapName2 = new Array("Ellinia of Victoria Island", "Ludibrium", "Leafre of Minar Forest", "Nihal Desert");
var ticket = [4031047, 4031074, 4031331, 4031576];
var cost = [5000, 6000, 30000, 6000];
var mapNames = ["Ellinia of Victoria Island", "Ludibrium", "Leafre", "Ariant"];
var mapName2 = ["Ellinia of Victoria Island", "Ludibrium", "Leafre of Minar Forest", "Nihal Desert"];
var select;
var status = 0;
function start() {
var where = "Hello, I'm in charge of selling tickets for the ship ride for every destination. Which ticket would you like to purchase?";
for (var i = 0; i < ticket.length; i++)
for (var i = 0; i < ticket.length; i++) {
where += "\r\n#L" + i + "##b" + mapNames[i] + "#k#l";
}
cm.sendSimple(where);
}
function action(mode, type, selection) {
if(mode < 1) {
if (mode < 1) {
cm.dispose();
} else {
status++;
if (status == 1) {
select = selection;
cm.sendYesNo("The ride to " + mapName2[select] + " takes off every " + (select == 0 ? 15 : 10) + " minutes, beginning on the hour, and it'll cost you #b"+cost[select]+" mesos#k. Are you sure you want to purchase #b#t"+ticket[select]+"##k?");
} else if(status == 2) {
if (cm.getMeso() < cost[select] || !cm.canHold(ticket[select]))
cm.sendOk("Are you sure you have #b"+cost[select]+" mesos#k? If so, then I urge you to check you etc. inventory, and see if it's full or not.");
else {
cm.sendYesNo("The ride to " + mapName2[select] + " takes off every " + (select == 0 ? 15 : 10) + " minutes, beginning on the hour, and it'll cost you #b" + cost[select] + " mesos#k. Are you sure you want to purchase #b#t" + ticket[select] + "##k?");
} else if (status == 2) {
if (cm.getMeso() < cost[select] || !cm.canHold(ticket[select])) {
cm.sendOk("Are you sure you have #b" + cost[select] + " mesos#k? If so, then I urge you to check you etc. inventory, and see if it's full or not.");
} else {
cm.gainMeso(-cost[select]);
cm.gainItem(ticket[select],1);
cm.gainItem(ticket[select], 1);
}
cm.dispose();
}