A good inspector will be able to give you a pretty good idea if the basement has flooded. Some states require that the seller disclose information like that if they know about it. But I revert back to an inspector with experience, they are your best option.
If you are hoping to buy a house, you likely have a budget in mind. Hopefully, that budget includes fees that come with the process, not just the purchase price. The good news for buyers is that they aren't directly responsible for paying their agent. Agent fees usually fall on the seller.