Proper pet inventory packets.
This commit is contained in:
@@ -46,7 +46,33 @@ public class PetInventoryUpdate extends AbstractInventoryUpdate
|
|||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.PET_INVENTORY_UPDATE.writeId(packet);
|
OutgoingPackets.PET_INVENTORY_UPDATE.writeId(packet);
|
||||||
writeItems(packet);
|
packet.writeH(getItems().size());
|
||||||
|
for (ItemInfo item : getItems())
|
||||||
|
{
|
||||||
|
packet.writeH(item.getChange());
|
||||||
|
packet.writeH(item.getItem().getType1()); // item type1
|
||||||
|
packet.writeD(item.getObjectId());
|
||||||
|
packet.writeD(item.getItem().getId());
|
||||||
|
packet.writeQ(item.getCount());
|
||||||
|
packet.writeH(item.getItem().getType2()); // item type2
|
||||||
|
packet.writeH(0x00); // ?
|
||||||
|
packet.writeH(item.getEquipped());
|
||||||
|
packet.writeD(item.getItem().getBodyPart()); // rev 415 slot 0006-lr.ear 0008-neck 0030-lr.finger 0040-head 0080-?? 0100-l.hand 0200-gloves 0400-chest 0800-pants 1000-feet 2000-?? 4000-r.hand 8000-r.hand
|
||||||
|
packet.writeH(item.getEnchant()); // enchant level
|
||||||
|
packet.writeH(0x00); // ?
|
||||||
|
|
||||||
|
packet.writeH(item.getAttackElementType());
|
||||||
|
packet.writeH(item.getAttackElementPower());
|
||||||
|
for (byte i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
packet.writeH(item.getElementDefAttr(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int op : item.getEnchantOptions())
|
||||||
|
{
|
||||||
|
packet.writeH(op);
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import org.l2jmobius.commons.network.PacketWriter;
|
|||||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
|
|
||||||
public class PetItemList extends AbstractItemPacket
|
public class PetItemList implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private final Collection<ItemInstance> _items;
|
private final Collection<ItemInstance> _items;
|
||||||
|
|
||||||
@@ -38,7 +38,28 @@ public class PetItemList extends AbstractItemPacket
|
|||||||
packet.writeH(_items.size());
|
packet.writeH(_items.size());
|
||||||
for (ItemInstance item : _items)
|
for (ItemInstance item : _items)
|
||||||
{
|
{
|
||||||
writeItem(packet, item);
|
packet.writeH(item.getItem().getType1()); // item type1
|
||||||
|
packet.writeD(item.getObjectId());
|
||||||
|
packet.writeD(item.getId());
|
||||||
|
packet.writeQ(item.getCount());
|
||||||
|
packet.writeH(item.getItem().getType2()); // item type2
|
||||||
|
packet.writeH(0x00); // ?
|
||||||
|
packet.writeH(item.isEquipped() ? 0x01 : 0x00);
|
||||||
|
packet.writeD(item.getItem().getBodyPart()); // rev 415 slot 0006-lr.ear 0008-neck 0030-lr.finger 0040-head 0080-?? 0100-l.hand 0200-gloves 0400-chest 0800-pants 1000-feet 2000-?? 4000-r.hand 8000-r.hand
|
||||||
|
packet.writeH(item.getEnchantLevel()); // enchant level
|
||||||
|
packet.writeH(0x00); // ?
|
||||||
|
|
||||||
|
packet.writeH(item.getAttackElementType());
|
||||||
|
packet.writeH(item.getAttackElementPower());
|
||||||
|
for (byte i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
packet.writeH(item.getElementDefAttr(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int op : item.getEnchantOptions())
|
||||||
|
{
|
||||||
|
packet.writeH(op);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user