Jump to content

Permanently reducing health of all humans ?


arael53

Recommended Posts

Hello,

 

I'd like to normalize the health of most humans in the game. I feel like if the player and the human NPCs should have the same health range. I'd like to reduce the health of human NPCs they exceed I chosen value. IE, If a NPC has more than 500 health, I'd like to find a way to mod his health to 500.

I tried a simple spell that would damage max health if the NPC has more than 500 health, but as soon as he get below 500 health, the effect stops, so he has more than 500 health again, then the effect works, so he has less than 500... And it never stops.

 

is there a way to reduce the max health of NPC without altering evey NPC one by one ?

 

Thanks !

Edited by arael53
Link to comment
Share on other sites

You are damaging the floating value for health, NPCs have an auto health regeneration feature which is healing them back to base health value:

ThisActor.GetValue(pHealth)     ;this is the actual health right now with boosts and damage 
ThisActor.GetBaseValue(pHealth) ;this is the target base with no modifiers

You need to modify the base value for health like this:

ActorValue Property pHealth Auto Const Manadatory
Function SetActorHealth(ObjectReference ThisActor)
 Float fTargetHealth = Game.GetPlayer().GetBaseValue(pHealth) 
 If (ThisActor.GetBaseValue(pHealth) >  fTargetHealth)
    ThisActor.SetValue(pHealth,  fTargetHealth)
 EndIf
EndFunction
Link to comment
Share on other sites

  • Recently Browsing   0 members

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