Genius Loci

(Complete Mage)

Conjuration (Creation) [see text]
Level: Sorcerer 9, Wizard 9,
Components: V, S, M,
Casting Time: 1 hour
Range: 0 ft.
Target: One building, location, or discernible geographic area, up to a maximum area of one 10-ft. cube/caster level
Duration: Permanent
Saving Throw: None
Spell Resistance: No

At your final word, the air around you hums and the region glows with a sudden flash of light.
It fades swiftly, but you can now feel a presence, as though the environment itself watched you.
With this spell, you grant the particular building or location a permanent "guardian spirit".
You must task the spirit with a specific purpose, and that purpose must in some manner involve protecting the building or region to which it is attached.
The task can be very general ("Slay any creature who attempts to enter!") or far more specific ("Kill any goblin who tries to take the red sword down off the wall").
The task can't be so specific as to mention the names of individual creatures, or to require unseen knowledge such as alignments or allegiances.
Finally, it must be simple enough to clearly convey in one or two sentences.
If the triggering event occurs, the genius loci manifests exactly where you cast the spell, taking the form of an elder elemental (choose air, earth, fire, or water when you cast the spell).
It immediately attempts to carry out the designated task.
Once the spell is complete, you have no special control over the spirit's actions, and if you trigger the manifestation, it attacks you just as it would anyone else.
The manifested spirit behaves in all ways as a normal elemental of its kind, within the parameters of the task assigned.
If the spirit's manifested form is slain, it is not destroyed and the spell is not broken.
However, it can't manifest for 24 hours after being destroyed.
The only way to permanently break a genius loci spell is with a miracle,Mordenkainen's disjunction, or wish, or else to permanently defeat the guardian spirit's purpose.
If, for instance, the spirit was commanded to prevent a particular item from being destroyed, the destruction of that item renders its existence moot.
When not actively involved in protecting its territory or following its task, the spirit shows no sign of its existence.
When it manifests, the creature appears to come out of nowhere.
Anyone viewing the building or area with detect magic sees an overwhelming aura of conjuration; true seeing reveals the spirit wandering its territory, appearing as a vague, hazy silhouette of the creature it manifests as.
Genius loci becomes a spell of the same type as the elemental manifestation specified (air, earth, fire, or water).
Material Component: A paste made up of silver, mithral, and holy water, worth a total of 3,000 gp.