fix(Core/Spells): Fix Cold Blood not consumed when Mutilate kills target (#24909)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
Co-authored-by: ariel- <ariel-@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-02-28 08:14:25 -06:00
committed by GitHub
parent 0b952192c1
commit 7b89dac055
4 changed files with 77 additions and 13 deletions

View File

@@ -0,0 +1,11 @@
-- Cold Blood: Bind AuraScript to prevent charge consumption on Mutilate MH/OH,
-- so both sub-spells get the guaranteed crit.
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_rog_cold_blood';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(14177, 'spell_rog_cold_blood');
-- Mutilate (parent): remove Cold Blood in AfterCast after both sub-spells
-- have executed their crit rolls. Negative spell_id covers all ranks.
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_rog_mutilate', 'spell_rog_mutilate_strike');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(-1329, 'spell_rog_mutilate');

View File

@@ -9990,14 +9990,6 @@ void Player::RemoveSpellMods(Spell* spell)
if (roll_chance_i(aurEff->GetAmount()))
continue; // don't consume charge
}
// ROGUE MUTILATE WITH COLD BLOOD
if (spellInfo->Id == 5374)
{
SpellInfo const* sp = mod->ownerAura->GetSpellInfo();
if (sp->Id == 14177) // Cold Blood
continue; // don't consume charge
}
if (mod->ownerAura->DropCharge(AURA_REMOVE_BY_EXPIRE))
itr = m_spellMods[i].begin();
}

View File

@@ -4472,10 +4472,6 @@ void Spell::finish(bool ok)
if (m_spellInfo->IsCooldownStartedOnEvent())
m_caster->ToPlayer()->SendCooldownEvent(m_spellInfo, 0, 0, false);
// Rogue fix: Remove Cold Blood if Mutilate off-hand failed
if (m_spellInfo->Id == 27576) // Mutilate, off-hand
if (m_caster->HasAura(14177))
m_caster->RemoveAura(14177);
}
return;
}

View File

@@ -53,7 +53,8 @@ enum RogueSpells
SPELL_ROGUE_TURN_THE_TABLES_R3 = 52915,
SPELL_ROGUE_OVERKILL_TRIGGERED = 58427,
SPELL_ROGUE_HONOR_AMONG_THIEVES_PROC = 52916,
SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED = 51699
SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED = 51699,
SPELL_ROGUE_COLD_BLOOD = 14177
};
enum RogueSpellIcons
@@ -1086,6 +1087,68 @@ class spell_rog_focused_attacks : public AuraScript
}
};
// 14177 - Cold Blood
class spell_rog_cold_blood : public AuraScript
{
PrepareAuraScript(spell_rog_cold_blood);
bool _usedByMutilate = false;
public:
bool WasUsedByMutilate() const { return _usedByMutilate; }
bool CheckProc(ProcEventInfo& eventInfo)
{
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo)
return true;
// Block Mutilate MH (0x2) and OH (0x4) from consuming the charge
if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE
&& (spellInfo->SpellFamilyFlags[1] & 0x6))
{
_usedByMutilate = true;
return false;
}
return true;
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_rog_cold_blood::CheckProc);
}
};
// 1329 - Mutilate (parent spell, all ranks)
class spell_rog_mutilate : public SpellScript
{
PrepareSpellScript(spell_rog_mutilate);
void HandleAfterCast()
{
Unit* caster = GetCaster();
if (!caster)
return;
Aura* cb = caster->GetAura(SPELL_ROGUE_COLD_BLOOD);
if (!cb)
return;
auto* script = dynamic_cast<spell_rog_cold_blood*>(
cb->GetScriptByName("spell_rog_cold_blood"));
if (!script || !script->WasUsedByMutilate())
return;
cb->Remove();
}
void Register() override
{
AfterCast += SpellCastFn(spell_rog_mutilate::HandleAfterCast);
}
};
void AddSC_rogue_spell_scripts()
{
RegisterSpellScript(spell_rog_savage_combat);
@@ -1117,4 +1180,6 @@ void AddSC_rogue_spell_scripts()
RegisterSpellScript(spell_rog_turn_the_tables);
RegisterSpellScript(spell_rog_turn_the_tables_proc);
RegisterSpellScript(spell_rog_focused_attacks);
RegisterSpellScript(spell_rog_mutilate);
RegisterSpellScript(spell_rog_cold_blood);
}