diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-05-04 19:58:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-04 19:58:43 +0200 |
commit | bec4308385cd83e3616e26562c94f0b133dd227f (patch) | |
tree | 839cdac83660774374e8fa37e94ce5468e8f836b /src | |
parent | 8d6e643c913c07c302edb237fb77020602c81988 (diff) |
Scripts/Spells: Implement hunter talent Implosive Trap (#30856)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 2060a121f69..65becbcbdc2 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -51,6 +51,8 @@ enum HunterSpells SPELL_HUNTER_GREVIOUS_INJURY = 1217789, SPELL_HUNTER_HIGH_EXPLOSIVE_TRAP = 236775, SPELL_HUNTER_HIGH_EXPLOSIVE_TRAP_DAMAGE = 236777, + SPELL_HUNTER_IMPLOSIVE_TRAP = 462032, + SPELL_HUNTER_IMPLOSIVE_TRAP_DAMAGE = 462033, SPELL_HUNTER_INTIMIDATION = 19577, SPELL_HUNTER_INTIMIDATION_MARKSMANSHIP = 474421, SPELL_HUNTER_LATENT_POISON_STACK = 378015, @@ -338,6 +340,32 @@ class spell_hun_hunting_party : public AuraScript } }; +// 462032 - Implosive Trap +// 34378 - AreatriggerId +struct areatrigger_hun_implosive_trap : AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnInitialize() override + { + if (Unit* caster = at->GetCaster()) + for (AreaTrigger* other : caster->GetAreaTriggers(SPELL_HUNTER_IMPLOSIVE_TRAP)) + other->SetDuration(0); + } + + void OnUnitEnter(Unit* unit) override + { + if (Unit* caster = at->GetCaster()) + { + if (caster->IsValidAttackTarget(unit)) + { + caster->CastSpell(at->GetPosition(), SPELL_HUNTER_IMPLOSIVE_TRAP_DAMAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + at->Remove(); + } + } + } +}; + // 53478 - Last Stand Pet class spell_hun_last_stand_pet : public SpellScript { @@ -988,6 +1016,7 @@ void AddSC_hunter_spell_scripts() RegisterSpellScript(spell_hun_explosive_shot); RegisterAreaTriggerAI(areatrigger_hun_high_explosive_trap); RegisterSpellScript(spell_hun_hunting_party); + RegisterAreaTriggerAI(areatrigger_hun_implosive_trap); RegisterSpellScript(spell_hun_last_stand_pet); RegisterSpellScript(spell_hun_latent_poison_damage); RegisterSpellScript(spell_hun_latent_poison_trigger); |