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

@@ -20,15 +20,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
Assistant Nancy
-- By ---------------------------------------------------------------------------------------------
Angel (get31720)
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Angel
2.0 - Second Version by happydud3 & XotiCraze
3.0 - Third Version by RonanLana (HeavenMS)
---------------------------------------------------------------------------------------------------
**/
Assistant Nancy
-- By ---------------------------------------------------------------------------------------------
Angel (get31720)
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Angel
2.0 - Second Version by happydud3 & XotiCraze
3.0 - Third Version by RonanLana (HeavenMS)
---------------------------------------------------------------------------------------------------
**/
var status;
var eim;
@@ -37,31 +37,31 @@ var hasRing;
function start() {
eim = cm.getEventInstance();
if(eim == null) {
cm.warp(680000000,0);
if (eim == null) {
cm.warp(680000000, 0);
cm.dispose();
return;
}
if(cm.getMapId() == 680000200) {
if(eim.getIntProperty("weddingStage") == 0) {
if (cm.getMapId() == 680000200) {
if (eim.getIntProperty("weddingStage") == 0) {
cm.sendNext("The guests are gathering here right now. Please wait awhile, the ceremony will start soon enough.");
} else {
cm.warp(680000210, "sp");
cm.sendNext("Pick your seat over here and good show!");
}
cm.dispose();
} else {
if(cm.getPlayer().getId() != eim.getIntProperty("groomId") && cm.getPlayer().getId() != eim.getIntProperty("brideId")) {
if (cm.getPlayer().getId() != eim.getIntProperty("groomId") && cm.getPlayer().getId() != eim.getIntProperty("brideId")) {
cm.sendNext("Sorry, only the marrying couple should be talking to me right now.");
cm.dispose();
return;
}
hasEngage = false;
for(var i = 4031357; i <= 4031364; i++) {
if(cm.haveItem(i)) {
for (var i = 4031357; i <= 4031364; i++) {
if (cm.haveItem(i)) {
hasEngage = true;
break;
}
@@ -82,7 +82,7 @@ function start() {
function action(mode, type, selection) {
if (mode == -1 || mode == 0) {
cm.sendOk("Goodbye then.");
cm.sendOk("Goodbye then.");
cm.dispose();
return;
} else if (mode == 1) {
@@ -90,10 +90,10 @@ function action(mode, type, selection) {
} else {
status--;
}
if (status == 0) {
var hasGoldenLeaf = cm.haveItem(4000313);
if (hasGoldenLeaf && hasEngage) {
cm.sendOk("You can't leave yet! You need to click High Priest John and get married before I can let you leave.");
cm.dispose();
@@ -112,32 +112,36 @@ function action(mode, type, selection) {
var cmPartner;
try {
cmPartner = cm.getMap().getCharacterById(cm.getPlayer().getPartnerId()).getAbstractPlayerInteraction();
} catch(err) {
} catch (err) {
cmPartner = null;
}
switch(selection) {
switch (selection) {
case 0:
if(eim.getIntProperty("isPremium") == 1) {
if (eim.getIntProperty("isPremium") == 1) {
eim.warpEventTeam(680000300);
cm.sendOk("Enjoy! Cherish your Photos Forever!");
if (cmPartner != null) cmPartner.npcTalk(cm.getNpc(), "Enjoy! Cherish your Photos Forever!");
if (cmPartner != null) {
cmPartner.npcTalk(cm.getNpc(), "Enjoy! Cherish your Photos Forever!");
}
} else { // skip the party-time (premium only)
eim.warpEventTeam(680000500);
cm.sendOk("Congratulations for the newly-wed! I will escort you to the exit.");
if (cmPartner != null) cmPartner.npcTalk(cm.getNpc(), "Congratulations for the newly-wed! I will escort you to the exit.");
if (cmPartner != null) {
cmPartner.npcTalk(cm.getNpc(), "Congratulations for the newly-wed! I will escort you to the exit.");
}
}
cm.dispose();
break;
case 1:
cm.sendOk("The Bride and Groom must receive the blessings of High Priest John to be wed. When you are ready you can click me to go to the Afterparty.");
cm.dispose();
break;
default:
cm.warp(680000000,0);
cm.warp(680000000, 0);
cm.dispose();
break;
}