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

Private Member Functions

 PrepareSpellScript (spell_garfrost_permafrost)
 
void Unload () override
 
void FilterTargets (std::list< WorldObject * > &targets)
 
void FilterTargetsNext (std::list< WorldObject * > &targets)
 
void Register () override
 

Private Attributes

std::list< WorldObject * > targetList
 

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
 
Unit * GetCaster ()
 
GameObject * GetGObjCaster ()
 
Unit * GetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObject * GetExplTargetWorldObject ()
 
Unit * GetExplTargetUnit ()
 
GameObject * GetExplTargetGObj ()
 
Item * GetExplTargetItem ()
 
Unit * GetHitUnit ()
 
Creature * GetHitCreature ()
 
Player * GetHitPlayer ()
 
Item * GetHitItem ()
 
GameObject * GetHitGObj ()
 
WorldLocation * GetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
Spell * GetSpell ()
 
Aura * GetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
Item * GetCastItem ()
 
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 bool Load ()
 
- 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< CastHandler > BeforeCast
 
HookList< CastHandler > OnCast
 
HookList< CastHandler > AfterCast
 
HookList< CheckCastHandler > OnCheckCast
 
HookList< EffectHandler > OnEffectLaunch
 
HookList< EffectHandler > OnEffectLaunchTarget
 
HookList< EffectHandler > OnEffectHit
 
HookList< EffectHandler > OnEffectHitTarget
 
HookList< BeforeHitHandler > BeforeHit
 
HookList< HitHandler > OnHit
 
HookList< HitHandler > AfterHit
 
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
 
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ FilterTargets()

void spell_garfrost_permafrost::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
313 {
314 if (Unit* caster = GetCaster())
315 {
316 std::list<GameObject*> blockList;
317 caster->GetGameObjectListWithEntryInGrid(blockList, GO_SARONITE_ROCK, 100.0f);
318
319 if (!blockList.empty())
320 {
321 for (std::list<WorldObject*>::iterator itrU = targets.begin(); itrU != targets.end(); ++itrU)
322 if (WorldObject* target = (*itrU))
323 {
324 bool valid = true;
325 if (!caster->IsWithinMeleeRange(target->ToUnit()))
326 for (std::list<GameObject*>::const_iterator itr = blockList.begin(); itr != blockList.end(); ++itr)
327 if (!(*itr)->IsInvisibleDueToDespawn())
328 if ((*itr)->IsInBetween(caster, target, 4.0f))
329 {
330 valid = false;
331 break;
332 }
333 if (valid)
334 {
335 if (Aura* aur = target->ToUnit()->GetAura(70336))
336 if (aur->GetStackAmount() >= 10 && caster->IsCreature())
337 caster->ToCreature()->AI()->SetData(1, aur->GetStackAmount());
338 targetList.push_back(*itrU);
339 }
340 }
341 }
342 else
343 {
344 targetList = targets;
345 return;
346 }
347 }
348
349 targets = targetList;
350 }
@ GO_SARONITE_ROCK
Definition boss_forgemaster_garfrost.cpp:45
Definition SpellAuras.h:88
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:665
Definition Object.h:482
std::list< WorldObject * > targetList
Definition boss_forgemaster_garfrost.cpp:305

References SpellScript::GetCaster(), GO_SARONITE_ROCK, and targetList.

Referenced by Register().

◆ FilterTargetsNext()

void spell_garfrost_permafrost::FilterTargetsNext ( std::list< WorldObject * > &  targets)
inlineprivate
353 {
354 targets = targetList;
355 }

References targetList.

Referenced by Register().

◆ PrepareSpellScript()

spell_garfrost_permafrost::PrepareSpellScript ( spell_garfrost_permafrost  )
private

◆ Register()

void spell_garfrost_permafrost::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

358 {
362 }
@ EFFECT_1
Definition SharedDefines.h:32
@ EFFECT_0
Definition SharedDefines.h:31
@ EFFECT_2
Definition SharedDefines.h:33
@ TARGET_UNIT_DEST_AREA_ENEMY
Definition SharedDefines.h:1425
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition SpellScript.h:354
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition SpellScript.h:353
void FilterTargetsNext(std::list< WorldObject * > &targets)
Definition boss_forgemaster_garfrost.cpp:352
void FilterTargets(std::list< WorldObject * > &targets)
Definition boss_forgemaster_garfrost.cpp:312

References EFFECT_0, EFFECT_1, EFFECT_2, FilterTargets(), FilterTargetsNext(), SpellScript::OnObjectAreaTargetSelect, SpellObjectAreaTargetSelectFn, and TARGET_UNIT_DEST_AREA_ENEMY.

◆ Unload()

void spell_garfrost_permafrost::Unload ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

308 {
309 targetList.clear();
310 }

References targetList.

Member Data Documentation

◆ targetList

std::list<WorldObject*> spell_garfrost_permafrost::targetList
private

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