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


C++ IsHeroic函数代码示例

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


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

示例1: UpdateAI

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

            if (!DrainingCrystal)
            {
                uint32 maxPowerMana = me->GetMaxPower(POWER_MANA);
                if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
                {
                    if (DrainLifeTimer <= diff)
                    {
                        DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE);
                        DrainLifeTimer = 10000;
                    } else DrainLifeTimer -= diff;

                    // Heroic only
                    if (IsHeroic())
                    {
                        if (DrainManaTimer <= diff)
                        {
                            DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1), SPELL_DRAIN_MANA);
                            DrainManaTimer = 10000;
                        } else DrainManaTimer -= diff;
                    }
                }

                if (FelExplosionTimer <= diff)
                {
                    if (!me->IsNonMeleeSpellCasted(false))
                    {
                        DoCast(me, SPELL_FEL_EXPLOSION);
                        FelExplosionTimer = 2000;
                    }
                } else FelExplosionTimer -= diff;

                // If below 10% mana, start recharging
                maxPowerMana = me->GetMaxPower(POWER_MANA);
                if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
                {
                    if (DrainCrystalTimer <= diff)
                    {
                        SelectNearestCrystal();
                        if (IsHeroic())
                            DrainCrystalTimer = urand(10000, 15000);
                        else
                            DrainCrystalTimer = urand(20000, 25000);
                    } else DrainCrystalTimer -= diff;
                }

            }else
            {
                if (IsDraining)
                {
                    if (EmpowerTimer <= diff)
                    {
                        IsDraining = false;
                        DrainingCrystal = false;

                        DoScriptText(SAY_EMPOWERED, me);

                        Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID);
                        if (CrystalChosen && CrystalChosen->isAlive())
                            // Use Deal Damage to kill it, not setDeathState.
                            CrystalChosen->Kill(CrystalChosen);

                        CrystalGUID = 0;

                        me->GetMotionMaster()->Clear();
                        me->GetMotionMaster()->MoveChase(me->getVictim());
                    } else EmpowerTimer -= diff;
                }
            }

            DoMeleeAttackIfReady();                             // No need to check if we are draining crystal here, as the spell has a stun.
        }
开发者ID:Lbniese,项目名称:WoWCircle434,代码行数:76,代码来源:boss_selin_fireheart.cpp

示例2: UpdateAI

            void UpdateAI(const uint32 diff)
            {
                //Return since we have no target
                if (!UpdateVictim())
                    return;

                if (Summon_Timer <= diff)
                {
                    for (uint8 i = 0; i < 3; ++i)
                    {
                        Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
                        Creature* Wraith = me->SummonCreature(21062,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
                        if (pTarget && Wraith)
                            Wraith->AI()->AttackStart(pTarget);
                    }
                    DoScriptText(SAY_SUMMON, me);
                    Summon_Timer = 30000 + rand()%15000;
                }
                else
                    Summon_Timer -= diff;

                if (ManaTap_Timer <= diff)
                {
                    DoCast(me->getVictim(), SPELL_MANA_TAP);
                    ManaTap_Timer = 14000 + rand()%8000;
                }
                else
                    ManaTap_Timer -= diff;

                if (ArcaneTorrent_Timer <= diff)
                {
                    DoCast(me->getVictim(), SPELL_ARCANE_TORRENT);
                    ArcaneTorrent_Timer = 12000 + rand()%6000;
                }
                else
                    ArcaneTorrent_Timer -= diff;

                if (Domination_Timer <= diff)
                {
                    if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
                    {
                        DoScriptText(RAND(SAY_DOMINATION_1,SAY_DOMINATION_2), me);
                        DoCast(pTarget, SPELL_DOMINATION);
                    }
                    Domination_Timer = 25000 + rand()%5000;
                }
                else
                    Domination_Timer -= diff;

                //Only casting if Heroic Mode is used
                if (IsHeroic())
                {
                    if (ArcaneExplosion_Timer <= diff)
                    {
                        DoCast(me->getVictim(), H_SPELL_ARCANE_EXPLOSION);
                        ArcaneExplosion_Timer = 10000 + rand()%4000;
                    }
                    else
                        ArcaneExplosion_Timer -= diff;
                }

                if (!Enraged && HealthBelowPct(21))
                {
                    DoCast(me, SPELL_FRENZY);
                    DoScriptText(SAY_ENRAGE, me);
                    Enraged = true;

                }

                DoMeleeAttackIfReady();
            }
开发者ID:AdrElecTro,项目名称:CactusEMU,代码行数:71,代码来源:boss_pathaleon_the_calculator.cpp

示例3: UpdateAI

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

                events.Update(diff);

                if (me->HasUnitState(UNIT_STAT_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_BONE_SPIKE_GRAVEYARD:
                            events.CancelEvent(EVENT_CHECK_PLAYERS);
                            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);
                            events.ScheduleEvent(EVENT_CHECK_PLAYERS,2000);
                            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, 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:
                        {
                            if(me->GetMap()->IsHeroic())
                                events.ScheduleEvent(EVENT_BONE_STORM_MOVE, _boneStormDuration/5);
                            else events.ScheduleEvent(EVENT_BONE_STORM_MOVE, _boneStormDuration/4);
                            Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 1);
                            if (!unit || unit->isPet() || unit->isTotem())
                                unit = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
                            if (unit)
                                if (unit->isPet() || unit->isTotem())
                                    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);
                            DoStartMovement(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, urand(15000, 20000), 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:FrenchCORE,项目名称:Server,代码行数:98,代码来源:boss_lord_marrowgar.cpp

示例4: UpdateAI

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

            if (IsHeroic() && me->HealthBelowPct(30) && !bShadowBreath)
            {
                bShadowBreath = true;
                if (Creature* pNefarius = me->FindNearestCreature(NPC_LORD_VICTOR_NEFARIUS_HEROIC, 200.0f))
                    pNefarius->AI()->DoAction(ACTION_SHADOW_BREATH);
            }

            events.Update(diff);

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                /*case EVENT_HEAD_START:
                    SetGrounded(true, 0);
                    if (Creature* pMagmawhead = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_MAGMAW_HEAD)))
                        pMagmawhead->AI()->DoAction(ACTION_HEAD_START);
                    events.ScheduleEvent(EVENT_HEAD_END, 20000);
                    break;
                case EVENT_HEAD_END:
                    if (Creature* pMagmawhead = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_MAGMAW_HEAD)))
                        pMagmawhead->AI()->DoAction(ACTION_HEAD_END);
                    SetGrounded(false, 0);
                    events.ScheduleEvent(EVENT_MELEE_CHECK, 6000);
                    events.ScheduleEvent(EVENT_LAVA_SPEW, urand(3000, 7000));
                    events.ScheduleEvent(EVENT_PILLAR_OF_FLAME, urand(10000, 15000));
                    events.ScheduleEvent(EVENT_MAGMA_SPLIT, urand(15000, 20000));
                    break;*/
                case EVENT_BERSERK:
                    DoCast(me, SPELL_BERSERK);
                    break;
                case EVENT_MELEE_CHECK:
                    if (!me->IsWithinMeleeRange(me->getVictim()))
                        DoCast(me, SPELL_MAGMA_SPLIT_2);
                    events.ScheduleEvent(EVENT_MELEE_CHECK, 1000);
                    break;
                case EVENT_MAGMA_SPLIT:
                    me->CastCustomSpell(SPELL_MAGMA_SPLIT_1, SPELLVALUE_MAX_TARGETS, RAID_MODE(3, 8, 3, 8), 0, false); 
                    events.ScheduleEvent(EVENT_MAGMA_SPLIT, urand(15000, 20000));
                    break;
                case EVENT_LAVA_SPEW:
                    DoCast (me, SPELL_LAVA_SPEW);
                    events.ScheduleEvent(EVENT_LAVA_SPEW, 22000);
                    break;
                case EVENT_PILLAR_OF_FLAME:
                    Unit* target;
                    target = SelectTarget(SELECT_TARGET_RANDOM, 1, -20.0f, true);
                    if (!target)
                        target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
                    if (!target)
                        break;
                    me->SummonCreature(NPC_PILLAR_OF_FLAME,
                        target->GetPositionX(),
                        target->GetPositionY(),
                        target->GetPositionZ(),
                        0.0f, TEMPSUMMON_TIMED_DESPAWN, 8000);
                    events.ScheduleEvent(EVENT_PILLAR_OF_FLAME, urand(35000, 45000));
                    break;
                case EVENT_MANGLE:
                    DoCast(me->getVictim(), SPELL_MANGLE);
                    //events.CancelEvent(EVENT_MELEE_CHECK);
                    //events.CancelEvent(EVENT_LAVA_SPEW);
                    //events.CancelEvent(EVENT_PILLAR_OF_FLAME);
                    //events.CancelEvent(EVENT_MAGMA_SPLIT);
                    events.ScheduleEvent(EVENT_MANGLE, 95000);
                    //events.ScheduleEvent(EVENT_HEAD_START, 12000);
                    break;
                }
            }
            if (me->getVictim())
                if (!me->getVictim()->HasAura(SPELL_MANGLE) && !bGrounded)
                    DoMeleeAttackIfReady();
        }
开发者ID:Expery,项目名称:Core,代码行数:81,代码来源:boss_magmaw.cpp

示例5: UpdateAI

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

            // Evade if too far
            if (check_Timer <= diff)
            {
                float x, y, z, o;
                me->GetHomePosition(x, y, z, o);
                if (!me->IsWithinDist3d(x, y, z, 60))
                {
                    EnterEvadeMode();
                    return;
                }
                check_Timer = 1000;
            } else check_Timer -= diff;

            // Spore Striders
            if (IsHeroic() && SporeStriders_Timer <= diff)
            {
                DoCast(me, SPELL_SUMMON_SPORE_STRIDER);
                SporeStriders_Timer = 10000 + rand32() % 5000;
            } else SporeStriders_Timer -= diff;

            // Levitate
            if (LevitatedTarget)
            {
                if (LevitatedTarget_Timer <= diff)
                {
                    if (Unit* target = ObjectAccessor::GetUnit(*me, LevitatedTarget))
                    {
                        if (!target->HasAura(SPELL_LEVITATE))
                        {
                            LevitatedTarget = 0;
                            return;
                        }
                        if (InAir)
                        {
                            target->AddAura(SPELL_SUSPENSION, target);
                            LevitatedTarget = 0;
                        }
                        else
                        {
                            target->CastSpell(target, SPELL_MAGNETIC_PULL, true);
                            InAir = true;
                            LevitatedTarget_Timer = 1500;
                        }
                    }
                    else
                        LevitatedTarget = 0;
                } else LevitatedTarget_Timer -= diff;
            }
            if (Levitate_Timer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                {
                    DoCast(target, SPELL_LEVITATE);
                    LevitatedTarget = target->GetGUID();
                    LevitatedTarget_Timer = 2000;
                    InAir = false;
                }
                Levitate_Timer = 12000 + rand32() % 3000;
            } else Levitate_Timer -= diff;

            // Chain Lightning
            if (ChainLightning_Timer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                    DoCast(target, SPELL_CHAIN_LIGHTNING);
                ChainLightning_Timer = 7000;
            } else ChainLightning_Timer -= diff;

            // Static Charge
            if (StaticCharge_Timer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true))
                    DoCast(target, SPELL_STATIC_CHARGE);
                StaticCharge_Timer = 10000;
            } else StaticCharge_Timer -= diff;

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

示例6: UpdateAI

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

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

        switch (Stage)
        {
            case 0:
                break;
            case 1: // Vortex
                if (SpecialAbilityTimer <= diff)
                {
                    if (Creature* pSister = GetSister())
                        pSister->AI()->DoAction(ACTION_VORTEX);
                    Talk(VortexEmote);
                    DoCastAOE(VortexSpellId);
                    Stage = 0;
                    SpecialAbilityTimer = 1*MINUTE*IN_MILLISECONDS;
                }
                else
                    SpecialAbilityTimer -= diff;
                break;
            case 2: // Shield + Pact
                if (SpecialAbilityTimer <= diff)
                {
                    Talk(EMOTE_TWINK_PACT);
                    Talk(SAY_TWINK_PACT);
                    if (Creature* pSister = GetSister())
                    {
                        pSister->AI()->DoAction(ACTION_PACT);
                        pSister->CastSpell(pSister, SPELL_POWER_TWINS, false);
                    }
                    DoCast(me, ShieldSpellId);
                    DoCast(me, TwinPactSpellId);
                    Stage = 0;
                    SpecialAbilityTimer = 1*MINUTE*IN_MILLISECONDS;
                }
                else
                    SpecialAbilityTimer -= diff;
                break;
            default:
                break;
        }

        if (SpikeTimer <= diff)
        {
            DoCastVictim(SpikeSpellId);
            SpikeTimer = 20*IN_MILLISECONDS;
        }
        else
            SpikeTimer -= diff;

        if (IsHeroic() && TouchTimer <= diff)
        {
            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true, OtherEssenceSpellId))
                me->CastCustomSpell(TouchSpellId, SPELLVALUE_MAX_TARGETS, 1, target, false);
            TouchTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS);
        }
        else
            TouchTimer -= diff;

        if (!IsBerserk && BerserkTimer <= diff)
        {
            DoCast(me, SPELL_BERSERK);
            Talk(SAY_BERSERK);
            IsBerserk = true;
        }
        else
            BerserkTimer -= diff;

        DoMeleeAttackIfReady();
    }
开发者ID:bahajan95,项目名称:5.4.8-TrinityCore,代码行数:75,代码来源:boss_twin_valkyr.cpp

示例7: UpdateAI

            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                {
                    if (check_Timer <= diff)
                    {
                        if (!me->IsNonMeleeSpellCasted(false))
                            DoCast(me, SPELL_EVOCATION);
                        check_Timer = 5000;
                    }
                    else
                        check_Timer -= diff;
                    return;
                }

                if (Firenova)
                {
                    if (Firenova_Timer <= diff)
                    {
                        DoCast(me, SPELL_FIRE_NOVA, true);
                        Firenova = false;
                        ShadowVolley_Timer = 2000;
                    }
                    else
                        Firenova_Timer -=diff;

                    return;
                }

                if (ShadowVolley_Timer <= diff)
                {
                    DoCast(me, SPELL_SHADOW_BOLT_VOLLEY);
                    ShadowVolley_Timer = 5000+rand()%8000;
                }
                else
                    ShadowVolley_Timer -=diff;

                if (Corruption_Timer <= diff)
                {
                    DoCast(me, SPELL_CORRUPTION);
                    Corruption_Timer = 30000+rand()%20000;
                }
                else
                    Corruption_Timer -=diff;

                if (BurningNova_Timer <= diff)
                {
                    if (me->IsNonMeleeSpellCasted(false))
                        me->InterruptNonMeleeSpells(true);

                    DoScriptText(SAY_NOVA, me);

                    if (SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA))
                    {
                        if (Aura * aura = Aura::TryCreate(nova, me, me))
                            aura->ApplyForTargets();
                    }

                    if (IsHeroic())
                        DoTeleportAll(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation());

                    BurningNova_Timer = 20000+rand()%8000;
                    Firenova_Timer= 5000;
                    Firenova = true;
                }
                else
                    BurningNova_Timer -=diff;

                DoMeleeAttackIfReady();
            }
开发者ID:AdrElecTro,项目名称:CactusEMU,代码行数:70,代码来源:boss_kelidan_the_breaker.cpp

示例8: UpdateAI

            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim() || !CheckInArea(diff, 5764))
                    return;

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_CHECK_HIGH:
                        {
                            //if (!me->getVictim() || !me->IsWithinMeleeRange(me->getVictim()))
                            std::list<Player*> PlayerList;
                            PlayerPositionCheck checker(true);
							MoPCore::PlayerListSearcher<PlayerPositionCheck> searcher(me, PlayerList, checker);
                            me->VisitNearbyWorldObject(300.0f, searcher);
                            if (PlayerList.size() == 0)
                                DoCastAOE(SPELL_VENOM_RAIN);
                            events.ScheduleEvent(EVENT_CHECK_HIGH, 5000);
                            break;
                        }
                        case EVENT_EMBER_FLARE:
                            if (uiPhase == 0)
                            {
                                std::list<Player*> PlayerList;
                                PlayerPositionCheck checker(true);
								MoPCore::PlayerListSearcher<PlayerPositionCheck> searcher(me, PlayerList, checker);
                                me->VisitNearbyWorldObject(300.0f, searcher);
                                if (PlayerList.size() > 0)
                                    DoCastAOE(SPELL_EMBER_FLARE_1);
                            }
                            else
                            {
                                DoCastAOE(SPELL_EMBER_FLARE_2);
                            }
                            
                            events.ScheduleEvent(EVENT_EMBER_FLARE, urand(6000, 7000)); 
                            break;
                        case EVENT_FILAMENT:
                            for (uint8 i = 0; i < RAID_MODE(2, 4, 2, 4); i++)
                                if (Creature* pFilament = me->SummonCreature(NPC_SPIDERWEB_FILAMENT, addsPos[4].GetPositionX() + irand(-8, 8), addsPos[4].GetPositionY() + irand(-8, 8), addsPos[4].GetPositionZ(), 0.0f))
                                    pFilament->SetCanFly(true);
                            events.ScheduleEvent(EVENT_FILAMENT, urand(20000, 25000));
                            break;
                        case EVENT_SUMMON_DRONE:
                            if (Creature* pDrone = me->SummonCreature(NPC_CINDERWEB_DRONE, addsPos[3]))
                                //pDrone->GetMotionMaster()->MovePoint(0, addsPos[5]);
                                if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, PositionSelector(true, 0)))
                                    pDrone->GetMotionMaster()->MoveChase(pTarget);
                            events.ScheduleEvent(EVENT_SUMMON_DRONE, 60000);
                            break;
                        case EVENT_SUMMON_SPIDERLING:
                            uiSide = urand(0, 2);
                            for (uint8 i = 0; i < 8; i++)
                                events.ScheduleEvent(EVENT_SUMMON_SPIDERLING_1, i * 500);
                            if (IsHeroic())
                                for (uint8 i = 0; i < RAID_MODE(1, 2, 1, 2); ++i)
                                    events.ScheduleEvent(EVENT_SUMMON_BROODLING_1, i * 1000);
                            events.ScheduleEvent(EVENT_SUMMON_SPIDERLING, 30000);
                            break;
                        case EVENT_SUMMON_SPIDERLING_1:
                            if (Creature* pSpiderling = me->SummonCreature(NPC_CINDERWEB_SPIDERLING, addsPos[uiSide]))
                                pSpiderling->GetMotionMaster()->MovePoint(0, addsPos[5]);
                            break;
                        case EVENT_SUMMON_BROODLING_1:
                            if (Creature* pBroodling = me->SummonCreature(NPC_ENGORGED_BROODLING, addsPos[uiSide]))
                                if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, PositionSelector(true, 0)))
                                {
                                    pBroodling->CastSpell(pTarget, SPELL_FIXATE_BROODLING, true);
                                    pBroodling->ClearUnitState(UNIT_STATE_CASTING);
                                    pBroodling->GetMotionMaster()->MoveFollow(pTarget, 0.0f, 0.0f);
                                }
                            break;
                        case EVENT_ENERGY_2:
                            //me->SetPower(POWER_MANA, 9000);
                            break;
                        case EVENT_ENERGY:
                        {
                            uint32 energy = me->GetPower(POWER_MANA);
                            if (energy > 0)
                                me->SetPower(POWER_MANA, energy - 100);
                            if ((energy - 100) == 0)
                            {
                                uiCount++;
                                if (uiCount < 3)
                                {
                                    events.RescheduleEvent(EVENT_FILAMENT, 23000);
                                    events.RescheduleEvent(EVENT_CHECK_HIGH, 12000);
                                    events.RescheduleEvent(EVENT_EMBER_FLARE, 14000);
                                    events.ScheduleEvent(EVENT_ENERGY, 10000);
                                    events.ScheduleEvent(EVENT_ENERGY_2, 8000);
                                }
                                else
                                {
                                    events.CancelEvent(EVENT_ENERGY);
//.........这里部分代码省略.........
开发者ID:Mystiko,项目名称:MoPCore5.4.8,代码行数:101,代码来源:boss_bethtilac.cpp

示例9: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (Phase == NORMAL)
            {
                if (!bMove && uiMoveTimer > diff)
                {
                    uiMoveTimer -= diff;
                    return;
                }
                else if (!bMove)
                {
                    DoStartMovement(me->getVictim());
                    pSacrificeTarget = NULL;
                    bMove = true;
                }
                //Return since we have no target
                if (!UpdateVictim())
                    return;

                if (uiSinsterStrikeTimer <= diff)
                {
                    DoCast(me->getVictim(), DUNGEON_MODE(SPELL_SINISTER_STRIKE, H_SPELL_SINISTER_STRIKE));
                    uiSinsterStrikeTimer = urand(5*IN_MILLISECONDS, 9*IN_MILLISECONDS);
                } else uiSinsterStrikeTimer -= diff;

                if (uiCallFlamesTimer <= diff) //move to send event scripts?
                {
                    if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    {
                        if (!bFlames)
                        {
                            DoCast(pTarget, SPELL_CALL_FLAMES);
                            bFlames = true;
                        }

                        if (uiFlamesCount < 3)
                        {
                            if (Creature* pBrazier = Creature::GetCreature(*me, RAND(uiFlameBrazier_1, uiFlameBrazier_2))) 
                            {
                                if (IsHeroic())   // find correct spell
                                {
                                    int dmg = 3825 + rand()%1350;
                                    pBrazier->CastCustomSpell(pBrazier, SPELL_BALL_OF_FLAME, &dmg, 0, 0, true);
                                }
                                else
                                    pBrazier->CastSpell(pBrazier, SPELL_BALL_OF_FLAME, true);
                            }
                            uiCallFlamesTimer = 1*IN_MILLISECONDS;
                            ++uiFlamesCount;
                        }
                        else
                        { 
                            bFlames = false;
                            uiCallFlamesTimer = urand(8*IN_MILLISECONDS, 12*IN_MILLISECONDS);
                            uiFlamesCount = 0;
                        }
                    }
                } else uiCallFlamesTimer -= diff;

                if ((me->GetHealth()*100 / me->GetMaxHealth()) < (100-(25*uiHealthAmountModifier)))
                {
                    ++uiHealthAmountModifier;

                    pSacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
                    if (pSacrificeTarget)
                    {
                        DoScriptText(RAND(SAY_SACRIFICE_PLAYER_1, SAY_SACRIFICE_PLAYER_2, SAY_SACRIFICE_PLAYER_3, SAY_SACRIFICE_PLAYER_4, SAY_SACRIFICE_PLAYER_5), me);
                        me->GetMotionMaster()->Clear();
                        DoCast(pSacrificeTarget, SPELL_RITUAL_OF_THE_SWORD);
                        DoTeleportPlayer(pSacrificeTarget, 296.632f, -346.075f, 90.63f, 4.6f);
                        Phase = SACRIFICING;

                        for (uint8 i = 0; i < 3; ++i)
                            if (Creature* pRitualChanneler = me->SummonCreature(CREATURE_RITUAL_CHANNELER, RitualChannelerPos[i], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 100*HOUR))
                                if (pRitualChanneler->AI())
                                    pRitualChanneler->AI()->SetGUID(pSacrificeTarget->GetGUID());
                    }
                }

                DoMeleeAttackIfReady();
            }
            else  //SACRIFICING
            {
                if (uiSacrificeTimer <= diff)
                {
                    Creature* pTarget = Creature::GetCreature(*me, uiRitualTarget);
                    if (pTarget)
                    {
                        DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true);
                        DoCast(me, SPELL_RITUAL_OF_THE_SWORD_DISARM, true);
                    }
                    bMove = false;
                    Phase = NORMAL;
                    uiMoveTimer = 23*IN_MILLISECONDS;
                    uiSacrificeTimer = 2*IN_MILLISECONDS;
                    uiSinsterStrikeTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS);
                    uiCallFlamesTimer = urand(13*IN_MILLISECONDS, 18*IN_MILLISECONDS);
                }
                else uiSacrificeTimer -= diff;
            }
//.........这里部分代码省略.........
开发者ID:B3NNY,项目名称:TrinityCore,代码行数:101,代码来源:boss_svala.cpp

示例10: UpdateAI

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

                if (Fireball_Timer <= diff)
                {
                    if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0))
                        DoCast(victim, SPELL_FIREBALL, true);
                    Fireball_Timer = urand(4000, 7000);
                }
                else
                    Fireball_Timer -= diff;

                if (flight) // phase 1 - the flight
                {
                    Creature* Vazruden = ObjectAccessor::GetCreature(*me, VazrudenGUID);
                    if (Fly_Timer < diff || !(Vazruden && Vazruden->IsAlive() && Vazruden->HealthAbovePct(20)))
                    {
                        flight = false;
                        BellowingRoar_Timer = 6000;
                        ConeOfFire_Timer = 12000;
                        me->SetDisableGravity(false);
                        me->SetWalk(true);
                        me->GetMotionMaster()->Clear();
                        if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0))
                            AttackStart(victim);
                        DoStartMovement(me->GetVictim());
                        Talk(EMOTE);
                        return;
                    }
                    else
                        Fly_Timer -= diff;

                    if (Turn_Timer <= diff)
                    {
                        uint32 waypoint = (Fly_Timer/10000)%2;
                        if (!me->IsWithinDist3d(VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2], 5))
                            me->GetMotionMaster()->MovePoint(0, VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2]);
                        Turn_Timer = 10000;
                    }
                    else
                        Turn_Timer -= diff;
                }
                else // phase 2 - land fight
                {
                    if (ConeOfFire_Timer <= diff)
                    {
                        DoCast(me, SPELL_CONE_OF_FIRE);
                        ConeOfFire_Timer = 12000;
                        Fireball_Timer = 4000;
                    }
                    else
                        ConeOfFire_Timer -= diff;

                    if (IsHeroic())
                    {
                        if (BellowingRoar_Timer <= diff)
                        {
                            DoCast(me, SPELL_BELLOWING_ROAR);
                            BellowingRoar_Timer = 45000;
                        }
                        else
                            BellowingRoar_Timer -= diff;
                    }

                    DoMeleeAttackIfReady();
                }
            }
开发者ID:Rastrian,项目名称:DeathCore_3.3.5,代码行数:69,代码来源:boss_vazruden_the_herald.cpp

示例11: KilledUnit

 void KilledUnit(Unit* who)
 {
     DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
     if (IsHeroic() && who->GetEntry() == CREATURE_SCOURGE_HULK)
         pInstance->DoCompleteAchievement(ACHIEV_INCREDIBLE_HULK);
 }
开发者ID:B3NNY,项目名称:TrinityCore,代码行数:6,代码来源:boss_svala.cpp

示例12: Reset

     void Reset()
     {
 	    if (IsHeroic())
             DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
     }
开发者ID:B3NNY,项目名称:TrinityCore,代码行数:5,代码来源:boss_svala.cpp

示例13: UpdateAI

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

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_FEL_EXPLOSION:
                            DoCastAOE(SPELL_FEL_EXPLOSION);
                            events.ScheduleEvent(EVENT_FEL_EXPLOSION, 2000, 0, PHASE_NORMAL);
                            break;
                        case EVENT_DRAIN_CRYSTAL:
                            SelectNearestCrystal();
                            _scheduledEvents = false;
                            break;
                        case EVENT_DRAIN_MANA:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
                                DoCast(target, SPELL_DRAIN_MANA);
                            events.ScheduleEvent(EVENT_DRAIN_MANA, 10000, 0, PHASE_NORMAL);
                            break;
                        case EVENT_DRAIN_LIFE:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, true))
                                DoCast(target, SPELL_DRAIN_LIFE);
                            events.ScheduleEvent(EVENT_DRAIN_LIFE, 10000, 0, PHASE_NORMAL);
                            break;
                        case EVENT_EMPOWER:
                        {
                            Talk(SAY_EMPOWERED);

                            Creature* CrystalChosen = ObjectAccessor::GetCreature(*me, CrystalGUID);
                            if (CrystalChosen && CrystalChosen->IsAlive())
                                CrystalChosen->Kill(CrystalChosen);

                            CrystalGUID.Clear();

                            me->GetMotionMaster()->Clear();
                            me->GetMotionMaster()->MoveChase(me->GetVictim());
                            break;
                        }
                        default:
                            break;
                    }
                }

                if (me->GetPowerPct(POWER_MANA) < 10.f)
                {
                    if (events.IsInPhase(PHASE_NORMAL) && !_scheduledEvents)
                    {
                        _scheduledEvents = true;
                        uint32 timer = urand(3000, 7000);
                        events.ScheduleEvent(EVENT_DRAIN_LIFE, timer, 0, PHASE_NORMAL);

                        if (IsHeroic())
                        {
                            events.ScheduleEvent(EVENT_DRAIN_CRYSTAL, urand(10000, 15000), 0, PHASE_NORMAL);
                            events.ScheduleEvent(EVENT_DRAIN_MANA, timer + 5000, 0, PHASE_NORMAL);
                        }
                        else
                            events.ScheduleEvent(EVENT_DRAIN_CRYSTAL, urand(20000, 25000), 0, PHASE_NORMAL);
                    }
                }

                DoMeleeAttackIfReady();
            }
开发者ID:Rastrian,项目名称:DeathCore_6.x-1,代码行数:71,代码来源:boss_selin_fireheart.cpp

示例14: EnterCombat

 void EnterCombat(Unit* who)
 {
     events.ScheduleEvent(EVENT_BURNING_ACID, urand(7000, 15000));
     if (IsHeroic())
         events.ScheduleEvent(EVENT_FIERY_WEB_SPIN, urand(5000, 15000));
 }
开发者ID:Mystiko,项目名称:MoPCore5.4.8,代码行数:6,代码来源:boss_bethtilac.cpp

示例15: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            //Return since we have no target or casting
            if (!UpdateVictim() || me->IsNonMeleeSpellCasted(false))
                return;

            // Sonic Boom
            if (SonicBoom)
            {
                DoCast(me, SPELL_SONIC_BOOM_EFFECT, true);
                SonicBoomEffect();

                SonicBoom = false;
                Resonance_Timer = 1500;
            }
            if (SonicBoom_Timer <= diff)
            {
                DoScriptText(EMOTE_SONIC_BOOM, me);
                DoCast(me, SPELL_SONIC_BOOM_CAST);
                SonicBoom_Timer = 30000;
                SonicBoom = true;
                return;
            } else SonicBoom_Timer -= diff;

            // Murmur's Touch
            if (MurmursTouch_Timer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true))
                    DoCast(target, SPELL_MURMURS_TOUCH);
                MurmursTouch_Timer = urand(25000, 35000);
            } else MurmursTouch_Timer -= diff;

            // Resonance
            if (!SonicBoom && !(me->IsWithinMeleeRange(me->getVictim())))
            {
                if (Resonance_Timer <= diff)
                {
                    DoCast(me, SPELL_RESONANCE);
                    Resonance_Timer = 5000;
                } else Resonance_Timer -= diff;
            }

            // Magnetic Pull
            if (MagneticPull_Timer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                    if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive())
                    {
                        DoCast(target, SPELL_MAGNETIC_PULL);
                        MagneticPull_Timer = 15000+rand()%15000;
                        return;
                    }
                MagneticPull_Timer = 500;
            } else MagneticPull_Timer -= diff;

            if (IsHeroic())
            {
                // Thundering Storm
                if (ThunderingStorm_Timer <= diff)
                {
                    std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
                    for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
                        if (Unit* target = Unit::GetUnit(*me, (*i)->getUnitGuid()))
                            if (target->isAlive() && !me->IsWithinDist(target, 35, false))
                                DoCast(target, SPELL_THUNDERING_STORM, true);
                    ThunderingStorm_Timer = 15000;
                } else ThunderingStorm_Timer -= diff;

                // Sonic Shock
                if (SonicShock_Timer <= diff)
                {
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20, false))
                        if (target->isAlive())
                            DoCast(target, SPELL_SONIC_SHOCK);
                    SonicShock_Timer = 10000+rand()%10000;
                } else SonicShock_Timer -= diff;
            }

            // Select nearest most aggro target if top aggro too far
            if (!me->isAttackReady())
                return;
            if (!me->IsWithinMeleeRange(me->getVictim()))
            {
                std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
                for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
                    if (Unit* target = Unit::GetUnit(*me, (*i)->getUnitGuid()))
                        if (target->isAlive() && me->IsWithinMeleeRange(target))
                        {
                            me->TauntApply(target);
                            break;
                        }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:kmN666,项目名称:Leroy,代码行数:95,代码来源:boss_murmur.cpp


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