HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Changing Unit max life

01-12-2003, 09:35 AM#1
Guest
How would i go about making a function that would change the max life of a unit?
01-12-2003, 09:47 AM#2
AIAndy
The right function to use is SetUnitState.

call SetUnitState(whichUnit, UNIT_STATE_MAX_LIFE, newMaxLife)

So
call SetUnitState(u, UNIT_STATE_MAX_LIFE, 100)
would set the max life of the unit u to 100.
01-12-2003, 09:51 AM#3
Guest
i put this in a trigger
call SetUnitState( gg_unit_hpea_0000, UNIT_STATE_MAX_LIFE, 1000 )
but it didnt work
it worked thoe if i put in just UNIT_STATE_LIFE what did i do wrong