• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Change a unit's health regeneration on % base

Status
Not open for further replies.

Ardenian

A

Ardenian

What would be the best way to permanently change a unit's health regeneration ?

To specify, how would an item/ ability of this kind created in Warcraft:
'Adds 5% health-regeneration'
If the item is equipped, the unit's health regeneration is increased by 5%.
If it is unequipped, the 5% are removed.

Is it possible to efficiently do this without indexing all units with these kind of items and looping and adding 5% of the health-regeneration to the current health ?
 
Level 11
Joined
Jan 23, 2015
Messages
788
maybe add every unit to a separate group for every item (unit group) once they pick the item, and remove them from the group once they drop it.. then in another trigger, you pick all units in UnitsWearingBracelet and do actions: ---> regenerate life of picked unit / 100 * 5 (5%) bla bla bla, I think you already know what to do next..
 

Ardenian

A

Ardenian

Yes, that's one approach. I don't think this is efficient tho.

I wonder whether there is a way to modify health regeneration before it is added.
 

Ardenian

A

Ardenian

Well, if it possible to do so with damage, like in the PDD and such, then maybe also with regenerations.
 
Level 12
Joined
May 22, 2015
Messages
1,051
I triggered regeneration in my map (and I'm working on making all other healing effects use the same function to heal). This allows me to use it like a damage detection system where I detect the heal and can do whatever I want afterwards.

I think there may be an upgrade to increase health regeneration by %, but it would probably only affect base health regeneration and you can't get rid of the research in any way once it is added.
 

Ardenian

A

Ardenian

Wouldn't fully triggering it make it lag ? I could imagine it drops the fps once many units are affected.

There is an item ability, for health-regeneration with a percentage option, but I don't know how it behaves, didn't test it.


When I use the PDD, it isn't detected as negative spell damage ?
 
Level 12
Joined
May 22, 2015
Messages
1,051
Wouldn't fully triggering it make it lag ? I could imagine it drops the fps once many units are affected.

There is an item ability, for health-regeneration with a percentage option, but I don't know how it behaves, didn't test it.


When I use the PDD, it isn't detected as negative spell damage ?

I don't think it is detected as damage at all. Otherwise, spell resistance would negate healing (probably). You can always try it, though. I've never used PDD.

The % health regeneration abilities usually mean % of total health. You can test some out with a unit that has a lot of health and just make sure it isn't healing 100's of health at a time.

The health regeneration for my map only affects the heroes and units that have items / effects that modify health regeneration. It is run 4 times per second. In a typical game, it is affecting maybe 5-10 units at max. Even if you purposely gave health regeneration items to many units, the amount of times this happens is still less than the damage detection in my map. There are a couple hundred units that could all be attacking and poisoning each other and stuff. You would have to be careful with it the same way you have to be careful with damage detection. If it is run a lot, it can lag.

Keep in mind that knockback systems usually run 25+ times per second and easily handle more than 5-10 units. Computers are fast :D
 
Level 11
Joined
Jun 2, 2013
Messages
613
You might could do something like this:

Use an Item Acquire/Drop event that does a for loop through the unit's inventory to check what the current items are. Set a temporary variable that adds up to the total percentage for each item in the for loop. Do an if/then else check of that variable to set the level of a hidden spell-book Unholy Aura ability to equal out the percentage of health from the items

I'm Pretty iffy that would work but it's a thought.
 

Ardenian

A

Ardenian

Hm, I think I have to use custom auras then. You don't know by chance whether auras based on item abilities are hidden, too ?

I think triggering the health regeneration might be too much for my issue, but thank you!
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
When you use FirstOfGroup() iterations, looping through all units on the map isnt that heavy.

On the other hand... I dont really understand what you are trying to do but are you trying to increase the health regeneration by 5% or do you want to add 5% regeneration?

Regeneration = 2/s
Regeneration + bonus = 2 * 1.05 = 2.1/s

or

Regeneration = 2/s
Regeneration + bonus = 2 + 0.05*MaxHealth = ?/s
 

Ardenian

A

Ardenian

The first one, not based on the maximum health, but on the current regeneration.

So in GUI I basically pick every in unit in the playable map area ?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
In GUI it is much more difficult than that.
It would be a lot of Custom Scripts to make it work properly and you need something to rely on as the value.

And on the other hand... you need something to find out how much regeneration your unit has.
 

Ardenian

A

Ardenian

Oh, this gets too complicated for me, I just cut it off my map, then, I guess.
 
Status
Not open for further replies.
Top