void UpdateFollowerAI(const uint32 diff) { if (!CanDoSomething()) { if (HasFollowState(STATE_FOLLOW_POSTEVENT)) { if (m_uiEndEventTimer < diff) { if (!pSpraggle || !pSpraggle->isAlive()) { SetFollowComplete(); return; } switch(m_uiEndEventProgress) { case 1: DoScriptText(SAY_RIN_END_1, me); m_uiEndEventTimer = 3000; break; case 2: DoScriptText(SAY_SPR_END_2, pSpraggle); m_uiEndEventTimer = 5000; break; case 3: DoScriptText(SAY_RIN_END_3, me); m_uiEndEventTimer = 1000; break; case 4: DoScriptText(EMOTE_RIN_END_4, me); SetFaint(); m_uiEndEventTimer = 9000; break; case 5: DoScriptText(EMOTE_RIN_END_5, me); ClearFaint(); m_uiEndEventTimer = 1000; break; case 6: DoScriptText(SAY_RIN_END_6, me); m_uiEndEventTimer = 3000; break; case 7: DoScriptText(SAY_SPR_END_7, pSpraggle); m_uiEndEventTimer = 10000; break; case 8: DoScriptText(EMOTE_RIN_END_8, me); m_uiEndEventTimer = 5000; break; case 9: SetFollowComplete(); break; } ++m_uiEndEventProgress; } else m_uiEndEventTimer -= diff; } else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { if (!HasFollowState(STATE_FOLLOW_PAUSED)) { if (m_uiFaintTimer < diff) { SetFaint(); m_uiFaintTimer = urand(60000, 120000); } else m_uiFaintTimer -= diff; } } return; } DoMeleeAttackIfReady(); }
void UpdateFollowerAI(uint32 Diff) { if (!UpdateVictim()) { //we are doing the post-event, or... if (HasFollowState(STATE_FOLLOW_POSTEVENT)) { if (PostEventTimer <= Diff) { PostEventTimer = 5000; Creature* torta = ObjectAccessor::GetCreature(*me, TortaGUID); if (!torta || !torta->IsAlive()) { //something happened, so just complete SetFollowComplete(); return; } switch (PhasePostEvent) { case 1: Talk(SAY_TOOG_POST_1); break; case 2: torta->AI()->Talk(SAY_TORT_POST_2); break; case 3: Talk(SAY_TOOG_POST_3); break; case 4: torta->AI()->Talk(SAY_TORT_POST_4); break; case 5: Talk(SAY_TOOG_POST_5); break; case 6: torta->AI()->Talk(SAY_TORT_POST_6); me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc); break; } ++PhasePostEvent; } else PostEventTimer -= Diff; } //...we are doing regular speech check else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { if (CheckSpeechTimer <= Diff) { CheckSpeechTimer = 5000; if (urand(0, 9) > 8) Talk(SAY_TOOG_WORRIED); } else CheckSpeechTimer -= Diff; } return; } DoMeleeAttackIfReady(); }
void UpdateFollowerAI(const uint32 uiDiff) { if (!UpdateVictim()) { //we are doing the post-event, or... if (HasFollowState(STATE_FOLLOW_POSTEVENT)) { if (m_uiPostEventTimer <= uiDiff) { m_uiPostEventTimer = 5000; Unit* pTorta = Unit::GetUnit(*me, TortaGUID); if (!pTorta || !pTorta->isAlive()) { //something happened, so just complete SetFollowComplete(); return; } switch (m_uiPhasePostEvent) { case 1: DoScriptText(SAY_TOOG_POST_1, me); break; case 2: DoScriptText(SAY_TORT_POST_2, pTorta); break; case 3: DoScriptText(SAY_TOOG_POST_3, me); break; case 4: DoScriptText(SAY_TORT_POST_4, pTorta); break; case 5: DoScriptText(SAY_TOOG_POST_5, me); break; case 6: DoScriptText(SAY_TORT_POST_6, pTorta); me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]); break; } ++m_uiPhasePostEvent; } else m_uiPostEventTimer -= uiDiff; } //...we are doing regular speech check else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { if (m_uiCheckSpeechTimer <= uiDiff) { m_uiCheckSpeechTimer = 5000; if (urand(0, 9) > 8) DoScriptText(RAND(SAY_TOOG_THIRST, SAY_TOOG_WORRIED), me); } else m_uiCheckSpeechTimer -= uiDiff; } return; } DoMeleeAttackIfReady(); }