diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-08-25 16:52:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-25 16:52:17 +0200 |
commit | 2e26b18851f98d560421bb75a13fb5e425468743 (patch) | |
tree | 53f1af351a649280a14db2806e5f8802a3077102 | |
parent | 8ffef194b2ff975360777bd808f7322fca649e3d (diff) |
Scripts/Spells: Implement hunter talent Master Marksman (#31054)
-rw-r--r-- | sql/updates/world/master/2025_08_25_01_world.sql | 7 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 30 |
2 files changed, 37 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_08_25_01_world.sql b/sql/updates/world/master/2025_08_25_01_world.sql new file mode 100644 index 00000000000..6117661d742 --- /dev/null +++ b/sql/updates/world/master/2025_08_25_01_world.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_master_marksman'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(260309,'spell_hun_master_marksman'); + +DELETE FROM `spell_proc` WHERE `SpellId` IN (260309); +INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES +(260309,0x00,9,0x00000000,0x00000000,0x00000000,0x00000000,0x0,0x0,0x1,0x2,0x2,0x0,0x0,0,0,0,0); -- Master Marksman diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index b223d884365..5e3d9a6a8cf 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -62,6 +62,7 @@ enum HunterSpells SPELL_HUNTER_LATENT_POISON_INJECTORS_DAMAGE = 336904, SPELL_HUNTER_LONE_WOLF = 155228, SPELL_HUNTER_MARKSMANSHIP_HUNTER_AURA = 137016, + SPELL_HUNTER_MASTER_MARKSMAN = 269576, SPELL_HUNTER_MASTERS_CALL_TRIGGERED = 62305, SPELL_HUNTER_MISDIRECTION = 34477, SPELL_HUNTER_MISDIRECTION_PROC = 35079, @@ -557,6 +558,34 @@ class spell_hun_manhunter : public AuraScript } }; +// 260309 - Master Marksman +class spell_hun_master_marksman : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HUNTER_MASTER_MARKSMAN }); + } + + static void HandleProc(AuraScript const&, AuraEffect const* aurEff, ProcEventInfo const& eventInfo) + { + uint32 ticks = sSpellMgr->AssertSpellInfo(SPELL_HUNTER_MASTER_MARKSMAN, DIFFICULTY_NONE)->GetMaxTicks(); + if (!ticks) + return; + + int32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()) / ticks; + + eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), SPELL_HUNTER_MASTER_MARKSMAN, CastSpellExtraArgsInit{ + .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR, + .SpellValueOverrides = { { SPELLVALUE_BASE_POINT0, damage } } + }); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_hun_master_marksman::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } +}; + // 53271 - Masters Call class spell_hun_masters_call : public SpellScript { @@ -1291,6 +1320,7 @@ void AddSC_hunter_spell_scripts() RegisterSpellScript(spell_hun_latent_poison_injectors_damage); RegisterSpellScript(spell_hun_latent_poison_injectors_trigger); RegisterSpellScript(spell_hun_manhunter); + RegisterSpellScript(spell_hun_master_marksman); RegisterSpellScript(spell_hun_masters_call); RegisterSpellScript(spell_hun_misdirection); RegisterSpellScript(spell_hun_misdirection_proc); |