• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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

Status
Not open for further replies.
Level 4
Joined
May 11, 2020
Messages
43
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
731
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:
Status
Not open for further replies.
Top