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 
)
9055 : WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList), _range(range), _position(position)
9056 {
9057 }
WorldObjectSpellTargetCheck(Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
Definition: Spell.cpp:8957
float _range
Definition: Spell.h:823
Position const * _position
Definition: Spell.h:824

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellAreaTargetCheck::operator() ( WorldObject target)
9060 {
9061 if (target->IsGameObject())
9062 {
9064 return false;
9065 }
9066 else if (!target->IsWithinDist3d(_position, _range))
9067 return false;
9068 else if (target->IsCreature() && target->ToCreature()->IsAvoidingAOE()) // pussywizard
9069 return false;
9071 }
bool IsAvoidingAOE() const
Definition: Creature.h:130
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:118
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
bool operator()(WorldObject *target)
Definition: Spell.cpp:8973

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()().