TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
spell_pri_guardian_spirit::spell_pri_guardian_spirit_AuraScript Class Reference

Public Member Functions

 spell_pri_guardian_spirit_AuraScript ()
 
- Public Member Functions inherited from AuraScript
 AuraScript ()
 
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Aura *aura)
 
void _PrepareScriptCall (AuraScriptHookType hookType, AuraApplication const *aurApp=NULL)
 
void _FinishScriptCall ()
 
bool _IsDefaultActionPrevented ()
 
void PreventDefaultAction ()
 
SpellInfo constGetSpellInfo () 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 constGetTargetApplication () 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 ()
 

Private Member Functions

 PrepareAuraScript (spell_pri_guardian_spirit_AuraScript)
 
bool Validate (SpellInfo const *) override
 
bool Load () override
 
void CalculateAmount (AuraEffect const *, int32 &amount, bool &)
 
void Absorb (AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
 
void Register () override
 

Private Attributes

uint32 healPct
 

Additional Inherited Members

- Public Attributes inherited from AuraScript
HookList< CheckAreaTargetHandlerDoCheckAreaTarget
 
HookList< AuraDispelHandlerOnDispel
 
HookList< AuraDispelHandlerAfterDispel
 
HookList< EffectApplyHandlerOnEffectApply
 
HookList< EffectApplyHandlerAfterEffectApply
 
HookList< EffectApplyHandlerOnEffectRemove
 
HookList< EffectApplyHandlerAfterEffectRemove
 
HookList< EffectPeriodicHandlerOnEffectPeriodic
 
HookList
< EffectUpdatePeriodicHandler
OnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandlerDoEffectCalcAmount
 
HookList
< EffectCalcPeriodicHandler
DoEffectCalcPeriodic
 
HookList
< EffectCalcSpellModHandler
DoEffectCalcSpellMod
 
HookList< EffectAbsorbHandlerOnEffectAbsorb
 
HookList< EffectAbsorbHandlerAfterEffectAbsorb
 
HookList< EffectManaShieldHandlerOnEffectManaShield
 
HookList< EffectManaShieldHandlerAfterEffectManaShield
 
HookList< EffectSplitHandlerOnEffectSplit
 
HookList< CheckProcHandlerDoCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string constm_scriptName
 
uint32 m_scriptSpellId
 

Constructor & Destructor Documentation

spell_pri_guardian_spirit::spell_pri_guardian_spirit_AuraScript::spell_pri_guardian_spirit_AuraScript ( )
inline
470  {
471  healPct = 0;
472  }

Member Function Documentation

void spell_pri_guardian_spirit::spell_pri_guardian_spirit_AuraScript::Absorb ( AuraEffect ,
DamageInfo dmgInfo,
uint32 absorbAmount 
)
inlineprivate
497  {
498  Unit* target = GetTarget();
499  if (dmgInfo.GetDamage() < target->GetHealth())
500  return;
501 
502  int32 healAmount = int32(target->CountPctFromMaxHealth(healPct));
503  // remove the aura now, we don't want 40% healing bonus
505  target->CastCustomSpell(target, SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL, &healAmount, NULL, NULL, true);
506  absorbAmount = dmgInfo.GetDamage();
507  }
Definition: spell_priest.cpp:46
arena_t NULL
Definition: jemalloc_internal.h:624
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: SpellScript.cpp:1026
Unit * GetTarget() const
Definition: SpellScript.cpp:1151
int32_t int32
Definition: Define.h:146
uint32 GetDamage() const
Definition: Unit.h:949
Definition: Unit.h:453
int32_t int32
Definition: g3dmath.h:167
uint32 GetHealth() const
Definition: Unit.h:1426
Definition: Unit.h:1305
void CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:920
uint32 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:1435

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_pri_guardian_spirit::spell_pri_guardian_spirit_AuraScript::CalculateAmount ( AuraEffect const ,
int32 amount,
bool  
)
inlineprivate
491  {
492  // Set absorbtion amount to unlimited
493  amount = -1;
494  }

+ Here is the caller graph for this function:

bool spell_pri_guardian_spirit::spell_pri_guardian_spirit_AuraScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

485  {
487  return true;
488  }
Definition: SharedDefines.h:29
SpellInfo const * GetSpellInfo() const
Definition: SpellScript.cpp:991
SpellEffectInfo const * GetEffect(uint32 difficulty, uint32 index) const
Definition: SpellInfo.cpp:3348
int32 CalcValue(Unit const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:455

+ Here is the call graph for this function:

spell_pri_guardian_spirit::spell_pri_guardian_spirit_AuraScript::PrepareAuraScript ( spell_pri_guardian_spirit_AuraScript  )
private
void spell_pri_guardian_spirit::spell_pri_guardian_spirit_AuraScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

510  {
513  }
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
Definition: spell_priest.cpp:490
Definition: SharedDefines.h:29
#define AuraEffectAbsorbFn(F, I)
Definition: SpellScript.h:740
#define AuraEffectCalcAmountFn(F, I, N)
Definition: SpellScript.h:722
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
Definition: spell_priest.cpp:496
HookList< EffectAbsorbHandler > OnEffectAbsorb
Definition: SpellScript.h:739
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:721
Definition: SpellAuraDefines.h:129

+ Here is the call graph for this function:

bool spell_pri_guardian_spirit::spell_pri_guardian_spirit_AuraScript::Validate ( SpellInfo const )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

478  {
479  if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL))
480  return false;
481  return true;
482  }
Definition: spell_priest.cpp:46
#define sSpellMgr
Definition: SpellMgr.h:756

Member Data Documentation

uint32 spell_pri_guardian_spirit::spell_pri_guardian_spirit_AuraScript::healPct
private

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