aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2024-12-30 18:42:32 +0100
committerGitHub <noreply@github.com>2024-12-30 18:42:32 +0100
commitba10eb589a22e804fb4324e22a8ce81a06127c95 (patch)
tree7a72e08566273f4fe18cde963219deeebd6d3634
parentd38941c19b51514fc16c52ca400b358555c13b38 (diff)
Scripts/Spells: Implement demon hunter talent "Calcified Spikes" (#30545)
-rw-r--r--sql/updates/world/master/2024_12_30_00_world.sql4
-rw-r--r--src/server/scripts/Spells/spell_dh.cpp52
2 files changed, 56 insertions, 0 deletions
diff --git a/sql/updates/world/master/2024_12_30_00_world.sql b/sql/updates/world/master/2024_12_30_00_world.sql
new file mode 100644
index 00000000000..b455cecf3f2
--- /dev/null
+++ b/sql/updates/world/master/2024_12_30_00_world.sql
@@ -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');
diff --git a/src/server/scripts/Spells/spell_dh.cpp b/src/server/scripts/Spells/spell_dh.cpp
index adfa2b7ab10..62c129622c4 100644
--- a/src/server/scripts/Spells/spell_dh.cpp
+++ b/src/server/scripts/Spells/spell_dh.cpp
@@ -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);