From Glitch City Laboratories
Nightmare glitch is a glitch that only exists in Pokémon Ruby and Sapphire versions. It has been fixed in FireRed and LeafGreen versions, probably because because the move Nightmare is inaccessible without trading or the Battle Tower. If a sleeping Pokémon under Nightmare effects has his sleep status cured by the ability Shed Skin, the Nightmare effects will remain until the Pokémon faints or is switched out.
- A Pokémon knowing Nightmare.
- A sleep-inducing move (preferably in same Pokémon with the move Nightmare).
- An enemy with the ability Shed Skin.
- Enter a battle against a Pokémon with the ability Shed Skin (like the Silcoon/Cascoon in Petalburg Woods).
- Put the Pokémon to sleep, and use Nightmare.
- Repeat the previous process until the Pokémon is awakened by Shed Skin under Nightmare effects.
It is still unknown what happens if this glitch is tried to be triggered in a Link Battle between Ruby/Sapphire and another, newer Generation III game.