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

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellAreaTargetCheck::operator() ( WorldObject target)
9005 {
9006 if (target->GetTypeId() == TYPEID_GAMEOBJECT)
9007 {
9009 return false;
9010 }
9011 else if (!target->IsWithinDist3d(_position, _range))
9012 return false;
9013 else if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->IsAvoidingAOE()) // pussywizard
9014 return false;
9016 }
@ TYPEID_GAMEOBJECT
Definition: ObjectGuid.h:39
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
bool IsAvoidingAOE() const
Definition: Creature.h:126
bool IsInRange(float x, float y, float z, float radius) const
Definition: GameObject.cpp:2149
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:8918

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