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

How do i get this 'invulnerable' condition?

Status
Not open for further replies.
Level 11
Joined
Feb 11, 2010
Messages
199
For this ability called Invulnerable (Neutral).. not the Divine Shield type of invulnerability though.. i tried this condition but doesn't seem to work
  • ((Triggering unit) has buff Invulnerable) Equal to True

Here's your problem: Invulnerable (Neutral) does NOT apply a buff. Here's how you check that the unit has the ability:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Invulnerable (Neutral) for (Triggering unit)) Greater than 0
    • Then - Actions
    • Else - Actions
Just tested it and it works. :thumbs_up:
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Here's your problem: Invulnerable (Neutral) does NOT apply a buff. Here's how you check that the unit has the ability:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Invulnerable (Neutral) for (Triggering unit)) Greater than 0
    • Then - Actions
    • Else - Actions
Just tested it and it works. :thumbs_up:
It doesn't work with everything.
Checking 'Avul' works for most cases, but not so much reliable. Ofc it works with neutral building with the ability and units set by SetUnitInvulnerable, but I've tested and found out some cases that don't work well with it. It seems that the presence of 'Avul' cannot tell much about spell-driven invulnerabilities (e.g. Divine Shield, Big Bad Voodoo, Phoenix morphing to an egg).
(This quote comes from the first link I provide)

There are two other methods that can detect if a unit is invulnerable or not.
Invulnerability Detector
Check Invulnerable
Personally I like the first method better which checks if a unit can use a modified Finger of Death on a unit and doesn't trigger damage, though it relies on Object Editor Data.

The second method deals 0.01 damage to a unit to check if it took damage or not.
 
Level 11
Joined
Feb 11, 2010
Messages
199
Checking 'Avul' works for most cases, but not so much reliable. Ofc it works with neutral building with the ability and units set by SetUnitInvulnerable, but I've tested and found out some cases that don't work well with it. It seems that the presence of 'Avul' cannot tell much about spell-driven invulnerabilities (e.g. Divine Shield, Big Bad Voodoo, Phoenix morphing to an egg).

...Except that he specifically said he wanted to detect the ability Invulnerable (Neutral) and NOT Divine Shield or anything of the sort. Read the first post.

And the trigger in my response most definitely detects whether a unit is affected by Invulnerable (Neutral), which is what he asked for.
 
Last edited:
Level 14
Joined
Nov 18, 2007
Messages
1,084
I don't know why, but JassCraft (you can find it in wc3c) is having a native like that:
IsUnitInvulnerable().
JASS:
function IsUnitInvulnerable takes unit u returns boolean
    return (GetDamageFactor(u,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL)==0)
endfunction
Apparently, it might work (haven't tested it).
I think that's because JassCraft has functions from the CasterSystem. The method it uses with GetDamageFactor is similar to the second method I mentioned in my post.
 
Status
Not open for further replies.
Top