Advertisement
Math_TM

Survivor Entrainement V2.8e

Mar 6th, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.54 KB | None | 0 0
  1. function main()
  2.     --vars:
  3.         interval = 10
  4.         sniper = 10
  5.         currentGame = "lobby"
  6.         temps = 0
  7.         difficulty = 8
  8.         lobby_map = "@7061197"
  9.         currentMap = lobby_map
  10.         start = false
  11.         version = "v2.8e"
  12.     --ids:
  13.         idTitre = 1
  14.         idTitre2 = 2
  15.         idVersion = 3
  16.         idCredits = 4
  17.         idStart = 5
  18.         idEz = 6
  19.         idMed = 7
  20.         idHard = 8
  21.         idAnouce = 9
  22.         idGames = 10
  23.         idRanking = 11
  24.         idAfk = 12
  25.     --tables:
  26.         admins = {["Athesdrake#0000"]=1, ["Nagi#9244"]=1}
  27.         maps = {"@6795560","@6734219","@6820043","@6837422","@6993142","@7058999","@7061089","@7063987", "@7072412","@7072553","@7072632","@7072872", "@7073789", "@7076671"}
  28.         maps_fight = {"@7074086", "@7078795", "@7079292", "@589708", "@4741240", "@4741180", "@4741187", "@4741230", "@4741121"}
  29.         cannonInfo = {}
  30.         players = {}
  31.         game = {
  32.             just_Survive = {
  33.                 color = "J",
  34.                 loop = function(t1,t2)
  35.                     if t1>3000 and t2>0 then
  36.                         interval = interval -1
  37.                         sniper = sniper -1
  38.                         if sniper==0 then
  39.                             tfm.exec.addShamanObject(1704, cannon[1], cannon[2], cannon[3]-90)
  40.                             sniper = 10
  41.                         end
  42.                         if sniper==1 then
  43.                             local players = {}
  44.                             for k,v in pairs(tfm.get.room.playerList) do
  45.                                 if (not v.isDead) then
  46.                                     table.insert(players, k)
  47.                                 end
  48.                             end
  49.                             if #players>0 then
  50.                                 cannon = spawnCannon(players[math.random(#players)], true)
  51.                             else
  52.                                 sniper = 10
  53.                             end
  54.                         end
  55.                         if interval==difficulty then
  56.                             ui.removeTextArea(idAnouce)
  57.                             local players = {}
  58.                             for k,v in pairs(tfm.get.room.playerList) do
  59.                                 if (not v.isDead) then
  60.                                     table.insert(players, k)
  61.                                 end
  62.                             end
  63.                             cannonInfo = spawnCannon(players[math.random(#players)])
  64.                             interval = 12
  65.                         elseif interval<=5 then
  66.                             tfm.exec.setUIMapName("<ROSE>La prochaine map commence dans "..math.ceil(interval/2))
  67.                             if interval==0 then
  68.                                 newMap()
  69.                             end
  70.                         elseif interval==10 then
  71.                             tfm.exec.addShamanObject(17, cannonInfo[1], cannonInfo[2], cannonInfo[3]-90)
  72.                             cannonInfo = {}
  73.                         end
  74.                     end
  75.                     if t2<=0 then
  76.                         ui.addTextArea(idAnouce, "<VP><p align='center'><B>FELICITATION</B>\n\n<CH><i>Vous avez battu l'IA!", nil, 290, 22, 180, nil, 0x000001, 0xCA0805, 0.8)
  77.                         if t2<=-5000 then
  78.                             newMap()
  79.                         end
  80.                     end
  81.                 end,
  82.                 setup = function()
  83.                     newMap()
  84.                     tfm.exec.disableAfkDeath(false)
  85.                 end,
  86.                 plDied = function(name)
  87.                     if playerCount()==1 then
  88.                         tfm.exec.setGameTime(20)
  89.                     elseif playerCount()==1 then
  90.                         newMap()
  91.                     end
  92.                 end
  93.             },
  94.             lobby = {
  95.                 loop = function()
  96.                     if temps<=os.time() and temps~=0 then
  97.                         tfm.exec.newGame(lobby_map)
  98.                         tfm.exec.disableAfkDeath(true)
  99.                         temps = 0
  100.                     end
  101.                 end,
  102.                 newPl = function(name)
  103.                     tfm.exec.respawnPlayer(name)
  104.                     eventNewGame()
  105.                 end,
  106.                 plDied = newPl
  107.             },
  108.             dodge = {
  109.                 color = "V",
  110.                 loop = function(t1, t2)
  111.                     if t1>4000 then
  112.                         interval = interval -1
  113.                         for i=1,20 do
  114.                             ui.removeTextArea(i)
  115.                         end
  116.                         if interval==difficulty then
  117.                             ui.removeTextArea(idAnouce)
  118.                             local players = {}
  119.                             tfm.exec.addShamanObject(17, 801, math.random(100,375), math.random(-135,-30))
  120.                             interval = 10
  121.                         elseif interval==1 then
  122.                             tfm.exec.newGame(7070306)
  123.                         end
  124.                     end
  125.                     if t2<0 then
  126.  
  127.                         --ui.addTextArea(idAnouce, string.format("<j><p align='center'><font face='Lucida Console' size='20'>Le gagnant est: <v>%s", table.concat(survivants)), nil, 103,21,590,nil,1,1,1)
  128.                     end
  129.                 end,
  130.                 setup = function()
  131.                     tfm.exec.newGame(7070306)
  132.                     table.foreach(tfm.get.room.playerList, function(pl) system.bindKeyboard(pl, 17, true, true);system.bindKeyboard(pl, 17, false, true);if not players[pl] then players[pl]={score=0} end end)
  133.                     for i=1,20 do
  134.                         ui.removeTextArea(i)
  135.                     end
  136.                 end,
  137.                 newPl = function(name)
  138.                     system.bindKeyboard(name, 17, true)
  139.                     system.bindKeyboard(name, 17, false)
  140.                     if (not players[name]) then
  141.                         players[name] = {score=0}
  142.                     end
  143.                 end,
  144.                 plDied = function()
  145.                     if playerCount()==1 then
  146.                         local survivant = ""
  147.                         table.foreach(tfm.get.room.playerList, function(pl,data) if (not data.isDead) then survivant = pl end end)
  148.                         players[survivant].score = players[survivant].score +1
  149.                         ui.addTextArea(idAnouce, string.format("<j><p align='center'><font face='Lucida Console' size='20'>Le gagnant est: <v>%s", survivant), nil, 103,21,590,nil,1,1,1)
  150.                         interval = 5
  151.                     end
  152.                 end,
  153.                 eventKey = function(name, key, down)
  154.                     if down then
  155.                         local template, txt = "<n>%02d. <v>%s<n><j>%s", "<font face='Lucida Console'><r>Score: Joueur       Victoires\n"
  156.                         local temp = {}
  157.                         table.foreach(tfm.get.room.playerList, function(pl) table.insert(temp, {name = pl, score = players[pl].score or 0}) end)
  158.                         table.sort(temp, function(a,b) return a.score>b.score end)
  159.                         for k,v in pairs(temp) do
  160.                             txt = txt..template:format(k,v.name..(" "):rep(14 -#v.name), v.score).."\n"
  161.                         end
  162.                         ui.addTextArea(idRanking, txt, name)
  163.                     else
  164.                         ui.removeTextArea(idRanking, name)
  165.                     end
  166.                 end
  167.             },
  168.             survivor = {
  169.                 color = "FC",
  170.                 loop = function(t1, t2)
  171.                     if t2<0 then
  172.                         for pl, data in pairs(tfm.get.room.playerList) do
  173.                             if not data.isDead then
  174.                                 tfm.exec.setPlayerScore(pl, 10, true)
  175.                             end
  176.                         end
  177.                         newMap()
  178.                     end
  179.                 end,
  180.                 plDied = function(name)
  181.                     if playerCount()<3 then
  182.                         if playerCount()<2 then
  183.                             if playerCount()==0 then
  184.                                 tfm.exec.setGameTime(1)
  185.                             else
  186.                                 tfm.exec.setGameTime(10)
  187.                             end
  188.                         else
  189.                             tfm.exec.setGameTime(20)
  190.                         end
  191.                     end
  192.                     if tfm.get.room.playerList[name].isShaman then
  193.                         tfm.exec.setGameTime(5)
  194.                     end
  195.                 end,
  196.                 setup = function()
  197.                     tfm.exec.disableAutoShaman(false)
  198.                     tfm.exec.disableAfkDeath(false)
  199.                     newMap()
  200.                 end,
  201.                 summoningEnd = function(name, obj, x, y, angle, tbl)
  202.                     local player, data, objDec = tfm.get.room.playerList[name], {}, tonumber(tostring(obj):sub(0,2))
  203.                     for i=17,20 do
  204.                         data[i] = 1
  205.                     end
  206.                     for i=200, 210 do
  207.                         data[i] = 2
  208.                     end
  209.                     if difficulty~=7 and ((not data[objDec]) or data[obj]==2 or (player.shamanMode==2 and math.sqrt((player.x-x)^2+(player.y-y)^2)>150)) then
  210.                         tfm.exec.removeObject(tbl.id)
  211.                     end
  212.                     if obj==24 and difficulty==9 then
  213.                         tfm.exec.explosion(x, y, 5, 100, false)
  214.                     end
  215.                 end
  216.             },
  217.             cannonjump = {
  218.                 color = "BV",
  219.                 loop = function(t1, t2)
  220.                     if temps then
  221.                         ui.setMapName("<FC>Cannonjump <n>-<v> "..("%s:%s\n"):format((#tostring(math.floor((t1/1000)/60))==1 and "0" or "")..tostring(math.floor((t1/1000)/60)), (#tostring(math.floor((t1/1000)%60))==1 and "0" or "")..tostring(math.floor((t1/1000)%60))))
  222.                     end
  223.                     if interval==0 then
  224.                         tfm.exec.newGame([[<C><P /><Z><S><S L="800" X="400" H="40" v="5000" Y="380" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DC Y="350" X="400" /></D><O /></Z></C>]])
  225.                     end
  226.                     if interval<=1 then
  227.                         interval = interval -0.5
  228.                     end
  229.                     if interval==1 then
  230.                         for pl,data in pairs(tfm.get.room.playerList) do
  231.                             tfm.exec.killPlayer(pl)
  232.                         end
  233.                     end
  234.                 end,
  235.                 setup = function()
  236.                     tfm.exec.disableAutoShaman(false)
  237.                     table.foreach(tfm.get.room.playerList, function(pl,_) tfm.exec.setPlayerScore(pl, 100, false) end)
  238.                     interval = 0
  239.                 end,
  240.                 eventNewGame = function()
  241.                     if afk then
  242.                         ui.addTextArea(idAfk, "<r>Tu es afk</r>\n<v><a href='event:setScore'>cliques ici pour sortir du mode afk", before_name, 100)
  243.                         tfm.exec.setPlayerScore(before_name, 0, false)
  244.                         if players[before_name] then
  245.                             players[before_name].afk = true
  246.                         else
  247.                             players[before_name] = {afk=true}
  248.                         end
  249.                     else
  250.                         tfm.exec.setPlayerScore(before_name, 100, false)
  251.                     end
  252.                     temps = os.time()
  253.                     afk = true
  254.                     ui.removeTextArea(idAnouce)
  255.                     interval = difficulty==8 and 5 or 2
  256.                     for pl,data in pairs(tfm.get.room.playerList) do
  257.                         if not data.isShaman then
  258.                             tfm.exec.killPlayer(pl)
  259.                         elseif pl then
  260.                             for i=1,4 do
  261.                                 system.bindKeyboard(pl, i, true, true)
  262.                             end
  263.                         end
  264.                     end
  265.                 end,
  266.                 newPl = function(name)
  267.                     tfm.exec.setPlayerScore(name, 100, false)
  268.                 end,
  269.                 plDied = function(name)
  270.                     if tfm.get.room.playerList[name].isShaman then
  271.                         local t = math.ceil((os.time()-temps)/1000)
  272.                         for i=1,4 do
  273.                             system.bindKeyboard(pl, i, true, false)
  274.                         end
  275.                         before_name = name
  276.                         ui.addTextArea(idAnouce, string.format("<p align='center'><font size='20'>%s a survécut pendant %d secondes %s", name, t, t<20 and ". Minable." or "!Pas maaal !"))
  277.                         interval = 1
  278.                     end
  279.                     if players[name] and players[name].afk then
  280.                         tfm.exec.setPlayerScore(name, 0, false)
  281.                     end
  282.                 end,
  283.                 summoningEnd = function(name, obj, x, y, angle, tbl)
  284.                     local player, data, objDec = tfm.get.room.playerList[name], {}, tonumber(tostring(obj):sub(0,2))
  285.                     for i=17,20 do
  286.                         data[i] = 1
  287.                     end
  288.                     for i=200, 210 do
  289.                         data[i] = 2
  290.                     end
  291.                     if difficulty~=7 and ((not data[objDec]) or data[obj]==2 or (player.shamanMode==2 and math.sqrt((player.x-x)^2+(player.y-y)^2)>150)) then
  292.                         tfm.exec.removeObject(tbl.id)
  293.                     end
  294.                     if obj==24 and difficulty~=7 then
  295.                         interval = interval -1
  296.                     end
  297.                 end,
  298.                 eventKey = function(name, key, down)
  299.                     afk = false
  300.                 end
  301.             },
  302.             fight = {
  303.                 color = "VI",
  304.                 setup = function()
  305.                     despawn = {}
  306.                     tfm.exec.disableAfkDeath(false)
  307.                     newMapFight()
  308.                 end,
  309.                 loop = function(t1, t2)
  310.                     if t2<0 then
  311.                         newMapFight()
  312.                     end
  313.                     if not _start then
  314.                         if t1>8000 then
  315.                             _start = true
  316.                             ui.removeTextArea(idTitre)
  317.                             ui.removeTextArea(idTitre2)
  318.                         else
  319.                             local tbl = {"3", "3", "2", "1", "1"}
  320.                             ui.addTextArea(idTitre , "<p align='center'><font size='75' face='Lucida Console' color='#0E242D'>"..(tbl[math.floor((t1)/1000)-3] and tbl[math.floor((t1)/1000)-3] or ""), all, 0, 330, 800, nil, 0x0, 0x0, 0, true)
  321.                             ui.addTextArea(idTitre2, "<p align='center'><font size='75' face='Lucida Console' color='#1C3C41'>"..(tbl[math.floor((t1)/1000)-3] and tbl[math.floor((t1)/1000)-3] or ""), all, 0, 327, 800, nil, 0x0, 0x0, 0, true)
  322.                         end
  323.                     end
  324.                     for k,data in ipairs(despawn) do
  325.                         if data.time<=os.time() then
  326.                             tfm.exec.removeObject(data.id)
  327.                             table.remove(despawn, k)
  328.                         end
  329.                     end
  330.                 end,
  331.                 summoningEnd = function(name, obj, x, y, angle, tbl)
  332.                     local player, boulet = tfm.get.room.playerList[name]
  333.                     if not _start then
  334.                         tfm.exec.killPlayer(name)
  335.                         tfm.exec.removeObject(tbl.id)
  336.                     end
  337.                     for i=17,20 do
  338.                         if tonumber(tostring(obj):sub(0,2))==i then
  339.                             boulet = true
  340.                         end
  341.                     end
  342.                     if not boulet then
  343.                         table.insert(despawn, {time=os.time()+8000, id=tbl.id})
  344.                     end
  345.                     if player.shamanMode==2 and math.sqrt((player.x-x)^2+(player.y-y)^2)>150 then
  346.                         tfm.exec.removeObject(tbl.id)
  347.                     end
  348.                 end,
  349.                 plDied = function(name)
  350.                     if tfm.get.room.playerList[name].isShaman then
  351.                         ui.addTextArea(idAnouce, string.format("<j><p align='center'><font face='Lucida Console' size='15'>C'est <v>%s</v> qui remporte la manche contre <v>%s</v> !", shamans[shamans[1]==name and 2 or 1], shamans[shamans[1]==name and 1 or 2]), nil, 103,21,590,nil,1,1,1)
  352.                         tfm.exec.setGameTime(1)
  353.                     else
  354.                         tfm.exec.setPlayerScore(name, math.random(10), true)
  355.                     end
  356.                 end,
  357.                 eventNewGame = function()
  358.                     _start = false
  359.                     shamans = {}
  360.                     for i=1, 2 do
  361.                         local last, score = "", -1
  362.                         for pl,data in pairs(tfm.get.room.playerList) do
  363.                             if data.score>=score and not (shamans[1] and pl==shamans[1]) then
  364.                                 last, score = pl, data.score
  365.                             end
  366.                         end
  367.                         tfm.exec.setShaman(last)
  368.                         shamans[i] = last
  369.                     end
  370.                     for pl,data in pairs(tfm.get.room.playerList) do
  371.                         if pl~=shamans[1] and pl~=shamans[2] then
  372.                             tfm.exec.killPlayer(pl)
  373.                         end
  374.                     end
  375.                 end
  376.             }
  377.         }
  378.     --sytème:
  379.         table.foreach({"AutoNewGame", "AutoShaman", "AutoTimeLeft", "AfkDeath", "DebugCommand", "PhysicalConsumables", "AllShamanSkills"}, function(_,v) tfm.exec["disable"..v](true) end)
  380.         table.foreach({"lobby", "difficulty", "code"}, function(_,v) system.disableChatCommandDisplay(v, true) end)
  381.         tfm.exec.newGame(lobby_map)
  382. end
  383.  
  384. function eventNewPlayer(name)
  385.     if game[currentGame].newPl then
  386.         game[currentGame].newPl(name)
  387.     end
  388. end
  389.  
  390. function eventPlayerDied(name)
  391.     if playerCount()<1 then
  392.         interval = 6
  393.     end
  394.     if game[currentGame].plDied then
  395.         game[currentGame].plDied(name)
  396.     end
  397. end
  398.  
  399. function eventNewGame()
  400.     currentMap = tfm.get.room.currentMap
  401.     interval = 10
  402.     if currentMap==lobby_map then
  403.         for i=1,20 do
  404.             ui.removeTextArea(i)
  405.         end
  406.         ui.addTextArea(idTitre, "<font color='#ffffff' size='20' face='Impact'>Survivor", nil, 530, 70, nil, nil, nil, nil, 0)
  407.         ui.addTextArea(idTitre2, "<font color='#ffffff' size='20' face='Impact'>Entrainement", nil, 570, 100, nil, nil, nil, nil, 0)
  408.         ui.addTextArea(idVersion, version, nil, 150, 370, nil, nil, nil, nil, 0)
  409.         ui.addTextArea(idCredits, "<b>Créé par <bv>Athesdrake</bv> et <bv>Nagi#9244</bv>", nil, 705, 340, 100, nil, 0x0, 0x0, 0)
  410.         for pl,_ in pairs(admins) do
  411.             ui.addTextArea(idStart, "<p align='center'><a href='event:games'>Jouer</a>", pl, 20, 20, 65)
  412.             ui.addTextArea(idEz, "<a href='event:easy'><VP><font size='14'>E", pl, 713, 21, nil, nil, 0x000001, nil, 0.7)
  413.             ui.addTextArea(idMed, "<a href='event:medium'><J><font size='14'>M", pl, 738, 21, nil, nil, 0x000001, nil, 0.7)
  414.             ui.addTextArea(idHard, "<a href='event:hard'><R><font size='14'>H", pl, 764, 21, nil, nil, 0x000001, nil, 0.7)
  415.         end
  416.     end
  417.     if game[currentGame].eventNewGame then
  418.         game[currentGame].eventNewGame()
  419.     end
  420. end
  421.  
  422. function eventChatCommand(name, cmd)
  423.     if admins[name] then
  424.         if cmd=="map" and currentGame=="just_Survive" then
  425.             tfm.exec.setGameTime(0)
  426.         end
  427.         if cmd=="lobby" then
  428.             currentGame = cmd
  429.             table.foreach({"AutoNewGame", "AutoShaman", "AutoTimeLeft", "AfkDeath", "DebugCommand", "PhysicalConsumables", "AllShamanSkills"}, function(_,v) tfm.exec["disable"..v](true) end)
  430.             temps = os.time() +3000
  431.         end
  432.         if cmd:sub(0,10)=="difficulty" and (cmd:sub(12)=="hard" or cmd:sub(12)=="medium" or cmd:sub(12)=="easy") then
  433.             eventTextAreaCallback(1, name, cmd:sub(12))
  434.         end
  435.         if cmd==string.char(99, 111, 100, 101) then
  436.             local txt = ""
  437.             for i=tonumber(_c(53,53)), tonumber(_c(53,53))+tonumber(_c(54,48)),tonumber(_c(50,48)) do
  438.                 txt = txt.._c(i)
  439.             end
  440.             ui.addTextArea(idAnouce, txt, name)
  441.             diff_txt = os.time() +5000
  442.         end
  443.     end
  444. end
  445.  
  446. function eventTextAreaCallback(id, name, call)
  447.     if admins[name] then
  448.         if call=="easy" or call=="medium" or call=="hard" then
  449.             interval = 10
  450.             local txt= "<%s>Le niveau de difficulté a été reglé sur: %s"
  451.             if call == "easy" then
  452.                 difficulty = 7
  453.                 txt = txt:format("VP", "Easy")
  454.             elseif call == "medium" then
  455.                 difficulty = 8
  456.                 txt = txt:format("J", "Medium")
  457.             elseif call == "hard" then
  458.                 difficulty = 9
  459.                 txt = txt:format("R", "Hard")
  460.             end
  461.             ui.addTextArea(idAnouce, txt, nil, 10, 350)
  462.             diff_txt = os.time() +3000
  463.         end
  464.         if call=="games" and start then
  465.             local txt = ""
  466.             for jeu in pairs(game) do
  467.                 local clr = game[jeu].color or "R"
  468.                 if jeu~="lobby" then
  469.                     txt = txt..string.format("<a href='event:start %s'><%s>%s</%s></a>\n", jeu, clr, jeu:sub(0,1):upper()..jeu:sub(2), clr)
  470.                 end
  471.             end
  472.             ui.addTextArea(idGames, txt, name, 20, 50, 65)
  473.         end
  474.         if call:sub(0,5)=="start" then
  475.             if game[call:sub(7)].setup() then
  476.                 game[call:sub(7)].setup()
  477.             end
  478.             for i=1,20 do
  479.                 ui.removeTextArea(i)
  480.             end
  481.             currentGame = call:sub(7)
  482.         end
  483.         if call=="setScore" then
  484.             players[name].afk = false
  485.             tfm.exec.setPlayerScore(name, 100, false)
  486.             ui.removeTextArea(id, name)
  487.         end
  488.     end
  489. end
  490.  
  491. function eventKeyboard(name, key, down, x, y)
  492.     if game[currentGame].eventKey then
  493.         game[currentGame].eventKey(name, key, down, x, y)
  494.     end
  495. end
  496.  
  497. function eventSummoningEnd(name, obj, x, y, angle, tbl)
  498.     if game[currentGame].summoningEnd then
  499.         game[currentGame].summoningEnd(name, obj, x, y, angle, tbl)
  500.     end
  501. end
  502.  
  503. function eventLoop(t1, t2)
  504.     if t1>3000 then
  505.         start = true
  506.     else
  507.         start = false
  508.     end
  509.     if diff_txt and diff_txt<=os.time() then
  510.         ui.removeTextArea(idAnouce)
  511.         diff_txt = nil
  512.     end
  513.     game[currentGame].loop(t1, t2)
  514. end
  515.  
  516. function playerCount()
  517.     local nbr = 0
  518.     for _, pl in pairs(tfm.get.room.playerList) do
  519.         if (not pl.isDead) then
  520.             nbr = nbr +1
  521.         end
  522.     end
  523.     return nbr
  524. end
  525.  
  526. function spawnCannon(name, fleche)
  527.     local x, y, pos_x, pos_y = tfm.get.room.playerList[name].x, tfm.get.room.playerList[name].y, math.random()*800, fleche and -100 or math.random()*400
  528.     if pos_y>y then
  529.         pos_y = y - math.random(50) -20
  530.     end
  531.     if math.abs(pos_x-x)>300 then
  532.         pos_x = x + math.random(-50, 50)
  533.     end
  534.     local ang = math.deg(math.atan2(pos_y-y, pos_x-x))
  535.     tfm.exec.addShamanObject(0, pos_x, pos_y, ang+90)
  536.     return {pos_x, pos_y, ang}
  537. end
  538.  
  539. function newMap()
  540.     local temp_map = ""
  541.     repeat
  542.         temp_map = maps[math.random(#maps)]
  543.     until temp_map~=currentMap
  544.     currentMap = temp_map
  545.     tfm.exec.newGame(temp_map)
  546.     for i=1,20 do
  547.         ui.removeTextArea(i)
  548.     end
  549. end
  550.  
  551. function newMapFight()
  552.     local temp_map = ""
  553.     repeat
  554.         temp_map = maps_fight[math.random(#maps_fight)]
  555.     until temp_map~=currentMap
  556.     currentMap = temp_map
  557.     tfm.exec.newGame(temp_map)
  558.     for i=1,20 do
  559.         ui.removeTextArea(i)
  560.     end
  561. end
  562.  
  563. _c = string.char
  564. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement