function Trig_Stats_Conditions takes nothing returns boolean
if ( not ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) > 100 ) ) then
return false
endif
return true
endfunction
function Trig_Stats_Func001001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Stats_Func001002 takes nothing returns nothing
set udg_hero = GetEnumUnit()
endfunction
function Trig_Stats_Func003001 takes nothing returns boolean
return ( GetEventPlayerChatString() == "-agi max" )
endfunction
function Trig_Stats_Func004001 takes nothing returns boolean
return ( GetEventPlayerChatString() == "-str max" )
endfunction
function Trig_Stats_Func005001 takes nothing returns boolean
return ( GetEventPlayerChatString() == "-int max" )
endfunction
function Trig_Stats_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsOfPlayerMatching(GetTriggerPlayer(), Condition(function Trig_Stats_Func001001002)), function Trig_Stats_Func001002 )
if ( Trig_Stats_Func003001() ) then
call ConditionalTriggerExecute( gg_trg_agi )
else
call DoNothing( )
endif
if ( Trig_Stats_Func004001() ) then
call ConditionalTriggerExecute( gg_trg_str )
else
call DoNothing( )
endif
if ( Trig_Stats_Func005001() ) then
call ConditionalTriggerExecute( gg_trg_int )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Stats takes nothing returns nothing
set gg_trg_Stats = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(2), "max", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(3), "max", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(4), "max", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(5), "max", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(6), "max", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(7), "max", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(8), "max", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(9), "max", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(10), "max", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Stats, Player(11), "max", false )
call TriggerAddCondition( gg_trg_Stats, Condition( function Trig_Stats_Conditions ) )
call TriggerAddAction( gg_trg_Stats, function Trig_Stats_Actions )
endfunction