- /*
- http://emudevs.com
- */
- static Waypoints waypoints[] =
- {
- { },
- /* Splintertree NPC Waypoints */
- { 1, 2232.689f, -2540.322f, 87.151680f, 2.994325f },
- { 2, 2199.957f, -2525.335f, 81.887581f, 2.491666f },
- { 3, 2161.294f, -2499.362f, 79.792213f, 2.625184f },
- { 4, 2113.347f, -2470.833f, 81.907562f, 2.389565f },
- { 5, 2060.820f, -2421.534f, 87.170036f, 2.695870f },
- { 6, 2000.545f, -2395.062f, 89.300522f, 1.990349f },
- { 7, 1950.070f, -2280.594f, 91.488533f, 1.754730f },
- { 8, 1930.723f, -2163.582f, 93.615677f, 1.252074f },
- { 9, 1968.390f, -1995.599f, 96.493195f, 1.204951f },
- { 10, 2008.603f, -1899.979f, 98.502579f, 0.623756f },
- { 11, 2171.254f, -1783.098f, 101.723885f, 0.521654f },
- { 12, 2273.168f, -1724.195f, 114.672012f, 0.800470f },
- { 13, 2324.556f, -1669.796f, 124.625069f, 1.157827f },
- { 14, 2362.465f, -1553.154f, 125.286140f, 1.322760f },
- { 15, 2437.212f, -1325.737f, 125.279434f, 1.499475f },
- { 16, 2469.889f, -1155.896f, 125.181503f, 1.240294f },
- { 17, 2516.389f, -984.656f, 129.455795f, 1.562307f },
- { 18, 2513.096f, -875.639f, 134.581512f, 2.104232f },
- { 19, 2479.504f, -799.719f, 137.150238f, 1.727241f },
- { 20, 2445.496f, -557.477f, 115.004616f, 1.413082f },
- { 21, 2453.443f, -510.455f, 114.829971f, 0.352794f },
- { 22, 2632.077f, -448.599f, 106.659004f, 0.399918f }
- };
- class npcs_astranaar : public CreatureScript
- {
- public:
- npcs_astranaar() : CreatureScript("npcs_astranaar") { }
- struct npcs_astranaarAI : public ScriptedAI
- {
- npcs_astranaarAI(Creature * c) : ScriptedAI(c) { }
- int moved;
- void Reset()
- {
- moved = 0;
- me->SetSpeed(MOVE_RUN, 1.0f, true);
- }
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
- moved++;
- }
- void UpdateAI(uint32 const diff)
- {
- if(factionWar.activeBattle)
- {
- switch(moved)
- {
- case 0:
- me->GetMotionMaster()->MovePoint(1, waypoints[22].x, waypoints[22].y, waypoints[22].z);
- break;
- case 1:
- me->GetMotionMaster()->MovePoint(2, waypoints[21].x, waypoints[21].y, waypoints[21].z);
- break;
- case 2:
- me->GetMotionMaster()->MovePoint(3, waypoints[20].x, waypoints[20].y, waypoints[20].z);
- break;
- case 3:
- me->GetMotionMaster()->MovePoint(4, waypoints[19].x, waypoints[19].y, waypoints[19].z);
- break;
- case 4:
- me->GetMotionMaster()->MovePoint(5, waypoints[18].x, waypoints[18].y, waypoints[18].z);
- break;
- case 5:
- me->GetMotionMaster()->MovePoint(6, waypoints[17].x, waypoints[17].y, waypoints[17].z);
- break;
- case 6:
- me->GetMotionMaster()->MovePoint(7, waypoints[16].x, waypoints[16].y, waypoints[16].z);
- break;
- case 7:
- me->GetMotionMaster()->MovePoint(8, waypoints[15].x, waypoints[15].y, waypoints[15].z);
- break;
- case 8:
- me->GetMotionMaster()->MovePoint(9, waypoints[14].x, waypoints[14].y, waypoints[14].z);
- break;
- case 9:
- me->GetMotionMaster()->MovePoint(10, waypoints[13].x, waypoints[13].y, waypoints[13].z);
- break;
- case 10:
- me->GetMotionMaster()->MovePoint(11, waypoints[12].x, waypoints[12].y, waypoints[12].z);
- break;
- case 11:
- me->GetMotionMaster()->MovePoint(12, waypoints[11].x, waypoints[11].y, waypoints[11].z);
- break;
- case 12:
- me->GetMotionMaster()->MovePoint(13, waypoints[10].x, waypoints[10].y, waypoints[10].z);
- break;
- case 13:
- me->GetMotionMaster()->MovePoint(14, waypoints[9].x, waypoints[9].y, waypoints[9].z);
- break;
- case 14:
- me->GetMotionMaster()->MovePoint(15, waypoints[8].x, waypoints[8].y, waypoints[8].z);
- break;
- case 15:
- me->GetMotionMaster()->MovePoint(16, waypoints[7].x, waypoints[7].y, waypoints[7].z);
- break;
- case 16:
- me->GetMotionMaster()->MovePoint(17, waypoints[6].x, waypoints[6].y, waypoints[6].z);
- break;
- case 17:
- me->GetMotionMaster()->MovePoint(18, waypoints[5].x, waypoints[5].y, waypoints[5].z);
- break;
- case 18:
- me->GetMotionMaster()->MovePoint(19, waypoints[4].x, waypoints[4].y, waypoints[4].z);
- break;
- case 19:
- me->GetMotionMaster()->MovePoint(20, waypoints[3].x, waypoints[3].y, waypoints[3].z);
- break;
- case 20:
- me->GetMotionMaster()->MovePoint(21, waypoints[2].x, waypoints[2].y, waypoints[2].z);
- break;
- case 21:
- me->GetMotionMaster()->MovePoint(22, waypoints[1].x, waypoints[1].y, waypoints[1].z);
- moved = 22;
- break;
- }
- }
- DoMeleeAttackIfReady();
- }
- };
- CreatureAI * GetAI(Creature * pCreature) const
- {
- return new npcs_astranaarAI(pCreature);
- }
- };
EmuDevs - Example