48 if (!owner || !owner->IsAlive())
56 owner->GetPosition(_reference.m_positionX, _reference.m_positionY, _reference.m_positionZ);
71 if (!owner || !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));
@ 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
ConfusedMovementGenerator()
void DoFinalize(T *, bool, bool)
bool DoUpdate(T *, uint32)
MovementGeneratorType GetMovementGeneratorType() const override
void SetTarget(ObjectGuid const &guid) override
void AddFlag(uint16 const flag)
bool HasFlag(uint16 const flag) const
void RemoveFlag(uint16 const flag)
void SetWalk(bool enable)
void MovebyPath(PointsArray const &path, int32 pointId=0)
static ObjectGuid GetGUID(Object const *o)
void ClearUnitState(uint32 f)
Unit * EnsureVictim() const
void RemoveUnitFlag(UnitFlags flags)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
constexpr float GetPositionZ() const