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


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

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


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

示例1: EnterCombat

        void EnterCombat(Unit* who)
        {
			BossAI::EnterCombat(who);
			me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
			if (events.Empty() && events2.Empty())
				events2.ScheduleEvent(EVENT_INTRO_2, 3000);
        }
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:7,代码来源:boss_felmyst.cpp

示例2: UpdateAI

        void UpdateAI(uint32 diff)
        {
			events2.Update(diff);
			switch (events2.ExecuteEvent())
			{
				case EVENT_ENTROPIUS_AURAS:
					me->CastSpell(me, SPELL_ENTROPIUS_COSMETIC_SPAWN, false);
					me->CastSpell(me, SPELL_NEGATIVE_ENERGY_PERIODIC, true);
					break;
				case EVENT_ENTROPIUS_COMBAT:
					me->SetReactState(REACT_AGGRESSIVE);
					me->SetInCombatWithZone();
					AttackStart(SelectTargetFromPlayerList(50.0f));
					break;
			}

			if (!events2.Empty())
				return;

            if (!UpdateVictim())
                return;

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

			switch (events.ExecuteEvent())
			{
				case EVENT_SPELL_ENRAGE:
					me->CastSpell(me, SPELL_ENRAGE, true);
					break;
				case EVENT_SPAWN_DARKNESS:
					if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
						me->CastSpell(target, SPELL_DARKNESS, true);
					events.ScheduleEvent(EVENT_SPAWN_DARKNESS, 15000);
					break;
				case EVENT_SPAWN_BLACK_HOLE:
					if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
						me->CastSpell(target, SPELL_BLACK_HOLE, true);
					events.ScheduleEvent(EVENT_SPAWN_BLACK_HOLE, 15000);
					break;
			}

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

示例3: UpdateAI

        void UpdateAI(uint32 diff)
        {
			events2.Update(diff);
			switch (events2.ExecuteEvent())
			{
				case EVENT_TALK_GOOD_1:
					me->SetRegeneratingHealth(false);
					me->RemoveAllAuras();
					me->SetReactState(REACT_PASSIVE);
					me->CombatStop();
					me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
					me->setFaction(35);
					events2.ScheduleEvent(EVENT_TALK_GOOD_2, 1000);
					break;
				case EVENT_TALK_GOOD_2:
					if (Creature* Sath = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_SATHROVARR)))
					{
						summons.Despawn(Sath);
						Unit::Kill(me, Sath);
					}
					events2.ScheduleEvent(EVENT_TALK_GOOD_3, 8000);
					break;
				case EVENT_TALK_GOOD_3:
					Talk(SAY_GOOD_PLRWIN);
					events2.ScheduleEvent(EVENT_TALK_GOOD_4, 10000);
					break;
				case EVENT_TALK_GOOD_4:
					me->SetDisableGravity(true);
					me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
					events2.ScheduleEvent(EVENT_TALK_GOOD_5, 10000);
					break;
				case EVENT_TALK_GOOD_5:
					me->SetVisible(false);
					Unit::Kill(me, me);
					break;
				case EVENT_TALK_BAD_1:
					me->SetReactState(REACT_PASSIVE);
					me->CombatStop();
					me->RemoveAllAuras();
					me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
					Talk(SAY_EVIL_ENRAGE);
					events2.ScheduleEvent(EVENT_TALK_BAD_2, 3000);
					break;
				case EVENT_TALK_BAD_2:
					me->SetDisableGravity(true);
					me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
					events2.ScheduleEvent(EVENT_TALK_BAD_3, 15000);
					break;
				case EVENT_TALK_BAD_3:
					me->SetVisible(false);
					EnterEvadeMode();
					break;
			}

			if (!events2.Empty())
				return;

			if (!UpdateVictim())
				return;

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

			switch (events.ExecuteEvent())
			{
				case EVENT_SPAWN_SPECTRALS:
					me->SummonCreature(NPC_KALEC, 1702.21f, 931.7f, -74.56f, 5.07f, TEMPSUMMON_MANUAL_DESPAWN);
					me->SummonCreature(NPC_SATHROVARR, 1704.62f, 927.78f, -73.9f, 2.0f, TEMPSUMMON_MANUAL_DESPAWN);
					break;
				case EVENT_ARCANE_BUFFET:
					me->CastSpell(me, SPELL_ARCANE_BUFFET, false);
					events.ScheduleEvent(EVENT_ARCANE_BUFFET, 8000);
					break;
				case EVENT_FROST_BREATH:
					me->CastSpell(me->GetVictim(), SPELL_FROST_BREATH, false);
					events.ScheduleEvent(EVENT_FROST_BREATH, 15000);
					break;
				case EVENT_TAIL_LASH:
					me->CastSpell(me->GetVictim(), SPELL_TAIL_LASH, false);
					events.ScheduleEvent(EVENT_TAIL_LASH, 15000);
					break;
				case EVENT_WILD_MAGIC:
					me->CastCustomSpell(RAND(44978, 45001, 45002, 45004, 45006, 45010), SPELLVALUE_MAX_TARGETS, 1, me, false);
					events.ScheduleEvent(EVENT_WILD_MAGIC, 20000);
					break;
				case EVENT_SPECTRAL_BLAST:
					me->CastSpell(me, SPELL_SPECTRAL_BLAST, false);
					events.ScheduleEvent(EVENT_SPECTRAL_BLAST, urand(15000, 25000));
					break;
				case EVENT_CHECK_POS:
					if (me->GetDistance(me->GetHomePosition()) > 50.0f)
					{
						EnterEvadeMode();
						return;
					}
					events.ScheduleEvent(EVENT_CHECK_POS, 5000);
					break;
				case EVENT_CHECK_HEALTH:
					if (me->HealthBelowPct(10))
//.........这里部分代码省略.........
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:101,代码来源:boss_kalecgos.cpp

示例4: UpdateAI

        void UpdateAI(uint32 diff)
        {
			events2.Update(diff);
			switch (events2.ExecuteEvent())
			{
				case EVENT_INTRO_1:
					me->SetStandState(UNIT_STAND_STATE_STAND);
					events2.ScheduleEvent(EVENT_INTRO_2, 4000);
					break;
				case EVENT_INTRO_2:
					Talk(YELL_BIRTH);
					me->SetDisableGravity(true);
					me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
					me->SendMovementFlagUpdate();
					events2.ScheduleEvent(EVENT_INTRO_3, 1500);
					break;
				case EVENT_INTRO_3:
					me->GetMotionMaster()->MovePoint(POINT_AIR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10.0f, false, true);
					events2.ScheduleEvent(EVENT_INTRO_4, 2000);
					break;
				case EVENT_INTRO_4:
					events.ScheduleEvent(EVENT_LAND, 3000, 1);
					events.ScheduleEvent(EVENT_SPELL_BERSERK, 600000);
					me->SetInCombatWithZone();
					me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
					me->CastSpell(me, SPELL_NOXIOUS_FUMES, true);
					me->GetMotionMaster()->MovePoint(POINT_MISC, 1472.18f, 603.38f, 34.0f, false, true);
					break;
			}

			if (!events2.Empty())
				return;

            if (!UpdateVictim())
                return;

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

			switch(events.ExecuteEvent())
			{
				case EVENT_RESTORE_COMBAT:
					me->SetReactState(REACT_AGGRESSIVE);
					break;
				case EVENT_RESTORE_COMBAT2:
					me->SetTarget(me->GetVictim()->GetGUID());
					me->GetMotionMaster()->MoveChase(me->GetVictim());
					break;
				case EVENT_LAND:
					me->GetMotionMaster()->MovePoint(POINT_GROUND, me->GetPositionX(), me->GetPositionY(), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()), false, true);
					break;
				case EVENT_SPELL_BERSERK:
					Talk(YELL_BERSERK);
					me->CastSpell(me, SPELL_BERSERK, true);
					break;
				case EVENT_SPELL_CLEAVE:
					me->CastSpell(me->GetVictim(), SPELL_CLEAVE, false);
					events.ScheduleEvent(EVENT_SPELL_CLEAVE, 7500, 1);
					break;
				case EVENT_SPELL_CORROSION:
					me->CastSpell(me->GetVictim(), SPELL_CORROSION, false);
					events.ScheduleEvent(EVENT_SPELL_CORROSION, 20000, 1);
					break;
				case EVENT_SPELL_GAS_NOVA:
					DoCast(me, SPELL_GAS_NOVA, false);
					events.ScheduleEvent(EVENT_SPELL_GAS_NOVA, 20000, 1);
					break;
				case EVENT_SPELL_ENCAPSULATE:
					if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
						me->CastSpell(target, SPELL_ENCAPSULATE_CHANNEL, false);
					events.ScheduleEvent(EVENT_SPELL_ENCAPSULATE, 25000, 1);
					break;
				case EVENT_FLIGHT:
					events.CancelEventGroup(1);
					events.ScheduleEvent(EVENT_FLIGHT_SEQ, 1000);
					me->SetReactState(REACT_PASSIVE);
					me->StopMoving();
					me->GetMotionMaster()->Clear();
					break;
				case EVENT_FLIGHT_SEQ:
                    Talk(YELL_TAKEOFF);
					me->SetTarget(0);
					me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
					me->SetDisableGravity(true);
					me->SendMovementFlagUpdate();

					events.ScheduleEvent(EVENT_FLIGHT_MOVE_UP, 2000);
					events.ScheduleEvent(EVENT_FLIGHT_VAPOR, 8000);
					events.ScheduleEvent(EVENT_FLIGHT_VAPOR, 21000);
					events.ScheduleEvent(EVENT_FLIGHT_BREATH1, 35000);
					events.ScheduleEvent(EVENT_FLIGHT_BREATH1, 72000);
					events.ScheduleEvent(EVENT_LAND_FIGHT, 86000);
					break;
				case EVENT_FLIGHT_MOVE_UP:
					me->GetMotionMaster()->MovePoint(POINT_AIR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+15.0f, false, true);
					break;
				case EVENT_FLIGHT_VAPOR:
					me->CastSpell(me, SPELL_SUMMON_DEMONIC_VAPOR, true);
					break;
//.........这里部分代码省略.........
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:101,代码来源:boss_felmyst.cpp


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