Ejemplo n.º 1
0
 public PurgeTimer(GameLiving caster, PurgeAbility purge, int count)
     : base(caster.CurrentRegion.TimeManager)
 {
     m_caster = caster;
     m_purge  = purge;
     counter  = count;
 }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 4
0
 public PurgeTimer(GameLiving caster, PurgeAbility purge)
     : base(caster.CurrentRegion.TimeManager)
 {
     m_caster = caster;
     m_purge = purge;
     counter = 5;
 }