Fixes creatures aggro range, Wrong check on pathpoints, and a crash when there is no unitCaster.
This commit is contained in:
@@ -1786,10 +1786,10 @@ namespace Game.Entities
|
|||||||
float maxRadius = 45.0f * aggroRate;
|
float maxRadius = 45.0f * aggroRate;
|
||||||
float minRadius = 5.0f * aggroRate;
|
float minRadius = 5.0f * aggroRate;
|
||||||
|
|
||||||
uint expansionMaxLevel = Global.ObjectMgr.GetMaxLevelForExpansion((Expansion)GetCreatureTemplate().RequiredExpansion);
|
int expansionMaxLevel = (int)Global.ObjectMgr.GetMaxLevelForExpansion((Expansion)GetCreatureTemplate().RequiredExpansion);
|
||||||
uint playerLevel = player.GetLevelForTarget(this);
|
int playerLevel = (int)player.GetLevelForTarget(this);
|
||||||
uint creatureLevel = GetLevelForTarget(player);
|
int creatureLevel = (int)GetLevelForTarget(player);
|
||||||
uint levelDifference = creatureLevel - playerLevel;
|
int levelDifference = creatureLevel - playerLevel;
|
||||||
|
|
||||||
// The aggro radius for creatures with equal level as the player is 20 yards.
|
// The aggro radius for creatures with equal level as the player is 20 yards.
|
||||||
// The combatreach should not get taken into account for the distance so we drop it from the range (see Supremus as expample)
|
// The combatreach should not get taken into account for the distance so we drop it from the range (see Supremus as expample)
|
||||||
|
|||||||
@@ -952,7 +952,7 @@ namespace Game.Movement
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// check if we even need to do anything
|
// check if we even need to do anything
|
||||||
if ((_pathPoints[0] - target).LengthSquared() >= distSq)
|
if ((_pathPoints[_pathPoints.Length - 1] - target).LengthSquared() >= distSq)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int i = _pathPoints.Length - 1;
|
int i = _pathPoints.Length - 1;
|
||||||
|
|||||||
@@ -3372,7 +3372,7 @@ namespace Game.Spells
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Unit unitCaster = m_caster.ToUnit();
|
Unit unitCaster = m_caster.ToUnit();
|
||||||
if (unitCaster != null)
|
if (unitCaster == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// successful cast of the initial autorepeat spell is moved to idle state so that it is not deleted as long as autorepeat is active
|
// successful cast of the initial autorepeat spell is moved to idle state so that it is not deleted as long as autorepeat is active
|
||||||
|
|||||||
@@ -1018,7 +1018,7 @@ namespace Scripts.Spells.Mage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 205021 - Ray of Frost
|
[Script] // 205021 - Ray of Frost
|
||||||
class spell_mage_ray_of_frost : SpellScript
|
class spell_mage_ray_of_frost : SpellScript
|
||||||
{
|
{
|
||||||
public override bool Validate(SpellInfo spellInfo)
|
public override bool Validate(SpellInfo spellInfo)
|
||||||
@@ -1039,6 +1039,7 @@ namespace Scripts.Spells.Mage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Script]
|
||||||
class spell_mage_ray_of_frost_aura : AuraScript
|
class spell_mage_ray_of_frost_aura : AuraScript
|
||||||
{
|
{
|
||||||
public override bool Validate(SpellInfo spellInfo)
|
public override bool Validate(SpellInfo spellInfo)
|
||||||
|
|||||||
Reference in New Issue
Block a user