Rename and clean up MapleInventoryManipulator
This commit is contained in:
@@ -25,7 +25,7 @@ import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -65,7 +65,7 @@ public final class AdminCommandHandler extends AbstractPacketHandler {
|
||||
Inventory in = c.getPlayer().getInventory(InventoryType.getByType(type));
|
||||
for (short i = 1; i <= in.getSlotLimit(); i++) { //TODO What is the point of this loop?
|
||||
if (in.getItem(i) != null) {
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.getByType(type), i, in.getItem(i).getQuantity(), false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.getByType(type), i, in.getItem(i).getQuantity(), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import client.inventory.Equip;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.AbstractPacketHandler;
|
||||
@@ -361,7 +361,7 @@ public final class CashOperationHandler extends AbstractPacketHandler {
|
||||
if (chr.getMeso() >= itemPrice) {
|
||||
if (chr.canHold(itemId)) {
|
||||
chr.gainMeso(-itemPrice, false);
|
||||
MapleInventoryManipulator.addById(c, itemId, (short) 1, "", -1);
|
||||
InventoryManipulator.addById(c, itemId, (short) 1, "", -1);
|
||||
c.sendPacket(PacketCreator.showBoughtQuestItem(itemId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ package net.server.channel.handlers;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import server.MapleTrade;
|
||||
@@ -94,7 +94,7 @@ public final class ChangeMapHandler extends AbstractPacketHandler {
|
||||
if (wheel && chr.haveItemWithId(5510000, false)) {
|
||||
// thanks lucasziron (lziron) for showing revivePlayer() triggering by Wheel
|
||||
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.CASH, 5510000, 1, true, false);
|
||||
InventoryManipulator.removeById(c, InventoryType.CASH, 5510000, 1, true, false);
|
||||
chr.sendPacket(PacketCreator.showWheelsLeft(chr.getItemQuantity(5510000, false)));
|
||||
|
||||
chr.updateHp(50);
|
||||
|
||||
@@ -26,7 +26,7 @@ package net.server.channel.handlers;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.Server;
|
||||
@@ -244,7 +244,7 @@ public final class CouponCodeHandler extends AbstractPacketHandler {
|
||||
cs.addToInventory(it);
|
||||
cashItems.add(it);
|
||||
} else {
|
||||
MapleInventoryManipulator.addById(c, item, qty, "", -1);
|
||||
InventoryManipulator.addById(c, item, qty, "", -1);
|
||||
items.add(new Pair<>((int) qty, item));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -26,7 +26,7 @@ import client.MapleClient;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -73,7 +73,7 @@ public final class InventoryMergeHandler extends AbstractPacketHandler {
|
||||
if(dstItem.getItemId() != srcItem.getItemId()) continue;
|
||||
if(dstItem.getQuantity() == ii.getSlotMax(c, inventory.getItem(dst).getItemId())) break;
|
||||
|
||||
MapleInventoryManipulator.move(c, inventoryType, src, dst);
|
||||
InventoryManipulator.move(c, inventoryType, src, dst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public final class InventoryMergeHandler extends AbstractPacketHandler {
|
||||
}
|
||||
}
|
||||
if (itemSlot > 0) {
|
||||
MapleInventoryManipulator.move(c, inventoryType, itemSlot, freeSlot);
|
||||
InventoryManipulator.move(c, inventoryType, itemSlot, freeSlot);
|
||||
} else {
|
||||
sorted = true;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ package net.server.channel.handlers;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import tools.PacketCreator;
|
||||
@@ -47,13 +47,13 @@ public final class ItemMoveHandler extends AbstractPacketHandler {
|
||||
short quantity = p.readShort();
|
||||
|
||||
if (src < 0 && action > 0) {
|
||||
MapleInventoryManipulator.unequip(c, src, action);
|
||||
InventoryManipulator.unequip(c, src, action);
|
||||
} else if (action < 0) {
|
||||
MapleInventoryManipulator.equip(c, src, action);
|
||||
InventoryManipulator.equip(c, src, action);
|
||||
} else if (action == 0) {
|
||||
MapleInventoryManipulator.drop(c, type, src, quantity);
|
||||
InventoryManipulator.drop(c, type, src, quantity);
|
||||
} else {
|
||||
MapleInventoryManipulator.move(c, type, src, action);
|
||||
InventoryManipulator.move(c, type, src, action);
|
||||
}
|
||||
|
||||
if (c.getPlayer().getMap().getHPDec() > 0) c.getPlayer().resetHpDecreaseTask();
|
||||
|
||||
@@ -24,7 +24,7 @@ package net.server.channel.handlers;
|
||||
import client.MapleClient;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -53,7 +53,7 @@ public final class ItemRewardHandler extends AbstractPacketHandler {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
Pair<Integer, List<RewardItem>> rewards = ii.getItemReward(itemId);
|
||||
for (RewardItem reward : rewards.getRight()) {
|
||||
if (!MapleInventoryManipulator.checkSpace(c, reward.itemid, reward.quantity, "")) {
|
||||
if (!InventoryManipulator.checkSpace(c, reward.itemid, reward.quantity, "")) {
|
||||
c.sendPacket(PacketCreator.getShowInventoryFull());
|
||||
break;
|
||||
}
|
||||
@@ -63,11 +63,11 @@ public final class ItemRewardHandler extends AbstractPacketHandler {
|
||||
if (reward.period != -1) {
|
||||
item.setExpiration(currentServerTime() + (reward.period * 60 * 60 * 10));
|
||||
}
|
||||
MapleInventoryManipulator.addFromDrop(c, item, false);
|
||||
InventoryManipulator.addFromDrop(c, item, false);
|
||||
} else {
|
||||
MapleInventoryManipulator.addById(c, reward.itemid, reward.quantity, "", -1);
|
||||
InventoryManipulator.addById(c, reward.itemid, reward.quantity, "", -1);
|
||||
}
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, false, false);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, false, false);
|
||||
if (reward.worldmsg != null) {
|
||||
String msg = reward.worldmsg;
|
||||
msg.replaceAll("/name", c.getPlayer().getName());
|
||||
|
||||
@@ -26,7 +26,7 @@ import client.MapleClient;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -213,7 +213,7 @@ public final class MTSHandler extends AbstractPacketHandler {
|
||||
}
|
||||
ps.executeUpdate();
|
||||
ps.close();
|
||||
MapleInventoryManipulator.removeFromSlot(c, invType, slot, quantity, false);
|
||||
InventoryManipulator.removeFromSlot(c, invType, slot, quantity, false);
|
||||
|
||||
con.close();
|
||||
} catch (SQLException e) {
|
||||
@@ -343,7 +343,7 @@ public final class MTSHandler extends AbstractPacketHandler {
|
||||
pse.setInt(2, c.getPlayer().getId());
|
||||
pse.executeUpdate();
|
||||
}
|
||||
MapleInventoryManipulator.addFromDrop(c, i, false);
|
||||
InventoryManipulator.addFromDrop(c, i, false);
|
||||
c.enableCSActions();
|
||||
c.sendPacket(getCart(c.getPlayer().getId()));
|
||||
c.sendPacket(getMTS(c.getPlayer().getCurrentTab(), c.getPlayer().getCurrentType(), c.getPlayer().getCurrentPage()));
|
||||
|
||||
@@ -28,7 +28,7 @@ import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.Pet;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.Server;
|
||||
@@ -80,7 +80,7 @@ public final class PetFoodHandler extends AbstractPacketHandler {
|
||||
}
|
||||
|
||||
pet.gainClosenessFullness(chr, (pet.getFullness() <= 75) ? 1 : 0, 30, 1); // 25+ "emptyness" to get +1 closeness
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, pos, (short) 1, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.USE, pos, (short) 1, false);
|
||||
} finally {
|
||||
useInv.unlockInventory();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import client.autoban.AutobanFactory;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import client.inventory.manipulator.MapleKarmaManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
@@ -363,7 +363,7 @@ public final class PlayerInteractionHandler extends AbstractPacketHandler {
|
||||
if (shop != null && shop.isOwner(chr)) {
|
||||
if(YamlConfig.config.server.USE_ERASE_PERMIT_ON_OPENSHOP) {
|
||||
try {
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.CASH, shop.getItemId(), 1, true, false);
|
||||
InventoryManipulator.removeById(c, InventoryType.CASH, shop.getItemId(), 1, true, false);
|
||||
} catch(RuntimeException re) {} // fella does not have a player shop permit...
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ public final class PlayerInteractionHandler extends AbstractPacketHandler {
|
||||
tradeItem.setPosition(targetSlot);
|
||||
|
||||
if (trade.addItem(tradeItem)) {
|
||||
MapleInventoryManipulator.removeFromSlot(c, ivType, item.getPosition(), quantity, true);
|
||||
InventoryManipulator.removeFromSlot(c, ivType, item.getPosition(), quantity, true);
|
||||
|
||||
trade.getChr().sendPacket(PacketCreator.getTradeItemAdd((byte) 0, tradeItem));
|
||||
if (trade.getPartner() != null) {
|
||||
@@ -609,9 +609,9 @@ public final class PlayerInteractionHandler extends AbstractPacketHandler {
|
||||
}
|
||||
|
||||
if (ItemConstants.isRechargeable(ivItem.getItemId())) {
|
||||
MapleInventoryManipulator.removeFromSlot(c, ivType, slot, ivItem.getQuantity(), true);
|
||||
InventoryManipulator.removeFromSlot(c, ivType, slot, ivItem.getQuantity(), true);
|
||||
} else {
|
||||
MapleInventoryManipulator.removeFromSlot(c, ivType, slot, (short) (bundles * perBundle), true);
|
||||
InventoryManipulator.removeFromSlot(c, ivType, slot, (short) (bundles * perBundle), true);
|
||||
}
|
||||
|
||||
c.sendPacket(PacketCreator.getPlayerShopItemUpdate(shop));
|
||||
@@ -627,9 +627,9 @@ public final class PlayerInteractionHandler extends AbstractPacketHandler {
|
||||
}
|
||||
|
||||
if (ItemConstants.isRechargeable(ivItem.getItemId())) {
|
||||
MapleInventoryManipulator.removeFromSlot(c, ivType, slot, ivItem.getQuantity(), true);
|
||||
InventoryManipulator.removeFromSlot(c, ivType, slot, ivItem.getQuantity(), true);
|
||||
} else {
|
||||
MapleInventoryManipulator.removeFromSlot(c, ivType, slot, (short) (bundles * perBundle), true);
|
||||
InventoryManipulator.removeFromSlot(c, ivType, slot, (short) (bundles * perBundle), true);
|
||||
}
|
||||
|
||||
c.sendPacket(PacketCreator.updateHiredMerchant(merchant, chr));
|
||||
|
||||
@@ -5,7 +5,7 @@ import client.MapleClient;
|
||||
import client.MapleQuestStatus;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -55,7 +55,7 @@ public class RaiseIncExpHandler extends AbstractPacketHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.getByType(inventorytype), slot, (short) 1, false, true);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.getByType(inventorytype), slot, (short) 1, false, true);
|
||||
} finally {
|
||||
inv.unlockInventory();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.WeaponType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
import constants.inventory.ItemConstants;
|
||||
@@ -167,7 +167,7 @@ public final class RangedAttackHandler extends AbstractDealDamageHandler {
|
||||
}
|
||||
|
||||
if(slot < 0) System.out.println("<ERROR> Projectile to use was unable to be found.");
|
||||
else MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, bulletConsume, false, true);
|
||||
else InventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, bulletConsume, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import client.MapleRing;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import client.processor.npc.DueyProcessor;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -116,11 +116,11 @@ public final class RingActionHandler extends AbstractPacketHandler {
|
||||
source.dropMessage(1, "You may only propose to a " + (source.getGender() == 1 ? "male" : "female") + "!");
|
||||
source.sendPacket(WeddingPackets.OnMarriageResult((byte) 0));
|
||||
return;
|
||||
} else if (!MapleInventoryManipulator.checkSpace(c, newBoxId, 1, "")) {
|
||||
} else if (!InventoryManipulator.checkSpace(c, newBoxId, 1, "")) {
|
||||
source.dropMessage(5, "You don't have a ETC slot available right now!");
|
||||
source.sendPacket(WeddingPackets.OnMarriageResult((byte) 0));
|
||||
return;
|
||||
} else if (!MapleInventoryManipulator.checkSpace(target.getClient(), newBoxId + 1, 1, "")) {
|
||||
} else if (!InventoryManipulator.checkSpace(target.getClient(), newBoxId + 1, 1, "")) {
|
||||
source.dropMessage(5, "The girl you proposed doesn't have a ETC slot available right now.");
|
||||
source.sendPacket(WeddingPackets.OnMarriageResult((byte) 0));
|
||||
return;
|
||||
@@ -230,7 +230,7 @@ public final class RingActionHandler extends AbstractPacketHandler {
|
||||
|
||||
int partnerMarriageitemid = marriageitemid + ((chr.getGender() == 0) ? 1 : -1);
|
||||
if(partner.haveItem(partnerMarriageitemid)) {
|
||||
MapleInventoryManipulator.removeById(partner.getClient(), InventoryType.ETC, partnerMarriageitemid, (short) 1, false, false);
|
||||
InventoryManipulator.removeById(partner.getClient(), InventoryType.ETC, partnerMarriageitemid, (short) 1, false, false);
|
||||
}
|
||||
|
||||
//partner.sendPacket(Wedding.OnMarriageResult((byte) 0)); ok, how to gracefully unengage someone without the need to cc?
|
||||
@@ -240,7 +240,7 @@ public final class RingActionHandler extends AbstractPacketHandler {
|
||||
}
|
||||
|
||||
if(chr.haveItem(marriageitemid)) {
|
||||
MapleInventoryManipulator.removeById(chr.getClient(), InventoryType.ETC, marriageitemid, (short) 1, false, false);
|
||||
InventoryManipulator.removeById(chr.getClient(), InventoryType.ETC, marriageitemid, (short) 1, false, false);
|
||||
}
|
||||
chr.dropMessage(5, "You have successfully break the engagement with " + MapleCharacter.getNameById(partnerid) + ".");
|
||||
|
||||
@@ -279,14 +279,14 @@ public final class RingActionHandler extends AbstractPacketHandler {
|
||||
Equip ringEqp = (Equip) ringObj;
|
||||
ringEqp.setRingId(rings.getLeft());
|
||||
player.addMarriageRing(MapleRing.loadFromDb(rings.getLeft()));
|
||||
MapleInventoryManipulator.addFromDrop(player.getClient(), ringEqp, false, -1);
|
||||
InventoryManipulator.addFromDrop(player.getClient(), ringEqp, false, -1);
|
||||
player.broadcastMarriageMessage();
|
||||
|
||||
ringObj = ii.getEquipById(marriageRingId);
|
||||
ringEqp = (Equip) ringObj;
|
||||
ringEqp.setRingId(rings.getRight());
|
||||
partner.addMarriageRing(MapleRing.loadFromDb(rings.getRight()));
|
||||
MapleInventoryManipulator.addFromDrop(partner.getClient(), ringEqp, false, -1);
|
||||
InventoryManipulator.addFromDrop(partner.getClient(), ringEqp, false, -1);
|
||||
partner.broadcastMarriageMessage();
|
||||
}
|
||||
|
||||
@@ -327,13 +327,13 @@ public final class RingActionHandler extends AbstractPacketHandler {
|
||||
|
||||
if (accepted) {
|
||||
final int newItemId = getBoxId(itemid);
|
||||
if (!MapleInventoryManipulator.checkSpace(c, newItemId, 1, "") || !MapleInventoryManipulator.checkSpace(source.getClient(), newItemId, 1, "")) {
|
||||
if (!InventoryManipulator.checkSpace(c, newItemId, 1, "") || !InventoryManipulator.checkSpace(source.getClient(), newItemId, 1, "")) {
|
||||
target.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
MapleInventoryManipulator.removeById(source.getClient(), InventoryType.USE, itemid, 1, false, false);
|
||||
InventoryManipulator.removeById(source.getClient(), InventoryType.USE, itemid, 1, false, false);
|
||||
|
||||
int marriageId = c.getWorldServer().createRelationship(source.getId(), target.getId());
|
||||
source.setPartnerId(target.getId()); // engage them (new marriageitemid, partnerid for both)
|
||||
@@ -342,8 +342,8 @@ public final class RingActionHandler extends AbstractPacketHandler {
|
||||
source.setMarriageItemId(newItemId);
|
||||
target.setMarriageItemId(newItemId + 1);
|
||||
|
||||
MapleInventoryManipulator.addById(source.getClient(), newItemId, (short) 1);
|
||||
MapleInventoryManipulator.addById(c, (newItemId + 1), (short) 1);
|
||||
InventoryManipulator.addById(source.getClient(), newItemId, (short) 1);
|
||||
InventoryManipulator.addById(c, (newItemId + 1), (short) 1);
|
||||
|
||||
source.sendPacket(WeddingPackets.OnMarriageResult(marriageId, source, false));
|
||||
target.sendPacket(WeddingPackets.OnMarriageResult(marriageId, source, false));
|
||||
@@ -405,7 +405,7 @@ public final class RingActionHandler extends AbstractPacketHandler {
|
||||
long expiration = cserv.getWeddingTicketExpireTime(resStatus + 1);
|
||||
|
||||
MapleCharacter guestChr = c.getWorldServer().getPlayerStorage().getCharacterById(guest);
|
||||
if(guestChr != null && MapleInventoryManipulator.checkSpace(guestChr.getClient(), newItemId, 1, "") && MapleInventoryManipulator.addById(guestChr.getClient(), newItemId, (short) 1, expiration)) {
|
||||
if(guestChr != null && InventoryManipulator.checkSpace(guestChr.getClient(), newItemId, 1, "") && InventoryManipulator.addById(guestChr.getClient(), newItemId, (short) 1, expiration)) {
|
||||
guestChr.dropMessage(6, "[Wedding] You've been invited to " + groom + " and " + bride + "'s Wedding!");
|
||||
} else {
|
||||
if(guestChr != null && guestChr.isLoggedinWorld()) {
|
||||
|
||||
@@ -27,7 +27,7 @@ import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.*;
|
||||
import client.inventory.Equip.ScrollResult;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -128,10 +128,10 @@ public final class ScrollHandler extends AbstractPacketHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, wscroll.getPosition(), (short) 1, false, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.USE, wscroll.getPosition(), (short) 1, false, false);
|
||||
}
|
||||
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, scroll.getPosition(), (short) 1, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.USE, scroll.getPosition(), (short) 1, false);
|
||||
} finally {
|
||||
useInventory.unlockInventory();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import client.SkillFactory;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -76,7 +76,7 @@ public final class SkillBookHandler extends AbstractPacketHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, (short) 1, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, (short) 1, false);
|
||||
} finally {
|
||||
inv.unlockInventory();
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.*;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import client.status.MonsterStatus;
|
||||
import client.status.MonsterStatusEffect;
|
||||
import config.YamlConfig;
|
||||
@@ -109,7 +109,7 @@ public final class TakeDamageHandler extends AbstractPacketHandler {
|
||||
inv.lockInventory();
|
||||
try {
|
||||
qty = Math.min(chr.countItem(loseItem.getId()), dropCount);
|
||||
MapleInventoryManipulator.removeById(c, type, loseItem.getId(), qty, false, false);
|
||||
InventoryManipulator.removeById(c, type, loseItem.getId(), qty, false, false);
|
||||
} finally {
|
||||
inv.unlockInventory();
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.*;
|
||||
import client.creator.veteran.*;
|
||||
import client.inventory.*;
|
||||
import client.inventory.Equip.ScrollResult;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import client.inventory.manipulator.MapleKarmaManipulator;
|
||||
import client.processor.npc.DueyProcessor;
|
||||
import client.processor.stat.AssignAPProcessor;
|
||||
@@ -132,7 +132,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
MapleInventoryManipulator.addById(c, itemId, (short) 1);
|
||||
InventoryManipulator.addById(c, itemId, (short) 1);
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
}
|
||||
} else if (itemType == 505) { // AP/SP reset
|
||||
@@ -243,7 +243,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
return;
|
||||
}
|
||||
if (getIncubatedItem(c, itemId)) {
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.getByType(inventory2), slot2, (short) 1, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.getByType(inventory2), slot2, (short) 1, false);
|
||||
remove(c, position, itemId);
|
||||
}
|
||||
return;
|
||||
@@ -570,7 +570,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.sendVegaScroll(scrolled.getLevel() > curlevel ? 0x41 : 0x43));
|
||||
//opcodes 0x42, 0x44: "this item cannot be used"; 0x39, 0x45: crashes
|
||||
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, uSlot, (short) 1, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.USE, uSlot, (short) 1, false);
|
||||
remove(c, position, itemId);
|
||||
|
||||
final MapleClient client = c;
|
||||
@@ -612,7 +612,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
}
|
||||
}
|
||||
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.CASH, position, (short) 1, true, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.CASH, position, (short) 1, true, false);
|
||||
} finally {
|
||||
cashInv.unlockInventory();
|
||||
}
|
||||
@@ -630,7 +630,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
if (c.getPlayer().getInventory(InventoryType.getByType((byte) (id / 1000000))).isFull()) {
|
||||
return false;
|
||||
}
|
||||
MapleInventoryManipulator.addById(c, id, (short) amount);
|
||||
InventoryManipulator.addById(c, id, (short) amount);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.autoban.AutobanManager;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -61,8 +61,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
if (mob.getId() == 9300101) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, 1902000, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, 1902000, (short) 1, "", -1);
|
||||
}
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
break;
|
||||
@@ -72,8 +72,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 4)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, 4031830, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, 4031830, (short) 1, "", -1);
|
||||
} else {
|
||||
abm.spam(10);
|
||||
c.sendPacket(PacketCreator.catchMessage(0));
|
||||
@@ -90,8 +90,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
if (Math.random() < 0.5) { // 50% chance
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, 4031868, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, 4031868, (short) 1, "", -1);
|
||||
} else {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 0));
|
||||
}
|
||||
@@ -112,8 +112,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 4)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, 4031887, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, 4031887, (short) 1, "", -1);
|
||||
} else {
|
||||
c.sendPacket(PacketCreator.catchMessage(0));
|
||||
}
|
||||
@@ -125,8 +125,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 3)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, 2109001, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, 2109001, (short) 1, "", -1);
|
||||
} else {
|
||||
c.sendPacket(PacketCreator.catchMessage(0));
|
||||
}
|
||||
@@ -138,8 +138,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 3)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, 2109002, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, 2109002, (short) 1, "", -1);
|
||||
} else {
|
||||
c.sendPacket(PacketCreator.catchMessage(0));
|
||||
}
|
||||
@@ -151,8 +151,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 3)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, 2109003, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, 2109003, (short) 1, "", -1);
|
||||
} else {
|
||||
c.sendPacket(PacketCreator.catchMessage(0));
|
||||
}
|
||||
@@ -164,8 +164,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 4)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, 4001169, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, 4001169, (short) 1, "", -1);
|
||||
} else {
|
||||
c.sendPacket(PacketCreator.catchMessage(0));
|
||||
}
|
||||
@@ -178,8 +178,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
abm.spam(10);
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, 2022323, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, 2022323, (short) 1, "", -1);
|
||||
} else {
|
||||
chr.message("You cannot use the Fishing Net yet.");
|
||||
}
|
||||
@@ -201,8 +201,8 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
if (mobHp != 0 && mob.getHp() < ((mob.getMaxHp() / 100) * mobHp)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
MapleInventoryManipulator.addById(c, itemGanho, (short) 1, "", -1);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, itemGanho, (short) 1, "", -1);
|
||||
} else if (mob.getId() != 9500336) {
|
||||
if (mobHp != 0) {
|
||||
abm.spam(10);
|
||||
|
||||
@@ -26,7 +26,7 @@ import client.MapleClient;
|
||||
import client.MapleDisease;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.AbstractPacketHandler;
|
||||
@@ -107,7 +107,7 @@ public final class UseItemHandler extends AbstractPacketHandler {
|
||||
}
|
||||
|
||||
private void remove(MapleClient c, short slot) {
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, (short) 1, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, (short) 1, false);
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import client.MapleMount;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.game.ExpTable;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -73,7 +73,7 @@ public final class UseMountFoodHandler extends AbstractPacketHandler {
|
||||
mountLevelup = levelup;
|
||||
}
|
||||
|
||||
MapleInventoryManipulator.removeById(c, InventoryType.USE, itemid, 1, true, false);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemid, 1, true, false);
|
||||
}
|
||||
} finally {
|
||||
useInv.unlockInventory();
|
||||
|
||||
@@ -26,7 +26,7 @@ import client.MapleClient;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -66,7 +66,7 @@ public final class UseSolomonHandler extends AbstractPacketHandler {
|
||||
return;
|
||||
}
|
||||
chr.addGachaExp((int) gachaexp);
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, (short) 1, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, (short) 1, false);
|
||||
} finally {
|
||||
inv.unlockInventory();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ package net.server.channel.handlers;
|
||||
import client.MapleClient;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -50,7 +50,7 @@ public final class UseSummonBagHandler extends AbstractPacketHandler {
|
||||
int itemId = p.readInt();
|
||||
Item toUse = c.getPlayer().getInventory(InventoryType.USE).getItem(slot);
|
||||
if (toUse != null && toUse.getQuantity() > 0 && toUse.getItemId() == itemId) {
|
||||
MapleInventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, (short) 1, false);
|
||||
InventoryManipulator.removeFromSlot(c, InventoryType.USE, slot, (short) 1, false);
|
||||
int[][] toSpawn = MapleItemInformationProvider.getInstance().getSummonMobs(itemId);
|
||||
for (int[] toSpawnChild : toSpawn) {
|
||||
if (Randomizer.nextInt(100) < toSpawnChild[1]) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import client.MapleClient;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import client.inventory.manipulator.MapleKarmaManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.inventory.ItemConstants;
|
||||
@@ -69,7 +69,7 @@ public final class WeddingHandler extends AbstractPacketHandler {
|
||||
newItem = item.copy();
|
||||
|
||||
marriage.addGiftItem(groomWishlist, newItem);
|
||||
MapleInventoryManipulator.removeFromSlot(c, type, slot, quantity, false, false);
|
||||
InventoryManipulator.removeFromSlot(c, type, slot, quantity, false, false);
|
||||
|
||||
MapleKarmaManipulator.toggleKarmaFlagToUntradeable(newItem);
|
||||
marriage.setIntProperty(groomWishlistProp, giftCount + 1);
|
||||
@@ -115,7 +115,7 @@ public final class WeddingHandler extends AbstractPacketHandler {
|
||||
marriage.removeGiftItem(groomWishlist, item);
|
||||
marriage.saveGiftItemsToDb(c, groomWishlist, chr.getId());
|
||||
|
||||
MapleInventoryManipulator.addFromDrop(c, item, true);
|
||||
InventoryManipulator.addFromDrop(c, item, true);
|
||||
|
||||
c.sendPacket(WeddingPackets.onWeddingGiftResult((byte) 0xF, marriage.getWishlistItems(groomWishlist), marriage.getGiftItems(c, groomWishlist)));
|
||||
} else {
|
||||
@@ -135,7 +135,7 @@ public final class WeddingHandler extends AbstractPacketHandler {
|
||||
items.remove(itemPos);
|
||||
MapleMarriage.saveGiftItemsToDb(c, items, chr.getId());
|
||||
|
||||
MapleInventoryManipulator.addFromDrop(c, item, true);
|
||||
InventoryManipulator.addFromDrop(c, item, true);
|
||||
c.sendPacket(WeddingPackets.onWeddingGiftResult((byte) 0xF, Collections.singletonList(""), items));
|
||||
} else {
|
||||
c.getPlayer().dropMessage(1, "Free a slot on your inventory before collecting this item.");
|
||||
|
||||
Reference in New Issue
Block a user