aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXanadu <none@none>2010-03-17 16:38:31 +0100
committerXanadu <none@none>2010-03-17 16:38:31 +0100
commite5cbe017f402a8e0f6feccdad42a11ff5ce06361 (patch)
tree803692493038ab0b07f3a854b9560ef5af05dbea /src
parent4fb7bf3664cfd036b7847bafeeaab5f939a50959 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellAuraEffects.cpp17
-rw-r--r--src/game/SpellAuras.cpp20
-rw-r--r--src/game/Unit.cpp4
3 files changed, 24 insertions, 17 deletions
diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp
index fbd0289103d..4042f5f8af4 100644
--- a/src/game/SpellAuraEffects.cpp
+++ b/src/game/SpellAuraEffects.cpp
@@ -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:
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 55512e51ce7..3754043c572 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -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;
}
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index edbeaf4c9ec..ee18c90e468 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -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