From b085ee61ebfcc85505bab405e15b059943425678 Mon Sep 17 00:00:00 2001 From: acidmanifesto Date: Fri, 28 Jan 2022 11:14:21 -0500 Subject: [PATCH] fix (core): EffectInstaKill Prevents spell animation fix (#10379) * fix (core): EffectInstaKill Prevents spell animation before deal damage execution This fixes the issue of spell animations of chain effects of a spell dealing with EffectInstaKill. This was identified as a issue in support of @malcrom 's current scripting efforts. We fix the issue by putting a half second delay and making the delay of a function possible and independent. Co-Authored-By: Malcrom * Fix double to float Co-Authored-By: Malcrom * Remove the STD I put the STD in STUD and all I need is U * Update src/server/game/Spells/SpellEffects.cpp per @kitzunu the great Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * Update src/server/game/Spells/SpellEffects.cpp per @nefertumm the beast Co-authored-by: Nefertumm * Update src/server/game/Spells/SpellEffects.cpp Co-authored-by: Kargatum * Update src/server/game/Spells/SpellEffects.cpp Co-authored-by: Kargatum * Update src/server/game/Spells/SpellEffects.cpp Co-authored-by: Kargatum * Update src/server/game/Spells/SpellEffects.cpp Co-authored-by: Kargatum * Update src/server/game/Spells/SpellEffects.cpp Co-authored-by: Kargatum * Notes Added Co-authored-by: Malcrom Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Co-authored-by: Nefertumm Co-authored-by: Kargatum --- src/server/game/Spells/SpellEffects.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 24629c8a8..57e6eb768 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -293,6 +293,9 @@ void Spell::EffectInstaKill(SpellEffIndex /*effIndex*/) data << unitTarget->GetGUID(); data << uint32(m_spellInfo->Id); m_caster->SendMessageToSet(&data, true); + // MDic - acidmanifesto: This is needed due to the Unit::DealDamage firing off immediately after the worldpacket which nerfs out additional spell animations + // The delay of half a second ensures the spell animations which are typically 0.4 seconds long have enough time to fire off + std::this_thread::sleep_for(500ms); Unit::DealDamage(m_caster, unitTarget, unitTarget->GetHealth(), nullptr, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); }