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
 
Unit * GetCaster () 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 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< 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< AfterCheckProcHandler > DoAfterCheckProc
 
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

◆ CalculateAmount()

void spell_pri_lightwell_renew::CalculateAmount ( AuraEffect const *  ,
int32 &  amount,
bool &   
)
inlineprivate
427 {
428 if (Unit* caster = GetCaster())
429 {
430 // Bonus from Glyph of Lightwell
431 if (AuraEffect* modHealing = caster->GetAuraEffect(SPELL_PRIEST_GLYPH_OF_LIGHTWELL, EFFECT_0))
432 AddPct(amount, modHealing->GetAmount());
433 }
434 }
@ 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:1040
Definition Unit.h:667
@ 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
443 {
444 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
445 if (!damageInfo)
446 return;
447
448 uint32 damage = damageInfo->GetDamage();
449 if (_remainingAmount <= damage)
450 return;
451
452 _remainingAmount -= damage;
453 // prevent drop charge
455 }
std::uint32_t uint32
Definition Define.h:107
void PreventDefaultAction()
Definition SpellScript.cpp:1005
Definition Unit.h:339
uint32 GetDamage() const
Definition Unit.h:375
DamageInfo * GetDamageInfo() const
Definition Unit.h:472
uint32 _remainingAmount
Definition spell_priest.cpp:492

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

Referenced by Register().

◆ HandleUpdateSpellclick()

void spell_pri_lightwell_renew::HandleUpdateSpellclick ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate
458 {
459 Player* player = GetTarget()->ToPlayer();
460 if (!player)
461 return;
462
463 Unit* caster = GetCaster();
464 if (!caster)
465 return;
466
467 // Spellclick gets hidden per player on the well's own NPC flags, so the wells are what
468 // need resending here, not the aura's caster (the priest).
469 for (Unit* controlled : caster->m_Controlled)
470 {
471 if (!IsLightwellEntry(controlled->GetEntry()))
472 continue;
473
474 UpdateData data;
475 WorldPacket packet;
476 controlled->BuildValuesUpdateBlockForPlayer(&data, player);
477 data.BuildPacket(packet);
478 player->SendDirectMessage(&packet);
479 }
480 }
Unit * GetTarget() const
Definition SpellScript.cpp:1185
Player * ToPlayer()
Definition Object.h:208
Definition Player.h:1086
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:5864
Definition UpdateData.h:52
bool BuildPacket(WorldPacket &packet)
Definition UpdateData.cpp:48
Definition WorldPacket.h:26
static bool IsLightwellEntry(uint32 entry)
Definition spell_priest.cpp:362

References UpdateData::BuildPacket(), AuraScript::GetCaster(), AuraScript::GetTarget(), IsLightwellEntry(), Unit::m_Controlled, Player::SendDirectMessage(), and Object::ToPlayer().

Referenced by Register().

◆ InitializeAmount()

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

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.

483 {
489 }
@ 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:858
#define AuraEffectCalcAmountFn(F, I, N)
Definition SpellScript.h:784
#define AuraEffectApplyFn(F, I, N, M)
Definition SpellScript.h:755
#define AuraEffectRemoveFn(F, I, N, M)
Definition SpellScript.h:766
HookList< EffectApplyHandler > AfterEffectRemove
Definition SpellScript.h:765
HookList< EffectApplyHandler > AfterEffectApply
Definition SpellScript.h:754
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition SpellScript.h:783
HookList< AuraProcHandler > DoPrepareProc
Definition SpellScript.h:849
void InitializeAmount(AuraEffect const *, AuraEffectHandleModes)
Definition spell_priest.cpp:436
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
Definition spell_priest.cpp:426
void CheckDropCharge(ProcEventInfo &eventInfo)
Definition spell_priest.cpp:442
void HandleUpdateSpellclick(AuraEffect const *, AuraEffectHandleModes)
Definition spell_priest.cpp:457

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: