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

Breakthrough divine shield

Status
Not open for further replies.
Level 2
Joined
Oct 8, 2021
Messages
4
I just wanna make a spell allows my unite attacks the enemy's unite when the enemy's unite has a divine shield
 
Level 4
Joined
Sep 21, 2022
Messages
30
Pls further tell more exactly what you mean, because description is quite scarce. Nobody is able to attack invulnerable units. The only way for you is to create your enemy's Divine Shield and ability to beat it - based on another ability, for example - Metamorphosis - you need just to create alternate version of your enemy with divine type of armor and modified versions of Hardened Skin and Anti-Magic Shell abilities that will prevent him from taking any damage. Then when you activate your Anti-Divine Shield ability you remove Hardened Skin and Anti-Magic Shell buff from enemy by trigger and transform your hero to the same version of himself, but with chaos attack which is able to penetrate divine armor. Con of this method - all other units also will be able to attack your enemy, but the only of them who has chaos attack will be capable to deal some significant damage to him. I hope I understood you correctly and it will be useful for you. The other alternate much more simple, but less versatile method - you can damage invulnerable units by dispel magic if they are summoned
 
Last edited:

Remixer

Map Reviewer
Level 33
Joined
Feb 19, 2011
Messages
2,112
Invulnerable units can be attacked and this is easy to detect, though the attacks deal no damage, which means that you need to deal the damage by SetUnitState instead, and if the new life value is below 0.405 (or 0), then just remove the invulnerability and deal the actual damage from its source. Thus the solution consists of three parts:
A) Detecting when an invulnerable unit is attacked - this can be done through checking for example by buff (such as Divine Shield) if there's specific source of invulnerability you want to be affected, or by BlzIsUnitInvulnerable() function.
B) Dealing with the attack's damage by calling the Unit is about to take damage -event and change the target unit's life value by SetUnitState() function. If the new life value is below 0.405, then you'd want the damage source to kill the unit for real to allow bounty and experience gain (along the other factors).
C) Enabling units to attack invulnerable targets - this can be done through the SetUnitWeaponIntegerField() function. To find the correct integer value to enable the attacks against invulnerable units, I'd recommend using the call GetUnitWeaponIntegerField() function on a unit type that can by default target invulnerable units - for example a melee unit that can attack invulnerable units has integer value of 3146042 in the mentioned integer field.
 
Level 2
Joined
Oct 8, 2021
Messages
4
Invulnerable units can be attacked and this is easy to detect, though the attacks deal no damage, which means that you need to deal the damage by SetUnitState instead, and if the new life value is below 0.405 (or 0), then just remove the invulnerability and deal the actual damage from its source. Thus the solution consists of three parts:
A) Detecting when an invulnerable unit is attacked - this can be done through checking for example by buff (such as Divine Shield) if there's specific source of invulnerability you want to be affected, or by BlzIsUnitInvulnerable() function.
B) Dealing with the attack's damage by calling the Unit is about to take damage -event and change the target unit's life value by SetUnitState() function. If the new life value is below 0.405, then you'd want the damage source to kill the unit for real to allow bounty and experience gain (along the other factors).
C) Enabling units to attack invulnerable targets - this can be done through the SetUnitWeaponIntegerField() function. To find the correct integer value to enable the attacks against invulnerable units, I'd recommend using the call GetUnitWeaponIntegerField() function on a unit type that can by default target invulnerable units - for example a melee unit that can attack invulnerable units has integer value of 3146042 in the mentioned integer field.
Could you please do it and upload the spell
Pls further tell more exactly what you mean, because description is quite scarce. Nobody is able to attack invulnerable units. The only way for you is to create your enemy's Divine Shield and ability to beat it - based on another ability, for example - Metamorphosis - you need just to create alternate version of your enemy with divine type of armor and modified versions of Hardened Skin and Anti-Magic Shell abilities that will prevent him from taking any damage. Then when you activate your Anti-Divine Shield ability you remove Hardened Skin and Anti-Magic Shell buff from enemy by trigger and transform your hero to the same version of himself, but with chaos attack which is able to penetrate divine armor. Con of this method - all other units also will be able to attack your enemy, but the only of them who has chaos attack will be capable to deal some significant damage to him. I hope I understood you correctly and it will be useful for you. The other alternate much more simple, but less versatile method - you can damage invulnerable units by dispel magic if they are summoned
Do you mean there's no way to create a spell could do it
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
You can't detect when an invulnerable unit is attacked using the normal events, since the order to issue the attack is interrupted and the "attacK" Event never happen.

That rules these two Events out:
  • Unit - A unit is attacked
  • Unit - A unit is issued an order targeting an object
However, you can however do what Remixer said in C), which would be to modify the Targets Allowed field of your units to allow them to attack Invulnerable units.

Search for it in the Actions -> Set Unit Integer field.
 

Remixer

Map Reviewer
Level 33
Joined
Feb 19, 2011
Messages
2,112
You can't detect when an invulnerable unit is attacked using the normal events, since the order to issue the attack is interrupted and the "attacK" Event never happen.
This event fires just fine, even on invulnerable targets and returns the correct damage value.
  • Unit - A unit About to take damage
Could you please do it and upload the spell
I think I don't have it in me to create the spell in GUI and I do not know which code language you use in your map.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
This event fires just fine, even on invulnerable targets and returns the correct damage value.
  • Unit - A unit About to take damage

I think I don't have it in me to create the spell in GUI and I do not know which code language you use in your map.
I understand, I just wanted to clarify that "attacked" and "takes damage" are two different things.

When you talk about Attacking there's no other Event than this one:
  • Unit - A unit is attacked
I realize I'm being an annoying stickler, but there's so many threads asking for one thing when they mean another. "I want an attack that does this", meanwhile they mean they want a custom Ability, etc...
 
Status
Not open for further replies.
Top