当前位置: 首页>>代码示例>>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;未经允许,请勿转载。