Jump to content

[Papyrus] Checking enemy NPC skill level


lesi123

Recommended Posts

So I've got an OnHit script setup on NPCs via dynamic script for the player to apply a spell to an enemy on hit with the conditions of a RandomInt and having a certain skill level. I'd like to do it in reverse so the OnHit script that will be attached to the player can check what the attackers skill level is if the RandomInt roll was high enough.

 

Part of the code I have attached to the NPC:

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
	if ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 75) && (PlayerRef.GetActorValue("Marksman") < 50))
myDamageSpell.cast(PlayerRef)
	endif
endevent

Is here a way to declare a non-specific npc to replace the PlayerRef for the GetActorValue?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...