After obtaining the Blue Orb from Mt. Pyre and battling Grunts in Slateport, you follow Team Magma to their hideout in Lilycove City.
Team Magma Hideout 1F
Go north from the entrance of the hideout and go through the door.
Go north, then east. Step on the green tile to be warped to a small room where you can get a Nugget. Step on the green tile to exit this room.
Go northwest and step on the tile there to go to another room. In this room, there are two Grunts that you can battle. Both of them have a level 35 Numel and a level 35 Koffing.
Step on the southeast tile in this room to go to a room with beds. You can rest in the beds to heal your pokémon. Go east in that same room to get a Full Restore. Then step on the warp tile to leave this room.
Use the stairs in the northeast to go to the basement.
Team Magma Hideout B1F
Go south to find an Escape Rope.
Go east and you must battle a Grunt. She has a level 37 Mightyena.
Go northeast into the meteorite lab. Step on the northeast warp tile, then walk down the hallway and step on the warp tile there. Go southeast to find TM97 Dark Pulse.
Step on the warp tile to leave this area, then walk down the hallway and step on the warp tile there. Then go to the northwest corner of the meteorite lab and step on the tile there.
You will be in the library. Go east to find a Max Elixir. Then step on the warp tile again to leave the library.
Go southeast to find another warp tile. Step on it, then go northwest into another lab. Go to the northeast corner of this lab to find a Nest Ball.
Step on the southeast warp tile in this lab to reach another area. Step on the next warp tile, then go south to find a PP Max, then go north and step on the warp tile again. Use the next warp tile to return to the lab.
From the lab, go south and then west. You can battle a Team Magma Grunt who has a level 37 Golbat.
Go north from that Grunt and step on the warp tile to go to another room. In that room, you can battle a Grunt to the west who has a level 34 Mightyena and a level 36 Golbat.
There is a Master Ball that you can get now. It always successfully catches the wild pokémon that you throw it at, making it useful for legendary pokémon that are hard to catch. If you don't get it now, you won't be able to get it anymore after you defeat the Team Magma Admin in the hideout later!
Team Magma Hideout B2F
If you want the Master Ball, go south from that Grunt and step on the warp tile to reach a room with many warp tiles. First, step on the left or right warp tile to go to the next row. Then step on the middle warp tile to go to the next row. Then step on the warp tile on the right to go to the next row. Finally, go around the middle tile and step on the far right one to go to the next area.
Go northwest to find four items. The bottom left and top right items are actually Electrodes. You can battle these pokémon and catch them, or just knock them out. The bottom right item is a Nugget, and the top left item is a Master Ball.
Go back and step on the warp tile to leave this room. You will be back in the room with many warp tiles. First, step on the middle warp tile, then step on the left or right warp tile. You should be at the top of the room. Step on the northernmost warp tile to leave this room.
Go north and west. Step on the warp tile there to go to another area.
Team Magma Hideout B4F
Go northwest to battle a Grunt who has a level 37 Numel.
Then go west and you will have to have a horde battle with five Grunts at once. They each have a level 18 Poochyena.
Go southwest to find a Max Revive.
Then go north to battle Team Magma Admin Courtney. She has a level 39 Camerupt.
Go north and then east, and step on the warp tile. Then go south and use Surf to leave the hideout.
Now that you have defeated Courtney, you can Surf east from Lilycove City to reach Route 124.