File:NPC spell casting code (NPC AI Fields).jpg

Summary
Image from Daybreak developer on their ability to set NPC spell memorizing.