示例#1
0
bool Transporter::CreateAsTransporter(uint32 EntryID, const char* Name, int32 Time)
{
	// Lookup GameobjectInfo
	if(!CreateFromProto(EntryID,0,0,0,0,0))
		return false;
	
	// Override these flags to avoid mistakes in proto
	SetUInt32Value(GAMEOBJECT_FLAGS,40);
	SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100);
	
	
	// Set period
	m_period = Time;

	// Generate waypoints
	if(!GenerateWaypoints())
		return false;

	// Set position
	SetMapId(m_WayPoints[0].mapid);
	SetPosition(m_WayPoints[0].x, m_WayPoints[0].y, m_WayPoints[0].z, 0);

	// Add to world
	AddToWorld();

	return true;
}
bool Transporter::CreateAsTransporter(uint32 EntryID, const char* Name, int32 Time)
{
    // Lookup GameobjectInfo
    if (!CreateFromProto(EntryID, 0, 0, 0, 0, 0))
        return false;

    // Override these flags to avoid mistakes in proto
    SetFlags(40);
    SetAnimProgress(100);

    //Maybe this would be the perfect way, so there would be no extra checks in Object.cpp:
    //but these fields seems to change often and between server flavours (ArcEmu, Aspire, name another one) - by: VLack aka. VLsoft
    if (pInfo)
        pInfo->Type = GAMEOBJECT_TYPE_TRANSPORT;
    else
        LOG_ERROR("Transporter id[%i] name[%s] - can't set GAMEOBJECT_TYPE - it will behave badly!", EntryID, Name);

    m_overrides = GAMEOBJECT_INFVIS | GAMEOBJECT_ONMOVEWIDE; //Make it forever visible on the same map

    // Set period
    m_period = Time;

    // Generate waypoints
    if (!GenerateWaypoints())
        return false;

    // Set position
    SetMapId(m_WayPoints[0].mapid);
    SetPosition(m_WayPoints[0].x, m_WayPoints[0].y, m_WayPoints[0].z, 0);
    SetLevel(m_period);
    // Add to world
    AddToWorld();

    return true;
}
bool Transporter::CreateAsTransporter(uint32 EntryID, const char* Name)
{
	// Lookup GameobjectInfo
	if(!CreateFromProto(EntryID,0,0,0,0,0))
		return false;
	
	SetUInt32Value(GAMEOBJECT_FLAGS,40);
	SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_ANIMPROGRESS, 100);

	//Maybe this would be the perfect way, so there would be no extra checks in Object.cpp:
	SetByte( GAMEOBJECT_BYTES_1, 0, GAMEOBJECT_TYPE_TRANSPORT );
	//but these fields seems to change often and between server flavours (ArcEmu, Aspire, name another one) - by: VLack aka. VLsoft
	if( pInfo )
		pInfo->Type = GAMEOBJECT_TYPE_TRANSPORT;
	else
		sLog.outString("Transporter id[%i] name[%s] - can't set GAMEOBJECT_TYPE - it will behave badly!",EntryID,Name);

	// Generate waypoints
	if(!GenerateWaypoints())
		return false;

	// Set position
	SetMapId(m_WayPoints[0].mapid);
	SetPosition(m_WayPoints[0].x, m_WayPoints[0].y, m_WayPoints[0].z, 0);

	SetUInt32Value(GAMEOBJECT_LEVEL, m_period); // ITS OVER 9000!!!!! No, really, it is.

	// Add to world
	AddToWorld();

	return true;
}
示例#4
0
void Transporter::EventClusterMapChange( uint32 mapid, LocationVector l )
{
    m_WayPoints.clear();

    if (!GenerateWaypoints())
        return;

    SetPosition(l.x, l.y, l.z, 0);

    //hmmm, ok
    for (WaypointMap::iterator itr=m_WayPoints.begin(); itr!=m_WayPoints.end(); ++itr)
    {
        if (itr->second.x == l.x && itr->second.y == l.y && itr->second.z == l.z)
        {
            mCurrentWaypoint = itr;
            break;
        }
    }

    mNextWaypoint = GetNextWaypoint();

    //m_canMove = true;
}
示例#5
0
bool Transporter::CreateAsTransporter(uint32 EntryID, const char* Name)
{
    // Try to spawn the Gameobject, no need for locations.
    if(!CreateFromProto(EntryID,0,0.0f,0.0f,0.0f,0.0f))
        return false;

    SetUInt32Value(GAMEOBJECT_FLAGS,40);
    SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_ANIMPROGRESS, 100);

    // Generate waypoints
    if(!GenerateWaypoints())
        return false;

    // Set position
    SetMapId(m_WayPoints[0].mapid);
    SetPosition(m_WayPoints[0].x, m_WayPoints[0].y, m_WayPoints[0].z, 0);

    SetUInt32Value(GAMEOBJECT_LEVEL, m_period); // ITS OVER 9000!!!!! No, really, it is.

    // Add to world
    AddToWorld();

    return true;
}