Mage's Evasion

Evocation
Level: Sorcerer */Wizard * 9
Components: V, S, M, (quicksilver, and an eyelash from the caster), F (silver statuette of the caster worth 5,000 gp)
Casting Time: at least 10 minutes; see text
Range: personal
Target: you
Duration: 1day/level or until discharged
Saving Throw: -
Spell Resistance: -
  This powerful variant of the contingency spell transfers you and everything you carry (except for other creatures or objects that weigh more than 50 pounds) to a destination you designate at the time of casting. When casting mage's Evasion, you must specify the locale and detail up to six specific conditions that trigger this spell. When any of these conditions occurs, your body, mind, and soul are transported to the target destination. The location can be any place you have familiarity (studied carefully, as defined by the teleport spell), even another plane.
  When casting the spell, you cast greater teleport and possibly other spells that take effect when you arrive at your destination point. The 10 minute casting time is the minimum total for all spells cast (if the companion spells have combined times longer than 10 minutes, use the combined casting times instead). In addition to any material components required by the companion spells, the initial casting of mage's Evasion drains 1d6 hp from the spellcaster. These hit points are "stored" in the spell, and may be regained by the caster normally.
  The stored hit points are immediately recovered by the caster upon the triggering of the Evasion.
  The greater teleport aspect of this spell takes you to your destination, so any condition that prevents teleporting also prevents mage's Evasion. Once reaching the destination point, the companion spells included in the Evasion instantly and simultaneously take effect. The companion spells must be ones that have a range of personal and be of a spell level no higher than one-third of your Caster Level. The total combined level of companion spells may not exceed your Caster Level. The conditions you specify to bring the spell into effect must be clear, although they can be general in nature (see the contingency spell, in the Pathfinder Roleplaying Game Core Rulebook for guidelines).
  The spell pulls together your mind, body, and soul if they have been separated. For example, if your soul is trapped in a magic jar when the Evasion is triggered, your soul returns to your body (breaking the magic jar spell).If your body or soul has been bound (for example, with a binding, imprisonment, or trap the soul spell), you must succeed at a opposed Caster Level check (DC 11 + the Caster Level of the person who cast the trapping spell) to break free.
  You may only use one mage's Evasion spell at a time; if a second is cast, or if a contingency spell is cast, the first spell (if still active) is dispelled.