• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Is there anyway to ADD (not set) HP to a unit?

Status
Not open for further replies.
Level 17
Joined
May 6, 2008
Messages
1,598
Is there anyway to add HP to a unit, IE; a unit has 25 HP and I want to add 50 HP to the unit.

Or do I have to store the current HP in a variable and then add the hp and the current in one action?
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
it can be done with GUI:
unit - set X hitpoints = X unit' hp + Y
where X is the unit, and Y is the amount of hp you want to increase

yeah thats the Unit - Set HP function, i think this is the Simplest way
Does not work.
You can't set the hp to more than 100% using gui - use the SetMaxState or the way redscored described it
 
I think there is an item(i don't know the name, its something with health) its a green book with panda's head on it(i think it is health bonus+50) and it aplies itself automaticly, just remove the effect and edit bonuses than(if you have a trigger) add it trough triggers, if you have an item just change the health bonus

Edit:
Item is "Manual of Health"
And the ability is "Item Permanent Life Gain(+50)"

HF -BZR-
 
Level 11
Joined
Apr 6, 2008
Messages
760
he want to Increase the unit max hp with X amount

i would recommend using Bonus Mod & SetUnitMaxState

This set the max hp to a value (e.g set "value" to 100 and the max hp on the unit gets 100)

  • Custom script: call SetUnitMaxState("Unit",UNIT_STATE_LIFE,"value")
and this add to max hp (Current max hp + "value" e.g Max hp is 100 and u up 100 as "value", the unit get 200 maxhp)

  • Custom script: call AddUnitMaxState("Unit",UNIT_STATE_LIFE,"value")
that easy to use this system


EDIT:

Captain Griffen, did allrdy say this :p but i explained it abit more
 
Level 17
Joined
May 6, 2008
Messages
1,598
What the hell are you talking? please explain better or stop asking ~.~.

Well, if you want it like a heal you need to get the current life and add the life.
Crap, you're right. I suck at explaining, and I got my solution, thanks all.
 
Status
Not open for further replies.
Top