Undeath Ward

Abjuration
Level: Cleric */Oracle * 5, Inquisitor * 4, Sorcerer */Wizard * 6, Warlock * 6
Components: V, S, M/DF (powdered silver)
Casting Time: 1 Standard Action
Range: 10 ft.
Area: 10-ft.-radius emanation, centered on you
Duration: 1 minute/level (D)
Saving Throw: None or Will negates, see text
Spell Resistance: yes
  You create a pale silver barrier that repels undead. Mindless undead and intelligent undead with fewer Hit Dice than your Caster Level cannot enter the area or penetrate the barrier.
  Undead of Hit Dice equal to or greater than your Caster Level can pass through this barrier by making a successful Will Save against the spell, but as they do so, they take 3d6 points of damage. Once an undead creature makes its save again this spell and takes this damage, it can come and go without further penalty. This spell may only be used defensively, not aggressively. Forcing an undeath ward against creatures that the spell keeps at bay collapses the barrier.