spellhook mechanics and item crafting
The spellhook validates cast restrictions before crafting checks, blocking illegal spells unless specific item-casting exemptions apply.
- X2PreSpellCastCode calls the spellhook prior to the crafting check, preventing characters from crafting items using spells rejected by the spellhook
- Spellhook code contains exceptions allowing prohibited item use, such as casting spells opposed to deity alignment or from prohibited schools via scrolls
- Specific class exemptions for restricted item casting include Hunter Rangers, Crusader Paladins, and druids violating oath restrictions with metal items
- Fallen divine casters remain unconditionally blocked from divine magic, and heretical Shadow Adepts are blocked from all magic across the board
- If exemptions apply, a character unable to cast a spell naturally could theoretically craft items by reading scrolls of that spell


