Scripts/Spells: Implement demon hunter talent "Cycle of hatred"

This commit is contained in:
aquadeus
2024-12-22 14:05:21 +01:00
committed by Shauren
parent 92efc2523b
commit 2997e1dc02
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dh_cycle_of_hatred';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(188499, 'spell_dh_cycle_of_hatred'),
(162794, 'spell_dh_cycle_of_hatred'),
(342817, 'spell_dh_cycle_of_hatred');

View File

@@ -69,6 +69,7 @@ enum DemonHunterSpells
SPELL_DH_CONSUME_SOUL_VENGEANCE = 208014,
SPELL_DH_CONSUME_SOUL_VENGEANCE_DEMON = 210050,
SPELL_DH_CONSUME_SOUL_VENGEANCE_SHATTERED = 210047,
SPELL_DH_CYCLE_OF_HATRED = 258887,
SPELL_DH_DARKGLARE_BOON = 389708,
SPELL_DH_DARKGLARE_BOON_ENERGIZE = 391345,
SPELL_DH_DARKNESS_ABSORB = 209426,
@@ -350,6 +351,31 @@ class spell_dh_collective_anguish_eye_beam : public AuraScript
}
};
// Called by 188499 - Blade Dance, 162794 - Chaos Strike and 342817 - Glaive Tempest
class spell_dh_cycle_of_hatred : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DH_CYCLE_OF_HATRED });
}
bool Load() override
{
return GetCaster()->HasAura(SPELL_DH_CYCLE_OF_HATRED);
}
void ReduceEyeBeamCooldown() const
{
if (AuraEffect const* aurEff = GetCaster()->GetAuraEffect(SPELL_DH_CYCLE_OF_HATRED, EFFECT_0))
GetCaster()->GetSpellHistory()->ModifyCooldown(SPELL_DH_EYE_BEAM, Milliseconds(-aurEff->GetAmount()));
}
void Register() override
{
AfterCast += SpellCastFn(spell_dh_cycle_of_hatred::ReduceEyeBeamCooldown);
}
};
// Called by 212084 - Fel Devastation
class spell_dh_darkglare_boon : public AuraScript
{
@@ -967,6 +993,7 @@ void AddSC_demon_hunter_spell_scripts()
RegisterSpellScript(spell_dh_charred_warblades);
RegisterSpellScript(spell_dh_collective_anguish);
RegisterSpellScript(spell_dh_collective_anguish_eye_beam);
RegisterSpellScript(spell_dh_cycle_of_hatred);
RegisterSpellScript(spell_dh_darkglare_boon);
RegisterSpellScript(spell_dh_darkness);
RegisterSpellScript(spell_dh_eye_beam);