Reformat and clean up portal scripts

This commit is contained in:
P0nk
2021-09-09 23:35:59 +02:00
parent d893309b4f
commit a78ca88a02
435 changed files with 2712 additions and 2287 deletions

View File

@@ -1,34 +1,32 @@
function enter(pi) {
if(pi.isQuestCompleted(2331)) {
if (pi.isQuestCompleted(2331)) {
pi.openNpc(1300013);
return false;
}
if(pi.isQuestCompleted(2333) && pi.isQuestStarted(2331) && !pi.hasItem(4001318)){
if (pi.isQuestCompleted(2333) && pi.isQuestStarted(2331) && !pi.hasItem(4001318)) {
pi.getPlayer().message("Lost the Royal Seal, eh? Worry not! Kevin's code here to save your hide.");
if(pi.canHold(4001318)){
if (pi.canHold(4001318)) {
pi.gainItem(4001318, 1);
}
else{
} else {
pi.getPlayer().message("Hey, how do you plan to hold this Seal when your inventory is full?");
}
}
if(pi.isQuestCompleted(2333)){
if (pi.isQuestCompleted(2333)) {
pi.playPortalSound();
pi.warp(106021600, 1);
return true;
}
else if(pi.isQuestStarted(2332) && pi.hasItem(4032388)){
} else if (pi.isQuestStarted(2332) && pi.hasItem(4032388)) {
pi.forceCompleteQuest(2332, 1300002);
pi.getPlayer().message("You've found the princess!");
pi.giveCharacterExp(4400, pi.getPlayer());
var em = pi.getEventManager("MK_PrimeMinister");
var party = pi.getPlayer().getParty();
if (party != null) {
var eli = em.getEligibleParty(pi.getParty()); // thanks Conrad for pointing out missing eligible party declaration here
if(eli.size() > 0) {
if (eli.size() > 0) {
if (em.startInstance(party, pi.getMap(), 1)) {
pi.playPortalSound();
return true;
@@ -46,14 +44,13 @@ function enter(pi) {
return false;
}
}
}
else if(pi.isQuestStarted(2333) || (pi.isQuestCompleted(2332) && !pi.isQuestStarted(2333))){
} else if (pi.isQuestStarted(2333) || (pi.isQuestCompleted(2332) && !pi.isQuestStarted(2333))) {
var em = pi.getEventManager("MK_PrimeMinister");
var party = pi.getPlayer().getParty();
if (party != null) {
var eli = em.getEligibleParty(pi.getParty());
if(eli.size() > 0) {
if (eli.size() > 0) {
if (em.startInstance(party, pi.getMap(), 1)) {
pi.playPortalSound();
return true;
@@ -71,8 +68,7 @@ function enter(pi) {
return false;
}
}
}
else{
} else {
pi.getPlayer().message("The door seems to be locked. Perhaps I can find a key to open it...");
return false;
}