This spell was designed to create temporary residences, but has been also used for hiding treasure and creating deadly abushes.
Initially, the spell is a full-round action. The caster mentally decides where he wants to form the grotto, and the spell begins searching the area. If the spell discovers only rock, metal or crystal, the spell creates an interdimensional space and places all of the stone into it, then replaces it with fresh air gated in from the Elemental Plane of Air (there is a 2% chance that a small 2HD elemental is sucked in with the air). This spell can never cause a cave-in or other collapse. The surrounding rock behaves as if the removed rock is still there, supporting it.
However, if the spell area contains anything other than rock, metal or crystal (such as an air pocket), and the obstruction is more than one cubic foot, the spell will inform the caster of the obstruction. The caster may then mentally reconfigure his cubes to avoid the obstruction and the spell will search again on the second round. If it finds another obstruction, the spell will go on into the third round, and so on. If an obstruction is found on the sixth round, the spell just gives up and ends.
Note that if a bag of holding or other similar object happens to get caught in the initial area of effect, it will cause destruction similar to putting a bag of holding inside a portable hole and ruin the spell.
At the end of the spell, everything returns to normal. This may be bad news for anyone still inside. Those within five feet of an exit may make a reflex save to dive out of harm's way. If this fails, or the subject is too far away, he may make a spell resistance roll and will save to avoid being sucked into the Elemental Plane of Air along with all the fresh air. Unattended objects, constructs and undead are other non-living things are immune to this effect. The final effect allows no save as the removed stone appears back in its old place. Objects and people still inside are not harmed. They are perfectly preserved, though they'll likely die of oxygen deprivation within two minutes. The rock that would have appeared in a location inhabited by a person or thing is instead shunted off to the Elemental Plane of Earth.
Material Component: A lump of clay. When the spell is cast, it begins glowing red. As the duration of the spell progresses, it slowly shifts through each color of the rainbow, finally becoming a deep purple about a half-hour before the spell ends. When the spell ends, the lump melts away into nothing. If the lump is split into multiple pieces, or if it is taken more than 100 feet from any portion of the grotto, it immediately melts away and the spell suddenly ends.