Some fixes for quests/basePoints calculation, realm server.

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2010-04-11 11:23:32 +04:00
parent 7ffc9ef40b
commit cdec48b9ef
6 changed files with 81 additions and 39 deletions

View File

@@ -12243,18 +12243,22 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde
int32 basePoints = int32(effBasePoints + level * basePointsPerLevel);
int32 randomPoints = int32(spellProto->EffectDieSides[effect_index]);
int32 value = basePoints;
if (randomPoints != 0)
switch(randomPoints)
{
// range can have positive and negative values, so order its for irand
int32 randvalue = (0 > randomPoints)
? irand(randomPoints, 0)
: irand(0, randomPoints);
case 0: break; // not used
case 1: basePoints += 1; break; // range 1..1
default:
// range can have positive (1..rand) and negative (rand..1) values, so order its for irand
int32 randvalue = (randomPoints >= 1)
? irand(1, randomPoints)
: irand(randomPoints, 1);
basePoints += randvalue;
basePoints += randvalue;
break;
}
int32 value = basePoints;
// random damage
//if (comboDamage != 0 && unitPlayer /*&& target && (target->GetGUID() == unitPlayer->GetComboTarget())*/)
if (m_movedPlayer)