當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetPathAtMapEnd函數代碼示例

本文整理匯總了C++中GetPathAtMapEnd函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetPathAtMapEnd函數的具體用法?C++ GetPathAtMapEnd怎麽用?C++ GetPathAtMapEnd使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetPathAtMapEnd函數的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: AddPct

void FlightPathMovementGenerator::DoReset(Player* owner)
{
    if (!owner)
        return;

    if (!owner->isAlive())
        return;

    float playerFlightSpeed = 32.0f;

    // Add percentage from SPELL_AURA_MOD_TAXI_FLIGHT_SPEED.
    Unit::AuraEffectList const& mIncreaseTaxiFlightSpeed = owner->GetAuraEffectsByType(SPELL_AURA_MOD_TAXI_FLIGHT_SPEED);
    for (Unit::AuraEffectList::const_iterator i = mIncreaseTaxiFlightSpeed.begin(); i != mIncreaseTaxiFlightSpeed.end(); ++i)
        AddPct(playerFlightSpeed, (*i)->GetAmount());

    owner->getHostileRefManager().setOnlineOfflineState(false);
    owner->AddUnitState(UNIT_STATE_IN_FLIGHT);
    owner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    Movement::MoveSplineInit init(*owner);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i != end; ++i)
    {
        G3D::Vector3 vertice((*i_path)[i].x, (*i_path)[i].y, (*i_path)[i].z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetSmooth();
    init.SetWalk(true);
    init.SetVelocity(playerFlightSpeed);
    init.Launch();
}
開發者ID:concept45,項目名稱:Core,代碼行數:33,代碼來源:WaypointMovementGenerator.cpp

示例2: traveller

void FlightPathMovementGenerator::Reset(Player & player)
{
    player.getHostileRefManager().setOnlineOfflineState(false);
    player.addUnitState(UNIT_STAT_TAXI_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);

    player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(), SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING));
}
開發者ID:Adalinator,項目名稱:mangos,代碼行數:11,代碼來源:WaypointMovementGenerator.cpp

示例3: traveller

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());
}
開發者ID:CamelPown,項目名稱:TrueBl0OD,代碼行數:12,代碼來源:WaypointMovementGenerator.cpp

示例4: LoadPath

void FlightPathMovementGenerator::Initialize(Player &player)
{
    player.getHostilRefManager().setOnlineOfflineState(false);
    player.addUnitState(UNIT_STAT_IN_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
    LoadPath(player);
    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);

    player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(),MOVEMENTFLAG_WALK_MODE|MOVEMENTFLAG_ONTRANSPORT);
}
開發者ID:spiritos,項目名稱:mangos,代碼行數:12,代碼來源:WaypointMovementGenerator.cpp

示例5: GetPath

void FlightPathMovementGenerator::ResendPathToOtherPlayers(Player& player)
{
    TaxiPathNodeList path = GetPath();
    uint32 pathEndPoint = GetPathAtMapEnd();
    uint32 traveltime = uint32(PLAYER_FLIGHT_SPEED * (path.GetTotalLength(GetCurrentNode(),pathEndPoint) 
            - player.GetDistance(path[GetCurrentNode()].x, path[GetCurrentNode()].y, path[GetCurrentNode()].z)));
    player.SendMonsterMoveByPath(path,
                                 GetCurrentNode(),
                                 pathEndPoint, 
                                 SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING), 
                                 traveltime,
                                 true );
} 
開發者ID:Phatcat,項目名稱:mangos,代碼行數:13,代碼來源:WaypointMovementGenerator.cpp

示例6: traveller

void FlightPathMovementGenerator::Reset(Player & player)
{
    player.getHostileRefManager().setOnlineOfflineState(false);
    player.addUnitState(UNIT_STAT_TAXI_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);

    TaxiPathNodeList path = GetPath();
    uint32 pathEndPoint = GetPathAtMapEnd();
    uint32 traveltime = uint32(PLAYER_FLIGHT_SPEED * path.GetTotalLength(GetCurrentNode(),pathEndPoint));
    player.SendMonsterMoveByPath(path,GetCurrentNode(),pathEndPoint, SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING), traveltime );
}
開發者ID:Phatcat,項目名稱:mangos,代碼行數:14,代碼來源:WaypointMovementGenerator.cpp

示例7: init

void FlightPathMovementGenerator::_Reset(Player & player)
{
    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i != end; ++i)
    {
        G3D::Vector3 vertice((*i_path)[i].x,(*i_path)[i].y,(*i_path)[i].z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetVelocity(PLAYER_FLIGHT_SPEED);
    init.Launch();
}
開發者ID:Splash,項目名稱:mangos,代碼行數:14,代碼來源:WaypointMovementGenerator.cpp

示例8: LoadPath

void FlightPathMovementGenerator::Initialize(Player &player)
{
    // Random handlers used for quests etc. - best would be to add FlightPathMovementGenerator::Initialize to sub-script class (Feanor)
    if( player.m_taxi.GetTaxiDestination() == 158 || player.m_taxi.GetTaxiDestination() == 243 )
        player.SetDisplayId(16587);

    player.getHostileRefManager().setOnlineOfflineState(false);
    player.addUnitState(UNIT_STAT_IN_FLIGHT);
    player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
    LoadPath(player);
    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);

    player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(), SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING));
}
開發者ID:Lirok,項目名稱:mangos,代碼行數:16,代碼來源:WaypointMovementGenerator.cpp

示例9: init

void FlightPathMovementGenerator::DoReset(Player* player)
{
    player->getHostileRefManager().setOnlineOfflineState(false);
    player->AddUnitState(UNIT_STATE_IN_FLIGHT);
    player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i < end; ++i)
    {
        G3D::Vector3 vertice(i_path[i]->x, i_path[i]->y, i_path[i]->z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetVelocity(PLAYER_FLIGHT_SPEED);
    init.Launch();
}
開發者ID:Helias,項目名稱:azerothcore-wotlk,代碼行數:18,代碼來源:WaypointMovementGenerator.cpp

示例10: init

void FlightPathMovementGenerator::Reset(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);

    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i != end; ++i)
    {
        G3D::Vector3 vertice((*i_path)[i].x,(*i_path)[i].y,(*i_path)[i].z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetVelocity(32.0f);
    init.Launch();
}
開發者ID:Shutok,項目名稱:HeavensGate,代碼行數:18,代碼來源:WaypointMovementGenerator.cpp

示例11: init

void FlightPathMovementGenerator::DoReset(Player* player)
{
    player->AddUnitState(UNIT_STATE_IN_FLIGHT);
    player->CombatStopWithPets();
    player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);

    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = GetCurrentNode(); i != end; ++i)
    {
        G3D::Vector3 vertice(_path[i]->LocX, _path[i]->LocY, _path[i]->LocZ);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(GetCurrentNode());
    init.SetFly();
    init.SetVelocity(PLAYER_FLIGHT_SPEED);
    init.Launch();
}
開發者ID:m-uu,項目名稱:ElunaTrinityWotlk,代碼行數:18,代碼來源:FlightPathMovementGenerator.cpp

示例12: init

void FlightPathMovementGenerator::DoReset(Player* player)
{
    player->getHostileRefManager().setOnlineOfflineState(false);
    player->AddUnitState(UNIT_STATE_IN_FLIGHT);
    player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);

    Movement::MoveSplineInit init(player);
    uint32 end = GetPathAtMapEnd();
    for (uint32 i = i_currentNode; i != end; ++i)
    {
        G3D::Vector3 vertice(i_path[i]->Loc.X, i_path[i]->Loc.Y, i_path[i]->Loc.Z);
        init.Path().push_back(vertice);
    }
    init.SetFirstPointId(i_currentNode);
    init.SetFly();
    init.SetSmooth();
    init.SetUncompressed();
    init.SetWalk(true);
    init.SetVelocity(PLAYER_FLIGHT_SPEED);
    init.Launch();
}
開發者ID:090809,項目名稱:TrinityCore,代碼行數:21,代碼來源:WaypointMovementGenerator.cpp

示例13: LoadPath

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);
    LoadPath(player);
    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);

    player.SendMonsterMoveByPath(GetPath(), GetCurrentNode(), GetPathAtMapEnd());

    // Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will
    // be reinitialized for each flightmaster at the end of each spline (or stop) in the flight.

    uint32 nodeCount = i_mapIds.size();     // Get the number of nodes in the path. i_path and i_mapIds are the
                                            //  same size when loaded in ObjectMgr::GetTaxiPathNodes, called from LoadPath()

    m_endMapId = i_mapIds[nodeCount -1];    // Get the map ID from the last node
    m_preloadTargetNode = nodeCount - 3;    // 2 nodes before the final node, we pre-load the grid
    m_endGridX = i_path[nodeCount -1].x;    // Get the X position from the last node
    m_endGridY = i_path[nodeCount -1].y;    // Get tye Y position from the last node
}
開發者ID:ShadowCore,項目名稱:ShadowCore,代碼行數:23,代碼來源:WaypointMovementGenerator.cpp


注:本文中的GetPathAtMapEnd函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。