From c76226cc413ef88eb8beae40b0267450ff96b9ed Mon Sep 17 00:00:00 2001 From: Aokromes Date: Thu, 12 Jan 2017 03:06:14 +0100 Subject: [PATCH] Script/Quest: Script Quest 24125 Rite of the Winds By Malcrom, closes #18262 --- src/server/scripts/Kalimdor/zone_mulgore.cpp | 91 ++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/server/scripts/Kalimdor/zone_mulgore.cpp diff --git a/src/server/scripts/Kalimdor/zone_mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp new file mode 100644 index 0000000000000..ce742f4a4922f --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_mulgore.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008-2015 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* Script Info +Name: Mulgore +Comment: Support for quest: 24215 +*/ + +/* Included Scripts +npc_eagle_spirit: Used by Creature Eagle Spirit, Entry 36790 + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Player.h" +#include "SpellInfo.h" + +/*###### +## npc_eagle_spirit +######*/ + +enum EagleSpirit +{ + SPELL_EJECT_ALL_PASSENGERS = 50630 +}; + +G3D::Vector3 const Flightpath[7] = +{ + { -2884.155f, -71.08681f, 242.0678f }, + { -2720.592f, -111.0035f, 242.5955f }, + { -2683.951f, -382.9010f, 231.1792f }, + { -2619.148f, -484.9288f, 231.1792f }, + { -2543.868f, -525.3333f, 231.1792f }, + { -2465.321f, -502.4896f, 190.7347f }, + { -2343.872f, -401.8281f, -8.320873f } +}; + +class npc_eagle_spirit : public CreatureScript +{ +public: + npc_eagle_spirit() : CreatureScript("npc_eagle_spirit") { } + + struct npc_eagle_spirit_AI : public ScriptedAI + { + npc_eagle_spirit_AI(Creature* creature) : ScriptedAI(creature) + { + me->SetCanFly(true); + } + + void PassengerBoarded(Unit* /*who*/, int8 /*seatId*/, bool apply) override + { + if (!apply) + return; + + me->GetMotionMaster()->MoveSmoothPath(1, Flightpath, 7, false); + } + + void MovementInform(uint32 type, uint32 pointId) override + { + if (type == EFFECT_MOTION_TYPE && pointId == 1) + { + DoCast(SPELL_EJECT_ALL_PASSENGERS); + me->DespawnOrUnsummon(); + } + } + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_eagle_spirit_AI(creature); + } +}; + +void AddSC_mulgore() +{ + new npc_eagle_spirit(); +}