Jump to content

[LE] Aimed Spell Effect on Weapon Block Help


jrseriel

Recommended Posts

Hello Nexus Community,

 

Firstly, I am new to modding, and papyrus. I am trying to create a mod for a weapon when when you block the weapon casts the sparks spell. This was inspired by the spellbreaker shield effect but just on a weapon, and an aimed effect rather than it casting on yourself as the spellbreaker ward effect does. I tried to use the creation kit GUI to do this but I got an Enchanment error.

 

Is there any other way to accomplish this?

 

Thank you & best regards.

-jr seriel

Link to comment
Share on other sites

1.Create Enchantment "Contact"

2.Make a new perk (name it whatever) -> Make new perk entry (Perk Entries Right click new) -> Check Entry point -> apply bashing spell -> sparks
3.Create Magic Effect Contact
4.On Magic Effect -> Apply Perk -> Choose your perk

5. Add you Magic Effect to your enchantment

 

Do note that concentration spells are abit wierd in this regard.

 

For blocking I could help you but that would require a script to my knowledge to cast the spell, otherwise there's different perk entry points you could check out.

Perhaps someone better could jump in with a different approach.

 

 

For Block

1. Create Enchantment "Contact"

2. Create Magic Effect "Constant Self" "Script"

3. Add this script -> add new script, "YourScript_Script" is replaced by whatever u want to call it

4. Fill properties in

5. Create Ability

6. Link your newly created magic effect you just made to that ability

7. create new magic effect "contact"

8. On Magic Effect -> Equip Ability -> Choose your Ability you made

9. Link effect to your enchantment

10. link enchantment to weapon

 

 

Scriptname YourScript_Script extends activemagiceffect

actor myTarget ; References the actor

Spell Property YourSpell auto ; References your spell, change property to sparks EVENT OnEffectStart(Actor Target, Actor Caster) myTarget = target RegisterForAnimationEvent(target, "blockstartout") ; Registering for block RegisterForAnimationEvent(target, "BlockStop") ; Registering for block stop ENDEVENT Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (akSource == myTarget) if asEventName == "blockstartout" ; when block, this event happens. YourSpell.Cast(mytarget) ; Yourspell if asEventName == "BlockStop"; when u stop block this even happens myTarget.InterruptCast() ; interupt concentration spell "sparks" endif endif endEvent

Event OnRaceSwitchComplete() ; event here needed if u ever transform so script starts again    Utility.Wait(1.0)    RegisterForAnimationEvent(target, "blockStartOut")    RegisterForAnimationEvent(target, "BlockStop") 

EndEvent

 

 

 

Best regards

Edited by GSGlobe
Link to comment
Share on other sites

Hey thank you for the possible solution. Though I see "on contact", sparks is an aimed concentration spell. So basically I would instead change it to a constant effect with no cost, so that when you block the weapon casts sparks wherever I am aiming. I may have misread or interpretted what is going on there, but this is what I am trying to do.

Edited by jrseriel
Link to comment
Share on other sites

As far as weapon enchants goes, only a contact spell is an option. So how the above bashing perk entry work is that.

 

When you bash "contact" with npc, the perk does its thing -> apply spell -> sparks to target npc.

 

The way the block works is that, "contact" magic effect is just a placeholder for the ability, when you equip that weapon linking to the enchantment, you gain a Ability "which is always active while you have the weapon equipped", this ability registers for animation "block" start and block "out" meaning, when you block you cast sparks, when you stop blocking, it interupts the cast.

Link to comment
Share on other sites

  • 4 weeks later...

I finally got around to trying this out. But I do not understand your script. If I copy and paste it I get compilation error. When I copy and paste this...

Scriptname YourScript_Script extends activemagiceffect   
actor myTarget ; References the actor
Spell Property YourSpell auto ; References your spell, change property to sparks EVENT OnEffectStart(Actor Target, Actor Caster) myTarget = target RegisterForAnimationEvent(target, "blockstartout") ; Registering for block RegisterForAnimationEvent(target, "BlockStop") ; Registering for block stop ENDEVENT Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (akSource == myTarget) if asEventName == "blockstartout" ; when block, this event happens. YourSpell.Cast(mytarget) ; Yourspell if asEventName == "BlockStop"; when u stop block this even happens myTarget.InterruptCast() ; interupt concentration spell "sparks" endif endif endEvent
Event OnRaceSwitchComplete() ; event here needed if u ever transform so script starts again

    Utility.Wait(1.0)
    RegisterForAnimationEvent(target, "blockStartOut")
    RegisterForAnimationEvent(target, "BlockStop")
 
EndEvent

Any help would be appreciated.

Link to comment
Share on other sites

Copy paste this into a script you make.

 

Change Property "castSpell" -> Sparks

 

Make this an ability and then link it to your enchantment or however you want it.

 

Might need on race change if you ever transform into a werewolf or vampire so it begins to register again without reequipping the weapon / shield enchantment after your back in human form.

 

 

spell property castSpell auto

actor myTarget
EVENT OnEffectStart(Actor Target, Actor Caster)
myTarget = target
RegisterForAnimationEvent(target, "blockstartout")
RegisterForAnimationEvent(target, "BlockStop")
ENDEVENT
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
if (akSource == myTarget)
if asEventName == "blockstartout"
castSpell.cast(myTarget)
elseif asEventName == "BlockStop"
myTarget.InterruptCast()
endif
endif

endEvent

 

 

This part here,you can paste into the end of the script if you're going to be using a transformation.

 

Event OnRaceSwitchComplete() ; event here needed if u ever transform so script starts again

Utility.Wait(1.0)
RegisterForAnimationEvent(target, "blockStartOut")
RegisterForAnimationEvent(target, "BlockStop")

EndEvent

 

 

EDIT: I'll be happy to help if you write down your concerns or questions.

Edited by GSGlobe
Link to comment
Share on other sites

  • Recently Browsing   0 members

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