# Ways to learn whether a magic user knows a certain spell

Is there a spell, feat, special ability, etc. in DnD3.x – or possibly Pathfinder – that would allow a character to learn whether a magic user knows a certain spell? Or is there a certain kind/school/etc of spells, at least (transmutation, for example)?

If not, what would be the best way to introduce such an element into the game?

You see, the point of this could be for PCs to be able to exclude certain suspects when playing investigation-focused stories.

-

For archivists, wizards, and wu jen, you could simply read their spellbook (prayerbook). Though I suspect someone looking to commit a crime with a spell that is unusual enough that this line of inquiry was worthwhile would probably not include it in his main spellbook, but keep it separate.

For spellcasters who do not prepare spells ahead of time, a 13th-level spellthief can use Discover Spells to get the complete list. Note that this requires a successful Sneak Attack to accomplish. Being immune to Sneak Attack damage (e.g. elemental type, fortification armor, etc.), however, would not protect against this effect. For prepared spellcasters, Discover Spells only retrieves the list of currently-prepared spells, which is less useful.

For spellcasters that prepare spells based on their full list (clerics, druids, so on and so forth), a Spellcraft check or relevant Knowledge check should probably be able to get you that list. I’m not certain how to determine a character’s class spell list; classes are, after all, typically metagame constructs. This also wouldn’t help much if the character has any effect which adds unusual spells to his or her list.

And of course, various general-purpose divinations (commune, contact other plane, etc.) could also probably answer the question “does so-and-so know how to cast the spell x?” Which is why after a certain level such investigations tend to be very short in 3.5.

So far as I know, those are the only options.

-
One addition: a successful Scry (and Read Magic, or deciphering successfully) on a target who is memorizing spells would let you look at which spells they're reading out of their spellbook for the duration of the Scry. Not a very reliable or practical method, but it's there. – Tridus Oct 13 '13 at 22:43
It occurs to me that just persuading the target to say whether or not they know the spell could work - As could all standard means of extracting information from an unwilling NPC, such as zone of truth and so on. – GMJoe Dec 8 '14 at 5:18