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


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

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


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

示例1: Reset

            void Reset()
            {
                events.Reset();

                events.ScheduleEvent(EVENT_SUMMON_ZEPHYR, 4000);
            }
开发者ID:Expery,项目名称:Core,代码行数:6,代码来源:heart_of_fear.cpp

示例2: Reset

 void Reset()
 {
     m_instance->SetData(ENC_IMMOLTHAR, NOT_STARTED);
     m_events.Reset();
     m_phase = 0;
 }
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:6,代码来源:boss_immolthar.cpp

示例3: UpdateAI

		void UpdateAI(uint32 diff)
		{
			if (!UpdateVictim() && !me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
				return;

			events.Update(diff);

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

			switch(events.GetEvent())
			{
				case 0:
					break;
				case EVENT_EMERGE:
					me->SetVisible(true);
					me->CastSpell(me, SPELL_EMERGE_0, false);
					events.PopEvent();
					events.RescheduleEvent(EVENT_ATTACK, 2000);
					break;
				case EVENT_SUMMON_TOTEMS:
					for (uint8 i=0; i<3; ++i)
						DoSummon(NPC_TOTEM, TotemPos[i], 10*60*1000, TEMPSUMMON_TIMED_DESPAWN);
					events.PopEvent();
					break;
				case EVENT_INVOKER_SAY_1:
					if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID))
					{
						plr->MonsterSay("The Ice Stone has melted!", LANG_UNIVERSAL, 0);
						plr->CastSpell(plr, SPELL_MAKE_BONFIRE, true);
					}
					events.PopEvent();
					events.RescheduleEvent(EVENT_INVOKER_SAY_2, 2000);
					break;
				case EVENT_INVOKER_SAY_2:
					if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID))
						plr->MonsterSay("Ahune, your strength grows no more!", LANG_UNIVERSAL, 0);
					events.PopEvent();
					events.RescheduleEvent(EVENT_INVOKER_SAY_3, 2000);
					break;
				case EVENT_INVOKER_SAY_3:
					if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID))
						plr->MonsterSay("Your frozen reign will not come to pass!", LANG_UNIVERSAL, 0);
					events.PopEvent();
					break;
				case EVENT_ATTACK:
					events.Reset();
					if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID))
						AttackStart(plr);
					me->SetInCombatWithZone();
					if (!me->IsInCombat())
					{
						EnterEvadeMode();
						return;
					}
					else
						me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
					break;
				case EVENT_TOTEMS_ATTACK:
					for (uint8 i=0; i<3; ++i)
						if (Creature* bunny = me->FindNearestCreature(NPC_TOTEM_BUNNY_1+i, 150.0f, true))
							bunny->CastSpell(me, SPELL_TOTEM_BEAM, false);
					events.PopEvent();
					events.RescheduleEvent(EVENT_SUBMERGE, 10000);
					break;
				case EVENT_SUBMERGE:
					me->MonsterTextEmote(TEXT_RETREAT, 0, true);
					me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
					me->CastSpell(me, SPELL_SUBMERGE_0, true);
					me->CastSpell(me, SPELL_SELF_STUN, true);
					if (Creature* c = DoSummon(NPC_FROZEN_CORE, *me, 24000, TEMPSUMMON_TIMED_DESPAWN))
					{
						c->SetHealth(me->GetHealth());
					}
					events.Reset();
					events.RescheduleEvent(EVENT_COMBAT_EMERGE, 25000);
					events.RescheduleEvent(EVENT_EMERGE_WARNING, 20000);
					break;
				case EVENT_EMERGE_WARNING:
					me->MonsterTextEmote(TEXT_RESURFACE, 0, true);
					events.PopEvent();
					break;
				case EVENT_COMBAT_EMERGE:
					me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
					me->RemoveAura(SPELL_SELF_STUN);
					me->CastSpell(me, SPELL_EMERGE_0, false);
					// me->CastSpell(me, SPELL_AHUNE_RESURFACES, true); // done in SummonedCreatureDespawn
					me->RemoveAura(SPELL_SUBMERGE_0);
					events.PopEvent();
					StartPhase1();
					break;

				case EVENT_SPELL_COLD_SLAP:
					if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 5.0f, true))
						if (target->GetPositionZ() < me->GetPositionZ()+6.0f)
						{
							int32 dmg = urand(5500,6000);
							me->CastCustomSpell(target, SPELL_COLD_SLAP, &dmg, NULL, NULL, false);
							float x, y, z;
							target->GetNearPoint(target, x, y, z, target->GetObjectSize(), 30.0f, target->GetAngle(me->GetPositionX(), me->GetPositionY()) + M_PI);
//.........这里部分代码省略.........
开发者ID:DSlayerMan,项目名称:Sunwell,代码行数:101,代码来源:boss_ahune.cpp

示例4: Reset

 void Reset()
 {
     events.Reset();
     Summons.DespawnAll();
     isEnraged = false;
 }
开发者ID:Everf,项目名称:Dkc,代码行数:6,代码来源:boss_general_umbriss.cpp

示例5: Reset

            void Reset()
            {
                events.Reset();

                events.ScheduleEvent(EVENT_THROW,      7000);
            }
开发者ID:CATACLYSMDEV,项目名称:JadeCore-5.4.8-18291--dev-,代码行数:6,代码来源:southern_barrens.cpp

示例6: Reset

 void Reset()
 {
     summons.DespawnAll();
     events.Reset();
     stage = 0;
 }
开发者ID:Exodius,项目名称:chuspi,代码行数:6,代码来源:boss_drahga_shadowburner.cpp

示例7: Reset

		void Reset()
		{
			events.Reset();

			events.ScheduleEvent(EVENT_AGGRO, 5500);
		}
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:6,代码来源:boss_lorewalker_stonestep.cpp

示例8: Reset

		void Reset()
            {
                me->SetReactState(REACT_DEFENSIVE);
                events.Reset();
            }
开发者ID:Adeer,项目名称:Patch,代码行数:5,代码来源:tct_boss_chimaeron.cpp

示例9: UpdateAI

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

			if((me->GetHealthPct() < 25 || Ignacious->GetHealthPct() < 25 ) && phase == 1)
			{ // Switch to Arion and Terrestra Phase (2)

				phase++;
				events.Reset();
				me->RemoveAllAuras();
				Ignacious->RemoveAllAuras();

				me->SetVisible(false);
				Ignacious->SetVisible(false);

				me->SetReactState(REACT_PASSIVE);
				Ignacious->SetReactState(REACT_PASSIVE);

				me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
				Ignacious->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);

				Ascendants[3] = Terrestra = me->SummonCreature(BOSS_TERRASTRA,position[1],TEMPSUMMON_MANUAL_DESPAWN);
				Ascendants[2] = Arion = me->SummonCreature(BOSS_ARION,position[0],TEMPSUMMON_MANUAL_DESPAWN);

			}else if(Arion && Terrestra)
			{
				if((Arion->GetHealthPct() < 25 || Terrestra->GetHealthPct() < 25 ) && phase == 2)
				{ // Switch to Monstrosity Phase (3)

					phase++;

					for(uint8 i = 0; i<=3;i++)
					{
						Ascendants[i]->RemoveAllAuras();
						Ascendants[i]->SetVisible(true);
						Ascendants[i]->SetReactState(REACT_PASSIVE);
						Ascendants[i]->AttackStop();
						Ascendants[i]->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);

						Ascendants[i]->NearTeleportTo(position[i+1].GetPositionX(),position[i+1].GetPositionY(),position[i+1].GetPositionZ(),position[i+1].GetOrientation());
					}

					AscentInTheMiddle = 0;
					events.ScheduleEvent(EVENT_EVENT_GO_IN_DELAY, 2200);

				}else if(phase == 3)
				{ // Phase 3 for Event

					events.Update(diff);

					while (uint32 eventId = events.ExecuteEvent())
					{
						switch (eventId)
						{
						case EVENT_EVENT_GO_IN_DELAY:			

							Ascendants[AscentInTheMiddle]->GetMotionMaster()->MovePoint(0,position[6]);

							AscentInTheMiddle++;

							if(AscentInTheMiddle != 4)
								events.ScheduleEvent(EVENT_EVENT_GO_IN_DELAY, 2200);
							break;
						}
					}
				}
			}

			if(phase > 1 || !UpdateVictim())
				return;

			events.Update(diff);

			while (uint32 eventId = events.ExecuteEvent())
			{
				switch (eventId)
				{

				case EVENT_HYDROLANCE:

					if(Unit * Victim = SelectTarget(SELECT_TARGET_RANDOM,0 ,500.0f,true))
						me->CastSpell(Victim,SPELL_HYDROLANCE,false);

					events.ScheduleEvent(EVENT_HYDROLANCE, urand(10000,12000));
					break;

				case EVENT_WATER_BOMB:
					DoCast(SPELL_WATERBOMB);

					events.ScheduleEvent(EVENT_WATER_BOMB, urand(16000,19000));
					break;

				case EVENT_HEART_OF_ICE:

					if(Unit * Victim = SelectTarget(SELECT_TARGET_RANDOM,0 ,500.0f,true))
						me->CastSpell(Victim,SPELL_HEART_OF_ICE,false);

					events.ScheduleEvent(EVENT_HEART_OF_ICE, urand(10000,12000));
					break;
//.........这里部分代码省略.........
开发者ID:AtVirus,项目名称:Merciless-Gaming-Cata,代码行数:101,代码来源:boss_council_of_ascendents.cpp

示例10: Reset

 void Reset()
 {
     m_instance->SetData(ENC_LETHTENDRIS, NOT_STARTED);
     m_events.Reset();
     m_phase = 0;
 }
开发者ID:Delicate90,项目名称:ArkCORE-NG,代码行数:6,代码来源:boss_lethtendris.cpp

示例11: UpdateAI

        void UpdateAI(uint32 diff) override
        {
            if (HealthBelowPct(75))
            {
                if (PotTimer <= diff)
                {
                    DoCast(me, SPELL_HEALING_POTION, true);
                    PotTimer = 10000;
                } else PotTimer -= diff;
            }

            if (GetAttack() && UpdateVictim())
                DoMeleeAttackIfReady();

            npc_escortAI::UpdateAI(diff);

            if (me->IsInCombat())
                return;

            events.Update(diff);

            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    case EVENT_EMOTE_BEG:
                        me->HandleEmoteCommand(EMOTE_ONESHOT_BEG);
                        events.ScheduleEvent(EVENT_EMOTE_BEG, Seconds(25));
                        break;
                    case EVENT_BEGIN:
                        if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
                            Talk(TALK_0, player);
                        break;
                    case EVENT_START_ESCORT:
                        events.Reset();
                        me->setFaction(FACTION_ESCORTEE_H);
                        me->SetReactState(REACT_AGGRESSIVE);
                        ENSURE_AI(npc_escortAI, (me->AI()))->Start(true, true, _player);
                        break;
                    case EVENT_TALK_1:
                        if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
                            Talk(TALK_1, player);
                        break;
                    case EVENT_KNEEL:
                        me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
                        break;
                    case EVENT_TALK_2:
                        if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
                            Talk(TALK_2, player);
                        me->LoadEquipment(EQUIP_TORCH);
                        me->SetSheath(SHEATH_STATE_MELEE);
                        break;
                    case EVENT_BURN_CRATES:
                        DoCastAOE(SPELL_BURN, true);
                        break;
                    case EVENT_TALK_3:
                        if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
                            Talk(TALK_3, player);
                        break;
                    case EVENT_TALK_4:
                        if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
                            Talk(TALK_4, player);
                        break;
                    case EVENT_LAUGH:
                        me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
                        break;
                    case EVENT_TALK_5:
                        if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
                            Talk(TALK_5, player);
                        me->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
                        break;
                    case EVENT_TALK_6:
                        if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
                            Talk(TALK_6, player);
                        break;
                    case EVENT_TALK_8:
                        if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
                            Talk(TALK_8, player);
                        break;
                }
            }
        }
开发者ID:090809,项目名称:TrinityCore,代码行数:82,代码来源:zone_howling_fjord.cpp

示例12: Reset

 void Reset()
 {
     events.Reset();
     me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
     me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
 }
开发者ID:AtVirus,项目名称:Tenerby,代码行数:6,代码来源:forge_of_souls.cpp

示例13: Reset

 void Reset() 
 {
     events.Reset();
     m_uiHealthAmountModifier = 1;
 }
开发者ID:AwkwardDev,项目名称:WoWSource434,代码行数:5,代码来源:boss_arcurion.cpp

示例14: Reset

 void Reset()
 {
     m_instance->SetData(ENC_TENDRIS_WARPWOOD, NOT_STARTED);
     m_events.Reset();
     m_phase = 0;
 }
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:6,代码来源:boss_tendris_warpwood.cpp

示例15: UpdateAI

            void UpdateAI(uint32 diff)
            {
                events2.Update(diff);
                switch (events2.ExecuteEvent())
                {
                    case INTRO_1:
                        me->GetMotionMaster()->MovePath(KIRTONOS_PATH, false);
                        break;
                    case INTRO_2:
                        me->GetMotionMaster()->MovePoint(0, PosMove[0]);
                        break;
                    case INTRO_3:
                        if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS)))
                            gate->SetGoState(GO_STATE_READY);
                        me->SetFacingTo(0.01745329f);
                        break;
                    case INTRO_4:
                        me->SetWalk(true);
                        me->SetDisableGravity(false);
                        me->CastSpell(me, SPELL_KIRTONOS_TRANSFORM, true);
                        me->SetCanFly(false);
                        break;
                    case INTRO_5:
                        me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
                        me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF));
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
                        me->SetReactState(REACT_AGGRESSIVE);
                        break;
                    case INTRO_6:
                        me->GetMotionMaster()->MovePoint(0, PosMove[1]);
                        break;
                }

                if (!UpdateVictim())
                    return;

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

                switch (events.ExecuteEvent())
                {
                    case EVENT_SWOOP:
                        me->CastSpell(me->GetVictim(), SPELL_SWOOP, false);
                        events.ScheduleEvent(EVENT_SWOOP, 15000);
                        break;
                    case EVENT_WING_FLAP:
                        me->CastSpell(me, SPELL_WING_FLAP, false);
                        events.ScheduleEvent(EVENT_WING_FLAP, 13000);
                        break;
                    case EVENT_PIERCE_ARMOR:
                        me->CastSpell(me->GetVictim(), SPELL_PIERCE_ARMOR, false);
                        events.ScheduleEvent(EVENT_PIERCE_ARMOR, 12000);
                        break;
                    case EVENT_DISARM:
                        me->CastSpell(me->GetVictim(), SPELL_DISARM, false);
                        events.ScheduleEvent(EVENT_DISARM, 11000);
                        break;
                    case EVENT_SHADOW_BOLT_VOLLEY:
                        me->CastSpell(me, SPELL_SHADOW_BOLT_VOLLEY, false);
                        events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 10000);
                        break;
                    case EVENT_CURSE_OF_TONGUES:
                        me->CastSpell(me, SPELL_CURSE_OF_TONGUES, false);
                        events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, 20000);
                        break;
                    case EVENT_DOMINATE_MIND:
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 20.0f, true))
                            me->CastSpell(target, SPELL_DOMINATE_MIND, false);
                        events.ScheduleEvent(EVENT_DOMINATE_MIND, urand(44000, 48000));
                        break;
                    case EVENT_KIRTONOS_TRANSFORM:
                        if (me->HealthBelowPct(50))
                        {
                            events.Reset();
                            events.ScheduleEvent(EVENT_SWOOP, 4000);
                            events.ScheduleEvent(EVENT_WING_FLAP, 7000);
                            events.ScheduleEvent(EVENT_PIERCE_ARMOR, 11000);
                            events.ScheduleEvent(EVENT_DISARM, 15000);
                            me->RemoveAura(SPELL_KIRTONOS_TRANSFORM);
                            me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0));
                            break;
                        }

                        events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, 2000);
                        break;
                }

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


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