hi i never wrote a jass script b4, so well i got this in jass(just converted it from a trigger)
(=
if there are any memory leaks tell me where or some thing!
tnx alot
(=
if there are any memory leaks tell me where or some thing!
Code:
function Trig_Test_Func001Func002C takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnumUnit()) == Player(10) ) ) then
return false
endif
if ( not ( GetUnitCurrentOrder(GetEnumUnit()) == String2OrderIdBJ("") ) ) then
return false
endif
return true
endfunction
function Trig_Test_Func001Func003C takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnumUnit()) == Player(11) ) ) then
return false
endif
if ( not ( GetUnitCurrentOrder(GetEnumUnit()) == String2OrderIdBJ("") ) ) then
return false
endif
return true
endfunction
function Trig_Test_Func001A takes nothing returns nothing
call SetUnitLifePercentBJ( GetEnumUnit(), ( GetUnitLifePercent(GetEnumUnit()) - 5.00 ) )
if ( Trig_Test_Func001Func002C() ) then
call IssuePointOrderLocBJ( GetEnumUnit(), "attack", GetRectCenter(gg_rct_Move_to_2) )
else
endif
if ( Trig_Test_Func001Func003C() ) then
call IssuePointOrderLocBJ( GetEnumUnit(), "attack", GetRectCenter(gg_rct_Move_to_1) )
else
endif
endfunction
function Trig_Test_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Arena), function Trig_Test_Func001A )
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
set gg_trg_Test = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Test, 5.00 )
call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction
tnx alot