当前位置: 首页>>代码示例>>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;未经允许,请勿转载。