diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 2d302c7fc60..25e6376cc1b 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -22,6 +22,7 @@ */ #include "ScriptMgr.h" +#include "AreaTriggerAI.h" #include "CellImpl.h" #include "GridNotifiersImpl.h" #include "Pet.h" @@ -46,6 +47,8 @@ enum HunterSpells SPELL_HUNTER_EXHILARATION_PET = 128594, SPELL_HUNTER_EXHILARATION_R2 = 231546, SPELL_HUNTER_EXPLOSIVE_SHOT_DAMAGE = 212680, + SPELL_HUNTER_HIGH_EXPLOSIVE_TRAP = 236775, + SPELL_HUNTER_HIGH_EXPLOSIVE_TRAP_DAMAGE = 236777, SPELL_HUNTER_LATENT_POISON_STACK = 378015, SPELL_HUNTER_LATENT_POISON_DAMAGE = 378016, SPELL_HUNTER_LATENT_POISON_INJECTORS_STACK = 336903, @@ -279,6 +282,32 @@ class spell_hun_explosive_shot : public AuraScript } }; +// 236775 - High Explosive Trap +// 9810 - AreatriggerId +struct areatrigger_hun_high_explosive_trap : AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnInitialize() override + { + if (Unit* caster = at->GetCaster()) + for (AreaTrigger* other : caster->GetAreaTriggers(SPELL_HUNTER_HIGH_EXPLOSIVE_TRAP)) + other->SetDuration(0); + } + + void OnUnitEnter(Unit* unit) override + { + if (Unit* caster = at->GetCaster()) + { + if (caster->IsValidAttackTarget(unit)) + { + caster->CastSpell(at->GetPosition(), SPELL_HUNTER_HIGH_EXPLOSIVE_TRAP_DAMAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + at->Remove(); + } + } + } +}; + // 212658 - Hunting Party class spell_hun_hunting_party : public AuraScript { @@ -883,6 +912,7 @@ void AddSC_hunter_spell_scripts() RegisterSpellScript(spell_hun_emergency_salve); RegisterSpellScript(spell_hun_exhilaration); RegisterSpellScript(spell_hun_explosive_shot); + RegisterAreaTriggerAI(areatrigger_hun_high_explosive_trap); RegisterSpellScript(spell_hun_hunting_party); RegisterSpellScript(spell_hun_last_stand_pet); RegisterSpellScript(spell_hun_latent_poison_damage); |