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

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,258
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