sweetgum83/scripts/portal/enterNepenthes.js
2024-01-19 03:56:28 -05:00

26 lines
836 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 LifeFactory = Java.type('server.life.LifeFactory');
const Point = Java.type('java.awt.Point');
mapobj2.spawnMonsterOnGroundBelow(LifeFactory.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;
}
}