• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetCreatureListWithEntryInGrid函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了GetCreatureListWithEntryInGrid函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: UpdateAI

 void UpdateAI(const uint32 uiDiff)
 {
     if (m_uiCheckRangeTimer < uiDiff)
     {
         if (m_creature->GetDistance(END_X, END_Y, END_Z) < 30)
         {
             if( VehicleKitPtr vehicle = m_creature->GetVehicleKit())
             {
                 if (Unit* pPlayer = vehicle->GetPassenger(0))
                 {
                     if (pPlayer->GetTypeId() == TYPEID_PLAYER)
                     {
                         for (int8 i = 1; i < 4; ++i)
                         {
                             if (Unit* pPrisoner = vehicle->GetPassenger(i))
                             {
                                 pPlayer->DealDamage(pPrisoner, pPrisoner->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                             }
                         }
                         ((Player*)pPlayer)->KilledMonsterCredit(m_creature->GetEntry(), m_creature->GetObjectGuid());
                         pPlayer->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                     }
                 }
             }
         }
         else
         {
             if (boarded < 3)
             {
                 std::list<Creature*> pPrisonerList;
                 GetCreatureListWithEntryInGrid(pPrisonerList, m_creature, NPC_ICE_PRISONER, 30.0f);
                 if (!pPrisonerList.empty())
                 {
                     for(std::list<Creature*>::iterator iter = pPrisonerList.begin(); iter != pPrisonerList.end(); ++iter)
                     {
                         if (Creature* pPrisoner = (*iter))
                         {
                             if (pPrisoner->isAlive())
                             {
                                 DoCast(pPrisoner, SPELL_SUMMON_FREE_PRISONER);
                                 pPrisoner->ForcedDespawn();
                             }
                         }
                     }
                 }
             }
         }
         m_uiCheckRangeTimer = 2000;
     }
     else
         m_uiCheckRangeTimer -= uiDiff;
 }
开发者ID:Reamer,项目名称:scriptdev2,代码行数:52,代码来源:storm_peaks.cpp


示例17: WaypointReached

    void WaypointReached(uint32 uiPointId) override
    {
        switch (uiPointId)
        {
            case 2:
                DoScriptText(SAY_HANES_FIRE_1, m_creature);
                break;
            case 3:
                DoScriptText(SAY_HANES_FIRE_2, m_creature);
                break;
            case 14:
            case 20:
            case 21:
            case 29:
            {
                m_creature->HandleEmote(EMOTE_ONESHOT_ATTACK1H);

                // set all nearby triggers on fire - ToDo: research if done by spell!
                std::list<Creature*> lTriggersInRange;
                GetCreatureListWithEntryInGrid(lTriggersInRange, m_creature, NPC_HANES_TRIGGER, 10.0f);

                for (std::list<Creature*>::const_iterator itr = lTriggersInRange.begin(); itr != lTriggersInRange.end(); ++itr)
                {
                    (*itr)->CastSpell((*itr), SPELL_LOW_POLY_FIRE, true);
                    (*itr)->ForcedDespawn(30000);
                }
                break;
            }
            case 15:
                DoScriptText(SAY_HANES_SUPPLIES_1, m_creature);
                break;
            case 22:
                DoScriptText(SAY_HANES_SUPPLIES_2, m_creature);
                break;
            case 30:
                m_creature->HandleEmote(EMOTE_ONESHOT_LAUGH_NOSHEATHE);
                break;
            case 31:
                DoScriptText(SAY_HANES_SUPPLIES_COMPLETE, m_creature);
                break;
            case 32:
                DoScriptText(SAY_HANES_SUPPLIES_ESCAPE, m_creature);
                break;
            case 40:
                DoScriptText(SAY_HANES_ARRIVE_BASE, m_creature);
                break;
            case 44:
                if (Player* pPlayer = GetPlayerForEscort())
                    pPlayer->GroupEventHappens(QUEST_ID_TRIAL_OF_FIRE, m_creature);
                break;
        }
    }
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:52,代码来源:howling_fjord.cpp


示例18: DoRemoveAdds

    void DoRemoveAdds()
    {
        for (GuidList::iterator i = m_lSummonedAddsGuids.begin(); i != m_lSummonedAddsGuids.end(); ++i)
        {
            if (Creature* pTmp = m_creature->GetMap()->GetCreature(*i))
                pTmp->ForcedDespawn();
        }

        std::list<Creature*> lWorms;
        GetCreatureListWithEntryInGrid(lWorms, m_creature, NPC_ROT_WORM, 100.0f);
        for (std::list<Creature*>::iterator i = lWorms.begin(); i != lWorms.end(); ++i)
            (*i)->ForcedDespawn();
    }
开发者ID:concept45,项目名称:RustEmu-SD2,代码行数:13,代码来源:boss_valithria_dreamwalker.cpp


示例19: JustReachedHome

    void JustReachedHome() override
    {
        if (m_pInstance)
            m_pInstance->SetData(TYPE_NETHEKURSE, FAIL);

        std::list<Creature*> lFelConverts;
        GetCreatureListWithEntryInGrid(lFelConverts, m_creature, NPC_FEL_ORC_CONVERT, 40.0f);
        for (std::list<Creature*>::iterator itr = lFelConverts.begin(); itr != lFelConverts.end(); ++itr)
        {
            if (!(*itr)->isAlive())
                (*itr)->Respawn();
        }
    }
开发者ID:mynew4,项目名称:RustEmu-Core,代码行数:13,代码来源:boss_nethekurse.cpp


示例20: HandleScript

        void HandleScript(SpellEffIndex effIndex)
        {
            PreventHitDefaultEffect(effIndex);

            std::list<Creature*> triggers;
            GetCreatureListWithEntryInGrid(triggers, GetHitUnit(), NPC_BAD_INTENTIONS_TARGET, 100.0f);
            if (!triggers.empty())
            {
                triggers.sort(Trinity::ObjectDistanceOrderPred(GetHitUnit(), true));
                Creature* trigger = triggers.front();
                GetHitUnit()->CastSpell(trigger, uint32(GetEffectValue()), true);
            }
        }
开发者ID:P-Kito,项目名称:InfinityCore,代码行数:13,代码来源:boss_hussam.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetCrossHairPosition函数代码示例发布时间:2022-05-30
下一篇:
C++ GetCreatureInfo函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap