🏆 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!
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.