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

Private Member Functions

 PrepareAuraScript (spell_warl_demonic_pact_aura)
 
bool Validate (SpellInfo const *) override
 
bool AfterCheckProc (ProcEventInfo &eventInfo, bool isTriggeredAtSpellProcEvent)
 
void HandleProc (AuraEffect const *aurEff, ProcEventInfo &eventInfo)
 
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 (uint32 removeMode=0)
 
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 Register ()=0
 
virtual bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
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< AfterCheckProcHandlerDoAfterCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
virtual bool _Validate (SpellInfo const *entry)
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ AfterCheckProc()

bool spell_warl_demonic_pact_aura::AfterCheckProc ( ProcEventInfo eventInfo,
bool  isTriggeredAtSpellProcEvent 
)
inlineprivate
1461 {
1462 return isTriggeredAtSpellProcEvent && eventInfo.GetActor() && eventInfo.GetActor()->IsPet();
1463 }
Unit * GetActor()
Definition: Unit.h:439
bool IsPet() const
Definition: Unit.h:754

References ProcEventInfo::GetActor(), and Unit::IsPet().

◆ HandleProc()

void spell_warl_demonic_pact_aura::HandleProc ( AuraEffect const *  aurEff,
ProcEventInfo eventInfo 
)
inlineprivate
1466 {
1468
1469 if (eventInfo.GetActor()->HasSpellCooldown(aurEff->GetId()))
1470 return;
1471
1472 if (Unit* owner = eventInfo.GetActor()->GetOwner())
1473 {
1474 int32 currentBonus = 0;
1475 if (AuraEffect* demonicAurEff = owner->GetAuraEffect(SPELL_WARLOCK_DEMONIC_PACT_PROC, EFFECT_0))
1476 {
1477 currentBonus = demonicAurEff->GetAmount();
1478 }
1479
1480 if (AuraEffect* talentAurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_DEMONIC_PACT, EFFECT_0))
1481 {
1482 int32 spellDamageMinusBonus = owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_MAGIC) - currentBonus;
1483 if (spellDamageMinusBonus < 0)
1484 return;
1485 int32 bp = int32((talentAurEff->GetAmount() / 100.0f) * spellDamageMinusBonus);
1486 owner->CastCustomSpell((Unit*)nullptr, SPELL_WARLOCK_DEMONIC_PACT_PROC, &bp, &bp, 0, true, nullptr, talentAurEff);
1487 eventInfo.GetActor()->AddSpellCooldown(aurEff->GetId(), 0, eventInfo.GetProcCooldown());
1488 }
1489 }
1490 }
std::int32_t int32
Definition: Define.h:103
@ SPELL_WARLOCK_DEMONIC_PACT_PROC
Definition: spell_warlock.cpp:74
@ WARLOCK_ICON_ID_DEMONIC_PACT
Definition: spell_warlock.cpp:81
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELLFAMILY_WARLOCK
Definition: SharedDefines.h:3533
@ SPELL_SCHOOL_MASK_MAGIC
Definition: SharedDefines.h:312
uint32 GetProcCooldown() const
Definition: Unit.h:453
Definition: Unit.h:630
Unit * GetOwner() const
Definition: Unit.cpp:10600
virtual bool HasSpellCooldown(uint32) const
Definition: Unit.h:1260
virtual void AddSpellCooldown(uint32, uint32, uint32, bool needSendToClient=false, bool forceSendToSpectator=false)
Definition: Unit.h:1262
Definition: SpellAuraEffects.h:39
void PreventDefaultAction()
Definition: SpellScript.cpp:985

References Unit::AddSpellCooldown(), EFFECT_0, ProcEventInfo::GetActor(), AuraEffect::GetId(), Unit::GetOwner(), ProcEventInfo::GetProcCooldown(), Unit::HasSpellCooldown(), AuraScript::PreventDefaultAction(), SPELL_SCHOOL_MASK_MAGIC, SPELL_WARLOCK_DEMONIC_PACT_PROC, SPELLFAMILY_WARLOCK, and WARLOCK_ICON_ID_DEMONIC_PACT.

Referenced by Register().

◆ PrepareAuraScript()

spell_warl_demonic_pact_aura::PrepareAuraScript ( spell_warl_demonic_pact_aura  )
private

◆ Register()

void spell_warl_demonic_pact_aura::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1493 {
1495 }
#define AuraEffectProcFn(F, I, N)
Definition: SpellScript.h:847
@ SPELL_AURA_PROC_TRIGGER_SPELL
Definition: SpellAuraDefines.h:105
HookList< EffectProcHandler > OnEffectProc
Definition: SpellScript.h:842
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition: spell_warlock.cpp:1465

References AuraEffectProcFn, EFFECT_0, HandleProc(), AuraScript::OnEffectProc, and SPELL_AURA_PROC_TRIGGER_SPELL.

◆ Validate()

bool spell_warl_demonic_pact_aura::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1456 {
1458 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:125

References SPELL_WARLOCK_DEMONIC_PACT_PROC, and _SpellScript::ValidateSpellInfo().