TrinityCore
Loading...
Searching...
No Matches
MotionMaster Class Reference

#include <MotionMaster.h>

Classes

class  DelayedAction
 

Public Types

typedef std::function< void()> DelayedActionDefine
 
typedef std::function< bool()> DelayedActionValidator
 

Public Member Functions

 MotionMaster (Unit *unit)
 
 ~MotionMaster ()
 
void Initialize ()
 
void InitializeDefault ()
 
void AddToWorld ()
 
bool Empty () const
 
uint32 Size () const
 
std::vector< MovementGeneratorInformationGetMovementGeneratorsInformation () const
 
MovementSlot GetCurrentSlot () const
 
MovementGeneratorGetCurrentMovementGenerator () const
 
MovementGeneratorType GetCurrentMovementGeneratorType () const
 
MovementGeneratorType GetCurrentMovementGeneratorType (MovementSlot slot) const
 
MovementGeneratorGetCurrentMovementGenerator (MovementSlot slot) const
 
MovementGeneratorGetMovementGenerator (std::function< bool(MovementGenerator const *)> const &filter, MovementSlot slot=MOTION_SLOT_ACTIVE) const
 
bool HasMovementGenerator (std::function< bool(MovementGenerator const *)> const &filter, MovementSlot slot=MOTION_SLOT_ACTIVE) const
 
void Update (uint32 diff)
 
void Add (MovementGenerator *movement, MovementSlot slot=MOTION_SLOT_ACTIVE)
 
void Remove (MovementGenerator *movement, MovementSlot slot=MOTION_SLOT_ACTIVE)
 
void Remove (MovementGeneratorType type, MovementSlot slot=MOTION_SLOT_ACTIVE)
 
void Clear ()
 
void Clear (MovementSlot slot)
 
void Clear (MovementGeneratorMode mode)
 
void Clear (MovementGeneratorPriority priority)
 
void PropagateSpeedChange ()
 
bool GetDestination (float &x, float &y, float &z)
 
bool StopOnDeath ()
 
void MoveIdle ()
 
void MoveTargetedHome ()
 
void MoveRandom (float wanderDistance=0.0f, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::ForceWalk, MovementSlot slot=MOTION_SLOT_DEFAULT, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveFollow (Unit *target, float dist, Optional< ChaseAngle > angle={}, Optional< Milliseconds > duration={}, bool ignoreTargetWalk=false, MovementSlot slot=MOTION_SLOT_ACTIVE, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveChase (Unit *target, Optional< ChaseRange > dist={}, Optional< ChaseAngle > angle={})
 
void MoveChase (Unit *target, float dist, float angle)
 
void MoveConfused ()
 
void MoveFleeing (Unit *enemy, Milliseconds time=0ms, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MovePoint (uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MovePoint (uint32 id, float x, float y, float z, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveCloserAndStop (uint32 id, Unit *target, float distance)
 
void MoveLand (uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveTakeoff (uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveTierTransition (uint32 id, Position const &pos, AnimTier newAnimTier, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveCharge (float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, bool generatePath=false, Unit const *target=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
void MoveCharge (PathGenerator const &path, float speed=SPEED_CHARGE, Unit const *target=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
void MoveKnockbackFrom (Position const &origin, float speedXY, float speedZ, float angle=M_PI, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
void MoveJump (uint32 id, Position const &pos, std::variant< std::monostate, float, Milliseconds > speedOrTime={}, Optional< float > minHeight={}, Optional< float > maxHeight={}, MovementFacingTarget const &facing={}, bool orientationFixed=false, bool unlimitedSpeed=false, Optional< float > speedMultiplier={}, JumpArrivalCastArgs const *arrivalCast=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveCirclePath (float x, float y, float z, float radius, bool clockwise, uint8 stepCount, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveAlongSplineChain (uint32 pointId, uint16 dbChainId, bool walk)
 
void MoveAlongSplineChain (uint32 pointId, std::vector< SplineChainLink > const &chain, bool walk)
 
void ResumeSplineChain (SplineChainResumeInfo const &info)
 
void MoveFall (uint32 id=0, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveSeekAssistance (float x, float y, float z)
 
void MoveSeekAssistanceDistract (uint32 timer)
 
void MoveTaxiFlight (uint32 path, uint32 pathnode, Optional< float > speed={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveDistract (uint32 time, float orientation)
 
void MovePath (uint32 pathId, bool repeatable, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< std::pair< Milliseconds, Milliseconds > > waitTimeRangeAtPathEnd={}, Optional< float > wanderDistanceAtPathEnds={}, Optional< bool > followPathBackwardsFromEndToStart={}, Optional< bool > exactSplinePath={}, bool generatePath=true, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MovePath (WaypointPath const &path, bool repeatable, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< std::pair< Milliseconds, Milliseconds > > waitTimeRangeAtPathEnd={}, Optional< float > wanderDistanceAtPathEnds={}, Optional< bool > followPathBackwardsFromEndToStart={}, Optional< bool > exactSplinePath={}, bool generatePath=true, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
void MoveRotate (uint32 id, RotateDirection direction, Optional< Milliseconds > time={}, Optional< float > turnSpeed={}, Optional< float > totalTurnAngle={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 Makes the Unit turn in place.
 
void MoveFormation (Unit *leader, float range, float angle, uint32 point1, uint32 point2)
 
void LaunchMoveSpline (std::function< void(Movement::MoveSplineInit &init)> &&initializer, uint32 id=0, MovementGeneratorPriority priority=MOTION_PRIORITY_NORMAL, MovementGeneratorType type=EFFECT_MOTION_TYPE, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 

Private Types

typedef std::unique_ptr< MovementGenerator, MovementGeneratorDeleterMovementGeneratorPointer
 
typedef std::multiset< MovementGenerator *, MovementGeneratorComparatorMotionMasterContainer
 
typedef std::unordered_multimap< uint32, MovementGenerator const * > MotionMasterUnitStatesContainer
 

Private Member Functions

void AddFlag (uint8 const flag)
 
bool HasFlag (uint8 const flag) const
 
void RemoveFlag (uint8 const flag)
 
void ResolveDelayedActions ()
 
void Remove (MotionMasterContainer::iterator iterator, bool active, bool movementInform)
 
void Pop (bool active, bool movementInform)
 
void DirectInitialize ()
 
void DirectClear ()
 
void DirectClearDefault ()
 
void DirectClear (std::function< bool(MovementGenerator *)> const &filter)
 
void DirectAdd (MovementGenerator *movement, MovementSlot slot)
 
void Delete (MovementGenerator *movement, bool active, bool movementInform)
 
void DeleteDefault (bool active, bool movementInform)
 
void AddBaseUnitState (MovementGenerator const *movement)
 
void ClearBaseUnitState (MovementGenerator const *movement)
 
void ClearBaseUnitStates ()
 

Private Attributes

Unit_owner
 
MovementGeneratorPointer _defaultGenerator
 
MotionMasterContainer _generators
 
MotionMasterUnitStatesContainer _baseUnitStatesMap
 
std::deque< DelayedAction_delayedActions
 
uint8 _flags
 

Detailed Description

Definition at line 97 of file MotionMaster.h.

Member Typedef Documentation

◆ DelayedActionDefine

typedef std::function<void()> MotionMaster::DelayedActionDefine

Definition at line 100 of file MotionMaster.h.

◆ DelayedActionValidator

typedef std::function<bool()> MotionMaster::DelayedActionValidator

Definition at line 101 of file MotionMaster.h.

◆ MotionMasterContainer

Definition at line 248 of file MotionMaster.h.

◆ MotionMasterUnitStatesContainer

typedef std::unordered_multimap<uint32, MovementGenerator const*> MotionMaster::MotionMasterUnitStatesContainer
private

Definition at line 249 of file MotionMaster.h.

◆ MovementGeneratorPointer

Definition at line 247 of file MotionMaster.h.

Constructor & Destructor Documentation

◆ MotionMaster()

MotionMaster::MotionMaster ( Unit unit)
explicit

Definition at line 84 of file MotionMaster.cpp.

◆ ~MotionMaster()

MotionMaster::~MotionMaster ( )

Definition at line 86 of file MotionMaster.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ Add()

void MotionMaster::Add ( MovementGenerator movement,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
)

Definition at line 328 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddBaseUnitState()

void MotionMaster::AddBaseUnitState ( MovementGenerator const *  movement)
private

Definition at line 1374 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddFlag()

void MotionMaster::AddFlag ( uint8 const  flag)
inlineprivate

Definition at line 251 of file MotionMaster.h.

+ Here is the caller graph for this function:

◆ AddToWorld()

void MotionMaster::AddToWorld ( )

Definition at line 117 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ Clear() [1/4]

void MotionMaster::Clear ( )

Definition at line 430 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Clear() [2/4]

void MotionMaster::Clear ( MovementGeneratorMode  mode)

Definition at line 477 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ Clear() [3/4]

void MotionMaster::Clear ( MovementGeneratorPriority  priority)

Definition at line 499 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ Clear() [4/4]

void MotionMaster::Clear ( MovementSlot  slot)

Definition at line 446 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ ClearBaseUnitState()

void MotionMaster::ClearBaseUnitState ( MovementGenerator const *  movement)
private

Definition at line 1383 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearBaseUnitStates()

void MotionMaster::ClearBaseUnitStates ( )
private

Definition at line 1393 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Delete()

void MotionMaster::Delete ( MovementGenerator movement,
bool  active,
bool  movementInform 
)
private

Definition at line 1354 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeleteDefault()

void MotionMaster::DeleteDefault ( bool  active,
bool  movementInform 
)
private

Definition at line 1364 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DirectAdd()

void MotionMaster::DirectAdd ( MovementGenerator movement,
MovementSlot  slot 
)
private

Definition at line 1280 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DirectClear() [1/2]

void MotionMaster::DirectClear ( )
private

Definition at line 1241 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DirectClear() [2/2]

void MotionMaster::DirectClear ( std::function< bool(MovementGenerator *)> const &  filter)
private

Definition at line 1261 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ DirectClearDefault()

void MotionMaster::DirectClearDefault ( )
private

Definition at line 1255 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DirectInitialize()

void MotionMaster::DirectInitialize ( )
private

Definition at line 1232 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Empty()

bool MotionMaster::Empty ( ) const

Definition at line 131 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ GetCurrentMovementGenerator() [1/2]

MovementGenerator * MotionMaster::GetCurrentMovementGenerator ( ) const

Definition at line 186 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ GetCurrentMovementGenerator() [2/2]

MovementGenerator * MotionMaster::GetCurrentMovementGenerator ( MovementSlot  slot) const

Definition at line 223 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ GetCurrentMovementGeneratorType() [1/2]

MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType ( ) const

Definition at line 197 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCurrentMovementGeneratorType() [2/2]

MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType ( MovementSlot  slot) const

Definition at line 209 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ GetCurrentSlot()

MovementSlot MotionMaster::GetCurrentSlot ( ) const

Definition at line 175 of file MotionMaster.cpp.

◆ GetDestination()

bool MotionMaster::GetDestination ( float &  x,
float &  y,
float &  z 
)

Definition at line 533 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ GetMovementGenerator()

MovementGenerator * MotionMaster::GetMovementGenerator ( std::function< bool(MovementGenerator const *)> const &  filter,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
) const

Definition at line 237 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMovementGeneratorsInformation()

std::vector< MovementGeneratorInformation > MotionMaster::GetMovementGeneratorsInformation ( ) const

Definition at line 141 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasFlag()

bool MotionMaster::HasFlag ( uint8 const  flag) const
inlineprivate

Definition at line 252 of file MotionMaster.h.

+ Here is the caller graph for this function:

◆ HasMovementGenerator()

bool MotionMaster::HasMovementGenerator ( std::function< bool(MovementGenerator const *)> const &  filter,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
) const

Definition at line 264 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Initialize()

void MotionMaster::Initialize ( )

Definition at line 94 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitializeDefault()

void MotionMaster::InitializeDefault ( )

Definition at line 112 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LaunchMoveSpline()

void MotionMaster::LaunchMoveSpline ( std::function< void(Movement::MoveSplineInit &init)> &&  initializer,
uint32  id = 0,
MovementGeneratorPriority  priority = MOTION_PRIORITY_NORMAL,
MovementGeneratorType  type = EFFECT_MOTION_TYPE,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 1193 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveAlongSplineChain() [1/2]

void MotionMaster::MoveAlongSplineChain ( uint32  pointId,
std::vector< SplineChainLink > const &  chain,
bool  walk 
)

Definition at line 1010 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MoveAlongSplineChain() [2/2]

void MotionMaster::MoveAlongSplineChain ( uint32  pointId,
uint16  dbChainId,
bool  walk 
)

Definition at line 993 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveCharge() [1/2]

void MotionMaster::MoveCharge ( float  x,
float  y,
float  z,
float  speed = SPEED_CHARGE,
uint32  id = EVENT_CHARGE,
bool  generatePath = false,
Unit const *  target = nullptr,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr 
)

Definition at line 774 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveCharge() [2/2]

void MotionMaster::MoveCharge ( PathGenerator const &  path,
float  speed = SPEED_CHARGE,
Unit const *  target = nullptr,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr 
)

Definition at line 788 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MoveChase() [1/2]

void MotionMaster::MoveChase ( Unit target,
float  dist,
float  angle 
)
inline

Definition at line 166 of file MotionMaster.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveChase() [2/2]

void MotionMaster::MoveChase ( Unit target,
Optional< ChaseRange dist = {},
Optional< ChaseAngle angle = {} 
)

Definition at line 622 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveCirclePath()

void MotionMaster::MoveCirclePath ( float  x,
float  y,
float  z,
float  radius,
bool  clockwise,
uint8  stepCount,
Optional< Milliseconds duration = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 937 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveCloserAndStop()

void MotionMaster::MoveCloserAndStop ( uint32  id,
Unit target,
float  distance 
)

Definition at line 682 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveConfused()

void MotionMaster::MoveConfused ( )

Definition at line 632 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveDistract()

void MotionMaster::MoveDistract ( uint32  time,
float  orientation 
)

Definition at line 1121 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveFall()

void MotionMaster::MoveFall ( uint32  id = 0,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 1025 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveFleeing()

void MotionMaster::MoveFleeing ( Unit enemy,
Milliseconds  time = 0ms,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 646 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveFollow()

void MotionMaster::MoveFollow ( Unit target,
float  dist,
Optional< ChaseAngle angle = {},
Optional< Milliseconds duration = {},
bool  ignoreTargetWalk = false,
MovementSlot  slot = MOTION_SLOT_ACTIVE,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 607 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveFormation()

void MotionMaster::MoveFormation ( Unit leader,
float  range,
float  angle,
uint32  point1,
uint32  point2 
)

Definition at line 1184 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MoveIdle()

void MotionMaster::MoveIdle ( )

Definition at line 567 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveJump()

void MotionMaster::MoveJump ( uint32  id,
Position const &  pos,
std::variant< std::monostate, float, Milliseconds speedOrTime = {},
Optional< float >  minHeight = {},
Optional< float >  maxHeight = {},
MovementFacingTarget const &  facing = {},
bool  orientationFixed = false,
bool  unlimitedSpeed = false,
Optional< float >  speedMultiplier = {},
JumpArrivalCastArgs const *  arrivalCast = nullptr,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 861 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveKnockbackFrom()

void MotionMaster::MoveKnockbackFrom ( Position const &  origin,
float  speedXY,
float  speedZ,
float  angle = M_PI,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr 
)

Definition at line 808 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveLand()

void MotionMaster::MoveLand ( uint32  id,
Position const &  pos,
Optional< int32 tierTransitionId = {},
Optional< float >  velocity = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 705 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MovePath() [1/2]

void MotionMaster::MovePath ( uint32  pathId,
bool  repeatable,
Optional< Milliseconds duration = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Optional< std::pair< Milliseconds, Milliseconds > >  waitTimeRangeAtPathEnd = {},
Optional< float >  wanderDistanceAtPathEnds = {},
Optional< bool >  followPathBackwardsFromEndToStart = {},
Optional< bool >  exactSplinePath = {},
bool  generatePath = true,
Optional< MovementFadeObject fadeObject = {},
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 1131 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MovePath() [2/2]

void MotionMaster::MovePath ( WaypointPath const &  path,
bool  repeatable,
Optional< Milliseconds duration = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Optional< std::pair< Milliseconds, Milliseconds > >  waitTimeRangeAtPathEnd = {},
Optional< float >  wanderDistanceAtPathEnds = {},
Optional< bool >  followPathBackwardsFromEndToStart = {},
Optional< bool >  exactSplinePath = {},
bool  generatePath = true,
Optional< MovementFadeObject fadeObject = {},
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 1156 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MovePoint() [1/2]

void MotionMaster::MovePoint ( uint32  id,
float  x,
float  y,
float  z,
bool  generatePath = true,
Optional< float >  finalOrient = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Optional< float >  closeEnoughDistance = {},
Optional< MovementFadeObject fadeObject = {},
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 672 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MovePoint() [2/2]

void MotionMaster::MovePoint ( uint32  id,
Position const &  pos,
bool  generatePath = true,
Optional< float >  finalOrient = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Optional< float >  closeEnoughDistance = {},
Optional< MovementFadeObject fadeObject = {},
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 663 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MoveRandom()

void MotionMaster::MoveRandom ( float  wanderDistance = 0.0f,
Optional< Milliseconds duration = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::ForceWalk,
MovementSlot  slot = MOTION_SLOT_DEFAULT,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 596 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveRotate()

void MotionMaster::MoveRotate ( uint32  id,
RotateDirection  direction,
Optional< Milliseconds time = {},
Optional< float >  turnSpeed = {},
Optional< float >  totalTurnAngle = {},
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Makes the Unit turn in place.

Parameters
idMovement identifier, later passed to script MovementInform hooks
directionRotation direction
timeHow long should this movement last, infinite if not set
turnSpeedHow fast should the unit rotate, in radians per second. Uses unit's turn speed if not set
totalTurnAngleTotal angle of the entire movement, infinite if not set
scriptResultAwaitable script result (for internal use)

Definition at line 1174 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveSeekAssistance()

void MotionMaster::MoveSeekAssistance ( float  x,
float  y,
float  z 
)

Definition at line 1071 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveSeekAssistanceDistract()

void MotionMaster::MoveSeekAssistanceDistract ( uint32  timer)

Definition at line 1086 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveTakeoff()

void MotionMaster::MoveTakeoff ( uint32  id,
Position const &  pos,
Optional< int32 tierTransitionId = {},
Optional< float >  velocity = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 712 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveTargetedHome()

void MotionMaster::MoveTargetedHome ( )

Definition at line 572 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveTaxiFlight()

void MotionMaster::MoveTaxiFlight ( uint32  path,
uint32  pathnode,
Optional< float >  speed = {},
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 1097 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveTierTransition()

void MotionMaster::MoveTierTransition ( uint32  id,
Position const &  pos,
AnimTier  newAnimTier,
Optional< int32 tierTransitionId = {},
Optional< float >  velocity = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)

Definition at line 719 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Pop()

void MotionMaster::Pop ( bool  active,
bool  movementInform 
)
private

Definition at line 1226 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ PropagateSpeedChange()

void MotionMaster::PropagateSpeedChange ( )

Definition at line 521 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Remove() [1/3]

void MotionMaster::Remove ( MotionMasterContainer::iterator  iterator,
bool  active,
bool  movementInform 
)
private

Definition at line 1219 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ Remove() [2/3]

void MotionMaster::Remove ( MovementGenerator movement,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
)

Definition at line 351 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Remove() [3/3]

void MotionMaster::Remove ( MovementGeneratorType  type,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
)

Definition at line 389 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ RemoveFlag()

void MotionMaster::RemoveFlag ( uint8 const  flag)
inlineprivate

Definition at line 253 of file MotionMaster.h.

+ Here is the caller graph for this function:

◆ ResolveDelayedActions()

void MotionMaster::ResolveDelayedActions ( )
private

Definition at line 1210 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ ResumeSplineChain()

void MotionMaster::ResumeSplineChain ( SplineChainResumeInfo const &  info)

Definition at line 1015 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Size()

uint32 MotionMaster::Size ( ) const

Definition at line 136 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ StopOnDeath()

bool MotionMaster::StopOnDeath ( )

Definition at line 545 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ Update()

void MotionMaster::Update ( uint32  diff)

Definition at line 290 of file MotionMaster.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ _baseUnitStatesMap

MotionMasterUnitStatesContainer MotionMaster::_baseUnitStatesMap
private

Definition at line 273 of file MotionMaster.h.

◆ _defaultGenerator

MovementGeneratorPointer MotionMaster::_defaultGenerator
private

Definition at line 271 of file MotionMaster.h.

◆ _delayedActions

std::deque<DelayedAction> MotionMaster::_delayedActions
private

Definition at line 274 of file MotionMaster.h.

◆ _flags

uint8 MotionMaster::_flags
private

Definition at line 275 of file MotionMaster.h.

◆ _generators

MotionMasterContainer MotionMaster::_generators
private

Definition at line 272 of file MotionMaster.h.

◆ _owner

Unit* MotionMaster::_owner
private

Definition at line 270 of file MotionMaster.h.


The documentation for this class was generated from the following files: