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

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 29
Joined
Sep 26, 2009
Messages
2,596
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