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:
Kamron Batman 2024-08-08 07:05:27 -07:00 • committed by GitHub
parent 91e37fb8d4
commit 9b7fea2c20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
85 changed files with 255 additions and 313 deletions

View file

@ -4,7 +4,7 @@ using Server.Targeting;
namespace Server.Spells.Necromancy;
public class StrangleSpell : NecromancerSpell, ISpellTargetingMobile
public class StrangleSpell : NecromancerSpell, ITargetingSpell<Mobile>
{
private static readonly SpellInfo _info = new(
"Strangle",
@ -111,7 +111,7 @@ public class StrangleSpell : NecromancerSpell, ISpellTargetingMobile
public override void OnCast()
{
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12);
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Harmful);
}
public static bool RemoveCurse(Mobile m)