Name | Type | is_array | initial_value |
Giay | integer | No | |
HackMap_Unit | force | No | |
HM_Gruop | group | No | |
Players | force | No | |
Quest_Level_1 | integer | Yes | |
TempGroup | group | No |
function Trig_Anti_Hack_Map_Va_Cho_Tien1_Func001A takes nothing returns nothing
set udg_Giay = ( udg_Giay + 1 )
call AdjustPlayerStateBJ( 2, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
endfunction
function Trig_Anti_Hack_Map_Va_Cho_Tien1_Func002002002 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'e005' )
endfunction
function Trig_Anti_Hack_Map_Va_Cho_Tien1_Func003Func001Func001C takes nothing returns boolean
if ( not ( IsUnitSelected(GetEnumUnit(), ConvertedPlayer(GetForLoopIndexA())) == true ) ) then
return false
endif
if ( not ( GetPlayerController(ConvertedPlayer(GetForLoopIndexA())) != MAP_CONTROL_COMPUTER ) ) then
return false
endif
if ( not ( GetPlayerSlotState(ConvertedPlayer(GetForLoopIndexA())) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
if ( not ( IsPlayerInForce(ConvertedPlayer(GetForLoopIndexA()), udg_HackMap_Unit) == false ) ) then
return false
endif
return true
endfunction
function Trig_Anti_Hack_Map_Va_Cho_Tien1_Func003A takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 12
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Anti_Hack_Map_Va_Cho_Tien1_Func003Func001Func001C() ) then
call ForceAddPlayerSimple( ConvertedPlayer(GetForLoopIndexA()), udg_HackMap_Unit )
set udg_Quest_Level_1[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = 0
call DisplayTextToForce( GetPlayersAll(), ( GetPlayerName(ConvertedPlayer(GetForLoopIndexA())) + "use map hack." ) )
call DisplayTextToForce( GetPlayersAll(), ( GetPlayerName(ConvertedPlayer(GetForLoopIndexA())) + " lose !!!" ) )
set udg_TempGroup = GetUnitsOfPlayerAll(ConvertedPlayer(GetForLoopIndexA()))
call CustomDefeatBJ( ConvertedPlayer(GetForLoopIndexA()), "TRIGSTR_002" )
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
function Trig_Anti_Hack_Map_Va_Cho_Tien1_Actions takes nothing returns nothing
call ForForce( udg_Players, function Trig_Anti_Hack_Map_Va_Cho_Tien1_Func001A )
set udg_HM_Gruop = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Anti_Hack_Map_Va_Cho_Tien1_Func002002002))
call ForGroupBJ( udg_HM_Gruop, function Trig_Anti_Hack_Map_Va_Cho_Tien1_Func003A )
call DestroyGroup( udg_HM_Gruop)
endfunction
//===========================================================================
function InitTrig_Anti_Hack_Map_Va_Cho_Tien1 takes nothing returns nothing
set gg_trg_Anti_Hack_Map_Va_Cho_Tien1 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Anti_Hack_Map_Va_Cho_Tien1, 0.03 )
call TriggerAddAction( gg_trg_Anti_Hack_Map_Va_Cho_Tien1, function Trig_Anti_Hack_Map_Va_Cho_Tien1_Actions )
endfunction