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

Private Member Functions

 PrepareSpellScript (spell_capacitus_polarity_charge_SpellScript)
 
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::spell_capacitus_polarity_charge_SpellScript::HandleDamage ( SpellEffIndex  )
inlineprivate
182 {
183 if (!GetTriggeringSpell())
184 return;
185
186 Unit* target = GetHitUnit();
187 if (target->HasAura(GetTriggeringSpell()->Id))
188 SetHitDamage(0);
189 }
Definition: Unit.h:1290
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5610
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::spell_capacitus_polarity_charge_SpellScript::HandleTargets ( std::list< WorldObject * > &  targetList)
inlineprivate
166 {
167 uint8 count = 0;
168 for (std::list<WorldObject*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
169 if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
170 if (Player* target = (*ihit)->ToPlayer())
171 if (target->HasAura(GetTriggeringSpell()->Id))
172 ++count;
173
174 if (count)
175 {
177 GetCaster()->SetAuraStack(spellId, GetCaster(), count);
178 }
179 }
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:149
@ SPELL_POSITIVE_CHARGE_STACK
Definition: boss_mechano_lord_capacitus.cpp:148
@ SPELL_NEGATIVE_CHARGE_STACK
Definition: boss_mechano_lord_capacitus.cpp:152
Player * ToPlayer()
Definition: Object.h:195
Definition: Player.h:1046
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Definition: Unit.cpp:19070
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::SetAuraStack(), SPELL_NEGATIVE_CHARGE_STACK, SPELL_POSITIVE_CHARGE, SPELL_POSITIVE_CHARGE_STACK, and Object::ToPlayer().

Referenced by Register().

◆ PrepareSpellScript()

spell_capacitus_polarity_charge::spell_capacitus_polarity_charge_SpellScript::PrepareSpellScript ( spell_capacitus_polarity_charge_SpellScript  )
private

◆ Register()

void spell_capacitus_polarity_charge::spell_capacitus_polarity_charge_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

192 {
195 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:354
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_SCHOOL_DAMAGE
Definition: SharedDefines.h:752
@ TARGET_UNIT_SRC_AREA_ALLY
Definition: SharedDefines.h:1406
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:353
void HandleDamage(SpellEffIndex)
Definition: boss_mechano_lord_capacitus.cpp:181
void HandleTargets(std::list< WorldObject * > &targetList)
Definition: boss_mechano_lord_capacitus.cpp:165

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