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
 
Unit * GetCaster () const
 
WorldObject * GetOwner () const
 
Unit * GetUnitOwner () const
 
DynamicObject * GetDynobjOwner () const
 
void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
Aura * GetAura () 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
 
AuraEffect * GetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
Unit * GetTarget () 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< CheckAreaTargetHandler > DoCheckAreaTarget
 
HookList< AuraDispelHandler > OnDispel
 
HookList< AuraDispelHandler > AfterDispel
 
HookList< EffectApplyHandler > OnEffectApply
 
HookList< EffectApplyHandler > AfterEffectApply
 
HookList< EffectApplyHandler > OnEffectRemove
 
HookList< EffectApplyHandler > AfterEffectRemove
 
HookList< EffectPeriodicHandler > OnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandler > DoEffectCalcSpellMod
 
HookList< EffectAbsorbHandler > OnEffectAbsorb
 
HookList< EffectAbsorbHandler > AfterEffectAbsorb
 
HookList< EffectManaShieldHandler > OnEffectManaShield
 
HookList< EffectManaShieldHandler > AfterEffectManaShield
 
HookList< EffectSplitHandler > OnEffectSplit
 
HookList< CheckProcHandler > DoCheckProc
 
HookList< CheckEffectProcHandler > DoCheckEffectProc
 
HookList< AfterCheckProcHandler > DoAfterCheckProc
 
HookList< AuraProcHandler > DoPrepareProc
 
HookList< AuraProcHandler > OnProc
 
HookList< AuraProcHandler > AfterProc
 
HookList< EffectProcHandler > OnEffectProc
 
HookList< EffectProcHandler > AfterEffectProc
 
- 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
2661 {
2662 Unit* caster = eventInfo.GetActor();
2663 if (!caster || !caster->IsPlayer())
2664 return false;
2665
2666 Player* player = caster->ToPlayer();
2667 if (player->getClass() != CLASS_DEATH_KNIGHT)
2668 return false;
2669
2670 return true;
2671 }
@ CLASS_DEATH_KNIGHT
Definition SharedDefines.h:131
bool IsPlayer() const
Definition Object.h:207
Player * ToPlayer()
Definition Object.h:208
Definition Player.h:1086
Unit * GetActor()
Definition Unit.h:462
Definition Unit.h:667
uint8 getClass() const
Definition Unit.h:846

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
2674 {
2675 Player* player = eventInfo.GetActor()->ToPlayer();
2676 AuraEffect* aurEff = GetEffect(EFFECT_0);
2677 if (!aurEff)
2678 return;
2679
2680 // Reset amplitude - set death rune remove timer to 30s
2681 aurEff->ResetPeriodic(true);
2682
2683 uint32 runesLeft = 1;
2684 // Death Rune Mastery (SpellIconID 2622)
2685 if (GetSpellInfo()->SpellIconID == 2622)
2686 runesLeft = 2;
2687
2688 for (uint8 i = 0; i < MAX_RUNES && runesLeft; ++i)
2689 {
2690 if (GetSpellInfo()->SpellIconID == 2622)
2691 {
2692 if (player->GetBaseRune(i) == RUNE_BLOOD)
2693 continue;
2694 }
2695 else
2696 {
2697 if (player->GetBaseRune(i) != RUNE_BLOOD)
2698 continue;
2699 }
2700
2701 // Check if rune just went on cooldown
2702 if (player->GetRuneCooldown(i) != player->GetRuneBaseCooldown(i, false))
2703 continue;
2704
2705 --runesLeft;
2706 player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff);
2707 }
2708 }
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:1025
AuraEffect * GetEffect(uint8 effIndex) const
Definition SpellScript.cpp:1175
uint32 GetRuneBaseCooldown(uint8 index, bool skipGrace)
Definition Player.cpp:13706
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2557
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition Player.h:2568
RuneType GetBaseRune(uint8 index) const
Definition Player.h:2555

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.

2656 {
2658 }
Unit * GetUnitOwner() const
Definition SpellScript.cpp:1050

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

◆ PeriodicTick()

void spell_dk_death_rune::PeriodicTick ( AuraEffect const *  aurEff)
inlineprivate
2711 {
2713 }
Unit * GetTarget() const
Definition SpellScript.cpp:1185
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition Player.cpp:13723

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.

2716 {
2720 }
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
#define AuraProcFn(F)
Definition SpellScript.h:858
#define AuraEffectPeriodicFn(F, I, N)
Definition SpellScript.h:772
#define AuraCheckProcFn(F)
Definition SpellScript.h:831
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition SpellScript.h:771
HookList< CheckProcHandler > DoCheckProc
Definition SpellScript.h:830
HookList< AuraProcHandler > OnProc
Definition SpellScript.h:853
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:2660
void PeriodicTick(AuraEffect const *aurEff)
Definition spell_dk.cpp:2710
void HandleProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:2673

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: