Exemplo n.º 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();
		}
Exemplo n.º 2
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);

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

                timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(5.0));
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Exemplo n.º 3
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            // TODO: Taken from "Lady of the snow". Check real ability at OSI.

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

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070831);                       // The freezing wind continues to blow!
                }
                else
                {
                    defender.SendLocalizedMessage(1070832);                       // An icy wind surrounds you, freezing your lungs as you breathe!
                }
                timer = new ExpireTimer(defender, this);
                timer.Start();

                m_Table[defender] = timer;
            }
        }
Exemplo n.º 4
0
        public static void RemoveTimer(Mobile m)
        {
            if (m == null)
            {
                return;
            }

            var contains = Contains(m);

            if (contains != null)
            {
                ExpireTimer t = contains.Timer;

                if (t != null)
                {
                    t.Stop();
                    Table.Remove(contains);

                    if (((PlayerMobile)m).AcceleratedStart > DateTime.UtcNow)
                    {
                        ((PlayerMobile)m).AcceleratedStart = DateTime.UtcNow;
                    }

                    m.PlaySound(0x100);
                    BuffInfo.RemoveBuff(m, BuffIcon.ArcaneEmpowerment);
                    m.SendLocalizedMessage(1077957);// The intense energy dissipates. You are no longer under the effects of an accelerated skillgain scroll.
                }
            }
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
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;
            }
        }
Exemplo n.º 7
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

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

            if (m_Table.TryGetValue(defender, out ExpireTimer 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();
        }
Exemplo n.º 8
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();
        }
Exemplo n.º 9
0
        public override void DoEffects(BaseCreature creature, Mobile defender, ref int damage)
        {
            ExpireTimer timer = null;

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

            if (_Table.ContainsKey(defender))
            {
                timer = _Table[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, TimeSpan.FromSeconds(10.0));
            timer.Start();
            _Table[defender] = timer;
        }
Exemplo n.º 10
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.5 > Utility.RandomDouble())
            {
                /* Blood Bath
                 * Start cliloc 1070826
                 * Sound: 0x52B
                 * 2-3 blood spots
                 * Damage: 2 hps per second for 10 seconds
                 * End cliloc: 1070824
                 */

                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendMessage("The parrot continues inflicting bleeding damage!");
                }
                else
                {
                    defender.SendMessage("The parrot goes into a rage, inflicting continuous bleeding damage!");
                }

                timer = new ExpireTimer(defender, this);
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Exemplo n.º 11
0
		public override void OnCast()
		{
			if( CheckSequence() )
			{
				Caster.PlaySound( 0x5C3 );
				Caster.FixedParticles( 0x3728, 1, 13, 0x26B8, 0x455, 7, EffectLayer.Waist );
				Caster.FixedParticles( 0x3779, 1, 15, 0x251E, 0x3F, 7, EffectLayer.Waist );

				double skill = Caster.Skills[SkillName.Spellweaving].Value;

				int damageAbsorb = (int)(18 + ((skill-10)/10)*3 + (FocusLevel * 6));
				Caster.MeleeDamageAbsorb = damageAbsorb;

				TimeSpan duration = TimeSpan.FromSeconds( 60 + (FocusLevel * 12) );

				ExpireTimer t = new ExpireTimer( Caster, duration );
				t.Start();

				m_Table[Caster] = t;

				Caster.BeginAction( typeof( AttuneWeaponSpell ) );

				BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.AttuneWeapon, 1075798, duration, Caster, damageAbsorb.ToString() ) );
			}

			FinishSequence();
		}
Exemplo n.º 12
0
        public override void DoEffects(BaseCreature creature, Mobile defender, ref int damage)
        {
            if (_Table == null)
            {
                _Table = new Dictionary <Mobile, ExpireTimer>();
            }

            ExpireTimer timer = null;

            if (_Table.ContainsKey(defender))
            {
                timer = _Table[defender];
            }

            if (timer != null)
            {
                timer.DoExpire();
            }

            defender.SendLocalizedMessage(1070833); // The creature fans you with fire, reducing your resistance to fire attacks.

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

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

            Effects.SendLocationParticles(defender, 0x3709, 10, 30, 5052);
            Effects.PlaySound(defender.Location, defender.Map, 0x208);

            timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(5.0));
            timer.Start();

            _Table[defender] = timer;
        }
Exemplo n.º 13
0
        public static void StartTimer(Mobile m)
        {
            if (m == null)
            {
                return;
            }

            var contains = Contains(m);

            if (contains != null)
            {
                ExpireTimer t = contains.Timer;

                if (t != null)
                {
                    t.Start();

                    m.SendLocalizedMessage(1077956); // You are infused with intense energy. You are under the effects of an accelerated skillgain scroll.

                    m.PlaySound(0x0FF);

                    ((PlayerMobile)m).AcceleratedStart = DateTime.UtcNow + TimeSpan.FromSeconds(t.Tick);
                    ((PlayerMobile)m).AcceleratedSkill = contains.Skill;

                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.ArcaneEmpowerment, 1078511, 1078512, TimeSpan.FromSeconds(t.Tick), m, SkillInfo.Table[(int)contains.Skill].Name));
                }
            }
            else
            {
                if (((PlayerMobile)m).AcceleratedStart > DateTime.UtcNow)
                {
                    ((PlayerMobile)m).AcceleratedStart = DateTime.UtcNow;
                }
            }
        }
Exemplo n.º 14
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                /* Blood Bath
                 * Start cliloc 1070826
                 * Sound: 0x52B
                 * 2-3 blood spots
                 * Damage: 2 hps per second for 5 seconds
                 * End cliloc: 1070824
                 */

                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070825); // The creature continues to rage!
                }
                else
                {
                    defender.SendLocalizedMessage(1070826); // The creature goes into a rage, inflicting heavy damage!
                }
                timer = new ExpireTimer(defender, this);
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Exemplo n.º 15
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
            {
                return;
            }

            if (attacker.Map == null || attacker.Map == Map.Internal)
            {
                return;
            }

            ExpireTimer timer = null;

            if (m_Table.ContainsKey(defender))
            {
                timer = m_Table[defender];
            }

            if (timer != null)
            {
                timer.DoExpire();
                defender.SendLocalizedMessage(1070831); // The freezing wind continues to blow!
            }
            else
            {
                defender.SendLocalizedMessage(1070832); // An icy wind surrounds you, freezing your lungs as you breathe!
            }
            timer = new ExpireTimer(defender, attacker);
            timer.Start();
            m_Table[defender] = timer;
        }
Exemplo n.º 16
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;
			}
		}
Exemplo n.º 17
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 <= Utility.RandomDouble() || m_Table.Contains(defender))
            {
                return;
            }

            /* Lightning Fist
             * Cliloc: 1070839
             * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(884 715, 10)" ToLocation: "(884 715, 10)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
             * Damage: 35-65, 100% energy, resistable
             * Freezes for 4 seconds
             * Effect cannot stack
             */

            defender.FixedEffect(0x37B9, 10, 5);
            defender.SendLocalizedMessage(1070839); // The creature attacks with stunning force!

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

            defender.Frozen = true;

            ExpireTimer timer = new ExpireTimer(defender, TimeSpan.FromSeconds(4.0));

            timer.Start();
            m_Table.Add(defender);
        }
Exemplo n.º 18
0
        // TODO: Snowball
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                /* Cold Wind
                 * Graphics: Message - Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(928 164, 34)" ToLocation: "(928 164, 34)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                 * Start cliloc: 1070832
                 * Damage: 1hp per second for 5 seconds
                 * End cliloc: 1070830
                 * Reset cliloc: 1070831
                 */
                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if (timer != null)
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage(1070831); // The freezing wind continues to blow!
                }
                else
                {
                    defender.SendLocalizedMessage(1070832); // An icy wind surrounds you, freezing your lungs as you breathe!
                }
                timer = new ExpireTimer(defender, this);
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Exemplo n.º 19
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.SendMessage("The spiders fangs pour more venom into your already weakend body.");
                }
                else
                {
                    defender.SendMessage("The spider sinks it's fangs into your flesh, releasing it's toxic venom!");
                }

                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;
            }
        }
Exemplo n.º 20
0
        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, 0x480, 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 ice resistance has decreased.");
                ResistanceMod mod1 = new ResistanceMod(ResistanceType.Cold, -amount);

                m.AddResistanceMod(mod1);

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

            FinishSequence();
        }
Exemplo n.º 21
0
        public override void OnCast()
        {
            BaseWeapon weapon = Caster.Weapon as BaseWeapon;

            if (weapon == null || weapon is Fists /* || weapon is CreatureFists*/)
            {
                Caster.SendLocalizedMessage(501078);                   // You must be holding a weapon.
            }
            else if (CheckSequence())
            {
                Caster.PlaySound(0x387);
                Effects.SendTargetParticles(Caster, 0x3779, 1, 15, 9905, 32, 2, EffectLayer.Head);
                Effects.SendTargetParticles(Caster, 0x37B9, 1, 14, 9502, 32, 5, (EffectLayer)255);
                new SoundEffectTimer(Caster).Start();

                double duration = 180;

                duration *= Spell.GetSpellScaling(Caster, Info.skillForCasting);

                Timer t = (Timer)m_Table[weapon];

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

                m_Table[weapon] = t = new ExpireTimer(weapon, TimeSpan.FromSeconds(duration));

                t.Start();
            }

            FinishSequence();
        }
Exemplo n.º 22
0
        public override void DoEffects(BaseCreature creature, Mobile defender, ref int damage)
        {
            if (_Table == null)
            {
                _Table = new Dictionary <Mobile, ExpireTimer>();
            }

            ExpireTimer timer = null;

            if (_Table.ContainsKey(defender))
            {
                timer = _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.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
            defender.AddResistanceMod(mod);

            timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(5.0));
            timer.Start();

            _Table[defender] = timer;
        }
Exemplo n.º 23
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);
        }
Exemplo n.º 24
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.

                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;
            }
        }
Exemplo n.º 25
0
        public override void DoEffects(BaseCreature creature, Mobile defender, ref int damage)
        {
            ExpireTimer timer = null;

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

            if (_Table.ContainsKey(defender))
            {
                timer = _Table[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, TimeSpan.FromSeconds(10.0));
            timer.Start();
            _Table[defender] = timer;
        }
Exemplo n.º 26
0
        public override void DoEffects(BaseCreature creature, Mobile defender, ref int damage)
        {
            if (_Table == null)
            {
                _Table = new Dictionary <Mobile, ExpireTimer>();
            }

            ExpireTimer timer = null;

            if (_Table.ContainsKey(defender))
            {
                timer = _Table[defender];
            }

            if (timer != null)
            {
                timer.DoExpire();
                defender.SendLocalizedMessage(1070825); // The creature continues to rage!
            }
            else
            {
                defender.SendLocalizedMessage(1070826); // The creature goes into a rage, inflicting heavy damage!
            }
            timer = new ExpireTimer(defender, creature);
            timer.Start();
            _Table[defender] = timer;
        }
Exemplo n.º 27
0
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if ( 0.1 > Utility.RandomDouble() && !IsStunned( defender ) )
			{
				/* Lightning Fist
				 * Cliloc: 1070839
				 * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(884 715, 10)" ToLocation: "(884 715, 10)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
				 * Damage: 35-65, 100% energy, resistable
				 * Freezes for 4 seconds
				 * Effect cannot stack
				 */

				defender.FixedEffect( 0x37B9, 10, 5 );
				defender.SendLocalizedMessage( 1070839 ); // The creature attacks with stunning force!
 
				// This should be done in place of the normal attack damage.
				//AOS.Damage( defender, this, Utility.RandomMinMax( 35, 65 ), 0, 0, 0, 0, 100 );

				defender.Frozen = true; 

				ExpireTimer timer = new ExpireTimer( defender, TimeSpan.FromSeconds( 4.0 ) );
				timer.Start();
				m_Table[defender] = timer;
			}
		}
Exemplo n.º 28
0
		public void Target( Mobile m )
		{
			if ( Caster == m || !(m is PlayerMobile || m is BaseCreature) ) // only PlayerMobile and BaseCreature implement blood oath checking
			{
				Caster.SendLocalizedMessage( 1060508 ); // You can't curse that.
			}
			else if ( m_OathTable.Contains( Caster ) )
			{
				Caster.SendLocalizedMessage( 1061607 ); // You are already bonded in a Blood Oath.
			}
			else if ( m_OathTable.Contains( m ) )
			{
				if ( m.Player )
					Caster.SendLocalizedMessage( 1061608 ); // That player is already bonded in a Blood Oath.
				else
					Caster.SendLocalizedMessage( 1061609 ); // That creature is already bonded in a Blood Oath.
			}
			else if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Temporarily creates a dark pact between the caster and the target.
				 * Any damage dealt by the target to the caster is increased, but the target receives the same amount of damage.
				 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 80 ) + 8 seconds.
				 * 
				 * NOTE: The above algorithm must be fixed point, it should be:
				 * ((ss-rm)/8)+8
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[m];
				if ( timer != null )
				timer.DoExpire();

				m_OathTable[Caster] = Caster;
				m_OathTable[m] = Caster;

				Caster.PlaySound( 0x175 );

				Caster.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
				Caster.FixedParticles( 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255 );

				m.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
				m.FixedParticles( 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255 );

				TimeSpan duration = TimeSpan.FromSeconds( ((GetDamageSkill( Caster ) - GetResistSkill( m )) / 8) + 8 );
				m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );	//Skill check for gain

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

				BuffInfo.AddBuff ( Caster, new BuffInfo ( BuffIcon.BloodOathCaster, 1075659, duration, Caster, m.Name.ToString () ) );
				BuffInfo.AddBuff ( m, new BuffInfo ( BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name.ToString () ) );

				m_Table[m] = timer;

			}

			FinishSequence();
		}
Exemplo n.º 29
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();
        }
Exemplo n.º 30
0
        public void Target(Mobile m)
        {
            if (Caster == m || !(m is PlayerMobile || m is BaseCreature)) // only PlayerMobile and BaseCreature implement blood oath checking
            {
                Caster.SendLocalizedMessage(1060508);                     // You can't curse that.
            }
            else if (m_OathTable.Contains(Caster))
            {
                Caster.SendLocalizedMessage(1061607);                   // You are already bonded in a Blood Oath.
            }
            else if (m_OathTable.Contains(m))
            {
                if (m.Player)
                {
                    Caster.SendLocalizedMessage(1061608);                       // That player is already bonded in a Blood Oath.
                }
                else
                {
                    Caster.SendLocalizedMessage(1061609);                       // That creature is already bonded in a Blood Oath.
                }
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Temporarily creates a dark pact between the caster and the target.
                 * Any damage dealt by the target to the caster is increased, but the target receives the same amount of damage.
                 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 80 ) + 8 seconds.
                 *
                 * NOTE: The above algorithm must be fixed point, it should be:
                 * ((ss-rm)/8)+8
                 */

                m_OathTable[Caster] = Caster;
                m_OathTable[m]      = Caster;

                Caster.PlaySound(0x175);

                Caster.FixedParticles(0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist);
                Caster.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);

                m.FixedParticles(0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist);
                m.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);

                TimeSpan duration = TimeSpan.FromSeconds(((GetDamageSkill(Caster) - GetResistSkill(m)) / 8) + 8);

                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.BloodOathCaster, 1075659, duration, Caster, String.Format("{0}", m.Name)));
                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.BloodOathCurse, 1075661, duration, m, String.Format("{0}", Caster.Name)));

                Timer t = new ExpireTimer(Caster, m, duration);
                m_TimerTable[m]      = t;
                m_TimerTable[Caster] = t;

                t.Start();
            }

            FinishSequence();
        }
Exemplo n.º 31
0
        public void Target(Mobile m)
        {
            if (this.Caster == m || !(m is PlayerMobile || m is BaseCreature)) // only PlayerMobile and BaseCreature implement blood oath checking
            {
                this.Caster.SendLocalizedMessage(1080194);                     // You can't curse that.
            }
            else if (m_PlagueTable.Contains(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1061607); // You are already bonded in a Blood Oath.
            }
            else if (m_PlagueTable.Contains(m))
            {
                this.Caster.SendLocalizedMessage(1080195); // That player is already bonded in a Blood Oath. // That creature is already bonded in a Blood Oath.
            }
            else if (this.CheckHSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

                /* Temporarily creates a dark pact between the caster and the target.
                 * Any damage dealt by the target to the caster is increased, but the target receives the same amount of damage.
                 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 80 ) + 8 seconds.
                 *
                 * NOTE: The above algorithm must be fixed point, it should be:
                 * ((ss-rm)/8)+8
                 */

                ExpireTimer timer = (ExpireTimer)m_Table[m];
                if (timer != null)
                {
                    timer.DoExpire();
                }

                m_PlagueTable[this.Caster] = this.Caster;
                m_PlagueTable[m]           = this.Caster;

                this.Caster.PlaySound(0x659);

                this.Caster.FixedParticles(0x375A, 1, 17, 9919, 1161, 7, EffectLayer.Waist);
                this.Caster.FixedParticles(0x3728, 1, 13, 9502, 1161, 7, (EffectLayer)255);

                m.FixedParticles(0x375A, 1, 17, 9919, 1161, 7, EffectLayer.Waist);
                m.FixedParticles(0x3728, 1, 13, 9502, 1161, 7, (EffectLayer)255);

                TimeSpan duration = TimeSpan.FromSeconds(((this.GetDamageSkill(this.Caster) - this.GetResistSkill(m)) / 8) + 8);
                m.CheckSkill(SkillName.MagicResist, 0.0, 120.0);        //Skill check for gain

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

                BuffInfo.AddBuff(this.Caster, new BuffInfo(BuffIcon.SpellPlague, 1075659, duration, this.Caster, m.Name.ToString()));
                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.SpellPlague, 1075661, duration, m, this.Caster.Name.ToString()));

                m_Table[m] = timer;
            }

            this.FinishSequence();
        }
Exemplo n.º 32
0
            public void OnExpired()
            {
                ExpireTimer.Stop();

                Owner.SendLocalizedMessage(1112822); // You fail to find the next ingredient in time. Your clockwork assembly crumbles.

                Mechanism.Delete();
                m_Table.Remove(Owner);
            }
Exemplo n.º 33
0
			public EssenceOfWindInfo( Mobile defender, int fcMalus, int ssiMalus, TimeSpan duration )
			{
				m_Defender = defender;
				m_FCMalus = fcMalus;
				m_SSIMalus = ssiMalus;

				m_Timer = new ExpireTimer( m_Defender, duration );
				m_Timer.Start();
			}
Exemplo n.º 34
0
 public void Dispose()
 {
     if (ExpireTimer != null)
     {
         ExpireTimer.Dispose();
     }
     ExpireTimer = null;
     GC.SuppressFinalize(this);
 }
Exemplo n.º 35
0
            public EssenceOfWindInfo(Mobile defender, int fcMalus, int ssiMalus, TimeSpan duration)
            {
                m_Defender = defender;
                m_FCMalus  = fcMalus;
                m_SSIMalus = ssiMalus;

                m_Timer = new ExpireTimer(m_Defender, duration);
                m_Timer.Start();
            }
		public override void OnCast()
		{
			BaseWeapon weapon = Caster.Weapon as BaseWeapon;

			if ( weapon == null || weapon is Fists )
			{
				Caster.SendLocalizedMessage( 501078 ); // You must be holding a weapon.
			}
			else if ( CheckSequence() )
			{
				/* Temporarily enchants the weapon the caster is currently wielding.
				 * The type of damage the weapon inflicts when hitting a target will
				 * be converted to the target's worst Resistance type.
				 * Duration of the effect is affected by the caster's Karma and lasts for 3 to 11 seconds.
				 */

				int itemID, soundID;

				switch ( weapon.Skill )
				{
					case SkillName.Macing: itemID = 0xFB4; soundID = 0x232; break;
					case SkillName.Archery: itemID = 0x13B1; soundID = 0x145; break;
					default: itemID = 0xF5F; soundID = 0x56; break;
				}

				Caster.PlaySound( 0x20C );
				Caster.PlaySound( soundID );
				Caster.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );

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

				double seconds = ComputePowerValue( 20 );

				// TODO: Should caps be applied?
				if ( seconds < 3.0 )
					seconds = 3.0;
				else if ( seconds > 11.0 )
					seconds = 11.0;

				TimeSpan duration = TimeSpan.FromSeconds( seconds );

				Timer t = (Timer)m_Table[weapon];

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

				weapon.Consecrated = true;

				m_Table[weapon] = t = new ExpireTimer( weapon, duration );

				t.Start();
			}

			FinishSequence();
		}
Exemplo n.º 37
0
        public override void OnCast()
        {
            BaseWeapon weapon = Caster.Weapon as BaseWeapon;

            if (weapon == null || weapon is Fists)
            {
                Caster.SendLocalizedMessage(501078); // You must be holding a weapon.
            }
            else if (CheckSequence())
            {
                if (weapon.Enchanted == true)
                {
                    Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                    return;
                }

                if (!Caster.CanBeginAction(typeof(EnchantSpell)))
                {
                    Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                    return;
                }
                else
                {
                    if (Caster.HasGump(typeof(EnchantGump)))
                    {
                        Caster.CloseGump(typeof(EnchantGump));
                    }

                    Caster.SendGump(new EnchantGump());
                    Caster.FixedParticles(0x3779, 1, 15, 9905, 32, 2, EffectLayer.Head);
                    Caster.FixedParticles(0x37B9, 1, 14, 9502, 32, 5, (EffectLayer)255);

                    TimeSpan duration = TimeSpan.FromSeconds((Caster.Skills[SkillName.Mysticism].Value / 3.4) * 4 + 9.0);

                    if (Caster.Skills[SkillName.Mysticism].Value >= 80.0)
                    {
                        weapon.Attributes.SpellChanneling = 1;
                    }


                    Timer t = (Timer)m_Table[weapon];

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

                    weapon.Enchanted = true;

                    m_Table[weapon] = t = new ExpireTimer(weapon, duration);

                    t.Start();
                }

                FinishSequence();
            }
        }
Exemplo n.º 38
0
        public static bool RemoveCurse(Mobile m)
        {
            ExpireTimer t = (ExpireTimer)m_Table[m];

            if (t == null)
                return false;

            t.DoExpire();
            return true;
        }
Exemplo n.º 39
0
		public void Target( Mobile m )
		{
			BaseCreature bc = m as BaseCreature;

			if( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if( m.IsDeadBondedPet || !m.Alive )
			{
				// As per Osi: Nothing happens.
			}
			else if( m != Caster && (bc == null || !bc.IsBonded || bc.ControlMaster != Caster) )
			{
				Caster.SendLocalizedMessage( 1072077 ); // You may only cast this spell on yourself or a bonded pet.
			}
			else if( m_Table.ContainsKey( m ) )
			{
				Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
			}
			else if( CheckBSequence( m ) )
			{
				if( Caster == m )
				{
					Caster.SendLocalizedMessage( 1074774 ); // You weave powerful magic, protecting yourself from death.
				}
				else
				{
					Caster.SendLocalizedMessage( 1074775 ); // You weave powerful magic, protecting your pet from death.
					SpellHelper.Turn( Caster, m );
				}


				m.PlaySound( 0x244 );
				m.FixedParticles( 0x3709, 1, 30, 0x26ED, 5, 2, EffectLayer.Waist );
				m.FixedParticles( 0x376A, 1, 30, 0x251E, 5, 3, EffectLayer.Waist );

				double skill = Caster.Skills[SkillName.Spellweaving].Value;

				TimeSpan duration = TimeSpan.FromMinutes( ((int)(skill / 24))* 2 + FocusLevel );

				ExpireTimer t = new ExpireTimer( m, duration, this );
				t.Start();

				m_Table[m] = t;

				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.GiftOfLife, 1031615, 1075807, duration, m, null, true ) );
			}

			FinishSequence();
		}
Exemplo n.º 40
0
		public override void OnCast()
		{
			BaseWeapon weapon = Caster.Weapon as BaseWeapon;

			if ( weapon == null || weapon is Fists )
			{
				Caster.SendLocalizedMessage( 501078 ); // You must be holding a weapon.
			}
			else if ( CheckSequence() )
			{
				/* Temporarily imbues a weapon with a life draining effect.
				 * Half the damage that the weapon inflicts is added to the necromancer's health.
				 * The effects lasts for (Spirit Speak skill level / 34) + 1 seconds.
				 * 
				 * NOTE: Above algorithm is fixed point, should be :
				 * (Spirit Speak skill level / 3.4) + 1
				 * 
				 * TODO: What happens if you curse a weapon then give it to someone else? Should they get the drain effect?
				 */

				Caster.PlaySound( 0x387 );
				Caster.FixedParticles( 0x3779, 1, 15, 9905, 32, 2, EffectLayer.Head );
				Caster.FixedParticles( 0x37B9, 1, 14, 9502, 32, 5, (EffectLayer)255 );
				new SoundEffectTimer( Caster ).Start();

				TimeSpan duration = TimeSpan.FromSeconds( (Caster.Skills[SkillName.SpiritSpeak].Value / 3.4) + 1.0 );


				Timer t = (Timer)m_Table[weapon];

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

				weapon.Cursed = true;

				m_Table[weapon] = t = new ExpireTimer( weapon, duration );

				t.Start();
			}

			FinishSequence();
		}
Exemplo n.º 41
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();
			}
		}
Exemplo n.º 42
0
        public void Target(Mobile m)
        {
            if (CheckBSequence(m))
            {
                Timer t = m_Table[m] as Timer;
                if (t != null && t.Running)
                {
                    Caster.SendAsciiMessage("This target already has reactive armor.");
                }
                else
                {
                    m.MeleeDamageAbsorb = (int)(10 + Caster.Skills[SkillName.Magery].Value / 4);
                    m.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
                    m.PlaySound(0x1F2);

                    t = new ExpireTimer(m, TimeSpan.FromSeconds(25 + (Caster.Skills[SkillName.Magery].Value / 2.0)));
                    t.Start();

                    m_Table[m] = t;
                }
            }

            FinishSequence();
        }
Exemplo n.º 43
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;
            }
        }
Exemplo n.º 44
0
            public EmpowermentInfo(Mobile caster, TimeSpan duration, int bonus, int focus)
            {
                this.Bonus = bonus;
                this.Focus = focus;

                this.Timer = new ExpireTimer(caster, duration);
                this.Timer.Start();
            }
Exemplo n.º 45
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;
            }
        }
Exemplo n.º 46
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;
            }
        }
Exemplo n.º 47
0
		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;
		}
Exemplo n.º 48
0
            public EmpowermentInfo( Mobile caster, int sdiBonus, double healBonus, int hitsBonus, int dispelBonus, TimeSpan duration )
            {
                m_Caster = caster;
                m_SDIBonus = sdiBonus;
                m_HealBonus = healBonus;
                m_HitsBonus = hitsBonus;
                m_DispelBonus = dispelBonus;

                m_Timer = new ExpireTimer( m_Caster, duration );
                m_Timer.Start();
            }
Exemplo n.º 49
0
        public PlayerVendorPlaceholder(PlayerVendor vendor)
            : base(0x1F28)
        {
            Hue = 0x672;
            Movable = false;

            m_Vendor = vendor;

            m_Timer = new ExpireTimer(this);
            m_Timer.Start();
        }
Exemplo n.º 50
0
        // TODO: Snowball
        public override void OnGaveMeleeAttack( Mobile defender )
        {
            base.OnGaveMeleeAttack( defender );

            if( 0.1 > Utility.RandomDouble() )
            {
                /* Cold Wind
                 * Graphics: Message - Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(928 164, 34)" ToLocation: "(928 164, 34)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                 * Start cliloc: 1070832
                 * Damage: 1hp per second for 5 seconds
                 * End cliloc: 1070830
                 * Reset cliloc: 1070831
                 */

                ExpireTimer timer = (ExpireTimer)m_Table[defender];

                if( timer != null )
                {
                    timer.DoExpire();
                    defender.SendLocalizedMessage( 1070831 ); // The freezing wind continues to blow!
                }
                else
                    defender.SendLocalizedMessage( 1070832 ); // An icy wind surrounds you, freezing your lungs as you breathe!

                timer = new ExpireTimer( defender, this );
                timer.Start();
                m_Table[defender] = timer;
            }
        }
Exemplo n.º 51
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;
            }
        }
Exemplo n.º 52
0
        public override void OnCast()
        {
            BaseWeapon weapon = this.Caster.Weapon as BaseWeapon;

            if (weapon == null || weapon is Fists)
            {
                this.Caster.SendLocalizedMessage(501078); // You must be holding a weapon.
            }
            else if (this.CheckSequence())
            {
                /* Temporarily enchants the weapon the caster is currently wielding.
                * The type of damage the weapon inflicts when hitting a target will
                * be converted to the target's worst Resistance type.
                * Duration of the effect is affected by the caster's Karma and lasts for 3 to 11 seconds.
                */
                int itemID, soundID;

                switch ( weapon.Skill )
                {
                    case SkillName.Macing:
                        itemID = 0xFB4;
                        soundID = 0x232;
                        break;
                    case SkillName.Archery:
                        itemID = 0x13B1;
                        soundID = 0x145;
                        break;
                    default:
                        itemID = 0xF5F;
                        soundID = 0x56;
                        break;
                }

                this.Caster.PlaySound(0x20C);
                this.Caster.PlaySound(soundID);
                this.Caster.FixedParticles(0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist);

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

                double seconds = this.ComputePowerValue(20);

                // TODO: Should caps be applied?

                int pkarma = this.Caster.Karma;



                if (pkarma > 5000)
                    seconds = 11.0;
                else if (pkarma >= 4999)
                    seconds = 10.0;
                else if (pkarma >= 3999)
                    seconds = 9.00;
                else if (pkarma >= 2999)
                    seconds = 8.0;
                else if (pkarma >= 1999)
                    seconds = 7.0;
                else if (pkarma >= 999)
                    seconds = 6.0;
                else
                    seconds = 5.0;
                       
           

                TimeSpan duration = TimeSpan.FromSeconds(seconds);

                Timer t = (Timer)m_Table[weapon];

                if (t != null)
                {
                    BuffInfo.RemoveBuff(Caster, BuffIcon.ConsecrateWeapon);
                    t.Stop();
                }


                weapon.ConsecrateDamageBonus = 0;
                weapon.ConsecrateProcChance = 0;

                if (Caster.Skills.Chivalry.Value >= 90)
                {
                    double calc = Caster.Skills.Chivalry.Value - 90;
                    weapon.ConsecrateDamageBonus = ((int)Math.Truncate(calc / 2));
                }

                if (Caster.Skills.Chivalry.Value >= 80)
                    weapon.ConsecrateProcChance = 100;
                else
                    weapon.ConsecrateProcChance = Caster.Skills.Chivalry.Value;

                weapon.Consecrated = true;

                m_Table[weapon] = t = new ExpireTimer(weapon, duration);
                
                
                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ConsecrateWeapon, 1151385, 1151386, duration, Caster, String.Format("{0}\t{1}", weapon.ConsecrateProcChance, weapon.ConsecrateDamageBonus)));

                t.Start();
            }

            this.FinishSequence();
        }
Exemplo n.º 53
0
        public override void OnCast()
        {
            BaseWeapon weapon = Caster.Weapon as BaseWeapon;

            if ( weapon == null || weapon is Fists )
            {
                Caster.SendLocalizedMessage( 501078 ); // You must be holding a weapon.
            }
            else if ( CheckSequence() )
            {
                /* Temporarily enchants the weapon the caster is currently wielding.
                 * The type of damage the weapon inflicts when hitting a target will
                 * be converted to the target's worst Resistance type.
                 * Duration of the effect is affected by the caster's Karma and lasts for 3 to 11 seconds.
                 */

                int itemID, soundID;

                switch ( weapon.Skill )
                {
                    case SkillName.Macing:
                        itemID = 0xFB4;
                        soundID = 0x232;
                        break;
                    case SkillName.Archery:
                        itemID = 0x13B1;
                        soundID = 0x145;
                        break;
                    default:
                        itemID = 0xF5F;
                        soundID = 0x56;
                        break;
                }

                Caster.PlaySound( 0x20C );
                Caster.PlaySound( soundID );
                Caster.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );

                IEntity from = new DummyEntity( Serial.Zero, new Point3D( Caster.X, Caster.Y, Caster.Z ), Caster.Map );
                IEntity to = new DummyEntity( Serial.Zero, new Point3D( Caster.X, Caster.Y, Caster.Z + 50 ), Caster.Map );
                Effects.SendMovingParticles( from, to, itemID, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );

                double seconds = ComputePowerValue( 20 );

                // TODO: Should caps be applied?
                Utility.FixMinMax( ref seconds, 3.0, 11.0 );

                TimeSpan duration = TimeSpan.FromSeconds( seconds );

                if ( m_Table.ContainsKey( Caster ) )
                {
                    Timer t = m_Table[Caster].Timer;

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

                double chivalry = Caster.Skills.Chivalry.Value;

                Timer expireTimer = new ExpireTimer( Caster, duration );
                int procChance = (int) ( ( chivalry - 20.0 ) / 0.6 );
                int bonusDamage = (int) ( ( chivalry - 90.0 ) / 2.0 );

                Utility.FixMinMax( ref procChance, 0, 100 );
                Utility.FixMinMax( ref bonusDamage, 0, 15 );

                BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.ConsecrateWeapon, 1151385, 1151386, duration, Caster, String.Format( "{0}\t{1}", procChance, bonusDamage ) ) );

                ConsecrateContext context = new ConsecrateContext( expireTimer, procChance, bonusDamage );

                m_Table[Caster] = context;

                expireTimer.Start();
            }

            FinishSequence();
        }
Exemplo n.º 54
0
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if( 0.1 > Utility.RandomDouble() )
			{
				/* Blood Bath
				 * Start cliloc 1070826
				 * Sound: 0x52B
				 * 2-3 blood spots
				 * Damage: 2 hps per second for 5 seconds
				 * End cliloc: 1070824
				 */

				ExpireTimer timer = (ExpireTimer)m_Table[defender];

				if( timer != null )
				{
					timer.DoExpire();
					defender.SendLocalizedMessage( 1070825 ); // The creature continues to rage!
				}
				else
					defender.SendLocalizedMessage( 1070826 ); // The creature goes into a rage, inflicting heavy damage!

				timer = new ExpireTimer( defender, this );
				timer.Start();
				m_Table[defender] = timer;
			}
		}
Exemplo n.º 55
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile m = state.Mobile;
           
            BaseWeapon weapon = m.Weapon as BaseWeapon;
            TimeSpan duration = TimeSpan.FromSeconds((m.Skills[SkillName.Mysticism].Value / 1.2) + 1.0);//needs work, just a base formula.

            switch (info.ButtonID)
            {
                case 0:
                    {
                        m.CloseGump(typeof(EnchantGump));
                        break;
                    }
                case 1:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Dispel to your weapon");
                        weapon.WeaponAttributes.HitDispel += 30;
                        m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                        m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
                        if (weapon.Name == null)
                            this.m_Name = weapon.GetType().Name;
                        else
                            this.m_Name = weapon.Name;
                        weapon.Name = this.m_Name + " [Enchanted]";
                        m_Table[weapon] = t = new ExpireTimer(weapon, AosWeaponAttribute.HitDispel, m, duration);
                        t.Start();
                        m.CloseGump(typeof(EnchantGump));
                        EnchantSpell.AddEffects(m, weapon);
                        break;
                    }
                case 2:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Fireball to your weapon");
                        weapon.WeaponAttributes.HitFireball += 30;
                        m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                        m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
                        if (weapon.Name == null)
                            this.m_Name = weapon.GetType().Name;
                        else
                            this.m_Name = weapon.Name;
                        weapon.Name = this.m_Name + " [Enchanted]";
                        m_Table[weapon] = t = new ExpireTimer(weapon, AosWeaponAttribute.HitFireball, m, duration);
                        t.Start();
                        m.CloseGump(typeof(EnchantGump));
                        EnchantSpell.AddEffects(m, weapon);
                        break;
                    }
                case 3:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Harm to your weapon");
                        weapon.WeaponAttributes.HitHarm += 30;
                        m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                        m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
                        if (weapon.Name == null)
                            this.m_Name = weapon.GetType().Name;
                        else
                            this.m_Name = weapon.Name;
                        weapon.Name = this.m_Name + " [Enchanted]";
                        m_Table[weapon] = t = new ExpireTimer(weapon, AosWeaponAttribute.HitHarm, m, duration);
                        t.Start();
                        m.CloseGump(typeof(EnchantGump));
                        EnchantSpell.AddEffects(m, weapon);
                        break;
                    }
                case 4:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Lightning to your weapon");
                        weapon.WeaponAttributes.HitLightning += 30;
                        m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                        m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
                        if (weapon.Name == null)
                            this.m_Name = weapon.GetType().Name;
                        else
                            this.m_Name = weapon.Name;
                        weapon.Name = this.m_Name + " [Enchanted]";
                        m_Table[weapon] = t = new ExpireTimer(weapon, AosWeaponAttribute.HitLightning, m, duration);
                        t.Start();
                        m.CloseGump(typeof(EnchantGump));
                        EnchantSpell.AddEffects(m, weapon);
                        break;
                    }
                case 5:
                    {
                        ExpireTimer t = (ExpireTimer)m_Table[weapon];
                        if (t != null)
                            t.DoExpire();
                        m.SendMessage("You added Hit Magic Arrow to your weapon");
                        weapon.WeaponAttributes.HitMagicArrow += 30;
                        m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                        m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);
                        if (weapon.Name == null)
                            this.m_Name = weapon.GetType().Name;
                        else
                            this.m_Name = weapon.Name;
                        weapon.Name = this.m_Name + " [Enchanted]";
                        m_Table[weapon] = t = new ExpireTimer(weapon, AosWeaponAttribute.HitMagicArrow, m, duration);
                        t.Start();
                        m.CloseGump(typeof(EnchantGump));
                        EnchantSpell.AddEffects(m, weapon);
                        break;
                    }
            }
        }