Adding a magic effect to the player when a spell is casted

Post » Mon Oct 12, 2015 2:06 pm

Hi everybody, this is the first time I write on the forum (and the first "serious" mod I try to create)
I have a spell, aimed, I want the game add a magic effect to the caster every time the spell is casted (the magic effect is blank, it's serves only for cooldown); I try the onspellcast event but it doesn't work.

Event OnSpellCast(Form akSpell)        Spell spellCast = akSpell as SpellIf(spellCast == YourSpell)       PlayerRef.AddSpell(Cooldown)       debug.notification("cooldown Added")EndIfEndEvent

Thanks to anyone answer me.

User avatar
Laura
 
Posts: 3456
Joined: Sun Sep 10, 2006 7:11 am

Post » Mon Oct 12, 2015 10:55 am

You would want to use OnEffectStart.

Spell Property MyCoolDownSpell Auto Event OnEffectStart(Actor Target, Actor Caster)   MyCoolDownSpell.Cast(Caster, Caster) EndEvent

Make 'MyCoolDownSpell' an OnSelf, Fire-And-Forget spell, with the same effect, and you'll have the effect for the duration. Attach this Script to the Spell, and it will trigger every time the Spell hits a target, automatically finding out who cast it and casting the cooldown spell on them.

User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm


Return to V - Skyrim