From 0b95406ba18f5eedfa98d0370c8d1df86a65ed01 Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 5 Oct 2026 11:25:37 -0300 Subject: [PATCH] Scripts/Spells: Implement hunter talent Bleak Powder --- src/server/game/Spells/SpellMgr.cpp | 6 ++ src/server/scripts/Spells/spell_hunter.cpp | 66 +++++++++++++++++++++- 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index bc84d44e2..19de0fedf 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -5786,6 +5786,12 @@ void SpellMgr::LoadSpellInfoTargetCaps() spellInfo->_LoadSqrtTargetLimit(8, 0, 1261193, EFFECT_1, {}, {}); }); + // Bleak Powder + ApplySpellFix({ 467914, 472084 }, [](SpellInfo* spellInfo) + { + spellInfo->_LoadSqrtTargetLimit(8, 0, 467911, EFFECT_1, {}, {}); + }); + // Starfire ApplySpellFix({ 194153 }, [](SpellInfo* spellInfo) { diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 5330913ac..6a3881a27 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -169,6 +169,9 @@ enum HunterSpells SPELL_HUNTER_WILDSPEAKER_RAGE = 1235388, SPELL_HUNTER_AUTO_SHOT = 75, SPELL_HUNTER_FOCUSED_AIM = 378767, + SPELL_HUNTER_BLEAK_POWDER_AREATRIGGER = 467912, + SPELL_HUNTER_BLEAK_POWDER_DAMAGE_MARKSMANSHIP = 467914, + SPELL_HUNTER_BLEAK_POWDER_DAMAGE_BEAST_MASTERY = 472084, }; // 131894 - A Murder of Crows @@ -2820,7 +2823,7 @@ class spell_hun_focused_aim : public AuraScript return ValidateSpellInfo({ SPELL_HUNTER_FOCUSED_AIM }); } - void HandleProc(ProcEventInfo const& eventInfo) const + static void HandleProc(AuraScript const&, ProcEventInfo const& eventInfo) { if (AuraEffect const* focusedAim = eventInfo.GetActor()->GetAuraEffect(SPELL_HUNTER_FOCUSED_AIM, EFFECT_0)) eventInfo.GetActor()->GetSpellHistory()->ModifyCooldown(SPELL_HUNTER_AIMED_SHOT, -Milliseconds(focusedAim->GetAmountAsInt())); @@ -2832,6 +2835,64 @@ class spell_hun_focused_aim : public AuraScript } }; +// 467911 - Bleak Powder +class spell_hun_bleak_powder : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HUNTER_BLEAK_POWDER_AREATRIGGER }); + } + + static void HandleProc(AuraScript const&, ProcEventInfo const& eventInfo) + { + eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), SPELL_HUNTER_BLEAK_POWDER_AREATRIGGER, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + + void Register() override + { + OnProc += AuraProcFn(spell_hun_bleak_powder::HandleProc); + } +}; + +// 467912 - Bleak Powder +class spell_hun_bleak_powder_areatrigger_summon : public SpellScript +{ + void UpdateOrientation(SpellDestination& target) const + { + Position pos = target._position; + pos.SetOrientation(GetCaster()->GetAbsoluteAngle(pos)); + target.Relocate(pos); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_hun_bleak_powder_areatrigger_summon::UpdateOrientation, EFFECT_0, TARGET_DEST_TARGET_ENEMY); + } +}; + +// 467912 - Bleak Powder +struct at_hun_bleak_powder : public AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnUnitEnter(Unit* unit) override + { + Unit* caster = at->GetCaster(); + Player* player = caster->ToPlayer(); + + if (!player) + return; + + if (player->IsValidAttackTarget(unit)) + { + if (player->GetPrimarySpecialization() == ChrSpecialization::HunterMarksmanship) + player->CastSpell(unit, SPELL_HUNTER_BLEAK_POWDER_DAMAGE_MARKSMANSHIP, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + else if (player->GetPrimarySpecialization() == ChrSpecialization::HunterBeastMastery) + player->CastSpell(unit, SPELL_HUNTER_BLEAK_POWDER_DAMAGE_BEAST_MASTERY, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + } +}; + void AddSC_hunter_spell_scripts() { RegisterSpellScript(spell_hun_a_murder_of_crows); @@ -2912,4 +2973,7 @@ void AddSC_hunter_spell_scripts() RegisterSpellScript(spell_hun_spotters_mark); RegisterSpellScript(spell_hun_windrunner_quiver); RegisterSpellScript(spell_hun_focused_aim); + RegisterSpellScript(spell_hun_bleak_powder); + RegisterSpellScript(spell_hun_bleak_powder_areatrigger_summon); + RegisterAreaTriggerAI(at_hun_bleak_powder); }