diff options
author | Ovahlord <dreadkiller@gmx.de> | 2024-07-31 11:39:37 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-07-31 11:39:37 +0200 |
commit | c903b317c9a2b92b5b45a15a44ee6e486530ce6c (patch) | |
tree | d7d4affd35fbcfcd8b1e11a82864b7b6f01f884d /src/server/game/Spells/SpellInfo.cpp | |
parent | 0a56248fb4c714747c617e0cae6ee9d6b4be67b5 (diff) |
Core/Spells: prioritize DieSides over Variance when calculation spell values
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index d079113b828..4cc5daf84e9 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -504,26 +504,23 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32 if (caster) casterUnit = caster->ToUnit(); - if (Scaling.Variance != 0.0f) + if (DieSides) + { + // roll in a range <1;EffectDieSides> as of patch 3.3.3 + if (DieSides == 1) + value += DieSides; + else + value += (DieSides >= 1) ? irand(1, DieSides) : irand(DieSides, 1); + } + else if (Scaling.Variance != 0.0f) { float delta = fabs(Scaling.Variance * 0.5f); double valueVariance = frand(-delta, delta); value += double(basePoints) * valueVariance; - + if (variance) *variance = valueVariance; } - else - { - if (DieSides) - { - // roll in a range <1;EffectDieSides> as of patch 3.3.3 - if (DieSides == 1) - value += DieSides; - else - value += (DieSides >= 1) ? irand(1, DieSides) : irand(DieSides, 1); - } - } // base amount modification based on spell lvl vs caster lvl if (Scaling.Coefficient != 0.0f) |