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


C++ GuidSet::end方法代码示例

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


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

示例1: Update

            void Update(uint32 diff) override
            {
                if (CageTimer)
                {
                    if (CageTimer <= diff)
                    {
                        Creature* Magtheridon = instance->GetCreature(MagtheridonGUID);
                        if (Magtheridon && Magtheridon->IsAlive())
                        {
                            Magtheridon->ClearUnitState(UNIT_STATE_STUNNED);
                            Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999));
                        }
                        CageTimer = 0;
                    } else CageTimer -= diff;
                }

                if (RespawnTimer)
                {
                    if (RespawnTimer <= diff)
                    {
                        for (GuidSet::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
                        {
                            if (Creature* Channeler = instance->GetCreature(*i))
                            {
                                if (Channeler->IsAlive())
                                    Channeler->AI()->EnterEvadeMode();
                                else
                                    Channeler->Respawn();
                            }
                        }
                        RespawnTimer = 0;
                    } else RespawnTimer -= diff;
                }
            }
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:34,代码来源:instance_magtheridons_lair.cpp

示例2: ActivatePrisoners

 void ActivatePrisoners(GuidSet const& prisoners)
 {
     for (GuidSet::const_iterator i = prisoners.begin(); i != prisoners.end(); ++i)
         if (Creature* prisoner = instance->GetCreature(*i))
         {
             prisoner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
             prisoner->SetInCombatWithZone();
         }
 }
开发者ID:beyourself,项目名称:LordPsyanBots,代码行数:9,代码来源:instance_blood_furnace.cpp

示例3: MoveInLineOfSight

 void MoveInLineOfSight(Unit* pWho) override
 {
     // Cosmetic spell
     if (m_sWretchedGuids.find(pWho->GetObjectGuid()) == m_sWretchedGuids.end() && pWho->IsWithinDist(m_creature, 5.0f) && pWho->isAlive() &&
             (pWho->GetEntry() == NPC_SKULER || pWho->GetEntry() == NPC_BRUISER || pWho->GetEntry() == NPC_HUSK))
     {
         pWho->CastSpell(m_creature, SPELL_FEL_CRYSTAL_COSMETIC, false);
         m_sWretchedGuids.insert(pWho->GetObjectGuid());
     }
 }
开发者ID:AlexHjelm,项目名称:Core,代码行数:10,代码来源:boss_selin_fireheart.cpp

示例4: MoveInLineOfSight

 void MoveInLineOfSight(Unit* pWho) override
 {
     // Note: this implementation is not the best; It should be better handled by the guard script
     if (m_bCanGuardSalute && (pWho->GetEntry() == NPC_GUARD_CITY || pWho->GetEntry() == NPC_GUARD_ROYAL ||
                               pWho->GetEntry() == NPC_GUARD_PATROLLER) && pWho->IsWithinDistInMap(m_creature, 15.0f) &&
             m_sGuardsSalutedGuidSet.find(pWho->GetObjectGuid()) == m_sGuardsSalutedGuidSet.end() && pWho->IsWithinLOSInMap(m_creature))
     {
         DoScriptText(aGuardSalute[urand(0, MAX_GUARD_SALUTES - 1)], pWho);
         m_sGuardsSalutedGuidSet.insert(pWho->GetObjectGuid());
     }
 }
开发者ID:Celtus,项目名称:custom-core2,代码行数:11,代码来源:stormwind_city.cpp

示例5: loadSendLogs

void CLogSerializer::loadSendLogs(GuidSet& ackSet, GuidMap& missedLogs, unsigned long& total_missed)//
{
    try
    {
        Close(); //release old file io, if any
        m_file = createIFile(m_FilePath.str());
        m_fileio = m_file->open(IFOread);
        if (m_fileio == 0)
            throw MakeStringException(-1, "Unable to open logging file %s",m_FilePath.str());

        offset_t finger = 0;
        total_missed = 0;
        while(true)
        {
            char dataSize[9];
            memset(dataSize, 0, 9);
            size32_t bytesRead = m_fileio->read(finger,8,dataSize);
            if(bytesRead==0)
                break;

            MemoryBuffer data;
            int dataLen = atoi(dataSize);
            finger+=9;
            bytesRead = m_fileio->read(finger,dataLen,data.reserveTruncate(dataLen));
            if(bytesRead==0)
                break;

            StringBuffer GUID,lostlogStr;
            splitLogRecord(data,GUID,lostlogStr);

            if (ackSet.find(GUID.str())==ackSet.end() && missedLogs.find(GUID.str()) == missedLogs.end())
            {
                if(total_missed % TRACE_INTERVAL == 0)
                    DBGLOG("Miss #%lu GUID: <%s>", total_missed, GUID.str());
                missedLogs[GUID.str()] = lostlogStr.str();
                total_missed++;
            }
            finger+=dataLen;
        }
    }
    catch(IException* ex)
    {
        StringBuffer errorStr;
        ex->errorMessage(errorStr);
        ERRLOG("Exception caught within CSendLogSerializer::LoadDataMap: %s",errorStr.str());
        ex->Release();
    }
    catch(...)
    {
        DBGLOG("Unknown Exception thrown in CSendLogSerializer::LoadDataMap");
    }
    Close();
}
开发者ID:stuartort,项目名称:HPCC-Platform,代码行数:53,代码来源:LogSerializer.cpp

示例6: DespawnIntroCreatures

    void DespawnIntroCreatures()
    {
        if (m_pInstance)
        {
            for (GuidSet::const_iterator itr = m_lIntroMobsSet.begin(); itr != m_lIntroMobsSet.end(); ++itr)
            {
                if (Creature* pCreature = m_pInstance->instance->GetCreature(*itr))
                    pCreature->ForcedDespawn();
            }
        }

        m_lIntroMobsSet.clear();
    }
开发者ID:conan513,项目名称:mangos-wotlk,代码行数:13,代码来源:boss_kelthuzad.cpp

示例7: RemovePassenger

bool Transport::RemovePassenger(WorldObject* passenger)
{
    GetTransportKit()->RemovePassenger(passenger);
    if (passenger->isType(TYPEMASK_UNIT))
    {
        GuidSet groupPetsCopy = ((Unit*)passenger)->GetPets();
        if (!groupPetsCopy.empty())
        {
            for (GuidSet::const_iterator itr = groupPetsCopy.begin(); itr != groupPetsCopy.end(); ++itr)
                if (Pet* pPet = GetMap()->GetPet(*itr))
                    if (pPet && pPet->IsInWorld())
                        GetTransportKit()->RemovePassenger(pPet);
        }
    }
    return true;
}
开发者ID:beyourself,项目名称:RustEmu-Core,代码行数:16,代码来源:Transports.cpp

示例8: HandleObjectiveComplete

void WorldPvPNA::HandleObjectiveComplete(GuidSet m_sPlayersSet, uint32 uiEventId)
{
    if (uiEventId == EVENT_HALAA_BANNER_WIN_ALLIANCE || uiEventId == EVENT_HALAA_BANNER_WIN_HORDE)
    {
        for (GuidSet::iterator itr = m_sPlayersSet.begin(); itr != m_sPlayersSet.end(); ++itr)
        {
            if (!(*itr))
                continue;

            Player* pPlayer = sObjectMgr.GetPlayer(*itr);

            if (!pPlayer)
                continue;

            pPlayer->KilledMonsterCredit(NPC_HALAA_COMBATANT);
        }
    }
}
开发者ID:alolo,项目名称:mangos,代码行数:18,代码来源:WorldPvPNA.cpp

示例9: DespawnAdds

    void DespawnAdds()
    {
        if (m_pInstance)
        {
            for (GuidSet::const_iterator itr = m_lAddsSet.begin(); itr != m_lAddsSet.end(); ++itr)
            {
                if (Creature* pCreature = m_pInstance->instance->GetCreature(*itr))
                {
                    if (pCreature->isAlive())
                    {
                        pCreature->AI()->EnterEvadeMode();
                        pCreature->ForcedDespawn(15000);
                    }
                }
            }
        }

        m_lAddsSet.clear();
    }
开发者ID:conan513,项目名称:mangos-wotlk,代码行数:19,代码来源:boss_kelthuzad.cpp

示例10: ResetPrisoners

 void ResetPrisoners(GuidSet const& prisoners)
 {
     for (GuidSet::const_iterator i = prisoners.begin(); i != prisoners.end(); ++i)
         if (Creature* prisoner = instance->GetCreature(*i))
             ResetPrisoner(prisoner);
 }
开发者ID:beyourself,项目名称:LordPsyanBots,代码行数:6,代码来源:instance_blood_furnace.cpp

示例11: SetData

 void SetData(uint32 type, uint32 data) override
 {
     switch (type)
     {
     case DATA_MAGTHERIDON_EVENT:
         m_auiEncounter[0] = data;
         if (data == NOT_STARTED)
             RespawnTimer = 10000;
         if (data != IN_PROGRESS)
            HandleGameObject(DoorGUID, true);
         break;
     case DATA_CHANNELER_EVENT:
         switch (data)
         {
         case NOT_STARTED: // Reset all channelers once one is reset.
             if (m_auiEncounter[1] != NOT_STARTED)
             {
                 m_auiEncounter[1] = NOT_STARTED;
                 for (GuidSet::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
                 {
                     if (Creature* Channeler = instance->GetCreature(*i))
                     {
                         if (Channeler->IsAlive())
                             Channeler->AI()->EnterEvadeMode();
                         else
                             Channeler->Respawn();
                     }
                 }
                 CageTimer = 0;
                 HandleGameObject(DoorGUID, true);
             }
             break;
         case IN_PROGRESS: // Event start.
             if (m_auiEncounter[1] != IN_PROGRESS)
             {
                 m_auiEncounter[1] = IN_PROGRESS;
                 // Let all five channelers aggro.
                 for (GuidSet::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
                 {
                     Creature* Channeler = instance->GetCreature(*i);
                     if (Channeler && Channeler->IsAlive())
                         Channeler->AI()->AttackStart(Channeler->SelectNearestTarget(999));
                 }
                 // Release Magtheridon after two minutes.
                 Creature* Magtheridon = instance->GetCreature(MagtheridonGUID);
                 if (Magtheridon && Magtheridon->IsAlive())
                 {
                     Magtheridon->TextEmote(EMOTE_BONDS_WEAKEN);
                     CageTimer = 120000;
                 }
                 HandleGameObject(DoorGUID, false);
             }
             break;
         case DONE: // Add buff and check if all channelers are dead.
             for (GuidSet::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i)
             {
                 Creature* Channeler = instance->GetCreature(*i);
                 if (Channeler && Channeler->IsAlive())
                 {
                     //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true);
                     data = IN_PROGRESS;
                     break;
                 }
             }
             break;
         }
         m_auiEncounter[1] = data;
         break;
     case DATA_COLLAPSE:
         // true - collapse / false - reset
         for (GuidSet::const_iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i)
             DoUseDoorOrButton(*i);
         break;
     default:
         break;
     }
 }
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:77,代码来源:instance_magtheridons_lair.cpp

示例12: SetupBattlefield

bool BattlefieldTB::SetupBattlefield()
{
    m_TypeId                    = BATTLEFIELD_TB;
    m_BattleId                  = BATTLEFIELD_BATTLEID_TB;
    m_ZoneId                    = BATTLEFIELD_TB_ZONEID;
    m_MapId                     = BATTLEFIELD_TB_MAPID;

    m_MaxPlayer                 = sWorld->getIntConfig(CONFIG_TOL_BARAD_PLR_MAX);
    m_IsEnabled                 = sWorld->getBoolConfig(CONFIG_TOL_BARAD_ENABLE);
    m_MinPlayer                 = sWorld->getIntConfig(CONFIG_TOL_BARAD_PLR_MIN);
    m_MinLevel                  = sWorld->getIntConfig(CONFIG_TOL_BARAD_PLR_MIN_LVL);
    m_BattleTime                = sWorld->getIntConfig(CONFIG_TOL_BARAD_BATTLETIME) * MINUTE * IN_MILLISECONDS;
    m_NoWarBattleTime           = sWorld->getIntConfig(CONFIG_TOL_BARAD_NOBATTLETIME) * MINUTE * IN_MILLISECONDS;
    m_RestartAfterCrash         = sWorld->getIntConfig(CONFIG_TOL_BARAD_RESTART_AFTER_CRASH) * MINUTE * IN_MILLISECONDS;

    m_TimeForAcceptInvite       = 20;
    m_StartGroupingTimer        = 15 * MINUTE * IN_MILLISECONDS;
    m_StartGrouping             = false;

    KickPosition.Relocate(-630.460f, 1184.504f, 95.766f, 0);
    KickPosition.m_mapId        = m_MapId;

    RegisterZone(m_ZoneId);

    m_Data32.resize(BATTLEFIELD_TB_DATA_MAX);

    m_Data32[BATTLEFIELD_TB_DATA_CAPTURED] = 0;

    m_saveTimer                 = 60000;

    SetGraveyardNumber(BATTLEFIELD_TB_GY_MAX);

    if ((sWorld->getWorldState(WS_TB_NEXT_BATTLE_TIMER_ENABLED) == 0) && (sWorld->getWorldState(WS_TB_HORDE_DEFENCE) == 0) && (sWorld->getWorldState(ClockBTWorldState[0]) == 0))
    {
        sWorld->setWorldState(WS_TB_NEXT_BATTLE_TIMER_ENABLED, uint64(false));
        sWorld->setWorldState(WS_TB_HORDE_DEFENCE, uint64(urand(0, 1)));
        sWorld->setWorldState(ClockBTWorldState[0], uint64(m_NoWarBattleTime));
    }

    if (sWorld->getWorldState(WS_TB_UNK) == 0)
        sWorld->setWorldState(WS_TB_UNK, urand(1, 3));

    if (sWorld->getWorldState(WS_TB_UNK_2) == 0)
        sWorld->setWorldState(WS_TB_UNK_2, time(NULL) + 86400);

    m_isActive = bool(sWorld->getWorldState(WS_TB_NEXT_BATTLE_TIMER_ENABLED));
    m_DefenderTeam = (TeamId)sWorld->getWorldState(WS_TB_HORDE_DEFENCE);

    m_Timer = sWorld->getWorldState(ClockBTWorldState[0]);

    if (m_isActive)
    {
        m_isActive = false;
        m_Timer = m_RestartAfterCrash;
    }

    for (uint8 i = 0; i < BATTLEFIELD_TB_GY_MAX; i++)
    {
        BfGraveyardTB* graveyard = new BfGraveyardTB(this);
        graveyard->Initialize(TBGraveYard[i].entryh, TBGraveYard[i].entrya, TBGraveYard[i].x, TBGraveYard[i].y,  TBGraveYard[i].z, TBGraveYard[i].o, m_DefenderTeam, TBGraveYard[i].gyid);
        m_GraveyardList[i] = graveyard;
    }

    for (uint8 i = 0; i < TB_MAX_WORKSHOP; i++)
    {
        BfTBWorkShopData* workshop = new BfTBWorkShopData(this);

        workshop->Init(TBWorkShopDataBase[i].worldstate, TBWorkShopDataBase[i].type, TBWorkShopDataBase[i].nameid);
        workshop->ChangeControl(GetDefenderTeam(),true);

        BfCapturePointTB* point = new BfCapturePointTB(this, GetDefenderTeam());

        point->SetCapturePointData(GetDefenderTeam() == TEAM_ALLIANCE ? TBWorkShopDataBase[i].CapturePoint.entrya : TBWorkShopDataBase[i].CapturePoint.entryh, BATTLEFIELD_TB_MAPID,
            TBWorkShopDataBase[i].CapturePoint.x, TBWorkShopDataBase[i].CapturePoint.y, TBWorkShopDataBase[i].CapturePoint.z, 0);
        point->LinkToWorkShop(workshop);
        AddCapturePoint(point);

        CapturePoints.insert(point);

        WorkShopList.insert(workshop);
    }

    for (uint8 i = 0; i < TB_MAX_DESTROY_MACHINE_NPC; i++)
    {
        if (Creature* creature = SpawnCreature(TBDestroyMachineNPC[i].entrya, TBDestroyMachineNPC[i].x, TBDestroyMachineNPC[i].y, TBDestroyMachineNPC[i].z, TBDestroyMachineNPC[i].o, GetAttackerTeam()))
        {
            HideNpc(creature);
            Vehicles.insert(creature->GetGUID());
        }
    }

    for (uint8 i = 0; i < TB_MAX_OBJ; i++)
    {
        GameObject* go = SpawnGameObject(TBGameObjectBuillding[i].entry, BATTLEFIELD_TB_MAPID, TBGameObjectBuillding[i].x, TBGameObjectBuillding[i].y, TBGameObjectBuillding[i].z, TBGameObjectBuillding[i].o);
        BfTBGameObjectBuilding* b = new BfTBGameObjectBuilding(this);
        b->Init(go,TBGameObjectBuillding[i].type,TBGameObjectBuillding[i].WorldState,TBGameObjectBuillding[i].nameid);
        b->m_State = BATTLEFIELD_TB_OBJECTSTATE_ALLIANCE_INTACT - (GetDefenderTeam() * 3);
        BuildingsInZone.insert(b);
    }

//.........这里部分代码省略.........
开发者ID:Lbniese,项目名称:WoWCircle434,代码行数:101,代码来源:BattlefieldTB.cpp

示例13: SendLfgUpdateList

void WorldSession::SendLfgUpdateList(uint32 dungeonID)
{
    if (!sWorld.getConfig(CONFIG_BOOL_LFR_ENABLE))
    {
        DEBUG_LOG("SendLfgUpdateList %u failed - Raid finder disabled", GetPlayer()->GetObjectGuid().GetCounter());
        return;
    }

    DEBUG_LOG("SMSG_LFG_SEARCH_RESULTS %u dungeonentry: %u ", GetPlayer()->GetObjectGuid().GetCounter(), dungeonID);

    LFGDungeonEntry const* dungeon = sLFGMgr.GetDungeon(dungeonID);

    if (!dungeon)
        return;

    Team team = sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GROUP) ? TEAM_NONE : GetPlayer()->GetTeam();

    GuidSet groups = sLFGMgr.GetDungeonGroupQueue(dungeon, team);
    GuidSet players = sLFGMgr.GetDungeonPlayerQueue(dungeon, team);

    uint32 groupCount = groups.size();
    uint32 groupSize = 4+4;

    for (GuidSet::const_iterator itr = groups.begin(); itr != groups.end(); ++itr)
    {
        Group* pGroup   = sObjectMgr.GetGroup(*itr);
        if (!pGroup)
            continue;

        Player* pLeader = sObjectMgr.GetPlayer(pGroup->GetLeaderGuid());
        if (!pLeader)
            continue;

        sLFGMgr.GetLFGPlayerState(pLeader->GetObjectGuid())->AddFlags(LFG_MEMBER_FLAG_CHARINFO |
                                        LFG_MEMBER_FLAG_COMMENT |
                                        LFG_MEMBER_FLAG_GROUPLEADER |
                                        LFG_MEMBER_FLAG_GROUPGUID |
                                        LFG_MEMBER_FLAG_ROLES |
                                        LFG_MEMBER_FLAG_AREA  |
                                        LFG_MEMBER_FLAG_STATUS  |
                                        LFG_MEMBER_FLAG_BIND);

        uint32 flags = sLFGMgr.GetLFGPlayerState(pLeader->GetObjectGuid())->GetFlags();

        if (flags & LFG_MEMBER_FLAG_COMMENT)
            groupSize += sLFGMgr.GetLFGPlayerState(pLeader->GetObjectGuid())->GetComment().size()+1;
        if (flags & LFG_MEMBER_FLAG_ROLES)
            groupSize +=3;
        if (flags & LFG_MEMBER_FLAG_BIND)
            groupSize += (8+4);

        players.insert(*itr);

        for (GroupReference *itr2 = pGroup->GetFirstMember(); itr2 != NULL; itr2 = itr2->next())
        {
            Player* player = itr2->getSource();

            if (!player || player == pLeader)
                continue;

            sLFGMgr.GetLFGPlayerState(player->GetObjectGuid())->AddFlags(LFG_MEMBER_FLAG_GROUPLEADER |
                                        LFG_MEMBER_FLAG_GROUPGUID |
                                        LFG_MEMBER_FLAG_STATUS);

            sLFGMgr.GetLFGPlayerState(player->GetObjectGuid())->RemoveFlags(LFG_MEMBER_FLAG_CHARINFO |
                                        LFG_MEMBER_FLAG_COMMENT |
                                        LFG_MEMBER_FLAG_ROLES |
                                        LFG_MEMBER_FLAG_AREA  |
                                        LFG_MEMBER_FLAG_BIND);
            players.insert(player->GetObjectGuid());
        }

    }

    uint32 playerCount = players.size();
    uint32 playerSize = 4+4;

    uint32 guidsSize = 0;
    GuidSet playersUpdated;
    playersUpdated.clear();

    for(GuidSet::const_iterator itr = players.begin(); itr != players.end(); ++itr)
    {
        Player* player   = sObjectMgr.GetPlayer(*itr);

        if (!player || !player->IsInWorld())
            continue;

        uint32 flags = sLFGMgr.GetLFGPlayerState(player->GetObjectGuid())->GetFlags();

        playerSize += (8+4);

        if (flags &  LFG_MEMBER_FLAG_CHARINFO)
            playerSize += (1+1+1+3+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4);

        if (flags & LFG_MEMBER_FLAG_COMMENT)
            playerSize += sLFGMgr.GetLFGPlayerState(player->GetObjectGuid())->GetComment().size()+1;         // comment

        if (flags & LFG_MEMBER_FLAG_GROUPLEADER)
            playerSize += 1;
//.........这里部分代码省略.........
开发者ID:mangosR2,项目名称:mangos,代码行数:101,代码来源:LFGHandler.cpp

示例14: SendLfgUpdateProposal

void WorldSession::SendLfgUpdateProposal(LFGProposal* pProposal)
{
    if (!sWorld.getConfig(CONFIG_BOOL_LFG_ENABLE))
    {
        DEBUG_LOG("SendLfgUpdateProposal %u failed - Dungeon finder disabled", GetPlayer()->GetObjectGuid().GetCounter());
        return;
    }

    if (!pProposal)
        return;

    LFGDungeonEntry const* dungeon = pProposal->GetDungeon();
    if (!dungeon)
    {
        DEBUG_LOG("SMSG_LFG_PROPOSAL_UPDATE: no dungeon in proposal %u, returning.", pProposal->m_uiID);
        return;
    }

    ObjectGuid guid = GetPlayer()->GetObjectGuid();

    bool isSameDungeon = false;
    bool isSameGroup   = false;

    uint32 completedEncounters = 0;
    LFGRolesMap rolesMap;

    if (Group* group = pProposal->GetGroup())
    {
        for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
        {
            Player* pGroupMember = itr->getSource();
            if (pGroupMember && pGroupMember->IsInWorld())
            {
                rolesMap.insert(std::make_pair(pGroupMember->GetObjectGuid(), sLFGMgr.GetLFGPlayerState(pGroupMember->GetObjectGuid())->GetRoles()));

                if (InstancePlayerBind* bind = pGroupMember->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty)))
                {
                    if (DungeonPersistentState* state = bind->state)
                        completedEncounters |= state->GetCompletedEncountersMask();
                }
            }
        }

        // isContinue = group->isLFGGroup() && sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON;
        isSameDungeon =  dungeon->map == GetPlayer()->GetMapId();
        isSameGroup   =  GetPlayer()->GetGroup() == group;
    }

    GuidSet const proposalGuids = pProposal->GetMembers();
    if (!proposalGuids.empty())
    {
        for (GuidSet::const_iterator itr = proposalGuids.begin(); itr != proposalGuids.end(); ++itr)
        {
            Player* player = sObjectMgr.GetPlayer(*itr);
            if (player && player->IsInWorld())
                rolesMap.insert(std::make_pair(player->GetObjectGuid(), sLFGMgr.GetLFGPlayerState(player->GetObjectGuid())->GetRoles()));
        }
    }

    uint32 size = rolesMap.size();

    DEBUG_LOG("SMSG_LFG_PROPOSAL_UPDATE proposal %u, player %u, state: %u", pProposal->m_uiID, GetPlayer()->GetObjectGuid().GetCounter(), pProposal->GetState());


    WorldPacket data(SMSG_LFG_PROPOSAL_UPDATE, 4 + 1 + 4 + 4 + 1 + 1 + size * (4 + 1 + 1 + 1 + 1 +1));

    data << uint32(dungeon->Entry());                          // Dungeon
    data << uint8(pProposal->GetState());                      // Result state
    data << uint32(pProposal->m_uiID);                         // Internal Proposal ID
    data << uint32(completedEncounters);                       // Bosses killed
    data << uint8(isSameDungeon);                              // Silent (show client window)
    data << uint8(size);                                       // Group size

    for (LFGRolesMap::const_iterator itr = rolesMap.begin(); itr != rolesMap.end(); ++itr)
    {
        Player* pPlayer = sObjectMgr.GetPlayer(itr->first);
        if (!pPlayer)
            continue;

        isSameDungeon =  dungeon->map == pPlayer->GetMapId();
        isSameGroup   =  pPlayer->GetGroup() == pProposal->GetGroup();

        data << uint32(itr->second);                              // Role
        data << uint8(pPlayer->GetObjectGuid() == guid);          // Self player
        data << uint8(isSameDungeon);                             // Not in dungeon
        data << uint8(isSameGroup);                               // Not same group
        data << uint8(sLFGMgr.GetLFGPlayerState(pPlayer->GetObjectGuid())->GetAnswer() != LFG_ANSWER_PENDING); // Answered
        data << uint8(sLFGMgr.GetLFGPlayerState(pPlayer->GetObjectGuid())->GetAnswer() == LFG_ANSWER_AGREE); // Accepted
    }
    SendPacket(&data);
}
开发者ID:mangosR2,项目名称:mangos,代码行数:91,代码来源:LFGHandler.cpp

示例15: UpdateEscortAI

    void UpdateEscortAI(const uint32 uiDiff) override
    {
        if (!m_pInstance)
            return;

        if (m_pInstance->GetData(TYPE_RING_OF_LAW) == FAIL)
        {
            // Reset Doors
            if (m_uiEventPhase >= 10)                       // North Gate is opened
            {
                m_pInstance->DoUseDoorOrButton(GO_ARENA_2);
                m_pInstance->DoUseDoorOrButton(GO_ARENA_4);
            }
            else if (m_uiEventPhase >= 4)                   // East Gate is opened
            {
                m_pInstance->DoUseDoorOrButton(GO_ARENA_1);
                m_pInstance->DoUseDoorOrButton(GO_ARENA_4);
            }

            // Despawn Summoned Mobs
            for (GuidList::const_iterator itr = m_lSummonedGUIDList.begin(); itr != m_lSummonedGUIDList.end(); ++itr)
            {
                if (Creature* pSummoned = m_creature->GetMap()->GetCreature(*itr))
                    pSummoned->ForcedDespawn();
            }
            m_lSummonedGUIDList.clear();

            // Despawn NPC
            m_creature->ForcedDespawn();
            return;
        }

        if (m_uiEventTimer)
        {
            if (m_uiEventTimer <= uiDiff)
            {
                switch (m_uiEventPhase)
                {
                    case 0:
                        // Shortly after spawn, start walking
                        m_creature->CastSpell(m_creature, SPELL_ASHCROMBES_TELEPORT_A, true);
                        DoScriptText(SAY_START_2, m_creature);
                        m_pInstance->DoUseDoorOrButton(GO_ARENA_4);
                        // Some of the NPCs in the crowd do cheer emote at event start
                        // we randomly select 25% of the NPCs to do this
                        m_pInstance->GetArenaCrowdGuid(m_lArenaCrowd);
                        for (GuidSet::const_iterator itr = m_lArenaCrowd.begin(); itr != m_lArenaCrowd.end(); ++itr)
                        {
                            if (Creature* pSpectator = m_creature->GetMap()->GetCreature(*itr))
                            {
                                if (urand(0, 1) < 0.25)
                                    pSpectator->HandleEmote(EMOTE_ONESHOT_CHEER);
                            }
                        }
                        Start(false);
                        SetEscortPaused(false);
                        m_uiEventTimer = 0;
                        break;
                    case 1:
                        // Start walking towards wall
                        SetEscortPaused(false);
                        m_uiEventTimer = 0;
                        break;
                    case 2:
                        m_uiEventTimer = 2000;
                        break;
                    case 3:
                        // Open East Gate
                        m_creature->CastSpell(m_creature, SPELL_ARENA_FLASH_A, true);
                        m_creature->CastSpell(m_creature, SPELL_ARENA_FLASH_B, true);
                        m_pInstance->DoUseDoorOrButton(GO_ARENA_1);
                        m_uiEventTimer = 3000;
                        break;
                    case 4:
                        // timer for teleport out spell which has 2000 ms cast time
                        m_creature->CastSpell(m_creature, SPELL_ASHCROMBES_TELEPORT_B, true);
                        m_uiEventTimer = 2500;
                        break;
                    case 5:
                        m_creature->SetVisibility(VISIBILITY_OFF);
                        SetEscortPaused(false);
                        // Summon Ring Mob(s)
                        SummonRingMob(aRingMob[m_uiMobSpawnId], POS_EAST);
                        m_uiEventTimer = 8000;
                        break;
                    case 6:
                        // Summon Ring Mob(s)
                        SummonRingMob(aRingMob[m_uiMobSpawnId], POS_EAST);
                        SummonRingMob(aRingMob[m_uiMobSpawnId], POS_EAST);
                        m_uiEventTimer = 8000;
                        break;
                    case 7:
                        // Summon Ring Mob(s)
                        SummonRingMob(aRingMob[m_uiMobSpawnId], POS_EAST);
                        m_uiEventTimer = 0;
                        break;
                    case 8:
                        // Summoned Mobs are dead, continue event
                        DoScriptText(SAY_SUMMON_BOSS_2, m_creature);
                        m_creature->SetVisibility(VISIBILITY_ON);
//.........这里部分代码省略.........
开发者ID:WangXYZ,项目名称:CMangos_2_ScriptDev2,代码行数:101,代码来源:blackrock_depths.cpp


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