I wanted to do something that, conceptually at least, seemed simple: every time the player gets hit by a melee attack, he has to stagger.
My idea was to...
1. create a magic effect of archetype 'stagger', casting type 'fire and forget' and deliver 'self' and then
2. attach that magic effect to a spell and then
3. make a script cast the spell when the player is hit by using the onHit event.
Script would like like this:
Scriptname aaPlayerStaggerScript extends ObjectReferenceEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) aaBCstaggerSpell.Cast(Victim)EndEventSpell Property aaBCstaggerSpell Auto
My problem is that I don't know how to reference the victim that was hit. The syntaxis of the onHit event provides information about the agressor, the type of weapon used etc but it says nothing about the victim. How can I reference the victim of the hit then? If it's not possible, is there another way to make the player stagger every time he gets hit?
Many thanks in advance.