diff --git a/scripts/npc/1032102.js b/scripts/npc/1032102.js index f21adf1da7..d63a19f77e 100644 --- a/scripts/npc/1032102.js +++ b/scripts/npc/1032102.js @@ -9,10 +9,6 @@ Dragon Evolver */ -importPackage(Packages.client.inventory); -importPackage(Packages.client.inventory.manipulator); -importPackage(Packages.server); - var status; function start() { @@ -105,6 +101,8 @@ function action(mode, type, selection) { } } else if (status == 2) { if (selection == 0) { + const MapleInventoryManipulator = Java.type('client.inventory.manipulator.MapleInventoryManipulator'); + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); MapleInventoryManipulator.removeFromSlot(cm.getClient(), MapleInventoryType.CASH, 1, 1, true); cm.sendOk("Your cash first slot is removed."); } else if (selection == 1) { diff --git a/scripts/npc/1032109.js b/scripts/npc/1032109.js index a21274ad52..450b9f56f8 100644 --- a/scripts/npc/1032109.js +++ b/scripts/npc/1032109.js @@ -3,7 +3,6 @@ MAP: Hidden Street - Magic Library (910110000) QUEST: Maybe it's Grendel! (20718) */ -importPackage(Packages.server.life); var status; var mobId = 2220100; //Blue Mushroom @@ -36,12 +35,14 @@ function action(mode, type, selection){ var player = cm.getPlayer(); var map = player.getMap(); + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); for(var i = 0; i < 10; i++) - map.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new java.awt.Point(117, 183)); + map.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new Point(117, 183)); for(var i = 0; i < 10; i++) - map.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new java.awt.Point(4, 183)); + map.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new Point(4, 183)); for(var i = 0; i < 10; i++) - map.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new java.awt.Point(-109, 183)); + map.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new Point(-109, 183)); cm.completeQuest(20718, 1103003); cm.gainExp(4000 * cm.getPlayer().getExpRate()); diff --git a/scripts/npc/1052115.js b/scripts/npc/1052115.js index 43cc74e55d..43644d2d90 100644 --- a/scripts/npc/1052115.js +++ b/scripts/npc/1052115.js @@ -1,6 +1,5 @@ var status = 0; var section = 0; -importPackage(java.lang); //questid 29931, infoquest 7662 function start() { diff --git a/scripts/npc/1061014.js b/scripts/npc/1061014.js index d5fb6da0f1..0ac0837bc1 100644 --- a/scripts/npc/1061014.js +++ b/scripts/npc/1061014.js @@ -23,16 +23,13 @@ *@author Ronan */ -importPackage(Packages.server.expeditions); -importPackage(Packages.tools); -importPackage(Packages.scripting.event); - var status = 0; var expedition; var expedMembers; var player; var em; -var exped = MapleExpeditionType.BALROG_NORMAL; +const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType'); +const exped = MapleExpeditionType.BALROG_NORMAL; var expedName = "Balrog"; var expedBoss = "Balrog"; var expedMap = "Balrog's Tomb"; @@ -159,6 +156,7 @@ function action(mode, type, selection) { cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); diff --git a/scripts/npc/1101001.js b/scripts/npc/1101001.js index 138d871853..c9947c92f5 100644 --- a/scripts/npc/1101001.js +++ b/scripts/npc/1101001.js @@ -3,9 +3,9 @@ Map(s): Erev Description: 3rd job KoC Buff */ -importPackage(Packages.constants.game); function start() { + const GameConstants = Java.type('constants.game.GameConstants'); if (cm.getPlayer().isCygnus() && GameConstants.getJobBranch(cm.getJob()) > 2) { cm.useItem(2022458); cm.sendOk("Let me cast you my blessings, my Knight. Please protect the world of Maple...."); diff --git a/scripts/npc/1104100.js b/scripts/npc/1104100.js index c06a406909..4a0a663049 100644 --- a/scripts/npc/1104100.js +++ b/scripts/npc/1104100.js @@ -18,8 +18,6 @@ along with this program. If not, see . */ -importPackage(Packages.server.life); - var npcid = 1104100; var baseJob = 11; var status; @@ -64,7 +62,9 @@ function action(mode, type, selection) { function spawnMob(x, y, id, map) { if(map.getMonsterById(id) != null) return; - + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); var mob = MapleLifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/1104101.js b/scripts/npc/1104101.js index 5f5583723b..b6be6958fe 100644 --- a/scripts/npc/1104101.js +++ b/scripts/npc/1104101.js @@ -18,8 +18,6 @@ along with this program. If not, see . */ -importPackage(Packages.server.life); - var npcid = 1104101; var baseJob = 12; var status; @@ -64,7 +62,9 @@ function action(mode, type, selection) { function spawnMob(x, y, id, map) { if(map.getMonsterById(id) != null) return; - + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); var mob = MapleLifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/1104102.js b/scripts/npc/1104102.js index 1cfb03eabc..c78f05607e 100644 --- a/scripts/npc/1104102.js +++ b/scripts/npc/1104102.js @@ -18,8 +18,6 @@ along with this program. If not, see . */ -importPackage(Packages.server.life); - var npcid = 1104102; var baseJob = 13; var status; @@ -64,7 +62,9 @@ function action(mode, type, selection) { function spawnMob(x, y, id, map) { if(map.getMonsterById(id) != null) return; - + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); var mob = MapleLifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/1104103.js b/scripts/npc/1104103.js index c714175c66..1ad5d6543a 100644 --- a/scripts/npc/1104103.js +++ b/scripts/npc/1104103.js @@ -18,8 +18,6 @@ along with this program. If not, see . */ -importPackage(Packages.server.life); - var npcid = 1104103; var baseJob = 14; var status; @@ -64,7 +62,9 @@ function action(mode, type, selection) { function spawnMob(x, y, id, map) { if(map.getMonsterById(id) != null) return; - + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); var mob = MapleLifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/1104104.js b/scripts/npc/1104104.js index aa95603b72..5ee093086f 100644 --- a/scripts/npc/1104104.js +++ b/scripts/npc/1104104.js @@ -18,8 +18,6 @@ along with this program. If not, see . */ -importPackage(Packages.server.life); - var npcid = 1104104; var baseJob = 15; var status; @@ -64,7 +62,9 @@ function action(mode, type, selection) { function spawnMob(x, y, id, map) { if(map.getMonsterById(id) != null) return; - + + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); var mob = MapleLifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/2012027.js b/scripts/npc/2012027.js index 9c32b31421..6d78795cd2 100644 --- a/scripts/npc/2012027.js +++ b/scripts/npc/2012027.js @@ -21,8 +21,6 @@ Hidden Street - Eliza’s Garden (200010303) */ -importPackage(Packages.tools); - var status; var harpNote = 'C'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu @@ -47,6 +45,7 @@ function action(mode, type, selection) { status--; if(status == 0) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); if(cm.isQuestStarted(3114)) { @@ -54,7 +53,7 @@ function action(mode, type, selection) { if(idx > -1) { var nextNote = harpSong[idx]; - + if(harpNote != nextNote) { cm.setQuestProgress(3114, 0); diff --git a/scripts/npc/2012028.js b/scripts/npc/2012028.js index 960dad19f9..43627b8b8a 100644 --- a/scripts/npc/2012028.js +++ b/scripts/npc/2012028.js @@ -21,8 +21,6 @@ Hidden Street - Eliza’s Garden (200010303) */ -importPackage(Packages.tools); - var status; var harpNote = 'D'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu @@ -45,8 +43,9 @@ function action(mode, type, selection) { status++; else status--; - + if(status == 0) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); if(cm.isQuestStarted(3114)) { diff --git a/scripts/npc/2012029.js b/scripts/npc/2012029.js index 3a242c3659..9b5a7ab270 100644 --- a/scripts/npc/2012029.js +++ b/scripts/npc/2012029.js @@ -21,8 +21,6 @@ Hidden Street - Eliza’s Garden (200010303) */ -importPackage(Packages.tools); - var status; var harpNote = 'E'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu @@ -47,6 +45,7 @@ function action(mode, type, selection) { status--; if(status == 0) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); if(cm.isQuestStarted(3114)) { diff --git a/scripts/npc/2012030.js b/scripts/npc/2012030.js index 05a7120a4f..c7a6590218 100644 --- a/scripts/npc/2012030.js +++ b/scripts/npc/2012030.js @@ -21,8 +21,6 @@ Hidden Street - Eliza’s Garden (200010303) */ -importPackage(Packages.tools); - var status; var harpNote = 'F'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu @@ -47,6 +45,7 @@ function action(mode, type, selection) { status--; if(status == 0) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); if(cm.isQuestStarted(3114)) { diff --git a/scripts/npc/2012031.js b/scripts/npc/2012031.js index 71af8dd7db..3420643eaf 100644 --- a/scripts/npc/2012031.js +++ b/scripts/npc/2012031.js @@ -21,8 +21,6 @@ Hidden Street - Eliza’s Garden (200010303) */ -importPackage(Packages.tools); - var status; var harpNote = 'G'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu @@ -47,6 +45,7 @@ function action(mode, type, selection) { status--; if(status == 0) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); if(cm.isQuestStarted(3114)) { diff --git a/scripts/npc/2012032.js b/scripts/npc/2012032.js index d0d33d06ee..3c39a2493b 100644 --- a/scripts/npc/2012032.js +++ b/scripts/npc/2012032.js @@ -21,8 +21,6 @@ Hidden Street - Eliza’s Garden (200010303) */ -importPackage(Packages.tools); - var status; var harpNote = 'A'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu @@ -47,6 +45,7 @@ function action(mode, type, selection) { status--; if(status == 0) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); if(cm.isQuestStarted(3114)) { diff --git a/scripts/npc/2012033.js b/scripts/npc/2012033.js index a70af27e4f..35499c3a28 100644 --- a/scripts/npc/2012033.js +++ b/scripts/npc/2012033.js @@ -21,8 +21,6 @@ Hidden Street - Eliza’s Garden (200010303) */ -importPackage(Packages.tools); - var status; var harpNote = 'B'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu @@ -47,6 +45,7 @@ function action(mode, type, selection) { status--; if(status == 0) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); if(cm.isQuestStarted(3114)) { diff --git a/scripts/npc/2030010.js b/scripts/npc/2030010.js index 20fde5ea3e..d4e3f97860 100644 --- a/scripts/npc/2030010.js +++ b/scripts/npc/2030010.js @@ -28,7 +28,6 @@ * Zakum Quest NPC * Helps players leave the map */ - importPackage(Packages.server.expeditions); function start() { if(cm.getMapId() == 280030000) { diff --git a/scripts/npc/2030013.js b/scripts/npc/2030013.js index 43d6876bd0..0c204d4d02 100644 --- a/scripts/npc/2030013.js +++ b/scripts/npc/2030013.js @@ -23,16 +23,14 @@ *@author Alan (SharpAceX) *@author Ronan */ -importPackage(Packages.server.expeditions); -importPackage(Packages.tools); -importPackage(Packages.scripting.event); var status = 0; var expedition; var expedMembers; var player; var em; -var exped = MapleExpeditionType.ZAKUM; +const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType'); +const exped = MapleExpeditionType.ZAKUM; var expedName = "Zakum"; var expedBoss = "Zakum"; var expedMap = "Zakum's Altar"; @@ -161,6 +159,7 @@ function action(mode, type, selection) { cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); diff --git a/scripts/npc/2040042.js b/scripts/npc/2040042.js index 772e9e7818..66a43f7256 100644 --- a/scripts/npc/2040042.js +++ b/scripts/npc/2040042.js @@ -31,8 +31,6 @@ @ Description: You need a ranged person here. The ranged person must kill the three Ratz, and they'll trigger something. What's next is for you to find out! Get me 3 passes! */ -importPackage(Packages.server.life); - var status = 0; var curMap, stage; diff --git a/scripts/npc/2081005.js b/scripts/npc/2081005.js index d709f1787e..84f4be4467 100644 --- a/scripts/npc/2081005.js +++ b/scripts/npc/2081005.js @@ -22,13 +22,12 @@ //@Author Moogra, Ronan //Fixed grammar, javascript syntax -importPackage(Packages.client); - var status = 0; var price = 100000; function isTransformed(ch) { - return ch.getBuffSource(MapleBuffStat.MORPH) == 2210003; + const MapleBuffStat = Java.type('client.MapleBuffStat'); + return ch.getBuffSource(MapleBuffStat.MORPH) == 2210003; } function start() { diff --git a/scripts/npc/2083004.js b/scripts/npc/2083004.js index f13fc27bcf..55691bec0e 100644 --- a/scripts/npc/2083004.js +++ b/scripts/npc/2083004.js @@ -23,16 +23,14 @@ *@author Alan (SharpAceX) *@author Ronan */ -importPackage(Packages.server.expeditions); -importPackage(Packages.tools); -importPackage(Packages.scripting.event); var status = 0; var expedition; var expedMembers; var player; var em; -var exped = MapleExpeditionType.HORNTAIL; +const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType'); +const exped = MapleExpeditionType.HORNTAIL; var expedName = "Horntail"; var expedBoss = "mighty Horntail"; @@ -153,6 +151,7 @@ function action(mode, type, selection) { cm.sendOk("Good luck! All of Leafre is counting on you."); status = 4; } else if (selection == 3) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); diff --git a/scripts/npc/2090004.js b/scripts/npc/2090004.js index c4fd175836..4c720bdf03 100644 --- a/scripts/npc/2090004.js +++ b/scripts/npc/2090004.js @@ -4,7 +4,6 @@ Map(s): Mu Lung: Mu Lung(2500000000) Description: Potion Creator */ -importPackage(Packages.client); var status = 0; var selectedType = -1; diff --git a/scripts/npc/2091005.js b/scripts/npc/2091005.js index bde9d339dd..4b1bb7e713 100644 --- a/scripts/npc/2091005.js +++ b/scripts/npc/2091005.js @@ -25,9 +25,6 @@ * @Map(s): Dojo Hall */ -importPackage(Packages.config); -importPackage(Packages.constants.game); - var disabled = false; var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004); var belt_level = Array(25, 35, 45, 60, 75); @@ -44,7 +41,8 @@ function start() { cm.dispose(); return; } - + + const YamlConfig = Java.type('config.YamlConfig'); belt_points = YamlConfig.config.server.USE_FAST_DOJO_UPGRADE ? Array(10, 90, 200, 460, 850) : Array(200, 1800, 4000, 9200, 17000); belt_on_inventory = new Array(); @@ -70,6 +68,8 @@ function action(mode, type, selection) { if(status == 0) { if (isRestingSpot(cm.getPlayer().getMap().getId())) { var text = "I'm surprised you made it this far! But it won't be easy from here on out. You still want the challenge?\r\n\r\n#b#L0#I want to continue#l\r\n#L1#I want to leave#l\r\n"; + + const GameConstants = Java.type('constants.game.GameConstants'); if (!GameConstants.isDojoPartyArea(cm.getPlayer().getMapId())) { text += "#L2#I want to record my score up to this point#l"; } diff --git a/scripts/npc/2091005_old.js b/scripts/npc/2091005_old.js index d5b543ee88..ad73703e70 100644 --- a/scripts/npc/2091005_old.js +++ b/scripts/npc/2091005_old.js @@ -26,8 +26,6 @@ * @Map(s): Dojo Hall */ -importPackage(Packages.constants.game); - var disabled = false; var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004); var belt_level = Array(25, 35, 45, 60, 75); @@ -47,6 +45,8 @@ function start() { if (isRestingSpot(cm.getPlayer().getMap().getId())) { var text = "I'm surprised you made it this far! But it won't be easy from here on out. You still want the challenge?\r\n\r\n#b#L0#I want to continue#l\r\n#L1#I want to leave#l\r\n"; + + const GameConstants = Java.type('constants.game.GameConstants'); if (!GameConstants.isDojoPartyArea(cm.getPlayer().getMapId())) { text += "#L2#I want to record my score up to this point#l"; } diff --git a/scripts/npc/2101014.js b/scripts/npc/2101014.js index 3058076035..cf2588b614 100644 --- a/scripts/npc/2101014.js +++ b/scripts/npc/2101014.js @@ -3,8 +3,6 @@ * For Jvlaple's AriantPQ */ -importPackage(Packages.server.expeditions); - var status = 0; var toBan = -1; var choice; @@ -13,6 +11,7 @@ var arena; var arenaName; var type; var map; +const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType'); var exped = MapleExpeditionType.ARIANT; var exped1 = MapleExpeditionType.ARIANT1; var exped2 = MapleExpeditionType.ARIANT2; diff --git a/scripts/npc/2101015.js b/scripts/npc/2101015.js index edaf1f311b..5ef0793b69 100644 --- a/scripts/npc/2101015.js +++ b/scripts/npc/2101015.js @@ -1,8 +1,6 @@ var arena; var status = 0; -importPackage(Packages.client); - function start() { arena = cm.getPlayer().getAriantColiseum(); if (arena == null) { diff --git a/scripts/npc/2101016.js b/scripts/npc/2101016.js index 8a483d907d..324846c156 100644 --- a/scripts/npc/2101016.js +++ b/scripts/npc/2101016.js @@ -1,8 +1,6 @@ var arena; var status = 0; -importPackage(Packages.client); - function start() { arena = cm.getPlayer().getAriantColiseum(); if (arena == null) { diff --git a/scripts/npc/2101017.js b/scripts/npc/2101017.js index 035e2e0b94..6766b737fd 100644 --- a/scripts/npc/2101017.js +++ b/scripts/npc/2101017.js @@ -3,9 +3,6 @@ *@author Jvlaple */ -importPackage(Packages.server.expeditions); - - var status = 0; var toBan = -1; var choice; @@ -13,6 +10,7 @@ var arena; var arenaName; var type; var map; +const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType'); var exped; var expedicao; var expedMembers; diff --git a/scripts/npc/2103000.js b/scripts/npc/2103000.js index ae5cd41956..3e386bcce7 100644 --- a/scripts/npc/2103000.js +++ b/scripts/npc/2103000.js @@ -20,10 +20,10 @@ /* Oasis near Ariant Castle */ -importPackage(Packages.client); function isTigunMorphed(ch) { - return ch.getBuffSource(MapleBuffStat.MORPH) == 2210005; + const MapleBuffStat = Java.type('client.MapleBuffStat'); + return ch.getBuffSource(MapleBuffStat.MORPH) == 2210005; } function start() { diff --git a/scripts/npc/2111015.js b/scripts/npc/2111015.js index ca329ad95f..c6d54ae0ce 100644 --- a/scripts/npc/2111015.js +++ b/scripts/npc/2111015.js @@ -18,11 +18,10 @@ along with this program. If not, see . */ -importPackage(Packages.client); - var status; function isPillUsed(ch) { + const MapleBuffStat = Java.type('client.MapleBuffStat'); return ch.getBuffSource(MapleBuffStat.HPREC) == 2022198; } diff --git a/scripts/npc/2112000.js b/scripts/npc/2112000.js index 71a0f0755a..44054dc213 100644 --- a/scripts/npc/2112000.js +++ b/scripts/npc/2112000.js @@ -25,9 +25,7 @@ */ var status; - -importPackage(Packages.server.life); - + function start() { status = -1; action(1, 0, 0); @@ -92,6 +90,8 @@ function action(mode, type, selection) { } else { var state = eim.getIntProperty("yuletePassed"); + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); if(state == -1) { cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha..."); } else if(state == 0) { @@ -102,7 +102,7 @@ function action(mode, type, selection) { var bossobj = MapleLifeFactory.getMonster(9300139); //mapobj.spawnMonsterWithEffect(bossobj, 13, new Packages.java.awt.Point(250, 100)); - mapobj.spawnMonsterOnGroundBelow(bossobj, new Packages.java.awt.Point(250, 100)); + mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); eim.setIntProperty("statusStg7", 1); eim.setIntProperty("yuletePassed", -1); @@ -114,7 +114,7 @@ function action(mode, type, selection) { var bossobj = MapleLifeFactory.getMonster(9300140); //mapobj.spawnMonsterWithEffect(bossobj, 14, new Packages.java.awt.Point(250, 100)); - mapobj.spawnMonsterOnGroundBelow(bossobj, new Packages.java.awt.Point(250, 100)); + mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); eim.setIntProperty("statusStg7", 2); eim.setIntProperty("yuletePassed", -1); diff --git a/scripts/npc/2112010.js b/scripts/npc/2112010.js index 3d6d4cb895..bbde5fcd92 100644 --- a/scripts/npc/2112010.js +++ b/scripts/npc/2112010.js @@ -25,9 +25,7 @@ */ var status; - -importPackage(Packages.server.life); - + function start() { status = -1; action(1, 0, 0); @@ -92,6 +90,8 @@ function action(mode, type, selection) { } else { var state = eim.getIntProperty("yuletePassed"); + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); if(state == -1) { cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha..."); } else if(state == 0) { @@ -100,7 +100,7 @@ function action(mode, type, selection) { var mapobj = eim.getMapInstance(926110401); var bossobj = MapleLifeFactory.getMonster(9300151); - mapobj.spawnMonsterOnGroundBelow(bossobj, new Packages.java.awt.Point(250, 100)); + mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); eim.setIntProperty("statusStg7", 1); eim.setIntProperty("yuletePassed", -1); @@ -110,7 +110,7 @@ function action(mode, type, selection) { var mapobj = eim.getMapInstance(926110401); var bossobj = MapleLifeFactory.getMonster(9300152); - mapobj.spawnMonsterOnGroundBelow(bossobj, new Packages.java.awt.Point(250, 100)); + mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); eim.setIntProperty("statusStg7", 2); eim.setIntProperty("yuletePassed", -1); diff --git a/scripts/npc/2141001.js b/scripts/npc/2141001.js index 1c41cf337b..6d92c75daf 100644 --- a/scripts/npc/2141001.js +++ b/scripts/npc/2141001.js @@ -25,15 +25,13 @@ * * @author Ronan */ -importPackage(Packages.server.expeditions); -importPackage(Packages.tools); -importPackage(Packages.scripting.event); var status = 0; var expedition; var expedMembers; var player; var em; +const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType'); var exped = MapleExpeditionType.PINKBEAN; var expedName = "Twilight of the Gods"; var expedBoss = "Pink Bean"; @@ -156,6 +154,7 @@ function action(mode, type, selection) { cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); diff --git a/scripts/npc/9000040.js b/scripts/npc/9000040.js index 75650242b9..5f5c4bcf5e 100644 --- a/scripts/npc/9000040.js +++ b/scripts/npc/9000040.js @@ -24,9 +24,6 @@ * @author Ronan Lana */ -importPackage(Packages.client.processor.action); -importPackage(Packages.config); - var status; var mergeFee = 50000; var name; @@ -50,7 +47,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.sendOk("The medal ranking system is currently unavailable..."); cm.dispose(); return; @@ -58,7 +56,8 @@ function action(mode, type, selection) { var levelLimit = !cm.getPlayer().isCygnus() ? 160 : 110; var selStr = "The medal ranking system is currently unavailable... Therefore, I am providing the #bEquipment Merge#k service! "; - + + const MakerProcessor = Java.type('client.processor.action.MakerProcessor'); if (!YamlConfig.config.server.USE_STARTER_MERGE && (cm.getPlayer().getLevel() < levelLimit || MakerProcessor.getMakerSkillLevel(cm.getPlayer()) < 3)) { selStr += "However, you must have #rMaker level 3#k and at least #rlevel 110#k (Cygnus Knight), #rlevel 160#k (other classes) and a fund of #r" + cm.numberWithCommas(mergeFee) + " mesos#k to use the service."; cm.sendOk(selStr); diff --git a/scripts/npc/9020001.js b/scripts/npc/9020001.js index f6e590d54a..78ebb34276 100644 --- a/scripts/npc/9020001.js +++ b/scripts/npc/9020001.js @@ -27,9 +27,6 @@ * @func: Kerning PQ */ -importPackage(Packages.tools); -importPackage(java.awt); - var stage1Questions = Array( "Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as warrior.", "Here's the question. Collect the same number of coupons as the minimum amount of STR needed to make the first job advancement as a warrior.", @@ -40,6 +37,7 @@ var stage1Questions = Array( "Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as a magician."); var stage1Answers = Array(10, 35, 20, 25, 25, 30, 8); +const Rectangle = Java.type('java.awt.Rectangle'); var stage2Rects = Array(new Rectangle(-755,-132,4,218),new Rectangle(-721,-340,4,166),new Rectangle(-586,-326,4,150),new Rectangle(-483,-181,4,222)); var stage3Rects = Array(new Rectangle(608,-180,140,50),new Rectangle(791,-117,140,45), new Rectangle(958,-180,140,50),new Rectangle(876,-238,140,45), diff --git a/scripts/npc/9040006.js b/scripts/npc/9040006.js index 5d18e68346..8ddaff03ec 100644 --- a/scripts/npc/9040006.js +++ b/scripts/npc/9040006.js @@ -6,8 +6,6 @@ * Guild Quest Stage 3 */ -importPackage(Packages.tools); - function clearStage(stage, eim) { eim.setProperty("stage" + stage + "clear", "true"); eim.showClearEffect(true); @@ -213,6 +211,8 @@ function randX() { } function spawnMob(id, x, y, map) { - var mob = Packages.server.life.MapleLifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new Packages.java.awt.Point(x, y)); + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + var mob = MapleLifeFactory.getMonster(id); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/9105004.js b/scripts/npc/9105004.js index 5fe3edd1ff..a5acf4577f 100644 --- a/scripts/npc/9105004.js +++ b/scripts/npc/9105004.js @@ -24,8 +24,6 @@ Maplemas PQ coordinator */ -importPackage(Packages.server.life); - var prizeTree = [[[2000002, 1002850], [20, 1]], [[2000006, 1012011], [20, 1]]]; var state; @@ -131,6 +129,9 @@ function insidePqAction(mode, type, selection) { } } } else if(status == 1) { + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); + if(stg == -1) { if(!cm.isEventLeader()) { cm.sendOk("Please let your party leader talk to me for further details on the mission."); @@ -140,7 +141,7 @@ function insidePqAction(mode, type, selection) { mapobj.allowSummonState(true); var snowman = MapleLifeFactory.getMonster(9400317 + (5 * difficulty)); - mapobj.spawnMonsterOnGroundBelow(snowman, new java.awt.Point(-180, 15)); + mapobj.spawnMonsterOnGroundBelow(snowman, new Point(-180, 15)); eim.setIntProperty("snowmanLevel", 1); eim.dropMessage(5, "The snowman appeared on the field! Protect it using all means necessary!"); @@ -158,7 +159,7 @@ function insidePqAction(mode, type, selection) { eim.getEm().getIv().invokeFunction("snowmanHeal", eim); var boss = MapleLifeFactory.getMonster(9400318 + difficulty); - mapobj.spawnMonsterOnGroundBelow(boss, new java.awt.Point(-180, 15)); + mapobj.spawnMonsterOnGroundBelow(boss, new Point(-180, 15)); eim.setProperty("spawnedBoss", "true"); eim.setIntProperty("statusStg1", 1); diff --git a/scripts/npc/9120201.js b/scripts/npc/9120201.js index 13be378b5a..98a0d7984f 100644 --- a/scripts/npc/9120201.js +++ b/scripts/npc/9120201.js @@ -22,15 +22,13 @@ * *@author Ronan */ -importPackage(Packages.server.expeditions); -importPackage(Packages.tools); -importPackage(Packages.scripting.event); var status = 0; var expedition; var expedMembers; var player; var em; +const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType'); var exped = MapleExpeditionType.SHOWA; var expedName = "Showa Gang"; var expedBoss = "The Boss"; @@ -160,6 +158,7 @@ function action(mode, type, selection) { cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); diff --git a/scripts/npc/9201002.js b/scripts/npc/9201002.js index 40faa47cff..5aac705356 100644 --- a/scripts/npc/9201002.js +++ b/scripts/npc/9201002.js @@ -21,17 +21,13 @@ Marriage NPC */ -importPackage(Packages.config); -importPackage(Packages.net.server.channel.handlers); -importPackage(Packages.tools); -importPackage(Packages.tools.packets); - var status; var state; var eim; var weddingEventName = "WeddingCathedral"; var cathedralWedding = true; var weddingIndoors; +const YamlConfig = Java.type('config.YamlConfig'); var weddingBlessingExp = YamlConfig.config.server.WEDDING_BLESS_EXP; function isWeddingIndoors(mapid) { @@ -304,6 +300,7 @@ function action(mode, type, selection) { if (state == 0) { // give player blessings eim.gridInsert(cm.getPlayer(), 1); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); if (YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) { var target = cm.getPlayer(); target.announce(MaplePacketCreator.showSpecialEffect(9)); @@ -354,6 +351,7 @@ function action(mode, type, selection) { cm.gainItem(playerItemId, -1); cmPartner.gainItem(partnerItemId, -1); + const RingActionHandler = Java.type('net.server.channel.handlers.RingActionHandler'); RingActionHandler.giveMarriageRings(player, partner, marriageRingId); player.setMarriageItemId(marriageRingId); partner.setMarriageItemId(marriageRingId); diff --git a/scripts/npc/9201004.js b/scripts/npc/9201004.js index f306a913cf..0a1f05002a 100644 --- a/scripts/npc/9201004.js +++ b/scripts/npc/9201004.js @@ -22,8 +22,6 @@ Wedding info. */ -importPackage(Packages.net.server.channel.handlers); - var status; var rings = [1112806, 1112803, 1112807, 1112809]; @@ -125,6 +123,7 @@ function action(mode, type, selection) { } cm.gainMeso(-divorceFee); + const RingActionHandler = Java.type('net.server.channel.handlers.RingActionHandler'); RingActionHandler.breakMarriageRing(cm.getPlayer(), ringObj.getItemId()); cm.gainItem(ringObj.getItemId(), -1); diff --git a/scripts/npc/9201005.js b/scripts/npc/9201005.js index 7e4006775b..d81ab704fa 100644 --- a/scripts/npc/9201005.js +++ b/scripts/npc/9201005.js @@ -21,8 +21,6 @@ Marriage NPC */ -importPackage(Packages.net.server.channel); - var status; var wid; var isMarrying; @@ -178,6 +176,7 @@ function action(mode, type, selection) { if(resStatus > 0) { cm.gainItem((weddingType) ? weddingEntryTicketPremium : weddingEntryTicketCommon, -1); + const Channel = Java.type('net.server.channel.Channel'); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); cm.gainItem(weddingSendTicket,15,false,true,expirationTime); partner.getAbstractPlayerInteraction().gainItem(weddingSendTicket,15,false,true,expirationTime); @@ -253,6 +252,7 @@ function action(mode, type, selection) { if(cm.canHold(weddingSendTicket, 3)) { cm.gainItem(5251100, -1); + const Channel = Java.type('net.server.channel.Channel'); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); cm.gainItem(weddingSendTicket,3,false,true,expirationTime); } else { diff --git a/scripts/npc/9201008.js b/scripts/npc/9201008.js index 8d1813e23b..348d1ac555 100644 --- a/scripts/npc/9201008.js +++ b/scripts/npc/9201008.js @@ -21,8 +21,6 @@ Marriage NPC */ -importPackage(Packages.net.server.channel); - var status; var wid; var isMarrying; @@ -253,6 +251,7 @@ function action(mode, type, selection) { if(cm.canHold(weddingSendTicket, 3)) { cm.gainItem(5251100, -1); + const Channel = Java.type('net.server.channel.Channel'); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); cm.gainItem(weddingSendTicket,3,false,true,expirationTime); } else { diff --git a/scripts/npc/9201011.js b/scripts/npc/9201011.js index 0cb2c189b3..e61b923927 100644 --- a/scripts/npc/9201011.js +++ b/scripts/npc/9201011.js @@ -21,17 +21,13 @@ Marriage NPC */ -importPackage(Packages.config); -importPackage(Packages.net.server.channel.handlers); -importPackage(Packages.tools); -importPackage(Packages.tools.packets); - var status; var state; var eim; var weddingEventName = "WeddingChapel"; var cathedralWedding = false; var weddingIndoors; +const YamlConfig = Java.type('config.YamlConfig'); var weddingBlessingExp = YamlConfig.config.server.WEDDING_BLESS_EXP; function detectPlayerItemid(player) { @@ -174,6 +170,7 @@ function action(mode, type, selection) { if(state == 0) { // give player blessings eim.gridInsert(cm.getPlayer(), 1); + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); if(YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) { var target = cm.getPlayer(); target.announce(MaplePacketCreator.showSpecialEffect(9)); @@ -224,6 +221,7 @@ function action(mode, type, selection) { cm.gainItem(playerItemId, -1); cmPartner.gainItem(partnerItemId, -1); + const RingActionHandler = Java.type('net.server.channel.handlers.RingActionHandler'); RingActionHandler.giveMarriageRings(player, partner, marriageRingId); player.setMarriageItemId(marriageRingId); partner.setMarriageItemId(marriageRingId); diff --git a/scripts/npc/9201044.js b/scripts/npc/9201044.js index 13a402420c..2c2b724312 100644 --- a/scripts/npc/9201044.js +++ b/scripts/npc/9201044.js @@ -29,8 +29,6 @@ @ Description: Used to find the combo to unlock the next door. Players stand on 5 different crates to guess the combo. */ -importPackage(Packages.server.life); - var debug = false; var autopass = false; @@ -39,6 +37,8 @@ function spawnMobs(maxSpawn) { var spawnPosY; var mapObj = cm.getMap(); + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const Point = Java.type('java.awt.Point'); if (stage == 2) { spawnPosX = [619, 299, 47, -140, -471]; spawnPosY = [-840, -840, -840, -840, -840]; @@ -49,9 +49,9 @@ function spawnMobs(maxSpawn) { var mobObj2 = MapleLifeFactory.getMonster(9400516); var mobObj3 = MapleLifeFactory.getMonster(9400517); - mapObj.spawnMonsterOnGroundBelow(mobObj1, new Packages.java.awt.Point(spawnPosX[i], spawnPosY[i])); - mapObj.spawnMonsterOnGroundBelow(mobObj2, new Packages.java.awt.Point(spawnPosX[i], spawnPosY[i])); - mapObj.spawnMonsterOnGroundBelow(mobObj3, new Packages.java.awt.Point(spawnPosX[i], spawnPosY[i])); + mapObj.spawnMonsterOnGroundBelow(mobObj1, new Point(spawnPosX[i], spawnPosY[i])); + mapObj.spawnMonsterOnGroundBelow(mobObj2, new Point(spawnPosX[i], spawnPosY[i])); + mapObj.spawnMonsterOnGroundBelow(mobObj3, new Point(spawnPosX[i], spawnPosY[i])); } } } else { @@ -63,7 +63,7 @@ function spawnMobs(maxSpawn) { var rndPos = Math.floor(Math.random() * 5); var mobObj = MapleLifeFactory.getMonster(rndMob); - mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(spawnPosX[rndPos], spawnPosY[rndPos])); + mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(spawnPosX[rndPos], spawnPosY[rndPos])); } } } diff --git a/scripts/npc/9201113.js b/scripts/npc/9201113.js index 766cae86de..539fef544e 100644 --- a/scripts/npc/9201113.js +++ b/scripts/npc/9201113.js @@ -23,15 +23,13 @@ *@author Alan (SharpAceX) *@author Ronan */ -importPackage(Packages.server.expeditions); -importPackage(Packages.tools); -importPackage(Packages.scripting.event); var status = 0; var expedition; var expedMembers; var player; var em; +const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType'); var cwkpq = MapleExpeditionType.CWKPQ; var list = "What would you like to do?#b\r\n\r\n#L1#View current Expedition members#l\r\n#L2#Start the fight!#l\r\n#L3#Stop the expedition.#l"; @@ -143,6 +141,7 @@ function action(mode, type, selection) { cm.sendOk("The expedition will begin and you will now be escorted to the #bEntrance to CWKPQ Altar#k."); status = 4; } else if (selection == 3) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); diff --git a/scripts/npc/9270047.js b/scripts/npc/9270047.js index b77399be54..bafaa03ae3 100644 --- a/scripts/npc/9270047.js +++ b/scripts/npc/9270047.js @@ -23,15 +23,13 @@ *@author Alan (SharpAceX) *@author Ronan */ -importPackage(Packages.server.expeditions); -importPackage(Packages.tools); -importPackage(Packages.scripting.event); var status = 0; var expedition; var expedMembers; var player; var em; +const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType'); var exped = MapleExpeditionType.SCARGA; var expedName = "Scarga"; var expedBoss = "Scarlion and Targa"; @@ -160,6 +158,7 @@ function action(mode, type, selection) { cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); diff --git a/scripts/npc/9977777.js b/scripts/npc/9977777.js index 26b5fcdf43..31605dc4ac 100644 --- a/scripts/npc/9977777.js +++ b/scripts/npc/9977777.js @@ -22,8 +22,6 @@ HeavenMS developer info. */ -importPackage(Packages.tools); - var status; var anthemSong = "Field/anthem/brazil"; // sound src: https://c7.rbxcdn.com/f91060652a6e9fbfbf92cb1418435448 @@ -310,6 +308,7 @@ function writeAllFeatures() { } function start() { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); cm.getPlayer().announce(MaplePacketCreator.musicChange(anthemSong)); status = -1; writeAllFeatures(); @@ -317,6 +316,7 @@ function start() { } function action(mode, type, selection) { + const MaplePacketCreator = Java.type('tools.MaplePacketCreator'); if (mode == -1) { cm.getPlayer().announce(MaplePacketCreator.musicChange(ambientSong)); cm.dispose(); diff --git a/scripts/npc/commands.js b/scripts/npc/commands.js index b90af5eae3..37f7252671 100644 --- a/scripts/npc/commands.js +++ b/scripts/npc/commands.js @@ -6,8 +6,6 @@ Script: commands.js */ -importPackage(Packages.client.command); - var status; var common_heading = "@"; @@ -17,6 +15,7 @@ var levels = ["Common", "Donator", "JrGM", "GM", "SuperGM", "Developer", "Admin" var commands; function writeHeavenMSCommands() { + const CommandsExecutor = Java.type('client.command.CommandsExecutor'); commands = CommandsExecutor.getInstance().getGmCommands(); } diff --git a/scripts/npc/cpqchallenge.js b/scripts/npc/cpqchallenge.js index c55c990717..5da9bedf6e 100644 --- a/scripts/npc/cpqchallenge.js +++ b/scripts/npc/cpqchallenge.js @@ -5,8 +5,6 @@ --------------------------------------------------------------------------------------------------- **/ -importPackage(Packages.constants.game); - var status = 0; var party; @@ -36,10 +34,12 @@ function action(mode, type, selection) { status++; else status--; - + if (status == 0) { if (cm.getParty().getMembers().size() == party.size()) { cm.getPlayer().setChallenged(true); + + const GameConstants = Java.type('constants.game.GameConstants'); var snd = ""; for (var i = 0; i < party.size(); i++) snd += "#bName: " + party.get(i).getName() + " / (Level: " + party.get(i).getLevel() + ") / " + GameConstants.getJobName(party.get(i).getJobId()) + "#k\r\n\r\n"; diff --git a/scripts/npc/cpqchallenge2.js b/scripts/npc/cpqchallenge2.js index c55c990717..d6c79c733b 100644 --- a/scripts/npc/cpqchallenge2.js +++ b/scripts/npc/cpqchallenge2.js @@ -5,8 +5,6 @@ --------------------------------------------------------------------------------------------------- **/ -importPackage(Packages.constants.game); - var status = 0; var party; @@ -40,6 +38,8 @@ function action(mode, type, selection) { if (status == 0) { if (cm.getParty().getMembers().size() == party.size()) { cm.getPlayer().setChallenged(true); + + const GameConstants = Java.type('constants.game.GameConstants'); var snd = ""; for (var i = 0; i < party.size(); i++) snd += "#bName: " + party.get(i).getName() + " / (Level: " + party.get(i).getLevel() + ") / " + GameConstants.getJobName(party.get(i).getJobId()) + "#k\r\n\r\n"; diff --git a/scripts/npc/rank_user.js b/scripts/npc/rank_user.js index bbe07c49da..e99b63f908 100644 --- a/scripts/npc/rank_user.js +++ b/scripts/npc/rank_user.js @@ -21,8 +21,6 @@ * @Author Ronan * Player NPC Ranking System */ -importPackage(Packages.constants.game); - var status; function start() { @@ -47,6 +45,7 @@ function action(mode, type, selection) { var pnpc = cm.getPlayerNPCByScriptid(cm.getNpc()); if(pnpc != null) { + const GameConstants = Java.type('constants.game.GameConstants'); var branchJobName = GameConstants.getJobName(pnpc.getJob()); var rankStr = "Hi, I am #b" + pnpc.getName() + "#k, #r" + GameConstants.ordinal(pnpc.getWorldJobRank()) + "#k in the #r" + branchJobName + "#k class to reach the max level and obtain a statue on " + GameConstants.WORLD_NAMES[cm.getPlayer().getWorld()] + ".\r\n"; diff --git a/scripts/npc/scroll_generator.js b/scripts/npc/scroll_generator.js index 1fa746d067..eeeaa5014b 100644 --- a/scripts/npc/scroll_generator.js +++ b/scripts/npc/scroll_generator.js @@ -25,12 +25,6 @@ * @author Ronan Lana */ -importPackage(Packages.client); -importPackage(Packages.config); -importPackage(Packages.constants.game); -importPackage(Packages.server); -importPackage(Packages.server.life); - var status; var jobWeaponRestricted = [[[2043000, 2043100, 2044000, 2044100, 2043200, 2044200]], [[2043000, 2043100, 2044000, 2044100], [2043000, 2043200, 2044000, 2044200], [2044300, 2044400]], [[2043700, 2043800], [2043700, 2043800], [2043700, 2043800]], [[2044500], [2044600]], [[2044700], [2043300]], [[2044800], [2044900]]]; @@ -150,7 +144,8 @@ function getJobTierScrolls() { var job = cm.getPlayer().getJob(); var jobScrolls = jobWeaponRestricted[Math.floor(cm.getPlayer().getJobStyle().getId() / 100)]; - + + const GameConstants = Java.type('constants.game.GameConstants'); var jobBranch = GameConstants.getJobBranch(job); if (jobBranch >= 2) { Array.prototype.push.apply(scrolls, jobScrolls[Math.floor((job.getId() / 10) % 10) - 1]); @@ -200,6 +195,7 @@ function getScrollTier(scrollStats) { function getScrollSuccessTier(scrollStats) { var prop = scrollStats.get("success"); + const YamlConfig = Java.type('config.YamlConfig'); if (prop > 90) { return 3; } else if (prop < 50) { @@ -211,6 +207,7 @@ function getScrollSuccessTier(scrollStats) { function getAvailableScrollsPool(baseScrolls, rewardTier, successTier) { var scrolls = []; + const MapleItemInformationProvider = Java.type('server.MapleItemInformationProvider'); var ii = MapleItemInformationProvider.getInstance(); for (var i = 0; i < baseScrolls.length; i++) { @@ -247,6 +244,8 @@ function getPlayerCardTierPower() { countTier[ceTier] += ce.getValue(); if (ceTier >= 8) { // is special card + const MapleLifeFactory = Java.type('server.life.MapleLifeFactory'); + const MapleItemInformationProvider = Java.type('server.MapleItemInformationProvider'); var mobLevel = MapleLifeFactory.getMonsterLevel(MapleItemInformationProvider.getInstance().getCardMobId(cardid)); var mobTier = getLevelTier(mobLevel) - 1; @@ -280,6 +279,7 @@ function calculateMobBookBuckets() { playerLevelTier = 8; } + const MonsterBook = Java.type('client.MonsterBook'); var tierSize = MonsterBook.getCardTierSize(); var playerCards = getPlayerCardTierPower(); @@ -421,7 +421,8 @@ function performExchange(sgItemid, sgCount) { } function generateRandomScroll() { - if (cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.USE).getNumFreeSlot() >= 1) { + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); + if (cm.getPlayer().getInventory(MapleInventoryType.USE).getNumFreeSlot() >= 1) { var itemid = getRandomScroll(calculateScrollTiers()); if (itemid != -1) { if (performExchange(itemid, 1)) { diff --git a/scripts/npc/waterOfLife.js b/scripts/npc/waterOfLife.js index b687e9ead0..42209c9206 100644 --- a/scripts/npc/waterOfLife.js +++ b/scripts/npc/waterOfLife.js @@ -23,9 +23,6 @@ Handles Water of Life */ -importPackage(Packages.client.inventory); -importPackage(Packages.server); - var status; var dList; @@ -79,7 +76,8 @@ function action(mode, type, selection) { if(sPet != null) { cm.sendNext("Your doll has now reawaken as your pet! However, my magic isn't perfect, so I can't promise an eternal life for your pet... Please take care of that pet before the Water of Life dries. Well then, good bye..."); - + + const MapleInventoryType = Java.type('client.inventory.MapleInventoryType'); var it = cm.getPlayer().getInventory(MapleInventoryType.CASH).getItem(sPet.getPosition()); it.setExpiration(Date.now() + (1000 * 60 * 60 * 24 * 90)); cm.getPlayer().forceUpdateItem(it);