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
 
GameObject * GetGObjCaster () 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< 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
2673 {
2674 Unit* caster = eventInfo.GetActor();
2675 if (!caster || !caster->IsPlayer())
2676 return false;
2677
2678 Player* player = caster->ToPlayer();
2679 if (player->getClass() != CLASS_DEATH_KNIGHT)
2680 return false;
2681
2682 return true;
2683 }
@ 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:468
Definition Unit.h:670
uint8 getClass() const
Definition Unit.h:849

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

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.

2668 {
2670 }
Unit * GetUnitOwner() const
Definition SpellScript.cpp:1043

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

◆ PeriodicTick()

void spell_dk_death_rune::PeriodicTick ( AuraEffect const *  aurEff)
inlineprivate
2723 {
2725 }
Unit * GetTarget() const
Definition SpellScript.cpp:1178
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition Player.cpp:13781

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.

2728 {
2732 }
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
#define AuraProcFn(F)
Definition SpellScript.h:841
#define AuraEffectPeriodicFn(F, I, N)
Definition SpellScript.h:761
#define AuraCheckProcFn(F)
Definition SpellScript.h:820
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition SpellScript.h:760
HookList< CheckProcHandler > DoCheckProc
Definition SpellScript.h:819
HookList< AuraProcHandler > OnProc
Definition SpellScript.h:836
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:2672
void PeriodicTick(AuraEffect const *aurEff)
Definition spell_dk.cpp:2722
void HandleProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:2685

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: