AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
UnchainedMagicTargetSelector Class Reference

Public Member Functions

 UnchainedMagicTargetSelector (bool removeHealers)
 
bool operator() (WorldObject *object) const
 

Private Attributes

bool _removeHealers
 

Detailed Description

Constructor & Destructor Documentation

◆ UnchainedMagicTargetSelector()

UnchainedMagicTargetSelector::UnchainedMagicTargetSelector ( bool  removeHealers)
inline
840: _removeHealers(removeHealers) { }
bool _removeHealers
Definition: boss_sindragosa.cpp:861

Member Function Documentation

◆ operator()()

bool UnchainedMagicTargetSelector::operator() ( WorldObject object) const
inline
843 {
844 if (Player* p = object->ToPlayer())
845 {
846 if (p->getPowerType() != POWER_MANA)
847 return true;
848 if (p->IsClass(CLASS_HUNTER))
849 return true;
850 uint8 maxIndex = p->GetMostPointsTalentTree();
851 if ((p->IsClass(CLASS_PALADIN) && maxIndex >= 1) || (p->IsClass(CLASS_SHAMAN) && maxIndex == 1) || (p->IsClass(CLASS_DRUID) && maxIndex == 1))
852 return true;
853 if (_removeHealers == ((p->IsClass(CLASS_DRUID) && maxIndex == 2) || (p->IsClass(CLASS_PALADIN) && maxIndex == 0) || (p->IsClass(CLASS_PRIEST) && maxIndex <= 1) || (p->IsClass(CLASS_SHAMAN) && maxIndex == 2)))
854 return true;
855
856 return false;
857 }
858 return true;
859 }
std::uint8_t uint8
Definition: Define.h:109
@ POWER_MANA
Definition: SharedDefines.h:269
@ CLASS_HUNTER
Definition: SharedDefines.h:143
@ CLASS_DRUID
Definition: SharedDefines.h:151
@ CLASS_SHAMAN
Definition: SharedDefines.h:147
@ CLASS_PRIEST
Definition: SharedDefines.h:145
@ CLASS_PALADIN
Definition: SharedDefines.h:142
Player * ToPlayer()
Definition: Object.h:201
Definition: Player.h:1081

References _removeHealers, CLASS_DRUID, CLASS_HUNTER, CLASS_PALADIN, CLASS_PRIEST, CLASS_SHAMAN, POWER_MANA, and Object::ToPlayer().

Member Data Documentation

◆ _removeHealers

bool UnchainedMagicTargetSelector::_removeHealers
private

Referenced by operator()().