Difference between revisions of "OnHit - ObjectReference"

1 byte added ,  12:13, 18 October 2018
m
no edit summary
imported>OpusGlass
m (Some sections of text were improperly flagged as code.)
imported>OpusGlass
m
Line 29: Line 29:
</source>
</source>


<source lang="papyrus">
 
To avoid the hits from enchantments running the code block one must compare the ''akSource'' to the actual reference that hit the actor/object.  
To avoid the hits from enchantments running the code block one must compare the ''akSource'' to the actual reference that hit the actor/object.  
For instance, say we have a weapon with 2 enchantments called "Fire/Ice Sword." When hit with this sword the hit registers as 3 separate hits, but you have code such as:
For instance, say we have a weapon with 2 enchantments called "Fire/Ice Sword." When hit with this sword the hit registers as 3 separate hits, but you have code such as:


<source lang="papyrus">
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \
   bool abBashAttack, bool abHitBlocked)
   bool abBashAttack, bool abHitBlocked)
Anonymous user