diff options
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); |