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


C++ GetCreatureListWithEntryInGrid函數代碼示例

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


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

示例1: DespawnSphere

    void DespawnSphere()
    {
        std::list<Creature*> assistList;
        GetCreatureListWithEntryInGrid(assistList,m_creature, NPC_ETHEREAL_SPHERE ,150.0f);

        if (assistList.empty())
            return;

        for(std::list<Creature*>::iterator iter = assistList.begin(); iter != assistList.end(); ++iter)
            (*iter)->DealDamage((*iter), (*iter)->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
    }
開發者ID:MrGrom,項目名稱:scriptdev2,代碼行數:11,代碼來源:boss_xevozz.cpp

示例2: UpdateOrientation

            void UpdateOrientation()
            {
                std::list<Creature*> beamTarList;
                uint64 tarGuid = 0;
                GetCreatureListWithEntryInGrid(beamTarList, me, YELLOW_EYE_MOVER, 200.0f);
                for (auto Beam : beamTarList)
                    tarGuid = Beam->GetGUID();

                if (Creature* beamTar = ObjectAccessor::GetCreature(*me, tarGuid))
                    me->SetFacingToObject(beamTar);
            }
開發者ID:Exodius,項目名稱:JadeCore548,代碼行數:11,代碼來源:boss_durumu.cpp

示例3: DespawnCreatures

        void DespawnCreatures(uint32 entry, float distance)
        {
            std::list<Creature*> creatures;
            GetCreatureListWithEntryInGrid(creatures, me, entry, distance);

            if (creatures.empty())
                return;

            for (std::list<Creature*>::iterator iter = creatures.begin(); iter != creatures.end(); ++iter)
                (*iter)->DespawnOrUnsummon();
        }
開發者ID:Caydan,項目名稱:DeathCore,代碼行數:11,代碼來源:boss_drahga_shadowburner.cpp

示例4: SendWaypoint

 void SendWaypoint()
 {
     std::list<Creature*> lVoidwalkerList;
     GetCreatureListWithEntryInGrid(lVoidwalkerList, m_creature, NPC_VOIDWALKER, 50.0f);
     for (std::list<Creature*>::iterator itr = lVoidwalkerList.begin(); itr != lVoidwalkerList.end(); ++itr)
     {
         if ((*itr)->isAlive())
             if (mob_arugal_voidwalkerAI* pVoidwalkerAI = dynamic_cast<mob_arugal_voidwalkerAI*>((*itr)->AI()))
                 pVoidwalkerAI->ReceiveWaypoint(m_uiCurrentPoint, m_bReverse);
     }
 }
開發者ID:Ozerev,項目名稱:mangos-tbc,代碼行數:11,代碼來源:shadowfang_keep.cpp

示例5: DespawnAdds

    void DespawnAdds()
    {
        CreatureList pWorshippers;
        GetCreatureListWithEntryInGrid(pWorshippers, m_creature, NPC_WORSHIPPER, DEFAULT_VISIBILITY_INSTANCE);

        if (!pWorshippers.empty())
            for(CreatureList::iterator itr = pWorshippers.begin(); itr != pWorshippers.end(); ++itr)
            {
                (*itr)->ForcedDespawn();
            }

        CreatureList pFollower;
        GetCreatureListWithEntryInGrid(pFollower, m_creature, NPC_FOLLOWER, DEFAULT_VISIBILITY_INSTANCE);

        if (!pFollower.empty())
            for(CreatureList::iterator iter = pFollower.begin(); iter != pFollower.end(); ++iter)
            {
                (*iter)->ForcedDespawn();
            }
    }
開發者ID:Tasssadar,項目名稱:catcore,代碼行數:20,代碼來源:boss_faerlina.cpp

示例6: LavaSpoutErrupt

        void LavaSpoutErrupt()
        {
            std::list<Creature*> creatures;
            GetCreatureListWithEntryInGrid(creatures, me, NPC_LAVA_SPOUT_TRIGGER, 1000.0f);

            if (creatures.empty())
                return;

            for (std::list<Creature*>::iterator iter = creatures.begin(); iter != creatures.end(); ++iter)
                (*iter)->CastSpell((*iter),SPELL_LAVA_SPOUT, true);
        }
開發者ID:Caydan,項目名稱:DeathCore,代碼行數:11,代碼來源:boss_karsh_steelbender.cpp

示例7: DespawnCreature

 void DespawnCreature(uint32 entry)
 {
     std::list<Creature*> creatureList;
     GetCreatureListWithEntryInGrid(creatureList, me, entry, 80.0f);
     for (auto NowCreature : creatureList)
     {
         if (NowCreature->GetEntry() == BLUE_FOG && NowCreature->GetDisplayId() == NowCreature->GetNativeDisplayId()) // if blue fog was been activated not despawn him
             continue;
         NowCreature->DespawnOrUnsummon();
     }
 }
開發者ID:Exodius,項目名稱:JadeCore548,代碼行數:11,代碼來源:boss_durumu.cpp

示例8: allStartMobsDead

    bool allStartMobsDead()
    {
        std::list<Creature* > lCreatureList;
        GetCreatureListWithEntryInGrid(lCreatureList, m_creature, NPC_TWILIGHT_INITIATE, 40.);

        if (!lCreatureList.empty())
            for(std::list<Creature*>::iterator itr = lCreatureList.begin(); itr != lCreatureList.end(); ++itr)
                if ((*itr)->isAlive())
                    return false;

        return true;
    }
開發者ID:leecher228,項目名稱:scriptdev2,代碼行數:12,代碼來源:boss_jedoga.cpp

示例9: RespawnBeams

 void RespawnBeams()
 {
     std::list<Creature*> creatures;
     GetCreatureListWithEntryInGrid(creatures, me, NPC_JINARA_BEAM, 100.0f);
     if (creatures.empty())
         return;
     for (std::list<Creature*>::iterator iter = creatures.begin(); iter != creatures.end(); ++iter)
     {
         if ((*iter)->isDead())
             (*iter)->Respawn();
     }
 }
開發者ID:beyourself,項目名稱:Wow-4.3.4,代碼行數:12,代碼來源:boss_jinara.cpp

示例10: DamageTaken

    void DamageTaken(Unit* pDoneBy, uint32& uiDamage, DamageEffectType /*damagetype*/) override
    {
        if (uiDamage > m_creature->GetHealth() || m_creature->GetHealthPercent() < 20.0f)
        {
            if (Player* pPlayer = pDoneBy->GetBeneficiaryPlayer())
            {
                if (pPlayer->GetQuestStatus(QUEST_MISSING_DIPLO_PT16) == QUEST_STATUS_INCOMPLETE)
                    guidPlayer = pPlayer->GetObjectGuid();  // Store the player to give quest credit later
            }

            uiDamage = 0;

            DoScriptText(EMOTE_SURRENDER, m_creature);
            EnterEvadeMode();

            // Make the two sentries flee and despawn
            CreatureList lSentryList;
            GetCreatureListWithEntryInGrid(lSentryList, m_creature, NPC_SENTRY, 40.0f);

            for (CreatureList::const_iterator itr = lSentryList.begin(); itr != lSentryList.end(); ++itr)
            {
                if ((*itr)->isAlive())
                {
                    (*itr)->RemoveAllAurasOnEvade();
                    (*itr)->CombatStop(true);
                    (*itr)->SetWalk(false);
                    (*itr)->GetMotionMaster()->MovePoint(0, fSentryFleePoint[0], fSentryFleePoint[1], fSentryFleePoint[2]);
                    (*itr)->ForcedDespawn(4000);
                }
            }

            // Summon Jaina Proudmoore, Archmage Tervosh and Pained
            for (const auto& lOutroSpawn : lOutroSpawns)
            {
                Creature* pCreature = m_creature->SummonCreature(lOutroSpawn.uiEntry, lOutroSpawn.fX, lOutroSpawn.fY, lOutroSpawn.fZ, lOutroSpawn.fO, TEMPSPAWN_TIMED_DESPAWN, 3 * MINUTE * IN_MILLISECONDS, false, true);
                if (pCreature)
                {
                    pCreature->CastSpell(pCreature, SPELL_TELEPORT_VISUAL, TRIGGERED_NONE);
                    pCreature->GetMotionMaster()->MovePoint(0, lOutroSpawn.fDestX, lOutroSpawn.fDestY, lOutroSpawn.fDestZ);

                    // Exception case for Archmage Tervosh: the outro event is a simple speech with visual spell cast
                    // so it will be handled by a DBScript held by NPC Archmage Tervosh
                    if (pCreature->GetEntry() == NPC_TERVOSH)
                    {
                        // Remove Gossip and Quest Giver flag from now, they will be re-added later to Archmage Tervosh in DBScript
                        pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER | UNIT_NPC_FLAG_GOSSIP);
                        // The DBScript will be done here
                        pCreature->GetMotionMaster()->MoveWaypoint(0);
                    }
                }
            }
        }
    }
開發者ID:Phatcat,項目名稱:mangos-wotlk,代碼行數:53,代碼來源:dustwallow_marsh.cpp

示例11: UpdateAI

    void UpdateAI(const uint32 uiDiff) override
    {
        if (m_uiStartTimer)
        {
            if (m_uiStartTimer <= uiDiff)
            {
                // get all the bats list in range; note: this will compare the 2D distance
                std::list<Creature*> lBatsList;
                GetCreatureListWithEntryInGrid(lBatsList, m_creature, NPC_DARKCLAW_BAT, 10.0f);

                if (lBatsList.empty())
                {
                    m_uiStartTimer = 5000;
                    return;
                }

                // sort by distance and get only the closest
                lBatsList.sort(ObjectDistanceOrder(m_creature));

                std::list<Creature*>::const_iterator batItr = lBatsList.begin();
                Creature* pBat = NULL;

                do
                {
                    // check for alive and out of combat only
                    if ((*batItr)->isAlive() && !(*batItr)->getVictim())
                        pBat = *batItr;

                    ++batItr;
                }
                while (!pBat && batItr != lBatsList.end());

                if (!pBat)
                {
                    m_uiStartTimer = 5000;
                    return;
                }

                // Move bat to the point
                float fX, fY, fZ;
                pBat->SetWalk(false);
                pBat->GetMotionMaster()->Clear();
                m_creature->GetContactPoint(pBat, fX, fY, fZ);
                pBat->GetMotionMaster()->MovePoint(0, fX, fY, fZ);

                m_selectedBatGuid = pBat->GetObjectGuid();
                m_uiStartTimer = 0;
                m_bHasValidBat = true;
            }
            else
                m_uiStartTimer -= uiDiff;
        }
    }
開發者ID:AwkwardDev,項目名稱:mangos-d3,代碼行數:53,代碼來源:howling_fjord.cpp

示例12: ShowMushrooms

 void ShowMushrooms(bool show = true)
 {
     std::list<Creature*> lMushroomsHealthy;
     GetCreatureListWithEntryInGrid(lMushroomsHealthy, m_creature, NPC_HEALTHY_MUSHROOM, 150.0f);
     for(std::list<Creature*>::iterator itr1 = lMushroomsHealthy.begin(); itr1 != lMushroomsHealthy.end(); ++itr1)
     {
         if(show)
             (*itr1)->SetVisibility(VISIBILITY_ON);
         else
             (*itr1)->SetVisibility(VISIBILITY_OFF);
     }
     std::list<Creature*> lMushroomsPoison;
     GetCreatureListWithEntryInGrid(lMushroomsPoison, m_creature, NPC_POISONOUS_MUSHROOM, 150.0f);
     for(std::list<Creature*>::iterator itr2 = lMushroomsPoison.begin(); itr2 != lMushroomsPoison.end(); ++itr2)
     {
         if(show)
             (*itr2)->SetVisibility(VISIBILITY_ON);
         else
             (*itr2)->SetVisibility(VISIBILITY_OFF);
     }
 }
開發者ID:Ancient,項目名稱:scriptdev2,代碼行數:21,代碼來源:boss_amanitar.cpp

示例13: JustStartedEscort

    void JustStartedEscort()
    {
        m_uiEventTimer = 5000;
        m_uiEventCount = 0;

        m_lResearchersList.clear();

        GetCreatureListWithEntryInGrid(m_lResearchersList, m_creature, NPC_RESEARCHER, 25.0f);

        if (!m_lResearchersList.empty())
            SetFormation();
    }
開發者ID:Bootz,項目名稱:StrawberryCore,代碼行數:12,代碼來源:terokkar_forest.cpp

示例14: DoWorldInFlamesEvent

        void DoWorldInFlamesEvent()
        {
            std::list<Creature*> munitionList;
            GetCreatureListWithEntryInGrid(munitionList, me, NPC_STABLE_MUNITION, 100.0f);

            for (std::list<Creature*>::const_iterator i = munitionList.begin(); i != munitionList.end(); ++i)
            {
                (*i)->RemoveAurasDueToSpell(SPELL_MUNITION_STABLE);
                (*i)->CastSpell((*i), SPELL_MUNITION_EXPLOSION, true);
                (*i)->DespawnOrUnsummon(2000);
            }
        }
開發者ID:Shiroy,項目名稱:Mist-Eria-Core510,代碼行數:12,代碼來源:boss_saboteur_kiptilak.cpp

示例15: Reset

    void Reset() override
    {
        m_creature->SetWalk(true);
        m_uiDarkOffering = urand(4400, 12500);
        m_bWPDone = true;

        Creature* pLeader = m_creature->GetMap()->GetCreature(m_leaderGuid);
        if (pLeader && pLeader->isAlive())
        {
            m_creature->GetMotionMaster()->MoveFollow(pLeader, 1.0f, M_PI / 2 * m_uiPosition);
        }
        else
        {
            std::list<Creature*> lVoidwalkerList;
            Creature* pNewLeader = NULL;
            uint8 uiHighestPosition = 0;
            GetCreatureListWithEntryInGrid(lVoidwalkerList, m_creature, NPC_VOIDWALKER, 50.0f);
            for (std::list<Creature*>::iterator itr = lVoidwalkerList.begin(); itr != lVoidwalkerList.end(); ++itr)
            {
                if ((*itr)->isAlive())
                {
                    if (mob_arugal_voidwalkerAI* pVoidwalkerAI = dynamic_cast<mob_arugal_voidwalkerAI*>((*itr)->AI()))
                    {
                        uint8 uiPosition = pVoidwalkerAI->GetPosition();
                        if (uiPosition > uiHighestPosition)
                        {
                            pNewLeader = (*itr);
                            uiHighestPosition = uiPosition;
                        }
                    }
                }
            }

            if (pNewLeader)
            {
                m_leaderGuid = pNewLeader->GetObjectGuid();
                if (pNewLeader == m_creature)
                {
                    m_bIsLeader = true;
                    m_bWPDone = true;
                }
                else
                    m_creature->GetMotionMaster()->MoveFollow(pNewLeader, 1.0f, M_PI / 2 * m_uiPosition);
            }
            else
            {
                pNewLeader = m_creature;
                m_bIsLeader = true;
                m_bWPDone = true;
            }
        }
    }
開發者ID:krullgor,項目名稱:mangos-wotlk,代碼行數:52,代碼來源:shadowfang_keep.cpp


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