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
|
|
@ -5,11 +5,10 @@ using Server.Misc;
|
|||
using Server.Mobiles;
|
||||
using Server.Regions;
|
||||
using Server.SkillHandlers;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Spells.Ninjitsu;
|
||||
|
||||
public class Shadowjump : NinjaSpell, ISpellTargetingPoint3D
|
||||
public class Shadowjump : NinjaSpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Shadowjump",
|
||||
|
|
@ -29,6 +28,8 @@ public class Shadowjump : NinjaSpell, ISpellTargetingPoint3D
|
|||
|
||||
public override bool BlockedByAnimalForm => false;
|
||||
|
||||
public int TargetRange => 11;
|
||||
|
||||
public void Target(IPoint3D p)
|
||||
{
|
||||
var orig = p;
|
||||
|
|
@ -111,6 +112,6 @@ public class Shadowjump : NinjaSpell, ISpellTargetingPoint3D
|
|||
public override void OnCast()
|
||||
{
|
||||
Caster.SendLocalizedMessage(1063088); // You prepare to perform a Shadowjump.
|
||||
Caster.Target = new SpellTargetPoint3D(this, TargetFlags.None, 11);
|
||||
Caster.Target = new SpellTarget<IPoint3D>(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue