예제 #1
0
        public int OnCraft(int mark, double quality, bool makersMark, Mobile from, CraftSystem craftSystem,
                           Type typeRes,
                           BaseTool tool, CraftItem craftItem, int resHue)
        {
            PlayerConstructed = true;

            if (craftSystem is DefAlchemy)
            {
                var pack = from.Backpack;

                if (pack != null)
                {
                    if ((int)PotionEffect >= (int)PotionEffect.TaintsMajorTransmutation)
                    {
                        return(1);
                    }

                    var kegs = pack.FindItemsByType <PotionKeg>();

                    foreach (var keg in kegs)
                    {
                        if (keg == null)
                        {
                            continue;
                        }

                        if (keg.Held <= 0 || keg.Held >= 100)
                        {
                            continue;
                        }

                        if (keg.Type != PotionEffect || keg.PotionStrength != PotionStrength)
                        {
                            continue;
                        }

                        ++keg.Held;

                        Consume();

                        DefAlchemy.RecycleBottles(from, craftItem);
                        from.SendLocalizedMessage(500282); // You create the potion and pour it into the keg.

                        return(-1);                        // signal placed in keg
                    }
                }
            }

            return(1);
        }
예제 #2
0
 public static void Initialize()
 {
     CraftSystem = new DefAlchemy();
 }