Instructions
Give Jasmine a Secret Potion to heal her Pokemon. You can find Jasmine at Olivine City's Lighthouse. Once you leave the Lighthouse, Boaba will call you. He will ask you to visit the newly opened Safari Zone. Use Fly to go to Cianwood City. Head left or west of the city, and you should come across the Safari Zone.
Enter the Safari Zone and pay your admittance fee. The man will give you 30 Safari Balls that you will use to capture any Pokemon in the park. Your time at the Safari Zone will end once you use up all your steps or all 30 Safari Balls.
Go to the Meadow area of the Safari Zone. Walk around in the long grass until a Pokemon comes up. If it's not a Riolu, choose the option "Run" to avoid wasting your time. Every Riolu that you encounter will be level 45.
Throw a balanced amount of mud and bait at the Riolu. Using mud will weaken the Riolu, but may make the Riolu flee. The bait will make the Riolu stay longer, but will also make the Riolu harder to catch. Use the Safari Balls on Riolu after weakening it considerably.