Reformat and clean up npc scripts
This commit is contained in:
@@ -4,39 +4,43 @@ var cost = 1000;
|
||||
|
||||
function start() {
|
||||
cm.sendNext("Hi, I'm the ticket salesman.");
|
||||
if (cm.isQuestStarted(2055) || cm.isQuestCompleted(2055))
|
||||
if (cm.isQuestStarted(2055) || cm.isQuestCompleted(2055)) {
|
||||
zones++;
|
||||
if (cm.isQuestStarted(2056) || cm.isQuestCompleted(2056))
|
||||
}
|
||||
if (cm.isQuestStarted(2056) || cm.isQuestCompleted(2056)) {
|
||||
zones++;
|
||||
if (cm.isQuestStarted(2057) || cm.isQuestCompleted(2057))
|
||||
}
|
||||
if (cm.isQuestStarted(2057) || cm.isQuestCompleted(2057)) {
|
||||
zones++;
|
||||
}
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
status++;
|
||||
if (mode != 1){
|
||||
if (mode != 1) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (status == 0) {
|
||||
if (zones == 0)
|
||||
if (zones == 0) {
|
||||
cm.dispose();
|
||||
else {
|
||||
} else {
|
||||
var selStr = "Which ticket would you like?#b";
|
||||
for (var i = 0; i < zones; i++)
|
||||
selStr += "\r\n#L" + i + "#Construction site B" + (i+1) + " (" + cost + " mesos)#l";
|
||||
for (var i = 0; i < zones; i++) {
|
||||
selStr += "\r\n#L" + i + "#Construction site B" + (i + 1) + " (" + cost + " mesos)#l";
|
||||
}
|
||||
cm.sendSimple(selStr);
|
||||
}
|
||||
} else if (status == 1) {
|
||||
if (cm.getMeso() < cost)
|
||||
if (cm.getMeso() < cost) {
|
||||
cm.sendOk("You do not have enough mesos.");
|
||||
else {
|
||||
} else {
|
||||
cm.gainMeso(-cost);
|
||||
if(selection < 0 || selection > zones) {
|
||||
cm.getClient().disconnect(false, false);
|
||||
return;
|
||||
}
|
||||
cm.gainItem(4031036 + selection,1);
|
||||
if (selection < 0 || selection > zones) {
|
||||
cm.getClient().disconnect(false, false);
|
||||
return;
|
||||
}
|
||||
cm.gainItem(4031036 + selection, 1);
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user