當前位置: 首頁>>代碼示例>>C++>>正文


C++ DoSpellAttackIfReady函數代碼示例

本文整理匯總了C++中DoSpellAttackIfReady函數的典型用法代碼示例。如果您正苦於以下問題:C++ DoSpellAttackIfReady函數的具體用法?C++ DoSpellAttackIfReady怎麽用?C++ DoSpellAttackIfReady使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DoSpellAttackIfReady函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: UpdateAI

            void UpdateAI(uint32 diff) override
            {
                if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
                    return;

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_CONJURE_FIRE:
                            if (summons.size() >= RAID_MODE<uint64>(2, 4))
                                break;
                            DoCast(me, SPELL_CONJURE_FIRE, true);
                            events.ScheduleEvent(EVENT_CONJURE_FIRE, 15s, 20s);
                            break;
                        case EVENT_MELT_ICE:
                            if (Creature* FlashFreeze = me->FindNearestCreature(NPC_FLASH_FREEZE, 50.0f, true))
                                DoCast(FlashFreeze, SPELL_MELT_ICE, true);
                            events.ScheduleEvent(EVENT_MELT_ICE, 10s, 15s);
                            break;
                    }

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

                DoSpellAttackIfReady(SPELL_FIREBALL);
            }
開發者ID:lasyan3,項目名稱:TrinityCore,代碼行數:33,代碼來源:boss_hodir.cpp

示例2: UpdateAI

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

                DoSpellAttackIfReady(SPELL_CHAIN_LIGHTNING);
            }
開發者ID:ter884,項目名稱:TER-Server,代碼行數:7,代碼來源:boss_siamat.cpp

示例3: DoSpellAttackIfReady

void TurretAI::UpdateAI(uint32 /*diff*/)
{
    if (!UpdateVictim())
        return;

    DoSpellAttackIfReady(me->m_spells[0]);
}
開發者ID:DanielBallaSZTE,項目名稱:TrinityCorePreWOTLK,代碼行數:7,代碼來源:CombatAI.cpp

示例4: UpdateAI

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

        DoSpellAttackIfReady(SPELL_ERUPTION);
    }
開發者ID:Lyill,項目名稱:TrinityCore,代碼行數:7,代碼來源:firelands.cpp

示例5: UpdateAI

            void UpdateAI(uint32 const diff)
            {
                if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
                    return;

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_CONJURE_FIRE:
                            if (summons.size() >= RAID_MODE<uint64>(2, 4))
                                break;
                            // The fire is gets positioned at a random coordinate.
                            DoCast(me, SPELL_CONJURE_FIRE, true);
                            events.ScheduleEvent(EVENT_CONJURE_FIRE, urand(15*IN_MILLISECONDS, 20*IN_MILLISECONDS));
                            return;
                        case EVENT_MELT_ICE:
                            if (Creature* FlashFreeze = me->FindNearestCreature(NPC_FLASH_FREEZE, 50.0f, true))
                                DoCast(FlashFreeze, SPELL_MELT_ICE, true);
                            events.ScheduleEvent(EVENT_MELT_ICE, urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS));
                            return;
                        default:
                            return;
                    }
                }

                DoSpellAttackIfReady(SPELL_FIREBALL);
            }
開發者ID:Nightprince,項目名稱:Avalon,代碼行數:33,代碼來源:boss_hodir.cpp

示例6: UpdateAI

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

                DoSpellAttackIfReady(DUNGEON_MODE(CLAW_PUNCTURE,CLAW_PUNCTURE_H));
            }
開發者ID:AwkwardDev,項目名稱:WoWSource434,代碼行數:7,代碼來源:boss_general_umbriss.cpp

示例7: DoSpellAttackIfReady

void ArchorAI::UpdateAI(const uint32 /*diff*/) {
	if (!UpdateVictim())
		return;

	if (!me->IsWithinCombatRange(me->getVictim(), m_minRange))
		DoSpellAttackIfReady(me->m_spells[0]);
	else
		DoMeleeAttackIfReady();
}
開發者ID:rexy,項目名稱:ArkCORE,代碼行數:9,代碼來源:CombatAI.cpp

示例8: DoSpellAttackIfReady

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

    DoSpellAttackIfReady(me->m_spells[0]);

    //if (!DoSpellAttackIfReady(me->m_spells[0]))
        //if (HostileReference *ref = me->getThreatManager().getCurrentVictim())
            //ref->removeReference();
}
開發者ID:Sanzzes,項目名稱:wopc-core,代碼行數:11,代碼來源:CombatAI.cpp

示例9: UpdateAI

            void UpdateAI(uint32 diff) override
            {
                // Only update events if Millhouse is aggressive
                if (me->GetReactState() != REACT_AGGRESSIVE)
                    return;

                events.Update(diff);

                // Impending Doom is exception because it needs to be interrupted.
                if (me->HasUnitState(UNIT_STATE_CASTING) && !me->GetCurrentSpell(SPELL_IMPENDING_DOOM))
                    return;

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        case EVENT_FROSTBOLT_VOLLEY:
                            DoCast(SPELL_FROSTBOLT_VOLLEY);
                            events.ScheduleEvent(EVENT_FROSTBOLT_VOLLEY, 7000);
                            break;
                        case EVENT_SHADOWFURY:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
                                DoCast(target, SPELL_SHADOWFURY);
                            events.ScheduleEvent(EVENT_SHADOWFURY, 7000);
                            break;
                        case EVENT_FEAR:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
                                DoCast(target, SPELL_FEAR);
                            events.ScheduleEvent(EVENT_FEAR, 18000);
                            break;
                        case EVENT_READY_FOR_COMBAT:
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
                            me->SetReactState(REACT_AGGRESSIVE);
                            ScheduleEvents();
                            break;
                        case EVENT_CAST_IMPENDING_DOOM:
                            DoCast(SPELL_IMPENDING_DOOM);
                            DoCast(SPELL_IMPENDING_DOOM_CHANNEL);
                            events.ScheduleEvent(EVENT_INTERRUPT_IMPENDING_DOOM, urand(15000,20000));
                            break;
                        case EVENT_INTERRUPT_IMPENDING_DOOM:
                            me->InterruptNonMeleeSpells(true);
                            me->RemoveAllAuras();
                            me->HandleEmoteCommand(EMOTE_ONESHOT_KNOCKDOWN);
                            events.ScheduleEvent(EVENT_CAST_IMPENDING_DOOM, 3000);
                            break;
                        default:
                            break;
                    }
                }

                DoSpellAttackIfReady(SPELL_SHADOW_BOLT);
            }
開發者ID:Mystiko,項目名稱:DeathCore_4.3.4,代碼行數:53,代碼來源:stonecore.cpp

示例10: UpdateAI

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

            // Shadow Burst ad area e reset threat
            if (BurstTimer <= uiDiff)
            {
                me->InterruptNonMeleeSpells(false);
                me->DeleteThreatList();
                DoCast(me->GetVictim(), SHADOW_BURST);
                BurstTimer = urand(25000,35000);
            } else BurstTimer -= uiDiff;

            // Storm of Grief ogni 20 sec colpisce ad area
            if (GriefTimer <= uiDiff)
            {
                me->InterruptNonMeleeSpells(false);
                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0))
                    DoCast(pTarget, STORM_OF_GRIEF);
                GriefTimer = 20000;
            } else GriefTimer -= uiDiff;

            // Ogni 10 sec casta Piercing Shadow sul target a maggior aggro dopo il tank
            if (PiercingTimer <= uiDiff)
            {
                me->InterruptNonMeleeSpells(false);
                if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,0))
                    DoCast(pTarget, PIERCING_SHADOW);
                PiercingTimer = 10000;
            } else PiercingTimer -= uiDiff;

            // Ogni 15 sec casta Shadow Flame che fa danno a cono
            if (FlameTimer <= uiDiff)
            {
                me->InterruptNonMeleeSpells(false);
                DoCastAOE(SHADOW_FLAME);
                FlameTimer = 15000;
            } else FlameTimer -= uiDiff;

            // Ogni 45 sec casta Harvest Soul su tutto il raid
            if (HarvestTimer <= uiDiff)
            {
                me->InterruptNonMeleeSpells(false);
                me->MonsterYell(SAY_PEROTHARN_SOUL, LANG_UNIVERSAL, 0);
                DoCastAOE(HARVEST_SOUL);
                HarvestTimer = 45000;
            } else HarvestTimer -= uiDiff;

            DoSpellAttackIfReady(SHADOW_BOLT);
        }
開發者ID:Finest,項目名稱:MMOCoreEvo,代碼行數:51,代碼來源:npcs_mini_boss.cpp

示例11: UpdateAI

    void UpdateAI(const uint32 uiDiff)
    {
        if (!UpdateVictim())
            return;
            
        if (StarlightTimer <= uiDiff)
        {
            DoCast(me, SPELL_STARLIGHT);
            StarlightTimer = urand(25000, 35000);
        }
        else StarlightTimer -= uiDiff;

        DoSpellAttackIfReady(SPELL_WRATH);
    }
開發者ID:Archives,項目名稱:ro_core,代碼行數:14,代碼來源:boss_hodir.cpp

示例12: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (tSeek <= diff)
            {
                if ((me->isAlive()) && (!me->isInCombat() && (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) <= 1.0f)))
                    if (Creature* enemy = me->FindNearestCreature(NPC_BLOODFANG_WORGEN, 5.0f, true))
                        me->AI()->AttackStart(enemy); //She should really only grab agro when npc Cleese is not there, so we will keep this range small
                tSeek = urand(1000, 2000); //optimize cpu load, seeking only sometime between 1 and 2 seconds
            }
            else tSeek -= diff;

            if (!UpdateVictim())
                return;

            if (dmgCount < 2)
                DoSpellAttackIfReady(SPELL_FROSTBOLT_VISUAL_ONLY); //Dummy spell, visual only to prevent getting agro (Blizz-like)
        }
開發者ID:PaladMaster,項目名稱:SkyFireEMU,代碼行數:17,代碼來源:gilneas.cpp

示例13: UpdateAI

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

        if(me->getThreatManager().isThreatListEmpty())
        {
            EnterEvadeMode();
            return;
        }

        events.Update(diff);

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

        uint32 eventId = events.GetEvent();
        if(!me->getVictim())
            eventId = EVENT_PURSUE;

        switch(eventId)
        {
            case 0:
                return;
            case EVENT_PURSUE:
                DoCastAOE(SPELL_PURSUED);
                events.RepeatEvent(35000);
                return;
            case EVENT_MISSILE:
                //TODO: without unittarget no visual effect
                //DoCastAOE(SPELL_MISSILE_BARRAGE);
                DoCast(me->getVictim(), SPELL_MISSILE_BARRAGE);
                events.RepeatEvent(1500);
                return;
            case EVENT_VENT:
                DoCastAOE(SPELL_FLAME_VENTS);
                events.RepeatEvent(20000);
                return;
            default:
                events.PopEvent();
                break;
        }

        DoSpellAttackIfReady(SPELL_BATTERING_RAM);
    }
開發者ID:MilchBuby,項目名稱:riboncore,代碼行數:45,代碼來源:boss_flame_leviathan.cpp

示例14: UpdateAI

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

            events.Update(diff);

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

            while (uint32 eventId = events.ExecuteEvent())
            {
                ExecuteEvent(eventId);
                if (me->HasUnitState(UNIT_STATE_CASTING))
                    return;
            }

            DoSpellAttackIfReady(SPELL_EMPOWERED_SMITE);
        }
開發者ID:martial69320,項目名稱:cerberus,代碼行數:19,代碼來源:boss_illidari_council.cpp

示例15: UpdateAI

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

                if (_phase == 0 && !CheckGuardAlive())
                {
                    _phase = 1;
                    me->SetCanDualWield(true);
                    DoCast(me, SPELL_WINDFURY, true);
                }

                scheduler.Update(diff, [this]
                {
                    if (_phase == 1)
                        DoSpellAttackIfReady(SPELL_STORMSTRIKE);
                    else
                        DoMeleeAttackIfReady();
                });
            }
開發者ID:FixCore,項目名稱:335source,代碼行數:20,代碼來源:boss_erekem.cpp


注:本文中的DoSpellAttackIfReady函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。