• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Get Armor value

Status
Not open for further replies.
Level 30
Joined
Jul 23, 2009
Messages
1,029
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
781
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