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