Jump to content

[LE] Magic Effect on weapon draw


tesfan1999

Recommended Posts

Im at work now and home in about 12-13hoiurs. Ill help you get started.

 

You could either use conditions on the spell itself or register for an animation event.

 

Do note that If your spell is concentration based, it will run Until you Magicka is empty or When you interupt casting. By jump block bash or similar.

 

 

Edit: See If you can write up something Until then and Ill help you Fill the rest When Im home!

Edited by GSGlobe
Link to comment
Share on other sites

Here, a sample. Make sure to change the script name to yours AND (spell & weapon property to yours, if you want)

 

 

Scriptname _MySuperAwesome_Script extends activemagiceffect

Actor Property PlayerRef Auto
Spell Property MySuperAwesomeSpell Auto
Weapon Property MySuperAwesomeWeapon Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
RegisterForAnimationEvent(PlayerRef, "weaponDraw") ; This registers for draw weapon.
RegisterForAnimationEvent(PlayerRef, "weaponSheathe") ; This registers for sheathing
EndEvent
Event OnAnimationEvent(ObjectReference akSource, string asEventName) ; When the event of draw weapon occurs
;; Your condition statement
If PlayerRef.GetEquippedWeapon() == MySuperAwesomeWeapon ; Player has MySuperAwesomeWeapon Equipped, do the rest.
If (akSource == PlayerRef) && (asEventName == "weaponDraw") ; If you as the player, draw the weapon - the following occurs
If PlayerRef.GetEquippedWeapon() == MySuperAwesomeWeapon) ; Player has MySuperAwesomeWeapon Equipped
MySuperAwesomeSpell.Cast(PlayerREf) ; Player casts MySuperAwesomeSpell
EndIf
ElseIf (akSource == PlayerRef) && (asEventName == "weaponSheathe") ; If you as the player, sheathe the weapon - the following occurs
Dispel() ; Unsure about this
EndIf
EndIf
EndEvent
Event OnRaceSwitchComplete() ; Safety event for transformation (Werewolf,Vampire) so the animation re-registers for the above event.
Utility.Wait(1.0)
RegisterForAnimationEvent(PlayerRef, "weaponDraw")
RegisterForAnimationEvent(PlayerRef, "weaponSheathe")
EndEvent

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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