Skyrim Special Edition

File information

Last updated

Original upload

Created by

ZXC Mods

Uploaded by

harmlessinsanity

Virus scan

Safe to use

Tags for this mod

About this mod

This is a modder's resource - it contains scripting for turning any book into a spell tome which will trigger animations to make learning spells more immersive.

Permissions and credits
I recently updated Champion of The Daedra's Tier Spell Tome concept by adding scripted vanilla animations. I built this in a separate project as opposed to working inside COTD, so that I could try a new workflow method. Before implementing this system into COTD I decided I would share this test mod as a modder's resource so that anyone can use it, because I love this community and many other modders have helped me learn how to do things I value.

You'll just need to modify the scripts a bit with your own spell & spell tome. If you have question on how to do this you can post them in the comments section and I'll try to help you out.

-=-

Scriptname ABC_TomeFX_Book extends ObjectReference  

Actor Property PlayerRef auto
Spell Property ABC_Spell_TomeFX_Fire auto
Spell Property ABC_Spell_TomeFX_Frost auto
Spell Property ABC_Spell_TomeFX_Shock auto
Spell Property ABC_Spell_TomeFX auto

Idle Property idlebook_reading auto
Idle Property idlecivilwarcheer auto

Sound Property MAGAlterationIronFleshFireSD auto

Auto State Fire
    Function ABC_SpellRotation()
        Game.DisablePlayerControls(false, false, false, false, false, true, false) ;disable menu
        PlayerRef.EquipSpell(ABC_Spell_TomeFX, 1)
        PlayerRef.PlayIdle(idlebook_reading)
        utility.wait(3)
        ABC_Spell_TomeFX_Fire.cast(playerRef, playerRef)
        Debug.Notification("Fire tome successfully studied.")
        int instanceID = MAGAlterationIronFleshFireSD.play(self)    ; play mySFX sound from my self
        Sound.SetInstanceVolume(instanceID, 0.5)                    ; play at half volume
        PlayerRef.PlayIdle(idlecivilwarcheer)
        PlayerRef.UnequipSpell(ABC_Spell_TomeFX, 1)
        Game.EnablePlayerControls()
        GoToState("Frost")
    EndFunction
EndState

State Frost
    Function ABC_SpellRotation()
        Game.DisablePlayerControls(false, false, false, false, false, true, false) ;disable menu
        PlayerRef.EquipSpell(ABC_Spell_TomeFX, 1)
        PlayerRef.PlayIdle(idlebook_reading)
        utility.wait(3)
        ABC_Spell_TomeFX_Frost.cast(playerRef, playerRef)
        Debug.Notification("Frost tome successfully studied.")
        int instanceID = MAGAlterationIronFleshFireSD.play(self)    ; play mySFX sound from my self
        Sound.SetInstanceVolume(instanceID, 0.5)                    ; play at half volume
        PlayerRef.PlayIdle(idlecivilwarcheer)
        PlayerRef.UnequipSpell(ABC_Spell_TomeFX, 1)
        Game.EnablePlayerControls()
        GoToState("Shock")
    EndFunction
EndState

State Shock
    Function ABC_SpellRotation()
        Game.DisablePlayerControls(false, false, false, false, false, true, false) ;disable menu
        PlayerRef.EquipSpell(ABC_Spell_TomeFX, 1)
        PlayerRef.PlayIdle(idlebook_reading)
        utility.wait(3)
        ABC_Spell_TomeFX_Shock.cast(playerRef, playerRef)
        Debug.Notification("Shock tome successfully studied.")
        int instanceID = MAGAlterationIronFleshFireSD.play(self)    ; play mySFX sound from my self
        Sound.SetInstanceVolume(instanceID, 0.5)                    ; play at half volume
        PlayerRef.PlayIdle(idlecivilwarcheer)
        PlayerRef.UnequipSpell(ABC_Spell_TomeFX, 1)
        Game.EnablePlayerControls()
        GoToState("Fire")
    EndFunction
EndState

Function ABC_SpellRotation()
    ; Empty function definition to allow Toggle to be defined inside states.
EndFunction

Event OnRead()
    ;ShieldSpellFXS.Play(PlayerRef, 0.5)
    ABC_SpellRotation()
endEvent