aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2025-05-05 01:14:35 +0200
committerGitHub <noreply@github.com>2025-05-05 01:14:35 +0200
commite57f0d01fb00b8cf86e7dd75c6f754bed95568ad (patch)
treeb75edcb8a74603b4a78f21a0e01ddf2e09edcff7 /src
parentfc362147f9613baf7ffcec12d8ea90b6aa9eb2ab (diff)
Scripts/Spells: Implement hunter talent Tar Trap (#30846)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index e009140bde7..0178b0402fb 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -77,6 +77,9 @@ enum HunterSpells
SPELL_HUNTER_STEADY_SHOT_FOCUS = 77443,
SPELL_HUNTER_T9_4P_GREATNESS = 68130,
SPELL_HUNTER_T29_2P_MARKSMANSHIP_DAMAGE = 394371,
+ SPELL_HUNTER_TAR_TRAP = 187699,
+ SPELL_HUNTER_TAR_TRAP_AREATRIGGER = 187700,
+ SPELL_HUNTER_TAR_TRAP_SLOW = 135299,
SPELL_HUNTER_WILDERNESS_MEDICINE_TALENT = 343242,
SPELL_HUNTER_WILDERNESS_MEDICINE_DISPEL = 384784,
SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481
@@ -948,6 +951,51 @@ class spell_hun_tame_beast : public SpellScript
}
};
+// 187700 - Tar Trap
+// 4436 - AreatriggerId
+struct areatrigger_hun_tar_trap : AreaTriggerAI
+{
+ using AreaTriggerAI::AreaTriggerAI;
+
+ void OnUnitEnter(Unit* unit) override
+ {
+ if (Unit* caster = at->GetCaster())
+ if (caster->IsValidAttackTarget(unit))
+ caster->CastSpell(unit, SPELL_HUNTER_TAR_TRAP_SLOW, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
+ }
+
+ void OnUnitExit(Unit* unit) override
+ {
+ unit->RemoveAurasDueToSpell(SPELL_HUNTER_TAR_TRAP_SLOW, at->GetCasterGuid());
+ }
+};
+
+// 187699 - Tar Trap
+// 4435 - AreatriggerId
+struct areatrigger_hun_tar_trap_activate : AreaTriggerAI
+{
+ using AreaTriggerAI::AreaTriggerAI;
+
+ void OnInitialize() override
+ {
+ if (Unit* caster = at->GetCaster())
+ for (AreaTrigger* other : caster->GetAreaTriggers(SPELL_HUNTER_TAR_TRAP))
+ other->SetDuration(0);
+ }
+
+ void OnUnitEnter(Unit* unit) override
+ {
+ if (Unit* caster = at->GetCaster())
+ {
+ if (caster->IsValidAttackTarget(unit))
+ {
+ caster->CastSpell(at->GetPosition(), SPELL_HUNTER_TAR_TRAP_AREATRIGGER, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
+ at->Remove();
+ }
+ }
+ }
+};
+
// 67151 - Item - Hunter T9 4P Bonus (Steady Shot)
class spell_hun_t9_4p_bonus : public AuraScript
{
@@ -1079,6 +1127,8 @@ void AddSC_hunter_spell_scripts()
RegisterSpellScript(spell_hun_steady_shot);
RegisterSpellScript(spell_hun_surging_shots);
RegisterSpellScript(spell_hun_tame_beast);
+ RegisterAreaTriggerAI(areatrigger_hun_tar_trap);
+ RegisterAreaTriggerAI(areatrigger_hun_tar_trap_activate);
RegisterSpellScript(spell_hun_t9_4p_bonus);
RegisterSpellScript(spell_hun_t29_2p_marksmanship_bonus);
RegisterSpellScript(spell_hun_wilderness_medicine);