- Joined
- Jun 7, 2008
- Messages
- 440
I read one tutorial (or i misinterpreted it) that you can use multiple conditions if you separate them with a comma. If this is so, can this be shortened??
EDIT: I just converted GUI to custom, obviously.
Code:
function Trig_Max_Red_Func003001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) != 'u008' )
endfunction
function Trig_Max_Red_Func003002001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) != 'nhem' )
endfunction
function Trig_Max_Red_Func003002002001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) != 'ohun' )
endfunction
function Trig_Max_Red_Func003002002002001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) != 'ushd' )
endfunction
function Trig_Max_Red_Func003002002002002001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) != 'n00O' )
endfunction
function Trig_Max_Red_Func003002002002002002001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) != 'efon' )
endfunction
function Trig_Max_Red_Func003002002002002002002 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) != 'ncer' )
endfunction
function Trig_Max_Red_Func003002002002002002 takes nothing returns boolean
return GetBooleanOr( Trig_Max_Red_Func003002002002002002001(), Trig_Max_Red_Func003002002002002002002() )
endfunction
function Trig_Max_Red_Func003002002002002 takes nothing returns boolean
return GetBooleanOr( Trig_Max_Red_Func003002002002002001(), Trig_Max_Red_Func003002002002002002() )
endfunction
function Trig_Max_Red_Func003002002002 takes nothing returns boolean
return GetBooleanOr( Trig_Max_Red_Func003002002002001(), Trig_Max_Red_Func003002002002002() )
endfunction
function Trig_Max_Red_Func003002002 takes nothing returns boolean
return GetBooleanOr( Trig_Max_Red_Func003002002001(), Trig_Max_Red_Func003002002002() )
endfunction
function Trig_Max_Red_Func003002 takes nothing returns boolean
return GetBooleanOr( Trig_Max_Red_Func003002001(), Trig_Max_Red_Func003002002() )
endfunction
function Trig_Max_Red_Conditions takes nothing returns boolean
if ( not GetBooleanOr( Trig_Max_Red_Func003001(), Trig_Max_Red_Func003002() ) ) then
return false
endif
if ( not ( CountUnitsInGroup(GetUnitsOfPlayerAll(Player(10))) > 100 ) ) then
return false
endif
return true
endfunction
function Trig_Max_Red_Actions takes nothing returns nothing
call KillUnit( GetTrainedUnit() )
endfunction
//===========================================================================
function InitTrig_Max_Red takes nothing returns nothing
set gg_trg_Max_Red = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Max_Red, EVENT_PLAYER_UNIT_TRAIN_FINISH )
call TriggerAddCondition( gg_trg_Max_Red, Condition( function Trig_Max_Red_Conditions ) )
call TriggerAddAction( gg_trg_Max_Red, function Trig_Max_Red_Actions )
endfunction
EDIT: I just converted GUI to custom, obviously.