Core/Spells: Fix Pain and Suffering reduces damage

This commit is contained in:
Vincent-Michael
2012-07-10 22:27:29 +02:00
parent 450f9e7d99
commit 968a8e8ee8
4 changed files with 40 additions and 29 deletions

View File

@@ -463,20 +463,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
}
case SPELLFAMILY_PRIEST:
{
// Shadow Word: Death - deals damage equal to damage done to caster
if (m_spellInfo->SpellFamilyFlags[1] & 0x2)
{
int32 back_damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE);
back_damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, (uint32)back_damage, SPELL_DIRECT_DAMAGE);
// Pain and Suffering reduces damage
if (AuraEffect* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2874, 0))
AddPctN(back_damage, -aurEff->GetAmount());
if (back_damage < int32(unitTarget->GetHealth()))
m_caster->CastCustomSpell(m_caster, 32409, &back_damage, 0, 0, true);
}
// Improved Mind Blast (Mind Blast in shadow form bonus)
else if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (m_spellInfo->SpellFamilyFlags[0] & 0x00002000))
if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (m_spellInfo->SpellFamilyFlags[0] & 0x00002000))
{
Unit::AuraEffectList const& ImprMindBlast = m_caster->GetAuraEffectsByType(SPELL_AURA_ADD_FLAT_MODIFIER);
for (Unit::AuraEffectList::const_iterator i = ImprMindBlast.begin(); i != ImprMindBlast.end(); ++i)