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.Targeting;
|
|||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class BlessSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class BlessSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Bless",
|
||||
|
|
@ -55,7 +55,7 @@ namespace Server.Spells.Third
|
|||
|
||||
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.Third
|
||||
{
|
||||
public class FireballSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class FireballSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Fireball",
|
||||
|
|
@ -59,7 +59,7 @@ namespace Server.Spells.Third
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Harmful);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using Server.Multis;
|
|||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class MagicLockSpell : MagerySpell, ISpellTargetingItem
|
||||
public class MagicLockSpell : MagerySpell, ITargetingSpell<Item>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Magic Lock",
|
||||
|
|
@ -62,7 +62,7 @@ namespace Server.Spells.Third
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetItem(this, range: Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Item>(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class PoisonSpell : MagerySpell, ISpellTargetingMobile
|
||||
public class PoisonSpell : MagerySpell, ITargetingSpell<Mobile>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Poison",
|
||||
|
|
@ -99,7 +99,7 @@ namespace Server.Spells.Third
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Mobile>(this, TargetFlags.Harmful);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using Server.Items;
|
|||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class TelekinesisSpell : MagerySpell, ISpellTargetingItem
|
||||
public class TelekinesisSpell : MagerySpell, ITargetingSpell<Item>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Telekinesis",
|
||||
|
|
@ -72,7 +72,7 @@ namespace Server.Spells.Third
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetItem(this, range: Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<Item>(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ using Server.Spells.Sixth;
|
|||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class TeleportSpell : MagerySpell, ISpellTargetingPoint3D
|
||||
public class TeleportSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Teleport",
|
||||
|
|
@ -139,7 +139,7 @@ namespace Server.Spells.Third
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
Caster.Target = new SpellTargetPoint3D(this, range: Core.ML ? 10 : 12);
|
||||
Caster.Target = new SpellTarget<IPoint3D>(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using Server.Multis;
|
|||
|
||||
namespace Server.Spells.Third
|
||||
{
|
||||
public class UnlockSpell : MagerySpell, ISpellTargetingPoint3D
|
||||
public class UnlockSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Unlock Spell",
|
||||
|
|
@ -84,7 +84,7 @@ namespace Server.Spells.Third
|
|||
|
||||
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.Mobiles;
|
|||
|
||||
namespace Server.Spells.Third;
|
||||
|
||||
public class WallOfStoneSpell : MagerySpell, ISpellTargetingPoint3D
|
||||
public class WallOfStoneSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
||||
{
|
||||
private static readonly SpellInfo _info = new(
|
||||
"Wall of Stone",
|
||||
|
|
@ -56,7 +56,7 @@ public class WallOfStoneSpell : 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