diff options
author | n0n4m3 <none@none> | 2010-04-11 11:16:42 +0400 |
---|---|---|
committer | n0n4m3 <none@none> | 2010-04-11 11:16:42 +0400 |
commit | be95faff2370db63eedd812ab4e70bb87e34b570 (patch) | |
tree | d2db46e9e6161abe0dd8740461979b8309ef79c7 /src/game/Unit.cpp | |
parent | 457df07bd4fd1b394cfcdbb63d5ff76e87fe8c89 (diff) |
Fix mail, professions, group loot, console spam, and some fixes. Big thx to TOM_RUS.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 21 |
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()) |