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

Hi, How do I raise a unit's armor using triggers?

Status
Not open for further replies.
Level 4
Joined
Jun 22, 2009
Messages
36
How do I raise a unit's armor class using triggers for a moment, then lower it? And when I say this I don't mean doing so by making the unit invulnerable? Please respond. If there is no way to do so, is there a way to make units that are invulnerable via triggers able to be attacked?
Thanks!:grin:
 
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • Ability being cast equal to (bone shield)
  • Actions
    • Set (integer variable) to current health of (your unit)
  • Events
    • Unit - A unit is attacked
  • Conditions
    • Unit being attacked has (the buff from the spell) equal to true
  • Actions
    • Unit - Set the health of (attacked unit) to (integer variable)
Not sure if that's correct, I know the wording isn't perfect because i'm too lazy to open up WE
 
I'm sorry, I'm really a newbie at this. What would I set the Real value to? Unit percentage life? Is the Variable an array?:confused:
Please help...:sad:

Set the real variable's value to the unit's current life because percentage value can change if you suddenly level up or gain a max life upgrade.....

I think setting health requires a real value not an integer.....

You need an array if you intend to use it for many units I think but if you could only have one unit under the effect of the spell you won't need an array...
 
Level 7
Joined
Mar 8, 2009
Messages
360
An alternative way to do it:

1) Copy an item armor bonus ability (object editor - special - items)

2)Set its defense bonus to 1000

3)Use this to add the armor to the unit:
  • Unit - Add Item Armor Bonus (+1000) to (Triggering unit)
4)Use this to remove the armor:
  • Unit - Remove Item Armor Bonus (+1000) from (Triggering unit)
 
Level 6
Joined
Mar 22, 2009
Messages
276
do you want a single unit's armor?
or units in within an area?
because i know something that may help you.
taddaa!! its a dummy unit with devotion aura!! ^_^
it's like Omniknight's guardian angel in dota :D
 
Level 6
Joined
Mar 8, 2007
Messages
192
The aura is pretty much fail, escapiley if you want to remove it or change the values per trigger. I had alot of problems with this ability till i switched to Item: Defend bonus.
 
Status
Not open for further replies.
Top