diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 9f1e43ee0..947fbbf72 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -713,7 +713,6 @@ namespace Game.Entities var creature = searcher.GetTarget(); SetNoSearchAssistance(true); - UpdateSpeed(UnitMoveType.Run); if (!creature) SetControlled(true, UnitState.Fleeing); @@ -1810,13 +1809,8 @@ namespace Game.Entities SetMountDisplayId(0); // if creature is mounted on a virtual mount, remove it at death - SetActive(false); - - if (HasSearchedAssistance()) - { - SetNoSearchAssistance(false); - UpdateSpeed(UnitMoveType.Run); - } + SetActive(false); + SetNoSearchAssistance(false); //Dismiss group if is leader if (m_formation != null && m_formation.GetLeader() == this) diff --git a/Source/Game/Entities/Unit/Unit.Combat.cs b/Source/Game/Entities/Unit/Unit.Combat.cs index e62589d91..f4f18a52b 100644 --- a/Source/Game/Entities/Unit/Unit.Combat.cs +++ b/Source/Game/Entities/Unit/Unit.Combat.cs @@ -400,16 +400,8 @@ namespace Game.Entities // reset only at real combat stop Creature creature = ToCreature(); if (creature != null) - { creature.SetNoCallAssistance(false); - if (creature.HasSearchedAssistance()) - { - creature.SetNoSearchAssistance(false); - UpdateSpeed(UnitMoveType.Run); - } - } - SendMeleeAttackStop(victim); return true; } diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index 7fc67778a..d7d45873c 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -543,10 +543,6 @@ namespace Game.Entities Creature creature = ToCreature(); if (creature != null) { - // for creature case, we check explicit if mob searched for assistance - if (ToCreature().HasSearchedAssistance()) - speed *= 0.66f; // best guessed value, so this will be 33% reduction. Based off initial speed, mob can then "run", "walk fast" or "walk". - if (creature.HasUnitTypeMask(UnitTypeMask.Minion) && !creature.IsInCombat()) { if (GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Follow) diff --git a/Source/Game/Movement/Generators/HomeMovement.cs b/Source/Game/Movement/Generators/HomeMovement.cs index 39725b443..b6a4b1d42 100644 --- a/Source/Game/Movement/Generators/HomeMovement.cs +++ b/Source/Game/Movement/Generators/HomeMovement.cs @@ -36,6 +36,8 @@ namespace Game.AI RemoveFlag(MovementGeneratorFlags.InitializationPending | MovementGeneratorFlags.Deactivated); AddFlag(MovementGeneratorFlags.Initialized); + owner.SetNoSearchAssistance(false); + SetTargetLocation(owner); } diff --git a/Source/Game/Movement/Generators/PointMovement.cs b/Source/Game/Movement/Generators/PointMovement.cs index 4aff4847b..6024f4e45 100644 --- a/Source/Game/Movement/Generators/PointMovement.cs +++ b/Source/Game/Movement/Generators/PointMovement.cs @@ -185,7 +185,7 @@ namespace Game.Movement public class AssistanceMovementGenerator : PointMovementGenerator { - public AssistanceMovementGenerator(uint id, float x, float y, float z, float speed = 0.0f) : base(id, x, y, z, true, speed) { } + public AssistanceMovementGenerator(uint id, float x, float y, float z) : base(id, x, y, z, true) { } public override void Finalize(Unit owner, bool active, bool movementInform) { diff --git a/Source/Game/Movement/MotionMaster.cs b/Source/Game/Movement/MotionMaster.cs index 931cf0c84..c8a748eeb 100644 --- a/Source/Game/Movement/MotionMaster.cs +++ b/Source/Game/Movement/MotionMaster.cs @@ -914,12 +914,15 @@ namespace Game.Movement public void MoveSeekAssistance(float x, float y, float z) { - if (_owner.IsCreature()) + Creature creature = _owner.ToCreature(); + if (creature != null) { - _owner.AttackStop(); - _owner.CastStop(); - _owner.ToCreature().SetReactState(ReactStates.Passive); - Add(new AssistanceMovementGenerator(EventId.AssistMove, x, y, z, _owner.GetSpeed(UnitMoveType.Run) * 0.66f)); + Log.outDebug(LogFilter.Movement, $"MotionMaster::MoveSeekAssistance: '{creature.GetGUID()}', seeks assistance (X: {x}, Y: {y}, Z: {z})"); + creature.AttackStop(); + creature.CastStop(); + creature.DoNotReacquireSpellFocusTarget(); + creature.SetReactState(ReactStates.Passive); + Add(new AssistanceMovementGenerator(EventId.AssistMove, x, y, z)); } else Log.outError(LogFilter.Server, $"MotionMaster::MoveSeekAssistance: {_owner.GetGUID()}, attempted to seek assistance"); diff --git a/Source/Game/Movement/MoveSplineInit.cs b/Source/Game/Movement/MoveSplineInit.cs index da3bb115c..60e789588 100644 --- a/Source/Game/Movement/MoveSplineInit.cs +++ b/Source/Game/Movement/MoveSplineInit.cs @@ -122,6 +122,10 @@ namespace Game.Movement moveFlagsForSpeed &= ~MovementFlag.Walking; args.velocity = unit.GetSpeed(SelectSpeedType(moveFlagsForSpeed)); + Creature creature = unit.ToCreature(); + if (creature != null) + if (creature.HasSearchedAssistance()) + args.velocity *= 0.66f; } // limit the speed in the same way the client does