Files
sweetgum-server/scripts/portal/enterNepenthes.js
P0nk fcd879f97c Convert remaining scripts to Graal
Mainly missed scripts that use Nashorn's "Packages"
2021-04-17 21:59:15 +02:00

24 lines
841 B
JavaScript

function enter(pi) {
if (pi.isQuestActive(21739)) {
var mapobj1 = pi.getWarpMap(920030000);
var mapobj2 = pi.getWarpMap(920030001);
if(mapobj1.countPlayers() == 0 && mapobj2.countPlayers() == 0) {
mapobj1.resetPQ(1);
mapobj2.resetPQ(1);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
mapobj2.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300348), new Point(591, -34));
pi.playPortalSound(); pi.warp(920030000,2);
return true;
} else {
pi.message("Someone is already challenging the area.");
return false;
}
} else {
pi.playPortalSound(); pi.warp(200060001,2);
return true;
}
}