Health Transfer script

Post » Mon May 06, 2013 8:00 am

While I keep adding more and more feats to my mod, I've encountered with a little dilemma (or whatever you want to call it)

I want to introduce a new perk, which makes Undead corpses absorb health with every attack. I've had no problem with this, but now I also want them to transfer a small portion of that HP to the caster, which means minions will heal the caster with every attack. I was wondering if there is any existing mechanic I could use (with proper modifications) in order to achieve this.

Any ideas are welcomed.

EDIT: I found this on the internet

Scriptname RodentToPlayerTransferHealth extends activemagiceffect {Transfers a portion of health absorbed by your pet to the owner }Actor Property PlayerRef AutoActor Property caster Auto HiddenMagicEffect Property MFx_RodentAbsorbHealth_NECMAS AutoSpell Property SP_PlayerToRodentAbsorbHealth_NECMAS AutoEvent OnEffectStart (Actor akCaster, Actor akTarget) caster = GetCasterActor() SP_PlayerToRodentAbsorbHealth_NECMAS.cast (PlayerRef, caster)	 debug.notification ("Absorb to player cast")EndEventEvent OnEffectFinish (Actor akCaster, Actor akTarget)	 caster.DispelSpell(SP_PlayerToRodentAbsorbHealth_NECMAS)EndEvent
User avatar
Chase McAbee
 
Posts: 3315
Joined: Sat Sep 08, 2007 5:59 am

Post » Sun May 05, 2013 10:11 pm

Scriptname RodentToPlayerTransferHealth extends activemagiceffect {Transfers a portion of health absorbed by your pet to the owner }Actor Property PlayerRef AutoActor Property caster Auto HiddenMagicEffect Property MFx_RodentAbsorbHealth_NECMAS AutoSpell Property SP_PlayerToRodentAbsorbHealth_NECMAS AutoEvent OnEffectStart (Actor akCaster, Actor akTarget)caster = GetCasterActor()SP_PlayerToRodentAbsorbHealth_NECMAS.cast (PlayerRef, caster)	 debug.notification ("Absorb to player cast")EndEventEvent OnEffectFinish (Actor akCaster, Actor akTarget)	 caster.DispelSpell(SP_PlayerToRodentAbsorbHealth_NECMAS)EndEvent
you want the summons to return health with each attack right?
if so this doesn't look like the script you are looking for.
User avatar
claire ley
 
Posts: 3454
Joined: Fri Aug 04, 2006 7:48 pm

Post » Mon May 06, 2013 8:22 am

Thanks curate, yes thats exactly what I want. Seems like the guy who made this script just made it for his mod. Every time the summons attack an enemy, they absorb a portion of health. This triggers the script, which causes the caster to absorb health from the pet. This Magic Effect is labeled as non-hostile, so the pets do not turn hostile towards the caster.

I don't know what would be the mechanism, but the aim is most like the script says. However I would like to know if there is a way to do this without using the pets as a 'bridge' between the caster and the target

User avatar
Queen Bitch
 
Posts: 3312
Joined: Fri Dec 15, 2006 2:43 pm


Return to V - Skyrim