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)
 
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
 
- 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 
)
9033 : WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList), _range(range), _position(position)
9034 {
9035 }
WorldObjectSpellTargetCheck(Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
Definition: Spell.cpp:8935
float _range
Definition: Spell.h:820
Position const * _position
Definition: Spell.h:821

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellAreaTargetCheck::operator() ( WorldObject target)
9038 {
9039 if (target->IsGameObject())
9040 {
9042 return false;
9043 }
9044 else if (!target->IsWithinDist3d(_position, _range))
9045 return false;
9046 else if (target->IsCreature() && target->ToCreature()->IsAvoidingAOE()) // pussywizard
9047 return false;
9049 }
bool IsAvoidingAOE() const
Definition: Creature.h:133
bool IsInRange(float x, float y, float z, float radius) const
Definition: GameObject.cpp:2158
bool IsGameObject() const
Definition: Object.h:209
GameObject * ToGameObject()
Definition: Object.h:210
bool IsCreature() const
Definition: Object.h:201
Creature * ToCreature()
Definition: Object.h:202
bool IsWithinDist3d(float x, float y, float z, float dist) const
Definition: Object.cpp:1295
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
bool operator()(WorldObject *target)
Definition: Spell.cpp:8951

References _position, _range, Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Creature::IsAvoidingAOE(), Object::IsCreature(), Object::IsGameObject(), GameObject::IsInRange(), WorldObject::IsWithinDist3d(), Acore::WorldObjectSpellTargetCheck::operator()(), Object::ToCreature(), and Object::ToGameObject().

Referenced by Acore::WorldObjectSpellConeTargetCheck::operator()(), and Acore::WorldObjectSpellTrajTargetCheck::operator()().

Member Data Documentation

◆ _position

Position const* Acore::WorldObjectSpellAreaTargetCheck::_position

Referenced by operator()().

◆ _range

float Acore::WorldObjectSpellAreaTargetCheck::_range

Referenced by operator()().