Esempio n. 1
0
        public override bool Drink(Mobile from)
        {
            if (from.Stam < from.StamMax)
            {
                CustomRegion region1 = from.Region as CustomRegion;

                from.Stam += Scale(from, (int)(Refresh * from.StamMax));

                BasePotion.PlayDrinkEffect(from);

                if (!Engines.ConPVP.DuelContext.IsFreeConsume(from) && (region1 == null || !region1.PlayingGame(from)))
                {
                    this.Consume();
                }
            }
            else
            {
                from.SendMessage("You decide against drinking this potion, as you are already at full stamina.");
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        public override bool Drink(Mobile from)
        {
            if (from.Hits < from.HitsMax)
            {
                if (from.Poisoned && !from.IsT2A || MortalStrike.IsWounded(from))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x22, 1005000);                     // You can not heal yourself in your current state.
                    return(false);
                }
                else
                {
                    if (from.BeginAction(typeof(BaseHealPotion)))
                    {
                        CustomRegion region1 = from.Region as CustomRegion;

                        DoHeal(from);

                        BasePotion.PlayDrinkEffect(from);

                        if (!Engines.ConPVP.DuelContext.IsFreeConsume(from) && (region1 == null || !region1.PlayingGame(from)))
                        {
                            this.Consume();
                        }

                        Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(Delay), new TimerStateCallback <Mobile>(ReleaseHealLock), from);
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235);                           // You must wait 10 seconds before using another healing potion.
                        return(false);
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1049547);                 // You decide against drinking this potion, as you are already at full health.
                return(false);
            }

            return(true);
        }
Esempio n. 3
0
        public override bool Drink(Mobile from)
        {
            if (from.Poisoned)
            {
                DoCure(from);

                BasePotion.PlayDrinkEffect(from);

                from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                from.PlaySound(0x1E0);

                CustomRegion region1 = from.Region as CustomRegion;

                if (!Engines.ConPVP.DuelContext.IsFreeConsume(from) && (region1 == null || !region1.PlayingGame(from)))
                {
                    this.Consume();
                }
            }
            else
            {
                from.SendLocalizedMessage(1042000);                   // You are not poisoned.
                return(false);
            }

            return(true);
        }
        public override bool Drink(Mobile from)
        {
            if (DoStrength(from))
            {
                CustomRegion region1 = from.Region as CustomRegion;

                BasePotion.PlayDrinkEffect(from);

                if (!Engines.ConPVP.DuelContext.IsFreeConsume(from) && (region1 == null || !region1.PlayingGame(from)))
                {
                    this.Consume();
                }

                return(true);
            }

            return(false);
        }