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

Private Member Functions

 PrepareSpellScript (spell_garfrost_permafrost_SpellScript)
 
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
 
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 void Register ()=0
 
virtual bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
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
 
virtual bool _Validate (SpellInfo const *entry)
 
- 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::spell_garfrost_permafrost_SpellScript::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
320 {
321 if (Unit* caster = GetCaster())
322 {
323 std::list<GameObject*> blockList;
324 caster->GetGameObjectListWithEntryInGrid(blockList, GO_SARONITE_ROCK, 100.0f);
325
326 if (!blockList.empty())
327 {
328 for (std::list<WorldObject*>::iterator itrU = targets.begin(); itrU != targets.end(); ++itrU)
329 if (WorldObject* target = (*itrU))
330 {
331 bool valid = true;
332 if (!caster->IsWithinMeleeRange(target->ToUnit()))
333 for (std::list<GameObject*>::const_iterator itr = blockList.begin(); itr != blockList.end(); ++itr)
334 if (!(*itr)->IsInvisibleDueToDespawn())
335 if ((*itr)->IsInBetween(caster, target, 4.0f))
336 {
337 valid = false;
338 break;
339 }
340 if (valid)
341 {
342 if (Aura* aur = target->ToUnit()->GetAura(70336))
343 if (aur->GetStackAmount() >= 10 && caster->GetTypeId() == TYPEID_UNIT)
344 caster->ToCreature()->AI()->SetData(1, aur->GetStackAmount());
345 targetList.push_back(*itrU);
346 }
347 }
348 }
349 else
350 {
351 targetList = targets;
352 return;
353 }
354 }
355
356 targets = targetList;
357 }
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
@ GO_SARONITE_ROCK
Definition: boss_forgemaster_garfrost.cpp:45
Definition: Object.h:393
Definition: Unit.h:1302
Definition: SpellAuras.h:87
Unit * GetCaster()
Definition: SpellScript.cpp:401
std::list< WorldObject * > targetList
Definition: boss_forgemaster_garfrost.cpp:312

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

Referenced by Register().

◆ FilterTargetsNext()

void spell_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::FilterTargetsNext ( std::list< WorldObject * > &  targets)
inlineprivate
360 {
361 targets = targetList;
362 }

References targetList.

Referenced by Register().

◆ PrepareSpellScript()

spell_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::PrepareSpellScript ( spell_garfrost_permafrost_SpellScript  )
private

◆ Register()

void spell_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

365 {
369 }
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:354
@ 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:1421
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:353
void FilterTargets(std::list< WorldObject * > &targets)
Definition: boss_forgemaster_garfrost.cpp:319
void FilterTargetsNext(std::list< WorldObject * > &targets)
Definition: boss_forgemaster_garfrost.cpp:359

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

◆ Unload()

void spell_garfrost_permafrost::spell_garfrost_permafrost_SpellScript::Unload ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

315 {
316 targetList.clear();
317 }

References targetList.

Member Data Documentation

◆ targetList

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