Use original taxipath data in taxi flight movement generator. Author: Vladimir

+ Cleanup

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-06-23 00:57:16 +02:00
parent 1daa1c09f9
commit d50cb473cb
14 changed files with 169 additions and 161 deletions
+32 -2
View File
@@ -34,6 +34,9 @@
#include "EventProcessor.h"
#include "MotionMaster.h"
#include "DBCStructure.h"
#include "Path.h"
#include "WorldPacket.h"
#include "Timer.h"
#include <list>
#define WORLD_TRIGGER 12999
@@ -324,7 +327,6 @@ class DynamicObject;
class GameObject;
class Item;
class Pet;
class Path;
class PetAura;
class Minion;
class Guardian;
@@ -1436,12 +1438,14 @@ class Unit : public WorldObject
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player = NULL);
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player = NULL);
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end);
void SendMonsterMoveTransport(Unit *vehicleOwner);
void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL);
void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL);
void SendMovementFlagUpdate();
template<typename PathElem, typename PathNode>
void SendMonsterMoveByPath(Path<PathElem,PathNode> const& path, uint32 start, uint32 end);
void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference);
void SendClearThreatListOpcode();
void SendRemoveFromThreatListOpcode(HostileReference* pHostileReference);
@@ -2116,4 +2120,30 @@ namespace Trinity
};
}
template<typename Elem, typename Node>
inline void Unit::SendMonsterMoveByPath(Path<Elem,Node> const& path, uint32 start, uint32 end)
{
uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32);
uint32 pathSize = end - start;
WorldPacket data(SMSG_MONSTER_MOVE, (GetPackGUID().size()+1+4+4+4+4+1+4+4+4+pathSize*4*3));
data.append(GetPackGUID());
data << uint8(0);
data << GetPositionX();
data << GetPositionY();
data << GetPositionZ();
data << uint32(getMSTime());
data << uint8(0);
data << uint32(((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) || isInFlight()) ? (MOVEFLAG_FLY|MOVEFLAG_WALK) : MOVEFLAG_WALK);
data << uint32(traveltime);
data << uint32(pathSize);
for (uint32 i = start; i < end; ++i)
{
data << float(path[i].x);
data << float(path[i].y);
data << float(path[i].z);
}
SendMessageToSet(&data, true);
}
#endif