Moin, wie die meisten kennen ja alle die Fussball Map von Metin2.sg
Habe damals eine Fussball quest hierfür geschrieben. Da dafür keine Verwendung habe..
Schenke ich sie euch. Soweit ich mich erinnern kann funktionierte diese soweit gut.
Beurteilt bitte nicht den Code.. Ich weiss sieht horror brutal aus. Aber es war zu einem Zeitpunkt da gabs noch keine source...
Mittlerweile hätte ich es bestimmt schöner gemacht
Idee. Es gibt mehre Team Gruppen die gegeneinander Spielen müssen.
Das Gewinner Team tritt dann gegen das andere Gewinner Team an. usw... Bis am ende das letzte Team gegeneinander antritt..
Gab auch ne Belohnung und Gamemaster war der Schichdsrichter
Code
- quest Football_manager begin
- state start begin
- --[[
- Test um neue Tabellenform zu machen
- when 9010.chat."Football_manager: new tables test add" with is_test_server() begin
- if bool_to_str(cool) == 'false' then
- Football_players = { }
- end
- table.insert(Football_players, table.getn(Football_players) +1 ,{ name = pc.get_name(), empire = pc.empire, Team = 'Team X',} )
- say(""..table.getn(Football_players).."")
- end
- when 9010.chat."Football_manager: new tables test get" with is_test_server() begin
- for i = 1, table.getn(Football_players), 1 do
- say(""..Football_players[i].name.." "..Football_players[i].empire.." "..Football_players[i].Team.." ")
- end
- end
- Funktoniert, aber kein bock nun umzuschreiben!
- ]]
- when logout with pc.get_map_index() == 402 and game.get_event_flag("Football_status") >= 1 and bool_to_str(Footbal_have_table) == 'true' begin
- if Football_admin_id == pc.get_player_id() then
- notice_all("Ein Football Administrator muss gesetzt werden damit das Spiel fotgesetzt werden kann!")
- Football_admin_id = 0
- return
- end
- local name = pc.get_name()
- local empire = pc.get_empire()
- if empire == 1 then
- if Football_manager.get_tables_remove_var(Footbal_1_team_A,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- elseif Football_manager.get_tables_remove_var(Footbal_1_team_B,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- elseif Football_manager.get_tables_remove_var(Footbal_1_team_C,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- elseif Football_manager.get_tables_remove_var(Footbal_1_team_D,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- end
- elseif empire == 2 then
- if Football_manager.get_tables_remove_var(Footbal_2_team_A,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_B,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_C,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_D,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- end
- elseif empire == 3 then
- if Football_manager.get_tables_remove_var(Footbal_3_team_A,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_B,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_C,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_D,name) == true then
- Football_manager.get_tables_remove_var_all(name)
- notice_all("Der Spieler "..name.." hat das Event verlassen. Er wird Automatisch aus der Teamlerliste entfernt.")
- end
- end
- end
- function check_count_member_correct(empire,team,team2)
- if empire == 1 then
- if team == "Team A" then Football_group_check1 = table.getn(Footbal_1_team_A)
- elseif team == "Team B" then Football_group_check1 = table.getn(Footbal_1_team_B)
- elseif team == "Team C" then Football_group_check1 = table.getn(Footbal_1_team_C)
- elseif team == "Team D" then Football_group_check1 = table.getn(Footbal_1_team_D)
- end
- if team2 == "Team A" then Football_group_check2 = table.getn(Footbal_1_team_A)
- elseif team2 == "Team B" then Football_group_check2 = table.getn(Footbal_1_team_B)
- elseif team2 == "Team C" then Football_group_check2 = table.getn(Footbal_1_team_C)
- elseif team2 == "Team D" then Football_group_check2 = table.getn(Footbal_1_team_D)
- end
- if Football_group_check1 != Football_group_check2 then
- return false
- elseif Football_group_check1 == Football_group_check2 then
- return true
- end
- elseif empire == 2 then
- if team == "Team A" then Football_group_check1 = table.getn(Footbal_2_team_A)
- elseif team == "Team B" then Football_group_check1 = table.getn(Footbal_2_team_B)
- elseif team == "Team C" then Football_group_check1 = table.getn(Footbal_2_team_C)
- elseif team == "Team D" then Football_group_check1 = table.getn(Footbal_2_team_D)
- end
- if team2 == "Team A" then Football_group_check2 = table.getn(Footbal_2_team_A)
- elseif team2 == "Team B" then Football_group_check2 = table.getn(Footbal_2_team_B)
- elseif team2 == "Team C" then Football_group_check2 = table.getn(Footbal_2_team_C)
- elseif team2 == "Team D" then Football_group_check2 = table.getn(Footbal_2_team_D)
- end
- if Football_group_check1 != Football_group_check2 then
- return false
- elseif Football_group_check1 == Football_group_check2 then
- return true
- end
- elseif empire == 3 then
- if team == "Team A" then Football_group_check1 = table.getn(Footbal_3_team_A)
- elseif team == "Team B" then Football_group_check1 = table.getn(Footbal_3_team_B)
- elseif team == "Team C" then Football_group_check1 = table.getn(Footbal_3_team_C)
- elseif team == "Team D" then Football_group_check1 = table.getn(Footbal_3_team_D)
- end
- if team2 == "Team A" then Football_group_check2 = table.getn(Footbal_3_team_A)
- elseif team2 == "Team B" then Football_group_check2 = table.getn(Footbal_3_team_B)
- elseif team2 == "Team C" then Football_group_check2 = table.getn(Footbal_3_team_C)
- elseif team2 == "Team D" then Football_group_check2 = table.getn(Footbal_3_team_D)
- end
- if Football_group_check1 != Football_group_check2 then
- return false
- elseif Football_group_check1 == Football_group_check2 then
- return true
- end
- end
- end
- function find_table_var(tables,var)
- if bool_to_str(tables) == 'false' then
- return false
- else
- for i = 1, table.getn(tables), 1 do
- if tables[i] == var then
- return true
- elseif table.getn(tables) == i then
- return false
- end
- end
- end
- end
- function get_tables_remove_var(tables,var)
- for i = 1, table.getn(tables), 1 do
- if tables[i] == var then
- table.remove(tables, i)
- return true
- elseif table.getn(tables) == i then
- return false
- end
- end
- end
- function get_tables_remove_var_all(var)
- for i = 1, table.getn(Football_all_players), 1 do
- if Football_all_players[i] == var then
- table.remove(Football_all_players, i)
- end
- end
- end
- function check_exits(name)
- if Football_manager.find_table_var(Footbal_1_team_A,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_1_team_B,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_1_team_C,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_1_team_D,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_2_team_A,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_2_team_B,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_2_team_C,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_2_team_D,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_3_team_A,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_3_team_B,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_3_team_C,name) == true then return true
- elseif Football_manager.find_table_var(Footbal_3_team_D,name) == true then return true
- else
- return false
- end
- end
- when message_item.timer begin
- say_title("Fussball Gewinn")
- say("")
- say("Deine Gruppe war ausgezeichnet!")
- say("Dies soll belohnt werden, du erhälst:")
- say_item(Football_win_countitem.."x "..item_name(Football_win_item), Football_win_item,"")
- say("")
- say("Viel Spass mit deiner Belohnung.")
- pc.give_item2(Football_win_item,Football_win_countitem)
- end
- when messge_boni.timer begin
- say_title("Fussball Gewinn")
- say("")
- say("Deine Gruppe war ausgezeichnet!")
- say("Dies soll belohnt werden:")
- say("Du erhälst folgenden Boni:")
- say_reward(""..Football_win_boniselect.."")
- say("")
- say("Viel Spass mit deiner Belohnung.")
- affect.add_collect(Football_win_bonityp,Football_win_bonitvalue,Football_win_boniduration)
- end
- function give_belohnung(empire,group)
- if empire == 1 then
- if group == "Team A" then
- for i = 1, table.getn(Footbal_1_team_A), 1 do
- local u_vid = find_pc_by_name(Footbal_1_team_A[i])
- if u_vid >= 1 then
- pc.select(u_vid)
- if Football_win_option == 1 then
- timer("messge_boni",1)
- elseif Football_win_option == 2 then
- timer("message_item",1)
- end
- end
- end
- elseif group == "Team B" then
- for i = 1, table.getn(Footbal_1_team_B), 1 do
- local u_vid = find_pc_by_name(Footbal_1_team_B[i])
- if u_vid >= 1 then
- pc.select(u_vid)
- if Football_win_option == 1 then
- timer("messge_boni",1)
- elseif Football_win_option == 2 then
- timer("message_item",1)
- end
- end
- end
- elseif group == "Team C" then
- for i = 1, table.getn(Footbal_1_team_C), 1 do
- local u_vid = find_pc_by_name(Footbal_1_team_C[i])
- if u_vid >= 1 then
- pc.select(u_vid)
- if Football_win_option == 1 then
- timer("messge_boni",1)
- elseif Football_win_option == 2 then
- timer("message_item",1)
- end
- end
- end
- elseif group == "Team D" then
- for i = 1, table.getn(Footbal_1_team_D), 1 do
- if u_vid >= 1 then
- pc.select(u_vid)
- if Football_win_option == 1 then
- timer("messge_boni",1)
- elseif Football_win_option == 2 then
- timer("message_item",1)
- end
- end
- end
- end
- elseif empire == 2 then
- elseif empiere == 3 then
- end
- end
- function port_all_place(empire,group,option,Platzzuweis,applyduration)
- --t_chat("GM #empire# "..empire.." #group# "..group.."")
- if empire == 1 then
- --t_chat("GM: empire 1 #group# "..group.."")
- if group == "Team A" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_1_team_A), 1 do
- local u_vid = find_pc_by_name(Footbal_1_team_A[i])
- --t_chat("GM: #vid# "..u_vid.."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld rot A")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus Rot A")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif group == "Team B" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_1_team_B), 1 do
- local u_vid = find_pc_by_name(Footbal_1_team_B[i])
- --t_chat("GM: #vid# "..u_vid.."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld rot B")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus Rot B")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif group == "Team C" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_1_team_C), 1 do
- local u_vid = find_pc_by_name(Footbal_1_team_C[i])
- --t_chat("GM: #vid# "..u_vid.."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld rot C")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus Rot C")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif group == "Team D" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_1_team_D), 1 do
- local u_vid = find_pc_by_name(Footbal_1_team_D[i])
- --t_chat("GM: #vid# "..u_vid.."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld rot D")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus Rot D")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif empire == 2 then
- --t_chat("GM: empire 2 #group# "..group.."")
- if group == "Team A" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_2_team_A), 1 do
- local u_vid = find_pc_by_name(Footbal_2_team_A[i])
- --t_chat("GM: #vid# "..u_vid.."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld gelb A")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus gelb A")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif group == "Team B" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_2_team_B), 1 do
- local u_vid = find_pc_by_name(Footbal_2_team_B[i])
- --t_chat("GM: #vid# "..u_vid.."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld gelb B")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus gelb B")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif group == "Team C" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_2_team_C), 1 do
- local u_vid = find_pc_by_name(Footbal_2_team_C[i])
- --t_chat("GM: #vid# "..u_vid.."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld gelb C")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus gelb C")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif group == "Team D" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_2_team_D), 1 do
- local u_vid = find_pc_by_name(Footbal_2_team_D[i])
- --t_chat("GM: #vid# "..u_vid.."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld gelb D")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus gelb D")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif empire == 3 then
- --t_chat("GM: empire 3 #group# "..group.."")
- if group == "Team A" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_3_team_A), 1 do
- local u_vid = find_pc_by_name(Footbal_3_team_A[i])
- --t_chat("GM: #vid# "..u_vid.." "..Footbal_3_team_A[i].."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld blau A")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus blau A")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif group == "Team B" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_3_team_B), 1 do
- local u_vid = find_pc_by_name(Footbal_3_team_B[i])
- --t_chat("GM: #vid# "..u_vid.." "..Footbal_3_team_B[i].."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld blau B")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus blau B")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif group == "Team C" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_3_team_C), 1 do
- local u_vid = find_pc_by_name(Footbal_3_team_C[i])
- --t_chat("GM: #vid# "..u_vid.." "..Footbal_3_team_C[i].."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld blau C")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus blau C")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- elseif group == "Team D" then
- --t_chat("GM: #option# "..option.." GROUP ##"..group.."")
- for i = 1, table.getn(Footbal_3_team_D), 1 do
- local u_vid = find_pc_by_name(Footbal_3_team_D[i])
- --t_chat("GM: #vid# "..u_vid.." "..Footbal_3_team_D[i].."")
- if u_vid >= 1 then
- pc.select(u_vid)
- if option == 1 then
- if Platzzuweis == 1 then
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(110,140)
- --t_chat(" Platz 1")
- elseif Platzzuweis == 2 then
- --t_chat(" Platz 2")
- affect.add(apply.MOV_SPEED, -1000, applyduration)
- LiB_move_to(140,140) --B
- end
- --t_chat("Porte dich ins Fussballfeld blau D")
- elseif option == 2 then
- LiB_move_to(125,115) --chat("Porte dich heraus blau D")
- elseif option == 3 then
- LiB_move_to(500,500) --port Reich platz
- end
- end
- --pc.select(Football_admin_vid)
- end
- end
- end
- end
- function set_variables()
- --Config
- Football_maximal_user_pro_gruppe = 8
- Football_minimal_user_pro_gruppe = 1
- Football_starttime = 80
- Football_item_table = {
- { vnum = 50512, count = 1, }, --Regenbogenstein
- { vnum = 72723, count = 1, } --Elixier der Sonne (K)
- }
- Football_boni_table = {
- { name = "Erfahrung 15% (1 Tag)", typ = 55, value = 15, duration = 60*60*24,},
- { name = "Stark gegen Monster 10% (1 Tag)", typ = 63, value = 10, duration = 60*60*24,}
- }
- --
- Football_timer = 0
- Footbal_have_table = { }
- Footbal_1_team_A = { }
- Footbal_1_team_B = { }
- Footbal_1_team_C = { }
- Footbal_1_team_D = { }
- Footbal_2_team_A = { }
- Footbal_2_team_B = { }
- Footbal_2_team_C = { }
- Footbal_2_team_D = { }
- Footbal_3_team_A = { }
- Footbal_3_team_B = { }
- Footbal_3_team_C = { }
- Footbal_3_team_D = { }
- Football_empire_gegner_01 = "keiner"
- Football_empire_gegner_02 = "keiner"
- Footbal_tor_A = 0
- Footbal_tor_B = 0
- Footbal_tor_C = 0
- Footbal_tor_D = 0
- Football_Punktestand01 = 0
- Football_Punktestand02 = 0
- Football_winner_01 = "keiner"
- Football_winner_02 = "keiner"
- Footbal_empire_name = "keiner"
- Footbal_empire = 0
- Football_group_check1 = 0
- Football_group_check2 = 0
- Football_team_wahl = {"Team A","Team B","Team C","Team D"}
- Football_all_players = { }
- Football_check_count = false
- Football_admin_id = 0
- Football_admin_vid = 0
- Football_win_boniselect = 'noname'
- Football_win_bonityp = 0
- Football_win_bonitvalue = 0
- Football_win_boniduration = 0
- Football_win_item = 0
- Football_win_countitem = 0
- end
- when login with pc.get_map_index() == 402 begin
- if pc.get_local_x() >= 105 and pc.get_local_x() <= 148 and pc.get_local_y() >= 125 and pc.get_local_y() <= 153 then
- chat("Du befindet dich in Fussballfeld. Du wirst an dem Startpunkt versetzt!")
- pc.warp(84900,97000)
- end
- end
- when letter with game.get_event_flag("Football_status") == 1 and pc.get_map_index() != 402 begin
- send_letter("Fussball Turnier")
- end
- when button or info begin
- addimage(24,10,'Football.tga')
- say("")
- say("")
- say("")
- if game.get_event_flag("Football_status") >= 1 then
- say_title("Fussball Turnier")
- say("OLE, OLE OLE OLE")
- say("Es ist so weit, jetzt wird Fussball gespielt")
- say("trete einem Team bei und helf ihm dabei")
- say("zum Erfolg.")
- wait()
- say("Willst du dabei sein bzw. zuschauen?")
- local i = select("Ja","Nein")
- if i == 1 then
- pc.warp(84900,97000)
- end
- else
- return;
- end
- end
- when 20082.chat."Fussball-Turnier Map betreten" with game.get_event_flag("Football_status") >= 1 and pc.get_map_index() != 402 begin
- pc.warp(84900,97000)
- end
- when 20082.chat."GM: Einstellungen #aufbbau#" with game.get_event_flag("Football_status") >= 1 and bool_to_str(Footbal_have_table) == 'true' and pc.is_gm() and LIB_GM_rights_access('game_can_event') == true begin
- say_title("Fussballverwaltung - Settings")
- if Football_check_count == true then
- say("Prüfung der Mitgliederanzahl: JA")
- else
- say("Prüfung der Mitgliederanzahl: NEIN")
- end
- say("Maximale Spieler pro Gruppe: "..Football_maximal_user_pro_gruppe.."")
- say("Laufzeit des Spiels: "..math.ceil(Football_starttime / 60) .." Minuten")
- say("")
- say("Was möchtest du einstellen?")
- local s = select("Prüfung der Mitgliederanzahl","Maximale Gruppenanzahl ändern","Laufzeit des Spiels ändern","Schließen")
- if s == 1 then
- say_title("Fussballverwaltung - Settings")
- say("")
- say("Prüfung der Mitgliederanzahl?")
- local a = select("Deaktivieren","Aktivieren","Schließen")
- if a == 1 then
- Football_check_count = false
- say_title("Fussballverwaltung - Settings")
- say("")
- say("Prüfung der Mitgliederanzahl")
- say("Wurde Deaktiviert.")
- elseif a == 2 then
- Football_check_count = true
- say_title("Fussballverwaltung - Settings")
- say("")
- say("Prüfung der Mitgliederanzahl")
- say("Wurde Aktiviert.")
- else
- return
- end
- elseif s == 2 then
- say_title("Fussballverwaltung - Settings")
- say("")
- say("Wie viele dürfen maximal in 1x Gruppe sein?")
- local v = n_input()
- if v == 0 or v > 20 then
- say("Unbekannter Wert bzw. nicht grösser als 20")
- return
- end
- Football_maximal_user_pro_gruppe = v
- say_title("Fussballverwaltung - Settings")
- say("")
- say("Maximale Gruppenanzahl ändern")
- say("Wurde gesetzt auf "..v..".")
- elseif s == 3 then
- say_title("Fussballverwaltung - Settings")
- say("")
- say("Wie viel Minuten soll es gesetzt werden?")
- local n_v = n_input()
- if n_v == 0 or n_v > 60 then
- say("Unbekanntert Wert oder grösser als 60")
- return
- end
- Football_starttime = 60*n_v
- say_title("Fussballverwaltung - Settings")
- say("")
- say("Laufzeit des Spiels ändern")
- say("Wurde gesetzt auf "..Football_starttime / 60 .." Minuten.")
- else
- return
- end
- end
- when 20082.chat."GM: Fusball Belohnung festlegen #" with game.get_event_flag("Football_status") >= 1
- and bool_to_str(Footbal_have_table) == 'true'
- and LIB_GM_rights_access('game_can_event') == true
- --and Football_admin_vid == pc.get_vid()
- begin
- say_title("Fussballverwaltung - Belohnung")
- say("Welche Art der Belohnung?")
- local s = select("Boni","Item","Schließen")
- if s == 1 then
- say("Welchen Boni?")
- local res = { }
- for i = 1, table.getn(Football_boni_table), 1 do
- table.insert(res, i,Football_boni_table[i].name)
- if i == table.getn(Football_boni_table) then
- table.insert(res, i +1, "Schließen")
- end
- end
- local b = select_table(res)
- if res[b] == "Schließen" then return end
- say_npc()
- say("")
- say("Du hast den Boni attribut")
- say_reward(""..Football_boni_table[b].name.."")
- say("gewählt.")
- say("")
- Football_win_option = 1
- Football_win_boniselect = Football_boni_table[b].name
- Football_win_bonityp = Football_boni_table[b].typ
- Football_win_bonitvalue = Football_boni_table[b].value
- Football_win_boniduration = Football_boni_table[b].duration
- elseif s == 2 then
- say("Welches Item?")
- local res = { }
- for i = 1, table.getn(Football_item_table), 1 do
- table.insert(res, i,item_name(Football_item_table[i].vnum).." x"..Football_item_table[i].count)
- if i == table.getn(Football_item_table) then
- table.insert(res, i +1, "Schließen")
- end
- end
- local b = select_table(res)
- if res[b] == "Schließen" then return end
- Football_win_option = 2
- Football_win_item = Football_item_table[b].vnum
- Football_win_countitem = Football_item_table[b].count
- say("Belohnung wurde festgelegt!")
- say_item_vnum(Football_item_table[b].vnum)
- say("")
- say("Anzahl "..Football_item_table[b].count.."")
- say("")
- else
- return
- end
- end
- when 20082.chat."GM: Als Admin setzen" with Football_admin_id != pc.get_vid()
- and game.get_event_flag("Football_status") >= 2
- and bool_to_str(Footbal_have_table) == 'true'
- and LIB_GM_rights_access('game_can_event') == true
- begin
- Football_admin_id = pc.get_player_id()
- Football_admin_vid = pc.get_vid()
- loop_timer("end_Footballtime",10)
- say_npc()
- say("")
- say("Du wurdest nun zum Fussball Administrator ernnant.")
- notice_in_map(""..pc.get_name().." wurde zum Fussball Administrator ernnant.",pc.get_map_index())
- end
- when 20082.chat."GM: Fussball-Turnier Starten" with game.get_event_flag("Football_status") == 0 or bool_to_str(Footbal_have_table) == 'false'
- and pc.get_map_index() == 402
- and LIB_GM_rights_access('game_can_event') == true
- begin
- game.set_event_flag("Football_status",1)
- Football_manager.set_variables()
- say_title("Fussball Manager - Starten")
- say("")
- say("Das Spiel wurde erfolgreich gestartet!")
- notice_all("Das Fussball-Turnier wurde gestartet!")
- notice_all("Alle Spieler können nun daran teilnehmen.")
- notice_all("Das Letzte Team von jedem Reich wird großzügig belohnt werden")
- notice_all("Teilnehmen könnt ihr über das User-Panel oder beim "..mob_name(20082).."")
- end
- when 20082.chat."GM: Zeit verlängern" with game.get_event_flag("Football_status") >= 2
- and bool_to_str(Footbal_have_table) == 'true'
- and pc.get_map_index() == 402
- and LIB_GM_rights_access('game_can_event') == true
- and Football_admin_vid == pc.get_vid()
- begin
- say_title("Fussball Manager - Zeit verlängern")
- say("")
- say("Wie viel Minuten soll es verlängert werden?")
- local m_v = n_input()
- if m_v == 0 or m_v > 5 then
- say("Unbekanntert Wert oder grösser als 5")
- return
- end
- local old = Football_timer
- Football_timer = old + 60*m_v
- notice_in_map("Die Zeit wurde verlängert um weitere "..m_v.." Minuten!",pc.get_map_index())
- syschat("GM: <Football Manager> Die Zeit wurde um weitere "..m_v.." Minuten verlängert.")
- end
- when 20082.chat."GM: Fussball-Turnier Beenden" with game.get_event_flag("Football_status") >= 1 and pc.get_map_index() == 402 and LIB_GM_rights_access('game_can_event') == true begin
- cleartimer("end_Footballtime")
- game.set_event_flag("Football_status",0)
- local my_vid = pc.get_vid()
- if table.getn(Football_all_players) >= 1 then
- Football_manager.port_all_place(1,'Team A',2,1,5)
- Football_manager.port_all_place(1,'Team B',2,2,5)
- Football_manager.port_all_place(1,'Team C',2,2,5)
- Football_manager.port_all_place(1,'Team D',2,2,5)
- Football_manager.port_all_place(2,'Team A',2,1,5)
- Football_manager.port_all_place(2,'Team B',2,2,5)
- Football_manager.port_all_place(2,'Team C',2,2,5)
- Football_manager.port_all_place(2,'Team D',2,2,5)
- Football_manager.port_all_place(3,'Team A',2,1,5)
- Football_manager.port_all_place(3,'Team B',2,2,5)
- Football_manager.port_all_place(3,'Team C',2,2,5)
- Football_manager.port_all_place(3,'Team D',2,2,5)
- pc.select(my_vid)
- end
- Football_manager.set_variables()
- timer("frag_back",1)
- end
- when frag_back.timer begin
- say_title("Fussball Manager - Beenden")
- say("")
- say("Das Spiel wurde erfolgreich beendet!")
- say("")
- say("Sollen alle in die Stadt gebracht werden?")
- if select("Ja","Nein") == 1 then
- warp_all_to_village(pc.get_map_index(),5)
- end
- end
- when 20082.chat."GM: Fussball neu Spawnen" with game.get_event_flag("Football_status") >= 2
- and bool_to_str(Footbal_have_table) == 'true'
- and pc.get_map_index() == 402
- and LIB_GM_rights_access('game_can_event') == true
- and Football_admin_vid == pc.get_vid()
- begin
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- notice_in_map("Der Fussball wurde neu gespawnt. Alle zurück an ihre Plätze!",pc.get_map_index())
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,1,1,5)
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,1,2,5)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- syschat("GM: <Football Manager> Ein neuer Fussball wurde gespawnt.")
- end
- when 20082.chat."GM: Tor geschossen" with game.get_event_flag("Football_status") >= 2
- and bool_to_str(Footbal_have_table) == 'true'
- and pc.get_map_index() == 402
- and LIB_GM_rights_access('game_can_event') == true
- and Football_admin_vid == pc.get_vid()
- begin
- say_title("Fussball Manager - Tor geschossen")
- if Football_empire_gegner_01 == "keiner" or Football_empire_gegner_02 == "keiner" then
- say("Es ist kein Teams festgelegt.")
- return
- end
- if table.getn(Football_all_players) == 0 then
- say("Es sind kein Spieler vorhanden!")
- return
- end
- say("Aktuelle Reich: "..Footbal_empire_name.."")
- say("links: "..Football_empire_gegner_01.." rechts: "..Football_empire_gegner_02.."")
- say("Aktuelle Punktestand "..Football_Punktestand01..":"..Football_Punktestand02.."")
- say("Welches Team hat ein Tor geschossen?")
- local tor = select(Football_empire_gegner_01,Football_empire_gegner_02,"Schließen")
- if tor == 1 then
- if Football_empire_gegner_01 == "Team A" then Footbal_tor_A = Footbal_tor_A +1 Football_Punktestand01 = Footbal_tor_A
- elseif Football_empire_gegner_01 == "Team B" then Footbal_tor_B = Footbal_tor_B +1 Football_Punktestand01 = Footbal_tor_B
- elseif Football_empire_gegner_01 == "Team C" then Footbal_tor_C = Footbal_tor_C +1 Football_Punktestand01 = Footbal_tor_C
- elseif Football_empire_gegner_01 == "Team D" then Footbal_tor_D = Footbal_tor_D +1 Football_Punktestand01 = Footbal_tor_D
- else return
- end
- notice_in_map("Das "..Football_empire_gegner_01.." hat ein Tor geschossen. Punktestand: "..Football_Punktestand01..":"..Football_Punktestand02.."",pc.get_map_index())
- notice_in_map("Alle Mitspieler werden an ihre Plätze gebracht! In 5 Sekunden geht es weiter!")
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,1,1,5)
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,1,2,5)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- syschat("GM: <Football Manager> Das Tor wurde vergeben.")
- elseif tor == 2 then
- if Football_empire_gegner_02 == "Team A" then Footbal_tor_A = Footbal_tor_A +1 Football_Punktestand02 = Footbal_tor_A
- elseif Football_empire_gegner_02 == "Team B" then Footbal_tor_B = Footbal_tor_B +1 Football_Punktestand02 = Footbal_tor_B
- elseif Football_empire_gegner_02 == "Team C" then Footbal_tor_C = Footbal_tor_C +1 Football_Punktestand02 = Footbal_tor_C
- elseif Football_empire_gegner_02 == "Team D" then Footbal_tor_D = Footbal_tor_D +1 Football_Punktestand02 = Footbal_tor_D
- else return
- end
- notice_in_map("Das "..Football_empire_gegner_02.." hat ein Tor geschossen. Punktestand: "..Football_Punktestand01..":"..Football_Punktestand02.."",pc.get_map_index())
- notice_in_map("Alle Mitspieler werden an ihre Plätze gebracht! In 5 Sekunden geht es weiter!")
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,1,1,5)
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,1,2,5)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- syschat("GM: <Football Manager> Das Tor wurde vergeben.")
- else
- return
- end
- end
- when 20082.chat."GM: Spiel Anpfeifen (starten)" with game.get_event_flag("Football_status") == 1
- and bool_to_str(Footbal_have_table) == 'true'
- and pc.get_map_index() == 402
- and LIB_GM_rights_access('game_can_event') == true begin
- say_npc()
- if table.getn(Football_all_players) == 0 then say("Es sind kein Spieler vorhanden!") return end
- if Football_win_option == 0 then say("Es ist kein Gewinn festgelegt lege erst einen fest") return end
- say("Wähle das Reich aus was beginnen soll")
- local r = select("Shinsoo","Chunjo","Jinno","Schließen")
- if r == 1 then
- if table.getn(Football_team_wahl) == 0 then
- say("Es sind keine Teams mehr vorhanden!")
- return
- end
- local rot_a = table.getn(Footbal_1_team_A)
- local rot_b = 1--table.getn(Footbal_1_team_B)
- local rot_c = 1--table.getn(Footbal_1_team_C)
- local rot_d = 1--table.getn(Footbal_1_team_D)
- if rot_a < Football_minimal_user_pro_gruppe
- or rot_b < Football_minimal_user_pro_gruppe
- or rot_c < Football_minimal_user_pro_gruppe
- or rot_d < Football_minimal_user_pro_gruppe
- then
- say("Es fehlen Mitspieler:")
- say("Es werden mindestens "..Football_minimal_user_pro_gruppe.." Spieler pro Gruppe")
- say("benötigt sowie gleiche Anzahl um es zu beginnen")
- say("")
- say("Team A Anzahl: "..rot_a.."")
- say("Team B Anzahl: "..rot_b.."")
- say("Team C Anzahl: "..rot_c.."")
- say("Team D Anzahl: "..rot_d.."")
- else
- Football_admin_id = pc.get_player_id()
- Football_admin_vid = pc.get_vid()
- Footbal_empire_name = "Shinsoo"
- Footbal_empire = 1
- --[[
- local sel = select_table(Football_team_wahl)
- Football_empire_gegner_01 = Football_team_wahl[sel]
- table.remove(Football_team_wahl,sel)
- say("Gegen welches Team soll "..Football_empire_gegner_01.." Spielen?")
- local sel2 = select_table(Football_team_wahl)
- Football_empire_gegner_02 = Football_team_wahl[sel2]
- table.remove(Football_team_wahl,sel2)
- ]]
- Football_empire_gegner_01 = Football_team_wahl[1]
- table.remove(Football_team_wahl,1)
- local r = number(1,3)
- Football_empire_gegner_02 = Football_team_wahl[r]
- table.remove(Football_team_wahl,r)
- notice_in_map("Das "..Footbal_empire_name.." Team: "..Football_empire_gegner_01.." tritt gegen das Team: "..Football_empire_gegner_02.." an.",pc.get_map_index())
- notice_in_map("Alle Mitspieler werden an ihre Plätze gebracht! In 10 Sekunden gehts los!")
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(1,Football_empire_gegner_01,1,1,11)
- Football_manager.port_all_place(1,Football_empire_gegner_02,1,2,11)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- Footbal_tor_A = 0
- Footbal_tor_B = 0
- Footbal_tor_C = 0
- Footbal_tor_D = 0
- Football_Punktestand01 = 0
- Football_Punktestand02 = 0
- game.set_event_flag("Football_status",2)
- loop_timer("end_Footballtime",10)
- Football_timer = Football_starttime
- syschat("GM: <Football Manager> Das Spiel hat begonnen.")
- setskin(NOWINDOW)
- end
- elseif r == 2 then
- if table.getn(Football_team_wahl) == 0 then
- say("Es sind keine Teams mehr vorhanden!")
- return
- end
- local gelb_a = table.getn(Footbal_2_team_A)
- local gelb_b = 1--table.getn(Footbal_2_team_B)
- local gelb_c = 1--table.getn(Footbal_2_team_C)
- local gelb_d = 1--table.getn(Footbal_2_team_D)
- if gelb_a < Football_minimal_user_pro_gruppe
- or gelb_b < Football_minimal_user_pro_gruppe
- or gelb_c < Football_minimal_user_pro_gruppe
- or gelb_d < Football_minimal_user_pro_gruppe
- then
- say("Es fehlen Mitspieler:")
- say("Es werden mindestens "..Football_minimal_user_pro_gruppe.." Spieler pro Gruppe")
- say("benötigt sowie gleiche Anzahl um es zu beginnen")
- say("")
- say("Team A Anzahl: "..gelb_a.."")
- say("Team B Anzahl: "..gelb_b.."")
- say("Team C Anzahl: "..gelb_c.."")
- say("Team D Anzahl: "..gelb_d.."")
- else
- Football_admin_id = pc.get_player_id()
- Football_admin_vid = pc.get_vid()
- Footbal_empire_name = "Chunjo"
- Footbal_empire = 2
- Football_empire_gegner_01 = Football_team_wahl[1]
- table.remove(Football_team_wahl,1)
- local r = number(1,3)
- Football_empire_gegner_02 = Football_team_wahl[r]
- table.remove(Football_team_wahl,r)
- notice_in_map("Das "..Footbal_empire_name.." Team: "..Football_empire_gegner_01.." tritt gegen das Team: "..Football_empire_gegner_02.." an.",pc.get_map_index())
- notice_in_map("Alle Mitspieler werden an ihre Plätze gebracht! In 10 Sekunden gehts los!")
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(2,Football_empire_gegner_01,1,1,11)
- Football_manager.port_all_place(2,Football_empire_gegner_02,1,2,11)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- Footbal_tor_A = 0
- Footbal_tor_B = 0
- Footbal_tor_C = 0
- Footbal_tor_D = 0
- Football_Punktestand01 = 0
- Football_Punktestand02 = 0
- game.set_event_flag("Football_status",2)
- Football_timer = Football_starttime
- syschat("GM: <Football Manager> Das Spiel hat begonnen.")
- loop_timer("end_Footballtime",10)
- end
- elseif r == 3 then
- if table.getn(Football_team_wahl) == 0 then
- say("Es sind keine Teams mehr vorhanden!")
- return
- end
- local blau_a = table.getn(Footbal_3_team_A) +1
- local blau_b = 1--table.getn(Footbal_3_team_B)
- local blau_c = 1--table.getn(Footbal_3_team_C)
- local blau_d = 1--table.getn(Footbal_3_team_D)
- if blau_a < Football_minimal_user_pro_gruppe
- or blau_b < Football_minimal_user_pro_gruppe
- or blau_c < Football_minimal_user_pro_gruppe
- or blau_d < Football_minimal_user_pro_gruppe
- then
- say("Es fehlen Mitspieler:")
- say("Es werden mindestens "..Football_minimal_user_pro_gruppe.." Spieler pro Gruppe")
- say("benötigt sowie gleiche Anzahl um es zu beginnen")
- say("")
- say("Team A Anzahl: "..blau_a.."")
- say("Team B Anzahl: "..blau_b.."")
- say("Team C Anzahl: "..blau_c.."")
- say("Team D Anzahl: "..blau_d.."")
- else
- Football_admin_id = pc.get_player_id()
- Football_admin_vid = pc.get_vid()
- Footbal_empire_name = "Jinno"
- Footbal_empire = 3
- Football_empire_gegner_01 = Football_team_wahl[1]
- table.remove(Football_team_wahl,1)
- local r = number(1,3)
- Football_empire_gegner_02 = Football_team_wahl[r]
- table.remove(Football_team_wahl,r)
- notice_in_map("Das "..Footbal_empire_name.." Team: "..Football_empire_gegner_01.." tritt gegen das Team: "..Football_empire_gegner_02.." an.",pc.get_map_index())
- notice_in_map("Alle Mitspieler werden an ihre Plätze gebracht! In 10 Sekunden gehts los!")
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(3,Football_empire_gegner_01,1,1,11)
- Football_manager.port_all_place(3,Football_empire_gegner_02,1,2,11)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- Footbal_tor_A = 0
- Footbal_tor_B = 0
- Footbal_tor_C = 0
- Footbal_tor_D = 0
- Football_Punktestand01 = 0
- Football_Punktestand02 = 0
- game.set_event_flag("Football_status",2)
- loop_timer("end_Footballtime",10)
- Football_timer = Football_starttime
- syschat("GM: <Football Manager> Das Spiel hat begonnen.")
- end
- else
- return
- end
- end
- when end_Footballtime.timer with game.get_event_flag("Football_status") >= 2 begin
- notice_all("SELECT VID "..pc.get_vid().." "..Football_admin_vid.." "..pc.get_name().."")
- if pc.get_vid() != Football_admin_vid then
- notice_all("#debug# Adminvid is nicht die selbe "..pc.get_vid().." "..Football_admin_vid.." "..pc.get_name().."")
- cleartimer("end_Footballtime")
- return
- end
- Football_manager.check_count_member_correct(Footbal_empire,Football_empire_gegner_01,Football_empire_gegner_02)
- --notice_in_map("DEBUG CHECKCOunTER: "..Football_empire_gegner_01.." ("..Football_group_check1..") "..Football_empire_gegner_02.." ("..Football_group_check2..")")
- if bool_to_str(Footbal_have_table) == 'true' then
- if Football_check_count == 1 then
- if Football_manager.check_count_member_correct(Footbal_empire,Football_empire_gegner_01,Football_empire_gegner_02) == true and game.get_event_flag("Football_status") == 7 then
- notice_in_map("Das Spiel geht weiter! Es sind wieder passend Spieler vorhanden! "..Football_empire_gegner_01.." ("..Football_group_check1..") "..Football_empire_gegner_02.." ("..Football_group_check2..")")
- notice_in_map("Alle Mitspieler werden an ihre Plätze gebracht! In 5 Sekunden geht es weiter.")
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(1,Football_empire_gegner_01,1,1,6)
- Football_manager.port_all_place(1,Football_empire_gegner_02,1,2,6)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- game.set_event_flag("Football_status",old_flag)
- elseif Football_manager.check_count_member_correct(Footbal_empire,Football_empire_gegner_01,Football_empire_gegner_02) == false and game.get_event_flag("Football_status") >= 2 then
- if game.get_event_flag("Football_status") != 7 then
- old_flag = game.get_event_flag("Football_status")
- end
- notice_in_map("Es fehlener Spieler. Zeit wird solange gestoppt bis sich einer findet. "..Football_empire_gegner_01.." ("..Football_group_check1..") "..Football_empire_gegner_02.." ("..Football_group_check2..")")
- game.set_event_flag("Football_status",7)
- return
- end
- end
- local old = Football_timer
- Football_timer = old - 10
- notice_all("#debug# have timer "..Football_timer.."")
- if Football_timer == 60 then
- notice_in_map("Restliche Laufzeit beträgt: 1 Minute",pc.get_map_index())
- return
- elseif Football_timer == 30 then
- notice_in_map("Restliche Laufzeit beträgt: 30 Sekunden",pc.get_map_index())
- return
- elseif Football_timer == 10 then
- notice_in_map("Restliche Laufzeit beträgt: 10 Sekunden",pc.get_map_index())
- if table.getn(Football_team_wahl) == 2 then
- notice_in_map("Danach ist das nächste Team an der reihe!",pc.get_map_index())
- end
- return
- else
- if Football_timer == 420 or Football_timer == 300 or Football_timer == 180 then
- notice_in_map("Restliche Laufzeit beträgt: "..Football_timer / 60 .." Minuten#")
- return
- end
- if Football_timer > 10 then
- return
- end
- end
- notice_all("#debug Mitglieder Gruppe: "..table.getn(Football_team_wahl).." flag: "..game.get_event_flag("Football_status").." Punkte: "..Football_Punktestand01..":"..Football_Punktestand02.."")
- if game.get_event_flag("Football_status") == 3 then
- Football_winner_01 = Football_empire_gegner_01
- Football_winner_02 = Football_empire_gegner_02
- if table.getn(Football_team_wahl) == 2 then
- Football_empire_gegner_01 = Football_team_wahl[1]
- table.remove(Football_team_wahl,1)
- Football_empire_gegner_02 = Football_team_wahl[1]
- table.remove(Football_team_wahl,1)
- notice_in_map(""..Footbal_empire_name.." Team: "..Football_empire_gegner_01.." tritt nun gegen das Team: "..Football_empire_gegner_02.." an.",pc.get_map_index())
- notice_in_map("Alle Mitspieler werden an ihre Plätze gebracht! In 15 Sekunden geht es los.")
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,1,1,16)
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,1,2,16)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- Football_timer = Football_starttime
- game.set_event_flag("Football_status",4)
- return
- end
- end
- if Football_Punktestand01 > Football_Punktestand02 and (game.get_event_flag("Football_status") == 2 or game.get_event_flag("Football_status") == 3 or game.get_event_flag("Football_status") == 4) then
- notice_in_map(""..Footbal_empire_name..": Das "..Football_empire_gegner_01.." Hat gegen "..Football_empire_gegner_02.." Gewonnen!",pc.get_map_index())
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,2,1,6) --Raus
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,2,2,6) --Raus
- Footbal_tor_A = 0
- Footbal_tor_B = 0
- Footbal_tor_C = 0
- Footbal_tor_D = 0
- Football_Punktestand01 = 0
- Football_Punktestand02 = 0
- --timer("end_Footballtime",3)
- if game.get_event_flag("Football_status") == 2 then
- game.set_event_flag("Football_status",3)
- Football_winner_01 = Football_empire_gegner_01
- elseif game.get_event_flag("Football_status") == 4 then
- game.set_event_flag("Football_status",5)
- Football_winner_02 = Football_empire_gegner_01
- end
- return
- elseif Football_Punktestand01 < Football_Punktestand02 and (game.get_event_flag("Football_status") == 2 or game.get_event_flag("Football_status") == 3 or game.get_event_flag("Football_status") == 4) then
- notice_in_map(""..Footbal_empire_name..": Das "..Football_empire_gegner_02.." Hat gegen "..Football_empire_gegner_01.." Gewonnen!",pc.get_map_index())
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,2,1,6) --Raus
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,2,2,6) --Raus
- Footbal_tor_A = 0
- Footbal_tor_B = 0
- Footbal_tor_C = 0
- Footbal_tor_D = 0
- Football_Punktestand01 = 0
- Football_Punktestand02 = 0
- --timer("end_Footballtime",3)
- if game.get_event_flag("Football_status") == 2 then
- game.set_event_flag("Football_status",3)
- Football_winner_01 = Football_empire_gegner_02
- elseif game.get_event_flag("Football_status") == 4 then
- game.set_event_flag("Football_status",5)
- Football_winner_02 = Football_empire_gegner_02
- end
- elseif Football_Punktestand01 == Football_Punktestand02 and (game.get_event_flag("Football_status") == 2 or game.get_event_flag("Football_status") == 3 or game.get_event_flag("Football_status") == 4) then
- notice_in_map(""..Footbal_empire_name..": Das "..Football_empire_gegner_01.." und "..Football_empire_gegner_02.." Haben beide die selben Punkte. Zeit wird auf weitere 3 Minuten verlängert.",pc.get_map_index())
- notice_in_map("Alle Mitspieler werden an ihre Plätze gebracht! In 5 Sekunden geht es weiter.")
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,1,1,6)
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,1,2,6)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- local old = Football_timer
- Football_timer = old + 180
- end
- if game.get_event_flag("Football_status") == 5 then
- Football_empire_gegner_01 = Football_winner_01
- Football_empire_gegner_02 = Football_winner_02
- if table.getn(Football_team_wahl) == 2 then
- Football_empire_gegner_01 = Football_team_wahl[1]
- table.remove(Football_team_wahl,1)
- Football_empire_gegner_02 = Football_team_wahl[1]
- table.remove(Football_team_wahl,1)
- end
- game.set_event_flag("Football_status",6)
- notice_in_map("Das Final beginnt!",pc.get_map_index())
- notice_in_map(""..Footbal_empire_name..": Nun Kämpft "..Football_empire_gegner_01.." gegen "..Football_empire_gegner_02.." um den Sieg!",pc.get_map_index())
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,1,1,6)
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,1,2,6)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- Football_timer = Football_starttime
- Footbal_tor_A = 0
- Footbal_tor_B = 0
- Footbal_tor_C = 0
- Footbal_tor_D = 0
- Football_Punktestand01 = 0
- Football_Punktestand02 = 0
- return
- elseif game.get_event_flag("Football_status") == 6 then
- if Football_Punktestand01 > Football_Punktestand02 then
- notice_in_map(""..Footbal_empire_name..": Das "..Football_empire_gegner_01.." Hat gegen "..Football_empire_gegner_02.." Gewonnen.",pc.get_map_index())
- notice_in_map("Sie sind die Hauptgewinner",pc.get_map_index())
- if Footbal_empire < 3 then
- notice_in_map("Ein GameMaster leitet gleich das nächste Spiel ein.")
- end
- Football_team_wahl = {"Team A","Team B","Team C","Team D"}
- cleartimer("end_Footballtime")
- --local my_vid = pc.get_vid()
- Football_manager.give_belohnung(Footbal_empire,Football_empire_gegner_01)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,2,1,6) --Raus
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,2,2,6) --Raus
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- game.set_event_flag("Football_status",1)
- elseif Football_Punktestand01 < Football_Punktestand02 then
- notice_in_map(""..Footbal_empire_name..": Das "..Football_empire_gegner_02.." Hat gegen "..Football_empire_gegner_01.." Gewonnen.",pc.get_map_index())
- notice_in_map("Sie sind die Hauptgewinner",pc.get_map_index())
- notice_in_map("Alle Mitspieler dieser Gruppe erhalten ein Geschenk!",pc.get_map_index())
- if Footbal_empire < 3 then
- notice_in_map("Ein GameMaster leitet das nächste Spiel jeden moment ein")
- end
- Football_team_wahl = {"Team A","Team B","Team C","Team D"}
- cleartimer("end_Footballtime")
- --local my_vid = pc.get_vid()
- Football_manager.give_belohnung(Footbal_empire,Football_empire_gegner_02)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,2,1,6) --Raus
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,2,2,6) --Raus
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- game.set_event_flag("Football_status",1)
- elseif Football_Punktestand01 == Football_Punktestand02 then
- notice_in_map(""..Footbal_empire_name..": Das "..Football_empire_gegner_02.." und "..Football_empire_gegner_01.." Haben beide die selben Punkte. Zeit wird auf weitere 3 Minuten verlängert.",pc.get_map_index())
- notice_in_map("Alle Mitspieler werden an ihre Plätze gebracht! In 5 Sekunden geht es weiter.")
- kill_all_in_map(402)
- mob.spawn(20500,128,140,1)
- --local my_vid = pc.get_vid()
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_01,1,1,6)
- Football_manager.port_all_place(Footbal_empire,Football_empire_gegner_02,1,2,6)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- pc.select(Football_admin_vid)
- local old = Football_timer
- Football_timer = old + 180
- end
- end
- else
- notice_in_map("Timer wird gelöscht. ERRORCODE#501#")
- cleartimer("end_Footballtime")
- end
- end
- function remove_player_warp(name)
- local my_vid = pc.get_vid()
- local u_vid = find_pc_by_name(name)
- if u_vid >= 1 then
- pc.select(u_vid)
- pc.warp(84900,97000)
- end
- pc.select(my_vid)
- pc.select(my_vid)
- end
- when 20082.chat."GM: Spieler entfernen" with game.get_event_flag("Football_status") >= 1
- and bool_to_str(Footbal_have_table) == 'true'
- and pc.get_map_index() == 402
- and LIB_GM_rights_access('game_can_event') == true
- --and Football_admin_vid == pc.get_vid()
- begin
- if table.getn(Football_all_players) == 0 then say("Es sind kein Spieler vorhanden!") return end
- local entff = { }
- say("Wenn möchtest entfernen")
- for i = 1, table.getn(Football_all_players), 1 do
- table.insert(entff , i ,Football_all_players[i])
- if table.getn(Football_all_players) == i then
- table.insert(entff , i +1,"Schließen")
- end
- end
- local s = select_table(entff)
- if entff[s] == "Schließen" then return end
- say_title("Fussballverwaltung - entfernen")
- say("")
- if Football_manager.get_tables_remove_var(Footbal_1_team_A,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Rotes Reich Team A")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_1_team_B,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Rotes Reich Team B")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_1_team_C,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Rotes Reich Team C")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_1_team_D,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Rotes Reich Team D")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_A,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Gelbes Reich Team A")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_B,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Gelbes Reich Team B")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_C,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Gelbes Reich Team C")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_D,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Gelbes Reich Team D")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_A,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Blaues Reich Team A")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_B,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Blaues Reich Team B")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_C,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Blaues Reich Team C")
- say("ausgetragen!")
- return
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_D,entff[s]) == true then
- Football_manager.get_tables_remove_var_all(entff[s])
- Football_manager.remove_player_warp(entff[s])
- say(""..entff[s].." wurde erfolgreich aus der Gruppe:")
- say_reward("Blaues Reich Team D")
- say("ausgetragen!")
- return
- else
- say(""..entff[s].." in keinerlei Team Gruppe! ERRORCODE#502#")
- return
- end
- end
- when 20082.chat."Ich möchte Aussteigen" with game.get_event_flag("Football_status") == 1
- and Football_manager.check_exits(pc.get_name()) == true
- and bool_to_str(Footbal_have_table) == 'true'
- and pc.get_map_index() == 402
- begin
- local empire = pc.get_empire()
- say_title("Fussballverwaltung - Austreten")
- say("")
- if empire == 1 then
- if Football_manager.get_tables_remove_var(Footbal_1_team_A,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Rotes Reich Team A")
- say("ausgetragen!")
- elseif Football_manager.get_tables_remove_var(Footbal_1_team_B,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Rotes Reich Team B")
- say("ausgetragen!")
- elseif Football_manager.get_tables_remove_var(Footbal_1_team_C,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Rotes Reich Team C")
- say("ausgetragen!")
- elseif Football_manager.get_tables_remove_var(Footbal_1_team_D,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Rotes Reich Team D")
- say("ausgetragen!")
- end
- elseif empire == 2 then
- if Football_manager.get_tables_remove_var(Footbal_2_team_A,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Gelbes Reich Team A")
- say("ausgetragen!")
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_B,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Gelbes Reich Team B")
- say("ausgetragen!")
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_C,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Gelbes Reich Team C")
- say("ausgetragen!")
- elseif Football_manager.get_tables_remove_var(Footbal_2_team_D,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Gelbes Reich Team D")
- say("ausgetragen!")
- end
- elseif empire == 3 then
- if Football_manager.get_tables_remove_var(Footbal_3_team_A,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Blaues Reich Team A")
- say("ausgetragen!")
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_B,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Blaues Reich Team B")
- say("ausgetragen!")
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_C,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Blaues Reich Team C")
- say("ausgetragen!")
- elseif Football_manager.get_tables_remove_var(Footbal_3_team_D,pc.get_name()) == true then
- Football_manager.get_tables_remove_var_all(pc.get_name())
- say("Du wurdest erfolgreich aus der Gruppe:")
- say_reward("Blaues Reich Team D")
- say("ausgetragen!")
- end
- else
- say("Unbekannter Fehler! ERRORCODE#505#")
- return
- end
- end
- when 20082.chat."Ich möchte Mitspielen" with (game.get_event_flag("Football_status") == 1 or game.get_event_flag("Football_status") == 7)
- and Football_manager.check_exits(pc.get_name()) == false
- and bool_to_str(Footbal_have_table) == 'true'
- and pc.get_map_index() == 402
- and Football_admin_id != pc.get_player_id()
- begin
- if bool_to_str(Footbal_have_table) == 'false' then
- say("Bitte Starte erst das Spiel es sind")
- say("keine Tabellen Vorhanden")
- return
- end
- if Football_manager.check_exits(pc.get_name()) == true then
- say("Du bist bereits eingetragen")
- return
- end
- local empire = pc.get_empire()
- if game.get_event_flag("Football_status") == 7 then --Fehlender Ersatz
- local f = select("Fehlenden Gruppe eintragen","Schließen")
- if f == 1 then
- if Footbal_empire == 1 and empire == 1 then
- if Football_empire_gegner_01 == "Team A" and table.getn(Footbal_1_team_A) == 0 then
- table.insert(Footbal_1_team_A , table.getn(Footbal_1_team_A) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team A")
- say("eingetragen!")
- elseif Football_empire_gegner_01 == "Team B" and table.getn(Footbal_1_team_B) == 0 then
- table.insert(Footbal_1_team_B , table.getn(Footbal_1_team_B) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team B")
- say("eingetragen!")
- elseif Football_empire_gegner_01 == "Team C" and table.getn(Footbal_1_team_C) == 0 then
- table.insert(Footbal_1_team_C , table.getn(Footbal_1_team_C) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team C")
- say("eingetragen!")
- elseif Football_empire_gegner_01 == "Team D" and table.getn(Footbal_1_team_D) == 0 then
- table.insert(Footbal_1_team_D , table.getn(Footbal_1_team_D) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team D")
- say("eingetragen!")
- end
- if Football_empire_gegner_02 == "Team A" and table.getn(Footbal_1_team_A) == 0 then
- table.insert(Footbal_1_team_A , table.getn(Footbal_1_team_A) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team A")
- say("eingetragen!")
- elseif Football_empire_gegner_02 == "Team B" and table.getn(Footbal_1_team_B) == 0 then
- table.insert(Footbal_1_team_B , table.getn(Footbal_1_team_B) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team B")
- say("eingetragen!")
- elseif Football_empire_gegner_02 == "Team C" and table.getn(Footbal_1_team_C) == 0 then
- table.insert(Footbal_1_team_C , table.getn(Footbal_1_team_C) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team C")
- say("eingetragen!")
- elseif Football_empire_gegner_02 == "Team D" and table.getn(Footbal_1_team_D) == 0 then
- table.insert(Footbal_1_team_D , table.getn(Footbal_1_team_D) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team D")
- say("eingetragen!")
- end
- -----------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------
- elseif Footbal_empire == 2 and empire == 2 then
- if Football_empire_gegner_01 == "Team A" and table.getn(Footbal_2_team_A) == 0 then
- elseif Football_empire_gegner_01 == "Team B" and table.getn(Footbal_2_team_B) == 0 then
- elseif Football_empire_gegner_01 == "Team C" and table.getn(Footbal_2_team_C) == 0 then
- elseif Football_empire_gegner_01 == "Team D" and table.getn(Footbal_2_team_D) == 0 then
- end
- if Football_empire_gegner_02 == "Team A" and table.getn(Footbal_2_team_A) == 0 then
- elseif Football_empire_gegner_02 == "Team B" and table.getn(Footbal_2_team_B) == 0 then
- elseif Football_empire_gegner_02 == "Team C" and table.getn(Footbal_2_team_C) == 0 then
- elseif Football_empire_gegner_02 == "Team D" and table.getn(Footbal_2_team_D) == 0 then
- end
- -----------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------
- -----------------------------------------------------------------------------------
- elseif Footbal_empire == 3 and empire == 3 then
- if Football_empire_gegner_01 == "Team A" and table.getn(Footbal_3_team_A) == 0 then
- elseif Football_empire_gegner_01 == "Team B" and table.getn(Footbal_3_team_B) == 0 then
- elseif Football_empire_gegner_01 == "Team C" and table.getn(Footbal_3_team_C) == 0 then
- elseif Football_empire_gegner_01 == "Team D" and table.getn(Footbal_3_team_D) == 0 then
- end
- if Football_empire_gegner_02 == "Team A" and table.getn(Footbal_3_team_A) == 0 then
- elseif Football_empire_gegner_02 == "Team A" and table.getn(Footbal_3_team_B) == 0 then
- elseif Football_empire_gegner_02 == "Team A" and table.getn(Footbal_3_team_C) == 0 then
- elseif Football_empire_gegner_02 == "Team A" and table.getn(Footbal_3_team_D) == 0 then
- end
- end
- return
- else
- return
- end
- return
- end
- if empire == 1 then --Rotes Reich
- say_title("Fussballverwaltung - Beitreten")
- say("")
- say("Pro Gruppe sind nur "..Football_maximal_user_pro_gruppe.." Spieler erlaubt!")
- say("")
- say_reward("Welchen Team möchtest du beitreten?")
- local t = select(
- "Team A ("..table.getn(Footbal_1_team_A)..") ",
- "Team B ("..table.getn(Footbal_1_team_B)..") ",
- "Team C ("..table.getn(Footbal_1_team_C)..") ",
- "Team D ("..table.getn(Footbal_1_team_D)..") ",
- "Schließen")
- if t == 1 then --a
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_1_team_A) >= Football_maximal_user_pro_gruppe then say("Die Gruppe ist voll, wähle eine andere!") return end
- table.insert(Footbal_1_team_A , table.getn(Footbal_1_team_A) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team A")
- say("eingetragen!")
- elseif t == 2 then --b
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_1_team_B) >= Football_maximal_user_pro_gruppe then say("Die Gruppe ist voll, wähle eine andere!") return end
- table.insert(Footbal_1_team_B , table.getn(Footbal_1_team_B) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team B")
- say("eingetragen!")
- elseif t == 3 then --c
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_1_team_C) >= Football_maximal_user_pro_gruppe then say("Die Gruppe ist voll, wähle eine andere!") return end
- table.insert(Footbal_1_team_C , table.getn(Footbal_1_team_C) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team C")
- say("eingetragen!")
- elseif t == 4 then --d
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_1_team_D) >= Football_maximal_user_pro_gruppe then say("Die Gruppe ist voll, wähle eine andere!") return end
- table.insert(Footbal_1_team_D , table.getn(Footbal_1_team_D) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Rotes Reich Team D")
- say("eingetragen!")
- else
- return
- end
- elseif empire == 2 then --Gelbes Reich
- say_title("Fussballverwaltung - Beitreten")
- say("")
- say("Pro Gruppe sind nur "..Football_maximal_user_pro_gruppe.." Spieler erlaubt!")
- say("")
- say_reward("Welchen Team möchtest du beitreten?")
- local t = select(
- "Team A ("..table.getn(Footbal_2_team_A)..") ",
- "Team B ("..table.getn(Footbal_2_team_B)..") ",
- "Team C ("..table.getn(Footbal_2_team_C)..") ",
- "Team D ("..table.getn(Footbal_2_team_D)..") ",
- "Schließen")
- if t == 1 then
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_2_team_A) >= Football_maximal_user_pro_gruppe then
- say("Die Gruppe ist voll, wähle eine andere!")
- return
- end
- table.insert(Footbal_2_team_A , table.getn(Footbal_2_team_A) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Gelbes Reich Team A")
- say("eingetragen!")
- elseif t == 2 then
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_2_team_B) >= Football_maximal_user_pro_gruppe then
- say("Die Gruppe ist voll, wähle eine andere!")
- return
- end
- table.insert(Footbal_2_team_B , table.getn(Footbal_2_team_B) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Gelbes Reich Team B")
- say("eingetragen!")
- elseif t == 3 then
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_2_team_C) >= Football_maximal_user_pro_gruppe then
- say("Die Gruppe ist voll, wähle eine andere!")
- return
- end
- table.insert(Footbal_2_team_C , table.getn(Footbal_2_team_C) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Gelbes Reich Team C")
- say("eingetragen!")
- elseif t == 4 then
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_2_team_D) >= Football_maximal_user_pro_gruppe then
- say("Die Gruppe ist voll, wähle eine andere!")
- return
- end
- table.insert(Footbal_2_team_D , table.getn(Footbal_2_team_D) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Gelbes Reich Team D")
- say("eingetragen!")
- else
- return
- end
- elseif empire == 3 then --Blaues Reich
- say_title("Fussballverwaltung - Beitreten")
- say("")
- say("Pro Gruppe sind nur "..Football_maximal_user_pro_gruppe.." Spieler erlaubt!")
- say("")
- say_reward("Welchen Team möchtest du beitreten?")
- local t = select(
- "Team A ("..table.getn(Footbal_3_team_A)..") ",
- "Team B ("..table.getn(Footbal_3_team_B)..") ",
- "Team C ("..table.getn(Footbal_3_team_C)..") ",
- "Team D ("..table.getn(Footbal_3_team_D)..") ",
- "Schließen")
- if t == 1 then
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_3_team_A) >= Football_maximal_user_pro_gruppe then
- say("Die Gruppe ist voll, wähle eine andere!")
- return
- end
- table.insert(Footbal_3_team_A , table.getn(Footbal_3_team_A) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Blaues Reich Team A")
- say("eingetragen!")
- elseif t == 2 then
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_3_team_B) >= Football_maximal_user_pro_gruppe then
- say("Die Gruppe ist voll, wähle eine andere!")
- return
- end
- table.insert(Footbal_3_team_B , table.getn(Footbal_3_team_B) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Blaues Reich Team B")
- say("eingetragen!")
- elseif t == 3 then
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_3_team_C) >= Football_maximal_user_pro_gruppe then
- say("Die Gruppe ist voll, wähle eine andere!")
- return
- end
- table.insert(Footbal_3_team_C , table.getn(Footbal_3_team_C) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Blaues Reich Team C")
- say("eingetragen!")
- elseif t == 4 then
- say_title("Fussballverwaltung - Beitreten")
- say("")
- if table.getn(Footbal_3_team_D) >= Football_maximal_user_pro_gruppe then
- say("Die Gruppe ist voll, wähle eine andere!")
- return
- end
- table.insert(Footbal_3_team_D , table.getn(Footbal_3_team_D) +1,pc.get_name())
- table.insert(Football_all_players , table.getn(Football_all_players) +1,pc.get_name())
- say("Du wurdest Erfolgreich in die Gruppe")
- say_reward("Blaues Reich Team D")
- say("eingetragen!")
- else
- return
- end
- else --empire if ende
- say("Unbekannter Fehler! ERRORCODE#500#")
- end
- end
- end
- end