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

@@ -35,31 +35,34 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
if (mode == 1)
if (mode == 1) {
status++;
else
} else {
status--;
}
if (status == 1) {
sel = selection;
if (selection == 0) {
if (cm.getPlayer().getGuildId() > 0) {
cm.sendOk("You may not create a new Guild while you are in one.");
cm.dispose();
} else
} else {
cm.sendYesNo("Creating a Guild costs #b 1500000 mesos#k, are you sure you want to continue?");
}
} else if (selection == 1) {
if (cm.getPlayer().getGuildId() < 1 || cm.getPlayer().getGuildRank() != 1) {
cm.sendOk("You can only disband a Guild if you are the leader of that Guild.");
cm.dispose();
} else
} else {
cm.sendYesNo("Are you sure you want to disband your Guild? You will not be able to recover it afterward and all your GP will be gone.");
}
} else if (selection == 2) {
if (cm.getPlayer().getGuildId() < 1 || cm.getPlayer().getGuildRank() != 1) {
cm.sendOk("You can only increase your Guild's capacity if you are the leader.");
cm.dispose();
} else {
var Guild = Java.type("net.server.guild.Guild"); // thanks Conrad for noticing an issue due to call on a static method here
cm.sendYesNo("Increasing your Guild capacity by #b5#k costs #b " + Guild.getIncreaseGuildCost(cm.getPlayer().getGuild().getCapacity()) +" mesos#k, are you sure you want to continue?");
cm.sendYesNo("Increasing your Guild capacity by #b5#k costs #b " + Guild.getIncreaseGuildCost(cm.getPlayer().getGuild().getCapacity()) + " mesos#k, are you sure you want to continue?");
}
}
} else if (status == 2) {