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

@@ -20,69 +20,69 @@
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Kerny - Pilot
-- By ---------------------------------------------------------------------------------------------
Information
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Information
2.0 - Second Version by Jayd
---------------------------------------------------------------------------------------------------
**/
-- Odin JavaScript --------------------------------------------------------------------------------
Kerny - Pilot
-- By ---------------------------------------------------------------------------------------------
Information
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Information
2.0 - Second Version by Jayd
---------------------------------------------------------------------------------------------------
**/
var k2s;
var airport;
var s2k;
function start() {
status = -1;
action(1, 0, 0);
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if(mode == -1) {
cm.dispose();
return;
}
if(mode == 1) {
status++;
}
if(mode == 0) {
if (cm.getMapId() == 540010101) {
cm.sendOk("Please hold on for a sec, and we're reaching Singapore! Thanks for your patience.");
cm.dispose();
return;
} else {
cm.sendOk("Please hold on for a sec, and we're reaching Kerning City! Thanks for your patience.");
cm.dispose();
return;
}
}
if(status == 0) {
if (cm.getMapId() == 540010001) {
cm.sendYesNo("The plane is taking off soon, are you sure you want to leave now? The ticket is not refundable.");
airport = 1;
} else if (cm.getMapId() == 540010002) {
cm.sendOk("We're reaching Kerning City in a minute, please sit down and wait.");
cm.dispose();
s2k = 1;
} else if (cm.getMapId() == 540010101) {
cm.sendOk("We're reaching Singapore in a minute, please sit down and wait.");
cm.dispose();
k2s = 1;
}
} else if(status == 1) {
if (k2s == 1) {
cm.warp(103000000);
cm.sendOk("Hope to see you again soon!");
cm.dispose();
} else if (airport == 1) {
cm.warp(540010000);
cm.sendOk("Hope to see you again soon!");
cm.dispose();
} else if (s2k == 1) {
cm.warp(540010000);
cm.sendOk("Hope to see you again soon!");
cm.dispose();
}
}
if (mode == -1) {
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
if (mode == 0) {
if (cm.getMapId() == 540010101) {
cm.sendOk("Please hold on for a sec, and we're reaching Singapore! Thanks for your patience.");
cm.dispose();
return;
} else {
cm.sendOk("Please hold on for a sec, and we're reaching Kerning City! Thanks for your patience.");
cm.dispose();
return;
}
}
if (status == 0) {
if (cm.getMapId() == 540010001) {
cm.sendYesNo("The plane is taking off soon, are you sure you want to leave now? The ticket is not refundable.");
airport = 1;
} else if (cm.getMapId() == 540010002) {
cm.sendOk("We're reaching Kerning City in a minute, please sit down and wait.");
cm.dispose();
s2k = 1;
} else if (cm.getMapId() == 540010101) {
cm.sendOk("We're reaching Singapore in a minute, please sit down and wait.");
cm.dispose();
k2s = 1;
}
} else if (status == 1) {
if (k2s == 1) {
cm.warp(103000000);
cm.sendOk("Hope to see you again soon!");
cm.dispose();
} else if (airport == 1) {
cm.warp(540010000);
cm.sendOk("Hope to see you again soon!");
cm.dispose();
} else if (s2k == 1) {
cm.warp(540010000);
cm.sendOk("Hope to see you again soon!");
cm.dispose();
}
}
}