(1.31) Custom script: "Any unit takes damage" event

Level 3
Joined
Sep 15, 2011
Messages
55
The recent patch to 1.31 had, in the notes, a reference to new capability for custom scripts to detect when any unit is damaged for a trigger event. Does anyone know how exactly I would write such an event in custom script?
 

Dr Super Good

Spell Reviewer
Level 62
Joined
Jan 18, 2005
Messages
27,086
Does anyone know how exactly I would write such an event in custom script?
The same as with any player unit event.
JASS:
call TriggerRegisterPlayerUnitEvent(YourTrigger, YourPlayer, EVENT_PLAYER_UNIT_DAMAGED, null)
Note this was constructed for the 1.31 PTR, I have not updated the native list of the program I used to look up the names for 1.31 release.
 
Level 3
Joined
Sep 15, 2011
Messages
55
The same as with any player unit event.
I've never used custom scripts for any player unit event; I've always used GUI. This is why I was asking, because so far, I've used actions to add an event to another trigger to detect unit damage. But I'd rather have a way to do this without needing an indexer. Thanks!
 
Top