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
|
|
@ -181,7 +181,6 @@ namespace Server.Mobiles
|
|||
public const int MaxOwners = 5;
|
||||
|
||||
public const int DefaultRangePerception = 16;
|
||||
public const int OldRangePerception = 10;
|
||||
|
||||
private const double ChanceToRummage = 0.5; // 50%
|
||||
|
||||
|
|
@ -350,15 +349,10 @@ namespace Server.Mobiles
|
|||
public BaseCreature(
|
||||
AIType ai,
|
||||
FightMode mode = FightMode.Closest,
|
||||
int iRangePerception = 10,
|
||||
int iRangePerception = DefaultRangePerception,
|
||||
int iRangeFight = 1
|
||||
)
|
||||
{
|
||||
if (iRangePerception == OldRangePerception)
|
||||
{
|
||||
iRangePerception = DefaultRangePerception;
|
||||
}
|
||||
|
||||
m_Loyalty = MaxLoyalty; // Wonderfully Happy
|
||||
|
||||
m_CurrentAI = ai;
|
||||
|
|
@ -1980,11 +1974,6 @@ namespace Server.Mobiles
|
|||
_passiveSpeed = reader.ReadDouble();
|
||||
_currentSpeed = reader.ReadDouble();
|
||||
|
||||
if (RangePerception == OldRangePerception)
|
||||
{
|
||||
RangePerception = DefaultRangePerception;
|
||||
}
|
||||
|
||||
m_Home.X = reader.ReadInt();
|
||||
m_Home.Y = reader.ReadInt();
|
||||
m_Home.Z = reader.ReadInt();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue