Convert NPC scripts to Graal

This commit is contained in:
P0nk
2021-04-17 21:02:39 +02:00
parent 256e5688e0
commit d2c7023e7b
54 changed files with 127 additions and 168 deletions

View File

@@ -9,10 +9,6 @@
Dragon Evolver Dragon Evolver
*/ */
importPackage(Packages.client.inventory);
importPackage(Packages.client.inventory.manipulator);
importPackage(Packages.server);
var status; var status;
function start() { function start() {
@@ -105,6 +101,8 @@ function action(mode, type, selection) {
} }
} else if (status == 2) { } else if (status == 2) {
if (selection == 0) { 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); MapleInventoryManipulator.removeFromSlot(cm.getClient(), MapleInventoryType.CASH, 1, 1, true);
cm.sendOk("Your cash first slot is removed."); cm.sendOk("Your cash first slot is removed.");
} else if (selection == 1) { } else if (selection == 1) {

View File

@@ -3,7 +3,6 @@
MAP: Hidden Street - Magic Library (910110000) MAP: Hidden Street - Magic Library (910110000)
QUEST: Maybe it's Grendel! (20718) QUEST: Maybe it's Grendel! (20718)
*/ */
importPackage(Packages.server.life);
var status; var status;
var mobId = 2220100; //Blue Mushroom var mobId = 2220100; //Blue Mushroom
@@ -36,12 +35,14 @@ function action(mode, type, selection){
var player = cm.getPlayer(); var player = cm.getPlayer();
var map = player.getMap(); 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++) 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++) 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++) 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.completeQuest(20718, 1103003);
cm.gainExp(4000 * cm.getPlayer().getExpRate()); cm.gainExp(4000 * cm.getPlayer().getExpRate());

View File

@@ -1,6 +1,5 @@
var status = 0; var status = 0;
var section = 0; var section = 0;
importPackage(java.lang);
//questid 29931, infoquest 7662 //questid 29931, infoquest 7662
function start() { function start() {

View File

@@ -23,16 +23,13 @@
*@author Ronan *@author Ronan
*/ */
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
importPackage(Packages.scripting.event);
var status = 0; var status = 0;
var expedition; var expedition;
var expedMembers; var expedMembers;
var player; var player;
var em; var em;
var exped = MapleExpeditionType.BALROG_NORMAL; const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType');
const exped = MapleExpeditionType.BALROG_NORMAL;
var expedName = "Balrog"; var expedName = "Balrog";
var expedBoss = "Balrog"; var expedBoss = "Balrog";
var expedMap = "Balrog's Tomb"; 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."); cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
status = 4; status = 4;
} else if (selection == 3) { } else if (selection == 3) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
cm.endExpedition(expedition); cm.endExpedition(expedition);
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");

View File

@@ -3,9 +3,9 @@
Map(s): Erev Map(s): Erev
Description: 3rd job KoC Buff Description: 3rd job KoC Buff
*/ */
importPackage(Packages.constants.game);
function start() { function start() {
const GameConstants = Java.type('constants.game.GameConstants');
if (cm.getPlayer().isCygnus() && GameConstants.getJobBranch(cm.getJob()) > 2) { if (cm.getPlayer().isCygnus() && GameConstants.getJobBranch(cm.getJob()) > 2) {
cm.useItem(2022458); cm.useItem(2022458);
cm.sendOk("Let me cast you my blessings, my Knight. Please protect the world of Maple...."); cm.sendOk("Let me cast you my blessings, my Knight. Please protect the world of Maple....");

View File

@@ -18,8 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
importPackage(Packages.server.life);
var npcid = 1104100; var npcid = 1104100;
var baseJob = 11; var baseJob = 11;
var status; var status;
@@ -65,6 +63,8 @@ function spawnMob(x, y, id, map) {
if(map.getMonsterById(id) != null) if(map.getMonsterById(id) != null)
return; return;
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mob = MapleLifeFactory.getMonster(id); var mob = MapleLifeFactory.getMonster(id);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); map.spawnMonsterOnGroundBelow(mob, new Point(x, y));
} }

View File

@@ -18,8 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
importPackage(Packages.server.life);
var npcid = 1104101; var npcid = 1104101;
var baseJob = 12; var baseJob = 12;
var status; var status;
@@ -65,6 +63,8 @@ function spawnMob(x, y, id, map) {
if(map.getMonsterById(id) != null) if(map.getMonsterById(id) != null)
return; return;
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mob = MapleLifeFactory.getMonster(id); var mob = MapleLifeFactory.getMonster(id);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); map.spawnMonsterOnGroundBelow(mob, new Point(x, y));
} }

View File

@@ -18,8 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
importPackage(Packages.server.life);
var npcid = 1104102; var npcid = 1104102;
var baseJob = 13; var baseJob = 13;
var status; var status;
@@ -65,6 +63,8 @@ function spawnMob(x, y, id, map) {
if(map.getMonsterById(id) != null) if(map.getMonsterById(id) != null)
return; return;
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mob = MapleLifeFactory.getMonster(id); var mob = MapleLifeFactory.getMonster(id);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); map.spawnMonsterOnGroundBelow(mob, new Point(x, y));
} }

View File

@@ -18,8 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
importPackage(Packages.server.life);
var npcid = 1104103; var npcid = 1104103;
var baseJob = 14; var baseJob = 14;
var status; var status;
@@ -65,6 +63,8 @@ function spawnMob(x, y, id, map) {
if(map.getMonsterById(id) != null) if(map.getMonsterById(id) != null)
return; return;
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mob = MapleLifeFactory.getMonster(id); var mob = MapleLifeFactory.getMonster(id);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); map.spawnMonsterOnGroundBelow(mob, new Point(x, y));
} }

View File

@@ -18,8 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
importPackage(Packages.server.life);
var npcid = 1104104; var npcid = 1104104;
var baseJob = 15; var baseJob = 15;
var status; var status;
@@ -65,6 +63,8 @@ function spawnMob(x, y, id, map) {
if(map.getMonsterById(id) != null) if(map.getMonsterById(id) != null)
return; return;
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mob = MapleLifeFactory.getMonster(id); var mob = MapleLifeFactory.getMonster(id);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(x, y)); map.spawnMonsterOnGroundBelow(mob, new Point(x, y));
} }

View File

@@ -21,8 +21,6 @@
Hidden Street - Elizas Garden (200010303) Hidden Street - Elizas Garden (200010303)
*/ */
importPackage(Packages.tools);
var status; var status;
var harpNote = 'C'; var harpNote = 'C';
var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu 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--; status--;
if(status == 0) { if(status == 0) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027]));
if(cm.isQuestStarted(3114)) { if(cm.isQuestStarted(3114)) {

View File

@@ -21,8 +21,6 @@
Hidden Street - Elizas Garden (200010303) Hidden Street - Elizas Garden (200010303)
*/ */
importPackage(Packages.tools);
var status; var status;
var harpNote = 'D'; var harpNote = 'D';
var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu 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--; status--;
if(status == 0) { if(status == 0) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027]));
if(cm.isQuestStarted(3114)) { if(cm.isQuestStarted(3114)) {

View File

@@ -21,8 +21,6 @@
Hidden Street - Elizas Garden (200010303) Hidden Street - Elizas Garden (200010303)
*/ */
importPackage(Packages.tools);
var status; var status;
var harpNote = 'E'; var harpNote = 'E';
var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu 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--; status--;
if(status == 0) { if(status == 0) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027]));
if(cm.isQuestStarted(3114)) { if(cm.isQuestStarted(3114)) {

View File

@@ -21,8 +21,6 @@
Hidden Street - Elizas Garden (200010303) Hidden Street - Elizas Garden (200010303)
*/ */
importPackage(Packages.tools);
var status; var status;
var harpNote = 'F'; var harpNote = 'F';
var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu 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--; status--;
if(status == 0) { if(status == 0) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027]));
if(cm.isQuestStarted(3114)) { if(cm.isQuestStarted(3114)) {

View File

@@ -21,8 +21,6 @@
Hidden Street - Elizas Garden (200010303) Hidden Street - Elizas Garden (200010303)
*/ */
importPackage(Packages.tools);
var status; var status;
var harpNote = 'G'; var harpNote = 'G';
var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu 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--; status--;
if(status == 0) { if(status == 0) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027]));
if(cm.isQuestStarted(3114)) { if(cm.isQuestStarted(3114)) {

View File

@@ -21,8 +21,6 @@
Hidden Street - Elizas Garden (200010303) Hidden Street - Elizas Garden (200010303)
*/ */
importPackage(Packages.tools);
var status; var status;
var harpNote = 'A'; var harpNote = 'A';
var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu 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--; status--;
if(status == 0) { if(status == 0) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027]));
if(cm.isQuestStarted(3114)) { if(cm.isQuestStarted(3114)) {

View File

@@ -21,8 +21,6 @@
Hidden Street - Elizas Garden (200010303) Hidden Street - Elizas Garden (200010303)
*/ */
importPackage(Packages.tools);
var status; var status;
var harpNote = 'B'; var harpNote = 'B';
var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu 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--; status--;
if(status == 0) { if(status == 0) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027]));
if(cm.isQuestStarted(3114)) { if(cm.isQuestStarted(3114)) {

View File

@@ -28,7 +28,6 @@
* Zakum Quest NPC * Zakum Quest NPC
* Helps players leave the map * Helps players leave the map
*/ */
importPackage(Packages.server.expeditions);
function start() { function start() {
if(cm.getMapId() == 280030000) { if(cm.getMapId() == 280030000) {

View File

@@ -23,16 +23,14 @@
*@author Alan (SharpAceX) *@author Alan (SharpAceX)
*@author Ronan *@author Ronan
*/ */
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
importPackage(Packages.scripting.event);
var status = 0; var status = 0;
var expedition; var expedition;
var expedMembers; var expedMembers;
var player; var player;
var em; var em;
var exped = MapleExpeditionType.ZAKUM; const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType');
const exped = MapleExpeditionType.ZAKUM;
var expedName = "Zakum"; var expedName = "Zakum";
var expedBoss = "Zakum"; var expedBoss = "Zakum";
var expedMap = "Zakum's Altar"; 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."); cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
status = 4; status = 4;
} else if (selection == 3) { } else if (selection == 3) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
cm.endExpedition(expedition); cm.endExpedition(expedition);
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");

View File

@@ -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! @ 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 status = 0;
var curMap, stage; var curMap, stage;

View File

@@ -22,13 +22,12 @@
//@Author Moogra, Ronan //@Author Moogra, Ronan
//Fixed grammar, javascript syntax //Fixed grammar, javascript syntax
importPackage(Packages.client);
var status = 0; var status = 0;
var price = 100000; var price = 100000;
function isTransformed(ch) { function isTransformed(ch) {
return ch.getBuffSource(MapleBuffStat.MORPH) == 2210003; const MapleBuffStat = Java.type('client.MapleBuffStat');
return ch.getBuffSource(MapleBuffStat.MORPH) == 2210003;
} }
function start() { function start() {

View File

@@ -23,16 +23,14 @@
*@author Alan (SharpAceX) *@author Alan (SharpAceX)
*@author Ronan *@author Ronan
*/ */
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
importPackage(Packages.scripting.event);
var status = 0; var status = 0;
var expedition; var expedition;
var expedMembers; var expedMembers;
var player; var player;
var em; var em;
var exped = MapleExpeditionType.HORNTAIL; const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType');
const exped = MapleExpeditionType.HORNTAIL;
var expedName = "Horntail"; var expedName = "Horntail";
var expedBoss = "mighty 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."); cm.sendOk("Good luck! All of Leafre is counting on you.");
status = 4; status = 4;
} else if (selection == 3) { } else if (selection == 3) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
cm.endExpedition(expedition); cm.endExpedition(expedition);
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");

View File

@@ -4,7 +4,6 @@
Map(s): Mu Lung: Mu Lung(2500000000) Map(s): Mu Lung: Mu Lung(2500000000)
Description: Potion Creator Description: Potion Creator
*/ */
importPackage(Packages.client);
var status = 0; var status = 0;
var selectedType = -1; var selectedType = -1;

View File

@@ -25,9 +25,6 @@
* @Map(s): Dojo Hall * @Map(s): Dojo Hall
*/ */
importPackage(Packages.config);
importPackage(Packages.constants.game);
var disabled = false; var disabled = false;
var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004); var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004);
var belt_level = Array(25, 35, 45, 60, 75); var belt_level = Array(25, 35, 45, 60, 75);
@@ -45,6 +42,7 @@ function start() {
return; 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_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(); belt_on_inventory = new Array();
@@ -70,6 +68,8 @@ function action(mode, type, selection) {
if(status == 0) { if(status == 0) {
if (isRestingSpot(cm.getPlayer().getMap().getId())) { 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"; 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())) { if (!GameConstants.isDojoPartyArea(cm.getPlayer().getMapId())) {
text += "#L2#I want to record my score up to this point#l"; text += "#L2#I want to record my score up to this point#l";
} }

View File

@@ -26,8 +26,6 @@
* @Map(s): Dojo Hall * @Map(s): Dojo Hall
*/ */
importPackage(Packages.constants.game);
var disabled = false; var disabled = false;
var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004); var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004);
var belt_level = Array(25, 35, 45, 60, 75); var belt_level = Array(25, 35, 45, 60, 75);
@@ -47,6 +45,8 @@ function start() {
if (isRestingSpot(cm.getPlayer().getMap().getId())) { 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"; 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())) { if (!GameConstants.isDojoPartyArea(cm.getPlayer().getMapId())) {
text += "#L2#I want to record my score up to this point#l"; text += "#L2#I want to record my score up to this point#l";
} }

View File

@@ -3,8 +3,6 @@
* For Jvlaple's AriantPQ * For Jvlaple's AriantPQ
*/ */
importPackage(Packages.server.expeditions);
var status = 0; var status = 0;
var toBan = -1; var toBan = -1;
var choice; var choice;
@@ -13,6 +11,7 @@ var arena;
var arenaName; var arenaName;
var type; var type;
var map; var map;
const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType');
var exped = MapleExpeditionType.ARIANT; var exped = MapleExpeditionType.ARIANT;
var exped1 = MapleExpeditionType.ARIANT1; var exped1 = MapleExpeditionType.ARIANT1;
var exped2 = MapleExpeditionType.ARIANT2; var exped2 = MapleExpeditionType.ARIANT2;

View File

@@ -1,8 +1,6 @@
var arena; var arena;
var status = 0; var status = 0;
importPackage(Packages.client);
function start() { function start() {
arena = cm.getPlayer().getAriantColiseum(); arena = cm.getPlayer().getAriantColiseum();
if (arena == null) { if (arena == null) {

View File

@@ -1,8 +1,6 @@
var arena; var arena;
var status = 0; var status = 0;
importPackage(Packages.client);
function start() { function start() {
arena = cm.getPlayer().getAriantColiseum(); arena = cm.getPlayer().getAriantColiseum();
if (arena == null) { if (arena == null) {

View File

@@ -3,9 +3,6 @@
*@author Jvlaple *@author Jvlaple
*/ */
importPackage(Packages.server.expeditions);
var status = 0; var status = 0;
var toBan = -1; var toBan = -1;
var choice; var choice;
@@ -13,6 +10,7 @@ var arena;
var arenaName; var arenaName;
var type; var type;
var map; var map;
const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType');
var exped; var exped;
var expedicao; var expedicao;
var expedMembers; var expedMembers;

View File

@@ -20,10 +20,10 @@
/* Oasis near Ariant Castle /* Oasis near Ariant Castle
*/ */
importPackage(Packages.client);
function isTigunMorphed(ch) { function isTigunMorphed(ch) {
return ch.getBuffSource(MapleBuffStat.MORPH) == 2210005; const MapleBuffStat = Java.type('client.MapleBuffStat');
return ch.getBuffSource(MapleBuffStat.MORPH) == 2210005;
} }
function start() { function start() {

View File

@@ -18,11 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
importPackage(Packages.client);
var status; var status;
function isPillUsed(ch) { function isPillUsed(ch) {
const MapleBuffStat = Java.type('client.MapleBuffStat');
return ch.getBuffSource(MapleBuffStat.HPREC) == 2022198; return ch.getBuffSource(MapleBuffStat.HPREC) == 2022198;
} }

View File

@@ -26,8 +26,6 @@
var status; var status;
importPackage(Packages.server.life);
function start() { function start() {
status = -1; status = -1;
action(1, 0, 0); action(1, 0, 0);
@@ -92,6 +90,8 @@ function action(mode, type, selection) {
} else { } else {
var state = eim.getIntProperty("yuletePassed"); var state = eim.getIntProperty("yuletePassed");
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
if(state == -1) { if(state == -1) {
cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha..."); cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha...");
} else if(state == 0) { } else if(state == 0) {
@@ -102,7 +102,7 @@ function action(mode, type, selection) {
var bossobj = MapleLifeFactory.getMonster(9300139); var bossobj = MapleLifeFactory.getMonster(9300139);
//mapobj.spawnMonsterWithEffect(bossobj, 13, new Packages.java.awt.Point(250, 100)); //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("statusStg7", 1);
eim.setIntProperty("yuletePassed", -1); eim.setIntProperty("yuletePassed", -1);
@@ -114,7 +114,7 @@ function action(mode, type, selection) {
var bossobj = MapleLifeFactory.getMonster(9300140); var bossobj = MapleLifeFactory.getMonster(9300140);
//mapobj.spawnMonsterWithEffect(bossobj, 14, new Packages.java.awt.Point(250, 100)); //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("statusStg7", 2);
eim.setIntProperty("yuletePassed", -1); eim.setIntProperty("yuletePassed", -1);

View File

@@ -26,8 +26,6 @@
var status; var status;
importPackage(Packages.server.life);
function start() { function start() {
status = -1; status = -1;
action(1, 0, 0); action(1, 0, 0);
@@ -92,6 +90,8 @@ function action(mode, type, selection) {
} else { } else {
var state = eim.getIntProperty("yuletePassed"); var state = eim.getIntProperty("yuletePassed");
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
if(state == -1) { if(state == -1) {
cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha..."); cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha...");
} else if(state == 0) { } else if(state == 0) {
@@ -100,7 +100,7 @@ function action(mode, type, selection) {
var mapobj = eim.getMapInstance(926110401); var mapobj = eim.getMapInstance(926110401);
var bossobj = MapleLifeFactory.getMonster(9300151); 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("statusStg7", 1);
eim.setIntProperty("yuletePassed", -1); eim.setIntProperty("yuletePassed", -1);
@@ -110,7 +110,7 @@ function action(mode, type, selection) {
var mapobj = eim.getMapInstance(926110401); var mapobj = eim.getMapInstance(926110401);
var bossobj = MapleLifeFactory.getMonster(9300152); 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("statusStg7", 2);
eim.setIntProperty("yuletePassed", -1); eim.setIntProperty("yuletePassed", -1);

View File

@@ -25,15 +25,13 @@
* *
* @author Ronan * @author Ronan
*/ */
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
importPackage(Packages.scripting.event);
var status = 0; var status = 0;
var expedition; var expedition;
var expedMembers; var expedMembers;
var player; var player;
var em; var em;
const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType');
var exped = MapleExpeditionType.PINKBEAN; var exped = MapleExpeditionType.PINKBEAN;
var expedName = "Twilight of the Gods"; var expedName = "Twilight of the Gods";
var expedBoss = "Pink Bean"; 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."); cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
status = 4; status = 4;
} else if (selection == 3) { } else if (selection == 3) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
cm.endExpedition(expedition); cm.endExpedition(expedition);
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");

View File

@@ -24,9 +24,6 @@
* @author Ronan Lana * @author Ronan Lana
*/ */
importPackage(Packages.client.processor.action);
importPackage(Packages.config);
var status; var status;
var mergeFee = 50000; var mergeFee = 50000;
var name; var name;
@@ -50,7 +47,8 @@ function action(mode, type, selection) {
status--; status--;
if(status == 0) { 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.sendOk("The medal ranking system is currently unavailable...");
cm.dispose(); cm.dispose();
return; return;
@@ -59,6 +57,7 @@ function action(mode, type, selection) {
var levelLimit = !cm.getPlayer().isCygnus() ? 160 : 110; 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! "; 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)) { 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."; 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); cm.sendOk(selStr);

View File

@@ -27,9 +27,6 @@
* @func: Kerning PQ * @func: Kerning PQ
*/ */
importPackage(Packages.tools);
importPackage(java.awt);
var stage1Questions = Array( 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 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.", "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."); "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); 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 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), 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), new Rectangle(958,-180,140,50),new Rectangle(876,-238,140,45),

View File

@@ -6,8 +6,6 @@
* Guild Quest Stage 3 * Guild Quest Stage 3
*/ */
importPackage(Packages.tools);
function clearStage(stage, eim) { function clearStage(stage, eim) {
eim.setProperty("stage" + stage + "clear", "true"); eim.setProperty("stage" + stage + "clear", "true");
eim.showClearEffect(true); eim.showClearEffect(true);
@@ -213,6 +211,8 @@ function randX() {
} }
function spawnMob(id, x, y, map) { function spawnMob(id, x, y, map) {
var mob = Packages.server.life.MapleLifeFactory.getMonster(id); const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
map.spawnMonsterOnGroundBelow(mob, new Packages.java.awt.Point(x, y)); const Point = Java.type('java.awt.Point');
var mob = MapleLifeFactory.getMonster(id);
map.spawnMonsterOnGroundBelow(mob, new Point(x, y));
} }

View File

@@ -24,8 +24,6 @@
Maplemas PQ coordinator Maplemas PQ coordinator
*/ */
importPackage(Packages.server.life);
var prizeTree = [[[2000002, 1002850], [20, 1]], [[2000006, 1012011], [20, 1]]]; var prizeTree = [[[2000002, 1002850], [20, 1]], [[2000006, 1012011], [20, 1]]];
var state; var state;
@@ -131,6 +129,9 @@ function insidePqAction(mode, type, selection) {
} }
} }
} else if(status == 1) { } else if(status == 1) {
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
if(stg == -1) { if(stg == -1) {
if(!cm.isEventLeader()) { if(!cm.isEventLeader()) {
cm.sendOk("Please let your party leader talk to me for further details on the mission."); 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); mapobj.allowSummonState(true);
var snowman = MapleLifeFactory.getMonster(9400317 + (5 * difficulty)); 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.setIntProperty("snowmanLevel", 1);
eim.dropMessage(5, "The snowman appeared on the field! Protect it using all means necessary!"); 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); eim.getEm().getIv().invokeFunction("snowmanHeal", eim);
var boss = MapleLifeFactory.getMonster(9400318 + difficulty); 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.setProperty("spawnedBoss", "true");
eim.setIntProperty("statusStg1", 1); eim.setIntProperty("statusStg1", 1);

View File

@@ -22,15 +22,13 @@
* *
*@author Ronan *@author Ronan
*/ */
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
importPackage(Packages.scripting.event);
var status = 0; var status = 0;
var expedition; var expedition;
var expedMembers; var expedMembers;
var player; var player;
var em; var em;
const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType');
var exped = MapleExpeditionType.SHOWA; var exped = MapleExpeditionType.SHOWA;
var expedName = "Showa Gang"; var expedName = "Showa Gang";
var expedBoss = "The Boss"; 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."); cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
status = 4; status = 4;
} else if (selection == 3) { } else if (selection == 3) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
cm.endExpedition(expedition); cm.endExpedition(expedition);
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");

View File

@@ -21,17 +21,13 @@
Marriage NPC Marriage NPC
*/ */
importPackage(Packages.config);
importPackage(Packages.net.server.channel.handlers);
importPackage(Packages.tools);
importPackage(Packages.tools.packets);
var status; var status;
var state; var state;
var eim; var eim;
var weddingEventName = "WeddingCathedral"; var weddingEventName = "WeddingCathedral";
var cathedralWedding = true; var cathedralWedding = true;
var weddingIndoors; var weddingIndoors;
const YamlConfig = Java.type('config.YamlConfig');
var weddingBlessingExp = YamlConfig.config.server.WEDDING_BLESS_EXP; var weddingBlessingExp = YamlConfig.config.server.WEDDING_BLESS_EXP;
function isWeddingIndoors(mapid) { function isWeddingIndoors(mapid) {
@@ -304,6 +300,7 @@ function action(mode, type, selection) {
if (state == 0) { // give player blessings if (state == 0) { // give player blessings
eim.gridInsert(cm.getPlayer(), 1); eim.gridInsert(cm.getPlayer(), 1);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
if (YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) { if (YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) {
var target = cm.getPlayer(); var target = cm.getPlayer();
target.announce(MaplePacketCreator.showSpecialEffect(9)); target.announce(MaplePacketCreator.showSpecialEffect(9));
@@ -354,6 +351,7 @@ function action(mode, type, selection) {
cm.gainItem(playerItemId, -1); cm.gainItem(playerItemId, -1);
cmPartner.gainItem(partnerItemId, -1); cmPartner.gainItem(partnerItemId, -1);
const RingActionHandler = Java.type('net.server.channel.handlers.RingActionHandler');
RingActionHandler.giveMarriageRings(player, partner, marriageRingId); RingActionHandler.giveMarriageRings(player, partner, marriageRingId);
player.setMarriageItemId(marriageRingId); player.setMarriageItemId(marriageRingId);
partner.setMarriageItemId(marriageRingId); partner.setMarriageItemId(marriageRingId);

View File

@@ -22,8 +22,6 @@
Wedding info. Wedding info.
*/ */
importPackage(Packages.net.server.channel.handlers);
var status; var status;
var rings = [1112806, 1112803, 1112807, 1112809]; var rings = [1112806, 1112803, 1112807, 1112809];
@@ -125,6 +123,7 @@ function action(mode, type, selection) {
} }
cm.gainMeso(-divorceFee); cm.gainMeso(-divorceFee);
const RingActionHandler = Java.type('net.server.channel.handlers.RingActionHandler');
RingActionHandler.breakMarriageRing(cm.getPlayer(), ringObj.getItemId()); RingActionHandler.breakMarriageRing(cm.getPlayer(), ringObj.getItemId());
cm.gainItem(ringObj.getItemId(), -1); cm.gainItem(ringObj.getItemId(), -1);

View File

@@ -21,8 +21,6 @@
Marriage NPC Marriage NPC
*/ */
importPackage(Packages.net.server.channel);
var status; var status;
var wid; var wid;
var isMarrying; var isMarrying;
@@ -178,6 +176,7 @@ function action(mode, type, selection) {
if(resStatus > 0) { if(resStatus > 0) {
cm.gainItem((weddingType) ? weddingEntryTicketPremium : weddingEntryTicketCommon, -1); cm.gainItem((weddingType) ? weddingEntryTicketPremium : weddingEntryTicketCommon, -1);
const Channel = Java.type('net.server.channel.Channel');
var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus);
cm.gainItem(weddingSendTicket,15,false,true,expirationTime); cm.gainItem(weddingSendTicket,15,false,true,expirationTime);
partner.getAbstractPlayerInteraction().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)) { if(cm.canHold(weddingSendTicket, 3)) {
cm.gainItem(5251100, -1); cm.gainItem(5251100, -1);
const Channel = Java.type('net.server.channel.Channel');
var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus);
cm.gainItem(weddingSendTicket,3,false,true,expirationTime); cm.gainItem(weddingSendTicket,3,false,true,expirationTime);
} else { } else {

View File

@@ -21,8 +21,6 @@
Marriage NPC Marriage NPC
*/ */
importPackage(Packages.net.server.channel);
var status; var status;
var wid; var wid;
var isMarrying; var isMarrying;
@@ -253,6 +251,7 @@ function action(mode, type, selection) {
if(cm.canHold(weddingSendTicket, 3)) { if(cm.canHold(weddingSendTicket, 3)) {
cm.gainItem(5251100, -1); cm.gainItem(5251100, -1);
const Channel = Java.type('net.server.channel.Channel');
var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus);
cm.gainItem(weddingSendTicket,3,false,true,expirationTime); cm.gainItem(weddingSendTicket,3,false,true,expirationTime);
} else { } else {

View File

@@ -21,17 +21,13 @@
Marriage NPC Marriage NPC
*/ */
importPackage(Packages.config);
importPackage(Packages.net.server.channel.handlers);
importPackage(Packages.tools);
importPackage(Packages.tools.packets);
var status; var status;
var state; var state;
var eim; var eim;
var weddingEventName = "WeddingChapel"; var weddingEventName = "WeddingChapel";
var cathedralWedding = false; var cathedralWedding = false;
var weddingIndoors; var weddingIndoors;
const YamlConfig = Java.type('config.YamlConfig');
var weddingBlessingExp = YamlConfig.config.server.WEDDING_BLESS_EXP; var weddingBlessingExp = YamlConfig.config.server.WEDDING_BLESS_EXP;
function detectPlayerItemid(player) { function detectPlayerItemid(player) {
@@ -174,6 +170,7 @@ function action(mode, type, selection) {
if(state == 0) { // give player blessings if(state == 0) { // give player blessings
eim.gridInsert(cm.getPlayer(), 1); eim.gridInsert(cm.getPlayer(), 1);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
if(YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) { if(YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) {
var target = cm.getPlayer(); var target = cm.getPlayer();
target.announce(MaplePacketCreator.showSpecialEffect(9)); target.announce(MaplePacketCreator.showSpecialEffect(9));
@@ -224,6 +221,7 @@ function action(mode, type, selection) {
cm.gainItem(playerItemId, -1); cm.gainItem(playerItemId, -1);
cmPartner.gainItem(partnerItemId, -1); cmPartner.gainItem(partnerItemId, -1);
const RingActionHandler = Java.type('net.server.channel.handlers.RingActionHandler');
RingActionHandler.giveMarriageRings(player, partner, marriageRingId); RingActionHandler.giveMarriageRings(player, partner, marriageRingId);
player.setMarriageItemId(marriageRingId); player.setMarriageItemId(marriageRingId);
partner.setMarriageItemId(marriageRingId); partner.setMarriageItemId(marriageRingId);

View File

@@ -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. @ 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 debug = false;
var autopass = false; var autopass = false;
@@ -39,6 +37,8 @@ function spawnMobs(maxSpawn) {
var spawnPosY; var spawnPosY;
var mapObj = cm.getMap(); var mapObj = cm.getMap();
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
if (stage == 2) { if (stage == 2) {
spawnPosX = [619, 299, 47, -140, -471]; spawnPosX = [619, 299, 47, -140, -471];
spawnPosY = [-840, -840, -840, -840, -840]; spawnPosY = [-840, -840, -840, -840, -840];
@@ -49,9 +49,9 @@ function spawnMobs(maxSpawn) {
var mobObj2 = MapleLifeFactory.getMonster(9400516); var mobObj2 = MapleLifeFactory.getMonster(9400516);
var mobObj3 = MapleLifeFactory.getMonster(9400517); var mobObj3 = MapleLifeFactory.getMonster(9400517);
mapObj.spawnMonsterOnGroundBelow(mobObj1, new Packages.java.awt.Point(spawnPosX[i], spawnPosY[i])); mapObj.spawnMonsterOnGroundBelow(mobObj1, new Point(spawnPosX[i], spawnPosY[i]));
mapObj.spawnMonsterOnGroundBelow(mobObj2, new Packages.java.awt.Point(spawnPosX[i], spawnPosY[i])); mapObj.spawnMonsterOnGroundBelow(mobObj2, new Point(spawnPosX[i], spawnPosY[i]));
mapObj.spawnMonsterOnGroundBelow(mobObj3, new Packages.java.awt.Point(spawnPosX[i], spawnPosY[i])); mapObj.spawnMonsterOnGroundBelow(mobObj3, new Point(spawnPosX[i], spawnPosY[i]));
} }
} }
} else { } else {
@@ -63,7 +63,7 @@ function spawnMobs(maxSpawn) {
var rndPos = Math.floor(Math.random() * 5); var rndPos = Math.floor(Math.random() * 5);
var mobObj = MapleLifeFactory.getMonster(rndMob); 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]));
} }
} }
} }

View File

@@ -23,15 +23,13 @@
*@author Alan (SharpAceX) *@author Alan (SharpAceX)
*@author Ronan *@author Ronan
*/ */
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
importPackage(Packages.scripting.event);
var status = 0; var status = 0;
var expedition; var expedition;
var expedMembers; var expedMembers;
var player; var player;
var em; var em;
const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType');
var cwkpq = MapleExpeditionType.CWKPQ; 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"; 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."); cm.sendOk("The expedition will begin and you will now be escorted to the #bEntrance to CWKPQ Altar#k.");
status = 4; status = 4;
} else if (selection == 3) { } else if (selection == 3) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
cm.endExpedition(expedition); cm.endExpedition(expedition);
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");

View File

@@ -23,15 +23,13 @@
*@author Alan (SharpAceX) *@author Alan (SharpAceX)
*@author Ronan *@author Ronan
*/ */
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
importPackage(Packages.scripting.event);
var status = 0; var status = 0;
var expedition; var expedition;
var expedMembers; var expedMembers;
var player; var player;
var em; var em;
const MapleExpeditionType = Java.type('server.expeditions.MapleExpeditionType');
var exped = MapleExpeditionType.SCARGA; var exped = MapleExpeditionType.SCARGA;
var expedName = "Scarga"; var expedName = "Scarga";
var expedBoss = "Scarlion and Targa"; 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."); cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
status = 4; status = 4;
} else if (selection == 3) { } else if (selection == 3) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition.")); player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
cm.endExpedition(expedition); cm.endExpedition(expedition);
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");

View File

@@ -22,8 +22,6 @@
HeavenMS developer info. HeavenMS developer info.
*/ */
importPackage(Packages.tools);
var status; var status;
var anthemSong = "Field/anthem/brazil"; // sound src: https://c7.rbxcdn.com/f91060652a6e9fbfbf92cb1418435448 var anthemSong = "Field/anthem/brazil"; // sound src: https://c7.rbxcdn.com/f91060652a6e9fbfbf92cb1418435448
@@ -310,6 +308,7 @@ function writeAllFeatures() {
} }
function start() { function start() {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getPlayer().announce(MaplePacketCreator.musicChange(anthemSong)); cm.getPlayer().announce(MaplePacketCreator.musicChange(anthemSong));
status = -1; status = -1;
writeAllFeatures(); writeAllFeatures();
@@ -317,6 +316,7 @@ function start() {
} }
function action(mode, type, selection) { function action(mode, type, selection) {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
if (mode == -1) { if (mode == -1) {
cm.getPlayer().announce(MaplePacketCreator.musicChange(ambientSong)); cm.getPlayer().announce(MaplePacketCreator.musicChange(ambientSong));
cm.dispose(); cm.dispose();

View File

@@ -6,8 +6,6 @@
Script: commands.js Script: commands.js
*/ */
importPackage(Packages.client.command);
var status; var status;
var common_heading = "@"; var common_heading = "@";
@@ -17,6 +15,7 @@ var levels = ["Common", "Donator", "JrGM", "GM", "SuperGM", "Developer", "Admin"
var commands; var commands;
function writeHeavenMSCommands() { function writeHeavenMSCommands() {
const CommandsExecutor = Java.type('client.command.CommandsExecutor');
commands = CommandsExecutor.getInstance().getGmCommands(); commands = CommandsExecutor.getInstance().getGmCommands();
} }

View File

@@ -5,8 +5,6 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
**/ **/
importPackage(Packages.constants.game);
var status = 0; var status = 0;
var party; var party;
@@ -40,6 +38,8 @@ function action(mode, type, selection) {
if (status == 0) { if (status == 0) {
if (cm.getParty().getMembers().size() == party.size()) { if (cm.getParty().getMembers().size() == party.size()) {
cm.getPlayer().setChallenged(true); cm.getPlayer().setChallenged(true);
const GameConstants = Java.type('constants.game.GameConstants');
var snd = ""; var snd = "";
for (var i = 0; i < party.size(); i++) 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"; snd += "#bName: " + party.get(i).getName() + " / (Level: " + party.get(i).getLevel() + ") / " + GameConstants.getJobName(party.get(i).getJobId()) + "#k\r\n\r\n";

View File

@@ -5,8 +5,6 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
**/ **/
importPackage(Packages.constants.game);
var status = 0; var status = 0;
var party; var party;
@@ -40,6 +38,8 @@ function action(mode, type, selection) {
if (status == 0) { if (status == 0) {
if (cm.getParty().getMembers().size() == party.size()) { if (cm.getParty().getMembers().size() == party.size()) {
cm.getPlayer().setChallenged(true); cm.getPlayer().setChallenged(true);
const GameConstants = Java.type('constants.game.GameConstants');
var snd = ""; var snd = "";
for (var i = 0; i < party.size(); i++) 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"; snd += "#bName: " + party.get(i).getName() + " / (Level: " + party.get(i).getLevel() + ") / " + GameConstants.getJobName(party.get(i).getJobId()) + "#k\r\n\r\n";

View File

@@ -21,8 +21,6 @@
* @Author Ronan * @Author Ronan
* Player NPC Ranking System */ * Player NPC Ranking System */
importPackage(Packages.constants.game);
var status; var status;
function start() { function start() {
@@ -47,6 +45,7 @@ function action(mode, type, selection) {
var pnpc = cm.getPlayerNPCByScriptid(cm.getNpc()); var pnpc = cm.getPlayerNPCByScriptid(cm.getNpc());
if(pnpc != null) { if(pnpc != null) {
const GameConstants = Java.type('constants.game.GameConstants');
var branchJobName = GameConstants.getJobName(pnpc.getJob()); 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"; 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";

View File

@@ -25,12 +25,6 @@
* @author Ronan Lana * @author Ronan Lana
*/ */
importPackage(Packages.client);
importPackage(Packages.config);
importPackage(Packages.constants.game);
importPackage(Packages.server);
importPackage(Packages.server.life);
var status; 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]]]; 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]]];
@@ -151,6 +145,7 @@ function getJobTierScrolls() {
var job = cm.getPlayer().getJob(); var job = cm.getPlayer().getJob();
var jobScrolls = jobWeaponRestricted[Math.floor(cm.getPlayer().getJobStyle().getId() / 100)]; var jobScrolls = jobWeaponRestricted[Math.floor(cm.getPlayer().getJobStyle().getId() / 100)];
const GameConstants = Java.type('constants.game.GameConstants');
var jobBranch = GameConstants.getJobBranch(job); var jobBranch = GameConstants.getJobBranch(job);
if (jobBranch >= 2) { if (jobBranch >= 2) {
Array.prototype.push.apply(scrolls, jobScrolls[Math.floor((job.getId() / 10) % 10) - 1]); Array.prototype.push.apply(scrolls, jobScrolls[Math.floor((job.getId() / 10) % 10) - 1]);
@@ -200,6 +195,7 @@ function getScrollTier(scrollStats) {
function getScrollSuccessTier(scrollStats) { function getScrollSuccessTier(scrollStats) {
var prop = scrollStats.get("success"); var prop = scrollStats.get("success");
const YamlConfig = Java.type('config.YamlConfig');
if (prop > 90) { if (prop > 90) {
return 3; return 3;
} else if (prop < 50) { } else if (prop < 50) {
@@ -211,6 +207,7 @@ function getScrollSuccessTier(scrollStats) {
function getAvailableScrollsPool(baseScrolls, rewardTier, successTier) { function getAvailableScrollsPool(baseScrolls, rewardTier, successTier) {
var scrolls = []; var scrolls = [];
const MapleItemInformationProvider = Java.type('server.MapleItemInformationProvider');
var ii = MapleItemInformationProvider.getInstance(); var ii = MapleItemInformationProvider.getInstance();
for (var i = 0; i < baseScrolls.length; i++) { for (var i = 0; i < baseScrolls.length; i++) {
@@ -247,6 +244,8 @@ function getPlayerCardTierPower() {
countTier[ceTier] += ce.getValue(); countTier[ceTier] += ce.getValue();
if (ceTier >= 8) { // is special card 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 mobLevel = MapleLifeFactory.getMonsterLevel(MapleItemInformationProvider.getInstance().getCardMobId(cardid));
var mobTier = getLevelTier(mobLevel) - 1; var mobTier = getLevelTier(mobLevel) - 1;
@@ -280,6 +279,7 @@ function calculateMobBookBuckets() {
playerLevelTier = 8; playerLevelTier = 8;
} }
const MonsterBook = Java.type('client.MonsterBook');
var tierSize = MonsterBook.getCardTierSize(); var tierSize = MonsterBook.getCardTierSize();
var playerCards = getPlayerCardTierPower(); var playerCards = getPlayerCardTierPower();
@@ -421,7 +421,8 @@ function performExchange(sgItemid, sgCount) {
} }
function generateRandomScroll() { 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()); var itemid = getRandomScroll(calculateScrollTiers());
if (itemid != -1) { if (itemid != -1) {
if (performExchange(itemid, 1)) { if (performExchange(itemid, 1)) {

View File

@@ -23,9 +23,6 @@
Handles Water of Life Handles Water of Life
*/ */
importPackage(Packages.client.inventory);
importPackage(Packages.server);
var status; var status;
var dList; var dList;
@@ -80,6 +77,7 @@ function action(mode, type, selection) {
if(sPet != null) { 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..."); 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()); var it = cm.getPlayer().getInventory(MapleInventoryType.CASH).getItem(sPet.getPosition());
it.setExpiration(Date.now() + (1000 * 60 * 60 * 24 * 90)); it.setExpiration(Date.now() + (1000 * 60 * 60 * 24 * 90));
cm.getPlayer().forceUpdateItem(it); cm.getPlayer().forceUpdateItem(it);