Core/Spells: Drain Soul will no longer generate Soul Shards during channeling

* fixed the damage bonus when Drain Soul is used on a target below 25% health
This commit is contained in:
Ovahlord
2019-01-19 12:38:10 +01:00
parent dfe94827c0
commit 54382d7926
3 changed files with 35 additions and 44 deletions

View File

@@ -6921,11 +6921,6 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
if (spellProto->SpellFamilyFlags[1] & 0x00400000 && IsPet())
if (uint8 count = victim->GetDoTsByCaster(GetOwnerGUID()))
AddPct(DoneTotalMod, 30 * count);
// Drain Soul - increased damage for targets under 25 % HP
if (spellProto->SpellFamilyFlags[0] & 0x00004000)
if (HasAura(100001))
DoneTotalMod *= 2;
break;
case SPELLFAMILY_DEATHKNIGHT:
// Sigil of the Vengeful Heart

View File

@@ -5568,32 +5568,42 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
damage = damageReductedArmor;
}
// Curse of Agony damage-per-tick calculation
if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x400) && GetSpellInfo()->SpellIconID == 544)
switch (GetSpellInfo()->SpellFamilyName)
{
uint32 totalTick = GetTotalTicks();
// 1..4 ticks, 1/2 from normal tick damage
if (m_tickNumber <= totalTick / 3)
damage = damage/2;
// 9..12 ticks, 3/2 from normal tick damage
else if (m_tickNumber > totalTick * 2 / 3)
damage += (damage+1)/2; // +1 prevent 0.5 damage possible lost at 1..4 ticks
// 5..8 ticks have normal tick damage
}
case SPELLFAMILY_GENERIC:
switch (GetId())
{
case 70911: // Unbound Plague
case 72854: // Unbound Plague
case 72855: // Unbound Plague
case 72856: // Unbound Plague
damage *= uint32(pow(1.25f, int32(m_tickNumber)));
break;
default:
break;
}
break;
case SPELLFAMILY_WARLOCK:
// Curse of Agony
if ((GetSpellInfo()->SpellFamilyFlags[0] & 0x400) && GetSpellInfo()->SpellIconID == 544)
{
uint32 totalTick = GetTotalTicks();
// 1..4 ticks, 1/2 from normal tick damage
if (m_tickNumber <= totalTick / 3)
damage = damage / 2;
// 9..12 ticks, 3/2 from normal tick damage
else if (m_tickNumber > totalTick * 2 / 3)
damage += (damage + 1) / 2; // +1 prevent 0.5 damage possible lost at 1..4 ticks
// 5..8 ticks have normal tick damage
}
if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC)
{
switch (GetId())
{
case 70911: // Unbound Plague
case 72854: // Unbound Plague
case 72855: // Unbound Plague
case 72856: // Unbound Plague
damage *= uint32(pow(1.25f, int32(m_tickNumber)));
break;
default:
break;
}
// Drain Soul
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000)
if (target->GetHealthPct() <= 25.0f)
AddPct(damage, 25);
break;
default:
break;
}
}
else // ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner

View File

@@ -1569,20 +1569,7 @@ class spell_warl_drain_soul : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/)
{
return ValidateSpellInfo(
{
SPELL_WARLOCK_SOUL_SHARD,
SPELL_WARLOCK_SOUL_SHARD_ENERGIZE
});
}
void HandlePeriodic(AuraEffect const* aurEff)
{
if (!roll_chance_i(GetSpellInfo()->Effects[EFFECT_1].BasePoints))
return;
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_WARLOCK_SOUL_SHARD, true, 0, aurEff);
return ValidateSpellInfo({ SPELL_WARLOCK_SOUL_SHARD_ENERGIZE });
}
void OnAuraRemoveHandler(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
@@ -1595,7 +1582,6 @@ class spell_warl_drain_soul : public SpellScriptLoader
void Register()
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_drain_soul_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
AfterEffectRemove += AuraEffectRemoveFn(spell_warl_drain_soul_AuraScript::OnAuraRemoveHandler, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};