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

Get Armor value

Status
Not open for further replies.
Level 30
Joined
Jul 23, 2009
Messages
1,033
I am trying to base a defensive spell with a value based on the caster's armor value but this option is not in the editor by default. Does anyone know a good way to get armor value from a unit? I have tried searching for systems but they usually just calculate the armor of targets when damage is dealt to them.
 
basically, if you want to dynamically get the armor value, the method that the systems you found are the easiest way...

else, you would need to save each unit's base armor, then the armor per agility, then the values of any armor addition/reduction abilities (both unit and item)... then you will obtain the total armor by getting the base armor, then checking if the unit is affected by any addition/reduction ability/aura and how much armor he gains/loses from his items...
 
Level 11
Joined
Nov 15, 2007
Messages
800
What's wrong with dealing damage to calculate armor? You can make it completely undetectable by anyone playing the map. Any other way would just be very convoluted.
 
Use this system imo:
http://www.wc3c.net/showthread.php?t=105849

Follow the implementation directions. It uses an ability to increase the life of a unit, then deals a certain amount of damage (and then removes the ability) so that it can calculate armor. It will make life easier and shouldn't have any bugs. (although, make sure you keep in mind that it fires a damage event)
 
Status
Not open for further replies.
Top