jlryan Posted October 23, 2017 Share Posted October 23, 2017 Hello, I hate to be lazy af but could someone help/create a script that casts a spell on power attack with a specific weapon? - I am trying to make a hammer that when you power attack, it will cast the Fire Storm destruction spell at the cost of 100 stamina. I was able to make a hammer that would cast Fire Storm when bashing, based off of the Dawnguard Rune Hammer script, but that was just too easy spam.More or less I am just looking for a Power Attack version of the Dawnguard Rune Hammer script. Thank You Link to comment Share on other sites More sharing options...
GSGlobe Posted October 23, 2017 Share Posted October 23, 2017 register for "Hitframe" or weaponswing / weaponswingleft. Then on spell condition isPowerattack == 1 Think you can modify the dawnguard script, change the register animation to the one above. Otherwise I can post a working script when I get home from work in 12hours Link to comment Share on other sites More sharing options...
jlryan Posted October 23, 2017 Author Share Posted October 23, 2017 register for "Hitframe" or weaponswing / weaponswingleft. Then on spell condition isPowerattack == 1 Think you can modify the dawnguard script, change the register animation to the one above.Otherwise I can post a working script when I get home from work in 12hoursI wanted to alter the dawnguard script to create new one but it wouldn't let me see it like i could the other scripts. Link to comment Share on other sites More sharing options...
GSGlobe Posted October 23, 2017 Share Posted October 23, 2017 (edited) The below script goes into a magic effect, you can then add into ability, or a spell, or link ability to perk and add perk on equip item or whatever. Sorry for the delay. Scriptname YourScriptName extends activemagiceffectActor Property PlayerRef Auto ; reference you, the playerSpell Property YourSpell Auto ; reference your spell, dont forget to set property after adding it; -----;Float DelayBetweenAttacksMin ; if you want delays between it;Float DelayBetweenAttacksMax; -----Event OnEffectStart(Actor akTarget, Actor akCaster) RegisterForAnimationEvent(PlayerRef, "HitFrame") ; register for animation Hitframe or weaponswing / weaponswingleftEndEvent; -----Event OnAnimationEvent(ObjectReference akSource, string asEventName) ; when event occurs If asEventName == "HitFrame" && akSource == PlayerRef ; change hitframe to weaponswing if u want ;If Playerref.IsSneaking() ; condition example if player ref is sneaking YourSpell.Cast(PlayerRef) ; Cast your spell when event fired EndifEndEvent; -----Event OnRaceSwitchComplete() ; if you transform and revert, this is needed for it to re register for animation event Utility.Wait(1.0) RegisterForAnimationEvent(PlayerRef, "HitFrame") ; animation it register forEndEvent ; ----- Edit: Don't forget to add condition on the ability itself for IsPowerAttacking == 1 or something like it, otherwise it will go off every hit. It's WeaponSwing && WeaponLeftSwing to be correct if you wish to change hitframe to it. Edited October 23, 2017 by GSGlobe Link to comment Share on other sites More sharing options...
jlryan Posted October 24, 2017 Author Share Posted October 24, 2017 kk ty for the leet help ;-) Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 24, 2017 Share Posted October 24, 2017 I wanted to alter the dawnguard script to create new one but it wouldn't let me see it like i could the other scripts. FYI - In order for the Creation Kit to see DLC and mod scripts you have to ensure that their source file(s) are located in the main script source folder. Since there is script overlap between base game and DLC, you have to copy them in the same order as your load order. i.e. base game > Dawnguard > Hearthfires > Dragonborn Link to comment Share on other sites More sharing options...
jlryan Posted October 24, 2017 Author Share Posted October 24, 2017 ya this script is not working at all for me. keeps crashing ck on trying to save script in ck. Link to comment Share on other sites More sharing options...
jlryan Posted October 24, 2017 Author Share Posted October 24, 2017 I wanted to alter the dawnguard script to create new one but it wouldn't let me see it like i could the other scripts. FYI - In order for the Creation Kit to see DLC and mod scripts you have to ensure that their source file(s) are located in the main script source folder. Since there is script overlap between base game and DLC, you have to copy them in the same order as your load order. i.e. base game > Dawnguard > Hearthfires > Dragonborn I can see and edit other dlc scripts, but for some reason this script wont allow me to view source. I searched for it in the file folders and found it, still having trouble adapting it for power attacking. This is the hammer script unedited Scriptname DLC1testPhilRuneHammerAbilitySCRIPT extends ActiveMagicEffect SPELL PROPERTY runeSpell AUTO EVENT OnEffectStart(Actor target, Actor caster) if(caster == game.getPlayer()) if(RegisterForAnimationEvent(game.getPlayer(), "bashExit") == true) debug.trace("bashExit registered") endif endif ENDEVENT EVENT OnAnimationEvent(ObjectReference akSource, string asEventName) if(asEventName == "bashExit") Debug.trace("the RUNE of me... get it?") ; //cast the rune and remove the stamina runeSpell.cast(game.getPlayer()) game.getPlayer().damageAv("stamina", 25) endIf ENDEVENT EVENT OnUnload() UnregisterForAnimationEvent(game.getPlayer(), "bashExit") ENDEVENT Link to comment Share on other sites More sharing options...
GSGlobe Posted October 24, 2017 Share Posted October 24, 2017 The script works, I wrote IT compiled IT and tested IT ingame. Give me details about your spell, Ill see IT done in a testmod when I get home from work in 13-14hours. Link to comment Share on other sites More sharing options...
GSGlobe Posted October 24, 2017 Share Posted October 24, 2017 Else just Edit "bashExit" to "HitFrame", dont forget to copy script into a new one not to edit vanilla one, set property and go Link to comment Share on other sites More sharing options...
Recommended Posts