Convert remaining scripts to Graal
Mainly missed scripts that use Nashorn's "Packages"
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user