void UpdateAI(const uint32 uiDiff) { if (uiPhase) { if (uiTimer <= uiDiff) { switch (uiPhase) { case 1: if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true)) DoScriptText(SAY_GUARD_2, pGuard); uiTimer = 3000; uiPhase = 2; break; case 2: DoGuardsDisappearAndDie(); uiTimer = 2000; uiPhase = 3; break; case 3: SetEscortPaused(false); uiTimer = 0; uiPhase = 0; break; case 4: DoScriptText(SAY_LESCOVAR_3, me); uiTimer = 0; uiPhase = 0; break; case 5: if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) DoScriptText(SAY_MARZON_1, pMarzon); uiTimer = 3000; uiPhase = 6; break; case 6: DoScriptText(SAY_LESCOVAR_4, me); if (Player* player = GetPlayerForEscort()) player->AreaExploredOrEventHappens(QUEST_THE_ATTACK); uiTimer = 2000; uiPhase = 7; break; case 7: if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true)) DoScriptText(SAY_TYRION_2, pTyrion); if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) pMarzon->setFaction(14); me->setFaction(14); uiTimer = 0; uiPhase = 0; break; } } else uiTimer -= uiDiff; } npc_escortAI::UpdateAI(uiDiff); if (!UpdateVictim()) return; DoMeleeAttackIfReady(); }
void UpdateAI(uint32 uiDiff) { if (uiPhase) { if (uiTimer <= uiDiff) { switch (uiPhase) { case 1: if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true)) pGuard->AI()->Talk(SAY_GUARD_2); uiTimer = 3000; uiPhase = 2; break; case 2: DoGuardsDisappearAndDie(); uiTimer = 2000; uiPhase = 3; break; case 3: SetEscortPaused(false); uiTimer = 0; uiPhase = 0; break; case 4: Talk(SAY_LESCOVAR_3); uiTimer = 0; uiPhase = 0; break; case 5: if (Creature* pMarzon = ObjectAccessor::GetCreature(*me, MarzonGUID)) pMarzon->AI()->Talk(SAY_MARZON_1); uiTimer = 3000; uiPhase = 6; break; case 6: Talk(SAY_LESCOVAR_4); if (Player* player = GetPlayerForEscort()) player->GroupEventHappens(QUEST_THE_ATTACK, me); uiTimer = 2000; uiPhase = 7; break; case 7: if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true)) pTyrion->AI()->Talk(SAY_TYRION_2); if (Creature* pMarzon = ObjectAccessor::GetCreature(*me, MarzonGUID)) pMarzon->setFaction(14); me->setFaction(14); uiTimer = 0; uiPhase = 0; break; } } else uiTimer -= uiDiff; } npc_escortAI::UpdateAI(uiDiff); if (!UpdateVictim()) return; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (Phase) { if (Timer <= diff) { switch (Phase) { case 1: if (Creature* guard = me->FindCreatureWithDistance(NPC_STORMWIND_ROYAL, 8.0f, true)) DoSendQuantumText(SAY_GUARD_2, guard); Timer = 3000; Phase = 2; break; case 2: DoGuardsDisappearAndDie(); Timer = 2000; Phase = 3; break; case 3: SetEscortPaused(false); Timer = 0; Phase = 0; break; case 4: DoSendQuantumText(SAY_LESCOVAR_3, me); Timer = 0; Phase = 0; break; case 5: if (Creature* Marzon = Unit::GetCreature(*me, MarzonGUID)) DoSendQuantumText(SAY_MARZON_1, Marzon); Timer = 3000; Phase = 6; break; case 6: DoSendQuantumText(SAY_LESCOVAR_4, me); if (Player* player = GetPlayerForEscort()) player->AreaExploredOrEventHappens(QUEST_THE_ATTACK); Timer = 2000; Phase = 7; break; case 7: if (Creature* Tyrion = me->FindCreatureWithDistance(NPC_TYRION, 20.0f, true)) DoSendQuantumText(SAY_TYRION_2, Tyrion); if (Creature* Marzon = Unit::GetCreature(*me, MarzonGUID)) Marzon->SetCurrentFaction(16); me->SetCurrentFaction(16); Timer = 0; Phase = 0; break; } } else Timer -= diff; } npc_escortAI::UpdateAI(diff); if (!UpdateVictim()) return; DoMeleeAttackIfReady(); }