Mousetat

Retro Survivor by Eshkation

Jan 7th, 2017
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.40 KB | None | 0 0
  1. --[[ OLDSURVIVOR, escrito por eshkation ]]--
  2. tfm.exec.disableAllShamanSkills(true)
  3. tfm.exec.disableAutoShaman(true)
  4. tfm.exec.disableAutoNewGame(true)
  5.  
  6. system.maps = {
  7. {2644055, "151216fa793.png", 0, -2, 999},
  8. {2644040, "1512176c14f.png", 0, -2, 999},
  9. {2644273, "151217fd47a.png", 0, -2, 999},
  10. {2644268, "151218194c7.png", 0, -2, 999},
  11. {2644264, "15121844a01.png", 0, -2, 999},
  12. {2644260, "1512185bfff.png", 2, -2, 999},
  13. {2644248, "15121897b2e.png", 0, -2, 999},
  14. {2644246, "151218cee5f.png", 0, -2, 999},
  15. {2644229, "151218e737c.png", 0, -2, 999},
  16. {2644226, "15121906391.png", 0, -2, 999},
  17. {2644222, "1512192bca9.png", 0, -2, 6},
  18. {2644212, "1512195b56a.png", 0, -2, 999},
  19. {2644199, "1512196ee98.png", 0, -2, 999},
  20. {2644171, "15121987e04.png", 0, -2, 2},
  21. {2644164, "1512199d51d.png", 0, -2, 999},
  22. {2644153, "151219c3718.png", 0, -2, 999},
  23. {2644150, "15121a01814.png", 0, -2, 999},
  24. {2644117, "15121a11450.png", 0, -2, 999},
  25. {2644108, "1512524c2d9.png", 0, -2, 999},
  26. {2644090, "151223c3bb4.png", 0, -3, 999},
  27. {2644074, "151223e43f0.png", 0, -25, 999},
  28. {2644065, "15122410feb.png", 0, -2, 999},
  29. {2644060, "1512243226f.png", 0, -2, 999},
  30. {2644026, "15122494505.png", -6, -13, 999},
  31. {2644019, "151224e0d27.png", 0, -2, 999},
  32. {2644028, "15125270d51.png", 0, -2, 999},
  33. {2644017, "15125282e49.png", 0, -2, 999},
  34. {2644015, "15125295aa0.png", 0, -2, 999},
  35. {2644010, "151252ae7fe.png", 0, -2, 999},
  36. {2644007, "151252b9fa9.png", 0, -2, 999},
  37. {2644004, "151252c5014.png", 0, -2, 999},
  38. {2644001, "1512530727a.png", 0, -62, 999},
  39. {2643998, "15125338b29.png", -2, -2, 999},
  40. {2643993, "15125361f21.png", -3, -2, 999},
  41. {2643985, "1512537707b.png", -2, -2, 999},
  42. {2643980, "15125383cec.png", -3, -2, 999},
  43. {2643977, "151253a30d7.png", 0, -2, 999},
  44. {6359710, "151253c1ee5.png", -2, -20, 999},
  45. {2643968, "151253f357a.png", -2, -20, 999},
  46. {2643966, "1512540110b.png", -2, -20, 999},
  47. {2643964, "15125414f94.png", -8, -19, 999},
  48. {2643955, "1512543ecb1.png", -8, -19, 999},
  49. {2643952, "15125447b14.png", -8, -19, 999},
  50. {2643948, "15125453b17.png", -8, -19, 999},
  51. {2643946, "1512ae198e5.png", -8, -2, 999},
  52. {2643943, "1512ae31b53.png", -8, -2, 999},
  53. {2643940, "1512ae3f71b.png", -8, -2, 999},
  54. {2643935, "1512ae4a995.png", -8, -2, 999},
  55. {2643931, "1512ae5de0a.png", -8, -2, 999},
  56. {2643926, "1512ae6b258.png", -8, -2, 999},
  57. {2643923, "1512ae7e0e6.png", -8, -2, 999},
  58. {2643920, "1512ae934eb.png", -8, -2, 999},
  59. {2643914, "1512ae9dfaf.png", -8, -2, 999},
  60. {2643909, "1512aea9fc4.png", -8, -2, 999},
  61. {2643907, "1512aeb7d58.png", -8, -2, 999},
  62. {2643904, "1512aec7142.png", -8, -2, 999},
  63. {2643899, "1512aed34b0.png", -8, -2, 999},
  64. {2643896, "1512af8a81a.png", -8, -2, 999},
  65. {2643892, "1512af9e409.png", -8, -2, 999},
  66. {2643889, "1512afaeb5a.png", -8, -2, 999},
  67. {2643886, "1512afcbc8e.png", -8, -2, 999},
  68. {2643884, "1512aff0c4e.png", -8, -2, 999},
  69. {2643875, "1512b00839c.png", -8, -2, 999},
  70. {2643870, "1512b0269b7.png", -8, -2, 999},
  71. {2643864, "1512b0555f4.png", -8, -2, 999},
  72. {2643856, "1512b075891.png", -8, -2, 999},
  73. {2643849, "1512b07c486.png", -8, -2, 999},
  74. {2643846, "1512b08391d.png", -8, -2, 999},
  75. {2643839, "1512b0a130e.png", -8, -2, 999},
  76. {2643833, "1512b0af4c9.png", -8, -2, 999},
  77. {2643829, "1512b0b950b.png", -8, -2, 999},
  78. {2643824, "1512b0cee70.png", -8, -2, 999},
  79. {2643820, "1512b0df456.png", -8, -2, 999},
  80. {2643816, "1512b0e91ea.png", -8, -2, 999},
  81. {2643804, "1512b0f2a46.png", -8, -2, 999},
  82. {2643799, "1512b0fbe29.png", -8, -2, 999},
  83. {2643792, "1512b107b0c.png", -8, -2, 999}
  84. }
  85.  
  86. system.messages = {
  87. translations = {
  88. en = {
  89. newShaman = {"Get them tiger! *-*", "whisper"},
  90. oneMiceRemain = {"Good job, <ROSE>%s<N>, your turn now!", "modchat"},
  91. newShamanTurn = {"Beware of <ROSE>%s<N>!", "modchat"},
  92. timeLeft = {"Time's up, <ROSE>%s<N> failed. ^_^", "modchat"},
  93. newPlayer = {"Welcome to oldsurvivor, type !help on chat to get help.", "whisper"},
  94. shamanDied = {"Awww, <ROSE>%s<N> died! T-T", "modchat"},
  95. helpMessage = {"Welcome to the old survivor room!\n- No meep and shortcurts\n- No divine mode\n- No skills!\nTry to survive the shaman to become the next to kill the mice! Bugs? report to Eshkation!", "whisper"},
  96. divineNotAllowed = {"<ROSE>Shaman divine mode isn't allowed here, please change your shaman mode in order to play."}
  97. },
  98. br = {
  99. newShaman = {"Pegue-os tigrão! *-*", "whisper"},
  100. oneMiceRemain = {"Bom trabalho, <ROSE>%s<N>, agora é seu turno!", "modchat"},
  101. newShamanTurn = {"Cuidado com <ROSE>%s<N>!", "modchat"},
  102. timeLeft = {"Acabou o tempo, <ROSE>%s<N> falhou. ^_^", "modchat"},
  103. newPlayer = {"Bem vindo a oldsurvivor, digite !help no chat para obter ajuda.", "whisper"},
  104. shamanDied = {"Awww, <ROSE>%s<N> morreu! T-T", "modchat"},
  105. helpMessage = {"Bem-vindo a sala old survivor!\n- Sem meep e atalhos\n- Sem modo divino\n- Sem habilidades !\nTente sobreviver ao shaman para se tornar o próximo a matar os ratos! Bugs? Reporte ao Eshkation!", "whisper"},
  106. divineNotAllowed = {"<ROSE>Modo divino não é permitido aqui, por favor mude o seu modo shaman para jogar."}
  107. },
  108. es = {
  109. newShaman = {"¡matarlos tigre! *-*", "whisper"},
  110. oneMiceRemain = {"Buen trabajo, <ROSE>%s<N>, ahora es tu turno!", "modchat"},
  111. newShamanTurn = {"Cuidado con <ROSE>%s<N>!", "modchat"},
  112. newPlayer = {"Bienvenido a oldsurvivor, tipo !help en el chat para información.", "whisper"},
  113. shamanDied = {"Awww, <ROSE>%s<N> murió! T-T", "modchat"},
  114. helpMessage = {"Bem-vindo a sala old survivor!\n- Sem meep e atalhos\n- Sem modo divino\n- Sem habilidades !\nSé el último ráton en pie para ser el próximo shaman! Bugs? Reporte ao Eshkation!", "whisper"},
  115. divineNotAllowed = {"<ROSE>Shaman divine mode isn't allowed here, please change your shaman mode in order to play."}
  116. },
  117. tr = {
  118. newShaman = {"Onları Yok Et Kaplan! *-*", "whisper"},
  119. oneMiceRemain = {"İyi iş çıkardın, <ROSE>%s<N>, diğer tura geçtin!", "modchat"},
  120. newShamanTurn = {"Şaman <ROSE>%s<N>, dikkat edin!", "modchat"},
  121. timeLeft = {"Zaman doldu, <ROSE>%s<N> ne yazıkki başarısız oldun. ^_^", "modchat"},
  122. newPlayer = {"Oldsurvivor odasına hoş geldin, yardım almak için !help komutunu kullanabilirsin.", "whisper"},
  123. shamanDied = {"Ahhh Hayır!, <ROSE>%s<N> öldü! T-T", "modchat"},
  124. helpMessage = {"Oldsurvivor Odasına Hoş Geldin.\n- Kısayol ve Meep yok!\n- Kutsal Mod yok!\n- Beceriler yok!\nFareleri öldürün ve bir sonraki Şaman olmak için hayatta kalmaya çalışın! Bug ve Hatalar için Eshkation ile iletişime geçin!", "whisper"},
  125. divineNotAllowed = {"<ROSE>İlahi Modu ile oynamak istiyorsunuz fakat buna izin verilmiyor.Lütfen Şaman modunuzu değiştirin."}
  126. },
  127. },
  128. types = {
  129. modchat = "<ROSE>• [%s] <N>",
  130. whisper = '<CEP>> [%s] [<CE>%s<CEP>]'
  131. }
  132. }
  133.  
  134. system.info = {
  135. botname = "Oldsurvivor",
  136. actualShaman = "Honk"
  137. }
  138. system.roundRunning = false
  139. system.mapindex = false
  140.  
  141. function eventNewPlayer(player)
  142. print(player)
  143. str = system.translate("newPlayer")
  144. tfm.exec.chatMessage(string.format(system.messages.types.whisper, str), player)
  145. if (system.mapindex) then
  146. img = system.maps[system.mapindex]
  147. tfm.exec.addImage(img[2], "_999"..img[5], 0+img[3], 20+img[4], nil)
  148. end
  149. end
  150.  
  151. function eventNewGame()
  152. system.announceNewShaman()
  153. system.killPlayersDivineMode()
  154. system.roundRunning = true
  155. end
  156.  
  157. function eventChatCommand(player, command)
  158. if (command == "help") then
  159. str = system.translate("helpMessage")
  160. tfm.exec.chatMessage(string.format(system.messages.types.whisper, str), player)
  161. end
  162. end
  163.  
  164. function eventLoop(timeElapsed, timeRemain)
  165. timeRemain = math.ceil(timeRemain/1000)
  166. if (timeRemain == 2) then
  167. if (system.roundRunning) then
  168. str = string.format(system.translate("timeLeft"), system.info.actualShaman)
  169. tfm.exec.chatMessage(string.format(system.messages.types.modchat, str), nil)
  170. system.info.actualShaman = system.getRandomAlivePlayer()
  171. end
  172. system.chooseNewMap()
  173. end
  174. end
  175.  
  176. function eventPlayerDied(player)
  177. if (player == system.info.actualShaman) then
  178. if (system.roundRunning) then
  179. system.roundRunning = false
  180. str = string.format(system.translate("shamanDied"), system.info.actualShaman)
  181. tfm.exec.chatMessage(string.format(system.messages.types.modchat, str), nil)
  182. system.info.actualShaman = system.getRandomAlivePlayer()
  183. tfm.exec.setGameTime(7)
  184. end
  185. else
  186. if (system.roundRunning) then
  187. alives = system.getAlivePlayers()
  188. if (alives[1] == 1) then
  189. system.roundRunning = false
  190. system.info.actualShaman = alives[2][1]
  191. str = string.format(system.translate("oneMiceRemain"), alives[2][1])
  192. tfm.exec.chatMessage(string.format(system.messages.types.modchat, str), nil)
  193. tfm.exec.setGameTime(7)
  194. elseif (alives[1] == 0) then
  195. system.roundRunning = false
  196. str = string.format(system.translate("oneMiceRemain"), system.info.actualShaman)
  197. tfm.exec.chatMessage(string.format(system.messages.types.modchat, str), nil)
  198. tfm.exec.setGameTime(7)
  199. end
  200. end
  201. end
  202. end
  203.  
  204. function eventSummoningEnd(player, objectType, xPosition, yPosition, angle, objectDescription)
  205. objectType = objectType..""
  206. if (objectType:sub(0,2) == "17") then
  207. tfm.exec.addImage("151183b1405.png", "#"..objectDescription.id, -15, -15)
  208. else
  209. if (string.len(objectType) > 2) then
  210. objectType = objectType:sub(1, -3)
  211. end
  212. allowedObjects = {[0] = true, [1] = {"1511d263d61.png", -15, -15}, [2] = {"1511d274f0e.png", -30, -30}, [3] = {"1511d292941.png", -50, -5}, [4] = {"1511d29afba.png", -100, -5}, [6] = true, [7] = true, [10] = true, [24] = true, [26] = true, [27] = true, [28] = true, [32] = true}
  213. if not (allowedObjects[objectType+0]) then
  214. tfm.exec.removeObject(objectDescription.id)
  215. else
  216. -- http://images.atelier801.com/1511d2a494d.png
  217. if not (allowedObjects[objectType+0] == true) then
  218. data = allowedObjects[objectType+0]
  219. tfm.exec.addImage(data[1], "#"..objectDescription.id, data[2], data[3])
  220. end
  221. end
  222. end
  223. end
  224.  
  225. function system.getRandomAlivePlayer()
  226. alives = {}
  227. for player, data in pairs(tfm.get.room.playerList) do
  228. if not (data.isDead) then
  229. if not (data.isShaman) then
  230. table.insert(alives, player)
  231. end
  232. end
  233. end
  234. mouse = alives[math.random(#alives)]
  235. if (mouse == nil) then
  236. mouse = system.info.actualShaman
  237. end
  238. return mouse
  239. end
  240.  
  241. function system.getAlivePlayers()
  242. alives = {}
  243. for player, data in pairs(tfm.get.room.playerList) do
  244. if not (data.isDead) then
  245. if not (data.isShaman) then
  246. table.insert(alives, player)
  247. end
  248. end
  249. end
  250. return {#alives, alives}
  251. end
  252.  
  253. function system.killPlayersDivineMode()
  254. for player, data in pairs(tfm.get.room.playerList) do
  255. if (data.shamanMode == 2) then
  256. str = system.translate("divineNotAllowed")
  257. tfm.exec.chatMessage(str, player)
  258. tfm.exec.killPlayer(player)
  259. end
  260. end
  261. end
  262.  
  263. function system.announceNewShaman()
  264. tfm.exec.setShaman(system.info.actualShaman)
  265. ui.setShamanName(system.info.actualShaman)
  266. str = system.translate("newShaman")
  267. tfm.exec.chatMessage(string.format(system.messages.types.whisper, str), system.info.actualShaman)
  268. str = string.format(system.translate("newShamanTurn"), system.info.actualShaman)
  269. tfm.exec.chatMessage(string.format(system.messages.types.modchat, str), nil)
  270. end
  271.  
  272. function system.chooseNewMap()
  273. system.mapindex = math.random(#system.maps)
  274. tfm.exec.newGame(system.maps[system.mapindex][1])
  275. img = system.maps[system.mapindex]
  276. tfm.exec.addImage(img[2], "_999"..img[5], 0+img[3], 20+img[4], nil)
  277. end
  278.  
  279. function system.translate(key)
  280. community = string.lower(tfm.get.room.community)
  281. if not (system.messages.translations[community]) then
  282. community = "en"
  283. end
  284. if (system.messages.translations[community][key]) then
  285. return system.messages.translations[community][key][1]
  286. else
  287. return "$"..key
  288. end
  289. end
  290.  
  291. function system.getHighestScore()
  292. high = {"souris", -1}
  293. for player, data in pairs(tfm.get.room.playerList) do
  294. if (data.score >= high[2]) then
  295. high = {player, data.score}
  296. end
  297. end
  298. return high[1]
  299. end
  300.  
  301. function MAIN()
  302. system.messages.types.whisper = string.format(system.messages.types.whisper, tfm.get.room.community, system.info.botname).." %s"
  303. system.messages.types.modchat = string.format(system.messages.types.modchat, system.info.botname).."%s"
  304. for player, data in pairs(tfm.get.room.playerList) do
  305. eventNewPlayer(player)
  306. end
  307. system.info.actualShaman = system.getHighestScore()
  308. system.chooseNewMap()
  309. end
  310.  
  311. MAIN()
Advertisement
Add Comment
Please, Sign In to add comment