Spell that damages the player while using it

Post » Wed Sep 18, 2013 4:43 am

Hi everyone,

I was wondering how I could create a spell that damages the player while he's using it. I know how I could do it for a Fire and Forget spell, but is that also possible for a Concentration-cast spell? For example, a flames-spell that drains the player's health while he's casting it but at the same time damages the enemies that walk through the cone. Is that possible?

Thanks in advance,

Nicolas

User avatar
JLG
 
Posts: 3364
Joined: Fri Oct 19, 2007 7:42 pm

Post » Tue Sep 17, 2013 11:26 pm

Can you explain the FF way? I don't have the CK open at the moment but if you mention a few things it'll jot my memory.

User avatar
joeK
 
Posts: 3370
Joined: Tue Jul 10, 2007 10:22 am

Post » Wed Sep 18, 2013 12:20 am

Isn't there a Damage on Self setting? I have not made a spell in this editor, so not sure.

User avatar
Jack Walker
 
Posts: 3457
Joined: Wed Jun 06, 2007 6:25 pm

Post » Tue Sep 17, 2013 9:54 pm

I would do this by attaching a script to the MGEF that the spell uses, that will add a detrimental spell to the caster while the spell is cast. something like:

Spoiler
Scriptname damageCasterScript extends activeMagicEffectSpell property detrimentalSpell auto   ;make this a fire-and-forget type spell with 1 second durationActor casterEvent onEffectStart(Actor akTarget, Actor akCaster)  caster = akCaster  detrimentalSpell.cast(caster, caster)  registerForSingleUpdate(1.0)EndEventEvent onUpdate()  detrimentalSpell.cast(caster, caster)EndEventEvent onEffectFinish(Actor akTarget, Actor akCaster)  unregisterForUpdate()EndEvent

Note: I've never used a script on a concentration-type spell effect, and I suspect there may be a chance that it recieves onEffectStart() events every second while the spell is held in concentration. If that is the case, you could get rid of the onUpdate and onEffectFinish events altogether, and simply have it add the spell onEffectStart(). e.g.:

Spoiler
Scriptname damageCasterScript extends activeMagicEffectSpell property detrimentalSpell auto   ;make this a fire-and-forget type spell with 1 second durationEvent onEffectStart(Actor akTarget, Actor akCaster)  detrimentalSpell.cast(akCaster, akCaster)EndEvent
User avatar
courtnay
 
Posts: 3412
Joined: Sun Nov 05, 2006 8:49 pm

Post » Tue Sep 17, 2013 9:28 pm

Thanks for the quick feedback!

@Elias

FF was my abbreviation for Fire & Forget. :)

@Egocarib

Yeah, thats what I thought about doing, too. This would work fine on a Fire and Forget spell, but OnEffectStart usually starts when the Target is hit by the effect, and not when the player casts it. I thought about using OnSpellCast, but I'd have to attach that to the player. What really bugs me is that I found a way to accomplish this a year ago but lost the script.

User avatar
Tyrone Haywood
 
Posts: 3472
Joined: Sun Apr 29, 2007 7:10 am

Post » Tue Sep 17, 2013 11:18 pm

lol thanks, but I meant could you explain how you do it in the fire and forget way.

User avatar
Mashystar
 
Posts: 3460
Joined: Mon Jul 16, 2007 6:35 am

Post » Wed Sep 18, 2013 3:05 am

Good point. Yeah, I think the only option I can think of is to put the player in an alias then. (Edit: or you could give them a hidden ability that has the script attached to the ability effect, and listens for OnSpellCast)

And...

To accomplish this, use the second script I posted above, and attach it to the magic effect used by the spell you want to negatively influence the caster.

User avatar
Mariana
 
Posts: 3426
Joined: Mon Jun 12, 2006 9:39 pm


Return to V - Skyrim

cron