Fix various other scripts with broken comparisons

This commit is contained in:
P0nk
2022-08-05 22:33:40 +02:00
parent fcdf3d6e1e
commit bfb2c1cb3d
24 changed files with 33 additions and 33 deletions

View File

@@ -19,7 +19,7 @@ function start() {
var em = cm.getEventManager("s4aWorld"); var em = cm.getEventManager("s4aWorld");
if (em == null) { if (em == null) {
cm.sendOk("You're not allowed to enter with unknown reason. Try again."); cm.sendOk("You're not allowed to enter with unknown reason. Try again.");
} else if (em.getProperty("started").equals("true")) { } else if (em.getProperty("started") === "true") {
cm.sendOk("Someone else is already attempting to defeat the Jr.Balrog in another world."); cm.sendOk("Someone else is already attempting to defeat the Jr.Balrog in another world.");
} else { } else {
var eli = em.getEligibleParty(cm.getParty()); var eli = em.getEligibleParty(cm.getParty());

View File

@@ -158,7 +158,7 @@ function action(mode, type, selection) {
} else { } else {
var num_correct = 0; var num_correct = 0;
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
if (eim.getProperty("stage4_" + i).equals("" + players[i])) { if (eim.getProperty("stage4_" + i) === ("" + players[i])) {
num_correct++; num_correct++;
} }
} }

View File

@@ -57,7 +57,7 @@ function action(mode, type, selection) {
return; return;
} }
} }
while (quest[rand].equals("") && status <= 4) { while (quest[rand] === "" && status <= 4) {
rand = parseInt(Math.random() * quest.length); rand = parseInt(Math.random() * quest.length);
} }
if (status <= 4) { if (status <= 4) {

View File

@@ -42,7 +42,7 @@ function action(mode, type, selection) {
break; break;
case 925100100: case 925100100:
var emp = eim.getProperty("stage2"); var emp = eim.getProperty("stage2");
if (emp.equals("0")) { if (emp === "0") {
if (cm.haveItem(4001120, 20)) { if (cm.haveItem(4001120, 20)) {
cm.sendNext("Excellent! Now hunt me 20 Rising Medals."); cm.sendNext("Excellent! Now hunt me 20 Rising Medals.");
cm.gainItem(4001120, -20); cm.gainItem(4001120, -20);
@@ -51,7 +51,7 @@ function action(mode, type, selection) {
} else { } else {
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rookie Medals."); cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rookie Medals.");
} }
} else if (emp.equals("1")) { } else if (emp === "1") {
if (cm.haveItem(4001121, 20)) { if (cm.haveItem(4001121, 20)) {
cm.sendNext("Excellent! Now hunt me 20 Veteran Medals."); cm.sendNext("Excellent! Now hunt me 20 Veteran Medals.");
cm.gainItem(4001121, -20); cm.gainItem(4001121, -20);
@@ -60,7 +60,7 @@ function action(mode, type, selection) {
} else { } else {
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rising Medals."); cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rising Medals.");
} }
} else if (emp.equals("2")) { } else if (emp === "2") {
if (cm.haveItem(4001122, 20)) { if (cm.haveItem(4001122, 20)) {
cm.sendNext("Excellent! Now let us go."); cm.sendNext("Excellent! Now let us go.");
cm.gainItem(4001122, -20); cm.gainItem(4001122, -20);
@@ -95,7 +95,7 @@ function action(mode, type, selection) {
case 925100301: case 925100301:
if (cm.getMap().getMonsters().size() == 0) { if (cm.getMap().getMonsters().size() == 0) {
cm.sendNext("The Lord Pirate's chest has appeared! If you happen to have a key, drop it by the chest to reveal it's treasures. That will certainly make him upset."); cm.sendNext("The Lord Pirate's chest has appeared! If you happen to have a key, drop it by the chest to reveal it's treasures. That will certainly make him upset.");
if (eim.getProperty("stage3a").equals("0")) { if (eim.getProperty("stage3a") === "0") {
cm.getMap().setReactorState(); cm.getMap().setReactorState();
eim.setProperty("stage3a", "1"); eim.setProperty("stage3a", "1");
} }

View File

@@ -65,7 +65,7 @@ function action(mode, type, selection) {
} else if (channelMaps.getMap(980010301).getCharacters().isEmpty()) { } else if (channelMaps.getMap(980010301).getCharacters().isEmpty()) {
toSnd += "#L2#Join Battle Arena (3) Owner (" + expedicao2.getLeader().getName() + ")" + " Current Member: " + cm.getExpeditionMemberNames(exped2) + "\r\n"; toSnd += "#L2#Join Battle Arena (3) Owner (" + expedicao2.getLeader().getName() + ")" + " Current Member: " + cm.getExpeditionMemberNames(exped2) + "\r\n";
} }
if (toSnd.equals(startSnd)) { if (toSnd === startSnd) {
cm.sendOk("All the Battle Arena is currently occupied. I suggest you to come back later or change channels."); cm.sendOk("All the Battle Arena is currently occupied. I suggest you to come back later or change channels.");
cm.dispose(); cm.dispose();
} else { } else {

View File

@@ -55,7 +55,7 @@ function action(mode, type, selection) {
var eim = cm.getPlayer().getEventInstance(); var eim = cm.getPlayer().getEventInstance();
if (eim.getProperty("stage4clear") != null && eim.getProperty("stage4clear").equals("true")) { if (eim.getProperty("stage4clear") != null && eim.getProperty("stage4clear") === "true") {
cm.sendOk("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. I can truly rest in peace now."); cm.sendOk("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. I can truly rest in peace now.");
cm.dispose(); cm.dispose();
return; return;

View File

@@ -26,7 +26,7 @@ function start() {
} else { } else {
if (cm.isEventLeader()) { if (cm.isEventLeader()) {
var currentCombo = eim.getProperty("stage3combo"); var currentCombo = eim.getProperty("stage3combo");
if (currentCombo == null || currentCombo.equals("reset")) { if (currentCombo == null || currentCombo === "reset") {
var newCombo = makeCombo(); var newCombo = makeCombo();
eim.setProperty("stage3combo", newCombo); eim.setProperty("stage3combo", newCombo);
//cm.playerMessage("Debug: " + newCombo); //cm.playerMessage("Debug: " + newCombo);

View File

@@ -60,7 +60,7 @@ function action(mode, type, selection) {
if (cm.isEventLeader()) { if (cm.isEventLeader()) {
if (status == 0) { if (status == 0) {
if (eim.getProperty("stage1status") == null || eim.getProperty("stage1status").equals("waiting")) { if (eim.getProperty("stage1status") == null || eim.getProperty("stage1status") === "waiting") {
if (eim.getProperty("stage1phase") == null) { if (eim.getProperty("stage1phase") == null) {
stage = 1; stage = 1;
eim.setProperty("stage1phase", stage); eim.setProperty("stage1phase", stage);
@@ -73,10 +73,10 @@ function action(mode, type, selection) {
} else { } else {
cm.sendOk("I shall now present a more difficult puzzle for you. Good luck."); cm.sendOk("I shall now present a more difficult puzzle for you. Good luck.");
} }
} else if (eim.getProperty("stage1status").equals("active")) { } else if (eim.getProperty("stage1status") === "active") {
stage = parseInt(eim.getProperty("stage1phase")); stage = parseInt(eim.getProperty("stage1phase"));
if (eim.getProperty("stage1combo").equals(eim.getProperty("stage1guess"))) { if (eim.getProperty("stage1combo") === eim.getProperty("stage1guess")) {
if (stage == 3) { if (stage == 3) {
cm.getPlayer().getMap().getReactorByName("statuegate").forceHitReactor(1); cm.getPlayer().getMap().getReactorByName("statuegate").forceHitReactor(1);
clearStage(1, eim); clearStage(1, eim);
@@ -128,7 +128,7 @@ function getReactors() {
var iter = cm.getPlayer().getMap().getReactors().iterator(); var iter = cm.getPlayer().getMap().getReactors().iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
var mo = iter.next(); var mo = iter.next();
if (!mo.getName().equals("statuegate")) { if (!mo.getName() === "statuegate") {
reactors.push(mo.getObjectId()); reactors.push(mo.getObjectId());
} }
} }

View File

@@ -36,7 +36,7 @@
function enter(pi) { function enter(pi) {
pi.playPortalSound(); pi.playPortalSound();
pi.warp(200090000, 4); pi.warp(200090000, 4);
if (pi.getPlayer().getClient().getChannelServer().getEventSM().getEventManager("Boats").getProperty("haveBalrog").equals("true")) { if (pi.getPlayer().getClient().getChannelServer().getEventSM().getEventManager("Boats").getProperty("haveBalrog") === "true") {
pi.changeMusic("Bgm04/ArabPirate"); pi.changeMusic("Bgm04/ArabPirate");
} }
return true; return true;

View File

@@ -36,7 +36,7 @@
function enter(pi) { function enter(pi) {
pi.playPortalSound(); pi.playPortalSound();
pi.warp(200090000, 5); pi.warp(200090000, 5);
if (pi.getPlayer().getClient().getChannelServer().getEventSM().getEventManager("Boats").getProperty("haveBalrog").equals("true")) { if (pi.getPlayer().getClient().getChannelServer().getEventSM().getEventManager("Boats").getProperty("haveBalrog") === "true") {
pi.changeMusic("Bgm04/ArabPirate"); pi.changeMusic("Bgm04/ArabPirate");
} }
return true; return true;

View File

@@ -37,7 +37,7 @@
function enter(pi) { function enter(pi) {
pi.playPortalSound(); pi.playPortalSound();
pi.warp(200090010, 4); pi.warp(200090010, 4);
if (pi.getPlayer().getClient().getChannelServer().getEventSM().getEventManager("Boats").getProperty("haveBalrog").equals("true")) { if (pi.getPlayer().getClient().getChannelServer().getEventSM().getEventManager("Boats").getProperty("haveBalrog") === "true") {
pi.changeMusic("Bgm04/ArabPirate"); pi.changeMusic("Bgm04/ArabPirate");
} }
return true; return true;

View File

@@ -37,7 +37,7 @@
function enter(pi) { function enter(pi) {
pi.playPortalSound(); pi.playPortalSound();
pi.warp(200090010, 5); pi.warp(200090010, 5);
if (pi.getPlayer().getClient().getChannelServer().getEventSM().getEventManager("Boats").getProperty("haveBalrog").equals("true")) { if (pi.getPlayer().getClient().getChannelServer().getEventSM().getEventManager("Boats").getProperty("haveBalrog") === "true") {
pi.changeMusic("Bgm04/ArabPirate"); pi.changeMusic("Bgm04/ArabPirate");
} }
return true; return true;

View File

@@ -1,7 +1,7 @@
function enter(pi) { function enter(pi) {
try { try {
var eim = pi.getEventInstance(); var eim = pi.getEventInstance();
if (eim != null && eim.getProperty("stage2").equals("3")) { if (eim != null && eim.getProperty("stage2") === "3") {
pi.playPortalSound(); pi.playPortalSound();
pi.warp(925100200, 0); //next pi.warp(925100200, 0); //next
return true; return true;

View File

@@ -30,7 +30,7 @@ function enter(pi) {
if (pi.getPlayer().getMap().getReactorByName("kinggate").getState() == 1) { if (pi.getPlayer().getMap().getReactorByName("kinggate").getState() == 1) {
pi.playPortalSound(); pi.playPortalSound();
pi.warp(990000900, 2); pi.warp(990000900, 2);
if (pi.getPlayer().getEventInstance().getProperty("boss") != null && pi.getPlayer().getEventInstance().getProperty("boss").equals("true")) { if (pi.getPlayer().getEventInstance().getProperty("boss") != null && pi.getPlayer().getEventInstance().getProperty("boss") === "true") {
pi.changeMusic("Bgm10/Eregos"); pi.changeMusic("Bgm10/Eregos");
} }
return true; return true;

View File

@@ -30,7 +30,7 @@ function enter(pi) {
if (pi.getPlayer().getMap().getReactorByName("kinggate").getState() == 1) { if (pi.getPlayer().getMap().getReactorByName("kinggate").getState() == 1) {
pi.playPortalSound(); pi.playPortalSound();
pi.warp(990000900, 1); pi.warp(990000900, 1);
if (pi.getPlayer().getEventInstance().getProperty("boss") != null && pi.getPlayer().getEventInstance().getProperty("boss").equals("true")) { if (pi.getPlayer().getEventInstance().getProperty("boss") != null && pi.getPlayer().getEventInstance().getProperty("boss") === "true") {
pi.changeMusic("Bgm10/Eregos"); pi.changeMusic("Bgm10/Eregos");
} }
return true; return true;

View File

@@ -6,7 +6,7 @@ function act() {
var newStage = stage.toString(); var newStage = stage.toString();
eim.setProperty("stage", newStage); eim.setProperty("stage", newStage);
react.forceHitReactor(react.getState() + 1); react.forceHitReactor(react.getState() + 1);
if (eim.getProperty("stage").equals("6")) { if (eim.getProperty("stage") === "6") {
rm.mapMessage(6, "Protect the Moon Bunny!!!"); rm.mapMessage(6, "Protect the Moon Bunny!!!");
var map = eim.getMapInstance(rm.getReactor().getMap().getId()); var map = eim.getMapInstance(rm.getReactor().getMap().getId());
map.allowSummonState(true); map.allowSummonState(true);

View File

@@ -6,7 +6,7 @@ function act() {
var newStage = stage.toString(); var newStage = stage.toString();
eim.setProperty("stage", newStage); eim.setProperty("stage", newStage);
react.forceHitReactor(react.getState() + 1); react.forceHitReactor(react.getState() + 1);
if (eim.getProperty("stage").equals("6")) { if (eim.getProperty("stage") === "6") {
rm.mapMessage(6, "Protect the Moon Bunny!!!"); rm.mapMessage(6, "Protect the Moon Bunny!!!");
var map = eim.getMapInstance(rm.getReactor().getMap().getId()); var map = eim.getMapInstance(rm.getReactor().getMap().getId());
map.allowSummonState(true); map.allowSummonState(true);

View File

@@ -6,7 +6,7 @@ function act() {
var newStage = stage.toString(); var newStage = stage.toString();
eim.setProperty("stage", newStage); eim.setProperty("stage", newStage);
react.forceHitReactor(react.getState() + 1); react.forceHitReactor(react.getState() + 1);
if (eim.getProperty("stage").equals("6")) { if (eim.getProperty("stage") === "6") {
rm.mapMessage(6, "Protect the Moon Bunny!!!"); rm.mapMessage(6, "Protect the Moon Bunny!!!");
var map = eim.getMapInstance(rm.getReactor().getMap().getId()); var map = eim.getMapInstance(rm.getReactor().getMap().getId());
map.allowSummonState(true); map.allowSummonState(true);

View File

@@ -6,7 +6,7 @@ function act() {
var newStage = stage.toString(); var newStage = stage.toString();
eim.setProperty("stage", newStage); eim.setProperty("stage", newStage);
react.forceHitReactor(react.getState() + 1); react.forceHitReactor(react.getState() + 1);
if (eim.getProperty("stage").equals("6")) { if (eim.getProperty("stage") === "6") {
rm.mapMessage(6, "Protect the Moon Bunny!!!"); rm.mapMessage(6, "Protect the Moon Bunny!!!");
var map = eim.getMapInstance(rm.getReactor().getMap().getId()); var map = eim.getMapInstance(rm.getReactor().getMap().getId());
map.allowSummonState(true); map.allowSummonState(true);

View File

@@ -6,7 +6,7 @@ function act() {
var newStage = stage.toString(); var newStage = stage.toString();
eim.setProperty("stage", newStage); eim.setProperty("stage", newStage);
react.forceHitReactor(react.getState() + 1); react.forceHitReactor(react.getState() + 1);
if (eim.getProperty("stage").equals("6")) { if (eim.getProperty("stage") === "6") {
rm.mapMessage(6, "Protect the Moon Bunny!!!"); rm.mapMessage(6, "Protect the Moon Bunny!!!");
var map = eim.getMapInstance(rm.getReactor().getMap().getId()); var map = eim.getMapInstance(rm.getReactor().getMap().getId());
map.allowSummonState(true); map.allowSummonState(true);

View File

@@ -6,7 +6,7 @@ function act() {
var newStage = stage.toString(); var newStage = stage.toString();
eim.setProperty("stage", newStage); eim.setProperty("stage", newStage);
react.forceHitReactor(react.getState() + 1); react.forceHitReactor(react.getState() + 1);
if (eim.getProperty("stage").equals("6")) { if (eim.getProperty("stage") === "6") {
rm.mapMessage(6, "Protect the Moon Bunny!!!"); rm.mapMessage(6, "Protect the Moon Bunny!!!");
var map = eim.getMapInstance(rm.getReactor().getMap().getId()); var map = eim.getMapInstance(rm.getReactor().getMap().getId());
map.allowSummonState(true); map.allowSummonState(true);

View File

@@ -36,9 +36,9 @@ function act() {
var eim = rm.getPlayer().getEventInstance(); var eim = rm.getPlayer().getEventInstance();
if (eim != null) { if (eim != null) {
var status = eim.getProperty("stage1status"); var status = eim.getProperty("stage1status");
if (status != null && !status.equals("waiting")) { if (status != null && status !== "waiting") {
var stage = parseInt(eim.getProperty("stage1phase")); var stage = parseInt(eim.getProperty("stage1phase"));
if (status.equals("display")) { if (status === "display") {
if (!rm.getReactor().isRecentHitFromAttack()) { if (!rm.getReactor().isRecentHitFromAttack()) {
var prevCombo = eim.getProperty("stage1combo"); var prevCombo = eim.getProperty("stage1combo");

View File

@@ -38,10 +38,10 @@ function act() {
var eim = rm.getPlayer().getEventInstance(); var eim = rm.getPlayer().getEventInstance();
if (eim != null) { if (eim != null) {
var status = eim.getProperty("stage1status"); var status = eim.getProperty("stage1status");
if (status != null && !status.equals("waiting")) { if (status != null && status !== "waiting") {
var stage = parseInt(eim.getProperty("stage1phase")); var stage = parseInt(eim.getProperty("stage1phase"));
//rm.mapMessage(6,"Stage " + stage); //rm.mapMessage(6,"Stage " + stage);
if (status.equals("display")) { if (status === "display") {
if (!rm.getReactor().isRecentHitFromAttack()) { if (!rm.getReactor().isRecentHitFromAttack()) {
var prevCombo = eim.getProperty("stage1combo"); var prevCombo = eim.getProperty("stage1combo");

View File

@@ -36,9 +36,9 @@ function act() {
var eim = rm.getPlayer().getEventInstance(); var eim = rm.getPlayer().getEventInstance();
if (eim != null) { if (eim != null) {
var status = eim.getProperty("stage1status"); var status = eim.getProperty("stage1status");
if (status != null && !status.equals("waiting")) { if (status != null && status !== "waiting") {
var stage = parseInt(eim.getProperty("stage1phase")); var stage = parseInt(eim.getProperty("stage1phase"));
if (status.equals("display")) { if (status === "display") {
if (!rm.getReactor().isRecentHitFromAttack()) { if (!rm.getReactor().isRecentHitFromAttack()) {
var prevCombo = eim.getProperty("stage1combo"); var prevCombo = eim.getProperty("stage1combo");
var n = "" + (rm.getReactor().getObjectId() % 1000); var n = "" + (rm.getReactor().getObjectId() % 1000);