Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public void ForceExceptional(int index)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.ForceExceptional = true;
        }
Exemplo n.º 3
0
        public void AddCraftAction(int index, Action <Mobile, CraftItem, ITool> action)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.TryCraft = action;
        }
Exemplo n.º 4
0
        public void AddResCallback(int index, Func <Mobile, ConsumeType, int> func)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.ConsumeResCallback = func;
        }
Exemplo n.º 5
0
        public void SetUseSubRes2(int index, bool val)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.UseSubRes2 = val;
        }
Exemplo n.º 6
0
        public void SetDisplayID(int index, int id)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.DisplayID = id;
        }
Exemplo n.º 7
0
        public void SetForceSuccess(int index, int success)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.ForceSuccessChance = success;
        }
Exemplo n.º 8
0
        public void SetUseAllRes(int index, bool useAll)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.UseAllRes = useAll;
        }
Exemplo n.º 9
0
        public void SetForceTypeRes(int index, bool value)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.ForceTypeRes = value;
        }
Exemplo n.º 10
0
        public void SetStamReq(int index, int stam)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.Stam = stam;
        }
Exemplo n.º 11
0
        public void SetHitsReq(int index, int hits)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.Hits = hits;
        }
Exemplo n.º 12
0
        public void SetManaReq(int index, int mana)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.Mana = mana;
        }
Exemplo n.º 13
0
        public void SetItemHue(int index, int hue)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.ItemHue = hue;
        }
Exemplo n.º 14
0
        public void SetNeededThemePack(int index, ThemePack pack)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.RequiredThemePack = pack;
        }
Exemplo n.º 15
0
        public void SetRequiresMechanicalLife(int index)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.RequiresMechanicalLife = true;
        }
Exemplo n.º 16
0
        public void SetNeedHeat(int index, bool needHeat)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.NeedHeat = needHeat;
        }
Exemplo n.º 17
0
        public void SetData(int index, object data)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.Data = data;
        }
Exemplo n.º 18
0
        public void SetNeedOven(int index, bool needOven)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.NeedOven = needOven;
        }
Exemplo n.º 19
0
        /// <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;
        }
Exemplo n.º 20
0
        public void SetNeedWater(int index, bool needWater)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.NeedWater = needWater;
        }
Exemplo n.º 21
0
        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);
        }
Exemplo n.º 22
0
        public void SetBeverageType(int index, BeverageType requiredBeverage)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.RequiredBeverage = requiredBeverage;
        }
Exemplo n.º 23
0
        public void AddSkill(int index, SkillName skillToMake, double minSkill, double maxSkill)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.AddSkill(skillToMake, minSkill, maxSkill);
        }
Exemplo n.º 24
0
        public void SetNeedMill(int index, bool needMill)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.NeedMill = needMill;
        }
Exemplo n.º 25
0
        public void AddRecipe(int index, int id)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.AddRecipe(id, this);
        }
Exemplo n.º 26
0
        public void SetRequiresBasketWeaving(int index)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.RequiresBasketWeaving = true;
        }
Exemplo n.º 27
0
        public void SetMinSkillOffset(int index, double skillOffset)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.MinSkillOffset = skillOffset;
        }
Exemplo n.º 28
0
        public void SetRequireResTarget(int index)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.RequiresResTarget = true;
        }
Exemplo n.º 29
0
        public void AddCreateItem(int index, Func <Mobile, CraftItem, ITool, Item> func)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.CreateItem = func;
        }
Exemplo n.º 30
0
        private void AddRecipeBase(int index, int id)
        {
            CraftItem craftItem = CraftItems.GetAt(index);

            craftItem.AddRecipe(id, this);
        }