public override void Received(VirtualClient virtualClient) { Inventory inventory = virtualClient.GetInventory(Cell.WindowType); if (inventory != null) { SlotItem slotItem = new SlotItem() { Vnum = this.Vnum, Count = this.Count }; for (int i = 0; i < StatBytes.Length; i = i + 3) { ItemStatType type = (ItemStatType)StatBytes[i]; Int16 value = BitConverter.ToInt16(StatBytes, i + 1); if (type != ItemStatType.None) { slotItem.ItemStats.Add(new ItemStat() { Type = type, Value = value }); } } inventory.SetSlot(Cell.Cell, slotItem); virtualClient.OnSlotChanged(Cell.WindowType, Cell.Cell, inventory.Slots[Cell.Cell]); } }
public override void Received(VirtualClient virtualClient) { Inventory inventory = virtualClient.GetInventory(Cell.WindowType); if (inventory != null) { List <ItemStat> itemStats = new List <ItemStat>(); for (int i = 0; i < StatBytes.Length; i = i + 3) { ItemStatType type = (ItemStatType)StatBytes[i]; Int16 value = BitConverter.ToInt16(StatBytes, i + 1); if (type != ItemStatType.None) { itemStats.Add(new ItemStat() { Type = type, Value = value }); } } inventory.UpdateItem(Cell.Cell, Count, itemStats); virtualClient.OnSlotChanged(Cell.WindowType, Cell.Cell, inventory.Slots[Cell.Cell]); } }