Skip to content

Commit

Permalink
Scripts/Spells: Implemented Demon Hunter talent "Charred Warblades" (T…
Browse files Browse the repository at this point in the history
  • Loading branch information
aquadeus authored Oct 24, 2024
1 parent 4cd8531 commit 831e102
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sql/updates/world/master/2024_10_24_02_world.sql
Original file line number Diff line number Diff line change
@@ -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');
44 changes: 44 additions & 0 deletions src/server/scripts/Spells/spell_dh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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<SPELL_DH_SIGIL_OF_SILENCE_AOE>("areatrigger_dh_sigil_of_silence");
new areatrigger_dh_generic_sigil<SPELL_DH_SIGIL_OF_MISERY_AOE>("areatrigger_dh_sigil_of_misery");
Expand Down

0 comments on commit 831e102

Please sign in to comment.