Fix fleeing speed to 66% run speed

This commit is contained in:
Giacomo Pozzoni authored and Ovahlord committed 2020-01-03 21:45:40 +01:00
1 parent 6bb1623464
commit ccb00b971b
6 files changed
+14 -25

No files matched your search

+7 -6
View File
@@ -601,13 +601,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);
Mutate(new AssistanceMovementGenerator(x, y, z, _owner->GetSpeed(MOVE_RUN) * 0.66f), MOTION_SLOT_ACTIVE);
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);
Mutate(new AssistanceMovementGenerator(x, y, z), MOTION_SLOT_ACTIVE);
}
else
TC_LOG_ERROR("movement.motionmaster", "MotionMaster::MoveSeekAssistance: '%s', attempted to seek assistance.", _owner->GetGUID().ToString().c_str());