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

Private Member Functions

 PrepareAuraScript (spell_pri_lightwell_renew)
 
void CalculateAmount (AuraEffect const *, int32 &amount, bool &)
 
void InitializeAmount (AuraEffect const *, AuraEffectHandleModes)
 
void CheckDropCharge (ProcEventInfo &eventInfo)
 
void HandleUpdateSpellclick (AuraEffect const *, AuraEffectHandleModes)
 
void Register () override
 

Private Attributes

uint32 _remainingAmount = 0
 

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 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< 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

◆ CalculateAmount()

void spell_pri_lightwell_renew::CalculateAmount ( AuraEffect const *  ,
int32 amount,
bool &   
)
inlineprivate
410 {
411 if (Unit* caster = GetCaster())
412 {
413 // Bonus from Glyph of Lightwell
414 if (AuraEffect* modHealing = caster->GetAuraEffect(SPELL_PRIEST_GLYPH_OF_LIGHTWELL, EFFECT_0))
415 AddPct(amount, modHealing->GetAmount());
416 }
417 }
@ EFFECT_0
Definition SharedDefines.h:31
T AddPct(T &base, U pct)
Definition Util.h:58
Definition SpellAuraEffects.h:39
Unit * GetCaster() const
Definition SpellScript.cpp:1035
Definition Unit.h:664
@ SPELL_PRIEST_GLYPH_OF_LIGHTWELL
Definition spell_priest.cpp:36

References AddPct(), EFFECT_0, AuraScript::GetCaster(), and SPELL_PRIEST_GLYPH_OF_LIGHTWELL.

Referenced by Register().

◆ CheckDropCharge()

void spell_pri_lightwell_renew::CheckDropCharge ( ProcEventInfo eventInfo)
inlineprivate
426 {
427 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
428 if (!damageInfo)
429 return;
430
431 uint32 damage = damageInfo->GetDamage();
432 if (_remainingAmount <= damage)
433 return;
434
435 _remainingAmount -= damage;
436 // prevent drop charge
438 }
std::uint32_t uint32
Definition Define.h:107
void PreventDefaultAction()
Definition SpellScript.cpp:1000
Definition Unit.h:336
uint32 GetDamage() const
Definition Unit.h:372
DamageInfo * GetDamageInfo() const
Definition Unit.h:469
uint32 _remainingAmount
Definition spell_priest.cpp:465

References _remainingAmount, DamageInfo::GetDamage(), ProcEventInfo::GetDamageInfo(), and AuraScript::PreventDefaultAction().

Referenced by Register().

◆ HandleUpdateSpellclick()

void spell_pri_lightwell_renew::HandleUpdateSpellclick ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate
441 {
442 if (Unit* caster = GetCaster())
443 {
444 if (Player* player = GetTarget()->ToPlayer())
445 {
446 UpdateData data;
447 WorldPacket packet;
448 caster->BuildValuesUpdateBlockForPlayer(&data, player);
449 data.BuildPacket(packet);
450 player->SendDirectMessage(&packet);
451 }
452 }
453 }
Unit * GetTarget() const
Definition SpellScript.cpp:1180
Definition Player.h:1084
Definition UpdateData.h:52
bool BuildPacket(WorldPacket &packet)
Definition UpdateData.cpp:48
Definition WorldPacket.h:26

References UpdateData::BuildPacket(), AuraScript::GetCaster(), and AuraScript::GetTarget().

Referenced by Register().

◆ InitializeAmount()

void spell_pri_lightwell_renew::InitializeAmount ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate
420 {
421 // Attacks done to you equal to 30% of your total health will cancel the effect
423 }
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1121

References _remainingAmount, Unit::CountPctFromMaxHealth(), and AuraScript::GetTarget().

Referenced by Register().

◆ PrepareAuraScript()

spell_pri_lightwell_renew::PrepareAuraScript ( spell_pri_lightwell_renew  )
private

◆ Register()

void spell_pri_lightwell_renew::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

456 {
462 }
@ SPELL_AURA_PERIODIC_HEAL
Definition SpellAuraDefines.h:71
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
Definition SpellAuraDefines.h:51
@ AURA_EFFECT_HANDLE_REAL
Definition SpellAuraDefines.h:42
#define AuraProcFn(F)
Definition SpellScript.h:855
#define AuraEffectCalcAmountFn(F, I, N)
Definition SpellScript.h:783
#define AuraEffectApplyFn(F, I, N, M)
Definition SpellScript.h:754
#define AuraEffectRemoveFn(F, I, N, M)
Definition SpellScript.h:765
HookList< EffectApplyHandler > AfterEffectRemove
Definition SpellScript.h:764
HookList< EffectApplyHandler > AfterEffectApply
Definition SpellScript.h:753
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition SpellScript.h:782
HookList< AuraProcHandler > DoPrepareProc
Definition SpellScript.h:846
void InitializeAmount(AuraEffect const *, AuraEffectHandleModes)
Definition spell_priest.cpp:419
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
Definition spell_priest.cpp:409
void CheckDropCharge(ProcEventInfo &eventInfo)
Definition spell_priest.cpp:425
void HandleUpdateSpellclick(AuraEffect const *, AuraEffectHandleModes)
Definition spell_priest.cpp:440

References AuraScript::AfterEffectApply, AuraScript::AfterEffectRemove, AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK, AuraEffectApplyFn, AuraEffectCalcAmountFn, AuraEffectRemoveFn, AuraProcFn, CalculateAmount(), CheckDropCharge(), AuraScript::DoEffectCalcAmount, AuraScript::DoPrepareProc, EFFECT_0, HandleUpdateSpellclick(), InitializeAmount(), and SPELL_AURA_PERIODIC_HEAL.

Member Data Documentation

◆ _remainingAmount

uint32 spell_pri_lightwell_renew::_remainingAmount = 0
private

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