// неправильно
function myFunc takes nothing returns nothing
call UnitAddAbility(GetTriggerUnit(), 'A000')
call UnitAddAbility(GetTriggerUnit(), 'A001')
call UnitAddAbility(GetTriggerUnit(), 'A002')
call UnitAddAbility(GetTriggerUnit(), 'A003')
call UnitAddAbility(GetTriggerUnit(), 'A004')
call UnitAddAbility(GetTriggerUnit(), 'A005')
if GetWidgetLife(GetTriggerUnit())>100.then
call SetWidgetLife(GetTriggerUnit(), 100.)
endif
endfunction
// правильно
function myFunc takes nothing returns nothing
local unit u=GetTriggerUnit()
call UnitAddAbility(u, 'A000')
call UnitAddAbility(u, 'A001')
call UnitAddAbility(u, 'A002')
call UnitAddAbility(u, 'A003')
call UnitAddAbility(u, 'A004')
call UnitAddAbility(u, 'A005')
if GetWidgetLife(u)>100.then
call SetWidgetLife(u, 100.)
endif
set u=null
endfunction