TrinityCore
Loading...
Searching...
No Matches
CharmInfo Struct Reference

#include <CharmInfo.h>

Public Member Functions

 CharmInfo (Unit *unit)
 
 ~CharmInfo ()
 
void RestoreState ()
 
uint32 GetPetNumber () const
 
void SetPetNumber (uint32 petnumber, bool statwindow)
 
void SetCommandState (CommandStates st)
 
CommandStates GetCommandState () const
 
bool HasCommandState (CommandStates state) const
 
void InitPossessCreateSpells ()
 
void InitCharmCreateSpells ()
 
void InitPetActionBar ()
 
void InitEmptyActionBar (bool withAttack=true)
 
bool AddSpellToActionBar (SpellInfo const *spellInfo, ActiveStates newstate=ACT_DECIDE, uint8 preferredSlot=0)
 
bool RemoveSpellFromActionBar (uint32 spell_id)
 
void LoadPetActionBar (const std::string &data)
 
void SetSpellAutocast (SpellInfo const *spellInfo, bool state)
 
void SetActionBar (uint8 index, uint32 spellOrAction, ActiveStates type)
 
UnitActionBarEntry const * GetActionBarEntry (uint8 index) const
 
void ToggleCreatureAutocast (SpellInfo const *spellInfo, bool apply)
 
CharmSpellInfo * GetCharmSpell (uint8 index)
 
void SetIsCommandAttack (bool val)
 
bool IsCommandAttack ()
 
void SetIsCommandFollow (bool val)
 
bool IsCommandFollow ()
 
void SetIsAtStay (bool val)
 
bool IsAtStay ()
 
void SetIsFollowing (bool val)
 
bool IsFollowing ()
 
void SetIsReturning (bool val)
 
bool IsReturning ()
 
void SaveStayPosition ()
 
void GetStayPosition (float &x, float &y, float &z)
 

Private Attributes

Unit * _unit
 
UnitActionBarEntry PetActionBar [MAX_UNIT_ACTION_BAR_INDEX]
 
CharmSpellInfo _charmspells [4]
 
CommandStates _CommandState
 
uint32 _petnumber
 
ReactStates _oldReactState
 
bool _isCommandAttack
 
bool _isCommandFollow
 
bool _isAtStay
 
bool _isFollowing
 
bool _isReturning
 
float _stayX
 
float _stayY
 
float _stayZ
 

Detailed Description

Definition at line 87 of file CharmInfo.h.

Constructor & Destructor Documentation

◆ CharmInfo()

CharmInfo::CharmInfo ( Unit *  unit)
explicit

◆ ~CharmInfo()

CharmInfo::~CharmInfo ( )

Definition at line 41 of file CharmInfo.cpp.

Member Function Documentation

◆ AddSpellToActionBar()

◆ GetActionBarEntry()

UnitActionBarEntry const * CharmInfo::GetActionBarEntry ( uint8  index) const
inline

◆ GetCharmSpell()

CharmSpellInfo * CharmInfo::GetCharmSpell ( uint8  index)
inline

Definition at line 119 of file CharmInfo.h.

Referenced by Player::CharmSpellInitialize().

◆ GetCommandState()

CommandStates CharmInfo::GetCommandState ( ) const
inline

Definition at line 97 of file CharmInfo.h.

Referenced by Player::CharmSpellInitialize(), and Player::PetSpellInitialize().

◆ GetPetNumber()

◆ GetStayPosition()

void CharmInfo::GetStayPosition ( float &  x,
float &  y,
float &  z 
)

Definition at line 13342 of file Unit.cpp.

References _stayX, _stayY, and _stayZ.

Referenced by PetAI::HandleReturnMovement().

◆ HasCommandState()

bool CharmInfo::HasCommandState ( CommandStates  state) const
inline

◆ InitCharmCreateSpells()

◆ InitEmptyActionBar()

void CharmInfo::InitEmptyActionBar ( bool  withAttack = true)

◆ InitPetActionBar()

◆ InitPossessCreateSpells()

◆ IsAtStay()

bool CharmInfo::IsAtStay ( )

Definition at line 13354 of file Unit.cpp.

References _isAtStay.

Referenced by PetAI::HandleReturnMovement(), PetAI::SelectNextTarget(), and PetAI::UpdateAI().

◆ IsCommandAttack()

bool CharmInfo::IsCommandAttack ( )

◆ IsCommandFollow()

bool CharmInfo::IsCommandFollow ( )

Definition at line 13323 of file Unit.cpp.

References _isCommandFollow.

Referenced by PetAI::CanAttack().

◆ IsFollowing()

bool CharmInfo::IsFollowing ( )

Definition at line 13364 of file Unit.cpp.

References _isFollowing.

Referenced by PetAI::HandleReturnMovement(), and PetAI::SelectNextTarget().

◆ IsReturning()

bool CharmInfo::IsReturning ( )

◆ LoadPetActionBar()

◆ RemoveSpellFromActionBar()

bool CharmInfo::RemoveSpellFromActionBar ( uint32  spell_id)

◆ RestoreState()

void CharmInfo::RestoreState ( )

Definition at line 43 of file CharmInfo.cpp.

References _oldReactState, _unit, and Object::ToCreature().

◆ SaveStayPosition()

void CharmInfo::SaveStayPosition ( )

At this point a new spline destination is enabled because of Unit::StopMoving()

Definition at line 13328 of file Unit.cpp.

References _stayX, _stayY, _stayZ, _unit, Unit::GetDirectTransport(), and Unit::movespline.

Referenced by Spell::EffectResurrectPet(), and WorldSession::HandlePetActionHelper().

◆ SetActionBar()

void CharmInfo::SetActionBar ( uint8  index,
uint32  spellOrAction,
ActiveStates  type 
)
inline

◆ SetCommandState()

void CharmInfo::SetCommandState ( CommandStates  st)
inline

Definition at line 96 of file CharmInfo.h.

Referenced by WorldSession::HandlePetActionHelper().

◆ SetIsAtStay()

void CharmInfo::SetIsAtStay ( bool  val)

◆ SetIsCommandAttack()

void CharmInfo::SetIsCommandAttack ( bool  val)

◆ SetIsCommandFollow()

void CharmInfo::SetIsCommandFollow ( bool  val)

◆ SetIsFollowing()

void CharmInfo::SetIsFollowing ( bool  val)

◆ SetIsReturning()

void CharmInfo::SetIsReturning ( bool  val)

◆ SetPetNumber()

void CharmInfo::SetPetNumber ( uint32  petnumber,
bool  statwindow 
)

◆ SetSpellAutocast()

◆ ToggleCreatureAutocast()

void CharmInfo::ToggleCreatureAutocast ( SpellInfo const *  spellInfo,
bool  apply 
)

Member Data Documentation

◆ _charmspells

CharmSpellInfo CharmInfo::_charmspells[4]
private

Definition at line 138 of file CharmInfo.h.

Referenced by CharmInfo(), InitCharmCreateSpells(), and ToggleCreatureAutocast().

◆ _CommandState

CommandStates CharmInfo::_CommandState
private

Definition at line 139 of file CharmInfo.h.

◆ _isAtStay

bool CharmInfo::_isAtStay
private

Definition at line 147 of file CharmInfo.h.

Referenced by IsAtStay(), and SetIsAtStay().

◆ _isCommandAttack

bool CharmInfo::_isCommandAttack
private

Definition at line 145 of file CharmInfo.h.

Referenced by IsCommandAttack(), and SetIsCommandAttack().

◆ _isCommandFollow

bool CharmInfo::_isCommandFollow
private

Definition at line 146 of file CharmInfo.h.

Referenced by IsCommandFollow(), and SetIsCommandFollow().

◆ _isFollowing

bool CharmInfo::_isFollowing
private

Definition at line 148 of file CharmInfo.h.

Referenced by IsFollowing(), and SetIsFollowing().

◆ _isReturning

bool CharmInfo::_isReturning
private

Definition at line 149 of file CharmInfo.h.

Referenced by IsReturning(), and SetIsReturning().

◆ _oldReactState

ReactStates CharmInfo::_oldReactState
private

Definition at line 143 of file CharmInfo.h.

Referenced by CharmInfo(), and RestoreState().

◆ _petnumber

uint32 CharmInfo::_petnumber
private

Definition at line 140 of file CharmInfo.h.

Referenced by SetPetNumber().

◆ _stayX

float CharmInfo::_stayX
private

Definition at line 150 of file CharmInfo.h.

Referenced by GetStayPosition(), and SaveStayPosition().

◆ _stayY

float CharmInfo::_stayY
private

Definition at line 151 of file CharmInfo.h.

Referenced by GetStayPosition(), and SaveStayPosition().

◆ _stayZ

float CharmInfo::_stayZ
private

Definition at line 152 of file CharmInfo.h.

Referenced by GetStayPosition(), and SaveStayPosition().

◆ _unit

◆ PetActionBar


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