public void AddIngredient(int itemID, int quantity) { if (!RequiredItems.Any(x => x.ItemId == itemID)) { RequiredItems.Add(new ItemQuantity(itemID, quantity)); } }
/// <summary> /// Marks the specified item as required. It is moved from the bank to the inventory and will not be moved into the bank via BankAllCoinItems. /// </summary> /// <param name="item">The item to mark as required.</param> public void Require(string item) { RequiredItems.Add(item.ToLower()); if (Bot.Bank.Contains(item)) { ScriptInterface.Instance.Bank.ToInventory(item); } }
public RecipeItem(string name, long strengthBonus, long agilityBonus, long intelligenceBonus, long hitPointsBonus, long damageBonus, params string[] items) : base(name, strengthBonus, agilityBonus, intelligenceBonus, hitPointsBonus, damageBonus) { this.RequiredItems = new List <string>(); foreach (var item in items) { RequiredItems.Add(item); } }
/// <summary> /// /// </summary> /// <param name="dataString"></param> public RewardEntry(string dataString) : this() { var data = dataString.Split(';'); var requiredData = data[0]; var rewardedData = data[1]; foreach (var required in requiredData.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) { var subData = required.Split(':'); var type = subData[0]; var id = int.Parse(subData[1]); var quantity = int.Parse(subData[2]); switch (type) { case "kamas": RequiredKamas = quantity; break; case "item": RequiredItems.Add(new ItemEntry(id, quantity)); break; } } foreach (var reward in rewardedData.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) { var subData = reward.Split(':'); var type = subData[0]; var id = int.Parse(subData[1]); var quantity = int.Parse(subData[2]); switch (type) { case "kamas": RewardedKamas = quantity; break; case "item": RewardedItems.Add(new ItemEntry(id, quantity)); break; } } }