当前位置: 首页>>代码示例>>C++>>正文


C++ Group::ConvertToRaid方法代码示例

本文整理汇总了C++中Group::ConvertToRaid方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::ConvertToRaid方法的具体用法?C++ Group::ConvertToRaid怎么用?C++ Group::ConvertToRaid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Group的用法示例。


在下文中一共展示了Group::ConvertToRaid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HandleGroupRaidConvertOpcode

void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recvData*/)
{
    ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT");

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    if (_player->InBattleground())
        return;

    /** error handling **/
    if (!group->IsLeader(GetPlayer()->GetGUID()) || group->GetMembersCount() < 2 || group->isLFGGroup()) // pussywizard: not allowed for lfg groups, it is either raid from the beginning or not!
        return;
    /********************/

    // everything's fine, do it (is it 0 (PARTY_OP_INVITE) correct code)
    SendPartyResult(PARTY_OP_INVITE, "", ERR_PARTY_RESULT_OK);
    group->ConvertToRaid();
}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:20,代码来源:GroupHandler.cpp

示例2: HandleGroupRaidConvertOpcode

void WorldSession::HandleGroupRaidConvertOpcode( WorldPacket & /*recv_data*/ )
{
    Group *group = GetPlayer()->GetGroup();
    if(!group)
        return;

    if(_player->InBattleGround())
        return;

    /** error handling **/
    if (!group->IsLeader(GetPlayer()->GetObjectGuid()) || group->GetMembersCount() < 2)
        return;
    /********************/

    if(group->isLFDGroup())
        return;

    // everything is fine, do it (is it 0 (PARTY_OP_INVITE) correct code)
    SendPartyResult(PARTY_OP_INVITE, "", ERR_PARTY_RESULT_OK);
    group->ConvertToRaid();
}
开发者ID:gc,项目名称:mangos,代码行数:21,代码来源:GroupHandler.cpp

示例3: HandleConvertRaidOpcode

void WorldSession::HandleConvertRaidOpcode(WorldPackets::Party::ConvertRaid& packet)
{
    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    if (_player->InBattleground())
        return;

    // error handling
    if (!group->IsLeader(GetPlayer()->GetGUID()) || group->GetMembersCount() < 2)
        return;

    // everything's fine, do it (is it 0 (PARTY_OP_INVITE) correct code)
    SendPartyResult(PARTY_OP_INVITE, "", ERR_PARTY_RESULT_OK);

    // New 4.x: it is now possible to convert a raid to a group if member count is 5 or less
    if (packet.Raid)
        group->ConvertToRaid();
    else
        group->ConvertToGroup();
}
开发者ID:welder1976,项目名称:DraenorCore,代码行数:22,代码来源:GroupHandler.cpp

示例4: AddPlayerToGroup

bool Battlefield::AddPlayerToGroup(Player * player)
{
    Group* grp;
    if(player->GetTeam() == ALLIANCE)
        grp = m_raidGroup[TEAM_ALLIANCE];
    else
        grp = m_raidGroup[TEAM_HORDE];

    if(!grp->IsCreated())
    {
        grp->Create(player->GetObjectGuid(),player->GetName());
        grp->ConvertToRaid();
        grp->AddMember(player->GetObjectGuid(),player->GetName());
    }
    else if(!grp->IsFull())
    {
        grp->AddMember(player->GetObjectGuid(),player->GetName());
    }
    else
        return false;

    return true;
}
开发者ID:Stylerdk,项目名称:StrawberryCore,代码行数:23,代码来源:Battlefield.cpp

示例5: HandleMoveWorldportAckOpcode

void WorldSession::HandleMoveWorldportAckOpcode( WorldPacket & /*recv_data*/ )
{
    sLog.outDebug( "WORLD: got MSG_MOVE_WORLDPORT_ACK." );

    MapEntry const* mEntry = sMapStore.LookupEntry(GetPlayer()->GetMapId());
    if(!mEntry || !MaNGOS::IsValidMapCoord(GetPlayer()->GetPositionX(),GetPlayer()->GetPositionY()))
    {
        LogoutPlayer(false);
        return;
    }

    // reset instance validity
    GetPlayer()->m_InstanceValid = true;

    GetPlayer()->SetSemaphoreTeleport(false);

    GetPlayer()->SendInitialPacketsBeforeAddToMap();
    MapManager::Instance().GetMap(GetPlayer()->GetMapId(), GetPlayer())->Add(GetPlayer());
    GetPlayer()->SendInitialPacketsAfterAddToMap();

    // flight fast teleport case
    if(GetPlayer()->GetMotionMaster()->top()->GetMovementGeneratorType()==FLIGHT_MOTION_TYPE)
    {
        if(!_player->InBattleGround())
        {
            // short preparations to continue flight
            FlightPathMovementGenerator* flight = (FlightPathMovementGenerator*)(GetPlayer()->GetMotionMaster()->top());
            flight->Initialize(*GetPlayer());

            SendPath(flight->GetPath(),flight->GetCurrentNode(),flight->GetPathAtMapEnd());

            GetPlayer()->SetDontMove(false);
            return;
        }

        // battleground state prepre, stop flight
        GetPlayer()->GetMotionMaster()->MovementExpired();
        GetPlayer()->FlightComplete();
        GetPlayer()->ClearTaxiDestinations();
        GetPlayer()->StopMoving();
    }

    // resurrect character at enter into instance where his corpse exist after add to map
    Corpse *corpse = GetPlayer()->GetCorpse();
    if (corpse && corpse->GetType() == CORPSE_RESURRECTABLE && corpse->GetMapId() == GetPlayer()->GetMapId())
    {
        if( mEntry && (mEntry->map_type == MAP_INSTANCE || mEntry->map_type == MAP_RAID) )
        {
            GetPlayer()->ResurrectPlayer(0.5f,false);
            GetPlayer()->SpawnCorpseBones();
            GetPlayer()->SaveToDB();
        }
    }

    // mount allow check
    if(!_player->GetBaseMap()->IsMountAllowed())
        _player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);

    // battleground state preper
    if(_player->InBattleGround())
    {
        BattleGround *bg = _player->GetBattleGround();
        if(bg)
        {
            if(bg->GetMapId() == _player->GetMapId())       // we teleported to bg
            {
                if(!bg->GetBgRaid(_player->GetTeam()))      // first player joined
                {
                    Group *group = new Group;
                    bg->SetBgRaid(_player->GetTeam(), group);
                    group->ConvertToRaid();
                    group->AddMember(_player->GetGUID(), _player->GetName());
                    group->ChangeLeader(_player->GetGUID());
                }
                else                                        // raid already exist
                {
                    bg->GetBgRaid(_player->GetTeam())->AddMember(_player->GetGUID(), _player->GetName());
                }
            }
        }
    }

    // honorless target
    if(GetPlayer()->pvpInfo.inHostileArea)
        GetPlayer()->CastSpell(GetPlayer(), 2479, true);

    // resummon pet
    if(GetPlayer()->m_oldpetnumber)
    {
        Pet* NewPet = new Pet(GetPlayer());
        if(!NewPet->LoadPetFromDB(GetPlayer(), 0, GetPlayer()->m_oldpetnumber, true))
            delete NewPet;

        GetPlayer()->m_oldpetnumber = 0;
    }

    GetPlayer()->SetDontMove(false);
}
开发者ID:Artea,项目名称:mangos-svn,代码行数:98,代码来源:MovementHandler.cpp


注:本文中的Group::ConvertToRaid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。