Reformat and clean up npc scripts
This commit is contained in:
@@ -24,41 +24,43 @@ var status = -1;
|
||||
/*
|
||||
Custom Quest 100300
|
||||
*/
|
||||
function activateShamanRock(slot,progress) {
|
||||
function activateShamanRock(slot, progress) {
|
||||
var ch = progress[slot];
|
||||
if(ch == '0') {
|
||||
if (ch == '0') {
|
||||
var nextProgress = progress.substr(0, slot) + '1' + progress.substr(slot + 1);
|
||||
|
||||
|
||||
cm.setQuestProgress(2236, nextProgress);
|
||||
cm.gainItem(4032263, -1);
|
||||
cm.sendOk("The seal took it's place, repelling the evil in the area.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function start() {
|
||||
if(cm.isQuestStarted(2236) && cm.haveItem(4032263, 1)) {
|
||||
if (cm.isQuestStarted(2236) && cm.haveItem(4032263, 1)) {
|
||||
var progress = cm.getQuestProgress(2236);
|
||||
var map = cm.getMapId();
|
||||
|
||||
if(map == 105050200) activateShamanRock(0,progress);
|
||||
else if(map == 105060000) activateShamanRock(1,progress);
|
||||
else if(map == 105070000) activateShamanRock(2,progress);
|
||||
|
||||
else if(map == 105090000) { // workaround... TWO SAME NPC ID ON SAME MAP
|
||||
|
||||
if (map == 105050200) {
|
||||
activateShamanRock(0, progress);
|
||||
} else if (map == 105060000) {
|
||||
activateShamanRock(1, progress);
|
||||
} else if (map == 105070000) {
|
||||
activateShamanRock(2, progress);
|
||||
} else if (map == 105090000) { // workaround... TWO SAME NPC ID ON SAME MAP
|
||||
var npcOid = cm.getQuestProgressInt(100300, 1);
|
||||
if (npcOid == 0) {
|
||||
activateShamanRock(3,progress);
|
||||
activateShamanRock(3, progress);
|
||||
cm.setQuestProgress(100300, 1, cm.getNpcObjectId());
|
||||
} else if (cm.getNpcObjectId() != npcOid) {
|
||||
activateShamanRock(4,progress);
|
||||
activateShamanRock(4, progress);
|
||||
}
|
||||
} else if (map == 105090100) {
|
||||
activateShamanRock(5, progress);
|
||||
}
|
||||
|
||||
else if(map == 105090100) activateShamanRock(5,progress);
|
||||
}
|
||||
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user