• 🏆 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!

unit killing upgrade

Status
Not open for further replies.
Level 4
Joined
Jan 13, 2013
Messages
92
how do i make an unit get upgraded every time it kills an enemy?

ex : archers kills enemy unit = +10 max hp +10 base damage
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
HP -> use item ability bug on maximum HP increase item ability. This is done by turning the item ability into a 2 level unit ability where level 2 gives less health (usually 0) than level 1. By adding the ability, setting it to level 2 and then removing it you will notice that the unit has gained (or lost, depending on settings) maximum health permanently. This is the best way to do it as it is leakless and fast.
Damage -> not sure if item ability bug works for this. Use damage tomes (yes you can temporarily give a non-hero an inventory, give it a tome and remove the inventory). Do remember to remove all tome items if used since they are not automatically removed.

There are many useful standard libraries you can use to do the above. Although I think the people who wrote them were vJASS/LUA freaks so they might not work properly anymore.

ex : archers kills enemy unit = +10 max hp +10 base damage
I would be careful with values like that. Usually 10 damage corresponds to 10 hp more lost. Since they usually fire more than once, this is a drastic statistical imbalance. Additional HP should be considerably larger than damage for this reason. You may also want to limit how far a unit can be upgraded like this to prevent a single unit becoming rigged. You may also want to award kills to nearby friendly units in the case that a unit is at the limit to prevent kill wastage.
 
Status
Not open for further replies.
Top