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


C++ EventMap::PopEvent方法代码示例

本文整理汇总了C++中EventMap::PopEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ EventMap::PopEvent方法的具体用法?C++ EventMap::PopEvent怎么用?C++ EventMap::PopEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EventMap的用法示例。


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

示例1: UpdateAI

		void UpdateAI(uint32 diff)
		{
			if( TargetGUID )
			{
				Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID);
				if( !target || !target->HasAura(SPELL_MARK) || !me->IsValidAttackTarget(target) || me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE || !me->HasUnitState(UNIT_STATE_CHASE_MOVE) )
				{
					SelectNewTarget(true);
					return;
				}
			}

			events.Update(diff);

			switch( events.GetEvent() )
			{
				case 0:
					break;
				case 1:
					me->CastSpell(me, SPELL_SPIKE_SPEED2, true);
					events.PopEvent();
					events.RescheduleEvent(2, 7000);
					break;
				case 2:
					me->CastSpell(me, SPELL_SPIKE_SPEED3, true);
					events.PopEvent();
					break;
				case 3:
					Reset();
					break;
			}
		}
开发者ID:DSlayerMan,项目名称:Sunwell,代码行数:32,代码来源:boss_anubarak_trial.cpp

示例2: UpdateAI

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

            events.Update(diff);

            // Special events which needs to be fired immidiately
            switch(events.GetEvent())
            {
                case EVENT_SARTHARION_SUMMON_LAVA:
                    if (!urand(0,3))
                        Talk(SAY_SARTHARION_SPECIAL);

                    SummonLavaWaves();
                    events.RepeatEvent(25000);
                    return;
                case EVENT_SARTHARION_START_LAVA:
                    SendLavaWaves(true);
                    events.PopEvent();
                    return;
                case EVENT_SARTHARION_FINISH_LAVA:
                    SendLavaWaves(false);
                    events.PopEvent();
                    return;
            }

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

            HandleSartharionAbilities();
            HandleDrakeAbilities();

            DoMeleeAttackIfReady();
        }
开发者ID:boom8866,项目名称:azerothcore-wotlk,代码行数:35,代码来源:boss_sartharion.cpp

示例3: UpdateAI

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

			events.Update(diff);

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

			switch (events.GetEvent())
			{
				case EVENT_BOULDER:
				{
					if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0)) 
						me->CastSpell(target, DUNGEON_MODE(BOULDER_TOSS, BOULDER_TOSS_H), false);

					events.RepeatEvent(5000 + rand()%2000);
					break;
				}
				case EVENT_GROUND_SPIKE:
				{
					me->CastSpell(me->GetVictim(), GROUND_SPIKE_H, false); // current enemy target
					events.RepeatEvent(8000 + rand()%3000);
					break;
				}
				case EVENT_STOMP:
				{
					me->CastSpell(me, DUNGEON_MODE(STOMP, STOMP_H), false);
					events.RepeatEvent(13000 + rand()% 5000);
					break;
				}
				case EVENT_GROUND_SLAM:
				{
					events.RepeatEvent(10000 + rand()%3000);
					me->CastSpell(me->GetVictim(), GROUND_SLAM, true);
					events.DelayEvents(10000);
					events.RescheduleEvent(EVENT_SHATTER, 8000);
					break;
				}
				case EVENT_SHATTER:
				{
					me->CastSpell((Unit*)NULL, DUNGEON_MODE(SHATTER, SHATTER_H), false);
					Talk(SAY_SHATTER);
					events.RescheduleEvent(EVENT_REMOVE_STONED, 1500);
					events.PopEvent();
					break;
				}
				case EVENT_REMOVE_STONED:
				{
					RemoveStonedEffect();
					events.PopEvent();
					break;
				}
			}

			DoMeleeAttackIfReady();
		}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:58,代码来源:boss_krystallus.cpp

示例4: UpdateAI

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

			events.Update(diff);
			if (me->HasUnitState(UNIT_STATE_CASTING))
				return;

			switch (events.GetEvent())
			{
				case EVENT_SUMMON_FERAL_DEFENDER:
					me->MonsterTextEmote("Auriaya begins to activate Feral Defender.", 0, true);
					me->CastSpell(me, SPELL_ACTIVATE_FERAL_DEFENDER, true);
					events.PopEvent();
					me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
					events.ScheduleEvent(EVENT_REMOVE_IMMUNE, 3000);
					break;
				case EVENT_REMOVE_IMMUNE:
					events.PopEvent();
					me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
					break;
				case EVENT_TERRIFYING_SCREECH:
					me->MonsterTextEmote("Auriaya begins to cast Terrifying Screech.", 0, true);
					me->CastSpell(me, SPELL_TERRIFYING_SCREECH, false);
					events.RepeatEvent(35000);
					break;
				case EVENT_SONIC_SCREECH:
					me->CastSpell(me, SPELL_SONIC_SCREECH, false);
					events.RepeatEvent(50000);
					break;
				case EVENT_GUARDIAN_SWARM:
					me->CastSpell(me->GetVictim(), SPELL_GUARDIAN_SWARM, false);
					events.RepeatEvent(40000);
					break;
				case EVENT_SENTINEL_BLAST:
					me->CastSpell(me, SPELL_SENTINEL_BLAST, false);
					events.RepeatEvent(35000);
					events.DelayEvents(5000, 0);
					break;
				case EVENT_RESPAWN_FERAL_DEFENDER:
				{
					EntryCheckPredicate pred(NPC_FERAL_DEFENDER);
					summons.DoAction(ACTION_FERAL_RESPAWN, pred);
					events.PopEvent();
					break;
				}
				case EVENT_ENRAGE:
					me->MonsterTextEmote("You waste my time!", 0);
					me->PlayDirectSound(SOUND_BERSERK);
					me->CastSpell(me, SPELL_ENRAGE, true);
					events.PopEvent();
					break;
			}

			DoMeleeAttackIfReady();
		}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:57,代码来源:boss_auriaya.cpp

示例5: UpdateAI

        void UpdateAI(uint32 diff)
        {
            events.Update(diff);
            switch (events.GetEvent())
            {
                case EVENT_GRAUF_CHECK:
                {
                    CheckPlayers();
                    events.RepeatEvent(2000);
                    break;
                }
                case EVENT_GRAUF_START:
                {
                    me->GetMotionMaster()->Clear(true);
                    me->GetMotionMaster()->MoveTakeoff(10, SkadiPosition[0].GetPositionX(), SkadiPosition[0].GetPositionY(), SkadiPosition[0].GetPositionZ(), 3.0f);

                    SpawnHelpers(0);
                    SpawnHelpers(0);
                    events.ScheduleEvent(EVENT_GRAUF_MOVE, 15000);
                    events.ScheduleEvent(EVENT_GRAUF_SUMMON_HELPERS, 20000);
                    events.PopEvent();
                    break;
                }
                case EVENT_GRAUF_MOVE:
                {
                    AchievementHitCount = 0;
                    uint8 targetPoint = SelectNextPos(currentPos);
                    me->GetMotionMaster()->MovePoint(targetPoint, SkadiPosition[targetPoint].GetPositionX(), SkadiPosition[targetPoint].GetPositionY(), SkadiPosition[targetPoint].GetPositionZ());
                    if (targetPoint <= 1)
                    {
                        SpawnFlameTriggers(targetPoint);
                        me->CastSpell(me, SPELL_FLAME_VISUAL, false);
                    }

                    if (m_pInstance) 
                        m_pInstance->SetData(SKADI_IN_RANGE, 0);

                    currentPos = targetPoint;
                    events.RepeatEvent(25000);
                    break;
                }
                case EVENT_GRAUF_SUMMON_HELPERS:
                {
                    SpawnHelpers(1);
                    events.RepeatEvent(15000);
                    break;
                }
                case EVENT_GRAUF_REMOVE_SKADI:
                {
                    RemoveSkadi(false);
                    me->DespawnOrUnsummon();
                    events.PopEvent();
                    break;
                }
            }
        }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:56,代码来源:boss_skadi.cpp

示例6: UpdateAI

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

			events.Update(diff);
			if (me->HasUnitState(UNIT_STATE_CASTING))
				return;

			switch (events.GetEvent())
			{
				case EVENT_SPELL_ARCANE_VOLLEY:
					me->CastSpell(me, SPELL_ARCANE_VOLLEY_N, false);
					events.RepeatEvent(urand(7000, 12000));
					break;
				case EVENT_SPELL_POLYMORPH:
					if (Unit* target = (IsHeroic() ? SelectTarget(SELECT_TARGET_RANDOM, 0) : SelectTarget(SELECT_TARGET_TOPAGGRO, 1)))
						me->CastSpell(target, SPELL_POLYMORPH_N, false);
					events.RepeatEvent(urand(15000, 17500));
					break;
				case EVENT_SPELL_SLOW:
					me->CastSpell(me, SPELL_SLOW, false);
                    events.RepeatEvent(urand(15000, 30000));
					break;
				case EVENT_HEALTH_CHECK:
					if (me->HealthBelowPct(20))
					{
						me->CastSpell(me, SPELL_MANA_SHIELD, false);
						events.PopEvent();
						return;
					}
					events.RepeatEvent(1000);
					break;
				case EVENT_SPELL_BLINK:
					Talk(EMOTE_ARCANE_EXP);
					if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
					{
						me->CastSpell(target, SPELL_BLINK, false);
						me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation());

						DoCast(target, SPELL_BLINK_TELEPORT);
					}
					events.RepeatEvent(urand(35000, 40000));
					events.DelayEvents(500);
					events.ScheduleEvent(EVENT_SPELL_BLINK_2, 0);
					return;
				case EVENT_SPELL_BLINK_2:
					me->CastSpell(me, SPELL_ARCANE_EXPLOSION_N, false);
					me->CastSpell(me, SPELL_ARCANE_BUBBLE, true);
					events.PopEvent();
					break;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:DSlayerMan,项目名称:Sunwell,代码行数:55,代码来源:boss_talon_king_ikiss.cpp

示例7: UpdateAI

        void UpdateAI(uint32 diff)
        {
            if( pInstance && pInstance->GetData(DATA_KELESETH) != IN_PROGRESS )
            {
                if( me->IsAlive() )
                    Unit::Kill(me, me);
                return;
            }

            if (!UpdateVictim())
                return;

            events.Update(diff);

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

            switch( events.GetEvent() )
            {
                case 0:
                    break;
                case EVENT_SPELL_DECREPIFY:
                    if( !me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE) )
                        me->CastSpell(me->GetVictim(), SPELL_DECREPIFY, false);
                    events.RepeatEvent(urand(15000,25000));
                    break;
                case EVENT_SPELL_BONE_ARMOR:
                    if( !me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE) )
                        me->CastSpell((Unit*)NULL, SPELL_BONE_ARMOR, false);
                    events.RepeatEvent(urand(40000,120000));
                    break;
                case EVENT_RESURRECT:
                    events.PopEvent();
                    events.DelayEvents(3500);
                    DoCast(me, SPELL_SCOURGE_RESURRECTION, true);
                    me->SetStandState(UNIT_STAND_STATE_STAND);
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);
                    me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
                    me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
                    events.RescheduleEvent(EVENT_RESURRECT_2, 3000);
                    break;
                case EVENT_RESURRECT_2:
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                    me->SetControlled(false, UNIT_STATE_ROOT);
                    me->GetMotionMaster()->MoveChase(me->GetVictim());
                    events.PopEvent();
                    break;
            }

            if( !me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE) )
                DoMeleeAttackIfReady();
        }
开发者ID:boom8866,项目名称:azerothcore-wotlk,代码行数:52,代码来源:boss_keleseth.cpp

示例8: UpdateAI

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

            events.Update(diff);

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

            switch (events.GetEvent())
            {
                case EVENT_BALL_LIGHTNING:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
                        me->CastSpell(target, me->GetMap()->IsHeroic() ? SPELL_BALL_LIGHTNING_H : SPELL_BALL_LIGHTNING_N, false);
                    
                    events.RepeatEvent(10000 + rand()%1000);
                    break;
                case EVENT_STATIC_OVERLOAD:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
                        me->CastSpell(target, me->GetMap()->IsHeroic() ? SPELL_STATIC_OVERLOAD_H : SPELL_STATIC_OVERLOAD_N, false);

                    events.RepeatEvent(5000 + rand()%1000);
                    break;
                case EVENT_CHECK_HEALTH:
                    if (HealthBelowPct(HealthCheck))
                        me->CastSpell(me, SPELL_DISPERSE, false);

                    events.RepeatEvent(1000);
                    return;
                case EVENT_CALL_SPARKS:
                {
                    EntryCheckPredicate pred(NPC_SPARK_OF_IONAR);
                    summons.DoAction(ACTION_CALLBACK, pred);
                    events.PopEvent();
                    events.ScheduleEvent(EVENT_RESTORE, 2000, 0, 2);
                    return;
                }
                case EVENT_RESTORE:
                    EntryCheckPredicate pred(NPC_SPARK_OF_IONAR);
                    summons.DoAction(ACTION_SPARK_DESPAWN, pred);
                    events.PopEvent();

                    me->SetVisible(true);
                    me->SetControlled(false, UNIT_STATE_STUNNED);
                    ScheduleEvents(true);
                    return;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:51,代码来源:boss_ionar.cpp

示例9: UpdateAI

        void UpdateAI(uint32 diff)
        {
            UpdateVictim();

            events.Update(diff);

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

            switch( events.GetEvent() )
            {
                case 0:
                    break;
                case EVENT_MEMORY_SCALE:
                    me->SetObjectScale(1.0f);
                    events.ScheduleEvent(EVENT_MEMORY_START_ATTACK, 5000);
                    events.PopEvent();
                    break;
                case EVENT_MEMORY_START_ATTACK:
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                    if( Unit* target = me->SelectNearestTarget(200.0f) )
                    {
                        AttackStart(target);
                        DoZoneInCombat();
                    }
                    me->SetReactState(REACT_AGGRESSIVE);
                    events.ScheduleEvent(EVENT_SPELL_OLD_WOUNDS, 8000);
                    events.ScheduleEvent(EVENT_SPELL_SHADOWS_PAST, 4000);
                    events.ScheduleEvent(EVENT_SPELL_WAKING_NIGHTMARE, urand(20000,30000));
                    events.PopEvent();
                    break;
                case EVENT_SPELL_OLD_WOUNDS:
                    if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f, true) )
                        me->CastSpell(target, SPELL_OLD_WOUNDS, true);
                    events.RepeatEvent(12000);
                    break;
                case EVENT_SPELL_SHADOWS_PAST:
                    if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true) )
                        me->CastSpell(target, SPELL_SHADOWS_PAST, false);
                    events.RepeatEvent(urand(15000,20000));
                    break;
                case EVENT_SPELL_WAKING_NIGHTMARE:
                    me->CastSpell(me, SPELL_WAKING_NIGHTMARE, false);
                    events.RepeatEvent(35000);
                    break;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:49,代码来源:boss_argent_challenge.cpp

示例10: UpdateAI

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

                events.Update(diff);

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

                switch (events.GetEvent())
                {
                    case EVENT_ROCK_SHARDS:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                            me->CastSpell(target, SPELL_ROCK_SHARDS, false);
                        
                        events.RepeatEvent(15000);
                        break;
                    case EVENT_CHOKING_CLOUD:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                            me->CastSpell(target, RAID_MODE(SPELL_CRUSHING_LEAP_10, SPELL_CRUSHING_LEAP_25), true); //10y~80y, ignore range
                        
                        events.RepeatEvent(30000);
                        break;
                    case EVENT_STOMP:
                    {
                        char buffer[100];
                        sprintf(buffer, "Archavon the Stone Watcher lunges for %s!", me->GetVictim()->GetName().c_str());
                        me->MonsterTextEmote(buffer, 0);
                        me->CastSpell(me->GetVictim(), RAID_MODE(SPELL_STOMP_10, SPELL_STOMP_25), false);
                        events.RepeatEvent(45000);
                        events.ScheduleEvent(EVENT_IMPALE, 3000);
                        break;
                    }
                    case EVENT_IMPALE:
                        me->CastSpell(me->GetVictim(), RAID_MODE(SPELL_IMPALE_10, SPELL_IMPALE_25), false);
                        events.PopEvent();
                        break;
                    case EVENT_BERSERK:
                        me->CastSpell(me, SPELL_BERSERK, true);
                        Talk(EMOTE_BERSERK);
                        events.PopEvent();
                        break;
                    default:
                        break;
                }

                DoMeleeAttackIfReady();
            }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:49,代码来源:boss_archavon.cpp

示例11: UpdateAI

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

			events.Update(diff);

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

			switch( events.GetEvent() )
			{
				case 0:
					break;
				case 1: // leap
					if (Unit* target = me->GetVictim())
						if (me->GetDistance(target) > 5.0f && me->GetDistance(target) < 30.0f)
						{
							me->CastSpell(target, SPELL_LEAP, false);
							events.PopEvent();
							break;
						}
					events.RepeatEvent(1000);
					break;
				case 2: // claw
					if (Unit* target = me->GetVictim())
						me->CastSpell(target, SPELL_CLAW_N, false);
					events.RepeatEvent(urand(6000,8000));
					break;
			}

			DoMeleeAttackIfReady();
		}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:33,代码来源:boss_black_knight.cpp

示例12: UpdateAI

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

            events.Update(diff);
            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;

            switch (events.GetEvent())
            {
                case EVENT_SPELL_NECROTIC_AURA:
                    me->CastSpell(me, SPELL_NECROTIC_AURA, true);
                    events.RepeatEvent(20000);
                    break;
                case EVENT_SPELL_DEATHBLOOM:
                    me->CastSpell(me, SPELL_SUMMON_SPORE, true);
                    me->CastSpell(me, RAID_MODE(SPELL_DEATHBLOOM_10, SPELL_DEATHBLOOM_25), false);
                    events.RepeatEvent(30000);
                    break;
                case EVENT_SPELL_INEVITABLE_DOOM:
                    me->CastSpell(me, RAID_MODE(SPELL_INEVITABLE_DOOM_10, SPELL_INEVITABLE_DOOM_25), false);
                    events.RepeatEvent(events.GetTimer() < 5*MINUTE*IN_MILLISECONDS ? 30000 : 15000);
                    break;
                case EVENT_SPELL_BERSERK:
                    me->CastSpell(me, SPELL_BERSERK, true);
                    events.PopEvent();
                    break;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Keader,项目名称:Sunwell,代码行数:32,代码来源:boss_loatheb.cpp

示例13: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
                return;

            events.Update(diff);

            while (uint32 eventId = events.GetEvent())
            {
                switch (eventId)
                {
                    case EVENT_VALIONAS_FLAME:
                        if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
                            DoCast(pTarget, SPELL_VALIONAS_FLAME);
                        events.RepeatEvent(urand(15000,25000));
                        break;
                    case EVENT_SHREDDING_SWIPE:
                        if(me->getVictim())
                            DoCastVictim(SPELL_SHREDDING_SWIPE);
                        events.RepeatEvent(urand(21000,30000));
                        break;
                    case EVENT_DEVOURING_FLAMES:
                        DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_DEVOURING_FLAMES_H);
                        events.RepeatEvent(urand(30000,35000));
                        break;
                    default:
                        events.PopEvent();
                        break;
                }
            }

            DoMeleeAttackIfReady();
        }
开发者ID:hodobaj,项目名称:Darkcore,代码行数:33,代码来源:boss_drahga_shadowburner.cpp

示例14: UpdateAI

 void UpdateAI(uint32 diff)
 {
     events.Update(diff);
     switch (events.GetEvent())
     {
         case EVENT_CHECK_PLAYER:
         {
             Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID);
             if (!player || me->GetDistance2d(player) > 100.0f)
             {
                 EnterEvadeMode();
                 return;
             }
             events.RepeatEvent(2000);
             break;
         }
         case EVENT_SUMMON_ARCHERS:
             SummonArchers();
             events.PopEvent();
             break;
         case EVENT_SUMMON_PEASANTS:
             _spoken = false;
             SummonPeasants();
             _spoken = false;
             events.RepeatEvent(60*IN_MILLISECONDS);
             break;
     }
 }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:28,代码来源:zone_eastern_plaguelands.cpp

示例15: UpdateAI

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

            events.Update(diff);

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

            switch( events.GetEvent() )
            {
                case 0:
                    break;
                case EVENT_YELL_DALRONN_AGGRO:
                    Talk(YELL_DALRONN_AGGRO);
                    events.PopEvent();
                    break;
                case EVENT_MATE_DIED:
                    Talk(YELL_DALRONN_SKA_DIEDFIRST);
                    events.PopEvent();
                    break;
                case EVENT_SPELL_SHADOW_BOLT:
                    if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 42.0f, true) )
                        me->CastSpell(target, SPELL_SHADOW_BOLT, false);
                    events.RepeatEvent(2500);
                    break;
                case EVENT_SPELL_DEBILITATE:
                    if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true) )
                    {
                        me->CastSpell(target, SPELL_DEBILITATE, false);
                        events.RepeatEvent(urand(5000,10000));
                    }
                    else
                        events.RepeatEvent(3000);
                    break;
                case EVENT_SPELL_SUMMON_SKELETONS:
                    me->CastSpell((Unit*)NULL, SPELL_SUMMON_SKELETONS, false);
                    events.RepeatEvent(urand(20000,30000));
                    break;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Keader,项目名称:Sunwell,代码行数:44,代码来源:boss_skarvald_dalronn.cpp


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