The trap building rules in D&d have a glitch (or feature) which enable the crafting of the "wish trap."
What things would you wish for if you could wish once per round?
In 3.5 you can build a spell into a trap by paying 50x it's material and XP cost. For a wish this would be extraordinarily expensive, but once it's done you get more then 50 wishes out of it so it breaks even.
You can further cut costs by using things like liquid pain and ritual sacrifice to generate arbitrarily high amounts of 'virtual' gold and xp that can only be spent on crafted items, at the cost of making them slightly evil.
Once it's done you just set your 'trap' to be 'set off' by say pulling a lever and then BAM! Pull lever, receive Wish. Repeat a few dozen times to make a boat load of cash. Teleport anywhere. Change reality. A lot you can do with that kind of power.