diff --git a/data/sql/updates/pending_db_world/rev_1772155523505295022.sql b/data/sql/updates/pending_db_world/rev_1772155523505295022.sql new file mode 100644 index 000000000..92c75cf72 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1772155523505295022.sql @@ -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'); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 532263828..3feda5d89 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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(); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9a1c2dc5e..6202acbb3 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -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; } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index a234dbb5d..8a0cc51cd 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -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( + 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); }