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

[Spell] Ignore Armor %

Status
Not open for further replies.
Level 4
Joined
Jan 8, 2012
Messages
66
Hello, I'm completely clueless on where to start on creating an ability that lasts for 10 seconds and causes the ability-user's attacks to ignore, let's say, 50% of the opponent's armor. Any pointers are welcome. Thanks in advance!
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Its not impossible but there is no easy way. It even can be very difficult to get the armor value of a unit in complex situations.

You might want to simplify it to e.g. -10 armor on attacked targets with a short lasting corruption buff or just get the damage value and inflict some extra damage on the enemy?
 
Level 17
Joined
Jul 17, 2011
Messages
1,863
you can use this system to first get a unit's armor (requires jass knowledge) and subsequently use some bonus mode library to add a negative armor ability which adds one half of the armor retrieved this way an attack against a unit will bypass 50% of its armor

however this method does come with some limitations: for example the armor ignoring is not for a single player and any other unit attacking it will also have its attack ignore 50% armor
 
Here's how

When the unit attacks another unit

Get that unit's armor type and armor value

Create a new unit with armor type and use bonus to set armor value to target unit's armor value

Keep using UnitDamageTarget until you get an exact match. This will get you the damage type.

Set dummy unit's armor value to half the armor value of the attacked unit
Apply UnitDamageTarget using found attack type
Clean dummy unit
Set damage to resulting damage


This method will correctly ignore half of the attacked unit's armor.

Be sure to use a DDS with priorities so that other libraries that manipulate damage don't get messed up. You want to apply offensive abilities first (linear, then percent), then defensive abilities (once again linear, then percent).
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
Here's how

When the unit attacks another unit

Get that unit's armor type and armor value

Create a new unit with armor type and use bonus to set armor value to target unit's armor value

Keep using UnitDamageTarget until you get an exact match. This will get you the damage type.

Set dummy unit's armor value to half the armor value of the attacked unit
Apply UnitDamageTarget using found attack type
Clean dummy unit
Set damage to resulting damage


This method will correctly ignore half of the attacked unit's armor.

Be sure to use a DDS with priorities so that other libraries that manipulate damage don't get messed up. You want to apply offensive abilities first (linear, then percent), then defensive abilities (once again linear, then percent).

That works, but its really really ugly. Storing the units current stats is a much cleaner solution (and it provides a great potential for triggering cool spells/buffs too!). Its much more flexible and less hacky.

Id say if this is really the only spell in your entire map that requires these kinds of triggers then you should go with Nestharus way. If you other cases where you need to access a units stats (damage, armor, liferegen, etc.) then you should write a system which stores and manages stats for every single unit on the map.
 
Status
Not open for further replies.
Top