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

@@ -40,78 +40,80 @@ function start() {
}
function action(mode, type, selection) {
if (mode == -1)
if (mode == -1) {
cm.dispose();
else {
} else {
if (mode == 0) {
cm.dispose();
return;
}
if (mode == 1)
if (mode == 1) {
status++;
else
} else {
status--;
if(cm.haveItem(4001109, 1)) {
}
if (cm.haveItem(4001109, 1)) {
cm.warp(921100000, "out00");
cm.dispose();
return;
}
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { // thanks Vcoc for finding out a need of reapproval from the masters for Zakum expeditions
if (!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { // thanks Vcoc for finding out a need of reapproval from the masters for Zakum expeditions
if (cm.getPlayer().getLevel() >= 50) { // thanks Z1peR for noticing not-so-clear unmet requirements message here.
cm.sendOk("Beware, for the power of olde has not been forgotten... If you seek to defeat #rZakum#k someday, earn the #bChief's Residence Council#k approval foremost and then #bface the trials#k, only then you will become eligible to fight.");
} else {
cm.sendOk("Beware, for the power of olde has not been forgotten...");
}
cm.dispose();
return;
}
em = cm.getEventManager("ZakumPQ");
if(em == null) {
if (em == null) {
cm.sendOk("The Zakum PQ has encountered an error.");
cm.dispose();
return;
}
if (status == 0) {
cm.sendSimple("#e#b<Party Quest: Zakum Campaign>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nBeware, for the power of olde has not been forgotten... #b\r\n#L0#Enter the Unknown Dead Mine (Stage 1)#l\r\n#L1#Face the Breath of Lava (Stage 2)#l\r\n#L2#Forging the Eyes of Fire (Stage 3)#l");
}
else if (status == 1) {
} else if (status == 1) {
if (selection == 0) {
if (cm.getParty() == null) {
cm.sendOk("You can participate in the party quest only if you are in a party.");
cm.dispose();
} else if(!cm.isLeader()) {
} else if (!cm.isLeader()) {
cm.sendOk("Your party leader must talk to me to start this party quest.");
cm.dispose();
} else {
var eli = em.getEligibleParty(cm.getParty());
if(eli.size() > 0) {
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
if (eli.size() > 0) {
if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish.");
}
}
else {
} else {
cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search.");
}
cm.dispose();
}
} else if(selection == 1) {
if (cm.haveItem(4031061) && !cm.haveItem(4031062))
} else if (selection == 1) {
if (cm.haveItem(4031061) && !cm.haveItem(4031062)) {
cm.sendYesNo("Would you like to attempt the #bBreath of Lava#k? If you fail, there is a very real chance you will die.");
else {
if (cm.haveItem(4031062)) cm.sendNext("You've already got the #bBreath of Lava#k, you don't need to do this stage.");
else cm.sendNext("Please complete the earlier trials first.");
} else {
if (cm.haveItem(4031062)) {
cm.sendNext("You've already got the #bBreath of Lava#k, you don't need to do this stage.");
} else {
cm.sendNext("Please complete the earlier trials first.");
}
cm.dispose();
}
} else {
if(cm.haveItem(4031061) && cm.haveItem(4031062)) {
if(!cm.haveItem(4000082, 30)) {
if (cm.haveItem(4031061) && cm.haveItem(4031062)) {
if (!cm.haveItem(4000082, 30)) {
cm.sendOk("You have completed the trials, however there's still the need of #b30 #t4000082##k to forge 5 #t4001017#.");
} else {
cm.completeQuest(100201);
@@ -122,15 +124,14 @@ function action(mode, type, selection) {
cm.gainItem(4001017, 5);
cm.sendNext("You #rhave completed the trials#k, from now on having my approval to challenge Zakum.");
}
cm.dispose();
} else {
cm.sendOk("You lack some of the required items to forge the #b#t4001017##k.");
cm.dispose();
}
}
}
else if (status == 2) {
} else if (status == 2) {
cm.warp(280020000, 0);
cm.dispose();
}