mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Some fixes for quests/basePoints calculation, realm server.
--HG-- branch : trunk
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user