Fixed Drain Soul increased damage for targets below 25% HP. Closes issue #394. Closes issue #748. Closes issue #938. Rejoice, new era of server-side spells has begun!

--HG--
branch : trunk
This commit is contained in:
Xanadu
2010-03-17 16:38:31 +01:00
parent 4fb7bf3664
commit e5cbe017f4
5 changed files with 33 additions and 21 deletions
-17
View File
@@ -845,23 +845,6 @@ void AuraEffect::CalculateSpellMod()
m_spellmod->value = GetBase()->GetUnitOwner()->CalculateSpellDamage(GetSpellProto(), 1, GetSpellProto()->EffectBasePoints[1], GetBase()->GetUnitOwner());
break;
}
// Drain Soul - If the target is at or below 25% health, Drain Soul causes four times the normal damage
if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && GetSpellProto()->SpellFamilyFlags[0] & 0x00004000)
{
if (!m_spellmod)
{
m_spellmod = new SpellModifier(GetBase());
m_spellmod->op = SPELLMOD_DOT;
m_spellmod->type = SPELLMOD_PCT;
m_spellmod->spellId = GetId();
m_spellmod->mask[0] = 0x00004000;
// 300% more dmg
if (GetBase()->GetUnitOwner()->GetMaxHealth() / 4 > GetBase()->GetUnitOwner()->GetHealth())
m_spellmod->value = 300;
else
m_spellmod->value = 0;
}
}
break;
case SPELL_AURA_ADD_FLAT_MODIFIER:
case SPELL_AURA_ADD_PCT_MODIFIER:
+20
View File
@@ -1411,6 +1411,26 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
}
}
break;
case SPELLFAMILY_WARLOCK:
// Drain Soul - If the target is at or below 25% health, Drain Soul causes four times the normal damage
if (GetSpellProto()->SpellFamilyFlags[0] & 0x00004000)
{
if (!target)
break;
if (apply)
{
if (target != caster && target->GetHealth() <= target->GetMaxHealth() / 4)
caster->CastSpell(caster, 200000, true);
}
else
{
if (target != caster)
caster->RemoveAurasDueToSpell(GetId());
else
caster->RemoveAurasDueToSpell(200000);
}
}
break;
}
}
+4
View File
@@ -9965,6 +9965,10 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
break;
}
}
// Drain Soul - increased damage for targets under 25 % HP
if (spellProto->SpellFamilyFlags[0] & 0x00004000)
if (HasAura(200000))
DoneTotalMod *= 4;
break;
case SPELLFAMILY_DEATHKNIGHT:
// Improved Icy Touch