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

C++ CheckInRoom函数代码示例

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

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



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

示例1: UpdateAI

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

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_SLIME_SPRAY:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
                            {
                                DoSummon(NPC_OOZE_SPRAY_STALKER, *target, 8000, TEMPSUMMON_TIMED_DESPAWN);
                                Talk(EMOTE_SLIME_SPRAY);
                                DoCast(me, SPELL_SLIME_SPRAY);
                            }
                            events.ScheduleEvent(EVENT_SLIME_SPRAY, 20000);
                            break;
                        case EVENT_HASTEN_INFECTIONS:
                            if (infectionStage++ < 4)
                            {
                                infectionCooldown -= 2000;
                                events.ScheduleEvent(EVENT_HASTEN_INFECTIONS, 90000);
                            }
                            break;
                        case EVENT_MUTATED_INFECTION:
                            me->CastCustomSpell(SPELL_MUTATED_INFECTION, SPELLVALUE_MAX_TARGETS, 1, NULL, false);
                            events.ScheduleEvent(EVENT_MUTATED_INFECTION, infectionCooldown);
                            break;
                        default:
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
开发者ID:VistaWoW,项目名称:VistaTC,代码行数:41,代码来源:boss_rotface.cpp


示例2: UpdateAI

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

            events.Update(diff);

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_CLEAVE:
                        DoCastVictim(SPELL_CLEAVE);
                        events.ScheduleEvent(EVENT_CLEAVE, urand(10 * IN_MILLISECONDS, 16 * IN_MILLISECONDS));
                        break;
                    case EVENT_FRIGHTENING_SHOUT:
                        DoCastVictim(SPELL_FRIGHTENING_SHOUT);
                        events.ScheduleEvent(EVENT_FRIGHTENING_SHOUT, urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS));
                        break;
                    case EVENT_WHIRLWIND1:
                        DoCastVictim(SPELL_WHIRLWIND1);
                        events.ScheduleEvent(EVENT_WHIRLWIND1, urand(6 * IN_MILLISECONDS, 10 * IN_MILLISECONDS));
                        break;
                    case EVENT_WHIRLWIND2:
                        DoCastVictim(SPELL_WHIRLWIND2);
                        events.ScheduleEvent(EVENT_WHIRLWIND2, urand(10 * IN_MILLISECONDS, 25 * IN_MILLISECONDS));
                        break;
                    case EVENT_MORTAL_STRIKE:
                        DoCastVictim(SPELL_MORTAL_STRIKE);
                        events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(10 * IN_MILLISECONDS, 30 * IN_MILLISECONDS));
                        break;
                    default:
                        break;
                }
            }

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


示例3: UpdateAI

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

            events.Update(diff);

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_WHIRLWIND:
                        DoCastVictim(SPELL_WHIRLWIND);
                        events.ScheduleEvent(EVENT_WHIRLWIND, urand(8 * IN_MILLISECONDS, 18 * IN_MILLISECONDS));
                        break;
                    case EVENT_WHIRLWIND2:
                        DoCastVictim(SPELL_WHIRLWIND2);
                        events.ScheduleEvent(EVENT_WHIRLWIND2, urand(7 * IN_MILLISECONDS, 25 * IN_MILLISECONDS));
                        break;
                    case EVENT_KNOCKDOWN:
                        DoCastVictim(SPELL_KNOCKDOWN);
                        events.ScheduleEvent(EVENT_KNOCKDOWN, urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS));
                        break;
                    case EVENT_FRENZY:
                        DoCastVictim(SPELL_FRENZY);
                        events.ScheduleEvent(EVENT_FRENZY, urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS));
                        break;
                    case EVENT_RANDOM_YELL:
                        Talk(SAY_RANDOM);
                        events.ScheduleEvent(EVENT_RANDOM_YELL, urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS));
                        break;
                    default:
                        break;
                }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:AwkwardDev,项目名称:RE,代码行数:41,代码来源:boss_drekthar.cpp


示例4: UpdateAI

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

        events.Update(diff);

        while (uint32 eventId = events.ExecuteEvent())
        {
            switch(eventId)
            {
                case EVENT_DISRUPT:
                    DoCastAOE(SPELL_SPELL_DISRUPTION);
                    events.ScheduleEvent(EVENT_DISRUPT, urand(5000, 10000));
                    break;
                case EVENT_FEVER:
                    DoCastAOE(SPELL_DECREPIT_FEVER);
                    events.ScheduleEvent(EVENT_FEVER, urand(20000, 25000));
                    break;
                case EVENT_PHASE:
                    // TODO : Add missing texts for both phase switches
                    EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT);
                    break;
                case EVENT_ERUPT:
                    instance->SetData(DATA_HEIGAN_ERUPT, eruptSection);
                    TeleportCheaters();

                    if (eruptSection == 0)
                        eruptDirection = true;
                    else if (eruptSection == 3)
                        eruptDirection = false;

                    eruptDirection ? ++eruptSection : --eruptSection;

                    events.ScheduleEvent(EVENT_ERUPT, phase == PHASE_FIGHT ? 10000 : 3000);
                    break;
            }
        }

        DoMeleeAttackIfReady();
    }
开发者ID:Archives,项目名称:ro_core,代码行数:41,代码来源:boss_heigan.cpp


示例5: UpdateAI

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

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_IMPALE:
                        //Cast Impale on a random target
                        //Do NOT cast it when we are afflicted by locust swarm
                        if (!me->HasAura(RAID_MODE(SPELL_LOCUST_SWARM_10, SPELL_LOCUST_SWARM_25)))
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                DoCast(target, RAID_MODE(SPELL_IMPALE_10, SPELL_IMPALE_25));
                        events.ScheduleEvent(EVENT_IMPALE, urand(10000, 20000));
                        break;
                    case EVENT_LOCUST:
                        // TODO : Add Text
                        DoCast(me, RAID_MODE(SPELL_LOCUST_SWARM_10, SPELL_LOCUST_SWARM_25));
                        DoSummon(MOB_CRYPT_GUARD, GuardSummonPos, 0, TEMPSUMMON_CORPSE_DESPAWN);
                        events.ScheduleEvent(EVENT_LOCUST, 90000);
                        break;
                    case EVENT_SPAWN_GUARDIAN_NORMAL:
                        // TODO : Add Text
                        DoSummon(MOB_CRYPT_GUARD, GuardSummonPos, 0, TEMPSUMMON_CORPSE_DESPAWN);
                        break;
                    case EVENT_BERSERK:
                        DoCast(me, SPELL_BERSERK, true);
                        events.ScheduleEvent(EVENT_BERSERK, 600000);
                        break;
                }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Bootz,项目名称:TrilliumEMU-1,代码行数:38,代码来源:boss_anubrekhan.cpp


示例6: UpdateAI

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

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

                events.Update(diff);

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_CAST_CLEAVE_ARMOR:
                            DoCastVictim(SPELL_CLEAVE_ARMOR);
                            events.ScheduleEvent(EVENT_CAST_CLEAVE_ARMOR, urand(3500,4500));
                            break;
                        case EVENT_CAST_INTIMIDATING_ROAR:
                            DoCastAOE(SPELL_INTIMIDATING_ROAR);
                            events.ScheduleEvent(EVENT_CAST_INTIMIDATING_ROAR, urand(10000,11000));
                            break;
                        case EVENT_CAST_SUMMON_FLAMECALLER:
                            if (Creature* pCreature1 = me->SummonCreature(NPC_ONYX_FLAMECALLER,SpawnPos[0]))
                            {
                                pCreature1->GetMotionMaster()->MovePoint(1,SpawnPos[1]);
                            }
                            if (Creature* pCreature2 = me->SummonCreature(NPC_ONYX_FLAMECALLER,SpawnPos[2]))
                            {
                                pCreature2->GetMotionMaster()->MovePoint(1,SpawnPos[3]);
                            }
                            events.ScheduleEvent(EVENT_CAST_SUMMON_FLAMECALLER, urand(40000,50000));
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
开发者ID:Adeer,项目名称:Patch,代码行数:38,代码来源:boss_zarithrian.cpp


示例7: UpdateAI

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

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_IMPALE:
                        //Cast Impale on a random target
                        //Do NOT cast it when we are afflicted by locust swarm
                        if (!me->HasAura(sSpellMgr->GetSpellIdForDifficulty(SPELL_LOCUST_SWARM, me)))
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                DoCast(target, SPELL_IMPALE);
                        events.ScheduleEvent(EVENT_IMPALE, urand(10000, 20000));
                        break;
                    case EVENT_LOCUST:
                        /// @todo Add Text
                        DoCast(me, SPELL_LOCUST_SWARM);
                        DoSummon(NPC_CRYPT_GUARD, GuardSummonPos, 0, TEMPSUMMON_CORPSE_DESPAWN);
                        events.ScheduleEvent(EVENT_LOCUST, 90000);
                        break;
                    case EVENT_SPAWN_GUARDIAN_NORMAL:
                        /// @todo Add Text
                        DoSummon(NPC_CRYPT_GUARD, GuardSummonPos, 0, TEMPSUMMON_CORPSE_DESPAWN);
                        break;
                    case EVENT_BERSERK:
                        DoCast(me, SPELL_BERSERK, true);
                        events.ScheduleEvent(EVENT_BERSERK, 600000);
                        break;
                }
            }

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


示例8: UpdateAI

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

                events.Update(diff);

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_IMPALE:
                            if (!me->HasAura(SPELL_LOCUST_SWARM))
                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                                    DoCast(target, SPELL_IMPALE);
                            events.ScheduleEvent(EVENT_IMPALE, urand(10000, 20000));
                            break;
                        case EVENT_LOCUST:
                            TalkToMap(EMOTE_LOCUST);
                            DoCast(me, SPELL_LOCUST_SWARM);
                            me->SummonCreature(NPC_CRYPT_GUARD, GuardSummonPos, TEMPSUMMON_CORPSE_DESPAWN, 5000);
                            events.ScheduleEvent(EVENT_LOCUST, 90000);
                            events.RescheduleEvent(EVENT_IMPALE, 20000);
                            break;
                        case EVENT_SUMMON_GUARDIAN:
                            TalkToMap(EMOTE_CRYPT);
                            me->SummonCreature(NPC_CRYPT_GUARD, GuardSummonPos, TEMPSUMMON_CORPSE_DESPAWN, 5000);
                            break;
                        case EVENT_BERSERK:
                            DoCastAOE(SPELL_BERSERK);
                            events.ScheduleEvent(EVENT_BERSERK, 600000);
                            break;
                    }
                }
                DoMeleeAttackIfReady();
            }
开发者ID:ddark,项目名称:ecl,代码行数:36,代码来源:boss_anubrekhan.cpp


示例9: UpdateAI

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

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_INHALE_BLIGHT:
                        {
                            RemoveBlight();
                            if (_inhaleCounter == 3)
                            {
                                Talk(EMOTE_WARN_PUNGENT_BLIGHT);
                                Talk(SAY_PUNGENT_BLIGHT);
                                DoCast(me, SPELL_PUNGENT_BLIGHT);
                                _inhaleCounter = 0;
                                if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PROFESSOR_PUTRICIDE)))
                                    professor->AI()->DoAction(ACTION_FESTERGUT_GAS);
                                events.RescheduleEvent(EVENT_GAS_SPORE, urand(20000, 25000));
                            }
                            else
                            {
                                DoCast(me, SPELL_INHALE_BLIGHT);
                                // just cast and dont bother with target, conditions will handle it
                                ++_inhaleCounter;
                                if (_inhaleCounter < 3)
                                    me->CastSpell(me, gaseousBlight[_inhaleCounter], true, NULL, NULL, me->GetGUID());
                            }

                            events.ScheduleEvent(EVENT_INHALE_BLIGHT, urand(33500, 35000));
                            break;
                        }
                        case EVENT_VILE_GAS:
                        {
                            std::list<Unit*> targets;
                            uint32 minTargets = RAID_MODE<uint32>(3, 8, 3, 8);
                            SelectTargetList(targets, minTargets, SELECT_TARGET_RANDOM, -5.0f, true);
                            float minDist = 0.0f;
                            if (targets.size() >= minTargets)
                                minDist = -5.0f;

                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, minDist, true))
                                DoCast(target, SPELL_VILE_GAS);
                            events.ScheduleEvent(EVENT_VILE_GAS, urand(28000, 35000));
                            break;
                        }
                        case EVENT_GAS_SPORE:
                            Talk(EMOTE_WARN_GAS_SPORE);
                            Talk(EMOTE_GAS_SPORE);
                            me->CastCustomSpell(SPELL_GAS_SPORE, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 3, 2, 3), me);
                            events.ScheduleEvent(EVENT_GAS_SPORE, urand(40000, 45000));
                            events.RescheduleEvent(EVENT_VILE_GAS, urand(28000, 35000));
                            break;
                        case EVENT_GASTRIC_BLOAT:
                            DoCastVictim(SPELL_GASTRIC_BLOAT);
                            events.ScheduleEvent(EVENT_GASTRIC_BLOAT, urand(15000, 17500));
                            break;
                        case EVENT_BERSERK:
                            DoCast(me, SPELL_BERSERK2);
                            Talk(SAY_BERSERK);
                            break;
                        default:
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
开发者ID:Carbinfibre,项目名称:Script-Land,代码行数:75,代码来源:boss_festergut.cpp


示例10: UpdateAI

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

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_INHALE_BLIGHT:
                        {
                            RemoveBlight();
                            if (_inhaleCounter == 3)
                            {
                                Talk(EMOTE_WARN_PUNGENT_BLIGHT);
                                Talk(SAY_PUNGENT_BLIGHT);
                                DoCast(me, SPELL_PUNGENT_BLIGHT);
                                _inhaleCounter = 0;
                                if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PROFESSOR_PUTRICIDE)))
                                    professor->AI()->DoAction(ACTION_FESTERGUT_GAS);
                                events.RescheduleEvent(EVENT_GAS_SPORE, urand(20000, 25000));
                            }
                            else
                            {
                                DoCast(me, SPELL_INHALE_BLIGHT);
                                // just cast and dont bother with target, conditions will handle it
                                ++_inhaleCounter;
                                if (_inhaleCounter < 3)
                                    me->CastSpell(me, gaseousBlight[_inhaleCounter], true, NULL, NULL, me->GetGUID());
                            }

                            events.ScheduleEvent(EVENT_INHALE_BLIGHT, urand(33500, 35000));
                            break;
                        }
                        case EVENT_VILE_GAS:
                        {
                            std::list<Unit*> ranged, melee;
                            uint32 minTargets = RAID_MODE<uint32>(3, 8, 3, 8);
                            SelectTargetList(ranged, 25, SELECT_TARGET_RANDOM, -5.0f, true);
                            SelectTargetList(melee, 25, SELECT_TARGET_RANDOM, 5.0f, true);
                            while (ranged.size() < minTargets)
                            {
                                if (melee.empty())
                                    break;

                                Unit* target = Trinity::Containers::SelectRandomContainerElement(melee);
                                ranged.push_back(target);
                                melee.remove(target);
                            }

                            if (!ranged.empty())
                            {
                                Trinity::Containers::RandomResizeList(ranged, RAID_MODE<uint32>(1, 3, 1, 3));
                                for (std::list<Unit*>::iterator itr = ranged.begin(); itr != ranged.end(); ++itr)
                                    DoCast(*itr, SPELL_VILE_GAS);
                            }

                            events.ScheduleEvent(EVENT_VILE_GAS, urand(28000, 35000));
                            break;
                        }
                        case EVENT_GAS_SPORE:
                            Talk(EMOTE_WARN_GAS_SPORE);
                            Talk(EMOTE_GAS_SPORE);
                            me->CastCustomSpell(SPELL_GAS_SPORE, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 3, 2, 3), me);
                            events.ScheduleEvent(EVENT_GAS_SPORE, urand(40000, 45000));
                            events.RescheduleEvent(EVENT_VILE_GAS, urand(28000, 35000));
                            break;
                        case EVENT_GASTRIC_BLOAT:
                            DoCastVictim(SPELL_GASTRIC_BLOAT);
                            events.ScheduleEvent(EVENT_GASTRIC_BLOAT, urand(15000, 17500));
                            break;
                        case EVENT_BERSERK:
                            DoCast(me, SPELL_BERSERK2);
                            Talk(SAY_BERSERK);
                            break;
                        default:
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
开发者ID:shaunk1593,项目名称:Crusade,代码行数:87,代码来源:boss_festergut.cpp


示例11: UpdateAI

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

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_BONE_SPIKE_GRAVEYARD:
                            if (IsHeroic() || !me->HasAura(SPELL_BONE_STORM))
                                DoCast(me, SPELL_BONE_SPIKE_GRAVEYARD);
                            events.ScheduleEvent(EVENT_BONE_SPIKE_GRAVEYARD, urand(15000, 20000), EVENT_GROUP_SPECIAL);
                            break;
                        case EVENT_COLDFLAME:
                            _coldflameLastPos.Relocate(me);
                            _coldflameTarget.Clear();
                            if (!me->HasAura(SPELL_BONE_STORM))
                                DoCastAOE(SPELL_COLDFLAME_NORMAL);
                            else
                                DoCast(me, SPELL_COLDFLAME_BONE_STORM);
                            events.ScheduleEvent(EVENT_COLDFLAME, 5000, EVENT_GROUP_SPECIAL);
                            break;
                        case EVENT_WARN_BONE_STORM:
                            _boneSlice = false;
                            Talk(EMOTE_BONE_STORM);
                            me->FinishSpell(CURRENT_MELEE_SPELL, false);
                            DoCast(me, SPELL_BONE_STORM);
                            events.DelayEvents(3000, EVENT_GROUP_SPECIAL);
                            events.ScheduleEvent(EVENT_BONE_STORM_BEGIN, 3050);
                            events.ScheduleEvent(EVENT_WARN_BONE_STORM, urand(90000, 95000));
                            break;
                        case EVENT_BONE_STORM_BEGIN:
                            if (Aura* pStorm = me->GetAura(SPELL_BONE_STORM))
                                pStorm->SetDuration(int32(_boneStormDuration));
                            me->SetSpeed(MOVE_RUN, _baseSpeed*3.0f, true);
                            Talk(SAY_BONE_STORM);
                            events.ScheduleEvent(EVENT_BONE_STORM_END, _boneStormDuration+1);
                            // no break here
                        case EVENT_BONE_STORM_MOVE:
                        {
                            events.ScheduleEvent(EVENT_BONE_STORM_MOVE, _boneStormDuration/3);
                            Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me));
                            if (!unit)
                                unit = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
                            if (unit)
                                me->GetMotionMaster()->MovePoint(POINT_TARGET_BONESTORM_PLAYER, *unit);
                            break;
                        }
                        case EVENT_BONE_STORM_END:
                            if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
                                me->GetMotionMaster()->MovementExpired();
                            me->GetMotionMaster()->MoveChase(me->GetVictim());
                            me->SetSpeed(MOVE_RUN, _baseSpeed, true);
                            events.CancelEvent(EVENT_BONE_STORM_MOVE);
                            events.ScheduleEvent(EVENT_ENABLE_BONE_SLICE, 10000);
                            if (!IsHeroic())
                                events.RescheduleEvent(EVENT_BONE_SPIKE_GRAVEYARD, 15000, EVENT_GROUP_SPECIAL);
                            break;
                        case EVENT_ENABLE_BONE_SLICE:
                            _boneSlice = true;
                            break;
                        case EVENT_ENRAGE:
                            DoCast(me, SPELL_BERSERK, true);
                            Talk(SAY_BERSERK);
                            break;
                    }
                }

                // We should not melee attack when storming
                if (me->HasAura(SPELL_BONE_STORM))
                    return;

                // 10 seconds since encounter start Bone Slice replaces melee attacks
                if (_boneSlice && !me->GetCurrentSpell(CURRENT_MELEE_SPELL))
                    DoCastVictim(SPELL_BONE_SLICE);

                DoMeleeAttackIfReady();
            }
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:84,代码来源:boss_lord_marrowgar.cpp


示例12: UpdateAI

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

            events.Update(diff);

            if (!thirtyPercentReached && HealthBelowPct(30) && phaseTwo)
            {
                thirtyPercentReached = true;
                if (instance)
                    instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
            }

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch(eventId)
                {
                    case EVENT_SUMMON:
                        if (waves[waveCount].entry)
                        {
                            if ((waves[waveCount].mode == 2) && (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL))
                               DoGothikSummon(waves[waveCount].entry);
                            else if ((waves[waveCount].mode == 0) && (getDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL))
                                DoGothikSummon(waves[waveCount].entry);
                            else if (waves[waveCount].mode == 1)
                                DoGothikSummon(waves[waveCount].entry);

                            // if group is not splitted, open gate and merge both sides at ~ 2 minutes (wave 11)
                            if (waveCount == 11)
                            {
                                if (!CheckGroupSplitted())
                                {
                                    if (instance)
                                        instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
                                    summons.DoAction(0, 0);
                                    summons.DoZoneInCombat();
                                    mergedSides = true;
                                }
                            }

                            if (waves[waveCount].mode == 1)
                                events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time);
                            else if ((waves[waveCount].mode == 2) && (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL))
                                events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time);
                            else if ((waves[waveCount].mode == 0) && (getDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL))
                                events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time);
                            else
                                events.ScheduleEvent(EVENT_SUMMON, 0);

                            ++waveCount;
                        }
                        else
                        {
                            phaseTwo = true;
                            DoScriptText(SAY_TELEPORT, me);
                            DoTeleportTo(PosGroundLiveSide);
                            me->SetReactState(REACT_AGGRESSIVE);
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
                            summons.DoAction(0, 0);
                            summons.DoZoneInCombat();
                            events.ScheduleEvent(EVENT_BOLT, 1000);
                            events.ScheduleEvent(EVENT_HARVEST, urand(3000, 15000));
                            events.ScheduleEvent(EVENT_TELEPORT, 20000);
                        }
                        break;
                    case EVENT_BOLT:
                        DoCast(me->getVictim(), RAID_MODE(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT));
                        events.ScheduleEvent(EVENT_BOLT, 1000);
                        break;
                    case EVENT_HARVEST:
                        DoCast(me->getVictim(), SPELL_HARVEST_SOUL, true);
                        events.ScheduleEvent(EVENT_HARVEST, urand(20000, 25000));
                        break;
                    case EVENT_TELEPORT:
                        if (!thirtyPercentReached)
                        {
                            me->AttackStop();
                            if (IN_LIVE_SIDE(me))
                            {
                                DoTeleportTo(PosGroundDeadSide);
                            }
                            else
                            {
                                DoTeleportTo(PosGroundLiveSide);
                            }

                            me->getThreatManager().resetAggro(NotOnSameSide(me));
                            if (Unit *pTarget = SelectTarget(SELECT_TARGET_NEAREST, 0))
                            {
                                me->getThreatManager().addThreat(pTarget, 100.0f);
                                AttackStart(pTarget);
                            }

                            events.ScheduleEvent(EVENT_TELEPORT, 20000);
                        }
                        break;
//.........这里部分代码省略.........
开发者ID:Drethek,项目名称:Darkpeninsula-Cata-Old,代码行数:101,代码来源:boss_gothik.cpp


示例13: UpdateAI

        void UpdateAI(uint32 const diff)
        {
            if (!UpdateVictim() || !CheckInRoom() || me->GetCurrentSpell(CURRENT_CHANNELED_SPELL) || _phase == PHASE_SHIELDED)
                return;

            events.Update(diff);

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_DIVINE_RECKONING:
						if(me->getVictim())
							DoCast(me->getVictim(), SPELL_DIVINE_RECKONING);
                        events.ScheduleEvent(EVENT_DIVINE_RECKONING, urand(10000, 12000));
                        break;
                    case EVENT_BURNING_LIGHT:
                    {
                        Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me));
                        if (!unit)
                            unit = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
						// Still no target, reschedule everything, then break ;	
						if (!unit)
						{
							events.ScheduleEvent(EVENT_SEAR, 2000);
							events.ScheduleEvent(EVENT_BURNING_LIGHT, 12000);
							break ;
						}
                        DoCast(unit, SPELL_BURNING_LIGHT);
						events.ScheduleEvent(EVENT_SEAR, 2000);
						events.ScheduleEvent(EVENT_BURNING_LIGHT, 12000);
                        break;
                    }
                    case EVENT_SEAR:
                    {
                        Unit* target = me->FindNearestCreature(NPC_SEARING_LIGHT, 100.0f);
                        if (!target)
                            break;

                        std::list<Creature*> stalkers;
                        GetCreatureListWithEntryInGrid(stalkers, me, NPC_CAVE_IN_STALKER, 100.0f);
                        stalkers.remove_if(Trinity::HeightDifferenceCheck(ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_ANHUUR_DOOR)), 5.0f, true));

                        if (stalkers.empty())
                            break;

                        stalkers.sort(Trinity::ObjectDistanceOrderPred(target));

                        // Get the closest statue face (any of its eyes)
                        Creature* eye1 = stalkers.front();
						// No pointer, break ;
						if(!eye1)
							break ;
						
                        stalkers.remove(eye1); // Remove the eye.
						
						if(stalkers.empty()) // No object, no pointer
							break ; 
						
                        stalkers.sort(Trinity::ObjectDistanceOrderPred(eye1)); // Find the second eye.
                        Creature* eye2 = stalkers.front();
						// Same deal
						if(!eye2)
							break ;

                        eye1->CastSpell(eye1, SPELL_SEARING_LIGHT, true);
                        eye2->CastSpell(eye2, SPELL_SEARING_LIGHT, true);
                        break;
                    }
                }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:GlassFace,项目名称:Mist-Eria-Core510,代码行数:77,代码来源:boss_temple_guardian_anhuur.cpp


示例14: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (!phase)
                return;

            events.Update(diff);

            if ((phase != PHASE_BIRTH && !UpdateVictim()) || !CheckInRoom())
                return;

            if (CanTheHundredClub)
            {
                if (CheckFrostResistTimer <= diff)
                {
                    CheckPlayersFrostResist();
                    CheckFrostResistTimer = (rand() % 5 + 5) * 1000;
                } else CheckFrostResistTimer -= diff;
            }

            if (phase == PHASE_GROUND)
            {
                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_BERSERK:
                            DoScriptText(EMOTE_ENRAGE, me);
                            DoCast(me, SPELL_BERSERK);
                            return;
                        case EVENT_CLEAVE:
                            DoCast(me->getVictim(), SPELL_CLEAVE);
                            events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND);
                            return;
                        case EVENT_TAIL:
                            DoCastAOE(SPELL_TAIL_SWEEP);
                            events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND);
                            return;
                        case EVENT_DRAIN:
                            DoCastAOE(SPELL_LIFE_DRAIN);
                            events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND);
                            return;
                        case EVENT_BLIZZARD:
                        {
                            //DoCastAOE(SPELL_SUMMON_BLIZZARD);
                            if (Creature* summon = DoSummon(MOB_BLIZZARD, me, 0.0f, urand(25000, 30000), TEMPSUMMON_TIMED_DESPAWN))
                                summon->GetMotionMaster()->MoveRandom(40);
                            events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(20000, 7000), 0, PHASE_GROUND);
                            break;
                        }
                        case EVENT_FLIGHT:
                            if (HealthAbovePct(10))
                            {
                                phase = PHASE_FLIGHT;
                                events.SetPhase(PHASE_FLIGHT);
                                me->SetReactState(REACT_PASSIVE);
                                me->AttackStop();
                                float x, y, z, o;
                                me->GetHomePosition(x, y, z, o);
                                me->GetMotionMaster()->MovePoint(1, x, y, z);
                                return;
                            }
                            break;
                    }
                }

                DoMeleeAttackIfReady();
            }
            else
            {
                if (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_LIFTOFF:
                            me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
                            me->SetLevitate(true);
                            me->SendMovementFlagUpdate();
                            events.ScheduleEvent(EVENT_ICEBOLT, 1500);
                            iceboltCount = RAID_MODE(2, 3);
                            return;
                        case EVENT_ICEBOLT:
                        {
                            std::vector<Unit*> targets;
                            std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
                            for (; i != me->getThreatManager().getThreatList().end(); ++i)
                                if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT))
                                    targets.push_back((*i)->getTarget());

                            if (targets.empty())
                                iceboltCount = 0;
                            else
                            {
                                std::vector<Unit*>::const_iterator itr = targets.begin();
                                advance(itr, rand()%targets.size());
                                iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0));
                                DoCast(*itr, SPELL_ICEBOLT);
                                --iceboltCount;
                            }

                            if (iceboltCount)
//.........这里部分代码省略.........
开发者ID:Asandru,项目名称:Script-Land,代码行数:101,代码来源:boss_sapphiron.cpp


示例15: UpdateAI

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

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_CHECK_PLAYERS:
                            instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TANK_MARKER);
                            events.ScheduleEvent(EVENT_CHECK_PLAYERS, 2000);
                            break;
                        case EVENT_PREPARE_BONE_SPIKE_GRAVEYARD:
                            events.CancelEvent(EVENT_CHECK_PLAYERS);
                            break;
                        case EVENT_BONE_SPIKE_GRAVEYARD:
                            if (IsHeroic() || !me->HasAura(SPELL_BONE_STORM))
                                DoCast(me, SPELL_BONE_SPIKE_GRAVEYARD);
                            events.ScheduleEvent(EVENT_PREPARE_BONE_SPIKE_GRAVEYARD, 12000, EVENT_GROUP_SPECIAL);
                            events.ScheduleEvent(EVENT_BONE_SPIKE_GRAVEYARD, 18000, EVENT_GROUP_SPECIAL);
                            events.ScheduleEvent(EVENT_CHECK_PLAYERS, 4000);
                            break;
                        case EVENT_COLDFLAME:
                            _coldflameLastPos.Relocate(me);
                            _coldflameTarget = 0LL;
                            if (!me->HasAura(SPELL_BONE_STORM))
                                DoCastAOE(SPELL_COLDFLAME_NORMAL);
                            else
                                DoCast(me, SPELL_COLDFLAME_BONE_STORM);
                            events.ScheduleEvent(EVENT_COLDFLAME, 5000, EVENT_GROUP_SPECIAL);
                            break;
                        case EVENT_WARN_BONE_STORM:
                            _boneSlice = false;
                            Talk(EMOTE_BONE_STORM);
                            me->FinishSpell(CURRENT_MELEE_SPELL, false);
                            DoCast(me, SPELL_BONE_STORM);
                            events.DelayEvents(3000, EVENT_GROUP_SPECIAL);
                            me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
                            me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
                            events.ScheduleEvent(EVENT_BONE_STORM_BEGIN, 3050);
                            events.ScheduleEvent(EVENT_WARN_BONE_STORM, 90000);
                            break;
                        case EVENT_BONE_STORM_BEGIN:
                            if (AuraPtr pStorm = me->GetAura(SPELL_BONE_STORM))
                                pStorm->SetDuration(int32(_boneStormDuration));
                            me->SetSpeed(MOVE_RUN, _baseSpeed*3.0f, true);
                            Talk(SAY_BONE_STORM);
                            events.ScheduleEvent(EVENT_BONE_STORM_END, _boneStormDuration+1);
                            // no break here
                        case EVENT_BONE_STORM_MOVE:
                        {
                            events.ScheduleEvent(EVENT_BONE_STORM_MOVE, IsHeroic() ? _boneStormDuration/5 : _boneStormDuration/4);
                            Unit* unit = SelectTarget(SELECT_TARGET_FARTHEST, 0, 60.0f);
                            if (!unit || unit->isPet() || unit->isTotem() || !me->IsWithinLOSInMap(unit))
                                unit = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
                            if (unit)
                                if (unit->isPet() || unit->isTotem() || !me->IsWithinLOSInMap(unit))
                                    unit = SelectTarget(SELECT_TARGET_RANDOM, 1);
                                else 
                                    me->GetMotionMaster()->MovePoint(POINT_TARGET_BONESTORM_PLAYER, unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
                            break;
                        }
                        case EVENT_BONE_STORM_END:
                            if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
                                me->GetMotionMaster()->MovementExpired();
                            me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
                            me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
            

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ CheckInit函数代码示例发布时间:2022-05-30
下一篇:
C++ CheckHr函数代码示例发布时间: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