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 
)
9001 : WorldObjectSpellTargetCheck(caster, referer, spellInfo, selectionType, condList), _range(range), _position(position)
9002 {
9003 }
WorldObjectSpellTargetCheck(Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
Definition: Spell.cpp:8903
float _range
Definition: Spell.h:819
Position const * _position
Definition: Spell.h:820

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellAreaTargetCheck::operator() ( WorldObject target)
9006 {
9007 if (target->GetTypeId() == TYPEID_GAMEOBJECT)
9008 {
9010 return false;
9011 }
9012 else if (!target->IsWithinDist3d(_position, _range))
9013 return false;
9014 else if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->IsAvoidingAOE()) // pussywizard
9015 return false;
9017 }
@ TYPEID_GAMEOBJECT
Definition: ObjectGuid.h:39
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
bool IsAvoidingAOE() const
Definition: Creature.h:125
bool IsInRange(float x, float y, float z, float radius) const
Definition: GameObject.cpp:2146
TypeID GetTypeId() const
Definition: Object.h:121
GameObject * ToGameObject()
Definition: Object.h:202
Creature * ToCreature()
Definition: Object.h:197
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:8919

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

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