OnEquip events for Henchmen? solved - kinda

So here is my stumper for today - I have an updated version of the old Crap torchlife script. When equipped, the torch gets a pseudo-hb and burns out over time. I would like it to function for henchmen, but it uses GetPCItemLastEquipped() to define the item and the GetPCITemLastEquippedBy() to define the character equipping the item. These, by definition, only work for PCs. So when you make your henchmen wield the torch, it does the default torch - and will last forever.
Question : Is there a way to get an OnEquip event for the NPC Henchmen?

For a torch, you could use the heartbeat event to detect whether it’s equipped and when it’s burned out. 6 seconds here or there in the life of a torch can’t matter much.

For other items, you might need a pseudo-heartbeat at, say, one second intervals, so that the effect of equipping is almost instant.

Alternatively, you could give the item a bonus feat - but that probably isn’t any easier.

1 Like

NPCs will never equip torch by themselves which means that you need to force them to do it in a script. And that mens you know exactly when they equipped it.

…except when the player opens the henchman inventory to equip the torch manually… which isn’t detected automatically.

1 Like

I was thinking the hb was the best choice, but I was hoping there was something more direct

ah you are right, I forgot about that case

So I figured out how to move the OnEquip check to the module wrapper and get rid of the PC only script checks. Then I could put an ExecuteScript call into the henchmen’s heartbeat script for the same script. Needs just a little more testing for my own sake (import it into a few different modules and test it there), but it is working well enough!