diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-01-14 19:35:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-14 19:35:30 +0100 |
commit | 62ffded9f2a3585b2f2f19ccf5d1ffd9e784a345 (patch) | |
tree | cd25a35c4e16d3a0cd44764979f71137bcdd0105 /src | |
parent | dc5307dfa0c17986ea3996d43426b5797ff2879d (diff) |
Scripts/Spells: Implement demon hunter talent "Inner Demon" (#30562)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_dh.cpp | 64 |
2 files changed, 70 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index d41b0b75476..e4dbe8a4c2e 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -5262,6 +5262,12 @@ void SpellMgr::LoadSpellInfoTargetCaps() spellInfo->_LoadSqrtTargetLimit(8, 0, 453034, EFFECT_1, {}, {}); }); + // Inner Demon + ApplySpellFix({ 390137 }, [](SpellInfo* spellInfo) + { + spellInfo->_LoadSqrtTargetLimit(5, 0, 389693, EFFECT_1, {}, {}); + }); + TC_LOG_INFO("server.loading", ">> Loaded SpellInfo target caps in {} ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/scripts/Spells/spell_dh.cpp b/src/server/scripts/Spells/spell_dh.cpp index 7de1e0f161d..7d41bb4488f 100644 --- a/src/server/scripts/Spells/spell_dh.cpp +++ b/src/server/scripts/Spells/spell_dh.cpp @@ -24,6 +24,7 @@ #include "AreaTrigger.h" #include "AreaTriggerAI.h" #include "DB2Stores.h" +#include "PathGenerator.h" #include "Player.h" #include "ScriptMgr.h" #include "Spell.h" @@ -127,6 +128,9 @@ enum DemonHunterSpells SPELL_DH_ILLIDANS_GRASP = 205630, SPELL_DH_ILLIDANS_GRASP_DAMAGE = 208618, SPELL_DH_ILLIDANS_GRASP_JUMP_DEST = 208175, + SPELL_DH_INNER_DEMON_BUFF = 390145, + SPELL_DH_INNER_DEMON_DAMAGE = 390137, + SPELL_DH_INNER_DEMON_TALENT = 389693, SPELL_DH_INFERNAL_STRIKE_CAST = 189110, SPELL_DH_INFERNAL_STRIKE_IMPACT_DAMAGE = 189112, SPELL_DH_INFERNAL_STRIKE_JUMP = 189111, @@ -806,6 +810,64 @@ class spell_dh_furious_gaze : public AuraScript } }; +// Called by 162264 - Metamorphosis +class spell_dh_inner_demon : public AuraScript +{ + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_DH_INNER_DEMON_TALENT, SPELL_DH_INNER_DEMON_BUFF }); + } + + bool Load() override + { + return GetUnitOwner()->HasAura(SPELL_DH_INNER_DEMON_TALENT); // This spell has a proc, but is just a copypaste from spell 390145 (also don't have a 5s cooldown) + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const + { + Unit* target = GetTarget(); + target->CastSpell(target, SPELL_DH_INNER_DEMON_BUFF, CastSpellExtraArgsInit{ + .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR, + }); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_dh_inner_demon::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } +}; + +// 390139 - Inner Demon +// ID - 26749 +struct at_dh_inner_demon : AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnInitialize() override + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(at->GetSpellId(), DIFFICULTY_NONE); + if (!spellInfo) + return; + + Unit* caster = at->GetCaster(); + if (!caster) + return; + + Position destPos = at->GetFirstCollisionPosition(spellInfo->GetEffect(EFFECT_0).CalcValue(caster) + at->GetMaxSearchRadius(), at->GetRelativeAngle(caster)); + PathGenerator path(at); + + path.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), false); + + at->InitSplines(path.GetPath()); + } + + void OnRemove() override + { + if (Unit* caster = at->GetCaster()) + caster->CastSpell(caster->GetPosition(), SPELL_DH_INNER_DEMON_DAMAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } +}; + // 209258 - Last Resort class spell_dh_last_resort : public AuraScript { @@ -1253,6 +1315,8 @@ void AddSC_demon_hunter_spell_scripts() RegisterSpellScript(spell_dh_felblade_cooldown_reset_proc); RegisterSpellScript(spell_dh_fiery_brand); RegisterSpellScript(spell_dh_furious_gaze); + RegisterSpellScript(spell_dh_inner_demon); + RegisterAreaTriggerAI(at_dh_inner_demon); RegisterSpellScript(spell_dh_last_resort); RegisterSpellScript(spell_dh_restless_hunter); RegisterSpellScript(spell_dh_shattered_destiny); |