Search in sources :

Example 56 with Item

use of client.inventory.Item in project HeavenMS by ronancpl.

the class MaplePacketCreator method getStorage.

public static byte[] getStorage(int npcId, byte slots, Collection<Item> items, int meso) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.STORAGE.getValue());
    mplew.write(0x16);
    mplew.writeInt(npcId);
    mplew.write(slots);
    mplew.writeShort(0x7E);
    mplew.writeShort(0);
    mplew.writeInt(0);
    mplew.writeInt(meso);
    mplew.writeShort(0);
    mplew.write((byte) items.size());
    for (Item item : items) {
        addItemInfo(mplew, item, true);
    }
    mplew.writeShort(0);
    mplew.write(0);
    return mplew.getPacket();
}
Also used : MapleMapItem(server.maps.MapleMapItem) SpecialCashItem(server.CashShop.SpecialCashItem) CashItem(server.CashShop.CashItem) Item(client.inventory.Item) MaplePlayerShopItem(server.maps.MaplePlayerShopItem) MapleShopItem(server.MapleShopItem) MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 57 with Item

use of client.inventory.Item in project HeavenMS by ronancpl.

the class MaplePacketCreator method showGifts.

public static byte[] showGifts(List<Pair<Item, String>> gifts) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.CASHSHOP_OPERATION.getValue());
    mplew.write(0x4D);
    mplew.writeShort(gifts.size());
    for (Pair<Item, String> gift : gifts) {
        addCashItemInformation(mplew, gift.getLeft(), 0, gift.getRight());
    }
    return mplew.getPacket();
}
Also used : MapleMapItem(server.maps.MapleMapItem) SpecialCashItem(server.CashShop.SpecialCashItem) CashItem(server.CashShop.CashItem) Item(client.inventory.Item) MaplePlayerShopItem(server.maps.MaplePlayerShopItem) MapleShopItem(server.MapleShopItem) MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 58 with Item

use of client.inventory.Item in project HeavenMS by ronancpl.

the class MaplePacketCreator method showCashInventory.

public static byte[] showCashInventory(MapleClient c) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.CASHSHOP_OPERATION.getValue());
    mplew.write(0x4B);
    mplew.writeShort(c.getPlayer().getCashShop().getInventory().size());
    for (Item item : c.getPlayer().getCashShop().getInventory()) {
        addCashItemInformation(mplew, item, c.getAccID());
    }
    mplew.writeShort(c.getPlayer().getStorage().getSlots());
    mplew.writeShort(c.getCharacterSlots());
    return mplew.getPacket();
}
Also used : MapleMapItem(server.maps.MapleMapItem) SpecialCashItem(server.CashShop.SpecialCashItem) CashItem(server.CashShop.CashItem) Item(client.inventory.Item) MaplePlayerShopItem(server.maps.MaplePlayerShopItem) MapleShopItem(server.MapleShopItem) MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 59 with Item

use of client.inventory.Item in project HeavenMS by ronancpl.

the class MaplePacketCreator method arrangeStorage.

public static byte[] arrangeStorage(byte slots, Collection<Item> items) {
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.STORAGE.getValue());
    mplew.write(0xF);
    mplew.write(slots);
    mplew.write(124);
    for (byte i = 0; i < 10; i++) mplew.write(0);
    mplew.write(items.size());
    for (Item item : items) {
        addItemInfo(mplew, item, true);
    }
    mplew.write(0);
    return mplew.getPacket();
}
Also used : MapleMapItem(server.maps.MapleMapItem) SpecialCashItem(server.CashShop.SpecialCashItem) CashItem(server.CashShop.CashItem) Item(client.inventory.Item) MaplePlayerShopItem(server.maps.MaplePlayerShopItem) MapleShopItem(server.MapleShopItem) MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 60 with Item

use of client.inventory.Item in project HeavenMS by ronancpl.

the class MaplePacketCreator method takeOutStorage.

public static byte[] takeOutStorage(byte slots, MapleInventoryType type, Collection<Item> items) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.STORAGE.getValue());
    mplew.write(0x9);
    mplew.write(slots);
    mplew.writeShort(type.getBitfieldEncoding());
    mplew.writeShort(0);
    mplew.writeInt(0);
    mplew.write(items.size());
    for (Item item : items) {
        addItemInfo(mplew, item, true);
    }
    return mplew.getPacket();
}
Also used : MapleMapItem(server.maps.MapleMapItem) SpecialCashItem(server.CashShop.SpecialCashItem) CashItem(server.CashShop.CashItem) Item(client.inventory.Item) MaplePlayerShopItem(server.maps.MaplePlayerShopItem) MapleShopItem(server.MapleShopItem) MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Aggregations

Item (client.inventory.Item)124 MapleMapItem (server.maps.MapleMapItem)33 Equip (client.inventory.Equip)31 ArrayList (java.util.ArrayList)31 MaplePlayerShopItem (server.maps.MaplePlayerShopItem)31 Point (java.awt.Point)29 SQLException (java.sql.SQLException)25 MapleCharacter (client.MapleCharacter)21 MapleInventoryType (client.inventory.MapleInventoryType)20 PreparedStatement (java.sql.PreparedStatement)20 Connection (java.sql.Connection)19 DatabaseConnection (tools.DatabaseConnection)19 MapleInventory (client.inventory.MapleInventory)18 MapleItemInformationProvider (server.MapleItemInformationProvider)18 ResultSet (java.sql.ResultSet)16 Pair (tools.Pair)15 CashItem (server.CashShop.CashItem)13 SpecialCashItem (server.CashShop.SpecialCashItem)12 MapleShopItem (server.MapleShopItem)12 MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)11