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

[Spell] Blocking Trigger Spell Damage

Status
Not open for further replies.
Level 5
Joined
Jan 19, 2018
Messages
126
Hello everyone,
I have a map where Hero ability damage is caused by triggers (Because I need dynamic damage for the abilities as they are partly affect by Hero Stats). I noticed the spell block ability doesn't block damage caused by trigger spells. Is there a way to fix this?

Thanks in advance.
 
Level 13
Joined
May 10, 2009
Messages
868
Check if unit has that specific buff prior to applying damage to it. Use boolean comparison for it (Unit - unit has a specific buff).
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (TARGET has buff Spell Shield) Equal to False
    • Then - Actions
      • -------- Damage TARGET --------
    • Else - Actions
      • Unit - Remove Spell Shield buff from TARGET
      • Special Effect - Create a special effect attached to the origin of TARGET using Abilities\Spells\Items\SpellShieldAmulet\SpellShieldCaster.mdl
      • Special Effect - Destroy (Last created special effect)
Or even better, avoid any spell instance from running, and remove the spell shield buff from target.

EDIT: Well, I just assumed you were talking about Spell Shield buff. However, you could be talking about magic immune units. In that case, then use boolean comparison again for checking if unit is indeed magic immune (Unit - Unit Classification Check).

  • (TARGET is Magic Immune) Equal to True
 
Last edited:
Level 5
Joined
Jan 19, 2018
Messages
126
Check if unit has that specific buff prior to applying damage to it. Use boolean comparison for it (Unit - unit has a specific buff).
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (TARGET has buff Spell Shield) Equal to False
    • Then - Actions
      • -------- Damage TARGET --------
    • Else - Actions
      • Unit - Remove Spell Shield buff from TARGET
      • Special Effect - Create a special effect attached to the origin of TARGET using Abilities\Spells\Items\SpellShieldAmulet\SpellShieldCaster.mdl
      • Special Effect - Destroy (Last created special effect)
Or even better, avoid any spell instance from running, and remove the spell shield buff from target.

EDIT: Well, I just assumed you were talking about Spell Shield buff. However, you could be talking about magic immune units. In that case, then use boolean comparison again for checking if unit is indeed magic immune (Unit - Unit Classification Check).

  • (TARGET is Magic Immune) Equal to True
Thank you BloodSoul, I'll give it a go and let you know the results, I'm expecting that to work of course as your solution seems pretty straight forward.
Thanks!

Edit
To my surprise it doesn't seem to work if the target has an item with the spell shield ability as it does not give them a buff. Simply checking if the unit has the item isn't an option because that ignores the item's cool down. Not sure what to do =/
 
Last edited:
Level 3
Joined
May 12, 2015
Messages
32
Maybe before dealing damage you can order a dummy to cast a dummy spell (that puts a buff for 0.01 sec e.g Slow) on the target then check if unit has the the dummy buff placed by ur dummy spell, if the unit has the buff then deal damage, however do nothing if the unit doesnt have the buff.
 
Level 5
Joined
Jan 19, 2018
Messages
126
Have you tried switching Spell with Magic?
I don't think playing with the spell types will work, I'm pretty sure it needs to be handled in a trigger but I would like a trigger that can handle all
spells so I don't have to add that specific functionality into every trigger spell I make.
 
Level 13
Joined
May 10, 2009
Messages
868
Then the easiest way to achieve that would be sacrificing one target-unit ability that places a buff, create a new function which orders an enemy dummy unit to place such buff on a target and checking if it has that specific buff. Otherwise, the target is either magic immune or a spell shield has blocked it.

Possible abilities: banish, frenzy, bloodlust, slow, entangling roots, cripple, curse, inner fire, faerie fire, mind rot, wand of shadowsight. Personally, I would choose wand of shadowsight over mind rot, because mind rot requires that targets do have maximum mana > 0, and shadowsight isn't so useful/common in my opinion (it reveals a target permanently).
 
Status
Not open for further replies.
Top