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.Fifth
|
||||
{
|
||||
public class BladeSpiritsSpell : MagerySpell, ISpellTargetingPoint3D
|
||||
public class BladeSpiritsSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Blade Spirits",
|
||||
|
|
@ -78,7 +78,7 @@ namespace Server.Spells.Fifth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetPoint3D(this, retryOnLOS: true);
|
||||
Caster.Target = new SpellTarget<IPoint3D>(this, retryOnLos: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using Server.Misc;
|
|||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class DispelFieldSpell : MagerySpell, ISpellTargetingItem
|
||||
public class DispelFieldSpell : MagerySpell, ITargetingSpell<Item>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Dispel Field",
|
||||
|
|
@ -51,7 +51,7 @@ namespace Server.Spells.Fifth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetItem(this, range: Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Item>(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class MindBlastSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class MindBlastSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Mind Blast",
|
||||
|
|
@ -110,7 +110,7 @@ namespace Server.Spells.Fifth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Harmful);
|
||||
}
|
||||
|
||||
private void AosDelay_Callback(Mobile caster, Mobile target, Mobile defender, int damage)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Fifth
|
||||
{
|
||||
public class ParalyzeSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class ParalyzeSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Paralyze",
|
||||
|
|
@ -82,7 +82,7 @@ namespace Server.Spells.Fifth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Harmful);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Server.Mobiles;
|
|||
|
||||
namespace Server.Spells.Fifth;
|
||||
|
||||
public class PoisonFieldSpell : MagerySpell, ISpellTargetingPoint3D
|
||||
public class PoisonFieldSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Poison Field",
|
||||
|
|
@ -57,7 +57,7 @@ public class PoisonFieldSpell : MagerySpell, ISpellTargetingPoint3D
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetPoint3D(this, range: Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<IPoint3D>(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue