47 if (!owner->IsAlive())
54 owner->GetPosition(_reference.m_positionX, _reference.m_positionY, _reference.m_positionZ);
57 SetTargetLocation(owner);
66 return DoInitialize(owner);
72 if (!owner->IsAlive())
90 SetTargetLocation(owner);
113 if constexpr (std::is_base_of_v<Creature, T>)
116 owner->SetTarget(victim->GetGUID());
118 else if constexpr (std::is_base_of_v<Player, T>)
130 float distance = 4.0f *
frand(0.0f, 1.0f) - 2.0f;
131 float angle =
frand(0.0f, 1.0f) * float(
M_PI) * 2.0f;
132 owner->MovePositionToFirstCollision(destination, distance, angle);
144 _path = std::make_unique<PathGenerator>(owner);
145 _path->SetPathLengthLimit(30.0f);
163 _timer.Reset(traveltime +
urand(800, 1500));
@ MOTION_PRIORITY_HIGHEST
@ MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING
@ MOVEMENTGENERATOR_FLAG_DEACTIVATED
@ MOVEMENTGENERATOR_FLAG_FINALIZED
@ MOVEMENTGENERATOR_FLAG_TRANSITORY
@ MOVEMENTGENERATOR_FLAG_INTERRUPTED
@ MOVEMENTGENERATOR_FLAG_INITIALIZED
@ MOVEMENTGENERATOR_FLAG_SPEED_UPDATE_PENDING
float frand(float min, float max)
uint32 urand(uint32 min, uint32 max)
@ UNIT_STATE_CONFUSED_MOVE
void SetTargetLocation(T *)
void DoFinalize(T *, bool, bool)
ConfusedMovementGenerator()
bool DoUpdate(T *, uint32)
MovementGeneratorType GetMovementGeneratorType() const override
void SetWalk(bool enable)
void MovebyPath(std::span< Vector3 const > path, int32 pointId=0)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
constexpr float GetPositionZ() const