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

@@ -82,12 +82,12 @@ function action(mode, type, selection) {
} else if (expedition.isInProgress()) { //Only if the expedition is in progress
if (expedition.contains(player)) { //If you're registered, warp you in
var eim = em.getInstance(expedName + player.getClient().getChannel());
if(eim.getIntProperty("canJoin") == 1) {
if (eim.getIntProperty("canJoin") == 1) {
eim.registerPlayer(player);
} else {
cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls.");
}
cm.dispose();
} else { //If you're not in by now, tough luck
cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
@@ -101,14 +101,14 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
expedition = cm.getExpedition(exped);
if(expedition != null) {
if (expedition != null) {
cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!");
cm.dispose();
return;
}
var res = cm.createExpedition(exped);
if (res == 0) {
cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
@@ -117,13 +117,13 @@ function action(mode, type, selection) {
} else {
cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later.");
}
cm.dispose();
return;
} else if (selection == 2) {
cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + ".");
cm.dispose();
return;
}
} else if (status == 2) {
if (selection == 1) {
@@ -148,14 +148,14 @@ function action(mode, type, selection) {
status = 6;
} else if (selection == 2) {
var min = exped.getMinSize();
var size = expedition.getMemberList().size();
if (size < min) {
cm.sendOk("You need at least " + min + " players registered in your expedition.");
cm.dispose();
return;
}
cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
status = 4;
} else if (selection == 3) {
@@ -164,7 +164,7 @@ function action(mode, type, selection) {
cm.endExpedition(expedition);
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
cm.dispose();
return;
}
} else if (status == 4) {
if (em == null) {
@@ -175,14 +175,14 @@ function action(mode, type, selection) {
em.setProperty("leader", player.getName());
em.setProperty("channel", player.getClient().getChannel());
if(!em.startInstance(expedition)) {
if (!em.startInstance(expedition)) {
cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
cm.dispose();
return;
}
cm.dispose();
return;
} else if (status == 6) {
if (selection > 0) {
var banned = expedMembers.get(selection - 1);