本文整理汇总了C++中RAID_MODE函数的典型用法代码示例。如果您正苦于以下问题:C++ RAID_MODE函数的具体用法?C++ RAID_MODE怎么用?C++ RAID_MODE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RAID_MODE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim() || !CheckInArea(diff, 5767))
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CHECK_PLAYERS:
{
Map::PlayerList const &PlayerList = instance->instance->GetPlayers();
if (!PlayerList.isEmpty())
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (Player* pPlayer = i->getSource())
if (pPlayer->GetPositionZ() > 70.0f)
pPlayer->NearTeleportTo(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
}
}
events.ScheduleEvent(EVENT_CHECK_PLAYERS, 5000);
break;
}
case EVENT_BERSERK:
Talk(SAY_BERSERK);
DoCast(me, SPELL_BERSERK);
break;
case EVENT_BLAZE_OF_GLORY:
DoCast(me, SPELL_INCENDIARY_SOUL, true);
DoCastVictim(SPELL_BLAZE_OF_GLORY);
events.ScheduleEvent(EVENT_BLAZE_OF_GLORY, 9000);
break;
case EVENT_INFERNO_BLADE:
Talk(SAY_INFERNO);
DoCast(me, SPELL_INFERNO_BLADE);
events.ScheduleEvent(EVENT_DECIMATION_BLADE, 30000);
events.RescheduleEvent(EVENT_BLAZE_OF_GLORY, urand(7000, 9000));
break;
case EVENT_DECIMATION_BLADE:
Talk(SAY_DECIMATION);
DoCast(me, SPELL_DECIMATION_BLADE);
events.ScheduleEvent(EVENT_INFERNO_BLADE, 30000);
events.RescheduleEvent(EVENT_BLAZE_OF_GLORY, urand(7000, 9000));
break;
case EVENT_SHARDS_OF_TORMENT:
Talk(SAY_SHARDS);
me->CastCustomSpell(SPELL_SHARDS_OF_TORMENT_AOE, SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 2, 1, 2), me);
events.ScheduleEvent(EVENT_SHARDS_OF_TORMENT, 34000);
break;
case EVENT_FINAL_COUNTDOWN:
DoCastAOE(SPELL_FINAL_COUNTDOWN);
events.ScheduleEvent(EVENT_FINAL_COUNTDOWN, 45000);
break;
}
}
if (me->HasAura(SPELL_INFERNO_BLADE))
{
if (!me->HasUnitState(UNIT_STATE_CASTING) && me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim()))
{
DoCastVictim(SPELL_INFERNO_BLADE_DMG, true);
me->resetAttackTimer();
}
}
else if (me->HasAura(SPELL_DECIMATION_BLADE) || me->HasAura(SPELL_DECIMATION_BLADE_25))
{
if (!me->HasUnitState(UNIT_STATE_CASTING) && me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim()))
{
DoCastVictim(SPELL_DECIMATION_BLADE_DMG, true);
me->resetAttackTimer();
}
}
else
DoMeleeAttackIfReady();
}
示例2: UpdateAI
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (Phase == 1 && HealthBelowPct(20))
{
Phase = 2;
DoScriptText(SAY_PHASE_2, me);
}
if (HealthBelowPct(2))
{
me->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667f, -295.101166f, 417.321381f, 0, 0, 0, 0, 0, 0);
// All of them. or random?
DoScriptText(SAY_DEATH_1, me);
DoScriptText(SAY_DEATH_2, me);
DoScriptText(SAY_DEATH_3, me);
DoScriptText(SAY_DEATH_4, me);
DoScriptText(SAY_DEATH_5, me);
me->DisappearAndDie();
if (instance)
instance->SetData(BOSS_ALGALON, DONE);
return;
}
if (Phase == 1)
{
if (!Summon)
{
if (uiPhase_timer <= diff)
{
switch (uiStep)
{
case 1:
DoScriptText(SAY_SUMMON_1, me);
JumpToNextStep(3000);
break;
case 2:
DoScriptText(SAY_SUMMON_2, me);
JumpToNextStep(3000);
break;
case 3:
DoScriptText(SAY_SUMMON_3, me);
JumpToNextStep(3000);
break;
case 4:
DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, me);
JumpToNextStep(3000);
break;
case 5:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
Summon = true;
break;
}
} else uiPhase_timer -= diff;
return;
}
if (QuantumStrike_Timer <= diff)
{
DoCast(me->getVictim(), RAID_MODE(SPELL_QUANTUM_STRIKE, H_SPELL_QUANTUM_STRIKE), true);
QuantumStrike_Timer = urand(4000, 14000);
} else QuantumStrike_Timer -= diff;
if (BigBang_Timer <= diff)
{
DoScriptText(RAND(SAY_BIG_BANG_1, SAY_BIG_BANG_2), me);
DoCast(me->getVictim(), RAID_MODE(SPELL_BIG_BANG, H_SPELL_BIG_BANG), true);
BigBang_Timer = 90000;
} else BigBang_Timer -= diff;
if (Ascend_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ASCEND, true);
Ascend_Timer = 480000;
} else Ascend_Timer -= diff;
if (PhasePunch_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_PHASE_PUNCH, true);
PhasePunch_Timer = 8000;
} else PhasePunch_Timer -= diff;
if (CosmicSmash_Timer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), RAID_MODE(SPELL_COSMIC_SMASH, H_SPELL_COSMIC_SMASH), true);
CosmicSmash_Timer = urand(30000, 60000);
//.........这里部分代码省略.........
示例3: mob_lightning_elementalAI
mob_lightning_elementalAI(Creature *c) : ScriptedAI(c)
{
me->SetInCombatWithZone();
me->AddAura( RAID_MODE(SPELL_LIGHTNING_ELEMENTAL_PASSIVE, SPELL_LIGHTNING_ELEMENTAL_PASSIVE_H), me);
}
示例4: UpdateAI
void UpdateAI(const uint32 diff)
{
if(!UpdateVictimWithGaze() || !CheckInRoom())
return;
if(me->GetDistance(me->GetHomePosition()) > 80.0f)
{
EnterEvadeMode();
return;
}
events.Update(diff);
while(uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_WOUND:
DoCast(me->getVictim(), SPELL_MORTAL_WOUND);
events.ScheduleEvent(EVENT_WOUND, 10000);
break;
case EVENT_ENRAGE:
DoCast(me, SPELL_ENRAGE);
events.ScheduleEvent(EVENT_ENRAGE, 15000);
break;
case EVENT_DECIMATE:
DoCastAOE(SPELL_DECIMATE);
events.ScheduleEvent(EVENT_DECIMATE, RAID_MODE(120000,90000));
for(std::list<uint64>::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
{
Creature* minion = Unit::GetCreature(*me, *itr);
if(minion && minion->isAlive())
{
int32 damage = int32(minion->GetHealth()) - int32(minion->CountPctFromMaxHealth(5));
if(damage > 0)
me->CastCustomSpell(28375, SPELLVALUE_BASE_POINT0, damage, minion, true);
AttackGluth(minion);
}
}
break;
case EVENT_BERSERK:
if(!me->HasAura(SPELL_BERSERK))
DoCast(me, SPELL_BERSERK);
events.ScheduleEvent(EVENT_BERSERK, 1*60000);
break;
case EVENT_SUMMON:
for(int32 i = 0; i < RAID_MODE(1, 2); ++i)
DoSummon(MOB_ZOMBIE, PosSummon[rand() % RAID_MODE(1,3)]);
events.ScheduleEvent(EVENT_SUMMON, 10000);
break;
}
}
if(me->getVictim() && me->getVictim()->GetEntry() == MOB_ZOMBIE)
{
if(me->IsWithinMeleeRange(me->getVictim()))
{
me->Kill(me->getVictim());
me->ModifyHealth(int32(me->CountPctFromMaxHealth(5)));
}
} else DoMeleeAttackIfReady();
}
示例5: UpdateAI
void UpdateAI(uint32 const diff)
{
if (!_phase)
return;
events.Update(diff);
if ((_phase != PHASE_BIRTH && !UpdateVictim()) || !CheckInRoom())
return;
if (_canTheHundredClub)
{
if (_checkFrostResistTimer <= diff)
{
CheckPlayersFrostResist();
_checkFrostResistTimer = 5 * IN_MILLISECONDS;
}
else
_checkFrostResistTimer -= diff;
}
if (_phase == PHASE_GROUND)
{
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_BERSERK:
Talk(EMOTE_ENRAGE);
DoCast(me, SPELL_BERSERK);
return;
case EVENT_CLEAVE:
DoCastVictim(SPELL_CLEAVE);
events.ScheduleEvent(EVENT_CLEAVE, urand(5, 15) * IN_MILLISECONDS, 0, PHASE_GROUND);
return;
case EVENT_TAIL:
DoCastAOE(SPELL_TAIL_SWEEP);
events.ScheduleEvent(EVENT_TAIL, urand(5, 15) * IN_MILLISECONDS, 0, PHASE_GROUND);
return;
case EVENT_DRAIN:
DoCastAOE(SPELL_LIFE_DRAIN);
events.ScheduleEvent(EVENT_DRAIN, 24 * IN_MILLISECONDS, 0, PHASE_GROUND);
return;
case EVENT_BLIZZARD:
{
//DoCastAOE(SPELL_SUMMON_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_LIFTOFF:
Talk(EMOTE_AIR_PHASE);
me->SetDisableGravity(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;
}
//.........这里部分代码省略.........
示例6: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
switch (m_uiStage)
{
case 0:
if (m_uiFreezeSlashTimer <= uiDiff)
{
DoCastVictim(SPELL_FREEZE_SLASH);
m_uiFreezeSlashTimer = 15*IN_MILLISECONDS;
} else m_uiFreezeSlashTimer -= uiDiff;
if (m_uiPenetratingColdTimer <= uiDiff)
{
me->CastCustomSpell(RAID_MODE(SPELL_PENETRATING_COLD_10_N, SPELL_PENETRATING_COLD_25_N, SPELL_PENETRATING_COLD_10_H, SPELL_PENETRATING_COLD_25_H) , SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5));
m_uiPenetratingColdTimer = 20*IN_MILLISECONDS;
} else m_uiPenetratingColdTimer -= uiDiff;
if (m_uiSummonNerubianTimer <= uiDiff && (IsHeroic() || !m_bReachedPhase3))
{
me->CastCustomSpell(SPELL_SUMMON_BURROWER, SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 2, 2, 4));
m_uiSummonNerubianTimer = 45*IN_MILLISECONDS;
} else m_uiSummonNerubianTimer -= uiDiff;
if (IsHeroic() && m_uiNerubianShadowStrikeTimer <= uiDiff)
{
Summons.DoAction(NPC_BURROWER, ACTION_SHADOW_STRIKE);
m_uiNerubianShadowStrikeTimer = 30*IN_MILLISECONDS;
} else m_uiNerubianShadowStrikeTimer -= uiDiff;
if (m_uiSubmergeTimer <= uiDiff && !m_bReachedPhase3 && !me->HasAura(SPELL_BERSERK))
{
m_uiStage = 1;
m_uiSubmergeTimer = 60*IN_MILLISECONDS;
} else m_uiSubmergeTimer -= uiDiff;
break;
case 1:
DoCast(me, SPELL_SUBMERGE_ANUBARAK);
DoCast(me, SPELL_CLEAR_ALL_DEBUFFS);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoScriptText(SAY_BURROWER, me);
m_uiScarabSummoned = 0;
m_uiSummonScarabTimer = 4*IN_MILLISECONDS;
m_uiStage = 2;
break;
case 2:
if (m_uiPursuingSpikeTimer <= uiDiff)
{
DoCast(SPELL_SPIKE_CALL);
// Just to make sure it won't happen again in this phase
m_uiPursuingSpikeTimer = 90*IN_MILLISECONDS;
} else m_uiPursuingSpikeTimer -= uiDiff;
if (m_uiSummonScarabTimer <= uiDiff)
{
/* WORKAROUND
* - The correct implementation is more likely the comment below but it needs spell knowledge
*/
std::list<uint64>::iterator i = m_vBurrowGUID.begin();
uint32 at = urand(0, m_vBurrowGUID.size()-1);
for (uint32 k = 0; k < at; k++)
++i;
if (Creature* pBurrow = Unit::GetCreature(*me, *i))
pBurrow->CastSpell(pBurrow, 66340, false);
m_uiScarabSummoned++;
m_uiSummonScarabTimer = 4*IN_MILLISECONDS;
if (m_uiScarabSummoned == 4) m_uiSummonScarabTimer = RAID_MODE(4, 20)*IN_MILLISECONDS;
/*It seems that this spell have something more that needs to be taken into account
//Need more sniff info
DoCast(SPELL_SUMMON_BEATLES);
// Just to make sure it won't happen again in this phase
m_uiSummonScarabTimer = 90*IN_MILLISECONDS;*/
} else m_uiSummonScarabTimer -= uiDiff;
if (m_uiSubmergeTimer <= uiDiff)
{
m_uiStage = 3;
m_uiSubmergeTimer = 80*IN_MILLISECONDS;
} else m_uiSubmergeTimer -= uiDiff;
break;
case 3:
m_uiStage = 0;
DoCast(SPELL_SPIKE_TELE);
if (Creature* pSpike = Unit::GetCreature(*me, m_uiSpikeGUID))
me->NearTeleportTo(pSpike->GetPositionX(), pSpike->GetPositionY(), pSpike->GetPositionZ(), pSpike->GetOrientation());
Summons.DespawnEntry(NPC_SPIKE);
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_ANUBARAK);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_EMERGE_ANUBARAK);
me->GetMotionMaster()->MoveChase(me->getVictim());
m_uiSummonNerubianTimer = 10*IN_MILLISECONDS;
m_uiNerubianShadowStrikeTimer = 30*IN_MILLISECONDS;
m_uiSummonScarabTimer = 2*IN_MILLISECONDS;
break;
}
if (!IsHeroic())
//.........这里部分代码省略.........
示例7: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateCombatState())
return;
events.Update(diff);
if (Phase == 1)
{
while (uint32 eventId = events.GetEvent())
{
switch(eventId)
{
case EVENT_WASTE:
DoSummon(NPC_WASTE, Pos[RAND(0,3,6,9)]);
events.RepeatEvent(urand(2000,5000));
break;
case EVENT_ABOMIN:
if (nAbomination < 8)
{
DoSummon(NPC_ABOMINATION, Pos[RAND(1,4,7,10)]);
nAbomination++;
events.RepeatEvent(20000);
}
else
events.PopEvent();
break;
case EVENT_WEAVER:
if (nWeaver < 8)
{
DoSummon(NPC_WEAVER, Pos[RAND(0,3,6,9)]);
nWeaver++;
events.RepeatEvent(25000);
}
else
events.PopEvent();
break;
case EVENT_TRIGGER:
if (GameObject *pKTTrigger = me->GetMap()->GetGameObject(KTTriggerGUID))
pKTTrigger->SetPhaseMask(2, true);
events.PopEvent();
break;
case EVENT_PHASE:
events.Reset();
DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me);
spawns.DespawnAll();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE);
me->CastStop();
DoStartMovement(me->getVictim());
events.ScheduleEvent(EVENT_BOLT, urand(5000,10000));
events.ScheduleEvent(EVENT_NOVA, 15000);
events.ScheduleEvent(EVENT_DETONATE, urand(30000,40000));
events.ScheduleEvent(EVENT_FISSURE, urand(10000,30000));
events.ScheduleEvent(EVENT_BLAST, urand(60000,120000));
if (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)
events.ScheduleEvent(EVENT_CHAIN, urand(30000,60000));
Phase = 2;
break;
default:
events.PopEvent();
break;
}
}
}
else
{
//start phase 3 when we are 45% health
if (Phase != 3)
{
if (HealthBelowPct(45))
{
Phase = 3 ;
DoScriptText(SAY_REQUEST_AID, me);
//here Lich King should respond to KelThuzad but I don't know which Creature to make talk
//so for now just make Kelthuzad says it.
DoScriptText(SAY_ANSWER_REQUEST, me);
for (uint8 i = 0; i <= 3; ++i)
{
if (GameObject *pPortal = me->GetMap()->GetGameObject(PortalsGUID[i]))
{
if (pPortal->getLootState() == GO_READY)
pPortal->UseDoorOrButton();
}
}
}
}
else if (nGuardiansOfIcecrownCount < RAID_MODE(2,4))
{
if (uiGuardiansOfIcecrownTimer <= diff)
{
// TODO : Add missing text
if (Creature* pGuardian = DoSummon(NPC_ICECROWN, Pos[RAND(2,5,8,11)]))
pGuardian->SetFloatValue(UNIT_FIELD_COMBATREACH, 2);
++nGuardiansOfIcecrownCount;
uiGuardiansOfIcecrownTimer = 5000;
}
else uiGuardiansOfIcecrownTimer -= diff;
}
//.........这里部分代码省略.........
示例8: UpdateAI
void UpdateAI(const uint32 diff) {
if (!UpdateVictim() || !CheckInRoom())
return;
if (!enraged && HealthBelowPct(30)) {
enraged = true;
events.ScheduleEvent(EVENT_FRENZY, 0); // will be cast immediately
}
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent()) {
switch (eventId) {
case EVENT_WRAP:
// TODO : Add missing text
for (uint8 i = 0; i < RAID_MODE(1, 2); ++i) {
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP)) {
pTarget->RemoveAura(
RAID_MODE(SPELL_WEB_SPRAY_10,
SPELL_WEB_SPRAY_25));
uint8 pos = rand() % MAX_POS_WRAP;
pTarget->GetMotionMaster()->MoveJump(
PosWrap[pos].GetPositionX(),
PosWrap[pos].GetPositionY(),
PosWrap[pos].GetPositionZ(), 20, 20);
if (Creature *wrap = DoSummon(MOB_WEB_WRAP, PosWrap[pos], 0, TEMPSUMMON_CORPSE_DESPAWN))
wrap->AI()->SetGUID(pTarget->GetGUID());
}
}
events.ScheduleEvent(EVENT_WRAP, 40000);
break;
case EVENT_SPRAY:
DoCastAOE(
RAID_MODE(SPELL_WEB_SPRAY_10, SPELL_WEB_SPRAY_25));
events.ScheduleEvent(EVENT_SPRAY, 40000);
break;
case EVENT_SHOCK:
DoCastAOE(
RAID_MODE(SPELL_POISON_SHOCK_10,
SPELL_POISON_SHOCK_25));
events.ScheduleEvent(EVENT_SHOCK, urand(10000, 20000));
break;
case EVENT_POISON:
DoCast(
me->getVictim(),
RAID_MODE(SPELL_NECROTIC_POISON_10,
SPELL_NECROTIC_POISON_25));
events.ScheduleEvent(EVENT_POISON, urand(10000, 20000));
break;
case EVENT_FRENZY:
DoCast(me, RAID_MODE(SPELL_FRENZY_10, SPELL_FRENZY_25),
true);
events.ScheduleEvent(EVENT_FRENZY, 600000);
break;
case EVENT_SUMMON:
// TODO : Add missing text
uint8 amount = urand(8, 10);
for (uint8 i = 0; i < amount; ++i)
DoSummon(MOB_SPIDERLING, me, 0,
TEMPSUMMON_CORPSE_DESPAWN);
events.ScheduleEvent(EVENT_SUMMON, 40000);
break;
}
}
DoMeleeAttackIfReady();
}
示例9: 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_FROZEN_ORB:
{
me->CastSpell(me, SPELL_FROZEN_ORB, CastSpellExtraArgs().AddSpellMod(SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 3)));
events.Repeat(Seconds(32));
break;
}
case EVENT_WHITEOUT:
DoCastSelf(SPELL_WHITEOUT);
events.Repeat(Seconds(38));
break;
case EVENT_FREEZING_GROUND:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
DoCast(target, SPELL_FREEZING_GROUND);
events.Repeat(Seconds(38));
break;
default:
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}
示例10: Reset
void Reset()
{
DoCast(me, RAID_MODE(SPELL_FLAME_GROUND_10, SPELL_FLAME_GROUND_25));
}
示例11: 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_JET:
Talk(EMOTE_JETS);
DoCast(me, SPELL_FLAME_JETS);
events.ScheduleEvent(EVENT_JET, urand(35000, 40000));
break;
case EVENT_SLAG_POT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
{
Talk(SAY_SLAG_POT);
_slagPotGUID = target->GetGUID();
DoCast(target, SPELL_GRAB);
events.DelayEvents(3000);
events.ScheduleEvent(EVENT_GRAB_POT, 500);
}
events.ScheduleEvent(EVENT_SLAG_POT, RAID_MODE(30000, 15000));
break;
case EVENT_GRAB_POT:
if (Unit* slagPotTarget = ObjectAccessor::GetUnit(*me, _slagPotGUID))
{
slagPotTarget->EnterVehicle(me, 0);
events.CancelEvent(EVENT_GRAB_POT);
events.ScheduleEvent(EVENT_CHANGE_POT, 1000);
}
break;
case EVENT_CHANGE_POT:
if (Unit* slagPotTarget = ObjectAccessor::GetUnit(*me, _slagPotGUID))
{
DoCast(slagPotTarget, SPELL_SLAG_POT, true);
slagPotTarget->EnterVehicle(me, 1);
events.CancelEvent(EVENT_CHANGE_POT);
events.ScheduleEvent(EVENT_END_POT, 10000);
}
break;
case EVENT_END_POT:
if (Unit* slagPotTarget = ObjectAccessor::GetUnit(*me, _slagPotGUID))
{
slagPotTarget->ExitVehicle();
slagPotTarget = NULL;
_slagPotGUID.Clear();
events.CancelEvent(EVENT_END_POT);
}
break;
case EVENT_SCORCH:
Talk(SAY_SCORCH);
if (Unit* target = me->GetVictim())
me->SummonCreature(NPC_GROUND_SCORCH, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 45000);
DoCast(SPELL_SCORCH);
events.ScheduleEvent(EVENT_SCORCH, 25000);
break;
case EVENT_CONSTRUCT:
Talk(SAY_SUMMON);
DoSummon(NPC_IRON_CONSTRUCT, ConstructSpawnPosition[urand(0, CONSTRUCT_SPAWN_POINTS - 1)], 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
DoCast(SPELL_STRENGHT);
DoCast(me, SPELL_ACTIVATE_CONSTRUCT);
events.ScheduleEvent(EVENT_CONSTRUCT, RAID_MODE(40000, 30000));
break;
case EVENT_BERSERK:
DoCast(me, SPELL_BERSERK, true);
Talk(SAY_BERSERK);
break;
}
}
DoMeleeAttackIfReady();
EnterEvadeIfOutOfCombatArea(diff);
}
示例12: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (enterHardMode)
{
SetPhaseOne();
enterHardMode = false;
}
// Handles spell casting. These spells only occur during phase 1 and hard mode
if (phase == 1 || hardMode)
{
if (uiSearingLightTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, RAID_MODE(SPELL_SEARING_LIGHT_10, SPELL_SEARING_LIGHT_25));
uiSearingLightTarget = pTarget->GetGUID();
}
uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK;
if (hardMode)
searing_light_active = true;
uiSearingLightTimer = TIMER_SEARING_LIGHT;
} else uiSearingLightTimer -= diff;
if (uiGravityBombTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, RAID_MODE(SPELL_GRAVITY_BOMB_10,SPELL_GRAVITY_BOMB_25));
uiGravityBombTarget = pTarget->GetGUID();
}
uiGravityBombTimer = TIMER_GRAVITY_BOMB;
gravity_bomb_active = true;
} else uiGravityBombTimer -= diff;
if (uiTympanicTantrumTimer <= diff)
{
DoScriptText(SAY_TYMPANIC_TANTRUM, me);
DoCast(SPELL_TYMPANIC_TANTRUM);
uiTympanicTantrumTimer = urand(TIMER_TYMPANIC_TANTRUM_MIN, TIMER_TYMPANIC_TANTRUM_MAX);
} else uiTympanicTantrumTimer -= diff;
}
if (!hardMode)
{
if (phase == 1)
{
if (HealthBelowPct(75) && heart_exposed == 0)
{
exposeHeart();
}
else if (HealthBelowPct(50) && heart_exposed == 1)
{
exposeHeart();
}
else if (HealthBelowPct(25) && heart_exposed == 2)
{
exposeHeart();
}
DoMeleeAttackIfReady();
}
else
{
//Stop moving
me->StopMoving();
//Start summoning adds
if (uiSpawnAddTimer <= diff)
{
DoScriptText(SAY_SUMMON, me);
// Spawn Pummeller
switch (rand() % 4)
{
case 0: me->SummonCreature(NPC_XM024_PUMMELLER, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
case 1: me->SummonCreature(NPC_XM024_PUMMELLER, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
case 2: me->SummonCreature(NPC_XM024_PUMMELLER, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
case 3: me->SummonCreature(NPC_XM024_PUMMELLER, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
}
// Spawn 5 Bombs
for (int8 n = 0; n < 5; n++)
{
//Some randomes are added so they wont spawn in a pile
switch(rand() % 4)
{
case 0: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(LR_X - 3, LR_X + 3)), float(irand(LR_Y - 3, LR_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
case 1: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(LL_X - 3, LL_X + 3)), float(irand(LL_Y - 3, LL_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
case 2: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(UR_X - 3, UR_X + 3)), float(irand(UR_Y - 3, UR_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
case 3: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(UL_X - 3, UL_X + 3)), float(irand(UL_Y - 3, UL_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
}
}
//Spawn 5 Scrapbots
switch (rand() % 4)
{
//.........这里部分代码省略.........
示例13: UpdateAI
void UpdateAI(uint32 diff)
{
if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING) || !phase)
return;
if (m_uiPowerTimer <= diff)
{
instance->NormaliseAltPower();
}
else m_uiPowerTimer -= diff;
if (m_berserkTimer <= diff)
{
DoCast(me, SPELL_BERSERK);
m_berserkTimer = 600000;
}
else m_berserkTimer -= diff;
if (Creature* firelord = me->FindNearestCreature(NPC_FIRE_LORD, 5.0f, true)) // Flame Lord near.
{
DoCast(me, SPELL_ABSORB_FIRE);
firelord->DespawnOrUnsummon();
}
if (Creature* shadowlord = me->FindNearestCreature(NPC_SHADOW_LORD, 5.0f, true)) // Shadow Lord near.
{
DoCast(me, SPELL_ABSORB_SHADOW);
shadowlord->DespawnOrUnsummon();
}
if (me->HealthBelowPct(26) && !phaseTwo) // Switch phase.
{
EnterPhaseTwo();
phaseTwo = true;
}
if (me->HealthBelowPct(3) && IsHeroic()&& !movedMid) // Heroic move mid before platform breaks.
{
movedMid = true;
events.CancelEvent(EVENT_FURY_OF_CHOGALL);
events.CancelEvent(EVENT_DARK_CREATIONS);
events.CancelEvent(EVENT_CORR_OLD_GOD);
events.CancelEvent(EVENT_SUMMON_TENTACLES);
me->GetMotionMaster()->MovePoint(1, -1162.254f, -798.731f, 835.844f);
}
events.Update(diff);
if (phase == PHASE_ONE) // First phase
{
std::list<Unit*> targets;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CONVERSION:
Talk(RAND(SAY_CONV_1, SAY_CONV_2, SAY_CONV_3));
SelectTargetList(targets, NonTankTargetSelector(me), RAID_MODE(1, 2, 2, 4), SELECT_TARGET_RANDOM);
if (!targets.empty())
for (std::list<Unit*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
(*itr)->CastSpell(me, SPELL_WORSHIPPING, true);
events.ScheduleEvent(EVENT_CONVERSION, urand(30000, 35000), PHASE_ONE);
break;
case EVENT_FLAME_ORDERS:
DoCast(me, SPELL_FLAME_ORDERS); // just once.
DoCast(me, SPELL_F_O_PERIODIC); // every 50 sec.
break;
case EVENT_SHADOW_ORDERS:
DoCast(me, SPELL_SHADOW_ORDERS); // just once.
DoCast(me, SPELL_S_O_PERIODIC); // every 50 sec.
break;
case EVENT_FURY_OF_CHOGALL:
DoCastVictim(SPELL_FURY_OF_CHOGALL);
events.ScheduleEvent(EVENT_FURY_OF_CHOGALL, urand(45000, 49000), PHASE_ONE);
break;
case EVENT_SUMMON_ADHERENT:
Talk(SAY_ADHERENT);
Talk(RAND(SAY_ADHER_1, SAY_ADHER_2, SAY_ADHER_3));
DoCast(me, SPELL_SUM_ADHER_SE); // Needs script.
events.ScheduleEvent(EVENT_SUMMON_ADHERENT, 90000, PHASE_ONE);
break;
case EVENT_FESTER_BLOOD:
DoCast(me, SPELL_FESTER_BLOOD); // Needs script.
events.ScheduleEvent(EVENT_FESTER_BLOOD, 130000, PHASE_ONE);
break;
}
}
}
else if (phase == PHASE_TWO) // Second phase
{
std::list<Unit*> targets;
if (uint32 eventId = events.ExecuteEvent())
{
//.........这里部分代码省略.........
示例14: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
EncounterTime += diff;
ConstructTimer += diff;
while(uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_JET:
me->MonsterTextEmote(EMOTE_JETS, 0, true);
DoCastAOE(SPELL_FLAME_JETS);
events.RescheduleEvent(EVENT_JET,urand(35000,40000));
break;
case EVENT_SLAG_POT:
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoScriptText(SAY_SLAG_POT, me);
SlagPotGUID = pTarget->GetGUID();
DoCast(pTarget, SPELL_GRAB);
events.DelayEvents(3000);
events.ScheduleEvent(EVENT_GRAB_POT, 500);
}
events.RescheduleEvent(EVENT_SLAG_POT,RAID_MODE(30000, 15000));
break;
case EVENT_GRAB_POT:
if (Unit* SlagPotTarget = Unit::GetUnit(*me, SlagPotGUID))
{
SlagPotTarget->EnterVehicle(me, 0);
events.CancelEvent(EVENT_GRAB_POT);
events.ScheduleEvent(EVENT_CHANGE_POT, 1000);
}
break;
case EVENT_CHANGE_POT:
if (Unit* SlagPotTarget = Unit::GetUnit(*me, SlagPotGUID))
{
SlagPotTarget->AddAura(SPELL_SLAG_POT, SlagPotTarget);
SlagPotTarget->EnterVehicle(me, 1);
events.CancelEvent(EVENT_CHANGE_POT);
events.ScheduleEvent(EVENT_END_POT, 10000);
}
break;
case EVENT_END_POT:
if (Unit* SlagPotTarget = Unit::GetUnit(*me, SlagPotGUID))
{
SlagPotTarget->ExitVehicle();
SlagPotTarget = NULL;
SlagPotGUID = NULL;
events.CancelEvent(EVENT_END_POT);
}
break;
case EVENT_SCORCH:
DoScriptText(RAND(SAY_SCORCH_1, SAY_SCORCH_2), me);
if (Unit *pTarget = me->getVictim())
me->SummonCreature(NPC_GROUND_SCORCH, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 45000);
DoCast(SPELL_SCORCH);
events.RescheduleEvent(EVENT_SCORCH,25000);
break;
case EVENT_CONSTRUCT:
DoScriptText(SAY_SUMMON, me);
DoSummon(NPC_IRON_CONSTRUCT, Pos[rand()%20], 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
DoCast(SPELL_STRENGHT);
DoCast(me, SPELL_ACTIVATE_CONSTRUCT);
events.RescheduleEvent(EVENT_CONSTRUCT,RAID_MODE(40000, 30000));
break;
case EVENT_BERSERK:
DoCast(me, SPELL_BERSERK, true);
DoScriptText(SAY_BERSERK, me);
break;
}
}
DoMeleeAttackIfReady();
}
示例15: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!phase)
return;
events.Update(diff);
if ((phase != PHASE_BIRTH && !UpdateVictim()) || !CheckInRoom())
return;
if (CanTheHundredClub)
{
if (CheckFrostResistTimer <= diff)
{
CheckPlayersFrostResist();
CheckFrostResistTimer = (rand() % 5 + 5) * 1000;
} else CheckFrostResistTimer -= diff;
}
if (phase == PHASE_GROUND)
{
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_BERSERK:
DoScriptText(EMOTE_ENRAGE, me);
DoCast(me, SPELL_BERSERK);
return;
case EVENT_CLEAVE:
DoCast(me->getVictim(), SPELL_CLEAVE);
events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND);
return;
case EVENT_TAIL:
DoCastAOE(SPELL_TAIL_SWEEP);
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:
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;
}
}
DoMeleeAttackIfReady();
}
else
{
if (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_LIFTOFF:
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
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;
//.........这里部分代码省略.........