本文整理匯總了C++中EnterPhaseGround函數的典型用法代碼示例。如果您正苦於以下問題:C++ EnterPhaseGround函數的具體用法?C++ EnterPhaseGround怎麽用?C++ EnterPhaseGround使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EnterPhaseGround函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: EnterCombat
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
Talk(SAY_AGGRO);
balconyCount = 0;
EnterPhaseGround();
}
示例2: DamageTaken
void DamageTaken(Unit* pKiller, uint32 &damage)
{
if (((me->GetHealth()*100)/me->GetMaxHealth()) < 50 && WasUnder == false)
{
WasUnder = true;
EnterPhaseGround();
}
}
示例3: EnterToBattle
void EnterToBattle(Unit* /*who*/)
{
_EnterToBattle();
DoSendQuantumText(RAND(SAY_AGGRO_1, SAY_AGGRO_2, SAY_AGGRO_3), me);
balconyCount = 0;
EnterPhaseGround();
}
示例4: EnterCombat
void EnterCombat(Unit * /*who*/) {
_EnterCombat();
me->CastSpell(me, SPELL_FROST_AURA, true);
events.ScheduleEvent(EVENT_BERSERK, 15 * 60000);
EnterPhaseGround();
CheckPlayersFrostResist();
}
示例5: EnterCombat
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
me->CastSpell(me, SPELL_FROST_AURA, true);
events.ScheduleEvent(EVENT_BERSERK, 15 * MINUTE * IN_MILLISECONDS);
EnterPhaseGround();
CheckPlayersFrostResist();
}
示例6: EnterCombat
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
me->CastSpell(me, SPELL_FROST_AURA, true);
DoCast(me, SPELL_CHECK_RESISTS);
events.ScheduleEvent(EVENT_CHECK_RESISTS, 30 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_BERSERK, 15 * MINUTE * IN_MILLISECONDS);
EnterPhaseGround();
}
示例7: EnterCombat
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
me->CastSpell(me, SPELL_FROST_AURA, true);
events.SetPhase(PHASE_GROUND);
events.ScheduleEvent(EVENT_CHECK_RESISTS, Seconds(0));
events.ScheduleEvent(EVENT_BERSERK, Minutes(15));
EnterPhaseGround(true);
}
示例8: EnterCombat
void EnterCombat(Unit* /*who*/)
{
EnterPhaseGround();
applySound();
Talk(SAY_AGGRO);
m_uiPowerTimer = 1000;
if(me->GetMap()->IsHeroic())
{
me->SummonCreature(NPC_NEFARIAN_HELPER_HEROIC, 154.228f, -250.653f, 74.944f, 1.377f, TEMPSUMMON_MANUAL_DESPAWN);
events.ScheduleEvent(EVENT_AGGRO_NEF, 8000, PHASE_GROUND);
}
if (instance)
{
instance->SetBossState(DATA_ATRAMEDES, IN_PROGRESS);
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); // Add
}
_EnterCombat();
}
示例9: UpdateAI
//.........這裏部分代碼省略.........
events.ScheduleEvent(EVENT_DRAIN, 24 * IN_MILLISECONDS, 0, PHASE_GROUND);
return;
case EVENT_BLIZZARD:
{
if (Creature* summon = DoSummon(NPC_BLIZZARD, me, 0.0f, urand(25, 30) * IN_MILLISECONDS, TEMPSUMMON_TIMED_DESPAWN))
summon->GetMotionMaster()->MoveRandom(40);
events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(20, 7) * IN_MILLISECONDS, 0, PHASE_GROUND);
break;
}
case EVENT_FLIGHT:
if (HealthAbovePct(10))
{
_phase = PHASE_FLIGHT;
events.SetPhase(PHASE_FLIGHT);
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(1, x, y, z);
return;
}
break;
}
}
DoMeleeAttackIfReady();
}
else
{
if (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CHECK_RESISTS:
DoCast(me, SPELL_CHECK_RESISTS);
events.ScheduleEvent(EVENT_CHECK_RESISTS, 30 * IN_MILLISECONDS);
return;
case EVENT_LIFTOFF:
Talk(EMOTE_AIR_PHASE);
me->SetDisableGravity(true);
me->SetHover(true);
events.ScheduleEvent(EVENT_ICEBOLT, 1500);
_iceboltCount = RAID_MODE(2, 3);
return;
case EVENT_ICEBOLT:
{
std::vector<Unit*> targets;
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
for (; i != me->getThreatManager().getThreatList().end(); ++i)
if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT))
targets.push_back((*i)->getTarget());
if (targets.empty())
_iceboltCount = 0;
else
{
std::vector<Unit*>::const_iterator itr = targets.begin();
advance(itr, rand32() % targets.size());
_iceblocks.insert(std::make_pair((*itr)->GetGUID(), ObjectGuid::Empty));
DoCast(*itr, SPELL_ICEBOLT);
--_iceboltCount;
}
if (_iceboltCount)
events.ScheduleEvent(EVENT_ICEBOLT, 1 * IN_MILLISECONDS);
else
events.ScheduleEvent(EVENT_BREATH, 1 * IN_MILLISECONDS);
return;
}
case EVENT_BREATH:
{
Talk(EMOTE_BREATH);
DoCastAOE(SPELL_FROST_MISSILE);
events.ScheduleEvent(EVENT_EXPLOSION, 8 * IN_MILLISECONDS);
return;
}
case EVENT_EXPLOSION:
CastExplosion();
ClearIceBlock();
events.ScheduleEvent(EVENT_LAND, 3 * IN_MILLISECONDS);
return;
case EVENT_LAND:
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
Talk(EMOTE_GROUND_PHASE);
me->SetHover(false);
me->SetDisableGravity(false);
events.ScheduleEvent(EVENT_GROUND, 1500);
return;
case EVENT_GROUND:
EnterPhaseGround();
return;
case EVENT_BIRTH:
me->SetVisible(true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
return;
}
}
}
}
示例10: UpdateAI
//.........這裏部分代碼省略.........
events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND);
return;
case EVENT_DRAIN:
DoCastAOE(SPELL_LIFE_DRAIN);
events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND);
return;
case EVENT_BLIZZARD:
{
//DoCastAOE(SPELL_SUMMON_BLIZZARD);
if (Creature* summon = DoSummon(MOB_BLIZZARD, me, 0.0f, urand(25000, 30000), TEMPSUMMON_TIMED_DESPAWN))
summon->GetMotionMaster()->MoveRandom(40);
events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(20000, 7000), 0, PHASE_GROUND);
break;
}
case EVENT_FLIGHT:
if (HealthAbovePct(10))
{
phase = PHASE_FLIGHT;
events.SetPhase(PHASE_FLIGHT);
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(1, x, y, z);
return;
}
break;
}
}
DoMeleeAttackIfReady();
}
else
{
if (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_LIFTOFF:
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
me->SetLevitate(true);
me->SendMovementFlagUpdate();
events.ScheduleEvent(EVENT_ICEBOLT, 1500);
iceboltCount = RAID_MODE(2, 3);
return;
case EVENT_ICEBOLT:
{
std::vector<Unit*> targets;
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
for (; i != me->getThreatManager().getThreatList().end(); ++i)
if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT))
targets.push_back((*i)->getTarget());
if (targets.empty())
iceboltCount = 0;
else
{
std::vector<Unit*>::const_iterator itr = targets.begin();
advance(itr, rand()%targets.size());
iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0));
DoCast(*itr, SPELL_ICEBOLT);
--iceboltCount;
}
if (iceboltCount)
events.ScheduleEvent(EVENT_ICEBOLT, 1000);
else
events.ScheduleEvent(EVENT_BREATH, 1000);
return;
}
case EVENT_BREATH:
{
DoScriptText(EMOTE_BREATH, me);
DoCastAOE(SPELL_FROST_MISSILE);
events.ScheduleEvent(EVENT_EXPLOSION, 8000);
return;
}
case EVENT_EXPLOSION:
CastExplosion();
ClearIceBlock();
events.ScheduleEvent(EVENT_LAND, 3000);
return;
case EVENT_LAND:
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
me->SetLevitate(false);
me->SendMovementFlagUpdate();
events.ScheduleEvent(EVENT_GROUND, 1500);
return;
case EVENT_GROUND:
EnterPhaseGround();
return;
case EVENT_BIRTH:
me->SetVisible(true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
return;
}
}//if (uint32 eventId = events.ExecuteEvent())
}//if (phase == PHASE_GROUND)
}
示例11: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
return;
if (Creature* Onyxia = me->FindNearestCreature(NPC_ONYXIA, 150.0f, true))
if (Onyxia && !Onyxia->isInCombat() && said == false)
{
Talk(SAY_AVOID_WIPE);
said = true;
}
if (phase == PHASE_GROUND && m_uiDistanceCheckTimer <= diff)
{
if (me->FindNearestCreature(NPC_ONYXIA, 50.0f, true) && onyxiaAlive && !me->HasAura(SPELL_CHILDREN_OF_DEATHWING_ONY))
me->AddAura(SPELL_CHILDREN_OF_DEATHWING_ONY, me);
else if (!me->FindNearestCreature(NPC_ONYXIA, 50.0f, true) && onyxiaAlive)
if(me->HasAura(SPELL_CHILDREN_OF_DEATHWING_ONY))
me->RemoveAura(SPELL_CHILDREN_OF_DEATHWING_ONY);
m_uiDistanceCheckTimer = 5000;
}
else m_uiDistanceCheckTimer -= diff;
if (phase == PHASE_GROUND && m_uiOnyxiaCheckTimer <= diff && !secondPhase)
{
if (me->FindNearestCreature(NPC_ONYXIA, 150.0f, true))
onyxiaAlive = true;
else
{
onyxiaAlive = false;
Talk(SAY_AIR_PHASE);
if(me->HasAura(SPELL_CHILDREN_OF_DEATHWING_ONY))
me->RemoveAura(SPELL_CHILDREN_OF_DEATHWING_ONY);
events.ScheduleEvent(EVENT_LIFTOFF, 5000, PHASE_GROUND);
secondPhase = true;
}
m_uiOnyxiaCheckTimer = 5000;
}
else m_uiOnyxiaCheckTimer -= diff;
if (phase == PHASE_FLIGHT && m_uiChromaticCheckTimer <= diff && !finalPhase)
{
if (!me->FindNearestCreature(NPC_CHROMATIC_PROTO, 150.0f, true))
events.ScheduleEvent(EVENT_LAND, 2000, PHASE_FLIGHT);
finalPhase = true;
m_uiChromaticCheckTimer = 5000;
}
else m_uiChromaticCheckTimer -= diff;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_ELECTROCUTE:
if(electrocute == true)
{
DoCast(me, SPELL_ELECTROCUTE);
electrocute = false;
}
break;
case EVENT_INTRO:
me->HandleEmote(EMOTE_ONESHOT_LIFTOFF);
me->SetDisableGravity(true);
me->SendMovementFlagUpdate();
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
me->GetMotionMaster()->MovePoint(1, -126.518f, -233.342f, 36.358f); // Position on top of raid.
break;
case EVENT_INTRO2:
Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_HAIL_OF_BONES, 100);
break;
case EVENT_HAIL_OF_BONES:
DoCast(me, SPELL_HAIL_OF_BONES);
break;
case EVENT_MOVE:
me->GetMotionMaster()->MovePoint(1, -100.123f, -221.522f, 7.156f); // Move down.
events.ScheduleEvent(EVENT_LANDING, 8000);
break;
case EVENT_LANDING:
me->HandleEmote(EMOTE_ONESHOT_LAND);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
me->SetDisableGravity(false);
me->SendMovementFlagUpdate();
EnterPhaseGround();
me->GetMotionMaster()->MoveChase(me->GetVictim());
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
break;
case EVENT_SHADOWFLAME_BREATH:
Talk(SAY_SHADOWFLAME);
//.........這裏部分代碼省略.........
示例12: EnterCombat
void EnterCombat(Unit * /*who*/)
{
EnterPhaseGround();
DoScriptText(SAY_AGGRO, me);
}
示例13: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CURSE:
{
DoCastAOE(SPELL_CURSE);
events.ScheduleEvent(EVENT_CURSE, urand(50, 70) * IN_MILLISECONDS, 0, PHASE_GROUND);
break;
}
case EVENT_WARRIOR:
Talk(SAY_SUMMON);
Talk(EMOTE_SUMMON);
CastSummon(RAID_MODE(2, 3), 0, 0);
events.ScheduleEvent(EVENT_WARRIOR, 40 * IN_MILLISECONDS, 0, PHASE_GROUND);
break;
case EVENT_BLINK:
DoCastAOE(SPELL_CRIPPLE, true);
DoCastAOE(SPELL_BLINK);
DoResetThreat();
justBlinked = true;
events.ScheduleEvent(EVENT_BLINK, 40000, 0, PHASE_GROUND);
break;
case EVENT_BALCONY:
events.SetPhase(PHASE_BALCONY);
me->SetReactState(REACT_PASSIVE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
me->AttackStop();
me->StopMoving();
me->RemoveAllAuras();
events.ScheduleEvent(EVENT_BALCONY_TELEPORT, 3 * IN_MILLISECONDS, 0, PHASE_BALCONY);
events.ScheduleEvent(EVENT_WAVE, urand(5 * IN_MILLISECONDS, 8 * IN_MILLISECONDS), 0, PHASE_BALCONY);
uint8 secondsBalcony;
switch (balconyCount)
{
case 0:
secondsBalcony = 70;
break;
case 1:
secondsBalcony = 97;
break;
case 2:
default:
secondsBalcony = 120;
break;
}
events.ScheduleEvent(EVENT_GROUND, secondsBalcony * IN_MILLISECONDS, 0, PHASE_BALCONY);
break;
case EVENT_BALCONY_TELEPORT:
Talk(EMOTE_TELEPORT_1);
DoCastAOE(SPELL_TELEPORT);
break;
case EVENT_WAVE:
Talk(EMOTE_SUMMON_WAVE);
switch (balconyCount)
{
case 0:
CastSummon(0, RAID_MODE(2, 4), 0);
break;
case 1:
CastSummon(0, RAID_MODE(1, 2), RAID_MODE(1, 2));
break;
case 2:
CastSummon(0, 0, RAID_MODE(2, 4));
break;
default:
CastSummon(0, RAID_MODE(5, 10), RAID_MODE(5, 10));
break;
}
events.ScheduleEvent(EVENT_WAVE, urand(30, 45) * IN_MILLISECONDS, 0, PHASE_BALCONY);
break;
case EVENT_GROUND:
++balconyCount;
DoCastAOE(SPELL_TELEPORT_BACK);
Talk(EMOTE_TELEPORT_2);
EnterPhaseGround();
break;
case EVENT_GROUND_ATTACKABLE:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
break;
}
}
//.........這裏部分代碼省略.........
示例14: UpdateAI
void UpdateAI(uint32 diff) override
{
events.Update(diff);
if (!events.IsInPhase(PHASE_BIRTH) && !UpdateVictim())
return;
if (events.IsInPhase(PHASE_GROUND))
{
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CHECK_RESISTS:
DoCast(me, SPELL_CHECK_RESISTS);
events.Repeat(Seconds(30));
return;
case EVENT_GROUND:
EnterPhaseGround(false);
return;
case EVENT_BERSERK:
Talk(EMOTE_ENRAGE);
DoCast(me, SPELL_BERSERK);
return;
case EVENT_CLEAVE:
DoCastVictim(SPELL_CLEAVE);
events.ScheduleEvent(EVENT_CLEAVE, randtime(Seconds(5), Seconds(15)), 0, PHASE_GROUND);
return;
case EVENT_TAIL:
DoCastAOE(SPELL_TAIL_SWEEP);
events.ScheduleEvent(EVENT_TAIL, randtime(Seconds(7), Seconds(10)), 0, PHASE_GROUND);
return;
case EVENT_DRAIN:
if (events.IsInPhase(PHASE_FLIGHT))
_delayedDrain = true;
else
CastDrain();
return;
case EVENT_BLIZZARD:
DoCastAOE(SPELL_SUMMON_BLIZZARD);
events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(Seconds(20), Seconds(7)), 0, PHASE_GROUND);
break;
case EVENT_FLIGHT:
if (HealthAbovePct(10))
{
_delayedDrain = false;
events.SetPhase(PHASE_FLIGHT);
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(1, x, y, z);
return;
}
break;
}
}
DoMeleeAttackIfReady();
}
else
{
if (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CHECK_RESISTS:
DoCast(me, SPELL_CHECK_RESISTS);
events.Repeat(Seconds(30));
return;
case EVENT_LIFTOFF:
{
Talk(EMOTE_AIR_PHASE);
if (Creature* buffet = DoSummon(NPC_WING_BUFFET, me, 0.0f, 0, TEMPSUMMON_MANUAL_DESPAWN))
_buffet = buffet->GetGUID();
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
me->SetHover(true);
events.ScheduleEvent(EVENT_ICEBOLT, Seconds(7), 0, PHASE_FLIGHT);
_iceboltTargets.clear();
std::list<Unit*> targets;
SelectTargetList(targets, RAID_MODE(2, 3), SELECT_TARGET_RANDOM, 200.0f, true);
for (Unit* target : targets)
if (target)
_iceboltTargets.push_back(target->GetGUID());
return;
}
case EVENT_ICEBOLT:
{
if (_iceboltTargets.empty())
{
events.ScheduleEvent(EVENT_BREATH, Seconds(2), 0, PHASE_FLIGHT);
return;
}
ObjectGuid target = _iceboltTargets.back();
if (Player* pTarget = ObjectAccessor::GetPlayer(*me, target))
if (pTarget->IsAlive())
DoCast(pTarget, SPELL_ICEBOLT);
_iceboltTargets.pop_back();
//.........這裏部分代碼省略.........
示例15: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim() || !CheckInRoom())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CURSE:
DoCastAOE(SPELL_CURSE_PLAGUEBRINGER);
events.ScheduleEvent(EVENT_CURSE, urand(50000, 60000));
return;
case EVENT_WARRIOR:
Talk(SAY_SUMMON);
SummonUndead(NPC_WARRIOR, RAID_MODE(2, 3));
events.ScheduleEvent(EVENT_WARRIOR, 30000);
return;
case EVENT_BLINK:
DoCastAOE(SPELL_CRIPPLE, true);
DoCastAOE(SPELL_BLINK);
DoResetThreat();
events.ScheduleEvent(EVENT_BLINK, 40000);
return;
case EVENT_BALCONY:
me->SetReactState(REACT_PASSIVE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->AttackStop();
me->RemoveAllAuras();
me->NearTeleportTo(Teleport.GetPositionX(), Teleport.GetPositionY(), Teleport.GetPositionZ(), Teleport.GetOrientation());
events.Reset();
events.ScheduleEvent(EVENT_WAVE, urand(2000, 5000));
waveCount = 0;
return;
case EVENT_WAVE:
Talk(SAY_SUMMON);
switch (balconyCount)
{
case 0:
SummonUndead(NPC_CHAMPION, RAID_MODE(2, 4));
break;
case 1:
SummonUndead(NPC_CHAMPION, RAID_MODE(1, 2));
SummonUndead(NPC_GUARDIAN, RAID_MODE(1, 2));
break;
case 2:
SummonUndead(NPC_GUARDIAN, RAID_MODE(2, 4));
break;
default:
SummonUndead(NPC_CHAMPION, RAID_MODE(5, 10));
SummonUndead(NPC_GUARDIAN, RAID_MODE(5, 10));
break;
}
++waveCount;
events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, urand(30000, 45000));
return;
case EVENT_GROUND:
{
++balconyCount;
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
me->NearTeleportTo(x, y, z, o);
events.ScheduleEvent(EVENT_BALCONY, 110000);
EnterPhaseGround();
return;
}
}
}
if (me->HasReactState(REACT_AGGRESSIVE))
DoMeleeAttackIfReady();
}