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

Private Member Functions

 PrepareAuraScript (spell_pal_seal_of_vengeance_aura)
 
bool Validate (SpellInfo const *) override
 
bool Load () override
 
bool CheckProc (ProcEventInfo &eventInfo)
 
void HandleApplyDoT (AuraEffect const *aurEff, ProcEventInfo &eventInfo)
 
void HandleSeal (AuraEffect const *aurEff, ProcEventInfo &eventInfo)
 
void Register () override
 

Private Attributes

bool _isVengeance = true
 

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 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_pal_seal_of_vengeance_aura::CheckProc ( ProcEventInfo eventInfo)
inlineprivate
1929 {
1930 SpellInfo const* procSpell = eventInfo.GetSpellInfo();
1931 if (procSpell &&
1933 {
1934 // Block re-proc from seal damage effects
1935 if ((procSpell->SpellFamilyFlags[1] & 0x800) &&
1936 !(procSpell->SpellFamilyFlags[0] & 0x800000))
1937 return false;
1938
1939 // Judgements only trigger seal procs with JotJ
1940 if (procSpell->SpellFamilyFlags[0] & 0x800000)
1941 return HasJudgementsOfTheJust(eventInfo.GetActor());
1942 }
1943
1944 return true;
1945 }
@ SPELLFAMILY_PALADIN
Definition SharedDefines.h:3794
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:301
Unit * GetActor()
Definition Unit.h:460
Definition SpellInfo.h:340
flag96 SpellFamilyFlags
Definition SpellInfo.h:412
uint32 SpellFamilyName
Definition SpellInfo.h:411
static bool HasJudgementsOfTheJust(Unit const *caster)
Definition spell_paladin.cpp:169

References ProcEventInfo::GetActor(), ProcEventInfo::GetSpellInfo(), HasJudgementsOfTheJust(), SPELLFAMILY_PALADIN, SpellInfo::SpellFamilyFlags, and SpellInfo::SpellFamilyName.

Referenced by Register().

◆ HandleApplyDoT()

void spell_pal_seal_of_vengeance_aura::HandleApplyDoT ( AuraEffect const *  aurEff,
ProcEventInfo eventInfo 
)
inlineprivate
1948 {
1950
1951 if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_MELEE_AUTO_ATTACK))
1952 {
1953 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1954 if (!spellInfo || spellInfo->SpellIconID != PALADIN_ICON_HAMMER_OF_THE_RIGHTEOUS)
1955 return;
1956 }
1957
1959 eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), dotSpell, true, nullptr, aurEff);
1960 }
std::uint32_t uint32
Definition Define.h:107
@ PROC_FLAG_DONE_MELEE_AUTO_ATTACK
Definition SpellMgr.h:113
void PreventDefaultAction()
Definition SpellScript.cpp:1000
Unit * GetActionTarget() const
Definition Unit.h:461
uint32 GetTypeMask() const
Definition Unit.h:463
uint32 SpellIconID
Definition SpellInfo.h:404
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1361
bool _isVengeance
Definition spell_paladin.cpp:1996
@ SPELL_PALADIN_HOLY_VENGEANCE
Definition spell_paladin.cpp:102
@ SPELL_PALADIN_BLOOD_CORRUPTION
Definition spell_paladin.cpp:103
@ PALADIN_ICON_HAMMER_OF_THE_RIGHTEOUS
Definition spell_paladin.cpp:115

References _isVengeance, Unit::CastSpell(), ProcEventInfo::GetActionTarget(), ProcEventInfo::GetActor(), ProcEventInfo::GetSpellInfo(), ProcEventInfo::GetTypeMask(), PALADIN_ICON_HAMMER_OF_THE_RIGHTEOUS, AuraScript::PreventDefaultAction(), PROC_FLAG_DONE_MELEE_AUTO_ATTACK, SPELL_PALADIN_BLOOD_CORRUPTION, SPELL_PALADIN_HOLY_VENGEANCE, and SpellInfo::SpellIconID.

Referenced by Register().

◆ HandleSeal()

void spell_pal_seal_of_vengeance_aura::HandleSeal ( AuraEffect const *  aurEff,
ProcEventInfo eventInfo 
)
inlineprivate
1963 {
1965
1966 Unit* caster = eventInfo.GetActor();
1967 Unit* target = eventInfo.GetActionTarget();
1968
1969 AuraEffect const* sealDot = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PALADIN, 0x00000000, 0x00000800, 0x00000000, caster->GetGUID());
1970 if (!sealDot)
1971 return;
1972
1973 uint8 stacks = sealDot->GetBase()->GetStackAmount();
1974 uint8 maxStacks = sealDot->GetSpellInfo()->StackAmount;
1975
1977
1978 // Scale weapon damage % by stacks (6.6% per stack, up to 33% at 5 stacks)
1979 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(damageSpell);
1980 int32 amount = spellInfo->Effects[EFFECT_0].CalcValue();
1981 amount = (amount * stacks) / maxStacks;
1982
1983 caster->CastCustomSpell(damageSpell, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
1984 }
std::int32_t int32
Definition Define.h:103
std::uint8_t uint8
Definition Define.h:109
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_AURA_PERIODIC_DAMAGE
Definition SpellAuraDefines.h:66
@ SPELLVALUE_BASE_POINT0
Definition SpellDefines.h:113
#define sSpellMgr
Definition SpellMgr.h:847
Definition SpellAuraEffects.h:39
SpellInfo const * GetSpellInfo() const
Definition SpellAuraEffects.h:54
Aura * GetBase() const
Definition SpellAuraEffects.h:49
uint8 GetStackAmount() const
Definition SpellAuras.h:148
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
uint32 StackAmount
Definition SpellInfo.h:395
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition SpellInfo.h:417
Definition Unit.h:665
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1418
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:5790
@ SPELL_PALADIN_SEAL_OF_VENGEANCE_EFFECT
Definition spell_paladin.cpp:104
@ SPELL_PALADIN_SEAL_OF_CORRUPTION_EFFECT
Definition spell_paladin.cpp:105

References _isVengeance, Unit::CastCustomSpell(), EFFECT_0, SpellInfo::Effects, ProcEventInfo::GetActionTarget(), ProcEventInfo::GetActor(), Unit::GetAuraEffect(), AuraEffect::GetBase(), Object::GetGUID(), AuraEffect::GetSpellInfo(), Aura::GetStackAmount(), AuraScript::PreventDefaultAction(), SPELL_AURA_PERIODIC_DAMAGE, SPELL_PALADIN_SEAL_OF_CORRUPTION_EFFECT, SPELL_PALADIN_SEAL_OF_VENGEANCE_EFFECT, SPELLFAMILY_PALADIN, SPELLVALUE_BASE_POINT0, sSpellMgr, and SpellInfo::StackAmount.

Referenced by Register().

◆ Load()

bool spell_pal_seal_of_vengeance_aura::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1922 {
1923 // Seal of Vengeance = 31801, Seal of Corruption = 53736
1924 _isVengeance = GetSpellInfo()->Id == 31801;
1925 return true;
1926 }
SpellInfo const * GetSpellInfo() const
Definition SpellScript.cpp:1020
uint32 Id
Definition SpellInfo.h:344

References _isVengeance, AuraScript::GetSpellInfo(), and SpellInfo::Id.

◆ PrepareAuraScript()

spell_pal_seal_of_vengeance_aura::PrepareAuraScript ( spell_pal_seal_of_vengeance_aura  )
private

◆ Register()

void spell_pal_seal_of_vengeance_aura::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1987 {
1989 // HandleSeal reads stacks BEFORE HandleApplyDoT increments them,
1990 // so the attacking hit does not benefit from its own stack application.
1993 }
@ SPELL_AURA_DUMMY
Definition SpellAuraDefines.h:67
#define AuraEffectProcFn(F, I, N)
Definition SpellScript.h:867
#define AuraCheckProcFn(F)
Definition SpellScript.h:830
HookList< CheckProcHandler > DoCheckProc
Definition SpellScript.h:829
HookList< EffectProcHandler > OnEffectProc
Definition SpellScript.h:862
void HandleApplyDoT(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition spell_paladin.cpp:1947
void HandleSeal(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition spell_paladin.cpp:1962
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_paladin.cpp:1928

References AuraCheckProcFn, AuraEffectProcFn, CheckProc(), AuraScript::DoCheckProc, EFFECT_0, HandleApplyDoT(), HandleSeal(), AuraScript::OnEffectProc, and SPELL_AURA_DUMMY.

◆ Validate()

bool spell_pal_seal_of_vengeance_aura::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Member Data Documentation

◆ _isVengeance

bool spell_pal_seal_of_vengeance_aura::_isVengeance = true
private

Referenced by HandleApplyDoT(), HandleSeal(), and Load().


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