Scripts/Spells: Implement hunter talent Bleak Powder

This commit is contained in:
luis
2026-10-05 11:25:37 -03:00
parent 9f7b277693
commit 0b95406ba1
2 changed files with 71 additions and 1 deletions
+6
View File
@@ -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)
{
+65 -1
View File
@@ -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);
}