aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2025-04-13 15:49:10 +0200
committerGitHub <noreply@github.com>2025-04-13 15:49:10 +0200
commit1f1180e5c6e071286ed404e70e0bdf7b7e23c993 (patch)
tree222a75548dc1ea73749fc232edac87b2e54bc610 /src
parentc2d04486b353e4b0d0b417de428feefc14296e09 (diff)
Scripts/Spells: Implement hunter talent High Explosive Trap (#30852)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp30
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);