Area801

Script Shaman Attack Transformice

Jan 13th, 2016
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.47 KB | None | 0 0
  1. admins={"Ilhaqjo","Ninguem"};
  2. data={};
  3. vivos=0;
  4.  
  5. -- Dar data
  6. for player in pairs(tfm.get.room.playerList) do
  7. newData={
  8. ["vidas"]=3;
  9. };
  10. data[player] = newData;
  11. end
  12. -- Mapas
  13. mapas={[[0]],[[1]],[[2]],[[3]],[[4]],[[5]],[[6]],[[11]],[[12]],[[13]],[[14]],[[15]],[[16]],[[17]],[[18]],[[19]],[[20]],[[21]],[[22]],[[24]],[[25]],[[26]],[[28]],[[29]],[[30]],[[31]],[[32]],[[33]],[[34]],[[35]],[[36]],[[37]],[[38]],[[39]],[[40]],[[41]],[[42]],[[43]],[[44]],[[45]],[[46]],[[47]],[[48]],[[49]],[[50]],[[51]],[[52]],[[53]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]],[[60]],[[61]],[[62]],[[63]],[[64]],[[65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76]],[[77]],[[78]],[[79]],[[80]],[[81]],[[82]],[[83]],[[84]],[[85]],[[86]],[[87]],[[88]],[[89]],[[90]],[[91]],[[92]],[[93]],[[95]],[[96]],[[97]],[[98]],[[99]],[[100]],[[110]],[[114]],[[115]],[[116]],[[117]],[[118]],[[119]],[[120]],[[121]],[[122]],[[123]],[[124]],[[125]],[[126]],[[127]],[[128]],[[129]],[[130]],[[131]],[[132]],[[133]],[[134]],[[136]],[[137]],[[138]],[[139]],[[140]],[[141]],[[142]],[[143]],[[200]],[[201]],[[202]],[[203]],[[204]],[[205]],[[206]],[[207]],[[208]],[[209]],[[210]]};
  14. -- Inicio do script
  15.  
  16. function eventPlayerWon(player)
  17. nextRound()
  18. tfm.exec.setPlayerScore(player,10,true)
  19. end
  20. system.disableChatCommandDisplay("skip", true)
  21. tfm.exec.disableAutoNewGame(true)
  22. tfm.exec.newGame(mapas[math.random(#mapas)])
  23. tfm.exec.disableAutoShaman(true)
  24. tfm.exec.disableAutoScore(true)
  25. tfm.exec.disableAllShamanSkills(true)
  26.  
  27. -- Novo round
  28.  
  29. function nextRound()
  30. tfm.exec.newGame(mapas[math.random(#mapas)]);
  31. tfm.exec.disableAllShamanSkills(true)
  32. end
  33.  
  34. -- NOVO JOGO se inicia
  35.  
  36. function eventNewGame()
  37. vivo=0
  38. for player in pairs(tfm.get.room.playerList) do
  39. data[player].vidas = 3;
  40. vivo=vivo+1
  41. tfm.exec.setShaman(player)
  42. end
  43. tfm.exec.setUIShamanName("Todos são shaman!")
  44. tfm.exec.setUIMapName("Shaman Attack");
  45. tfm.exec.disableAutoTimeLeft(true)
  46. tfm.exec.disableAllShamanSkills(true)
  47. tfm.exec.setGameTime([[303]])
  48. end
  49. -- Jogador morre
  50. function eventPlayerDied(player)
  51. data[player].vidas=data[player].vidas-1;
  52. if data[player].vidas >= 1 then
  53. tfm.exec.respawnPlayer(player)
  54. end
  55. if data[player].vidas <= 0 then
  56. vivo=vivo-1;
  57. end
  58. end
  59. -- Loop
  60. function eventLoop(tempoFaltando, tempoPassado)
  61. if vivo == 0 or tempoFaltando < 1000 then
  62. nextRound();
  63. end
  64. for player in pairs(tfm.get.room.playerList) do
  65. if data[player].vidas == 3 then
  66. tfm.exec.displayParticle(5,30,35,0,0, 0, 0, player)
  67. tfm.exec.displayParticle(5,60,35,0,0, 0, 0, player)
  68. tfm.exec.displayParticle(5,90,35,0,0, 0, 0, player)
  69. end
  70. if data[player].vidas == 2 then
  71. tfm.exec.displayParticle(5,30,35,0,0, 0, 0, player)
  72. tfm.exec.displayParticle(5,60,35,0,0, 0, 0, player)
  73. end
  74. if data[player].vidas == 1 then
  75. tfm.exec.displayParticle(5,30,35,0,0, 0, 0, player)
  76. end
  77. end
  78. end
  79. -- Novo jogador entra na partida
  80. function eventNewPlayer(player)
  81. newData={
  82. ["vidas"]=0;
  83. };
  84. data[player] = newData;
  85. ui.addTextArea(2,"<p align='center'><a href='event:open'>Ajuda</a></p>",player,700,20,40,20,1,1,0.5,true)
  86.  
  87. function eventTextAreaCallback(id, player, callback)
  88.  
  89. if callback == "close" then
  90. ui.removeTextArea(2, player)
  91. ui.removeTextArea(4, player)
  92. ui.addTextArea(2,"<p align='center'><a href='event:open'>Abrir</a></p>",player,700,20,40,20,1,1,0.5,true)
  93. end
  94. if callback == "open" then
  95. ui.removeTextArea(4, player)
  96. ui.addTextArea(2,"<br><font size='18'>Ajuda</font><br><br>Nunca ninguém pensou isso. Todos neste mundo são shamans, e querem dominar o mundo. Tente matar todos os outros, ganhando a partida!<br><br>Envie o seu mapa agora no Forum, Subseção Modules, na Galeria do Ilhaqjo ou então /w Ilhaqjo<br><br>Rotação de mapas será melhorada em Breve<br><br>Shaman Attack & Company<br><br><b>Mini-game feito por: Ilhaqjo</b><br><br><b>Sistema de Vidas: Brenower</b><br>",player,50,60,700,300,1,1,0.8,true)
  97. ui.addTextArea(4,"<p align='center'><a href='event:close'>Fechar</a></p>",player,20,375,760,20,1,1,0.8,true)
  98. end
  99. end
  100. end
  101.  
  102. -- Um item é invocado
  103. function eventSummoningEnd(player,id,x,y,ang,xs,ys,other)
  104. if id == 28 then
  105. tfm.exec.removeObject(other.id)
  106. if id == 2 then
  107. tfm.exec.removeObject(other.id)
  108. if id == 1 then
  109. tfm.exec.removeObject(other.id)
  110. end
  111. end
  112. end
  113. end
  114. -- Comandos
  115. function isAdm(nome)
  116. for i, v in pairs(admins) do
  117. if v == nome then
  118. return true
  119. end
  120. end
  121. return false
  122. end
  123. function eventChatCommand(nome, cmd)
  124. if cmd=="skip" and isAdm(nome) then
  125. tfm.exec.newGame(mapas[math.random(#mapas)])
  126. end
  127. end
  128.  
  129. ui.addTextArea(2,"<p align='center'><a href='event:open'>Ajuda</a></p>",player,700,20,40,20,1,1,0.5,true)
  130.  
  131. function eventTextAreaCallback(id, player, callback)
  132.  
  133. if callback == "close" then
  134. ui.removeTextArea(2, player)
  135. ui.removeTextArea(4, player)
  136. ui.addTextArea(2,"<p align='center'><a href='event:open'>Abrir</a></p>",player,700,20,40,20,1,1,0.5,true)
  137. end
  138. if callback == "open" then
  139. ui.removeTextArea(4, player)
  140. ui.addTextArea(2,"<br><font size='18'>Ajuda</font><br><br>Nunca ninguém pensou isso. Todos neste mundo são shamans, e querem dominar o mundo. Tente matar todos os outros, ganhando a partida!<br><br>Envie o seu mapa agora no Forum, Subseção Modules, na Galeria do Ilhaqjo ou então /w Ilhaqjo<br><br>Rotação de mapas será melhorada em Breve<br><br>Shaman Attack & Company<br><br><b>Mini-game feito por: Ilhaqjo</b><br><br><b>Sistema de Vidas: Brenower</b><br>",player,50,60,700,300,1,1,0.8,true)
  141. ui.addTextArea(4,"<p align='center'><a href='event:close'>Fechar</a></p>",player,20,375,760,20,1,1,0.8,true)
  142. end
  143. end
Advertisement
Add Comment
Please, Sign In to add comment