Info on GetLastSpellCastClass()
Spells cast from a spellbook (including domain spells and quickslots of the spellbook used in combination with a polymorph) are treated as cast by that class.
Spells cast from a polymorph's spell menu are treated as from the initial class of the character.
Spells cast from a scroll or item (including on-hit cast spell), spells cast as a feat, and NPC spells not assigned to a spellbook return 255 (CLASS_TYPE_INVALID).
EDIT: added the feat and NPC cases
Modifié par WhiZard, 15 juillet 2013 - 11:22 .