aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 4b57fcbb76e..043dc8cc179 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12240,17 +12240,22 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde
level -= int32(spellProto->spellLevel);
float basePointsPerLevel = spellProto->EffectRealPointsPerLevel[effect_index];
- float randomPointsPerLevel = 1;
int32 basePoints = int32(effBasePoints + level * basePointsPerLevel);
- int32 randomPoints = int32(spellProto->EffectDieSides[effect_index] + level * randomPointsPerLevel);
+ int32 randomPoints = int32(spellProto->EffectDieSides[effect_index]);
- // range can have possitive and negative values, so order its for irand
- int32 randvalue = int32(1) >= randomPoints
- ? irand(randomPoints, int32(1))
- : irand(int32(1), randomPoints);
+ int32 value = basePoints;
+
+ if (randomPoints != 0)
+ {
+ // range can have positive and negative values, so order its for irand
+ int32 randvalue = (0 > randomPoints)
+ ? irand(randomPoints, 0)
+ : irand(0, randomPoints);
- int32 value = basePoints + randvalue;
- //random damage
+ basePoints += randvalue;
+ }
+
+ // random damage
//if (comboDamage != 0 && unitPlayer /*&& target && (target->GetGUID() == unitPlayer->GetComboTarget())*/)
if (m_movedPlayer)
if (uint8 comboPoints = m_movedPlayer->GetComboPoints())