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

@@ -25,25 +25,30 @@
var rolled = 0;
function start(mode, type, selection){
if(!cm.isQuestStarted(2186)) {
function start(mode, type, selection) {
if (!cm.isQuestStarted(2186)) {
cm.sendOk("Just a pile of boxes, nothing special...");
cm.dispose();
return;
}
cm.sendNext("Do you want to obtain a glasses?");
}
function action(mode, type, selection) {
if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) {
if (!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) {
rolled = Math.floor(Math.random() * 3);
if(rolled == 0) cm.gainItem(4031853, 1);
else if(rolled == 1) cm.gainItem(4031854, 1);
else cm.gainItem(4031855, 1);
if (rolled == 0) {
cm.gainItem(4031853, 1);
} else if (rolled == 1) {
cm.gainItem(4031854, 1);
} else {
cm.gainItem(4031855, 1);
}
} else {
cm.sendOk("You #balready have#k the glasses that was here!");
}
else cm.sendOk("You #balready have#k the glasses that was here!");
cm.dispose();
}