Ejemplo n.º 1
0
        public Item AddExtraItem(int itemId, byte slot)
        {
            var item = new Item(ItemRecord.GetItemRecord(itemId), Owner, slot);

            Items.Add(slot, item);
            item.ApplyStats();
            Owner.OnItemAdded(item);
            return(item);
        }
Ejemplo n.º 2
0
        public static void HandleBuyItemRequestMessage(BuyItemRequestMessage message, LoLClient client)
        {
            ItemRecord itemRecord = ItemRecord.GetItemRecord(message.itemId);

            if (client.Hero.Stats.Gold >= itemRecord.Price)
            {
                int[] recipePrices = client.Hero.Inventory.RemoveRecipeItem(itemRecord);
                Item  itemResult   = client.Hero.Inventory.AddItem(itemRecord);

                if (itemResult != null)
                {
                    int priceTotal = itemRecord.GetTotalPrice();

                    foreach (var price in recipePrices)
                    {
                        priceTotal -= price;
                    }

                    client.Hero.RemoveGold(priceTotal);
                    client.Hero.UpdateStats();
                }
            }
        }
Ejemplo n.º 3
0
 public Item AddItem(int itemId)
 {
     return(AddItem(ItemRecord.GetItemRecord(itemId)));
 }