tesfan1999 Posted December 13, 2017 Share Posted December 13, 2017 A summary of what I need:I want a spell to be cast as soon as a particular weapon is drawn, and soon as it is sheathed, I want the spell to end. Any ideas? Link to comment Share on other sites More sharing options...
GSGlobe Posted December 14, 2017 Share Posted December 14, 2017 (edited) 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 December 14, 2017 by GSGlobe Link to comment Share on other sites More sharing options...
JobVanDam Posted December 14, 2017 Share Posted December 14, 2017 https://www.creationkit.com/index.php?title=IsWeaponOuthttps://www.creationkit.com/index.php?title=IsWeaponMagicOut Test them out though. I'm pretty sure I was doing some quick testing and IsWeaponOut will return true if you have magic out. I think. Link to comment Share on other sites More sharing options...
tesfan1999 Posted December 14, 2017 Author Share Posted December 14, 2017 THanks, but does anyone know how to dispel an effect? Link to comment Share on other sites More sharing options...
tesfan1999 Posted December 14, 2017 Author Share Posted December 14, 2017 And I need a check for a particular weapon only. Link to comment Share on other sites More sharing options...
GSGlobe Posted December 14, 2017 Share Posted December 14, 2017 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 AutoSpell Property MySuperAwesomeSpell AutoWeapon Property MySuperAwesomeWeapon Auto Event OnEffectStart(Actor akTarget, Actor akCaster) RegisterForAnimationEvent(PlayerRef, "weaponDraw") ; This registers for draw weapon. RegisterForAnimationEvent(PlayerRef, "weaponSheathe") ; This registers for sheathingEndEvent 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 EquippedMySuperAwesomeSpell.Cast(PlayerREf) ; Player casts MySuperAwesomeSpellEndIf ElseIf (akSource == PlayerRef) && (asEventName == "weaponSheathe") ; If you as the player, sheathe the weapon - the following occursDispel() ; Unsure about thisEndIfEndIf 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 More sharing options...
tesfan1999 Posted December 15, 2017 Author Share Posted December 15, 2017 It should be Game.getPlayer().Dispel(MySuperAwesomeSpell)But it looks fine otherwise. I'll try it. Link to comment Share on other sites More sharing options...
Recommended Posts