aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2025_09_02_00_world.sql9
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp96
2 files changed, 105 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_09_02_00_world.sql b/sql/updates/world/master/2025_09_02_00_world.sql
new file mode 100644
index 00000000000..9188450acde
--- /dev/null
+++ b/sql/updates/world/master/2025_09_02_00_world.sql
@@ -0,0 +1,9 @@
+UPDATE `areatrigger_template` SET `VerifiedBuild`=61265 WHERE (`Id`=5972 AND `IsCustom`=0);
+
+DELETE FROM `areatrigger_create_properties` WHERE (`IsCustom`=0 AND `Id` IN (1524));
+INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Flags`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `SpellForVisuals`, `TimeToTargetScale`, `Speed`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES
+(1524, 0, 5972, 0, 0, 0, 0, 0, 0, -1, 0, 0, NULL, 10000, 0, 4, 5, 5, 2, 2, 0.3, 0.3, 0, 0, 'at_hun_binding_shot', 61265); -- Spell: 109248 (Binding Shot)
+
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_binding_shot';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(109248, 'spell_hun_binding_shot');
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);