From 4234c685b84df09c590320b12ef919b446aadb9e Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 24 Mar 2010 12:43:09 +0300 Subject: [PATCH] Fix. --- src/game/Unit.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 5484b61f3..af73a8177 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1129,13 +1129,13 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const Spell *spell = new Spell(this, spellInfo, triggered, originalCaster); if(bp0) - spell->m_currentBasePoints[EFFECT_INDEX_0] = *bp0-int32(1); + spell->m_currentBasePoints[EFFECT_INDEX_0] = *bp0; if(bp1) - spell->m_currentBasePoints[EFFECT_INDEX_1] = *bp1-int32(1); + spell->m_currentBasePoints[EFFECT_INDEX_1] = *bp1; if(bp2) - spell->m_currentBasePoints[EFFECT_INDEX_2] = *bp2-int32(1); + spell->m_currentBasePoints[EFFECT_INDEX_2] = *bp2; SpellCastTargets targets; targets.setUnitTarget( Victim ); @@ -11246,34 +11246,28 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, SpellEffectIndex 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]); float comboDamage = spellProto->EffectPointsPerComboPoint[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 + randvalue; + int32 value = basePoints + 1; //random damage if(comboDamage != 0 && unitPlayer && target && (target->GetGUID() == unitPlayer->GetComboTarget())) value += (int32)(comboDamage * comboPoints); if(Player* modOwner = GetSpellModOwner()) { - modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_ALL_EFFECTS, value); + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_ALL_EFFECTS, value); switch(effect_index) { case 0: - modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT1, value); + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_EFFECT1, value); break; case 1: - modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT2, value); + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_EFFECT2, value); break; case 2: - modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT3, value); + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_EFFECT3, value); break; } }