### Summary - Drastically streamlines the spell targeting by collapsing the target classes into a single `SpellTarget<T>` class. - Moves TargetRange to the spell itself so it can be used by MageAI. - Changes range check in MageAI to use TargetRange. This should fix target acquisition bugs
69 lines
1.9 KiB
C#
69 lines
1.9 KiB
C#
using Server.Targeting;
|
|
|
|
namespace Server.Spells.Sixth
|
|
{
|
|
public class EnergyBoltSpell : MagerySpell, ITargetingSpell<Mobile>
|
|
{
|
|
private static readonly SpellInfo _info = new(
|
|
"Energy Bolt",
|
|
"Corp Por",
|
|
230,
|
|
9022,
|
|
Reagent.BlackPearl,
|
|
Reagent.Nightshade
|
|
);
|
|
|
|
public EnergyBoltSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
|
|
{
|
|
}
|
|
|
|
public override SpellCircle Circle => SpellCircle.Sixth;
|
|
|
|
public override bool DelayedDamage => true;
|
|
|
|
public void Target(Mobile m)
|
|
{
|
|
if (CheckHSequence(m))
|
|
{
|
|
var source = Caster;
|
|
|
|
SpellHelper.Turn(Caster, m);
|
|
|
|
SpellHelper.CheckReflect((int)Circle, ref source, ref m);
|
|
|
|
double damage;
|
|
|
|
if (Core.AOS)
|
|
{
|
|
damage = GetNewAosDamage(40, 1, 5, m);
|
|
}
|
|
else
|
|
{
|
|
damage = Utility.Random(24, 18);
|
|
|
|
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);
|
|
}
|
|
}
|
|
|
|
public override void OnCast()
|
|
{
|
|
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Harmful);
|
|
}
|
|
}
|
|
}
|