Complex sentence: Nip Ying ultimately went berserk and became a menace to the "jianghu", and when he regained his senses, he imprisoned himself inside Lingyun Cave and eventually died there before a cure was found for him.
Split into simpler sentences: Nip Ying ultimately went berserk and became a menace to the "jianghu". When he regained his senses, he confined himself in Lingyun Cave and died there before a cure was found for him.