Example #1
0
        public static void RemoveWard( Mobile targ )
        {
            ResistanceMod[] mods = (ResistanceMod[]) m_Table[targ];

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

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

                BuffInfo.RemoveBuff( targ, BuffIcon.ReactiveArmor );
            }
        }
Example #2
0
        public static void RemoveEffects( Mobile m )
        {
            ArrayList mods = (ArrayList) m_Table[m];

            for ( int i = 0; i < mods.Count; ++i )
                m.RemoveResistanceMod( (ResistanceMod) mods[i] );

            m.BodyMod = 0;
            m.HueMod = -1;

            m_Table.Remove( m );

            BuffInfo.RemoveBuff( m, BuffIcon.StoneForm );
        }
        public static void EndProtection(Mobile m)
        {
            if (m_Table.Contains(m))
            {
                object[] mods = (object[])m_Table[m];

                m_Table.Remove(m);
                Registry.Remove(m);

                m.RemoveResistanceMod((ResistanceMod)mods[0]);
                m.RemoveSkillMod((SkillMod)mods[1]);

                BuffInfo.RemoveBuff(m, BuffIcon.Protection);
            }
        }
Example #4
0
        public static void RemoveEffects( Mobile m )
        {
            if ( m_Table.ContainsKey( m ) )
            {
                ArrayList mods = (ArrayList) m_Table[m];

                for ( int i = 0; i < mods.Count; ++i )
                    m.RemoveResistanceMod( (ResistanceMod) mods[i] );

                m.BodyMod = 0;
                m.HueMod = -1;

                m_Table.Remove( m );
            }
        }
Example #5
0
        public static void Toggle(Mobile caster, Mobile target)
        {
            /* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
            * Players under the protection spell have decreased physical resistance stat value (-15 + (Inscription/20),
            * a decreased "resisting spells" skill value by -35 + (Inscription/20),
            * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
            * The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
            * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out,
            * even after dying—until you “turn them off” by casting them again.
            */
            object[] mods = (object[])m_Table[target];

            if (mods == null)
            {
                target.PlaySound(0x1E9);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                mods = new object[2]
                {
                    new ResistanceMod(ResistanceType.Physical, -15 + Math.Min((int)(caster.Skills[SkillName.Inscribe].Value / 20), 15)),
                    new DefaultSkillMod(SkillName.MagicResist, true, -35 + Math.Min((int)(caster.Skills[SkillName.Inscribe].Value / 20), 35))
                };

                m_Table[target] = mods;
                Registry[target] = 100.0;

                target.AddResistanceMod((ResistanceMod)mods[0]);
                target.AddSkillMod((SkillMod)mods[1]);

                int physloss = -15 + (int)(caster.Skills[SkillName.Inscribe].Value / 20);
                int resistloss = -35 + (int)(caster.Skills[SkillName.Inscribe].Value / 20);
                string args = String.Format("{0}\t{1}", physloss, resistloss);
                BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString()));
            }
            else
            {
                target.PlaySound(0x1ED);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                m_Table.Remove(target);
                Registry.Remove(target);

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

                BuffInfo.RemoveBuff(target, BuffIcon.Protection);
            }
        }
Example #6
0
        public static void EndArmor(Mobile m)
        {
            if (m_Table.Contains(m))
            {
                ResistanceMod[] mods = (ResistanceMod[])m_Table[m];

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

                m_Table.Remove(m);
                BuffInfo.RemoveBuff(m, BuffIcon.ReactiveArmor);
            }
        }
Example #7
0
        public static void RemoveWard( Mobile target )
        {
            object[] mods = (object[]) m_Table[target];

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

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

                BuffInfo.RemoveBuff( target, BuffIcon.Protection );
                BuffInfo.RemoveBuff( target, BuffIcon.ArchProtection );
            }
        }
Example #8
0
        public static void RemoveEffect(Mobile m)
        {
            if (!m_Table.ContainsKey(m))
                return;

            List<ResistanceMod> mods = m_Table[m];

            for (int i = 0; i < m_Table[m].Count; i++)
            {
                m.RemoveResistanceMod(mods[i]);
            }

            m_Table.Remove(m);
            m.EndAction(typeof(StoneFormSpell));
            m.PlaySound(0x201);  
            m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
            m.BodyMod = 0;
        }
        public override void RemoveEffect(Mobile m)
        {
            ResistanceMod[] mods = (ResistanceMod[])m_Table[m];

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

                m_Table[m] = mods;

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

                m.PlaySound(0x65B);
                m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
                m.Delta(MobileDelta.WeaponDamage);
                m.EndAction(typeof(StoneFormSpell));
            }
        }
Example #10
0
        public static void Toggle( Mobile caster, Mobile target )
        {
            /* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
             * Players under the protection spell have decreased physical resistance stat value,
             * a decreased "resisting spells" skill value by -35,
             * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
             * The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
             * Reactive Armor, Protection, and Magic Reflection will stay on�even after logging out,
             * even after dying�until you �turn them off� by casting them again.
             */

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

            if ( mods == null )
            {
                target.PlaySound( 0x1E9 );
                target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );

                mods = new object[2]
                    {
                        new ResistanceMod( ResistanceType.Physical, -15 + (int)(caster.Skills[SkillName.Inscribe].Value / 20) ),
                        new DefaultSkillMod( SkillName.MagicResist, true, -35 + (int)(caster.Skills[SkillName.Inscribe].Value / 20) )
                    };

                m_Table[target] = mods;
                Registry[target] = 100.0;

                target.AddResistanceMod( (ResistanceMod)mods[0] );
                target.AddSkillMod( (SkillMod)mods[1] );
            }
            else
            {
                target.PlaySound( 0x1ED );
                target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );

                m_Table.Remove( target );
                Registry.Remove( target );

                target.RemoveResistanceMod( (ResistanceMod)mods[0] );
                target.RemoveSkillMod( (SkillMod)mods[1] );
            }
        }
Example #11
0
            public void Clear()
            {
                for (int i = 0; i < m_Mods.Count; ++i)
                {
                    object mod = m_Mods[i];

                    if (mod is ResistanceMod)
                    {
                        m_Creature.RemoveResistanceMod((ResistanceMod)mod);
                    }
                    else if (mod is StatMod)
                    {
                        m_Creature.RemoveStatMod(((StatMod)mod).Name);
                    }
                    else if (mod is SkillMod)
                    {
                        m_Creature.RemoveSkillMod((SkillMod)mod);
                    }
                }
            }
Example #12
0
        public static void RemoveEffect(Mobile m)
        {
            if (!m_Table.ContainsKey(m))
            {
                return;
            }

            List <ResistanceMod> mods = m_Table[m];

            for (int i = 0; i < m_Table[m].Count; i++)
            {
                m.RemoveResistanceMod(mods[i]);
            }

            m_Table.Remove(m);
            m.EndAction(typeof(StoneFormSpell));
            m.PlaySound(0x201);
            m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
            m.BodyMod = 0;
        }
Example #13
0
        private static void ClearMods(Mobile from, ArrayList mods)
        {
            for (int i = 0; i < mods.Count; ++i)
            {
                object mod = mods[i];

                if (mod is ResistanceMod)
                {
                    from.RemoveResistanceMod((ResistanceMod)mod);
                }
                else if (mod is StatMod)
                {
                    from.RemoveStatMod(((StatMod)mod).Name);
                }
                else if (mod is SkillMod)
                {
                    from.RemoveSkillMod((SkillMod)mod);
                }
            }
        }
Example #14
0
            public void Clear()
            {
                for (var i = 0; i < m_Mods.Count; ++i)
                {
                    var mod = m_Mods[i];

                    if (mod is ResistanceMod resistanceMod)
                    {
                        m_Creature.RemoveResistanceMod(resistanceMod);
                    }
                    else if (mod is StatMod statMod)
                    {
                        m_Creature.RemoveStatMod(statMod.Name);
                    }
                    else if (mod is SkillMod skillMod)
                    {
                        m_Creature.RemoveSkillMod(skillMod);
                    }
                }
            }
Example #15
0
            protected override void OnTick()
            {
                if (target == null || target.Deleted)
                {
                    return;
                }

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

                Effects.SendTargetParticles(target, 14170, 10, 15, 5013, 0, 0, EffectLayer.CenterFeet); //ID, speed, dura, effect, hue, render, layer
                Effects.SendTargetParticles(target, 14201, 10, 15, 5013, 0, 0, EffectLayer.CenterFeet); //ID, speed, dura, effect, hue, render, layer
                target.PlaySound(514);

                m_Table.Remove(target);

                for (int i = 0; i < mods.Length; ++i)
                {
                    target.RemoveResistanceMod(mods[i]);
                }
            }
        public static void RemoveEffect(Mobile m)
        {
            m.HueMod  = -1;
            m.BodyMod = 0;
            m.SendMessage("Your flesh turns back to normal.");

            ResistanceMod[] mods = (ResistanceMod[])TableStoneFlesh[m];
            TableStoneFlesh.Remove(m);
            for (int i = 0; i < mods.Length; ++i)
            {
                m.RemoveResistanceMod(mods[i]);
            }

            Point3D hands = new Point3D((m.X + 1), (m.Y + 1), (m.Z + 8));

            Effects.SendLocationParticles(EffectItem.Create(hands, m.Map, EffectItem.DefaultDuration), 0x3837, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(m, 0xB7F), 0, 5022, 0);
            m.PlaySound(0x65A);

            m.EndAction(typeof(ResearchRockFlesh));
        }
Example #17
0
        public static bool EndArmor(Mobile m)
        {
            if (m_Table.Contains(m))
            {
                ResistanceMod[] mods = (ResistanceMod[])m_Table[m];

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

                m_Table.Remove(m);
                BuffInfo.RemoveBuff(m, BuffIcon.ReactiveArmor);
                return(true);
            }
            return(false);
        }
Example #18
0
            public void DoExpire()
            {
                UnequipPirateItems(m_Mobile);

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

                if (m_Mobile.Criminal)
                {
                    m_Mobile.Criminal = false;
                }
                if (m_Mobile.Poisoned)
                {
                    m_Mobile.CurePoison(m_Mobile);
                }

                Stop();
                m_Table.Remove(m_Mobile);
            }
Example #19
0
        public static void RemoveEffect(Mobile m)
        {
            if (!m_Table.ContainsKey(m))
                return;

            var mods = m_Table[m];

            for (var i = 0; i < m_Table[m].Count; i++)
            {
                m.RemoveResistanceMod(mods[i]);
            }

            Enhancement.SetValue(m, AosAttribute.CastSpeed, 2, "Stone Form");
            Enhancement.SetValue(m, AosAttribute.WeaponSpeed, 10, "Stone Form");

            m_Table.Remove(m);
            m.EndAction(typeof (StoneFormSpell));
            m.PlaySound(0x201);
            m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
            m.BodyMod = 0;
        }
Example #20
0
            public void Clear()
            {
                if (m_Mods == null)
                {
                    return;
                }

                for (var i = 0; i < m_Mods.Count; ++i)
                {
                    var mod = m_Mods[i];

                    if (mod is ResistanceMod resistanceMod)
                    {
                        m_Mobile.RemoveResistanceMod(resistanceMod);
                    }
                    else if (mod is SkillMod skillMod)
                    {
                        m_Mobile.RemoveSkillMod(skillMod);
                    }
                }
            }
Example #21
0
            public void Clear()
            {
                if (m_Mods == null)
                {
                    return;
                }

                for (int i = 0; i < m_Mods.Count; ++i)
                {
                    object mod = m_Mods[i];

                    if (mod is ResistanceMod)
                    {
                        m_Mobile.RemoveResistanceMod((ResistanceMod)mod);
                    }
                    else if (mod is SkillMod)
                    {
                        m_Mobile.RemoveSkillMod((SkillMod)mod);
                    }
                }
            }
Example #22
0
        public static void EndReflect(Mobile m)
        {
            if (m_Table.Contains(m))
            {
                ResistanceMod[] mods = (ResistanceMod[])m_Table[m];

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

                m_Table.Remove(m);
                if (Core.ML)
                {
                    BuffInfo.RemoveBuff(m, BuffIcon.MagicReflection);
                }
            }
        }
        public static void Toggle(Mobile caster, Mobile target)
        {
            /* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
             * Players under the protection spell have decreased physical resistance stat value,
             * a decreased "resisting spells" skill value by -35,
             * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
             * The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
             * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out,
             * even after dying—until you “turn them off” by casting them again.
             */

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

            if (mods == null)
            {
                target.PlaySound(0x1E9);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                mods = new object[2] {
                    new ResistanceMod(ResistanceType.Physical, -15 + (int)(caster.Skills[SkillName.Inscribe].Value / 20)), new DefaultSkillMod(SkillName.MagicResist, true, -35 + (int)(caster.Skills[SkillName.Inscribe].Value / 20))
                };

                m_Table[target]  = mods;
                Registry[target] = 100.0;

                target.AddResistanceMod((ResistanceMod)mods[0]);
                target.AddSkillMod((SkillMod)mods[1]);
            }
            else
            {
                target.PlaySound(0x1ED);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                m_Table.Remove(target);
                Registry.Remove(target);

                target.RemoveResistanceMod((ResistanceMod)mods[0]);
                target.RemoveSkillMod((SkillMod)mods[1]);
            }
        }
Example #24
0
            public void DoExpire(bool message = true)
            {
                for (int i = 0; i < m_Mods.Length; ++i)
                {
                    m_Mobile.RemoveResistanceMod(m_Mods[i]);
                }

                Stop();
                BuffInfo.RemoveBuff(m_Mobile, BuffIcon.CorpseSkin);

                if (m_Table.ContainsKey(m_Mobile))
                {
                    m_Table.Remove(m_Mobile);
                }

                m_Mobile.UpdateResistances();

                if (message)
                {
                    m_Mobile.SendLocalizedMessage(1061688); // Your skin returns to normal.
                }
            }
Example #25
0
            public void Clear()
            {
                if (m_PVP)
                {
                    Timer.DelayCall(() =>
                    {
                        foreach (var item in m_Target.Items)
                        {
                            var bonuses = RunicReforging.GetAosSkillBonuses(item);

                            if (bonuses != null)
                            {
                                bonuses.AddTo(m_Target);
                            }
                        }
                    });
                }
                else
                {
                    for (int i = 0; i < m_Mods.Count; ++i)
                    {
                        object mod = m_Mods[i];

                        if (mod is ResistanceMod)
                        {
                            m_Target.RemoveResistanceMod((ResistanceMod)mod);
                        }
                        else if (mod is StatMod)
                        {
                            m_Target.RemoveStatMod(((StatMod)mod).Name);
                        }
                        else if (mod is SkillMod)
                        {
                            m_Target.RemoveSkillMod((SkillMod)mod);
                        }
                    }
                }
            }
Example #26
0
        public static void RemoveContext(Mobile m, TransformContext context, bool resetGraphics)
        {
            if (m_Table.ContainsKey(m))
            {
                m_Table.Remove(m);

                List <ResistanceMod> mods = context.Mods;

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

                if (resetGraphics)
                {
                    m.HueMod  = -1;
                    m.BodyMod = 0;
                }

                context.Timer.Stop();
                context.Spell.RemoveEffect(m);
            }
        }
Example #27
0
        public static void RemoveEffect(Mobile m)
        {
            if (!m_Table.ContainsKey(m))
            {
                return;
            }

            var mods = m_Table[m];

            for (var i = 0; i < m_Table[m].Count; i++)
            {
                m.RemoveResistanceMod(mods[i]);
            }

            Enhancement.SetValue(m, AosAttribute.CastSpeed, 2, "Stone Form");
            Enhancement.SetValue(m, AosAttribute.WeaponSpeed, 10, "Stone Form");

            m_Table.Remove(m);
            m.EndAction(typeof(StoneFormSpell));
            m.PlaySound(0x201);
            m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
            m.BodyMod = 0;
        }
Example #28
0
        public static void RemoveContext(Mobile m, TransformContext context, bool resetGraphics)
        {
            m_Table.Remove(m);

            ArrayList mods = context.Mods;

            for (int i = 0; i < mods.Count; ++i)
            {
                m.RemoveResistanceMod((ResistanceMod)mods[i]);
            }

            if (resetGraphics)
            {
                m.HueMod  = -1;
                m.BodyMod = 0;
            }

            context.Timer.Stop();

            if (context.Type == typeof(HorrificBeastSpell))
            {
                m.Delta(MobileDelta.WeaponDamage);
            }
        }
Example #29
0
 public void DoExpire()
 {
     m_Mobile.RemoveResistanceMod(m_Mod);
     Stop();
     m_Table.Remove(m_Mobile);
 }
Example #30
0
            public void DoExpire()
            {
                m_Mobile.RemoveResistanceMod(m_Mods);

                Stop();
            }
Example #31
0
        public override void OnHit(Mobile defender, ref int damage)
        {
            BaseWeapon weapon = GetWeapon();

            if (!CheckWeapon())
            {
                return;
            }

            Poison p = weapon.Poison;

            if (p == null || weapon.PoisonCharges <= 0)
            {
                Caster.SendLocalizedMessage(1061141); // Your weapon must have a dose of poison to perform an infectious strike!
                return;
            }

            // Skill Masteries
            int noChargeChance = MasteryInfo.NonPoisonConsumeChance(Caster);

            if (noChargeChance > 0 && noChargeChance < Utility.Random(100))
            {
                --weapon.PoisonCharges;
            }
            else
            {
                Caster.SendLocalizedMessage(1156095); // Your mastery of poisoning allows you to use your poison charge without consuming it.
            }
            int maxLevel = Caster.Skills[SkillName.Poisoning].Fixed / 200;

            if (maxLevel < 0)
            {
                maxLevel = 0;
            }

            #region Mondain's Legacy
            if (p == Poison.DarkGlow)
            {
                p = Poison.GetPoison(10 + Math.Min(maxLevel, 2));
            }
            else if (p == Poison.Parasitic)
            {
                p = Poison.GetPoison(14 + Math.Min(maxLevel, 3));
            }
            else if (p.Level > maxLevel)
            {
                p = Poison.GetPoison(maxLevel);
            }
            #endregion

            if ((Caster.Skills[SkillName.Poisoning].Value / 100.0) > Utility.RandomDouble())
            {
                int    level     = p.Level + 1;
                Poison newPoison = Poison.GetPoison(level);

                if (newPoison != null)
                {
                    p = newPoison;

                    Caster.SendLocalizedMessage(1060080);   // Your precise strike has increased the level of the poison by 1
                    defender.SendLocalizedMessage(1060081); // The poison seems extra effective!
                }
            }

            defender.PlaySound(0xDD);
            defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

            if (defender.ApplyPoison(Caster, p) != ApplyPoisonResult.Immune)
            {
                Caster.SendLocalizedMessage(1008096, true, defender.Name);  // You have poisoned your target :
                defender.SendLocalizedMessage(1008097, false, Caster.Name); //  : poisoned you!
            }

            int malus = (int)(BaseSkillBonus / 4);
            if (defender is PlayerMobile)
            {
                malus /= 2;
            }

            ResistanceMod mod = new ResistanceMod(ResistanceType.Poison, -malus);
            defender.AddResistanceMod(mod);

            BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.InjectedStrikeDebuff, 1155927, BuffInfo.Blank, ""));

            Server.Timer.DelayCall(TimeSpan.FromSeconds(4), () =>
            {
                defender.RemoveResistanceMod(mod);
                BuffInfo.RemoveBuff(defender, BuffIcon.InjectedStrikeDebuff);
            });

            Expire();
        }
Example #32
0
        private static void RemoveMods( Mobile m, List<object> mods )
        {
            for ( int i = 0; i < mods.Count; i++ )
            {
                object mod = mods[i];

                m.RemoveResistanceMod( (ResistanceMod) mod );
            }
        }
Example #33
0
        public override void OnCast()
        {
            if (Core.AOS)
            {
                if (CheckSequence())
                {
                    Mobile targ = Caster;

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

                    if (mods == null)
                    {
                        targ.PlaySound(0x1E9);
                        targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                        mods = new ResistanceMod[5]
                        {
                            new ResistanceMod(ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20)),
                            new ResistanceMod(ResistanceType.Fire, -5),
                            new ResistanceMod(ResistanceType.Cold, -5),
                            new ResistanceMod(ResistanceType.Poison, -5),
                            new ResistanceMod(ResistanceType.Energy, -5)
                        };

                        m_Table[targ] = mods;

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            targ.AddResistanceMod(mods[i]);
                        }
                    }
                    else
                    {
                        targ.PlaySound(0x1ED);
                        targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                        m_Table.Remove(targ);

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

                FinishSequence();
            }
            else
            {
                if (Caster.MeleeDamageAbsorb > 0)
                {
                    Caster.SendAsciiMessage("This spell is already in effect.");
                }
                else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
                {
                    Caster.SendAsciiMessage("The spell will not adhere to you at this time.");
                }
                else if (CheckSequence())
                {
                    if (Caster.BeginAction(typeof(DefensiveSpell)))
                    {
                        int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Meditation].Value + Caster.Skills[SkillName.Inscribe].Value);
                        value /= 3;

                        if (value < 0)
                        {
                            value = 1;
                        }
                        else if (value > 75)
                        {
                            value = 75;
                        }

                        Caster.MeleeDamageAbsorb = value;

                        Caster.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
                        Caster.PlaySound(0x1F2);
                    }
                    else
                    {
                        Caster.SendAsciiMessage("The spell will not adhere to you at this time.");
                    }
                }

                FinishSequence();
            }
        }
Example #34
0
        public override void OnCast()
        {
            #region AOS - NOT USED
            if (Core.AOS)
            {
                /* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances.
                 * Physical decrease = 25 - (Inscription/20).
                 * Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription)
                 * The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
                 * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
                 */

                if (CheckSequence())
                {
                    Mobile targ = Caster;

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

                    if (mods == null)
                    {
                        targ.PlaySound(0x1E9);
                        targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

                        //Removed by IPY
                        //int physiMod = -25 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
                        //int otherMod = 10;

                        mods = new ResistanceMod[5]
                        {
                            new ResistanceMod(ResistanceType.Physical, -25 + (int)(targ.Skills[SkillName.Inscribe].Value / 20)),
                            new ResistanceMod(ResistanceType.Fire, 10),
                            new ResistanceMod(ResistanceType.Cold, 10),
                            new ResistanceMod(ResistanceType.Poison, 10),
                            new ResistanceMod(ResistanceType.Energy, 10)
                        };

                        m_Table[targ] = mods;

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            targ.AddResistanceMod(mods[i]);
                        }
                        //Removed by IPY
                        //string buffFormat = String.Format( "{0}\t+{1}\t+{1}\t+{1}\t+{1}", physiMod, otherMod );

                        //BuffInfo.AddBuff( targ, new BuffInfo( BuffIcon.MagicReflection, 1075817, buffFormat, true ) );
                    }
                    else
                    {
                        targ.PlaySound(0x1ED);
                        targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

                        m_Table.Remove(targ);

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

                        //Removed by IPY
                        //BuffInfo.RemoveBuff( targ, BuffIcon.MagicReflection );
                    }
                }

                FinishSequence();
            }
            #endregion

            else
            {
                BaseCreature casterCreature = Caster as BaseCreature;

                if (casterCreature != null)
                {
                    if (casterCreature.SpellTarget != null)
                    {
                        this.Target(casterCreature.SpellTarget);
                    }
                }

                else
                {
                    Caster.Target = new InternalTarget(this);
                }
            }
        }
        public override void OnCast()
        {
            if (Core.AOS)
            {
                /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances.
                 * 15 + (Inscription/20) Physcial bonus
                 * -5 Elemental
                 * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
                 * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
                 * (+20 physical -5 elemental at 100 Inscription)
                 */

                if (CheckSequence())
                {
                    Mobile targ = Caster;

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

                    if (mods == null)
                    {
                        targ.PlaySound(0x1E9);
                        targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                        mods = new ResistanceMod[5]
                        {
                            new ResistanceMod(ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20)),
                            new ResistanceMod(ResistanceType.Fire, -5),
                            new ResistanceMod(ResistanceType.Cold, -5),
                            new ResistanceMod(ResistanceType.Poison, -5),
                            new ResistanceMod(ResistanceType.Energy, -5)
                        };

                        m_Table[targ] = mods;

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

                        int    physresist = 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
                        string args       = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", physresist, 5, 5, 5, 5);

                        BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ReactiveArmor, 1075812, 1075813, args.ToString()));
                    }
                    else
                    {
                        targ.PlaySound(0x1ED);
                        targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                        m_Table.Remove(targ);

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

                        BuffInfo.RemoveBuff(Caster, BuffIcon.ReactiveArmor);
                    }
                }

                FinishSequence();
            }
            else
            {
                if (Caster.MeleeDamageAbsorb > 0)
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
                else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
                {
                    Caster.SendLocalizedMessage(1005385);                       // The spell will not adhere to you at this time.
                }
                else if (CheckSequence())
                {
                    if (Caster.BeginAction(typeof(DefensiveSpell)))
                    {
                        int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Meditation].Value + Caster.Skills[SkillName.Inscribe].Value);
                        value /= 3;

                        if (value < 0)
                        {
                            value = 1;
                        }
                        else if (value > 40)
                        {
                            value = 40;
                        }

                        Caster.MeleeDamageAbsorb = value;

                        Caster.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
                        Caster.PlaySound(0x1F2);
                    }
                    else
                    {
                        Caster.SendLocalizedMessage(1005385);                           // The spell will not adhere to you at this time.
                    }
                }

                FinishSequence();
            }
        }
Example #36
0
            protected override void OnTick()
            {
                m_Owner.RemoveResistanceMod(m_resMod);

                m_Owner.SendMessage("Champ entropique prend fin.");
            }
Example #37
0
        public override void OnCast()
        {
            if (Core.AOS)
            {
                /* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances.
                 * Physical decrease = 25 - (Inscription/20).
                 * Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription)
                 * The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
                 * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
                 */

                if (CheckSequence())
                {
                    Mobile targ = Caster;

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

                    if (mods == null)
                    {
                        targ.PlaySound(0x1E9);
                        targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

                        int physiMod = -25 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
                        int otherMod = 10;

                        mods = new ResistanceMod[5]
                        {
                            new ResistanceMod(ResistanceType.Physical, physiMod),
                            new ResistanceMod(ResistanceType.Fire, otherMod),
                            new ResistanceMod(ResistanceType.Cold, otherMod),
                            new ResistanceMod(ResistanceType.Poison, otherMod),
                            new ResistanceMod(ResistanceType.Energy, otherMod)
                        };

                        m_Table[targ] = mods;

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

                        string buffFormat = String.Format("{0}\t+{1}\t+{1}\t+{1}\t+{1}", physiMod, otherMod);

                        BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.MagicReflection, 1075817, buffFormat, true));
                    }
                    else
                    {
                        targ.PlaySound(0x1ED);
                        targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

                        m_Table.Remove(targ);

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

                        BuffInfo.RemoveBuff(targ, BuffIcon.MagicReflection);
                    }
                }

                FinishSequence();
            }
            else
            {
                if (Caster.MagicDamageAbsorb > 0)
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
                else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
                {
                    Caster.SendLocalizedMessage(1005385);                       // The spell will not adhere to you at this time.
                }
                else if (CheckSequence())
                {
                    if (Caster.BeginAction(typeof(DefensiveSpell)))
                    {
                        int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Inscribe].Value);
                        value = (int)(8 + (value / 200) * 7.0);                    //absorb from 8 to 15 "circles"

                        Caster.MagicDamageAbsorb = value;

                        Caster.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);
                        Caster.PlaySound(0x1E9);
                    }
                    else
                    {
                        Caster.SendLocalizedMessage(1005385);                           // The spell will not adhere to you at this time.
                    }
                }

                FinishSequence();
            }
        }
Example #38
0
        private static void RemoveMods( Mobile m, List<object> mods )
        {
            for ( int i = 0; i < mods.Count; i++ )
            {
                object mod = mods[i];

                if ( mod is AttributeMod )
                    m.RemoveAttributeMod( (AttributeMod) mod );
                else if ( mod is ResistanceMod )
                    m.RemoveResistanceMod( (ResistanceMod) mod );
            }
        }
Example #39
0
            protected override void OnTick()
            {
                m_Owner.RemoveResistanceMod(m_resMod);

                m_Owner.SendMessage("Peau de pierre prend fin.");
            }
Example #40
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon != null && !HasOnslaught(attacker, defender))
            {
                ClearCurrentMove(attacker);

                int phys, fire, cold, pois, nrgy, chaos, direct;
                weapon.GetDamageTypes(null, out phys, out fire, out cold, out pois, out nrgy, out chaos, out direct);

                int highest = phys;
                int type    = 0;

                if (fire > phys)
                {
                    type    = 1;
                    highest = fire;
                }

                if (cold > highest)
                {
                    type    = 2;
                    highest = cold;
                }

                if (pois > highest)
                {
                    type    = 3;
                    highest = pois;
                }

                if (nrgy > highest)
                {
                    type    = 4;
                    highest = nrgy;
                }

                ResistanceType resistType = (ResistanceType)type;

                int amount   = (int)(attacker.Skills[MoveSkill].Value + attacker.Skills[SkillName.Tactics].Value / 12);
                int duration = (MasteryInfo.GetMasteryLevel(attacker, MoveSkill) * 2) + 1;

                if (defender is PlayerMobile)
                {
                    amount /= 2;
                }

                ResistanceMod mod = new ResistanceMod(resistType, -amount);
                defender.AddResistanceMod(mod);

                attacker.PrivateOverheadMessage(MessageType.Regular, 1150, 1156008, attacker.NetState);                                                                                                        // You deliver an onslaught of sword strikes!
                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.Onslaught, 1156009, 1156010, TimeSpan.FromSeconds(duration), defender, String.Format("{0}\t{1}", amount.ToString(), resistType.ToString()))); // -~2_VAL~% ~1_RESIST~ Debuff.

                defender.FixedEffect(0x37B9, 10, 5, 632, 0);

                if (_Table == null)
                {
                    _Table = new Dictionary <Mobile, Mobile>();
                }

                _Table[attacker] = defender;

                Timer.DelayCall(TimeSpan.FromSeconds(duration), () =>
                {
                    defender.RemoveResistanceMod(mod);
                    _Table.Remove(attacker);
                });
            }
        }
Example #41
0
        public override void OnCast()
        {
            /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances.
             * 15 + (Inscription/20) Physcial bonus
             * -5 Elemental
             * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
             * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
             * (+20 physical -5 elemental at 100 Inscription)
             */

            if (CheckSequence())
            {
                Mobile targ = Caster;

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

                if (mods == null)
                {
                    targ.PlaySound(0x1E9);
                    targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                    int physmod = 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);

                    mods = new ResistanceMod[5]
                    {
                        new ResistanceMod(ResistanceType.Physical, physmod),
                        new ResistanceMod(ResistanceType.Fire, -5),
                        new ResistanceMod(ResistanceType.Cold, -5),
                        new ResistanceMod(ResistanceType.Poison, -5),
                        new ResistanceMod(ResistanceType.Energy, -5)
                    };

                    string buffFormat = String.Format("{0}\t{1}\t{1}\t{1}\t{1}", physmod, 5);

                    BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.ReactiveArmor, 1075812, buffFormat, true));

                    m_Table[targ] = mods;

                    for (int i = 0; i < mods.Length; ++i)
                    {
                        targ.AddResistanceMod(mods[i]);
                    }
                }
                else
                {
                    targ.PlaySound(0x1ED);
                    targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                    BuffInfo.RemoveBuff(targ, BuffIcon.ReactiveArmor);

                    m_Table.Remove(targ);

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

            FinishSequence();
        }
Example #42
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 #43
0
        public static void RemoveContext(Mobile m, TransformContext context, bool resetGraphics)
        {
            if (m_Table.ContainsKey(m))
            {
                m_Table.Remove(m);

                List<ResistanceMod> mods = context.Mods;

                for (int i = 0; i < mods.Count; ++i)
                    m.RemoveResistanceMod(mods[i]);

                if (resetGraphics)
                {
                    m.HueMod = -1;
                    m.BodyMod = 0;
                }

                context.Timer.Stop();
                context.Spell.RemoveEffect(m);
            }
        }
Example #44
0
        public override void OnCast()
        {
            #region AOS - NOT USED
            if (Core.AOS)
            {
                /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances.
                 * 15 + (Inscription/20) Physcial bonus
                 * -5 Elemental
                 * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
                 * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
                 * (+20 physical -5 elemental at 100 Inscription)
                 */

                if (CheckSequence())
                {
                    Mobile targ = Caster;

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

                    if (mods == null)
                    {
                        targ.PlaySound(0x1E9);
                        targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                        mods = new ResistanceMod[5]
                        {
                            new ResistanceMod(ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20)),
                            new ResistanceMod(ResistanceType.Fire, -5),
                            new ResistanceMod(ResistanceType.Cold, -5),
                            new ResistanceMod(ResistanceType.Poison, -5),
                            new ResistanceMod(ResistanceType.Energy, -5)
                        };

                        m_Table[targ] = mods;

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            targ.AddResistanceMod(mods[i]);
                        }
                    }
                    else
                    {
                        targ.PlaySound(0x1ED);
                        targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                        m_Table.Remove(targ);

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

                FinishSequence();
            }
            #endregion
            else
            {
                if (Caster is BaseCreature)
                {
                    this.Target(Caster);
                }

                else
                {
                    Caster.Target = new InternalTarget(this);
                }
            }
        }