• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Spell immunity

Status
Not open for further replies.
Level 3
Joined
Apr 12, 2014
Messages
23
Hi!
I want to make spell immunity for my hero, but not all-spell-immunity, just one of them.

My first idea was that I could make a default active ability, and when an enemy use that spell, which one should have no-effect on my unit, I just check (with trigger) if my hero has the ability, but it seems I can not detect default active ability (at least I haven't found it).

How can I do it?
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
If the enemy spell is triggered, you can just filter if he has Spell Immunity ability so it can't be damaged by the spell , so the trigger of @Retarted_Hobo does the job to detect whether your unit has Spell Immunity or not, and then you can filter your units to damage
For example :
  • Set Enemies_AOE = (Units within 600 aoe matching condition ((Matching Unit) belongs to an enemy of Caster)
  • Unit Group - Pick Every unit in Enemies_AOE and do multiple actions :
    • Loop - Actions
      • If/Then/Else :
        • Conditions
          • (Level of Ability (Spell Immunity) of (Picked Unit)) Equal to 0
        • Then - Actions
          • Unit - Cause (Caster) to damage (Picked Unit) 300 damage of type Fire attack...
        • Else - Actions
          • === It can't be damaged ===
 
Level 3
Joined
Apr 12, 2014
Messages
23
If the enemy spell is triggered, you can just filter if he has Spell Immunity ability so it can't be damaged by the spell , so the trigger of @Retarted_Hobo does the job to detect whether your unit has Spell Immunity or not, and then you can filter your units to damage
For example :
  • Set Enemies_AOE = (Units within 600 aoe matching condition ((Matching Unit) belongs to an enemy of Caster)
  • Unit Group - Pick Every unit in Enemies_AOE and do multiple actions :
    • Loop - Actions
      • If/Then/Else :
        • Conditions
          • (Level of Ability (Spell Immunity) of (Picked Unit)) Equal to 0
        • Then - Actions
          • Unit - Cause (Caster) to damage (Picked Unit) 300 damage of type Fire attack...
        • Else - Actions
          • === It can't be damaged ===
I did not see your comment when I write my last post, but I like it. It will be useful and has more possibilities. I was thnking about something like that with item (which fits more than a spell in my campaign), so you save me some time from thinking about how to do it exactly.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
I did not see your comment when I write my last post, but I like it. It will be useful and has more possibilities. I was thnking about something like that with item (which fits more than a spell in my campaign), so you save me some time from thinking about how to do it exactly.

You can use it with items too, since it uses abilities too... :) Glad I did my job
 
Status
Not open for further replies.
Top