Reformat and clean up portal scripts

This commit is contained in:
P0nk
2021-09-09 23:35:59 +02:00
parent d893309b4f
commit a78ca88a02
435 changed files with 2712 additions and 2287 deletions

View File

@@ -1,16 +1,22 @@
function enter(pi) {
if (pi.getMap().getReactorByName("sMob1").getState() >= 1 && pi.getMap().getReactorByName("sMob2").getState() >= 1 && pi.getMap().getReactorByName("sMob3").getState() >= 1 && pi.getMap().getReactorByName("sMob4").getState() >= 1 && pi.getMap().getMonsters().size() == 0) {
var eim = pi.getEventInstance();
if(eim.getProperty("spawnedBoss") == null) {
var eim = pi.getEventInstance();
if (eim.getProperty("spawnedBoss") == null) {
var level = parseInt(eim.getProperty("level"));
var chests = parseInt(eim.getProperty("openedChests"));
var boss;
var boss;
const LifeFactory = Java.type('server.life.LifeFactory');
if(chests == 0) boss = LifeFactory.getMonster(9300119); //lord pirate
else if(chests == 1) boss = LifeFactory.getMonster(9300105); //angry lord pirate
else boss = LifeFactory.getMonster(9300106); //enraged lord pirate
if (chests == 0) {
boss = LifeFactory.getMonster(9300119);
}//lord pirate
else if (chests == 1) {
boss = LifeFactory.getMonster(9300105);
}//angry lord pirate
else {
boss = LifeFactory.getMonster(9300106);
} //enraged lord pirate
boss.changeDifficulty(level, true);
@@ -18,11 +24,12 @@ function enter(pi) {
pi.getMap(925100500).spawnMonsterOnGroundBelow(boss, new Point(777, 140));
eim.setProperty("spawnedBoss", "true");
}
pi.playPortalSound(); pi.warp(925100500, 0);
pi.playPortalSound();
pi.warp(925100500, 0);
return true;
} else {
pi.playerMessage(5, "The portal is not opened yet.");
pi.playerMessage(5, "The portal is not opened yet.");
return false;
}
}