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

Private Member Functions

 PrepareAuraScript (spell_dk_death_rune)
 
bool Load () override
 
bool CheckProc (ProcEventInfo &eventInfo)
 
void HandleProc (ProcEventInfo &eventInfo)
 
void PeriodicTick (AuraEffect const *aurEff)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from AuraScript
 AuraScript ()
 
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Aura *aura)
 
void _PrepareScriptCall (AuraScriptHookType hookType, AuraApplication const *aurApp=nullptr)
 
void _FinishScriptCall ()
 
bool _IsDefaultActionPrevented ()
 
void PreventDefaultAction ()
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
ObjectGuid GetCasterGUID () const
 
UnitGetCaster () const
 
WorldObjectGetOwner () const
 
UnitGetUnitOwner () const
 
DynamicObjectGetDynobjOwner () const
 
void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
AuraGetAura () const
 
AuraObjectType GetType () const
 
int32 GetDuration () const
 
void SetDuration (int32 duration, bool withMods=false)
 
void RefreshDuration ()
 
time_t GetApplyTime () const
 
int32 GetMaxDuration () const
 
void SetMaxDuration (int32 duration)
 
int32 CalcMaxDuration () const
 
bool IsExpired () const
 
bool IsPermanent () const
 
uint8 GetCharges () const
 
void SetCharges (uint8 charges)
 
uint8 CalcMaxCharges () const
 
bool ModCharges (int8 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool DropCharge (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
uint8 GetStackAmount () const
 
void SetStackAmount (uint8 num)
 
bool ModStackAmount (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool IsPassive () const
 
bool IsDeathPersistent () const
 
bool HasEffect (uint8 effIndex) const
 
AuraEffectGetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
UnitGetTarget () const
 
AuraApplication const * GetTargetApplication () const
 
- 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 Validate (SpellInfo const *)
 
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 AuraScript
HookList< CheckAreaTargetHandlerDoCheckAreaTarget
 
HookList< AuraDispelHandlerOnDispel
 
HookList< AuraDispelHandlerAfterDispel
 
HookList< EffectApplyHandlerOnEffectApply
 
HookList< EffectApplyHandlerAfterEffectApply
 
HookList< EffectApplyHandlerOnEffectRemove
 
HookList< EffectApplyHandlerAfterEffectRemove
 
HookList< EffectPeriodicHandlerOnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandlerOnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandlerDoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandlerDoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandlerDoEffectCalcSpellMod
 
HookList< EffectAbsorbHandlerOnEffectAbsorb
 
HookList< EffectAbsorbHandlerAfterEffectAbsorb
 
HookList< EffectManaShieldHandlerOnEffectManaShield
 
HookList< EffectManaShieldHandlerAfterEffectManaShield
 
HookList< EffectSplitHandlerOnEffectSplit
 
HookList< CheckProcHandlerDoCheckProc
 
HookList< CheckEffectProcHandlerDoCheckEffectProc
 
HookList< AfterCheckProcHandlerDoAfterCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ CheckProc()

bool spell_dk_death_rune::CheckProc ( ProcEventInfo eventInfo)
inlineprivate
2658 {
2659 Unit* caster = eventInfo.GetActor();
2660 if (!caster || !caster->IsPlayer())
2661 return false;
2662
2663 Player* player = caster->ToPlayer();
2664 if (player->getClass() != CLASS_DEATH_KNIGHT)
2665 return false;
2666
2667 return true;
2668 }
@ CLASS_DEATH_KNIGHT
Definition SharedDefines.h:131
bool IsPlayer() const
Definition Object.h:201
Player * ToPlayer()
Definition Object.h:202
Definition Player.h:1086
Unit * GetActor()
Definition Unit.h:460
Definition Unit.h:665
uint8 getClass() const
Definition Unit.h:844

References CLASS_DEATH_KNIGHT, ProcEventInfo::GetActor(), Unit::getClass(), Object::IsPlayer(), and Object::ToPlayer().

Referenced by Register().

◆ HandleProc()

void spell_dk_death_rune::HandleProc ( ProcEventInfo eventInfo)
inlineprivate
2671 {
2672 Player* player = eventInfo.GetActor()->ToPlayer();
2673 AuraEffect* aurEff = GetEffect(EFFECT_0);
2674 if (!aurEff)
2675 return;
2676
2677 // Reset amplitude - set death rune remove timer to 30s
2678 aurEff->ResetPeriodic(true);
2679
2680 uint32 runesLeft = 1;
2681 // Death Rune Mastery (SpellIconID 2622)
2682 if (GetSpellInfo()->SpellIconID == 2622)
2683 runesLeft = 2;
2684
2685 for (uint8 i = 0; i < MAX_RUNES && runesLeft; ++i)
2686 {
2687 if (GetSpellInfo()->SpellIconID == 2622)
2688 {
2689 if (player->GetBaseRune(i) == RUNE_BLOOD)
2690 continue;
2691 }
2692 else
2693 {
2694 if (player->GetBaseRune(i) != RUNE_BLOOD)
2695 continue;
2696 }
2697
2698 // Check if rune just went on cooldown
2699 if (player->GetRuneCooldown(i) != player->GetRuneBaseCooldown(i, false))
2700 continue;
2701
2702 --runesLeft;
2703 player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff);
2704 }
2705 }
std::uint8_t uint8
Definition Define.h:109
std::uint32_t uint32
Definition Define.h:107
@ RUNE_DEATH
Definition Player.h:399
@ RUNE_BLOOD
Definition Player.h:396
#define MAX_RUNES
Definition Player.h:385
@ EFFECT_0
Definition SharedDefines.h:31
Definition SpellAuraEffects.h:39
void ResetPeriodic(bool resetPeriodicTimer=false)
Definition SpellAuraEffects.h:89
SpellInfo const * GetSpellInfo() const
Definition SpellScript.cpp:1020
AuraEffect * GetEffect(uint8 effIndex) const
Definition SpellScript.cpp:1170
uint32 GetRuneBaseCooldown(uint8 index, bool skipGrace)
Definition Player.cpp:13677
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2556
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition Player.h:2567
RuneType GetBaseRune(uint8 index) const
Definition Player.h:2554

References Player::AddRuneByAuraEffect(), EFFECT_0, ProcEventInfo::GetActor(), Player::GetBaseRune(), AuraScript::GetEffect(), Player::GetRuneBaseCooldown(), Player::GetRuneCooldown(), AuraScript::GetSpellInfo(), MAX_RUNES, AuraEffect::ResetPeriodic(), RUNE_BLOOD, RUNE_DEATH, and Object::ToPlayer().

Referenced by Register().

◆ Load()

bool spell_dk_death_rune::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

2653 {
2655 }
Unit * GetUnitOwner() const
Definition SpellScript.cpp:1045

References CLASS_DEATH_KNIGHT, Unit::getClass(), AuraScript::GetUnitOwner(), Object::IsPlayer(), and Object::ToPlayer().

◆ PeriodicTick()

void spell_dk_death_rune::PeriodicTick ( AuraEffect const *  aurEff)
inlineprivate
2708 {
2710 }
Unit * GetTarget() const
Definition SpellScript.cpp:1180
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition Player.cpp:13694

References AuraScript::GetTarget(), Player::RemoveRunesByAuraEffect(), and Object::ToPlayer().

Referenced by Register().

◆ PrepareAuraScript()

spell_dk_death_rune::PrepareAuraScript ( spell_dk_death_rune  )
private

◆ Register()

void spell_dk_death_rune::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2713 {
2717 }
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
#define AuraProcFn(F)
Definition SpellScript.h:857
#define AuraEffectPeriodicFn(F, I, N)
Definition SpellScript.h:771
#define AuraCheckProcFn(F)
Definition SpellScript.h:830
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition SpellScript.h:770
HookList< CheckProcHandler > DoCheckProc
Definition SpellScript.h:829
HookList< AuraProcHandler > OnProc
Definition SpellScript.h:852
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:2657
void PeriodicTick(AuraEffect const *aurEff)
Definition spell_dk.cpp:2707
void HandleProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:2670

References AuraCheckProcFn, AuraEffectPeriodicFn, AuraProcFn, CheckProc(), AuraScript::DoCheckProc, EFFECT_0, HandleProc(), AuraScript::OnEffectPeriodic, AuraScript::OnProc, PeriodicTick(), and SPELL_AURA_PERIODIC_DUMMY.


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