From be95faff2370db63eedd812ab4e70bb87e34b570 Mon Sep 17 00:00:00 2001 From: n0n4m3 Date: Sun, 11 Apr 2010 11:16:42 +0400 Subject: Fix mail, professions, group loot, console spam, and some fixes. Big thx to TOM_RUS. --HG-- branch : trunk --- src/game/Unit.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/game/Unit.cpp') 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()) -- cgit v1.2.3