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

@@ -37,57 +37,56 @@ var curMap, stage;
function start() {
curMap = cm.getMapId();
stage = Math.floor((curMap - 922010100) / 100) + 1;
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else if (mode == 0){
cm.dispose();
if (mode == -1) {
cm.dispose();
} else if (mode == 0) {
cm.dispose();
} else {
if (mode == 1) {
status++;
} else {
if (mode == 1)
status++;
else
status--;
var eim = cm.getPlayer().getEventInstance();
if(eim.getProperty(stage.toString() + "stageclear") != null) {
cm.sendNext("Hurry, goto the next stage, the portal is open!");
}
else {
if (eim.isEventLeader(cm.getPlayer())) {
var state = eim.getIntProperty("statusStg" + stage);
if(state == -1) { // preamble
cm.sendOk("Hi. Welcome to the #bBOSS stage#k. Kill the Ratz on that platform to reveal the Alishar, and defeat him!");
eim.setProperty("statusStg" + stage, 0);
}
else { // check stage completion
if (cm.haveItem(4001023, 1)) {
cm.gainItem(4001023, -1);
eim.setProperty("statusStg" + stage, 1);
var list = eim.getClearStageBonus(stage); // will give bonus exp & mesos to everyone in the event
eim.giveEventPlayersExp(list.get(0));
eim.giveEventPlayersMeso(list.get(1));
eim.setProperty(stage + "stageclear", "true");
eim.showClearEffect(true);
eim.clearPQ();
} else {
cm.sendNext("Please defeat Alishar and bring me his #b#t4001023#.#k");
}
}
} else {
cm.sendNext("Please tell your #bParty-Leader#k to come talk to me.");
}
}
cm.dispose();
status--;
}
var eim = cm.getPlayer().getEventInstance();
if (eim.getProperty(stage.toString() + "stageclear") != null) {
cm.sendNext("Hurry, goto the next stage, the portal is open!");
} else {
if (eim.isEventLeader(cm.getPlayer())) {
var state = eim.getIntProperty("statusStg" + stage);
if (state == -1) { // preamble
cm.sendOk("Hi. Welcome to the #bBOSS stage#k. Kill the Ratz on that platform to reveal the Alishar, and defeat him!");
eim.setProperty("statusStg" + stage, 0);
} else { // check stage completion
if (cm.haveItem(4001023, 1)) {
cm.gainItem(4001023, -1);
eim.setProperty("statusStg" + stage, 1);
var list = eim.getClearStageBonus(stage); // will give bonus exp & mesos to everyone in the event
eim.giveEventPlayersExp(list.get(0));
eim.giveEventPlayersMeso(list.get(1));
eim.setProperty(stage + "stageclear", "true");
eim.showClearEffect(true);
eim.clearPQ();
} else {
cm.sendNext("Please defeat Alishar and bring me his #b#t4001023#.#k");
}
}
} else {
cm.sendNext("Please tell your #bParty-Leader#k to come talk to me.");
}
}
cm.dispose();
}
}