function InitPlayerActions takes player p, unit u returns nothing
call SetPlayerHandicapXP(p, 0.30)
// Dungeon Creatures
call SetPlayerAlliance(p, Player(11), ALLIANCE_PASSIVE, false)
// If a player is playing intialize the variable to that player's wisp, else remove that wisp
if GetPlayerSlotState(p) != PLAYER_SLOT_STATE_PLAYING then
call RemoveUnit(u)
else
call FogModifierStart(CreateFogModifierRect(p, FOG_OF_WAR_VISIBLE, gg_rct_MenuVisibility, true, false))
//The BJ function prevents player from allying with itself
call SetPlayerAllianceStateBJ(p, Player(0), bj_ALLIANCE_ALLIED_VISION)
call SetPlayerAllianceStateBJ(p, Player(1), bj_ALLIANCE_ALLIED_VISION)
call SetPlayerAllianceStateBJ(p, Player(5), bj_ALLIANCE_ALLIED_VISION)
call SetPlayerAllianceStateBJ(p, Player(6), bj_ALLIANCE_ALLIED_VISION)
if udg_LocalPlayer == p then
call SetCameraTargetController(u, 0, 0, false)
call SelectUnit(u, true)
set udg_CameraUnit = u
set udg_CameraActive = true
endif
endif
endfunction
function InitPlayers takes nothing returns nothing
call CameraSetupApplyForceDuration(gg_cam_CamStart1, true, 0)
call SetMapFlag(MAP_LOCK_ALLIANCE_CHANGES, true)
call SetMapFlag(MAP_LOCK_RESOURCE_TRADING, false)
call SetPlayerState(Player(11), PLAYER_STATE_GIVES_BOUNTY, 1)
//Setup interesting GUI Globals
call DestroyGroup(udg_LastCreatedUnitGroup) //GUI vars spawn a new unit group
set udg_LastCreatedUnitGroup = bj_lastCreatedGroup //is never destroyed nor set to a new var
set udg_LocalPlayer = GetLocalPlayer() //Less JASS needed in the future
// Player 1
call InitPlayerActions(Player(0), gg_unit_ewsp_0006)
// Player 2
call InitPlayerActions(Player(1), gg_unit_ewsp_0007)
// Player 6
call InitPlayerActions(Player(5), gg_unit_ewsp_0008)
// Player 7
call InitPlayerActions(Player(6), gg_unit_ewsp_0010)
endfunction
//===========================================================================
function InitTrig_Custom_Script_Init takes nothing returns nothing
call ExecuteFunc("InitPlayers") //no triggeractions needed here
endfunction