Epic Games will pay $520m to settle claims it violated laws and also tricked users into making purchases.