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

[Solved] Idea for Magic Damage Reduction Unit Ability?

Level 21
Joined
Mar 16, 2008
Messages
955
Trying to add some upgrade to counter magic units. I tried using Runed Bracers (Spell Damage Reduction 'Alsr') as a unit ability and it doesn't seem to work. Hardened Skin, I can't seem to get working either. Any feed back or alternative ideas welcome. Thanks.
 
Level 30
Joined
Aug 29, 2012
Messages
1,383
You can use the Archer's Elune Grace ability most likely.

1721087674022.png


The magic damage reduction field needs to be read as "unit takes X% damage from magic" (in this case a 20% reduction)
 
Level 21
Joined
Mar 16, 2008
Messages
955
Adding the copy paste Elune's Grace to the unit as an Ability with tech tree requirement for upgrade, command card looks good, but doesn't seem to actually reduce magic damage. hmm. i used a creep with 10 magic damage to test. and a trigger to toggle the upgrade.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
Adding the copy paste Elune's Grace to the unit as an Ability with tech tree requirement for upgrade, command card looks good, but doesn't seem to actually reduce magic damage. hmm. i used a creep with 10 magic damage to test. and a trigger to toggle the upgrade.
After testing on the latest patch I found that Elune's Grace will work even when it's Tech Upgrade is not researched. So I'm not sure why yours didn't work.

I found the fix to be:
1) Give Elune's Grace 2 levels, the first level doing absolutely nothing (1.00% damage taken) and the second level doing what you want.
2) Create a Tech Upgrade that increases the Ability Level by 1.
1721107290703.png

3) ^ Don't forget to add it to the Ability's Upgrade Requirement and to the Unit's Upgrades Used.
 
Last edited:
Level 28
Joined
Dec 3, 2020
Messages
970
When testing on the latest patch, Elune's Grace will work even when it's Tech Upgrade is not researched.

I found the fix to be:
1) Give Elune's Grace 2 levels, the first level doing absolutely nothing (1.00% damage taken) and the second level doing what you want.
2) Make the Tech Upgrade increase the Ability Level by 1.
View attachment 480036
3) Don't forget to add it to the Ability's Upgrade Requirement and to the Unit's Upgrades Used.
Would the following trigger be a bad idea to use?

Event: every 0.25 seconds of game time
Conditions: Level of X upgrade for Y player equal to level 1
Actions: Pick every unit of type X for player Y and add spell damage reduction to picked unit(s)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
Would the following trigger be a bad idea to use?

Event: every 0.25 seconds of game time
Conditions: Level of X upgrade for Y player equal to level 1
Actions: Pick every unit of type X for player Y and add spell damage reduction to picked unit(s)
For an approach like that you would want to use two triggers and keep things Event based:

TRIGGER A:
Event: On upgrade researched
Conditions: It's your upgrade
Actions: Pick every unit of type X for player Y and add spell damage reduction to picked unit(s) + Turn on TRIGGER B

TRIGGER B (initially off):
Event: A unit Enters playable map area
Conditions: It's your Unit-Type + Upgrade Level >= 1
Actions: Add spell damage reduction to triggering unit

Relying on Periodic Intervals to constantly check for changes in the game is bad practice and can lead to bugs. Of course there's some exceptions, but there's almost always an Event that tells you the exact moment when something changes, plus you can create your own custom Events when one doesn't exist. This level of precision can be really important for creating a map that feels polished and responsive.

Anyway, I wouldn't use this approach over my own unless there's something forcing you. My method relies on the standard "Requirements" mechanic that the rest of the abilities use plus it doesn't rely on any triggers.
 
Last edited:
Level 28
Joined
Dec 3, 2020
Messages
970
For an approach like that you would want to use two triggers and keep things Event based:

TRIGGER A:
Event: On upgrade researched
Conditions: It's your upgrade
Actions: Pick every unit of type X for player Y and add spell damage reduction to picked unit(s) + Turn on TRIGGER B

TRIGGER B (initially off):
Event: A unit Enters playable map area
Conditions: It's your Unit-Type + Upgrade Level >= 1
Actions: Add spell damage reduction to triggering unit

Relying on Periodic Intervals to constantly check for changes in the game is bad practice and can lead to bugs. Of course there's some exceptions, but there's almost always an Event that tells you the exact moment when something changes, plus you can create your own custom Events when one doesn't exist. This level of precision can be really important for creating a map that feels polished.

Anyway, I wouldn't use this approach over my own unless there's something forcing you to. My method relies on the standard "Requirements" mechanic that the rest of the abilities use and doesn't rely on any triggers.
Of course, I also avoid triggers if possible in such situations.

I must agree that the 2 trigger approach is better than the one I asked about!
 
Level 12
Joined
May 29, 2008
Messages
149
Adding the copy paste Elune's Grace to the unit as an Ability with tech tree requirement for upgrade, command card looks good, but doesn't seem to actually reduce magic damage. hmm. i used a creep with 10 magic damage to test. and a trigger to toggle the upgrade.
I think there's a problem here: Magic Damage is not reduced by the abilities that reduce spell damage AFAIK. The editor names are wrong for 'magic damage' when it should be 'spell damage'. As far as I know the only way to reduce the magic damage a unit takes without triggers is by using their armor type.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
I think there's a problem here: Magic Damage is not reduced by the abilities that reduce spell damage AFAIK. The editor names are wrong for 'magic damage' when it should be 'spell damage'. As far as I know the only way to reduce the magic damage a unit takes without triggers is by using their armor type.
Worked fine for me. I tested using a Chimaera's magic attack which dealt reduced damage to the Archer.

The only bug I encountered was that it ALWAYS works even if you have a Tech Requirement "disabling" the ability.

But maybe you guys are on a buggy patch or something.
 
Level 21
Joined
Mar 16, 2008
Messages
955
EDIT: got it working. My misunderstanding, was something Uncle hinted at, was that Elune's Grace starts by default at rank 1, not rank 0, so when I put to upgrade the ability by 2, then it was putting Elune's Grace to rank 3 (which is defaulted to 0.00 Magic damage taken).
 
Last edited:
Top