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


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

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


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

示例1: 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

示例2: UpdateAI

        void UpdateAI(uint32 diff)
        {
            //Return since we have no target or if we are frozen
            if (!UpdateVictim() || me->GetEntry() == NPC_BRITTLE_GOLEM)
                return;

            events.Update(diff);

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

            switch (events.GetEvent())
            {
                case EVENT_BLAST:
                    me->CastSpell(me, SPELL_BLAST_WAVE, false);
                    events.RepeatEvent(14000);
                    break;
                case EVENT_IMMOLATION:
                    me->CastSpell(me->GetVictim(), me->GetMap()->IsHeroic() ? SPELL_IMMOLATION_STRIKE_H : SPELL_IMMOLATION_STRIKE_N, false);
                    events.RepeatEvent(5000);
                    break;
            }

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

示例3: 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

示例4: 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_SPELL_GUSHING_WOUND:
                    me->CastSpell(me->GetVictim(), SPELL_GUSHING_WOUND, false);
                    events.RepeatEvent(urand(7000,12000));
                    break;
                case EVENT_SPELL_HOWLING_SCREECH:
                    me->CastSpell(me->GetVictim(), SPELL_HOWLING_SCREECH, false);
                    events.RepeatEvent(urand(8000,13000));
                    break;
                case EVENT_SPELL_STRIKE:
                    me->CastSpell(me->GetVictim(), SPELL_STRIKE, false);
                    events.RepeatEvent(urand(4000,8000));
                    break;
            }

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

示例5: UpdateAI

        void UpdateAI(uint32 diff)
        {
            if (beamTimer)
            {
                beamTimer += diff;
                if (beamTimer >= 2000)
                {
                    me->CastSpell(me, SPELL_CORRUPTION_OF_TIME_CHANNEL, true);
                    beamTimer = 0;
                }
            }

            if (!UpdateVictim())
                return;

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

            switch (events.GetEvent())
            {
                case EVENT_SPELL_VOID_STRIKE:
                    me->CastSpell(me->GetVictim(), SPELL_VOID_STRIKE, false);
                    events.RepeatEvent(8000);
                    break;
                case EVENT_SPELL_CORRUPTING_BLIGHT:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
                        me->CastSpell(target, SPELL_CORRUPTING_BLIGHT, false);
                    events.RepeatEvent(12000);
                    break;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:34,代码来源:boss_infinite.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_ACID:
                        me->CastSpell(me->GetVictim(), SPELL_ACID_SPRAY, false);
                        events.RepeatEvent(urand(15000, 23000));
                        break;
                    case EVENT_SPELL_EXPLODING:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                            me->CastSpell(target, SPELL_EXPLODING_BREAKER, false);
                        events.RepeatEvent(urand(7000, 11000));
                        break;
                    case EVENT_SPELL_DOMINATION:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                            me->CastSpell(target, SPELL_DOMINATION, false);
                        events.RepeatEvent(120000);
                        break;
                    case EVENT_SPELL_KNOCKDOWN:
                        me->CastSpell(me->GetVictim(), SPELL_KNOCKDOWN, false);
                        events.RepeatEvent(urand(4000, 12000));
                        break;
                }

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

示例7: 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_SPELL_FIREBOLT:
                    me->CastSpell(me->GetVictim(), SPELL_FIREBOLT, false);
                    events.RepeatEvent(urand(5000,13000));
                    break;
                case EVENT_SPELL_FLAME_BREATH:
                    me->CastSpell(me->GetVictim(), SPELL_FLAME_BREATH, false);
                    events.RepeatEvent(urand(10000,15000));
                    break;
                case EVENT_SPELL_LAVA_BURN:
                    me->CastSpell(me->GetVictim(), SPELL_LAVA_BURN, false);
                    events.RepeatEvent(urand(14000,20000));
                    break;
                case EVENT_SPELL_CAUTERIZING_FLAMES:
                    me->CastSpell((Unit*)NULL, SPELL_FLAME_BREATH, false);
                    events.RepeatEvent(urand(10000,16000));
                    break;
            }

            DoMeleeAttackIfReady();
        }
开发者ID:Keader,项目名称:Sunwell,代码行数:34,代码来源:boss_lavanthor.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_WORGEN_MORTAL:
                {
                    me->CastSpell(me->GetVictim(), IsHeroic() ? SPELL_MORTAL_WOUND_H : SPELL_MORTAL_WOUND_H, false);
                    events.RepeatEvent(4000 + rand()%3000);
                    break;
                }
                case EVENT_WORGEN_ENRAGE1:
                {
                    me->CastSpell(me, SPELL_ENRAGE_1, false);
                    events.RepeatEvent(15000);
                    break;
                }
                case EVENT_WORGEN_ENRAGE2:
                {
                    me->CastSpell(me, SPELL_ENRAGE_2, false);
                    events.RepeatEvent(10000);
                    break;
                }
            }

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

示例9: 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

示例10: 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

示例11: UpdateAI

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

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

                switch (events.GetEvent())
                {
                    case EVENT_SPELL_SLIME:
                        me->CastSpell(me->GetVictim(), SPELL_SLIME_SPRAY, false);
                        events.RepeatEvent(urand(7000, 12000));
                        break;
                    case EVENT_SPELL_BOLT:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                            me->CastSpell(target, SPELL_POISON_BOLT, false);
                        events.RepeatEvent(urand(6000, 11000));
                        break;
                    case EVENT_SPELL_POISON:
                        me->CastSpell(me, SPELL_POISON_CLOUD, false);
                        events.RepeatEvent(20000);
                        break;

                }

                DoMeleeAttackIfReady();
            }
开发者ID:Keader,项目名称:Sunwell,代码行数:29,代码来源:boss_broggok.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_DISEASE_EXPULSION:
					me->CastSpell(me, DUNGEON_MODE(SPELL_DISEASE_EXPULSION_N, SPELL_DISEASE_EXPULSION_H), false);
					events.RepeatEvent(6000);
					break;
				case EVENT_SPELL_FRENZY:
					me->CastSpell(me, SPELL_FRENZY, false);
					events.RepeatEvent(20000);
					break;
				case EVENT_SPELL_CONSTRICTING_CHAINS:
					if (Unit *pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, 50.0f, true))
						me->CastSpell(pTarget, DUNGEON_MODE(SPELL_CONSTRICTING_CHAINS_N, SPELL_CONSTRICTING_CHAINS_H), false);
					events.RepeatEvent(14000);
					break;
			}

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

示例13: 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

示例14: 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

示例15: UpdateAI

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

			events.Update(diff);
			switch (events.GetEvent())
			{
				case EVENT_SPELL_LIGHTNING:
					for (uint8 i = 0; i < DUNGEON_MODE(1, 2); ++i)
						if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
							me->CastSpell(target, SPELL_LIGHTNING_CLOUD, false);
					events.RepeatEvent(urand(15000, 25000));
					break;
				case EVENT_SPELL_LUNG:
					if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                    DoCast(target, SPELL_LUNG_BURST);
					events.RepeatEvent(urand(7000, 12000));
					break;
				case EVENT_SPELL_ENVELOPING:
					for (uint8 i = 0; i < DUNGEON_MODE(1, 2); ++i)
						if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
							me->CastSpell(target, SPELL_ENVELOPING_WINDS, false);
					events.RepeatEvent(urand(10000, 15000));
					break;
			}

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


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