I'm working on a new weapon that transfers "size" between the wielder and the target with every hit. I've written the following so far:
Scriptname spgEssenceShift extends activemagiceffect {A transfer of essence between target and caster occurs. Making the caster to grow larger, causing the target minor pain in the process}Actor Property Wielder Autofloat CurrentScaleWfloat CurrentScaleTfloat NewScaleWfloat NewScaleTfloat DefaultScaleEvent OnEffectStart(Actor akTarget, Actor akCaster)Wielder = akCaster ;now we know who is wielding the Staff ;Debug.Notification("Wielder is" + akCaster)Enemy = akTarget ;pretty self explanatory ;Debug.Notification("Enemy is" + akTarget)CurrentScaleW = Wielder.GetScale()CurrentScaleT = Enemy.GetScale()EndEventEvent OnHit(ObjectReference akTarget, Form akSpell, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) CurrentScaleW = Wielder.GetScale() CurrentScaleT = Enemy.GetScale() If (CurrentScaleW < 10.0) NewScaleW = CurrentScale + 0.01 ;rate of growth/hit Wielder.SetScale(NewScaleW) ;Debug.Notification(akCaster + "Absorbed essence.") EndIf If (CurrentScaleT > 0.01) NewScaleT = CurrentScaleT - 0.01 ;rate of growth/hit Enemy.SetScale(NewScaleT) ;Debug.Notification(akCaster + "Essence drained.") EndIf EndEvent
However I am unable to compile it because for some reason apparently Enemy is undefined. I'm not sure why as I have defined it as per the script.
I have a feeling it has something to do with the parameters for OnHit being used as I've never used it before and so am unfamiliar with the parameters. However I'm still not experienced enough to know forsure.
Any help would be appreciated because this is the last thing I need to do before I can finish my mod. Thank you in advance.