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

Unit immune to own spells

Status
Not open for further replies.
Level 7
Joined
Jan 11, 2022
Messages
108
Is there a way to make unit immune to damange-spells that it's casting? For example I want flamestrike to not damage the caster, same for rain of fire etc (i dont want to make caster invulnerable during casting)
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
A very simple way is to detect damage taken via triggers, check if the damage source (unit dealing damage) is the same as the damage target (unit that will take the damage) and if so, set the damage amount to 0.00
Something like this:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Damage source) Equal to (Damage Target)
    • Actions
      • Event Response - Set Damage of Unit Damaged Event to 0.00
If you are on older patches then you will need damage detection system. If you already imported some damage detection system into your map (even if you are on latest patch), then you should use the system, but the basic idea will be the same.
 
Status
Not open for further replies.
Top