public static void UpdateInventorySlot(ZoneCharacter pChar, byte pFromSlot, byte pFromInv, byte pToSlot, Item pItem) { using (var packet = new Packet(SH12Type.ModifyItemSlot)) { packet.WriteByte(pFromSlot); packet.WriteByte(pFromInv); packet.WriteByte(pToSlot); packet.WriteByte(0x24); // pToInv if (pItem == null) { packet.WriteUShort(0xffff); } else { if (pItem.ItemInfo.Slot == ItemSlot.None) { pItem.WriteStats(packet); } else { pItem.WriteEquipStats(packet); } } pChar.Client.SendPacket(packet); } }
private void SendTradeAddItemTo(ZoneClient pClient,Item pItem,byte TradepSlot) { using (var packet = new Packet(SH19Type.SendAddItem)) { packet.WriteByte(TradepSlot); if (pItem.ItemInfo.Slot == ItemSlot.None) pItem.WriteStats(packet); else pItem.WriteEquipStats(packet); pClient.SendPacket(packet); } }
public static void ModifyInventorySlot(ZoneCharacter character, byte sourcestate, byte deststate, byte oldslot, byte newslot, Item item) { using (var packet = new Packet(SH12Type.ModifyItemSlot)) { packet.WriteByte(oldslot); packet.WriteByte(sourcestate); //aka 'unequipped' bool packet.WriteByte(newslot); packet.WriteByte(deststate); if (item == null) { packet.WriteUShort(0xffff); } else { if (item.ItemInfo.Slot == ItemSlot.None) { item.WriteStats(packet); } else { item.WriteEquipStats(packet); } } character.Client.SendPacket(packet); } }