Core/Auras: Properly fix SPELL_AURA_DAMAGE_SHIELD

This commit is contained in:
tobmaps committed 2011-05-13 19:43:32 +07:00
1 parent 7fac55db66
commit 2d6912cd2e
4 files changed
+30 -4

No files matched your search

+2
View File
@@ -16901,6 +16901,7 @@ INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`a
(2912, 1, -1, -1, -1, 'Druid - Starfire'),
(18562, 0, 0, 0, 0, 'Druid - Swiftmend'),
(779, -1, -1, 0.063, -1, 'Druid - Swipe (Bear)'),
(467, 0.033, -1, -1, -1, 'Druid - Thorns'),
(44203, 0.538, -1, -1, -1, 'Druid - Tranquility Triggered'),
(61391, 0.193, -1, -1, -1, 'Druid - Typhoon'),
(48438, -1, 0.11505, -1, -1, 'Druid - Wild Growth'),
@@ -16973,6 +16974,7 @@ INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`a
(53725, 0.0833, -1, 0.0533, -1, 'Paladin - Judgement of the Martyr Self'),
(31804, 0.22, 0, 0.14, 0, 'Paladin - Judgement of Vengeance'),
(54158, 0.25, 0, 0.16, 0, 'Paladin - Judgement (Seal of Light, Seal of Wisdom, Seal of Justice)'),
(7294, 0.033, -1, -1, -1, 'Paladin - Retribution Aura'),
(58597, 0.75, -1, -1, -1, 'Paladin - Sacred Shield'),
(53601, 0.75, -1, -1, -1, 'Paladin - Sacred Shield'),
(31893, 0, 0, 0, 0, 'Paladin - Seal of Blood Proc Enemy'),
@@ -0,0 +1,4 @@
DELETE FROM `spell_bonus_data` WHERE `entry` IN (467,7294);
INSERT INTO `spell_bonus_data` VALUES
(467,0.033,-1,-1,-1,'Druid - Thorns'),
(7294,0.033,-1,-1,-1,'Paladin - Retribution Aura');
+10
View File
@@ -1456,6 +1456,16 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
uint32 damage = (*dmgShieldItr)->GetAmount();
int32 bonus = 0;
bonus += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, GetSpellSchoolMask(i_spellProto));
if (Unit * caster = (*dmgShieldItr)->GetCaster())
{
bonus += caster->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, GetSpellSchoolMask(i_spellProto));
bonus += caster->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS, GetCreatureTypeMask());
}
if (bonus)
AddPctN(damage, bonus);
// No Unit::CalcAbsorbResist here - opcode doesn't send that data - this damage is probably not affected by that
pVictim->DealDamageMods(this, damage, NULL);
@@ -597,10 +597,20 @@ int32 AuraEffect::CalculateAmount(Unit * caster)
case SPELL_AURA_DAMAGE_SHIELD:
if (!caster)
break;
// Thorns
if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags[0] & 0x100)
// 3.3% from sp bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.033f;
if (caster->GetTypeId() == TYPEID_PLAYER)
{
DoneActualBenefit += caster->SpellDamageBonus(GetBase()->GetUnitOwner(), GetSpellProto(), 0, SPELL_DIRECT_DAMAGE);
DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());
amount += (int32)DoneActualBenefit;
// Thorns
if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags[0] & 0x100)
if (AuraEffect * aurEff = caster->GetAuraEffectOfRankedSpell(16836, 0))
AddPctN(amount, aurEff->GetAmount());
return amount;
}
break;
case SPELL_AURA_PERIODIC_DAMAGE:
if (!caster)