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
2650 {
2651 Unit* caster = eventInfo.GetActor();
2652 if (!caster || !caster->IsPlayer())
2653 return false;
2654
2655 Player* player = caster->ToPlayer();
2656 if (player->getClass() != CLASS_DEATH_KNIGHT)
2657 return false;
2658
2659 return true;
2660 }
@ 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
2663 {
2664 Player* player = eventInfo.GetActor()->ToPlayer();
2665 AuraEffect* aurEff = GetEffect(EFFECT_0);
2666 if (!aurEff)
2667 return;
2668
2669 // Reset amplitude - set death rune remove timer to 30s
2670 aurEff->ResetPeriodic(true);
2671
2672 uint32 runesLeft = 1;
2673 // Death Rune Mastery (SpellIconID 2622)
2674 if (GetSpellInfo()->SpellIconID == 2622)
2675 runesLeft = 2;
2676
2677 for (uint8 i = 0; i < MAX_RUNES && runesLeft; ++i)
2678 {
2679 if (GetSpellInfo()->SpellIconID == 2622)
2680 {
2681 if (player->GetBaseRune(i) == RUNE_BLOOD)
2682 continue;
2683 }
2684 else
2685 {
2686 if (player->GetBaseRune(i) != RUNE_BLOOD)
2687 continue;
2688 }
2689
2690 // Check if rune just went on cooldown
2691 if (player->GetRuneCooldown(i) != player->GetRuneBaseCooldown(i, false))
2692 continue;
2693
2694 --runesLeft;
2695 player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff);
2696 }
2697 }
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:13423
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2545
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition Player.h:2556
RuneType GetBaseRune(uint8 index) const
Definition Player.h:2543

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.

2645 {
2647 }
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
2700 {
2702 }
Unit * GetTarget() const
Definition SpellScript.cpp:1180
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition Player.cpp:13440

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.

2705 {
2709 }
@ 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:2649
void PeriodicTick(AuraEffect const *aurEff)
Definition spell_dk.cpp:2699
void HandleProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:2662

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: