Either way the treasure had to have been discovered in order for the plot to progress. It was inevitable that the main character would come across it. The fact that the friend had it all along was just good luck... at least that's what I'd like to think.