Unit Health Dependent on Hero's

Kyuft

Member
Reaction score
11
I was wondering if it is possible to have a Hero cast a spell that creates a unit with the same amount of health as it. I know how to create the unit and all, but I don't know how to make it's maximum health equal to that of the caster. Is it possible in data? If not, I have no problem doing it in triggers, considering that seems like the only way to do it. As far as efficiency for triggers, I was thinking about taking the Unit's maximum health, dividing it by the Hero's health, Multiplying that by 100, subtracting it by 100, multiplying that by -1, to make it positive, and reducing dmg by that amt. For example, Hero has 2500 health and Unit has 500.
500 / 2500 = .2
.2 * 100 = 20
20 - 100 = -80
-80*-1 = 80
Reduce incoming dmg by 80%

-Kyuft:shades:
 

Dave312

Censored for your safe viewing
Reaction score
269
Maybe I'm missing something, but why don't you just use the Set Unit Property action to set the units maximum life to your desired value?

I think I might know of a way of doing this via data which adds a stackable buff which increases the units maximum life by set increments, but I would need to look into it further. Let me know if your interested, but using triggers to set the units life would be much easier.
 

Kyuft

Member
Reaction score
11
I thought about doing that, but I decided not to. I can't remember why I thought that the Set Unit Property was a bad idea. Well, I guess that's what I'll end up doing.

-Kyuft:shades:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top