AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
spell_kologarn_focused_eyebeam Class Reference
Inheritance diagram for spell_kologarn_focused_eyebeam:
SpellScript _SpellScript

Private Member Functions

 PrepareSpellScript (spell_kologarn_focused_eyebeam)
 
bool Load () override
 
void FilterTargetsInitial (std::list< WorldObject * > &targets)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from SpellScript
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Spell *spell)
 
void _InitHit ()
 
bool _IsEffectPrevented (SpellEffIndex effIndex)
 
bool _IsDefaultEffectPrevented (SpellEffIndex effIndex)
 
void _PrepareScriptCall (SpellScriptHookType hookType)
 
void _FinishScriptCall ()
 
bool IsInCheckCastHook () const
 
bool IsInTargetHook () const
 
bool IsInHitPhase () const
 
bool IsInEffectHook () const
 
UnitGetCaster ()
 
UnitGetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObjectGetExplTargetWorldObject ()
 
UnitGetExplTargetUnit ()
 
GameObjectGetExplTargetGObj ()
 
ItemGetExplTargetItem ()
 
UnitGetHitUnit ()
 
CreatureGetHitCreature ()
 
PlayerGetHitPlayer ()
 
ItemGetHitItem ()
 
GameObjectGetHitGObj ()
 
WorldLocationGetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
SpellGetSpell ()
 
AuraGetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo const * GetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void Cancel ()
 
void SetCustomCastResultMessage (SpellCustomErrors result)
 
- Public Member Functions inherited from _SpellScript
 _SpellScript ()
 
virtual ~_SpellScript ()
 
virtual void _Register ()
 
virtual void _Unload ()
 
virtual void _Init (std::string const *scriptname, uint32 spellId)
 
std::string const * _GetScriptName () const
 
virtual bool Validate (SpellInfo const *)
 
virtual void Unload ()
 
- Static Public Member Functions inherited from _SpellScript
static bool ValidateSpellInfo (std::initializer_list< uint32 > spellIds)
 
template<class T >
static bool ValidateSpellInfo (T const &spellIds)
 
- Public Attributes inherited from SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ FilterTargetsInitial()

void spell_kologarn_focused_eyebeam::FilterTargetsInitial ( std::list< WorldObject * > &  targets)
inlineprivate
696 {
697 std::list<Unit*> newTargets;
698 Creature* creature = GetCaster()->ToCreature();
699 // Select 3 most distant targets
701
702 // If no distant targets available, get 1 target from original list
703 if (newTargets.empty())
704 {
705 if (!targets.empty())
706 {
707 while (1 < targets.size())
708 {
709 std::list<WorldObject*>::iterator itr = targets.begin();
710 advance(itr, urand(0, targets.size() - 1));
711 targets.erase(itr);
712 }
713 }
714 return;
715 }
716
717 // Clear original targets
718 targets.clear();
719
720 // Select a random target
721 std::list<Unit*>::iterator head = newTargets.begin();
722 advance(head, urand(0, newTargets.size() - 1));
723 targets.push_back(*head);
724 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
Definition Creature.h:43
Creature * ToCreature()
Definition Object.h:205
Unit * GetCaster()
Definition SpellScript.cpp:401
void SelectTargetList(std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the f...
Definition UnitAI.cpp:115
UnitAI * GetAI()
Definition Unit.h:664
Definition UnitAI.h:123

References Unit::GetAI(), SpellScript::GetCaster(), MaxDistance, UnitAI::SelectTargetList(), Object::ToCreature(), and urand().

Referenced by Register().

◆ Load()

bool spell_kologarn_focused_eyebeam::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

691 {
692 return GetCaster()->IsCreature();
693 }
bool IsCreature() const
Definition Object.h:204

References SpellScript::GetCaster(), and Object::IsCreature().

◆ PrepareSpellScript()

spell_kologarn_focused_eyebeam::PrepareSpellScript ( spell_kologarn_focused_eyebeam  )
private

◆ Register()

void spell_kologarn_focused_eyebeam::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

727 {
729 }
@ TARGET_UNIT_SRC_AREA_ENEMY
Definition SharedDefines.h:1420
#define EFFECT_ALL
Definition SharedDefines.h:38
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition SpellScript.h:354
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition SpellScript.h:353
void FilterTargetsInitial(std::list< WorldObject * > &targets)
Definition boss_kologarn.cpp:695

References EFFECT_ALL, FilterTargetsInitial(), SpellScript::OnObjectAreaTargetSelect, SpellObjectAreaTargetSelectFn, and TARGET_UNIT_SRC_AREA_ENEMY.


The documentation for this class was generated from the following file: