Jump to content

[LE] Script for cast spell on bash attack


Recommended Posts

I'm working on a similar function to cast a spell when shield bashing and having issues making a script. Apply bashing spell with perk entry only seems to work with weapons on not shields. For shields, you need to have a custom script such as Auriel's Shield. Now I can just use the scripted magic effect (DLC1AbFXReflectingShield) as is and just add it to an enchantment and it works just like Auriel's shield so does release the spell when charged with blocks. But what I want is to do is modify the script so I can pick any spell and not have all the other charging jazz going on.

 

Here is what I have from dissecting the script. I'm not good with scripting at all so any help will be appreciated :

 

Scriptname SpellBash extends ActiveMagicEffect
{Script for casting spells on shield bash action.}
Actor selfRef
Spell Property ChargeSpell1 Auto
EVENT OnEffectStart(Actor Target, Actor Caster)
selfRef = caster
if (selfref == Game.GetPlayer())
registerForAnimationEvent(selfRef, "bashRelease")
else
registerForAnimationEvent(selfRef, "bashExit")
registerForAnimationEvent(selfRef, "bashStop")
endif
ENDEVENT
EVENT OnEffectFinish(Actor Target, Actor Caster)
unregisterForAnimationEvent(selfRef, "bashRelease")
unregisterForAnimationEvent(selfRef, "bashExit")
unregisterForAnimationEvent(selfRef, "bashStop")
ENDEVENT
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
Event OnAnimationEvent(ObjectReference akSource, string EventName)
if (selfref == Game.GetPlayer())
if (eventName == "bashRelease")
;debug.Trace("I'm catching the bashRelease anim event")
BlastIMod.Apply(0.3)
ChargeSpell1.cast(selfRef)
endif
else
if (eventName == "bashExit") || (eventName == "bashStop")
;debug.Trace("I'm catching the bashRelease anim event")
endif
endEVENT

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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