Jump to content

Help with a simple Enchantment Script


citronblood

Recommended Posts

Hi,

 

I'm new to creation kit and scripting. What I am trying to do is put together a simple script, so that whenever the staff is fired, it triggers a script that recharges the staff after say 5 seconds.

 

I looked around, and only really found a OnSpellCast event. On the page it says that this works for enchantments as well, but I'm not sure how to link these things together. I am also not that familiar with the syntax and structure of Papyrus.

 

If anyone can help me with making this simple script, I'd be very grateful!

 

Thank you very much!

Link to comment
Share on other sites

You can put the script on a reference alias pointing to an actor, or add a spell ability to an actor and put a script on the spell ability's magic effect. For a reference alias, you can do something like this:

 

Scriptname TM_ReferenceAliasScript extends ReferenceAlias 

Enchantment Property MyEnchantment Auto

Event OnSpellCast(Form akSpell) 
    If akSpell == MyEnchantment
        RegisterForSingleUpdate(5) 
    Endif 
EndEvent 

Event OnUpdate() 
    Actor SelfRef = GetActorRef()
    SelfRef.SetAv("EquippedStaffCharge", SelfRef.GetAv("EquippedStaffCharge") + 100)
Endevent
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...