Reformat and clean up npc scripts
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user