Jump to content

[LE] Casting Spells on Weapon Swing


Recommended Posts

I need help with a script to get a spell to cast when a specific weapon is swung at a target. I've tried numerous different approaches and none have worked even though the scripts compile fine. What I want to do is have a weapon cast a ball of light on the target when the weapon is swung. Can anyone help me out here? I don't want it on a power attack, just a normal weapon swing.

Link to comment
Share on other sites

You can attach an enchantment with a scripted magic effect to the weapon. The magic effect script should be something like this:

ScriptName myBallofLightScript extends ActiveMagicEffect

spell property BallofLight auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
  BallofLight.cast(akCaster, akTarget)
endEvent

This won't take in account whether your attack is normal, a power attack or something entirely else though.

 

Otherwise, you'd have to use something like OnAnimationEvent using one of the normal attack animations listed here, I'd guess. I don't have any experience in this matter though.

  • Thanks 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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