protected override void OnTick()
            {
                if (m_Attacker.HarmfulCheck(m_Defender))
                {
                    double damage;

                    if (Core.AOS)
                    {
                        damage = m_Spell.GetNewAosDamage(40, 1, 5, m_Defender);
                    }
                    else
                    {
                        damage = SpellController.GetDamage(SpellController.ExplosionDamage);

                        if (m_Spell.CheckResisted(m_Target))
                        {
                            damage *= 0.75;

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

                        damage *= m_Spell.GetDamageScalar(m_Target);
                    }

                    m_Target.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                    m_Target.PlaySound(0x307);

                    SpellHelper.Damage(m_Spell, m_Target, damage, 0, 100, 0, 0, 0);

                    if (m_Spell != null)
                    {
                        m_Spell.RemoveDelayedDamageContext(m_Attacker);
                    }
                }
            }
Example #2
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(17, 1, 5, m);
                }
                else
                {
                    damage = SpellController.GetDamage(SpellController.HarmDamage);

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

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

                    damage *= GetDamageScalar(m);
                }

                if (!m.InRange(Caster, 2))
                {
                    damage *= 0.25;                     // 1/4 damage at > 2 tile range
                }
                else if (!m.InRange(Caster, 1))
                {
                    damage *= 0.50;                     // 1/2 damage at 2 tile range
                }
                if (Core.AOS)
                {
                    m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
                    m.PlaySound(0x0FC);
                }
                else
                {
                    m.FixedParticles(0x374A, 10, 15, 5013, EffectLayer.Waist);
                    m.PlaySound(0x1F1);
                }

                SpellHelper.Damage(this, m, damage, 0, 0, 100, 0, 0);
            }

            FinishSequence();
        }
Example #3
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m.IsDeadBondedPet)
            {
                Caster.SendLocalizedMessage(1060177);                   // You cannot heal a creature that is already dead!
            }
            else if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
            {
                Caster.SendLocalizedMessage(1061654);                   // You cannot heal that which is not alive.
            }
            else if (m is Golem)
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500951);                   // You cannot heal that.
            }
            else if (m.Poisoned || Server.Items.MortalStrike.IsWounded(m))
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398);
            }
            else if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                int toHeal;

                if (Core.AOS)
                {
                    toHeal  = Caster.Skills.Magery.Fixed / 120;
                    toHeal += Utility.RandomMinMax(1, 4);

                    if (Core.SE && Caster != m)
                    {
                        toHeal = (int)(toHeal * 1.5);
                    }
                }
                else
                {
                    toHeal  = (int)(Caster.Skills[SkillName.Magery].Value * 0.1);
                    toHeal += SpellController.GetDamage(SpellController.HealDamage);
                }

                m.Heal(toHeal);

                m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
                m.PlaySound(0x1F2);
            }

            FinishSequence();
        }
Example #4
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, ref source, ref m);

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(40, 1, 5, m);
                }
                else
                {
                    damage = SpellController.GetDamage(SpellController.EnergyBoltDamage);

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

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

                    // Scale damage based on evalint and resist
                    damage *= GetDamageScalar(m);
                }

                // Do the effects
                source.MovingParticles(m, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
                source.PlaySound(0x20A);

                // Deal the damage
                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.Turn(source, m);

                SpellHelper.CheckReflect((int)this.Circle, ref source, ref m);

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(19, 1, 5, m);
                }
                else
                {
                    damage = SpellController.GetDamage(SpellController.FireballDamage);

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

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

                    damage *= GetDamageScalar(m);
                }

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

                SpellHelper.Damage(this, m, damage, 0, 100, 0, 0, 0);
            }

            FinishSequence();
        }
Example #6
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(48, 1, 5, m);
                }
                else
                {
                    damage = SpellController.GetDamage(SpellController.FlameStrikeDamage);

                    if (CheckResisted(m))
                    {
                        damage *= 0.6;

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

                    damage *= GetDamageScalar(m);
                }

                m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                m.PlaySound(0x208);

                SpellHelper.Damage(this, m, damage, 0, 100, 0, 0, 0);
            }

            FinishSequence();
        }
Example #7
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(23, 1, 4, m);
                }
                else
                {
                    damage = SpellController.GetDamage(SpellController.LightningDamage);

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

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

                    damage *= GetDamageScalar(m);
                }

                m.BoltEffect(0);

                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

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

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                bool playerVsPlayer = false;

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

                    foreach (Mobile m in eable)
                    {
                        if (Core.AOS && m == Caster)
                        {
                            continue;
                        }

                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                        {
                            if (Core.AOS && !Caster.InLOS(m))
                            {
                                continue;
                            }

                            targets.Add(m);

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

                    eable.Free();
                }

                double damage;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(51, 1, 5, playerVsPlayer);
                }
                else
                {
                    damage = SpellController.GetDamage(SpellController.ChainLightningDamage);
                }

                if (targets.Count > 0)
                {
                    if (Core.AOS && targets.Count > 2)
                    {
                        damage = (damage * 2) / targets.Count;
                    }
                    else if (!Core.AOS)
                    {
                        damage /= targets.Count;
                    }

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

                        double toDeal = damage;

                        if (!Core.AOS && CheckResisted(m))
                        {
                            toDeal *= 0.5;

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

                        Caster.DoHarmful(m);
                        SpellHelper.Damage(this, m, toDeal, 0, 0, 0, 0, 100);

                        m.BoltEffect(0);
                    }
                }
            }

            FinishSequence();
        }