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

Private Member Functions

 PrepareAuraScript (spell_pri_power_word_shield_AuraScript)
 
bool Validate (SpellInfo const *) override
 
void CalculateAmount (AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
 
void ReflectDamage (AuraEffect *aurEff, DamageInfo &dmgInfo, uint32 &absorbAmount)
 
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=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 bool Load ()
 
virtual void Unload ()
 
- 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
 

Member Function Documentation

void spell_pri_power_word_shield::spell_pri_power_word_shield_AuraScript::CalculateAmount ( AuraEffect const aurEff,
int32 amount,
bool canBeRecalculated 
)
inlineprivate
905  {
906  canBeRecalculated = false;
907  if (Unit* caster = GetCaster())
908  {
909  // +87% from sp bonus
910  float bonus = 0.87f;
911 
912  // Borrowed Time
913  if (AuraEffect const* borrowedTime = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_BORROWED_TIME, EFFECT_1))
914  bonus += CalculatePct(1.0f, borrowedTime->GetAmount());
915 
916  bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask());
917 
918  // Improved PW: Shield: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :)
919  // Improved PW: Shield is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage
920  bonus = caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), bonus);
921  bonus *= caster->CalculateLevelPenalty(GetSpellInfo());
922 
923  amount += int32(bonus);
924 
925  // Twin Disciplines
926  if (AuraEffect const* twinDisciplines = caster->GetAuraEffectOfRankedSpell(SPELL_PRIEST_TWIN_DISCIPLINES_RANK_1, EFFECT_1))
927  AddPct(amount, twinDisciplines->GetAmount());
928 
929  // Focused Power
930  amount *= caster->GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
931  }
932  }
Definition: SpellAuraEffects.h:30
Definition: SharedDefines.h:29
Definition: SharedDefines.h:4629
Definition: spell_priest.cpp:61
SpellInfo const * GetSpellInfo() const
Definition: SpellScript.cpp:991
Definition: spell_priest.cpp:69
T CalculatePct(T base, U pct)
Definition: Util.h:92
Unit * GetCaster() const
Definition: SpellScript.cpp:1006
T AddPct(T &base, U pct)
Definition: Util.h:98
int32_t int32
Definition: g3dmath.h:167
Definition: SpellAuraDefines.h:196
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

spell_pri_power_word_shield::spell_pri_power_word_shield_AuraScript::PrepareAuraScript ( spell_pri_power_word_shield_AuraScript  )
private
void spell_pri_power_word_shield::spell_pri_power_word_shield_AuraScript::ReflectDamage ( AuraEffect aurEff,
DamageInfo dmgInfo,
uint32 absorbAmount 
)
inlineprivate
935  {
936  Unit* target = GetTarget();
937  if (dmgInfo.GetAttacker() == target)
938  return;
939 
941  {
942  int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount());
943  target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
944  }
945  }
Definition: SpellAuraEffects.h:30
Definition: spell_priest.cpp:57
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:4085
Definition: SharedDefines.h:28
arena_t NULL
Definition: jemalloc_internal.h:624
Unit * GetTarget() const
Definition: SpellScript.cpp:1151
int32_t int32
Definition: Define.h:146
T CalculatePct(T base, U pct)
Definition: Util.h:92
Unit * GetAttacker() const
Definition: Unit.h:943
Definition: Unit.h:1305
Definition: spell_priest.cpp:56
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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_pri_power_word_shield::spell_pri_power_word_shield_AuraScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

948  {
951  }
HookList< EffectAbsorbHandler > AfterEffectAbsorb
Definition: SpellScript.h:745
#define AuraEffectAbsorbFn(F, I)
Definition: SpellScript.h:740
Definition: SharedDefines.h:28
#define AuraEffectCalcAmountFn(F, I, N)
Definition: SpellScript.h:722
void ReflectDamage(AuraEffect *aurEff, DamageInfo &dmgInfo, uint32 &absorbAmount)
Definition: spell_priest.cpp:934
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
Definition: spell_priest.cpp:904
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:721
Definition: SpellAuraDefines.h:129

+ Here is the call graph for this function:

bool spell_pri_power_word_shield::spell_pri_power_word_shield_AuraScript::Validate ( SpellInfo const )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

896  {
898  return false;
899  if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_REFLECTIVE_SHIELD_R1))
900  return false;
901  return true;
902  }
Definition: spell_priest.cpp:57
#define sSpellMgr
Definition: SpellMgr.h:756
Definition: spell_priest.cpp:56

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