[10742] Add spell_bonus_data.spell_bonus_data field and support for RAP bonuses use for spells damage from table.

Thanks to insider42 for prepering patch for mangos repo.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also added loading check for redundant ap/ap_dot data in table.
This commit is contained in:
QAston 2010-11-19 05:15:22 +03:00 committed by VladimirMangos
parent 21d63d491b
commit f27741460f
8 changed files with 157 additions and 133 deletions

View file

@ -6092,9 +6092,9 @@ int32 Unit::SpellBonusWithCoeffs(SpellEntry const *spellProto, int32 total, int3
coeff = damagetype == DOT ? bonus->dot_damage : bonus->direct_damage;
// apply ap bonus at done part calculation only (it flat total mod so common with taken)
if (donePart && bonus->ap_bonus)
if (donePart && (bonus->ap_bonus || bonus->ap_dot_bonus))
{
float ap_bonus = bonus->ap_bonus;
float ap_bonus = damagetype == DOT ? bonus->ap_dot_bonus : bonus->ap_bonus;
// Impurity
if (GetTypeId() == TYPEID_PLAYER && spellProto->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT)
@ -6103,7 +6103,7 @@ int32 Unit::SpellBonusWithCoeffs(SpellEntry const *spellProto, int32 total, int3
ap_bonus += ((spell->CalculateSimpleValue(EFFECT_INDEX_0) * ap_bonus) / 100.0f);
}
total += int32(ap_bonus * (GetTotalAttackPowerValue(BASE_ATTACK) + ap_benefit));
total += int32(ap_bonus * (GetTotalAttackPowerValue(IsSpellRequiresRangedAP(spellProto) ? RANGED_ATTACK : BASE_ATTACK) + ap_benefit));
}
}
// Default calculation