Scripts/Spells: Implement hunter talent Implosive Trap (#30856)

This commit is contained in:
Aqua Deus
2025-05-04 19:58:43 +02:00
committed by GitHub
parent 8d6e643c91
commit bec4308385
2 changed files with 36 additions and 0 deletions

View File

@@ -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);