Summonned pets health transfer

Post » Sun Nov 18, 2012 1:19 am

I'm making a mod that enhances necromancy. Now I want to create a Perk that makes pets absorb health when hitting enemies and transfer a certain amount to the necromancer. I'm kinda lost on this one and any help would be much appreciated.
User avatar
Emily Rose
 
Posts: 3482
Joined: Sat Feb 17, 2007 5:56 pm

Post » Sun Nov 18, 2012 1:15 am

Depending on how you wish to approach this, i have a similar system in place except i dont use a perk

I have a spell which conjures multiple rodents depending on level. Each rodent has a chance of applying a drain health spell.

The drain health spell is applied through the attack data of the summoned creature (actor).

As for transfering health back to the caster, i use a script on the magic effect to cast a second drain effect from the player to the summoned pet. The second drain effect from player to pet is non-hostile (unflag hostile) and the pet won't attack you.
This then gives the illusion of health transferring from the target to the pet and then onto the player

This is a script that i made which has the above effect

Spoiler
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
Justin
 
Posts: 3409
Joined: Sun Sep 23, 2007 12:32 am


Return to V - Skyrim