In the Underground Palace the doors are locked with a pillar puzzles. To open a gate all the pillars in a room must be place on the nearby switches. If Merlin makes a mistake they can be reset with the Dwarven Key.
5UUL, 6LLLUL, 4RRRUU, 3U, 2LL, 1DDD, walk around to the other side of the pillar, 1RRRRU, 3DDDD, walk around, 3LLLU, 2RRRRRDDDD, walk around, 2LLLU.
5RRR, 3D, 2DD, 4L, 1DD, 4L, walk around, 4RRR
1RRR, 2UR, 4LLLLLLU, 3DLLLL, walk around, 3RRR, 4DRRR, 1D, 2D