Jump to content

Check Health


wizardmirth

Recommended Posts

I'm trying to figure out how to check the health of an NPC while in a non-lethal duel with the player. This NPC would then yield when his health is like maybe at 30% or whatever. I think I need to use GetActorValue, set/ref it, and then use variable equations, but variables scare me and I'm not sure how to format it properly. Anyone know of a script I can check vanilla or otherwise or have a suggestion on the best way to do this. Not sure if OBSE has a simpler method for this.
Link to comment
Share on other sites

This is a one time occurence for a specific NPC that I created. The script must keep checking the NPC's health from the time the duel starts until the threshold I set is reached, and then it can stop.
Link to comment
Share on other sites

You would need to insert this code into the script attached to the NPC:

 

...

short dueling

...

if (dueling == 1)
	if (GetAV Health < (0.3 * GetBaseAV Health))
		Yield
		set dueling to 0
	endif
endif

...

 

You'll need to define when dueling should be 1. Maybe through checking for a quest stage or AI package or something.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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