This NPC uses the Complete Warrior(Improved Toughness Feat), Epic Level Handbook(Energy Resistance Feat) and Spell Compendium(Various Spells).

Danukan-Ryttn CR 27
Male Outsider Rogue3/Sorcerer11/Arcane Trickster10
Chaotic Evil Medium Outsider (Augmented Humanoid(Human))
Init +7; Senses Darkvision 60 ft. Listen +0, Spot +6
Languages Common, Abyssal, Orc, Draconic, Ignan, Infernal, Giant, Goblin, Slaadi, Esperonto

AC 38, touch 22, flat-footed 31 (+8 bracers, +2 Force Shield, +7 Dex, +6 Natural Armor, +5 Deflection)
hp 150 (3D6+11D4+10D4+72+24); DR 10/Magic
Resist Immune Poison, Resist Acid, Electricity 10, Resist Cold, Fire 20 ; SR 34
Fort +11, Ref +20, Will +15

Spd 30 ft., Fly 30 ft.(Average) (6 squares)
Melee Quarterstaff +14,+9 (1d6+2/x2) or Melee Touch +14 (as spell/x2)
Ranged Ranged Touch +19 or +20[Ray] (as spell/x2)
Base Atk +10+2; Grp +13
Space 5 ft.; Reach 5 ft.
Atk Options Smite Good +20 1/Day, Combat Expertise, Sneak attack +7D6, Impromptu Sneak Attack 2/Day
Combat Gear Staff of Evocation(42 Charges), Robe of Scintillating Colors
Special Actions Improved Feint
Class Spells Prepared (CL 21) (DC 19+Spell Level) 6/8/8/8/8/8/7/7/7/7: 0lv: Mage hand, Prestidigitation, You can pick the rest,
1lv: Shocking grasp, Ray of Enfeeblement, Lesser Orb of Sound, Golem Strike, Ray of Clumsiness
2lv: Melf's Acid Arrow, Scorching Ray, Invisibility, Ray of Stupidity, Ray of Ice
3lv: Fly, Ray of Exhaustion, Explosive Runes, Mass Snake's Swiftness
4lv: Animate Dead, Enervation, Greater Invisibility, Orb of Acid
5lv: Hold Monster, Cloudkill, Prismatic Ray, Gutsnake
6lv: Create Undead, Disintegrate, Revive Undead
7lv: Finger of Death, Antimagic Ray, Prismatic Eye
8lv: Polar Ray, Create Greater Undead, Superior Invisibility
9lv: Energy Drain, Mass Hold Monster, Dominate Monster
Spell-like Abilities (CL 24)(DC 19+Spell Level):
3/Day: Darkness, Poison, Unholy Aura
1/Day: Desecrate, Unholy Blight, Contagion, Blasphemy, Unhallow, Horrid Wilting, Summon Monster IX, Destruction

Abilities Str 14, Dex 24, Con 16, Int 16, Wis 10, Cha 29
SQ Outsider Traits, Evasion, Ranged Legerdemain 3/Day
Feats Spell Penetration, Greater Spell Penetration, Combat Casting, Improved Counterspell, Weapon Focus(Ray), Combat Expertise, Improved Feint, Improved Toughness, Energy Resistance(Fire), Energy Resistance(Cold)
Skills Bluff +25, Craft(Painting) +19, Decipher Script +14, Disable Device +24, Escape Artist +28, Knowledge(Arcana) +27, Open Lock +23, Sleight of Hand +28, Spot +6, Tumble +28
Possessions Staff of Evocation(42 Charges), Bracers of Armor +8, Ring of Force Shield, Ring of Protection+5, Amulet of Natural Armor +5, Cloak of Charisma +6, Robe of Scintillating Colors, Gloves of Dex +4, 3500GP