Adapted from Complete Arcane, D&D 3.5e
9-level Abjuration
The caster covers themselves in protective magic that absorbs any spell or spell-like energy that targets them. They can absorb up to 1d6+4 spell levels from the next incoming ranged spells that have them as a target (area of effect spells and touch spells cannot be absorbed). When a spell is absorbed, the remaining levels of spells that can be absorbed is lowered by the absorbed spell's level. When spells are absorbed, the remaining spell levels after the Absorption effect is consumed still affect the caster. The damage dealt, if any, is equal to the spell's damage times the remaining spell levels, divided by the spell's original level. If there is any effect that should affect the caster, roll a d100. If the result is higher than 100 * (remaining spell levels) / (spell's original level), then the caster is unaffected. When spells are absorbed, the caster gains a spell slot for a spell of level equal to the amount of spell levels that were absorbed. These extra spell slots are lost after a long rest.