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


C++ DoZoneInCombat函数代码示例

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


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

示例1: UpdateAI


//.........这里部分代码省略.........
                    }
                    CheckTimer = 2000;
                } else CheckTimer -= diff;

                if (RotTimer)
                {
                    Map* pMap = me->GetMap();
                    if (pMap->IsDungeon())
                    {
                        Map::PlayerList const &PlayerList = pMap->GetPlayers();
                        for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
                        {
                            if (i->getSource() && i->getSource()->isAlive() && me->HasInArc(float(diff/20000*M_PI*2),i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater())
                                DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water
                        }
                    }

                    if (SpoutAnimTimer <= diff)
                    {
                        DoCast(me, SPELL_SPOUT_ANIM, true);
                        SpoutAnimTimer = 1000;
                    } else SpoutAnimTimer -= diff;

                    if (RotTimer <= diff)
                    {
                        RotTimer = 0;
                    } else RotTimer -= diff;
                    return;
                }

                if (GeyserTimer <= diff)
                {
                    Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
                    if (!pTarget && me->getVictim())
                        pTarget = me->getVictim();
                    if (pTarget)
                        DoCast(pTarget, SPELL_GEYSER, true);
                    GeyserTimer = rand()%5000 + 15000;
                } else GeyserTimer -= diff;

                if (!InRange)//if on players in melee range cast Waterbolt
                {
                    if (WaterboltTimer <= diff)
                    {
                        Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
                        if (!pTarget && me->getVictim())
                            pTarget = me->getVictim();
                        if (pTarget)
                            DoCast(pTarget, SPELL_WATERBOLT, true);
                        WaterboltTimer = 3000;
                    } else WaterboltTimer -= diff;
                }

                if (!UpdateVictim())
                    return;

                DoMeleeAttackIfReady();

            }else//submerged
            {
                if (PhaseTimer <= diff)
                {
                    Submerged = false;
                    me->InterruptNonMeleeSpells(false);//shouldn't be any
                    me->RemoveAllAuras();
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
                    me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
                    DoCast(me, SPELL_EMERGE, true);
                    Spawned = false;
                    SpoutTimer = 3000; // directly cast Spout after emerging!
                    PhaseTimer = 120000;
                    return;
                } else PhaseTimer-=diff;

                if (me->getThreatManager().getThreatList().empty())//check if should evade
                {
                    EnterEvadeMode();
                    return;
                }
                if (!me->isInCombat())
                    DoZoneInCombat();

                if (!Spawned)
                {
                    me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
                    //spawn adds
                    for (uint8 i = 0; i < 9; ++i)
                    {
                        Creature* Summoned;
                        if (i < 6)
                            Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
                        else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);

                        if (Summoned)
                            Summons.Summon(Summoned);
                    }
                    Spawned = true;
                }
            }
        }
开发者ID:1024wow,项目名称:TrinityCore,代码行数:101,代码来源:boss_lurker_below.cpp

示例2: EnterCombat

 void EnterCombat(Unit* /*who*/)
 {
     DoCast(me, ENSLAVED_SOUL_PASSIVE, true);
     DoZoneInCombat();
 }
开发者ID:Bootz,项目名称:SF1,代码行数:5,代码来源:boss_reliquary_of_souls.cpp

示例3: EnterCombat

 void EnterCombat(Unit* /*who*/) override
 {
     DoZoneInCombat();
 }
开发者ID:Rastrian,项目名称:DeathCore_3.3.5,代码行数:4,代码来源:boss_toravon.cpp

示例4: DoZoneInCombat

void BossAI::JustSummoned(Creature* summon)
{
    summons.Summon(summon);
    if (me->isInCombat())
        DoZoneInCombat(summon);
}
开发者ID:ALive-WoW,项目名称:RC2,代码行数:6,代码来源:ScriptedCreature.cpp

示例5: EnterCombat

 void EnterCombat(Unit* /*who*/)
 {
     DoScriptText(SAY_AGGRO, me);
     DoZoneInCombat();
 }
开发者ID:4m1g0,项目名称:TrinityCore,代码行数:5,代码来源:boss_broodlord_lashlayer.cpp

示例6: EnterCombat

 void EnterCombat(Unit* /*who*/)
 {
     DoZoneInCombat();
     //DoCast(me, SPELL_VAPOR_FORCE, true); core bug
 }
开发者ID:Deviuss,项目名称:TrinityCore,代码行数:5,代码来源:boss_felmyst.cpp

示例7: Reset

 void Reset() override
 {
     me->RemoveAllAuras();
     DoZoneInCombat();
     events.ScheduleEvent(EVENT_FADE_ARMOR, 1000);
 }
开发者ID:Refuge89,项目名称:TrinityCore,代码行数:6,代码来源:obsidian_sanctum.cpp

示例8: JustSummoned

 void JustSummoned(Creature* summon)
 {
     if (me->isInCombat())
         DoZoneInCombat(summon);
 }
开发者ID:Mystiko,项目名称:MoPCore5.4.8,代码行数:5,代码来源:boss_bethtilac.cpp

示例9: JustSummoned

 void JustSummoned(Creature* summon)
 {
     Summons.push_back(summon->GetGUID());
     DoZoneInCombat(summon);
 }
开发者ID:redlaine,项目名称:InfinityCore-Ark,代码行数:5,代码来源:boss_argaloth.cpp

示例10: JustSummoned

 void JustSummoned(Creature* who) override
 {
     DoZoneInCombat(who);
 }
开发者ID:Refuge89,项目名称:TrinityCore,代码行数:4,代码来源:obsidian_sanctum.cpp

示例11: EnterCombat

		void EnterCombat(Unit * /*who*/) {
			DoCast(me, SPELL_ESSENCEOFTHERED);
			DoZoneInCombat();
			me->SetHealth(me->CountPctFromMaxHealth(30));
		}
开发者ID:FrenchCORE,项目名称:OLD_FrenchCORE,代码行数:5,代码来源:boss_vaelastrasz.cpp

示例12: UpdateAI

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

        if (!me->HasAura(SPELL_BERSERK, 0))
        {
            if (BerserkTimer <= diff)
                DoCast(me, SPELL_BERSERK);
            else BerserkTimer -= diff;
        }

        if (SummonFlameTimer <= diff)
        {
            DoCast(me, SPELL_MOLTEN_PUNCH);
            SummonFlameTimer = 10000;
        }
        else SummonFlameTimer -= diff;

        if (Phase1)
        {
            if (HatefulStrikeTimer <= diff)
            {
                if (Unit* pTarget = CalculateHatefulStrikeTarget())
                {
                    DoCast(pTarget, SPELL_HATEFUL_STRIKE);
                    HatefulStrikeTimer = 5000;
                }
            }
            else HatefulStrikeTimer -= diff;
        }

        if (!Phase1)
        {
            if (SwitchTargetTimer <= diff)
            {
                if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
                {
                    if (me->GetDistance2d(me->GetVictim()) < 40)
                        me->CastSpell(me->GetVictim(), SPELL_CHARGE, false);

                    DoResetThreat();
                    me->AddThreat(pTarget, 5000000.0f);
                    DoScriptText(EMOTE_NEW_TARGET, me);
                    SwitchTargetTimer = 10000;
                }
            }
            else SwitchTargetTimer -= diff;

            if (SummonVolcanoTimer <= diff)
            {
                if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true))
                {
                    DoCast(pTarget, SPELL_VOLCANIC_SUMMON);
                    DoScriptText(EMOTE_GROUND_CRACK, me);
                    SummonVolcanoTimer = 10000;
                }
            }
            else SummonVolcanoTimer -= diff;
        }

        if (PhaseSwitchTimer <= diff)
        {
            if (!Phase1)
            {
                Phase1 = true;
                DoResetThreat();
                PhaseSwitchTimer = 60000;
                me->SetSpeed(MOVE_RUN, 1.2f);
                DoZoneInCombat();
                me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
            }
            else
            {
                Phase1 = false;
                DoResetThreat();
                SwitchTargetTimer = 10000;
                SummonVolcanoTimer = 2000;
                PhaseSwitchTimer = 60000;
                me->SetSpeed(MOVE_RUN, 0.9f);
                DoZoneInCombat();
                me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
            }
        }
        else PhaseSwitchTimer -= diff;

        DoMeleeAttackIfReady();
    }
开发者ID:Phentora,项目名称:OregonCore,代码行数:90,代码来源:boss_supremus.cpp

示例13: UpdateAI

            void UpdateAI(uint32 diff) override
            {
                if (!UpdateVictim() && !events.IsInPhase(PHASE_EVENT))
                    return;

                events.Update(diff);

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

                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch (eventId)
                    {
                        // PHASE ONE
                        case EVENT_CLEAVE:
                            DoCastVictim(SPELL_CLEAVE);
                            events.ScheduleEvent(EVENT_CLEAVE, urand(6, 12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
                            break;
                        case EVENT_STAGGERING_ROAR:
                            DoCast(me, SPELL_STAGGERING_ROAR);
                            events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_HUMAN);
                            break;
                        case EVENT_ENRAGE:
                            DoCast(me, SPELL_ENRAGE);
                            events.ScheduleEvent(EVENT_ENRAGE, urand(7, 14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
                            break;
                        case EVENT_SMASH:
                            DoCastAOE(SPELL_SMASH);
                            events.ScheduleEvent(EVENT_SMASH, urand(12, 16)*IN_MILLISECONDS, 0, PHASE_HUMAN);
                            break;
                        case EVENT_JUST_TRANSFORMED:
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
                            DoZoneInCombat();
                            ScheduleSecondPhase();
                            return;
                        case EVENT_SUMMON_BANSHEE:
                            DoCast(me, SPELL_SUMMON_BANSHEE);
                            return;
                        // PHASE TWO
                        case EVENT_DARK_SMASH:
                            DoCastVictim(SPELL_DARK_SMASH);
                            events.ScheduleEvent(EVENT_DARK_SMASH, urand(12, 16)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
                            break;
                        case EVENT_DREADFUL_ROAR:
                            DoCast(me, SPELL_DREADFUL_ROAR);
                            events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
                            break;
                        case EVENT_WOE_STRIKE:
                            DoCastVictim(SPELL_WOE_STRIKE);
                            events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10, 14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
                            break;
                        case EVENT_SHADOW_AXE:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
                                DoCast(target, SPELL_SHADOW_AXE_SUMMON);
                            events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
                            break;
                        default:
                            break;
                    }
                }

                if (!events.IsInPhase(PHASE_EVENT))
                    DoMeleeAttackIfReady();
            }
开发者ID:madisodr,项目名称:legacy-core,代码行数:65,代码来源:boss_ingvar_the_plunderer.cpp

示例14: EnterCombat

 void EnterCombat(Unit* who)
 {
     DoZoneInCombat();
 }
开发者ID:FirstCore,项目名称:Battle,代码行数:4,代码来源:boss_felmyst.cpp

示例15: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if(InciteChaos)
        {
            if(InciteChaosWait_Timer < diff)
            {
                InciteChaos = false;
                DoZoneInCombat();
                DoResetThreat();

                Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true);
                if(target)
                    AttackStart(target);
            }
            else
                InciteChaosWait_Timer -= diff;

            return;
        }

        if (!UpdateVictim())
            return;
        else
            TrashAggro();

        if(InciteChaos_Timer < diff)
        {
            DoCast(me, SPELL_INCITE_CHAOS);

            Map *map = me->GetMap();
            Map::PlayerList const &PlayerList = map->GetPlayers();

            if(PlayerList.isEmpty())
                return;

            for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
            {
                Player *plr = i->getSource();
                Player *target = (Player*)SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true, plr->GetGUID());

                if(plr && plr->IsAIEnabled && target)
                    plr->AI()->AttackStart(target);
            }

            //DoResetThreat();
            InciteChaos = true;
            InciteChaos_Timer = 40000;
            InciteChaosWait_Timer = 16000;
            return;
        }
        else
            InciteChaos_Timer -= diff;

        //Charge_Timer
        if (Charge_Timer < diff)
        {
            if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true))
                DoCast(target, SPELL_CHARGE);
            Charge_Timer = 25000;
        }
        else
            Charge_Timer -= diff;

        //Knockback_Timer
        if (Knockback_Timer < diff)
        {
            DoCast(me, SPELL_WAR_STOMP);
            Knockback_Timer = 20000;
        }
        else
            Knockback_Timer -= diff;

        DoMeleeAttackIfReady();
    }
开发者ID:Xadras,项目名称:looking4group-core,代码行数:74,代码来源:boss_blackheart_the_inciter.cpp


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