Aller au contenu

Photo

is there a way to lower a creatures hp with scripting?


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
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).

#2
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
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
Craig Graff

Craig Graff
  • Members
  • 608 messages
Try playing with the CREATURE_SPAWN_HEALTH_MOD local variable on the creature you want to modify.

#4
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
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
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
ok i'll check it out.

#6
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
wait a minute what is that exactly?

#7
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
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);
}

Modifié par FollowTheGourd, 23 janvier 2010 - 01:34 .