Advertisement
Tectoon

[TFM] Treinamento Shaman V1.1

Sep 22nd, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.70 KB | None | 0 0
  1. adm =                 {       "Tectoon", "Theapps", "Sagazgamer" }
  2.  
  3. np= tfm.exec.disableAutoNewGame(true) or {[[@1703644]], [[@360778]], [[@183740]], [[@4624694]], [[@2065627]], [[@1474189]], [[@1482964]], [[@626107]], [[@4530334]], [[@2593758]], [[@524924]], [[@2722183]]}
  4.  
  5. function eventLoop(a, b)
  6.     local c= 0;
  7.     table.foreach(tfm.get.room.playerList, function(i,v) c= not v.isDead and c+1 or c end)
  8.     c= (c == 0 or b <=0) and tfm.exec.newGame(np[math.random(#np)]) or nil;
  9. end
  10.  
  11. eventNewGame = function()
  12.         sh = 2
  13.         alive = 0
  14.         maxscore = 0
  15.         for i in pairs(tfm.get.room.playerList) do
  16.                 alive = alive + 1
  17.                 for l = 1,2 do
  18.                         if tfm.get.room.playerList[i].score < maxscore + 1 and sh ~= 0 then
  19.                                 sh = sh - 1
  20.                                 tfm.exec.setShaman(i)
  21.                                 tfm.exec.setPlayerScore(i, 0, false)
  22.                                 if sh == 1 then
  23.                                         tfm.exec.setNameColor(i, 0xFF1100) ------- Aonde está FFAB35 você mude para outro código, outra cor, que será a cor do shaman
  24.                                         tfm.exec.setUIMapName("Treinamento Shaman V1.1")
  25.                                 end
  26.                         end
  27.                 end
  28.         end
  29. end
  30.  
  31. eventLoop(0, 0)
  32.  
  33. parametre =     { ["Tempo automático"] = true }
  34.  
  35.  
  36. aff =           { lJoueurs = {} , joueur = {}
  37.                                 }
  38.  
  39.  
  40. joueur =         {}
  41.  
  42. for k, pseudo in pairs(adm) do
  43.                 ui.addTextArea (1, "<p align='center'><b><a href='event:time'>Time</a></b></p>", pseudo, 61, 30, 40, 20, 0xC06F6E, 0x324650, 0.75, true)
  44.                 ui.addTextArea (4, "<p align='center'><b><a href='event:map'>Mapa</a></b></p>", pseudo, 10, 30, 40, 20, 0x000000, 0x324650, 0.5, true)
  45.                
  46.                 for l, m in pairs ( aff ) do
  47.                         aff[l][pseudo] = false
  48.  
  49.                 end
  50. end
  51.  
  52.  
  53.  
  54. function eventTextAreaCallback(id, source, callback)
  55.  
  56.                 if callback == 'time' then
  57.    
  58.                         ui.addPopup (0, 2, "Tempo para definir:", source, 10, 70, 150, true)
  59.  
  60.  elseif callback == 'map' then  
  61.  
  62.                         ui.addPopup (1, 2, "Código do Mapa:", source, 10, 70, 150, true)
  63.  
  64.                 elseif parametre[callback] ~= nil then
  65.  
  66.                         paraGestion(callback,  source )
  67.                         ui.updateTextArea (id, callback .. ": <a href='event:" .. callback .. "'>" .. B(parametre[callback]) .. "</a>", source )
  68.    
  69.  
  70.                 elseif joueur[callback] ~= nil or callback == "Nomes" then
  71.    
  72.                         if aff["joueur"][source] then
  73.                                 effJoueur ( source )
  74.                                 if callback ~= dernierProfil[source] then
  75.                                         eventTextAreaCallback(id, source, callback)
  76.                                 end
  77.  
  78.                         else
  79.                                 affJoueur(source, callback)
  80.                                 ui.updateTextArea (id, "<p align='center'><b><V><a href='event:" .. callback .. "'>" .. callback .. "</a></N></b></p>", source)
  81.                         end
  82.    
  83.                         dernierProfil[source] = callback
  84.  
  85.                 elseif parametreJ[callback] ~= nil then
  86.                         if dernierProfil[source] == "all" then
  87.  
  88.                                 for k, v in pairs ( joueur ) do
  89.                                         if all[callback] ~= nil then
  90.                                                 joueur[k][callback] = all[callback]
  91.                                         end
  92.    
  93.                                         paraJGestion ( k, callback )
  94.                                 end
  95.  
  96.                         end
  97.  
  98.    
  99.                 end
  100.    
  101. end
  102.  
  103. function eventPopupAnswer (id, playerName, answer)
  104.  
  105.                 if id == 0 then
  106.                         tfm.exec.setGameTime(answer, true)
  107.    
  108.  
  109. elseif id == 1 then
  110.                         tfm.exec.newGame(answer)
  111.  
  112.    
  113.                 end
  114. end
  115.  
  116. function eventChatCommand(p,c)
  117.  local args={}
  118.     for i in c:gmatch('[^%s]+') do
  119.         table.insert(args,i)
  120.     end
  121.      if args[1]==[[skip]] and p==[[Sagazgamer]] then
  122.     tfm.exec.newGame(np[math.random(#np)])
  123.     tfm.exec.setUIMapName("<J> Treinamento Shaman V1.1")
  124.                 print("<J>Próximo mapa<n> Mapa carregado com sucesso!")
  125. elseif args[1]=="reset" and p==[[Sagazgamer]] then
  126.     tfm.exec.newGame(tfm.get.room.currentMap)
  127.   end
  128. end
  129.  
  130. for i,command in ipairs({"skip","reset"}) do
  131.         system.disableChatCommandDisplay(command)
  132.         end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement