Пример #1
0
        void UpdateFollowerAI(const uint32 uiDiff)
        {
            if (!UpdateVictim())
            {
                if (HasFollowState(STATE_FOLLOW_POSTEVENT))
                {
                    if (m_uiEndEventTimer <= uiDiff)
                    {
                        Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID);
                        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 -= uiDiff;
                }
                else if (HasFollowState(STATE_FOLLOW_INPROGRESS))
                {
                    if (!HasFollowState(STATE_FOLLOW_PAUSED))
                    {
                        if (m_uiFaintTimer <= uiDiff)
                        {
                            SetFaint();
                            m_uiFaintTimer = urand(60000, 120000);
                        }
                        else
                            m_uiFaintTimer -= uiDiff;
                    }
                }

                return;
            }

            DoMeleeAttackIfReady();
        }
Пример #2
0
        void UpdateFollowerAI(uint32 Diff) override
        {
            if (!UpdateVictim())
            {
                if (HasFollowState(STATE_FOLLOW_POSTEVENT))
                {
                    if (EndEventTimer <= Diff)
                    {
                        Creature* spraggle = ObjectAccessor::GetCreature(*me, SpraggleGUID);
                        if (!spraggle || !spraggle->IsAlive())
                        {
                            SetFollowComplete();
                            return;
                        }

                        switch (EndEventProgress)
                        {
                            case 1:
                                Talk(SAY_RIN_END_1);
                                EndEventTimer = 3000;
                                break;
                            case 2:
                                spraggle->AI()->Talk(SAY_SPR_END_2);
                                EndEventTimer = 5000;
                                break;
                            case 3:
                                Talk(SAY_RIN_END_3);
                                EndEventTimer = 1000;
                                break;
                            case 4:
                                Talk(EMOTE_RIN_END_4);
                                SetFaint();
                                EndEventTimer = 9000;
                                break;
                            case 5:
                                Talk(EMOTE_RIN_END_5);
                                ClearFaint();
                                EndEventTimer = 1000;
                                break;
                            case 6:
                                Talk(SAY_RIN_END_6);
                                EndEventTimer = 3000;
                                break;
                            case 7:
                                spraggle->AI()->Talk(SAY_SPR_END_7);
                                EndEventTimer = 10000;
                                break;
                            case 8:
                                Talk(EMOTE_RIN_END_8);
                                EndEventTimer = 5000;
                                break;
                            case 9:
                                SetFollowComplete();
                                break;
                        }

                        ++EndEventProgress;
                    }
                    else
                        EndEventTimer -= Diff;
                }
                else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED))
                {
                    if (FaintTimer <= Diff)
                    {
                        SetFaint();
                        FaintTimer = urand(60000, 120000);
                    }
                    else
                        FaintTimer -= Diff;
                }

                return;
            }

            DoMeleeAttackIfReady();
        }