- #include "ScriptPCH.h"
- class npc_waypoint : public CreatureScript
- {
- public:
- npc_waypoint() : CreatureScript("npc_waypoint") { }
- struct npc_waypointAI : public ScriptedAI
- {
- npc_waypointAI(Creature * c) : ScriptedAI(c) { }
- int moveCount;
- void Reset()
- {
- moveCount = 0;
- me->SetSpeed(MOVE_RUN, 1.0f, true);
- }
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
- moveCount++;
- }
- void UpdateAI(uint32 const diff)
- {
- switch(moveCount)
- {
- case 0:
- me->GetMotionMaster()->MovePoint(0, -13179.666016f, 316.836945f, 33.242424f);
- break;
- case 1:
- me->GetMotionMaster()->MovePoint(0, -13198.463867f, 323.198944f, 33.242424f);
- break;
- case 2:
- me->GetMotionMaster()->MovePoint(0, -13215.075195f, 323.894623f, 33.242462f);
- break;
- case 3:
- me->GetMotionMaster()->MovePoint(0, -13234.995117f, 314.123047f, 33.220901f);
- break;
- case 4:
- me->GetMotionMaster()->MovePoint(0, -13249.653320f, 297.987000f, 33.241779f);
- me->MonsterYell("Test!", LANG_UNIVERSAL, me->GetGUID());
- break;
- case 5:
- me->GetMotionMaster()->MovePoint(0, -13254.754883f, 282.916412f, 33.242786f);
- me->MonsterYell("Test2!", LANG_UNIVERSAL, me->GetGUID());
- me->setFaction(14);
- break;
- }
- DoMeleeAttackIfReady();
- }
- };
- CreatureAI * GetAI(Creature * pCreature) const
- {
- return new npc_waypointAI(pCreature);
- }
- };
- void AddSC_npc_waypoint()
- {
- new npc_waypoint();
- }