diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-08-24 16:03:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-24 16:03:22 +0200 |
commit | c356e0af255e6947db7bed3d212aa42779b648c2 (patch) | |
tree | acb12c10a68c7ac2479bc59c98b101cc77204f77 | |
parent | b0de792bb8b904bf59bebc45aa3cf6ba6672b032 (diff) |
Scripts/Spells: Implement hunter talent Penetrating Shots (#30784)
-rw-r--r-- | sql/updates/world/master/2025_08_24_01_world.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 26 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_08_24_01_world.sql b/sql/updates/world/master/2025_08_24_01_world.sql new file mode 100644 index 00000000000..a9574a3dc06 --- /dev/null +++ b/sql/updates/world/master/2025_08_24_01_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_penetrating_shots'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(459783,'spell_hun_penetrating_shots'); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 1c547c9a16b..b223d884365 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -693,6 +693,31 @@ class spell_hun_multi_shot : public SpellScript } }; +// 459783 - Penetrating Shots +class spell_hun_penetrating_shots : public AuraScript +{ + void CalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool const& /*canBeRecalculated*/) const + { + if (AuraEffect const* amountHolder = GetEffect(EFFECT_1)) + { + float critChanceDone = GetUnitOwner()->GetUnitCriticalChanceDone(BASE_ATTACK); + amount = CalculatePct(critChanceDone, amountHolder->GetAmount()); + } + } + + void UpdatePeriodic(AuraEffect const* aurEff) const + { + if (AuraEffect* bonus = GetEffect(EFFECT_0)) + bonus->RecalculateAmount(aurEff); + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_penetrating_shots::CalcAmount, EFFECT_0, SPELL_AURA_MOD_CRIT_DAMAGE_BONUS); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_penetrating_shots::UpdatePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); + } +}; + // 55709 - Pet Heart of the Phoenix class spell_hun_pet_heart_of_the_phoenix : public SpellScript { @@ -1270,6 +1295,7 @@ void AddSC_hunter_spell_scripts() RegisterSpellScript(spell_hun_misdirection); RegisterSpellScript(spell_hun_misdirection_proc); RegisterSpellScript(spell_hun_multi_shot); + RegisterSpellScript(spell_hun_penetrating_shots); RegisterSpellScript(spell_hun_pet_heart_of_the_phoenix); RegisterSpellScript(spell_hun_posthaste); RegisterSpellScript(spell_hun_precise_shots); |