diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_dh.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_dh.cpp b/src/server/scripts/Spells/spell_dh.cpp index cb959291444..0344cddcda2 100644 --- a/src/server/scripts/Spells/spell_dh.cpp +++ b/src/server/scripts/Spells/spell_dh.cpp @@ -33,6 +33,7 @@ #include "SpellHistory.h" #include "SpellMgr.h" #include "SpellScript.h" +#include "TaskScheduler.h" #include "Unit.h" enum DemonHunterSpells @@ -126,6 +127,7 @@ enum DemonHunterSpells SPELL_DH_FURIOUS_GAZE = 343311, SPELL_DH_FURIOUS_GAZE_BUFF = 343312, SPELL_DH_FURIOUS_THROWS = 393029, + SPELL_DH_GLAIVE_TEMPEST = 342857, SPELL_DH_GLIDE = 131347, SPELL_DH_GLIDE_DURATION = 197154, SPELL_DH_GLIDE_KNOCKBACK = 196353, @@ -931,6 +933,36 @@ class spell_dh_furious_gaze : public AuraScript } }; +// 342817 - Glaive Tempest +// ID - 21832 +struct at_dh_glaive_tempest : AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnCreate(Spell const* /*creatingSpell*/) override + { + _scheduler.Schedule(0ms, [this](TaskContext task) + { + std::chrono::duration<float> period = 500ms; // 500ms, affected by haste + if (Unit* caster = at->GetCaster()) + { + period *= *caster->m_unitData->ModHaste; + caster->CastSpell(at->GetPosition(), SPELL_DH_GLAIVE_TEMPEST, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + caster->CastSpell(at->GetPosition(), SPELL_DH_GLAIVE_TEMPEST, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + task.Repeat(duration_cast<Milliseconds>(period)); + }); + } + + void OnUpdate(uint32 diff) override + { + _scheduler.Update(diff); + } + +private: + TaskScheduler _scheduler; +}; + // Called by 162264 - Metamorphosis class spell_dh_inner_demon : public AuraScript { @@ -1465,6 +1497,7 @@ void AddSC_demon_hunter_spell_scripts() RegisterSpellScript(spell_dh_felblade_cooldown_reset_proc); RegisterSpellScript(spell_dh_fiery_brand); RegisterSpellScript(spell_dh_furious_gaze); + RegisterAreaTriggerAI(at_dh_glaive_tempest); RegisterSpellScript(spell_dh_inner_demon); RegisterAreaTriggerAI(at_dh_inner_demon); RegisterSpellScript(spell_dh_know_your_enemy); |