They were intimate friends(like Chandragupta Maurya and Chanakya), so much that after the death of Ramayyan the Maharajah went into depression and started losing health himself till he died in 1758.