![]() |
TrinityCore
|
#include <CharmInfo.h>
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 |
Definition at line 87 of file CharmInfo.h.
|
explicit |
Definition at line 26 of file CharmInfo.cpp.
References _charmspells, _oldReactState, _unit, ACT_DISABLED, MAX_SPELL_CHARM, REACT_PASSIVE, and Object::ToCreature().
| CharmInfo::~CharmInfo | ( | ) |
Definition at line 41 of file CharmInfo.cpp.
| bool CharmInfo::AddSpellToActionBar | ( | SpellInfo const * | spellInfo, |
| ActiveStates | newstate = ACT_DECIDE, |
||
| uint8 | preferredSlot = 0 |
||
| ) |
Definition at line 166 of file CharmInfo.cpp.
References ACT_DECIDE, ACT_DISABLED, ACT_ENABLED, ACT_PASSIVE, ASSERT, SpellInfo::GetFirstRankSpell(), SpellInfo::Id, UnitActionBarEntry::IsActionBarForSpell(), SpellInfo::IsAutocastable(), SpellInfo::IsAutocastEnabledByDefault(), MAX_UNIT_ACTION_BAR_INDEX, PetActionBar, UnitActionBarEntry::SetAction(), SetActionBar(), and sSpellMgr.
Referenced by InitCharmCreateSpells(), and InitPossessCreateSpells().
|
inline |
Definition at line 115 of file CharmInfo.h.
Referenced by Player::CharmSpellInitialize(), Player::PetSpellInitialize(), and Player::PossessSpellInitialize().
|
inline |
Definition at line 119 of file CharmInfo.h.
Referenced by Player::CharmSpellInitialize().
|
inline |
Definition at line 97 of file CharmInfo.h.
Referenced by Player::CharmSpellInitialize(), and Player::PetSpellInitialize().
|
inline |
Definition at line 93 of file CharmInfo.h.
Referenced by WorldSession::HandlePetRename(), Player::RemovePet(), SpellHistory::PersistenceHelper< Pet >::SetIdentifier(), and Player::UnsummonPetTemporaryIfAny().
| void CharmInfo::GetStayPosition | ( | float & | x, |
| float & | y, | ||
| float & | z | ||
| ) |
|
inline |
Definition at line 98 of file CharmInfo.h.
Referenced by PetAI::_AttackStart(), Pet::AddToWorld(), PetAI::CanAttack(), Spell::EffectResurrectPet(), AuraEffect::HandleModPossessPet(), and PetAI::HandleReturnMovement().
| void CharmInfo::InitCharmCreateSpells | ( | ) |
Definition at line 113 of file CharmInfo.cpp.
References _charmspells, _unit, ACT_DISABLED, ACT_ENABLED, ACT_PASSIVE, AddSpellToActionBar(), WorldObject::CastSpell(), Map::GetDifficultyID(), WorldObject::GetMap(), BaseEntity::GetTypeId(), SpellInfo::HasAttribute(), SpellInfo::Id, InitEmptyActionBar(), InitPetActionBar(), SpellInfo::IsAutocastable(), SpellInfo::IsAutocastEnabledByDefault(), SpellInfo::IsPassive(), Creature::m_spells, MAX_SPELL_CHARM, SpellInfo::NeedsExplicitUnitTarget(), UnitActionBarEntry::SetActionAndType(), SPELL_ATTR5_NOT_AVAILABLE_WHILE_CHARMED, sSpellMgr, Object::ToCreature(), ToggleCreatureAutocast(), and TYPEID_PLAYER.
Referenced by Unit::SetCharmedBy().
| void CharmInfo::InitEmptyActionBar | ( | bool | withAttack = true | ) |
Definition at line 64 of file CharmInfo.cpp.
References ACT_COMMAND, ACT_PASSIVE, ACTION_BAR_INDEX_END, ACTION_BAR_INDEX_START, COMMAND_ATTACK, and SetActionBar().
Referenced by InitCharmCreateSpells(), and InitPossessCreateSpells().
| void CharmInfo::InitPetActionBar | ( | ) |
Definition at line 49 of file CharmInfo.cpp.
References ACT_COMMAND, ACT_PASSIVE, ACT_REACTION, ACTION_BAR_INDEX_END, ACTION_BAR_INDEX_PET_SPELL_END, ACTION_BAR_INDEX_PET_SPELL_START, ACTION_BAR_INDEX_START, COMMAND_ATTACK, and SetActionBar().
Referenced by InitCharmCreateSpells(), and LoadPetActionBar().
| void CharmInfo::InitPossessCreateSpells | ( | ) |
Definition at line 74 of file CharmInfo.cpp.
References _unit, ACT_PASSIVE, AddSpellToActionBar(), WorldObject::CastSpell(), Map::GetDifficultyID(), Object::GetEntry(), WorldObject::GetMap(), BaseEntity::GetTypeId(), SpellInfo::HasAttribute(), SpellInfo::Id, InitEmptyActionBar(), SpellInfo::IsPassive(), Creature::m_spells, MAX_CREATURE_SPELLS, MAX_UNIT_ACTION_BAR_INDEX, SPELL_ATTR5_NOT_AVAILABLE_WHILE_CHARMED, sSpellMgr, Object::ToCreature(), and TYPEID_UNIT.
Referenced by npc_eye_of_acherus::npc_eye_of_acherus(), and Unit::SetCharmedBy().
| bool CharmInfo::IsAtStay | ( | ) |
Definition at line 13354 of file Unit.cpp.
References _isAtStay.
Referenced by PetAI::HandleReturnMovement(), PetAI::SelectNextTarget(), and PetAI::UpdateAI().
| bool CharmInfo::IsCommandAttack | ( | ) |
Definition at line 13313 of file Unit.cpp.
References _isCommandAttack.
Referenced by PetAI::_AttackStart(), PetAI::CanAttack(), PetAI::DoAttack(), WorldSession::HandlePetActionHelper(), and PetAI::UpdateAI().
| bool CharmInfo::IsCommandFollow | ( | ) |
Definition at line 13323 of file Unit.cpp.
References _isCommandFollow.
Referenced by PetAI::CanAttack().
| bool CharmInfo::IsFollowing | ( | ) |
Definition at line 13364 of file Unit.cpp.
References _isFollowing.
Referenced by PetAI::HandleReturnMovement(), and PetAI::SelectNextTarget().
| bool CharmInfo::IsReturning | ( | ) |
Definition at line 13374 of file Unit.cpp.
References _isReturning.
Referenced by PetAI::CanAttack(), PetAI::HandleReturnMovement(), PetAI::MovementInform(), and PetAI::SelectNextTarget().
| void CharmInfo::LoadPetActionBar | ( | const std::string & | data | ) |
Definition at line 247 of file CharmInfo.cpp.
References _unit, ACT_PASSIVE, ACTION_BAR_INDEX_END, ACTION_BAR_INDEX_START, Map::GetDifficultyID(), WorldObject::GetMap(), InitPetActionBar(), SpellInfo::IsAutocastable(), PetActionBar, UnitActionBarEntry::SetActionAndType(), SetActionBar(), sSpellMgr, and Trinity::Tokenize().
| bool CharmInfo::RemoveSpellFromActionBar | ( | uint32 | spell_id | ) |
Definition at line 209 of file CharmInfo.cpp.
References ACT_PASSIVE, MAX_UNIT_ACTION_BAR_INDEX, PetActionBar, SetActionBar(), and sSpellMgr.
| void CharmInfo::RestoreState | ( | ) |
Definition at line 43 of file CharmInfo.cpp.
References _oldReactState, _unit, and Object::ToCreature().
| 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().
|
inline |
Definition at line 110 of file CharmInfo.h.
Referenced by AddSpellToActionBar(), WorldSession::HandlePetSetAction(), InitEmptyActionBar(), InitPetActionBar(), LoadPetActionBar(), and RemoveSpellFromActionBar().
|
inline |
Definition at line 96 of file CharmInfo.h.
Referenced by WorldSession::HandlePetActionHelper().
| void CharmInfo::SetIsAtStay | ( | bool | val | ) |
Definition at line 13349 of file Unit.cpp.
References _isAtStay.
Referenced by Pet::AddToWorld(), PetAI::ClearCharmInfoFlags(), PetAI::DoAttack(), Spell::EffectResurrectPet(), WorldSession::HandlePetActionHelper(), and PetAI::MovementInform().
| void CharmInfo::SetIsCommandAttack | ( | bool | val | ) |
Definition at line 13308 of file Unit.cpp.
References _isCommandAttack.
Referenced by Pet::AddToWorld(), PetAI::ClearCharmInfoFlags(), PetAI::DoAttack(), Spell::EffectResurrectPet(), WorldSession::HandlePetActionHelper(), and PetAI::StopAttack().
| void CharmInfo::SetIsCommandFollow | ( | bool | val | ) |
Definition at line 13318 of file Unit.cpp.
References _isCommandFollow.
Referenced by Pet::AddToWorld(), PetAI::ClearCharmInfoFlags(), Spell::EffectResurrectPet(), and WorldSession::HandlePetActionHelper().
| void CharmInfo::SetIsFollowing | ( | bool | val | ) |
Definition at line 13359 of file Unit.cpp.
References _isFollowing.
Referenced by Pet::AddToWorld(), PetAI::ClearCharmInfoFlags(), Spell::EffectResurrectPet(), WorldSession::HandlePetActionHelper(), and PetAI::MovementInform().
| void CharmInfo::SetIsReturning | ( | bool | val | ) |
Definition at line 13369 of file Unit.cpp.
References _isReturning.
Referenced by Pet::AddToWorld(), PetAI::ClearCharmInfoFlags(), Spell::EffectResurrectPet(), WorldSession::HandlePetActionHelper(), and PetAI::HandleReturnMovement().
| void CharmInfo::SetPetNumber | ( | uint32 | petnumber, |
| bool | statwindow | ||
| ) |
Definition at line 238 of file CharmInfo.cpp.
References _petnumber, _unit, and Unit::SetPetNumberForClient().
Referenced by Unit::InitTamedPet(), Unit::RemoveCharmedBy(), Unit::SetCharmedBy(), and Player::SummonPet().
| void CharmInfo::SetSpellAutocast | ( | SpellInfo const * | spellInfo, |
| bool | state | ||
| ) |
Definition at line 278 of file CharmInfo.cpp.
References ACT_DISABLED, ACT_ENABLED, UnitActionBarEntry::GetAction(), SpellInfo::Id, UnitActionBarEntry::IsActionBarForSpell(), MAX_UNIT_ACTION_BAR_INDEX, PetActionBar, and UnitActionBarEntry::SetType().
Referenced by WorldSession::HandlePetSpellAutocastOpcode().
| void CharmInfo::ToggleCreatureAutocast | ( | SpellInfo const * | spellInfo, |
| bool | apply | ||
| ) |
Definition at line 228 of file CharmInfo.cpp.
References _charmspells, ACT_DISABLED, ACT_ENABLED, UnitActionBarEntry::GetAction(), SpellInfo::Id, SpellInfo::IsPassive(), MAX_SPELL_CHARM, and UnitActionBarEntry::SetType().
Referenced by WorldSession::HandlePetSpellAutocastOpcode(), and InitCharmCreateSpells().
|
private |
Definition at line 138 of file CharmInfo.h.
Referenced by CharmInfo(), InitCharmCreateSpells(), and ToggleCreatureAutocast().
|
private |
Definition at line 139 of file CharmInfo.h.
|
private |
Definition at line 147 of file CharmInfo.h.
Referenced by IsAtStay(), and SetIsAtStay().
|
private |
Definition at line 145 of file CharmInfo.h.
Referenced by IsCommandAttack(), and SetIsCommandAttack().
|
private |
Definition at line 146 of file CharmInfo.h.
Referenced by IsCommandFollow(), and SetIsCommandFollow().
|
private |
Definition at line 148 of file CharmInfo.h.
Referenced by IsFollowing(), and SetIsFollowing().
|
private |
Definition at line 149 of file CharmInfo.h.
Referenced by IsReturning(), and SetIsReturning().
|
private |
Definition at line 143 of file CharmInfo.h.
Referenced by CharmInfo(), and RestoreState().
|
private |
Definition at line 140 of file CharmInfo.h.
Referenced by SetPetNumber().
|
private |
Definition at line 150 of file CharmInfo.h.
Referenced by GetStayPosition(), and SaveStayPosition().
|
private |
Definition at line 151 of file CharmInfo.h.
Referenced by GetStayPosition(), and SaveStayPosition().
|
private |
Definition at line 152 of file CharmInfo.h.
Referenced by GetStayPosition(), and SaveStayPosition().
|
private |
Definition at line 136 of file CharmInfo.h.
Referenced by CharmInfo(), InitCharmCreateSpells(), InitPossessCreateSpells(), LoadPetActionBar(), RestoreState(), SaveStayPosition(), and SetPetNumber().
|
private |
Definition at line 137 of file CharmInfo.h.
Referenced by AddSpellToActionBar(), LoadPetActionBar(), RemoveSpellFromActionBar(), and SetSpellAutocast().