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


C++ SummonList::begin方法代码示例

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


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

示例1: UpdateAI

        void UpdateAI(uint32 diff)
        {
            if (!pInstance)
                return;

            events.Update(diff);

            switch(events.GetEvent())
            {
                case 0:
                    break;
                case EVENT_SUMMON_KEEPER_OR_GUARDIAN:
                    bKorG = true;
                    spawned = true;
                    if (Creature *c = DoSummon(RAND(NPC_PORTAL_GUARDIAN, NPC_PORTAL_KEEPER), me, 2.0f, 0, TEMPSUMMON_DEAD_DESPAWN))
                        me->CastSpell(c, SPELL_PORTAL_CHANNEL, false);
                    events.PopEvent();
                    events.RescheduleEvent(EVENT_SUMMON_KEEPER_TRASH, 20000);
                    break;
                case EVENT_SUMMON_KEEPER_TRASH:
                    for (uint8 i=0; i<3+addValue; ++i)
                    {
                        uint32 entry = RAND(NPC_AZURE_INVADER_1, NPC_AZURE_INVADER_2, NPC_AZURE_SPELLBREAKER_1, NPC_AZURE_SPELLBREAKER_2, NPC_AZURE_MAGE_SLAYER_1, NPC_AZURE_MAGE_SLAYER_2, NPC_AZURE_BINDER_1, NPC_AZURE_BINDER_2);
                        DoSummon(entry, me, 2.0f, 20000, TEMPSUMMON_DEAD_DESPAWN);
                    }
                    events.RepeatEvent(20000);
                    break;
                case EVENT_SUMMON_ELITES:
                    spawned = true;
                    for (uint8 i=0; i<2+addValue; ++i)
                    {
                        uint32 entry = RAND(NPC_AZURE_CAPTAIN, NPC_AZURE_RAIDER, NPC_AZURE_STALKER, NPC_AZURE_SORCEROR);
                        DoSummon(entry, me, 2.0f, 20000, TEMPSUMMON_DEAD_DESPAWN);
                    }
                    me->SetVisible(false);
                    events.PopEvent();
                    break;
                case EVENT_SUMMON_SABOTEOUR:
                    DoSummon(NPC_SABOTEOUR, me, 2.0f, 0, TEMPSUMMON_CORPSE_DESPAWN);
                    me->DespawnOrUnsummon(3000);
                    events.PopEvent();
                    break;
            }

            if (!spawned)
                return;

            if (bKorG)
            {
                if (!me->IsNonMeleeSpellCast(false)) // keeper/guardian died => channeled spell interrupted
                {
                    // if keeper/guard lost all victims, in enterevademode linking aura is removed, restore it:
                    if (pInstance)
                        for (SummonList::iterator itr = listOfMobs.begin(); itr != listOfMobs.end(); ++itr)
                            if (Creature* c = pInstance->instance->GetCreature(*itr))
                                if (c->IsAlive() && (c->GetEntry() == NPC_PORTAL_GUARDIAN || c->GetEntry() == NPC_PORTAL_KEEPER))
                                {
                                    me->CastSpell(c, SPELL_PORTAL_CHANNEL, false);
                                    return;
                                }
                    Unit::Kill(me, me, false);
                }
            }
            else
            {
                if (listOfMobs.empty())
                    Unit::Kill(me, me, false);
            }
        }
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:69,代码来源:violet_hold.cpp

示例2: UpdateAI

        void UpdateAI(const uint32 uiDiff)
        {
            if (!UpdateVictim())
                return;

            if (!bIsFrenzy && HealthBelowPct(25) && !bIsExploded)
            {
                DoScriptText(SAY_ENRAGE, me);
                DoCast(me, DUNGEON_MODE(SPELL_FRENZY,SPELL_FRENZY_H), true);
                bIsFrenzy = true;
            }

            if (!bIsFrenzy)
            {
                if (uiBubbleCheckerTimer <= uiDiff)
                {
                    if (!bIsExploded)
                    {
                        if (!me->HasAura(SPELL_PROTECTIVE_BUBBLE, 0))
                        {
                            DoScriptText(SAY_SHATTER, me);
                            DoCast(me, SPELL_DRAINED);
                            DoCast(me, SPELL_BURST, true);
                            bIsExploded = true;
                            me->AttackStop();
                            me->SetVisible(false);
                            for (uint8 i = 0; i < 10; i++)
                            {
                                int tmp = urand(0, MAX_SPAWN_LOC-1);
                                me->SummonCreature(NPC_ICHOR_GLOBULE, SpawnLoc[tmp], TEMPSUMMON_CORPSE_DESPAWN);
                            }
                        }
                    }
                    else
                    {
                        bool bIsWaterElementsAlive = false;
                        if (!m_waterElements.empty())
                        {
                            for (std::list<uint64>::const_iterator itr = m_waterElements.begin(); itr != m_waterElements.end(); ++itr)
                                if (Creature* pTemp = Unit::GetCreature(*me, *itr))
                                    if (pTemp->isAlive())
                                    {
                                        bIsWaterElementsAlive = true;
                                        break;
                                    }
                        }

                        if (!bIsWaterElementsAlive)
                            DoExplodeCompleted();
                    }
                    uiBubbleCheckerTimer = 1000;
                }
                else uiBubbleCheckerTimer -= uiDiff;
            }

            if (!bIsExploded)
            {
                if (uiWaterBoltVolleyTimer <= uiDiff)
                {
                    if(!me->IsNonMeleeSpellCasted(false))
                    {
                        DoCast(me, DUNGEON_MODE(SPELL_WATER_BOLT_VOLLEY,SPELL_WATER_BOLT_VOLLEY_H));
                        uiWaterBoltVolleyTimer = urand(10000, 15000);
                    }
                }
                else uiWaterBoltVolleyTimer -= uiDiff;

                if (uiWaterBlastTimer <= uiDiff)
                {
                    if(!me->IsNonMeleeSpellCasted(false))
                    {
                        DoCast(me->getVictim(), DUNGEON_MODE(SPELL_WATER_BLAST,SPELL_WATER_BLAST_H));
                        uiWaterBlastTimer = urand(10000, 15000);
                    }
                }
                else uiWaterBlastTimer -= uiDiff;

                DoMeleeAttackIfReady();
            }
        }
开发者ID:fragiami,项目名称:TrinityCore,代码行数:80,代码来源:boss_ichoron.cpp

示例3: UpdateAI

			void UpdateAI(uint32 diff)
			{
				events2.Update(diff);
				switch (events2.ExecuteEvent())
				{
					case EVENT_AKAMA_START_ENCOUNTER:
						me->RemoveAura(SPELL_STEALTH);
						me->SetWalk(true);
						me->GetMotionMaster()->MovePoint(POINT_START, 517.4877f, 400.7993f, 112.7837f, false);
						events2.ScheduleEvent(EVENT_AKAMA_START_CHANNEL, 11000);
						break;
					case EVENT_AKAMA_START_CHANNEL:
						me->CastSpell(me, SPELL_AKAMA_SOUL_CHANNEL, false);
						if (Creature* shade = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_SHADE_OF_AKAMA)))
						{
							shade->AI()->AttackStart(me);
							shade->GetMotionMaster()->Clear();
							shade->AI()->DoAction(ACTION_START_ENCOUNTER);
						}
						break;
					case EVENT_AKAMA_SCENE0:
						me->SetWalk(true);
						me->GetMotionMaster()->MovePoint(POINT_CHANNEL_SOUL, 467.0f, 400.7993f, 118.537f);
						break;
					case EVENT_AKAMA_SCENE1:
						me->CastSpell(me, SPELL_AKAMA_SOUL_RETRIEVE, true);
						break;
					case EVENT_AKAMA_SCENE2:
						Talk(SAY_BROKEN_FREE_0);
						break;
					case EVENT_AKAMA_SCENE3:
						me->SummonCreatureGroup(SUMMON_GROUP_BROKENS);
						break;
					case EVENT_AKAMA_SCENE4:
						Talk(SAY_BROKEN_FREE_1);
						break;
					case EVENT_AKAMA_SCENE5:
						for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
							if (Creature* broken = ObjectAccessor::GetCreature(*me, *itr))
								broken->SetStandState(UNIT_STAND_STATE_KNEEL);
						Talk(SAY_BROKEN_FREE_2);
						break;
					case EVENT_AKAMA_SCENE6:
						if (Creature* broken = summons.GetCreatureWithEntry(NPC_ASHTONGUE_BROKEN))
							broken->AI()->Talk(SAY_BROKEN_S1);
						break;
					case EVENT_AKAMA_SCENE7:
						for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
							if (Creature* broken = ObjectAccessor::GetCreature(*me, *itr))
								broken->AI()->Talk(SAY_BROKEN_S2);
						break;
				}

				if (!UpdateVictim())
					return;

				events.Update(diff);
				if (me->HasUnitState(UNIT_STATE_CASTING))
					return;

				switch (events.ExecuteEvent())
				{
					case EVENT_SPELL_CHAIN_LIGHTNING:
						me->CastSpell(me->GetVictim(), SPELL_CHAIN_LIGHTNING, false);
						events.ScheduleEvent(EVENT_SPELL_CHAIN_LIGHTNING, urand(10000, 15000));
						break;
					case EVENT_SPELL_DESTRUCTIVE_POISON:
						me->CastSpell(me, SPELL_DESTRUCTIVE_POISON, false);
						events.ScheduleEvent(EVENT_SPELL_DESTRUCTIVE_POISON, urand(4000, 5000));
						break;
				}

				DoMeleeAttackIfReady();
			}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:74,代码来源:boss_shade_of_akama.cpp


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