i'm having problem coming up with a way to get a very low hp creature (but not 1 since even the highest armor allows for 1 hp blows to be dealt without any armor penetration bonuses).
is there a way to lower a creatures hp with scripting?
Débuté par
gordonbrown82
, janv. 22 2010 04:51
#1
Posté 22 janvier 2010 - 04:51
#2
Posté 22 janvier 2010 - 05:15
setmaxhealth worked for the hero when i put the code in the core_module replacement script inside the EVENT_TYPE_CHARGEN_END: brackets but it did not work for the enemy as i intended. Where should i place the setmaxhealth function in order to get an enemy down to a very low hp? what kind of event should be used?
#3
Posté 22 janvier 2010 - 05:55
Try playing with the CREATURE_SPAWN_HEALTH_MOD local variable on the creature you want to modify.
#4
Posté 22 janvier 2010 - 05:59
got it working with a trigger but that's not the ideal way to set it off. the best way would be when an event is sent to the area.
#5
Posté 22 janvier 2010 - 06:00
ok i'll check it out.
#6
Posté 22 janvier 2010 - 06:41
wait a minute what is that exactly?
#7
Posté 23 janvier 2010 - 01:32
It takes effect in creature_core.nss:
// -----------------------------------------------------------------
// Deal with creatures that start out with % of health
// as defined in creature var
// -----------------------------------------------------------------
float fHealthMod = MinF(GetLocalFloat(OBJECT_SELF,CREATURE_SPAWN_HEALTH_MOD),0.9f);
if (fHealthMod > 0.0f)
{
float fHealth = GetCurrentHealth(OBJECT_SELF);
fHealth = MinF(1.0f, fHealth * fHealthMod);
SetCurrentHealth(OBJECT_SELF,fHealth);
}
// -----------------------------------------------------------------
// Deal with creatures that start out with % of health
// as defined in creature var
// -----------------------------------------------------------------
float fHealthMod = MinF(GetLocalFloat(OBJECT_SELF,CREATURE_SPAWN_HEALTH_MOD),0.9f);
if (fHealthMod > 0.0f)
{
float fHealth = GetCurrentHealth(OBJECT_SELF);
fHealth = MinF(1.0f, fHealth * fHealthMod);
SetCurrentHealth(OBJECT_SELF,fHealth);
}
Modifié par FollowTheGourd, 23 janvier 2010 - 01:34 .





Retour en haut






