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
1923 {
1924 SpellInfo const* procSpell = eventInfo.GetSpellInfo();
1925 if (procSpell &&
1927 {
1928 // Block re-proc from seal damage effects
1929 if ((procSpell->SpellFamilyFlags[1] & 0x800) &&
1930 !(procSpell->SpellFamilyFlags[0] & 0x800000))
1931 return false;
1932
1933 // Judgements only trigger seal procs with JotJ
1934 if (procSpell->SpellFamilyFlags[0] & 0x800000)
1935 return HasJudgementsOfTheJust(eventInfo.GetActor());
1936 }
1937
1938 return true;
1939 }
@ SPELLFAMILY_PALADIN
Definition SharedDefines.h:3796
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:299
Unit * GetActor()
Definition Unit.h:459
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:163

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
1942 {
1944
1945 if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_MELEE_AUTO_ATTACK))
1946 {
1947 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1948 if (!spellInfo || spellInfo->SpellIconID != PALADIN_ICON_HAMMER_OF_THE_RIGHTEOUS)
1949 return;
1950 }
1951
1953 eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), dotSpell, true, nullptr, aurEff);
1954 }
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:460
uint32 GetTypeMask() const
Definition Unit.h:462
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:1350
bool _isVengeance
Definition spell_paladin.cpp:1990
@ SPELL_PALADIN_HOLY_VENGEANCE
Definition spell_paladin.cpp:96
@ SPELL_PALADIN_BLOOD_CORRUPTION
Definition spell_paladin.cpp:97
@ PALADIN_ICON_HAMMER_OF_THE_RIGHTEOUS
Definition spell_paladin.cpp:109

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
1957 {
1959
1960 Unit* caster = eventInfo.GetActor();
1961 Unit* target = eventInfo.GetActionTarget();
1962
1963 AuraEffect const* sealDot = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PALADIN, 0x00000000, 0x00000800, 0x00000000, caster->GetGUID());
1964 if (!sealDot)
1965 return;
1966
1967 uint8 stacks = sealDot->GetBase()->GetStackAmount();
1968 uint8 maxStacks = sealDot->GetSpellInfo()->StackAmount;
1969
1971
1972 // Scale weapon damage % by stacks (6.6% per stack, up to 33% at 5 stacks)
1973 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(damageSpell);
1974 int32 amount = spellInfo->Effects[EFFECT_0].CalcValue();
1975 amount = (amount * stacks) / maxStacks;
1976
1977 caster->CastCustomSpell(damageSpell, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
1978 }
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:836
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:664
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:1407
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:5755
@ SPELL_PALADIN_SEAL_OF_VENGEANCE_EFFECT
Definition spell_paladin.cpp:98
@ SPELL_PALADIN_SEAL_OF_CORRUPTION_EFFECT
Definition spell_paladin.cpp:99

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.

1916 {
1917 // Seal of Vengeance = 31801, Seal of Corruption = 53736
1918 _isVengeance = GetSpellInfo()->Id == 31801;
1919 return true;
1920 }
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.

1981 {
1983 // HandleSeal reads stacks BEFORE HandleApplyDoT increments them,
1984 // so the attacking hit does not benefit from its own stack application.
1987 }
@ SPELL_AURA_DUMMY
Definition SpellAuraDefines.h:67
#define AuraEffectProcFn(F, I, N)
Definition SpellScript.h:865
#define AuraCheckProcFn(F)
Definition SpellScript.h:829
HookList< CheckProcHandler > DoCheckProc
Definition SpellScript.h:828
HookList< EffectProcHandler > OnEffectProc
Definition SpellScript.h:860
void HandleApplyDoT(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition spell_paladin.cpp:1941
void HandleSeal(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition spell_paladin.cpp:1956
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_paladin.cpp:1922

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: