-- Script.Load( "C:\\91 Spiele\\Siedler 5 Mapping\\fussballv2.lua" ) g_MC_StR = 1 function GameCallback_OnGameStart() -- Include global tool script functions Script.Load(Folders.MapTools.."Ai\\Support.lua") Script.Load( "Data\\Script\\MapTools\\MultiPlayer\\MultiplayerTools.lua" ) Script.Load( "Data\\Script\\MapTools\\Tools.lua" ) Script.Load( "Data\\Script\\MapTools\\WeatherSets.lua" ) IncludeGlobals("Comfort") Globale_Hilfsvariablen() Comforts() -- Init global MP stuff MultiplayerTools.InitCameraPositionsForPlayers() MultiplayerTools.SetUpGameLogicOnMPGameConfig() Logic.CreateEntity( Entities.PB_Headquarters1, 1500, 17000, 0, 1 ) if XNetwork.Manager_DoesExist() == 0 then -- Standardschleife für Multiplayersetup 8 Player for i=1,8 do MultiplayerTools.DeleteFastGameStuff(i) end local PlayerID = GUI.GetPlayerID() Logic.PlayerSetIsHumanFlag( PlayerID, 1 ) Logic.PlayerSetGameStateToPlaying( PlayerID ) end for i = 1,8 do Logic.SetEntityExplorationRange ( GetEntityId("Explore"..i), 10000 ) end SetupFussballTributes() BallSperre = true Setup_GUIHacks() _Spielstand = {0,0} local _mapname = "Siedlerfussball" LocalMusic.UseSet = HIGHLANDMUSIC SetupHighlandWeatherGfxSet() AddPeriodicSummer(10) --StartCountdown(5, FussballStart, true) StartZeit = -1 NachSpielZeit = false SpielEnde = false Mitte = {} Mitte.X = 10050 Mitte.Y = 9650 tort2 = {} tort2.X = 3370 tort2.Y = 9650 tort1 = {} tort1.X = 16670 tort1.Y = 9650 torrad = 1200 VORLAGE_player = 0 VORLAGE_hero = 0 LASTSHOT_player = 0 LASTSHOT_hero = 0 fussballt1 = 15 fussballt2 = 15 Torschuetzen = {} Torvorlagen = {} Torschuetzen[1] = {} Torschuetzen[2] = {} ScorerOfTheGame = "" Torschuetzenkoenig = "" -- Pfosten fuer Spieler 0 setzen Score.Player[0] = {} --um error bei ID0 zu vermeiden Score.Player[0]["buildings"] = 0 Score.Player[0]["all"] = 0 Comfort_TrackEntitysIni() Comfort_TrackEntityIni(1,Entities.XD_WallCorner) for i = Track_Entity_Table[1][Entities.XD_WallCorner].count, 1, -1 do -- local _pos = GetPosition ( Track_Entity_Table[1][Entities.XD_WallCorner][i] ) DestroyEntity ( Track_Entity_Table[1][Entities.XD_WallCorner][i] ) -- Logic.CreateEntity( Entities.XD_WallCorner, _pos.X, _pos.Y, 0, 0 ) end Logic.CreateEntity( Entities.XD_WallCorner, 16700, 10500, 0, 0 ) Logic.CreateEntity( Entities.XD_WallCorner, 16700, 8800, 0, 0 ) Logic.CreateEntity( Entities.XD_WallCorner, 3400, 10500, 0, 0 ) Logic.CreateEntity( Entities.XD_WallCorner, 3400, 8800, 0, 0 ) -- Alle Spieler auf Friendly stellen for i = 1,8 do for u = 1,8 do if not (i == u) then Logic.SetDiplomacyState( i, u, Diplomacy.Friendly ) end end end foult1 = 0 foult2 = 0 -- sound abstellen GUI.SetFeedbackSoundOutputState(0) StartSimpleHiResJob("WPUpdateFeedback") Logic.SuspendAllEntities() mpc_playernames = {} mpc_playerteams = {1,1,1,1,2,2,2,2} for i = 1,8 do mpc_playernames[i] = XNetwork.GameInformation_GetLogicPlayerUserName(i) end mpc_TRIB = {} setuppId = 1 for i = 1,9 do if i == 9 then setuppId = 1 break end if not(mpc_playernames[i] == "") then setuppId = i break end end mpc_Rules = {} mpc_Rules["Player"] = {4,5,6,7,8,9,10,11} mpc_Rules["Player"].Cur = 4 - 3 mpc_Rules["Player"].Sel = true mpc_Rules["Player"].Text = "Anzahl Helden pro Team: " mpc_Rules["Playermode"] = {"Auto","1v1","2v1","2v2","3v2","3v3","4v3","4v4"} mpc_Rules["Playermode"].Cur = 1 mpc_Rules["Playermode"].Sel = true mpc_Rules["Playermode"].Text = "Modus: " mpc_Rules["Gametime"] = {"Frei",0.5,10,15,20,25,30,40,60} mpc_Rules["Gametime"].Cur = 1 mpc_Rules["Gametime"].Sel = true mpc_Rules["Gametime"].Text = "Spielzeit: " mpc_Rules["GoldenGoal"] = {"Ja","Nein"} mpc_Rules["GoldenGoal"].Cur = 1 mpc_Rules["GoldenGoal"].Sel = true mpc_Rules["GoldenGoal"].Text = "Golden Goal: " local t1count = 0; for i = 1,4 do if Logic.PlayerGetGameState( i ) == 1 then t1count = t1count + 1 end end local t2count = 0; for i = 5,8 do if Logic.PlayerGetGameState( i ) == 1 then t2count = t2count + 1 end end if t1count > 1 and t2count > 1 then mpc_Rules["Player"].Cur = 8 - 3 end if t1count > 2 and t2count > 2 then mpc_Rules["Player"].Cur = 11 - 3 end RemoveAllmpc_TRIB = function() for i = 1,6 do Logic.RemoveTribute( setuppId, mpc_TRIB[i]); end end RulesetChoosen = function(_NextStep) RemoveAllmpc_TRIB(); SetupRuleSets(_NextStep) end mpc_TRIB_SelectSingleChoiceRule = function (_step, _rule) if mpc_Rules[_rule].Sel then local _countRules = table.getn( mpc_Rules[_rule] ) mpc_Rules[_rule].Cur = mpc_Rules[_rule].Cur + 1; if mpc_Rules[_rule].Cur > _countRules then mpc_Rules[_rule].Cur = 1 end end RulesetChoosen(_step) end mpc_CreateSingleChoiceTributes = function(_rule) local _countRules = table.getn(mpc_Rules[_rule]) local Color local _text = "@color:255,255,255 "..mpc_Rules[_rule].Text..": " for i = 1, _countRules do if mpc_Rules[_rule].Cur == i then Color = "@color:0,255,0 " else if mpc_Rules[_rule].Sel then Color = "@color:255,0,0 " else Color = "@color:127,127,127 " end end _text = _text..Color..mpc_Rules[_rule][i].." - "; end return AddTribute( CreateATribute(setuppId, _text, { Gold = 0}, mpc_TRIBRuleFunc[_rule] ) ) end mpc_TRIBRuleFunc = {} mpc_TRIBRuleFunc["Player"] = function() mpc_TRIB_SelectSingleChoiceRule(1, "Player") end mpc_TRIBRuleFunc["Playermode"] = function() mpc_TRIB_SelectSingleChoiceRule(1, "Playermode") end mpc_TRIBRuleFunc["Gametime"] = function() mpc_TRIB_SelectSingleChoiceRule(1, "Gametime") end mpc_TRIBRuleFunc["GoldenGoal"] = function() mpc_TRIB_SelectSingleChoiceRule(1, "GoldenGoal") end SetupRuleSets = function(_Step) if _Step == 1 then mpc_TRIB[1] = AddTribute( CreateATribute(setuppId, "@color:255,255,0 WEITER:", { Gold = 0}, function() RulesetChoosen(2) end ) ) mpc_TRIB[2] = mpc_CreateSingleChoiceTributes("Player") mpc_TRIB[3] = mpc_CreateSingleChoiceTributes("Playermode") mpc_TRIB[4] = mpc_CreateSingleChoiceTributes("Gametime") mpc_TRIB[5] = mpc_CreateSingleChoiceTributes("GoldenGoal") else StartCountdown(15, FussballStart, true) SetupHeroes() StartSimpleJob("Fouljob") end end SetupRuleSets(1) end function FussballStart() BallSperre = false Logic.ResumeAllEntities() Camera.ZoomSetFactorMax(2) StartZeit = Logic.GetTime() end function SetupHeroes() heropos1 = {} heropos2 = {} for i = 1,11 do heropos1[i] = {} --GetPosition("T1_"..i) end for i = 1,11 do heropos2[i] = {} -- GetPosition("T2_"..i) end heropos1[1].X = 11300; heropos1[1].Y = 9000 heropos1[2].X = 16420; heropos1[2].Y = 9750 heropos1[3].X = 11150; heropos1[3].Y = 10500 heropos1[4].X = 13670; heropos1[4].Y = 11250 heropos1[5].X = 14100; heropos1[5].Y = 8070 heropos1[6].X = 12100; heropos1[6].Y = 11550 heropos1[7].X = 12300; heropos1[7].Y = 7450 heropos1[8].X = 12750; heropos1[8].Y = 9750 heropos1[9].X = 15250; heropos1[9].Y = 10300 heropos1[10].X = 15250; heropos1[10].Y = 8900 heropos1[11].X = 13950; heropos1[11].Y = 9750 heropos2[1].X = 9110; heropos2[1].Y = 10500 heropos2[2].X = 3520; heropos2[2].Y = 9740 heropos2[3].X = 9100; heropos2[3].Y = 8900 heropos2[4].X = 6300; heropos2[4].Y = 11500 heropos2[5].X = 6450; heropos2[5].Y = 8350 heropos2[6].X = 7770; heropos2[6].Y = 11450 heropos2[7].X = 8300; heropos2[7].Y = 7700 heropos2[8].X = 7300; heropos2[8].Y = 9770 heropos2[9].X = 4800; heropos2[9].Y = 10600 heropos2[10].X = 4660; heropos2[10].Y = 8860 heropos2[11].X = 5900; heropos2[11].Y = 9900 local t1count = 0; local heroes1 = 0; local heroes2 = 0; for i = 1,4 do if Logic.PlayerGetGameState( i ) == 1 then t1count = t1count + 1 end end local t2count = 0; for i = 5,8 do if Logic.PlayerGetGameState( i ) == 1 then t2count = t2count + 1 end end for i = 1,4 do Display.SetPlayerColorMapping(i,XNetwork.GameInformation_GetLogicPlayerColor(1)) end for i = 5,8 do Display.SetPlayerColorMapping(i,XNetwork.GameInformation_GetLogicPlayerColor(5)) end local _playerID = 1 local _teamHeroes = 0 Logic.ResumeAllEntities() if mpc_Rules["Playermode"][mpc_Rules["Playermode"].Cur] == "Auto" then for u = 1,2 do local _heropos = 0 if u == 1 then _playerID = 1 else _playerID = 5 end for i = 2, mpc_Rules["Player"][mpc_Rules["Player"].Cur]+1 do if u == 1 then if _playerID == 5 then _playerID = 1 end else if _playerID == 9 then _playerID = 5 end end if not (Logic.PlayerGetGameState( _playerID ) == 1) then if u == 1 then _playerID = 1 else _playerID = 5 end end _heropos = _heropos + 1 if u == 1 then Logic.CreateEntity( herotable[i], heropos1[_heropos].X, heropos1[_heropos].Y, 0, _playerID ) else Logic.CreateEntity( herotable[i], heropos2[_heropos].X, heropos1[_heropos].Y, 0, _playerID ) end --Logic.CreateEntity( herotable[i], heropos1[_heropos].X, heropos1[_heropos].Y, 0, _playerID ) _playerID = _playerID + 1 end end else if mpc_Rules["Playermode"][mpc_Rules["Playermode"].Cur] == "1v1" then mpc_MultiplayerPlaying = {true,false,false,false,true,false,false,false} end if mpc_Rules["Playermode"][mpc_Rules["Playermode"].Cur] == "2v1" then mpc_MultiplayerPlaying = {true,true,false,false,true,false,false,false} end if mpc_Rules["Playermode"][mpc_Rules["Playermode"].Cur] == "2v2" then mpc_MultiplayerPlaying = {true,true,false,false,true,true,false,false} end if mpc_Rules["Playermode"][mpc_Rules["Playermode"].Cur] == "3v2" then mpc_MultiplayerPlaying = {true,true,true,false,true,true,false,false} end if mpc_Rules["Playermode"][mpc_Rules["Playermode"].Cur] == "3v3" then mpc_MultiplayerPlaying = {true,true,true,false,true,true,true,false} end if mpc_Rules["Playermode"][mpc_Rules["Playermode"].Cur] == "4v3" then mpc_MultiplayerPlaying = {true,true,true,true,true,true,true,false} end if mpc_Rules["Playermode"][mpc_Rules["Playermode"].Cur] == "4v4" then mpc_MultiplayerPlaying = {true,true,true,true,true,true,true,true} end for u = 1,2 do local _heropos = 0 if u == 1 then _playerID = 1 else _playerID = 5 end for i = 2, mpc_Rules["Player"][mpc_Rules["Player"].Cur]+1 do if u == 1 then if _playerID == 5 then _playerID = 1 end else if _playerID == 9 then _playerID = 5 end end if not (mpc_MultiplayerPlaying[ _playerID ] == true) then if u == 1 then _playerID = 1 else _playerID = 5 end end _heropos = _heropos + 1 if u == 1 then Logic.CreateEntity( herotable[i], heropos1[_heropos].X, heropos1[_heropos].Y, 0, _playerID ) else Logic.CreateEntity( herotable[i], heropos2[_heropos].X, heropos1[_heropos].Y, 0, _playerID ) end --Logic.CreateEntity( herotable[i], heropos1[_heropos].X, heropos1[_heropos].Y, 0, _playerID ) _playerID = _playerID + 1 end end end suspendThem = function() Logic.SuspendAllEntities() return true end StartSimpleJob("suspendThem") function Ausgeklammert1() if t1count == 1 and t2count == 0 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 1 ) Logic.CreateEntity( herotable[6], heropos2[1].X, heropos2[1].Y, 0, 1 ) Logic.CreateEntity( herotable[7], heropos2[2].X, heropos2[2].Y, 0, 1 ) Logic.CreateEntity( herotable[8], heropos2[3].X, heropos2[3].Y, 0, 1 ) Logic.CreateEntity( herotable[9], heropos2[4].X, heropos2[4].Y, 0, 1 ) end if t1count == 1 and t2count == 1 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 1 ) Logic.CreateEntity( herotable[6], heropos2[1].X, heropos2[1].Y, 0, 5 ) Logic.CreateEntity( herotable[7], heropos2[2].X, heropos2[2].Y, 0, 5 ) Logic.CreateEntity( herotable[8], heropos2[3].X, heropos2[3].Y, 0, 5 ) Logic.CreateEntity( herotable[9], heropos2[4].X, heropos2[4].Y, 0, 5 ) --Logic.CreateEntity( herotable[10], heropos1[9].X, heropos1[9].Y, 0, 1 ) --Logic.CreateEntity( herotable[11], heropos1[10].X, heropos1[10].Y, 0, 1 ) end if t1count == 1 and t2count == 2 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 1 ) Logic.CreateEntity( herotable[6], heropos2[1].X, heropos1[1].Y, 0, 5 ) Logic.CreateEntity( herotable[7], heropos2[2].X, heropos1[2].Y, 0, 5 ) Logic.CreateEntity( herotable[8], heropos2[3].X, heropos1[3].Y, 0, 6 ) Logic.CreateEntity( herotable[9], heropos2[4].X, heropos1[4].Y, 0, 6 ) --Logic.CreateEntity( herotable[10], heropos1[9].X, heropos1[9].Y, 0, 1 ) --Logic.CreateEntity( herotable[11], heropos1[10].X, heropos1[10].Y, 0, 1 ) end if t1count == 2 and t2count == 1 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 2 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 2 ) Logic.CreateEntity( herotable[6], heropos2[1].X, heropos2[1].Y, 0, 5 ) Logic.CreateEntity( herotable[7], heropos2[2].X, heropos2[2].Y, 0, 5 ) Logic.CreateEntity( herotable[8], heropos2[3].X, heropos2[3].Y, 0, 5 ) Logic.CreateEntity( herotable[9], heropos2[4].X, heropos2[4].Y, 0, 5 ) --Logic.CreateEntity( herotable[10], heropos1[9].X, heropos1[9].Y, 0, 1 ) --Logic.CreateEntity( herotable[11], heropos1[10].X, heropos1[10].Y, 0, 1 ) end if t1count == 2 and t2count == 2 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 1 ) Logic.CreateEntity( herotable[6], heropos1[5].X, heropos1[5].Y, 0, 2 ) Logic.CreateEntity( herotable[7], heropos1[6].X, heropos1[6].Y, 0, 2 ) Logic.CreateEntity( herotable[8], heropos1[7].X, heropos1[7].Y, 0, 2 ) Logic.CreateEntity( herotable[9], heropos1[8].X, heropos1[8].Y, 0, 2 ) Logic.CreateEntity( herotable[2], heropos2[1].X, heropos2[1].Y, 0, 5 ) Logic.CreateEntity( herotable[3], heropos2[2].X, heropos2[2].Y, 0, 5 ) Logic.CreateEntity( herotable[4], heropos2[3].X, heropos2[3].Y, 0, 5 ) Logic.CreateEntity( herotable[5], heropos2[4].X, heropos2[4].Y, 0, 5 ) Logic.CreateEntity( herotable[6], heropos2[5].X, heropos2[5].Y, 0, 6 ) Logic.CreateEntity( herotable[7], heropos2[6].X, heropos2[6].Y, 0, 6 ) Logic.CreateEntity( herotable[8], heropos2[7].X, heropos2[7].Y, 0, 6 ) Logic.CreateEntity( herotable[9], heropos2[8].X, heropos2[8].Y, 0, 6 ) end if t1count == 2 and t2count == 3 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 1 ) Logic.CreateEntity( herotable[6], heropos1[5].X, heropos1[5].Y, 0, 2 ) Logic.CreateEntity( herotable[7], heropos1[6].X, heropos1[6].Y, 0, 2 ) Logic.CreateEntity( herotable[8], heropos1[7].X, heropos1[7].Y, 0, 2 ) Logic.CreateEntity( herotable[9], heropos1[8].X, heropos1[8].Y, 0, 2 ) Logic.CreateEntity( herotable[2], heropos2[1].X, heropos2[1].Y, 0, 5 ) Logic.CreateEntity( herotable[3], heropos2[2].X, heropos2[2].Y, 0, 5 ) Logic.CreateEntity( herotable[4], heropos2[3].X, heropos2[3].Y, 0, 5 ) Logic.CreateEntity( herotable[5], heropos2[4].X, heropos2[4].Y, 0, 6 ) Logic.CreateEntity( herotable[6], heropos2[5].X, heropos2[5].Y, 0, 6 ) Logic.CreateEntity( herotable[7], heropos2[6].X, heropos2[6].Y, 0, 6 ) Logic.CreateEntity( herotable[8], heropos2[7].X, heropos2[7].Y, 0, 7 ) Logic.CreateEntity( herotable[9], heropos2[8].X, heropos2[8].Y, 0, 7 ) end if t1count == 3 and t2count == 2 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 2 ) Logic.CreateEntity( herotable[6], heropos1[5].X, heropos1[5].Y, 0, 2 ) Logic.CreateEntity( herotable[7], heropos1[6].X, heropos1[6].Y, 0, 2 ) Logic.CreateEntity( herotable[8], heropos1[7].X, heropos1[7].Y, 0, 3 ) Logic.CreateEntity( herotable[9], heropos1[8].X, heropos1[8].Y, 0, 3 ) Logic.CreateEntity( herotable[2], heropos2[1].X, heropos2[1].Y, 0, 5 ) Logic.CreateEntity( herotable[3], heropos2[2].X, heropos2[2].Y, 0, 5 ) Logic.CreateEntity( herotable[4], heropos2[3].X, heropos2[3].Y, 0, 5 ) Logic.CreateEntity( herotable[5], heropos2[4].X, heropos2[4].Y, 0, 5 ) Logic.CreateEntity( herotable[6], heropos2[5].X, heropos2[5].Y, 0, 6 ) Logic.CreateEntity( herotable[7], heropos2[6].X, heropos2[6].Y, 0, 6 ) Logic.CreateEntity( herotable[8], heropos2[7].X, heropos2[7].Y, 0, 6 ) Logic.CreateEntity( herotable[9], heropos2[8].X, heropos2[8].Y, 0, 6 ) end if t1count == 3 and t2count == 3 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 2 ) Logic.CreateEntity( herotable[6], heropos1[5].X, heropos1[5].Y, 0, 2 ) Logic.CreateEntity( herotable[7], heropos1[6].X, heropos1[6].Y, 0, 2 ) Logic.CreateEntity( herotable[8], heropos1[7].X, heropos1[7].Y, 0, 3 ) Logic.CreateEntity( herotable[9], heropos1[8].X, heropos1[8].Y, 0, 3 ) Logic.CreateEntity( herotable[10], heropos1[9].X, heropos1[9].Y, 0, 3 ) Logic.CreateEntity( herotable[2], heropos2[1].X, heropos2[1].Y, 0, 5 ) Logic.CreateEntity( herotable[3], heropos2[2].X, heropos2[2].Y, 0, 5 ) Logic.CreateEntity( herotable[4], heropos2[3].X, heropos2[3].Y, 0, 5 ) Logic.CreateEntity( herotable[5], heropos2[4].X, heropos2[4].Y, 0, 6 ) Logic.CreateEntity( herotable[6], heropos2[5].X, heropos2[5].Y, 0, 6 ) Logic.CreateEntity( herotable[7], heropos2[6].X, heropos2[6].Y, 0, 6 ) Logic.CreateEntity( herotable[8], heropos2[7].X, heropos2[7].Y, 0, 7 ) Logic.CreateEntity( herotable[9], heropos2[8].X, heropos2[8].Y, 0, 7 ) Logic.CreateEntity( herotable[10], heropos2[9].X, heropos2[9].Y, 0, 7 ) end if t1count == 4 and t2count == 3 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 2 ) Logic.CreateEntity( herotable[6], heropos1[5].X, heropos1[5].Y, 0, 2 ) Logic.CreateEntity( herotable[7], heropos1[6].X, heropos1[6].Y, 0, 3 ) Logic.CreateEntity( herotable[8], heropos1[7].X, heropos1[7].Y, 0, 3 ) Logic.CreateEntity( herotable[9], heropos1[8].X, heropos1[8].Y, 0, 4 ) Logic.CreateEntity( herotable[10], heropos1[9].X, heropos1[9].Y, 0, 4 ) Logic.CreateEntity( herotable[2], heropos2[1].X, heropos2[1].Y, 0, 5 ) Logic.CreateEntity( herotable[3], heropos2[2].X, heropos2[2].Y, 0, 5 ) Logic.CreateEntity( herotable[4], heropos2[3].X, heropos2[3].Y, 0, 5 ) Logic.CreateEntity( herotable[5], heropos2[4].X, heropos2[4].Y, 0, 6 ) Logic.CreateEntity( herotable[6], heropos2[5].X, heropos2[5].Y, 0, 6 ) Logic.CreateEntity( herotable[7], heropos2[6].X, heropos2[6].Y, 0, 6 ) Logic.CreateEntity( herotable[8], heropos2[7].X, heropos2[7].Y, 0, 7 ) Logic.CreateEntity( herotable[9], heropos2[8].X, heropos2[8].Y, 0, 7 ) Logic.CreateEntity( herotable[10], heropos2[9].X, heropos2[9].Y, 0, 7 ) end if t1count == 3 and t2count == 4 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 2 ) Logic.CreateEntity( herotable[6], heropos1[5].X, heropos1[5].Y, 0, 2 ) Logic.CreateEntity( herotable[7], heropos1[6].X, heropos1[6].Y, 0, 2 ) Logic.CreateEntity( herotable[8], heropos1[7].X, heropos1[7].Y, 0, 3 ) Logic.CreateEntity( herotable[9], heropos1[8].X, heropos1[8].Y, 0, 3 ) Logic.CreateEntity( herotable[10], heropos1[9].X, heropos1[9].Y, 0, 3 ) Logic.CreateEntity( herotable[2], heropos2[1].X, heropos2[1].Y, 0, 5 ) Logic.CreateEntity( herotable[3], heropos2[2].X, heropos2[2].Y, 0, 5 ) Logic.CreateEntity( herotable[4], heropos2[3].X, heropos2[3].Y, 0, 5 ) Logic.CreateEntity( herotable[5], heropos2[4].X, heropos2[4].Y, 0, 6 ) Logic.CreateEntity( herotable[6], heropos2[5].X, heropos2[5].Y, 0, 6 ) Logic.CreateEntity( herotable[7], heropos2[6].X, heropos2[6].Y, 0, 7 ) Logic.CreateEntity( herotable[8], heropos2[7].X, heropos2[7].Y, 0, 7 ) Logic.CreateEntity( herotable[9], heropos2[8].X, heropos2[8].Y, 0, 8 ) Logic.CreateEntity( herotable[10], heropos2[9].X, heropos2[9].Y, 0, 8 ) end if t1count == 4 and t2count == 4 then Logic.CreateEntity( herotable[2], heropos1[1].X, heropos1[1].Y, 0, 1 ) Logic.CreateEntity( herotable[3], heropos1[2].X, heropos1[2].Y, 0, 1 ) Logic.CreateEntity( herotable[4], heropos1[3].X, heropos1[3].Y, 0, 1 ) Logic.CreateEntity( herotable[5], heropos1[4].X, heropos1[4].Y, 0, 2 ) Logic.CreateEntity( herotable[6], heropos1[5].X, heropos1[5].Y, 0, 2 ) Logic.CreateEntity( herotable[7], heropos1[6].X, heropos1[6].Y, 0, 3 ) Logic.CreateEntity( herotable[8], heropos1[7].X, heropos1[7].Y, 0, 3 ) Logic.CreateEntity( herotable[9], heropos1[8].X, heropos1[8].Y, 0, 4 ) Logic.CreateEntity( herotable[10], heropos1[9].X, heropos1[9].Y, 0, 4 ) Logic.CreateEntity( herotable[2], heropos2[1].X, heropos2[1].Y, 0, 5 ) Logic.CreateEntity( herotable[3], heropos2[2].X, heropos2[2].Y, 0, 5 ) Logic.CreateEntity( herotable[4], heropos2[3].X, heropos2[3].Y, 0, 5 ) Logic.CreateEntity( herotable[5], heropos2[4].X, heropos2[4].Y, 0, 6 ) Logic.CreateEntity( herotable[6], heropos2[5].X, heropos2[5].Y, 0, 6 ) Logic.CreateEntity( herotable[7], heropos2[6].X, heropos2[6].Y, 0, 7 ) Logic.CreateEntity( herotable[8], heropos2[7].X, heropos2[7].Y, 0, 7 ) Logic.CreateEntity( herotable[9], heropos2[8].X, heropos2[8].Y, 0, 8 ) Logic.CreateEntity( herotable[10], heropos2[9].X, heropos2[9].Y, 0, 8 ) end end end function SetupFussballTributes() herotable = {Entities.PU_Hero1, Entities.PU_Hero2,Entities.PU_Hero3,Entities.PU_Hero4,Entities.PU_Hero5,Entities.PU_Hero6,Entities.CU_BlackKnight,Entities.CU_Mary_de_Mortfichet,Entities.CU_Barbarian_Hero,Entities.PU_Hero10,Entities.PU_Hero11, Entities.CU_Evil_Queen} gvAna_KurzerSchussTribute = {} for i = 1,8 do gvAna_KurzerSchussTribute[i] = {} end gvAna_KurzerSchussTribute[1][1] = function() KurzerSchuss(1, 1) end gvAna_KurzerSchussTribute[1][2] = function() KurzerSchuss(1, 2) end gvAna_KurzerSchussTribute[1][3] = function() KurzerSchuss(1, 3) end gvAna_KurzerSchussTribute[1][4] = function() KurzerSchuss(1, 4) end gvAna_KurzerSchussTribute[1][5] = function() KurzerSchuss(1, 5) end gvAna_KurzerSchussTribute[1][6] = function() KurzerSchuss(1, 6) end gvAna_KurzerSchussTribute[1][7] = function() KurzerSchuss(1, 7) end gvAna_KurzerSchussTribute[1][8] = function() KurzerSchuss(1, 8) end gvAna_KurzerSchussTribute[1][9] = function() KurzerSchuss(1, 9) end gvAna_KurzerSchussTribute[1][10] = function() KurzerSchuss(1, 10) end gvAna_KurzerSchussTribute[1][11] = function() KurzerSchuss(1, 11) end gvAna_KurzerSchussTribute[1][12] = function() KurzerSchuss(1, 12) end gvAna_KurzerSchussTribute[2][1] = function() KurzerSchuss(2, 1) end gvAna_KurzerSchussTribute[2][2] = function() KurzerSchuss(2, 2) end gvAna_KurzerSchussTribute[2][3] = function() KurzerSchuss(2, 3) end gvAna_KurzerSchussTribute[2][4] = function() KurzerSchuss(2, 4) end gvAna_KurzerSchussTribute[2][5] = function() KurzerSchuss(2, 5) end gvAna_KurzerSchussTribute[2][6] = function() KurzerSchuss(2, 6) end gvAna_KurzerSchussTribute[2][7] = function() KurzerSchuss(2, 7) end gvAna_KurzerSchussTribute[2][8] = function() KurzerSchuss(2, 8) end gvAna_KurzerSchussTribute[2][9] = function() KurzerSchuss(2, 9) end gvAna_KurzerSchussTribute[2][10] = function() KurzerSchuss(2, 10) end gvAna_KurzerSchussTribute[2][11] = function() KurzerSchuss(2, 11) end gvAna_KurzerSchussTribute[2][12] = function() KurzerSchuss(2, 12) end gvAna_KurzerSchussTribute[3][1] = function() KurzerSchuss(3,1) end gvAna_KurzerSchussTribute[3][2] = function() KurzerSchuss(3, 2) end gvAna_KurzerSchussTribute[3][3] = function() KurzerSchuss(3, 3) end gvAna_KurzerSchussTribute[3][4] = function() KurzerSchuss(3, 4) end gvAna_KurzerSchussTribute[3][5] = function() KurzerSchuss(3, 5) end gvAna_KurzerSchussTribute[3][6] = function() KurzerSchuss(3, 6) end gvAna_KurzerSchussTribute[3][7] = function() KurzerSchuss(3, 7) end gvAna_KurzerSchussTribute[3][8] = function() KurzerSchuss(3, 8) end gvAna_KurzerSchussTribute[3][9] = function() KurzerSchuss(3, 9) end gvAna_KurzerSchussTribute[3][10] = function() KurzerSchuss(3, 10) end gvAna_KurzerSchussTribute[3][11] = function() KurzerSchuss(3, 11) end gvAna_KurzerSchussTribute[3][12] = function() KurzerSchuss(3, 12) end gvAna_KurzerSchussTribute[4][1] = function() KurzerSchuss(4,1) end gvAna_KurzerSchussTribute[4][2] = function() KurzerSchuss(4, 2) end gvAna_KurzerSchussTribute[4][3] = function() KurzerSchuss(4, 3) end gvAna_KurzerSchussTribute[4][4] = function() KurzerSchuss(4, 4) end gvAna_KurzerSchussTribute[4][5] = function() KurzerSchuss(4, 5) end gvAna_KurzerSchussTribute[4][6] = function() KurzerSchuss(4, 6) end gvAna_KurzerSchussTribute[4][7] = function() KurzerSchuss(4, 7) end gvAna_KurzerSchussTribute[4][8] = function() KurzerSchuss(4, 8) end gvAna_KurzerSchussTribute[4][9] = function() KurzerSchuss(4, 9) end gvAna_KurzerSchussTribute[4][10] = function() KurzerSchuss(4, 10) end gvAna_KurzerSchussTribute[4][11] = function() KurzerSchuss(4, 11) end gvAna_KurzerSchussTribute[4][12] = function() KurzerSchuss(4, 12) end gvAna_KurzerSchussTribute[5][1] = function() KurzerSchuss(5,1) end gvAna_KurzerSchussTribute[5][2] = function() KurzerSchuss(5, 2) end gvAna_KurzerSchussTribute[5][3] = function() KurzerSchuss(5, 3) end gvAna_KurzerSchussTribute[5][4] = function() KurzerSchuss(5, 4) end gvAna_KurzerSchussTribute[5][5] = function() KurzerSchuss(5, 5) end gvAna_KurzerSchussTribute[5][6] = function() KurzerSchuss(5, 6) end gvAna_KurzerSchussTribute[5][7] = function() KurzerSchuss(5, 7) end gvAna_KurzerSchussTribute[5][8] = function() KurzerSchuss(5, 8) end gvAna_KurzerSchussTribute[5][9] = function() KurzerSchuss(5, 9) end gvAna_KurzerSchussTribute[5][10] = function() KurzerSchuss(5, 10) end gvAna_KurzerSchussTribute[5][11] = function() KurzerSchuss(5, 11) end gvAna_KurzerSchussTribute[5][12] = function() KurzerSchuss(5, 12) end gvAna_KurzerSchussTribute[6][1] = function() KurzerSchuss(6,1) end gvAna_KurzerSchussTribute[6][2] = function() KurzerSchuss(6, 2) end gvAna_KurzerSchussTribute[6][3] = function() KurzerSchuss(6, 3) end gvAna_KurzerSchussTribute[6][4] = function() KurzerSchuss(6, 4) end gvAna_KurzerSchussTribute[6][5] = function() KurzerSchuss(6, 5) end gvAna_KurzerSchussTribute[6][6] = function() KurzerSchuss(6, 6) end gvAna_KurzerSchussTribute[6][7] = function() KurzerSchuss(6, 7) end gvAna_KurzerSchussTribute[6][8] = function() KurzerSchuss(6, 8) end gvAna_KurzerSchussTribute[6][9] = function() KurzerSchuss(6, 9) end gvAna_KurzerSchussTribute[6][10] = function() KurzerSchuss(6, 10) end gvAna_KurzerSchussTribute[6][11] = function() KurzerSchuss(6, 11) end gvAna_KurzerSchussTribute[6][12] = function() KurzerSchuss(6, 12) end gvAna_KurzerSchussTribute[7][1] = function() KurzerSchuss(7,1) end gvAna_KurzerSchussTribute[7][2] = function() KurzerSchuss(7, 2) end gvAna_KurzerSchussTribute[7][3] = function() KurzerSchuss(7, 3) end gvAna_KurzerSchussTribute[7][4] = function() KurzerSchuss(7, 4) end gvAna_KurzerSchussTribute[7][5] = function() KurzerSchuss(7, 5) end gvAna_KurzerSchussTribute[7][6] = function() KurzerSchuss(7, 6) end gvAna_KurzerSchussTribute[7][7] = function() KurzerSchuss(7, 7) end gvAna_KurzerSchussTribute[7][8] = function() KurzerSchuss(7, 8) end gvAna_KurzerSchussTribute[7][9] = function() KurzerSchuss(7, 9) end gvAna_KurzerSchussTribute[7][10] = function() KurzerSchuss(7, 10) end gvAna_KurzerSchussTribute[7][11] = function() KurzerSchuss(7, 11) end gvAna_KurzerSchussTribute[7][12] = function() KurzerSchuss(7, 12) end gvAna_KurzerSchussTribute[8][1] = function() KurzerSchuss(8,1) end gvAna_KurzerSchussTribute[8][2] = function() KurzerSchuss(8, 2) end gvAna_KurzerSchussTribute[8][3] = function() KurzerSchuss(8, 3) end gvAna_KurzerSchussTribute[8][4] = function() KurzerSchuss(8, 4) end gvAna_KurzerSchussTribute[8][5] = function() KurzerSchuss(8, 5) end gvAna_KurzerSchussTribute[8][6] = function() KurzerSchuss(8, 6) end gvAna_KurzerSchussTribute[8][7] = function() KurzerSchuss(8, 7) end gvAna_KurzerSchussTribute[8][8] = function() KurzerSchuss(8, 8) end gvAna_KurzerSchussTribute[8][9] = function() KurzerSchuss(8, 9) end gvAna_KurzerSchussTribute[8][10] = function() KurzerSchuss(8, 10) end gvAna_KurzerSchussTribute[8][11] = function() KurzerSchuss(8, 11) end gvAna_KurzerSchussTribute[8][12] = function() KurzerSchuss(8, 12) end gvAna_KurzerSchussId = {} for i = 1,8 do gvAna_KurzerSchussId[i] = {} for u = 1,12 do gvAna_KurzerSchussId[i][u] = AddTribute( CreateATribute(8, "", { Gold = 0}, gvAna_KurzerSchussTribute[i][u] ) ) end end gvAna_LangerSchussTribute = {} for i = 1,8 do gvAna_LangerSchussTribute[i] = {} end gvAna_LangerSchussTribute[1][1] = function() LangerSchuss(1, 1) end gvAna_LangerSchussTribute[1][2] = function() LangerSchuss(1, 2) end gvAna_LangerSchussTribute[1][3] = function() LangerSchuss(1, 3) end gvAna_LangerSchussTribute[1][4] = function() LangerSchuss(1, 4) end gvAna_LangerSchussTribute[1][5] = function() LangerSchuss(1, 5) end gvAna_LangerSchussTribute[1][6] = function() LangerSchuss(1, 6) end gvAna_LangerSchussTribute[1][7] = function() LangerSchuss(1, 7) end gvAna_LangerSchussTribute[1][8] = function() LangerSchuss(1, 8) end gvAna_LangerSchussTribute[1][9] = function() LangerSchuss(1, 9) end gvAna_LangerSchussTribute[1][10] = function() LangerSchuss(1, 10) end gvAna_LangerSchussTribute[1][11] = function() LangerSchuss(1, 11) end gvAna_LangerSchussTribute[1][12] = function() LangerSchuss(1, 12) end gvAna_LangerSchussTribute[2][1] = function() LangerSchuss(2, 1) end gvAna_LangerSchussTribute[2][2] = function() LangerSchuss(2, 2) end gvAna_LangerSchussTribute[2][3] = function() LangerSchuss(2, 3) end gvAna_LangerSchussTribute[2][4] = function() LangerSchuss(2, 4) end gvAna_LangerSchussTribute[2][5] = function() LangerSchuss(2, 5) end gvAna_LangerSchussTribute[2][6] = function() LangerSchuss(2, 6) end gvAna_LangerSchussTribute[2][7] = function() LangerSchuss(2, 7) end gvAna_LangerSchussTribute[2][8] = function() LangerSchuss(2, 8) end gvAna_LangerSchussTribute[2][9] = function() LangerSchuss(2, 9) end gvAna_LangerSchussTribute[2][10] = function() LangerSchuss(2, 10) end gvAna_LangerSchussTribute[2][11] = function() LangerSchuss(2, 11) end gvAna_LangerSchussTribute[2][12] = function() LangerSchuss(2, 12) end gvAna_LangerSchussTribute[3][1] = function() LangerSchuss(3,1) end gvAna_LangerSchussTribute[3][2] = function() LangerSchuss(3, 2) end gvAna_LangerSchussTribute[3][3] = function() LangerSchuss(3, 3) end gvAna_LangerSchussTribute[3][4] = function() LangerSchuss(3, 4) end gvAna_LangerSchussTribute[3][5] = function() LangerSchuss(3, 5) end gvAna_LangerSchussTribute[3][6] = function() LangerSchuss(3, 6) end gvAna_LangerSchussTribute[3][7] = function() LangerSchuss(3, 7) end gvAna_LangerSchussTribute[3][8] = function() LangerSchuss(3, 8) end gvAna_LangerSchussTribute[3][9] = function() LangerSchuss(3, 9) end gvAna_LangerSchussTribute[3][10] = function() LangerSchuss(3, 10) end gvAna_LangerSchussTribute[3][11] = function() LangerSchuss(3, 11) end gvAna_LangerSchussTribute[3][12] = function() LangerSchuss(3, 12) end gvAna_LangerSchussTribute[4][1] = function() LangerSchuss(4,1) end gvAna_LangerSchussTribute[4][2] = function() LangerSchuss(4, 2) end gvAna_LangerSchussTribute[4][3] = function() LangerSchuss(4, 3) end gvAna_LangerSchussTribute[4][4] = function() LangerSchuss(4, 4) end gvAna_LangerSchussTribute[4][5] = function() LangerSchuss(4, 5) end gvAna_LangerSchussTribute[4][6] = function() LangerSchuss(4, 6) end gvAna_LangerSchussTribute[4][7] = function() LangerSchuss(4, 7) end gvAna_LangerSchussTribute[4][8] = function() LangerSchuss(4, 8) end gvAna_LangerSchussTribute[4][9] = function() LangerSchuss(4, 9) end gvAna_LangerSchussTribute[4][10] = function() LangerSchuss(4, 10) end gvAna_LangerSchussTribute[4][11] = function() LangerSchuss(4, 11) end gvAna_LangerSchussTribute[4][12] = function() LangerSchuss(4, 12) end gvAna_LangerSchussTribute[5][1] = function() LangerSchuss(5,1) end gvAna_LangerSchussTribute[5][2] = function() LangerSchuss(5, 2) end gvAna_LangerSchussTribute[5][3] = function() LangerSchuss(5, 3) end gvAna_LangerSchussTribute[5][4] = function() LangerSchuss(5, 4) end gvAna_LangerSchussTribute[5][5] = function() LangerSchuss(5, 5) end gvAna_LangerSchussTribute[5][6] = function() LangerSchuss(5, 6) end gvAna_LangerSchussTribute[5][7] = function() LangerSchuss(5, 7) end gvAna_LangerSchussTribute[5][8] = function() LangerSchuss(5, 8) end gvAna_LangerSchussTribute[5][9] = function() LangerSchuss(5, 9) end gvAna_LangerSchussTribute[5][10] = function() LangerSchuss(5, 10) end gvAna_LangerSchussTribute[5][11] = function() LangerSchuss(5, 11) end gvAna_LangerSchussTribute[5][12] = function() LangerSchuss(5, 12) end gvAna_LangerSchussTribute[6][1] = function() LangerSchuss(6,1) end gvAna_LangerSchussTribute[6][2] = function() LangerSchuss(6, 2) end gvAna_LangerSchussTribute[6][3] = function() LangerSchuss(6, 3) end gvAna_LangerSchussTribute[6][4] = function() LangerSchuss(6, 4) end gvAna_LangerSchussTribute[6][5] = function() LangerSchuss(6, 5) end gvAna_LangerSchussTribute[6][6] = function() LangerSchuss(6, 6) end gvAna_LangerSchussTribute[6][7] = function() LangerSchuss(6, 7) end gvAna_LangerSchussTribute[6][8] = function() LangerSchuss(6, 8) end gvAna_LangerSchussTribute[6][9] = function() LangerSchuss(6, 9) end gvAna_LangerSchussTribute[6][10] = function() LangerSchuss(6, 10) end gvAna_LangerSchussTribute[6][11] = function() LangerSchuss(6, 11) end gvAna_LangerSchussTribute[6][12] = function() LangerSchuss(6, 12) end gvAna_LangerSchussTribute[7][1] = function() LangerSchuss(7,1) end gvAna_LangerSchussTribute[7][2] = function() LangerSchuss(7, 2) end gvAna_LangerSchussTribute[7][3] = function() LangerSchuss(7, 3) end gvAna_LangerSchussTribute[7][4] = function() LangerSchuss(7, 4) end gvAna_LangerSchussTribute[7][5] = function() LangerSchuss(7, 5) end gvAna_LangerSchussTribute[7][6] = function() LangerSchuss(7, 6) end gvAna_LangerSchussTribute[7][7] = function() LangerSchuss(7, 7) end gvAna_LangerSchussTribute[7][8] = function() LangerSchuss(7, 8) end gvAna_LangerSchussTribute[7][9] = function() LangerSchuss(7, 9) end gvAna_LangerSchussTribute[7][10] = function() LangerSchuss(7, 10) end gvAna_LangerSchussTribute[7][11] = function() LangerSchuss(7, 11) end gvAna_LangerSchussTribute[7][12] = function() LangerSchuss(7, 12) end gvAna_LangerSchussTribute[8][1] = function() LangerSchuss(8,1) end gvAna_LangerSchussTribute[8][2] = function() LangerSchuss(8, 2) end gvAna_LangerSchussTribute[8][3] = function() LangerSchuss(8, 3) end gvAna_LangerSchussTribute[8][4] = function() LangerSchuss(8, 4) end gvAna_LangerSchussTribute[8][5] = function() LangerSchuss(8, 5) end gvAna_LangerSchussTribute[8][6] = function() LangerSchuss(8, 6) end gvAna_LangerSchussTribute[8][7] = function() LangerSchuss(8, 7) end gvAna_LangerSchussTribute[8][8] = function() LangerSchuss(8, 8) end gvAna_LangerSchussTribute[8][9] = function() LangerSchuss(8, 9) end gvAna_LangerSchussTribute[8][10] = function() LangerSchuss(8, 10) end gvAna_LangerSchussTribute[8][11] = function() LangerSchuss(8, 11) end gvAna_LangerSchussTribute[8][12] = function() LangerSchuss(8, 12) end gvAna_LangerSchussId = {} for i = 1,8 do gvAna_LangerSchussId[i] = {} for u = 1,12 do gvAna_LangerSchussId[i][u] = AddTribute( CreateATribute(8, "", { Gold = 0}, gvAna_LangerSchussTribute[i][u] ) ) end end end function LangerSchuss(_player, _hero) local _temp = {Logic.GetPlayerEntities(_player, herotable[_hero],1,0) } local _heropos = GetPosition(_temp[2]) local _temp2 = {Logic.GetEntitiesInArea( Entities.XD_Rock3, _heropos.X, _heropos.Y, 500, 60 )}; if _temp2[1] > 0 then EndJob(SchussJobId) if BallSperre == false then RadWinkel = (Winkel( GetPosition("Fussball"), _heropos) /360)*2*math.pi Schussstaerke = 210 Blocked = 0 SchussSound() SchussJobId = StartSimpleHiResJob("SchussJob") VORLAGE_player = LASTSHOT_player VORLAGE_hero = LASTSHOT_hero LASTSHOT_player = _player LASTSHOT_hero = _hero end end gvAna_LangerSchussId[_player][_hero] = AddTribute( CreateATribute(8, "", { Gold = 0}, gvAna_LangerSchussTribute[_player][_hero] ) ) end function KurzerSchuss(_player, _hero) local _temp = {Logic.GetPlayerEntities(_player, herotable[_hero],1,0) } local _heropos = GetPosition(_temp[2]) local _temp2 = {Logic.GetEntitiesInArea( Entities.XD_Rock3, _heropos.X, _heropos.Y, 500, 60 )}; if _temp2[1] > 0 then EndJob(SchussJobId) if BallSperre == false then RadWinkel = (Winkel( GetPosition("Fussball"), _heropos) /360)*2*math.pi Schussstaerke = 130 Blocked = 0 SchussSound() SchussJobId = StartSimpleHiResJob("SchussJob") VORLAGE_player = LASTSHOT_player VORLAGE_hero = LASTSHOT_hero LASTSHOT_player = _player LASTSHOT_hero = _hero end end gvAna_KurzerSchussId[_player][_hero] = AddTribute( CreateATribute(8, "", { Gold = 0}, gvAna_KurzerSchussTribute[_player][_hero] ) ) end function SchussJob() if SpielEnde then return true end local _oldPos = {} local _newPos = {} if BallSperre == false then _oldPos = GetPosition("Fussball") _newPos.X = math.floor( _oldPos.X - math.cos(RadWinkel)*Schussstaerke + 0.5 ) _newPos.Y = math.floor( _oldPos.Y - math.sin(RadWinkel)*Schussstaerke + 0.5 ) local temp = {Logic.GetEntitiesInArea( 0, _newPos.X, _newPos.Y, 160, 60 )}; if temp[1] > 0 then local _rnd = GetRandom(10) if _rnd > 7 then RadWinkel = (Winkel( GetPosition("Fussball"), GetPosition(temp[2])) /360)*2*math.pi Blocked = Blocked + 1 Schussstaerke = Schussstaerke - 20 elseif _rnd > 5 then RadWinkel = (Winkel( GetPosition("Fussball"), GetPosition(temp[2])) /360)*2*math.pi Blocked = Blocked + 1 Schussstaerke = Schussstaerke - 50 elseif _rnd > 3 then RadWinkel = GetRandom(6.28) else EndJob(SchussJobId) end else if _newPos.X < 3400 or _newPos.X > 16700 or _newPos.Y > 13400 or _newPos.Y < 5900 then if _newPos.X < 3400 or _newPos.X > 16700 then if _newPos.Y > 8800 and _newPos.Y < 10500 then if _newPos.X < 3400 then TORFUNC(1) else TORFUNC(2) end else _newPos.Y = math.floor( _oldPos.Y + math.sin(RadWinkel)*Schussstaerke + 0.5 ) RadWinkel = (Winkel( GetPosition("Fussball"), _newPos) /360)*2*math.pi end else _newPos.X = math.floor( _oldPos.X + math.cos(RadWinkel)*Schussstaerke + 0.5 ) RadWinkel = (Winkel( GetPosition("Fussball"), _newPos) /360)*2*math.pi end Schussstaerke = Schussstaerke - 10 else SetPosition("Fussball",_newPos) Schussstaerke = Schussstaerke - 5 end end else EndJob(SchussJobId) end if Blocked == 5 then --SpielerKicken() end if Schussstaerke <= 0 then EndJob(SchussJobId) end end function SchussSound() local x,y = Camera.ScrollGetLookAt(); local _fussball = GetPosition("Fussball"); local xDistance = (_fussball.X - x); local yDistance = (_fussball.Y - y); local _distance = math.sqrt((xDistance^2) + (yDistance^2)); if _distance < 3400 then Sound.PlayGUISound( Sounds.Military_SO_Cannon_rnd_1 , 100 - _distance/35) end end function TorSound() if TorSoundTimer == 0 or TorSoundTimer == 8 or TorSoundTimer == 16 or TorSoundTimer == 20 or TorSoundTimer == 24 or TorSoundTimer == 32 or TorSoundTimer == 36 or TorSoundTimer == 40 or TorSoundTimer == 44 or TorSoundTimer == 52 or TorSoundTimer == 56 then id = Sound.PlayGUISound( Sounds.Buildings_SO_StonemineCraneUp , 100 ) elseif TorSoundTimer > 58 then return true end TorSoundTimer = TorSoundTimer + 1 end function TORFUNC(_team) Message(" @color:255,255,0 T @color:255,0,255 O @color:0,255,255 R @color:255,128,128 TEAM ".._team) local rnd = GetRandom(5) if _team == mpc_playerteams[ LASTSHOT_player ] then if rnd > 4 then Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 hat mit @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 eingelocht!") elseif rnd > 3 then Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 hats gedreht! Wasn Schuss von @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 !") elseif rnd > 2 then Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 rockt ab! @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 geht ab!") elseif rnd > 1 then Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 zielsicher! @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 macht ihn rein!") else Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 juche! OLE OLE @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 macht ihn rein!") end else if rnd > 4 then Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 hat versagt! Da schoss @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 ins eigene Tor!") elseif rnd > 3 then Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 ist von gestern! @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 spielt wohl fuer den Gegner!") elseif rnd > 2 then Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 OHWEIA! @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 wollt das wohl nicht!") elseif rnd > 1 then Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 hat @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 nicht unter Kontrolle!") else Message(" @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player).." @color:255,255,255 EIGENTOR! Was hat @color:255,128,128 "..GetHeroNameByID(LASTSHOT_hero).." @color:255,255,255 da gemacht?") end end local rnd = GetRandom(5) if _team == mpc_playerteams[ VORLAGE_player ] then if rnd > 4 then Message(" Perfekte Vorlage von @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).."! @color:255,255,255 @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).." @color:255,255,255 ist ein Held!") elseif rnd > 3 then Message(" Welche Vorlage von @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).."! @color:255,255,255 Der @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).." @color:255,255,255 hat gepasst!") elseif rnd > 2 then Message(" Vorgelegt von @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).."! @color:255,255,255 Natuerlich von @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).."!") elseif rnd > 1 then Message(" Perfekter Pass von @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).."! @color:255,255,255 Heldenhafter Einsatz von @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).."!") else Message(" Zielsicher gepasst, @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).."! @color:255,255,255 Selbstlose Aktion, @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).."!") end else if rnd > 4 then Message(" Der Ball von @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).." @color:255,255,255 war nix! @color:255,255,255 @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).." @color:255,255,255 spielt dem Gegner vor die Fuesse!") elseif rnd > 3 then Message(" Was macht @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).." @color:255,255,255 da! @color:255,255,255 Der @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).." @color:255,255,255 das war wohl nix!") elseif rnd > 2 then Message(" Das gibt Stress fuer @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).."! @color:255,255,255 Meine Guete @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).." @color:255,255,255 !") elseif rnd > 1 then Message(" Mesch Meier! @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).."! @color:255,255,255 Da wollte @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).." @color:255,255,255 wohl woanders hin ballern!") else Message(" Das war die falsche Richtung @color:57,200,255 "..XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player).."! @color:255,255,255 @color:255,128,128 "..GetHeroNameByID(VORLAGE_hero).." @color:255,255,255 voll daneben!") end end _Spielstand[_team] = _Spielstand[_team] + 1 Torschuetzen[_team][_Spielstand[_team]] = {} Torschuetzen[_team][_Spielstand[_team]].Minute = math.floor(((Logic.GetTime()) / 60) + 1) Torschuetzen[_team][_Spielstand[_team]].TorTeam = mpc_playerteams[ LASTSHOT_player ] Torschuetzen[_team][_Spielstand[_team]].TorSpieler = XNetwork.GameInformation_GetLogicPlayerUserName(LASTSHOT_player) Torschuetzen[_team][_Spielstand[_team]].TorSpielerID = LASTSHOT_player if _team == Torschuetzen[_team][_Spielstand[_team]].TorTeam then Torschuetzen[_team][_Spielstand[_team]].TorFarbe = gvCol.gruen else Torschuetzen[_team][_Spielstand[_team]].TorFarbe = gvCol.rot end Torschuetzen[_team][_Spielstand[_team]].TorHeld = GetHeroNameByID(LASTSHOT_hero) Torschuetzen[_team][_Spielstand[_team]].VorlageTeam = mpc_playerteams[ VORLAGE_player ] Torschuetzen[_team][_Spielstand[_team]].VorlageSpieler = XNetwork.GameInformation_GetLogicPlayerUserName(VORLAGE_player) Torschuetzen[_team][_Spielstand[_team]].VorlageSpielerID = VORLAGE_player if _team == Torschuetzen[_team][_Spielstand[_team]].VorlageTeam then Torschuetzen[_team][_Spielstand[_team]].VorlageFarbe = gvCol.gruen else Torschuetzen[_team][_Spielstand[_team]].VorlageFarbe = gvCol.rot end Torschuetzen[_team][_Spielstand[_team]].VorlageHeld = GetHeroNameByID(VORLAGE_hero) local ScorerPlayer = {} for i = 1,8 do ScorerPlayer[i] = {} ScorerPlayer[i].Tore = 0 ScorerPlayer[i].VorlagenTore = 0 end for u = 1,2 do for i = 1, table.getn(Torschuetzen[u]) do for v = 1,8 do if Torschuetzen[u][i].TorSpielerID == v and Torschuetzen[u][i].TorTeam == u then ScorerPlayer[v].Tore = ScorerPlayer[v].Tore + 1 ScorerPlayer[v].VorlagenTore = ScorerPlayer[v].VorlagenTore + 1 end if Torschuetzen[u][i].VorlageSpielerID == v and Torschuetzen[u][i].VorlageTeam == u then ScorerPlayer[v].VorlagenTore = ScorerPlayer[v].VorlagenTore + 1 end end end end local Tore = 0 local VorlagenTore = 0 for i = 1,8 do if ScorerPlayer[i].Tore > 0 then if ScorerPlayer[i].Tore > Tore then Tore = ScorerPlayer[i].Tore Torschuetzenkoenig = Tore..": "..XNetwork.GameInformation_GetLogicPlayerUserName(i) elseif ScorerPlayer[i].Tore == Tore then Torschuetzenkoenig = Torschuetzenkoenig.. " "..XNetwork.GameInformation_GetLogicPlayerUserName(i) end end if ScorerPlayer[i].VorlagenTore > 0 then if ScorerPlayer[i].VorlagenTore > VorlagenTore then VorlagenTore = ScorerPlayer[i].VorlagenTore ScorerOfTheGame = VorlagenTore..": "..XNetwork.GameInformation_GetLogicPlayerUserName(i) elseif ScorerPlayer[i].Tore == Tore then ScorerOfTheGame = ScorerOfTheGame.. " "..XNetwork.GameInformation_GetLogicPlayerUserName(i) end end end Message("Es steht ".._Spielstand[1]..":".._Spielstand[2] ) Message("Ball wird freigegeben in 20 Sekunden!") Ballfreigabe = 20 TorJobId = StartSimpleJob("Torjob") TorSoundTimer = 0 StartSimpleHiResJob("TorSound") BallSperre = true local BallLegen = {} BallLegen.X = Mitte.X BallLegen.Y = Mitte.Y while true do local temp = {Logic.GetEntitiesInArea( 0, BallLegen.X, BallLegen.Y, 300, 60 )}; if temp[1] > 0 then BallLegen.X = BallLegen.X + GetRandom(100) - 50 BallLegen.Y = BallLegen.Y + GetRandom(100) - 50 else SetPosition("Fussball",BallLegen) break end --Mitte.X = 8015 --Mitte.Y = 8100 end local _mapname = "Siedlerfussball" end function Torjob() Ballfreigabe = Ballfreigabe - 1 if Ballfreigabe < 10 then Message ("Spiel geht weiter in "..Ballfreigabe.." Sekunden") if Ballfreigabe == 0 then BallSperre = false EndJob(TorJobId) end end end function Fouljob() local _Pos = GetPosition("Fussball") local _temp = {Logic.GetEntitiesInArea( 0, _Pos.X, _Pos.Y, 600, 60 )}; local _time = Logic.GetTime() _time = _time - StartZeit local _mapname = "Siedlerfussball" local _sec = math.mod(_time,60) local _min = math.floor(_time/60) if math.floor(_sec/10) == 0 then _sec = "0".._sec end if StartZeit >= 0 then MapVersion_Write_Comfort(_mapname, _Spielstand[1]..":".._Spielstand[2],_min..":".._sec) if mpc_Rules["Gametime"].Cur > 1 then if _time >= (mpc_Rules["Gametime"][mpc_Rules["Gametime"].Cur] * 60) then if NachSpielZeit == false then if mpc_Rules["GoldenGoal"][mpc_Rules["GoldenGoal"].Cur] == "Ja" then if _Spielstand[1] == _Spielstand[2] then Message("@color:255,0,0 NACHSPIELZEIT! Das naechste Tor entscheidet!") else Message("@color:255,0,0 Das Spiel ist zuende!") EndJob(SchussJobId) Logic.SuspendAllEntities() NachSpielZeit = true SpielEnde = true return true end NachSpielZeit = true else Message("@color:255,0,0 Das Spiel ist zuende!") EndJob(SchussJobId) Logic.SuspendAllEntities() NachSpielZeit = true SpielEnde = true return true end else if not(_Spielstand[1] == _Spielstand[2]) then Message("@color:255,0,0 Das Spiel ist zuende!") EndJob(SchussJobId) Logic.SuspendAllEntities() NachSpielZeit = true SpielEnde = true return true end end end end end if _temp[1] > 1 then local p1 = 0 local p2 = 0 for i = 2,_temp[1]+1 do if mpc_playerteams[GetPlayer(_temp[i])] == 1 then p1 = p1 + 1 if p1 > 1 then foult1 = foult1 + 1 end if foult1 > 5 then for v = 2,_temp[1]+1 do MoveEntityFussball(_temp[v], 1, 1500) end foult1 = 0 end elseif mpc_playerteams[GetPlayer(_temp[i])] == 2 then p2 = p2 + 1 if p2 > 1 then foult2 = foult2 + 1 end if foult2 > 5 then for v = 2,_temp[1]+1 do MoveEntityFussball(_temp[v], 2, 1500) end foult2 = 0 end end end end local _temp = {Logic.GetEntitiesInArea( 0, tort1.X, tort1.Y, torrad, 60 )}; if _temp[1] > 2 then local t1 = 0 for i = 2,_temp[1]+1 do if mpc_playerteams[GetPlayer(_temp[i])] == 1 then t1 = t1 + 1 if t1 > 1 then MoveEntityFussball(_temp[i], 1, 1200) end elseif mpc_playerteams[GetPlayer(_temp[i])] == 2 then MoveEntityFussball(_temp[i], 2, 1200) end end end local _temp2 = {Logic.GetEntitiesInArea( Entities.XD_Rock3, tort1.X, tort1.Y, torrad, 60 )}; if _temp2[1] > 0 then fussballt1 = fussballt1 - 1 if fussballt1 < 1 then MoveFussballFromGoal(1,_temp2[2]) fussballt1 = 15 end else if fussballt1 < 15 then fussballt1 = fussballt1 + 1 end end local _temp = {Logic.GetEntitiesInArea( 0, tort2.X, tort2.Y, torrad, 60 )}; if _temp[1] > 2 then local t2 = 0 for i = 2,_temp[1]+1 do if mpc_playerteams[GetPlayer(_temp[i])] == 2 then --XNetwork.GameInformation_GetLogicPlayerTeam(GetPlayer(_temp[i])) == 1 then t2 = t2 + 1 if t2 > 1 then MoveEntityFussball(_temp[i], 2, 1200) end elseif mpc_playerteams[GetPlayer(_temp[i])] == 1 then MoveEntityFussball(_temp[i], 1, 1200) end end end local _temp2 = {Logic.GetEntitiesInArea( Entities.XD_Rock3, tort2.X, tort2.Y, torrad, 60 )}; if _temp2[1] > 0 then fussballt2 = fussballt2 - 1 if fussballt2 < 1 then MoveFussballFromGoal(2,_temp2[2]) fussballt2 = 15 end else if fussballt2 < 15 then fussballt2 = fussballt2 + 1 end end end function MoveEntityFussball(_eId, _team, _range) local _Pos = GetPosition(_eId) local RadWinkel = GetRandom(6.28) local _newPos = {} _newPos.X = math.floor( _Pos.X - math.cos(RadWinkel)*_range + 0.5 ) _newPos.Y = math.floor( _Pos.Y - math.sin(RadWinkel)*_range+ 0.5 ) if mpc_playerteams[GetPlayer(_eId)] == _team then for u=0,5 do local _temp2 = {Logic.GetEntitiesInArea( 0, _newPos.X, _newPos.Y, 160, 60 )}; --Message(_temp2[1]) if _temp2[1] == 0 then SetPosition(_eId,_newPos) break end _newPos.X = math.floor( _newPos.X - math.cos(RadWinkel)*200 + 0.5 ) _newPos.Y = math.floor( _newPos.Y - math.sin(RadWinkel)*200 + 0.5 ) end end end function MoveFussballFromGoal(_goalId,_eId) local _Pos = GetPosition(_eId) local RadWinkel = GetRandom(6.28) local _newPos = {} if _goalId == 1 then _newPos.X = math.floor( _Pos.X - math.abs(math.cos(RadWinkel)*2000) + 0.5 ) else _newPos.X = math.floor( _Pos.X + math.abs(math.cos(RadWinkel)*2000) + 0.5 ) end _newPos.Y = math.floor( _Pos.Y - math.sin(RadWinkel)*2000+ 0.5 ) for u=0,5 do local _temp2 = {Logic.GetEntitiesInArea( 0, _newPos.X, _newPos.Y, 160, 60 )}; if _temp2[1] == 0 then SetPosition(_eId,_newPos) break end _newPos.X = math.floor( _newPos.X - math.cos(RadWinkel)*200 + 0.5 ) _newPos.Y = math.floor( _newPos.Y - math.sin(RadWinkel)*200 + 0.5 ) end end function SpielerKicken() local _ballpos = GetPosition("Fussball") local _temp = {Logic.GetEntitiesInArea( 0, _ballpos.X, _ballpos.Y, 1000, 60 )}; SpielerKick = {} local u = 1 for i = 2, _temp[1]+1 do local _eT = Logic.GetEntityType(temp[i]) if _eT == Entities.PU_Hero1 or _eT == Entities.PU_Hero2 or _eT == Entities.PU_Hero3 or _eT == Entities.PU_Hero4 or _eT == Entities.PU_Hero5 or _eT == Entities.PU_Hero6 or _eT == Entities.CU_BlackKnight or _eT == Entities.CU_Mary_de_Mortfichet or _eT == Entities.CU_Barbarian_Hero or _eT == Entities.CU_Evil_Queen or _eT == Entities.PU_Hero10 or _eT == Entities.PU_Hero11 then SpielerKick[u] = {} SpielerKick[u].Id = _temp[i] SpielerKick[u].Pos = GetPosition(_temp[i]) SpielerKick[u].RadWinkel = (Winkel( GetPosition(SpielerKick[u].Id), GetPosition("Fussball") ) /360)*2*math.pi u = u + 1 end end Kickstaerke = 1000 --Message("Job Starten"..SpielerKick[1].Id) KickJobId = StartSimpleHiResJob("KickJob") end function KickJob() for i = 1, table.getn(SpielerKick) do SpielerKick[i].Pos.X = math.floor( SpielerKick[i].Pos.X - math.cos(SpielerKick[i].RadWinkel)*Kickstaerke + 0.5 ) SpielerKick[i].Pos.Y = math.floor( SpielerKick[i].Pos.Y - math.sin(SpielerKick[i].RadWinkel)*Kickstaerke + 0.5 ) SetPosition(SpielerKick[i].Pos) end Kickstaerke = Kickstaerke - 1000 if Kickstaerke <= 0 then EndJob(KickJobId) end end function Winkel(_Pos1,_Pos2) local delta_X = 0; local delta_Y = 0; local alpha = 0 if type (_Pos1) == "string" or type (_Pos1) == "number" then _Pos1 = GetPosition(GetEntityId(_Pos1)); end if type (_Pos2) == "string" or type (_Pos2) == "number" then _Pos2 = GetPosition(GetEntityId(_Pos2)); end delta_X = _Pos1.X - _Pos2.X delta_Y = _Pos1.Y - _Pos2.Y if delta_X == 0 and delta_Y == 0 then -- Gleicher Punkt return 0 end alpha = math.deg(math.asin(math.abs(delta_X)/(math.sqrt(__pow(delta_X, 2)+__pow(delta_Y, 2))))) if delta_X >= 0 and delta_Y > 0 then alpha = 270 - alpha elseif delta_X < 0 and delta_Y > 0 then alpha = 270 + alpha elseif delta_X < 0 and delta_Y <= 0 then alpha = 90 - alpha elseif delta_X >= 0 and delta_Y <= 0 then alpha = 90 + alpha end return alpha end function Setup_GUIHacks() GUIAction_Hero1SendHawk = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][1] ) end GUIAction_Hero1ProtectUnits = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][1] ) end GUIAction_Hero2PlaceBomb = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][2] ) end GUIAction_Hero2BuildCannon = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][2] ) end GUIAction_Hero3BuildTrap = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][3] ) end GUIAction_Hero3Heal = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][3] ) end GUIAction_Hero4CircularAttack = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][4] ) end GUIAction_Hero4AuraOfWar = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][4] ) end GUIAction_Hero5Camouflage = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][5] ) end GUIAction_Hero5Summon = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][5] ) end GUIAction_Hero6ConvertSettlers = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][6] ) end GUIAction_Hero6Bless = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][6] ) end GUIAction_Hero7InflictFear = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][7] ) end GUIAction_Hero7Madness = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][7] ) end GUIAction_Hero8Poison = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][8] ) end GUIAction_Hero8MoraleDamage = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][8] ) end GUIAction_Hero9CallWolfs = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][9] ) end GUIAction_Hero9Berserk = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][9] ) end GUIAction_Hero10SniperAttack = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][10] ) end GUIAction_Hero10LongRangeAura = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][10] ) end GUIAction_Hero11Shuriken = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][11] ) end GUIAction_Hero11FireworksFear = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][11] ) end GUIAction_Hero11FireworksMotivate = function() end GUIAction_Hero12PoisonRange = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_LangerSchussId[_guiplayer][12] ) end GUIAction_Hero12PoisonArrows = function() local _guiplayer = GUI.GetPlayerID() GUI.PayTribute( 8, gvAna_KurzerSchussId[_guiplayer][12] ) end GUITooltip_NormalButton_Orig = GUITooltip_NormalButton GUITooltip_NormalButton = function(_a,_b) local _text = "" local found = false if _a == "MenuHero2/command_bomb" then _text = gvCol.gelb.." Kurzer Schuss" _found = true elseif _a == "MenuHero2/command_buildcannon" then _text = gvCol.rot.." Langer Schuss" _found = true elseif _a == "MenuHero3/command_buildTrap" then _text = gvCol.gelb.." Kurzer Schuss" _found = true elseif _a == "MenuHero3/command_heal" then _text = gvCol.rot.." Langer Schuss" _found = true elseif _a == "MenuHero4/command_circularattack" then _text = gvCol.gelb.." Kurzer Schuss" _found = true elseif _a == "MenuHero4/command_auraofwar" then _text = gvCol.rot.." Langer Schuss" _found = true elseif _a == "MenuHero5/command_camouflage" then _text = gvCol.gelb.." Kurzer Schuss" _found = true elseif _a == "MenuHero5/command_summon" then _text = gvCol.rot.." Langer Schuss" _found = true elseif _a == "MenuHero6/command_convertbuilding" then _text = gvCol.gelb.." Kurzer Schuss" _found = true elseif _a == "MenuHero6/command_bless" then _text = gvCol.rot.." Langer Schuss" _found = true elseif _a == "MenuHero7/command_inflictFear" then _text = gvCol.gelb.." Kurzer Schuss"; _found = true; elseif _a == "MenuHero7/command_madness" then _text = gvCol.rot.." Langer Schuss"; _found = true; elseif _a == "MenuHero8/command_poison" then _text = gvCol.gelb.." Kurzer Schuss"; _found = true; elseif _a == "MenuHero8/command_moraledamage" then _text = gvCol.rot.." Langer Schuss"; _found = true; elseif _a == "MenuHero9/command_callwolfs" then _text = gvCol.gelb.." Kurzer Schuss"; _found = true; elseif _a == "MenuHero9/command_berserk" then _text = gvCol.rot.." Langer Schuss"; _found = true; elseif _a == "AOMenuHero10/command_sniperattack" then _text = gvCol.gelb.." Kurzer Schuss"; _found = true; elseif _a == "AOMenuHero10/command_longrangeaura" then _text = gvCol.rot.." Langer Schuss"; _found = true; elseif _a == "AOMenuHero11/command_Shuriken" then _text = gvCol.gelb.." Kurzer Schuss"; _found = true; elseif _a == "AOMenuHero11/command_FireworksFear" then _text = gvCol.rot.." Langer Schuss"; _found = true; elseif _a == "AOMenuHero12/command_PoisonRange" then _text = gvCol.gelb.." Kurzer Schuss"; _found = true; elseif _a == "AOMenuHero12/command_poisonarrows" then _text = gvCol.rot.." Langer Schuss" _found = true end if _found == true then XGUIEng.SetText( gvGUI_WidgetID.TooltipBottomText,_text); -- 1 then for _teamplayerID = 1, _humenPlayer do local _teamplayer = XNetwork.GameInformation_GetLogicPlayerTeam( _teamplayerID ) for _oppoPlayerID = 1, _humenPlayer do if _teamplayerID ~= OppoPlayer then local _oppoPlayer = XNetwork.GameInformation_GetLogicPlayerTeam( _oppoPlayerID ) if _teamplayer == _oppoPlayer then Logic.SetDiplomacyState( _oppoPlayerID, _teamplayerID, Diplomacy.Friendly ) else Logic.SetDiplomacyState( _oppoPlayerID, _teamplayerID, Diplomacy.Neutral ) end end end end end end end function MapVersion_Write_Comfort(_mapname, _stand, _time) g_MC_VT = "@color:255,128,128 @cr ".._mapname.." @cr @cr Spielstand: @cr ".._stand.." @cr @cr Zeit: @cr ".._time -- Regeln: g_MC_VT = g_MC_VT.." @cr @cr Regeln: @cr Dauer: "..mpc_Rules["Gametime"][mpc_Rules["Gametime"].Cur].." @cr Golden Goal: "..mpc_Rules["GoldenGoal"][mpc_Rules["GoldenGoal"].Cur] MapVersion_InitMapInfoButton( g_MC_VT ) end function MapVersion_InitMapInfoButton( _text) if type(_text) == "string" then XGUIEng.SetText( "TopMainMenuTextButton", "@color:0,0,0,0: ....... @color:255,255,255 Menü @cr @cr ".._text) else XGUIEng.SetText( "TopMainMenuTextButton", "@color:0,0,0,0: ....... @color:255,255,255 Menü @cr @cr Hier die Mapversion und sonstige Infos einfügen") end end -- Tributfunktionen function AddTribute( _tribute ) assert( type( _tribute ) == "table", "Tribut muß ein Table sein" ); assert( type( _tribute.text ) == "string", "Tribut.text muß ein String sein" ); assert( type( _tribute.cost ) == "table", "Tribut.cost muß ein Table sein" ); assert( type( _tribute.playerId ) == "number", "Tribut.playerId muß eine Nummer sein" ); assert( not _tribute.Tribute , "Tribut.Tribute darf nicht vorbelegt sein"); uniqueTributeCounter = uniqueTributeCounter or 1; _tribute.Tribute = uniqueTributeCounter; uniqueTributeCounter = uniqueTributeCounter + 1; local tResCost = {}; for k, v in pairs( _tribute.cost ) do assert( ResourceType[k] ); assert( type( v ) == "number" ); table.insert( tResCost, ResourceType[k] ); table.insert( tResCost, v ); end Logic.AddTribute( _tribute.playerId, _tribute.Tribute, 0, 0, _tribute.text, unpack( tResCost ) ); SetupTributePaid( _tribute ); return _tribute.Tribute; end function CreateATribute(_playerID, _text, _cost, _callback) local tribute = {}; tribute.playerId = _playerID; tribute.text = _text; tribute.cost = _cost; tribute.Callback = _callback; return tribute end function GameCallback_FulfillTribute() return 1 end function GetHeroNameByID(_ID) if _ID == 1 then return "Dario"; end if _ID == 2 then return "Pilgrim"; end if _ID == 3 then return "Salim"; end if _ID == 4 then return "Erec"; end if _ID == 5 then return "Ari"; end if _ID == 6 then return "Helias"; end if _ID == 7 then return "Kerberos"; end if _ID == 8 then return "Mary"; end if _ID == 9 then return "Varg"; end if _ID == 10 then return "Drake"; end if _ID == 11 then return "Yuki"; end if _ID == 12 then return "Kala"; end end function SetPeacetime( _seconds ) ---hier wird die Funktion special peacetime gestartet SpecialPeacetime(); StartCountdown( _seconds, PeacetimeEnd, true ); end function PeacetimeEnd() MultiplayerTools.SetUpDiplomacyOnMPGameConfig() PeaceTimeEndActions() end function SpecialPeacetime() -- Anzahl der menschlichen Spieler wird hier ermittelt local _humenPlayer = XNetwork.GameInformation_GetMapMaximumNumberOfHumanPlayer() -- Abfrage ob Standardsituation gegeben ist das jeder sich mit jedem verbünden kann if XNetwork.GameInformation_GetFreeAlliancesFlag() == 1 then -- Feststellung wer mit wem verbündet ist und Festlegung des Diplomatistatus für die Peacetime if _humenPlayer > 1 then for _teamplayerID = 1, _humenPlayer do local _teamplayer = XNetwork.GameInformation_GetLogicPlayerTeam( _teamplayerID ) for _oppoPlayerID = 1, _humenPlayer do if _teamplayerID ~= OppoPlayer then local _oppoPlayer = XNetwork.GameInformation_GetLogicPlayerTeam( _oppoPlayerID ) if _teamplayer == _oppoPlayer then Logic.SetDiplomacyState( _oppoPlayerID, _teamplayerID, Diplomacy.Friendly ) else Logic.SetDiplomacyState( _oppoPlayerID, _teamplayerID, Diplomacy.Neutral ) end end end end end end end --Countdown Comfort Funktionen function StartCountdown(_Limit, _Callback, _Show) assert(type(_Limit) == "number") Counter.Index = (Counter.Index or 0) + 1 if _Show and CountdownIsVisisble() then assert(false, "StartCountdown: A countdown is already visible") end Counter["counter" .. Counter.Index] = {Limit = _Limit, TickCount = 0, Callback = _Callback, Show = _Show, Finished = false} if _Show then MapLocal_StartCountDown(_Limit) end if Counter.JobId == nil then Counter.JobId = StartSimpleJob("CountdownTick") end return Counter.Index end function StopCountdown(_Id) if Counter.Index == nil then return end if _Id == nil then for i = 1, Counter.Index do if Counter.IsValid("counter" .. i) then if Counter["counter" .. i].Show then MapLocal_StopCountDown() end Counter["counter" .. i] = nil end end else if Counter.IsValid("counter" .. _Id) then if Counter["counter" .. _Id].Show then MapLocal_StopCountDown() end Counter["counter" .. _Id] = nil end end end function CountdownTick() local empty = true for i = 1, Counter.Index do if Counter.IsValid("counter" .. i) then if Counter.Tick("counter" .. i) then Counter["counter" .. i].Finished = true end if Counter["counter" .. i].Finished and not IsBriefingActive() then if Counter["counter" .. i].Show then MapLocal_StopCountDown() end -- callback function if type(Counter["counter" .. i].Callback) == "function" then Counter["counter" .. i].Callback() end Counter["counter" .. i] = nil end empty = false end end if empty then Counter.JobId = nil Counter.Index = nil return true end end function CountdownIsVisisble() for i = 1, Counter.Index do if Counter.IsValid("counter" .. i) and Counter["counter" .. i].Show then return true end end return false end function MovieFenster( _title, _text, _WPinternal ) if gvWP then if _WPinternal then -- MovieFenster wird vom Itm-Skript aufgerufen gvWP.MF.internalUse = true; MovieFensterCore( _title, _text ); else -- ... vom Mapper gvWP.MF.externalUse = true; gvWP.MF.BACKUPextTitle = _title; gvWP.MF.BACKUPextText = _text; if not gvWP.MF.internalUse then MovieFensterCore( _title, _text ); end end else MovieFensterCore( _title, _text ); end end function MovieFensterCore( _title, _text ) XGUIEng.ShowWidget( "Movie", 1 ); XGUIEng.ShowWidget( "Cinematic_Text", 0 ); XGUIEng.ShowWidget( "MovieBarTop", 0 ); XGUIEng.ShowWidget( "MovieBarBottom", 0 ); XGUIEng.ShowWidget( "MovieInvisibleClickCatcher", 0 ); XGUIEng.ShowWidget( "CreditsWindowLogo", 0 ); XGUIEng.SetText( "CreditsWindowTextTitle", _title ); XGUIEng.SetText( "CreditsWindowText", _text ); end function HideMovieFenster( _WPinternal ) if gvWP then if _WPinternal then -- HideMovieFenster wird vom Itm-Skript aufgerufen gvWP.MF.internalUse = false; if gvWP.MF.externalUse then MovieFensterCore( gvWP.MF.BACKUPextTitle, gvWP.MF.BACKUPextText ); else HideMovieFensterCore(); end else -- ... vom Mapper gvWP.MF.externalUse = false; if not gvWP.MF.internalUse then HideMovieFensterCore(); end end else HideMovieFensterCore(); end end function HideMovieFensterCore() XGUIEng.ShowWidget( "Movie", 0 ); end function WPUpdateFeedback() -- Funktion aus ItM made by Noigi if not (IsBriefingActive() or cutsceneIsActive) then local _text = "" if XGUIEng.IsModifierPressed(Keys.ModifierAlt) == 1 then _text = _text..gvCol.orange.." Scorer: "..gvCol.weiss.." "..ScorerOfTheGame.." @cr " _text = _text..gvCol.orange.." Torkoenig: "..gvCol.weiss.." "..Torschuetzenkoenig.." @cr " _text = _text..gvCol.orange.." Tore des Spiels / Vorlage @cr " for u = 1,2 do for i = 1, table.getn(Torschuetzen[u]) do _text = _text..gvCol.orange.." Team"..u..": "..gvCol.weiss.." "..Torschuetzen[u][i].Minute.."min "..Torschuetzen[u][i].TorFarbe.." "..Torschuetzen[u][i].TorSpieler.." "..Torschuetzen[u][i].VorlageFarbe.." "..Torschuetzen[u][i].VorlageSpieler.." @cr " end end MovieFenster(gvCol.space..": ....... "..gvCol.gruen.." Spielstand: "..gvCol.gruen.." ".._Spielstand[1]..":".._Spielstand[2],_text,true); else HideMovieFenster(true); end else HideMovieFenster(true); end end function Comfort_TrackEntitysIni() Track_Entity_Table = {} for i = 1,8 do Track_Entity_Table[i] = {} end Comfort_TrackEntityIni = function(_pId,_eType) local temp = {Logic.GetPlayerEntities(_pId, _eType,1)} local count = 0 Track_Entity_Table[_pId][_eType] = {} Track_Entity_Table[_pId][_eType].tracked = true Track_Entity_Table[_pId][_eType].count = 0 if temp[1] > 0 then local latestEntity = temp[2] for u = 1, Logic.GetNumberOfEntitiesOfTypeOfPlayer(_pId, _eType) do if latestEntity ~= 0 then table.insert(Track_Entity_Table[_pId][_eType], latestEntity) count = count + 1 end latestEntity = Logic.GetNextEntityOfPlayerOfType(latestEntity); end Track_Entity_Table[_pId][_eType].count = count end end Comfort_TrackEntity_Created = function(_eId) local _pId = GetPlayer(_eId) local _eType = Logic.GetEntityType(_eId) if Comfort_TrackEntity_IsTracked(_pId,_eType) then if Track_Entity_Table[_pId][_eType].tracked then table.insert(Track_Entity_Table[_pId][_eType], _eId) Track_Entity_Table[_pId][_eType].count = Track_Entity_Table[_pId][_eType].count + 1 end end end Comfort_TrackEntity_Destroyed = function(_eId) local _pId = GetPlayer(_eId) local _eType = Logic.GetEntityType(_eId) if Comfort_TrackEntity_IsTracked(_pId,_eType) then for i = 1, Track_Entity_Table[_pId][_eType].count do if _eId == Track_Entity_Table[_pId][_eType][i] then table.remove(Track_Entity_Table[_pId][_eType], i) break end end end end Comfort_TrackEntity_IsTracked = function(_pId, _eType, _TypeOrId) if _TypeOrId == false then _eType = Logic.GetEntityType(_eTypeOrId) end if type(Track_Entity_Table[_pId]) == "table" then if type(Track_Entity_Table[_pId][_eType]) == "table" then else return false end else return false end return Track_Entity_Table[_pId][_eType].tracked end Comfort_TrackEntity_RemoveTracking = function(_pId, _eType) Track_Entity_Table[_pId][_eType] = {} Track_Entity_Table[_pId][_eType].tracked = false Track_Entity_Table[_pId][_eType].count = -1 end end end function Globale_Hilfsvariablen() gvCol = { weiss = "@color:255,255,255", schwarz = "@color:0,0,0", rot = "@color:255,0,0", gelb = "@color:255,232,0", gruen = "@color:0,255,0", dunkelgruen = "@color:0,100,0", blau = "@color:0,0,255", lila = "@color:200,0,200", grau = "@color:150,150,150", tuerkis = "@color:0,180,180", orange = "@color:255,130,0", beige = "@color:190,190,150", hellgrau = "@color:170,170,170", dunkelgrau = "@color:120,120,120", TTgelb = "@color:255,200,0", TTrot = "@color:200,60,0", TUTgruen = "@color:90,190,20", space = "@color:0,0,0,0", } end