void UpdateAI(uint32 diff) override
        {
            events.Update(diff);
            while (uint32 eventId = events.ExecuteEvent())
            {
                switch(eventId)
                {
                case EVENT_START: //Begin script if playersInvolved is not empty
                {
                    updatePlayerList();
                    if (playersInvolved.empty())
                        events.ScheduleEvent(1, 600);
                    else
                    {
                        me->MonsterSay("Keep those creatures at bay while I meditate. We'll soon have the answers we seek...", LANG_UNIVERSAL, 0);
                        me->SetReactState(REACT_PASSIVE);
                        timer = 0;
                        events.ScheduleEvent(EVENT_SPAWN_MOBS, 5000); //spawn mobs
                        events.ScheduleEvent(EVENT_PROGRESS, 1000); //update time
                        events.ScheduleEvent(EVENT_END, 90000); //end quest
                    }
                    break;
                }
                case EVENT_SPAWN_MOBS: //Spawn 3 mobs
                {
                    updatePlayerList();
                    for(int i = 0; i < std::max((int)playersInvolved.size()*3,3); i++)
                    {
                        if (TempSummon* temp = me->SummonCreature(59637, 1144.55f, 3435.65f, 104.97f, 3.3f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000))
                        {
                            if (temp->AI())
                                temp->AI()->AttackStart(me);

                            temp->AddThreat(me, 250.0f);
                            temp->GetMotionMaster()->Clear();
                            temp->GetMotionMaster()->MoveChase(me);
                        }
                    }
                    events.ScheduleEvent(EVENT_SPAWN_MOBS, 20000); //spawn mobs
                    break;
                }
                case EVENT_PROGRESS: //update energy
                {
                    timer++;

                    if (timer == 25 && !lifei)
                    {
                        if (lifei = me->SummonCreature(54856, 1130.162231f, 3435.905518f, 105.496597f, 0.0f,TEMPSUMMON_MANUAL_DESPAWN))
                            lifei->MonsterSay("The way of the Tushui... enlightenment through patience and mediation... the principled life", LANG_UNIVERSAL, 0);
                    }

                    if (timer == 30)
                        if (lifei)
                            lifei->MonsterSay("It is good to see you again, Aysa. You've come with respect, and so I shall give you the answers you seek.", LANG_UNIVERSAL, 0);

                    if (timer == 42)
                        if (lifei)
                            lifei->MonsterSay("Huo, the spirit of fire, is known for his hunger. He wants for tinder to eat. He needs the caress of the wind to rouse him.", LANG_UNIVERSAL, 0);

                    if (timer == 54)
                        if (lifei)
                            lifei->MonsterSay("If you find these things and bring them to his cave, on the far side of Wu-Song Village, you will face a challenge within.", LANG_UNIVERSAL, 0);

                    if (timer == 66)
                        if (lifei)
                            lifei->MonsterSay("Overcome that challenge, and you shall be graced by Huo's presence. Rekindle his flame, and if your spirit is pure, he shall follow you.", LANG_UNIVERSAL, 0);

                    if (timer == 78)
                        if (lifei)
                            lifei->MonsterSay("Go, children. We shall meet again very soon.", LANG_UNIVERSAL, 0);

                    if (timer == 85)
                    {
                        if (lifei)
                            lifei->UnSummon();

                        lifei = NULL;
                    }

                    updatePlayerList();
                    for (auto player: playersInvolved)
                    {
                        if (!player->HasAura(116421))
                            player->CastSpell(player, 116421);

                        player->ModifyPower(POWER_ALTERNATE_POWER, timer/25);
                        player->SetMaxPower(POWER_ALTERNATE_POWER, 90);
                    }

                    events.ScheduleEvent(EVENT_PROGRESS, 1000);
                    break;
                }
                case EVENT_END: //script end
                {
                    if (lifei)
                    {
                        lifei->UnSummon();
                        lifei = NULL;
                    }
                    events.ScheduleEvent(EVENT_START, 10000);
                    events.CancelEvent(EVENT_SPAWN_MOBS);
                    events.CancelEvent(EVENT_PROGRESS);
                    me->MonsterSay("And so our path lays before us. Speak to Master Shang Xi, he will tell you what comes next.", LANG_UNIVERSAL, 0);
                    updatePlayerList();
                    me->SetReactState(REACT_DEFENSIVE);
                    for(auto player: playersInvolved)
                    {
                        player->KilledMonsterCredit(54856, 0);
                        player->RemoveAura(116421);
                    }
                    break;
                }
                }
            }
        }