void AIUpdate()
   {
		if( Ogre == NULL )
			return;
      if( GetRange( Ogre ) <= 5 )
      {
         Ogre->SetDisplayWeaponIds( 28562, 0);
         Ogre->GetUnit()->SetUInt32Value( UNIT_NPC_EMOTESTATE, 92 );
         Ogre->GetUnit()->SetUInt32Value( UNIT_FIELD_FACTIONTEMPLATE, 35 );		 
         Ogre->GetUnit()->SetStandState( STANDSTATE_SIT );
         Ogre->GetUnit()->_setFaction();
		 GameObject *GO = GetNearestGameObject(184315);
		 if( GO )
			GO->Despawn(0);
         Ogre->Despawn(60*1000, 3*60*1000);
         QuestLogEntry * qle = NULL;
		 if( plr )
			qle = plr->GetQuestLogForEntry( 10512 );

         if( qle!=NULL && qle->GetMobCount( 0 ) < qle->GetQuest()->required_mobcount[0] )
         {
            qle->SetMobCount( 0, qle->GetMobCount( 0 )+1);
            qle->SendUpdateAddKill( 0 );
            qle->UpdatePlayerFields();
         }
		 Despawn(0, 0);
      }	  
      ParentClass::AIUpdate();
   }
		void AIUpdate()
		{
			if(Ogre == NULL)
				return;
			if(GetRange(Ogre) <= 5)
			{
				Ogre->SetDisplayWeaponIds(28562, 0);
				Ogre->GetUnit()->SetEmoteState(92);
				Ogre->GetUnit()->SetFaction(35);
				Ogre->GetUnit()->SetStandState(STANDSTATE_SIT);
				NdGo = GetNearestGameObject(184315);
				if(NdGo == NULL)
					return;
				NdGo->Despawn(0, 0);
				Ogre->Despawn(60 * 1000, 3 * 60 * 1000);
				if(plr == NULL)
					return;
				QuestLogEntry* qle = plr->GetQuestLogForEntry(10512);

				if(qle != NULL && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
				{
					qle->SetMobCount(0, qle->GetMobCount(0) + 1);
					qle->SendUpdateAddKill(0);
					qle->UpdatePlayerFields();
				}
				Despawn(0, 0);
				return;
			}
			ParentClass::AIUpdate();
		}
	void OnDied(Unit* pKiller)
	{
		GameObject* Doors = GetNearestGameObject(192395);
		if( Doors != NULL )
			Doors->Despawn(0);

		ParentClass::OnDied(pKiller);
	};
    void StartEscort(Player* pPlayer)
    {
        GameObject* pGO = GetNearestGameObject();
        if (pGO)
            pGO->SetState(pGO->GetState() == 1 ? 0 : 1);

        _unit->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
        SetMoveType(Move_ForwardThenStop);
    }
    void StartEscort(Player* pPlayer)
    {
        GameObject* pGO = GetNearestGameObject();
        if (pGO)
            pGO->SetState(pGO->GetState() == 1 ? 0 : 1);

        _unit->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
        SetWaypointMoveType(Movement::WP_MOVEMENT_SCRIPT_FORWARDTHENSTOP);
    }
        void OnDied(Unit* mKiller)
        {
            _unit->SendScriptTextChatMessage(7375);     // Now I'm really angry.

            GameObject* door2 = NULL;
            door2 = GetNearestGameObject(184319);
            if (door2 != NULL)
                door2->SetState(GAMEOBJECT_STATE_OPEN);

            ParentClass::OnDied(mKiller);
        }