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
2678 {
2679 Unit* caster = eventInfo.GetActor();
2680 if (!caster || !caster->IsPlayer())
2681 return false;
2682
2683 Player* player = caster->ToPlayer();
2684 if (player->getClass() != CLASS_DEATH_KNIGHT)
2685 return false;
2686
2687 return true;
2688 }
@ CLASS_DEATH_KNIGHT
Definition SharedDefines.h:131
bool IsPlayer() const
Definition Object.h:201
Player * ToPlayer()
Definition Object.h:202
Definition Player.h:1084
Unit * GetActor()
Definition Unit.h:459
Definition Unit.h:664
uint8 getClass() const
Definition Unit.h:843

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
2691 {
2692 Player* player = eventInfo.GetActor()->ToPlayer();
2693 AuraEffect* aurEff = GetEffect(EFFECT_0);
2694 if (!aurEff)
2695 return;
2696
2697 // Reset amplitude - set death rune remove timer to 30s
2698 aurEff->ResetPeriodic(true);
2699
2700 uint32 runesLeft = 1;
2701 // Death Rune Mastery (SpellIconID 2622)
2702 if (GetSpellInfo()->SpellIconID == 2622)
2703 runesLeft = 2;
2704
2705 for (uint8 i = 0; i < MAX_RUNES && runesLeft; ++i)
2706 {
2707 if (GetSpellInfo()->SpellIconID == 2622)
2708 {
2709 if (player->GetBaseRune(i) == RUNE_BLOOD)
2710 continue;
2711 }
2712 else
2713 {
2714 if (player->GetBaseRune(i) != RUNE_BLOOD)
2715 continue;
2716 }
2717
2718 // Check if rune just went on cooldown
2719 if (player->GetRuneCooldown(i) != player->GetRuneBaseCooldown(i, false))
2720 continue;
2721
2722 --runesLeft;
2723 player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff);
2724 }
2725 }
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:13388
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2544
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition Player.h:2555
RuneType GetBaseRune(uint8 index) const
Definition Player.h:2542

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.

2673 {
2675 }
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
2728 {
2730 }
Unit * GetTarget() const
Definition SpellScript.cpp:1180
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition Player.cpp:13405

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.

2733 {
2737 }
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
#define AuraProcFn(F)
Definition SpellScript.h:855
#define AuraEffectPeriodicFn(F, I, N)
Definition SpellScript.h:771
#define AuraCheckProcFn(F)
Definition SpellScript.h:829
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition SpellScript.h:770
HookList< CheckProcHandler > DoCheckProc
Definition SpellScript.h:828
HookList< AuraProcHandler > OnProc
Definition SpellScript.h:850
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:2677
void PeriodicTick(AuraEffect const *aurEff)
Definition spell_dk.cpp:2727
void HandleProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:2690

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: