Jump to content

[LE] NPC equip armor via script - help


sammidraco

Recommended Posts

Hey all. I'm trying to create a scenario where my custom NPC equips certain pieces of armor (specific boots, gloves, cuirass, and hood) when the player has a specific ring equipped. I'm assuming the best way to do this is via scripting. Unfortunately I know next to nothing about constructing a custom script. It seems like this should be easy, but the more I try to figure it out alone, the more I feel like I'm falling down a rabbit hole. Any suggestions for the basic construct for this script (or any better ideas) would be greatly appreciated. Thanks in advance.
Link to comment
Share on other sites

So you will need to use OnEquipped and OnUnEquipped events on the jewelry to have the custom NPC change attire when the jewelry is equipped by the player.

 

The custom NPCs default outfit can make it difficult to get them to equip and unequip individual items.

 

This is something you could try. I am sure if you need more help setting this up others can also help you.

Actor Property CNPC Auto
Outfit Property OldOutfit Auto
Outfit Property NewOutfit Auto

Bool B 

Event OnEquipped(Actor akActor)
  if akActor == Game.GetPlayer()
   if B 
   else
     CNPC.SetOutfit(NewOutfit)
     B = True
   endIf  
  endIf
endEvent

Event OnUnequipped(Actor akActor)

  if akActor == Game.GetPlayer()
   if B
     CNPC.SetOutfit(OldOutfit)
     B = False
   endIf
  endIf

endEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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