lesi123 Posted August 17, 2014 Share Posted August 17, 2014 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 endeventIs here a way to declare a non-specific npc to replace the PlayerRef for the GetActorValue? Link to comment Share on other sites More sharing options...
lesi123 Posted August 18, 2014 Author Share Posted August 18, 2014 I figured it out. To grab an actor out of akAggressor I had to use ((akAggressor as Actor).GetActorValue("Marksman") < 50). :) Link to comment Share on other sites More sharing options...
Recommended Posts