Agony is a living spell of the spells power leech and psychic poison (caster level 20th) which was then somehow awakened. The exact means of how Agony came into existence, how it was awakened and what it's doing now are all up to individual DMs who use Agony in their game. The Living Spell template is from the Monster Manual III (or the Eberron Campaign Setting), and the spells power leech and psychic poison are from the Book of Vile Darkness.
Agony CR 17
Awakened living spell
NE Large Ooze (Evil)
Init +1; Senses blindsight 60’, Listen +1, Spot +1; Aura moderate evil
AC 15, touch 15, flat-footed 14
hp 150 (20d10+40 HD); DR 10/magic
Immune attack forms that rely on sight, critical hits, flanking, gaze attacks, illusions, paralysis, poison, polymorph, sleep effects, stunning, visual effects
Fort +15, Ref +14, Will +14
Speed 20 ft
Melee slam +17 (1d8+3 plus spell effect)
Space 10 ft.; Reach 5 ft.
Base Atk +15; Grp +21
Special Atks engulf
Abilities Str 15, Dex 12, Con 15, Int 10, Wis 12 Cha 15
SQ spell effect, ooze qualities
Feats Ability Focus (engulf), Ability Focus (spell effect), Great Fortitude, Iron Will, Lightning Reflexes, Improved Natural Attack, Weapon Focus (slam)
Skills Hide -3, Knowledge (arcana) +11, Search +1, Spellcraft +13
Engulf (Ex): Agony can flow around creatures that fit within its space as a standard action. It cannot make a slam attack during a round in which it engulfs. It merely has to move over the opponents, affecting as many as it can cover. Opponents can make attacks of opportunity against Agony, but if they do so they are not entitled to a saving throw. Those who do not attempt attacks of opportunity must succeed on a Reflex save (DC 19) or be engulfed; on a success, they are pushed back or aside (opponent’s choice) as Agony moves forward. Engulfed creatures are subject to the full normal effects of power leech and psychic poison each round on Agony’s turn, and are considered grappled.
Ooze Traits: Oozes are blind but have blindsight, and are immune to gaze attacks, visual effects, illusions, and other attack forms that rely on sight. Oozes are immune to poison, sleep effects, paralysis, polymorph, and stunning. They are not subject to critical hits or flanking. Oozes do not need to sleep.
Spell Effect (Su): A creature hit by Agony’s slam attack is subject to both a power leech (Will save DC 19) and psychic poison (no save) spells.
Agony’s natural weapons strike as evil and magic for purposes of overcoming damage reduction. Anyone trying to use a divination or mind-affecting spell on Agony is subject to the effects of psychic poison.
Despite its appearance, Agony tries to fight intelligently. It tries to use its engulf attack on as many people as possible but settles for using its slam attack if it can’t engulf two or more characters on its turn. It targets martial-looking characters first, using power leech to drain their Strength and Constitution (in that order), trusting in its spell resistance to protect it from spellcasters.
DMs who don't have access to the Book of Vile Darkness should treat psychic poison as being a normal poison, save that it affects a mental ability score (Intelligence instead of Strength, Wisdom instead of Constitution, or Charisma instead of Dexterity), and requires a successful Will save, instead of a Fortitude save, to overcome. Characters affected by psychic poison do not themselves take this ability damage, but anyone who tries to use a divination or mind-affecting spell on them does. This lasts for approximately 20 hours. Treat power leech as an effect that deals 1 point of permanent ability drain to one ability score of Agony's choice (1 point per round if engulfing a creature). Agony gains a +1 enhancement bonus to the same ability score for 200 minutes when using this ability. Note that bonuses from multiple uses of power leech don't stack (but if he is able to engulf a character for multiple rounds, all the points drained during that use do stack).
Ordinarily, targeted spells such as power leech are not subject to becoming living spells; Agony is unique in that regard. As a result of being awakened, it has gained an Intelligence score of 10 (the average of 3d6, rounded down). Skill points and feats were then retroactively assigned based on its Intelligence score and hit dice. All skill points were spent under the assumption that all skills were cross-class skills for Agony, since living spells have no skills by default. Because Agony has an Intelligence score, it has lost the Mindless trait that most creatures of the Ooze type possess.
Note that, while Agony does have the blindsight ability of all oozes, the range of this ability is never stated. The recommended default used here is 60’, and the recommendation for how the blindsight works is that it’s a quasi-magical sense (“quasi-magical” in that it doesn’t go away in an antimagic field).
DMs using Agony may want to consider lowering his CR by 1 or 2, even despite his being awakened. His lack of items and lack of ranged attacks (or means of rapidly closing distances so he can engage in melee combat) means that he’ll be a relatively easy encounter for a group of 17th-level PCs if he fights them alone. He works best as part of a group of enemies fighting in concert.