sentences:  The castle was rebuilt and repaired many times.In the times of Khmelnytsky Uprising it was taken by Cossack forces of Colonel Maksym Kryvonis in October 1648.In 1704, when Lviv was occupied by Swedes the castle was heavily damaged.