void UpdateAI(const uint32 diff)
            {
                //Return since we have no target
                if (!UpdateVictim())
                    return;

                if (Assassins_Timer)
                {
                    if (Assassins_Timer <= diff)
                    {
                        SpawnAssassin();
                        Assassins_Timer = 0;
                    }
                    else
                        Assassins_Timer -= diff;
                }

                if (InBlade)
                {
                    if (Wait_Timer)
                    {
                        if (Wait_Timer <= diff)
                        {
                            if (target_num <= 0)
                            {
                                // stop bladedance
                                InBlade = false;
                                me->SetSpeed(MOVE_RUN, 2);
                                me->GetMotionMaster()->MoveChase(me->getVictim());
                                Blade_Dance_Timer = 30000;
                                Wait_Timer = 0;
                                if (IsHeroic())
                                    Charge_timer = 5000;
                            }
                            else
                            {
                                //move in bladedance
                                float x, y, randx, randy;
                                randx = 0.0f + rand()%40;
                                randy = 0.0f + rand()%40;
                                x = 210+ randx ;
                                y = -60- randy ;
                                me->GetMotionMaster()->MovePoint(1, x, y, me->GetPositionZ());
                                Wait_Timer = 0;
                            }
                        }
                        else
                            Wait_Timer -= diff;
                    }
                }
                else
                {
                    if (Blade_Dance_Timer)
                    {
                        if (Blade_Dance_Timer <= diff)
                        {
                            target_num = TARGET_NUM;
                            Wait_Timer = 1;
                            InBlade = true;
                            Blade_Dance_Timer = 0;
                            me->SetSpeed(MOVE_RUN, 4);
                            return;
                        }
                        else
                            Blade_Dance_Timer -= diff;
                    }

                    if (Charge_timer)
                    {
                        if (Charge_timer <= diff)
                        {
                            DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), H_SPELL_CHARGE);
                            Charge_timer = 0;
                        }
                        else
                            Charge_timer -= diff;
                    }

                    if (Summon_Assistant_Timer <= diff)
                    {
                        for (uint8 i = 0; i < summoned; ++i)
                        {
                            switch (urand(0, 2))
                            {
                                case 0:
                                    me->SummonCreature(MOB_HEARTHEN_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
                                    break;
                                case 1:
                                    me->SummonCreature(MOB_SHARPSHOOTER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
                                    break;
                                case 2:
                                    me->SummonCreature(MOB_REAVER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
                                    break;
                            }
                        }
                        if (urand(0, 9) < 2)
                            ++summoned;
                        Summon_Assistant_Timer = urand(25000, 35000);
                    }
                    else
                        Summon_Assistant_Timer -= diff;

                    DoMeleeAttackIfReady();
                }

                if (resetcheck_timer <= diff)
                {
                    uint32 tempx, tempy;
                    tempx = uint32(me->GetPositionX());
                    tempy = uint32(me->GetPositionY());
                    if (tempx > 255 || tempx < 205)
                    {
                        EnterEvadeMode();
                        return;
                    }
                    resetcheck_timer = 5000;
                }
                else
                    resetcheck_timer -= diff;
            }
    void UpdateAI(const uint32 diff)
    {
        if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
            return;

        if (Assassins_Timer)
            if (Assassins_Timer < diff)
            {
                SpawnAssassin();
                Assassins_Timer = 0;
            }else Assassins_Timer -= diff;

        if (InBlade)
        {
            if (Wait_Timer)
                if (Wait_Timer < diff)
                {
                    if (target_num <= 0)
                    {
                        // stop bladedance
                        InBlade = false;
                        m_creature->SetSpeed(MOVE_RUN,2);
                        (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim());
                        Blade_Dance_Timer = 30000;
                        Wait_Timer = 0;
                        if (m_bIsHeroicMode)
                            Charge_timer = 5000;
                    }
                    else
                    {
                        //move in bladedance
                        float x,y,randx,randy;
                        randx = (rand()%40);
                        randy = (rand()%40);
                        x = 210+ randx ;
                        y = -60- randy ;
                        (*m_creature).GetMotionMaster()->MovePoint(1,x,y,m_creature->GetPositionZ());
                        Wait_Timer = 0;
                    }
                }else Wait_Timer -= diff;
        }
        else
        {
            if (Blade_Dance_Timer)
                if (Blade_Dance_Timer < diff)
                {
                    target_num = TARGET_NUM;
                    Wait_Timer = 1;
                    InBlade = true;
                    Blade_Dance_Timer = 0;
                    m_creature->SetSpeed(MOVE_RUN,4);
                    return;
                }else Blade_Dance_Timer -= diff;

            if (Charge_timer)
                if (Charge_timer < diff)
                {
                    DoCast(SelectUnit(SELECT_TARGET_RANDOM,0),H_SPELL_CHARGE);
                    Charge_timer = 0;
                }else Charge_timer -= diff;

            if (Summon_Assistant_Timer < diff)
            {
                Unit* target = NULL;

                for(int i = 0; i < summoned; i++)
                {
                    switch(rand()%3)
                    {
                        case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break;
                        case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break;
                        case 2: m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break;
                    }
                }
                if (rand()%100 < 20) summoned++;
                    Summon_Assistant_Timer = 25000 + (rand()%10000) ;
            }else Summon_Assistant_Timer -= diff;

            DoMeleeAttackIfReady();
        }

        if (resetcheck_timer < diff)
        {
            uint32 tempx,tempy;
            tempx = uint32(m_creature->GetPositionX());
            tempy = uint32(m_creature->GetPositionY());
            if (tempx > 255 || tempx < 205)
            {
                EnterEvadeMode();
            }
            resetcheck_timer = 5000;
        }else resetcheck_timer -= diff;
    }
    void UpdateAI(const uint32 uiDiff)
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        // Check if out of range
        if (EnterEvadeIfOutOfCombatArea(uiDiff))
        {
            DoScriptText(SAY_EVADE, m_creature);
            return;
        }

        if (m_uiAssassinsTimer)
        {
            if (m_uiAssassinsTimer <= uiDiff)
            {
                SpawnAssassin();
                m_uiAssassinsTimer = 0;
            }
            else
                m_uiAssassinsTimer -= uiDiff;
        }

        if (m_bInBlade)
        {
            if (m_uiWaitTimer)
            {
                if (m_uiWaitTimer <= uiDiff)
                {
                    if (m_uiTargetNum == 0)
                    {
                        // stop bladedance
                        m_bInBlade = false;
                        m_creature->SetSpeedRate(MOVE_RUN, 2.0f);
                        m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
                        m_uiWaitTimer = 0;
                        if (!m_bIsRegularMode)
                            m_uiChargeTimer = 5000;
                    }
                    else
                    {
                        // move in bladedance
                        float x, y, randx, randy;
                        randx = (rand()%40);
                        randy = (rand()%40);
                        x = 210+ randx ;
                        y = -60- randy ;
                        m_creature->GetMotionMaster()->MovePoint(1, x, y, m_creature->GetPositionZ());
                        m_uiWaitTimer = 0;
                    }
                }
                else
                    m_uiWaitTimer -= uiDiff;
            }
        }
        else                                                // !m_bInBlade
        {
            if (m_uiBladeDanceTimer < uiDiff)
            {
                m_uiTargetNum = TARGET_NUM;
                m_uiWaitTimer = 1;
                m_bInBlade = true;
                m_uiBladeDanceTimer = 30000;
                m_creature->SetSpeedRate(MOVE_RUN, 4.0f);
                return;
            }
            else
                m_uiBladeDanceTimer -= uiDiff;

            if (m_uiChargeTimer)
            {
                if (m_uiChargeTimer <= uiDiff)
                {
                    if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                        DoCastSpellIfCan(pTarget, SPELL_CHARGE_H);

                    m_uiChargeTimer = 0;
                }
                else
                    m_uiChargeTimer -= uiDiff;
            }

            if (m_uiSummonAssistantTimer < uiDiff)
            {
                for (uint32 i = 0; i < m_uiSummoned; ++i)
                {
                    switch (urand(0, 2))
                    {
                        case 0: m_creature->SummonCreature(NPC_HEARTHEN_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); break;
                        case 1: m_creature->SummonCreature(NPC_SHARPSHOOTER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); break;
                        case 2: m_creature->SummonCreature(NPC_REAVER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); break;
                    }
                }

                if (!urand(0, 4))
                    ++m_uiSummoned;

                m_uiSummonAssistantTimer = urand(25000, 35000);
            }
            else
                m_uiSummonAssistantTimer -= uiDiff;

            DoMeleeAttackIfReady();
        }
    }