Rename and clean up MapleInventoryType
This commit is contained in:
@@ -116,7 +116,7 @@ function action(mode, type, selection) {
|
||||
if(!cm.hasItem(itemToUse) && vp > 0)
|
||||
useVP = true;
|
||||
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(choice == 0) {
|
||||
// VP Exchange
|
||||
if(!cm.canHold(itemToUse)) {
|
||||
@@ -141,7 +141,7 @@ function action(mode, type, selection) {
|
||||
cm.logLeaf(nxAmount + " NX");
|
||||
cm.dispose();
|
||||
} else if(choice == 2) {
|
||||
if(!cm.getPlayer().getInventory(MapleInventoryType.SETUP).isFull(chairAmount)) {
|
||||
if(!cm.getPlayer().getInventory(InventoryType.SETUP).isFull(chairAmount)) {
|
||||
|
||||
var chairStr = "";
|
||||
for(var i = 0; i < chairAmount; i++) {
|
||||
@@ -161,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(MapleInventoryType.EQUIP).isFull(weaponAmount)) {
|
||||
if(!cm.getPlayer().getInventory(InventoryType.EQUIP).isFull(weaponAmount)) {
|
||||
|
||||
var weaponStr = "";
|
||||
for(var i = 0; i < weaponAmount; i++) {
|
||||
@@ -181,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(MapleInventoryType.USE).isFull(2)) {
|
||||
if(!cm.getPlayer().getInventory(InventoryType.USE).isFull(2)) {
|
||||
cm.gainItem(buff1ID, buffAmount, true);
|
||||
cm.gainItem(buff2ID, buffAmount, true);
|
||||
cm.gainItem(itemToUse, -1);
|
||||
@@ -192,7 +192,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
} else if(choice == 5) {
|
||||
if(!cm.haveItem(5030000, 1)) {
|
||||
if(!cm.getPlayer().getInventory(MapleInventoryType.CASH).isFull(1)){
|
||||
if(!cm.getPlayer().getInventory(InventoryType.CASH).isFull(1)){
|
||||
cm.gainItem(5030000, 1, false, true, 1000 * 60 * 60 * 24 * hiredMerchantLength);
|
||||
|
||||
if(useVP)
|
||||
|
||||
@@ -102,8 +102,8 @@ function action(mode, type, selection) {
|
||||
} else if (status == 2) {
|
||||
if (selection == 0) {
|
||||
const MapleInventoryManipulator = Java.type('client.inventory.manipulator.MapleInventoryManipulator');
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
MapleInventoryManipulator.removeFromSlot(cm.getClient(), MapleInventoryType.CASH, 1, 1, true);
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
MapleInventoryManipulator.removeFromSlot(cm.getClient(), InventoryType.CASH, 1, 1, true);
|
||||
cm.sendOk("Your cash first slot is removed.");
|
||||
} else if (selection == 1) {
|
||||
if (cm.haveItem(5000029, 2)) {
|
||||
|
||||
@@ -34,8 +34,8 @@ function start() {
|
||||
|
||||
cm.gainItem(4031025,10);
|
||||
} else {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
cm.sendNext("Check for a available slot on your ETC inventory.");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
@@ -34,8 +34,8 @@ function start() {
|
||||
|
||||
cm.gainItem(4031026,20);
|
||||
} else {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
cm.sendNext("Check for a available slot on your ETC inventory.");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
@@ -34,8 +34,8 @@ function start() {
|
||||
|
||||
cm.gainItem(4031028,30);
|
||||
} else {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
cm.sendNext("Check for a available slot on your ETC inventory.");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
@@ -155,7 +155,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else {
|
||||
var count = 0;
|
||||
var iter = cm.getChar().getInventory(MapleInventoryType.ETC).listById(mats[i]).iterator();
|
||||
var iter = cm.getChar().getInventory(InventoryType.ETC).listById(mats[i]).iterator();
|
||||
while (iter.hasNext()) {
|
||||
count += iter.next().getQuantity();
|
||||
}
|
||||
@@ -166,7 +166,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else {
|
||||
var count = 0;
|
||||
var iter = cm.getChar().getInventory(MapleInventoryType.ETC).listById(mats).iterator();
|
||||
var iter = cm.getChar().getInventory(InventoryType.ETC).listById(mats).iterator();
|
||||
while (iter.hasNext()) {
|
||||
count += iter.next().getQuantity();
|
||||
}
|
||||
|
||||
@@ -500,8 +500,8 @@ 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 = {};
|
||||
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
var iter = cm.getPlayer().getInventory(InventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
@@ -554,8 +554,8 @@ function refineRockItems() {
|
||||
var rockItems = [4011007, 4021009];
|
||||
var rockFees = [10000, 15000];
|
||||
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
var iter = cm.getPlayer().getInventory(InventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
|
||||
@@ -499,8 +499,8 @@ 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 = {};
|
||||
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
var iter = cm.getPlayer().getInventory(InventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
@@ -553,8 +553,8 @@ function refineRockItems() {
|
||||
var rockItems = [4011007, 4021009];
|
||||
var rockFees = [10000, 15000];
|
||||
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
var iter = cm.getPlayer().getInventory(InventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
|
||||
@@ -500,8 +500,8 @@ 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 = {};
|
||||
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
var iter = cm.getPlayer().getInventory(InventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
@@ -554,8 +554,8 @@ function refineRockItems() {
|
||||
var rockItems = [4011007, 4021009];
|
||||
var rockFees = [10000, 15000];
|
||||
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
var iter = cm.getPlayer().getInventory(MapleInventoryType.ETC).iterator();
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
var iter = cm.getPlayer().getInventory(InventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
|
||||
@@ -19,8 +19,8 @@ function action(mode, type, selection) {
|
||||
status--;
|
||||
|
||||
if(status == 0) {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
cm.sendNext("Check for a available slot on your ETC inventory.");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
@@ -421,8 +421,8 @@ function performExchange(sgItemid, sgCount) {
|
||||
}
|
||||
|
||||
function generateRandomScroll() {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if (cm.getPlayer().getInventory(MapleInventoryType.USE).getNumFreeSlot() >= 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if (cm.getPlayer().getInventory(InventoryType.USE).getNumFreeSlot() >= 1) {
|
||||
var itemid = getRandomScroll(calculateScrollTiers());
|
||||
if (itemid != -1) {
|
||||
if (performExchange(itemid, 1)) {
|
||||
|
||||
@@ -77,8 +77,8 @@ function action(mode, type, selection) {
|
||||
if(sPet != null) {
|
||||
cm.sendNext("Your doll has now reawaken as your pet! However, my magic isn't perfect, so I can't promise an eternal life for your pet... Please take care of that pet before the Water of Life dries. Well then, good bye...");
|
||||
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
var it = cm.getPlayer().getInventory(MapleInventoryType.CASH).getItem(sPet.getPosition());
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
var it = cm.getPlayer().getInventory(InventoryType.CASH).getItem(sPet.getPosition());
|
||||
it.setExpiration(Date.now() + (1000 * 60 * 60 * 24 * 90));
|
||||
cm.getPlayer().forceUpdateItem(it);
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ function end(mode, type, selection) {
|
||||
}
|
||||
|
||||
else if(status == 1) {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(qm.getPlayer().getInventory(MapleInventoryType.USE).getNumFreeSlot() < 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(qm.getPlayer().getInventory(InventoryType.USE).getNumFreeSlot() < 1) {
|
||||
qm.getPlayer().dropMessage(1, "USE inventory full.");
|
||||
qm.dispose();
|
||||
return;
|
||||
|
||||
@@ -14,8 +14,8 @@ function end(mode, type, selection) {
|
||||
}
|
||||
|
||||
else if(status == 1) {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(qm.getPlayer().getInventory(MapleInventoryType.EQUIP).getNumFreeSlot() < 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(qm.getPlayer().getInventory(InventoryType.EQUIP).getNumFreeSlot() < 1) {
|
||||
qm.sendOk("Please free a EQUIP inventory slot to receive the reward.");
|
||||
qm.dispose();
|
||||
return;
|
||||
|
||||
@@ -17,8 +17,8 @@ function end(mode, type, selection) {
|
||||
|
||||
if (status == 0) {
|
||||
if (qm.haveItem(4031092, 10)) {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if (qm.getPlayer().getInventory(MapleInventoryType.USE).getNumFreeSlot() >= 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if (qm.getPlayer().getInventory(InventoryType.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 {
|
||||
qm.sendOk("Free a space on your USE inventory before receiving your prize.");
|
||||
|
||||
@@ -15,8 +15,8 @@ function end(mode, type, selection) {
|
||||
}
|
||||
|
||||
else if(status == 1) {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(qm.getPlayer().getInventory(MapleInventoryType.USE).getNumFreeSlot() < 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(qm.getPlayer().getInventory(InventoryType.USE).getNumFreeSlot() < 1) {
|
||||
qm.getPlayer().dropMessage(1, "USE inventory full.");
|
||||
qm.dispose();
|
||||
return;
|
||||
|
||||
@@ -13,8 +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) {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(qm.getPlayer().getInventory(MapleInventoryType.EQUIP).getNumFreeSlot() < 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(qm.getPlayer().getInventory(InventoryType.EQUIP).getNumFreeSlot() < 1) {
|
||||
qm.sendOk("Please free a EQUIP inventory slot to receive the reward.");
|
||||
qm.dispose();
|
||||
return;
|
||||
|
||||
@@ -10,8 +10,8 @@ function end(mode, type, selection) {
|
||||
qm.sendNext("Take these #bMana Elixir Pills#k as a token of my gratitude.");
|
||||
}
|
||||
else if (status == 1) {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(qm.getPlayer().getInventory(MapleInventoryType.USE).getNumFreeSlot() >= 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(qm.getPlayer().getInventory(InventoryType.USE).getNumFreeSlot() >= 1) {
|
||||
qm.gainItem(4000099, -1);
|
||||
qm.gainItem(2000011, 50);
|
||||
qm.gainExp(8000);
|
||||
|
||||
@@ -44,8 +44,8 @@ function end(mode, type, selection) {
|
||||
status--;
|
||||
|
||||
if (status == 0) {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if(qm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if(qm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) {
|
||||
qm.sendOk("Make room on your ETC inventory first.");
|
||||
qm.dispose();
|
||||
return;
|
||||
|
||||
@@ -8,8 +8,8 @@ function end(mode, type, selection) {
|
||||
if (status == 0) {
|
||||
qm.sendOk("Great! You managed to get the herb I need. As a #btoken of gratitude#k, take this item to help on your journey.");
|
||||
} else if (status == 1) {
|
||||
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
||||
if (qm.getPlayer().getInventory(MapleInventoryType.USE).getNumFreeSlot() >= 2) {
|
||||
const InventoryType = Java.type('client.inventory.InventoryType');
|
||||
if (qm.getPlayer().getInventory(InventoryType.USE).getNumFreeSlot() >= 2) {
|
||||
if (qm.haveItem(4000294, 1000)) {
|
||||
qm.gainItem(4000294, -1000);
|
||||
qm.gainItem(2040501, 1);
|
||||
|
||||
Reference in New Issue
Block a user