diff --git a/scripts/event/AmoriaPQ.js b/scripts/event/AmoriaPQ.js index 6ad982a942..c61e617936 100644 --- a/scripts/event/AmoriaPQ.js +++ b/scripts/event/AmoriaPQ.js @@ -147,8 +147,11 @@ function setup(level, lobbyid) { eim.getInstanceMap(670010800).shuffleReactors(); var mapObj = eim.getInstanceMap(670010700); - var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400536); - mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(942, 478)); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + var mobObj = MapleLifeFactory.getMonster(9400536); + mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(942, 478)); respawnStages(eim); diff --git a/scripts/event/AreaBossBamboo.js b/scripts/event/AreaBossBamboo.js index 35d114c0a6..3a12c4ebf4 100644 --- a/scripts/event/AreaBossBamboo.js +++ b/scripts/event/AreaBossBamboo.js @@ -40,16 +40,19 @@ function cancelSchedule() { } function start() { + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); var mapObj = em.getChannelServer().getMapFactory().getMap(800020120); // original mapid was 251010101 - var mobObj = Packages.server.life.MapleLifeFactory.getMonster(6090002); + var mobObj = MapleLifeFactory.getMonster(6090002); if(mapObj.getMonsterById(6090002) != null) { em.schedule("start", 3 * 60 *60 * 1000); return; } - - mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(560, 50)); - mapObj.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "From amongst the ruins shrouded by the mists, Bamboo Warrior appears.")); + + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(560, 50)); + mapObj.broadcastMessage(MaplePacketCreator.serverNotice(6, "From amongst the ruins shrouded by the mists, Bamboo Warrior appears.")); em.schedule("start", 3 * 60 *60 * 1000); } diff --git a/scripts/event/AreaBossCentipede.js b/scripts/event/AreaBossCentipede.js index 998ebddd08..b7e4b5653b 100644 --- a/scripts/event/AreaBossCentipede.js +++ b/scripts/event/AreaBossCentipede.js @@ -41,15 +41,19 @@ function cancelSchedule() { function start() { var herbGarden = em.getChannelServer().getMapFactory().getMap(251010102); - var gcent = Packages.server.life.MapleLifeFactory.getMonster(5220004); if(herbGarden.getMonsterById(5220004) != null) { em.schedule("start", 3 * 60 *60 * 1000); return; } - - herbGarden.spawnMonsterOnGroundBelow(gcent, new Packages.java.awt.Point(560, 50)); - herbGarden.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "From the mists surrounding the herb garden, the gargantuous Giant Centipede appears.")); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + + var gcent = MapleLifeFactory.getMonster(5220004); + herbGarden.spawnMonsterOnGroundBelow(gcent, new Point(560, 50)); + herbGarden.broadcastMessage(MaplePacketCreator.serverNotice(6, "From the mists surrounding the herb garden, the gargantuous Giant Centipede appears.")); em.schedule("start", 3 * 60 *60 * 1000); } diff --git a/scripts/event/AreaBossDeo.js b/scripts/event/AreaBossDeo.js index 8c5328967b..64d13bb70e 100644 --- a/scripts/event/AreaBossDeo.js +++ b/scripts/event/AreaBossDeo.js @@ -41,15 +41,19 @@ function cancelSchedule() { function start() { var royalCatthusDesert = em.getChannelServer().getMapFactory().getMap(260010201); - var deo = Packages.server.life.MapleLifeFactory.getMonster(3220001); if(royalCatthusDesert.getMonsterById(3220001) != null) { em.schedule("start", 3 * 60 *60 * 1000); return; } - - royalCatthusDesert.spawnMonsterOnGroundBelow(deo, new Packages.java.awt.Point(645, 275)); - royalCatthusDesert.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Deo slowly appeared out of the sand dust.")); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + + var deo = MapleLifeFactory.getMonster(3220001); + royalCatthusDesert.spawnMonsterOnGroundBelow(deo, new Point(645, 275)); + royalCatthusDesert.broadcastMessage(MaplePacketCreator.serverNotice(6, "Deo slowly appeared out of the sand dust.")); em.schedule("start", 3 * 60 *60 * 1000); } diff --git a/scripts/event/AreaBossDoor1.js b/scripts/event/AreaBossDoor1.js index e497823d06..68d447dbe4 100644 --- a/scripts/event/AreaBossDoor1.js +++ b/scripts/event/AreaBossDoor1.js @@ -41,17 +41,21 @@ function start() { var bossMobid = 9400610; var bossMapid = 677000003; var bossMsg = "Amdusias has appeared!"; - var bossPos = new Packages.java.awt.Point(467, 0); var map = em.getChannelServer().getMapFactory().getMap(bossMapid); if (map.getMonsterById(bossMobid) != null) { em.schedule("start", 3 * 60 * 60 * 1000); return; } - - var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid); + + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + + var boss = MapleLifeFactory.getMonster(bossMobid); + var bossPos = new Point(467, 0); map.spawnMonsterOnGroundBelow(boss, bossPos); - map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg)); + map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg)); em.schedule("start", 3 * 60 * 60 * 1000); } diff --git a/scripts/event/AreaBossDoor2.js b/scripts/event/AreaBossDoor2.js index 65bee99bc2..22380d50cf 100644 --- a/scripts/event/AreaBossDoor2.js +++ b/scripts/event/AreaBossDoor2.js @@ -41,17 +41,21 @@ function start() { var bossMobid = 9400609; var bossMapid = 677000005; var bossMsg = "Andras has appeared!"; - var bossPos = new Packages.java.awt.Point(201, 80); var map = em.getChannelServer().getMapFactory().getMap(bossMapid); if (map.getMonsterById(bossMobid) != null) { em.schedule("start", 3 * 60 * 60 * 1000); return; } - - var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + + var boss = MapleLifeFactory.getMonster(bossMobid); + var bossPos = new Point(201, 80); map.spawnMonsterOnGroundBelow(boss, bossPos); - map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg)); + map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg)); em.schedule("start", 3 * 60 * 60 * 1000); } diff --git a/scripts/event/AreaBossDoor3.js b/scripts/event/AreaBossDoor3.js index 20969b76e9..f9dfa38f08 100644 --- a/scripts/event/AreaBossDoor3.js +++ b/scripts/event/AreaBossDoor3.js @@ -41,17 +41,21 @@ function start() { var bossMobid = 9400613; var bossMapid = 677000009; var bossMsg = "Valefor has appeared!"; - var bossPos = new Packages.java.awt.Point(251, -841); var map = em.getChannelServer().getMapFactory().getMap(bossMapid); if (map.getMonsterById(bossMobid) != null) { em.schedule("start", 3 * 60 * 60 * 1000); return; } - - var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + + var boss = MapleLifeFactory.getMonster(bossMobid); + var bossPos = new Point(251, -841); map.spawnMonsterOnGroundBelow(boss, bossPos); - map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg)); + map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg)); em.schedule("start", 3 * 60 * 60 * 1000); } diff --git a/scripts/event/AreaBossDoor4.js b/scripts/event/AreaBossDoor4.js index e5965a9f3b..d58b2e7e0c 100644 --- a/scripts/event/AreaBossDoor4.js +++ b/scripts/event/AreaBossDoor4.js @@ -41,17 +41,21 @@ function start() { var bossMobid = 9400633; var bossMapid = 677000012; var bossMsg = "Astaroth has appeared!"; - var bossPos = new Packages.java.awt.Point(842, 0); var map = em.getChannelServer().getMapFactory().getMap(bossMapid); if (map.getMonsterById(bossMobid) != null) { em.schedule("start", 3 * 60 * 60 * 1000); return; } - - var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + + var boss = MapleLifeFactory.getMonster(bossMobid); + var bossPos = new Point(842, 0); map.spawnMonsterOnGroundBelow(boss, bossPos); - map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg)); + map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg)); em.schedule("start", 3 * 60 * 60 * 1000); } diff --git a/scripts/event/AreaBossDoor5.js b/scripts/event/AreaBossDoor5.js index cae6b7cf90..a8b1095794 100644 --- a/scripts/event/AreaBossDoor5.js +++ b/scripts/event/AreaBossDoor5.js @@ -41,17 +41,21 @@ function start() { var bossMobid = 9400612; var bossMapid = 677000001; var bossMsg = "Marbas has appeared!"; - var bossPos = new Packages.java.awt.Point(461, 61); var map = em.getChannelServer().getMapFactory().getMap(bossMapid); if (map.getMonsterById(bossMobid) != null) { em.schedule("start", 3 * 60 * 60 * 1000); return; } - - var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + + var boss = MapleLifeFactory.getMonster(bossMobid); + var bossPos = new Point(461, 61); map.spawnMonsterOnGroundBelow(boss, bossPos); - map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg)); + map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg)); em.schedule("start", 3 * 60 * 60 * 1000); } diff --git a/scripts/event/AreaBossDoor6.js b/scripts/event/AreaBossDoor6.js index 5576c7aa7f..3fdec07a5a 100644 --- a/scripts/event/AreaBossDoor6.js +++ b/scripts/event/AreaBossDoor6.js @@ -41,17 +41,21 @@ function start() { var bossMobid = 9400611; var bossMapid = 677000007; var bossMsg = "Crocell has appeared!"; - var bossPos = new Packages.java.awt.Point(171, 50); var map = em.getChannelServer().getMapFactory().getMap(bossMapid); if (map.getMonsterById(bossMobid) != null) { em.schedule("start", 3 * 60 * 60 * 1000); return; } - - var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + + var boss = MapleLifeFactory.getMonster(bossMobid); + var bossPos = new Point(171, 50); map.spawnMonsterOnGroundBelow(boss, bossPos); - map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg)); + map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg)); em.schedule("start", 3 * 60 * 60 * 1000); } diff --git a/scripts/event/AreaBossSnackBar.js b/scripts/event/AreaBossSnackBar.js index 46d966c384..97388176d6 100644 --- a/scripts/event/AreaBossSnackBar.js +++ b/scripts/event/AreaBossSnackBar.js @@ -41,19 +41,23 @@ function cancelSchedule() { function start() { var snackBarMap = em.getChannelServer().getMapFactory().getMap(105090310); - var snackBar = Packages.server.life.MapleLifeFactory.getMonster(8220008); - - if(snackBarMap.getMonsterById(8220008) != null || snackBarMap.getMonsterById(8220009) != null) { - em.schedule("start", 3 * 60 * 60 * 1000); - return; - } - - var setPos = [[-626, -604], [735, -600]]; - var rndPos = setPos[Math.floor(Math.random() * setPos.length)]; - - snackBarMap.spawnMonsterOnGroundBelow(snackBar, new Packages.java.awt.Point(rndPos[0], rndPos[1])); - snackBarMap.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Slowly, a suspicious food stand opens up on a strangely remote place.")); - em.schedule("start", 3 * 60 *60 * 1000); + + if (snackBarMap.getMonsterById(8220008) != null || snackBarMap.getMonsterById(8220009) != null) { + em.schedule("start", 3 * 60 * 60 * 1000); + return; + } + + var setPos = [[-626, -604], [735, -600]]; + var rndPos = setPos[Math.floor(Math.random() * setPos.length)]; + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + + var snackBar = MapleLifeFactory.getMonster(8220008); + snackBarMap.spawnMonsterOnGroundBelow(snackBar, new Point(rndPos[0], rndPos[1])); + snackBarMap.broadcastMessage(MaplePacketCreator.serverNotice(6, "Slowly, a suspicious food stand opens up on a strangely remote place.")); + em.schedule("start", 3 * 60 * 60 * 1000); } // ---------- FILLER FUNCTIONS ---------- diff --git a/scripts/event/AreaBossZeno.js b/scripts/event/AreaBossZeno.js index 9820efc538..348f03bce5 100644 --- a/scripts/event/AreaBossZeno.js +++ b/scripts/event/AreaBossZeno.js @@ -41,15 +41,19 @@ function cancelSchedule() { function start() { var graysPrairie = em.getChannelServer().getMapFactory().getMap(221040301); - var zeno = Packages.server.life.MapleLifeFactory.getMonster(6220001); if(graysPrairie.getMonsterById(6220001) != null) { em.schedule("start", 3 * 60 * 60 * 1000); return; } - - graysPrairie.spawnMonsterOnGroundBelow(zeno, new Packages.java.awt.Point(-4224, 776)); - graysPrairie.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Zeno has appeared with a heavy sound of machinery.")); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + + var zeno = MapleLifeFactory.getMonster(6220001); + graysPrairie.spawnMonsterOnGroundBelow(zeno, new Point(-4224, 776)); + graysPrairie.broadcastMessage(MaplePacketCreator.serverNotice(6, "Zeno has appeared with a heavy sound of machinery.")); em.schedule("start", 3 * 60 * 60 * 1000); } diff --git a/scripts/event/HenesysPQ.js b/scripts/event/HenesysPQ.js index 2b44f2a4a5..a2544bca81 100644 --- a/scripts/event/HenesysPQ.js +++ b/scripts/event/HenesysPQ.js @@ -249,8 +249,9 @@ function friendlyItemDrop(eim, mob) { if (mob.getId() == 9300061) { var cakes = eim.getIntProperty("bunnyCake") + 1; eim.setIntProperty("bunnyCake", cakes); - - mob.getMap().broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "The Moon Bunny made rice cake number " + cakes + ".")); + + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + mob.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny made rice cake number " + cakes + ".")); } } @@ -258,7 +259,8 @@ function friendlyDamaged(eim, mob) { if (mob.getId() == 9300061) { var bunnyDamage = eim.getIntProperty("bunnyDamaged") + 1; if (bunnyDamage > 5) { - broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "The Moon Bunny is feeling sick. Please protect it so it can make delicious rice cakes.")); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny is feeling sick. Please protect it so it can make delicious rice cakes.")); eim.setIntProperty("bunnyDamaged", 0); } } diff --git a/scripts/event/WeddingCathedral.js b/scripts/event/WeddingCathedral.js index 3bc5eacdf9..e49e90ff78 100644 --- a/scripts/event/WeddingCathedral.js +++ b/scripts/event/WeddingCathedral.js @@ -71,9 +71,11 @@ function setEventRewards(eim) { function spawnCakeBoss(eim) { var mapObj = eim.getMapInstance(680000400); - var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400606); - mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(777, -177)); + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + var mobObj = MapleLifeFactory.getMonster(9400606); + mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(777, -177)); } function setup(level, lobbyid) { @@ -125,10 +127,11 @@ function stopBlessings(eim) { function sendWeddingAction(eim, type) { var chr = eim.getLeader(); + const Wedding = Java.type('tools.packets.Wedding'); if(chr.getGender() == 0) { - chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1)); + chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1)); } else { - chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1)); + chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1)); } } @@ -137,12 +140,14 @@ function hidePriestMsg(eim) { } function showStartMsg(eim) { - eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 0)); + const Wedding = Java.type('tools.packets.Wedding'); + eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 0)); eim.schedule("hidePriestMsg", forceHideMsgTime * 1000); } function showBlessMsg(eim) { - eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 1)); + const Wedding = Java.type('tools.packets.Wedding'); + eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 1)); eim.setIntProperty("guestBlessings", 1); eim.schedule("hidePriestMsg", forceHideMsgTime * 1000); } diff --git a/scripts/event/WeddingChapel.js b/scripts/event/WeddingChapel.js index 4b53b39df6..904d707f4a 100644 --- a/scripts/event/WeddingChapel.js +++ b/scripts/event/WeddingChapel.js @@ -71,9 +71,11 @@ function setEventRewards(eim) { function spawnCakeBoss(eim) { var mapObj = eim.getMapInstance(680000400); - var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400606); - mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(777, -177)); + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + var mobObj = MapleLifeFactory.getMonster(9400606); + mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(777, -177)); } function setup(level, lobbyid) { @@ -125,10 +127,12 @@ function stopBlessings(eim) { function sendWeddingAction(eim, type) { var chr = eim.getLeader(); + + const Wedding = Java.type('tools.packets.Wedding'); if(chr.getGender() == 0) { - chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1)); + chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1)); } else { - chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1)); + chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1)); } } @@ -137,12 +141,14 @@ function hidePriestMsg(eim) { } function showStartMsg(eim) { - eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 0)); + const Wedding = Java.type('tools.packets.Wedding'); + eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 0)); eim.schedule("hidePriestMsg", forceHideMsgTime * 1000); } function showBlessMsg(eim) { - eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 1)); + const Wedding = Java.type('tools.packets.Wedding'); + eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 1)); eim.setIntProperty("guestBlessings", 1); eim.schedule("hidePriestMsg", forceHideMsgTime * 1000); } diff --git a/scripts/map/onUserEnter/108010600.js b/scripts/map/onUserEnter/108010600.js index 6d052cbc76..960ae7fe10 100644 --- a/scripts/map/onUserEnter/108010600.js +++ b/scripts/map/onUserEnter/108010600.js @@ -19,7 +19,8 @@ */ var npcid = 1104100; -var spawnPos = new Packages.java.awt.Point(2830, 78); +const Point = Java.type('java.awt.Point'); +var spawnPos = new Point(2830, 78); function start(ms) { var mapobj = ms.getMap(); diff --git a/scripts/map/onUserEnter/108010610.js b/scripts/map/onUserEnter/108010610.js index 2ec610e06c..e33a76dc87 100644 --- a/scripts/map/onUserEnter/108010610.js +++ b/scripts/map/onUserEnter/108010610.js @@ -19,7 +19,8 @@ */ var npcid = 1104101; -var spawnPos = new Packages.java.awt.Point(3395, -322); +const Point = Java.type('java.awt.Point'); +var spawnPos = new Point(3395, -322); function start(ms) { var mapobj = ms.getMap(); diff --git a/scripts/map/onUserEnter/108010620.js b/scripts/map/onUserEnter/108010620.js index 1857cb2d51..db35223e49 100644 --- a/scripts/map/onUserEnter/108010620.js +++ b/scripts/map/onUserEnter/108010620.js @@ -19,7 +19,8 @@ */ var npcid = 1104102; -var spawnPos = new Packages.java.awt.Point(500, -522); +const Point = Java.type('java.awt.Point'); +var spawnPos = new Point(500, -522); function start(ms) { var mapobj = ms.getMap(); diff --git a/scripts/map/onUserEnter/108010630.js b/scripts/map/onUserEnter/108010630.js index 9fa161fb75..325c893061 100644 --- a/scripts/map/onUserEnter/108010630.js +++ b/scripts/map/onUserEnter/108010630.js @@ -19,7 +19,8 @@ */ var npcid = 1104103; -var spawnPos = new Packages.java.awt.Point(-2263, -582); +const Point = Java.type('java.awt.Point'); +var spawnPos = new Point(-2263, -582); function start(ms) { var mapobj = ms.getMap(); diff --git a/scripts/map/onUserEnter/108010640.js b/scripts/map/onUserEnter/108010640.js index 3fc2fbb334..b57b1715ff 100644 --- a/scripts/map/onUserEnter/108010640.js +++ b/scripts/map/onUserEnter/108010640.js @@ -19,7 +19,8 @@ */ var npcid = 1104104; -var spawnPos = new Packages.java.awt.Point(372, 70); +const Point = Java.type('java.awt.Point'); +var spawnPos = new Point(372, 70); function start(ms) { var mapobj = ms.getMap(); diff --git a/scripts/npc/1012100.js b/scripts/npc/1012100.js index 5d44d1e5f1..698ba0031f 100644 --- a/scripts/npc/1012100.js +++ b/scripts/npc/1012100.js @@ -34,7 +34,8 @@ spawnPnpcFee = 7000000; jobType = 3; function start() { - if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) { + const GameConstants = Java.type('constants.game.GameConstants'); + if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; @@ -92,8 +93,10 @@ function action(mode, type, selection) { cm.dispose(); return; } - - if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + + const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC'); + const GameConstants = Java.type('constants.game.GameConstants'); + if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { diff --git a/scripts/npc/1022000.js b/scripts/npc/1022000.js index ccea9025d8..8e0ad6d308 100644 --- a/scripts/npc/1022000.js +++ b/scripts/npc/1022000.js @@ -35,7 +35,8 @@ spawnPnpcFee = 7000000; jobType = 1; function start() { - if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) { + const GameConstants = Java.type('constants.game.GameConstants'); + if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; @@ -93,8 +94,10 @@ function action(mode, type, selection) { cm.dispose(); return; } - - if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + + const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC'); + const GameConstants = Java.type('constants.game.GameConstants'); + if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { diff --git a/scripts/npc/1022101_old.js b/scripts/npc/1022101_old.js index e4cbe1975e..63a593d8c8 100644 --- a/scripts/npc/1022101_old.js +++ b/scripts/npc/1022101_old.js @@ -115,7 +115,8 @@ function action(mode, type, selection) { var useVP = false; if(!cm.hasItem(itemToUse) && vp > 0) useVP = true; - + + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); if(choice == 0) { // VP Exchange if(!cm.canHold(itemToUse)) { @@ -135,11 +136,12 @@ function action(mode, type, selection) { cm.gainItem(itemToUse, -1); cm.getPlayer().getCashShop().gainCash(1, nxAmount); - cm.getPlayer().announce(Packages.tools.MaplePacketCreator.earnTitleMessage("You have earned " + nxAmount + " NX")); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + cm.getPlayer().announce(MaplePacketCreator.earnTitleMessage("You have earned " + nxAmount + " NX")); cm.logLeaf(nxAmount + " NX"); cm.dispose(); } else if(choice == 2) { - if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.SETUP).isFull(chairAmount)) { + if(!cm.getPlayer().getInventory(MapleInventoryType.SETUP).isFull(chairAmount)) { var chairStr = ""; for(var i = 0; i < chairAmount; i++) { @@ -159,7 +161,7 @@ function action(mode, type, selection) { cm.sendOk("Please make sure you have enough space to hold the items!"); } } else if(choice == 3) { - if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.EQUIP).isFull(weaponAmount)) { + if(!cm.getPlayer().getInventory(MapleInventoryType.EQUIP).isFull(weaponAmount)) { var weaponStr = ""; for(var i = 0; i < weaponAmount; i++) { @@ -179,7 +181,7 @@ function action(mode, type, selection) { cm.sendOk("Please make sure you have enough space to hold the items!"); } } else if(choice == 4) { - if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.USE).isFull(2)) { + if(!cm.getPlayer().getInventory(MapleInventoryType.USE).isFull(2)) { cm.gainItem(buff1ID, buffAmount, true); cm.gainItem(buff2ID, buffAmount, true); cm.gainItem(itemToUse, -1); @@ -190,7 +192,7 @@ function action(mode, type, selection) { } } else if(choice == 5) { if(!cm.haveItem(5030000, 1)) { - if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.CASH).isFull(1)){ + if(!cm.getPlayer().getInventory(MapleInventoryType.CASH).isFull(1)){ cm.gainItem(5030000, 1, false, true, 1000 * 60 * 60 * 24 * hiredMerchantLength); if(useVP) diff --git a/scripts/npc/1032001.js b/scripts/npc/1032001.js index c10656286c..2aad6ef6b4 100644 --- a/scripts/npc/1032001.js +++ b/scripts/npc/1032001.js @@ -35,7 +35,8 @@ spawnPnpcFee = 7000000; jobType = 2; function start() { - if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) { + const GameConstants = Java.type('constants.game.GameConstants'); + if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; @@ -93,8 +94,10 @@ function action(mode, type, selection) { cm.dispose(); return; } - - if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + + const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC'); + const GameConstants = Java.type('constants.game.GameConstants'); + if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { diff --git a/scripts/npc/1052001.js b/scripts/npc/1052001.js index 9ab5b9f37d..090f7ebc02 100644 --- a/scripts/npc/1052001.js +++ b/scripts/npc/1052001.js @@ -34,7 +34,8 @@ spawnPnpcFee = 7000000; jobType = 4; function start() { - if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) { + const GameConstants = Java.type('constants.game.GameConstants'); + if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; @@ -94,8 +95,10 @@ function action(mode, type, selection) { cm.dispose(); return; } - - if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + + const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC'); + const GameConstants = Java.type('constants.game.GameConstants'); + if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { diff --git a/scripts/npc/1063000.js b/scripts/npc/1063000.js index ba1248310b..8fe5582c07 100644 --- a/scripts/npc/1063000.js +++ b/scripts/npc/1063000.js @@ -34,7 +34,8 @@ function start() { cm.gainItem(4031025,10); } else { - if(cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) { + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) { cm.sendNext("Check for a available slot on your ETC inventory."); cm.dispose(); return; diff --git a/scripts/npc/1063001.js b/scripts/npc/1063001.js index 2d4f3fad09..f5b3d1ca3f 100644 --- a/scripts/npc/1063001.js +++ b/scripts/npc/1063001.js @@ -34,7 +34,8 @@ function start() { cm.gainItem(4031026,20); } else { - if(cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) { + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) { cm.sendNext("Check for a available slot on your ETC inventory."); cm.dispose(); return; diff --git a/scripts/npc/1063002.js b/scripts/npc/1063002.js index 4b27a9bcd1..18aaf916ce 100644 --- a/scripts/npc/1063002.js +++ b/scripts/npc/1063002.js @@ -34,7 +34,8 @@ function start() { cm.gainItem(4031028,30); } else { - if(cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) { + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) { cm.sendNext("Check for a available slot on your ETC inventory."); cm.dispose(); return; diff --git a/scripts/npc/1063017.js b/scripts/npc/1063017.js index f31b772a52..1597b528ad 100644 --- a/scripts/npc/1063017.js +++ b/scripts/npc/1063017.js @@ -29,8 +29,10 @@ function action(mode, type, selection) { if(cm.getClient().getChannelServer().getMapFactory().getMap(925020010).getCharacters().size() > 0) { cm.sendOk("Someone is already challenging the Master. Try again later."); } else { - cm.getWarpMap(910510202).spawnMonsterOnGroundBelow(Packages.server.life.MapleLifeFactory.getMonster(9300346), new java.awt.Point(95, 200)); - cm.warp(910510202, 0); + const MapleLifeFactoroy = Java.type('server.life.MapleLifeFactoroy'); + const Point = Java.type('java.awt.Point'); + cm.getWarpMap(910510202).spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300346), new Point(95, 200)); + cm.warp(910510202, 0); } cm.dispose(); diff --git a/scripts/npc/1090000.js b/scripts/npc/1090000.js index 9ddce6bbbd..bb12416503 100644 --- a/scripts/npc/1090000.js +++ b/scripts/npc/1090000.js @@ -35,6 +35,7 @@ jobType = 5; var advQuest = 0; function start() { + const GameConstants = Java.type('constants.game.GameConstants'); if (cm.isQuestStarted(6330)) { if (cm.getEventInstance() != null) { // missing script for skill test found thanks to Jadeā„¢ advQuest = 5; // string visibility thanks to iPunchEm & Glvelturall @@ -63,7 +64,7 @@ function start() { cm.sendNext("Congratulations. You have managed to pass my test. I'll teach you a new skill called \"Battleship\".\r\n\r\n #s5221006# #b#q5221006##k"); } - } else if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) { + } else if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; @@ -141,8 +142,10 @@ function action(mode, type, selection) { cm.dispose(); return; } - - if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + + const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC'); + const GameConstants = Java.type('constants.game.GameConstants'); + if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { diff --git a/scripts/npc/11000.js b/scripts/npc/11000.js index 36f780f994..a787830c55 100644 --- a/scripts/npc/11000.js +++ b/scripts/npc/11000.js @@ -19,6 +19,7 @@ */ function start() { - Packages.server.MapleShopFactory.getInstance().getShop(11000).sendShop(cm.getClient()); + const MapleShopFactory = Java.type('server.MapleShopFactory'); + MapleShopFactory.getInstance().getShop(11000).sendShop(cm.getClient()); cm.dispose(); } diff --git a/scripts/npc/1102003.js b/scripts/npc/1102003.js index eb9c59c847..f1fe369d80 100644 --- a/scripts/npc/1102003.js +++ b/scripts/npc/1102003.js @@ -33,7 +33,8 @@ var maxJobType = 15; function start() { var jobType = parseInt(cm.getJobId() / 100); - if (jobType >= minJobType && jobType <= maxJobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) { + const GameConstants = Java.type('constants.game.GameConstants'); + if (jobType >= minJobType && jobType <= maxJobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; @@ -63,8 +64,10 @@ function action(mode, type, selection) { cm.dispose(); return; } - - if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + + const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC'); + const GameConstants = Java.type('constants.game.GameConstants'); + if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { diff --git a/scripts/npc/1104002.js b/scripts/npc/1104002.js index 6c486cb10f..52134cb4cc 100644 --- a/scripts/npc/1104002.js +++ b/scripts/npc/1104002.js @@ -33,8 +33,10 @@ function action(mode, type, selection) { if (mode == 0 && type > 0) { cm.getPlayer().dropMessage(5, "Eleanor: Oh, lost the Empress and still challenging us? Now you've done it! Prepare yourself!!!"); - - mapobj.spawnMonsterOnGroundBelow(Packages.server.life.MapleLifeFactory.getMonster(9001010), new Packages.java.awt.Point(850, 0)); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + mapobj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9001010), new Point(850, 0)); mapobj.destroyNPC(1104002); cm.dispose(); diff --git a/scripts/npc/1202010.js b/scripts/npc/1202010.js index 0978526cdf..f8d05c995c 100644 --- a/scripts/npc/1202010.js +++ b/scripts/npc/1202010.js @@ -5,7 +5,8 @@ var spawnPnpcFee = 7000000; var jobType = 21; function start() { - if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) { + const GameConstants = Java.type('constants.game.GameConstants'); + if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; @@ -35,8 +36,10 @@ function action(mode, type, selection) { cm.dispose(); return; } - - if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + + const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC'); + const GameConstants = Java.type('constants.game.GameConstants'); + if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { diff --git a/scripts/npc/2020008.js b/scripts/npc/2020008.js index dcaec7b027..58e8e81a94 100644 --- a/scripts/npc/2020008.js +++ b/scripts/npc/2020008.js @@ -142,7 +142,8 @@ function action(mode, type, selection){ if (cm.getPlayer().getLevel() >= 50){ cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); - if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); + const YamlConfig = Java.type('config.YamlConfig'); + if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); }else cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); cm.dispose(); diff --git a/scripts/npc/2020009.js b/scripts/npc/2020009.js index 17273222ae..ba0310fbcd 100644 --- a/scripts/npc/2020009.js +++ b/scripts/npc/2020009.js @@ -114,7 +114,8 @@ function action(mode, type, selection){ if (cm.getPlayer().getLevel() >= 50){ cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); - if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); + const YamlConfig = Java.type('config.YamlConfig'); + if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); }else cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); cm.dispose(); diff --git a/scripts/npc/2020010.js b/scripts/npc/2020010.js index 7716da2276..fbfa3def39 100644 --- a/scripts/npc/2020010.js +++ b/scripts/npc/2020010.js @@ -115,7 +115,8 @@ function action(mode, type, selection){ if (cm.getPlayer().getLevel() >= 50){ cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); - if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); + const YamlConfig = Java.type('config.YamlConfig'); + if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); }else cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); cm.dispose(); diff --git a/scripts/npc/2020011.js b/scripts/npc/2020011.js index 670f76d8f6..558ca4ab64 100644 --- a/scripts/npc/2020011.js +++ b/scripts/npc/2020011.js @@ -114,7 +114,8 @@ function action(mode, type, selection){ if (cm.getPlayer().getLevel() >= 50){ cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); - if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); + const YamlConfig = Java.type('config.YamlConfig'); + if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); }else cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); cm.dispose(); diff --git a/scripts/npc/2020013.js b/scripts/npc/2020013.js index 8e593311d4..209e650f49 100644 --- a/scripts/npc/2020013.js +++ b/scripts/npc/2020013.js @@ -113,7 +113,8 @@ function action(mode, type, selection){ if (cm.getPlayer().getLevel() >= 50){ cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); - if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); + const YamlConfig = Java.type('config.YamlConfig'); + if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); }else cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); cm.dispose(); diff --git a/scripts/npc/2042000.js b/scripts/npc/2042000.js index 1b20c94ed7..7d0bc50950 100644 --- a/scripts/npc/2042000.js +++ b/scripts/npc/2042000.js @@ -29,9 +29,10 @@ var feeMultiplier = 7.0; function start() { status = -1; - - if (!Packages.config.YamlConfig.config.server.USE_CPQ) { - if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + + const YamlConfig = Java.type('config.YamlConfig'); + if (!YamlConfig.config.server.USE_CPQ) { + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { status = 0; action(1, 0, 4); } else { @@ -57,7 +58,8 @@ function action(mode, type, selection) { status++; else status--; - + + const YamlConfig = Java.type('config.YamlConfig'); if (cm.getPlayer().getMapId() == 980000010) { if (status == 0) { cm.sendNext("I hope you had fun at the Monster Carnival!"); @@ -221,9 +223,9 @@ function action(mode, type, selection) { } } else { var party = cm.getParty().getMembers(); - if ((selection >= 0 && selection <= 3) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) { + if ((selection >= 0 && selection <= 3) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) { cm.sendOk("You need at least 2 players to participate in the battle!"); - } else if ((selection >= 4 && selection <= 5) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) { + } else if ((selection >= 4 && selection <= 5) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) { cm.sendOk("You need at least 3 players to participate in the battle!"); } else { cm.cpqLobby(selection); @@ -236,7 +238,7 @@ function action(mode, type, selection) { } else { if (status == 0) { var talk = "What would you like to do? If you have never participate in the Monster Carnival, you will need to know a few things before participating! \r\n#b#L0# Go to the Monster Carnival 1.#l \r\n#L3# Go to the Monster Carnival 2.#l \r\n#L1# Learn about the Monster Carnival.#l\r\n#L2# Trade #t4001129#.#l"; - if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { talk += "\r\n#L4# ... Can I just refine my ores?#l"; } cm.sendSimple(talk); @@ -497,8 +499,9 @@ function refineItems(refineType) { var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]]; var itemCount = {}; - - var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator(); + + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator(); while (iter.hasNext()) { var it = iter.next(); var itemid = it.getItemId(); @@ -551,7 +554,8 @@ function refineRockItems() { var rockItems = [4011007, 4021009]; var rockFees = [10000, 15000]; - var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator(); + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator(); while (iter.hasNext()) { var it = iter.next(); var itemid = it.getItemId(); diff --git a/scripts/npc/2042001.js b/scripts/npc/2042001.js index 7d57140f9e..c2b850a181 100644 --- a/scripts/npc/2042001.js +++ b/scripts/npc/2042001.js @@ -28,9 +28,10 @@ var feeMultiplier = 7.0; function start() { status = -1; - - if (!Packages.config.YamlConfig.config.server.USE_CPQ) { - if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + + const YamlConfig = Java.type('config.YamlConfig'); + if (!YamlConfig.config.server.USE_CPQ) { + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { status = 0; action(1, 0, 4); } else { @@ -56,7 +57,8 @@ function action(mode, type, selection) { status++; else status--; - + + const YamlConfig = Java.type('config.YamlConfig'); if (cm.getPlayer().getMapId() == 980000010) { if (status == 0) { cm.sendNext("I hope you had fun at the Monster Carnival!"); @@ -220,9 +222,9 @@ function action(mode, type, selection) { } } else { var party = cm.getParty().getMembers(); - if ((selection >= 0 && selection <= 3) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) { + if ((selection >= 0 && selection <= 3) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) { cm.sendOk("You need at least 2 players to participate in the battle!"); - } else if ((selection >= 4 && selection <= 5) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) { + } else if ((selection >= 4 && selection <= 5) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) { cm.sendOk("You need at least 3 players to participate in the battle!"); } else { cm.cpqLobby(selection); @@ -235,7 +237,7 @@ function action(mode, type, selection) { } else { if (status == 0) { var talk = "What would you like to do? If you have never participate in the Monster Carnival, you will need to know a few things before participating! \r\n#b#L0# Go to the Monster Carnival 1.#l \r\n#L3# Go to the Monster Carnival 2.#l \r\n#L1# Learn about the Monster Carnival.#l\r\n#L2# Trade #t4001129#.#l"; - if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { talk += "\r\n#L4# ... Can I just refine my ores?#l"; } cm.sendSimple(talk); @@ -496,8 +498,9 @@ function refineItems(refineType) { var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]]; var itemCount = {}; - - var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator(); + + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator(); while (iter.hasNext()) { var it = iter.next(); var itemid = it.getItemId(); @@ -550,7 +553,8 @@ function refineRockItems() { var rockItems = [4011007, 4021009]; var rockFees = [10000, 15000]; - var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator(); + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator(); while (iter.hasNext()) { var it = iter.next(); var itemid = it.getItemId(); diff --git a/scripts/npc/2042002.js b/scripts/npc/2042002.js index 8ffd18763d..64416da13d 100644 --- a/scripts/npc/2042002.js +++ b/scripts/npc/2042002.js @@ -29,8 +29,9 @@ var feeMultiplier = 7.0; function start() { status = -1; - if (!Packages.config.YamlConfig.config.server.USE_CPQ) { - if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + const YamlConfig = Java.type('config.YamlConfig'); + if (!YamlConfig.config.server.USE_CPQ) { + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { status = 0; action(1, 0, 4); } else { @@ -235,7 +236,9 @@ function action(mode, type, selection) { } else { if (status == 0) { var talk = "What would you like to do? If you have never participate in the Monster Carnival, you will need to know a few things before participating! \r\n#b#L0# Go to the Monster Carnival 1.#l \r\n#L3# Go to the Monster Carnival 2.#l \r\n#L1# Learn about the Monster Carnival.#l\r\n#L2# Trade #t4001129#.#l"; - if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + + const YamlConfig = Java.type('config.YamlConfig'); + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { talk += "\r\n#L4# ... Can I just refine my ores?#l"; } cm.sendSimple(talk); @@ -496,8 +499,9 @@ function refineItems(refineType) { var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]]; var itemCount = {}; - - var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator(); + + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator(); while (iter.hasNext()) { var it = iter.next(); var itemid = it.getItemId(); @@ -550,7 +554,8 @@ function refineRockItems() { var rockItems = [4011007, 4021009]; var rockFees = [10000, 15000]; - var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator(); + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator(); while (iter.hasNext()) { var it = iter.next(); var itemid = it.getItemId(); diff --git a/scripts/npc/2042005.js b/scripts/npc/2042005.js index efb085c16a..61ea554dd1 100644 --- a/scripts/npc/2042005.js +++ b/scripts/npc/2042005.js @@ -77,9 +77,10 @@ function action(mode, type, selection) { } } else { var party = cm.getParty().getMembers(); - if ((selection === 0 || selection === 1 ) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) { + const YamlConfig = Java.type('config.YamlConfig'); + if ((selection === 0 || selection === 1 ) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) { cm.sendOk("You need at least 2 players to participate in the battle!"); - } else if ((selection === 2 ) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) { + } else if ((selection === 2 ) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) { cm.sendOk("You need at least 3 players to participate in the battle!"); } else { cm.cpqLobby2(selection); diff --git a/scripts/npc/2082014.js b/scripts/npc/2082014.js index 6b0eac71fd..291e0b3ded 100644 --- a/scripts/npc/2082014.js +++ b/scripts/npc/2082014.js @@ -39,7 +39,8 @@ function action(mode, type, selection) { status--; if(status == 0) { - if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + const YamlConfig = Java.type('config.YamlConfig'); + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { cm.openShopNPC(2082014); } else if (cm.isQuestStarted(3749)) { cm.sendOk("We've already located the enemy's ultimate weapon! Follow along the ship's bow area ahead and you will find my sister #b#p2082013##k. Report to her for futher instructions on the mission."); diff --git a/scripts/npc/2083000.js b/scripts/npc/2083000.js index ee3b07b2f6..96622940da 100644 --- a/scripts/npc/2083000.js +++ b/scripts/npc/2083000.js @@ -43,9 +43,10 @@ function action(mode, type, selection) { else status--; if (status == 0) { + const YamlConfig = Java.type('config.YamlConfig'); if(cm.haveItem(4001086)) { cm.sendYesNo("Do you want to access #b#m240050400##k right now?"); - } else if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS) { + } else if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS) { if(canBypassHTPQ()) { cm.sendYesNo("Do you want to access #b#m240050400##k right now?"); } else { diff --git a/scripts/npc/2101017.js b/scripts/npc/2101017.js index 6766b737fd..27302f3aa6 100644 --- a/scripts/npc/2101017.js +++ b/scripts/npc/2101017.js @@ -29,6 +29,7 @@ function action(mode, type, selection) { return; } + const GameConstants = Java.type('constants.game.GameConstants'); if (cm.getPlayer().getMapId() == 980010100 || cm.getPlayer().getMapId() == 980010200 || cm.getPlayer().getMapId() == 980010300) { if (cm.getPlayer().getMapId() == 980010100) { exped = MapleExpeditionType.ARIANT; @@ -113,7 +114,7 @@ function action(mode, type, selection) { status = 2; } } - } else if (Packages.constants.game.GameConstants.isAriantColiseumArena(cm.getPlayer().getMapId())) { + } else if (GameConstants.isAriantColiseumArena(cm.getPlayer().getMapId())) { if (cm.getPlayer().getMapId() == 980010101) { exped = MapleExpeditionType.ARIANT; expedicao = cm.getExpedition(exped); diff --git a/scripts/npc/9000017.js b/scripts/npc/9000017.js index 7ec1630216..c001a09481 100644 --- a/scripts/npc/9000017.js +++ b/scripts/npc/9000017.js @@ -51,7 +51,8 @@ function action(mode, type, selection) { } if (status == 0) { - if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + const YamlConfig = Java.type('config.YamlConfig'); + if (!YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { cm.sendOk("Hi, I'm #b#p" + cm.getNpc() + "##k."); cm.dispose(); return; diff --git a/scripts/npc/9000019.js b/scripts/npc/9000019.js index c5c20ae161..7dac2aa966 100644 --- a/scripts/npc/9000019.js +++ b/scripts/npc/9000019.js @@ -17,15 +17,17 @@ function action(mode, type, selection) { status++; else status--; - + if(status == 0) { - if(cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) { + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) { cm.sendNext("Check for a available slot on your ETC inventory."); cm.dispose(); return; } - - cm.getClient().announce(Packages.tools.MaplePacketCreator.openRPSNPC()); + + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + cm.getClient().announce(MaplePacketCreator.openRPSNPC()); cm.dispose(); } } diff --git a/scripts/npc/9000036.js b/scripts/npc/9000036.js index 247353a8a4..73c6e933e9 100644 --- a/scripts/npc/9000036.js +++ b/scripts/npc/9000036.js @@ -39,7 +39,8 @@ var equip; var maxEqp = 0; function start() { - if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + const YamlConfig = Java.type('config.YamlConfig'); + if (!YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { cm.sendOk("Hi, I'm #b#p" + cm.getNpc() + "##k."); cm.dispose(); return; diff --git a/scripts/npc/9000041.js b/scripts/npc/9000041.js index 45d4b1aeac..6437f55ebd 100644 --- a/scripts/npc/9000041.js +++ b/scripts/npc/9000041.js @@ -42,7 +42,8 @@ function action(mode, type, selection) { } if (status == 0) { - if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + const YamlConfig = Java.type('config.YamlConfig'); + if (!YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { cm.sendOk("The medal ranking system is currently unavailable..."); cm.dispose(); return; diff --git a/scripts/npc/9010021.js b/scripts/npc/9010021.js index 0abd074218..07c5e87e62 100644 --- a/scripts/npc/9010021.js +++ b/scripts/npc/9010021.js @@ -26,7 +26,8 @@ function start() { status = -1; - if (!Packages.config.YamlConfig.config.server.USE_REBIRTH_SYSTEM) { + const YamlConfig = Java.type('config.YamlConfig'); + if (!YamlConfig.config.server.USE_REBIRTH_SYSTEM) { cm.sendOk("... I came from distant planes to assist the fight against the #rBlack Magician#k. Right now I search my master, have you seen him?"); cm.dispose(); return; diff --git a/scripts/npc/9201047.js b/scripts/npc/9201047.js index 1c28526bee..faa4730731 100644 --- a/scripts/npc/9201047.js +++ b/scripts/npc/9201047.js @@ -65,9 +65,11 @@ function action(mode, type, selection) { var mapObj = cm.getMap(); mapObj.toggleDrops(); - - var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400518); - mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(-245, 810)); + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + var mobObj = MapleLifeFactory.getMonster(9400518); + mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(-245, 810)); cm.sendOk("The fierry appeared! Defeat it to get the #b#t4031596##k!"); } else { diff --git a/scripts/npc/9201101.js b/scripts/npc/9201101.js index c424e7dcd9..4232739755 100644 --- a/scripts/npc/9201101.js +++ b/scripts/npc/9201101.js @@ -4,7 +4,8 @@ */ function start() { - if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + const YamlConfig = Java.type('config.YamlConfig'); + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { cm.openShopNPC(9201101); } else { //cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city."); diff --git a/scripts/npc/MagatiaPassword.js b/scripts/npc/MagatiaPassword.js index eaab5b7a19..340e7b52cb 100644 --- a/scripts/npc/MagatiaPassword.js +++ b/scripts/npc/MagatiaPassword.js @@ -21,7 +21,8 @@ function action(mode, type, selection){ else if(status == 1){ if(cm.getText() == cm.getQuestProgress(3360)){ cm.setQuestProgress(3360, 1); - cm.getPlayer().announce(Packages.tools.MaplePacketCreator.playPortalSound()); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); + cm.getPlayer().announce(MaplePacketCreator.playPortalSound()); cm.warp(261030000, "sp_" + ((cm.getMapId() == 261010000) ? "jenu" : "alca")); } else { diff --git a/scripts/npc/changeName.js b/scripts/npc/changeName.js index b0b81f2b20..a684dc9b1e 100644 --- a/scripts/npc/changeName.js +++ b/scripts/npc/changeName.js @@ -46,7 +46,9 @@ function action(mode, type, selection) { cm.sendGetText("Please input your desired name below."); } else if(status == 2) { var text = cm.getText(); - var canCreate = Packages.client.MapleCharacter.canCreateChar(text); + + const MapleCharacter = Java.type('client.MapleCharacter'); + var canCreate = MapleCharacter.canCreateChar(text); if(canCreate) { cm.getPlayer().setName(text); cm.sendOk("Your name has been changed to #b" + text + "#k. You will have to login again for this to take effect.", 1); diff --git a/scripts/npc/gachaponInfo.js b/scripts/npc/gachaponInfo.js index 2a63279a1b..68dad89a8d 100644 --- a/scripts/npc/gachaponInfo.js +++ b/scripts/npc/gachaponInfo.js @@ -27,8 +27,9 @@ var status; var gachaMessages; function start() { - gachaMessages = Packages.server.gachapon.MapleGachapon.Gachapon.getLootInfo(); - gachas = Packages.server.gachapon.MapleGachapon.Gachapon.values(); + const MapleGachapon = Java.type('server.gachapon.MapleGachapon'); + gachaMessages = MapleGachapon.Gachapon.getLootInfo(); + gachas = MapleGachapon.Gachapon.values(); status = -1; action(1, 0, 0); diff --git a/scripts/npc/mapleTV.js b/scripts/npc/mapleTV.js index 93c58b5d66..5a66c176d9 100644 --- a/scripts/npc/mapleTV.js +++ b/scripts/npc/mapleTV.js @@ -24,7 +24,8 @@ var status; function start() { - if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + const YamlConfig = Java.type('config.YamlConfig'); + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { cm.dispose(); cm.openNpc(9201088, "scroll_generator"); return; diff --git a/scripts/portal/enterInfo.js b/scripts/portal/enterInfo.js index 466f53f0cd..aedd9c1f75 100644 --- a/scripts/portal/enterInfo.js +++ b/scripts/portal/enterInfo.js @@ -1,7 +1,9 @@ function enter(pi) { var mapobj = pi.getWarpMap(104000004); if(pi.isQuestActive(21733) && pi.getQuestProgressInt(21733, 9300345) == 0 && mapobj.countMonsters() == 0) { - mapobj.spawnMonsterOnGroundBelow(Packages.server.life.MapleLifeFactory.getMonster(9300345), new java.awt.Point(0, 0)); + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + mapobj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300345), new Point(0, 0)); pi.setQuestProgress(21733, 21762, 2); } diff --git a/scripts/portal/enterNepenthes.js b/scripts/portal/enterNepenthes.js index 9963a6fb2f..7a5f1393b2 100644 --- a/scripts/portal/enterNepenthes.js +++ b/scripts/portal/enterNepenthes.js @@ -6,8 +6,10 @@ function enter(pi) { if(mapobj1.countPlayers() == 0 && mapobj2.countPlayers() == 0) { mapobj1.resetPQ(1); mapobj2.resetPQ(1); - - mapobj2.spawnMonsterOnGroundBelow(Packages.server.life.MapleLifeFactory.getMonster(9300348), new Packages.java.awt.Point(591, -34)); + + 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; diff --git a/scripts/portal/rankDeveloperRoom.js b/scripts/portal/rankDeveloperRoom.js index 4b6e3c6987..2ec93fc548 100644 --- a/scripts/portal/rankDeveloperRoom.js +++ b/scripts/portal/rankDeveloperRoom.js @@ -1,6 +1,7 @@ function enter(pi) { if (pi.getPlayer().getMapId() != 777777777) { - if(!Packages.net.server.Server.getInstance().canEnterDeveloperRoom()) { + const Server = Java.type('net.server.Server'); + if(!Server.getInstance().canEnterDeveloperRoom()) { pi.message("The next room is currently unavailable."); return false; } diff --git a/scripts/quest/20201.js b/scripts/quest/20201.js index 3a19a62fdb..32be42207f 100644 --- a/scripts/quest/20201.js +++ b/scripts/quest/20201.js @@ -54,7 +54,8 @@ function end(mode, type, selection) { } qm.gainItem(4032096, -30); qm.gainItem(1142067, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.DAWNWARRIOR2); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.DAWNWARRIOR2); qm.completeQuest(); } qm.sendNext("You are a Knight-in-Training no more. You are now an official knight of the Cygnus Knights."); diff --git a/scripts/quest/20202.js b/scripts/quest/20202.js index 81f667696d..818e6d44df 100644 --- a/scripts/quest/20202.js +++ b/scripts/quest/20202.js @@ -54,7 +54,8 @@ function end(mode, type, selection) { } qm.gainItem(4032097, -30); qm.gainItem(1142067, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.BLAZEWIZARD2); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.BLAZEWIZARD2); qm.completeQuest(); } qm.sendNext("You are no longer a Knight-in-Training. You are now an official Cygnus Knight!"); diff --git a/scripts/quest/20203.js b/scripts/quest/20203.js index ab3a264cd4..e39be7bd65 100644 --- a/scripts/quest/20203.js +++ b/scripts/quest/20203.js @@ -54,7 +54,8 @@ function end(mode, type, selection) { } qm.gainItem(4032098, -30); qm.gainItem(1142067, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.WINDARCHER2); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.WINDARCHER2); qm.completeQuest(); } qm.sendNext("You are no longer a Knight-in-Training. You are now officially a Cygnus Knight."); diff --git a/scripts/quest/20204.js b/scripts/quest/20204.js index 496abb1d95..58a995c9df 100644 --- a/scripts/quest/20204.js +++ b/scripts/quest/20204.js @@ -54,7 +54,8 @@ function end(mode, type, selection) { } qm.gainItem(4032099, -30); qm.gainItem(1142067, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.NIGHTWALKER2); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.NIGHTWALKER2); qm.completeQuest(); } qm.sendNext("You are no longer a Knight-in-Training. You have officially become a Cygnus Knight."); diff --git a/scripts/quest/20205.js b/scripts/quest/20205.js index d842fb9e5f..c9c5cc94be 100644 --- a/scripts/quest/20205.js +++ b/scripts/quest/20205.js @@ -54,7 +54,8 @@ function end(mode, type, selection) { } qm.gainItem(4032100, -30); qm.gainItem(1142067, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.THUNDERBREAKER2); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.THUNDERBREAKER2); qm.completeQuest(); } qm.sendNext("You are now no longer a Knight-in-Training. You have now officially become a Cygnus Knight."); diff --git a/scripts/quest/20311.js b/scripts/quest/20311.js index 4075738092..5a7723caef 100644 --- a/scripts/quest/20311.js +++ b/scripts/quest/20311.js @@ -54,7 +54,8 @@ function start(mode, type, selection) { } else { qm.completeQuest(); qm.gainItem(1142068, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.DAWNWARRIOR3); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.DAWNWARRIOR3); qm.sendOk("#h #, as of this moment, you are an Advanced Knight. From this moment on, you shall carry yourself with dignity and respect befitting your new title, an Advanced Knight of Cygnus Knights. May your glory continue to shine as bright as this moment."); } } diff --git a/scripts/quest/20312.js b/scripts/quest/20312.js index b562dea87e..1f5fcdbe21 100644 --- a/scripts/quest/20312.js +++ b/scripts/quest/20312.js @@ -54,7 +54,8 @@ function start(mode, type, selection) { } else { qm.completeQuest(); qm.gainItem(1142068, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.BLAZEWIZARD3); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.BLAZEWIZARD3); qm.sendOk("#h #, as of this moment, you are an Advanced Knight. From this moment on, you will train yourself with fervor as you will lead your group of Knights for the safety of this world. That fervor will provide you with plenty of courage."); } } diff --git a/scripts/quest/20313.js b/scripts/quest/20313.js index 58e7a89064..8f87176ee8 100644 --- a/scripts/quest/20313.js +++ b/scripts/quest/20313.js @@ -54,7 +54,8 @@ function start(mode, type, selection) { } else { qm.completeQuest(); qm.gainItem(1142068, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.WINDARCHER3); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.WINDARCHER3); qm.sendOk("#h #, as of this moment, you are an Advanced Knight. From this moment on, you will be carrying a while lot of responsibility befitting your new title as an Advanced Knight of Cygnus Knights. You may view the world in a carefree mode, but please remember what your mission is."); } } diff --git a/scripts/quest/20314.js b/scripts/quest/20314.js index be6c955c90..785fbbda4b 100644 --- a/scripts/quest/20314.js +++ b/scripts/quest/20314.js @@ -53,7 +53,8 @@ function start(mode, type, selection) { qm.sendNext("If you wish to receive the medal befitting the title, you may want to make some room in your equipment inventory."); } else { qm.gainItem(1142068, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.NIGHTWALKER3); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.NIGHTWALKER3); qm.completeQuest(); qm.sendOk("#h #, from here on out, you are an Advanced Knight of Cygnus Knights. The title comes with a newfound broad view on everything. You may encounter temptations here and there, but I want you to keep your faith and beliefs intact and do not succumb to the darkness."); } diff --git a/scripts/quest/20315.js b/scripts/quest/20315.js index 073fc6da8b..bccbc89910 100644 --- a/scripts/quest/20315.js +++ b/scripts/quest/20315.js @@ -53,7 +53,8 @@ function start(mode, type, selection) { qm.sendNext("If you wish to receive the medal befitting the title, you may want to make some room in your equipment inventory."); } else { qm.gainItem(1142068, 1); - qm.getPlayer().changeJob(Packages.client.MapleJob.THUNDERBREAKER3); + const MapleJob = Java.type('client.MapleJob'); + qm.getPlayer().changeJob(MapleJob.THUNDERBREAKER3); qm.completeQuest(); qm.sendOk("#h #, from here on out, you will become an Advanced Knight of the Knights of Cygnus! As your standing rises, so does the difficulty of the tasks you will be receiving. But challenge is good, right? You have to enjoy life. Enjoy what's given to you!"); } diff --git a/scripts/quest/2316.js b/scripts/quest/2316.js index 99ab0f8d2f..6e4adf133b 100644 --- a/scripts/quest/2316.js +++ b/scripts/quest/2316.js @@ -23,10 +23,10 @@ function start(mode, type, selection) { } if (status == 0) qm.sendAcceptDecline("I think i've heard of a potion that breaks these kinds of barriers. I think it's called #bKiller Mushroom Spores#k? Hmmm... outside, you'll find the Mushroom Scholar #bScarrs#k waiting outside. #bScarrs#k is an expert on mushrooms, so go talk to him."); - else if (status == 1){ + else if (status == 1) { qm.forceStartQuest(); qm.sendOk("I am confident #kScarrs#k will do everything to help you."); - else if (status == 2){ + } else if (status == 2){ qm.dispose(); } } diff --git a/scripts/quest/3239.js b/scripts/quest/3239.js index 4e89e74cca..2ba8548747 100644 --- a/scripts/quest/3239.js +++ b/scripts/quest/3239.js @@ -4,25 +4,27 @@ function end(mode, type, selection) { if (mode == -1) { qm.dispose(); } else { - if(mode == 0 && type > 0) { + if (mode == 0 && type > 0) { qm.dispose(); return; } - - if (mode == 1) + + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 0) { - if(qm.haveItem(4031092, 10)) { - if(qm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.USE).getNumFreeSlot() >= 1) { + if (qm.haveItem(4031092, 10)) { + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + if (qm.getPlayer().getInventory(MapleInventoryType.USE).getNumFreeSlot() >= 1) { qm.sendOk("Well done! You brought back all the #t4031092# that were missing. Here, take this scroll as a token of my gratitude..."); - } else { + } else { qm.sendOk("Free a space on your USE inventory before receiving your prize."); qm.dispose(); return; - } + } } else { qm.sendOk("Please return me 10 #t4031092# that went missing on this room."); qm.dispose(); @@ -30,12 +32,17 @@ function end(mode, type, selection) { } } else if (status == 1) { qm.gainItem(4031092, -10); - + rnd = Math.floor(Math.random() * 4); - if(rnd == 0) qm.gainItem(2040704, 1); - else if(rnd == 1) qm.gainItem(2040705, 1); - else if(rnd == 2) qm.gainItem(2040707, 1); - else qm.gainItem(2040708, 1); + if (rnd == 0) { + qm.gainItem(2040704, 1); + } else if (rnd == 1) { + qm.gainItem(2040705, 1); + } else if (rnd == 2) { + qm.gainItem(2040707, 1); + } else { + qm.gainItem(2040708, 1); + } qm.gainExp(2700); qm.forceCompleteQuest(); diff --git a/scripts/quest/3437.js b/scripts/quest/3437.js index 00d524e968..da1ddd9077 100644 --- a/scripts/quest/3437.js +++ b/scripts/quest/3437.js @@ -13,7 +13,8 @@ function end(mode, type, selection) { if(status == 0) { qm.sendNext("What the? Are you telling me you've already taken out 150 #o4230120#s? And these ... yes, these really are 120 #t4000122#s. I was wondering how you were going to complete this mission all by yourself, but you took care of it just fine. Alright, here ... this is a very important item for me, but please take it."); } else if(status == 1) { - if(qm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.EQUIP).getNumFreeSlot() < 1) { + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + if(qm.getPlayer().getInventory(MapleInventoryType.EQUIP).getNumFreeSlot() < 1) { qm.sendOk("Please free a EQUIP inventory slot to receive the reward."); qm.dispose(); return; diff --git a/scripts/quest/3454.js b/scripts/quest/3454.js index 84f2c77bf4..b6d0ebb721 100644 --- a/scripts/quest/3454.js +++ b/scripts/quest/3454.js @@ -44,7 +44,8 @@ function end(mode, type, selection) { status--; if (status == 0) { - if(qm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) { + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + if(qm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) { qm.sendOk("Make room on your ETC inventory first."); qm.dispose(); return;