Example #1
1
		public void Target( Mobile m )
		{
			if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
				 * making them more vulnerable to Fire and Poison damage,
				 * but increasing their resistance to Physical and Cold damage.
				 * 
				 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
				 * 
				 * NOTE: Algorithm above is fixed point, should be:
				 * ((ss-mr)/2.5) + 40
				 * 
				 * NOTE: Resistance is not checked if targeting yourself
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[m];

				if ( timer != null )
					timer.DoExpire();
				else
					m.SendLocalizedMessage( 1061689 ); // Your skin turns dry and corpselike.

				 if ( m.Spell != null )
					m.Spell.OnCasterHurt();
				
				m.FixedParticles( 0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head );
				m.PlaySound( 0x1BB );

				double ss = GetDamageSkill( Caster );
				double mr = ( Caster == m ? 0.0 : GetResistSkill( m ) );
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

				TimeSpan duration = TimeSpan.FromSeconds( ((ss - mr) / 2.5) + 40.0 );

				ResistanceMod[] mods = new ResistanceMod[4]
					{
						new ResistanceMod( ResistanceType.Fire, -15 ),
						new ResistanceMod( ResistanceType.Poison, -15 ),
						new ResistanceMod( ResistanceType.Cold, +10 ),
						new ResistanceMod( ResistanceType.Physical, +10 )
					};

				timer = new ExpireTimer( m, mods, duration );
				timer.Start();

				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.CorpseSkin, 1075663, duration, m ) );

				m_Table[m] = timer;

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

				HarmfulSpell( m );
			}

			FinishSequence();
		}
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckHSequence( m ) )
            {
                Mobile source = Caster;
                SpellHelper.Turn( source, m );

                SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );

                m.FixedParticles( 0x374A, 10, 30, 5013, 0x238, 2, EffectLayer.Waist );

                int amount = (int)( Caster.Skills[SkillName.Musicianship].Base * 0.17 );
                TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Musicianship].Base * 0.15 );

                m.SendMessage( "Your poison resistance has decreased." );
                ResistanceMod mod1 = new ResistanceMod( ResistanceType.Cold, - amount );

                m.AddResistanceMod( mod1 );

                ExpireTimer timer1 = new ExpireTimer( m, mod1, duration );
                timer1.Start();
            }

            FinishSequence();
        }
Example #3
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070837); // The creature lands another blow in your weakened state.
                }
                else
                {
                    defender.SendLocalizedMessage(1070836); // The blow from the creature's claws has made you more susceptible to physical attacks.
                }
                int effect = -(defender.PhysicalResistance * 15 / 100);

                ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, effect);

                int duration = Utility.RandomMinMax(5, 9);

                defender.FixedEffect(0x37B9, 10, duration);
                defender.AddResistanceMod(mod);

                timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Example #4
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() >= 0.1)
            {
                return;
            }

            if (m_Table.TryGetValue(defender, out var timer))
            {
                timer.DoExpire();
            }

            defender.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
            defender.PlaySound(0x208);
            defender.SendLocalizedMessage(
                1070833
                ); // The creature fans you with fire, reducing your resistance to fire attacks.

            var mod = new ResistanceMod(ResistanceType.Fire, -10);

            defender.AddResistanceMod(mod);

            m_Table[defender] = timer = new ExpireTimer(defender, mod);
            timer.Start();
        }
Example #5
0
        public void ApplyEffects(Mobile m, double strength = 1.0)
        {
            /* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
             * making them more vulnerable to Fire and Poison damage,
             * but increasing their resistance to Physical and Cold damage.
             *
             * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
             *
             * NOTE: Algorithm above is fixed point, should be:
             * ((ss-mr)/2.5) + 40
             *
             * NOTE: Resistance is not checked if targeting yourself
             */

            if (m_Table.ContainsKey(m))
            {
                m_Table[m].DoExpire(false);
            }

            m.SendLocalizedMessage(1061689); // Your skin turns dry and corpselike.

            m.Spell?.OnCasterHurt();

            m.FixedParticles(0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head);
            m.PlaySound(0x1BB);

            double ss = GetDamageSkill(Caster);
            double mr = GetResistSkill(m);

            m.CheckSkill(SkillName.MagicResist, 0.0, m.Skills[SkillName.MagicResist].Cap);      //Skill check for gain

            TimeSpan duration = TimeSpan.FromSeconds((((ss - mr) / 2.5) + 40.0) * strength);

            int malus = (int)Math.Min(15, (Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value) * 0.075);

            ResistanceMod[] mods =
            {
                new ResistanceMod(ResistanceType.Fire,     (int)(-malus * strength)),
                new ResistanceMod(ResistanceType.Poison,   (int)(-malus * strength)),
                new ResistanceMod(ResistanceType.Cold,     (int)(+10.0 * strength)),
                new ResistanceMod(ResistanceType.Physical, (int)(+10.0 * strength))
            };

            ExpireTimer timer = new ExpireTimer(m, mods, malus, duration);

            timer.Start();

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.CorpseSkin, 1075663, duration, m));

            m_Table[m] = timer;

            m.UpdateResistances();

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

            HarmfulSpell(m);
        }
Example #6
0
        public void Target(Mobile m)
        {
            if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
                 * making them more vulnerable to Fire and Poison damage,
                 * but increasing their resistance to Physical and Cold damage.
                 *
                 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
                 *
                 * NOTE: Algorithm above is fixed point, should be:
                 * ((ss-mr)/2.5) + 40
                 *
                 * NOTE: Resistance is not checked if targeting yourself
                 */

                ExpireTimer timer = (ExpireTimer)m_Table[m];

                if (timer != null)
                {
                    timer.DoExpire();
                }
                else
                {
                    m.SendLocalizedMessage(1061689);                       // Your skin turns dry and corpselike.
                }
                m.FixedParticles(0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head);
                m.PlaySound(0x1BB);

                double ss = GetDamageSkill(Caster);
                double mr = (Caster == m ? 0.0 : GetResistSkill(m));
                m.CheckSkill(SkillName.MagicResist, 0.0, 120.0);                        //Skill check for gain

                TimeSpan duration = TimeSpan.FromSeconds(((ss - mr) / 2.5) + 40.0);

                ResistanceMod[] mods = new ResistanceMod[4]
                {
                    new ResistanceMod(ResistanceType.Fire, -15),
                    new ResistanceMod(ResistanceType.Poison, -15),
                    new ResistanceMod(ResistanceType.Cold, +10),
                    new ResistanceMod(ResistanceType.Physical, +10)
                };

                timer = new ExpireTimer(m, mods, duration);
                timer.Start();

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.CorpseSkin, 1075663, duration, m));

                m_Table[m] = timer;

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

            FinishSequence();
        }
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;
                SpellHelper.Turn(source, m);

                SpellHelper.CheckReflect((int)this.Circle, ref source, ref m);

                m.FixedParticles(0x374A, 10, 30, 5013, 0x238, 2, EffectLayer.Waist);

                int      amount   = (int)(Caster.Skills[SkillName.Musicianship].Base * 0.17);
                TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Musicianship].Base * 0.15);

                m.SendMessage("Your poison resistance has decreased.");
                ResistanceMod mod1 = new ResistanceMod(ResistanceType.Cold, -amount);

                m.AddResistanceMod(mod1);

                ExpireTimer timer1 = new ExpireTimer(m, mod1, duration);
                timer1.Start();
            }

            FinishSequence();
        }
Example #8
0
        public override void DoEffect(Mobile m)
        {
            ResistanceMod[] mods = (ResistanceMod[])m_Table[m];
       
                int otherMod = 0 + (int)(m.Skills[SkillName.Mysticism].Value / 20);
                int admod = 1 + (int)(m.Skills[SkillName.Focus].Value / 20);
                //int casts = (int)AosAttributes.GetValue(Caster, AosAttribute.CastSpeed - 2);
               

                mods = new ResistanceMod[5]
				{
					new ResistanceMod( ResistanceType.Physical, otherMod + admod  ),
					new ResistanceMod( ResistanceType.Fire,		otherMod + admod  ),
				    new ResistanceMod( ResistanceType.Cold,		otherMod + admod  ),
					new ResistanceMod( ResistanceType.Poison,	otherMod + admod  ),
					new ResistanceMod( ResistanceType.Energy,	otherMod + admod  ),
                   // new ResistanceMod( AosAttribute.CastSpeed, casts )
			       
				};

                m_Table[m] = mods;

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

                m.PlaySound(0x65B);
                m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
                m.Delta(MobileDelta.WeaponDamage);
                
                m.EndAction(typeof(StoneFormSpell));
                
            }
Example #9
0
            public HumilityHuntContext(Mobile owner, List <Mobile> pets)
            {
                Owner = owner;

                Table = new Dictionary <Mobile, ResistanceMod[]>();

                var mod = GetMod;

                owner.FixedEffect(0x373A, 10, 16);

                foreach (var mods in mod)
                {
                    owner.AddResistanceMod(mods);
                }

                Table[owner] = mod;
                pets.ForEach(
                    m =>
                {
                    mod = GetMod;

                    foreach (var mods in mod)
                    {
                        m.AddResistanceMod(mods);
                    }

                    m.FixedEffect(0x373A, 10, 16);
                    Table[m] = mod;
                });
            }
Example #10
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                /* Grasping Claw
                 * Start cliloc: 1070836
                 * Effect: Physical resistance -15% for 5 seconds
                 * End cliloc: 1070838
                 * Effect: Type: "3" - From: "0x57D4F5B" (player) - To: "0x0" - ItemId: "0x37B9" - ItemIdName: "glow" - FromLocation: "(1149 808, 32)" - ToLocation: "(1149 808, 32)" - Speed: "10" - Duration: "5" - FixedDirection: "True" - Explode: "False"
                 */
                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070837); // The creature lands another blow in your weakened state.
                }
                else
                {
                    defender.SendLocalizedMessage(1070836); // The blow from the creature's claws has made you more susceptible to physical attacks.
                }
                int effect = -(defender.PhysicalResistance * 15 / 100);

                ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, effect);

                defender.FixedEffect(0x37B9, 10, 5);
                defender.AddResistanceMod(mod);

                timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Example #11
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                ArrayList targets = new ArrayList();

                foreach (Mobile m in Caster.GetMobilesInRange(3))
                {
                    if (Caster.CanBeBeneficial(m, false, true) && !(m is Golem))
                    {
                        targets.Add(m);
                    }
                }


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

                    TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Musicianship].Value * 0.2);
                    int      amount   = (int)(Caster.Skills[SkillName.Musicianship].Value * .125);

                    m.SendMessage("Your fire resistance has increased.");
                    ResistanceMod mod1 = new ResistanceMod(ResistanceType.Fire, +amount);

                    m.AddResistanceMod(mod1);

                    m.FixedParticles(0x373A, 10, 15, 5012, 0x21, 3, EffectLayer.Waist);

                    new ExpireTimer(m, mod1, duration).Start();
                }
            }

            FinishSequence();
        }
Example #12
0
            public void Apply()
            {
                if (m_PVP)
                {
                    foreach (var item in m_Target.Items)
                    {
                        var bonuses = RunicReforging.GetAosSkillBonuses(item);

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

                        if (mod is ResistanceMod)
                        {
                            m_Target.AddResistanceMod((ResistanceMod)mod);
                        }
                        else if (mod is StatMod)
                        {
                            m_Target.AddStatMod((StatMod)mod);
                        }
                        else if (mod is SkillMod)
                        {
                            m_Target.AddSkillMod((SkillMod)mod);
                        }
                    }
                }
            }
Example #13
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);

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

                    m_Table[targ] = mods;

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

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

                    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();
        }
Example #14
0
        public override void DoEffects(Mobile m)
        {
            base.DoEffects(m);

            ResistanceMod mod1 = new ResistanceMod(ResistanceType.Poison, 10);

            m.AddResistanceMod(mod1);

            Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod1));

            ResistanceMod mod2 = new ResistanceMod(ResistanceType.Energy, 5);

            m.AddResistanceMod(mod2);

            Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod2));
        }
Example #15
0
        public static void Toggle(Mobile caster, Mobile target)
        {
            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 #16
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
                return;

            ClearCurrentAbility(attacker);

            attacker.SendLocalizedMessage(1063353); // You perform a masterful defense!

            attacker.FixedParticles(0x375A, 1, 17, 0x7F2, 0x3E8, 0x3, EffectLayer.Waist);

            int modifier = (int)(30.0 * ((Math.Max(attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value) - 50.0) / 70.0));

            DefenseMasteryInfo info = m_Table[attacker] as DefenseMasteryInfo;

            if (info != null)
                EndDefense((object)info);

            ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, 50 + modifier);
            attacker.AddResistanceMod(mod);

            info = new DefenseMasteryInfo(attacker, 80 - modifier, mod);
            info.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(EndDefense), info);

            m_Table[attacker] = info;

            attacker.Delta(MobileDelta.WeaponDamage);
        }
Example #17
0
		// TODO: Put this attack shared with Hiryu and Lesser Hiryu in one place
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if( 0.1 > Utility.RandomDouble() )
			{
				ExpireTimer timer = (ExpireTimer)m_Table[defender];

				if( timer != null )
				{
					timer.DoExpire();
					defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.
				}
				else
					defender.SendLocalizedMessage( 1070836 ); // The blow from the creature's claws has made you more susceptible to physical attacks.

				int effect = -(defender.PhysicalResistance * 15 / 100);

				ResistanceMod mod = new ResistanceMod( ResistanceType.Physical, effect );

				defender.FixedEffect( 0x37B9, 10, 5 );
				defender.AddResistanceMod( mod );

				timer = new ExpireTimer( defender, mod, TimeSpan.FromSeconds( 5.0 ) );
				timer.Start();
				m_Table[defender] = timer;
			}
		}
Example #18
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (!IsFanned(defender) && 0.05 > Utility.RandomDouble())
            {
                /* Fanning Fire
                 * Graphic: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x3709" ItemIdName: "fire column" FromLocation: "(994 325, 16)" ToLocation: "(994 325, 16)" Speed: "10" Duration: "30" FixedDirection: "True" Explode: "False" Hue: "0x0" RenderMode: "0x0" Effect: "0x34" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x57D4F5B" Layer: "5" Unknown: "0x0"
                 * Sound: 0x208
                 * Start cliloc: 1070833
                 * Effect: Fire res -10% for 10 seconds
                 * Damage: 35-45, 100% fire
                 * End cliloc: 1070834
                 * Effect does not stack
                 */
                defender.SendLocalizedMessage(1070833);
                // The creature fans you with fire, reducing your resistance to fire attacks.

                var effect = -(defender.FireResistance / 10);

                var mod = new ResistanceMod(ResistanceType.Fire, effect);

                defender.FixedParticles(0x37B9, 10, 30, 0x34, EffectLayer.RightFoot);
                defender.PlaySound(0x208);

                // This should be done in place of the normal attack damage.
                //AOS.Damage( defender, this, Utility.RandomMinMax( 35, 45 ), 0, 100, 0, 0, 0 );

                defender.AddResistanceMod(mod);

                var timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(10.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Example #19
0
        public override void OnCast()
        {
            /* 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 (this.CheckSequence())
            {
                Mobile targ = this.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);
                }
            }

            this.FinishSequence();
        }
Example #20
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            attacker.SendLocalizedMessage(1063353);             // You perform a masterful defense!

            attacker.FixedParticles(0x375A, 1, 17, 0x7F2, 0x3E8, 0x3, EffectLayer.Waist);

            int modifier = (int)(30.0 * ((Math.Max(attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value) - 50.0) / 70.0));

            DefenseMasteryInfo info = m_Table[attacker] as DefenseMasteryInfo;

            if (info != null)
            {
                EndDefense(info);
            }

            ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, 50 + modifier);

            attacker.AddResistanceMod(mod);

            info         = new DefenseMasteryInfo(attacker, 80 - modifier, mod);
            info.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(EndDefense), info);

            m_Table[attacker] = info;

            attacker.Delta(MobileDelta.WeaponDamage);
        }
Example #21
0
        public void Target(Mobile m)
        {
            bool sings = false;

            PlayerMobile p = m as PlayerMobile;

            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                sings = true;

                //get songbook instrument
                Spellbook book = Spellbook.Find(Caster, -1, SpellbookType.Song);
                if (book == null)
                {
                    return;
                }
                m_Book = (SongBook)book;
                if (m_Book.Instrument == null || !(Caster.InRange(m_Book.Instrument.GetWorldLocation(), 1)))
                {
                    Caster.SendMessage("Your instrument is missing! You can select another from your song book.");
                    return;
                }

                Mobile source = Caster;
                SpellHelper.Turn(source, m);

                m.FixedParticles(0x374A, 10, 30, 5013, 0x480, 2, EffectLayer.Waist);

                bool IsSlayer = false;
                if (m is BaseCreature)
                {
                    IsSlayer = CheckSlayer(m_Book.Instrument, m);
                }

                int      amount   = (int)((Caster.Skills[SkillName.Musicianship].Value + Caster.Skills[SkillName.Peacemaking].Value + Caster.Skills[SkillName.Provocation].Value + Caster.Skills[SkillName.Discordance].Value) / 4 * .167);
                TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Musicianship].Value * 0.3);

                if (IsSlayer == true)
                {
                    amount   = amount * 2;
                    duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Musicianship].Value * 0.6);
                }

                m.SendMessage("Your resistance to cold has decreased.");
                ResistanceMod mod1 = new ResistanceMod(ResistanceType.Cold, -amount);

                m.AddResistanceMod(mod1);

                ExpireTimer timer1 = new ExpireTimer(m, mod1, duration);
                timer1.Start();
            }

            BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster);
            FinishSequence();
        }
 public override bool OnEquip( Mobile from )
 {
    if (!Core.AOS)
       from.VirtualArmor += 2;
    else
       from.AddResistanceMod( new ResistanceMod( ResistanceType.Physical, 2 ) );
    return true;
 }
Example #23
0
        public override void OnCast()
        {
            bool sings = false;

            //get songbook instrument
            Spellbook book = Spellbook.Find(Caster, -1, SpellbookType.Song);

            if (book == null)
            {
                return;
            }
            m_Book = (SongBook)book;
            if (m_Book.Instrument == null || !(Caster.InRange(m_Book.Instrument.GetWorldLocation(), 1)))
            {
                Caster.SendMessage("Your instrument is missing! You can select another from your song book.");
                return;
            }

            //added this to test
            if (m_Book.Instrument == null || !(Caster.InRange(m_Book.Instrument.GetWorldLocation(), 1)))
            {
                Caster.SendMessage("You need an instrument to play that song!");
            }
            else if (CheckSequence())
            {
                sings = true;

                ArrayList targets = new ArrayList();

                foreach (Mobile m in Caster.GetMobilesInRange(3))
                {
                    if (Caster.CanBeBeneficial(m, false, true) && !(m is Golem))
                    {
                        targets.Add(m);
                    }
                }


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

                    TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Musicianship].Value * 2.5);
                    int      amount   = (int)((Caster.Skills[SkillName.Musicianship].Value + Caster.Skills[SkillName.Peacemaking].Value + Caster.Skills[SkillName.Provocation].Value + Caster.Skills[SkillName.Discordance].Value) / 4 * .125);
                    m.SendMessage("Your resistance to fire has increased.");
                    ResistanceMod mod1 = new ResistanceMod(ResistanceType.Fire, +amount);

                    m.AddResistanceMod(mod1);

                    m.FixedParticles(0x373A, 10, 15, 5012, 0x21, 3, EffectLayer.Waist);

                    new ExpireTimer(m, mod1, duration).Start();
                }
            }

            BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster);
            FinishSequence();
        }
Example #24
0
            public InternalTimer(Mobile caster, int value, double duree) : base(TimeSpan.FromSeconds(duree))
            {
                Priority = TimerPriority.OneSecond;

                m_Owner = caster;

                m_resMod = new ResistanceMod(ResistanceType.Physical, (int)value);
                m_Owner.AddResistanceMod(m_resMod);
            }
Example #25
0
        private static void ApplyMods(Mobile m, List <object> mods)
        {
            for (int i = 0; i < mods.Count; i++)
            {
                object mod = mods[i];

                m.AddResistanceMod((ResistanceMod)mod);
            }
        }
Example #26
0
        public virtual bool ApplyTo(Mobile from)
        {
            if (from == null || from.Deleted)
            {
                return(false);
            }

            from.AddResistanceMod(this);
            return(true);
        }
Example #27
0
        public override void DoEffects(Mobile m)
        {
            base.DoEffects(m);

            ResistanceMod mod = new ResistanceMod(ResistanceType.Fire, 10);

            m.AddResistanceMod(mod);

            Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod));
        }
Example #28
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

            if (m_Table.Contains(m))
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x481, false, "That target is under the effect of that spell already.");
            }

            if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                ExpireTimer timer = (ExpireTimer)m_Table[m];

                if (timer != null)
                {
                    timer.DoExpire();
                }
                else
                {
                    m.SendMessage("You feel hatred shielding you from physical harm.");
                }
                m.PlaySound(0x5C0);
                m.FixedParticles(0x376A, 1, 29, 9961, 1152, 0, EffectLayer.Waist);

                TimeSpan duration = TimeSpan.FromSeconds(GetKarmaPower(Caster));

                ResistanceMod[] mods = new ResistanceMod[4]
                {
                    new ResistanceMod(ResistanceType.Fire, +0),
                    new ResistanceMod(ResistanceType.Poison, +0),
                    new ResistanceMod(ResistanceType.Cold, +0),
                    new ResistanceMod(ResistanceType.Physical, +100)
                };

                timer = new ExpireTimer(m, mods, duration);
                timer.Start();

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.ReactiveArmor, 1044120, 1044118, duration, m));

                m_Table[m] = timer;

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

            FinishSequence();
        }
Example #29
0
        public override void OnCast()
        {
            /* 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;

                var context = GetContext(targ);

                targ.PlaySound(0x1E9);
                targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

                if (context == null)
                {
                    int physiMod = 20 - (int)(targ.Skills[SkillName.Inscribe].Value / 20);
                    int otherMod = 10;

                    var mods = new[]
                    {
                        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)
                    };

                    context = new MagicReflectContext(Caster, mods);
                    m_Table.Add(context);

                    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}\t{2}\t{3}", physiMod, otherMod, "-5", context.ReflectPool);
                    BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.MagicReflection, 1015197, 1149979, buffFormat, true));
                }
                else if (CooldownTimer.InCooldown(Caster))
                {
                    Caster.SendLocalizedMessage(1150073, CooldownTimer.GetRemaining(Caster)); // You must wait ~1_seconds~ seconds to tap into your magic reflection pool.
                }
                else if (context.NextReplenish > DateTime.UtcNow || !context.TryReplenish())
                {
                    Expire(context);
                }
            }

            FinishSequence();
        }
Example #30
0
        public override void OnCast()
        {
            //get songbook instrument
            Spellbook book = Spellbook.Find(Caster, -1, SpellbookType.Song);

            if (book == null)
            {
                return;
            }
            m_Book = (SongBook)book;
            if (m_Book.Instrument == null || !(Caster.InRange(m_Book.Instrument.GetWorldLocation(), 1)))
            {
                Caster.SendMessage("Your instrument is missing! You can select another from your song book.");
                return;
            }

            bool sings = false;

            if (CheckSequence())
            {
                sings = true;

                ArrayList targets = new ArrayList();

                foreach (Mobile m in Caster.GetMobilesInRange(3))
                {
                    if (Caster.CanBeBeneficial(m, false, true) && !(m is Golem))
                    {
                        targets.Add(m);
                    }
                }


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

                    TimeSpan duration = TimeSpan.FromSeconds((double)(MusicSkill(Caster) * 2));
                    int      amount   = Server.Misc.MyServerSettings.PlayerLevelMod((int)(MusicSkill(Caster) / 16), Caster);

                    m.SendMessage("Your resistance to poison has increased.");
                    ResistanceMod mod1 = new ResistanceMod(ResistanceType.Poison, +amount);

                    m.AddResistanceMod(mod1);

                    m.FixedParticles(0x373A, 10, 15, 5012, 0x238, 3, EffectLayer.Waist);

                    new ExpireTimer(m, mod1, duration).Start();
                }
            }

            BardFunctions.UseBardInstrument(m_Book.Instrument, sings, Caster);
            FinishSequence();
        }
Example #31
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);

                if (Core.ML)
                {
                    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]);
                if (Core.ML)
                {
                    BuffInfo.RemoveBuff(target, BuffIcon.Protection);
                }
            }
        }
Example #32
0
 public void UpdateMobile(Mobile m)
 {
     if (Core.AOS)
     {
         if (ReistanceMod != null)
         {
             m.RemoveResistanceMod(ReistanceMod);
         }
         ReistanceMod = new ResistanceMod(ResistanceType.Poison, Level * 5);
         m.AddResistanceMod(ReistanceMod);
     }
 }
Example #33
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.
             */

            if (m_Table.TryGetValue(target, out var mods))
            {
                target.PlaySound(0x1ED);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

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

                target.RemoveResistanceMod(mods.Item1);
                target.RemoveSkillMod(mods.Item2);

                BuffInfo.RemoveBuff(target, BuffIcon.Protection);
            }
            else
            {
                target.PlaySound(0x1E9);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                mods = new Tuple <ResistanceMod, DefaultSkillMod>(
                    new ResistanceMod(
                        ResistanceType.Physical,
                        -15 + Math.Min((int)(caster.Skills.Inscribe.Value / 20), 15)
                        ),
                    new DefaultSkillMod(
                        SkillName.MagicResist,
                        true,
                        -35 + Math.Min((int)(caster.Skills.Inscribe.Value / 20), 35)
                        )
                    );

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

                target.AddResistanceMod(mods.Item1);
                target.AddSkillMod(mods.Item2);

                var physloss   = -15 + (int)(caster.Skills.Inscribe.Value / 20);
                var resistloss = -35 + (int)(caster.Skills.Inscribe.Value / 20);
                var args       = $"{physloss}\t{resistloss}";
                BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args));
            }
        }
Example #34
0
 public override bool OnEquip(Mobile from)
 {
     if (!Core.AOS)
     {
         from.VirtualArmor += 2;
     }
     else
     {
         from.AddResistanceMod(new ResistanceMod(ResistanceType.Physical, 2));
     }
     return(true);
 }
        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 #36
0
        public static void CursePlayer(Mobile m)
        {
            if (IsCursed(m))
            {
                return;
            }

            if (!UnEquipPlayer(m))
            {
                return;
            }

            ExpireTimer timer = (ExpireTimer)m_Table[m];

            if (timer != null)
            {
                timer.DoExpire();
            }
            else
            {
                m.SendMessage("You feel yourself transform into a cursed pirate");
            }

            Effects.SendLocationEffect(m.Location, m.Map, 0x3709, 28, 10, 0x1D3, 5);

            TimeSpan duration = TimeSpan.FromSeconds(240.0);

            ResistanceMod[] mods = new ResistanceMod[4]
            {
                new ResistanceMod(ResistanceType.Fire, -10),
                new ResistanceMod(ResistanceType.Poison, -10),
                new ResistanceMod(ResistanceType.Cold, +10),
                new ResistanceMod(ResistanceType.Physical, +10)
            };

            timer = new ExpireTimer(m, mods, duration);
            timer.Start();

            m_Table[m] = timer;

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

            m.ApplyPoison(m, Poison.Greater);

            m.Criminal = true;
        }
Example #37
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 #38
0
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if ( Utility.RandomDouble() < 0.1 )
			{
				ExpireTimer timer;

				if ( m_Table.TryGetValue( defender, out timer ) )
					timer.DoExpire();

				defender.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
				defender.PlaySound( 0x208 );
				defender.SendLocalizedMessage( 1070833 ); // The creature fans you with fire, reducing your resistance to fire attacks.

				ResistanceMod mod = new ResistanceMod( ResistanceType.Fire, -10 );
				defender.AddResistanceMod( mod );

				m_Table[defender] = timer = new ExpireTimer( defender, mod );
				timer.Start();
			}
		}
Example #39
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                /* Flurry of Twigs
                * Start cliloc: 1070850
                * Effect: Physical resistance -15% for 5 seconds
                * End cliloc: 1070852
                * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                */
                ExpireTimer timer = (ExpireTimer)m_FlurryOfTwigsTable[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070851); // The creature lands another blow in your weakened state.
                }
                else
                    defender.SendLocalizedMessage(1070850); // The creature's flurry of twigs has made you more susceptible to physical attacks!

                int effect = -(defender.PhysicalResistance * 15 / 100);

                ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, effect);

                defender.FixedEffect(0x37B9, 10, 5);
                defender.AddResistanceMod(mod);

                timer = new ExpireTimer(defender, mod, m_FlurryOfTwigsTable, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_FlurryOfTwigsTable[defender] = timer;
            }
            else if (0.05 > Utility.RandomDouble())
            {
                /* Chlorophyl Blast
                * Start cliloc: 1070827
                * Effect: Energy resistance -50% for 10 seconds
                * End cliloc: 1070829
                * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                */
                ExpireTimer timer = (ExpireTimer)m_ChlorophylBlastTable[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070828); // The creature continues to hinder your energy resistance!
                }
                else
                    defender.SendLocalizedMessage(1070827); // The creature's attack has made you more susceptible to energy attacks!

                int effect = -(defender.EnergyResistance / 2);

                ResistanceMod mod = new ResistanceMod(ResistanceType.Energy, effect);

                defender.FixedEffect(0x37B9, 10, 5);
                defender.AddResistanceMod(mod);

                timer = new ExpireTimer(defender, mod, m_ChlorophylBlastTable, TimeSpan.FromSeconds(10.0));
                timer.Start();
                m_ChlorophylBlastTable[defender] = timer;
            }
        }
Example #40
0
		public static void MustardBomb( Mobile from, Mobile to )
		{
			if ( !Ability.CanUse( to, from, true ) )
				return;

			Point3D point = to.Location;

			for( int i = -3; i < 4; i++ )
			{
				for( int j = -3; j < 4; j++ )
				{
					point = new Point3D( to.X + i, to.Y + j, to.Z );

					if ( BlueSpell.GetDist( point, to.Location ) < 3.1 )
						Effects.SendLocationEffect( point,to.Map, 0x3728, 13, 1283/*Hue*/, 4 );
				}
			}

			ResistanceMod[] mods = new ResistanceMod[]{ new ResistanceMod( ResistanceType.Fire, -300 ), 
					new ResistanceMod( ResistanceType.Cold, -300 ) };

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

			TimedResistanceMod.AddMod( 
				to, 
				"Mustard Bomb", 
				mods, 
				TimeSpan.FromSeconds( 60 )
			);

			to.AddSkillMod( new TimedSkillMod( SkillName.MagicResist, true, -120.0, TimeSpan.FromSeconds( 60 ) ) );

			to.SendMessage( "The intense heat scalds your elemental resistance." );
		}
		public void DoCorruption( Mobile defender )
		{
			if ( defender == null )
				return;

			/* Rune Corruption
			 * Start cliloc: 1070846 "The creature magically corrupts your armor!"
			 * Effect: All resistances -70 (lowest 0) for 5 seconds
			 * End ASCII: "The corruption of your armor has worn off"
			 */

			ExpireTimer timer = (ExpireTimer)m_Table[defender];

			if ( timer != null )
			{
				timer.DoExpire();
				defender.SendLocalizedMessage( 1070845 ); // The creature continues to corrupt your armor!
			}
			else
				defender.SendLocalizedMessage( 1070846 ); // The creature magically corrupts your armor!

			List<ResistanceMod> mods = new List<ResistanceMod>();

			if ( defender.PhysicalResistance > 0 )
				mods.Add( new ResistanceMod( ResistanceType.Physical, -120 ) );

			if ( defender.FireResistance > 0 )
				mods.Add( new ResistanceMod( ResistanceType.Fire, -120 ) );

			if ( defender.ColdResistance > 0 )
				mods.Add( new ResistanceMod( ResistanceType.Cold, -120 ) );

			if ( defender.PoisonResistance > 0 )
				mods.Add( new ResistanceMod( ResistanceType.Poison, -120 ) );

			if ( defender.EnergyResistance > 0 )
				mods.Add( new ResistanceMod( ResistanceType.Energy, -120 ) );

			for ( int i = 0; i < mods.Count; ++i )
					defender.AddResistanceMod( mods[i] );

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

			timer = new ExpireTimer( defender, mods, TimeSpan.FromSeconds( 25.0 ) );
			timer.Start();
			m_Table[defender] = timer;
		}
Example #42
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (!this.IsFanned(defender) && 0.05 > Utility.RandomDouble())
            {
                /* Fanning Fire
                * Graphic: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x3709" ItemIdName: "fire column" FromLocation: "(994 325, 16)" ToLocation: "(994 325, 16)" Speed: "10" Duration: "30" FixedDirection: "True" Explode: "False" Hue: "0x0" RenderMode: "0x0" Effect: "0x34" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x57D4F5B" Layer: "5" Unknown: "0x0"
                * Sound: 0x208
                * Start cliloc: 1070833
                * Effect: Fire res -10% for 10 seconds
                * Damage: 35-45, 100% fire
                * End cliloc: 1070834
                * Effect does not stack
                */
                defender.SendLocalizedMessage(1070833); // The creature fans you with fire, reducing your resistance to fire attacks.

                int effect = -(defender.FireResistance / 10);

                ResistanceMod mod = new ResistanceMod(ResistanceType.Fire, effect);

                defender.FixedParticles(0x37B9, 10, 30, 0x34, EffectLayer.RightFoot);
                defender.PlaySound(0x208);

                // This should be done in place of the normal attack damage.
                //AOS.Damage( defender, this, Utility.RandomMinMax( 35, 45 ), 0, 100, 0, 0, 0 );

                defender.AddResistanceMod(mod);
		
                ExpireTimer timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(10.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Example #43
0
		public override void SpellEffect( Mobile target )
		{
			if ( target == Caster )
				return;

			target.SendMessage( "You breath in a noxious gas" );

			// Done primarly to draw aggro.
			SpellHelper.Damage( this, target, GetDamage( Caster, target, DamageSkill, 0.5 ), 0, 0, 100, 0, 0 );

			if ( target == null )
				return;

			int dc = 10 + (int)ScaleBySkill( Caster, DamageSkill );
			int debuff = (int)( ScaleBySkill( Caster, DamageSkill ) / 2 );
			debuff = -debuff;
			bool totalfail = true;

			StringBuilder sb = new StringBuilder();
			sb.Append( "You see " );
			sb.Append( target.Name );
			sb.Append( " suffer penalties to:" );

			if ( FullPower() )
				dc += 120;

			if ( !SavingThrow( target, DDSave.Will, dc ) )
			{
				Slow.SlowWalk( target, dc*2 );
				target.SendMessage( "You have been slowed" );
				sb.Append (" Speed" );
				totalfail = false;
			}

			if ( !SavingThrow( target, DDSave.Fort, dc ) )
			{
				target.AddSkillMod( new TimedSkillMod( SkillName.Tactics, true, debuff, TimeSpan.FromSeconds( dc*2 ) ) );
				target.AddStatMod( new StatMod( StatType.Str, "Bad Breath Str", debuff, TimeSpan.FromSeconds( dc*2 ) ) );
				target.AddStatMod( new StatMod( StatType.Dex, "Bad Breath Dex", debuff, TimeSpan.FromSeconds( dc*2 ) ) );
				target.AddStatMod( new StatMod( StatType.Int, "Bad Breath Int", debuff, TimeSpan.FromSeconds( dc*2 ) ) );
				sb.Append( " Tactics" );
				totalfail = false;

				if ( dc > 120 )
					target.AddSkillMod( new TimedSkillMod( SkillName.MagicResist, true, debuff, TimeSpan.FromSeconds( dc*2 ) ) );
			}

			if ( !SavingThrow( target, DDSave.Refl, dc ) )
			{
				ResistanceMod[] mods =
				{
					new ResistanceMod( ResistanceType.Physical, debuff ),
					new ResistanceMod( ResistanceType.Fire, debuff ),
					new ResistanceMod( ResistanceType.Cold, debuff ),
					new ResistanceMod( ResistanceType.Poison, debuff ),
					new ResistanceMod( ResistanceType.Energy, debuff )
				};

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

				TimedResistanceMod.AddMod( target, "Bad Breath", mods, TimeSpan.FromSeconds( Caster.Skills[DamageSkill].Value ) );
				sb.Append( " Resistance" );
				totalfail = false;
			}

			if ( dc > 120 )
			{
				target.ApplyPoison( Caster, Poison.Greater );
			}

			if ( totalfail )
				Caster.SendMessage( target.Name + " saved against your spell." );
			else
				Caster.SendMessage( sb.ToString() );
		}
Example #44
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                /* Grasping Claw
                * Start cliloc: 1070836
                * Effect: Physical resistance -15% for 5 seconds
                * End cliloc: 1070838
                * Effect: Type: "3" - From: "0x57D4F5B" (player) - To: "0x0" - ItemId: "0x37B9" - ItemIdName: "glow" - FromLocation: "(1149 808, 32)" - ToLocation: "(1149 808, 32)" - Speed: "10" - Duration: "5" - FixedDirection: "True" - Explode: "False"
                */
                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070837); // The creature lands another blow in your weakened state.
                }
                else
                    defender.SendLocalizedMessage(1070836); // The blow from the creature's claws has made you more susceptible to physical attacks.

                int effect = -(defender.PhysicalResistance * 15 / 100);

                ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, effect);

                defender.FixedEffect(0x37B9, 10, 5);
                defender.AddResistanceMod(mod);

                timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Example #45
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.05 > Utility.RandomDouble())
            {
                /* Rune Corruption
                * Start cliloc: 1070846 "The creature magically corrupts your armor!"
                * Effect: All resistances -70 (lowest 0) for 5 seconds
                * End ASCII: "The corruption of your armor has worn off"
                */
                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070845); // The creature continues to corrupt your armor!
                }
                else
                    defender.SendLocalizedMessage(1070846); // The creature magically corrupts your armor!

                List<ResistanceMod> mods = new List<ResistanceMod>();

                if (Core.ML)
                {
                    if (defender.PhysicalResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Physical, -(defender.PhysicalResistance / 2)));

                    if (defender.FireResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Fire, -(defender.FireResistance / 2)));

                    if (defender.ColdResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Cold, -(defender.ColdResistance / 2)));

                    if (defender.PoisonResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Poison, -(defender.PoisonResistance / 2)));

                    if (defender.EnergyResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Energy, -(defender.EnergyResistance / 2)));
                }
                else
                {
                    if (defender.PhysicalResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Physical, (defender.PhysicalResistance > 70) ? -70 : -defender.PhysicalResistance));

                    if (defender.FireResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Fire, (defender.FireResistance > 70) ? -70 : -defender.FireResistance));

                    if (defender.ColdResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Cold, (defender.ColdResistance > 70) ? -70 : -defender.ColdResistance));

                    if (defender.PoisonResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Poison, (defender.PoisonResistance > 70) ? -70 : -defender.PoisonResistance));

                    if (defender.EnergyResistance > 0)
                        mods.Add(new ResistanceMod(ResistanceType.Energy, (defender.EnergyResistance > 70) ? -70 : -defender.EnergyResistance));
                }

                for (int i = 0; i < mods.Count; ++i)
                    defender.AddResistanceMod(mods[i]);

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

                timer = new ExpireTimer(defender, mods, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Example #46
0
        private static void ApplyMods( Mobile m, List<object> mods )
        {
            for ( int i = 0; i < mods.Count; i++ )
            {
                object mod = mods[i];

                if ( mod is AttributeMod )
                    m.AddAttributeMod( (AttributeMod) mod );
                else if ( mod is ResistanceMod )
                    m.AddResistanceMod( (ResistanceMod) mod );
            }
        }
Example #47
0
        public static bool OnCast(Mobile caster, Spell spell)
        {
            ITransformationSpell transformSpell = spell as ITransformationSpell;

            if (transformSpell == null)
                return false;

            if (Factions.Sigil.ExistsOn(caster))
            {
                caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            else if (!caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
            }
            else if (DisguiseTimers.IsDisguised(caster))
            {
                caster.SendLocalizedMessage(1061631); // You can't do that while disguised.
                return false;
            }
            else if (AnimalForm.UnderTransformation(caster))
            {
                caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
            }
            else if (!caster.CanBeginAction(typeof(IncognitoSpell)) || (caster.IsBodyMod && GetContext(caster) == null))
            {
                spell.DoFizzle();
            }
            else if (spell.CheckSequence())
            {
                TransformContext context = GetContext(caster);
                Type ourType = spell.GetType();

                bool wasTransformed = (context != null);
                bool ourTransform = (wasTransformed && context.Type == ourType);

                if (wasTransformed)
                {
                    RemoveContext(caster, context, ourTransform);

                    if (ourTransform)
                    {
                        caster.PlaySound(0xFA);
                        caster.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist);
                    }
                }

                if (!ourTransform)
                {
                    List<ResistanceMod> mods = new List<ResistanceMod>();

                    if (transformSpell.PhysResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Physical, transformSpell.PhysResistOffset));

                    if (transformSpell.FireResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Fire, transformSpell.FireResistOffset));

                    if (transformSpell.ColdResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Cold, transformSpell.ColdResistOffset));

                    if (transformSpell.PoisResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Poison, transformSpell.PoisResistOffset));

                    if (transformSpell.NrgyResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Energy, transformSpell.NrgyResistOffset));

                    if (!((Body)transformSpell.Body).IsHuman)
                    {
                        Mobiles.IMount mt = caster.Mount;

                        if (mt != null)
                            mt.Rider = null;
                    }

                    caster.BodyMod = transformSpell.Body;
                    caster.HueMod = transformSpell.Hue;

                    for (int i = 0; i < mods.Count; ++i)
                        caster.AddResistanceMod(mods[i]);

                    transformSpell.DoEffect(caster);

                    Timer timer = new TransformTimer(caster, transformSpell);
                    timer.Start();

                    AddContext(caster, new TransformContext(timer, mods, ourType, transformSpell));
                    return true;
                }
            }

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

                m.AddResistanceMod( (ResistanceMod) mod );
            }
        }