About this mod
API to allow mods to implement custom behavior when the player uses spell tomes, disabling the vanilla behavior of simply eating the book and instantly learning the spell.
- Requirements
- Permissions and credits
- Mirrors
- Changelogs
This is an API that allows mods to implement custom behavior when the player uses spell tomes.
Your scripts can register for the spell tome event using any of these provided scripts:
DEST_FormExt.psc:
Scriptname DEST_FormExt Hidden
Function RegisterForSpellTomeReadEvent(Form akForm) global native
Function UnregisterForSpellTomeReadEvent(Form akForm) global native
Event OnSpellTomeRead(Book akBook, Spell akSpell, ObjectReference akContainer)
EndEvent
DEST_AliasExt.psc:
Scriptname DEST_AliasExt Hidden
Function RegisterForSpellTomeReadEvent(Alias akAlias) global native
Function UnregisterForSpellTomeReadEvent(Alias akAlias) global native
Event OnSpellTomeRead(Book akBook, Spell akSpell, ObjectReference akContainer)
EndEvent
DEST_ActiveMagicEffectExt.psc:
Scriptname DEST_ActiveMagicEffectExt Hidden
Function RegisterForSpellTomeReadEvent(ActiveMagicEffect akEffect) global native
Function UnregisterForSpellTomeReadEvent(ActiveMagicEffect akEffect) global native
Event OnSpellTomeRead(Book akBook, Spell akSpell, ObjectReference akContainer)
EndEvent
An example implementation is included in the download (DontEatSpellTomes.esp and DEST_PlayerSpellLearningScript.psc). It simply registers the Papyrus event and teaches the spell to the player like in vanilla, but it does not remove the book. However, the commented out code in the script shows how the book could still be removed if we wanted to.
Frequently Asked Questions