diff options
author | ariel- <ariel-@users.noreply.github.com> | 2018-01-13 06:45:21 -0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-06-13 00:59:13 +0200 |
commit | fccf1a8c62820004df92b9ac567ba75f7281e6e2 (patch) | |
tree | 063326fad1f3fa51c633e4b8d0c7745341ec113e /src/server/game/Spells/SpellScript.h | |
parent | fa4e2d3935b0184623a6d816dc25a41bad30b1d8 (diff) |
Core/Auras: removed caster dependency from core
- Decoupled Unit logic: split of spell critical chance into done (caster bonuses) and taken (target bonuses), this allows to precalculate caster bonuses on aura apply and then check victim's auras on damage/healing calc
- Made static a bunch of methods (they no longer have this pointer because they are now called from periodic handlers which may or may not have an active caster in world)
- Simplified all AuraEffect bonuses into AuraEffect::_amount, no more duplicated code
- Critical chance and whether or not caster is player owned unit (for resilience calcs) is now saved one level upper, on Aura itself (it's impossible as of 3.3.5 to have different effects with different critical chances)
- Minor cleanup of SPELL_DAMAGE_CLASS_NONE and Arcane Potency (#18813) crit handling
Closes #19876
(cherry picked from commit cb9e72e521d3cc415dd15bf6912c87f89e41b92a)
Diffstat (limited to 'src/server/game/Spells/SpellScript.h')
-rw-r--r-- | src/server/game/Spells/SpellScript.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index fc665f0947a..2a52b953266 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -193,7 +193,7 @@ class TC_GAME_API SpellScript : public _SpellScript typedef void(CLASSNAME::*SpellBeforeHitFnType)(SpellMissInfo missInfo); \ typedef void(CLASSNAME::*SpellHitFnType)(); \ typedef void(CLASSNAME::*SpellCastFnType)(); \ - typedef void(CLASSNAME::*SpellOnCalcCritChanceFnType)(Unit* victim, float& chance); \ + typedef void(CLASSNAME::*SpellOnCalcCritChanceFnType)(Unit const* victim, float& chance); \ typedef void(CLASSNAME::*SpellObjectAreaTargetSelectFnType)(std::list<WorldObject*>&); \ typedef void(CLASSNAME::*SpellObjectTargetSelectFnType)(WorldObject*&); \ typedef void(CLASSNAME::*SpellDestinationTargetSelectFnType)(SpellDestination&); @@ -251,7 +251,7 @@ class TC_GAME_API SpellScript : public _SpellScript { public: OnCalcCritChanceHandler(SpellOnCalcCritChanceFnType onCalcCritChanceHandlerScript); - void Call(SpellScript* spellScript, Unit* victim, float& critChance) const; + void Call(SpellScript* spellScript, Unit const* victim, float& critChance) const; private: SpellOnCalcCritChanceFnType _onCalcCritChanceHandlerScript; }; @@ -563,7 +563,7 @@ class TC_GAME_API AuraScript : public _SpellScript typedef void(CLASSNAME::*AuraEffectCalcAmountFnType)(AuraEffect const*, int32 &, bool &); \ typedef void(CLASSNAME::*AuraEffectCalcPeriodicFnType)(AuraEffect const*, bool &, int32 &); \ typedef void(CLASSNAME::*AuraEffectCalcSpellModFnType)(AuraEffect const*, SpellModifier* &); \ - typedef void(CLASSNAME::*AuraEffectCalcCritChanceFnType)(AuraEffect const*, Unit*, float&); \ + typedef void(CLASSNAME::*AuraEffectCalcCritChanceFnType)(AuraEffect const*, Unit const*, float&); \ typedef void(CLASSNAME::*AuraEffectAbsorbFnType)(AuraEffect*, DamageInfo &, uint32 &); \ typedef void(CLASSNAME::*AuraEffectSplitFnType)(AuraEffect*, DamageInfo &, uint32 &); \ typedef bool(CLASSNAME::*AuraCheckProcFnType)(ProcEventInfo&); \ @@ -641,7 +641,7 @@ class TC_GAME_API AuraScript : public _SpellScript { public: EffectCalcCritChanceHandler(AuraEffectCalcCritChanceFnType effectHandlerScript, uint8 effIndex, uint16 effName); - void Call(AuraScript* auraScript, AuraEffect const* aurEff, Unit* victim, float& critChance) const; + void Call(AuraScript* auraScript, AuraEffect const* aurEff, Unit const* victim, float& critChance) const; private: AuraEffectCalcCritChanceFnType _effectHandlerScript; }; |