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


C++ GuidVector类代码示例

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


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

示例1: AddJustAggroed

 void AddJustAggroed(Unit* pWho)
 {
     // Let all adds attack
     for (GuidVector::const_iterator itr = m_vAddGuids.begin(); itr != m_vAddGuids.end(); ++itr)
     {
         Creature* pAdd = m_creature->GetMap()->GetCreature(*itr);
         if (pAdd && !pAdd->getVictim())
             pAdd->AI()->AttackStart(pWho);
     }
 }
开发者ID:MantisLord,项目名称:mangos-tbc,代码行数:10,代码来源:boss_kelidan_the_breaker.cpp

示例2: Reset

    void Reset() override
    {
        m_Phase                  = PHASE_GROUND;
        m_PhaseSwitchTimer       = 80000;
        m_uiFreezingSlashTimer   = 20000;
        m_uiPenetratingColdTimer = urand(15000, 25000);
        m_uiBurrowerSummonTimer  = 10000;
        m_uiBerserkTimer         = 10 * MINUTE * IN_MILLISECONDS;

        m_vSpheresGuidVector.clear();
        m_vSpheresGuidVector.resize(MAX_FROSTSPHERES, ObjectGuid());
    }
开发者ID:jviljoen82,项目名称:ScriptDev3,代码行数:12,代码来源:boss_anubarak_trial.cpp

示例3: Cleanup

        void Cleanup(Creature* infernal, InfernalPoint *point)
        {
            for (GuidVector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
            {
                if (*itr == infernal->GetGUID())
                {
                    infernals.erase(itr);
                    break;
                }
            }

            positions.push_back(point);
        }
开发者ID:AwkwardDev,项目名称:TinyCore,代码行数:13,代码来源:boss_prince_malchezaar.cpp

示例4: InfernalCleanup

        void InfernalCleanup()
        {
            //Infernal Cleanup
            for (GuidVector::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr)
                if (Unit* pInfernal = ObjectAccessor::GetUnit(*me, *itr))
                    if (pInfernal->IsAlive())
                    {
                        pInfernal->SetVisible(false);
                        pInfernal->setDeathState(JUST_DIED);
                    }

            infernals.clear();
        }
开发者ID:AwkwardDev,项目名称:TinyCore,代码行数:13,代码来源:boss_prince_malchezaar.cpp

示例5: JustDied

    void JustDied(Unit* /*pKiller*/) override
    {
        for (GuidVector::const_iterator itr = m_vSnoboldGuidsVector.begin(); itr != m_vSnoboldGuidsVector.end(); ++itr)
        {
            if (Creature* pSnobold = m_creature->GetMap()->GetCreature(*itr))
            {
                if (!pSnobold->isAlive())
                    continue;

                // ToDo: check if there is any player vehicle mounting involved
                SendAIEvent(AI_EVENT_CUSTOM_EVENTAI_A, m_creature, pSnobold);
            }
        }
    }
开发者ID:dvdvideo1234,项目名称:mangos-wotlk,代码行数:14,代码来源:boss_northrend_beasts.cpp

示例6: DoSetupAdds

    void DoSetupAdds()
    {
        m_uiSetupAddsTimer = 0;

        if (!m_pInstance)
            return;

        GuidList lAddGuids;
        m_pInstance->GetKelidanAddList(lAddGuids);

        // Sort Adds to vector if not already done
        if (!lAddGuids.empty())
        {
            m_vAddGuids.reserve(lAddGuids.size());
            std::list<Creature*> lAdds;
            for (GuidList::const_iterator itr = lAddGuids.begin(); itr != lAddGuids.end(); ++itr)
            {
                if (Creature* pAdd = m_pInstance->instance->GetCreature(*itr))
                    lAdds.push_back(pAdd);
            }
            // Sort them by angle
            lAdds.sort(SortByAngle(m_creature));
            for (std::list<Creature*>::const_iterator itr = lAdds.begin(); itr != lAdds.end(); ++itr)
                m_vAddGuids.push_back((*itr)->GetObjectGuid());
        }

        // Respawn killed adds and reset counter
        m_uiKilledAdds = 0;
        for (GuidVector::const_iterator itr = m_vAddGuids.begin(); itr != m_vAddGuids.end(); ++itr)
        {
            Creature* pAdd = m_pInstance->instance->GetCreature(*itr);
            if (pAdd && !pAdd->isAlive())
                pAdd->Respawn();
        }

        // Cast pentagram
        uint8 s = m_vAddGuids.size();
        for (uint8 i = 0; i < s; ++i)
        {
            Creature* pCaster = m_pInstance->instance->GetCreature(m_vAddGuids[i]);
            Creature* pTarget = m_pInstance->instance->GetCreature(m_vAddGuids[(i + 2) % s]);
            if (pCaster && pTarget)
                pCaster->CastSpell(pTarget, SPELL_CHANNELING, TRIGGERED_NONE);
        }

        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
    }
开发者ID:MantisLord,项目名称:mangos-tbc,代码行数:48,代码来源:boss_kelidan_the_breaker.cpp

示例7: DespawnGuids

void ScriptedAI::DespawnGuids(GuidVector& spawns)
{
    for (ObjectGuid& guid : spawns)
        if (Creature* spawn = m_creature->GetMap()->GetCreature(guid))
            spawn->ForcedDespawn();
    spawns.clear();
}
开发者ID:Phatcat,项目名称:mangos-classic,代码行数:7,代码来源:sc_creature.cpp

示例8: RemoveGravityLapse

    // Wrapper to remove Gravity Lapse - this should be removed on aura 44251 expires
    void RemoveGravityLapse()
    {
        GuidVector vGuids;
        m_creature->FillGuidsListFromThreatList(vGuids);

        for (GuidVector::const_iterator itr = vGuids.begin(); itr != vGuids.end(); ++itr)
        {
            Unit* pUnit = m_creature->GetMap()->GetUnit(*itr);

            if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER)
            {
                pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
                pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
            }
        }
    }
开发者ID:killerwife,项目名称:mangos-tbc,代码行数:17,代码来源:boss_felblood_kaelthas.cpp

示例9: npc_vimgol_visual_bunnyAI

    npc_vimgol_visual_bunnyAI(Creature* pCreature) : ScriptedAI(pCreature)
    {
        m_pMap = (ScriptedMap*)pCreature->GetInstanceData();

        GuidVector bunnyGuids;

        if (m_pMap)
        {
            m_pMap->GetCreatureGuidVectorFromStorage(m_creature->GetEntry(), bunnyGuids);

            for (auto it = bunnyGuids.begin(); it != bunnyGuids.end(); ++it)
                if ((*it) == m_creature->GetObjectGuid())
                    m_uiBunnyId = std::distance(bunnyGuids.begin(), it);
        }

        Reset();
    }
开发者ID:BThallid,项目名称:mangos,代码行数:17,代码来源:blades_edge_mountains.cpp

示例10: playersInsideCircles

    uint8 playersInsideCircles()
    {
        uint32 tmpAuras[5] = {
            SPELL_VIMGOL_POP_TEST_A, SPELL_VIMGOL_POP_TEST_B, SPELL_VIMGOL_POP_TEST_C,
            SPELL_VIMGOL_POP_TEST_D, SPELL_VIMGOL_POP_TEST_E
        };
        uint8 tmpCounter = 0;

        if (m_uiBunnyGuids.size() < 5 && m_pMap)
        {
            m_uiBunnyGuids.clear();
            m_pMap->GetCreatureGuidVectorFromStorage(NPC_VIMGOL_VISUAL_BUNNY, m_uiBunnyGuids);
        }

        for (int i = 0; i < 5; i++)
            m_uiActiveCircles[i] = false;

        std::list<Player*> playerList;
        GetPlayerListWithEntryInWorld(playerList, m_creature, 30);
        for (auto itr = playerList.begin(); itr != playerList.end(); ++itr)
        {
            if (!(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_A) && !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_B) && !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_C) &&
                !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_D) && !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_E))
                continue;

            for (auto it = m_uiBunnyGuids.begin(); it != m_uiBunnyGuids.end(); ++it)
            {
                for (int i = 0; i < 5; ++i)
                {
                    if (!(*itr)->GetAura(tmpAuras[i], SpellEffectIndex(0)))
                        continue;

                    if ((*it) != (*itr)->GetAura(tmpAuras[i], SpellEffectIndex(0))->GetCasterGuid())
                        continue;

                    m_uiActiveCircles[std::distance(m_uiBunnyGuids.begin(), it)] = true;
                }
            }
        }

        for (int i = 0; i < 5; i++)
            if (m_uiActiveCircles[i])
                ++tmpCounter;

        return tmpCounter;
    }
开发者ID:BThallid,项目名称:mangos,代码行数:46,代码来源:blades_edge_mountains.cpp

示例11: DoTeleportToPlatform

        // Wrapper to teleport all players to the platform - Workaround for missing spell
        void DoTeleportToPlatform()
        {
            m_creature->NearTeleportTo(aVorpilTeleportLoc[0], aVorpilTeleportLoc[1], aVorpilTeleportLoc[2], 0.0f);

            float fX, fY, fZ;

            GuidVector vGuids;
            m_creature->FillGuidsListFromThreatList(vGuids);
            for (GuidVector::const_iterator itr = vGuids.begin(); itr != vGuids.end(); ++itr)
            {
                Unit* pTarget = m_creature->GetMap()->GetUnit(*itr);

                if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
                {
                    pTarget->GetRandomPoint(aVorpilTeleportLoc[0], aVorpilTeleportLoc[1], aVorpilTeleportLoc[2], 4.0f, fX, fY, fZ);
                    DoTeleportPlayer(pTarget, fX, fY, fZ, m_creature->GetAngle(fX, fY));
                }
            }
        }
开发者ID:jviljoen82,项目名称:ScriptDev3,代码行数:20,代码来源:boss_grandmaster_vorpil.cpp

示例12: DoSummonDrakkariInvaders

    // Wrapper to handle the drakkari invaders summon
    void DoSummonDrakkariInvaders()
    {
        if (!m_pInstance)
            return;

        // check if there are there are at least 2 triggers in the vector
        if (m_vTriggers.size() < 2)
            return;

        if (roll_chance_i(30))
        {
            // Summon a troll in the corner and 2 trolls in the air
            if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_pInstance->GetTrollgoreCornerTrigger()))
                pTrigger->CastSpell(pTrigger, roll_chance_i(20) ? SPELL_SUMMON_INVADER_1 : SPELL_SUMMON_INVADER_2, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_creature->GetObjectGuid());

            // get two random outside triggers
            uint8 uiMaxTriggers = m_vTriggers.size();
            uint8 uiPos1 = urand(0, uiMaxTriggers  - 1);
            uint8 uiPos2 = (uiPos1 + urand(1, uiMaxTriggers  - 1)) % uiMaxTriggers;

            if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_vTriggers[uiPos1]))
                pTrigger->CastSpell(pTrigger, roll_chance_i(30) ? SPELL_SUMMON_INVADER_1 : SPELL_SUMMON_INVADER_2, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_creature->GetObjectGuid());
            if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_vTriggers[uiPos2]))
                pTrigger->CastSpell(pTrigger, roll_chance_i(30) ? SPELL_SUMMON_INVADER_1 : SPELL_SUMMON_INVADER_2, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_creature->GetObjectGuid());
        }
        else
        {
            // Summon 3 trolls in the air
            for (auto m_vTrigger : m_vTriggers)
            {
                if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_vTrigger))
                    pTrigger->CastSpell(pTrigger, roll_chance_i(30) ? SPELL_SUMMON_INVADER_1 : SPELL_SUMMON_INVADER_2, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_creature->GetObjectGuid());
            }
        }
    }
开发者ID:Phatcat,项目名称:mangos-wotlk,代码行数:36,代码来源:boss_trollgore.cpp

示例13: JustDied

 void JustDied(Unit* /*killer*/) override
 {
     LiveTriggerGUID.clear();
     DeadTriggerGUID.clear();
     _JustDied();
     Talk(SAY_DEATH);
     instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
 }
开发者ID:AllThing,项目名称:TrinityCore,代码行数:8,代码来源:boss_gothik.cpp

示例14: Reset

            void Reset() override
            {
                LiveTriggerGUID.clear();
                DeadTriggerGUID.clear();

                me->SetReactState(REACT_PASSIVE);
                instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
                _Reset();
                Initialize();
            }
开发者ID:AllThing,项目名称:TrinityCore,代码行数:10,代码来源:boss_gothik.cpp

示例15: CastBunnySpell

    void CastBunnySpell(Creature* pTarget, uint32 uSpell)
    {
        if (!uSpell)
            return;

        std::list<Creature*> creatureList;
        GetCreatureListWithEntryInGrid(creatureList, m_creature, NPC_VIMGOL_VISUAL_BUNNY, 200.0f);
        for (auto& bunny : creatureList)
            for (auto it = m_uiBunnyGuids.begin(); it != m_uiBunnyGuids.end(); ++it)
                if ((*it) == bunny->GetObjectGuid())
                    if (m_uiActiveCircles[std::distance(m_uiBunnyGuids.begin(), it)])
                        bunny->CastSpell(pTarget ? pTarget : bunny, uSpell, TRIGGERED_OLD_TRIGGERED);
    }
开发者ID:BThallid,项目名称:mangos,代码行数:13,代码来源:blades_edge_mountains.cpp


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