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

Private Member Functions

 PrepareSpellScript (spell_thaddius_pos_neg_charge)
 
bool Validate (SpellInfo const *) override
 
void HandleTargets (std::list< WorldObject * > &targets)
 
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 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
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ HandleDamage()

void spell_thaddius_pos_neg_charge::HandleDamage ( SpellEffIndex  )
inlineprivate
600 {
601 if (!GetTriggeringSpell())
602 return;
603
604 Unit* target = GetHitUnit();
605 if (!target)
606 return;
607
608 if (target->HasAura(GetTriggeringSpell()->Id) || !target->IsPlayer())
609 {
610 SetHitDamage(0);
611 }
612 else if (InstanceScript* instance = target->GetInstanceScript())
613 {
614 instance->SetData(DATA_CHARGES_CROSSED, 0);
615 }
616 }
Definition InstanceScript.h:143
bool IsPlayer() const
Definition Object.h:200
Unit * GetHitUnit()
Definition SpellScript.cpp:448
SpellInfo const * GetTriggeringSpell()
Definition SpellScript.cpp:630
void SetHitDamage(int32 damage)
Definition SpellScript.cpp:524
Definition Unit.h:636
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5753
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
@ DATA_CHARGES_CROSSED
Definition naxxramas.h:79

References DATA_CHARGES_CROSSED, SpellScript::GetHitUnit(), WorldObject::GetInstanceScript(), SpellScript::GetTriggeringSpell(), Unit::HasAura(), Object::IsPlayer(), and SpellScript::SetHitDamage().

Referenced by Register().

◆ HandleTargets()

void spell_thaddius_pos_neg_charge::HandleTargets ( std::list< WorldObject * > &  targets)
inlineprivate
576 {
577 uint8 count = 0;
578 for (auto& ihit : targets)
579 {
580 if (ihit->GetGUID() != GetCaster()->GetGUID())
581 {
582 if (Player* target = ihit->ToPlayer())
583 {
584 if (target->HasAura(GetTriggeringSpell()->Id))
585 {
586 ++count;
587 }
588 }
589 }
590 }
591
592 if (count)
593 {
595 GetCaster()->SetAuraStack(spellId, GetCaster(), count);
596 }
597 }
std::uint8_t uint8
Definition Define.h:109
std::uint32_t uint32
Definition Define.h:107
@ SPELL_POSITIVE_CHARGE
Definition boss_thaddius.cpp:80
@ SPELL_POSITIVE_CHARGE_STACK
Definition boss_thaddius.cpp:81
@ SPELL_NEGATIVE_CHARGE_STACK
Definition boss_thaddius.cpp:83
Player * ToPlayer()
Definition Object.h:201
Definition Player.h:1081
uint32 Id
Definition SpellInfo.h:320
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:411
Unit * GetCaster()
Definition SpellScript.cpp:401
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Definition Unit.cpp:18954

References SpellScript::GetCaster(), Object::GetGUID(), 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_thaddius_pos_neg_charge::PrepareSpellScript ( spell_thaddius_pos_neg_charge  )
private

◆ Register()

void spell_thaddius_pos_neg_charge::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

619 {
622 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_SCHOOL_DAMAGE
Definition SharedDefines.h:780
@ TARGET_UNIT_SRC_AREA_ALLY
Definition SharedDefines.h:1434
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition SpellScript.h:354
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition SpellScript.h:353
void HandleDamage(SpellEffIndex)
Definition boss_thaddius.cpp:599
void HandleTargets(std::list< WorldObject * > &targets)
Definition boss_thaddius.cpp:575

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

◆ Validate()

bool spell_thaddius_pos_neg_charge::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

571 {
573 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition SpellScript.h:125

References SPELL_POSITIVE_CHARGE, SPELL_POSITIVE_CHARGE_STACK, and _SpellScript::ValidateSpellInfo().


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