예제 #1
0
        /// <summary>
        /// When an applied effect expires.
        /// Duration spells only.
        /// </summary>
        /// <param name="effect">The expired effect</param>
        /// <param name="noMessages">true, when no messages should be sent to player and surrounding</param>
        /// <returns>immunity duration in milliseconds</returns>
        public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
        {
            if (!noMessages && Spell.Pulse == 0)
            {
                MessageToLiving(effect.Owner, Spell.Message3, eChatType.CT_SpellExpires);
                Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message4, effect.Owner.GetName(0, false)), eChatType.CT_SpellExpires, effect.Owner);
            }

            ApplyBonus(effect.Owner, BonusCategory1, Property1, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory2, Property2, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory3, Property3, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory4, Property4, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory5, Property5, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory6, Property6, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory7, Property7, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory8, Property8, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory9, Property9, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory10, Property10, (int)(Spell.Value * effect.Effectiveness), true);

            SendUpdates(effect.Owner);

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

            return(base.OnEffectExpires(effect, noMessages));
        }
예제 #2
0
        /// <summary>
        /// start changing effect on target
        /// </summary>
        /// <param name="effect"></param>
        public override void OnEffectStart(GameSpellEffect effect)
        {
            ApplyBonus(effect.Owner, BonusCategory1, Property1, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory2, Property2, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory3, Property3, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory4, Property4, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory5, Property5, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory6, Property6, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory7, Property7, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory8, Property8, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory9, Property9, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory10, Property10, (int)(Spell.Value * effect.Effectiveness), false);

            // Xali: buffs/debuffs are now efficient on pets
            #region Petbuffs
            if (effect.Owner is GameNPC)
            {
                if ((effect.Owner as GameNPC).Brain is ControlledNpcBrain)
                {
                    //Increase Pet's ArmorAbsorb/MagicAbsorb with Buffs
                    if (this is StrengthBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeDamage] += (int)(((Spell.Value / 100) * Spell.Level) / 2);
                    }
                    else if (this is ConstitutionBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Body]     += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Energy]   += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Cold]     += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Heat]     += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Matter]   += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Spirit]   += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is ArmorFactorBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is DexterityBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is QuicknessBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeSpeed] += (int)(((Spell.Value / 100) * Spell.Level) / 6);
                    }
                    else if (this is StrengthConBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeDamage]   += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Body]   += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Energy] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Cold]   += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Heat]   += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Matter] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Spirit] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                    }
                    else if (this is DexterityQuiBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeSpeed]      += (int)(((Spell.Value / 100) * Spell.Level) / 6);
                    }
                    //Decrease Pet's ArmorAbsorb/MagicAbsorb with DeBuffs
                    else if (this is StrengthDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeDamage] -= (int)(((Spell.Value / 100) * Spell.Level) / 2);
                    }
                    else if (this is ConstitutionDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Body]     -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Energy]   -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Cold]     -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Heat]     -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Matter]   -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Spirit]   -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is ArmorFactorDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is DexterityDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is QuicknessDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeSpeed] -= (int)(((Spell.Value / 100) * Spell.Level) / 6);
                    }
                    else if (this is StrengthConDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeDamage]   -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Body]   -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Energy] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Cold]   -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Heat]   -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Matter] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Spirit] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                    }
                    else if (this is DexterityQuiDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeSpeed]      -= (int)(((Spell.Value / 100) * Spell.Level) / 6);
                    }
                }
            }
            #endregion

            SendUpdates(effect.Owner);

            eChatType toLiving = eChatType.CT_SpellPulse;
            eChatType toOther  = eChatType.CT_SpellPulse;
            if (Spell.Pulse == 0 || !HasPositiveEffect)
            {
                toLiving = eChatType.CT_Spell;
                toOther  = eChatType.CT_System;
                SendEffectAnimation(effect.Owner, 0, false, 1);
            }

            GameLiving player = null;

            if (Caster is GameNPC && (Caster as GameNPC).Brain is IControlledBrain)
            {
                player = ((Caster as GameNPC).Brain as IControlledBrain).Owner;
            }
            else if (effect.Owner is GameNPC && (effect.Owner as GameNPC).Brain is IControlledBrain)
            {
                player = ((effect.Owner as GameNPC).Brain as IControlledBrain).Owner;
            }

            if (player != null)
            {
                // Controlled NPC. Show message in blue writing to owner...

                MessageToLiving(player, String.Format(Spell.Message2,
                                                      effect.Owner.GetName(0, true)), toLiving);

                // ...and in white writing for everyone else.

                foreach (GamePlayer gamePlayer in effect.Owner.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
                {
                    if (gamePlayer != player)
                    {
                        MessageToLiving(gamePlayer, String.Format(Spell.Message2,
                                                                  effect.Owner.GetName(0, true)), toOther);
                    }
                }
            }
            else
            {
                MessageToLiving(effect.Owner, Spell.Message1, toLiving);
                Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, false)), toOther, effect.Owner);
            }
            if (ServerProperties.Properties.BUFF_RANGE > 0 && effect.Spell.Concentration > 0 && effect.SpellHandler.HasPositiveEffect && effect.Owner != effect.SpellHandler.Caster)
            {
                m_buffCheckAction = new BuffCheckAction(effect.SpellHandler.Caster, effect.Owner, effect);
                m_buffCheckAction.Start(BuffCheckAction.BUFFCHECKINTERVAL);
            }
        }
        /// <summary>
        /// When an applied effect expires.
        /// Duration spells only.
        /// </summary>
        /// <param name="effect">The expired effect</param>
        /// <param name="noMessages">true, when no messages should be sent to player and surrounding</param>
        /// <returns>immunity duration in milliseconds</returns>
        public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
        {
            if (!noMessages && Spell.Pulse == 0)
            {
                MessageToLiving(effect.Owner, Spell.Message3, eChatType.CT_SpellExpires);
                Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message4, effect.Owner.GetName(0, false)), eChatType.CT_SpellExpires, effect.Owner);
            }

            ApplyBonus(effect.Owner, BonusCategory1, Property1, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory2, Property2, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory3, Property3, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory4, Property4, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory5, Property5, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory6, Property6, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory7, Property7, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory8, Property8, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory9, Property9, (int)(Spell.Value * effect.Effectiveness), true);
            ApplyBonus(effect.Owner, BonusCategory10, Property10, (int)(Spell.Value * effect.Effectiveness), true);

            SendUpdates(effect.Owner);

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

            return base.OnEffectExpires(effect, noMessages);
        }
예제 #4
0
        /// <summary>
        /// start changing effect on target
        /// </summary>
        /// <param name="effect"></param>
        public override void OnEffectStart(GameSpellEffect effect)
        {
            ApplyBonus(effect.Owner, BonusCategory1, Property1, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory2, Property2, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory3, Property3, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory4, Property4, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory5, Property5, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory6, Property6, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory7, Property7, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory8, Property8, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory9, Property9, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory10, Property10, (int)(Spell.Value * effect.Effectiveness), false);

            SendUpdates(effect.Owner);

            eChatType toLiving = eChatType.CT_SpellPulse;
            eChatType toOther  = eChatType.CT_SpellPulse;

            if (Spell.Pulse == 0 || !HasPositiveEffect)
            {
                toLiving = eChatType.CT_Spell;
                toOther  = eChatType.CT_System;
                SendEffectAnimation(effect.Owner, 0, false, 1);
            }

            GameLiving player = null;

            if (Caster is GameNPC && (Caster as GameNPC).Brain is IControlledBrain)
            {
                player = ((Caster as GameNPC).Brain as IControlledBrain).Owner;
            }
            else if (effect.Owner is GameNPC && (effect.Owner as GameNPC).Brain is IControlledBrain)
            {
                player = ((effect.Owner as GameNPC).Brain as IControlledBrain).Owner;
            }

            if (player != null)
            {
                // Controlled NPC. Show message in blue writing to owner...

                MessageToLiving(player, String.Format(Spell.Message2,
                                                      effect.Owner.GetName(0, true)), toLiving);

                // ...and in white writing for everyone else.

                foreach (GamePlayer gamePlayer in effect.Owner.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
                {
                    if (gamePlayer != player)
                    {
                        MessageToLiving(gamePlayer, String.Format(Spell.Message2,
                                                                  effect.Owner.GetName(0, true)), toOther);
                    }
                }
            }
            else
            {
                MessageToLiving(effect.Owner, Spell.Message1, toLiving);
                Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, false)), toOther, effect.Owner);
            }
            if (ServerProperties.Properties.BUFF_RANGE > 0 && effect.Spell.Concentration > 0 && effect.SpellHandler.HasPositiveEffect && effect.Owner != effect.SpellHandler.Caster)
            {
                m_buffCheckAction = new BuffCheckAction(effect.SpellHandler.Caster, effect.Owner, effect);
                m_buffCheckAction.Start(BuffCheckAction.BUFFCHECKINTERVAL);
            }
        }
        /// <summary>
        /// start changing effect on target
        /// </summary>
        /// <param name="effect"></param>
        public override void OnEffectStart(GameSpellEffect effect)
        {
            ApplyBonus(effect.Owner, BonusCategory1, Property1, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory2, Property2, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory3, Property3, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory4, Property4, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory5, Property5, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory6, Property6, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory7, Property7, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory8, Property8, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory9, Property9, (int)(Spell.Value * effect.Effectiveness), false);
            ApplyBonus(effect.Owner, BonusCategory10, Property10, (int)(Spell.Value * effect.Effectiveness), false);

            // Xali: buffs/debuffs are now efficient on pets

            #region Petbuffs

            if (effect.Owner is GameNPC)
            {
                if ((effect.Owner as GameNPC).Brain is ControlledNpcBrain)
                {
                    //Increase Pet's ArmorAbsorb/MagicAbsorb with Buffs
                    if (this is StrengthBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeDamage] += (int)(((Spell.Value / 100) * Spell.Level) / 2);
                    }
                    else if (this is ConstitutionBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Body] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Energy] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Cold] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Heat] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Matter] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Spirit] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is ArmorFactorBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is DexterityBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] += (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is QuicknessBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeSpeed] += (int)(((Spell.Value / 100) * Spell.Level) / 6);
                    }
                    else if (this is StrengthConBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeDamage] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Body] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Energy] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Cold] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Heat] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Matter] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Spirit] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                    }
                    else if (this is DexterityQuiBuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] += (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeSpeed] += (int)(((Spell.Value / 100) * Spell.Level) / 6);
                    }
                    //Decrease Pet's ArmorAbsorb/MagicAbsorb with DeBuffs
                    else if (this is StrengthDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeDamage] -= (int)(((Spell.Value / 100) * Spell.Level) / 2);
                    }
                    else if (this is ConstitutionDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Body] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Energy] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Cold] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Heat] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Matter] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Spirit] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is ArmorFactorDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is DexterityDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] -= (int)(((Spell.Value / 100) * Spell.Level) / 4);
                    }
                    else if (this is QuicknessDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeSpeed] -= (int)(((Spell.Value / 100) * Spell.Level) / 6);
                    }
                    else if (this is StrengthConDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeDamage] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Body] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Energy] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Cold] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Heat] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Matter] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.Resist_Spirit] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                    }
                    else if (this is DexterityQuiDebuff)
                    {
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.ArmorAbsorption] -= (int)(((Spell.Value / 100) * Spell.Level) / 8);
                        (effect.Owner as GameNPC).AbilityBonus[(int)eProperty.MeleeSpeed] -= (int)(((Spell.Value / 100) * Spell.Level) / 6);
                    }
                }
            }

            #endregion Petbuffs

            SendUpdates(effect.Owner);

            eChatType toLiving = eChatType.CT_SpellPulse;
            eChatType toOther = eChatType.CT_SpellPulse;
            if (Spell.Pulse == 0 || !HasPositiveEffect)
            {
                toLiving = eChatType.CT_Spell;
                toOther = eChatType.CT_System;
                SendEffectAnimation(effect.Owner, 0, false, 1);
            }

            GameLiving player = null;

            if (Caster is GameNPC && (Caster as GameNPC).Brain is IControlledBrain)
                player = ((Caster as GameNPC).Brain as IControlledBrain).Owner;
            else if (effect.Owner is GameNPC && (effect.Owner as GameNPC).Brain is IControlledBrain)
                player = ((effect.Owner as GameNPC).Brain as IControlledBrain).Owner;

            if (player != null)
            {
                // Controlled NPC. Show message in blue writing to owner...

                MessageToLiving(player, String.Format(Spell.Message2,
                                                      effect.Owner.GetName(0, true)), toLiving);

                // ...and in white writing for everyone else.

                foreach (GamePlayer gamePlayer in effect.Owner.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
                    if (gamePlayer != player)
                        MessageToLiving(gamePlayer, String.Format(Spell.Message2,
                                                                  effect.Owner.GetName(0, true)), toOther);
            }
            else
            {
                MessageToLiving(effect.Owner, Spell.Message1, toLiving);
                Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, false)), toOther, effect.Owner);
            }
            if (ServerProperties.Properties.BUFF_RANGE > 0 && effect.Spell.Concentration > 0 && effect.SpellHandler.HasPositiveEffect && effect.Owner != effect.SpellHandler.Caster)
            {
                m_buffCheckAction = new BuffCheckAction(effect.SpellHandler.Caster, effect.Owner, effect);
                m_buffCheckAction.Start(BuffCheckAction.BUFFCHECKINTERVAL);
            }
        }