diff --git a/sql/updates/world/master/2024_10_24_02_world.sql b/sql/updates/world/master/2024_10_24_02_world.sql new file mode 100644 index 0000000000000..fc8c7c447cd0d --- /dev/null +++ b/sql/updates/world/master/2024_10_24_02_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=213010 AND `ScriptName`='spell_dh_charred_warblades'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(213010, 'spell_dh_charred_warblades'); diff --git a/src/server/scripts/Spells/spell_dh.cpp b/src/server/scripts/Spells/spell_dh.cpp index 16c6385e8b7d6..bd6dab20f36b5 100644 --- a/src/server/scripts/Spells/spell_dh.cpp +++ b/src/server/scripts/Spells/spell_dh.cpp @@ -55,6 +55,7 @@ enum DemonHunterSpells SPELL_DH_CHAOS_STRIKE_ENERGIZE = 193840, SPELL_DH_CHAOS_STRIKE_MH = 222031, SPELL_DH_CHAOS_STRIKE_OH = 199547, + SPELL_DH_CHARRED_WARBLADES_HEAL = 213011, SPELL_DH_CONSUME_SOUL_HAVOC = 228542, SPELL_DH_CONSUME_SOUL_HAVOC_DEMON = 228556, SPELL_DH_CONSUME_SOUL_HAVOC_SHATTERED = 228540, @@ -195,6 +196,48 @@ class spell_dh_chaos_strike : public AuraScript } }; +// 213010 - Charred Warblades +class spell_dh_charred_warblades : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DH_CHARRED_WARBLADES_HEAL }); + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetDamageInfo() && eventInfo.GetDamageInfo()->GetSchoolMask() & SPELL_SCHOOL_MASK_FIRE; + } + + void HandleAfterProc(ProcEventInfo& eventInfo) + { + _healAmount += CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), GetEffect(EFFECT_0)->GetAmount()); + } + + void HandleDummyTick(AuraEffect const* aurEff) + { + if (_healAmount == 0) + return; + + GetTarget()->CastSpell(GetTarget(), SPELL_DH_CHARRED_WARBLADES_HEAL, + CastSpellExtraArgs(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR) + .SetTriggeringAura(aurEff) + .AddSpellBP0(_healAmount)); + + _healAmount = 0; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_dh_charred_warblades::CheckProc); + AfterProc += AuraProcFn(spell_dh_charred_warblades::HandleAfterProc); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_dh_charred_warblades::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + +private: + uint32 _healAmount = 0; +}; + // 206416 - First Blood class spell_dh_first_blood : public AuraScript { @@ -479,6 +522,7 @@ class spell_dh_soul_furnace_conduit : public AuraScript void AddSC_demon_hunter_spell_scripts() { RegisterSpellScript(spell_dh_chaos_strike); + RegisterSpellScript(spell_dh_charred_warblades); new areatrigger_dh_generic_sigil("areatrigger_dh_sigil_of_silence"); new areatrigger_dh_generic_sigil("areatrigger_dh_sigil_of_misery");