- Joined
- Jul 10, 2007
- Messages
- 6,306
JASS:
struct tester extends array
private static unit u
private static unit u2
private static method ts takes nothing returns nothing
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,R2S(GetWidgetLife(u))+"=="+R2S(GetWidgetLife(u2)))
endmethod
private static method r takes nothing returns boolean
call ReviveHero(u,GetWidgetX(u),GetWidgetY(u),false)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE))
return false
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer l=1000
set u = CreateUnit(Player(0), 'Hpal', GetStartLocationX(0), GetStartLocationY(0), 0)
set u2 = CreateUnit(Player(0), 'Hpal', GetStartLocationX(0)+128, GetStartLocationY(0), 0)
call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function thistype.r))
call SetHeroLevel(u,l,false)
call UnitStripHeroLevel(u,l)
call SetWidgetLife(u2,GetUnitState(u2,UNIT_STATE_MAX_LIFE)/2)
call SetWidgetLife(u,GetUnitState(u,UNIT_STATE_MAX_LIFE)/2)
call TimerStart(CreateTimer(),1,true,function thistype.ts)
set t=null
endmethod
endstruct
Last edited: