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


C++ EventMap::ExecuteEvent方法代码示例

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


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

示例1: UpdateAI

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

        events.Update(uiDiff);

        if (me->hasUnitState(UNIT_STAT_CASTING))
            return;

        while(uint32 eventId = events.ExecuteEvent())
        {
            switch(eventId)
            {
                case EVENT_STRIKE:
                    switch(me->GetEntry())
                    {
                        case WG_CREATURE_GUARD_A:
                        case WG_CREATURE_GUARD_H:
                        case WG_CREATURE_CHAMPION_A:
                        case WG_CREATURE_CHAMPION_H:
                            DoCast(me->getVictim(), SPELL_STRIKE);
                            events.ScheduleEvent(EVENT_STRIKE, 5000);
                            return;
                    }
                case EVENT_ARCANE_MISSILES:
                    switch(me->GetEntry())
                    {
                        case WG_CREATURE_ENHANCEMENT_A:
                            DoCast(me->getVictim(), SPELL_ARCANE_MISSILES);
                            events.ScheduleEvent(EVENT_ARCANE_MISSILES, 5000);
                            return;
                    }
                case EVENT_SLOW:
                    switch(me->GetEntry())
                    {
                        case WG_CREATURE_ENHANCEMENT_A:
                            DoCast(me->getVictim(), SPELL_SLOW);
                            events.ScheduleEvent(EVENT_SLOW, 15000);
                            return;
                    }
                case EVENT_HEALING_WAVE:
                    switch(me->GetEntry())
                    {
                        case WG_CREATURE_ENHANCEMENT_H:
                            if (HealthBelowPct(50))
                                DoCast(me, SPELL_HEALING_WAVE);
                            events.ScheduleEvent(EVENT_HEALING_WAVE, 3000);
                            return;
                    }
                case EVENT_LIGHTNING_BOLT:
                    switch(me->GetEntry())
                    {
                        case WG_CREATURE_ENHANCEMENT_H:
                            DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT);
                            events.ScheduleEvent(EVENT_LIGHTNING_BOLT, 5000);
                            return;
                    }
                case EVENT_QUICK_FLAME_WARD:
                    switch(me->GetEntry())
                    {
                        case WG_CREATURE_ENHANCEMENT_H:
                            DoCast(me, SPELL_QUICK_FLAME_WARD);
                            events.ScheduleEvent(EVENT_QUICK_FLAME_WARD, 10000);
                            return;
                    }
                case EVENT_MORTAL_STRIKE:
                    switch(me->GetEntry())
                    {
                        case WG_CREATURE_QUESTGIVER_1_A:
                        case WG_CREATURE_QUESTGIVER_1_H:
                        case WG_CREATURE_QUESTGIVER_2_A:
                        case WG_CREATURE_QUESTGIVER_2_H:
                        case WG_CREATURE_QUESTGIVER_3_A:
                        case WG_CREATURE_QUESTGIVER_3_H:
                        case WG_CREATURE_QUESTGIVER_4_A:
                        case WG_CREATURE_QUESTGIVER_4_H:
                            DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
                            events.ScheduleEvent(EVENT_MORTAL_STRIKE, 10000);
                            return;
                    }
                case EVENT_HEAL:
                    switch(me->GetEntry())
                    {
                        case WG_CREATURE_QUESTGIVER_5_A:
                            if (HealthBelowPct(50))
                                DoCast(me, SPELL_HEAL);
                            events.ScheduleEvent(EVENT_HEAL, 5000);
                            return;
                    }
                case EVENT_HOLY_NOVA:
                    switch(me->GetEntry())
                    {
                        case WG_CREATURE_QUESTGIVER_5_A:
                            DoCast(me, SPELL_HOLY_NOVA);
                            events.ScheduleEvent(EVENT_HOLY_NOVA, 8000);
                            return;
                    }
                case EVENT_CLEAVE:
                    switch(me->GetEntry())
//.........这里部分代码省略.........
开发者ID:LolJK,项目名称:PhantomCore,代码行数:101,代码来源:wintergrasp.cpp

示例2: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            switch (phase)
            {
            case PHASE_CHAINED:
                if (!anchorGUID)
                {
                    if (Creature* anchor = me->FindNearestCreature(29521, 30))
                    {
                        anchor->AI()->SetGUID(me->GetGUID());
                        anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true);
                        anchorGUID = anchor->GetGUID();
                    }
                    else
                        sLog->outError("npc_unworthy_initiateAI: unable to find anchor!");

                    float dist = 99.0f;
                    GameObject* prison = NULL;

                    for (uint8 i = 0; i < 12; ++i)
                    {
                        if (GameObject* temp_prison = me->FindNearestGameObject(acherus_soul_prison[i], 30))
                        {
                            if (me->IsWithinDist(temp_prison, dist, false))
                            {
                                dist = me->GetDistance2d(temp_prison);
                                prison = temp_prison;
                            }
                        }
                    }

                    if (prison)
                        prison->ResetDoorOrButton();
                    else
                        sLog->outError("npc_unworthy_initiateAI: unable to find prison!");
                }
                break;
            case PHASE_TO_EQUIP:
                if (wait_timer)
                {
                    if (wait_timer > diff)
                        wait_timer -= diff;
                    else
                    {
                        me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ());
                        //sLog->outDebug(LOG_FILTER_TSCR, "npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ());
                        phase = PHASE_EQUIPING;
                        wait_timer = 0;
                    }
                }
                break;
            case PHASE_TO_ATTACK:
                if (wait_timer)
                {
                    if (wait_timer > diff)
                        wait_timer -= diff;
                    else
                    {
                        me->setFaction(14);
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
                        phase = PHASE_ATTACKING;

                        if (Player* target = Unit::GetPlayer(*me, playerGUID))
                            me->AI()->AttackStart(target);
                        wait_timer = 0;
                    }
                }
                break;
            case PHASE_ATTACKING:
                if (!UpdateVictim())
                    return;

                events.Update(diff);

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                    case EVENT_ICY_TOUCH:
                        DoCast(me->getVictim(), SPELL_ICY_TOUCH);
                        events.DelayEvents(1000, GCD_CAST);
                        events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST);
                        break;
                    case EVENT_PLAGUE_STRIKE:
                        DoCast(me->getVictim(), SPELL_PLAGUE_STRIKE);
                        events.DelayEvents(1000, GCD_CAST);
                        events.ScheduleEvent(SPELL_PLAGUE_STRIKE, 5000, GCD_CAST);
                        break;
                    case EVENT_BLOOD_STRIKE:
                        DoCast(me->getVictim(), SPELL_BLOOD_STRIKE);
                        events.DelayEvents(1000, GCD_CAST);
                        events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST);
                        break;
                    case EVENT_DEATH_COIL:
                        DoCast(me->getVictim(), SPELL_DEATH_COIL);
                        events.DelayEvents(1000, GCD_CAST);
                        events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST);
                        break;
                    }
                }
//.........这里部分代码省略.........
开发者ID:Blackn7g,项目名称:Voodoo,代码行数:101,代码来源:chapter1.cpp

示例3: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
        {
            if (phase == PHASE_FLIGHT && !me->IsInEvadeMode())
                EnterEvadeMode();
            return;
        }

        events.Update(diff);

        if (me->IsNonMeleeSpellCasted(false))
            return;

        if (phase == PHASE_GROUND)
        {
            switch (events.ExecuteEvent())
            {
                case EVENT_BERSERK:
                    DoScriptText(YELL_BERSERK, me);
                    DoCast(me, SPELL_BERSERK, true);
                    events.ScheduleEvent(EVENT_BERSERK, 10000);
                    break;
                case EVENT_CLEAVE:
                    DoCast(me->getVictim(), SPELL_CLEAVE, false);
                    events.ScheduleEvent(EVENT_CLEAVE, urand(5000, 10000));
                    break;
                case EVENT_CORROSION:
                    DoCast(me->getVictim(), SPELL_CORROSION, false);
                    events.ScheduleEvent(EVENT_CORROSION, urand(20000, 30000));
                    break;
                case EVENT_GAS_NOVA:
                    DoCast(me, SPELL_GAS_NOVA, false);
                    events.ScheduleEvent(EVENT_GAS_NOVA, urand(20000, 25000));
                    break;
                case EVENT_ENCAPSULATE:
                    if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true))
                        DoCast(pTarget, SPELL_ENCAPSULATE_CHANNEL, false);
                    events.ScheduleEvent(EVENT_ENCAPSULATE, urand(25000, 30000));
                    break;
                case EVENT_FLIGHT:
                    EnterPhase(PHASE_FLIGHT);
                    break;
                default:
                    DoMeleeAttackIfReady();
                    break;
            }
        }

        if (phase == PHASE_FLIGHT)
        {
            switch (events.ExecuteEvent())
            {
                case EVENT_BERSERK:
                    DoScriptText(YELL_BERSERK, me);
                    DoCast(me, SPELL_BERSERK, true);
                    break;
                case EVENT_FLIGHT_SEQUENCE:
                    HandleFlightSequence();
                    break;
                case EVENT_SUMMON_FOG:
                    float x, y, z;
                    me->GetPosition(x, y, z);
                    me->UpdateGroundPositionZ(x, y, z);
                    if (Creature *Fog = me->SummonCreature(MOB_VAPOR_TRAIL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000))
                    {
                        Fog->RemoveAurasDueToSpell(SPELL_TRAIL_TRIGGER);
                        Fog->CastSpell(Fog, SPELL_FOG_TRIGGER, true);
                        me->CastSpell(Fog, SPELL_FOG_FORCE, true);
                    }
                    events.ScheduleEvent(EVENT_SUMMON_FOG, 1000);
                    break;
            }
        }
    }
开发者ID:Maczuga,项目名称:SkyFire_one,代码行数:75,代码来源:boss_felmyst.cpp

示例4: UpdateAI

            void UpdateAI(uint32 const diff)
            {
                if (!intro)
                {
                    me->SummonCreature(NPC_SLIPPERY_FLOOR, SummonPositions[0]); // floor ambient
                    me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
                    me->SetReactState(REACT_AGGRESSIVE);
                    intro = true;
                }

                if (!UpdateVictim())
                    return;

                events.Update(diff);

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_SWITCH_PHASE:
                            if (events.GetPhaseMask() & PHASE_MASK_ONE)
                            {
                                // Emote: Ahune retreats. His defenses diminish.
                                //                                 me->MonsterTextEmote(EMOTE_SUBMERGE, 0, true); //Hack Fix by jacob


                                events.SetPhase(PHASE_TWO);
                                events.ScheduleEvent(EVENT_SWITCH_PHASE, 30000);

                                DoCast(me, SPELL_MAKE_BONFIRE);

                                me->AttackStop();
                                me->SetReactState(REACT_PASSIVE);
                                me->setFaction(35);
                                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED);
                                me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);

                                me->SummonCreature(NPC_FROZEN_CORE, SummonPositions[0], TEMPSUMMON_CORPSE_DESPAWN);
                            }
                            else
                            {
                                events.SetPhase(PHASE_ONE);
                                events.ScheduleEvent(EVENT_SWITCH_PHASE, 90000);
                                events.ScheduleEvent(EVENT_COLD_SLAP, 500, 0, PHASE_ONE);
                                events.ScheduleEvent(EVENT_SUMMON_HAILSTONE, 1000, 0, PHASE_ONE);
                                events.ScheduleEvent(EVENT_SUMMON_COLDWEAVE, 8000, 0, PHASE_ONE);
                                events.ScheduleEvent(EVENT_SUMMON_FROSTWIND, 9000, 0, PHASE_ONE);
                                events.ScheduleEvent(EVENT_ICE_SPEAR, 9500, 0, PHASE_ONE);
                                events.ScheduleEvent(EVENT_EARTHEN_RING_ATTACK, 10000, 0, PHASE_ONE);

                                me->SetReactState(REACT_AGGRESSIVE);
                                me->setFaction(14);
                                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
                                me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);

                                DoCastVictim(SPELL_RESURFACE);

                                summons.DespawnEntry(NPC_FROZEN_CORE);
                            }
                            break;
                        case EVENT_COLD_SLAP:
                            if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 8.0f, true))
                            {
                                DoCast(target, SPELL_COLD_SLAP);
                                Position targetPos;
                                target->GetNearPosition(targetPos, float(rand_norm()) * 5.0f + 35.0f, me->GetAngle(target));
                                target->GetMotionMaster()->MoveJump(targetPos.GetPositionX(), targetPos.GetPositionY(), targetPos.GetPositionZ(), target->GetExactDist2d(targetPos.GetPositionX(), targetPos.GetPositionY()), 10.0f);
                            }
                            events.ScheduleEvent(EVENT_COLD_SLAP, 500, 0, PHASE_ONE);
                            break;
                        case EVENT_ICE_SPEAR: 
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 120.0f, true))
                            {
                                target->CastSpell(target, SPELL_ICESPEAR_SUMMON_BUNNY);
                                target->CastSpell(target, SPELL_ICESPEAR_SUMMON_GO);
                                events.ScheduleEvent(EVENT_ICE_SPEAR_KNOCKBACK, 2000);
                            }
                            events.ScheduleEvent(EVENT_ICE_SPEAR, 7000, 0, PHASE_ONE);
                            break;
                        case EVENT_ICE_SPEAR_KNOCKBACK:
                            if (GameObject* go = me->FindNearestGameObject(GO_ICE_SPEAR, 120.0f))
                            {
                                go->UseDoorOrButton();
                                Map::PlayerList const& playerList = me->GetMap()->GetPlayers();
                                if (!playerList.isEmpty())
                                    for (Map::PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i)
                                        if (i->getSource() && go->GetDistance(i->getSource()) <= 2.0f)
                                            i->getSource()->CastSpell(i->getSource(), SPELL_ICESPEAR_KNOCKBACK);
                                go->Delete();
                            }
                            break;
                        case EVENT_SUMMON_HAILSTONE:
                            me->SummonCreature(NPC_AHUNITE_HAILSTONE, SummonPositions[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
                            break;
                        case EVENT_SUMMON_COLDWEAVE: 
                            me->SummonCreature(NPC_AHUNITE_COLDWEAVE, SummonPositions[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
                            me->SummonCreature(NPC_AHUNITE_COLDWEAVE, SummonPositions[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
                            events.ScheduleEvent(EVENT_SUMMON_COLDWEAVE, 5000, 0, PHASE_ONE);
//.........这里部分代码省略.........
开发者ID:kmN666,项目名称:Leroy,代码行数:101,代码来源:boss_ahune.cpp

示例5: UpdateAI

        void UpdateAI(uint32 diff) override
        {
            events.Update(diff);

            switch (events.ExecuteEvent())
            {
                case EVENT_SPAWN:
                    {
                        if (Creature* Dalfors = DoSummon(NPC_CRUSADER_LORD_DALFORS, DalforsPos[0]))
                        {
                            guidDalfors = Dalfors->GetGUID();
                            Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[1]);
                        }
                        if (Creature* Priest1 = DoSummon(NPC_ARGENT_BATTLE_PRIEST, Priest1Pos[0]))
                        {
                            guidPriest[0] = Priest1->GetGUID();
                            Priest1->GetMotionMaster()->MovePoint(0, Priest1Pos[1]);
                        }
                        if (Creature* Priest2 = DoSummon(NPC_ARGENT_BATTLE_PRIEST, Priest2Pos[0]))
                        {
                            guidPriest[1] = Priest2->GetGUID();
                            Priest2->GetMotionMaster()->MovePoint(0, Priest2Pos[1]);
                        }
                        if (Creature* Priest3 = DoSummon(NPC_ARGENT_BATTLE_PRIEST, Priest3Pos[0]))
                        {
                            guidPriest[2] = Priest3->GetGUID();
                            Priest3->GetMotionMaster()->MovePoint(0, Priest3Pos[1]);
                        }
                        if (Creature* Mason1 = DoSummon(NPC_ARGENT_MASON, Mason1Pos[0]))
                        {
                            guidMason[0] = Mason1->GetGUID();
                            Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[1]);
                        }
                        if (Creature* Mason2 = DoSummon(NPC_ARGENT_MASON, Mason2Pos[0]))
                        {
                            guidMason[1] = Mason2->GetGUID();
                            Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[1]);
                        }
                        if (Creature* Mason3 = DoSummon(NPC_ARGENT_MASON, Mason3Pos[0]))
                        {
                            guidMason[2] = Mason3->GetGUID();
                            Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[1]);
                        }
                        events.ScheduleEvent(EVENT_INTRO_1, 15000);
                    }
                    break;
                case EVENT_INTRO_1:
                    {
                        if (Creature* Dalfors = ObjectAccessor::GetCreature(*me, guidDalfors))
                            Dalfors->AI()->Talk(DALFORS_SAY_PRE_1);
                        events.ScheduleEvent(EVENT_INTRO_2, 5000);
                    }
                    break;
                case EVENT_INTRO_2:
                    {
                        if (Creature* Dalfors = ObjectAccessor::GetCreature(*me, guidDalfors))
                        {
                            Dalfors->SetFacingTo(6.215f);
                            Dalfors->AI()->Talk(DALFORS_SAY_PRE_2);
                        }
                    events.ScheduleEvent(EVENT_INTRO_3, 5000);
                    }
                    break;
                case EVENT_INTRO_3:
                    {
                        if (Creature* Dalfors = ObjectAccessor::GetCreature(*me, guidDalfors))
                        {
                            Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[2]);
                            Dalfors->SetHomePosition(DalforsPos[2]);
                        }
                        if (Creature* Priest1 = ObjectAccessor::GetCreature(*me, guidPriest[0]))
                        {
                            Priest1->SetFacingTo(5.7421f);
                            Priest1->SetHomePosition(Priest1Pos[1]);
                        }
                        if (Creature* Priest2 = ObjectAccessor::GetCreature(*me, guidPriest[1]))
                        {
                            Priest2->SetFacingTo(5.7421f);
                            Priest2->SetHomePosition(Priest2Pos[1]);
                        }
                        if (Creature* Priest3 = ObjectAccessor::GetCreature(*me, guidPriest[2]))
                        {
                            Priest3->SetFacingTo(5.7421f);
                            Priest3->SetHomePosition(Priest3Pos[1]);
                        }
                        if (Creature* Mason1 = ObjectAccessor::GetCreature(*me, guidMason[0]))
                        {
                            Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[2]);
                            Mason1->SetHomePosition(Mason1Pos[2]);
                        }
                        if (Creature* Mason2 = ObjectAccessor::GetCreature(*me, guidMason[1]))
                        {
                            Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[2]);
                            Mason2->SetHomePosition(Mason2Pos[2]);
                        }
                        if (Creature* Mason3 = ObjectAccessor::GetCreature(*me, guidMason[2]))
                        {
                            Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[2]);
                            Mason3->SetHomePosition(Mason3Pos[2]);
                        }
//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:RE,代码行数:101,代码来源:zone_icecrown.cpp

示例6: UpdateAI

            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                {
                    if (pInstance && pInstance->GetData(SPELL_RITUAL_OF_PURIFICATION) == false)
                        me->RemoveAura(SPELL_RITUAL_OF_PURIFICATION);

                    return;
                }

                if (me->HasUnitState(UNIT_STATE_CASTING))
                    return;
 
                events.Update(diff);
 
                switch (events.ExecuteEvent())
                {
                    case EVENT_CHECK_MELEE:
                    {
                        if (!me->IsWithinMeleeRange(me->getVictim(), 2.0f))
                        {
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f))
                                me->CastSpell(target, SPELL_REACHING_ATTACK, false);
                        }
                        else
                        {
                            // Always attack champion of light
                            if (Player* target = GetChampionOfLight(me))
                                if (me->getVictim() && me->getVictim()->GetGUID() != target->GetGUID())
                                    AttackStart(target);
                        }
                        events.ScheduleEvent(EVENT_CHECK_MELEE, 1000);
                        break;
                    }
                    case EVENT_EERIE_SKULL:
                    {
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 60.0f))
                            me->CastSpell(target, SPELL_EERIE_SKULL, false);
                        events.ScheduleEvent(EVENT_EERIE_SKULL, 5000);
                        break;
                    }
                    case EVENT_CHECK_ENERGY:
                    {
                        if (!pInstance)
                        {
                            events.ScheduleEvent(EVENT_CHECK_ENERGY, 1000);
                            break;
                        }

                        if (me->GetPower(POWER_ENERGY) >= me->GetMaxPower(POWER_ENERGY))
                        {
                            if (Creature* pureLight = Creature::GetCreature(*me, pInstance->GetData64(NPC_PURE_LIGHT_TERRACE)))
                                me->CastSpell(pureLight, SPELL_BREATH_OF_FEAR, false);
                            Talk(TALK_BREATH_OF_FEAR);
                            me->SetPower(POWER_ENERGY, 0);
                            me->SetInt32Value(UNIT_FIELD_POWER1, 0);
                        }

                        events.ScheduleEvent(EVENT_CHECK_ENERGY, 1000);
                        break;
                    }
                    case EVENT_FIRST_TERRORS:
                    {
                        me->CastSpell(me, SPELL_CONJURE_TERROR_SPAWN_TICK, true);
                        break;
                    }
                    default:
                        break;
                }

                DoMeleeAttackIfReady();
            }
开发者ID:Mystiko,项目名称:MoPCore5.4.8,代码行数:72,代码来源:boss_sha_of_fear.cpp

示例7: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
                return;

            if (me->HealthBelowPct(81) && !firstSelection)
            {
                events.CancelEvent(EVENT_WHIRLWIND);
                events.CancelEvent(EVENT_GRIEVOUS_THROW);
                EnterPhase(RAND(PHASE_BEAR, PHASE_LYNX));
                firstSelection = true;
            }

            if (me->HealthBelowPct(41) && !secondSelection)
            {
                if (Phase == PHASE_BEAR)
                {
                    events.CancelEvent(EVENT_SURGE);
                    events.CancelEvent(EVENT_OVERPOWER);
                    events.CancelEvent(EVENT_CREEPING_PARALYSIS);
                }
                else if (Phase == PHASE_LYNX)
                {
                    events.CancelEvent(EVENT_CLAW_RAGE);
                    events.CancelEvent(EVENT_LYNX_RUSH);
                }

                EnterPhase(RAND(PHASE_EAGLE, PHASE_DRAGONHAWK));
                secondSelection = true;
            }

            if (isFlameBreathing)
            {
                if (!me->IsNonMeleeSpellCasted(false))
                    isFlameBreathing = false;
                else
                    return;
            }

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch(eventId)
                {
                    //====== Troll Form
                    case EVENT_WHIRLWIND:
                        DoCast(me, SPELL_WHIRLWIND);
                        events.ScheduleEvent(EVENT_WHIRLWIND, urand(15000, 20000));
                        break;

                    case EVENT_GRIEVOUS_THROW:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                            DoCast(target, SPELL_GRIEVOUS_THROW, false);
                        events.ScheduleEvent(EVENT_GRIEVOUS_THROW, urand(10000, 11000));
                        break;

                    //====== Bear Form
                    case EVENT_SURGE:
                        if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 80.0f, true)) // Try to select farthest target.
                            DoCast(target, SPELL_SURGE);
                        events.ScheduleEvent(EVENT_SURGE, urand(15000, 20000));
                        break;

                    case EVENT_OVERPOWER:
                        DoCastVictim(SPELL_OVERPOWER);
                        events.ScheduleEvent(EVENT_OVERPOWER, urand(11000, 15000));
                        break;

                    case EVENT_CREEPING_PARALYSIS:
                        {
                            Map::PlayerList const& players = me->GetMap()->GetPlayers();
                            for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
                                if (Player* player = itr->getSource())
                                    DoCast(player, SPELL_CREEPING_PARALYSIS);

                            events.ScheduleEvent(EVENT_CREEPING_PARALYSIS, urand(19000, 21000));
                        }
                        break;

                    //====== Lynx Form
                    case EVENT_SUMMON_LYNX:
                        DoCast(me, SPELL_SUMMON_LYNX);
                        break;

                    case EVENT_CLAW_RAGE:
                        if (canCastClaw && clawRageTicks < 10)
                        {
                            if(!hasclawTarget)
                            {
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                                {
                                    DoCast(target, SPELL_CLAW_RAGE_CHARGE, false);
                                    DoCast(target, SPELL_CLAW_RAGE_DAMAGE, false);
                                    clawTarget = target;
                                    hasclawTarget = true;
                                }
                            }
                            else
                            {
//.........这里部分代码省略.........
开发者ID:AwkwardDev,项目名称:WoWSource434,代码行数:101,代码来源:boss_daakara.cpp

示例8: UpdateAI

        void UpdateAI(uint32 diff)
        {
            events2.Update(diff);
            switch (events2.ExecuteEvent())
            {
                case EVENT_INIT_COMBAT:
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
                    if (Unit* target = SelectTargetFromPlayerList(50.0f))
                        AttackStart(target);
                    return;
                case EVENT_FINISH_TALK:
                    Unit::Kill(me, me);
                    return;
            }

            if (!UpdateVictim())
                return;

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

            switch (uint32 eventId = events.ExecuteEvent())
            {
                case EVENT_SPELL_FIREBALL:
                    me->CastSpell(me->GetVictim(), DUNGEON_MODE(SPELL_FIREBALL_N, SPELL_FIREBALL_H), false);
                    events.ScheduleEvent(EVENT_SPELL_FIREBALL, urand(3000, 4500));
                    break;
                case EVENT_SPELL_FLAMESTRIKE:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    {
                        me->CastSpell(target, SPELL_FLAMESTRIKE_SUMMON, true);
                        Talk(SAY_FLAMESTRIKE);
                    }
                    events.ScheduleEvent(EVENT_SPELL_FLAMESTRIKE, 25000);
                    break;
                case EVENT_SPELL_SHOCK_BARRIER:
                    me->CastSpell(me, SPELL_SHOCK_BARRIER, true);
                    me->CastCustomSpell(SPELL_PYROBLAST, SPELLVALUE_MAX_TARGETS, 1, (Unit*)NULL, false);
                    events.ScheduleEvent(EVENT_SPELL_SHOCK_BARRIER, 50000);
                    break;
                case EVENT_SPELL_PHOENIX:
                    Talk(SAY_PHOENIX);
                    me->CastSpell(me, SPELL_PHOENIX, false);
                    events.ScheduleEvent(EVENT_SPELL_PHOENIX, 60000);
                    break;
                case EVENT_CHECK_HEALTH:
                    if (HealthBelowPct(50))
                    {
                        me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
                        me->CastSpell(me, SPELL_TELEPORT_CENTER, true);
                        events.Reset();

                        me->StopMoving();
                        me->GetMotionMaster()->Clear();
                        me->GetMotionMaster()->MoveIdle();

                        events.SetPhase(1);
                        events.ScheduleEvent(EVENT_GRAVITY_LAPSE_1_1, 0);
                        break;
                    }
                    events.ScheduleEvent(EVENT_CHECK_HEALTH, 500);
                    break;
                case EVENT_GRAVITY_LAPSE_1_1:
                case EVENT_GRAVITY_LAPSE_1_2:
                    Talk(eventId == EVENT_GRAVITY_LAPSE_1_1 ? SAY_GRAVITY_LAPSE : SAY_RECAST_GRAVITY);
                    me->CastSpell(me, SPELL_GRAVITY_LAPSE_INITIAL, false);
                    events.ScheduleEvent(EVENT_GRAVITY_LAPSE_2, 2000);
                    break;
                case EVENT_GRAVITY_LAPSE_2:
                    LapseAction(ACTION_TELEPORT_PLAYERS);
                    events.ScheduleEvent(EVENT_GRAVITY_LAPSE_3, 1000);
                    break;
                case EVENT_GRAVITY_LAPSE_3:
                    LapseAction(ACTION_KNOCKUP);
                    events.ScheduleEvent(EVENT_GRAVITY_LAPSE_4, 1000);
                    break;
                case EVENT_GRAVITY_LAPSE_4:
                    LapseAction(ACTION_ALLOW_FLY);
                    for (uint8 i = 0; i < 3; ++i)
                        me->CastSpell(me, SPELL_SUMMON_ARCANE_SPHERE, true);

                    me->CastSpell(me, SPELL_GRAVITY_LAPSE_CHANNEL, false);
                    events.ScheduleEvent(EVENT_GRAVITY_LAPSE_5, 30000);
                    break;
                case EVENT_GRAVITY_LAPSE_5:
                    LapseAction(ACTION_REMOVE_FLY);
                    me->InterruptNonMeleeSpells(false);
                    Talk(SAY_TIRED);
                    me->CastSpell(me, SPELL_POWER_FEEDBACK, false);
                    events.ScheduleEvent(EVENT_GRAVITY_LAPSE_1_2, 10000);
                    break;
            }


            if (events.GetPhaseMask() == 0)
                DoMeleeAttackIfReady();
        }
开发者ID:lineagedr,项目名称:azerothcore-wotlk,代码行数:98,代码来源:boss_felblood_kaelthas.cpp

示例9: UpdateAI

        void UpdateAI(uint32 diff)
        {
            if (!(UpdateVictim() && isInManglePhase) || me->HasUnitState(UNIT_STATE_CASTING))
                return; 

            if(me->GetMap()->IsHeroic())
            {
                if (Creature* nefarian = me->FindNearestCreature(NPC_NEFARIAN_HELPER_HEROIC, 150.0f, true))
                {
                    if(me->GetHealthPct() < 95 && say1 == false)
                    {
                        nefarian->AI()->Talk(NEF_H_STARTED_C);
                        say1 = true;
                    }

                    if(me->GetHealthPct() < 31 && say2 == false)
                    {
                        nefarian->AI()->Talk(NEF_H_LOW_HP);
                        say2 = true;
                        events.CancelEvent(EVENT_BLAZING_INFERNO);
                        events.ScheduleEvent(EVENT_SHADOW_BREATH, urand(6000, 9000));
                    }
                }
            }

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch(eventId)
                {
                    case EVENT_IGNITION:
                        CastIgnition();
                        break;

                    case EVENT_SHADOW_BREATH:
                        if (Creature* nefarian = me->FindNearestCreature(NPC_NEFARIAN_HELPER_HEROIC, 150.0f, true))
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
                                nefarian->CastSpell(target, SPELL_SHADOW_BREATH, false);
                        events.ScheduleEvent(EVENT_SHADOW_BREATH, urand(9000, 13000));
                        break;

                    case EVENT_BLAZING_INFERNO:
                        if (Creature* nefarian = me->FindNearestCreature(NPC_NEFARIAN_HELPER_HEROIC, 150.0f, true))
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
                                nefarian->CastSpell(target, SPELL_BLAZING_INFERNO, false);
                        events.ScheduleEvent(EVENT_BLAZING_INFERNO, urand(30000, 35000));
                        break;

                    case EVENT_MAGMA_SPIT:
                        me->AttackStop();
                        CastMagmaSpit();
                        me->Attack(me->GetVictim(), true);
                        events.ScheduleEvent(EVENT_MAGMA_SPIT, urand(8000, 11000));
                        break;

                    case EVENT_LAVA_SPEW:
                        DoCastAOE(SPELL_LAVA_SPEW);
                        events.ScheduleEvent(EVENT_LAVA_SPEW, urand(17000,20000));
                        break;

                    case EVENT_BREAK_FREE:
                        if (me->HasAura(SPELL_CUSTOM_STATE_05)) // Check if the second chain hit or not.
                        {
                            Talk(ANN_BREAK_FREE);
                            me->RemoveAura(SPELL_CUSTOM_STATE_05);
                            if (Creature* spikeStalker = me->FindNearestCreature(41767, 50.0f, true))
                                spikeStalker->AI()->DoAction(ACTION_SPIKE_RESET);
                        }
                        break;

                    case EVENT_PILLAR_OF_FLAME:
                        if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 80.0f, true)) // Try to select farthest target.
                        {
                            if (me->GetDistance2d(target) >= 15.0f) // If target is over 15y away, it's ok.
                                DoCast(target, SPELL_PILLAR_OF_FLAME);
                            else
                                if (me->GetDistance2d(target) < 15.0f) // If target is less then 15y away, cast on nearest, as they are hacking the encounter by standing all melee.
                                    if (Unit* target2 = SelectTarget(SELECT_TARGET_NEAREST, 0, 80.0f, true))
                                        DoCast(target2, SPELL_PILLAR_OF_FLAME);
                        }
                        events.ScheduleEvent(EVENT_PILLAR_OF_FLAME, urand(20000, 25000));
                        break;

                    case EVENT_BERSERK:
                        DoCast(me, SPELL_BERSERK);
                        break;

                    case EVENT_MANGLE:
                        if (Unit* victim = me->GetVictim())
                        {
                            if (victim->GetTypeId() == TYPEID_PLAYER)
                            {
                                sTarget = victim;
                                sTar = true;
                                isInManglePhase = true;
                                Talk(ANN_CLOSE_HEAD);
                                me->AddAura(SPELL_MANGLE, victim);
                                DoCast(me, SPELL_CUSTOM_IMPACT_06);
                                if (Unit* magmawHead = vehicle->GetPassenger(0))
//.........这里部分代码省略.........
开发者ID:redlaine,项目名称:InfinityCore-Ark,代码行数:101,代码来源:boss_magmaw.cpp

示例10: UpdateAI

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

                events.Update(diff);

                if (me->HasUnitState(UNIT_STATE_CASTING))
                    return;

                if (me->GetVictim())
                    if (me->GetVictim()->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 55.0f)
                    {
                        DoCastVictim(SPELL_LIGHTNING_BLAST);
                        return;
                    }

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                    case EVENT_CHILLING_BREATH:
                        if (Unit* target  = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
                            DoCast(target, SPELL_CHILLING_BREATH);
                        events.ScheduleEvent(EVENT_CHILLING_BREATH, urand(10000, 16000));
                        break;
                    case EVENT_RESET_WIND:
                        if (_aircurrent)
                            _aircurrent->DespawnOrUnsummon();
                        events.DelayEvents(1000);
                        events.ScheduleEvent(EVENT_CALL_OF_WIND, 800);
                        break;
                    case EVENT_CALL_OF_WIND:
                        _aircurrent = me->SummonCreature(NPC_AIR_CURRENT,
                            me->GetPositionX(),
                            me->GetPositionY(),
                            me->GetPositionZ(),
                            orientations[urand(0, 3)]);
                        events.ScheduleEvent(EVENT_RESET_WIND, 18000);
                        break;
                    case EVENT_CHECK_FACING:
                        if (me->GetMap()->GetPlayers().isEmpty() || !_aircurrent)
                            break;

                        for (Map::PlayerList::const_iterator itr = me->GetMap()->GetPlayers().begin(); itr != me->GetMap()->GetPlayers().end(); ++itr) 
                        {
                            if (CheckOrientation(itr->GetSource()->GetOrientation(), _aircurrent->GetOrientation()))
                            {
                                itr->GetSource()->RemoveAurasDueToSpell(SPELL_DOWNWIND_OF_ALTAIRUS);
                                me->AddAura(SPELL_UPWIND_OF_ALTAIRUS, itr->GetSource());
                            }
                            else
                            {
                                itr->GetSource()->RemoveAurasDueToSpell(SPELL_UPWIND_OF_ALTAIRUS);
                                me->AddAura(SPELL_DOWNWIND_OF_ALTAIRUS, itr->GetSource());
                            }
                        }
                        events.ScheduleEvent(EVENT_CHECK_FACING, 3000);
                        break;
                    }
                }
                DoMeleeAttackIfReady();
            }
开发者ID:BravadoToDeath,项目名称:ArkCORE-NG,代码行数:63,代码来源:boss_altairus.cpp

示例11: UpdateAI

        void UpdateAI(uint32 diff)
        {
            if (!me->isActiveObject())
                return;

            events.Update(diff);

            switch (events.ExecuteEvent())
            {
                case 1:
                    if (Creature* c = me->FindNearestCreature(NPC_SUNWELL_HONOR_GUARD, 60.0f, true))
                        c->AI()->Talk(0);
                    break;
                case 2:
                    if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
                        c->AI()->Talk(0);
                    break;
                case 3:
                    me->SetWalk(true);
                    me->GetMotionMaster()->MovePath(me->GetEntry()*100, false);
                    if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
                    {
                        c->SetWalk(true);
                        c->GetMotionMaster()->MovePath(c->GetEntry()*100, false);
                    }
                    if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
                    {
                        c->SetWalk(true);
                        c->GetMotionMaster()->MovePath(c->GetEntry()*100, false);
                    }
                    break;
                case 4:
                    Talk(0);
                    break;
                case 5:
                    if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
                        c->AI()->Talk(1);
                    break;
                case 6:
                    if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
                        c->AI()->Talk(2, ObjectAccessor::GetPlayer(*me, playerGUID));
                    break;
                case 7:
                    Talk(1, ObjectAccessor::GetPlayer(*me, playerGUID));
                    break;
                case 8:
                    Talk(2);
                    break;
                case 9:
                    Talk(3);
                    break;
                case 10:
                    if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
                        c->AI()->Talk(0);
                    break;
                case 11:
                    if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
                        c->AI()->Talk(1);
                    break;
                case 12:
                    if (Player* p = ObjectAccessor::GetPlayer(*me, playerGUID))
                        Talk(p->GetTeamId() == TEAM_ALLIANCE ? 5 : 4, p);
                    break;
                case 13:
                    me->setActive(false);
                    if (Creature* c = me->FindNearestCreature(NPC_SUNWELL_VISUAL_BUNNY, 60.0f, true))
                        c->DespawnOrUnsummon(1);
                    if (GameObject* go = me->FindNearestGameObject(GO_QUEL_DELAR, 60.0f))
                        go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
                    me->SetWalk(true);
                    if (me->GetCreatureData())
                        me->GetMotionMaster()->MovePoint(0, me->GetCreatureData()->posX, me->GetCreatureData()->posY, me->GetCreatureData()->posZ);
                    if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
                    {
                        c->SetWalk(true);
                        if (c->GetCreatureData())
                            c->GetMotionMaster()->MovePoint(0, c->GetCreatureData()->posX, c->GetCreatureData()->posY, c->GetCreatureData()->posZ);
                    }
                    if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
                    {
                        c->SetWalk(true);
                        if (c->GetCreatureData())
                            c->GetMotionMaster()->MovePoint(0, c->GetCreatureData()->posX, c->GetCreatureData()->posY, c->GetCreatureData()->posZ);
                    }
                    break;
            }
        }
开发者ID:boom8866,项目名称:azerothcore-wotlk,代码行数:87,代码来源:zone_isle_of_queldanas.cpp

示例12: UpdateAI

                void UpdateAI(const uint32 diff)
                {
                    if (!UpdateVictim())
                        return;
					
					if (AggroResetTime)
                    {
                    //Attack random Gamers
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true))
                        {
                        me->AddThreat(target, 1.0f);
                        me->TauntApply(target);
                        AttackStart(target);
                        }
                    AggroResetTime = false;
					}
					
                    events.Update(diff);

                    if (me->HasUnitState(UNIT_STATE_CASTING))
                        return;

                    while (uint32 eventId = events.ExecuteEvent())
                    {
                        switch (eventId)
                        {
                            case EVENT_ENERGY_DRAIN:
                                if (me->GetPower(POWER_ENERGY) == 0)
                                {
                                    DoCast(me, SPELL_SMOLDERING_DEVASTATION);
                                    me->SetPower(POWER_ENERGY, 100);
                                    Devastion++;
                                    if (Devastion == 3)
                                    {
                                        events.CancelEvent(EVENT_ENERGY_DRAIN);
                                        events.ScheduleEvent(EVENT_PHASE_LOWER, 10000);
                                        break;
                                    }
                                }
                                else
                                    me->SetPower(POWER_ENERGY, (me->GetPower(POWER_ENERGY) - 1));

                                events.ScheduleEvent(EVENT_ENERGY_DRAIN, 1000, EVENT_GROUP_UP_PHASE);
                                break;
                            case EVENT_EMBER_FLARE:
                                DoCast(me, SPELL_EMBER_FLARE);
                                events.ScheduleEvent(EVENT_EMBER_FLARE, urand(10000, 15000));
                                break;
                            case EVENT_METEOR_FALL:
                                if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, true))
                                {
                                    DoCast(target, SPELL_METEOR_FALL);
                                    events.ScheduleEvent(EVENT_METEOR_FALL, urand(20000, 30000));
                                }
                                else
                                    events.ScheduleEvent(EVENT_METEOR_FALL, 5000);
                                break;
                            case EVENT_PHASE_UPPER:
                                me->SetCanFly(true);
                                me->SetDisableGravity(true);
								AggroResetTime = true;
                                me->AddAura(SPELL_WEB_SILK, me);
                                me->GetMotionMaster()->MovePoint(POINT_UP, upPos);
                                _moveup = true;
                                me->SetReactState(REACT_PASSIVE);
                                me->SetPower(POWER_ENERGY, 100);
                                DoCast(me, SPELL_NO_REGEN);
                                events.ScheduleEvent(EVENT_ENERGY_DRAIN, 3000, EVENT_GROUP_UP_PHASE);
                                events.ScheduleEvent(EVENT_SUMMON_CINDERWEB_SPINNER, 10000, EVENT_GROUP_UP_PHASE);
                                events.ScheduleEvent(EVENT_SUMMON_CINDERWEB_DRONE, 44500, EVENT_GROUP_UP_PHASE);
                                events.ScheduleEvent(EVENT_SUMMON_CINDERWEB_SPIDERLING, 12000, EVENT_GROUP_UP_PHASE);
                                events.ScheduleEvent(EVENT_SMOLDERING_DEVASTATION, 120000, EVENT_GROUP_UP_PHASE);
                                events.ScheduleEvent(EVENT_PHASE_LOWER, 312000);
                                events.ScheduleEvent(EVENT_CHECK_UPPER, 1900);
                                if (me->GetMap()->IsHeroic())
                                    events.ScheduleEvent(EVENT_SUMMON_ENGORGED_BROODLING, 45000, EVENT_GROUP_UP_PHASE);
                                break;
                            case EVENT_PHASE_LOWER:
                                events.CancelEvent(EVENT_SUMMON_CINDERWEB_SPINNER);
                                events.CancelEvent(EVENT_SUMMON_CINDERWEB_DRONE);
                                events.CancelEvent(EVENT_SUMMON_CINDERWEB_SPIDERLING);
                                events.CancelEvent(EVENT_SUMMON_ENGORGED_BROODLING);
                                events.CancelEvent(EVENT_SMOLDERING_DEVASTATION);
                                events.CancelEvent(EVENT_CHECK_UPPER);
                                events.CancelEvent(EVENT_METEOR_FALL);
                                me->GetMotionMaster()->MovePoint(POINT_DOWN, 67.888f, 387.82f, 74.042f);
                                me->SetPower(POWER_ENERGY, 0);
                                events.ScheduleEvent(EVENT_ATTACK_START, 12000);
                                events.ScheduleEvent(EVENT_FRENZY, 13000);
                                events.ScheduleEvent(EVENT_WIDOWS_KISS, 15000);
                                break;
                            case EVENT_SUMMON_CINDERWEB_SPINNER:
                                for (int i = 0; i < 5; i++)
                                    me->SummonCreature(NPC_LIFT_CONTROLLER, CinderwebSummonPos[i].GetPositionX(),
                                            CinderwebSummonPos[i].GetPositionY(), CinderwebSummonPos[i].GetPositionZ(),
                                            0, TEMPSUMMON_TIMED_DESPAWN, 120000);
                                events.ScheduleEvent(EVENT_SUMMON_CINDERWEB_SPINNER, 55000, EVENT_GROUP_UP_PHASE);
                                break;
                            case EVENT_SUMMON_CINDERWEB_DRONE:
                                me->SummonCreature(NPC_CINDERWEB_DRONE, DronePositionSummon[urand(0, 1)],
//.........这里部分代码省略.........
开发者ID:ter884,项目名称:TER-Server,代码行数:101,代码来源:boss_bethtilac.cpp

示例13: UpdateAI

        void UpdateAI(uint32 const diff)
        {
            if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
                return;

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                case EVENT_BLOOD_SUMMON:
                    switch (urand(0, 1))
                    {
                    case 0:
                        me->SummonCreature(NPC_BLACK_BLOOD, SummonPositions[0], TEMPSUMMON_MANUAL_DESPAWN);
                        me->SummonCreature(NPC_COBLAT_BLOOD, SummonPositions[1], TEMPSUMMON_MANUAL_DESPAWN);
                        me->SummonCreature(NPC_CRIMSON_BLOOD, SummonPositions[2], TEMPSUMMON_MANUAL_DESPAWN);
                        if(IsHeroic())
                            me->SummonCreature(NPC_GLOWING_BLOOD, SummonPositions[3], TEMPSUMMON_MANUAL_DESPAWN);
                        Talk(YELL);
                        break;
                    case 1:
                        me->SummonCreature(NPC_GLOWING_BLOOD, SummonPositions[3], TEMPSUMMON_MANUAL_DESPAWN);
                        me->SummonCreature(NPC_ACIDIC_BLOOD, SummonPositions[4], TEMPSUMMON_MANUAL_DESPAWN);
                        me->SummonCreature(NPC_SHADOWED_BLOOD, SummonPositions[5], TEMPSUMMON_MANUAL_DESPAWN);
                        if(IsHeroic())
                            me->SummonCreature(NPC_CRIMSON_BLOOD, SummonPositions[2], TEMPSUMMON_MANUAL_DESPAWN);
                        Talk(YELL);
                        break;
                    }
                    events.ScheduleEvent(EVENT_BLOOD_SUMMON, 82000);
                    break;

                case EVENT_COID_BOLT:
                    if(me->HasAura(SPELL_GLOWING_BLOOD_OF_SHUMA))
                    {
                        if(Unit* target = me->FindNearestPlayer(100.0f))
                            DoCast(target, SPELL_COID_BOLT);
                    }
                    else if(Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO))
                        DoCast(target, SPELL_COID_BOLT);

                    if(me->HasAura(SPELL_GLOWING_BLOOD_OF_SHUMA))
                        events.ScheduleEvent(EVENT_COID_BOLT, urand(2500, 15000));
                    else
                        events.ScheduleEvent(EVENT_COID_BOLT, urand(5000, 30000));
                    break;

                case EVENT_SEARING_BLOOD:
                    if(me->HasAura(SPELL_CRIMSON_BLOOD_OF_SHUMA))
                    {
                        if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
                           DoCast(target, SPELL_SEARING_BLOOD);
                        events.ScheduleEvent(EVENT_SEARING_BLOOD, urand(5000,30000));
                    }
                    else
                        events.ScheduleEvent(EVENT_SEARING_BLOOD, 1000);
                    break;

                case EVENT_MANA_VOID:
                    if (me->HasAura(SPELL_COBALT_BLOOD_OF_SHUMA) && !mana_void)
                    {
                        me->SummonCreature(NPC_MANA_VOID, SummonMvPositions[urand(0,5)], TEMPSUMMON_MANUAL_DESPAWN);
                        mana_void = true;
                    }
                    if (!me->HasAura(SPELL_COBALT_BLOOD_OF_SHUMA) && mana_void)
                        mana_void = false;
                    events.ScheduleEvent(EVENT_MANA_VOID, 1000);
                    break;

                case EVENT_FORGOTTEN_ONE:
                    if(me->HasAura(SPELL_BLACK_BLOOD_OF_SHUMA))
                    {
                        switch(urand(0,2))
                        {
                        case 1:
                            for (int8 i = 0; i < 3; i++)
                            me->SummonCreature(NPC_FORGOTTEN_ONE, forgotten[i], TEMPSUMMON_TIMED_DESPAWN, 60000);
                            break;
                        case 2:
                            for (int8 i = 0; i < 3; i++)
                            me->SummonCreature(NPC_FORGOTTEN_ONE, forgotten2[i], TEMPSUMMON_TIMED_DESPAWN, 60000);
                            break;
                        case 3:
                            for (int8 i = 0; i < 3; i++)
                            me->SummonCreature(NPC_FORGOTTEN_ONE, forgotten3[i], TEMPSUMMON_TIMED_DESPAWN, 60000);
                            break;
                        }
                        events.ScheduleEvent(EVENT_FORGOTTEN_ONE, urand(7500,15000));
                    }
                    else
                        events.ScheduleEvent(EVENT_FORGOTTEN_ONE, 1000);
                    break;

                case EVENT_DIGESTIVE_ACID:
                    if(me->HasAura(SPELL_ACIDIC_BLOOD_OF_SHUMA))
                    {
                        Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
                        for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
//.........这里部分代码省略.........
开发者ID:Tithand,项目名称:TER-Server,代码行数:101,代码来源:boss_yorsahj_unsleeping.cpp

示例14: UpdateAI

        void UpdateAI(uint32 diff)
        {
			events.Update(diff);
			switch (events.ExecuteEvent())
			{
				case EVENT_MAD_1:
					me->SetVisible(true);
					if (Creature* brutallus = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_BRUTALLUS)))
					{
						me->SetTarget(brutallus->GetGUID());
						brutallus->SetReactState(REACT_PASSIVE);
						brutallus->setActive(true);
					}
					me->GetMotionMaster()->MovePoint(1, 1477.94f, 643.22f, 21.21f);
					me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD);
					events.ScheduleEvent(EVENT_MAD_2, 6000);
					break;
				case EVENT_MAD_2:
					Talk(SAY_MAD_1);
					me->CastSpell(me, SPELL_MADRIGOSA_FREEZE, false);
					events.ScheduleEvent(EVENT_MAD_2_1, 1000);
					break;
				case EVENT_MAD_2_1:
					me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
					me->SetDisableGravity(false);
					me->CastSpell(me, SPELL_MADRIGOSA_FROST_BREATH, false);
					events.ScheduleEvent(EVENT_MAD_3, 7000);
					break;
				case EVENT_MAD_3:
					Talk(SAY_MAD_2);
					events.ScheduleEvent(EVENT_MAD_4, 7000);
					break;
				case EVENT_MAD_4:
					if (Creature* brutallus = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_BRUTALLUS)))
						brutallus->AI()->Talk(YELL_INTRO);
					events.ScheduleEvent(EVENT_MAD_5, 5000);
					break;
				case EVENT_MAD_5:
					if (Creature* brutallus = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_BRUTALLUS)))
					{
						brutallus->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK1H);
						me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK1H);
					}
					events.ScheduleEvent(EVENT_MAD_6, 10000);
					break;
				case EVENT_MAD_6:
					if (Creature* brutallus = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_BRUTALLUS)))
					{
						brutallus->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
						me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
					}
					me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
					me->SetDisableGravity(true);
					events.ScheduleEvent(EVENT_MAD_7, 4000);
					break;
				case EVENT_MAD_7:
					Talk(SAY_MAD_3);
					me->CastSpell(me, SPELL_MADRIGOSA_FROST_BLAST, false);
					events.ScheduleEvent(EVENT_MAD_8, 3000);
					events.ScheduleEvent(EVENT_MAD_8, 5000);
					events.ScheduleEvent(EVENT_MAD_8, 6500);
					events.ScheduleEvent(EVENT_MAD_8, 7500);
					events.ScheduleEvent(EVENT_MAD_8, 8500);
					events.ScheduleEvent(EVENT_MAD_8, 9500);
					events.ScheduleEvent(EVENT_MAD_9, 11000);
					events.ScheduleEvent(EVENT_MAD_8, 12000);
					events.ScheduleEvent(EVENT_MAD_8, 14000);
					break;
				case EVENT_MAD_8:
					if (Creature* brutallus = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_BRUTALLUS)))
						me->CastSpell(brutallus, SPELL_MADRIGOSA_FROSTBOLT, false);
					break;
				case EVENT_MAD_9:
					if (Creature* brutallus = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_BRUTALLUS)))
					{
						brutallus->CastSpell(brutallus, SPELL_BRUTALLUS_FLAME_RING, true);
						brutallus->RemoveAllAuras();
						brutallus->CastSpell(brutallus, SPELL_BRUTALLUS_FEL_FIREBALL, false);
						brutallus->AI()->Talk(YELL_INTRO_BREAK_ICE);
					}
					events.ScheduleEvent(EVENT_MAD_11, 6000);
					break;
				//case EVENT_MAD_10:
				case EVENT_MAD_11:
					me->SetDisableGravity(false);
					me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
					events.ScheduleEvent(EVENT_MAD_13, 2500);
					break;
				case EVENT_MAD_13:
					Talk(SAY_MAD_4);
					me->RemoveAllAuras();
					me->CastSpell(me, SPELL_MADRIGOSA_ENCAPSULATE, false);
					events.ScheduleEvent(EVENT_MAD_14, 2000);
					break;
				case EVENT_MAD_14:
					if (Creature* brutallus = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_BRUTALLUS)))
					{
						brutallus->SetDisableGravity(true);
						brutallus->GetMotionMaster()->MovePoint(0, brutallus->GetPositionX(), brutallus->GetPositionY()-30.0f, brutallus->GetPositionZ()+15.0f, false, true);
					}
//.........这里部分代码省略.........
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:101,代码来源:boss_brutallus.cpp

示例15: UpdateAI

        void UpdateAI(uint32 diff)
        {
            if (phase == PHASE_INTRO)
            {
                if (!instance)
                    return;

                events.Update(diff);
                switch (events.ExecuteEvent())
                {
                    case EVENT_INTRO_1:
                        Talk(SAY_JAINA_INTRO_1);
                        events.ScheduleEvent(EVENT_INTRO_2, 8000);
                        break;

                    case EVENT_INTRO_2:
                        Talk(SAY_JAINA_INTRO_2);
                        events.ScheduleEvent(EVENT_INTRO_3, 8500);
                        break;

                    case EVENT_INTRO_3:
                        Talk(SAY_JAINA_INTRO_3);
                        events.ScheduleEvent(EVENT_INTRO_4, 8000);
                        break;

                    case EVENT_INTRO_4:
                        Talk(SAY_JAINA_INTRO_4);
                        events.ScheduleEvent(EVENT_INTRO_5, 10000);
                        break;

                    case EVENT_INTRO_5:
                        Talk(SAY_JAINA_INTRO_5);
                        events.ScheduleEvent(EVENT_INTRO_6, 8000);
                        break;

                    case EVENT_INTRO_6:
                        Talk(SAY_JAINA_INTRO_6);
                        events.ScheduleEvent(EVENT_INTRO_7, 12000);
                        break;

                    case EVENT_INTRO_7:
                        Talk(SAY_JAINA_INTRO_7);
                        events.ScheduleEvent(EVENT_INTRO_8, 8000);
                        break;

                    case EVENT_INTRO_8:
                        Talk(SAY_JAINA_INTRO_8);
                        // End of Intro
                        phase = PHASE_NORMAL;
                        break;
                }
            }

            //Return since we have no target
            if (!UpdateVictim())
                return;

            events.Update(diff);

            DoMeleeAttackIfReady();
        }
开发者ID:PavelDev,项目名称:wodnetcore,代码行数:61,代码来源:forge_of_souls.cpp


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