diff options
Diffstat (limited to 'src')
6 files changed, 15 insertions, 23 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 1dce8415082..5274a37d7fd 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -950,7 +950,6 @@ void Creature::DoFleeToGetAssistance() Cell::VisitGridObjects(this, searcher, radius); SetNoSearchAssistance(true); - UpdateSpeed(MOVE_RUN); if (!creature) /// @todo use 31365 @@ -1957,11 +1956,7 @@ void Creature::setDeathState(DeathState s) setActive(false); - if (HasSearchedAssistance()) - { - SetNoSearchAssistance(false); - UpdateSpeed(MOVE_RUN); - } + SetNoSearchAssistance(false); //Dismiss group if is leader if (m_formation && m_formation->GetLeader() == this) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index aac027daab7..aba659b93a0 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5573,12 +5573,6 @@ bool Unit::AttackStop() if (Creature* creature = ToCreature()) { creature->SetNoCallAssistance(false); - - if (creature->HasSearchedAssistance()) - { - creature->SetNoSearchAssistance(false); - UpdateSpeed(MOVE_RUN); - } } SendMeleeAttackStop(victim); @@ -8488,10 +8482,6 @@ void Unit::UpdateSpeed(UnitMoveType mtype) if (Creature* creature = ToCreature()) { - // for creature case, we check explicit if mob searched for assistance - if (creature->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(UNIT_MASK_MINION) && !creature->IsInCombat()) { if (GetMotionMaster()->GetCurrentMovementGeneratorType() == FOLLOW_MOTION_TYPE) diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 56934f67c7c..32d0661020c 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -929,13 +929,14 @@ void MotionMaster::MoveFall(uint32 id/* = 0*/) void MotionMaster::MoveSeekAssistance(float x, float y, float z) { - if (_owner->GetTypeId() == TYPEID_UNIT) + if (Creature* creature = _owner->ToCreature()) { - TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveSeekAssistance: '%s', seeks assistance (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), x, y, z); - _owner->AttackStop(); - _owner->CastStop(); - _owner->ToCreature()->SetReactState(REACT_PASSIVE); - Add(new AssistanceMovementGenerator(EVENT_ASSIST_MOVE, x, y, z, _owner->GetSpeed(MOVE_RUN) * 0.66f)); + TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveSeekAssistance: '%s', seeks assistance (X: %f, Y: %f, Z: %f)", creature->GetGUID().ToString().c_str(), x, y, z); + creature->AttackStop(); + creature->CastStop(); + creature->DoNotReacquireSpellFocusTarget(); + creature->SetReactState(REACT_PASSIVE); + Add(new AssistanceMovementGenerator(EVENT_ASSIST_MOVE, x, y, z)); } else TC_LOG_ERROR("movement.motionmaster", "MotionMaster::MoveSeekAssistance: '%s', attempted to seek assistance.", _owner->GetGUID().ToString().c_str()); diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index ce7bb76ce09..ee089dfdde9 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -90,6 +90,8 @@ void HomeMovementGenerator<Creature>::DoInitialize(Creature* owner) RemoveFlag(MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING | MOVEMENTGENERATOR_FLAG_DEACTIVATED); AddFlag(MOVEMENTGENERATOR_FLAG_INITIALIZED); + owner->SetNoSearchAssistance(false); + SetTargetLocation(owner); } diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index 8a892b35220..542c918d360 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -56,7 +56,7 @@ class PointMovementGenerator : public MovementGeneratorMedium<T, PointMovementGe class AssistanceMovementGenerator : public PointMovementGenerator<Creature> { public: - explicit AssistanceMovementGenerator(uint32 id, float x, float y, float z, float speed = 0.0f) : PointMovementGenerator<Creature>(id, x, y, z, true, speed) { } + explicit AssistanceMovementGenerator(uint32 id, float x, float y, float z) : PointMovementGenerator<Creature>(id, x, y, z, true) { } void Finalize(Unit*, bool, bool) override; MovementGeneratorType GetMovementGeneratorType() const override; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 98d30984768..a8fba0e8067 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -17,6 +17,7 @@ */ #include "MoveSplineInit.h" +#include "Creature.h" #include "MoveSpline.h" #include "MovementPacketBuilder.h" #include "Unit.h" @@ -113,6 +114,9 @@ namespace Movement moveFlagsForSpeed &= ~MOVEMENTFLAG_WALKING; args.velocity = unit->GetSpeed(SelectSpeedType(moveFlagsForSpeed)); + if (Creature* creature = unit->ToCreature()) + if (creature->HasSearchedAssistance()) + args.velocity *= 0.66f; } // limit the speed in the same way the client does |