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
|
|
@ -4,7 +4,7 @@ using Server.Mobiles;
|
|||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class ArchCureSpell : MagerySpell, ISpellTargetingPoint3D
|
||||
public class ArchCureSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Arch Cure",
|
||||
|
|
@ -95,7 +95,7 @@ namespace Server.Spells.Fourth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetPoint3D(this, range: Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<IPoint3D>(this);
|
||||
}
|
||||
|
||||
private bool AreaCanTarget(Mobile target, bool feluccaRules)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using Server.Spells.Second;
|
|||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class ArchProtectionSpell : MagerySpell, ISpellTargetingPoint3D
|
||||
public class ArchProtectionSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Arch Protection",
|
||||
|
|
@ -94,7 +94,7 @@ namespace Server.Spells.Fourth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetPoint3D(this, range: Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<IPoint3D>(this);
|
||||
}
|
||||
|
||||
private static void AddEntry(Mobile m, int v)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class CurseSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class CurseSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Curse",
|
||||
|
|
@ -105,7 +105,7 @@ namespace Server.Spells.Fourth
|
|||
|
||||
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 RemoveEffect(Mobile m)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Server.Mobiles;
|
|||
|
||||
namespace Server.Spells.Fourth;
|
||||
|
||||
public class FireFieldSpell : MagerySpell, ISpellTargetingPoint3D
|
||||
public class FireFieldSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Fire Field",
|
||||
|
|
@ -60,7 +60,7 @@ public class FireFieldSpell : MagerySpell, ISpellTargetingPoint3D
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetPoint3D(this, range: Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<IPoint3D>(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class GreaterHealSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class GreaterHealSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Greater Heal",
|
||||
|
|
@ -72,7 +72,7 @@ namespace Server.Spells.Fourth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Beneficial, Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Beneficial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class LightningSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class LightningSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Lightning",
|
||||
|
|
@ -57,7 +57,7 @@ namespace Server.Spells.Fourth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Harmful);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Fourth
|
||||
{
|
||||
public class ManaDrainSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class ManaDrainSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Mana Drain",
|
||||
|
|
@ -77,7 +77,7 @@ namespace Server.Spells.Fourth
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Harmful);
|
||||
}
|
||||
|
||||
private static void AosDelay_Callback(Mobile m, int mana)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue