Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Dark Dreams of Furiae - a new module for NWN:EE! Buy now
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Help with Hit Point script

Trying to make a hit point check on one of my monsters. Id like to check when its down to 25% health to spawn in a bunch of his buddies. The spawn i can handle, its the hp check I dont understand do well.

Any help would be great.

Comments

  • FreshLemonBunFreshLemonBun Member Posts: 901
    Hit points are whole numbers so to avoid a fraction multiply the current hitpoints by 100 and divide it with the maximum hitpoints. You'll still lose fractions but these will be less than 1% of total hitpoints.
    percent = (100 * GetCurrentHitPoints(oCreature)) / GetMaxHitPoints(oCreature);
    if (percent <= 25)
    {
    	//do stuff
    }
    

Sign In or Register to comment.