Example #1
0
            private void EndHeal()
            {
                if (Context.ContainsKey(Healer))
                    Context.Remove(Healer);

                if (Patient != Healer && Patient.InRange(Healer.Location, 2))
                {
                    Healer.PlaySound(0x57);

                    if (EnchantedApple.GetTotalCurses(Patient) == 0)
                        Healer.SendLocalizedMessage(500968); // You apply the bandages, but they barely help.
                    else
                        Healer.SendLocalizedMessage(500969); // You finish applying the bandages.

                    EvilOmenSpell.TryEndEffect(Patient);
                    StrangleSpell.RemoveCurse(Patient);
                    CorpseSkinSpell.RemoveCurse(Patient);
                    WeakenSpell.RemoveEffects(Patient);
                    FeeblemindSpell.RemoveEffects(Patient);
                    ClumsySpell.RemoveEffects(Patient);
                    CurseSpell.RemoveEffect(Patient);
                    MortalStrike.EndWound(Patient);
                    BloodOathSpell.RemoveCurse(Patient);
                    MindRotSpell.ClearMindRotScalar(Patient);
                    SpellPlagueSpell.RemoveFromList(Patient);
                    SleepSpell.EndSleep(Patient);

                    BuffInfo.RemoveBuff(Patient, BuffIcon.MassCurse);
                }
                else
                {
                    Healer.SendLocalizedMessage(500295); // You are too far away to do that.
                }
            }
Example #2
0
        }// A tasty bite of the enchanted apple lifts all curses from your soul.
        public override bool Eat(Mobile from)
        {
            if (base.Eat(from))
            {
                from.PlaySound(0xF6);
                from.PlaySound(0x1F7);
                from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                IEntity mfrom = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z - 10), from.Map);
                IEntity mto   = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);
                Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                from.RemoveStatMod("[Magic] Str Curse");
                from.RemoveStatMod("[Magic] Dex Curse");
                from.RemoveStatMod("[Magic] Int Curse");

                from.Paralyzed = false;
                from.Asleep    = false;

                EvilOmenSpell.TryEndEffect(from);
                StrangleSpell.RemoveCurse(from);
                CorpseSkinSpell.RemoveCurse(from);
                CurseSpell.RemoveEffect(from);

                BuffInfo.RemoveBuff(from, BuffIcon.Clumsy);
                BuffInfo.RemoveBuff(from, BuffIcon.FeebleMind);
                BuffInfo.RemoveBuff(from, BuffIcon.Weaken);
                BuffInfo.RemoveBuff(from, BuffIcon.MassCurse);

                return(true);
            }

            return(false);
        }
        }// A tasty bite of the enchanted apple lifts all curses from your soul.

        public override bool Eat(Mobile from)
        {
            if (!IsUnderInfluence(from, FoodID))
            {
                if (CoolingDown(from, FoodID))
                {
                    from.SendLocalizedMessage(1151180); // You must wait a while before eating another enchanted apple.
                }
                else
                {
                    from.PlaySound(0xF6);
                    from.PlaySound(0x1F7);
                    from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    IEntity mfrom = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z - 10), from.Map);
                    IEntity mto   = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);
                    Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                    if (Core.SA)
                    {
                        int totalCurses = GetTotalCurses(from);

                        if (totalCurses > 2 && totalCurses > Utility.Random(10))
                        {
                            from.SendLocalizedMessage(1150174); // The apple was not strong enough to purify you.

                            Consume();

                            return(false);
                        }
                    }

                    EvilOmenSpell.TryEndEffect(from);
                    StrangleSpell.RemoveCurse(from);
                    CorpseSkinSpell.RemoveCurse(from);
                    WeakenSpell.RemoveEffects(from);
                    FeeblemindSpell.RemoveEffects(from);
                    ClumsySpell.RemoveEffects(from);
                    CurseSpell.RemoveEffect(from);
                    MortalStrike.EndWound(from);
                    BloodOathSpell.RemoveCurse(from);
                    MindRotSpell.ClearMindRotScalar(from);
                    SpellPlagueSpell.RemoveFromList(from);
                    SleepSpell.EndSleep(from);

                    BuffInfo.RemoveBuff(from, BuffIcon.MassCurse);

                    from.SendLocalizedMessage(EatMessage);

                    StartInfluence(from, FoodID, Duration, Cooldown);
                    Consume();

                    return(true);
                }
            }

            return(false);
        }
Example #4
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
            {
                Caster.SendLocalizedMessage(1061654);                   // You cannot heal that which is not alive.
            }
            else if (m.IsDeadBondedPet)
            {
                Caster.SendLocalizedMessage(1060177);                   // You cannot heal a creature that is already dead!
            }
            else if (CheckBSequence(m, false))
            {
                SpellHelper.Turn(Caster, m);

                m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
                m.PlaySound(0x202);

                StatMod mod;

                mod = m.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Str Offset");
                }

                mod = m.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Dex Offset");
                }

                mod = m.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Int Offset");
                }

                m.Paralyzed = false;
                m.CurePoison(Caster);

                int toHeal = (int)(Caster.Skills[SkillName.AnimalTaming].Value) + (int)(Caster.Skills[SkillName.AnimalLore].Value);
                SpellHelper.Heal(toHeal, m, Caster);

                EvilOmenSpell.TryEndEffect(m);
                StrangleSpell.RemoveCurse(m);
                CorpseSkinSpell.RemoveCurse(m);
            }

            FinishSequence();
        }
Example #5
0
        public static void RemoveCurses(Mobile m)
        {
            // play the sound
            m.PlaySound(0xF6);
            m.PlaySound(0x1F7);

            // do the effects
            m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

            IEntity from = new DummyEntity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), m.Map);
            IEntity to   = new DummyEntity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), m.Map);

            Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

            // remove stat mods
            StatMod mod;

            foreach (string statModName in StatModNames)
            {
                mod = m.GetStatMod(statModName);
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod(statModName);
                }
            }

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.EndEffect(m);
            SpellPlagueSpell.RemoveEffect(m);
            SleepSpell.RemoveEffect(m);
            MindRotSpell.ClearMindRotScalar(m);

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Sleep);
            BuffInfo.RemoveBuff(m, BuffIcon.MassSleep);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
        }
Example #6
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckBSequence(m, false))
            {
                SpellHelper.Turn(Caster, m);

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

                IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), Caster.Map);
                IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map);
                Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                StatMod mod;

                mod = m.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Str Offset");
                }

                mod = m.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Dex Offset");
                }

                mod = m.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Int Offset");
                }

                m.Paralyzed = false;
                m.CurePoison(Caster);

                EvilOmenSpell.CheckEffect(m);
                StrangleSpell.RemoveCurse(m);
                CorpseSkinSpell.RemoveCurse(m);
            }

            FinishSequence();
        }
Example #7
0
        public static void DoRemoveCurses(Mobile m)
        {
            StatMod mod;

            mod = m.GetStatMod("[Magic] Str Malus");
            if (mod != null && mod.Offset < 0)
            {
                m.RemoveStatMod("[Magic] Str Malus");
            }

            mod = m.GetStatMod("[Magic] Dex Malus");
            if (mod != null && mod.Offset < 0)
            {
                m.RemoveStatMod("[Magic] Dex Malus");
            }

            mod = m.GetStatMod("[Magic] Int Malus");
            if (mod != null && mod.Offset < 0)
            {
                m.RemoveStatMod("[Magic] Int Malus");
            }

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.EndEffect(m);
            SpellPlagueSpell.RemoveEffect(m);

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);

            // TODO: Should this remove blood oath? Pain spike?
        }
 public static void SuperHealXML(BaseCreature bc, Mobile player)
 {
     if (!bc.Alive)
     {
         bc.Resurrect();
     }
     if (bc.Hits < bc.HitsMax)
     {
         bc.Hits = bc.HitsMax;
     }
     if (bc.Mana < bc.ManaMax)
     {
         bc.Mana = bc.ManaMax;
     }
     if (bc.Stam < bc.StamMax)
     {
         bc.Stam = bc.StamMax;
     }
     if (bc.Poison != null)
     {
         bc.Poison = null;
     }
     if (bc.Paralyzed == true)
     {
         bc.Paralyzed = false;
     }
     EvilOmenSpell.TryEndEffect(bc);
     StrangleSpell.RemoveCurse(bc);
     CorpseSkinSpell.RemoveCurse(bc);
     CurseSpell.RemoveEffect(bc);
     MortalStrike.EndWound(bc);
     BloodOathSpell.RemoveCurse(bc);
     MindRotSpell.ClearMindRotScalar(bc);
     bc.Loyalty = BaseCreature.MaxLoyalty;
     Effects.SendTargetEffect(bc, 0x3709, 32);
     Effects.SendTargetEffect(bc, 0x376A, 32);
     bc.PlaySound(0x208);
     bc.Emote("*you see {0} looks refreshed!*", bc.Name);
 }
Example #9
0
        private void RemoveCurses(Mobile m)
        {
            StatMod mod;

            foreach (var statModName in StatModNames)
            {
                mod = m.GetStatMod(statModName);
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod(statModName);
                }
            }

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.EndEffect(m);
            SpellPlagueSpell.RemoveEffect(m);
            SleepSpell.RemoveEffect(m);
            MindRotSpell.ClearMindRotScalar(m);

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Sleep);
            BuffInfo.RemoveBuff(m, BuffIcon.MassSleep);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
        }
Example #10
0
        public void Target(Mobile m)
        {
            if (CheckBSequence(m) && CheckFizzle())
            {
                SpellHelper.Turn(Caster, m);

                int chance = 0;
                int karma  = Caster.Karma * -1;

                if (karma < -5000)
                {
                    chance = 0;
                }
                else if (karma < 0)
                {
                    chance = (int)Math.Sqrt(20000 + karma) - 122;
                }
                else if (karma < 5625)
                {
                    chance = (int)Math.Sqrt(karma) + 25;
                }
                else
                {
                    chance = 100;
                }

                if (chance > Utility.Random(100))
                {
                    m.PlaySound(0xF6);
                    m.PlaySound(0x1F7);
                    m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), Caster.Map);
                    IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map);
                    Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                    StatMod mod;

                    mod = m.GetStatMod("[Magic] Str Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Str Offset");
                    }

                    mod = m.GetStatMod("[Magic] Dex Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Dex Offset");
                    }

                    mod = m.GetStatMod("[Magic] Int Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Int Offset");
                    }

                    m.Paralyzed = false;

                    EvilOmenSpell.TryEndEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);
                    MortalStrike.EndWound(m);
                    if (Core.ML)
                    {
                        BloodOathSpell.RemoveCurse(m);
                    }
                    MindRotSpell.ClearMindRotScalar(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                    BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
                }
                else
                {
                    m.PlaySound(0x1DF);
                }
            }

            FinishSequence();
        }
        public void Target(Mobile m)
        {
            if (this.CheckBSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

                /* Attempts to remove all Curse effects from Target.
                 * Curses include Mage spells such as Clumsy, Weaken, Feeblemind and Paralyze
                 * as well as all Necromancer curses.
                 * Chance of removing curse is affected by Caster's Karma.
                 */

                int chance = 0;

                if (this.Caster.Karma < -5000)
                {
                    chance = 0;
                }
                else if (this.Caster.Karma < 0)
                {
                    chance = (int)Math.Sqrt(20000 + this.Caster.Karma) - 122;
                }
                else if (this.Caster.Karma < 5625)
                {
                    chance = (int)Math.Sqrt(this.Caster.Karma) + 25;
                }
                else
                {
                    chance = 100;
                }

                if (chance > Utility.Random(100))
                {
                    m.PlaySound(0xF6);
                    m.PlaySound(0x1F7);
                    m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), this.Caster.Map);
                    IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), this.Caster.Map);
                    Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                    m.RemoveStatMod("[Magic] Str Curse");
                    m.RemoveStatMod("[Magic] Dex Curse");
                    m.RemoveStatMod("[Magic] Int Curse");

                    m.Paralyzed = false;

                    EvilOmenSpell.TryEndEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);
                    MortalStrike.EndWound(m);
                    if (Core.ML)
                    {
                        BloodOathSpell.RemoveCurse(m);
                    }
                    MindRotSpell.ClearMindRotScalar(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                    BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
                    // TODO: Should this remove blood oath? Pain spike?
                }
                else
                {
                    m.PlaySound(0x1DF);
                }
            }

            this.FinishSequence();
        }
Example #12
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (m_Talisman == null || m_Talisman.Deleted)
                {
                    return;
                }

                Mobile target = o as Mobile;

                if (from.Talisman != m_Talisman)
                {
                    from.SendLocalizedMessage(502641);                       // You must equip this item to use it.
                }
                else if (target == null)
                {
                    from.SendLocalizedMessage(1046439);                       // That is not a valid target.
                }
                else if (m_Talisman.ChargeTime > 0)
                {
                    from.SendLocalizedMessage(1074882, m_Talisman.ChargeTime.ToString());                       // You must wait ~1_val~ seconds for this to recharge.
                }
                else if (m_Talisman.Charges == 0 && m_Talisman.MaxCharges > 0)
                {
                    from.SendLocalizedMessage(1042544);                       // This item is out of charges.
                }
                else
                {
                    switch (m_Talisman.Removal)
                    {
                    case TalismanRemoval.Curse:
                        target.PlaySound(0xF6);
                        target.PlaySound(0x1F7);
                        target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                        IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map);
                        IEntity mto   = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map);
                        Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                        StatMod mod;

                        mod = target.GetStatMod("[Magic] Str Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Str Offset");
                        }

                        mod = target.GetStatMod("[Magic] Dex Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Dex Offset");
                        }

                        mod = target.GetStatMod("[Magic] Int Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Int Offset");
                        }

                        target.Paralyzed = false;

                        EvilOmenSpell.TryEndEffect(target);
                        StrangleSpell.RemoveCurse(target);
                        CorpseSkinSpell.RemoveCurse(target);
                        CurseSpell.RemoveEffect(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Clumsy);
                        BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind);
                        BuffInfo.RemoveBuff(target, BuffIcon.Weaken);
                        BuffInfo.RemoveBuff(target, BuffIcon.MassCurse);

                        target.SendLocalizedMessage(1072408);                                   // Any curses on you have been lifted

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072409);                                       // Your targets curses have been lifted
                        }
                        break;

                    case TalismanRemoval.Damage:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        BleedAttack.EndBleed(target, true);
                        MortalStrike.EndWound(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Bleed);
                        BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike);

                        target.SendLocalizedMessage(1072405);                                   // Your lasting damage effects have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072406);                                       // Your Targets lasting damage effects have been removed!
                        }
                        break;

                    case TalismanRemoval.Ward:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        MagicReflectSpell.EndReflect(target);
                        ReactiveArmorSpell.EndArmor(target);
                        ProtectionSpell.EndProtection(target);

                        target.SendLocalizedMessage(1072402);                                   // Your wards have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072403);                                       // Your target's wards have been removed!
                        }
                        break;

                    case TalismanRemoval.Wildfire:
                        // TODO
                        break;
                    }

                    m_Talisman.OnAfterUse(from);
                }
            }
Example #13
0
        public override bool OnBeforeDeath(Mobile m)
        {
            if (!(m is PlayerMobile))
            {
                return(base.OnBeforeDeath(m));
            }

            //Remove the player's items acquired in the dream
            for (int x = m.Items.Count - 1; x >= 0; x--)
            {
                if (!(m.Items[x] is Backpack))
                {
                    m.RemoveItem(m.Items[x]);
                }
            }

            for (int y = m.Backpack.Items.Count - 1; y >= 0; y--)
            {
                if ((m.Backpack.Items[y] is HelmOfCourage) || (m.Backpack.Items[y] is CrystalRoseOfLove) || (m.Backpack.Items[y] is MirrorOfTruth) || (m.Backpack.Items[y] is StaffOrb))
                {
                }
                else
                {
                    m.RemoveItem(m.Backpack.Items[y]);
                }
            }

            //Find the player's item container
            Item[] Items = Map.SerpentIsle.GetItemsInRange(new Point3D(0, 0, 0)).CastToArray <Item>();

            foreach (Item found in Items)
            {
                if (found is MetalBox)
                {
                    MetalBox box = found as MetalBox;

                    if (box.Name == m.Name)
                    {
                        //Give them back their stuff
                        for (int x = box.Items.Count - 1; x >= 0; x--)
                        {
                            if (box.Items[x] is MetalBox)
                            {
                                MetalBox itemBox = box.Items[x] as MetalBox;
                                for (int y = itemBox.Items.Count - 1; y >= 0; y--)
                                {
                                    m.AddToBackpack(itemBox.Items[y]);
                                }
                                if (itemBox.Items.Count == 0)
                                {
                                    itemBox.Delete();
                                }
                            }
                            else
                            {
                                m.EquipItem(box.Items[x]);
                            }
                        }

                        if (box.Items.Count == 0)
                        {
                            box.Delete();
                        }
                    }
                }
            }

            //Move pets back
            foreach (Mobile mobile in ((PlayerMobile)m).AllFollowers)
            {
                mobile.MoveToWorld(new Point3D(650, 881, 0), Map.SerpentIsle);
                mobile.Frozen = false;
            }


            switch (Utility.Random(2))
            {
            case 0:
                m.MoveToWorld(new Point3D(643, 881, 0), Map.SerpentIsle);
                break;

            case 1:
                m.MoveToWorld(new Point3D(662, 882, 0), Map.SerpentIsle);
                break;
            }

            m.SendMessage("Thou hast awoken from thy dream.");

            //Restore player to full
            ((PlayerMobile)m).Hits   = m.HitsMax;
            ((PlayerMobile)m).Mana   = m.ManaMax;
            ((PlayerMobile)m).Stam   = m.StamMax;
            ((PlayerMobile)m).Hunger = 20;
            ((PlayerMobile)m).Thirst = 20;

            ((PlayerMobile)m).Paralyzed = false;
            ((PlayerMobile)m).Poison    = null;

            EvilOmenSpell.TryEndEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.RemoveCurse(m);
            MindRotSpell.ClearMindRotScalar(m);

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);

            return(false);
        }
Example #14
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (!(o is Mobile))
                {
                    from.SendLocalizedMessage(1046439);                       // That is not a valid target.
                    return;
                }

                Mobile target = (Mobile)o;

                switch (m_Talisman.Removal)
                {
                case TalismanRemoval.Curse:
                    target.PlaySound(0xF6);
                    target.PlaySound(0x1F7);
                    target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map);
                    IEntity mto   = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map);
                    Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                    StatMod mod;

                    mod = target.GetStatMod("[Magic] Str Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        target.RemoveStatMod("[Magic] Str Offset");
                    }

                    mod = target.GetStatMod("[Magic] Dex Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        target.RemoveStatMod("[Magic] Dex Offset");
                    }

                    mod = target.GetStatMod("[Magic] Int Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        target.RemoveStatMod("[Magic] Int Offset");
                    }

                    target.Paralyzed = false;

                    EvilOmenSpell.CheckEffect(target);
                    StrangleSpell.RemoveCurse(target);
                    CorpseSkinSpell.RemoveCurse(target);
                    CurseSpell.RemoveEffect(target);

                    BuffInfo.RemoveBuff(target, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(target, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(target, BuffIcon.MassCurse);

                    if (target == from)
                    {
                        from.SendLocalizedMessage(1072408);                                   // Any curses on you have been lifted
                    }
                    else
                    {
                        from.SendLocalizedMessage(1072409);                                   // Your targets curses have been lifted
                        target.SendLocalizedMessage(1072408);                                 // Any curses on you have been lifted
                    }

                    break;

                case TalismanRemoval.Damage:
                    target.PlaySound(0x201);
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                    BleedAttack.EndBleed(target, false);
                    MortalStrike.EndWound(target);

                    BuffInfo.RemoveBuff(target, BuffIcon.Bleed);
                    BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike);

                    if (target == from)
                    {
                        from.SendLocalizedMessage(1072405);                                   // Your lasting damage effects have been removed!
                    }
                    else
                    {
                        from.SendLocalizedMessage(1072406);                                   // Your Targets lasting damage effects have been removed!
                        target.SendLocalizedMessage(1072405);                                 // Your lasting damage effects have been removed!
                    }

                    break;

                case TalismanRemoval.Ward:
                    target.PlaySound(0x201);
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                    // Magic reflect
                    Hashtable m_Table = MagicReflectSpell.m_Table;

                    if (m_Table == null)
                    {
                        return;
                    }

                    ResistanceMod[] mods = (ResistanceMod[])m_Table[target];

                    m_Table.Remove(target);

                    if (mods != null)
                    {
                        for (int i = 0; i < mods.Length; ++i)
                        {
                            target.RemoveResistanceMod(mods[i]);
                        }
                    }

                    BuffInfo.RemoveBuff(target, BuffIcon.MagicReflection);


                    // Reactive armor
                    m_Table = ReactiveArmorSpell.m_Table;

                    if (m_Table == null)
                    {
                        return;
                    }

                    mods = (ResistanceMod[])m_Table[target];

                    if (mods != null)
                    {
                        m_Table.Remove(target);

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            target.RemoveResistanceMod(mods[i]);
                        }
                    }

                    BuffInfo.RemoveBuff(target, BuffIcon.ReactiveArmor);


                    // Protection
                    m_Table = ProtectionSpell.m_Table;

                    if (m_Table == null)
                    {
                        return;
                    }

                    object[] pmods = (object[])m_Table[target];

                    if (mods != null)
                    {
                        m_Table.Remove(target);
                        ProtectionSpell.Registry.Remove(target);

                        target.RemoveResistanceMod((ResistanceMod)pmods[0]);
                        target.RemoveSkillMod((SkillMod)pmods[1]);
                    }

                    BuffInfo.RemoveBuff(target, BuffIcon.Protection);

                    if (target == from)
                    {
                        from.SendLocalizedMessage(1072402);                                   // Your wards have been removed!
                    }
                    else
                    {
                        from.SendLocalizedMessage(1072403);                                   // Your target's wards have been removed!
                        target.SendLocalizedMessage(1072402);                                 // Your wards have been removed!
                    }

                    break;
                }

                m_Talisman.ChargeTime = m_Talisman.MaxChargeTime;

                if (m_Talisman.Charges > 0)
                {
                    m_Talisman.Charges -= 1;
                }

                m_Talisman.StartTimer();
                m_Talisman.InvalidateProperties();
            }
Example #15
0
        public void Target(Mobile m)
        {
            if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Attempts to remove all Curse effects from Target.
                 * Curses include Mage spells such as Clumsy, Weaken, Feeblemind and Paralyze
                 * as well as all Necromancer curses.
                 * Chance of removing curse is affected by Caster's Karma.
                 */

                int chance = 0;

                if (Caster.Karma < -5000)
                {
                    chance = 0;
                }
                else if (Caster.Karma < 0)
                {
                    chance = (int)Math.Sqrt(20000 + Caster.Karma) - 122;
                }
                else if (Caster.Karma < 5625)
                {
                    chance = (int)Math.Sqrt(Caster.Karma) + 25;
                }
                else
                {
                    chance = 100;
                }

                if (chance > Utility.Random(100))
                {
                    m.PlaySound(0xF6);
                    m.PlaySound(0x1F7);
                    m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), Caster.Map);
                    IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map);
                    Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                    StatMod mod;

                    mod = m.GetStatMod("[Magic] Str Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Str Offset");
                    }

                    mod = m.GetStatMod("[Magic] Dex Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Dex Offset");
                    }

                    mod = m.GetStatMod("[Magic] Int Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Int Offset");
                    }

                    m.Paralyzed = false;

                    EvilOmenSpell.CheckEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);
                }
                else
                {
                    m.PlaySound(0x1DF);
                }
            }

            FinishSequence();
        }
Example #16
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckBSequence(m, false))
            {
                SpellHelper.Turn(Caster, m);

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

                IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), Caster.Map);
                IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map);
                Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                StatMod mod;

                mod = m.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Str Offset");
                }

                mod = m.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Dex Offset");
                }

                mod = m.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Int Offset");
                }

                m.Paralyzed = false;

                EvilOmenSpell.TryEndEffect(m);
                StrangleSpell.RemoveCurse(m);
                CorpseSkinSpell.RemoveCurse(m);
                CurseSpell.RemoveEffect(m);
                MortalStrike.EndWound(m);
                if (Core.ML)
                {
                    BloodOathSpell.RemoveCurse(m);
                }
                MindRotSpell.ClearMindRotScalar(m);

                BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
            }

            FinishSequence();
        }
Example #17
0
        private void OnBeginDream(PlayerMobile m)
        {
            if ((!m.Alive))
            {
                return;
            }

            m.SendMessage("Thou hast fallen asleep.");

            //Create the player's box and label it
            MetalBox playerBox = new MetalBox();

            playerBox.Name = m.Name;

            //Items list so we can remove them
            List <Item> equipItems = m.Items;

            //Remove clothing/equipment
            for (int x = m.Items.Count - 1; x >= 0; x--)
            {
                if (!(m.Items[x] is Backpack))
                {
                    playerBox.AddItem(m.Items[x]);
                }
            }

            //Create the box for the backpack items
            MetalBox backpackBox = new MetalBox();

            playerBox.AddItem(backpackBox);

            //Remove backpack items
            for (int y = m.Backpack.Items.Count - 1; y >= 0; y--)
            {
                if ((m.Backpack.Items[y] is HelmOfCourage) || (m.Backpack.Items[y] is CrystalRoseOfLove) || (m.Backpack.Items[y] is MirrorOfTruth) || (m.Backpack.Items[y] is StaffOrb))
                {
                }
                else
                {
                    backpackBox.AddItem(m.Backpack.Items[y]);
                }
            }

            //Move the container away
            playerBox.MoveToWorld(new Point3D(0, 0, 0), Map.SerpentIsle);

            //Move pets away
            foreach (Mobile mobile in m.AllFollowers)
            {
                mobile.MoveToWorld(new Point3D(0, 0, 0), Map.SerpentIsle);
                mobile.Frozen = true;
            }

            //Send to random destination in the dream
            switch (Utility.Random(4))
            {
            case 0:
                m.MoveToWorld(new Point3D(1988, 1536, 0), Map.SerpentIsle);
                m.SetDirection(Direction.East);
                break;

            case 1:
                m.MoveToWorld(new Point3D(2050, 1491, 0), Map.SerpentIsle);
                m.SetDirection(Direction.North);
                break;

            case 2:
                m.MoveToWorld(new Point3D(2040, 1389, 0), Map.SerpentIsle);
                m.SetDirection(Direction.East);
                break;

            case 3:
                m.MoveToWorld(new Point3D(1904, 1376, 0), Map.SerpentIsle);
                m.SetDirection(Direction.West);
                break;
            }

            //Restore player to full
            ((PlayerMobile)m).Hits   = m.HitsMax;
            ((PlayerMobile)m).Mana   = m.ManaMax;
            ((PlayerMobile)m).Stam   = m.StamMax;
            ((PlayerMobile)m).Hunger = 20;
            ((PlayerMobile)m).Thirst = 20;

            ((PlayerMobile)m).Paralyzed = false;
            ((PlayerMobile)m).Poison    = null;

            EvilOmenSpell.TryEndEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.RemoveCurse(m);
            MindRotSpell.ClearMindRotScalar(m);

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);

            //Additionally, remove any polymorphs
            PolymorphSpell.EndPolymorph(m);
            StoneFormSpell.EndEffect(m);

            m.BodyMod = 0;
            m.HueMod  = -1;
        }
Example #18
0
        public override void OnTarget(Object o)
        {
            IPoint3D p = o as IPoint3D;

            if (p == null)
            {
                return;
            }

            if (CheckSequence())
            {
                List <Mobile> targets = new List <Mobile>();
                Party         party   = Party.Get(Caster);

                double prim = Caster.Skills[CastSkill].Value;
                double sec  = Caster.Skills[DamageSkill].Value;

                IPooledEnumerable eable = Caster.Map.GetMobilesInRange(new Point3D(p), 3);
                foreach (Mobile mob in eable)
                {
                    if (mob == null)
                    {
                        continue;
                    }

                    if (mob == Caster)
                    {
                        targets.Add(mob);
                    }

                    if (Caster.CanBeBeneficial(mob, false) && party != null && party.Contains(mob))
                    {
                        targets.Add(mob);
                    }
                }
                eable.Free();

                Mobile m;
                int    toheal = (int)(((prim + sec) / 2) * 0.3) - 6;
                Caster.PlaySound(0x64C);

                for (int i = 0; i < targets.Count; i++)
                {
                    m = targets[i];
                    int toHealMod = toheal;

                    if (!m.Alive)
                    {
                        continue;
                    }

                    if (m.Poisoned)
                    {
                        int level        = m.Poison.RealLevel + 1;
                        int chanceToCure = (10000 + (int)(((prim + sec) / 2) * 75) - (level * 1750)) / 100;

                        if (chanceToCure > Utility.Random(100) && m.CurePoison(Caster))
                        {
                            toHealMod /= level;
                        }
                        else
                        {
                            toHealMod = 0;
                        }
                    }

                    if (MortalStrike.IsWounded(m))
                    {
                        MortalStrike.EndWound(m);
                        toHealMod = 0;
                    }

                    int curselevel = 0;

                    if (SleepSpell.IsUnderSleepEffects(m))
                    {
                        SleepSpell.EndSleep(m);
                        curselevel += 2;
                    }

                    if (EvilOmenSpell.TryEndEffect(m))
                    {
                        curselevel += 1;
                    }

                    if (StrangleSpell.RemoveCurse(m))
                    {
                        curselevel += 2;
                    }

                    if (CorpseSkinSpell.RemoveCurse(m))
                    {
                        curselevel += 3;
                    }

                    if (CurseSpell.UnderEffect(m))
                    {
                        CurseSpell.RemoveEffect(m);
                        curselevel += 4;
                    }

                    if (BloodOathSpell.RemoveCurse(m))
                    {
                        curselevel += 3;
                    }

                    if (MindRotSpell.HasMindRotScalar(m))
                    {
                        MindRotSpell.ClearMindRotScalar(m);
                        curselevel += 2;
                    }

                    if (SpellPlagueSpell.HasSpellPlague(m))
                    {
                        SpellPlagueSpell.RemoveFromList(m);
                        curselevel += 4;
                    }

                    if (m.GetStatMod("[Magic] Str Curse") != null)
                    {
                        m.RemoveStatMod("[Magic] Str Curse");
                        curselevel += 1;
                    }

                    if (m.GetStatMod("[Magic] Dex Curse") != null)
                    {
                        m.RemoveStatMod("[Magic] Dex Curse");
                        curselevel += 1;
                    }

                    if (m.GetStatMod("[Magic] Int Curse") != null)
                    {
                        m.RemoveStatMod("[Magic] Int Curse");
                        curselevel += 1;
                    }

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                    BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
                    BuffInfo.RemoveBuff(m, BuffIcon.CorpseSkin);
                    BuffInfo.RemoveBuff(m, BuffIcon.Strangle);
                    BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);

                    if (toHealMod > 0 && curselevel > 0)
                    {
                        int toHealMod1 = toHealMod - (curselevel * 3);
                        int toHealMod2 = toHealMod - (int)((double)toHealMod * ((double)curselevel / 100));

                        toHealMod -= toHealMod1 + toHealMod2;
                    }

                    if (toHealMod > 0)
                    {
                        SpellHelper.Heal(toHealMod + Utility.RandomMinMax(1, 6), m, Caster);
                    }
                }
            }

            FinishSequence();
        }
Example #19
0
        public static int RemoveCurses(Mobile m)
        {
            int curseLevel = 0;

            if (SleepSpell.IsUnderSleepEffects(m))
            {
                SleepSpell.EndSleep(m);
                curseLevel += 2;
            }

            if (EvilOmenSpell.TryEndEffect(m))
            {
                curseLevel += 1;
            }

            if (StrangleSpell.RemoveCurse(m))
            {
                curseLevel += 2;
            }

            if (CorpseSkinSpell.RemoveCurse(m))
            {
                curseLevel += 3;
            }

            if (CurseSpell.UnderEffect(m))
            {
                CurseSpell.RemoveEffect(m);
                curseLevel += 4;
            }

            if (BloodOathSpell.RemoveCurse(m))
            {
                curseLevel += 3;
            }

            if (MindRotSpell.HasMindRotScalar(m))
            {
                MindRotSpell.ClearMindRotScalar(m);
                curseLevel += 2;
            }

            if (SpellPlagueSpell.HasSpellPlague(m))
            {
                SpellPlagueSpell.RemoveFromList(m);
                curseLevel += 4;
            }

            if (FeeblemindSpell.IsUnderEffects(m))
            {
                FeeblemindSpell.RemoveEffects(m);
                curseLevel += 1;
            }

            if (ClumsySpell.IsUnderEffects(m))
            {
                ClumsySpell.RemoveEffects(m);
                curseLevel += 1;
            }

            if (WeakenSpell.IsUnderEffects(m))
            {
                WeakenSpell.RemoveEffects(m);
                curseLevel += 1;
            }

            if (MortalStrike.IsWounded(m))
            {
                MortalStrike.EndWound(m);
                curseLevel += 2;
            }

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
            BuffInfo.RemoveBuff(m, BuffIcon.CorpseSkin);
            BuffInfo.RemoveBuff(m, BuffIcon.Strangle);
            BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);

            return(curseLevel);
        }
Example #20
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                var m = targeted as Mobile;

                if (m == null)
                {
                    from.SendMessage("This is not a mobile!");
                    return;
                }

                CommandLogging.WriteLine(from, "{0} {1} completely restoring {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(m));

                if (!m.Alive)
                {
                    m.Resurrect();
                }

                m.Hits      = m.HitsMax;
                m.Mana      = m.ManaMax;
                m.Stam      = m.StamMax;
                m.Hunger    = 20;
                m.Thirst    = 20;
                m.Poison    = null;
                m.Paralyzed = false;

                StatMod mod;

                mod = m.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Str Offset");
                }

                mod = m.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Dex Offset");
                }

                mod = m.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Int Offset");
                }

                EvilOmenSpell.TryEndEffect(m);
                StrangleSpell.RemoveCurse(m);
                CorpseSkinSpell.RemoveCurse(m);
                CurseSpell.RemoveEffect(m);
                MortalStrike.EndWound(m);
                BloodOathSpell.RemoveCurse(m);
                MindRotSpell.ClearMindRotScalar(m);

                BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);

                from.SendMessage("{0} has been completely restored!", m.Name);
            }
Example #21
0
        public static void NegateEffects(Mobile target, bool curses, bool buffs, bool damage, bool morph)
        {
            if (target == null)
            {
                return;
            }

            if (damage)
            {
                if (target.Poisoned)
                {
                    var p = target.Poison;

                    target.Poison = null;

                    target.OnCured(target, p);
                }

                target.Frozen    = false;
                target.Paralyzed = false;

                target.SetPropertyValue("Asleep", false);

                BuffInfo.RemoveBuff(target, BuffIcon.Paralyze);
                BuffInfo.RemoveBuff(target, BuffIcon.Sleep);
            }

            if (buffs)
            {
                ReactiveArmorSpell.EndArmor(target);
                MagicReflectSpell.EndReflect(target);
            }

            if (curses)
            {
                #region Pain Spike
                IDictionary table;

                if (typeof(PainSpikeSpell).GetFieldValue("m_Table", out table) && table.Contains(target))
                {
                    var t = table[target] as Timer;

                    if (t != null)
                    {
                        t.Stop();
                    }

                    table.Remove(target);

                    BuffInfo.RemoveBuff(target, BuffIcon.PainSpike);
                }
                #endregion

                CurseSpell.RemoveEffect(target);
                EvilOmenSpell.TryEndEffect(target);
                StrangleSpell.RemoveCurse(target);
                CorpseSkinSpell.RemoveCurse(target);
                BloodOathSpell.RemoveCurse(target);
                MindRotSpell.ClearMindRotScalar(target);
            }

            if (damage)
            {
                MortalStrike.EndWound(target);
                BleedAttack.EndBleed(target, target.Alive);
                MeerMage.StopEffect(target, target.Alive);
            }

            if (morph)
            {
                AnimalForm.RemoveContext(target, true);

                PolymorphSpell.StopTimer(target);
                IncognitoSpell.StopTimer(target);

                target.Send(SpeedControl.Disable);

                target.EndAction(typeof(PolymorphSpell));
                target.EndAction(typeof(IncognitoSpell));

                BuffInfo.RemoveBuff(target, BuffIcon.AnimalForm);
                BuffInfo.RemoveBuff(target, BuffIcon.Polymorph);
                BuffInfo.RemoveBuff(target, BuffIcon.Incognito);
            }

            if (buffs)
            {
                RemoveStatBonus(target, StatType.All);
            }

            if (curses)
            {
                RemoveStatCurse(target, StatType.All);
            }
        }
Example #22
0
        protected override void OnTarget(object o)
        {
            Mobile m = o as Mobile;

            if (m != null)
            {
                if (m.IsDeadBondedPet)
                {
                    Caster.SendLocalizedMessage(1046439); // That is not a valid target.
                }
                else if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
                {
                    Caster.SendLocalizedMessage(1046439); // That is not a valid target.
                }
                else if (m is Golem)
                {
                    Caster.SendLocalizedMessage(1046439); // That is not a valid target.
                }
                else if (m.Hits > m.HitsMax && m.Stam >= m.StamMax && m.Mana >= m.ManaMax)
                {
                    Caster.SendLocalizedMessage(1155788); // Your target is already at full health, mana and stamina!
                }
                else if (CheckBSequence(m))
                {
                    double rejuv = (GetMasteryLevel() * 33.3) / 100;

                    if (rejuv > 1.0)
                    {
                        rejuv = 1.0;
                    }

                    int hitsNeeds = m.HitsMax - m.Hits;
                    int stamNeeds = m.StamMax - m.Stam;
                    int manaNeeds = m.ManaMax - m.Mana;

                    int toRejuv = 0;

                    if (hitsNeeds > 0)
                    {
                        toRejuv = (int)Math.Ceiling(hitsNeeds * rejuv);

                        if (toRejuv > 0)
                        {
                            SpellHelper.Heal(toRejuv, m, Caster, false);
                        }
                    }

                    if (stamNeeds > 0)
                    {
                        toRejuv = (int)Math.Ceiling(stamNeeds * rejuv);

                        if (toRejuv > 0)
                        {
                            m.Stam += toRejuv;
                        }
                    }

                    if (manaNeeds > 0)
                    {
                        toRejuv = (int)Math.Ceiling(manaNeeds * rejuv);

                        if (toRejuv > 0)
                        {
                            m.Mana += toRejuv;
                        }
                    }

                    if (Caster.Karma > Utility.Random(5000))
                    {
                        if (m.Poison != null)
                        {
                            m.CurePoison(Caster);
                        }

                        StatMod mod;

                        mod = m.GetStatMod("[Magic] Str Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            m.RemoveStatMod("[Magic] Str Offset");
                        }

                        mod = m.GetStatMod("[Magic] Dex Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            m.RemoveStatMod("[Magic] Dex Offset");
                        }

                        mod = m.GetStatMod("[Magic] Int Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            m.RemoveStatMod("[Magic] Int Offset");
                        }

                        m.Paralyzed = false;

                        EvilOmenSpell.TryEndEffect(m);
                        StrangleSpell.RemoveCurse(m);
                        CorpseSkinSpell.RemoveCurse(m);
                        CurseSpell.RemoveEffect(m);
                        MortalStrike.EndWound(m);
                        BloodOathSpell.RemoveCurse(m);
                        MindRotSpell.ClearMindRotScalar(m);

                        BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                        BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                        BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                        BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                        BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                        BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                        BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
                    }

                    Caster.PlaySound(0x102);

                    m.SendLocalizedMessage(1155789); // You feel completely rejuvenated!

                    if (Caster != m)
                    {
                        m.PlaySound(0x102);
                        Caster.SendLocalizedMessage(1155790); // Your target has been rejuvenated!
                    }

                    int skill = ((int)Caster.Skills[CastSkill].Value + GetWeaponSkill() + GetMasteryLevel() * 40) / 3;
                    int duration;

                    if (skill >= 120)
                    {
                        duration = 60;
                    }
                    else if (skill >= 110)
                    {
                        duration = 120;
                    }
                    else
                    {
                        duration = 180;
                    }

                    TimeSpan d;

                    if (Caster.AccessLevel == AccessLevel.Player)
                    {
                        d = TimeSpan.FromMinutes(duration);
                    }
                    else
                    {
                        d = TimeSpan.FromSeconds(10);
                    }

                    AddToCooldown(d);
                }
            }
            else
            {
                Caster.SendLocalizedMessage(1046439); // That is not a valid target.
            }
        }
Example #23
0
        public override void OnTarget(Object o)
        {
            IPoint3D p = o as IPoint3D;

            if (p == null)
            {
                return;
            }

            List <Mobile> targets = new List <Mobile>();
            StatMod       mod;

            foreach (Mobile mob in Caster.Map.GetMobilesInRange(new Point3D(p), 3))
            {
                if (mob == null)
                {
                    continue;
                }

                if (Caster is PlayerMobile)
                {
                    if (Caster.CanBeBeneficial(mob, false))
                    {
                        targets.Add(mob);
                    }
                }
            }

            Mobile m;
            int    toheal = (int)(Caster.Skills[SkillName.EvalInt].Value * 0.5);

            Caster.PlaySound(0x64D);

            for (int i = 0; i < targets.Count; i++)
            {
                m = targets[i];

                if (!m.Alive)
                {
                    continue;
                }

                m.Heal(toheal + Utility.RandomMinMax(11, 15));

                mod = m.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Str Offset");
                }

                mod = m.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Dex Offset");
                }

                mod = m.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Int Offset");
                }

                m.Paralyzed = false;
                m.Sleep     = false;             // SA Mysticism Edit
                m.CurePoison(Caster);
                EvilOmenSpell.TryEndEffect(m);
                StrangleSpell.RemoveCurse(m);
                CorpseSkinSpell.RemoveCurse(m);
                CurseSpell.RemoveEffect(m);
                MortalStrike.EndWound(m);

                if (Core.ML)
                {
                    BloodOathSpell.RemoveCurse(m);
                }

                MindRotSpell.ClearMindRotScalar(m);

                BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
            }
        }
Example #24
0
        public override void SpellEffect(Mobile target)
        {
            if (Caster.Backpack == null || !(Caster.Backpack is Container))
            {
                Caster.SendMessage("You need a backpack to use this spell.");
                return;
            }

            if (AosAttributes.GetValue(Caster, AosAttribute.LowerRegCost) < 100)                 // Nothing less than 100% will do
            {
                Item item = Caster.Backpack.FindItemByType(typeof(RefreshPotion));

                if (item == null)
                {
                    Caster.SendMessage("You do not have enough Refresh Potions");
                    return;
                }

                item = Caster.Backpack.FindItemByType(typeof(LesserHealPotion));

                if (item == null)
                {
                    Caster.SendMessage("You do not have enough Heal Potions");
                    return;
                }

                item = Caster.Backpack.FindItemByType(typeof(LesserCurePotion));

                if (item == null)
                {
                    Caster.SendMessage("You do not have enough Cure Potions");
                    return;
                }

                // We just checked for the items.
                Caster.Backpack.ConsumeTotal(typeof(RefreshPotion), 1);
                Caster.Backpack.ConsumeTotal(typeof(LesserHealPotion), 1);
                Caster.Backpack.ConsumeTotal(typeof(LesserCurePotion), 1);
            }

            StatMod mod;

            mod = target.GetStatMod("[Magic] Str Offset");
            if (mod != null && mod.Offset < 0)
            {
                target.RemoveStatMod("[Magic] Str Offset");
            }

            mod = target.GetStatMod("[Magic] Dex Offset");
            if (mod != null && mod.Offset < 0)
            {
                target.RemoveStatMod("[Magic] Dex Offset");
            }

            mod = target.GetStatMod("[Magic] Int Offset");
            if (mod != null && mod.Offset < 0)
            {
                target.RemoveStatMod("[Magic] Int Offset");
            }

            BuffInfo.RemoveBuff(target, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(target, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(target, BuffIcon.MassCurse);

            target.Paralyzed = false;

            // Don't cure others of Lethal Poison
            if (target.Poison != Poison.Lethal || target == Caster)
            {
                target.CurePoison(Caster);
            }

            EvilOmenSpell.TryEndEffect(target);
            StrangleSpell.RemoveCurse(target);
            CorpseSkinSpell.RemoveCurse(target);
            CurseSpell.RemoveEffect(target);

            // Cure Status aliments (is the system being used?)
            BlindSpell.EndBlind(target);
            SilenceSpell.EndSilence(target);
            SlowSpell.EndSlow(target);
            StillSpell.EndStill(target);

            Effects.SendLocationParticles(
                EffectItem.Create(new Point3D(target.X, target.Y, target.Z), target.Map, EffectItem.DefaultDuration),
                0x376A, 9, 32, 5020);

            // Play a random eating sound
            target.PlaySound(Utility.Random(0x3A, 3));

            int bonus = AosAttributes.GetValue(Caster, AosAttribute.EnhancePotions) / 2;

            if (bonus > 20)
            {
                bonus = 20;
            }

            target.Hits += bonus;
            target.Stam += bonus;

            target.SendMessage("You have been cured of all ailments");
            Caster.SendMessage("You have cured " + target.Name + " of all alignments.");

            // It is a party effect, no way to ever get hit by it.
            // BlueMageControl.CheckKnown( target, this, CanTeach( target ) );
        }
Example #25
0
        private void FixMobile(Mobile m)
        {
            if (!m.Alive)
            {
                m.Resurrect();
            }

            HandleCorpse(m);

            m.Aggressed.Clear();
            m.Aggressors.Clear();
            m.Hits = m.HitsMax;
            m.Stam = m.StamMax;
            m.Mana = m.ManaMax;
            m.DamageEntries.Clear();
            m.Combatant = null;
            m.InvalidateProperties();

            m.Criminal = false;

            StatMod mod;

            mod = m.GetStatMod("[Magic] Str Offset");
            if (mod != null && mod.Offset < 0)
            {
                m.RemoveStatMod("[Magic] Str Offset");
            }

            mod = m.GetStatMod("[Magic] Dex Offset");
            if (mod != null && mod.Offset < 0)
            {
                m.RemoveStatMod("[Magic] Dex Offset");
            }

            mod = m.GetStatMod("[Magic] Int Offset");
            if (mod != null && mod.Offset < 0)
            {
                m.RemoveStatMod("[Magic] Int Offset");
            }

            m.Paralyzed = false;
            m.CurePoison(m);

            // EvilOmenSpell.CheckEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);

            #region Buff Icons
            if (m is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)m;
                pm.RemoveBuff(BuffIcon.Clumsy);
                pm.RemoveBuff(BuffIcon.CorpseSkin);
                pm.RemoveBuff(BuffIcon.EvilOmen);
                pm.RemoveBuff(BuffIcon.Curse);
                pm.RemoveBuff(BuffIcon.FeebleMind);
                pm.RemoveBuff(BuffIcon.MassCurse);
                pm.RemoveBuff(BuffIcon.Paralyze);
                pm.RemoveBuff(BuffIcon.Poison);
                pm.RemoveBuff(BuffIcon.Strangle);
                pm.RemoveBuff(BuffIcon.Weaken);
            }
            #endregion

            m.SendMessage("The duel has ended.");
        }
Example #26
0
        public override void OnTarget(Object o)
        {
            IPoint3D p = o as IPoint3D;

            if (p == null)
            {
                return;
            }

            if (CheckSequence())
            {
                List <Mobile> targets = new List <Mobile>();
                Party         party   = Party.Get(Caster);
                StatMod       mod;

                double prim = Caster.Skills[CastSkill].Value;
                double sec  = Caster.Skills[DamageSkill].Value;

                IPooledEnumerable eable = Caster.Map.GetMobilesInRange(new Point3D(p), 3);
                foreach (Mobile mob in eable)
                {
                    if (mob == null)
                    {
                        continue;
                    }

                    if (mob == Caster)
                    {
                        targets.Add(mob);
                    }

                    if (Caster.CanBeBeneficial(mob, false) && party != null && party.Contains(mob))
                    {
                        targets.Add(mob);
                    }
                }
                eable.Free();

                Mobile m;
                int    toheal = (int)(((prim + sec) / 2) * 0.3) - 6;
                Caster.PlaySound(0x64C);

                for (int i = 0; i < targets.Count; i++)
                {
                    m = targets[i];
                    int toHealMod = toheal;

                    if (!m.Alive)
                    {
                        continue;
                    }

                    if (m.Poisoned)
                    {
                        int chanceToCure = (10000 + (int)(((prim + sec) / 2) * 75) - ((m.Poison.RealLevel + 1) * 1750)) / 100;

                        if (chanceToCure > Utility.Random(100) && m.CurePoison(Caster))
                        {
                            toHealMod /= 3;
                        }
                        else
                        {
                            toHealMod = 0;
                        }
                    }

                    if (MortalStrike.IsWounded(m))
                    {
                        MortalStrike.EndWound(m);
                        toHealMod = 0;
                    }

                    if (toHealMod > 0)
                    {
                        m.Heal(toHealMod + Utility.RandomMinMax(1, 6));
                    }

                    m.RemoveStatMod("[Magic] Str Curse");
                    m.RemoveStatMod("[Magic] Dex Curse");
                    m.RemoveStatMod("[Magic] Int Curse");

                    SleepSpell.EndSleep(m);
                    EvilOmenSpell.TryEndEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);
                    BloodOathSpell.RemoveCurse(m);
                    MindRotSpell.ClearMindRotScalar(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                    BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
                    BuffInfo.RemoveBuff(m, BuffIcon.CorpseSkin);
                    BuffInfo.RemoveBuff(m, BuffIcon.Strangle);
                    BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);

                    //TODO: Message/Effects???
                }
            }

            FinishSequence();
        }
Example #27
0
        public void Target(BaseTalisman talis, Mobile owner, Mobile m)
        {
            if (this.Parent == owner)
            {
                //Curse Removal
                if (talis.m_TalismanType == TalismanType.CurseRemoval)
                {
                    m.PlaySound(0xF6);
                    m.PlaySound(0x1F7);
                    m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    StatMod mod;

                    mod = m.GetStatMod("[Magic] Str Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Str Malus");
                    }

                    mod = m.GetStatMod("[Magic] Dex Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Dex Malus");
                    }

                    mod = m.GetStatMod("[Magic] Int Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Int Malus");
                    }

                    m.Paralyzed = false;

                    EvilOmenSpell.CheckEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                    BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072409);               // Your targets curses have been lifted
                    }
                    m.SendLocalizedMessage(1072408);                       // Any curses on you have been lifted
                }

                //Damage Removal
                if (talis.m_TalismanType == TalismanType.DamageRemoval)
                {
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 8);
                    Effects.PlaySound(m, m.Map, 0x201);
                    BleedAttack.EndBleed(m, false);
                    MortalStrike.EndWound(m);
                    m.CurePoison(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Bleed);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072406);               // Your Targets lasting damage effects have been removed!
                    }
                    m.SendLocalizedMessage(1072405);                       // Your lasting damage effects have been removed!
                }

                //Ward Removal
                if (talis.m_TalismanType == TalismanType.WardRemoval)
                {
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 8);
                    Effects.PlaySound(m, m.Map, 0x201);

                    ProtectionSpell.RemoveWard(m);
                    ReactiveArmorSpell.RemoveWard(m);
                    MagicReflectSpell.RemoveWard(m);
                    TransformationSpell.RemoveContext(m, true);
                    ReaperFormSpell.RemoveEffects(m);
                    if (StoneFormSpell.UnderEffect(m))
                    {
                        StoneFormSpell.RemoveEffects(m);
                    }

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072403);               // Your target's wards have been removed!
                    }
                    m.SendLocalizedMessage(1072402);                       // Your wards have been removed!
                }

                //Wildfire Removal
                if (talis.m_TalismanType == TalismanType.WildfireRemoval)
                {
                    owner.SendLocalizedMessage(1042753, "Wildfire Removal");                       // ~1_SOMETHING~ has been temporarily disabled.
                }
                //CARGE TIMER
                ChargeTimeLeft = 1200;
                m_ChargeTimer  = new ChargeTimeLeftTimer(this);
                m_ChargeTimer.Start();
                m_ChargeTimeLeft3 = DateTime.Now;
            }
            else if (m_TalismanType != 0)
            {
                m.SendLocalizedMessage(502641);                   // You must equip this item to use it.
            }
        }
Example #28
0
        public override void OnCast()
        {
            if (this.CheckSequence())
            {
                List <Mobile> targets = new List <Mobile>();

                foreach (Mobile m in this.Caster.GetMobilesInRange(3)) // TODO: Validate range
                {
                    if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
                    {
                        continue;
                    }

                    if (this.Caster != m && m.InLOS(this.Caster) && this.Caster.CanBeBeneficial(m, false, true) && !(m is Golem))
                    {
                        targets.Add(m);
                    }
                }

                this.Caster.PlaySound(0x244);
                this.Caster.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist);
                this.Caster.FixedParticles(0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist);

                /* Attempts to Resurrect, Cure and Heal all targets in a radius around the caster.
                 * If any target is successfully assisted, the Paladin's current
                 * Hit Points, Mana and Stamina are set to 1.
                 * Amount of damage healed is affected by the Caster's Karma, from 8 to 24 hit points.
                 */

                bool sacrifice = false;

                // TODO: Is there really a resurrection chance?
                double resChance = 0.1 + (0.9 * ((double)this.Caster.Karma / 10000));

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = targets[i];

                    if (!m.Alive)
                    {
                        if (m.Region != null && m.Region.IsPartOf("Khaldun"))
                        {
                            this.Caster.SendLocalizedMessage(1010395); // The veil of death in this area is too strong and resists thy efforts to restore life.
                        }
                        else if (resChance > Utility.RandomDouble())
                        {
                            m.FixedParticles(0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head);
                            m.CloseGump(typeof(ResurrectGump));
                            m.SendGump(new ResurrectGump(m, this.Caster));
                            sacrifice = true;
                        }
                    }
                    else
                    {
                        bool sendEffect = false;

                        if (m.Poisoned && m.CurePoison(this.Caster))
                        {
                            this.Caster.DoBeneficial(m);

                            if (this.Caster != m)
                            {
                                this.Caster.SendLocalizedMessage(1010058); // You have cured the target of all poisons!
                            }
                            m.SendLocalizedMessage(1010059);               // You have been cured of all poisons.
                            sendEffect = true;
                            sacrifice  = true;
                        }

                        if (m.Hits < m.HitsMax)
                        {
                            int toHeal = this.ComputePowerValue(10) + Utility.RandomMinMax(0, 2);

                            // TODO: Should caps be applied?
                            if (toHeal < 8)
                            {
                                toHeal = 8;
                            }
                            else if (toHeal > 24)
                            {
                                toHeal = 24;
                            }

                            this.Caster.DoBeneficial(m);
                            m.Heal(toHeal, this.Caster);
                            sendEffect = true;
                        }

                        StatMod mod;

                        if (m.RemoveStatMod("[Magic] Str Offset"))
                        {
                            sendEffect = true;
                        }

                        if (m.RemoveStatMod("[Magic] Dex Offset"))
                        {
                            sendEffect = true;
                        }

                        if (m.RemoveStatMod("[Magic] Int Offset"))
                        {
                            sendEffect = true;
                        }

                        if (m.Paralyzed)
                        {
                            m.Paralyzed = false;
                            sendEffect  = true;
                        }

                        if (EvilOmenSpell.TryEndEffect(m))
                        {
                            sendEffect = true;
                        }

                        if (StrangleSpell.RemoveCurse(m))
                        {
                            sendEffect = true;
                        }

                        if (CorpseSkinSpell.RemoveCurse(m))
                        {
                            sendEffect = true;
                        }

                        // TODO: Should this remove blood oath? Pain spike?

                        if (sendEffect)
                        {
                            m.FixedParticles(0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head);
                            sacrifice = true;
                        }
                    }
                }

                if (sacrifice)
                {
                    this.Caster.PlaySound(this.Caster.Body.IsFemale ? 0x150 : 0x423);
                    this.Caster.Hits = 1;
                    this.Caster.Stam = 1;
                    this.Caster.Mana = 1;
                }
            }

            this.FinishSequence();
        }
Example #29
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                ArrayList targets = new ArrayList();

                foreach (Mobile m in Caster.GetMobilesInRange(3))                     // TODO: Validate range
                {
                    if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
                    {
                        continue;
                    }

                    if (Caster != m && Caster.CanBeBeneficial(m, false, true) && !(m is Golem))
                    {
                        targets.Add(m);
                    }
                }

                Caster.PlaySound(0x244);
                Caster.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist);
                Caster.FixedParticles(0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist);

                /* Attempts to Resurrect, Cure and Heal all targets in a radius around the caster.
                 * If any target is successfully assisted, the Paladin's current
                 * Hit Points, Mana and Stamina are set to 1.
                 * Amount of damage healed is affected by the Caster's Karma, from 8 to 24 hit points.
                 */

                bool sacrifice = false;

                // TODO: Is there really a resurrection chance?
                double resChance = 0.1 + (0.9 * ((double)Caster.Karma / 10000));

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = (Mobile)targets[i];

                    if (!m.Alive)
                    {
                        if (m.Region != null && m.Region.Name == "Khaldun")
                        {
                        }
                        else if (resChance > Utility.RandomDouble())
                        {
                            m.FixedParticles(0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head);
                            m.SendGump(new ResurrectGump(m, Caster));
                            sacrifice = true;
                        }
                    }
                    else
                    {
                        bool sendEffect = false;

                        if (m.Poisoned && m.CurePoison(Caster))
                        {
                            Caster.DoBeneficial(m);
                            sendEffect = true;
                            sacrifice  = true;
                        }

                        if (m.Hits < m.HitsMax)
                        {
                            int toHeal = ComputePowerValue(10) + Utility.RandomMinMax(0, 2);

                            // TODO: Should caps be applied?
                            if (toHeal < 8)
                            {
                                toHeal = 8;
                            }
                            else if (toHeal > 24)
                            {
                                toHeal = 24;
                            }

                            Caster.DoBeneficial(m);
                            m.Heal(toHeal);
                            sendEffect = true;
                        }

                        StatMod mod;

                        mod = m.GetStatMod("[Magic] Str Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            m.RemoveStatMod("[Magic] Str Offset");
                            sendEffect = true;
                        }

                        mod = m.GetStatMod("[Magic] Dex Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            m.RemoveStatMod("[Magic] Dex Offset");
                            sendEffect = true;
                        }

                        mod = m.GetStatMod("[Magic] Int Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            m.RemoveStatMod("[Magic] Int Offset");
                            sendEffect = true;
                        }

                        if (m.Paralyzed)
                        {
                            m.Paralyzed = false;
                            sendEffect  = true;
                        }

                        if (EvilOmenSpell.CheckEffect(m))
                        {
                            sendEffect = true;
                        }

                        if (StrangleSpell.RemoveCurse(m))
                        {
                            sendEffect = true;
                        }

                        if (CorpseSkinSpell.RemoveCurse(m))
                        {
                            sendEffect = true;
                        }

                        // TODO: Should this remove blood oath? Pain spike?

                        if (sendEffect)
                        {
                            m.FixedParticles(0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head);
                            sacrifice = true;
                        }
                    }
                }

                if (sacrifice)
                {
                    Caster.PlaySound(0x423);
                    Caster.Hits = 1;
                    Caster.Stam = 1;
                    Caster.Mana = 1;
                }
            }

            FinishSequence();
        }