aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2025-09-02 22:33:22 +0200
committerGitHub <noreply@github.com>2025-09-02 22:33:22 +0200
commit21dd7ee4927954b0d7c21269b5d76c33f21038c1 (patch)
tree0b8222e89e7d214104ccddf373fcb1b7e94c5355 /src/server/scripts
parentddfccf0c96982c9273f9a2db3266d38c663fa633 (diff)
Scripts/Spells: Implement hunter talent Binding Shot (#31074)
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index b753ff11b26..45ff0a4ec7c 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -25,11 +25,13 @@
#include "AreaTriggerAI.h"
#include "CellImpl.h"
#include "GridNotifiersImpl.h"
+#include "ObjectAccessor.h"
#include "Pet.h"
#include "SpellAuraEffects.h"
#include "SpellHistory.h"
#include "SpellMgr.h"
#include "SpellScript.h"
+#include "TaskScheduler.h"
enum HunterSpells
{
@@ -42,6 +44,11 @@ enum HunterSpells
SPELL_HUNTER_ASPECT_OF_THE_FOX = 1219162,
SPELL_HUNTER_ASPECT_OF_THE_TURTLE_PACIFY_AURA = 205769,
SPELL_HUNTER_BINDING_SHOT = 109248,
+ SPELL_HUNTER_BINDING_SHOT_IMMUNE = 117553,
+ SPELL_HUNTER_BINDING_SHOT_MARKER = 117405,
+ SPELL_HUNTER_BINDING_SHOT_STUN = 117526,
+ SPELL_HUNTER_BINDING_SHOT_VISUAL = 117614,
+ SPELL_HUNTER_BINDING_SHOT_VISUAL_ARROW = 118306,
SPELL_HUNTER_CONCUSSIVE_SHOT = 5116,
SPELL_HUNTER_EMERGENCY_SALVE_TALENT = 459517,
SPELL_HUNTER_EMERGENCY_SALVE_DISPEL = 459521,
@@ -217,6 +224,93 @@ class spell_hun_aspect_of_the_turtle : public AuraScript
}
};
+// 109248 - Binding Shot
+class spell_hun_binding_shot : public SpellScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_HUNTER_BINDING_SHOT_VISUAL_ARROW });
+ }
+
+ void HandleCast()
+ {
+ GetCaster()->CastSpell(GetExplTargetDest()->GetPosition(), SPELL_HUNTER_BINDING_SHOT_VISUAL_ARROW, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
+ }
+
+ void Register() override
+ {
+ OnCast += SpellCastFn(spell_hun_binding_shot::HandleCast);
+ }
+};
+
+// 109248 - Binding Shot
+// Id - 1524
+struct at_hun_binding_shot : AreaTriggerAI
+{
+ using AreaTriggerAI::AreaTriggerAI;
+
+ void OnInitialize() override
+ {
+ if (Unit* caster = at->GetCaster())
+ for (AreaTrigger* other : caster->GetAreaTriggers(SPELL_HUNTER_BINDING_SHOT))
+ other->SetDuration(0);
+ }
+
+ void OnCreate(Spell const* /*creatingSpell*/) override
+ {
+ _scheduler.Schedule(1s, [this](TaskContext task)
+ {
+ for (ObjectGuid const& guid : at->GetInsideUnits())
+ {
+ Unit* unit = ObjectAccessor::GetUnit(*at, guid);
+ if (!unit->HasAura(SPELL_HUNTER_BINDING_SHOT_MARKER))
+ continue;
+
+ unit->CastSpell(at->GetPosition(), SPELL_HUNTER_BINDING_SHOT_VISUAL, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
+ }
+
+ task.Repeat(1s);
+ });
+ }
+
+ void OnUnitEnter(Unit* unit) override
+ {
+ if (Unit* caster = at->GetCaster())
+ {
+ if (caster->IsValidAttackTarget(unit) && !unit->HasAura(SPELL_HUNTER_BINDING_SHOT_IMMUNE, caster->GetGUID()))
+ {
+ caster->CastSpell(unit, SPELL_HUNTER_BINDING_SHOT_MARKER, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
+ unit->CastSpell(at->GetPosition(), SPELL_HUNTER_BINDING_SHOT_VISUAL, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
+ }
+ }
+ }
+
+ void OnUnitExit(Unit* unit) override
+ {
+ unit->RemoveAurasDueToSpell(SPELL_HUNTER_BINDING_SHOT_MARKER, at->GetCasterGuid());
+
+ if (at->IsRemoved())
+ return;
+
+ if (Unit* caster = at->GetCaster())
+ {
+ if (caster->IsValidAttackTarget(unit) && !unit->HasAura(SPELL_HUNTER_BINDING_SHOT_IMMUNE, caster->GetGUID()))
+ {
+ caster->CastSpell(unit, SPELL_HUNTER_BINDING_SHOT_STUN, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
+ caster->CastSpell(unit, SPELL_HUNTER_BINDING_SHOT_IMMUNE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
+ }
+ }
+ }
+
+ void OnUpdate(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+ }
+
+private:
+ TaskScheduler _scheduler;
+};
+
// 204089 - Bullseye
class spell_hun_bullseye : public AuraScript
{
@@ -1345,6 +1439,8 @@ void AddSC_hunter_spell_scripts()
RegisterSpellScript(spell_hun_aspect_cheetah);
RegisterSpellScript(spell_hun_aspect_of_the_fox);
RegisterSpellScript(spell_hun_aspect_of_the_turtle);
+ RegisterSpellScript(spell_hun_binding_shot);
+ RegisterAreaTriggerAI(at_hun_binding_shot);
RegisterSpellScript(spell_hun_bullseye);
RegisterSpellScript(spell_hun_cobra_sting);
RegisterSpellScript(spell_hun_concussive_shot);