Core/Creatures: Implemented CREATURE_STATIC_FLAG_4_NO_MELEE_APPROACH and fixed CREATURE_STATIC_FLAG_NO_MELEE_FLEE implementation (should cause fleeing from melee range)
Port From (https://github.com/TrinityCore/TrinityCore/commit/a748fddfa47216e1f516303e3bca9b5a86823748)
This commit is contained in:
@@ -1391,14 +1391,17 @@ namespace Game.Entities
|
||||
if (caster == null)
|
||||
caster = GetAttackerForHelper();
|
||||
GetMotionMaster().MoveFleeing(caster, TimeSpan.FromMilliseconds(fearAuras.Empty() ? WorldConfig.GetIntValue(WorldCfg.CreatureFamilyFleeDelay) : 0)); // caster == NULL processed in MoveFleeing
|
||||
SetUnitFlag(UnitFlags.Fleeing);
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveUnitFlag(UnitFlags.Fleeing);
|
||||
if (IsAlive())
|
||||
{
|
||||
GetMotionMaster().Remove(MovementGeneratorType.Fleeing);
|
||||
if (GetVictim() != null)
|
||||
SetTarget(GetVictim().GetGUID());
|
||||
Unit victim = GetVictim();
|
||||
if (victim != null)
|
||||
SetTarget(victim.GetGUID());
|
||||
if (!IsPlayer() && !IsInCombat())
|
||||
GetMotionMaster().MoveTargetedHome();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user