[Solved] Stacking hp increase when killing units with specific buff

Level 4
Joined
May 11, 2020
Messages
41
i'm working on an ability that debuffs an enemy unit, and if said unit dies in the duration the caster gains a max hp increase. However when a unit dies all buffs are purged, so it can't pass the check and thus can't trigger the hp increase. Any idea how to work around this?
 
Level 13
Joined
Oct 16, 2010
Messages
714
If you're only intending on having 1 hero with ability you could try adding units to a group when the spell is cast on them, having a periodic check to see if they have the buff (if not remove from group), then a trigger to check if a unit within the group dies - if they die while still in the group then add hp?

If multiple units/heroes are able to use this ability it'd be more difficult but still possible
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Others have said it, you can play around with Unit Group to register them as a part of the "Buff Recipient" and remove them if they die OR the buff expires.

I have attached a test map.
Test it out.
 

Attachments

  • DEBUFF.w3m
    15.7 KB · Views: 14
Last edited:
Top