Convert event scripts to Graal

This commit is contained in:
P0nk
2021-04-17 19:43:00 +02:00
parent a18a1cb8ce
commit 3458d1c7b3
56 changed files with 273 additions and 237 deletions

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -44,7 +42,8 @@ function cancelSchedule() {
function start() {
var goblinForest2 = em.getChannelServer().getMapFactory().getMap(250010504);
var kingSageCat = Packages.server.life.MapleLifeFactory.getMonster(7220002);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var kingSageCat = MapleLifeFactory.getMonster(7220002);
if(goblinForest2.getMonsterById(7220002) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
@@ -53,8 +52,12 @@ function start() {
var posX;
var posY = 540;
posX = Math.floor((Math.random() * 1300) - 500);
goblinForest2.spawnMonsterOnGroundBelow(kingSageCat, new Packages.java.awt.Point(posX, posY));
goblinForest2.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "The ghostly air around here has become stronger. The unpleasant sound of a cat crying can be heard."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
goblinForest2.spawnMonsterOnGroundBelow(kingSageCat, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
goblinForest2.broadcastMessage(MaplePacketCreator.serverNotice(6, "The ghostly air around here has become stronger. The unpleasant sound of a cat crying can be heard."));
em.schedule("start", 3 * 60 *60 * 1000);
}