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

@@ -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 {