21#include "G3DPosition.hpp"
36 : _movementId(id), _destination(x, y, z), _speed(speed), _generatePath(generatePath), _finalOrient(finalOrient),
37 i_faceTarget(faceTarget), _speedSelectionMode(speedSelectionMode), _closeEnoughDistance(closeEnoughDistance), _fadeObject(fadeObject)
45 if (spellEffectExtraData)
46 this->
i_spellEffectExtra = std::make_unique<Movement::SpellEffectExtraData>(*spellEffectExtraData);
83 bool result = path.
CalculatePath(dest.x, dest.y, dest.z,
false);
128 creature->SignalFormationMovement();
174 creature->SignalFormationMovement();
MovementWalkRunSpeedSelectionMode
@ MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING
@ MOVEMENTGENERATOR_FLAG_DEACTIVATED
@ MOVEMENTGENERATOR_FLAG_FINALIZED
@ MOVEMENTGENERATOR_FLAG_TRANSITORY
@ MOVEMENTGENERATOR_FLAG_INTERRUPTED
@ MOVEMENTGENERATOR_FLAG_INFORM_ENABLED
@ MOVEMENTGENERATOR_FLAG_INITIALIZED
@ MOVEMENTGENERATOR_FLAG_SPEED_UPDATE_PENDING
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ UNIT_STATE_ROAMING_MOVE
void Finalize(Unit *owner, bool active, bool movementInform) override
MovementGeneratorType GetMovementGeneratorType() const override
void SetNoCallAssistance(bool val)
void MoveSeekAssistanceDistract(uint32 timer)
void SetScriptResult(MovementStopReason reason)
void AddFlag(uint16 const flag)
Scripting::v2::ActionResultSetter< MovementStopReason > ScriptResult
bool HasFlag(uint16 const flag) const
void RemoveFlag(uint16 const flag)
void MoveTo(Vector3 const &destination, bool generatePath=true, bool forceDestination=false)
void SetWalk(bool enable)
void MovebyPath(std::span< Vector3 const > path, int32 pointId=0)
void SetVelocity(float velocity)
void SetFacing(float angle)
void SetFadeObject(Milliseconds fadeDuration=1s)
void SetSpellEffectExtraData(SpellEffectExtraData const &spellEffectExtraData)
Movement::PointsArray const & GetPath() const
void ShortenPathUntilDist(G3D::Vector3 const &target, float dist)
PathType GetPathType() const
bool CalculatePath(float srcX, float srcY, float srcZ, float destX, float destY, float destZ, bool forceDest=false)
MovementWalkRunSpeedSelectionMode _speedSelectionMode
Optional< float > _closeEnoughDistance
PointMovementGenerator(uint32 id, float x, float y, float z, bool generatePath, Optional< float > speed={}, Optional< float > finalOrient={}, Unit const *faceTarget=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
Optional< float > _finalOrient
if set then unit will turn to specified _orient in provided _pos
void MovementInform(Unit *)
void Deactivate(Unit *owner) override
void Initialize(Unit *owner) override
Optional< MovementFadeObject > _fadeObject
MovementGeneratorType GetMovementGeneratorType() const override
std::unique_ptr< Movement::SpellEffectExtraData > i_spellEffectExtra
Unit const * i_faceTarget
bool Update(Unit *owner, uint32 diff) override
void Finalize(Unit *owner, bool active, bool movementInform) override
void Reset(Unit *owner) override
~PointMovementGenerator()
void ClearUnitState(uint32 f)
virtual bool IsMovementPreventedByCasting() const
MotionMaster * GetMotionMaster()
void AddUnitState(uint32 f)
bool HasUnitState(const uint32 f) const
std::unique_ptr< Movement::MoveSpline > movespline
void MovePosition(Position &pos, float dist, float angle, float maxHeightChange=6.0f) const
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY
constexpr float GetPositionX() const
constexpr float GetPositionY() const
float GetRelativeAngle(float x, float y) const
float GetExactDist(float x, float y, float z) const
constexpr float GetPositionZ() const