public virtual int AddCraft(CraftInfo info) { if (info == null || info.TypeOf == null || info.Resources == null || info.Resources.Length == 0) { return(-1); } var item = info.TypeOf.CreateInstanceSafe <Item>(); if (item == null) { return(-1); } item.Delete(); var res = info.Resources[0]; var index = AddCraft( info.TypeOf, info.Group, info.Name, info.MinSkill, info.MaxSkill, res.TypeOf, res.Name, res.Amount, String.Format("You do not have the required {0} to craft that item.", res.Name.GetString())); if (info.Resources.Length > 1) { foreach (var r in info.Resources.Skip(1)) { AddRes( index, r.TypeOf, r.Name, r.Amount, String.Format("You do not have the required {0} to craft that item.", r.Name.GetString())); } } info.OnAdded(CraftItems.GetAt(index)); return(index); }
public void ForceExceptional(int index) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.ForceExceptional = true; }
public void AddCraftAction(int index, Action <Mobile, CraftItem, ITool> action) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.TryCraft = action; }
public void AddResCallback(int index, Func <Mobile, ConsumeType, int> func) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.ConsumeResCallback = func; }
public void SetUseSubRes2(int index, bool val) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.UseSubRes2 = val; }
public void SetDisplayID(int index, int id) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.DisplayID = id; }
public void SetForceSuccess(int index, int success) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.ForceSuccessChance = success; }
public void SetUseAllRes(int index, bool useAll) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.UseAllRes = useAll; }
public void SetForceTypeRes(int index, bool value) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.ForceTypeRes = value; }
public void SetStamReq(int index, int stam) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.Stam = stam; }
public void SetHitsReq(int index, int hits) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.Hits = hits; }
public void SetManaReq(int index, int mana) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.Mana = mana; }
public void SetItemHue(int index, int hue) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.ItemHue = hue; }
public void SetNeededThemePack(int index, ThemePack pack) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.RequiredThemePack = pack; }
public void SetRequiresMechanicalLife(int index) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.RequiresMechanicalLife = true; }
public void SetNeedHeat(int index, bool needHeat) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.NeedHeat = needHeat; }
public void SetData(int index, object data) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.Data = data; }
public void SetNeedOven(int index, bool needOven) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.NeedOven = needOven; }
/// <summary> /// Add a callback Action to allow mutating the crafted item. Handy when you have a single Item Type but you want to create variations of it. /// </summary> /// <param name="index"></param> /// <param name="action"></param> public void SetMutateAction(int index, Action <Mobile, Item, ITool> action) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.MutateAction = action; }
public void SetNeedWater(int index, bool needWater) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.NeedWater = needWater; }
public void AddMapRes(int index, Type type, int maplevel, TextDefinition name, int amount, TextDefinition message) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.AddMapRes(type, maplevel, name, amount, message); }
public void SetBeverageType(int index, BeverageType requiredBeverage) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.RequiredBeverage = requiredBeverage; }
public void AddSkill(int index, SkillName skillToMake, double minSkill, double maxSkill) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.AddSkill(skillToMake, minSkill, maxSkill); }
public void SetNeedMill(int index, bool needMill) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.NeedMill = needMill; }
public void AddRecipe(int index, int id) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.AddRecipe(id, this); }
public void SetRequiresBasketWeaving(int index) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.RequiresBasketWeaving = true; }
public void SetMinSkillOffset(int index, double skillOffset) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.MinSkillOffset = skillOffset; }
public void SetRequireResTarget(int index) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.RequiresResTarget = true; }
public void AddCreateItem(int index, Func <Mobile, CraftItem, ITool, Item> func) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.CreateItem = func; }
private void AddRecipeBase(int index, int id) { CraftItem craftItem = CraftItems.GetAt(index); craftItem.AddRecipe(id, this); }