fix: Magic NPCs now use spell range (#1870)
### 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
This commit is contained in:
parent
91e37fb8d4
commit
9b7fea2c20
85 changed files with 255 additions and 313 deletions
|
|
@ -3,7 +3,7 @@ using Server.Mobiles;
|
|||
|
||||
namespace Server.Spells.Eighth
|
||||
{
|
||||
public class EnergyVortexSpell : MagerySpell, ISpellTargetingPoint3D
|
||||
public class EnergyVortexSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Energy Vortex",
|
||||
|
|
@ -60,7 +60,7 @@ namespace Server.Spells.Eighth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetPoint3D(this, retryOnLOS: true);
|
||||
Caster.Target = new SpellTarget<IPoint3D>(this, retryOnLos: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Eighth
|
||||
{
|
||||
public class ResurrectionSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class ResurrectionSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Resurrection",
|
||||
|
|
@ -22,6 +22,8 @@ namespace Server.Spells.Eighth
|
|||
|
||||
public override SpellCircle Circle => SpellCircle.Eighth;
|
||||
|
||||
public int TargetRange => 1;
|
||||
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (m == Caster)
|
||||
|
|
@ -79,7 +81,7 @@ namespace Server.Spells.Eighth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Beneficial, 1);
|
||||
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Beneficial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue