48 if (!owner->IsAlive())
56 owner->GetPosition(_reference.m_positionX, _reference.m_positionY, _reference.m_positionZ);
71 if (!owner->IsAlive())
91 float distance = 4.0f *
frand(0.0f, 1.0f) - 2.0f;
92 float angle =
frand(0.0f, 1.0f) * float(
M_PI) * 2.0f;
93 owner->MovePositionToFirstCollision(destination, distance, angle);
105 _path = std::make_unique<PathGenerator>(owner);
106 _path->SetPathLengthLimit(30.0f);
124 _timer.Reset(traveltime +
urand(800, 1500));
147 if constexpr (std::is_base_of_v<Creature, T>)
150 owner->SetTarget(victim->GetGUID());
152 else if constexpr (std::is_base_of_v<Player, T>)
@ 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 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