void FlightPathMovementGenerator::Initialize(Player &player) {
	player.getHostileRefManager().setOnlineOfflineState(false);
	player.AddUnitState(UNIT_STAT_IN_FLIGHT);
	player.SetFlag(UNIT_FIELD_FLAGS,
			UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
	Traveller<Player> traveller(player);
	// do not send movement, it was sent already
	i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x,
			(*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false);
	// For preloading end grid
	InitEndGridInfo();
	player.SendMonsterMoveByPath(GetPath(), GetCurrentNode(),
			GetPathAtMapEnd());
}
Example #2
0
void FlightPathMovementGenerator::Initialize(Player &player)
{
    player.getHostileRefManager().setOnlineOfflineState(false);
    player.AddUnitState(UNIT_STAT_IN_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
    Traveller<Player> traveller(player);
    // do not send movement, it was sent already
    i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false);

    // For preloading end grid
    InitEndGridInfo();
    TaxiPathNodeList path = GetPath();
    uint32 pathEndPoint = GetPathAtMapEnd();
    uint32 traveltime = uint32(32.0f*path.GetTotalLength(GetCurrentNode(),pathEndPoint));
    player.SetUnitMovementFlags(SPLINEFLAG_WALKING|SPLINEFLAG_FLYING);
    player.SendMonsterMoveByPath(path,GetCurrentNode(),pathEndPoint, traveltime);
}
void FlightPathMovementGenerator::DoInitialize(Player* player)
{
    Reset(player);
    InitEndGridInfo();
}