DB/Core: The Storm King's Vengeance

This commit is contained in:
Kirkhammett committed 2013-09-27 12:50:34 +02:00
1 parent 2cca3982d4
commit 89085f7d57
3 files changed
+587

No files matched your search

+82
View File
@@ -2161,6 +2161,86 @@ class spell_q12619_emblazon_runeblade_effect : public SpellScriptLoader
}
};
enum Quest_The_Storm_King
{
SPELL_RIDE_GYMER = 43671,
SPELL_GRABBED = 55424
};
class spell_q12919_gymers_grab : public SpellScriptLoader
{
public:
spell_q12919_gymers_grab() : SpellScriptLoader("spell_q12919_gymers_grab") { }
class spell_q12919_gymers_grab_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q12919_gymers_grab_SpellScript);
bool Validate(SpellInfo const* /*spell*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_RIDE_GYMER))
return false;
return true;
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
int8 seatId = 2;
if (!GetHitCreature())
return;
GetHitCreature()->CastCustomSpell(SPELL_RIDE_GYMER, SPELLVALUE_BASE_POINT0, seatId, GetCaster(), true);
GetHitCreature()->CastSpell(GetHitCreature(), SPELL_GRABBED, true);
}
void Register() OVERRIDE
{
OnEffectHitTarget += SpellEffectFn(spell_q12919_gymers_grab_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_q12919_gymers_grab_SpellScript();
}
};
enum Quest_The_Storm_King_Throw
{
SPELL_VARGUL_EXPLOSION = 55569
};
class spell_q12919_gymers_throw : public SpellScriptLoader
{
public:
spell_q12919_gymers_throw() : SpellScriptLoader("spell_q12919_gymers_throw") { }
class spell_q12919_gymers_throw_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q12919_gymers_throw_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (caster->IsVehicle())
if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(1))
{
passenger->ExitVehicle();
caster->CastSpell(passenger, SPELL_VARGUL_EXPLOSION, true);
}
}
void Register() OVERRIDE
{
OnEffectHitTarget += SpellEffectFn(spell_q12919_gymers_throw_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_q12919_gymers_throw_SpellScript();
}
};
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -2213,4 +2293,6 @@ void AddSC_quest_spell_scripts()
new spell_q12641_death_comes_from_on_high();
new spell_q12619_emblazon_runeblade();
new spell_q12619_emblazon_runeblade_effect();
new spell_q12919_gymers_grab();
new spell_q12919_gymers_throw();
}