Scriptname zzzSXPPAliasOnHit extends ReferenceAlias

MiscObject Property MISC_HitToken Auto

Auto State Active
Event OnHit( ObjectReference pAttacker, Form pSource, Projectile pProjectile, bool bPowerAttack, bool bSneakAttack, bool bBashAttack, bool bHitBlocked )
	if ( pAttacker == None )
		return
	endif
	Actor pActor = pAttacker as Actor
	if ( pActor == None )
		return
	endif
	if ( pActor.IsPlayerTeammate() == True )
		return
	endif

	int count = 1
	if ( bPowerAttack )
		count += 1
	endif
	if ( bHitBlocked )
		count += 1
	endif
	
	pActor.AddItem( MISC_HitToken, count, True )
EndEvent
EndState

State Empty
EndState