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); }
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(); } } }
public Item AddItem(int itemId) { return(AddItem(ItemRecord.GetItemRecord(itemId))); }