From 89085f7d577be8361ddfb879a913f96e87c966aa Mon Sep 17 00:00:00 2001 From: Kirkhammett Date: Fri, 27 Sep 2013 12:50:34 +0200 Subject: DB/Core: The Storm King's Vengeance --- src/server/scripts/Northrend/zone_zuldrak.cpp | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'src/server/scripts/Northrend') diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 63ba44f19e8..532ede3f849 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -24,6 +24,7 @@ #include "SpellScript.h" #include "SpellAuras.h" #include "SpellAuraEffects.h" +#include "Vehicle.h" /*#### ## npc_drakuru_shackles @@ -1814,6 +1815,54 @@ class spell_fetch_ingredient_aura : public SpellScriptLoader } }; +enum StormCloud +{ + STORM_COULD = 29939, + HEALING_WINDS = 55549, + STORM_VISUAL = 55708, + GYMERS_GRAB = 55516, + RIDE_VEHICLE = 43671 +}; + +class npc_storm_cloud : public CreatureScript +{ +public: + npc_storm_cloud() : CreatureScript("npc_storm_cloud") { } + + struct npc_storm_cloudAI : public ScriptedAI + { + npc_storm_cloudAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() OVERRIDE + { + me->CastSpell(me, STORM_VISUAL, true); + } + + void JustRespawned() OVERRIDE + { + Reset(); + } + + void SpellHit(Unit* caster, const SpellInfo* spell) OVERRIDE + { + if (spell->Id != GYMERS_GRAB) + return; + + if (Vehicle* veh = caster->GetVehicleKit()) + if (veh->GetAvailableSeatCount() != 0) + { + me->CastSpell(caster, RIDE_VEHICLE, true); + me->CastSpell(caster, HEALING_WINDS, true); + } + } + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_storm_cloudAI(creature); + } +}; + void AddSC_zuldrak() { new npc_drakuru_shackles(); @@ -1834,4 +1883,5 @@ void AddSC_zuldrak() new spell_random_ingredient(); new spell_pot_check(); new spell_fetch_ingredient_aura(); + new npc_storm_cloud(); } -- cgit v1.2.3