TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 constGetActionBarEntry (uint8 index) const
 
void ToggleCreatureAutocast (SpellInfo const *spellInfo, bool apply)
 
CharmSpellInfoGetCharmSpell (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
 

Constructor & Destructor Documentation

CharmInfo::CharmInfo ( Unit unit)
explicit
11856  _isCommandAttack(false), _isCommandFollow(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
11857  _stayX(0.0f), _stayY(0.0f), _stayZ(0.0f)
11858 {
11859  for (uint8 i = 0; i < MAX_SPELL_CHARM; ++i)
11860  _charmspells[i].SetActionAndType(0, ACT_DISABLED);
11861 
11862  if (_unit->GetTypeId() == TYPEID_UNIT)
11863  {
11866  }
11867 }
#define MAX_SPELL_CHARM
Definition: Unit.h:325
bool _isCommandAttack
Definition: Unit.h:1259
CharmSpellInfo _charmspells[4]
Definition: Unit.h:1252
Definition: Unit.h:1129
float _stayY
Definition: Unit.h:1265
Definition: ObjectGuid.h:32
CommandStates _CommandState
Definition: Unit.h:1253
bool _isAtStay
Definition: Unit.h:1261
TypeID GetTypeId() const
Definition: Object.h:113
bool _isReturning
Definition: Unit.h:1263
Unit * _unit
Definition: Unit.h:1250
uint32 _petnumber
Definition: Unit.h:1254
float _stayZ
Definition: Unit.h:1266
ReactStates GetReactState() const
Definition: Creature.h:503
Definition: Unit.h:1138
Creature * ToCreature()
Definition: Object.h:194
float _stayX
Definition: Unit.h:1264
uint8_t uint8
Definition: Define.h:152
ReactStates _oldReactState
Definition: Unit.h:1257
bool _isCommandFollow
Definition: Unit.h:1260
void SetReactState(ReactStates st)
Definition: Creature.h:502
bool _isFollowing
Definition: Unit.h:1262
Definition: Unit.h:1120

+ Here is the call graph for this function:

CharmInfo::~CharmInfo ( )
11869 { }

Member Function Documentation

bool CharmInfo::AddSpellToActionBar ( SpellInfo const spellInfo,
ActiveStates  newstate = ACT_DECIDE,
uint8  preferredSlot = 0 
)
11988 {
11989  uint32 spell_id = spellInfo->Id;
11990  uint32 first_id = spellInfo->GetFirstRankSpell()->Id;
11991 
11992  ASSERT(preferredSlot < MAX_UNIT_ACTION_BAR_INDEX);
11993  // new spell rank can be already listed
11994  for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
11995  {
11996  if (uint32 action = PetActionBar[i].GetAction())
11997  {
11998  if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr->GetFirstSpellInChain(action) == first_id)
11999  {
12000  PetActionBar[i].SetAction(spell_id);
12001  return true;
12002  }
12003  }
12004  }
12005 
12006  // or use empty slot in other case
12007  for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
12008  {
12009  uint8 j = (preferredSlot + i) % MAX_UNIT_ACTION_BAR_INDEX;
12010  if (!PetActionBar[j].GetAction() && PetActionBar[j].IsActionBarForSpell())
12011  {
12012  SetActionBar(j, spell_id, newstate == ACT_DECIDE ? spellInfo->IsAutocastable() ? ACT_DISABLED : ACT_PASSIVE : newstate);
12013  return true;
12014  }
12015  }
12016  return false;
12017 }
Definition: Unit.h:1124
bool IsActionBarForSpell() const
Definition: Unit.h:1157
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
void SetAction(uint32 action)
Definition: Unit.h:1173
#define MAX_UNIT_ACTION_BAR_INDEX
Definition: Unit.h:1199
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
Definition: Unit.h:1225
uint8_t uint8
Definition: Define.h:152
Definition: Unit.h:1119
#define ASSERT
Definition: Errors.h:55
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
Definition: Unit.h:1251
Definition: Unit.h:1120

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharmInfo::BuildActionBar ( WorldPacket data)
12090 {
12091  for (uint32 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
12092  *data << uint32(PetActionBar[i].packedData);
12093 }
uint32_t uint32
Definition: Define.h:150
#define MAX_UNIT_ACTION_BAR_INDEX
Definition: Unit.h:1199
uint32_t uint32
Definition: g3dmath.h:168
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
Definition: Unit.h:1251
UnitActionBarEntry const* CharmInfo::GetActionBarEntry ( uint8  index) const
inline
1229 { return &(PetActionBar[index]); }
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
Definition: Unit.h:1251

+ Here is the caller graph for this function:

CharmSpellInfo* CharmInfo::GetCharmSpell ( uint8  index)
inline
1233 { return &(_charmspells[index]); }
CharmSpellInfo _charmspells[4]
Definition: Unit.h:1252

+ Here is the caller graph for this function:

CommandStates CharmInfo::GetCommandState ( ) const
inline
1211 { return _CommandState; }
CommandStates _CommandState
Definition: Unit.h:1253
uint32 CharmInfo::GetPetNumber ( ) const
inline
1207 { return _petnumber; }
uint32 _petnumber
Definition: Unit.h:1254

+ Here is the caller graph for this function:

void CharmInfo::GetStayPosition ( float &  x,
float &  y,
float &  z 
)
15735 {
15736  x = _stayX;
15737  y = _stayY;
15738  z = _stayZ;
15739 }
float _stayY
Definition: Unit.h:1265
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
float _stayZ
Definition: Unit.h:1266
float _stayX
Definition: Unit.h:1264
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

bool CharmInfo::HasCommandState ( CommandStates  state) const
inline
1212 { return (_CommandState == state); }
CommandStates _CommandState
Definition: Unit.h:1253

+ Here is the caller graph for this function:

void CharmInfo::InitCharmCreateSpells ( )
11938 {
11939  if (_unit->GetTypeId() == TYPEID_PLAYER) // charmed players don't have spells
11940  {
11942  return;
11943  }
11944 
11945  InitPetActionBar();
11946 
11947  for (uint32 x = 0; x < MAX_SPELL_CHARM; ++x)
11948  {
11949  uint32 spellId = _unit->ToCreature()->m_spells[x];
11950  SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
11951 
11952  if (!spellInfo)
11953  {
11955  continue;
11956  }
11957 
11958  if (spellInfo->IsPassive())
11959  {
11960  _unit->CastSpell(_unit, spellInfo, true);
11962  }
11963  else
11964  {
11966 
11967  ActiveStates newstate = ACT_PASSIVE;
11968 
11969  if (!spellInfo->IsAutocastable())
11970  newstate = ACT_PASSIVE;
11971  else
11972  {
11973  if (spellInfo->NeedsExplicitUnitTarget())
11974  {
11975  newstate = ACT_ENABLED;
11976  ToggleCreatureAutocast(spellInfo, true);
11977  }
11978  else
11979  newstate = ACT_DISABLED;
11980  }
11981 
11982  AddSpellToActionBar(spellInfo, newstate);
11983  }
11984  }
11985 }
void SetActionAndType(uint32 action, ActiveStates type)
Definition: Unit.h:1163
bool IsPassive() const
Definition: SpellInfo.cpp:1403
#define MAX_SPELL_CHARM
Definition: Unit.h:325
bool IsAutocastable() const
Definition: SpellInfo.cpp:1408
CharmSpellInfo _charmspells[4]
Definition: Unit.h:1252
Definition: SpellInfo.h:326
TypeID GetTypeId() const
Definition: Object.h:113
uint32 m_spells[CREATURE_MAX_SPELLS]
Definition: Creature.h:602
void InitPetActionBar()
Definition: Unit.cpp:11877
void InitEmptyActionBar(bool withAttack=true)
Definition: Unit.cpp:11892
Unit * _unit
Definition: Unit.h:1250
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
Definition: Unit.h:1121
ActiveStates
Definition: Unit.h:1117
Definition: ObjectGuid.h:33
Creature * ToCreature()
Definition: Object.h:194
Definition: Unit.h:1119
bool NeedsExplicitUnitTarget() const
Definition: SpellInfo.cpp:1358
G3D::int16 x
Definition: Vector2int16.h:37
void ToggleCreatureAutocast(SpellInfo const *spellInfo, bool apply)
Definition: Unit.cpp:12038
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
bool AddSpellToActionBar(SpellInfo const *spellInfo, ActiveStates newstate=ACT_DECIDE, uint8 preferredSlot=0)
Definition: Unit.cpp:11987
Definition: Unit.h:1120

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharmInfo::InitEmptyActionBar ( bool  withAttack = true)
11893 {
11894  if (withAttack)
11896  else
11899  SetActionBar(x, 0, ACT_PASSIVE);
11900 }
Definition: Unit.h:1139
Definition: Unit.h:1196
uint32_t uint32
Definition: Define.h:150
Definition: Unit.h:1122
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
Definition: Unit.h:1225
Definition: Unit.h:1119
G3D::int16 x
Definition: Vector2int16.h:37
Definition: Unit.h:1193

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharmInfo::InitPetActionBar ( )
11878 {
11879  // the first 3 SpellOrActions are attack, follow and stay
11881  SetActionBar(ACTION_BAR_INDEX_START + i, COMMAND_ATTACK - i, ACT_COMMAND);
11882 
11883  // middle 4 SpellOrActions are spells/special attacks/abilities
11885  SetActionBar(ACTION_BAR_INDEX_PET_SPELL_START + i, 0, ACT_PASSIVE);
11886 
11887  // last 3 SpellOrActions are reactions
11889  SetActionBar(ACTION_BAR_INDEX_PET_SPELL_END + i, COMMAND_ATTACK - i, ACT_REACTION);
11890 }
Definition: Unit.h:1139
Definition: Unit.h:1196
Definition: Unit.h:1194
uint32_t uint32
Definition: Define.h:150
Definition: Unit.h:1123
Definition: Unit.h:1195
Definition: Unit.h:1122
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
Definition: Unit.h:1225
Definition: Unit.h:1119
Definition: Unit.h:1193

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharmInfo::InitPossessCreateSpells ( )
11903 {
11904  if (_unit->GetTypeId() == TYPEID_UNIT)
11905  {
11906  // Adding switch until better way is found. Malcrom
11907  // Adding entrys to this switch will prevent COMMAND_ATTACK being added to pet bar.
11908  switch (_unit->GetEntry())
11909  {
11910  case 23575: // Mindless Abomination
11911  case 24783: // Trained Rock Falcon
11912  case 27664: // Crashin' Thrashin' Racer
11913  case 40281: // Crashin' Thrashin' Racer
11914  break;
11915  default:
11917  break;
11918  }
11919 
11920  for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
11921  {
11922  uint32 spellId = _unit->ToCreature()->m_spells[i];
11923  SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
11924  if (spellInfo)
11925  {
11926  if (spellInfo->IsPassive())
11927  _unit->CastSpell(_unit, spellInfo, true);
11928  else
11930  }
11931  }
11932  }
11933  else
11935 }
bool IsPassive() const
Definition: SpellInfo.cpp:1403
#define CREATURE_MAX_SPELLS
Definition: Creature.h:75
Definition: SpellInfo.h:326
Definition: ObjectGuid.h:32
TypeID GetTypeId() const
Definition: Object.h:113
uint32 m_spells[CREATURE_MAX_SPELLS]
Definition: Creature.h:602
void InitEmptyActionBar(bool withAttack=true)
Definition: Unit.cpp:11892
Unit * _unit
Definition: Unit.h:1250
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
Creature * ToCreature()
Definition: Object.h:194
#define MAX_UNIT_ACTION_BAR_INDEX
Definition: Unit.h:1199
uint8_t uint8
Definition: Define.h:152
Definition: Unit.h:1119
uint32 GetEntry() const
Definition: Object.h:107
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
bool AddSpellToActionBar(SpellInfo const *spellInfo, ActiveStates newstate=ACT_DECIDE, uint8 preferredSlot=0)
Definition: Unit.cpp:11987

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CharmInfo::IsAtStay ( )
15747 {
15748  return _isAtStay;
15749 }
bool _isAtStay
Definition: Unit.h:1261

+ Here is the caller graph for this function:

bool CharmInfo::IsCommandAttack ( )
15706 {
15707  return _isCommandAttack;
15708 }
bool _isCommandAttack
Definition: Unit.h:1259

+ Here is the caller graph for this function:

bool CharmInfo::IsCommandFollow ( )
15716 {
15717  return _isCommandFollow;
15718 }
bool _isCommandFollow
Definition: Unit.h:1260

+ Here is the caller graph for this function:

bool CharmInfo::IsFollowing ( )
15757 {
15758  return _isFollowing;
15759 }
bool _isFollowing
Definition: Unit.h:1262

+ Here is the caller graph for this function:

bool CharmInfo::IsReturning ( )
15767 {
15768  return _isReturning;
15769 }
bool _isReturning
Definition: Unit.h:1263

+ Here is the caller graph for this function:

void CharmInfo::LoadPetActionBar ( const std::string &  data)
12058 {
12059  InitPetActionBar();
12060 
12061  Tokenizer tokens(data, ' ');
12062 
12063  if (tokens.size() != (ACTION_BAR_INDEX_END-ACTION_BAR_INDEX_START) * 2)
12064  return; // non critical, will reset to default
12065 
12066  uint8 index = ACTION_BAR_INDEX_START;
12067  Tokenizer::const_iterator iter = tokens.begin();
12068  for (; index < ACTION_BAR_INDEX_END; ++iter, ++index)
12069  {
12070  // use unsigned cast to avoid sign negative format use at long-> ActiveStates (int) conversion
12071  ActiveStates type = ActiveStates(atol(*iter));
12072  ++iter;
12073  uint32 action = atoul(*iter);
12074 
12075  PetActionBar[index].SetActionAndType(action, type);
12076 
12077  // check correctness
12078  if (PetActionBar[index].IsActionBarForSpell())
12079  {
12080  SpellInfo const* spelInfo = sSpellMgr->GetSpellInfo(PetActionBar[index].GetAction());
12081  if (!spelInfo)
12082  SetActionBar(index, 0, ACT_PASSIVE);
12083  else if (!spelInfo->IsAutocastable())
12084  SetActionBar(index, PetActionBar[index].GetAction(), ACT_PASSIVE);
12085  }
12086  }
12087 }
void SetActionAndType(uint32 action, ActiveStates type)
Definition: Unit.h:1163
bool IsAutocastable() const
Definition: SpellInfo.cpp:1408
Definition: SpellInfo.h:326
Definition: Util.h:45
Definition: Unit.h:1196
StorageType::const_iterator const_iterator
Definition: Util.h:52
void InitPetActionBar()
Definition: Unit.cpp:11877
unsigned long atoul(char const *str)
Definition: Common.h:90
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
ActiveStates
Definition: Unit.h:1117
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
Definition: Unit.h:1225
uint8_t uint8
Definition: Define.h:152
Definition: Unit.h:1119
Definition: Unit.h:1193
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
Definition: Unit.h:1251

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CharmInfo::RemoveSpellFromActionBar ( uint32  spell_id)
12020 {
12021  uint32 first_id = sSpellMgr->GetFirstSpellInChain(spell_id);
12022 
12023  for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
12024  {
12025  if (uint32 action = PetActionBar[i].GetAction())
12026  {
12027  if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr->GetFirstSpellInChain(action) == first_id)
12028  {
12029  SetActionBar(i, 0, ACT_PASSIVE);
12030  return true;
12031  }
12032  }
12033  }
12034 
12035  return false;
12036 }
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
#define MAX_UNIT_ACTION_BAR_INDEX
Definition: Unit.h:1199
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
Definition: Unit.h:1225
uint8_t uint8
Definition: Define.h:152
Definition: Unit.h:1119
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
Definition: Unit.h:1251

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharmInfo::RestoreState ( )
11872 {
11873  if (Creature* creature = _unit->ToCreature())
11874  creature->SetReactState(_oldReactState);
11875 }
Definition: Creature.h:467
Unit * _unit
Definition: Unit.h:1250
Creature * ToCreature()
Definition: Object.h:194
ReactStates _oldReactState
Definition: Unit.h:1257

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharmInfo::SaveStayPosition ( )

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

15721 {
15724 
15726  if (TransportBase* transport = _unit->GetDirectTransport())
15727  transport->CalculatePassengerPosition(stayPos.x, stayPos.y, stayPos.z);
15728 
15729  _stayX = stayPos.x;
15730  _stayY = stayPos.y;
15731  _stayZ = stayPos.z;
15732 }
float x
Definition: Vector3.h:62
float _stayY
Definition: Unit.h:1265
Movement::MoveSpline * movespline
Definition: Unit.h:2213
float y
Definition: Vector3.h:62
Definition: Vector3.h:58
Definition: VehicleDefines.h:119
bool onTransport
Definition: MoveSpline.h:136
Unit * _unit
Definition: Unit.h:1250
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle) ...
Definition: Unit.cpp:14365
float _stayZ
Definition: Unit.h:1266
Vector3 const & FinalDestination() const
Definition: MoveSpline.h:132
float z
Definition: Vector3.h:62
float _stayX
Definition: Unit.h:1264

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharmInfo::SetActionBar ( uint8  index,
uint32  spellOrAction,
ActiveStates  type 
)
inline
1226  {
1227  PetActionBar[index].SetActionAndType(spellOrAction, type);
1228  }
void SetActionAndType(uint32 action, ActiveStates type)
Definition: Unit.h:1163
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
Definition: Unit.h:1251

+ Here is the caller graph for this function:

void CharmInfo::SetCommandState ( CommandStates  st)
inline
1210 { _CommandState = st; }
CommandStates _CommandState
Definition: Unit.h:1253

+ Here is the caller graph for this function:

void CharmInfo::SetIsAtStay ( bool  val)
15742 {
15743  _isAtStay = val;
15744 }
bool _isAtStay
Definition: Unit.h:1261

+ Here is the caller graph for this function:

void CharmInfo::SetIsCommandAttack ( bool  val)
15701 {
15702  _isCommandAttack = val;
15703 }
bool _isCommandAttack
Definition: Unit.h:1259

+ Here is the caller graph for this function:

void CharmInfo::SetIsCommandFollow ( bool  val)
15711 {
15712  _isCommandFollow = val;
15713 }
bool _isCommandFollow
Definition: Unit.h:1260

+ Here is the caller graph for this function:

void CharmInfo::SetIsFollowing ( bool  val)
15752 {
15753  _isFollowing = val;
15754 }
bool _isFollowing
Definition: Unit.h:1262

+ Here is the caller graph for this function:

void CharmInfo::SetIsReturning ( bool  val)
15762 {
15763  _isReturning = val;
15764 }
bool _isReturning
Definition: Unit.h:1263

+ Here is the caller graph for this function:

void CharmInfo::SetPetNumber ( uint32  petnumber,
bool  statwindow 
)
12049 {
12050  _petnumber = petnumber;
12051  if (statwindow)
12053  else
12055 }
Definition: UpdateFields.h:125
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
Unit * _unit
Definition: Unit.h:1250
uint32 _petnumber
Definition: Unit.h:1254

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharmInfo::SetSpellAutocast ( SpellInfo const spellInfo,
bool  state 
)
12096 {
12097  for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
12098  {
12099  if (spellInfo->Id == PetActionBar[i].GetAction() && PetActionBar[i].IsActionBarForSpell())
12100  {
12102  break;
12103  }
12104  }
12105 }
uint32 GetAction() const
Definition: Unit.h:1156
bool IsActionBarForSpell() const
Definition: Unit.h:1157
void SetType(ActiveStates type)
Definition: Unit.h:1168
Definition: Unit.h:1121
#define MAX_UNIT_ACTION_BAR_INDEX
Definition: Unit.h:1199
uint8_t uint8
Definition: Define.h:152
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
Definition: Unit.h:1251
Definition: Unit.h:1120

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CharmInfo::ToggleCreatureAutocast ( SpellInfo const spellInfo,
bool  apply 
)
12039 {
12040  if (spellInfo->IsPassive())
12041  return;
12042 
12043  for (uint32 x = 0; x < MAX_SPELL_CHARM; ++x)
12044  if (spellInfo->Id == _charmspells[x].GetAction())
12046 }
uint32 GetAction() const
Definition: Unit.h:1156
#define MAX_SPELL_CHARM
Definition: Unit.h:325
CharmSpellInfo _charmspells[4]
Definition: Unit.h:1252
void apply(T *val)
Definition: ByteConverter.h:41
uint32_t uint32
Definition: Define.h:150
Definition: Unit.h:1121
G3D::int16 x
Definition: Vector2int16.h:37
Definition: Unit.h:1120

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

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

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