fix(Core/Spells): Improved Drain Soul triggering from every target … (#8144)

...that dies and not just the one affected by Drain Soul and move the Drain Soul code to spell scripts

- TC Ports: d9743c984f (diff-ea612aafadff90005e88b243eb000369be9e5cb6f8dc85a008d31e42b156e0ec) and  2b1b36f561 (diff-ea612aafadff90005e88b243eb000369be9e5cb6f8dc85a008d31e42b156e0ec)
This commit is contained in:
Skjalf
2021-10-07 13:58:46 -03:00
committed by GitHub
parent d0ff62a1ab
commit 99cc428511
4 changed files with 100 additions and 56 deletions

View File

@@ -8409,28 +8409,8 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
break;
case SPELLFAMILY_WARLOCK:
{
// Drain Soul
if (auraSpellInfo->SpellFamilyFlags[0] & 0x4000)
{
// Improved Drain Soul
Unit::AuraEffectList const& mAddFlatModifier = GetAuraEffectsByType(SPELL_AURA_DUMMY);
for (Unit::AuraEffectList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i)
{
if ((*i)->GetMiscValue() == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellInfo()->SpellIconID == 113)
{
int32 value2 = CalculateSpellDamage(this, (*i)->GetSpellInfo(), 2);
basepoints0 = int32(CalculatePct(GetMaxPower(POWER_MANA), value2));
// Drain Soul
CastCustomSpell(this, 18371, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura);
break;
}
}
// Not remove charge (aura removed on death in any cases)
// Need for correct work Drain Soul SPELL_AURA_CHANNEL_DEATH_ITEM aura
return false;
}
// Nether Protection
else if (auraSpellInfo->SpellIconID == 1985)
if (auraSpellInfo->SpellIconID == 1985)
{
if (!procSpell)
return false;