*Add new column to spell_bonus_data table to store ap bonus for periodic auras.

*Use -1 to mark entries, for which default spell bonus calculation should be used.
*Move periodic auras ap bonuses from core to db.
*Add coefficient for Black Arrow.

--HG--
branch : trunk
This commit is contained in:
QAston committed 2009-07-18 22:18:47 +02:00
1 parent 91c309387a
commit bc4d862263
7 files changed
+528 -377

No files matched your search

+24 -8
View File
@@ -9318,21 +9318,29 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
DoneAdvertisedBenefit += ((Guardian*)this)->GetBonusDamage();
// Check for table values
float coeff;
float coeff = 0;
SpellBonusEntry const* bonus = spellmgr.GetSpellBonusData(spellProto->Id);
if (bonus)
{
if (damagetype == DOT)
{
coeff = bonus->dot_damage;
if (bonus->ap_dot_bonus > 0)
DoneTotal+=bonus->ap_dot_bonus * stack * ApCoeffMod *
GetTotalAttackPowerValue(IsRangedWeaponSpell(spellProto) ? RANGED_ATTACK: BASE_ATTACK);
}
else
{
coeff = bonus->direct_damage;
if (bonus->ap_bonus)
DoneTotal+=bonus->ap_bonus * GetTotalAttackPowerValue(BASE_ATTACK) * stack * ApCoeffMod;
if (bonus->ap_bonus > 0)
DoneTotal+=bonus->ap_bonus * stack * ApCoeffMod *
GetTotalAttackPowerValue(IsRangedWeaponSpell(spellProto) ? RANGED_ATTACK: BASE_ATTACK);
}
}
// Default calculation
if (DoneAdvertisedBenefit || TakenAdvertisedBenefit)
{
if(!bonus)
if(!bonus || coeff < 0)
{
// Damage Done from spell damage bonus
int32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto);
@@ -9785,16 +9793,24 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
// Check for table values
SpellBonusEntry const* bonus = !scripted ? spellmgr.GetSpellBonusData(spellProto->Id) : NULL;
float coeff;
float coeff = 0;
float factorMod = 1.0f;
if (bonus)
{
if (damagetype == DOT)
{
coeff = bonus->dot_damage;
if (bonus->ap_dot_bonus > 0)
DoneTotal+=bonus->ap_dot_bonus * stack *
GetTotalAttackPowerValue(IsRangedWeaponSpell(spellProto) ? RANGED_ATTACK: BASE_ATTACK);
}
else
{
coeff = bonus->direct_damage;
if (bonus->ap_bonus)
DoneTotal+=bonus->ap_bonus * GetTotalAttackPowerValue(BASE_ATTACK) * stack;
if (bonus->ap_bonus > 0)
DoneTotal+=bonus->ap_bonus * stack *
GetTotalAttackPowerValue(IsRangedWeaponSpell(spellProto) ? RANGED_ATTACK: BASE_ATTACK);
}
}
else // scripted bonus
{
@@ -9828,7 +9844,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
// Default calculation
if (DoneAdvertisedBenefit || TakenAdvertisedBenefit)
{
if(!bonus && !scripted)
if((!bonus && !scripted) || coeff < 0)
{
// Damage Done from spell damage bonus
int32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto);