47 if (!owner || !owner->IsAlive())
54 owner->GetPosition(_x, _y, _z);
64 return DoInitialize(owner);
70 if (!owner || !owner->IsAlive())
90 float distance = 4.0f *
frand(0.0f, 1.0f) - 2.0f;
91 float angle =
frand(0.0f, 1.0f) * float(
M_PI) * 2.0f;
92 owner->MovePositionToFirstCollision(destination, distance, angle);
104 _path = std::make_unique<PathGenerator>(owner);
105 _path->SetPathLengthLimit(30.0f);
123 _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 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)
void StopMoving(bool force=false)
Unit * EnsureVictim() const
void RemoveUnitFlag(UnitFlags flags)
float GetPositionZ() const
float GetPositionX() const
float GetPositionY() const