/// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }

            SendCasterSpellEffectAndCastMessage(living, 7072, true);

            bool deactivate = false;

            foreach (GamePlayer player in living.GetPlayersInRadius(false, 350))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(living, player, true))
                {
                    DamageTarget(player, living);
                    deactivate = true;
                }
            }

            foreach (GameNPC npc in living.GetNPCsInRadius(false, 350))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(living, npc, true))
                {
                    DamageTarget(npc, living);
                    deactivate = true;
                }
            }
            if (deactivate)
            {
                DisableSkill(living);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            SendCasterSpellEffectAndCastMessage(living, 1145, true);

            bool deactivate = false;
            foreach (GamePlayer player in living.GetPlayersInRadius(false, 350))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(living, player, true))
                {
                    DamageTarget(player, living);
                    deactivate = true;
                }
            }

            foreach (GameNPC npc in living.GetNPCsInRadius(false, 350))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(living, npc, true))
                {
                    DamageTarget(npc, living);
                    deactivate = true;
                }
            }
            if (deactivate)
                DisableSkill(living);
        }
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }

            SpellLine spline  = SkillBase.GetSpellLine(GlobalSpellsLines.Character_Abilities);
            Spell     abSpell = SkillBase.GetSpellByID(7045);

            if (spline != null && abSpell != null)
            {
                foreach (GameNPC enemy in living.GetNPCsInRadius(750))
                {
                    if (enemy.IsAlive && enemy.Brain != null)
                    {
                        if (enemy.Brain is IControlledBrain)
                        {
                            living.CastSpell(abSpell, spline);
                        }
                    }
                }
            }
            DisableSkill(living);
        }
Ejemplo n.º 4
0
        public override IList <GameLiving> SelectTargets(GameObject castTarget)
        {
            var        list   = new List <GameLiving>(8);
            GameLiving target = castTarget as GameLiving;

            if (target == null || Spell.Range == 0)
            {
                target = Caster;
            }

            foreach (GamePlayer player in target.GetPlayersInRadius(false, (ushort)Spell.Radius))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(Caster, player, true))
                {
                    list.Add(player);
                }
            }
            foreach (GameNPC npc in target.GetNPCsInRadius(false, (ushort)Spell.Radius))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(Caster, npc, true))
                {
                    list.Add(npc);
                }
            }

            return(list);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// execute non duration spell effect on target
        /// </summary>
        /// <param name="target"></param>
        /// <param name="effectiveness"></param>
        public override void OnDirectEffect(GameLiving target, double effectiveness)
        {
            base.OnDirectEffect(target, effectiveness);
            if (target == null || !target.IsAlive)
            {
                return;
            }

            foreach (GameNPC item in target.GetNPCsInRadius((ushort)Spell.Radius))
            {
                (item as GameMine)?.Delete();
            }
        }
Ejemplo n.º 6
0
        public override IList SelectTargets(GameObject castTarget)
        {
            ArrayList  list   = new ArrayList();
            GameLiving target = Caster;

            foreach (GameNPC npc in target.GetNPCsInRadius((ushort)Spell.Radius))
            {
                if (npc is GameNPC && npc.Brain is ControlledNpcBrain)//!(npc is NecromancerPet))
                {
                    list.Add(npc);
                }
            }
            return(list);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// execute non duration spell effect on target
        /// </summary>
        /// <param name="target"></param>
        /// <param name="effectiveness"></param>
        public override void OnDirectEffect(GameLiving target, double effectiveness)
        {
            base.OnDirectEffect(target, effectiveness);
            if (target == null || !target.IsAlive)
                return;

            foreach (GameNPC item in target.GetNPCsInRadius((ushort)m_spell.Radius))
            {
                if (item != null && item is GameMine)
                {
                    (item as GameMine).Delete();
                }
            }
        }
Ejemplo n.º 8
0
        public override IList<GameLiving> SelectTargets(GameObject castTarget)
        {
            var list = new List<GameLiving>();
            GameLiving target = Caster;
            foreach (GameNPC npc in target.GetNPCsInRadius((ushort)Spell.Radius))
            {
                if (npc?.Brain is ControlledNpcBrain) // !(npc is NecromancerPet))
                {
                    list.Add(npc);
                }
            }

            return list;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Fired once the chained DD hits its target.
        /// Deals damage and jumps to the next target where possible.
        /// </summary>
        public void LightningHits()
        {
            if (Util.Chance(base.CalculateSpellResistChance(currentTarget)))
            {
                MessageToCaster("Your spell is resisted!", eChatType.CT_SpellResisted);
                return;
            }

            //First we damage our current target.
            DealDamage(currentTarget, currentDamageNerf);

            currentDamageNerf *= ((double)Spell.LifeDrainReturn / 100.0);
            recursions++;
            if (recursions <= (int)Spell.Value)
            {
                //Find an enemy we can strike next to this current target.
                List <GameLiving> enemies = new List <GameLiving>();
                foreach (GameNPC npc in currentTarget.GetNPCsInRadius((ushort)Spell.Radius))
                {
                    if (GameServer.ServerRules.IsAllowedToAttack(Caster, npc, false))
                    {
                        enemies.Add(npc);
                    }
                }
                foreach (GamePlayer pc in currentTarget.GetPlayersInRadius((ushort)Spell.Radius))
                {
                    if (GameServer.ServerRules.IsAllowedToAttack(Caster, pc, false))
                    {
                        enemies.Add(pc);
                    }
                }

                if (enemies.Count == 0)
                {
                    return;
                }

                currentSource = currentTarget;
                currentTarget = enemies[Util.Random(enemies.Count - 1)];
                if (currentSource != currentTarget)
                {
                    TryLightning();
                }
                enemies.Clear();
            }
        }
Ejemplo n.º 10
0
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            SpellLine spline = SkillBase.GetSpellLine(GlobalSpellsLines.Character_Abilities);
             			Spell abSpell = SkillBase.GetSpellByID(7045);

             			if (spline != null && abSpell != null)
            {
                foreach (GameNPC enemy in living.GetNPCsInRadius(750))
                {
                    if (enemy.IsAlive && enemy.Brain!=null)
                        if(enemy.Brain is IControlledBrain)
                            living.CastSpell(abSpell, spline);
                }
             			}
            DisableSkill(living);
        }
Ejemplo n.º 11
0
        protected virtual int EndCast(RegionTimer timer)
        {
            if (caster.TargetObject == null)
            {
                caster.Out.SendMessage("You need a target for this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                caster.DisableSkill(this, 3 * 1000);
                return(0);
            }

            if (caster.IsMoving)
            {
                caster.Out.SendMessage(LanguageMgr.GetTranslation(caster.Client, "SpellHandler.CasterMove"), eChatType.CT_Say, eChatLoc.CL_SystemWindow);
                caster.DisableSkill(this, 3000);
                return(0);
            }

            if (!caster.IsWithinRadius(caster.TargetObject, 1875))
            {
                caster.Out.SendMessage(caster.TargetObject.Name + " is too far away.", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
                caster.DisableSkill(this, 3 * 1000);
                return(0);
            }

            GameLiving living = caster.TargetObject as GameLiving;

            if (living == null)
            {
                timer.Stop();
                timer = null;
                return(0);
            }

            if (living.EffectList.GetOfType <ChargeEffect>() == null && living.EffectList.GetOfType <SpeedOfSoundEffect>() != null)
            {
                living.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 99 * 0.01);
                m_rootExpire = new RegionTimer(living, new RegionTimerCallback(RootExpires), duration);
                GameEventMgr.AddHandler(living, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
                SendUpdates(living);
            }

            foreach (GamePlayer player in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                player.Out.SendSpellEffectAnimation(caster, (caster.TargetObject as GameLiving), 7029, 0, false, 1);
            }

            foreach (GameNPC mob in living.GetNPCsInRadius(500))
            {
                if (!GameServer.ServerRules.IsAllowedToAttack(caster, mob, true))
                {
                    continue;
                }

                if (mob.HasAbility(Abilities.CCImmunity) || mob.HasAbility(Abilities.RootImmunity) || mob.HasAbility(Abilities.DamageImmunity))
                {
                    continue;
                }

                GameSpellEffect mez = SpellHandler.FindEffectOnTarget(mob, "Mesmerize");
                if (mez != null)
                {
                    mez.Cancel(false);
                }

                mob.TakeDamage(caster, eDamageType.Spirit, dmgValue, 0);

                if (mob.EffectList.GetOfType <ChargeEffect>() == null && mob.EffectList.GetOfType <SpeedOfSoundEffect>() == null)
                {
                    mob.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 99 * 0.01);
                    m_rootExpire = new RegionTimer(mob, new RegionTimerCallback(RootExpires), duration);
                    GameEventMgr.AddHandler(mob, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
                    SendUpdates(mob);
                }

                caster.Out.SendMessage("You hit the " + mob.Name + " for " + dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);

                foreach (GamePlayer player2 in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    player2.Out.SendSpellEffectAnimation(caster, mob, 7029, 0, false, 1);
                }
            }

            foreach (GamePlayer aeplayer in living.GetPlayersInRadius(500))
            {
                if (!GameServer.ServerRules.IsAllowedToAttack(caster, aeplayer, true))
                {
                    continue;
                }

                GameSpellEffect mez = SpellHandler.FindEffectOnTarget(aeplayer, "Mesmerize");
                if (mez != null)
                {
                    mez.Cancel(false);
                }
                aeplayer.TakeDamage(caster, eDamageType.Spirit, dmgValue, 0);
                aeplayer.StartInterruptTimer(3000, AttackData.eAttackType.Spell, caster);

                if (aeplayer.EffectList.GetOfType <ChargeEffect>() == null && aeplayer.EffectList.GetOfType <SpeedOfSoundEffect>() == null)
                {
                    (aeplayer as GameLiving).BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 99 * 0.01);
                    m_rootExpire = new RegionTimer(aeplayer, new RegionTimerCallback(RootExpires), duration);
                    GameEventMgr.AddHandler(aeplayer, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
                    SendUpdates(aeplayer);
                }

                caster.Out.SendMessage("You hit " + aeplayer.Name + " for " + dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);

                foreach (GamePlayer player3 in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    player3.Out.SendSpellEffectAnimation(caster, aeplayer, 7029, 0, false, 1);
                }
            }

            DisableSkill(caster);
            timer.Stop();
            timer = null;
            return(0);
        }