63 _timer.Reset(overrideTimer);
79 if (!owner || !owner->
IsAlive())
84 if (_wanderDistance == 0.f)
88 _wanderSteps =
urand(2, 10);
103 return DoInitialize(owner);
124 float distance =
frand(0.f, _wanderDistance);
125 float angle =
frand(0.f,
float(
M_PI * 2));
138 _path = std::make_unique<PathGenerator>(owner);
139 _path->SetPathLengthLimit(30.0f);
176 _timer.Reset(splineDuration);
181 _wanderSteps =
urand(2, 10);
197 if (!owner || !owner->
IsAlive())
215 SetRandomLocation(owner);
@ MOVEMENTGENERATOR_FLAG_TIMED_PAUSED
@ MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING
@ MOVEMENTGENERATOR_FLAG_PAUSED
@ 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_ROAMING_MOVE
@ UNIT_STATE_LOST_CONTROL
void SignalFormationMovement()
float GetWanderDistance() const
CreatureMovementData const & GetMovementTemplate() const
bool IsMovementPreventedByCasting() const override
void SetWalk(bool enable)
void MovebyPath(PointsArray const &path, int32 pointId=0)
void SetRandomLocation(T *)
void Resume(uint32 overrideTimer=0) override
RandomMovementGenerator(float distance=0.0f)
MovementGeneratorType GetMovementGeneratorType() const override
void DoFinalize(T *, bool, bool)
bool DoUpdate(T *, uint32)
void Pause(uint32 timer=0) override
void ClearUnitState(uint32 f)
Movement::MoveSpline * movespline
void StopMoving(bool force=false)
void AddUnitState(uint32 f)
bool SetWalk(bool enable)
bool HasUnitState(const uint32 f) const
bool IsWithinLOS(float x, float y, float z, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
void MovePositionToFirstCollision(Position &pos, float dist, float angle)
CreatureRandomMovementType GetRandom() const
float GetPositionZ() const
float GetPositionX() const
void GetPosition(float &x, float &y) const
float GetPositionY() const