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 
)
9083 : WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList), _range(range), _position(position), _searchReason(searchReason)
9084 {
9085 }
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:8981

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellAreaTargetCheck::operator() ( WorldObject target)
9088 {
9089 if (target->IsGameObject())
9090 {
9092 return false;
9093 }
9094 else if (!target->IsWithinDist3d(_position, _range))
9095 return false;
9096 else if (Creature* c = target->ToCreature())
9097 {
9098 if (c->IsAvoidingAOE()) // pussywizard
9099 return false;
9100 if (CreatureImmunities const* immunities = sSpellMgr->GetCreatureImmunities(c->GetCreatureTemplate()->CreatureImmunitiesId))
9101 {
9102 switch (_searchReason)
9103 {
9105 if (immunities->ImmuneAoE)
9106 return false;
9107 break;
9109 if (immunities->ImmuneChain)
9110 return false;
9111 break;
9112 default:
9113 break;
9114 }
9115 }
9116 }
9118 }
#define sSpellMgr
Definition SpellMgr.h:836
Definition Creature.h:47
bool IsInRange3d(float x, float y, float z, float radius) const
Definition GameObject.cpp:2170
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:8997
Definition SpellMgr.h:564
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: