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


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

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


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

示例1: 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:AzerothShard-Dev,项目名称:azerothcore,代码行数:74,代码来源:boss_shade_of_akama.cpp


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