Example #1
0
		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int damage = 0;

			if (m_Damage > 0)
			{
				damage = Utility.Random(m_Damage);
			}

			if (defender != null && attacker != null && damage > 0)
			{
				attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
				attacker.PlaySound(0x15E);

				//SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 100, 0, 0, 0 );
				SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage);

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
Example #2
0
        public static void DrawFirework(Mobile from)
        {
            int[] intEffectID = { 14138, 14154, 14201 };

            Point3D EffectLocation = new Point3D((from.X + Utility.Random(-4, 8)), (from.Y + Utility.Random(-4, 8)), from.Z + 20);
            //	Effects.SendMovingParticles( from, EffectLocation, 0x36E4, 5, 0, false, false, 3006, 4006, 9501, 1, 0, EffectLayer.RightHand, 0x100 );
            IEntity to = new Entity(Serial.Zero, EffectLocation, from.Map);
            from.MovingParticles(to, 0x36E4, 5, 0, false, false, 3006, 4006, 0);
            Timer t = new InternalTimer(from, EffectLocation, intEffectID);

            m_Table[from] = t;

            t.Start();
        }
		public virtual void DoFireball(Mobile attacker, Mobile defender)
		{
			if (!attacker.CanBeHarmful(defender, false))
			{
				return;
			}

			attacker.DoHarmful(defender);

			double damage = GetAosDamage(attacker, 19, 1, 5);

			attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
			attacker.PlaySound(0x15E);

			SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage, 0, 100, 0, 0, 0);
		}
		public virtual void DoMagicArrow(Mobile attacker, Mobile defender)
		{
			if (!attacker.CanBeHarmful(defender, false))
			{
				return;
			}

			attacker.DoHarmful(defender);

			double damage = GetAosDamage(attacker, 10, 1, 4);

			attacker.MovingParticles(defender, 0x36E4, 5, 0, false, true, 3006, 4006, 0);
			attacker.PlaySound(0x1E5);

			SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage, 0, 100, 0, 0, 0);
		}
		public override void OnHit( Mobile caster, Mobile target )
		{
			double damage;

			damage = Utility.Random( 7, 5 );

			if ( CheckResisted( target ) )
			{
				damage *= 0.75;

				target.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
			}

			damage *= GetDamageScalar( target );

			caster.MovingParticles( target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
			caster.PlaySound( Core.AOS ? 0x15E : 0x44B );

			SpellHelper.Damage( this, target, damage, 0, 100, 0, 0, 0 );
		}
        public override void OnUsage(Mobile m)
        {
            if (CrateRace.FirstPlace != null)
            {
                if (CrateRace.PartList.Count > 0)
                {
                    RaceData rd = CrateRace.PartList[0];

                    m.MovingParticles(rd.Part, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
                    m.PlaySound(0x20A);
                    rd.Part.SendMessage("You have been hit by an enormous energy blast!");
                    CrateRace.HandleDamage(rd, .50);
                }
                m.SendMessage("The first in place has been hit by an enormous energy blast!");
            }

            CrateRace.OpenCrates--;
        }
Example #7
0
		public override void OnTrigger(object activator, Mobile m)
		{
			if(m == null ) return;

			// if it is still refractory then return
			if(DateTime.Now < m_EndTime) return;

			int damage = 0;

			if(m_Damage > 0)
				damage = Utility.Random(m_Damage);

			if(damage > 0)
			{
				m.MovingParticles( m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
				m.PlaySound( 0x15E );
				SpellHelper.Damage( TimeSpan.Zero, m, m, damage, 0, 100, 0, 0, 0 );
			}

			m_EndTime = DateTime.Now + Refractory;

		}    
		public override void OnDamagedBySpell( Mobile caster )
		{
			if ( caster.InRange( this, 8 ) )
			{
				caster.MovingParticles( this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1,    0, (EffectLayer)255, 0x100 );
				caster.MovingParticles( this, 0x0001, 1, 0, false,  true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0 );
				this.PlaySound( 0x209 );

				caster.Mana -= caster.Mana;
				caster.Hits -= caster.Hits;
				caster.Stam -= caster.Stam;
				this.Mana += caster.Mana;
				this.Hits += caster.Hits;
				this.Stam += caster.Stam;
			}

			base.OnDamagedBySpell( caster );
		}
Example #9
0
		public void DoMeteorSwarm( Mobile attacker, Mobile defender )
		{
			if ( !attacker.CanBeHarmful( defender, false ) )
				return;

			IPoint3D p = defender.Location;

			if ( !attacker.CanSee( p ) )
			{
				attacker.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( SpellHelper.CheckTown( p, attacker ) )
			{
				SpellHelper.Turn( attacker, p );

				if ( p is Item )
					p = ((Item)p).GetWorldLocation();

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

				Map map = attacker.Map;

				bool playerVsPlayer = false;

				if ( map != null )
				{
					IPooledEnumerable eable = map.GetMobilesInRange( new Point3D( p ), 2 );

					foreach ( Mobile m in eable )
					{
						if ( attacker != m && SpellHelper.ValidIndirectTarget( attacker, m ) && attacker.CanBeHarmful( m, false ) )
						{
							if ( Core.AOS && !attacker.InLOS( m ) )
								continue;

							targets.Add( m );

							if ( m.Player )
								playerVsPlayer = true;
						}
					}

					eable.Free();
				}

				double damage;

				damage = Utility.Random( 37, 33 );

				if ( targets.Count > 0 )
				{
					Effects.PlaySound( p, attacker.Map, 0x160 );

					if ( targets.Count > 2 )
						damage = (damage * 2) / targets.Count;

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

						double toDeal = damage;

						attacker.DoHarmful( m );
						SpellHelper.Damage( TimeSpan.FromSeconds( 1.0 ), m, attacker, toDeal, 0, 100, 0, 0, 0 );

						attacker.MovingParticles( m, 0x36D4, 7, 0, false, true, 9501, 1, 0, 0x100 );
					}
				}
				SpellHelper.Damage( TimeSpan.FromSeconds( 1.0 ), defender, attacker, 1, 0, 100, 0, 0, 0 );
			}
		}
        public override void OnHit(Mobile caster, Mobile target)
        {
            double damage;

            damage = 3;

            if (CheckResisted(target))
            {
                damage *= 0.75;

                target.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
            }

            damage *= GetDamageScalar(target);

            caster.MovingParticles(target, 0x36E4, 5, 0, false, true, 3006, 4006, 0);
            caster.PlaySound(0x1E5);

            SpellHelper.Damage(TimeSpan.FromSeconds(0.50), target, caster, damage, 0, 100, 0, 0, 0);
        }
Example #11
0
        public virtual void OnHit( Mobile attacker, Mobile defender, double damageBonus )
        {
            if ( MirrorImage.HasClone( defender ) && (defender.Skills.Ninjitsu.Value / 150.0) > Utility.RandomDouble() )
            {
                Clone bc;

                foreach ( Mobile m in defender.GetMobilesInRange( 4 ) )
                {
                    bc = m as Clone;

                    if ( bc != null && bc.Summoned && bc.SummonMaster == defender )
                    {
                        attacker.SendLocalizedMessage( 1063141 ); // Your attack has been diverted to a nearby mirror image of your target!
                        defender.SendLocalizedMessage( 1063140 ); // You manage to divert the attack onto one of your nearby mirror images.

                        /*
                         * TODO: What happens if the Clone parries a blow?
                         * And what about if the attacker is using Honorable Execution
                         * and kills it?
                         */

                        defender = m;
                        break;
                    }
                }
            }

            PlaySwingAnimation( attacker );
            PlayHurtAnimation( defender );

            attacker.PlaySound( GetHitAttackSound( attacker, defender ) );
            defender.PlaySound( GetHitDefendSound( attacker, defender ) );

            int damage = ComputeDamage( attacker, defender );

            if (attacker is PlayerMobile && defender is BaseCreature) //Attacks do double damage to creeps.
                damage *= 2;

            #region Damage Multipliers
            /*
             * The following damage bonuses multiply damage by a factor.
             * Capped at x3 (300%).
             */
            //double factor = 1.0;
            int percentageBonus = 0;

            WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker );
            SpecialMove move = SpecialMove.GetCurrentMove( attacker );

            if( a != null )
            {
                //factor *= a.DamageScalar;
                percentageBonus += (int)(a.DamageScalar * 100) - 100;
            }

            if( move != null )
            {
                //factor *= move.GetDamageScalar( attacker, defender );
                percentageBonus += (int)(move.GetDamageScalar( attacker, defender ) * 100) - 100;
            }

            //factor *= damageBonus;
            percentageBonus += (int)(damageBonus * 100) - 100;

            CheckSlayerResult cs = CheckSlayers( attacker, defender );

            if ( cs != CheckSlayerResult.None )
            {
                if ( cs == CheckSlayerResult.Slayer )
                    defender.FixedEffect( 0x37B9, 10, 5 );

                //factor *= 2.0;
                percentageBonus += 100;
            }

            if ( !attacker.Player )
            {
                if ( defender is PlayerMobile )
                {
                    PlayerMobile pm = (PlayerMobile)defender;

                    if( pm.EnemyOfOneType != null && pm.EnemyOfOneType != attacker.GetType() )
                    {
                        //factor *= 2.0;
                        percentageBonus += 100;
                    }
                }
            }
            else if ( !defender.Player )
            {
                if ( attacker is PlayerMobile )
                {
                    PlayerMobile pm = (PlayerMobile)attacker;

                    if ( pm.WaitingForEnemy )
                    {
                        pm.EnemyOfOneType = defender.GetType();
                        pm.WaitingForEnemy = false;
                    }

                    if ( pm.EnemyOfOneType == defender.GetType() )
                    {
                        defender.FixedEffect( 0x37B9, 10, 5, 1160, 0 );
                        //factor *= 1.5;
                        percentageBonus += 50;
                    }
                }
            }

            int packInstinctBonus = GetPackInstinctBonus( attacker, defender );

            if( packInstinctBonus != 0 )
            {
                //factor *= 1.0 + (double)packInstinctBonus / 100.0;
                percentageBonus += packInstinctBonus;
            }

            if( m_InDoubleStrike )
            {
                //factor *= 0.9; // 10% loss when attacking with double-strike
                percentageBonus -= 10;
            }

            TransformContext context = TransformationSpellHelper.GetContext( defender );

            if( (m_Slayer == SlayerName.Silver || m_Slayer2 == SlayerName.Silver) && context != null && context.Spell is NecromancerSpell && context.Type != typeof( HorrificBeastSpell ) )
            {
                //factor *= 1.25; // Every necromancer transformation other than horrific beast takes an additional 25% damage
                percentageBonus += 25;
            }

            if ( attacker is PlayerMobile && !(Core.ML && defender is PlayerMobile ))
            {
                PlayerMobile pmAttacker = (PlayerMobile) attacker;

                if( pmAttacker.HonorActive && pmAttacker.InRange( defender, 1 ) )
                {
                    //factor *= 1.25;
                    percentageBonus += 25;
                }

                if( pmAttacker.SentHonorContext != null && pmAttacker.SentHonorContext.Target == defender )
                {
                    //pmAttacker.SentHonorContext.ApplyPerfectionDamageBonus( ref factor );
                    percentageBonus += pmAttacker.SentHonorContext.PerfectionDamageBonus;
                }
            }

            //if ( factor > 3.0 )
            //	factor = 3.0;

            percentageBonus = Math.Min( percentageBonus, 300 );

            //damage = (int)(damage * factor);
            damage = AOS.Scale( damage, 100 + percentageBonus );
            #endregion

            if ( attacker is BaseCreature )
                ((BaseCreature)attacker).AlterMeleeDamageTo( defender, ref damage );

            if ( defender is BaseCreature )
                ((BaseCreature)defender).AlterMeleeDamageFrom( attacker, ref damage );

            damage = AbsorbDamage( attacker, defender, damage );

            if ( !Core.AOS && damage < 1 )
                damage = 1;
            else if ( Core.AOS && damage == 0 ) // parried
            {
                if ( a != null && a.Validate( attacker ) /*&& a.CheckMana( attacker, true )*/ ) // Parried special moves have no mana cost
                {
                    a = null;
                    WeaponAbility.ClearCurrentAbility( attacker );

                    attacker.SendLocalizedMessage( 1061140 ); // Your attack was parried!
                }
            }

            AddBlood( attacker, defender, damage );

            int phys, fire, cold, pois, nrgy;

            GetDamageTypes( attacker, out phys, out fire, out cold, out pois, out nrgy );

            if ( m_Consecrated )
            {
                phys = defender.PhysicalResistance;
                fire = defender.FireResistance;
                cold = defender.ColdResistance;
                pois = defender.PoisonResistance;
                nrgy = defender.EnergyResistance;

                int low = phys, type = 0;

                if ( fire < low ){ low = fire; type = 1; }
                if ( cold < low ){ low = cold; type = 2; }
                if ( pois < low ){ low = pois; type = 3; }
                if ( nrgy < low ){ low = nrgy; type = 4; }

                phys = fire = cold = pois = nrgy = 0;

                if ( type == 0 ) phys = 100;
                else if ( type == 1 ) fire = 100;
                else if ( type == 2 ) cold = 100;
                else if ( type == 3 ) pois = 100;
                else if ( type == 4 ) nrgy = 100;
            }

            int damageGiven = damage;

            if ( a != null && !a.OnBeforeDamage( attacker, defender ) )
            {
                WeaponAbility.ClearCurrentAbility( attacker );
                a = null;
            }

            if ( move != null && !move.OnBeforeDamage( attacker, defender ) )
            {
                SpecialMove.ClearCurrentMove( attacker );
                move = null;
            }

            bool ignoreArmor = ( a is ArmorIgnore || (move != null && move.IgnoreArmor( attacker )) );

            damageGiven = AOS.Damage( defender, attacker, damage, ignoreArmor, phys, fire, cold, pois, nrgy );

            double propertyBonus = ( move == null ) ? 1.0 : move.GetPropertyBonus( attacker );

            if ( Core.AOS )
            {
                int lifeLeech = 0;
                int stamLeech = 0;
                int manaLeech = 0;
                int wraithLeech = 0;

                if ( (int)(m_AosWeaponAttributes.HitLeechHits * propertyBonus) > Utility.Random( 100 ) )
                    lifeLeech += 30; // HitLeechHits% chance to leech 30% of damage as hit points

                if ( (int)(m_AosWeaponAttributes.HitLeechStam * propertyBonus) > Utility.Random( 100 ) )
                    stamLeech += 100; // HitLeechStam% chance to leech 100% of damage as stamina

                if ( (int)(m_AosWeaponAttributes.HitLeechMana * propertyBonus) > Utility.Random( 100 ) )
                    manaLeech += 40; // HitLeechMana% chance to leech 40% of damage as mana

                if ( m_Cursed )
                    lifeLeech += 50; // Additional 50% life leech for cursed weapons (necro spell)

                context = TransformationSpellHelper.GetContext( attacker );

                if ( context != null && context.Type == typeof( VampiricEmbraceSpell ) )
                    lifeLeech += 20; // Vampiric embrace gives an additional 20% life leech

                if ( context != null && context.Type == typeof( WraithFormSpell ) )
                {
                    wraithLeech = (5 + (int)((15 * attacker.Skills.SpiritSpeak.Value) / 100)); // Wraith form gives an additional 5-20% mana leech

                    // Mana leeched by the Wraith Form spell is actually stolen, not just leeched.
                    defender.Mana -= AOS.Scale( damageGiven, wraithLeech );

                    manaLeech += wraithLeech;
                }

                if ( lifeLeech != 0 )
                    attacker.Hits += AOS.Scale( damageGiven, lifeLeech );

                if ( stamLeech != 0 )
                    attacker.Stam += AOS.Scale( damageGiven, stamLeech );

                if ( manaLeech != 0 )
                    attacker.Mana += AOS.Scale( damageGiven, manaLeech );

                if ( lifeLeech != 0 || stamLeech != 0 || manaLeech != 0 )
                    attacker.PlaySound( 0x44D );
            }

            if ( m_MaxHits > 0 && ((MaxRange <= 1 && (defender is Slime || defender is ToxicElemental)) || Utility.Random( 25 ) == 0) ) // Stratics says 50% chance, seems more like 4%..
            {
                if ( MaxRange <= 1 && (defender is Slime || defender is ToxicElemental) )
                    attacker.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500263 ); // *Acid blood scars your weapon!*

                if ( Core.AOS && m_AosWeaponAttributes.SelfRepair > Utility.Random( 10 ) )
                {
                    HitPoints += 2;
                }
                else
                {
                    if ( m_Hits > 0 )
                    {
                        --HitPoints;
                    }
                    else if ( m_MaxHits > 1 )
                    {
                        --MaxHitPoints;

                        if ( Parent is Mobile )
                            ((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
                    }
                    else
                    {
                        Delete();
                    }
                }
            }

            if ( attacker is VampireBatFamiliar )
            {
                BaseCreature bc = (BaseCreature)attacker;
                Mobile caster = bc.ControlMaster;

                if ( caster == null )
                    caster = bc.SummonMaster;

                if ( caster != null && caster.Map == bc.Map && caster.InRange( bc, 2 ) )
                    caster.Hits += damage;
                else
                    bc.Hits += damage;
            }

            if ( Core.AOS )
            {
                int physChance = (int)(m_AosWeaponAttributes.HitPhysicalArea * propertyBonus);
                int fireChance = (int)(m_AosWeaponAttributes.HitFireArea * propertyBonus);
                int coldChance = (int)(m_AosWeaponAttributes.HitColdArea * propertyBonus);
                int poisChance = (int)(m_AosWeaponAttributes.HitPoisonArea * propertyBonus);
                int nrgyChance = (int)(m_AosWeaponAttributes.HitEnergyArea * propertyBonus);

                if ( physChance != 0 && physChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x10E,   50, 100, 0, 0, 0, 0 );

                if ( fireChance != 0 && fireChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x11D, 1160, 0, 100, 0, 0, 0 );

                if ( coldChance != 0 && coldChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x0FC, 2100, 0, 0, 100, 0, 0 );

                if ( poisChance != 0 && poisChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x205, 1166, 0, 0, 0, 100, 0 );

                if ( nrgyChance != 0 && nrgyChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x1F1,  120, 0, 0, 0, 0, 100 );

                int maChance = (int)(m_AosWeaponAttributes.HitMagicArrow * propertyBonus);
                int harmChance = (int)(m_AosWeaponAttributes.HitHarm * propertyBonus);
                int fireballChance = (int)(m_AosWeaponAttributes.HitFireball * propertyBonus);
                int lightningChance = (int)(m_AosWeaponAttributes.HitLightning * propertyBonus);
                int dispelChance = (int)(m_AosWeaponAttributes.HitDispel * propertyBonus);

                if ( maChance != 0 && maChance > Utility.Random( 100 ) )
                    DoMagicArrow( attacker, defender );

                if ( harmChance != 0 && harmChance > Utility.Random( 100 ) )
                    DoHarm( attacker, defender );

                if ( fireballChance != 0 && fireballChance > Utility.Random( 100 ) )
                    DoFireball( attacker, defender );

                if ( lightningChance != 0 && lightningChance > Utility.Random( 100 ) )
                    DoLightning( attacker, defender );

                if ( dispelChance != 0 && dispelChance > Utility.Random( 100 ) )
                    DoDispel( attacker, defender );

                int laChance = (int)(m_AosWeaponAttributes.HitLowerAttack * propertyBonus);
                int ldChance = (int)(m_AosWeaponAttributes.HitLowerDefend * propertyBonus);

                if ( laChance != 0 && laChance > Utility.Random( 100 ) )
                    DoLowerAttack( attacker, defender );

                if ( ldChance != 0 && ldChance > Utility.Random( 100 ) )
                    DoLowerDefense( attacker, defender );
            }

            if ( attacker is BaseCreature )
                ((BaseCreature)attacker).OnGaveMeleeAttack( defender );

            if ( defender is BaseCreature )
                ((BaseCreature)defender).OnGotMeleeAttack( attacker );

            if (m_PreUORMagEff != null && m_PreUORMagEff != PreUORMagEff.None && MagEffCharges != 0)
            {
                Mobile from = defender;
                switch(m_PreUORMagEff)
                {
                    case PreUORMagEff.Clumsiness:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            string name = String.Format( "[Magic] {0} Offset", StatType.Dex );
                            StatMod mod = from.GetStatMod( name );

                            if ( mod != null && mod.Offset < 0 )
                            {
                                from.AddStatMod( new StatMod( StatType.Dex, name, mod.Offset + -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            else if ( mod == null || mod.Offset < -10 )
                            {
                                from.AddStatMod( new StatMod( StatType.Dex, name, -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            MagEffCharges--;
                        from.FixedParticles( 0x3779, 10, 15, 5002, EffectLayer.Head );
                        from.PlaySound( 0x1DF );
                        }
                        break;
                    case PreUORMagEff.Feeblemindedness:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            string name = String.Format( "[Magic] {0} Offset", StatType.Int );

                            StatMod mod = from.GetStatMod( name );

                            if ( mod != null && mod.Offset < 0 )
                            {
                                from.AddStatMod( new StatMod( StatType.Int, name, mod.Offset + -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            else if ( mod == null || mod.Offset < 10 )
                            {
                                from.AddStatMod( new StatMod( StatType.Int, name, -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            MagEffCharges--;
                        from.FixedParticles( 0x3779, 10, 15, 5004, EffectLayer.Head );
                        from.PlaySound( 0x1E4 );
                        }
                        break;
                    case PreUORMagEff.Weakness:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            string name = String.Format( "[Magic] {0} Offset", StatType.Str );

                            StatMod mod = from.GetStatMod( name );

                            if ( mod != null && mod.Offset < 0 )
                            {
                                from.AddStatMod( new StatMod( StatType.Str, name, mod.Offset + -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            else if ( mod == null || mod.Offset < 10 )
                            {
                                from.AddStatMod( new StatMod( StatType.Str, name, -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            MagEffCharges--;
                        from.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
                        from.PlaySound( 0x1E6 );
                        }
                        break;
                    case PreUORMagEff.Burning:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            DoMagicArrow( attacker, defender );
                            MagEffCharges--;
                            attacker.MovingParticles( defender, 0x36E4, 5, 0, false, true, 3006, 4006, 0 );
                            attacker.PlaySound( 0x1E5 );
                        }
                        break;
                    case PreUORMagEff.Wounding:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            DoHarm( attacker, defender );
                            MagEffCharges--;
                            defender.FixedParticles( 0x374A, 10, 15, 5013, EffectLayer.Waist );
                            defender.PlaySound( 0x1F1 );
                        }
                        break;
                    case PreUORMagEff.DaemonBreath:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            DoFireball( attacker, defender );
                            MagEffCharges--;
                            attacker.MovingParticles( defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
                            attacker.PlaySound( 0x15E );
                        }
                        break;
                    case PreUORMagEff.Thunder:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            DoLightning( attacker, defender );
                            MagEffCharges--;
                            defender.BoltEffect( 0 );
                        }
                        break;
                    case PreUORMagEff.MagesBane:
                        if( Utility.RandomDouble() <= 0.25 ) //25% chance for this to hit defender successfully
                        {
                            defender.Mana -= 10;
                            MagEffCharges--;
                            defender.FixedParticles( 0x374A, 10, 15, 5032, EffectLayer.Head );
                            defender.PlaySound( 0x1F8 );
                        }
                        break;
                    case PreUORMagEff.GhoulTouch:
                        if( Utility.RandomDouble() <= 0.25 ) //25% chance for this to hit defender successfully
                        {
                            defender.Paralyze( TimeSpan.FromSeconds( 7 ) );
                            MagEffCharges--;
                            defender.PlaySound( 0x204 );
                            defender.FixedEffect( 0x376A, 6, 1 );
                        }
                        break;
                    case PreUORMagEff.Evil:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            TimeSpan duration = TimeSpan.FromSeconds( 60.0 );
                            int amount = 10;
                            SpellHelper.AddStatCurse(attacker, defender, StatType.Str, amount, duration);
                            SpellHelper.AddStatCurse(attacker, defender, StatType.Dex, amount, duration);
                            SpellHelper.AddStatCurse(attacker, defender, StatType.Int, amount, duration);

                            MagEffCharges--;
                            from.FixedParticles( 0x374A, 10, 15, 5028, EffectLayer.Waist );
                            from.PlaySound( 0x1EA );
                        }
                        break;
                }
            }
            if ( a != null )
                a.OnHit( attacker, defender, damage );

            if ( move != null )
                move.OnHit( attacker, defender, damage );

            if ( defender is IHonorTarget && ((IHonorTarget)defender).ReceivedHonorContext != null )
                ((IHonorTarget)defender).ReceivedHonorContext.OnTargetHit( attacker );

            if ( !(this is BaseRanged) )
            {
                if ( AnimalForm.UnderTransformation( attacker, typeof( GiantSerpent ) ) )
                    defender.ApplyPoison( attacker, Poison.Lesser );

                if ( AnimalForm.UnderTransformation( defender, typeof( BullFrog ) ) )
                    attacker.ApplyPoison( defender, Poison.Regular );
                // hook for attachment OnWeaponHit method
                Server.Engines.XmlSpawner2.XmlAttach.OnWeaponHit(this, attacker, defender, damageGiven);
            }
        }