diff options
| author | Subv <s.v.h21@hotmail.com> | 2012-10-21 15:11:50 -0700 |
|---|---|---|
| committer | Subv <s.v.h21@hotmail.com> | 2012-10-21 15:11:50 -0700 |
| commit | 82c251dc3db793e167d85683854e6bdcff10656a (patch) | |
| tree | e1a0dfe8eceb2ae607573dc3189e7c280cb26015 /src | |
| parent | bc1714161a8cb1f2ebf801107f38eb25576227f1 (diff) | |
| parent | 1da4a8503cef12d51e9d14a86f21e272cdde19ad (diff) | |
Merge pull request #8088 from Gacko/q13038
Core/DB: Quest 'Distortions in time'
Closes #3011
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Northrend/storm_peaks.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 976a6e5dba5..fc4f2785990 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -564,6 +564,53 @@ class npc_hyldsmeet_protodrake : public CreatureScript } }; +enum CloseRift +{ + SPELL_DESPAWN_RIFT = 61665 +}; + +class spell_close_rift : public SpellScriptLoader +{ + public: + spell_close_rift() : SpellScriptLoader("spell_close_rift") { } + + class spell_close_rift_AuraScript : public AuraScript + { + PrepareAuraScript(spell_close_rift_AuraScript); + + bool Load() + { + _counter = 0; + return true; + } + + bool Validate(SpellInfo const* /*spell*/) + { + return sSpellMgr->GetSpellInfo(SPELL_DESPAWN_RIFT); + } + + void HandlePeriodic(AuraEffect const* /* aurEff */) + { + if (++_counter == 5) + GetTarget()->CastSpell((Unit*)NULL, SPELL_DESPAWN_RIFT, true); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_close_rift_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + + private: + uint8 _counter; + + }; + + AuraScript* GetAuraScript() const + { + return new spell_close_rift_AuraScript(); + } +}; + void AddSC_storm_peaks() { new npc_agnetta_tyrsdottar(); @@ -574,4 +621,5 @@ void AddSC_storm_peaks() new npc_freed_protodrake(); new npc_icefang(); new npc_hyldsmeet_protodrake(); + new spell_close_rift(); } |
