• 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.

Decreasing unit max HP

Status
Not open for further replies.
Level 3
Joined
Aug 19, 2005
Messages
47
Let's say I have an unit which starts with 1000 hp. How can I decrease its max HP to 900 on the run? JASS allowed.

TY
 
Level 3
Joined
Aug 19, 2005
Messages
47
That system is a bit overkill for me, I just want to drop the HP from 1000 to 900. I know it is something with adding and removing bonus HP ability, but I managed only to increse max HP, not to decrease it.
 
Level 8
Joined
Feb 20, 2007
Messages
338
Through triggering there are two functions:

  • Actions
    • Unit - Set life of (Triggering unit) to 100.00%
    • Unit - Set life of (Triggering unit) to 900.00
The first is percentages, the second is a value.

I have no idea what event and/or conditions you need to trigger the trigger.
 
Level 5
Joined
Jul 26, 2004
Messages
99
Here's a fairly simple way to do it using "upgrades".

Create a unit with 900 max hit points.
Give it an upgrade that increases it's max health by 100.
Automatically apply the upgrade at map startup (or whenever) so that it will have 1000. To lower it's health, simply reduce the level of the upgrade.

To only have a "specific unit" receive the effect, you could make the upgrade non-global (do this by inputing "true" for 'applies to all units' within the upgrade... don't ask me why it's backwards, it just is). This makes it so that the upgrade will only apply to units that are made after the upgrade takes effect. So, you could:

1. decrease the upgrade
2. replace the unit with the same type, facing same direction and keeping it's current hp/health etc.
3. re-increase the upgrade (to ready it for future occasions).

Hope all that made sense.
 
Status
Not open for further replies.
Top