ConsumeTotal() public static method

public static ConsumeTotal ( Server.Items.Container pack, BeverageType content, int quantity ) : bool
pack Server.Items.Container
content BeverageType
quantity int
return bool
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                if (targeted is Pitcher)
                {
                    if (!((Item)targeted).Movable)
                    {
                        return;
                    }

                    if (BaseBeverage.ConsumeTotal(from.Backpack, typeof(Pitcher), BeverageType.Water, 1))
                    {
                        Effects.PlaySound(from.Location, from.Map, 0x240);
                        from.AddToBackpack(new Dough());
                        from.SendMessage("You made some dough and put it them in your backpack");
                        m_Item.Use(from);
                    }
                }

                if (targeted is SweetDough)
                {
                    if (!((Item)targeted).Movable)
                    {
                        return;
                    }
                    from.SendMessage("You made a cake mix");
                    if (((SweetDough)targeted).Parent == null)
                    {
                        new CakeMix().MoveToWorld(((SweetDough)targeted).Location, ((SweetDough)targeted).Map);
                    }
                    else
                    {
                        from.AddToBackpack(new CakeMix());
                    }
                    ((SweetDough)targeted).Consume();
                    m_Item.Use(from);
                }

                if (targeted is TribalBerry)
                {
                    if (!((Item)targeted).Movable)
                    {
                        return;
                    }

                    if (from.Skills[SkillName.Cooking].Base >= 80.0)
                    {
                        m_Item.Use(from);
                        ((TribalBerry)targeted).Delete();

                        from.AddToBackpack(new TribalPaint());

                        from.SendLocalizedMessage(1042002);
                    }
                    else
                    {
                        from.SendLocalizedMessage(1042003);
                    }
                }
            }
示例#2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }


                if (targeted is WoodenBowl)
                {
                    if (!((Item)targeted).Movable)
                    {
                        return;
                    }
                    from.SendMessage("You poured some flour into the bowl");
                    if (((Item)targeted).Parent == null)
                    {
                        new BowlFlour().MoveToWorld(((Item)targeted).Location, ((Item)targeted).Map);
                    }
                    else
                    {
                        from.AddToBackpack(new BowlFlour());
                    }
                    ((WoodenBowl)targeted).Consume();
                    m_Item.Use(from);
                }
                if (targeted is Pitcher)                    // was pitcherwater
                {
                    if (!((Item)targeted).Movable)
                    {
                        return;
                    }
                    // ((PitcherWater)targeted).Use( from );
                    if (BaseBeverage.ConsumeTotal(from.Backpack, typeof(Pitcher), BeverageType.Water, 1))
                    {
                        Effects.PlaySound(from.Location, from.Map, 0x240);
                        from.AddToBackpack(new Dough());
                        from.SendMessage("You made some dough and put it them in your backpack");
                        m_Item.Use(from);
                    }
                }

                /*  no infinite flourbowls - alari
                 *      if ( targeted is BowlFlour )
                 *      {
                 *              if(!((Item)targeted).Movable) return;
                 *              ((BowlFlour)targeted).Uses++;
                 *              from.SendMessage("You poured some flour into the bowl");
                 *              m_Item.Use( from );
                 *      }
                 */
                if (targeted is SweetDough)
                {
                    if (!((Item)targeted).Movable)
                    {
                        return;
                    }
                    from.SendMessage("You made a cake mix");
                    if (((SweetDough)targeted).Parent == null)
                    {
                        new CakeMix().MoveToWorld(((SweetDough)targeted).Location, ((SweetDough)targeted).Map);
                    }
                    else
                    {
                        from.AddToBackpack(new CakeMix());
                    }
                    ((SweetDough)targeted).Consume();
                    m_Item.Use(from);
                }

                if (targeted is TribalBerry)
                {
                    if (!((Item)targeted).Movable)
                    {
                        return;
                    }

                    if (from.Skills[SkillName.Cooking].Base >= 80.0)
                    {
                        m_Item.Use(from);
                        ((TribalBerry)targeted).Delete();

                        from.AddToBackpack(new TribalPaint());

                        from.SendLocalizedMessage(1042002);                           // You combine the berry and the flour into the tribal paint worn by the savages.
                    }
                    else
                    {
                        from.SendLocalizedMessage(1042003);                           // You don't have the cooking skill to create the body paint.
                    }
                }
            }