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

@@ -21,29 +21,31 @@
*/
function enter(pi) {
if(pi.isQuestStarted(21301) && pi.getQuestProgressInt(21301, 9001013) == 0) {
if(pi.getPlayerCount(108010700) != 0) {
pi.message("The portal is blocked from the other side. I wonder if someone is already fighting the Thief Crow?");
return false;
} else {
var map = pi.getClient().getChannelServer().getMapFactory().getMap(108010700);
spawnMob(2732, 3, 9001013, map);
pi.playPortalSound();
pi.warp(108010700, "west00");
}
} else {
pi.playPortalSound(); pi.warp(140020300, 1);
}
return true;
if (pi.isQuestStarted(21301) && pi.getQuestProgressInt(21301, 9001013) == 0) {
if (pi.getPlayerCount(108010700) != 0) {
pi.message("The portal is blocked from the other side. I wonder if someone is already fighting the Thief Crow?");
return false;
} else {
var map = pi.getClient().getChannelServer().getMapFactory().getMap(108010700);
spawnMob(2732, 3, 9001013, map);
pi.playPortalSound();
pi.warp(108010700, "west00");
}
} else {
pi.playPortalSound();
pi.warp(140020300, 1);
}
return true;
}
function spawnMob(x, y, id, map) {
if(map.getMonsterById(id) != null)
return;
if (map.getMonsterById(id) != null) {
return;
}
const LifeFactory = Java.type('server.life.LifeFactory');
const Point = Java.type('java.awt.Point');
var mob = LifeFactory.getMonster(id);
map.spawnMonsterOnGroundBelow(mob, new Point(x, y));
const LifeFactory = Java.type('server.life.LifeFactory');
const Point = Java.type('java.awt.Point');
var mob = LifeFactory.getMonster(id);
map.spawnMonsterOnGroundBelow(mob, new Point(x, y));
}