public override int CalcValue(GameLiving living, eProperty property)
        {
            GamePlayer player = living as GamePlayer;

            if (player != null)
            {
                int buff = player.BaseBuffBonusCategory[(int)property] * 10
                           + player.SpecBuffBonusCategory[(int)property] * 10
                           - player.DebuffCategory[(int)property] * 10
                           + player.BuffBonusCategory4[(int)property] * 10
                           + player.AbilityBonus[(int)property] * 10;
                int parrySpec = 0;
                if (player.HasSpecialization(Specs.Parry))
                {
                    parrySpec = (player.Dexterity * 2 - 100) / 4 + (player.GetModifiedSpecLevel(Specs.Parry) - 1) * (10 / 2) + 50;
                }
                if (parrySpec > 500)
                {
                    parrySpec = 500;
                }
                return(parrySpec + buff);
            }
            NecromancerPet pet = living as NecromancerPet;

            if (pet != null)
            {
                IControlledBrain brain = pet.Brain as IControlledBrain;
                if (brain != null)
                {
                    int buff = pet.BaseBuffBonusCategory[(int)property] * 10
                               + pet.SpecBuffBonusCategory[(int)property] * 10
                               - pet.DebuffCategory[(int)property] * 10
                               + pet.BuffBonusCategory4[(int)property] * 10
                               + pet.AbilityBonus[(int)property] * 10
                               + (pet.GetModified(eProperty.Dexterity) * 2 - 100) / 4
                               + pet.ParryChance * 10;
                    return(buff);
                }
            }
            GameNPC npc = living as GameNPC;

            if (npc != null)
            {
                return(npc.ParryChance * 10);
            }

            return(0);
        }
Exemple #2
0
        //public override eProperty Property1 { get { return eProperty.MeleeDamage; } }

        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            foreach (JuggernautEffect jg in target.EffectList.GetAllOfType <JuggernautEffect>())
            {
                if (jg != null)
                {
                    MessageToCaster("Your Pet already has an ability of this type active", eChatType.CT_SpellResisted);
                    return;
                }
            }

            // Add byNefa 04.02.2011 13:35
            // Check if Necro try to use ML9 Convoker at own Pet
            if (m_player != null && m_player.CharacterClass.ID == (int)eCharacterClass.Necromancer)
            {             // Caster is a Necro
                NecromancerPet necroPet = target as NecromancerPet;
                if (necroPet == null || necroPet.Owner == m_player)
                {                 // Caster is a Nekro and his Target is his Own Pet
                    MessageToCaster("You cant use this ability on your own Pet", eChatType.CT_SpellResisted);
                    return;
                }
            }
            base.ApplyEffectOnTarget(target, effectiveness);
        }
Exemple #3
0
        protected static bool RemoveNegativeEffects(GameLiving living, PurgeAbility purge)
        {
            bool      removed = false;
            ArrayList effects = new ArrayList();


            GamePlayer player = (GamePlayer)living;

            if (player.CharacterClass.ID == (int)eCharacterClass.Necromancer)
            {
                NecromancerPet necroPet = (NecromancerPet)player.ControlledBrain.Body;
                lock (necroPet.EffectList)
                {
                    foreach (IGameEffect effect in necroPet.EffectList)
                    {
                        GameSpellEffect gsp = (GameSpellEffect)effect;

                        if (gsp == null)
                        {
                            continue;
                        }
                        if (gsp is GameSpellAndImmunityEffect && ((GameSpellAndImmunityEffect)gsp).ImmunityState)
                        {
                            continue;
                        }
                        if (gsp.SpellHandler.HasPositiveEffect)
                        {
                            continue;
                        }

                        effects.Add(gsp);
                        removed = true;
                    }
                }
            }

            lock (living.EffectList)
            {
                foreach (IGameEffect effect in living.EffectList)
                {
                    GameSpellEffect gsp = effect as GameSpellEffect;
                    if (gsp == null)
                    {
                        continue;
                    }
                    if (gsp is GameSpellAndImmunityEffect && ((GameSpellAndImmunityEffect)gsp).ImmunityState)
                    {
                        continue;                           // ignore immunity effects
                    }
                    if (gsp.SpellHandler.HasPositiveEffect) //only enemy spells are affected
                    {
                        continue;
                    }

                    /*
                     * if (gsp.SpellHandler is RvRResurrectionIllness)
                     * continue;
                     */
                    //if (gsp.Spell.SpellType == "DesperateBowman")//Can't be purged
                    //continue;
                    effects.Add(gsp);
                    removed = true;
                }

                foreach (IGameEffect effect in effects)
                {
                    effect.Cancel(false);
                }
            }

            if (player != null)
            {
                foreach (GamePlayer rangePlayer in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    if (player.CharacterClass.ID == (int)eCharacterClass.Necromancer)
                    {
                        rangePlayer.Out.SendSpellEffectAnimation(player.ControlledBrain.Body,
                                                                 player.ControlledBrain.Body, 7011, 0,
                                                                 false, (byte)(removed ? 1 : 0));
                    }

                    rangePlayer.Out.SendSpellEffectAnimation(player, player, 7011, 0, false, (byte)(removed ? 1 : 0));
                }
                if (removed)
                {
                    player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "PurgeAbility.RemoveNegativeEffects.FallFromYou"), eChatType.CT_Advise, eChatLoc.CL_SystemWindow);
                }
                else
                {
                    player.DisableSkill(purge, 5);
                }
            }
            if (removed)
            {
                player.Stealth(false);
            }
            return(removed);
        }
Exemple #4
0
 public TetherTimer(NecromancerPet pet)
     : base(pet.CurrentRegion.TimeManager)
 {
     m_pet = pet;
 }