Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
MotionMaster Class Reference

#include <MotionMaster.h>

Collaboration diagram for MotionMaster:

Public Member Functions

void Clear (bool reset=true)
void DelayedDelete (_Ty curr)
void DirectDelete (_Ty curr)
bool empty () const
MovementGeneratorType GetCurrentMovementGeneratorType () const
bool GetDestination (float &x, float &y, float &z)
_Ty GetMotionSlot (int slot) const
MovementGeneratorType GetMotionSlotType (int slot) const
void InitDefault ()
void Initialize ()
 MotionMaster (Unit *unit)
void MoveCharge (float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, bool generatePath=false)
void MoveCharge (PathGenerator const &path)
void MoveChase (Unit *target, float dist=0.0f, float angle=0.0f)
void MoveConfused ()
void MoveDistract (uint32 time)
void MoveFall (uint32 id=0)
void MoveFleeing (Unit *enemy, uint32 time=0)
void MoveFollow (Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
void MoveIdle ()
void MoveJump (float x, float y, float z, float speedXY, float speedZ, uint32 id=EVENT_JUMP)
void MoveJump (Position const &pos, float speedXY, float speedZ, uint32 id=EVENT_JUMP)
void MoveJumpTo (float angle, float speedXY, float speedZ)
void MoveKnockbackFrom (float srcX, float srcY, float speedXY, float speedZ)
void MoveLand (uint32 id, Position const &pos)
void MovementExpired (bool reset=true)
void MovePath (uint32 path_id, bool repeatable)
void MovePoint (uint32 id, float x, float y, float z, bool generatePath=true)
void MovePoint (uint32 id, Position const &pos, bool generatePath=true)
void MoveRandom (float spawndist=0.0f)
void MoveRotate (uint32 time, RotateDirection direction)
void MoveSeekAssistance (float x, float y, float z)
void MoveSeekAssistanceDistract (uint32 timer)
void MoveTakeoff (uint32 id, Position const &pos)
void MoveTargetedHome ()
void MoveTaxiFlight (uint32 path, uint32 pathnode)
void propagateSpeedChange ()
int size () const
_Ty top () const
void UpdateMotion (uint32 diff)
 ~MotionMaster ()

Private Types

typedef MovementGenerator_Ty
typedef std::vector< _TyExpireList

Private Member Functions

void DelayedClean ()
void DelayedExpire ()
void DirectClean (bool reset)
void DirectExpire (bool reset)
void InitTop ()
void Mutate (MovementGenerator *m, MovementSlot slot)
bool needInitTop () const
void pop ()
void push (_Ty _Val)

Private Attributes

uint8 _cleanFlag
ExpireList_expList
bool _needInit [MAX_MOTION_SLOT] = { true }
Unit_owner
int _top
_Ty Impl [MAX_MOTION_SLOT] = {}

Detailed Description

Definition at line 69 of file MotionMaster.h.

Member Typedef Documentation

◆ _Ty

Definition at line 73 of file MotionMaster.h.

◆ ExpireList

typedef std::vector<_Ty> MotionMaster::ExpireList
private

Definition at line 180 of file MotionMaster.h.

Constructor & Destructor Documentation

◆ MotionMaster()

MotionMaster::MotionMaster ( Unit * unit)
inlineexplicit

Definition at line 87 of file MotionMaster.h.

References _cleanFlag, _expList, _owner, _top, and MMCF_NONE.

◆ ~MotionMaster()

MotionMaster::~MotionMaster ( )

Definition at line 55 of file MotionMaster.cpp.

References DirectDelete(), empty(), pop(), and top().

Member Function Documentation

◆ Clear()

◆ DelayedClean()

void MotionMaster::DelayedClean ( )
private

Definition at line 125 of file MotionMaster.cpp.

References DelayedDelete(), pop(), size(), and top().

Referenced by Clear().

◆ DelayedDelete()

void MotionMaster::DelayedDelete ( _Ty curr)

◆ DelayedExpire()

void MotionMaster::DelayedExpire ( )
private

Definition at line 156 of file MotionMaster.cpp.

References _top, DelayedDelete(), pop(), size(), and top().

Referenced by MovementExpired().

◆ DirectClean()

void MotionMaster::DirectClean ( bool reset)
private

Definition at line 110 of file MotionMaster.cpp.

References _owner, DirectDelete(), InitTop(), needInitTop(), pop(), MovementGenerator::Reset(), size(), and top().

Referenced by Clear().

◆ DirectDelete()

void MotionMaster::DirectDelete ( _Ty curr)

◆ DirectExpire()

void MotionMaster::DirectExpire ( bool reset)
private

◆ empty()

bool MotionMaster::empty ( ) const
inline

◆ GetCurrentMovementGeneratorType()

MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType ( ) const

◆ GetDestination()

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

Definition at line 636 of file MotionMaster.cpp.

References _owner.

Referenced by misc_commandscript::HandleMovegensCommand().

◆ GetMotionSlot()

_Ty MotionMaster::GetMotionSlot ( int slot) const
inline

Definition at line 96 of file MotionMaster.h.

References Impl.

Referenced by misc_commandscript::HandleMovegensCommand().

◆ GetMotionSlotType()

MovementGeneratorType MotionMaster::GetMotionSlotType ( int slot) const

Definition at line 604 of file MotionMaster.cpp.

References Impl, and NULL_MOTION_TYPE.

◆ InitDefault()

void MotionMaster::InitDefault ( )

◆ Initialize()

◆ InitTop()

void MotionMaster::InitTop ( )
private

Definition at line 612 of file MotionMaster.cpp.

References _needInit, _owner, _top, MovementGenerator::Initialize(), and top().

Referenced by DirectClean(), DirectExpire(), and UpdateMotion().

◆ MoveCharge() [1/2]

void MotionMaster::MoveCharge ( float x,
float y,
float z,
float speed = SPEED_CHARGE,
uint32 id = EVENT_CHARGE,
bool generatePath = false )

◆ MoveCharge() [2/2]

◆ MoveChase()

◆ MoveConfused()

void MotionMaster::MoveConfused ( )

Definition at line 210 of file MotionMaster.cpp.

References _owner, MOTION_SLOT_CONTROLLED, Mutate(), SF_LOG_DEBUG, and TYPEID_PLAYER.

Referenced by Unit::SetConfused().

◆ MoveDistract()

void MotionMaster::MoveDistract ( uint32 time)

Definition at line 506 of file MotionMaster.cpp.

References _owner, Impl, MOTION_SLOT_CONTROLLED, Mutate(), SF_LOG_DEBUG, and TYPEID_PLAYER.

◆ MoveFall()

◆ MoveFleeing()

◆ MoveFollow()

◆ MoveIdle()

void MotionMaster::MoveIdle ( )

◆ MoveJump() [1/2]

◆ MoveJump() [2/2]

◆ MoveJumpTo()

void MotionMaster::MoveJumpTo ( float angle,
float speedXY,
float speedZ )

Definition at line 339 of file MotionMaster.cpp.

References _owner, Movement::gravity, MoveJump(), and TYPEID_PLAYER.

Referenced by Unit::JumpTo().

◆ MoveKnockbackFrom()

◆ MoveLand()

◆ MovementExpired()

◆ MovePath()

void MotionMaster::MovePath ( uint32 path_id,
bool repeatable )

◆ MovePoint() [1/2]

void MotionMaster::MovePoint ( uint32 id,
float x,
float y,
float z,
bool generatePath = true )

Definition at line 274 of file MotionMaster.cpp.

References _owner, MOTION_SLOT_ACTIVE, Mutate(), SF_LOG_DEBUG, and TYPEID_PLAYER.

◆ MovePoint() [2/2]

void MotionMaster::MovePoint ( uint32 id,
Position const & pos,
bool generatePath = true )
inline

Definition at line 136 of file MotionMaster.h.

References Position::m_positionX, Position::m_positionY, Position::m_positionZ, and MovePoint().

Referenced by boss_illidan_stormrage::boss_illidan_stormrageAI::CastEyeBlast(), boss_sartharion::boss_sartharionAI::FetchDragons(), misc_commandscript::HandleComeToMeCommand(), spell_malygos_random_portal::spell_malygos_random_portal_SpellScript::HandleDummy(), spell_q12589_shoot_rjr::spell_q12589_shoot_rjr_SpellScript::HandleDummy(), WorldSession::HandlePetActionHelper(), spell_saviana_conflagration_throwback::spell_saviana_conflagration_throwback_SpellScript::HandleScript(), npc_counselor_talbot::npc_counselor_talbotAI::JustDied(), npc_enraged_spirit::npc_enraged_spiritAI::JustDied(), CreatureGroup::LeaderMoveTo(), boss_midnight::boss_midnightAI::Mount(), instance_deadmines::instance_deadmines_InstanceMapScript::MoveCreatureInside(), MovePoint(), LuaUnit::MoveTo(), boss_palehoof::boss_palehoofAI::NextPhase(), npc_geezle::npc_geezleAI::NextStep(), npc_image_of_medivh::npc_image_of_medivhAI::NextStep(), npc_jungle_punch_target::npc_jungle_punch_targetAI::proceedCwEvent(), instance_violet_hold::instance_violet_hold_InstanceMapScript::StartBossEncounter(), boss_krick::boss_krickAI::UpdateAI(), boss_malygos::boss_malygosAI::UpdateAI(), boss_sartharion::boss_sartharionAI::UpdateAI(), npc_alexstraza_the_lifebinder::npc_alexstraza_the_lifebinderAI::UpdateAI(), npc_elder_kekek::npc_elder_kekekAI::UpdateAI(), npc_high_oracle_soo_roo::npc_high_oracle_soo_rooAI::UpdateAI(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::UpdateAI(), npc_snowfall_glade_playmate::npc_snowfall_glade_playmateAI::UpdateAI(), npc_the_biggest_tree::npc_the_biggest_treeAI::UpdateAI(), npc_the_etymidian::npc_the_etymidianAI::UpdateAI(), and npc_winterfin_playmate::npc_winterfin_playmateAI::UpdateAI().

◆ MoveRandom()

◆ MoveRotate()

void MotionMaster::MoveRotate ( uint32 time,
RotateDirection direction )

Definition at line 574 of file MotionMaster.cpp.

References MOTION_SLOT_ACTIVE, and Mutate().

Referenced by LuaUnit::MoveRotate().

◆ MoveSeekAssistance()

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

◆ MoveSeekAssistanceDistract()

void MotionMaster::MoveSeekAssistanceDistract ( uint32 timer)

◆ MoveTakeoff()

◆ MoveTargetedHome()

◆ MoveTaxiFlight()

void MotionMaster::MoveTaxiFlight ( uint32 path,
uint32 pathnode )

◆ Mutate()

◆ needInitTop()

bool MotionMaster::needInitTop ( ) const
inlineprivate

Definition at line 83 of file MotionMaster.h.

References _needInit, and _top.

Referenced by DirectClean(), DirectExpire(), and UpdateMotion().

◆ pop()

void MotionMaster::pop ( )
inlineprivate

Definition at line 75 of file MotionMaster.h.

References _top, Impl, and top().

Referenced by DelayedClean(), DelayedExpire(), DirectClean(), DirectExpire(), Initialize(), and ~MotionMaster().

◆ propagateSpeedChange()

void MotionMaster::propagateSpeedChange ( )

Definition at line 582 of file MotionMaster.cpp.

References _top, and Impl.

Referenced by Unit::propagateSpeedChange().

◆ push()

void MotionMaster::push ( _Ty _Val)
inlineprivate

Definition at line 81 of file MotionMaster.h.

References _top, and Impl.

◆ size()

int MotionMaster::size ( ) const
inline

Definition at line 94 of file MotionMaster.h.

References _top.

Referenced by DelayedClean(), DelayedExpire(), DirectClean(), and DirectExpire().

◆ top()

◆ UpdateMotion()

Member Data Documentation

◆ _cleanFlag

uint8 MotionMaster::_cleanFlag
private

Definition at line 186 of file MotionMaster.h.

Referenced by Clear(), MotionMaster(), MovementExpired(), Mutate(), and UpdateMotion().

◆ _expList

ExpireList* MotionMaster::_expList
private

Definition at line 181 of file MotionMaster.h.

Referenced by DelayedDelete(), MotionMaster(), and UpdateMotion().

◆ _needInit

bool MotionMaster::_needInit[MAX_MOTION_SLOT] = { true }
private

Definition at line 185 of file MotionMaster.h.

Referenced by InitTop(), Mutate(), and needInitTop().

◆ _owner

◆ _top

int MotionMaster::_top
private

◆ Impl

_Ty MotionMaster::Impl[MAX_MOTION_SLOT] = {}
private

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