The player's spellbook can be changed to Ancient Magicks at the altar inside the Jaldraocht Pyramid (simply "Pyramid" on the World Map) in the Kharidian Desert, west of Pollnivneach and north of Menaphos. There is a rear entrance (tunnel) to the south of the pyramid that allows players who have completed Desert Treasure to enter the throne room directly, where the altar resides, without having to navigate the four floors of the pyramid. At the altar, players can pray to switch to or from the Ancient Magicks spellbook, though this drains all Prayer points to zero. (Players can still switch spellbooks even with 0 Prayer points.)
http://runescape.wikia.com/wiki/Ancient_magicks