Пример #1
0
        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]);
            }
        }
Пример #2
0
        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]);
            }
        }