Jump to content

Getting Armor Values with Scripting


KennEH

Recommended Posts

I'm trying to remake the Fists of Steel perk. The perk is an ability, so I'm trying to partially remake the skill in Papyrus. The trouble I'm having is I cannot find a way to get the armour rating on the gauntlets. Any suggestions?

 

 

If anyone is interested I'm trying to make brawling more endgame viable without changing too much, a patch essentially. What I planned to do was use the players current Heavy Armor rating as a modifier (30 Heavy Armor = 30%), and then take that from your current armour rating on your gauntlets, adding that to your unarmoured damage. I think it will make unarmed viable without too strong. I might have to modify the percentage.

Link to comment
Share on other sites

So after about a day of work, this is what I got. Not sure where I went wrong, but the script isn't working. I think I messed up the end event.

 

Scriptname FistsOfSteel extends Perk  
{Fist of Steel Perk Reamke}

Event Oninit()
; Heavy Armour for damage boost percentage
int HeAr = Game.GetPlayer().GetActorValue("HeavyArmor") as int

; Obtain the armor rating of the player currently equipped gauntlets
Armor Gauntlets = Game.GetPlayer().GetWornForm(0x00000008) as Armor
int AR = Gauntlets.GetArmorRating() as int

Float UD = game.getplayer().getav("UnarmedDamage")
EndEvent

; Equation to amplify damage
Float boost
Float Function Boost (int AR, int HeAr, Float UD)
return AR * (HeAr/100) + UD
EndFunction

; Replaces Unarmed Damage with new value
Event OnObjectEquipped(armor gauntlets)
if gauntlets as armor
	Game.GetPlayer().ModActorValue("UnarmedDamage", boost)
endif
EndEvent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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