Example #1
0
			public void ApplyPoisonTo( Mobile m )
			{
				if ( m_Caster == null )
					return;

				Poison p;

				if ( Core.AOS )
				{
					int total = (m_Caster.Skills.Magery.Fixed + m_Caster.Skills.Poisoning.Fixed) / 2;

					if ( total >= 1000 )
						p = Poison.Deadly;
					else if ( total > 850 )
						p = Poison.Greater;
					else if ( total > 650 )
						p = Poison.Regular;
					else
						p = Poison.Lesser;
				}
				else
				{
					p = Poison.Regular;
				}

				if ( m.ApplyPoison( m_Caster, p ) == ApplyPoisonResult.Poisoned )
					if ( SpellHelper.CanRevealCaster( m ) )
						m_Caster.RevealingAction();

				if ( m is BaseCreature )
					( (BaseCreature) m ).OnHarmfulSpell( m_Caster );
			}
Example #2
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }

                    m_Caster.DoHarmful(m);

                    double duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.2);

                    m.Paralyze(TimeSpan.FromSeconds(duration));

                    m.PlaySound(0x204);
                    m.FixedEffect(0x376A, 10, 16);

                    if (m is BaseCreature)
                    {
                        ((BaseCreature)m).OnHarmfulSpell(m_Caster);
                    }
                }

                return(true);
            }
Example #3
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && (!Core.AOS || m != m_Caster) &&
                    SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }

                    m_Caster.DoHarmful(m);

                    var damage = m_Damage;

                    if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
                    {
                        damage = 1;

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

                    AOS.Damage(m, m_Caster, damage, 0, 100, 0, 0, 0);
                    m.PlaySound(0x208);

                    (m as BaseCreature)?.OnHarmfulSpell(m_Caster);
                }

                return(true);
            }
Example #4
0
            public override bool OnMoveOver(Mobile m)
            {
                if (this.Visible && this.m_Caster != null && (!Core.AOS || m != this.m_Caster) && SpellHelper.ValidIndirectTarget(this.m_Caster, m) && this.m_Caster.CanBeHarmful(m, false))
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        this.m_Caster.RevealingAction();
                    }

                    this.m_Caster.DoHarmful(m);

                    int damage = this.m_Damage;

                    if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
                    {
                        damage = 1;

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

                    m.Damage(damage, m_Caster);
                    m.PlaySound(0x208);

                    if (m is BaseCreature)
                    {
                        ((BaseCreature)m).OnHarmfulSpell(this.m_Caster);
                    }
                }

                return(true);
            }
Example #5
0
                protected override void OnTick()
                {
                    if (m_Item.Deleted)
                    {
                        return;
                    }

                    if (DateTime.UtcNow > m_Item.m_End)
                    {
                        m_Item.Delete();
                        Stop();
                    }
                    else
                    {
                        Map    map    = m_Item.Map;
                        Mobile caster = m_Item.m_Caster;

                        if (map != null && caster != null)
                        {
                            foreach (Mobile m in m_Item.GetMobilesInRange(0))
                            {
                                if ((m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && (!Core.AOS || m != caster) && SpellHelper.ValidIndirectTarget(caster, m) && caster.CanBeHarmful(m, false))
                                {
                                    m_Queue.Enqueue(m);
                                }
                            }

                            while (m_Queue.Count > 0)
                            {
                                Mobile m = (Mobile)m_Queue.Dequeue();

                                if (SpellHelper.CanRevealCaster(m))
                                {
                                    caster.RevealingAction();
                                }

                                caster.DoHarmful(m);

                                int damage = m_Item.m_Damage;

                                if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
                                {
                                    damage = 1;

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

                                AOS.Damage(m, caster, damage, 0, 100, 0, 0, 0);
                                m.PlaySound(0x208);

                                if (m is BaseCreature)
                                {
                                    ((BaseCreature)m).OnHarmfulSpell(caster);
                                }
                            }
                        }
                    }
                }
Example #6
0
                protected override void OnTick()
                {
                    if (m_Item.Deleted)
                    {
                        return;
                    }

                    if (DateTime.UtcNow > m_Item.m_End)
                    {
                        m_Item.Delete();
                        Stop();
                    }
                    else
                    {
                        Map    map    = m_Item.Map;
                        Mobile caster = m_Item.m_Caster;

                        if (map != null && caster != null)
                        {
                            IPooledEnumerable eable = m_Item.GetMobilesInRange(0);

                            foreach (Mobile m in eable)
                            {
                                if ((m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && m != caster && SpellHelper.ValidIndirectTarget(caster, m) && caster.CanBeHarmful(m, false))
                                {
                                    m_Queue.Enqueue(m);
                                }
                            }

                            eable.Free();

                            while (m_Queue.Count > 0)
                            {
                                Mobile m = (Mobile)m_Queue.Dequeue();

                                if (SpellHelper.CanRevealCaster(m))
                                {
                                    caster.RevealingAction();
                                }

                                caster.DoHarmful(m);

                                int damage = m_Item.m_Damage;

                                AOS.Damage(m, caster, damage, 0, 100, 0, 0, 0);
                                m.PlaySound(0x208);

                                if (m is BaseCreature)
                                {
                                    ((BaseCreature)m).OnHarmfulSpell(caster);
                                }
                            }
                        }
                    }
                }
Example #7
0
        private static void DealDamage(Mobile caster, Mobile target, double power)
        {
            if (SpellHelper.CanRevealCaster(target))
            {
                caster.RevealingAction();
            }

            caster.DoHarmful(target);
            SpellHelper.Damage(Utility.Dice((uint)power, 8, 0), target, caster, null, null, ElementalType.Fire);
            target.PlaySound(0x208);
        }
Example #8
0
            public void ApplyPoisonTo(Mobile m)
            {
                if (m_Caster == null)
                {
                    return;
                }

                Poison p;

                if (Core.AOS)
                {
                    int total = (int)(m_Caster.Skills[SkillName.Magery].Value + m_Caster.Skills[SkillName.Poisoning].Value);

                    if (total >= 250)
                    {
                        p = Poison.Lethal;
                    }
                    else if (total >= 200)
                    {
                        p = Poison.Deadly;
                    }
                    else if (total >= 150)
                    {
                        p = Poison.Greater;
                    }
                    else if (total >= 100)
                    {
                        p = Poison.Regular;
                    }
                    else
                    {
                        p = Poison.Lesser;
                    }
                }
                else
                {
                    p = Poison.Regular;
                }

                if (m.ApplyPoison(m_Caster, p) == ApplyPoisonResult.Poisoned)
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }
                }

                if (m is BaseCreature)
                {
                    ((BaseCreature)m).OnHarmfulSpell(m_Caster);
                }
            }
Example #9
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }

                    m_Caster.DoHarmful(m);

                    double duration;

                    int nBenefit = 0;
                    if (m_Caster is PlayerMobile)
                    {
                        nBenefit = (int)(m_Caster.Skills[SkillName.Magery].Value / 2);
                    }

                    if (Core.AOS)
                    {
                        duration = 2.0 + ((int)(m_Caster.Skills[SkillName.EvalInt].Value / 10) - (int)(m.Skills[SkillName.MagicResist].Value / 10)) + nBenefit;

                        if (!m.Player)
                        {
                            duration *= 3.0;
                        }

                        if (duration < 0.0)
                        {
                            duration = 0.0;
                        }
                    }
                    else
                    {
                        duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.2) + nBenefit;
                    }

                    m.Paralyze(TimeSpan.FromSeconds(duration));

                    m.PlaySound(0x204);
                    m.FixedEffect(0x376A, 10, 16, Server.Items.CharacterDatabase.GetMySpellHue(m_Caster, 0), 0);

                    if (m is BaseCreature)
                    {
                        ((BaseCreature)m).OnHarmfulSpell(m_Caster);
                    }
                }

                return(true);
            }
Example #10
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }

                    m_Caster.DoHarmful(m);

                    double duration;

                    if (Core.AOS)
                    {
                        duration = 2.0 + ((int)(m_Caster.Skills[SkillName.EvalInt].Value / 10) - (int)(m.Skills[SkillName.MagicResist].Value / 10));

                        if (!m.Player)
                        {
                            duration *= 3.0;
                        }

                        if (duration < 0.0)
                        {
                            duration = 0.0;
                        }
                    }
                    else
                    {
                        duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.2);
                    }

                    m.Paralyze(TimeSpan.FromSeconds(duration));

                    m.PlaySound(0x204);
                    m.FixedEffect(0x376A, 10, 16);

                    if (m is BaseMobile bm)
                    {
                        bm.OnHarmfulSpell(m_Caster);
                    }
                }

                return(true);
            }
Example #11
0
            public void ApplyPoisonTo(Mobile m)
            {
                if (m_Caster == null)
                {
                    return;
                }

                Poison p;

                if (Core.AOS)
                {
                    int total = (m_Caster.Skills.Magery.Fixed + m_Caster.Skills.Poisoning.Fixed) / 2;

                    if (total >= 1000)
                    {
                        p = Poison.Deadly;
                    }
                    else if (total > 850)
                    {
                        p = Poison.Greater;
                    }
                    else if (total > 650)
                    {
                        p = Poison.Regular;
                    }
                    else
                    {
                        p = Poison.Lesser;
                    }
                }
                else
                {
                    p = Poison.Regular;
                }

                if (m.ApplyPoison(m_Caster, p) == ApplyPoisonResult.Poisoned)
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }
                }
            }
        private static void TryPoison(Mobile caster, Mobile target, double power)
        {
            caster.DoHarmful(target);

            var level = SpellHelper.TryResist(caster, target, SpellCircle.Fifth)
                ? Utility.Dice(1, (uint)power, 0)
                : (int)power;

            var p = Poison.GetPoison(Math.Min(level, Poison.Poisons.Count - 1));

            target.PlaySound(0x474);

            if (target.ApplyPoison(caster, p) == ApplyPoisonResult.Poisoned)
            {
                if (SpellHelper.CanRevealCaster(target))
                {
                    caster.RevealingAction();
                }
            }
        }
Example #13
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && Caster != null && (!Core.AOS || m != Caster) && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        Caster.RevealingAction();
                    }

                    SkillName damageSkill = Caster.Skills[SkillName.Focus].Value > Caster.Skills[SkillName.Imbuing].Value ? SkillName.Focus : SkillName.Imbuing;

                    double skill = ((Caster.Skills[SkillName.Mysticism].Value) + Caster.Skills[damageSkill].Value * 2) / 3;
                    skill /= m.Player ? 3.5 : 2;

                    int damage = (int)skill + Utility.RandomMinMax(-3, 3);

                    AOS.Damage(m, Caster, damage, 0, 0, 0, 0, 0, 100, 0, DamageType.SpellAOE);
                }

                return(true);
            }
Example #14
0
            public void ApplyPoisonTo(Mobile m)
            {
                if (m_Caster == null)
                {
                    return;
                }

                Poison p = Poison.Regular;

                if (m.ApplyPoison(m_Caster, p) == ApplyPoisonResult.Poisoned)
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }
                }

                if (m is BaseCreature)
                {
                    ((BaseCreature)m).OnHarmfulSpell(m_Caster);
                }
            }
Example #15
0
        private bool DoDamage(Mobile m, NetherBlastItem item)
        {
            if (item.Visible && Caster != null && (!Core.AOS || m != Caster) && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
            {
                if (SpellHelper.CanRevealCaster(m))
                {
                    Caster.RevealingAction();
                }

                SkillName damageSkill = Caster.Skills[SkillName.Focus].Value > Caster.Skills[SkillName.Imbuing].Value ? SkillName.Focus : SkillName.Imbuing;

                double skill = (Caster.Skills[SkillName.Mysticism].Value + Caster.Skills[damageSkill].Value * 2) / 3;
                skill /= m.Player ? 3.5 : 2;

                int damage = (int)skill + Utility.RandomMinMax(-3, 3);
                damage *= (int)GetDamageScalar(m);

                int sdiBonus = SpellHelper.GetSpellDamageBonus(Caster, m, CastSkill, Caster.Player && m.Player);

                damage *= 100 + sdiBonus;
                damage /= 100;
                Caster.DoHarmful(m);

                m.FixedParticles(0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255);

                AOS.Damage(m, Caster, damage, 0, 0, 0, 0, 0, 100, 0, DamageType.SpellAOE);

                int manaRip = Math.Min(m.Mana, damage / 4);

                if (manaRip > 0)
                {
                    m.Mana      -= manaRip;
                    Caster.Mana += manaRip;
                }
            }

            return(true);
        }
            public override bool OnMoveOver(Mobile m)
            {
                bool CanAffect = true;

                if (m is BaseCreature)
                {
                    SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver);
                    SlayerEntry elly   = SlayerGroup.GetEntryByName(SlayerName.ElementalBan);
                    SlayerEntry golem  = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction);
                    if (undead.Slays(m) || elly.Slays(m) || golem.Slays(m))
                    {
                        CanAffect = false;
                    }
                }

                if (Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false) && CanAffect)
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }

                    m_Caster.DoHarmful(m);

                    TimeSpan duration = TimeSpan.FromSeconds((DamagingSkill(m_Caster) / 4));

                    m.Paralyze(duration);

                    m.PlaySound(0x657);

                    m.FixedParticles(0x3039, 9, 32, 5008, Server.Items.CharacterDatabase.GetMySpellHue(m_Caster, 0xB72), 0, EffectLayer.Waist);

                    new SleepyTimer(m, duration).Start();
                }

                return(true);
            }
Example #17
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }

                    m_Caster.DoHarmful(m);

                    int damage = m_Damage;

                    AOS.Damage(m, m_Caster, damage, 0, 0, 100, 0, 0);
                    m.PlaySound(0x5C7);

                    if (m is BaseCreature)
                    {
                        ((BaseCreature)m).OnHarmfulSpell(m_Caster);
                    }
                }

                return(true);
            }
Example #18
0
                protected override void OnTick()
                {
                    if (m_Item.Deleted)
                    {
                        return;
                    }

                    if (!m_Item.Visible)
                    {
                        if (m_InLOS && m_CanFit)
                        {
                            m_Item.Visible = true;
                        }
                        else
                        {
                            m_Item.Delete();
                        }

                        if (!m_Item.Deleted)
                        {
                            m_Item.ProcessDelta();
                            Effects.SendLocationParticles(
                                EffectItem.Create(m_Item.Location, m_Item.Map, EffectItem.DefaultDuration),
                                0x376A,
                                9,
                                10,
                                5029
                                );
                        }
                    }
                    else if (DateTime.UtcNow > m_Item.m_End)
                    {
                        m_Item.Delete();
                        Stop();
                    }
                    else
                    {
                        var map    = m_Item.Map;
                        var caster = m_Item.m_Caster;

                        if (map == null || caster == null)
                        {
                            return;
                        }

                        foreach (var m in m_Item.GetMobilesInRange(0))
                        {
                            if (m.Z + 16 > m_Item.Z && m_Item.Z + 12 > m.Z && (!Core.AOS || m != caster) &&
                                SpellHelper.ValidIndirectTarget(caster, m) && caster.CanBeHarmful(m, false))
                            {
                                m_Queue.Enqueue(m);
                            }
                        }

                        while (m_Queue.Count > 0)
                        {
                            var m = (Mobile)m_Queue.Dequeue();

                            if (SpellHelper.CanRevealCaster(m))
                            {
                                caster.RevealingAction();
                            }

                            caster.DoHarmful(m);

                            var damage = m_Item.m_Damage;

                            if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
                            {
                                damage = 1;

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

                            AOS.Damage(m, caster, damage, 0, 100, 0, 0, 0);
                            m.PlaySound(0x208);

                            (m as BaseCreature)?.OnHarmfulSpell(caster);
                        }
                    }
                }
Example #19
0
                protected override void OnTick()
                {
                    if (this.m_Item.Deleted)
                    {
                        return;
                    }

                    if (!this.m_Item.Visible)
                    {
                        if (this.m_InLOS && this.m_CanFit)
                        {
                            this.m_Item.Visible = true;
                        }
                        else
                        {
                            this.m_Item.Delete();
                        }

                        if (!this.m_Item.Deleted)
                        {
                            this.m_Item.ProcessDelta();
                            Effects.SendLocationParticles(EffectItem.Create(this.m_Item.Location, this.m_Item.Map, EffectItem.DefaultDuration), 0x376A, 9, 10, 5029);
                        }
                    }
                    else if (DateTime.UtcNow > this.m_Item.m_End)
                    {
                        this.m_Item.Delete();
                        this.Stop();
                    }
                    else
                    {
                        Map    map    = this.m_Item.Map;
                        Mobile caster = this.m_Item.m_Caster;

                        if (map != null && caster != null)
                        {
                            foreach (Mobile m in this.m_Item.GetMobilesInRange(0))
                            {
                                if ((m.Z + 16) > this.m_Item.Z && (this.m_Item.Z + 12) > m.Z && (!Core.AOS || m != caster) && SpellHelper.ValidIndirectTarget(caster, m) && caster.CanBeHarmful(m, false))
                                {
                                    m_Queue.Enqueue(m);
                                }
                            }

                            while (m_Queue.Count > 0)
                            {
                                Mobile m = (Mobile)m_Queue.Dequeue();

                                if (SpellHelper.CanRevealCaster(m))
                                {
                                    caster.RevealingAction();
                                }

                                caster.DoHarmful(m);

                                int damage = this.m_Item.m_Damage;

                                if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0))
                                {
                                    damage = 1;

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

                                m.Damage(damage, caster);
                                m.PlaySound(0x208);

                                if (m is BaseCreature)
                                {
                                    ((BaseCreature)m).OnHarmfulSpell(caster);
                                }
                            }
                        }
                    }
                }
Example #20
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && (!EraAOS || m != m_Caster) && SpellHelper.ValidIndirectTarget(m_Caster, m) &&
                    m_Caster.CanBeHarmful(m, false))
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }

                    m_Caster.DoHarmful(m);

                    double duration = 0.0;

                    if (EraAOS)
                    {
                        duration = 2.0 +
                                   ((int)(m_Caster.Skills[SkillName.EvalInt].Value / 10) - (int)(m.Skills[SkillName.MagicResist].Value / 10));

                        if (!m.Player)
                        {
                            duration *= 3.0;
                        }

                        if (duration < 0.0)
                        {
                            duration = 0.0;
                        }
                    }
                    else if (EraUOR)
                    {
                        double magery = m_Caster.Skills.Magery.Value;

                        if (m.Player)
                        {
                            magery = Math.Min(magery, 100.0);

                            if (m_Caster.Skills.Magery.Value > 100.0)
                            {
                                magery *= 1.0 + ((m_Caster.Skills.Magery.Value / 120.0) * 0.1);
                            }
                        }

                        duration = 7.0 + (magery * 0.2);
                    }
                    else if (EraT2A)
                    {
                        // HACK: Convert to T2A mechanics.
                        double magery = m_Caster.Skills.Magery.Value;

                        if (m.Player)
                        {
                            magery = Math.Min(magery, 100.0);
                            if (m_Caster.Skills.Magery.Value > 100.0)
                            {
                                magery *= 1.0 + ((m_Caster.Skills.Magery.Value / 120.0) * 0.1);
                            }
                        }

                        duration = 7.0 + (magery * 0.2);
                    }

                    m.Paralyze(TimeSpan.FromSeconds(duration));

                    m.PlaySound(0x204);
                    m.FixedEffect(0x376A, 10, 16);

                    if (m is BaseCreature)
                    {
                        ((BaseCreature)m).OnHarmfulSpell(m_Caster);
                    }
                }

                return(true);
            }
        public async Task OnTargetAsync(ITargetResponse <IPoint3D> response)
        {
            if (!response.HasValue)
            {
                return;
            }

            var point = SpellHelper.GetSurfaceTop(response.Target);

            SpellHelper.Turn(Caster, point);

            Effects.PlaySound(point, Caster.Map, 0x20B);

            var power = 2.0;

            Caster.FireHook(h => h.OnModifyWithMagicEfficiency(Caster, ref power));

            var seconds = Caster.Skills[SkillName.Magery].Value / 5.0 + 20.0;

            Caster.FireHook(h => h.OnModifyWithMagicEfficiency(Caster, ref seconds));
            var duration = TimeSpan.FromSeconds(seconds);

            FieldItem.CreateField(
                (0x3967, 0x3979),
                point,
                Caster,
                duration,
                TimeSpan.Zero,
                onCreate: item => Effects.SendLocationParticles(
                    EffectItem.Create(item.Location, Caster.Map, EffectItem.DefaultDuration),
                    0x376A,
                    9,
                    10,
                    5048
                    ),
                onMoveOver: mobile =>
            {
                if (SpellHelper.ValidIndirectTarget(Caster, mobile) && Caster.CanBeHarmful(mobile, false))
                {
                    if (SpellHelper.CanRevealCaster(mobile))
                    {
                        Caster.RevealingAction();
                    }

                    Caster.DoHarmful(mobile);

                    var paralyzeDuration = 10.0;
                    Caster.FireHook(h => h.OnModifyWithMagicEfficiency(Caster, ref paralyzeDuration));

                    if (!SpellHelper.TryResist(Caster, mobile, SpellCircle.Fifth))
                    {
                        mobile.Paralyze(TimeSpan.FromSeconds(paralyzeDuration));
                        mobile.PlaySound(0x204);
                        mobile.FixedEffect(0x376A, 10, 16);
                    }
                }

                return(true);
            }
                );
        }
Example #22
0
                protected override void OnTick()
                {
                    if (m_Item.Deleted)
                    {
                        return;
                    }

                    if (!m_Item.Visible)
                    {
                        if (m_InLOS && m_CanFit)
                        {
                            m_Item.Visible = true;
                        }
                        else
                        {
                            m_Item.Delete();
                        }

                        if (!m_Item.Deleted)
                        {
                            m_Item.ProcessDelta();
                            Effects.SendLocationParticles(EffectItem.Create(m_Item.Location, m_Item.Map, EffectItem.DefaultDuration), 0x376A, 9, 10, Server.Items.CharacterDatabase.GetMySpellHue(m_Item.m_Caster, 0xB77), 0, 5029, 0);
                        }
                    }
                    else if (DateTime.Now > m_Item.m_End)
                    {
                        m_Item.Delete();
                        Stop();
                    }
                    else
                    {
                        Map    map    = m_Item.Map;
                        Mobile caster = m_Item.m_Caster;

                        if (map != null && caster != null)
                        {
                            foreach (Mobile m in m_Item.GetMobilesInRange(0))
                            {
                                if ((m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && (!Core.AOS || m != caster) && SpellHelper.ValidIndirectTarget(caster, m) && caster.CanBeHarmful(m, false))
                                {
                                    m_Queue.Enqueue(m);
                                }
                            }

                            while (m_Queue.Count > 0)
                            {
                                Mobile m = (Mobile)m_Queue.Dequeue();

                                if (SpellHelper.CanRevealCaster(m))
                                {
                                    caster.RevealingAction();
                                }

                                caster.DoHarmful(m);

                                int damage = m_Item.m_Damage;

                                AOS.Damage(m, caster, damage, 0, 0, 100, 0, 0);
                                m.PlaySound(0x5C7);

                                if (m is BaseCreature)
                                {
                                    ((BaseCreature)m).OnHarmfulSpell(caster);
                                }
                            }
                        }
                    }
                }