Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Run a periodic timer that checks item life with GetWidgetLife, maybe something like this:
JASS:
function onUpdate takes nothing returns nothing
local real life = GetWidgetLife(itm)
if life < 0.405 then // maybe it should be "<=", I'm not sure
// Item was destroyed
// ...
// ...
// ...
elseif life < BlzGetItemIntegerField(itm, ITEM_IF_MAX_HIT_POINTS)
// Item was damaged
// ...
// ...
// ...
endif
endfunction
call TimerStart(updateTimer, 0.1, true, function onUpdate)
If there are multiple items, you need to add them to a list and iterate through it.
Items are widgets, so you should be able to use this widget event: constant widgetevent EVENT_WIDGET_DEATH = ConvertWidgetEvent(89)
But... there's no TriggerRegisterWidgetEvent... wtf Blizzard?
Luckily, there is also this native: native TriggerRegisterDeathEvent takes trigger whichTrigger, widget whichWidget returns event
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.