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


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

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


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

示例1: Split

		void Split()
		{
			Talk(SAY_SPLIT);

			Creature* spark;
			for (uint8 i = 0; i < 5; ++i)
			{
				if (spark = me->SummonCreature(NPC_SPARK_OF_IONAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 20000))
				{
					summons.Summon(spark);
					spark->CastSpell(spark, me->GetMap()->IsHeroic() ? SPELL_SPARK_VISUAL_TRIGGER_H : SPELL_SPARK_VISUAL_TRIGGER_N, true);
					spark->CastSpell(spark, SPELL_RANDOM_LIGHTNING, true);
					spark->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE);
					spark->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0);

					if (Player* tgt = SelectTargetFromPlayerList(100))
						spark->GetMotionMaster()->MoveFollow(tgt, 0.0f, 0.0f, MOTION_SLOT_CONTROLLED);
				}
			}
			
			me->SetVisible(false);
			me->SetControlled(true, UNIT_STATE_STUNNED);

			events.SetPhase(2);
			events.ScheduleEvent(EVENT_CALL_SPARKS, 15000, 0, 2);
		}
开发者ID:DSlayerMan,项目名称:Sunwell,代码行数:26,代码来源:boss_ionar.cpp

示例2: ChangePhase

 void ChangePhase()
 {
     if (!phase || phase == PHASE_CHASE)
     {
         phase = PHASE_STRIKE;
         summons.DoAction(EVENT_VOLCANO, 0);
         events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE);
         me->SetSpeed(MOVE_RUN, 1.2f);
         me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
         me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false);
     }
     else
     {
         phase = PHASE_CHASE;
         events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE);
         events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE);
         me->SetSpeed(MOVE_RUN, 0.9f);
         me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
         me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
     }
     DoResetThreat();
     DoZoneInCombat();
     events.SetPhase(phase);
     events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST);
 }
开发者ID:Neskafee,项目名称:TrinityCore,代码行数:25,代码来源:boss_supremus.cpp

示例3: ScheduleEvents

 void ScheduleEvents(bool anvil)
 {
     events.SetPhase(1);
     events.RescheduleEvent(EVENT_HEAT, 8000, 0, 1);
     events.RescheduleEvent(EVENT_SHATTER, 10000, 0, 1);
     events.RescheduleEvent(EVENT_CHECK_HEALTH, anvil ? 1000 : 6000, 0, 1);
     events.RescheduleEvent(EVENT_POSITION, 4000, 0, 1);
 }
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:8,代码来源:boss_volkhan.cpp

示例4: ScheduleEvents

        void ScheduleEvents(bool spark)
        {
            events.SetPhase(1);
            if (!spark)
                events.RescheduleEvent(EVENT_CHECK_HEALTH, 1000, 0, 1);

            events.RescheduleEvent(EVENT_BALL_LIGHTNING, 10000, 0, 1);
            events.RescheduleEvent(EVENT_STATIC_OVERLOAD, 5000, 0, 1);
        }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:9,代码来源:boss_ionar.cpp

示例5: Reset

		void Reset()
		{
			events.Reset();
			evade = false;

			me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
			me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
			me->SetReactState(REACT_PASSIVE);

			events.SetPhase(PHASE_BOSS_WAITING);
		}
开发者ID:GlassFace,项目名称:Mist-Eria-Core510,代码行数:11,代码来源:boss_trial_of_the_king.cpp

示例6: EnterCombat

		void EnterCombat(Unit* /*who*/)
		{
			if (Creature* mushiba = me->GetCreature(*me, instance->GetData64(DATA_MUSHIBA)))
			{
				mushiba->SetReactState(REACT_AGGRESSIVE);
				mushiba->SetInCombatWithZone();
			}

			events.SetPhase(PHASE_BOSS_ATTACK);
			events.ScheduleEvent(EVENT_SHOCKWAVE, 17*IN_MILLISECONDS, 0);
		}
开发者ID:GlassFace,项目名称:Mist-Eria-Core510,代码行数:11,代码来源:boss_trial_of_the_king.cpp

示例7: EnterCombat

 void EnterCombat(Unit* who)
 {
     DoScriptText(SAY_STEELBREAKER_AGGRO, me);
     DoZoneInCombat();
     CallBosses(pInstance, DATA_STEELBREAKER, who);
     DoCast(me, SPELL_HIGH_VOLTAGE);
     phase = 1;
     events.SetPhase(phase);
     events.ScheduleEvent(EVENT_ENRAGE, 900000);
     events.ScheduleEvent(EVENT_FUSION_PUNCH, 15000);
 }
开发者ID:Ramusik,项目名称:MadboxpcWOW_3.0,代码行数:11,代码来源:boss_assembly_of_iron.cpp

示例8: DamageTaken

 void DamageTaken(Unit* /*done_by*/, uint32 & /*damage*/)
 {
     if (!Repentance && me->GetHealthPct() <= 50.0f)
     {
         Repentance = true;
         events.Reset();
         events.SetPhase(PHASE_REPENTANCE);
         me->SetReactState(REACT_PASSIVE);
         me->AttackStop();
         me->GetMotionMaster()->MoveTargetedHome();
     }
 }
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:12,代码来源:boss_high_prophet_barim.cpp

示例9: DoAction

 void DoAction(int32 action)
 {
     if (action == ACTION_SERVANT_DEATH)
     {
         Talk(SAY_WAILING_WINDS);
         me->RemoveAura(SPELL_DEFLECTING_WINDS);
         me->CastSpell(me, SPELL_WAILING_WINDS_AURA, false);
         events.SetPhase(PHASE_WAILING_WINDS);
         events.ScheduleEvent(EVENT_WAILING_WINDS, 1000, 0, PHASE_WAILING_WINDS);
         events.ScheduleEvent(EVENT_STORM_BOLT_S, urand(10000, 25000), 0, PHASE_SIAMAT);
     }
 }
开发者ID:sunshitwowsucks,项目名称:ArkCORE-NG,代码行数:12,代码来源:boss_siamat.cpp

示例10: UpdateAI

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

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

			switch (events.ExecuteEvent())
			{
				case EVENT_SPELL_DRAIN_LIFE:
					if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
						me->CastSpell(target, DUNGEON_MODE(SPELL_DRAIN_LIFE_N, SPELL_DRAIN_LIFE_H), false);
					events.ScheduleEvent(EVENT_SPELL_DRAIN_LIFE, 10000, 1);
					return;
				case EVENT_SPELL_DRAIN_MANA:
					if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, PowerUsersSelector(me, POWER_MANA, 40.0f, false)))
						me->CastSpell(target, SPELL_DRAIN_MANA, false);
					events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 10000, 1);
					return;
				case EVENT_SPELL_FEL_EXPLOSION:
					me->RemoveAuraFromStack(SPELL_MANA_RAGE_TRIGGER);
					me->CastSpell(me, SPELL_FEL_EXPLOSION, false);
					events.ScheduleEvent(EVENT_SPELL_FEL_EXPLOSION, 2000);
					break;
				case EVENT_DRAIN_CRYSTAL:
					events.DelayEvents(10001);
					events.ScheduleEvent(EVENT_EMPOWER, 10000);
					events.ScheduleEvent(EVENT_DRAIN_CRYSTAL, 30000);
					SelectNearestCrystal();
					break;
				case EVENT_EMPOWER:
					if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA))
					{
						Talk(SAY_EMPOWERED);
						if (Unit* crystal = ObjectAccessor::GetUnit(*me, CrystalGUID))
							Unit::Kill(crystal, crystal);
						events.DelayEvents(10000, 1);
						events.ScheduleEvent(EVENT_RESTORE_COMBAT, 0);
					}
					else
						events.ScheduleEvent(EVENT_EMPOWER, 0, 0, 1);
					break;
				case EVENT_RESTORE_COMBAT:
					events.SetPhase(0);
					me->GetMotionMaster()->MoveChase(me->GetVictim());
					break;
			}

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

示例11: EnterCombat

            void EnterCombat(Unit* who)
            {
                DoZoneInCombat();

                events.Reset();
                events.SetPhase(PHASE_ONE);
                events.ScheduleEvent(EVENT_SWITCH_PHASE, 90000); 
                events.ScheduleEvent(EVENT_COLD_SLAP, 500, 0, PHASE_ONE); 
                events.ScheduleEvent(EVENT_SUMMON_HAILSTONE, 1000, 0, PHASE_ONE); 
                events.ScheduleEvent(EVENT_SUMMON_COLDWEAVE, 8000, 0, PHASE_ONE); 
                events.ScheduleEvent(EVENT_ICE_SPEAR, 9500, 0, PHASE_ONE); 
                events.ScheduleEvent(EVENT_EARTHEN_RING_ATTACK, 10000, 0, PHASE_ONE); 
            }
开发者ID:kmN666,项目名称:Leroy,代码行数:13,代码来源:boss_ahune.cpp

示例12: EnterCombat

            void EnterCombat(Unit* who)
            {
                DoZoneInCombat();

                events.Reset();
                events.SetPhase(PHASE_ONE);
                events.ScheduleEvent(EVENT_SWITCH_PHASE, 90000); // phase 2 after 90 seconds
                events.ScheduleEvent(EVENT_COLD_SLAP, 500, 0, PHASE_ONE); // every 500ms in melee range in phase 1
                events.ScheduleEvent(EVENT_SUMMON_HAILSTONE, 1000, 0, PHASE_ONE); // once in every phase 1
                events.ScheduleEvent(EVENT_SUMMON_COLDWEAVE, 8000, 0, PHASE_ONE); // every 7 seconds in phase 1
                events.ScheduleEvent(EVENT_ICE_SPEAR, 9500, 0, PHASE_ONE); // every 7 seconds in phase 1, first after 9.5 seconds
                events.ScheduleEvent(EVENT_EARTHEN_RING_ATTACK, 10000, 0, PHASE_ONE); // every 10 seconds in phase 1 totem attack visual
            }
开发者ID:Marchmalo,项目名称:TrinityElron103,代码行数:13,代码来源:boss_ahune.cpp

示例13: MoveInLineOfSight

        void MoveInLineOfSight(Unit* who) override
        {
            if (!_introDone && (instance->GetData(BOSS_GRAND_CHAMPIONS) != DONE && instance->GetData(BOSS_GRAND_CHAMPIONS) != FAIL) && me->IsWithinDistInMap(who, 75.0f))
            {
                _introDone = true;
                me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                
                events.SetPhase(PHASE_INTRO);
                events.ScheduleEvent(EVENT_INTRO_1, 10000, 0, PHASE_INTRO);

                SummonNpcs();
            }
        }
开发者ID:GetPlay,项目名称:TC,代码行数:13,代码来源:TW_trial_of_the_champion.cpp

示例14: HealReceived

        void HealReceived(Unit* /*healer*/, uint32& heal)
        {
            if (me->GetHealth() + heal >= me->GetMaxHealth())
                if (events.GetPhaseMask() & PHASE_EGG_MASK)
                {
                    Birth = true;
                    uiBirthTimer = 2500;
                    me->RemoveAura(SPELL_BLAZE_OF_THE_HEAVENS_TRANSFORM);

                    events.SetPhase(PHASE_BLAZE);

                }
        }
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:13,代码来源:boss_high_prophet_barim.cpp

示例15: EnterCombat

        void EnterCombat(Unit* /*who*/)
        {
            Talk(SAY_AGGRO);
            UpdateDistanceVisibility();

            events.ScheduleEvent(EVENT_DISTANCE, 2*IN_MILLISECONDS);
            events.ScheduleEvent(EVENT_ENDLESS_RAGE, 20*IN_MILLISECONDS);
            events.ScheduleEvent(EVENT_GROWING_ANGER, urand(30*IN_MILLISECONDS, 35*IN_MILLISECONDS), 0, PHASE_GROWING_ANGER);
            events.ScheduleEvent(EVENT_UNLEASHED_WRATH, 50*IN_MILLISECONDS);
            events.ScheduleEvent(EVENT_BERSERK, 900*IN_MILLISECONDS);

            events.SetPhase(PHASE_GROWING_ANGER);
        }
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:13,代码来源:boss_sha_of_anger.cpp


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