本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
}
示例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();
}
示例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);
}
示例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
}
示例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();
}
}
示例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);
}
}
示例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);
}