AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::WorldObjectSpellAreaTargetCheck Struct Reference

#include "Spell.h"

Inheritance diagram for Acore::WorldObjectSpellAreaTargetCheck:
Acore::WorldObjectSpellTargetCheck Acore::WorldObjectSpellConeTargetCheck Acore::WorldObjectSpellTrajTargetCheck

Public Member Functions

 WorldObjectSpellAreaTargetCheck (float range, Position const *position, Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList, Acore::WorldObjectSpellAreaTargetSearchReason searchReason=Acore::WorldObjectSpellAreaTargetSearchReason::Area)
 
bool operator() (WorldObject *target)
 
- Public Member Functions inherited from Acore::WorldObjectSpellTargetCheck
 WorldObjectSpellTargetCheck (Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
 
 ~WorldObjectSpellTargetCheck ()
 
bool operator() (WorldObject *target)
 

Public Attributes

float _range
 
Position const * _position
 
Acore::WorldObjectSpellAreaTargetSearchReason _searchReason
 
- Public Attributes inherited from Acore::WorldObjectSpellTargetCheck
Unit_caster
 
Unit_referer
 
SpellInfo const * _spellInfo
 
SpellTargetCheckTypes _targetSelectionType
 
ConditionSourceInfo_condSrcInfo
 
ConditionList_condList
 

Detailed Description

Constructor & Destructor Documentation

◆ WorldObjectSpellAreaTargetCheck()

Acore::WorldObjectSpellAreaTargetCheck::WorldObjectSpellAreaTargetCheck ( float  range,
Position const *  position,
Unit caster,
Unit referer,
SpellInfo const *  spellInfo,
SpellTargetCheckTypes  selectionType,
ConditionList condList,
Acore::WorldObjectSpellAreaTargetSearchReason  searchReason = Acore::WorldObjectSpellAreaTargetSearchReason::Area 
)
9116 : WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList), _range(range), _position(position), _searchReason(searchReason)
9117 {
9118 }
float _range
Definition Spell.h:837
Position const * _position
Definition Spell.h:838
Acore::WorldObjectSpellAreaTargetSearchReason _searchReason
Definition Spell.h:839
WorldObjectSpellTargetCheck(Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
Definition Spell.cpp:9014

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellAreaTargetCheck::operator() ( WorldObject target)
9121 {
9122 if (target->IsGameObject())
9123 {
9125 return false;
9126 }
9127 else if (!target->IsWithinDist3d(_position, _range))
9128 return false;
9129 else if (Creature* c = target->ToCreature())
9130 {
9131 if (c->IsAvoidingAOE()) // pussywizard
9132 return false;
9133 if (CreatureImmunities const* immunities = sSpellMgr->GetCreatureImmunities(c->GetCreatureTemplate()->CreatureImmunitiesId))
9134 {
9135 switch (_searchReason)
9136 {
9138 if (immunities->ImmuneAoE)
9139 return false;
9140 break;
9142 if (immunities->ImmuneChain)
9143 return false;
9144 break;
9145 default:
9146 break;
9147 }
9148 }
9149 }
9151 }
#define sSpellMgr
Definition SpellMgr.h:847
Definition Creature.h:47
bool IsInRange3d(float x, float y, float z, float radius) const
Definition GameObject.cpp:2180
bool IsGameObject() const
Definition Object.h:213
GameObject * ToGameObject()
Definition Object.h:214
Creature * ToCreature()
Definition Object.h:206
bool IsWithinDist3d(float x, float y, float z, float dist) const
Definition Object.cpp:1345
bool operator()(WorldObject *target)
Definition Spell.cpp:9030
Definition SpellMgr.h:571
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References _position, _range, _searchReason, Acore::Area, Acore::Chain, Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Object::IsGameObject(), GameObject::IsInRange3d(), WorldObject::IsWithinDist3d(), Acore::WorldObjectSpellTargetCheck::operator()(), sSpellMgr, Object::ToCreature(), and Object::ToGameObject().

Referenced by Acore::WorldObjectSpellConeTargetCheck::operator()().

Member Data Documentation

◆ _position

Position const* Acore::WorldObjectSpellAreaTargetCheck::_position

◆ _range

float Acore::WorldObjectSpellAreaTargetCheck::_range

◆ _searchReason

Acore::WorldObjectSpellAreaTargetSearchReason Acore::WorldObjectSpellAreaTargetCheck::_searchReason

Referenced by operator()().


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