Core/DB: Quest 'Distortions in time'

This commit is contained in:
Gacko
2012-10-14 17:24:59 +02:00
parent 6f0a8040d8
commit 59557091a6
2 changed files with 85 additions and 0 deletions

View File

@@ -564,6 +564,53 @@ class npc_hyldsmeet_protodrake : public CreatureScript
}
};
enum eCloseRift
{
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 (bool) 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();
}