|
发表于 2006-4-26 13:22:03
|
显示全部楼层
[jass]function h2i takes handle h returns integer
return h
return 0
endfunction
function i2a takes integer i returns triggeraction
return i
return null
endfunction
function LifeChange_Trigger takes nothing returns nothing
call DisplayTextToPlayer(Player(0), 0, 0, \"CurrLife: \" + R2S(GetUnitState(udg_Player,UNIT_STATE_LIFE)) )
call TriggerRemoveAction(GetTriggeringTrigger(),i2a(udg_Action))
call DestroyTrigger(GetTriggeringTrigger())
set udg_Trg = CreateTrigger()
call TriggerRegisterUnitStateEvent( udg_Trg, udg_Player, UNIT_STATE_LIFE, LESS_THAN, GetUnitState(udg_Player,UNIT_STATE_LIFE) - 1 )
call TriggerRegisterUnitStateEvent( udg_Trg, udg_Player, UNIT_STATE_LIFE, GREATER_THAN, GetUnitState(udg_Player,UNIT_STATE_LIFE) + 1 )
set udg_Action = h2i(TriggerAddAction( udg_Trg, function LifeChange_Trigger ))
endfunction
[/jass]
楼上的改成这样就不错了,可以看单人.w3x
[ 本帖最后由 Red_Wolf 于 2006-4-26 14:21 编辑 ] |
|