Scripts/Spells: Implement demon hunter talent "Calcified Spikes" (#30545)

This commit is contained in:
Aqua Deus
2024-12-30 18:42:32 +01:00
committed by GitHub
parent d38941c19b
commit ba10eb589a
2 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_dh_calcified_spikes', 'spell_dh_calcified_spikes_periodic');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(203819, 'spell_dh_calcified_spikes'),
(391171, 'spell_dh_calcified_spikes_periodic');

View File

@@ -52,6 +52,8 @@ enum DemonHunterSpells
SPELL_DH_BLUR_TRIGGER = 198589,
SPELL_DH_BURNING_ALIVE = 207739,
SPELL_DH_BURNING_ALIVE_TARGET_SELECTOR = 207760,
SPELL_DH_CALCIFIED_SPIKES_TALENT = 389720,
SPELL_DH_CALCIFIED_SPIKES_MOD_DAMAGE = 391171,
SPELL_DH_CHAOS_NOVA = 179057,
SPELL_DH_CHAOS_STRIKE = 162794,
SPELL_DH_CHAOS_STRIKE_ENERGIZE = 193840,
@@ -198,6 +200,54 @@ enum DemonHunterSpellCategories
SPELL_CATEGORY_DH_BLADE_DANCE = 1640
};
// Called by 203819 - Demon Spikes
class spell_dh_calcified_spikes : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DH_CALCIFIED_SPIKES_TALENT, SPELL_DH_CALCIFIED_SPIKES_MOD_DAMAGE });
}
bool Load() override
{
return GetUnitOwner()->HasAura(SPELL_DH_CALCIFIED_SPIKES_TALENT);
}
void HandleAfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
{
Unit* target = GetTarget();
target->CastSpell(target, SPELL_DH_CALCIFIED_SPIKES_MOD_DAMAGE, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
.TriggeringAura = aurEff
});
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_dh_calcified_spikes::HandleAfterRemove, EFFECT_1, SPELL_AURA_MOD_ARMOR_PCT_FROM_STAT, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
// 391171 - Calcified Spikes
class spell_dh_calcified_spikes_periodic : public AuraScript
{
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
}
void HandlePeriodic(AuraEffect const* /*aurEff*/) const
{
if (AuraEffect* damagePctTaken = GetEffect(EFFECT_0))
damagePctTaken->ChangeAmount(damagePctTaken->GetAmount() + 1);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dh_calcified_spikes_periodic::HandlePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
// 197125 - Chaos Strike
class spell_dh_chaos_strike : public AuraScript
{
@@ -1121,6 +1171,8 @@ class spell_dh_vengeful_retreat_damage : public SpellScript
void AddSC_demon_hunter_spell_scripts()
{
RegisterSpellScript(spell_dh_calcified_spikes);
RegisterSpellScript(spell_dh_calcified_spikes_periodic);
RegisterSpellScript(spell_dh_chaos_strike);
RegisterSpellScript(spell_dh_chaotic_transformation);
RegisterSpellScript(spell_dh_charred_warblades);