PlayDrinkEffect() 공개 정적인 메소드

public static PlayDrinkEffect ( Server.Mobile m ) : void
m Server.Mobile
리턴 void
예제 #1
0
        public override void Drink(Mobile m)
        {
            TimeSpan duration = TimeSpan.FromMinutes(1);

            if (m.Blessed == false)
            {
                m.FixedEffect(0x375A, 10, 15);
                m.PlaySound(492);

                BasePotion.PlayDrinkEffect(m);

                this.Consume();

                m.Blessed = true;
                m.NameHue = 0x35;

                RemoveTimer(m);

                Timer t = new InternalTimer(m, duration);

                m_Table[m] = t;

                t.Start();
            }
            else
            {
                m.SendMessage("An invulnerability potion is already taking effect on your person.");                   //An invisibility potion is already taking effect on your person.
            }
        }
예제 #2
0
        public override bool Drink(Mobile from)
        {
            if (from.BeginAction(typeof(LightCycle)))
            {
                new LightCycle.NightSightTimer(from).Start();
                from.LightLevel = LightCycle.DungeonLevel / 2;

                from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist);
                from.PlaySound(0x1E3);

                BasePotion.PlayDrinkEffect(from);

                if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                {
                    this.Consume();
                }
            }
            else
            {
                from.SendMessage("You already have nightsight.");
                return(false);
            }

            return(true);
        }
예제 #3
0
        public override void Drink(Mobile from)
        {
            if (TransformationSpellHelper.UnderTransformation(from, typeof(Spells.Necromancy.VampiricEmbraceSpell)))
            {
                from.SendLocalizedMessage(1061652);                   // The garlic in the potion would surely kill you.
            }
            else if (from.Poisoned)
            {
                DoCure(from);

                BasePotion.PlayDrinkEffect(from);

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

                if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                {
                    this.Consume();
                }
            }
            else
            {
                from.SendLocalizedMessage(1042000);                   // You are not poisoned.
            }
        }
        public override void Drink(Mobile from)
        {
            if (from.Hits < from.HitsMax)
            {
                if (from.BeginAction(typeof(BaseHealPotion)))
                {
                    DoHeal(from);

                    if (!BasePotion.PlayDrinkEffect(from))
                    {
                        Consume();
                    }

                    Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseHealLock), from);
                }

                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235);                       // You must wait 10 seconds before using another healing potion.
                }
            }

            else
            {
                from.SendLocalizedMessage(1049547);                   // You decide against drinking this potion, as you are already at full health.
            }
        }
        public override bool Drink(Mobile from)
        {
            if (from.Mana < from.ManaMax)
            {
                if (from.BeginAction(typeof(BaseManaRefreshPotion)))
                {
                    from.Mana += Scale(from, (int)(Refresh * from.ManaMax));

                    BasePotion.PlayDrinkEffect(from);

                    Delete();

                    Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(20.0), new TimerStateCallback <Mobile>(ReleaseManaLock), from);

                    return(true);
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x22, false, "You must wait 20 seconds before using another mana refresh potion.");
                }
            }
            else
            {
                from.SendMessage("You decide against drinking this potion, as you already have full mana.");
            }

            return(false);
        }
예제 #6
0
        public override void Drink(Mobile from)
        {
            if (from.Hits < from.HitsMax)
            {
                /*if ( from.Poisoned || MortalStrike.IsWounded( from ) )
                 * {
                 *      from.LocalOverheadMessage( MessageType.Regular, 0x22, 1005000 ); // You can not heal yourself in your current state.
                 * }
                 * else*/
                {
                    if (from.BeginAction(typeof(BaseHealPotion)))
                    {
                        DoHeal(from);

                        BasePotion.PlayDrinkEffect(from);

                        this.Consume();

                        Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseHealLock), from);
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235);                           // You must wait 10 seconds before using another healing potion.
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1049547);                   // You decide against drinking this potion, as you are already at full health.
            }
        }
예제 #7
0
        public override void Drink(Mobile from)
        {
            if (this != null && ParentEntity != from.Backpack)
            {
                from.SendMessage("The potion must be in your pack to drink it.");
            }

            else
            {
                if (!from.CanBeginAction(typeof(IncognitoSpell)))
                {
                    from.SendMessage("You are already under the influence of an incognito effect.");
                    return;
                }

                if (DisguiseTimers.IsDisguised(from))
                {
                    from.SendMessage("You cannot can drink that while being disguised.");
                }

                if (KinPaint.IsWearingKinPaint(from))
                {
                    from.SendMessage("You cannot can drink that while wearing kin paint.");
                    return;
                }

                if (!from.CanBeginAction(typeof(PolymorphSpell)) || from.IsBodyMod)
                {
                    from.SendMessage("You cannot can drink that while under the effect of a modification spell, ability, or item.");
                    return;
                }

                from.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head);
                from.PlaySound(0x3BD);
                from.Animate(34, 5, 1, true, false, 0);

                BasePotion.PlayDrinkEffect(from);

                from.HueMod = from.Race.RandomSkinHue();

                from.NameMod = from.Female ? NameList.RandomName("female") : NameList.RandomName("male");

                PlayerMobile pm = from as PlayerMobile;

                if (pm != null && pm.Race != null)
                {
                    pm.SetHairMods(pm.Race.RandomHair(pm.Female), pm.Race.RandomFacialHair(pm.Female));
                    pm.HairHue       = pm.Race.RandomHairHue();
                    pm.FacialHairHue = pm.Race.RandomHairHue();
                }

                BaseArmor.ValidateMobile(from);

                from.BeginAction(typeof(IncognitoSpell));

                Timer.DelayCall(TimeSpan.FromSeconds(300), delegate { ChangeBack(from); });

                Consume();
            }
        }
예제 #8
0
        public override void Drink(Mobile from)
        {
            if (TransformationSpellHelper.UnderTransformation(from, typeof(Spells.Necromancy.VampiricEmbraceSpell)))
            {
                from.SendLocalizedMessage(1061652);                   // The garlic in the potion would surely kill you.
            }
            else if (from.Poisoned)
            {
                if (from.BeginAction(typeof(BasePotion)))
                {
                    DoCure(from);

                    BasePotion.PlayDrinkEffect(from);

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

                    if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                    {
                        this.Consume();
                    }
                    Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseLock), from);
                }
                else
                {
                    from.NonlocalOverheadMessage(MessageType.Regular, 0x22, true, "You must wait before using another mana potion.");
                    //from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235); // You must wait 10 seconds before using another healing potion.
                }
            }
            else
            {
                from.SendLocalizedMessage(1042000);                   // You are not poisoned.
            }
        }
예제 #9
0
        public override void Drink(Mobile from)
        {
            if (Spells.Necromancy.TransformationSpell.UnderTransformation(from, typeof(Spells.Necromancy.VampiricEmbraceSpell)))
            {
                from.SendLocalizedMessage(1061652);                   // The garlic in the potion would surely kill you.
            }
            else if (from.Poisoned)
            {
                if (from.BeginAction(typeof(BaseHealPotion)))
                {
                    DoCure(from);

                    BasePotion.PlayDrinkEffect(from);

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

                    this.Consume();
                    Timer.DelayCall(TimeSpan.FromSeconds(15.0), new TimerStateCallback(ReleaseHealLock), from);
                }
            }
            else
            {
                from.SendLocalizedMessage(1042000);                   // You are not poisoned.
            }
        }
예제 #10
0
 public override void Drink(Mobile m)
 {
     if (m.InRange(this.GetWorldLocation(), 1))
     {
         string  modName = m.Serial.ToString();
         StatMod smod    = m.GetStatMod("Str");
         StatMod dmod    = m.GetStatMod("Dex");
         StatMod imod    = m.GetStatMod("Int");
         if (smod != null && imod != null && dmod != null)
         {
             m.SendMessage("You appear to be under a similar effect!");
         }
         else if (smod == null && imod == null && dmod == null)
         {
             m.AddStatMod(new StatMod(StatType.Int, modName + "Int", 10, TimeSpan.FromMinutes(5)));
             m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", 10, TimeSpan.FromMinutes(5)));
             m.AddStatMod(new StatMod(StatType.Str, modName + "Str", 10, TimeSpan.FromMinutes(5)));
             m.Hits = m.HitsMax;
             m.Mana = m.ManaMax;
             m.Stam = m.StamMax;
             BasePotion.PlayDrinkEffect(m);
             this.Consume();
             m.SendMessage("You feel much more superior!");
         }
     }
     else
     {
         m.LocalOverheadMessage(MessageType.Regular, 906, 1019045);                   // I can't reach that.
     }
 }
예제 #11
0
        public override void Drink(Mobile from)
        {
            if (from.BeginAction(typeof(LightCycle)))
            {
                new LightCycle.NightSightTimer(from).Start();

                if (Server.Utilities.StartupSettings.LightingChanged)
                {
                    from.LightLevel = 15;
                }
                else if (from.Map != Map.Trammel)
                {
                    from.LightLevel = LightCycle.DungeonLevel / 2;
                }
                else
                {
                    from.LightLevel = 6;
                }

                from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist);
                from.PlaySound(0x1E3);

                BasePotion.PlayDrinkEffect(from);

                this.Consume();
            }
            else
            {
                from.SendMessage("You already have nightsight.");
            }
        }
예제 #12
0
 public void ConsumeCharge(HairDyePotion potion, Mobile from)
 {
     potion.Consume();
     from.RevealingAction();
     BasePotion.PlayDrinkEffect(from);
     from.PlaySound(Utility.RandomList(0x30, 0x2D6));
 }
예제 #13
0
        public override void Drink(Mobile from)
        {
            Item am = from.Backpack.FindItemByType(typeof(RecluseStingMarker));

            if (am != null)
            {
                from.BodyMod         = 0;
                from.Hue             = -1;
                from.YellowHealthbar = false;

                from.PlaySound(0xF6);
                from.PlaySound(0x1F7);
                from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                BasePotion.PlayDrinkEffect(from);

                this.Consume();
                from.SendGump(new RecluseAntidoteGump());
                //am.Delete();
            }
            else if (am == null)
            {
                from.SendGump(new RecluseCuredGump());
            }
        }
예제 #14
0
        public override bool Drink(Mobile from)
        {
            if (from.RawDex > 10)
            {
                if (from.BeginAction(typeof(BaseLethargyPotion)))
                {
                    DoStatLoss(from);

                    BasePotion.PlayDrinkEffect(from);

                    this.Consume();

                    new DelayTimer(from).Start();

                    return(true);
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x22, true, "You must wait for your body to adjust to the potion.");
                }
            }
            else
            {
                from.SendMessage("You decide against drinking this potion, as you are already fairly slow.");
            }

            return(false);
        }
예제 #15
0
        public override void Drink(Mobile from)
        {
            if (from.Mana < from.ManaMax)
            {
                if (MortalStrike.IsWounded(from))                                  // if (from.Poisoned || MortalStrike.IsWounded(from))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x22, 1005000); // You can not heal yourself in your current state.
                }
                else
                {
                    if (from.BeginAction(typeof(BaseHealPotion)))
                    {
                        DoMana(from);

                        BasePotion.PlayDrinkEffect(from);

                        this.Consume(); // this.Consume();

                        Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseManaLock), from);
                    }
                    else
                    {
                        from.SendMessage(0x22, "Voce nao pode usar outra potion em tao pouco tempo");
                        //from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235); // You must wait 10 seconds before using another healing potion.
                    }
                }
            }
            else
            {
                from.SendMessage(0x22, "Voce decide nao usar a potion, pois esta com Mana cheia");
                //from.SendLocalizedMessage( 1049547 ); // You decide against drinking this potion, as you are already at full health.
            }
        }
예제 #16
0
        public override void Drink(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (TransformationSpellHelper.UnderTransformation(from, typeof(Spells.Necromancy.VampiricEmbraceSpell)))
            {
                from.SendLocalizedMessage(1061652);                   // The garlic in the potion would surely kill you.
            }
            else if (from.Poisoned)
            {
                if (pm.Level >= RequiredLevel)
                {
                    DoCure(from);

                    BasePotion.PlayDrinkEffect(from);

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

                    this.Consume();
                }
                else
                {
                    from.SendMessage("Your level isn't high enough to use this potion.");
                }
            }
            else
            {
                from.SendLocalizedMessage(1042000);                   // You are not poisoned.
            }
        }
예제 #17
0
        public override void Drink(Mobile from)
        {
            if (from.Mana < from.ManaMax)
            {
                if (from.BeginAction(typeof(BaseHealPotion)))
                {
                    from.Mana = Math.Min(from.Mana + 50, from.ManaMax);

                    from.FixedParticles(0x375A, 9, 16, 5007, EffectLayer.Waist);

                    BasePotion.PlayDrinkEffect(from);
                    from.PlaySound(0x5C8);

                    this.Consume();

                    Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(ReleaseHealLock), from);
                }
                else
                {
                    from.SendMessage("You must wait 10 seconds before using another sky blue potion.");
                }
            }
            else
            {
                from.SendMessage("You decide against drinking this potion, as you are already at full mana.");
            }
        }
예제 #18
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);
        }
예제 #19
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            from.RevealingAction();

            if (m_PercentToHit > Utility.Random(100))
            {
                BasePotion.PlayDrinkEffect(from);
                from.Say("Ugh!");
                from.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                from.PlaySound(0x208);
                from.Damage(Utility.RandomMinMax(m_minDamage, m_maxDamage), from);
                Consume();
            }
            else
            {
                BasePotion.PlayDrinkEffect(from);
            }

            Consume();
        }
예제 #20
0
        public override void Drink(Mobile from)
        {
            if (from.Mana < from.ManaMax)
            {
                if (from.Poisoned || MortalStrike.IsWounded(from))
                {
                    from.SendMessage("You cannot use this in your current state.");
                }
                else
                {
                    if (from.BeginAction(typeof(BaseManaPotion)))
                    {
                        DoMana(from);

                        BasePotion.PlayDrinkEffect(from);

                        this.Consume();

                        Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseManaLock), from);
                    }
                    else
                    {
                        from.SendMessage("You must wait to use another mana potion.");
                    }
                }
            }
            else
            {
                from.SendMessage("You are already at full mana.");
            }
        }
예제 #21
0
        public override void Drink(Mobile from)
        {
            int skillLevel = 50;

            if (this is PoisonPotion)
            {
                skillLevel = 60;
            }
            else if (this is GreaterPoisonPotion)
            {
                skillLevel = 70;
            }
            else if (this is DeadlyPoisonPotion)
            {
                skillLevel = 80;
            }
            else if (this is LethalPoisonPotion)
            {
                skillLevel = 90;
            }

            if (from.Skills[SkillName.Poisoning].Value >= skillLevel)
            {
                if (!IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1060640);                       // The item must be in your backpack to use it.
                }
                else if (!from.Region.AllowHarmful(from, from))
                {
                    from.SendMessage("That doesn't feel like a good idea.");
                    return;
                }
                else if (Server.Items.MonsterSplatter.TooMuchSplatter(from))
                {
                    from.SendMessage("There is too much liquid on the ground already.");
                    return;
                }
                else
                {
                    from.SendMessage("Where do you want to dump the poison?");
                    ThrowTarget targ = from.Target as ThrowTarget;

                    if (targ != null && targ.Potion == this)
                    {
                        return;
                    }

                    from.RevealingAction();
                    from.Target = new ThrowTarget(this);
                    Misc.Titles.AwardKarma(from, -40, true);
                }
            }
            else
            {
                DoPoison(from);
                BasePotion.PlayDrinkEffect(from);
                this.Consume();
            }
        }
예제 #22
0
 public override void Drink(Mobile from)
 {
     if (DoAgility(from))
     {
         BasePotion.PlayDrinkEffect(from);
         Consume();
     }
 }
예제 #23
0
        public override void Drink(Mobile from)
        {
            DoPoison(from);

            BasePotion.PlayDrinkEffect(from);

            this.Delete();
        }
예제 #24
0
 public override void Drink(Mobile from)
 {
     if (DoStrength(from))
     {
         BasePotion.PlayDrinkEffect(from);
         this.Consume();
     }
 }
        public override void Drink(Mobile from)
        {
            DoPoison(from);

            if (!BasePotion.PlayDrinkEffect(from))
            {
                Consume();
            }
        }
예제 #26
0
        public override void Drink(Mobile from)
        {
            if (from.Hits < from.HitsMax)
            {
                if (from.Poisoned || MortalStrike.IsWounded(from))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x22, 1005000); // You can not heal yourself in your current state.
                }
                else
                {
                    if (from.BeginAction(typeof(BaseHealPotion)))
                    {
                        //Plume : Addiction
                        if (from is PlayerMobile)
                        {
                            PlayerMobile drinker = from as PlayerMobile;

                            double Addiction = drinker.CalculateHealAddiction(this);

                            if (Addiction > 100)
                            {
                                drinker.SendMessage("Votre corps ne supporte plus ce traitement");
                                drinker.Poison = Poison.Lesser;
                            }
                            else
                            {
                                double HealScalar = Addiction / 100 * 0.95;
                                DoHeal(from, HealScalar);
                            }
                            drinker.IncAddiction(this);
                        }
                        else
                        {
                            DoHeal(from);
                        }

                        BasePotion.PlayDrinkEffect(from);

                        if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                        {
                            this.Consume();
                        }

                        Timer.DelayCall(TimeSpan.FromSeconds(Delay), new TimerStateCallback(ReleaseHealLock), from);
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235); // You must wait 10 seconds before using another healing potion.
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1049547); // You decide against drinking this potion, as you are already at full health.
            }
        }
예제 #27
0
 public override void Drink(Mobile from)
 {
     if (DoMagicResist(from))
     {
         if (!BasePotion.PlayDrinkEffect(from))
         {
             Consume();
         }
     }
 }
예제 #28
0
        public override void Drink(Mobile from)
        {
            DoPoison(from);

            BasePotion.PlayDrinkEffect(from);

            if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
            {
                this.Consume();
            }
        }
예제 #29
0
        public override void Drink(Mobile from)
        {
            if (this.DoStrength(from))
            {
                BasePotion.PlayDrinkEffect(from);

                if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                {
                    this.Consume();
                }
            }
        }
예제 #30
0
        public override void Drink(Mobile from)
        {
            if (DoAgility(from))
            {
                BasePotion.PlayDrinkEffect(from);

                if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                {
                    Consume();
                }
            }
        }