Convert remaining scripts to Graal

Mainly missed scripts that use Nashorn's "Packages"
This commit is contained in:
P0nk
2021-04-17 21:55:32 +02:00
parent d2c7023e7b
commit fcd879f97c
74 changed files with 350 additions and 195 deletions

View File

@@ -147,8 +147,11 @@ function setup(level, lobbyid) {
eim.getInstanceMap(670010800).shuffleReactors();
var mapObj = eim.getInstanceMap(670010700);
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400536);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(942, 478));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mobObj = MapleLifeFactory.getMonster(9400536);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(942, 478));
respawnStages(eim);

View File

@@ -40,16 +40,19 @@ function cancelSchedule() {
}
function start() {
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var mapObj = em.getChannelServer().getMapFactory().getMap(800020120); // original mapid was 251010101
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(6090002);
var mobObj = MapleLifeFactory.getMonster(6090002);
if(mapObj.getMonsterById(6090002) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(560, 50));
mapObj.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "From amongst the ruins shrouded by the mists, Bamboo Warrior appears."));
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(560, 50));
mapObj.broadcastMessage(MaplePacketCreator.serverNotice(6, "From amongst the ruins shrouded by the mists, Bamboo Warrior appears."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -41,15 +41,19 @@ function cancelSchedule() {
function start() {
var herbGarden = em.getChannelServer().getMapFactory().getMap(251010102);
var gcent = Packages.server.life.MapleLifeFactory.getMonster(5220004);
if(herbGarden.getMonsterById(5220004) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
herbGarden.spawnMonsterOnGroundBelow(gcent, new Packages.java.awt.Point(560, 50));
herbGarden.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "From the mists surrounding the herb garden, the gargantuous Giant Centipede appears."));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var gcent = MapleLifeFactory.getMonster(5220004);
herbGarden.spawnMonsterOnGroundBelow(gcent, new Point(560, 50));
herbGarden.broadcastMessage(MaplePacketCreator.serverNotice(6, "From the mists surrounding the herb garden, the gargantuous Giant Centipede appears."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -41,15 +41,19 @@ function cancelSchedule() {
function start() {
var royalCatthusDesert = em.getChannelServer().getMapFactory().getMap(260010201);
var deo = Packages.server.life.MapleLifeFactory.getMonster(3220001);
if(royalCatthusDesert.getMonsterById(3220001) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
royalCatthusDesert.spawnMonsterOnGroundBelow(deo, new Packages.java.awt.Point(645, 275));
royalCatthusDesert.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Deo slowly appeared out of the sand dust."));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var deo = MapleLifeFactory.getMonster(3220001);
royalCatthusDesert.spawnMonsterOnGroundBelow(deo, new Point(645, 275));
royalCatthusDesert.broadcastMessage(MaplePacketCreator.serverNotice(6, "Deo slowly appeared out of the sand dust."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400610;
var bossMapid = 677000003;
var bossMsg = "Amdusias has appeared!";
var bossPos = new Packages.java.awt.Point(467, 0);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(467, 0);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400609;
var bossMapid = 677000005;
var bossMsg = "Andras has appeared!";
var bossPos = new Packages.java.awt.Point(201, 80);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(201, 80);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400613;
var bossMapid = 677000009;
var bossMsg = "Valefor has appeared!";
var bossPos = new Packages.java.awt.Point(251, -841);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(251, -841);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400633;
var bossMapid = 677000012;
var bossMsg = "Astaroth has appeared!";
var bossPos = new Packages.java.awt.Point(842, 0);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(842, 0);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400612;
var bossMapid = 677000001;
var bossMsg = "Marbas has appeared!";
var bossPos = new Packages.java.awt.Point(461, 61);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(461, 61);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400611;
var bossMapid = 677000007;
var bossMsg = "Crocell has appeared!";
var bossPos = new Packages.java.awt.Point(171, 50);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(171, 50);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,19 +41,23 @@ function cancelSchedule() {
function start() {
var snackBarMap = em.getChannelServer().getMapFactory().getMap(105090310);
var snackBar = Packages.server.life.MapleLifeFactory.getMonster(8220008);
if(snackBarMap.getMonsterById(8220008) != null || snackBarMap.getMonsterById(8220009) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var setPos = [[-626, -604], [735, -600]];
var rndPos = setPos[Math.floor(Math.random() * setPos.length)];
snackBarMap.spawnMonsterOnGroundBelow(snackBar, new Packages.java.awt.Point(rndPos[0], rndPos[1]));
snackBarMap.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Slowly, a suspicious food stand opens up on a strangely remote place."));
em.schedule("start", 3 * 60 *60 * 1000);
if (snackBarMap.getMonsterById(8220008) != null || snackBarMap.getMonsterById(8220009) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var setPos = [[-626, -604], [735, -600]];
var rndPos = setPos[Math.floor(Math.random() * setPos.length)];
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var snackBar = MapleLifeFactory.getMonster(8220008);
snackBarMap.spawnMonsterOnGroundBelow(snackBar, new Point(rndPos[0], rndPos[1]));
snackBarMap.broadcastMessage(MaplePacketCreator.serverNotice(6, "Slowly, a suspicious food stand opens up on a strangely remote place."));
em.schedule("start", 3 * 60 * 60 * 1000);
}
// ---------- FILLER FUNCTIONS ----------

View File

@@ -41,15 +41,19 @@ function cancelSchedule() {
function start() {
var graysPrairie = em.getChannelServer().getMapFactory().getMap(221040301);
var zeno = Packages.server.life.MapleLifeFactory.getMonster(6220001);
if(graysPrairie.getMonsterById(6220001) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
graysPrairie.spawnMonsterOnGroundBelow(zeno, new Packages.java.awt.Point(-4224, 776));
graysPrairie.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Zeno has appeared with a heavy sound of machinery."));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var zeno = MapleLifeFactory.getMonster(6220001);
graysPrairie.spawnMonsterOnGroundBelow(zeno, new Point(-4224, 776));
graysPrairie.broadcastMessage(MaplePacketCreator.serverNotice(6, "Zeno has appeared with a heavy sound of machinery."));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -249,8 +249,9 @@ function friendlyItemDrop(eim, mob) {
if (mob.getId() == 9300061) {
var cakes = eim.getIntProperty("bunnyCake") + 1;
eim.setIntProperty("bunnyCake", cakes);
mob.getMap().broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "The Moon Bunny made rice cake number " + cakes + "."));
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
mob.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny made rice cake number " + cakes + "."));
}
}
@@ -258,7 +259,8 @@ function friendlyDamaged(eim, mob) {
if (mob.getId() == 9300061) {
var bunnyDamage = eim.getIntProperty("bunnyDamaged") + 1;
if (bunnyDamage > 5) {
broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "The Moon Bunny is feeling sick. Please protect it so it can make delicious rice cakes."));
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny is feeling sick. Please protect it so it can make delicious rice cakes."));
eim.setIntProperty("bunnyDamaged", 0);
}
}

View File

@@ -71,9 +71,11 @@ function setEventRewards(eim) {
function spawnCakeBoss(eim) {
var mapObj = eim.getMapInstance(680000400);
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400606);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(777, -177));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mobObj = MapleLifeFactory.getMonster(9400606);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(777, -177));
}
function setup(level, lobbyid) {
@@ -125,10 +127,11 @@ function stopBlessings(eim) {
function sendWeddingAction(eim, type) {
var chr = eim.getLeader();
const Wedding = Java.type('tools.packets.Wedding');
if(chr.getGender() == 0) {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1));
chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1));
} else {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1));
chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1));
}
}
@@ -137,12 +140,14 @@ function hidePriestMsg(eim) {
}
function showStartMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 0));
const Wedding = Java.type('tools.packets.Wedding');
eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 0));
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}
function showBlessMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 1));
const Wedding = Java.type('tools.packets.Wedding');
eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 1));
eim.setIntProperty("guestBlessings", 1);
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}

View File

@@ -71,9 +71,11 @@ function setEventRewards(eim) {
function spawnCakeBoss(eim) {
var mapObj = eim.getMapInstance(680000400);
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400606);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(777, -177));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mobObj = MapleLifeFactory.getMonster(9400606);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(777, -177));
}
function setup(level, lobbyid) {
@@ -125,10 +127,12 @@ function stopBlessings(eim) {
function sendWeddingAction(eim, type) {
var chr = eim.getLeader();
const Wedding = Java.type('tools.packets.Wedding');
if(chr.getGender() == 0) {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1));
chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1));
} else {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1));
chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1));
}
}
@@ -137,12 +141,14 @@ function hidePriestMsg(eim) {
}
function showStartMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 0));
const Wedding = Java.type('tools.packets.Wedding');
eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 0));
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}
function showBlessMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 1));
const Wedding = Java.type('tools.packets.Wedding');
eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 1));
eim.setIntProperty("guestBlessings", 1);
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}

View File

@@ -19,7 +19,8 @@
*/
var npcid = 1104100;
var spawnPos = new Packages.java.awt.Point(2830, 78);
const Point = Java.type('java.awt.Point');
var spawnPos = new Point(2830, 78);
function start(ms) {
var mapobj = ms.getMap();

View File

@@ -19,7 +19,8 @@
*/
var npcid = 1104101;
var spawnPos = new Packages.java.awt.Point(3395, -322);
const Point = Java.type('java.awt.Point');
var spawnPos = new Point(3395, -322);
function start(ms) {
var mapobj = ms.getMap();

View File

@@ -19,7 +19,8 @@
*/
var npcid = 1104102;
var spawnPos = new Packages.java.awt.Point(500, -522);
const Point = Java.type('java.awt.Point');
var spawnPos = new Point(500, -522);
function start(ms) {
var mapobj = ms.getMap();

View File

@@ -19,7 +19,8 @@
*/
var npcid = 1104103;
var spawnPos = new Packages.java.awt.Point(-2263, -582);
const Point = Java.type('java.awt.Point');
var spawnPos = new Point(-2263, -582);
function start(ms) {
var mapobj = ms.getMap();

View File

@@ -19,7 +19,8 @@
*/
var npcid = 1104104;
var spawnPos = new Packages.java.awt.Point(372, 70);
const Point = Java.type('java.awt.Point');
var spawnPos = new Point(372, 70);
function start(ms) {
var mapobj = ms.getMap();

View File

@@ -34,7 +34,8 @@ spawnPnpcFee = 7000000;
jobType = 3;
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) {
const GameConstants = Java.type('constants.game.GameConstants');
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
@@ -92,8 +93,10 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC');
const GameConstants = Java.type('constants.game.GameConstants');
if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
cm.sendOk("There you go! Hope you will like it.");
cm.gainMeso(-spawnPnpcFee);
} else {

View File

@@ -35,7 +35,8 @@ spawnPnpcFee = 7000000;
jobType = 1;
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) {
const GameConstants = Java.type('constants.game.GameConstants');
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
@@ -93,8 +94,10 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC');
const GameConstants = Java.type('constants.game.GameConstants');
if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
cm.sendOk("There you go! Hope you will like it.");
cm.gainMeso(-spawnPnpcFee);
} else {

View File

@@ -115,7 +115,8 @@ function action(mode, type, selection) {
var useVP = false;
if(!cm.hasItem(itemToUse) && vp > 0)
useVP = true;
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
if(choice == 0) {
// VP Exchange
if(!cm.canHold(itemToUse)) {
@@ -135,11 +136,12 @@ function action(mode, type, selection) {
cm.gainItem(itemToUse, -1);
cm.getPlayer().getCashShop().gainCash(1, nxAmount);
cm.getPlayer().announce(Packages.tools.MaplePacketCreator.earnTitleMessage("You have earned " + nxAmount + " NX"));
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getPlayer().announce(MaplePacketCreator.earnTitleMessage("You have earned " + nxAmount + " NX"));
cm.logLeaf(nxAmount + " NX");
cm.dispose();
} else if(choice == 2) {
if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.SETUP).isFull(chairAmount)) {
if(!cm.getPlayer().getInventory(MapleInventoryType.SETUP).isFull(chairAmount)) {
var chairStr = "";
for(var i = 0; i < chairAmount; i++) {
@@ -159,7 +161,7 @@ function action(mode, type, selection) {
cm.sendOk("Please make sure you have enough space to hold the items!");
}
} else if(choice == 3) {
if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.EQUIP).isFull(weaponAmount)) {
if(!cm.getPlayer().getInventory(MapleInventoryType.EQUIP).isFull(weaponAmount)) {
var weaponStr = "";
for(var i = 0; i < weaponAmount; i++) {
@@ -179,7 +181,7 @@ function action(mode, type, selection) {
cm.sendOk("Please make sure you have enough space to hold the items!");
}
} else if(choice == 4) {
if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.USE).isFull(2)) {
if(!cm.getPlayer().getInventory(MapleInventoryType.USE).isFull(2)) {
cm.gainItem(buff1ID, buffAmount, true);
cm.gainItem(buff2ID, buffAmount, true);
cm.gainItem(itemToUse, -1);
@@ -190,7 +192,7 @@ function action(mode, type, selection) {
}
} else if(choice == 5) {
if(!cm.haveItem(5030000, 1)) {
if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.CASH).isFull(1)){
if(!cm.getPlayer().getInventory(MapleInventoryType.CASH).isFull(1)){
cm.gainItem(5030000, 1, false, true, 1000 * 60 * 60 * 24 * hiredMerchantLength);
if(useVP)

View File

@@ -35,7 +35,8 @@ spawnPnpcFee = 7000000;
jobType = 2;
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) {
const GameConstants = Java.type('constants.game.GameConstants');
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
@@ -93,8 +94,10 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC');
const GameConstants = Java.type('constants.game.GameConstants');
if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
cm.sendOk("There you go! Hope you will like it.");
cm.gainMeso(-spawnPnpcFee);
} else {

View File

@@ -34,7 +34,8 @@ spawnPnpcFee = 7000000;
jobType = 4;
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) {
const GameConstants = Java.type('constants.game.GameConstants');
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
@@ -94,8 +95,10 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC');
const GameConstants = Java.type('constants.game.GameConstants');
if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
cm.sendOk("There you go! Hope you will like it.");
cm.gainMeso(-spawnPnpcFee);
} else {

View File

@@ -34,7 +34,8 @@ function start() {
cm.gainItem(4031025,10);
} else {
if(cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) {
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
cm.sendNext("Check for a available slot on your ETC inventory.");
cm.dispose();
return;

View File

@@ -34,7 +34,8 @@ function start() {
cm.gainItem(4031026,20);
} else {
if(cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) {
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
cm.sendNext("Check for a available slot on your ETC inventory.");
cm.dispose();
return;

View File

@@ -34,7 +34,8 @@ function start() {
cm.gainItem(4031028,30);
} else {
if(cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) {
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
cm.sendNext("Check for a available slot on your ETC inventory.");
cm.dispose();
return;

View File

@@ -29,8 +29,10 @@ function action(mode, type, selection) {
if(cm.getClient().getChannelServer().getMapFactory().getMap(925020010).getCharacters().size() > 0) {
cm.sendOk("Someone is already challenging the Master. Try again later.");
} else {
cm.getWarpMap(910510202).spawnMonsterOnGroundBelow(Packages.server.life.MapleLifeFactory.getMonster(9300346), new java.awt.Point(95, 200));
cm.warp(910510202, 0);
const MapleLifeFactoroy = Java.type('server.life.MapleLifeFactoroy');
const Point = Java.type('java.awt.Point');
cm.getWarpMap(910510202).spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300346), new Point(95, 200));
cm.warp(910510202, 0);
}
cm.dispose();

View File

@@ -35,6 +35,7 @@ jobType = 5;
var advQuest = 0;
function start() {
const GameConstants = Java.type('constants.game.GameConstants');
if (cm.isQuestStarted(6330)) {
if (cm.getEventInstance() != null) { // missing script for skill test found thanks to Jade™
advQuest = 5; // string visibility thanks to iPunchEm & Glvelturall
@@ -63,7 +64,7 @@ function start() {
cm.sendNext("Congratulations. You have managed to pass my test. I'll teach you a new skill called \"Battleship\".\r\n\r\n #s5221006# #b#q5221006##k");
}
} else if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) {
} else if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
@@ -141,8 +142,10 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC');
const GameConstants = Java.type('constants.game.GameConstants');
if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
cm.sendOk("There you go! Hope you will like it.");
cm.gainMeso(-spawnPnpcFee);
} else {

View File

@@ -19,6 +19,7 @@
*/
function start() {
Packages.server.MapleShopFactory.getInstance().getShop(11000).sendShop(cm.getClient());
const MapleShopFactory = Java.type('server.MapleShopFactory');
MapleShopFactory.getInstance().getShop(11000).sendShop(cm.getClient());
cm.dispose();
}

View File

@@ -33,7 +33,8 @@ var maxJobType = 15;
function start() {
var jobType = parseInt(cm.getJobId() / 100);
if (jobType >= minJobType && jobType <= maxJobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) {
const GameConstants = Java.type('constants.game.GameConstants');
if (jobType >= minJobType && jobType <= maxJobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
@@ -63,8 +64,10 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC');
const GameConstants = Java.type('constants.game.GameConstants');
if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
cm.sendOk("There you go! Hope you will like it.");
cm.gainMeso(-spawnPnpcFee);
} else {

View File

@@ -33,8 +33,10 @@ function action(mode, type, selection) {
if (mode == 0 && type > 0) {
cm.getPlayer().dropMessage(5, "Eleanor: Oh, lost the Empress and still challenging us? Now you've done it! Prepare yourself!!!");
mapobj.spawnMonsterOnGroundBelow(Packages.server.life.MapleLifeFactory.getMonster(9001010), new Packages.java.awt.Point(850, 0));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
mapobj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9001010), new Point(850, 0));
mapobj.destroyNPC(1104002);
cm.dispose();

View File

@@ -5,7 +5,8 @@ var spawnPnpcFee = 7000000;
var jobType = 21;
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()))) {
const GameConstants = Java.type('constants.game.GameConstants');
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
@@ -35,8 +36,10 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.game.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
const MaplePlayerNPC = Java.type('server.life.MaplePlayerNPC');
const GameConstants = Java.type('constants.game.GameConstants');
if(MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
cm.sendOk("There you go! Hope you will like it.");
cm.gainMeso(-spawnPnpcFee);
} else {

View File

@@ -142,7 +142,8 @@ function action(mode, type, selection){
if (cm.getPlayer().getLevel() >= 50){
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
const YamlConfig = Java.type('config.YamlConfig');
if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
}else
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
cm.dispose();

View File

@@ -114,7 +114,8 @@ function action(mode, type, selection){
if (cm.getPlayer().getLevel() >= 50){
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
const YamlConfig = Java.type('config.YamlConfig');
if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
}else
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
cm.dispose();

View File

@@ -115,7 +115,8 @@ function action(mode, type, selection){
if (cm.getPlayer().getLevel() >= 50){
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
const YamlConfig = Java.type('config.YamlConfig');
if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
}else
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
cm.dispose();

View File

@@ -114,7 +114,8 @@ function action(mode, type, selection){
if (cm.getPlayer().getLevel() >= 50){
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
const YamlConfig = Java.type('config.YamlConfig');
if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
}else
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
cm.dispose();

View File

@@ -113,7 +113,8 @@ function action(mode, type, selection){
if (cm.getPlayer().getLevel() >= 50){
cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead.");
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200);
if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
const YamlConfig = Java.type('config.YamlConfig');
if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
}else
cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me.");
cm.dispose();

View File

@@ -29,9 +29,10 @@ var feeMultiplier = 7.0;
function start() {
status = -1;
if (!Packages.config.YamlConfig.config.server.USE_CPQ) {
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (!YamlConfig.config.server.USE_CPQ) {
if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
status = 0;
action(1, 0, 4);
} else {
@@ -57,7 +58,8 @@ function action(mode, type, selection) {
status++;
else
status--;
const YamlConfig = Java.type('config.YamlConfig');
if (cm.getPlayer().getMapId() == 980000010) {
if (status == 0) {
cm.sendNext("I hope you had fun at the Monster Carnival!");
@@ -221,9 +223,9 @@ function action(mode, type, selection) {
}
} else {
var party = cm.getParty().getMembers();
if ((selection >= 0 && selection <= 3) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
if ((selection >= 0 && selection <= 3) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
cm.sendOk("You need at least 2 players to participate in the battle!");
} else if ((selection >= 4 && selection <= 5) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
} else if ((selection >= 4 && selection <= 5) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
cm.sendOk("You need at least 3 players to participate in the battle!");
} else {
cm.cpqLobby(selection);
@@ -236,7 +238,7 @@ function action(mode, type, selection) {
} else {
if (status == 0) {
var talk = "What would you like to do? If you have never participate in the Monster Carnival, you will need to know a few things before participating! \r\n#b#L0# Go to the Monster Carnival 1.#l \r\n#L3# Go to the Monster Carnival 2.#l \r\n#L1# Learn about the Monster Carnival.#l\r\n#L2# Trade #t4001129#.#l";
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
talk += "\r\n#L4# ... Can I just refine my ores?#l";
}
cm.sendSimple(talk);
@@ -497,8 +499,9 @@ function refineItems(refineType) {
var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]];
var itemCount = {};
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
while (iter.hasNext()) {
var it = iter.next();
var itemid = it.getItemId();
@@ -551,7 +554,8 @@ function refineRockItems() {
var rockItems = [4011007, 4021009];
var rockFees = [10000, 15000];
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
while (iter.hasNext()) {
var it = iter.next();
var itemid = it.getItemId();

View File

@@ -28,9 +28,10 @@ var feeMultiplier = 7.0;
function start() {
status = -1;
if (!Packages.config.YamlConfig.config.server.USE_CPQ) {
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (!YamlConfig.config.server.USE_CPQ) {
if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
status = 0;
action(1, 0, 4);
} else {
@@ -56,7 +57,8 @@ function action(mode, type, selection) {
status++;
else
status--;
const YamlConfig = Java.type('config.YamlConfig');
if (cm.getPlayer().getMapId() == 980000010) {
if (status == 0) {
cm.sendNext("I hope you had fun at the Monster Carnival!");
@@ -220,9 +222,9 @@ function action(mode, type, selection) {
}
} else {
var party = cm.getParty().getMembers();
if ((selection >= 0 && selection <= 3) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
if ((selection >= 0 && selection <= 3) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
cm.sendOk("You need at least 2 players to participate in the battle!");
} else if ((selection >= 4 && selection <= 5) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
} else if ((selection >= 4 && selection <= 5) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
cm.sendOk("You need at least 3 players to participate in the battle!");
} else {
cm.cpqLobby(selection);
@@ -235,7 +237,7 @@ function action(mode, type, selection) {
} else {
if (status == 0) {
var talk = "What would you like to do? If you have never participate in the Monster Carnival, you will need to know a few things before participating! \r\n#b#L0# Go to the Monster Carnival 1.#l \r\n#L3# Go to the Monster Carnival 2.#l \r\n#L1# Learn about the Monster Carnival.#l\r\n#L2# Trade #t4001129#.#l";
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
talk += "\r\n#L4# ... Can I just refine my ores?#l";
}
cm.sendSimple(talk);
@@ -496,8 +498,9 @@ function refineItems(refineType) {
var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]];
var itemCount = {};
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
while (iter.hasNext()) {
var it = iter.next();
var itemid = it.getItemId();
@@ -550,7 +553,8 @@ function refineRockItems() {
var rockItems = [4011007, 4021009];
var rockFees = [10000, 15000];
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
while (iter.hasNext()) {
var it = iter.next();
var itemid = it.getItemId();

View File

@@ -29,8 +29,9 @@ var feeMultiplier = 7.0;
function start() {
status = -1;
if (!Packages.config.YamlConfig.config.server.USE_CPQ) {
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (!YamlConfig.config.server.USE_CPQ) {
if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
status = 0;
action(1, 0, 4);
} else {
@@ -235,7 +236,9 @@ function action(mode, type, selection) {
} else {
if (status == 0) {
var talk = "What would you like to do? If you have never participate in the Monster Carnival, you will need to know a few things before participating! \r\n#b#L0# Go to the Monster Carnival 1.#l \r\n#L3# Go to the Monster Carnival 2.#l \r\n#L1# Learn about the Monster Carnival.#l\r\n#L2# Trade #t4001129#.#l";
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
talk += "\r\n#L4# ... Can I just refine my ores?#l";
}
cm.sendSimple(talk);
@@ -496,8 +499,9 @@ function refineItems(refineType) {
var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]];
var itemCount = {};
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
while (iter.hasNext()) {
var it = iter.next();
var itemid = it.getItemId();
@@ -550,7 +554,8 @@ function refineRockItems() {
var rockItems = [4011007, 4021009];
var rockFees = [10000, 15000];
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
while (iter.hasNext()) {
var it = iter.next();
var itemid = it.getItemId();

View File

@@ -77,9 +77,10 @@ function action(mode, type, selection) {
}
} else {
var party = cm.getParty().getMembers();
if ((selection === 0 || selection === 1 ) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
const YamlConfig = Java.type('config.YamlConfig');
if ((selection === 0 || selection === 1 ) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
cm.sendOk("You need at least 2 players to participate in the battle!");
} else if ((selection === 2 ) && party.size() < (Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
} else if ((selection === 2 ) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
cm.sendOk("You need at least 3 players to participate in the battle!");
} else {
cm.cpqLobby2(selection);

View File

@@ -39,7 +39,8 @@ function action(mode, type, selection) {
status--;
if(status == 0) {
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
cm.openShopNPC(2082014);
} else if (cm.isQuestStarted(3749)) {
cm.sendOk("We've already located the enemy's ultimate weapon! Follow along the ship's bow area ahead and you will find my sister #b#p2082013##k. Report to her for futher instructions on the mission.");

View File

@@ -43,9 +43,10 @@ function action(mode, type, selection) {
else
status--;
if (status == 0) {
const YamlConfig = Java.type('config.YamlConfig');
if(cm.haveItem(4001086)) {
cm.sendYesNo("Do you want to access #b#m240050400##k right now?");
} else if(Packages.config.YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS) {
} else if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS) {
if(canBypassHTPQ()) {
cm.sendYesNo("Do you want to access #b#m240050400##k right now?");
} else {

View File

@@ -29,6 +29,7 @@ function action(mode, type, selection) {
return;
}
const GameConstants = Java.type('constants.game.GameConstants');
if (cm.getPlayer().getMapId() == 980010100 || cm.getPlayer().getMapId() == 980010200 || cm.getPlayer().getMapId() == 980010300) {
if (cm.getPlayer().getMapId() == 980010100) {
exped = MapleExpeditionType.ARIANT;
@@ -113,7 +114,7 @@ function action(mode, type, selection) {
status = 2;
}
}
} else if (Packages.constants.game.GameConstants.isAriantColiseumArena(cm.getPlayer().getMapId())) {
} else if (GameConstants.isAriantColiseumArena(cm.getPlayer().getMapId())) {
if (cm.getPlayer().getMapId() == 980010101) {
exped = MapleExpeditionType.ARIANT;
expedicao = cm.getExpedition(exped);

View File

@@ -51,7 +51,8 @@ function action(mode, type, selection) {
}
if (status == 0) {
if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (!YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
cm.sendOk("Hi, I'm #b#p" + cm.getNpc() + "##k.");
cm.dispose();
return;

View File

@@ -17,15 +17,17 @@ function action(mode, type, selection) {
status++;
else
status--;
if(status == 0) {
if(cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) {
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
cm.sendNext("Check for a available slot on your ETC inventory.");
cm.dispose();
return;
}
cm.getClient().announce(Packages.tools.MaplePacketCreator.openRPSNPC());
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getClient().announce(MaplePacketCreator.openRPSNPC());
cm.dispose();
}
}

View File

@@ -39,7 +39,8 @@ var equip;
var maxEqp = 0;
function start() {
if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (!YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
cm.sendOk("Hi, I'm #b#p" + cm.getNpc() + "##k.");
cm.dispose();
return;

View File

@@ -42,7 +42,8 @@ function action(mode, type, selection) {
}
if (status == 0) {
if (!Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (!YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
cm.sendOk("The medal ranking system is currently unavailable...");
cm.dispose();
return;

View File

@@ -26,7 +26,8 @@
function start() {
status = -1;
if (!Packages.config.YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
const YamlConfig = Java.type('config.YamlConfig');
if (!YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
cm.sendOk("... I came from distant planes to assist the fight against the #rBlack Magician#k. Right now I search my master, have you seen him?");
cm.dispose();
return;

View File

@@ -65,9 +65,11 @@ function action(mode, type, selection) {
var mapObj = cm.getMap();
mapObj.toggleDrops();
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400518);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(-245, 810));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mobObj = MapleLifeFactory.getMonster(9400518);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(-245, 810));
cm.sendOk("The fierry appeared! Defeat it to get the #b#t4031596##k!");
} else {

View File

@@ -4,7 +4,8 @@
*/
function start() {
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
cm.openShopNPC(9201101);
} else {
//cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city.");

View File

@@ -21,7 +21,8 @@ function action(mode, type, selection){
else if(status == 1){
if(cm.getText() == cm.getQuestProgress(3360)){
cm.setQuestProgress(3360, 1);
cm.getPlayer().announce(Packages.tools.MaplePacketCreator.playPortalSound());
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
cm.getPlayer().announce(MaplePacketCreator.playPortalSound());
cm.warp(261030000, "sp_" + ((cm.getMapId() == 261010000) ? "jenu" : "alca"));
}
else {

View File

@@ -46,7 +46,9 @@ function action(mode, type, selection) {
cm.sendGetText("Please input your desired name below.");
} else if(status == 2) {
var text = cm.getText();
var canCreate = Packages.client.MapleCharacter.canCreateChar(text);
const MapleCharacter = Java.type('client.MapleCharacter');
var canCreate = MapleCharacter.canCreateChar(text);
if(canCreate) {
cm.getPlayer().setName(text);
cm.sendOk("Your name has been changed to #b" + text + "#k. You will have to login again for this to take effect.", 1);

View File

@@ -27,8 +27,9 @@ var status;
var gachaMessages;
function start() {
gachaMessages = Packages.server.gachapon.MapleGachapon.Gachapon.getLootInfo();
gachas = Packages.server.gachapon.MapleGachapon.Gachapon.values();
const MapleGachapon = Java.type('server.gachapon.MapleGachapon');
gachaMessages = MapleGachapon.Gachapon.getLootInfo();
gachas = MapleGachapon.Gachapon.values();
status = -1;
action(1, 0, 0);

View File

@@ -24,7 +24,8 @@
var status;
function start() {
if (Packages.config.YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
const YamlConfig = Java.type('config.YamlConfig');
if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
cm.dispose();
cm.openNpc(9201088, "scroll_generator");
return;

View File

@@ -1,7 +1,9 @@
function enter(pi) {
var mapobj = pi.getWarpMap(104000004);
if(pi.isQuestActive(21733) && pi.getQuestProgressInt(21733, 9300345) == 0 && mapobj.countMonsters() == 0) {
mapobj.spawnMonsterOnGroundBelow(Packages.server.life.MapleLifeFactory.getMonster(9300345), new java.awt.Point(0, 0));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
mapobj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300345), new Point(0, 0));
pi.setQuestProgress(21733, 21762, 2);
}

View File

@@ -6,8 +6,10 @@ function enter(pi) {
if(mapobj1.countPlayers() == 0 && mapobj2.countPlayers() == 0) {
mapobj1.resetPQ(1);
mapobj2.resetPQ(1);
mapobj2.spawnMonsterOnGroundBelow(Packages.server.life.MapleLifeFactory.getMonster(9300348), new Packages.java.awt.Point(591, -34));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
mapobj2.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300348), new Point(591, -34));
pi.playPortalSound(); pi.warp(920030000,2);
return true;

View File

@@ -1,6 +1,7 @@
function enter(pi) {
if (pi.getPlayer().getMapId() != 777777777) {
if(!Packages.net.server.Server.getInstance().canEnterDeveloperRoom()) {
const Server = Java.type('net.server.Server');
if(!Server.getInstance().canEnterDeveloperRoom()) {
pi.message("The next room is currently unavailable.");
return false;
}

View File

@@ -54,7 +54,8 @@ function end(mode, type, selection) {
}
qm.gainItem(4032096, -30);
qm.gainItem(1142067, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.DAWNWARRIOR2);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.DAWNWARRIOR2);
qm.completeQuest();
}
qm.sendNext("You are a Knight-in-Training no more. You are now an official knight of the Cygnus Knights.");

View File

@@ -54,7 +54,8 @@ function end(mode, type, selection) {
}
qm.gainItem(4032097, -30);
qm.gainItem(1142067, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.BLAZEWIZARD2);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.BLAZEWIZARD2);
qm.completeQuest();
}
qm.sendNext("You are no longer a Knight-in-Training. You are now an official Cygnus Knight!");

View File

@@ -54,7 +54,8 @@ function end(mode, type, selection) {
}
qm.gainItem(4032098, -30);
qm.gainItem(1142067, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.WINDARCHER2);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.WINDARCHER2);
qm.completeQuest();
}
qm.sendNext("You are no longer a Knight-in-Training. You are now officially a Cygnus Knight.");

View File

@@ -54,7 +54,8 @@ function end(mode, type, selection) {
}
qm.gainItem(4032099, -30);
qm.gainItem(1142067, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.NIGHTWALKER2);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.NIGHTWALKER2);
qm.completeQuest();
}
qm.sendNext("You are no longer a Knight-in-Training. You have officially become a Cygnus Knight.");

View File

@@ -54,7 +54,8 @@ function end(mode, type, selection) {
}
qm.gainItem(4032100, -30);
qm.gainItem(1142067, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.THUNDERBREAKER2);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.THUNDERBREAKER2);
qm.completeQuest();
}
qm.sendNext("You are now no longer a Knight-in-Training. You have now officially become a Cygnus Knight.");

View File

@@ -54,7 +54,8 @@ function start(mode, type, selection) {
} else {
qm.completeQuest();
qm.gainItem(1142068, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.DAWNWARRIOR3);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.DAWNWARRIOR3);
qm.sendOk("#h #, as of this moment, you are an Advanced Knight. From this moment on, you shall carry yourself with dignity and respect befitting your new title, an Advanced Knight of Cygnus Knights. May your glory continue to shine as bright as this moment.");
}
}

View File

@@ -54,7 +54,8 @@ function start(mode, type, selection) {
} else {
qm.completeQuest();
qm.gainItem(1142068, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.BLAZEWIZARD3);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.BLAZEWIZARD3);
qm.sendOk("#h #, as of this moment, you are an Advanced Knight. From this moment on, you will train yourself with fervor as you will lead your group of Knights for the safety of this world. That fervor will provide you with plenty of courage.");
}
}

View File

@@ -54,7 +54,8 @@ function start(mode, type, selection) {
} else {
qm.completeQuest();
qm.gainItem(1142068, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.WINDARCHER3);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.WINDARCHER3);
qm.sendOk("#h #, as of this moment, you are an Advanced Knight. From this moment on, you will be carrying a while lot of responsibility befitting your new title as an Advanced Knight of Cygnus Knights. You may view the world in a carefree mode, but please remember what your mission is.");
}
}

View File

@@ -53,7 +53,8 @@ function start(mode, type, selection) {
qm.sendNext("If you wish to receive the medal befitting the title, you may want to make some room in your equipment inventory.");
} else {
qm.gainItem(1142068, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.NIGHTWALKER3);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.NIGHTWALKER3);
qm.completeQuest();
qm.sendOk("#h #, from here on out, you are an Advanced Knight of Cygnus Knights. The title comes with a newfound broad view on everything. You may encounter temptations here and there, but I want you to keep your faith and beliefs intact and do not succumb to the darkness.");
}

View File

@@ -53,7 +53,8 @@ function start(mode, type, selection) {
qm.sendNext("If you wish to receive the medal befitting the title, you may want to make some room in your equipment inventory.");
} else {
qm.gainItem(1142068, 1);
qm.getPlayer().changeJob(Packages.client.MapleJob.THUNDERBREAKER3);
const MapleJob = Java.type('client.MapleJob');
qm.getPlayer().changeJob(MapleJob.THUNDERBREAKER3);
qm.completeQuest();
qm.sendOk("#h #, from here on out, you will become an Advanced Knight of the Knights of Cygnus! As your standing rises, so does the difficulty of the tasks you will be receiving. But challenge is good, right? You have to enjoy life. Enjoy what's given to you!");
}

View File

@@ -23,10 +23,10 @@ function start(mode, type, selection) {
}
if (status == 0)
qm.sendAcceptDecline("I think i've heard of a potion that breaks these kinds of barriers. I think it's called #bKiller Mushroom Spores#k? Hmmm... outside, you'll find the Mushroom Scholar #bScarrs#k waiting outside. #bScarrs#k is an expert on mushrooms, so go talk to him.");
else if (status == 1){
else if (status == 1) {
qm.forceStartQuest();
qm.sendOk("I am confident #kScarrs#k will do everything to help you.");
else if (status == 2){
} else if (status == 2){
qm.dispose();
}
}

View File

@@ -4,25 +4,27 @@ function end(mode, type, selection) {
if (mode == -1) {
qm.dispose();
} else {
if(mode == 0 && type > 0) {
if (mode == 0 && type > 0) {
qm.dispose();
return;
}
if (mode == 1)
if (mode == 1) {
status++;
else
} else {
status--;
}
if (status == 0) {
if(qm.haveItem(4031092, 10)) {
if(qm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.USE).getNumFreeSlot() >= 1) {
if (qm.haveItem(4031092, 10)) {
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
if (qm.getPlayer().getInventory(MapleInventoryType.USE).getNumFreeSlot() >= 1) {
qm.sendOk("Well done! You brought back all the #t4031092# that were missing. Here, take this scroll as a token of my gratitude...");
} else {
} else {
qm.sendOk("Free a space on your USE inventory before receiving your prize.");
qm.dispose();
return;
}
}
} else {
qm.sendOk("Please return me 10 #t4031092# that went missing on this room.");
qm.dispose();
@@ -30,12 +32,17 @@ function end(mode, type, selection) {
}
} else if (status == 1) {
qm.gainItem(4031092, -10);
rnd = Math.floor(Math.random() * 4);
if(rnd == 0) qm.gainItem(2040704, 1);
else if(rnd == 1) qm.gainItem(2040705, 1);
else if(rnd == 2) qm.gainItem(2040707, 1);
else qm.gainItem(2040708, 1);
if (rnd == 0) {
qm.gainItem(2040704, 1);
} else if (rnd == 1) {
qm.gainItem(2040705, 1);
} else if (rnd == 2) {
qm.gainItem(2040707, 1);
} else {
qm.gainItem(2040708, 1);
}
qm.gainExp(2700);
qm.forceCompleteQuest();

View File

@@ -13,7 +13,8 @@ function end(mode, type, selection) {
if(status == 0) {
qm.sendNext("What the? Are you telling me you've already taken out 150 #o4230120#s? And these ... yes, these really are 120 #t4000122#s. I was wondering how you were going to complete this mission all by yourself, but you took care of it just fine. Alright, here ... this is a very important item for me, but please take it.");
} else if(status == 1) {
if(qm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.EQUIP).getNumFreeSlot() < 1) {
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
if(qm.getPlayer().getInventory(MapleInventoryType.EQUIP).getNumFreeSlot() < 1) {
qm.sendOk("Please free a EQUIP inventory slot to receive the reward.");
qm.dispose();
return;

View File

@@ -44,7 +44,8 @@ function end(mode, type, selection) {
status--;
if (status == 0) {
if(qm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) {
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
if(qm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
qm.sendOk("Make room on your ETC inventory first.");
qm.dispose();
return;