Reformat and clean up npc scripts
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user