• 🏆 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] Dying unit can have a buff?

Status
Not open for further replies.
Level 6
Joined
May 31, 2008
Messages
218
I wonder if dying unit can have buffs? Cause i need a trigger where a unit dies and then checks if that dying unit got a specific buff. But it wont work, and the unit got that exact buff. That also leads me to the next question.
Let's say that dead units can not have buffs, then i need to use a similar system shown below.
  • Untitled Trigger 001
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Set tastegroup = (Units in (Playable map area) matching (((Matching unit) has buff A Taste of Death (CULT OF KHAUGOR)) Equal to (==) True))
Since unit groups leak they need to be destroyed, but i need this unit group to be the same all the time, how can i prevent leaks?
 
The only way to achieve this is to add your unit into a unit group. Create a unit group and once a unit is targeted by the spell that adds the buff, add the unit into a unit group and remove it once the duration is over. If you want this for auras, you will need advanced aura systems.
To check if the dying unit has buff, the conditions Unit has buff will be replaced by the Boolean:
  • ((Triggering unit) is in BuffedGroup) Equal to True
 
Level 6
Joined
May 31, 2008
Messages
218
The only way to achieve this is to add your unit into a unit group. Create a unit group and once a unit is targeted by the spell that adds the buff, add the unit into a unit group and remove it once the duration is over. If you want this for auras, you will need advanced aura systems.
To check if the dying unit has buff, the conditions Unit has buff will be replaced by the Boolean:
  • ((Triggering unit) is in BuffedGroup) Equal to True
But i can just add a wait command into that trigger? And don't bother about the random stuff inside the trigger,
  • Tastegroup creation
    • Events
      • Unit - A unit Is attacked
      • Unit - A unit Finishes casting an ability
    • Conditions
      • ((Attacked unit) has buff A Taste of Death (CULT OF KHAUGOR)) Equal to (==) True
      • ((Target unit of ability being cast) has buff A Taste of Death (CULT OF KHAUGOR)) Equal to (==) True
    • Actions
      • Unit Group - Add (Attacked unit) to tastegroup
      • Unit Group - Add (Target unit of ability being cast) to tastegroup
      • Wait 180.00 seconds
      • Unit Group - Remove (Attacked unit) from tastegroup
      • Unit Group - Remove (Target unit of ability being cast) from tastegroup
Dieing units do not have buffs.

Also I advise group recycling (jass as GUI sucks too much for this) as that saves allocation and deallocation of handles.
A big questionmark = ?
 
Last edited:
Level 6
Joined
May 31, 2008
Messages
218
Dying units can not have buffs.

Anyway you trigger above wont work cause only 1 condition could ever be true at the same time, thus you have to use them in or mode (currently and mode).

That's what i meant with just ignore the multiple stuff. I tried both attacking unit and casting unit, that's why.
But i can't get it to work anyway :/
 
Status
Not open for further replies.
Top