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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations