Script attempt with Getnthactiveeffect~

Post » Wed Oct 06, 2010 12:28 am

This piece of test script probably doesn't work and would be more easily achieved by arrays, but I'm wondering if it's possible to do it this way too. The goal is to get the duration of an active reanimation effect, so it will heal the subject according to it's duration. If it had magnitudes, I'd be happy to use gettotalAEmagnitude, but no such luck. Maybe it's also more feasible to achieve this through Onmagiceffecthit, but I don't know how to get the duration of the responsible spell either. Magicka cost would also work for this purpose.

begin gamemode

if power != rean ; If power code isn't reanimation, choose the next effect.
set count to count + 1
set power to getnthactiveeffectcode count
elseif power == rean
set length to (player.GetNthActiveEffectDuration count)
message "Reanimation is %g seconds long" length
set heal to length
modav2 health heal
endif
end

User avatar
He got the
 
Posts: 3399
Joined: Sat Nov 17, 2007 12:19 pm

Post » Tue Oct 05, 2010 10:47 pm

Doh! The reanimation spell doesn't work on live undead(or dead for that matter, it doesn't work on creatures either), so it won't register as an active effect. Onmagiceffecthit it is, whatever I can do with it.
User avatar
Damned_Queen
 
Posts: 3425
Joined: Fri Apr 20, 2007 5:18 pm


Return to IV - Oblivion