Set every NPC's health on the fly.

Post » Wed Feb 16, 2011 5:27 am

How taxing would it be to have a token of some sort placed in every NPC's inventory when you encounter them that adjusts their base HP, then removes itself from the game? Anyone have a reference walking script handy? This is more for personal use than anything else. Thanks a bunch.
User avatar
Emmanuel Morales
 
Posts: 3433
Joined: Sat Oct 06, 2007 2:03 pm

Post » Tue Feb 15, 2011 6:17 pm

I think it would be fairly simple and not very taxing at all. This is how I would do it with a quest script.

scn yourscriptnameref dudebegin gamemodeset dude to getfirstref 69 1while dude	if dude.getitemcount yourtoken == 0		;modify dude's health		dude.additem yourtoken	endif	set dude to getnextrefloopend


In this script I had the NPCs keep the token because it seemed like a good way to make sure their health was adjusted only once.

Alternatively, you could script the token to modify the dude's health instead of putting the adjustment in the quest script.
User avatar
Annika Marziniak
 
Posts: 3416
Joined: Wed Apr 18, 2007 6:22 am


Return to IV - Oblivion