Эллесар, ну и как это исправить?Добавлено (06-09-2010, 23:28)
---------------------------------------------
Ливы
function Trig_Player_Leaves_Game_____________________u_Func007Func004A takes nothing returns nothing
call AdjustPlayerStateBJ( udg_TempInteger, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
call SetPlayerAllianceStateBJ( GetTriggerPlayer(), GetEnumPlayer(), bj_ALLIANCE_ALLIED_UNITS )
endfunction
function Trig_Player_Leaves_Game_____________________u_Func007Func006A takes nothing returns nothing
call AdjustPlayerStateBJ( udg_TempInteger, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
call SetPlayerAllianceStateBJ( GetTriggerPlayer(), GetEnumPlayer(), bj_ALLIANCE_ALLIED_UNITS )
endfunction
function Trig_Player_Leaves_Game_____________________u_Func007C takes nothing returns boolean
if ( not ( IsPlayerInForce(GetTriggerPlayer(), udg_PlayersLight) == true ) ) then
return false
endif
return true
endfunction
function Trig_Player_Leaves_Game_____________________u_Func008Func001A takes nothing returns nothing
call CustomVictoryBJ( GetEnumPlayer(), false, true )
endfunction
function Trig_Player_Leaves_Game_____________________u_Func008C takes nothing returns boolean
if ( not ( udg_End_Game_If_All_Gone == true ) ) then
return false
endif
if ( not ( CountPlayersInForceBJ(udg_PlayersLightPlaying) == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Player_Leaves_Game_____________________u_Func009Func001A takes nothing returns nothing
call CustomVictoryBJ( GetEnumPlayer(), false, true )
endfunction
function Trig_Player_Leaves_Game_____________________u_Func009C takes nothing returns boolean
if ( not ( udg_End_Game_If_All_Gone == true ) ) then
return false
endif
if ( not ( CountPlayersInForceBJ(udg_PlayersDarkPlaying) == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Player_Leaves_Game_____________________u_Func010Func001C takes nothing returns boolean
if ( not ( IsPlayerInForce(GetTriggerPlayer(), udg_PlayersLight) == true ) ) then
return false
endif
return true
endfunction
function Trig_Player_Leaves_Game_____________________u_Func010C takes nothing returns boolean
if ( not ( GetPlayerSlotState(GetTriggerPlayer()) != PLAYER_SLOT_STATE_LEFT ) ) then
return false
endif
return true
endfunction
function Trig_Player_Leaves_Game_____________________u_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), ( udg_Player_Colors[GetConvertedPlayerId(GetTriggerPlayer())] + ( GetPlayerName(GetTriggerPlayer()) + "|r ïîêèíóë èãðó" ) ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 1, udg_mb_spots[GetConvertedPlayerId(GetTriggerPlayer())], "UI\\Minimap\\MinimapIconCreepLoc2.blp" )
call MultiboardSetItemValueBJ( udg_Multiboard, 2, udg_mb_spots[GetConvertedPlayerId(GetTriggerPlayer())], ( "|cFF959959" + GetPlayerName(GetTriggerPlayer()) ) )
call MultiboardSetItemValueBJ( udg_Multiboard, 3, udg_mb_spots[GetConvertedPlayerId(GetTriggerPlayer())], "TRIGSTR_4197" )
call MultiboardSetItemValueBJ( udg_Multiboard, 4, udg_mb_spots[GetConvertedPlayerId(GetTriggerPlayer())], "TRIGSTR_4198" )
if ( Trig_Player_Leaves_Game_____________________u_Func007C() ) then
set udg_TempInteger = ( ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) / CountPlayersInForceBJ(udg_PlayersLightPlaying) ) + 1 )
call ForceRemovePlayerSimple( GetTriggerPlayer(), udg_PlayersLightPlaying )
call ForForce( udg_PlayersLightPlaying, function Trig_Player_Leaves_Game_____________________u_Func007Func006A )
else
set udg_TempInteger = ( ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) / CountPlayersInForceBJ(udg_PlayersScourgePlaying) ) + 1 )
call ForceRemovePlayerSimple( GetTriggerPlayer(), udg_PlayersScourgePlaying )
call ForForce( udg_PlayersScourgePlaying, function Trig_Player_Leaves_Game_____________________u_Func007Func004A )
endif
if ( Trig_Player_Leaves_Game_____________________u_Func008C() ) then
call ForForce( udg_PlayersDark, function Trig_Player_Leaves_Game_____________________u_Func008Func001A )
else
endif
if ( Trig_Player_Leaves_Game_____________________u_Func009C() ) then
call ForForce( udg_PlayersLight, function Trig_Player_Leaves_Game_____________________u_Func009Func001A )
else
endif
if ( Trig_Player_Leaves_Game_____________________u_Func010C() ) then
if ( Trig_Player_Leaves_Game_____________________u_Func010Func001C() ) then
call SetForceAllianceStateBJ( GetForceOfPlayer(GetTriggerPlayer()), udg_PlayersLight, bj_ALLIANCE_ALLIED_UNITS )
else
call SetForceAllianceStateBJ( GetForceOfPlayer(GetTriggerPlayer()), udg_PlayersDark, bj_ALLIANCE_ALLIED_UNITS )
endif
else
endif
endfunction
//===========================================================================
function InitTrig_Player_Leaves_Game_____________________u takes nothing returns nothing
set gg_trg_Player_Leaves_Game_____________________u = CreateTrigger( )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(0) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(1) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(2) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(3) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(4) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(5) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(6) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(7) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(8) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Leaves_Game_____________________u, Player(9) )
call TriggerAddAction( gg_trg_Player_Leaves_Game_____________________u, function Trig_Player_Leaves_Game_____________________u_Actions )
endfunction
Добавлено (06-09-2010, 23:30)
---------------------------------------------
Погода
function Trig_Weather_Begin_____________________u_Actions takes nothing returns nothing
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'RAhr' )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), true )
call PolledWait( 50.00 )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), false )
call RemoveWeatherEffectBJ( GetLastCreatedWeatherEffect() )
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'RAlr' )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), true )
call PolledWait( 40.00 )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), false )
call RemoveWeatherEffectBJ( GetLastCreatedWeatherEffect() )
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'LRma' )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), true )
call PolledWait( 21.00 )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), false )
call RemoveWeatherEffectBJ( GetLastCreatedWeatherEffect() )
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'LRaa' )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), true )
call PolledWait( 5.00 )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), false )
call RemoveWeatherEffectBJ( GetLastCreatedWeatherEffect() )
endfunction
Добавлено (06-09-2010, 23:34)
---------------------------------------------
Мультиборд
function Trig_MultiboardCreate_____________________u_Func002001001001 takes nothing returns boolean
return ( GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_USER )
endfunction
function Trig_MultiboardCreate_____________________u_Func002001001002 takes nothing returns boolean
return ( GetPlayerSlotState(GetFilterPlayer()) == PLAYER_SLOT_STATE_PLAYING )
endfunction
function Trig_MultiboardCreate_____________________u_Func002001001 takes nothing returns boolean
return GetBooleanAnd( Trig_MultiboardCreate_____________________u_Func002001001001(), Trig_MultiboardCreate_____________________u_Func002001001002() )
endfunction
function Trig_MultiboardCreate_____________________u_Func002Func001001 takes nothing returns boolean
return ( IsPlayerAlly(GetEnumPlayer(), Player(0)) == true )
endfunction
function Trig_MultiboardCreate_____________________u_Func002Func002001 takes nothing returns boolean
return ( IsPlayerAlly(GetEnumPlayer(), Player(5)) == true )
endfunction
function Trig_MultiboardCreate_____________________u_Func002A takes nothing returns nothing
if ( Trig_MultiboardCreate_____________________u_Func002Func001001() ) then
call ForceAddPlayerSimple( GetEnumPlayer(), udg_group[1] )
else
call DoNothing( )
endif
if ( Trig_MultiboardCreate_____________________u_Func002Func002001() ) then
call ForceAddPlayerSimple( GetEnumPlayer(), udg_group[2] )
else
call DoNothing( )
endif
endfunction
function Trig_MultiboardCreate_____________________u_Func003001001001 takes nothing returns boolean
return ( GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_COMPUTER )
endfunction
function Trig_MultiboardCreate_____________________u_Func003001001002 takes nothing returns boolean
return ( GetPlayerSlotState(GetFilterPlayer()) == PLAYER_SLOT_STATE_PLAYING )
endfunction
function Trig_MultiboardCreate_____________________u_Func003001001 takes nothing returns boolean
return GetBooleanAnd( Trig_MultiboardCreate_____________________u_Func003001001001(), Trig_MultiboardCreate_____________________u_Func003001001002() )
endfunction
function Trig_MultiboardCreate_____________________u_Func003Func001001 takes nothing returns boolean
return ( IsPlayerAlly(GetEnumPlayer(), Player(0)) == true )
endfunction
function Trig_MultiboardCreate_____________________u_Func003Func002001 takes nothing returns boolean
return ( IsPlayerAlly(GetEnumPlayer(), Player(5)) == true )
endfunction
function Trig_MultiboardCreate_____________________u_Func003A takes nothing returns nothing
if ( Trig_MultiboardCreate_____________________u_Func003Func001001() ) then
call ForceAddPlayerSimple( GetEnumPlayer(), udg_group[1] )
else
call DoNothing( )
endif
if ( Trig_MultiboardCreate_____________________u_Func003Func002001() ) then
call ForceAddPlayerSimple( GetEnumPlayer(), udg_group[2] )
else
call DoNothing( )
endif
endfunction
function Trig_MultiboardCreate_____________________u_Func030A takes nothing returns nothing
call MultiboardSetItemValueBJ( udg_Multiboard, 2, udg_List, ( udg_Player_Colors[GetConvertedPlayerId(GetEnumPlayer())] + GetPlayerName(GetEnumPlayer()) ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 1, udg_List, "ReplaceableTextures\\CommandButtons\\BTNAnimateDead.blp" )
call MultiboardSetItemValueBJ( udg_Multiboard, 3, udg_List, "TRIGSTR_4205" )
call MultiboardSetItemValueBJ( udg_Multiboard, 4, udg_List, "TRIGSTR_4206" )
set udg_mb_spots[GetConvertedPlayerId(GetEnumPlayer())] = udg_List
set udg_List = ( udg_List + 1 )
endfunction
function Trig_MultiboardCreate_____________________u_Func032A takes nothing returns nothing
call MultiboardSetItemValueBJ( udg_Multiboard, 2, udg_List, ( udg_Player_Colors[GetConvertedPlayerId(GetEnumPlayer())] + GetPlayerName(GetEnumPlayer()) ) )
call MultiboardSetItemIconBJ( udg_Multiboard, 1, udg_List, "ReplaceableTextures\\CommandButtons\\BTNDivineIntervention.blp" )
call MultiboardSetItemValueBJ( udg_Multiboard, 3, udg_List, "TRIGSTR_4207" )
call MultiboardSetItemValueBJ( udg_Multiboard, 4, udg_List, "TRIGSTR_4208" )
set udg_mb_spots[GetConvertedPlayerId(GetEnumPlayer())] = udg_List
set udg_List = ( udg_List + 1 )
endfunction
function Trig_MultiboardCreate_____________________u_Actions takes nothing returns nothing
// Çäåñü ðàñïðåäåëÿåì èãðîêîâ ïî êîìàíäàì.
call ForForce( GetPlayersMatching(Condition(function Trig_MultiboardCreate_____________________u_Func002001001)), function Trig_MultiboardCreate_____________________u_Func002A )
call ForForce( GetPlayersMatching(Condition(function Trig_MultiboardCreate_____________________u_Func003001001)), function Trig_MultiboardCreate_____________________u_Func003A )
// Ñ÷èòàåì èãðîêîâ â êàæäîé ãðóïïå äëÿ ñîçäàíèÿ ñòðîê ìóëüòèäîñêè.
set udg_numofplayers[1] = CountPlayersInForceBJ(udg_group[1])
set udg_numofplayers[2] = CountPlayersInForceBJ(udg_group[2])
// 4 êîëîíêè (Èêîíêà, èìÿ èãðîêà, óáèéñòâ, ñìåðòåé)
// Ñòðîêè îïðåäåëÿþòñÿ êîë-âîì óïðàâëÿåìûõ ÷åëîâåêîì è èãðàþùèõ ïðîòèâíèêîâ
// â êàæäîé êîìàíäå + 2 ñòðîêè-ðàçäåëèòåëè + ñòðîêà-îïèñàíèå + ñòðîêà, ïîêàçûâàþùàÿ âðåìÿ èãðû.
call CreateMultiboardBJ( 4, ( ( udg_numofplayers[1] + udg_numofplayers[2] ) + 4 ), "TRIGSTR_4199" )
set udg_Multiboard = GetLastCreatedMultiboard()
// Çàäà¸ì ïàðàìåòðû 1-é ñòðîêè.
call MultiboardSetItemValueBJ( udg_Multiboard, 2, 1, "TRIGSTR_4200" )
call MultiboardSetItemValueBJ( udg_Multiboard, 3, 1, "TRIGSTR_4201" )
call MultiboardSetItemValueBJ( udg_Multiboard, 4, 1, "TRIGSTR_4202" )
// Çàäà¸ì ïàðàìåòðû ïîñëåäíåé ñòðîêè.
call MultiboardSetItemIconBJ( udg_Multiboard, 1, ( udg_numofplayers[1] + ( udg_numofplayers[2] + 4 ) ), "ReplaceableTextures\\CommandButtons\\BTNClock.blp" )
call MultiboardSetItemValueBJ( udg_Multiboard, 2, ( ( udg_numofplayers[1] + udg_numofplayers[2] ) + 4 ), "TRIGSTR_4203" )
call MultiboardSetItemValueBJ( udg_Multiboard, 3, ( ( udg_numofplayers[1] + udg_numofplayers[2] ) + 4 ), "TRIGSTR_4204" )
// Öèêëè÷íî çàäà¸ì øèðèíó è ñòèëè êîëîíîê
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = ( ( udg_numofplayers[1] + udg_numofplayers[2] ) + 4 )
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call MultiboardSetItemStyleBJ( udg_Multiboard, 1, GetForLoopIndexA(), false, true )
call MultiboardSetItemStyleBJ( udg_Multiboard, 2, GetForLoopIndexA(), true, false )
call MultiboardSetItemStyleBJ( udg_Multiboard, 3, GetForLoopIndexA(), true, false )
call MultiboardSetItemStyleBJ( udg_Multiboard, 4, GetForLoopIndexA(), true, false )
call MultiboardSetItemWidthBJ( udg_Multiboard, 1, GetForLoopIndexA(), 2.00 )
call MultiboardSetItemWidthBJ( udg_Multiboard, 2, GetForLoopIndexA(), 8.00 )
call MultiboardSetItemWidthBJ( udg_Multiboard, 3, GetForLoopIndexA(), 6.00 )
call MultiboardSetItemWidthBJ( udg_Multiboard, 4, GetForLoopIndexA(), 6.00 )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
// Ñêðûâàåì èêîíêó â ïåðâîé âåðõíåé êîëîíêå, òàì îíà íå íóæíà.
call MultiboardSetItemStyleBJ( udg_Multiboard, 1, 1, false, false )
// Ñêðûâàåì èêîíêó òàêæå â ðàçäåëèòåëÿõ, òàì îíà íå íóæíà.
call MultiboardSetItemStyleBJ( udg_Multiboard, 1, ( udg_numofplayers[1] + 2 ), false, false )
call MultiboardSetItemStyleBJ( udg_Multiboard, 1, ( ( udg_numofplayers[1] + udg_numofplayers[2] ) + 3 ), false, false )
// List - âñïîìîãàòåëüíàÿ ïåðåìåííàÿ, êîòîðàÿ áóäåò ñëóæèòü íàì ïñåâäîöèêëè÷åñêèì èíäåêñîì
set udg_List = 2
// Òåïåðü äëÿ êàæäîé ãðóïïû èãðîêîâ ïðîäåëûâàåì íåñêîëüêî äåéñòâèé
call ForForce( udg_group[1], function Trig_MultiboardCreate_____________________u_Func030A )
set udg_List = ( udg_List + 1 )
call ForForce( udg_group[2], function Trig_MultiboardCreate_____________________u_Func032A )
call MultiboardDisplayBJ( true, udg_Multiboard )
endfunction
часы в мультиборд
function Trig_function_Trig_MultiboardCreate_____________________u_Func002001001001_takes_noth_Func002C takes nothing returns boolean
if ( not ( udg_seconds == 60 ) ) then
return false
endif
return true
endfunction
function Trig_function_Trig_MultiboardCreate_____________________u_Func002001001001_takes_noth_Actions takes nothing returns nothing
set udg_seconds = ( udg_seconds + 1 )
if ( Trig_function_Trig_MultiboardCreate_____________________u_Func002001001001_takes_noth_Func002C() ) then
set udg_seconds = 0
set udg_minutes = ( udg_minutes + 1 )
else
endif
call MultiboardSetItemValueBJ( udg_Multiboard, 3, ( ( udg_numofplayers[1] + udg_numofplayers[2] ) + 4 ), ( ( I2S(udg_minutes) + ":" ) + I2S(udg_seconds) ) )
endfunction
//===========================================================================
function InitTrig_function_Trig_MultiboardCreate_____________________u_Func002001001001_takes_noth takes nothing returns nothing
set gg_trg_function_Trig_MultiboardCreate_____________________u_Func002001001001_takes_noth = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_function_Trig_MultiboardCreate_____________________u_Func002001001001_takes_noth, 1.00 )
call TriggerAddAction( gg_trg_function_Trig_MultiboardCreate_____________________u_Func002001001001_takes_noth, function Trig_function_Trig_MultiboardCreate_____________________u_Func002001001001_takes_noth_Actions )
endfunction
Добавлено (06-09-2010, 23:36)
---------------------------------------------
Инициализация
function Trig___________________________u_Func006A takes nothing returns nothing
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD, 750 )
endfunction
function Trig___________________________u_Actions takes nothing returns nothing
set udg_End_Game_If_All_Gone = false
set udg_PlayersDark = GetPlayersAllies(Player(0))
set udg_PlayersDarkPlaying = GetPlayersAllies(Player(0))
set udg_PlayersLight = GetPlayersAllies(Player(5))
set udg_PlayersLightPlaying = GetPlayersAllies(Player(5))
call ForForce( GetPlayersAll(), function Trig___________________________u_Func006A )
set udg_total_heroes = 20
set udg_random_count = 20
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_random_data[GetForLoopIndexA()] = GetForLoopIndexA()
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction