diff options
| author | Nyr <nyrdeveloper@gmail.com> | 2022-07-25 19:38:42 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-07-28 21:26:48 +0200 |
| commit | 44236c70787eae0239fb636e217305dfa043bf71 (patch) | |
| tree | f309905195b591feabd5f009d83005fb69b68b26 /src/server/game/Spells/SpellScript.h | |
| parent | 51166b2c5e02910728f897ff481ea6ee83a9310c (diff) | |
Core/Spells: Implement OnEffectAbsorbHeal and AfterEffectAbsorbHeal hooks
Diffstat (limited to 'src/server/game/Spells/SpellScript.h')
| -rw-r--r-- | src/server/game/Spells/SpellScript.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 7cbb3a5121b..7deec060f01 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -690,6 +690,7 @@ class TC_GAME_API AuraScript : public _SpellScript typedef void(CLASSNAME::*AuraEffectCalcSpellModFnType)(AuraEffect const*, SpellModifier* &); \ typedef void(CLASSNAME::*AuraEffectCalcCritChanceFnType)(AuraEffect const*, Unit const*, float&); \ typedef void(CLASSNAME::*AuraEffectAbsorbFnType)(AuraEffect*, DamageInfo &, uint32 &); \ + typedef void(CLASSNAME::*AuraEffectAbsorbHealFnType)(AuraEffect*, HealInfo &, uint32 &); \ typedef void(CLASSNAME::*AuraEffectSplitFnType)(AuraEffect*, DamageInfo &, uint32 &); \ typedef bool(CLASSNAME::*AuraCheckProcFnType)(ProcEventInfo&); \ typedef bool(CLASSNAME::*AuraCheckEffectProcFnType)(AuraEffect const*, ProcEventInfo&); \ @@ -842,6 +843,14 @@ class TC_GAME_API AuraScript : public _SpellScript private: AuraEffectAbsorbFnType pEffectHandlerScript; }; + class TC_GAME_API EffectAbsorbHealHandler : public EffectBase + { + public: + EffectAbsorbHealHandler(AuraEffectAbsorbHealFnType _pEffectHandlerScript, uint8 _effIndex); + void Call(AuraScript* auraScript, AuraEffect* aurEff, HealInfo& healInfo, uint32& absorbAmount); + private: + AuraEffectAbsorbHealFnType pEffectHandlerScript; + }; class TC_GAME_API EffectManaShieldHandler : public EffectBase { public: @@ -945,6 +954,7 @@ class TC_GAME_API AuraScript : public _SpellScript class EffectCalcCritChanceHandlerFunction : public AuraScript::EffectCalcCritChanceHandler { public: explicit EffectCalcCritChanceHandlerFunction(AuraEffectCalcCritChanceFnType effectHandlerScript, uint8 effIndex, uint16 effName) : AuraScript::EffectCalcCritChanceHandler((AuraScript::AuraEffectCalcCritChanceFnType)effectHandlerScript, effIndex, effName) { } }; \ class EffectApplyHandlerFunction : public AuraScript::EffectApplyHandler { public: explicit EffectApplyHandlerFunction(AuraEffectApplicationModeFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName, AuraEffectHandleModes _mode) : AuraScript::EffectApplyHandler((AuraScript::AuraEffectApplicationModeFnType)_pEffectHandlerScript, _effIndex, _effName, _mode) { } }; \ class EffectAbsorbFunction : public AuraScript::EffectAbsorbHandler { public: explicit EffectAbsorbFunction(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex, bool overkill = false) : AuraScript::EffectAbsorbHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex, overkill) { } }; \ + class EffectAbsorbHealFunction : public AuraScript::EffectAbsorbHealHandler { public: EffectAbsorbHealFunction(AuraEffectAbsorbHealFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectAbsorbHealHandler((AuraScript::AuraEffectAbsorbHealFnType)_pEffectHandlerScript, _effIndex) { } }; \ class EffectManaShieldFunction : public AuraScript::EffectManaShieldHandler { public: explicit EffectManaShieldFunction(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectManaShieldHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) { } }; \ class EffectSplitFunction : public AuraScript::EffectSplitHandler { public: explicit EffectSplitFunction(AuraEffectSplitFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectSplitHandler((AuraScript::AuraEffectSplitFnType)_pEffectHandlerScript, _effIndex) { } }; \ class CheckProcHandlerFunction : public AuraScript::CheckProcHandler { public: explicit CheckProcHandlerFunction(AuraCheckProcFnType handlerScript) : AuraScript::CheckProcHandler((AuraScript::AuraCheckProcFnType)handlerScript) { } }; \ @@ -1067,11 +1077,22 @@ class TC_GAME_API AuraScript : public _SpellScript #define AuraEffectAbsorbFn(F, I) EffectAbsorbFunction(&F, I) #define AuraEffectAbsorbOverkillFn(F, I) EffectAbsorbFunction(&F, I, true) + // executed when absorb aura effect is going to reduce damage + // example: OnEffectAbsorbHeal += AuraEffectAbsorbHealFn(class::function, EffectIndexSpecifier); + // where function is: void function (AuraEffect const* aurEff, HealInfo& healInfo, uint32& absorbAmount); + HookList<EffectAbsorbHealHandler> OnEffectAbsorbHeal; + #define AuraEffectAbsorbHealFn(F, I) EffectAbsorbHealFunction(&F, I) + // executed after absorb aura effect reduced damage to target - absorbAmount is real amount absorbed by aura // example: AfterEffectAbsorb += AuraEffectAbsorbFn(class::function, EffectIndexSpecifier); // where function is: void function (AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount); HookList<EffectAbsorbHandler> AfterEffectAbsorb; + // executed after absorb aura effect reduced heal to target - absorbAmount is real amount absorbed by aura + // example: AfterEffectAbsorbHeal += AuraEffectAbsorbHealFn(class::function, EffectIndexSpecifier); + // where function is: void function (AuraEffect* aurEff, HealInfo& healInfo, uint32& absorbAmount); + HookList<EffectAbsorbHealHandler> AfterEffectAbsorbHeal; + // executed when mana shield aura effect is going to reduce damage // example: OnEffectManaShield += AuraEffectManaShieldFn(class::function, EffectIndexSpecifier); // where function is: void function (AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount); |
