Convert portal scripts to Graal

This commit is contained in:
P0nk
2021-04-17 19:59:27 +02:00
parent 938f7c9390
commit 984adc7885
6 changed files with 14 additions and 17 deletions

View File

@@ -1,5 +1,3 @@
importPackage(Packages.server.life);
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();
@@ -9,13 +7,15 @@ function enter(pi) {
var chests = parseInt(eim.getProperty("openedChests"));
var boss;
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
if(chests == 0) boss = MapleLifeFactory.getMonster(9300119); //lord pirate
else if(chests == 1) boss = MapleLifeFactory.getMonster(9300105); //angry lord pirate
else boss = MapleLifeFactory.getMonster(9300106); //enraged lord pirate
boss.changeDifficulty(level, true);
pi.getMap(925100500).spawnMonsterOnGroundBelow(boss, new java.awt.Point(777, 140));
const Point = Java.type('java.awt.Point');
pi.getMap(925100500).spawnMonsterOnGroundBelow(boss, new Point(777, 140));
eim.setProperty("spawnedBoss", "true");
}