Reformat and clean up npc scripts
This commit is contained in:
@@ -9,35 +9,35 @@ function start() {
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
status++;
|
||||
} else {
|
||||
if (status <= 1) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
status--;
|
||||
if (status <= 1) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
status--;
|
||||
}
|
||||
if (status == 0) {
|
||||
if(cm.getLevel() >= 20) {
|
||||
if (cm.getLevel() >= 20) {
|
||||
cm.sendOk("This training ground is available only for those under level 20.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
var selStr = "Would you like to go into the Training Center?";
|
||||
for (var i = 0; i < num; i++) {
|
||||
selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k";
|
||||
}
|
||||
cm.sendSimple(selStr);
|
||||
|
||||
var selStr = "Would you like to go into the Training Center?";
|
||||
for (var i = 0; i < num; i++) {
|
||||
selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k";
|
||||
}
|
||||
cm.sendSimple(selStr);
|
||||
} else if (status == 1) {
|
||||
if (selection < 0 || selection >= num) {
|
||||
cm.dispose();
|
||||
} else if (cm.getPlayerCount(map + selection) >= maxp) {
|
||||
cm.sendNext("This training center is full.");
|
||||
status = -1;
|
||||
} else {
|
||||
cm.warp(map + selection, 0);
|
||||
cm.dispose();
|
||||
}
|
||||
if (selection < 0 || selection >= num) {
|
||||
cm.dispose();
|
||||
} else if (cm.getPlayerCount(map + selection) >= maxp) {
|
||||
cm.sendNext("This training center is full.");
|
||||
status = -1;
|
||||
} else {
|
||||
cm.warp(map + selection, 0);
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user