diff options
| author | Shauren <shauren.trinity@gmail.com> | 2013-10-07 14:30:37 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2013-10-07 14:30:37 +0200 |
| commit | fca4a5448ac476b942c330108a76032ae242711e (patch) | |
| tree | 81fe500a02353fa5079532fe53c21a4f3a269b82 /src/server/scripts/Spells | |
| parent | 1b56bd1b6a860c325f3e4e76d94dc367429fbb16 (diff) | |
| parent | c8f525c76e162b5b546c91628a1457f9aef43699 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 6b56c51d6e1..3d84d9bbca9 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -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(); } |
