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 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_thaddius_pos_neg_charge::HandleDamage ( SpellEffIndex  )
inlineprivate
643 {
644 if (!GetTriggeringSpell())
645 return;
646
647 Unit* target = GetHitUnit();
648 if (!target)
649 return;
650
651 if (target->HasAura(GetTriggeringSpell()->Id) || !target->IsPlayer())
652 {
653 SetHitDamage(0);
654 }
655 else if (target->GetInstanceScript())
656 {
658 }
659 }
@ DATA_CHARGES_CROSSED
Definition: naxxramas.h:69
bool IsPlayer() const
Definition: Object.h:200
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
Definition: Unit.h:630
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5698
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Unit * GetHitUnit()
Definition: SpellScript.cpp:448
SpellInfo const * GetTriggeringSpell()
Definition: SpellScript.cpp:630
void SetHitDamage(int32 damage)
Definition: SpellScript.cpp:524

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

Referenced by Register().

◆ HandleTargets()

void spell_thaddius_pos_neg_charge::HandleTargets ( std::list< WorldObject * > &  targets)
inlineprivate
619 {
620 uint8 count = 0;
621 for (auto& ihit : targets)
622 {
623 if (ihit->GetGUID() != GetCaster()->GetGUID())
624 {
625 if (Player* target = ihit->ToPlayer())
626 {
627 if (target->HasAura(GetTriggeringSpell()->Id))
628 {
629 ++count;
630 }
631 }
632 }
633 }
634
635 if (count)
636 {
638 GetCaster()->SetAuraStack(spellId, GetCaster(), count);
639 }
640 }
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
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Definition: Unit.cpp:18902
uint32 Id
Definition: SpellInfo.h:320
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_thaddius_pos_neg_charge::PrepareSpellScript ( spell_thaddius_pos_neg_charge  )
private

◆ Register()

void spell_thaddius_pos_neg_charge::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

662 {
665 }
@ 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:642
void HandleTargets(std::list< WorldObject * > &targets)
Definition: boss_thaddius.cpp:618

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.

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

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