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

Private Member Functions

 PrepareSpellScript (spell_capacitus_polarity_charge)
 
void HandleTargets (std::list< WorldObject * > &targetList)
 
void HandleDamage (SpellEffIndex)
 
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 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

◆ HandleDamage()

void spell_capacitus_polarity_charge::HandleDamage ( SpellEffIndex  )
inlineprivate
160 {
161 if (!GetTriggeringSpell())
162 return;
163
164 Unit* target = GetHitUnit();
165 if (target->HasAura(GetTriggeringSpell()->Id))
166 SetHitDamage(0);
167 }
Definition: Unit.h:1302
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5636
Unit * GetHitUnit()
Definition: SpellScript.cpp:448
SpellInfo const * GetTriggeringSpell()
Definition: SpellScript.cpp:630
void SetHitDamage(int32 damage)
Definition: SpellScript.cpp:524

References SpellScript::GetHitUnit(), SpellScript::GetTriggeringSpell(), Unit::HasAura(), and SpellScript::SetHitDamage().

Referenced by Register().

◆ HandleTargets()

void spell_capacitus_polarity_charge::HandleTargets ( std::list< WorldObject * > &  targetList)
inlineprivate
140 {
141 uint8 count = 0;
142 for (auto& ihit : targetList)
143 if (ihit->GetGUID() != GetCaster()->GetGUID())
144 if (Player* target = ihit->ToPlayer())
145 if (target->HasAura(GetTriggeringSpell()->Id))
146 ++count;
147
149 if (count)
150 {
151 GetCaster()->SetAuraStack(spellId, GetCaster(), count);
152 }
153 else
154 {
156 }
157 }
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
@ SPELL_POSITIVE_CHARGE
Definition: boss_mechano_lord_capacitus.cpp:128
@ SPELL_POSITIVE_CHARGE_STACK
Definition: boss_mechano_lord_capacitus.cpp:127
@ SPELL_NEGATIVE_CHARGE_STACK
Definition: boss_mechano_lord_capacitus.cpp:131
Player * ToPlayer()
Definition: Object.h:195
Definition: Player.h:1056
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Definition: Unit.cpp:19166
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4855
uint32 Id
Definition: SpellInfo.h:318
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
Unit * GetCaster()
Definition: SpellScript.cpp:401

References SpellScript::GetCaster(), SpellScript::GetSpellInfo(), SpellScript::GetTriggeringSpell(), SpellInfo::Id, Unit::RemoveAurasDueToSpell(), Unit::SetAuraStack(), SPELL_NEGATIVE_CHARGE_STACK, SPELL_POSITIVE_CHARGE, SPELL_POSITIVE_CHARGE_STACK, and Object::ToPlayer().

Referenced by Register().

◆ PrepareSpellScript()

spell_capacitus_polarity_charge::PrepareSpellScript ( spell_capacitus_polarity_charge  )
private

◆ Register()

void spell_capacitus_polarity_charge::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

170 {
173 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:354
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_SCHOOL_DAMAGE
Definition: SharedDefines.h:780
@ TARGET_UNIT_SRC_AREA_ALLY
Definition: SharedDefines.h:1434
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:353
void HandleTargets(std::list< WorldObject * > &targetList)
Definition: boss_mechano_lord_capacitus.cpp:139
void HandleDamage(SpellEffIndex)
Definition: boss_mechano_lord_capacitus.cpp:159

References EFFECT_0, HandleDamage(), HandleTargets(), SpellScript::OnEffectHitTarget, SpellScript::OnObjectAreaTargetSelect, SPELL_EFFECT_SCHOOL_DAMAGE, SpellEffectFn, SpellObjectAreaTargetSelectFn, and TARGET_UNIT_SRC_AREA_ALLY.