Having some trouble with a script

Post » Thu Feb 07, 2013 1:38 am

I'm working on a custom summon spell that (because it uses a script and not the summon archetype) doesn't give any skill xp on cast.
So I gave a contact spell to my summons (via their attack data) that fires a script to give skill xp.

I want to increase Conjuration xp a small amount every time the creature attacks and give a more substantial boost if it manages to kill something.

Heres the script:
Scriptname csd_conj_MinionXPScript extends activemagiceffect  {Script attached to all minion attacks to level conjuration}Import GameActor property PlayerRef autoActor CastActor Float PlayerSkillEvent OnEffectStart(Actor akTarget, Actor akCaster)         CastActor = akCaster         PlayerSkill = PlayerRef.GetAV("Conjuration")       ;This Part Works          Float SkillAdv = (PlayerSkill * (PlayerSkill / 30))         AdvanceSkill("Conjuration", SkillAdv)EndEventEvent OnDying(Actor akKiller)        Debug.Notification("OnDying Happened")     ;This Part Does Not Work        if akKiller == CastActor             AdvanceSkill("Conjuration", (PlayerSkill * 2))             Debug.Notification("Familiar killed.")        endifEndEvent

The OnEffectStart block works.
I get the first notification in the OnDying but for some reason akKiller never = akCaster, even though the caster is the only thing doing damage to the target.
User avatar
Pumpkin
 
Posts: 3440
Joined: Sun Jun 25, 2006 10:23 am

Return to V - Skyrim