Advertisement
podoko_Lua

PlayMap [v0.55]

Jan 14th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.03 KB | None | 0 0
  1. liste = {}
  2.  
  3. liste["P1"] =   {   "115767","116040","119012","119135","119203","119217","119242","119309","119389","119537","119540","119814","119884","119907","120013","120657","120696","120770","120845","120856","120876","121108","121416","121452","121772","121777","121941","122097","122148","122333","122547","122563","122576","122710","123123","123217","123299","123301","123330","123436","123522","123812","123906","124577","124717","124749","125078","125206","125723","126325","126432","126496","126555","126858","127049","127159","127161","127853","128194","128859","129017","129067","129119","129313","129745","129837","130029","130685","131224","131493","131540","132021","132590","132745","132789","133373","133404","133508","133519","133632","133649","133795","133916","134024","134039","134048","134184","134590","134929","134937","134996","135084","135340","135767","136276","136372","136418","136627","136778","137024","137068","137552","137657","138005","138017","139694","140566","141014","141224","141355","141898","142311","142577","143026","143511","144304","144888","145210","145354","146006"     }
  4. liste["P3"] =   {   "113156","124000","149422","149451","150607","150651","150664","151655","152260","152733","153996","155480","155606","155611","155628","155765","156720","157004","157203","157805","157960","158345","158417","158909","159131","159187","159298","159932","160841","161023","161434","162482","163094","163159","163172","163506","163531","163596","164544","164916","165186","166032","166037","166056","166271","166333","166361","166430","166805","167075","167903","168204","168754","169059","169076"      }
  5. liste["P4"] =   {   "120806","126092","131444","151712","155582","155982","156966","158280","159709","164663","165741","166138","168872","169710","171093","171097","172357","173231","179968","182878","183705","183740","183760","186482","187059","187088","188821","199112","199265","200017","213781","215312","219032","234373","234665","239860","239941","245354","249255","250889","251052","273581","308787","317521","326777","348365","355562","357214","357644","360778","364544","364688","365734","367747","371007","379805","382841","384181","392150","398828","404226","413242","416324","420875","421185","421195","423670","426398"     }
  6. liste["P5"] =   {   "129420","154859","202952","224120","230970","235931","238162","247992","256797","257777","257782","261886","263215","263800","270238","277994","280679","281473","287044","290549","299897","306561","315632","317110","330773","330797","334645","350441","374125","448507","450140","453765","457558","476658","484355","485653","495829","506218","525684","531213","543398","558253","578714","585040","604406","617254","638159","706326","744348","750942","763156","779260","786497","848208","878196","899457","927182","979494","1135318","1154704","1200519","1211568","1214279","1259600","1262441","1262576","1263900","1268550","1284562","1300245"   }
  7. liste["P6"] =   {   "49101","60303","113235","119308","121043","121494","123777","124969","126151","127440","133082","139581","141827","147831","149476","155262","155591","158569","160303","164404","164859","166106","167093","169959","171290","179384","183423","183427","184294","192144","192155","196950","198823","204059","206891","208692","211171","211533","213396","215965","217333","219350","220999","226423","238926","239907","242204","242381","246776","248490","248644","250042","251430","251448"     }
  8. liste["P7"] =   {   "162804","164931","165808","169033","169909","178486","179656","180035","180617","181261","182233","185646","185955","185985","186484","186695","191070","197413","197442","197503","197742","199957","201502","201606","210217","211248","212576","212903","213470","214465","214788","215601","219889","220737","221767","222730","228517","233294","233333","235464","237251","238378","240994","244642","245152","247329","247904","248906","250491","250619","261462"  }
  9. liste["P8"] =   {   "125204","149514","159903","176885","185685","197214","198028","212956","216809","263777","270489","294822","322898","343455","350169","352617","404907","414991","421583","422305","465849","481925","484218","497904","506950","508252","509145","515913","542870","544675","570888","609552","626107","742744","1089882","1095753","1100306","1341133","1365330","1380404","1390764","1405207","1428989","1452753","1474189","1518389","1568962","1651220","1653564","1662853","1696100","1703817","1709353","1721620","1758349","1789491","1805044","1819830","1821046","1830591","1887755","1901078"   }
  10. liste["P9"] =   {   "121024","134300","139360","141301","144903","145968","151850","156030","163770","163833","165264","165993","180301","183676","186490","187672","191021","205280","218061","225041","238365","239853","239883","253864","257008","260953","266723","269622","270403","277517","278557","304325","308541","313076","316859","324426","327308","328997","332114","333333","348115","351777","352154","361426","365347","365742","370045","377297","379521","379615","382746","382906","384457","384989","387280","402313","415547","421576","421608","434730","445108","445520","449424","449673","450986","482845","499397","512836","542808","569959","599834","604878","605894","622358","628530","631342","651831","716537","716722","744202" }
  11. liste["P10"] =  {   "276534","279689","280120","280159","281431","281479","281492","281649","289932","289964","290388","290546","290725","290865","290971","290974","291399","291643","292592","292672","292678","293222","293487","295988","296033","299123","300404","302224","304198","304482","305748","305753","306106","306360","306382","307930","311496","390383","390386","390649","390657","391057","391643","391664","391738","392616","392646","393406","395246","397066","459284","464787","478116","479091","481676","489470","489829","490248","492283","495880","500312","521931","540495","573817","697561","741041","770675","787131","793117","797964","799141","802958","802975","803074","811211","848697","852617","866256","908739","937383","958881"    }
  12. liste["P11"] =  {   "258972","334445","423793","615791","760329","812007","946893","955523","1296883","1542025","1638989","1676629","1782151","2389613","2393716","2403639","2428213","2429313","2435372","2541364","2561153","2563004","2680717","2683284","2686097","2693083","2761246","2821033","2910904","2929496","2938327","2940045","2944932","2951616","2953590","2956031","2956156","2971085","2975699","2976059","2983430","2986318","2999898","3001393","3006311","3020988","3027934","3032840","3033710"   }
  13. liste["P13"] =  {   "155517","156510","159116","159145","167333","170007","175454","176615","177652","186855","187035","195453","197368","212322","215933","229974","235717","249760","253469","255943","257092","258289","259854","266398","277631","277835","280949","281668","281985","285589","285961","292668","292808","293658","294478","295487","296020","298424","301559","305680","313138","313214","322922","330590","342640","343875","346684","353356","357837","366809","368585","371579","374995","392861","431873","503679","507341","507884","515684","544695","549759","554154","591528","593003","597348","597804","621850","639878","651656","655207","658960","720672","733146","763368","814311","1102513","1110982","1134969","1296299","1350382","1526368","1533335","1584555","1610638","1636814","1642725","1646448","1657819","1705006","1719709","1737297","1737800","1737914","1766343","1802012","1802528"    }
  14. liste["P17"] =  {   "2283","2806","3154","72339","103182","107544","112790","114122","117548","120152","122911","124359","130763","136966","138036","138678","140850","144468","144677","145020","145762","146801","147436","148424","150692","152299","155168","156685","156847","157590","158128","159351","160762","161730","163682","164802","165112","165747","165843","166705","167941","168776","169065","169892","171152","176263","177236","177813","178545","178657","179339","179541","180191","180255","180274","180469","180509","180619","181312","184110","184924","185760","185774","186604","190026","191201","191716","191749","191753","192391","192566","193009","193588","193936","195720","196433","196468","196574","197219","197501","198549","198715","199219","201323","201442","206810","208058","208162","208914","209315","209708","209799","210188","211041","211528","211565","211885","212542","213331","213697","213933","214037","214660","214775","215938","216439","216505","216553","216735","217282","217881","217900","219548","220500","221564","222098","223293","223810","223986","224441","225017","226069","226879","226883","227417","227851","228462","229814","229827","229830","229834","229835","229944","230510","230741","231254","231694","231905","232140","232274","232451","232699"  }
  15. liste["P18"] =  {   "767142","1299415","1408349","2067212","2350333","2391874","2403601","2724523","2828653","3360371","3389471","3485735","3542818","3588592","3594075","3594982","3597078","3599387","3604095","3604466","3607701","3607702","3608780","3608970","3609021","3609664","3610314","3610391","3610645","3611760","3612194","3613669","3614156","3614384","3617974","3618476","3618594","3619690","3619917","3620309","3620571","3620811","3621663","3622939","3624107","3624400","3625576","3627013","3629143","3630267","3631170","3632905","3634588","3636939","3637386","3638927","3646346","3653815","3656275","3656585","3661916","3662299","3664724","3666517","3682449","3698736","3714415","3716681","3720793","3729289","3730104","3731768","3745172","3745177","3745187","3745190","3745194","3745200","3745207","3745213","3745218","3745220","3753765","3758473","3761727","3766438","3775820","3776993","3784736","3787386","3791957"}
  16.  
  17.  
  18.  
  19.  
  20. P =     { "P1","P3","P4","P5","P6","P7","P8","P9","P10","P11","P13","P17","P18" }
  21.  
  22. currentP = "P1"
  23.  
  24.  
  25. time =      {   P1 = 120, P3 = 360, P4 = 120, P5 = 120, P6 = 120, P7 = 63, P8 = 120, P9 = 120, P10 = 120, P11 = 120,P13 = 360, P17 = 63, P18 = 120, P32 = 120}
  26. timeLeft =  {   P1 = false, P3 = true, P4 = false, P5 = false, P6 = false, P7 = false, P8 = false, P9 = false, P10 = false, P11 = true, P13 = true, P17 = false, P18 = true, P32 = false}
  27. shaman =    {   P1 = false, P3 = true, P4 = false, P5 = false, P6 = false, P7 = true, P8 = false, P9 = false, P10 = false, P11 = true, P13 = true, P17 = true, P18 = true, P32 = false}
  28.  
  29.  
  30.  
  31. playerList = {}
  32. alive = 0
  33.  
  34. tfm.exec.disableAutoNewGame ( true )
  35.  
  36. print(time[currentP])
  37.  
  38.  
  39. for name, v in pairs ( tfm.get.room.playerList ) do
  40.        
  41.         table.insert ( playerList, name )
  42.  
  43. end
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. function launchGame ( )
  51.        
  52.             currentP = P [math.random ( #P )]
  53.             nextMap = "@".. liste [currentP] [math.random ( #liste[currentP] )]
  54.  
  55.  
  56.             tfm.exec.disableAutoShaman ( shaman [currentP] )
  57.            
  58.  
  59. print(currentP..' '..nextMap)
  60.  
  61.  
  62.  
  63.             tfm.exec.newGame ( nextMap )
  64.  
  65. end
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. function eventChatCommand ( name , action )
  84.  
  85.         if action == "next" then
  86.            
  87.             launchGame ( )
  88.  
  89.         end
  90.  
  91. end
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104. function eventLoop (past, remaining)
  105.  
  106.         if remaining < 500 or alive == 0 then
  107.             launchGame ( )
  108.         end
  109.  
  110. end
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117. function eventNewGame ( )
  118.        
  119.  
  120.         alive = #playerList
  121.  
  122.         tfm.exec.setGameTime( time[currentP] )
  123.         tfm.exec.disableAutoTimeLeft ( timeLeft[currentP] )
  124.  
  125. end
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132. function eventPlayerDied ( name )
  133.  
  134.         if currentP == "P3" or currentP == "P13" then
  135.             tfm.exec.respawnPlayer ( name )
  136.  
  137.         else
  138.             alive = alive - 1
  139.  
  140.         end
  141.  
  142. end
  143.  
  144.  
  145. function eventPlayerRespawn ( name )
  146.        
  147.         alive = alive + 1
  148.        
  149.  
  150. end
  151.  
  152.  
  153.  
  154.  
  155. function eventPlayerWon ( name )
  156.  
  157.         if currentP == "P18" then
  158.             tfm.exec.setGameTime ( 20 )
  159.            
  160.         elseif currentP == "P13" or currentP == "P3" then
  161.             tfm.exec.respawnPlayer ( name )
  162.            
  163.         end
  164.  
  165.         alive = alive - 1
  166.  
  167.    
  168. end
  169.  
  170.  
  171. function eventPlayerVampire ( name )
  172.  
  173.         alive = alive - 1
  174.  
  175. end
  176.  
  177.  
  178.  
  179.  
  180. function eventNewPlayer ( name )
  181.        
  182.         table.insert ( playerList, name )
  183.         print ( name.. " vient d'entrer dans le salon." )
  184.  
  185.         if currentP == "P3" or currentP == "P13" then
  186.             tfm.exec.respawnPlayer ( name )
  187.         end
  188.        
  189. end
  190.  
  191.  
  192.  
  193. function eventPlayerLeft ( name )
  194.  
  195.         for k, v in ipairs ( playerList ) do
  196.  
  197.             if playerList[k] == name then
  198.                 print(playerList[k])
  199.                 table.remove ( playerList, k )
  200.                
  201.                 print ( name.. " vient de quitter le salon." )
  202.                 break
  203.                
  204.             end
  205.         end
  206.  
  207.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement