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

Private Member Functions

 PrepareSpellScript (spell_dru_nourish)
 
void HandleHeal (SpellEffIndex)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from SpellScript
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Spell *spell)
 
void _InitHit ()
 
bool _IsEffectPrevented (SpellEffIndex effIndex)
 
bool _IsDefaultEffectPrevented (SpellEffIndex effIndex)
 
void _PrepareScriptCall (SpellScriptHookType hookType)
 
void _FinishScriptCall ()
 
bool IsInCheckCastHook () const
 
bool IsInTargetHook () const
 
bool IsInHitPhase () const
 
bool IsInEffectHook () const
 
UnitGetCaster ()
 
UnitGetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObjectGetExplTargetWorldObject ()
 
UnitGetExplTargetUnit ()
 
GameObjectGetExplTargetGObj ()
 
ItemGetExplTargetItem ()
 
UnitGetHitUnit ()
 
CreatureGetHitCreature ()
 
PlayerGetHitPlayer ()
 
ItemGetHitItem ()
 
GameObjectGetHitGObj ()
 
WorldLocationGetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
SpellGetSpell ()
 
AuraGetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo const * GetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void Cancel ()
 
void SetCustomCastResultMessage (SpellCustomErrors result)
 
- 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 SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ HandleHeal()

void spell_dru_nourish::HandleHeal ( SpellEffIndex  )
inlineprivate
2027 {
2028 Unit* caster = GetCaster();
2029 Unit* target = GetHitUnit();
2030 if (!target)
2031 return;
2032
2033 int32 heal = GetHitHeal();
2034
2035 // Glyph of Nourish
2036 if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DRUID_GLYPH_OF_NOURISH, EFFECT_0))
2037 {
2038 uint32 auraCount = 0;
2039
2041 for (AuraEffect const* hot : periodicHeals)
2042 {
2043 if (caster->GetGUID() == hot->GetCasterGUID())
2044 ++auraCount;
2045 }
2046
2047 AddPct(heal, aurEff->GetAmount() * auraCount);
2048 }
2049
2050 SetHitHeal(heal);
2051 }
std::int32_t int32
Definition Define.h:103
std::uint32_t uint32
Definition Define.h:107
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_AURA_PERIODIC_HEAL
Definition SpellAuraDefines.h:71
T AddPct(T &base, U pct)
Definition Util.h:58
Definition SpellAuraEffects.h:39
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
Unit * GetHitUnit()
Definition SpellScript.cpp:448
void SetHitHeal(int32 heal)
Definition SpellScript.cpp:544
int32 GetHitHeal()
Definition SpellScript.cpp:534
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:664
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1428
std::vector< AuraEffect * > AuraEffectList
Definition Unit.h:680
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:5755
@ SPELL_DRUID_GLYPH_OF_NOURISH
Definition spell_druid.cpp:101

References AddPct(), EFFECT_0, Unit::GetAuraEffect(), Unit::GetAuraEffectsByType(), SpellScript::GetCaster(), Object::GetGUID(), SpellScript::GetHitHeal(), SpellScript::GetHitUnit(), SpellScript::SetHitHeal(), SPELL_AURA_PERIODIC_HEAL, and SPELL_DRUID_GLYPH_OF_NOURISH.

Referenced by Register().

◆ PrepareSpellScript()

spell_dru_nourish::PrepareSpellScript ( spell_dru_nourish  )
private

◆ Register()

void spell_dru_nourish::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2054 {
2056 }
@ SPELL_EFFECT_HEAL
Definition SharedDefines.h:776
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
void HandleHeal(SpellEffIndex)
Definition spell_druid.cpp:2026

References EFFECT_0, HandleHeal(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_HEAL, and SpellEffectFn.


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