コード例 #1
0
void Transporter::UpdatePosition()
{
	if (m_WayPoints.size() <= 1)
		return;

	m_timer = getMSTime() % m_period;

	while (((m_timer - mCurrentWaypoint->first) % m_pathTime) >= ((mNextWaypoint->first - mCurrentWaypoint->first) % m_pathTime))
	{
		/*printf("%s from %u %f %f %f to %u %f %f %f\n", GetInfo()->Name,
			mCurrentWaypoint->second.mapid, mCurrentWaypoint->second.x,mCurrentWaypoint->second.y,mCurrentWaypoint->second.z,
			mNextWaypoint->second.mapid, mNextWaypoint->second.x,mNextWaypoint->second.y,mNextWaypoint->second.z);*/

		mCurrentWaypoint = mNextWaypoint;
		mNextWaypoint = GetNextWaypoint();
		if (mNextWaypoint->second.mapid != GetMapId() || mCurrentWaypoint->second.teleport) {
			//mCurrentWaypoint = mNextWaypoint;
			//mNextWaypoint = GetNextWaypoint();
			TransportPassengers(mNextWaypoint->second.mapid, GetMapId(),
				mNextWaypoint->second.x, mNextWaypoint->second.y, mNextWaypoint->second.z);
			break;
		} else {
			SetPosition(mNextWaypoint->second.x, mNextWaypoint->second.y,
				mNextWaypoint->second.z, m_position.o, false);
		}

		if(mCurrentWaypoint->second.delayed)
		{
			PlaySoundToSet(5495);		// BoatDockedWarning.wav
		}
	}
}
コード例 #2
0
void Transporter::UpdatePosition()
{
    if (m_WayPoints.size() <= 1)
        return;

    m_timer = getMSTime() % m_period;

    while (((m_timer - mCurrentWaypoint->first) % m_pathTime) >= ((mNextWaypoint->first - mCurrentWaypoint->first) % m_pathTime))
    {
        /*printf("%s from %u %f %f %f to %u %f %f %f\n", this->GetInfo()->Name,
            mCurrentWaypoint->second.mapid, mCurrentWaypoint->second.x,mCurrentWaypoint->second.y,mCurrentWaypoint->second.z,
            mNextWaypoint->second.mapid, mNextWaypoint->second.x,mNextWaypoint->second.y,mNextWaypoint->second.z);*/

        mCurrentWaypoint = mNextWaypoint;
        mNextWaypoint = GetNextWaypoint();
        if (mCurrentWaypoint->second.mapid != GetMapId() || mCurrentWaypoint->second.teleport)
        {
            passengers.clear();
            TransportPassengers(mCurrentWaypoint->second.mapid, GetMapId(), mCurrentWaypoint->second.x, mCurrentWaypoint->second.y, mCurrentWaypoint->second.z);
            break;
        }
        else{
            SetPosition(mCurrentWaypoint->second.x, mCurrentWaypoint->second.y, mCurrentWaypoint->second.z, m_position.o, false);
            MovePassengers(mCurrentWaypoint->second.x, mCurrentWaypoint->second.y, mCurrentWaypoint->second.z, m_position.o);
        }

        if (mCurrentWaypoint->second.delayed)
        {
            //Transprter Script = sScriptMgr.CreateAIScriptClassForGameObject(GetEntry(), this);
            switch (GetInfo()->DisplayID)
            {
                case 3015:
                case 7087:
                {
                    PlaySoundToSet(5154);        // ShipDocked LightHouseFogHorn.wav
                }
                break;
                case 3031:
                {
                    PlaySoundToSet(11804);        // ZeppelinDocked    ZeppelinHorn.wav
                }
                break;
                default:
                {
                    PlaySoundToSet(5495);        // BoatDockingWarning    BoatDockedWarning.wav
                }
                break;
            }
            TransportGossip(GetInfo()->DisplayID);
        }
    }
}
コード例 #3
0
void Transporter::UpdatePosition()
{
    if (m_WayPoints.size() <= 1)
        return;

    m_timer = getMSTime() % m_period;

    while (((m_timer - mCurrentWaypoint->first) % m_pathTime) >= ((mNextWaypoint->first - mCurrentWaypoint->first) % m_pathTime))
    {
        mCurrentWaypoint = mNextWaypoint;
        mNextWaypoint = GetNextWaypoint();
        if (mNextWaypoint->second.mapid != GetMapId() || mCurrentWaypoint->second.teleport)
        {
            TransportPassengers(mNextWaypoint->second.mapid, GetMapId(), mNextWaypoint->second.x, mNextWaypoint->second.y, mNextWaypoint->second.z);
            break;
        }

        SetPosition(mNextWaypoint->second.x, mNextWaypoint->second.y, mNextWaypoint->second.z, m_position.o);
        if(mCurrentWaypoint->second.delayed)
        {
            PlaySoundToSet(5495);       // BoatDockedWarning.wav
        }
    }
}