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

#include <Unit.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 BuildActionBar (WorldPacket *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 686 of file Unit.h.

Constructor & Destructor Documentation

◆ CharmInfo()

CharmInfo::CharmInfo ( Unit *  unit)
explicit

◆ ~CharmInfo()

CharmInfo::~CharmInfo ( )

Definition at line 9740 of file Unit.cpp.

Member Function Documentation

◆ AddSpellToActionBar()

◆ BuildActionBar()

void CharmInfo::BuildActionBar ( WorldPacket *  data)

◆ GetActionBarEntry()

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

◆ GetCharmSpell()

CharmSpellInfo * CharmInfo::GetCharmSpell ( uint8  index)
inline

Definition at line 718 of file Unit.h.

Referenced by Player::CharmSpellInitialize(), and Creature::GetPetAutoSpellOnPos().

◆ GetCommandState()

CommandStates CharmInfo::GetCommandState ( ) const
inline

Definition at line 696 of file Unit.h.

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

◆ GetPetNumber()

◆ GetStayPosition()

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

Definition at line 13183 of file Unit.cpp.

References _stayX, _stayY, and _stayZ.

Referenced by PetAI::HandleReturnMovement().

◆ HasCommandState()

◆ InitCharmCreateSpells()

◆ InitEmptyActionBar()

void CharmInfo::InitEmptyActionBar ( bool  withAttack = true)

◆ InitPetActionBar()

◆ InitPossessCreateSpells()

◆ IsAtStay()

bool CharmInfo::IsAtStay ( )

Definition at line 13195 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 13164 of file Unit.cpp.

References _isCommandFollow.

Referenced by PetAI::CanAttack().

◆ IsFollowing()

bool CharmInfo::IsFollowing ( )

Definition at line 13205 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)

Definition at line 9891 of file Unit.cpp.

References ACT_PASSIVE, MAX_UNIT_ACTION_BAR_INDEX, PetActionBar, SetActionBar(), and sSpellMgr.

Referenced by Pet::removeSpell().

◆ RestoreState()

void CharmInfo::RestoreState ( )

Definition at line 9742 of file Unit.cpp.

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

Referenced by Unit::DeleteCharmInfo().

◆ SaveStayPosition()

void CharmInfo::SaveStayPosition ( )

◆ SetActionBar()

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

◆ SetCommandState()

void CharmInfo::SetCommandState ( CommandStates  st)
inline

Definition at line 695 of file Unit.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 737 of file Unit.h.

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

◆ _CommandState

CommandStates CharmInfo::_CommandState
private

Definition at line 738 of file Unit.h.

◆ _isAtStay

bool CharmInfo::_isAtStay
private

Definition at line 746 of file Unit.h.

Referenced by IsAtStay(), and SetIsAtStay().

◆ _isCommandAttack

bool CharmInfo::_isCommandAttack
private

Definition at line 744 of file Unit.h.

Referenced by IsCommandAttack(), and SetIsCommandAttack().

◆ _isCommandFollow

bool CharmInfo::_isCommandFollow
private

Definition at line 745 of file Unit.h.

Referenced by IsCommandFollow(), and SetIsCommandFollow().

◆ _isFollowing

bool CharmInfo::_isFollowing
private

Definition at line 747 of file Unit.h.

Referenced by IsFollowing(), and SetIsFollowing().

◆ _isReturning

bool CharmInfo::_isReturning
private

Definition at line 748 of file Unit.h.

Referenced by IsReturning(), and SetIsReturning().

◆ _oldReactState

ReactStates CharmInfo::_oldReactState
private

Definition at line 742 of file Unit.h.

Referenced by CharmInfo(), and RestoreState().

◆ _petnumber

uint32 CharmInfo::_petnumber
private

Definition at line 739 of file Unit.h.

Referenced by SetPetNumber().

◆ _stayX

float CharmInfo::_stayX
private

Definition at line 749 of file Unit.h.

Referenced by GetStayPosition(), and SaveStayPosition().

◆ _stayY

float CharmInfo::_stayY
private

Definition at line 750 of file Unit.h.

Referenced by GetStayPosition(), and SaveStayPosition().

◆ _stayZ

float CharmInfo::_stayZ
private

Definition at line 751 of file Unit.h.

Referenced by GetStayPosition(), and SaveStayPosition().

◆ _unit

Unit* CharmInfo::_unit
private

◆ PetActionBar


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