[9701] Fix basepoints calculation

Signed-off-by: Laise <fenrisse@gmail.com>
This commit is contained in:
VladimirMangos 2010-04-08 23:15:10 +03:00 committed by Laise
parent f39cdc66a6
commit 53486545b5
8 changed files with 21 additions and 19 deletions

View file

@ -6645,7 +6645,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
}
int32 extra_attack_power = CalculateSpellDamage(windfurySpellEntry, EFFECT_INDEX_1, windfurySpellEntry->EffectBasePoints[EFFECT_INDEX_1], pVictim);
int32 extra_attack_power = CalculateSpellDamage(pVictim, windfurySpellEntry, EFFECT_INDEX_1);
// Off-Hand case
if (castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND)
@ -8925,7 +8925,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
// effect 1 m_amount
int32 maxPercent = (*i)->GetModifier()->m_amount;
// effect 0 m_amount
int32 stepPercent = CalculateSpellDamage((*i)->GetSpellProto(), EFFECT_INDEX_0, (*i)->GetSpellProto()->EffectBasePoints[EFFECT_INDEX_0], this);
int32 stepPercent = CalculateSpellDamage(this, (*i)->GetSpellProto(), EFFECT_INDEX_0);
// count affliction effects and calc additional damage in percentage
int32 modPercent = 0;
AuraMap const& victimAuras = pVictim->GetAuras();
@ -11291,7 +11291,7 @@ bool Unit::SelectHostileTarget()
//======================================================================
//======================================================================
int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, SpellEffectIndex effect_index, int32 effBasePoints, Unit const* target)
int32 Unit::CalculateSpellDamage(Unit const* target, SpellEntry const* spellProto, SpellEffectIndex effect_index, int32 const* effBasePoints)
{
Player* unitPlayer = (GetTypeId() == TYPEID_PLAYER) ? (Player*)this : NULL;
@ -11305,7 +11305,8 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, SpellEffectIndex
level-= (int32)spellProto->spellLevel;
float basePointsPerLevel = spellProto->EffectRealPointsPerLevel[effect_index];
int32 basePoints = int32(effBasePoints + level * basePointsPerLevel);
int32 basePoints = effBasePoints ? *effBasePoints - 1 : spellProto->EffectBasePoints[effect_index];
basePoints += int32(level * basePointsPerLevel);
int32 randomPoints = int32(spellProto->EffectDieSides[effect_index]);
float comboDamage = spellProto->EffectPointsPerComboPoint[effect_index];