Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.77 KB | None | 0 0
  1. ------------------------
  2. -- @Version: 4.9
  3. -- @OBS1: Bug da flecha para a esquerda corrigido.
  4. -- @OBS2: Corrigido, apenas os Hunters jogam as flechas
  5. -- @OBS3: A barra de vida diminui.
  6. -- @OBS4: Adicionado rotação de mapas.
  7. -- @OBS5: Adicionado Skills.
  8.  
  9. --[[ Disable ]]--
  10.  
  11. for _, v in next, {'AutoShaman', 'AutoNewGame', 'AutoTimeLeft', 'PhysicalConsumables', 'AfkDeath', 'MortCommand', 'AutoScore'} do
  12. tfm.exec['disable' .. v]()
  13. end
  14.  
  15. tfm.exec.chatMessage =print
  16. -------------------------------
  17.  
  18. --[[ Script data ]]--
  19.  
  20. newData = {}
  21. tempo = os.time()
  22. maps = {7308494,7308488,7311388,7314824}
  23. p = {}
  24. hunters=0
  25. monsters=0
  26. playerRoom = 0
  27. local hunters = {}
  28. local monsters = {}
  29.  
  30. deleteObject={}
  31.  
  32. SkillHunter = true
  33. SkillMonster = true
  34.  
  35. --- @System Translations
  36.  
  37. translations = {
  38. en = { -- br = Brasil = Pt_br = Português brasil.
  39. welcome = "Bem-vindo ao #DeaddlyHunt. Utilize os atalhos: H [Help], P [Perfil], T [Atualizações]",
  40. tab_profile = "Perfil",
  41. tab_Howtoplay = "Como jogar?",
  42. tab_help = "Para mais informações pressione [H]",
  43. tab_requiredXP = "XP Requerido",
  44. tab_title = "Titulo",
  45. tab_Level = "Nivel",
  46. tab_healing = "Cura",
  47. tab_LevelNext = "Você agora é nível",
  48. tab_victoriesHunter = "Vitorias sendo Caçador",
  49. tab_victoriesMonsters = "Vitorias sendo Monstro",
  50. tab_MonsterRed = "<R><B>Você nasceu como um Monster! Tire a energia dos Caçadores!!</B></R>",
  51. tab_HunterBlue = "<BV><B>Você nasceu como um caçador! Fleche os Monstros!!</B></BV>",
  52. tab_helpStarGame1 = "<font size='15'>Seja bem-vindo ao mini game #Deadlyhunt, aprenda abaixo como jogar.: <br><B><R>Se você é um Monstro</R></B>: Você é o todo poderoso Monstro Vermelho, possui apenas [3] vidas e deve ir atrás dos jogadores azuis (Caçadores), corram atrás deles e pressionem [ESPAÇO] ou pressionem [↓] para remover a energia vital deles. Utilize sua skill Apagão para afetar a tela dos caçadores. <br><B><BV>Se você é um Caçador</BV></B>: Você é o Salvador da humanidade e deve usar suas incríveis flechas para lançar os monstros para fora do mapa, se as coisas começarem a ficar difíceis você pode usar sua Skill de cura uma vez por rodada e aumentar um pouco mais sua vida para que você e seu time possam vencer.</font>",
  53. tab_helpStarGame2 = "<font size='15'><i>Livro de mágicas:</i>\n<b>livros especiais que liberam as classes e novos poderes na loja.</b></font>",
  54. tab_helpStarGame3 = "<font size='14'><i>Cartas/missões:</i>\n<b>quando sua classe chegar ao limite de bônus, você recebe uma carta com missões, para a conquista de uma nova classe. E novos clãs.</b></font>",
  55. tab_SkillUsedHunter = "<B>Você está com + 30% de energia! Poderá usar essa skill temporaria, novamente na proxima rodada!</B>",
  56. tab_SkillUsedMonster = "<B>Você alterou a visão dos caçadores! Poderá usar essa skill temporaria, novamente na proxima rodada!</B>",
  57. tab_AffectedHunter = "<B>Sua visão foi afetada por um monstro!</B>",
  58. tab_SkillHunterName = "Saúde",
  59. tab_SkillMonsterName = "Apagão",
  60. close = "Fechar",
  61. },
  62.  
  63. br = { -- en = English = Inglês
  64. welcome = "Welcome to #DeaddlyHunt. Use the shortcuts: H [Help], P [Profile], T [Updates]",
  65. tab_profile = "Profile",
  66. tab_Howtoplay ="How to play?",
  67. tab_help = "For more information press H",
  68. tab_requiredXP = "Required XP",
  69. tab_title = "Title",
  70. tab_Level = "Level",
  71. tab_healing = "healing",
  72. tab_LevelNext = "You are now level",
  73. tab_victoriesHunter = "Hunters win!",
  74. tab_victoriesMonsters = "Monsters win!",
  75. tab_MonsterRed = "<R><B>You are a Monster! Kill the hunters!!</B></R>",
  76. tab_HunterBlue = "<BV><B>You are a Hunter! Shoot an arrow to the Monsters!!</B></BV>",
  77. tab_helpStarGame1 = "<font size='13'>Welcome to #Deadlyhunt. How to play:<R>Monster:</R> Duck near a Hunter to attack [↓] and you have 3 lives. <li><BV>Hunter:</BV></li> When you're running towards a monster press [SPACE] to attack with arrows, but be aware that it can also damage your teammates. \n<B>Game Modes:</b>\n<li> <R>Aie</R></li>: In aie mode, you can not fall from great heights, otherwise you will get killed! Watch out! <li><BV>Normal</BV></li>: Normal mode without any modifications.</font>\n\n<p align='center'><I><U>More games modes coming soon!</p>",
  78. tab_helpStarGame2 = "<font size='15'><i>SpellBook:</i>\n<b>special books that release classes and new powers in the store.</b></font>",
  79. tab_helpStarGame3 = "<font size='14'><i>Letters/missions:</i>\n<b>When your class get to the bonus limit, you receive a letter with missions, to the conquest of a new class.</b></font>",
  80. tab_SkillUsedHunter = "<B>You have + 30% energy! You can use this temporary skill again in the next round!</B>",
  81. tab_SkillUsedMonster = "<B>You changed the vision of the hunters! You can use this temporary skill again in the next round!</B>",
  82. tab_AffectedHunter = "<B>Your vision was affected by a monster!</B>",
  83. tab_SkillHunterName = "health",
  84. tab_SkillMonsterName = "blackout",
  85. close = "Close",
  86. }
  87. }
  88.  
  89. -----------------------------
  90. -- @System que define quem ganha a partida
  91. --
  92. ---------------------------------
  93.  
  94. function eventLoop(currentTime,timeRemaining)
  95. for _,obj in ipairs(deleteObject) do
  96. if obj.time < os.time()-1000 then
  97. tfm.exec.removeObject(obj.id)
  98. table.remove(deleteObject,_)
  99. end
  100. end
  101.  
  102. if (timeRemaining <= 20000 or hunters == 0 or monsters == 0) and timeRemaining >= 19500 then
  103. local victory=""
  104.  
  105. if hunters > monsters then
  106. victory="Hunter"
  107. tfm.exec.giveCheese(i)
  108. tfm.exec.playerVictory(i)
  109. elseif monsters > hunters then
  110. victory="Monster"
  111. elseif monsters == hunters then
  112. victory="none"
  113. end
  114.  
  115. for i,v in pairs(tfm.get.room.playerList) do
  116. if newData[i].Team == victory then
  117. tfm.exec.giveCheese(i)
  118. tfm.exec.playerVictory(i)
  119. else
  120. if v.isDead then
  121. tfm.exec.respawnPlayer(i)
  122. end
  123. end
  124. if victory == "none" then
  125. tfm.exec.killPlayer(i)
  126. end
  127. end
  128.  
  129. partidaTerminou=true
  130. tfm.exec.newGame(maps[math.random(#maps)])
  131. end
  132. end
  133. ----------------------
  134. -- <procedure>
  135. -- Sistema de teams
  136. -- @Define se o jogador é do time red ou blue.
  137. ----------------------
  138. function eventNewGame()
  139. hunters=0
  140. monsters=0
  141. teamtime=math.random(0,1)
  142. for p,n in pairs(tfm.get.room.playerList) do
  143. if teamtime == 0 then
  144. newData[p].Team = "Monster"
  145. tfm.exec.setNameColor(p, 0xCB546B) -- color red
  146. tfm.exec.chatMessage(""..translations[newData[p].lang].tab_MonsterRed.."",p)
  147. ui.removeTextArea(0,p)
  148. ui.removeTextArea(2,p)
  149. ui.removeTextArea(3,p)
  150. ui.removeTextArea(4,p)
  151. ui.removeTextArea(5,p)
  152. ui.removeTextArea(5000,p)
  153. ui.removeTextArea(5001,p)
  154. SkillMonster = true
  155. newData[p].LifeMonster=3
  156. tfm.exec.movePlayer(p,73,234,false,0,0,false)
  157. teamtime=1
  158. monsters=monsters+1
  159. else
  160. newData[p].Team = "Hunter"
  161. tfm.exec.setNameColor(p, 0x2F7FCC)
  162. tfm.exec.chatMessage(""..translations[newData[p].lang].tab_HunterBlue.."",p)
  163. ui.removeTextArea(50,p)
  164. ui.removeTextArea(51,p)
  165. ui.removeTextArea(001,p)
  166. ui.removeTextArea(002,p)
  167. ui.removeTextArea(003,p)
  168. ui.removeTextArea(004,p)
  169. SkillHunter = true
  170. newData[p].Life = 100
  171. tfm.exec.movePlayer(p,1500,250,false,0,0,false)
  172. teamtime=0
  173. hunters=hunters+1
  174. end
  175. LifeStatus(p)
  176. --eventPlayerDied(p)
  177. LifeStatusMonster(p)
  178. tfm.exec.newGame(maps[math.random(#maps)])
  179. tfm.exec.setGameTime(120)
  180. end
  181. end
  182.  
  183. -------------------------------
  184. -- @Jogador sobe de nível
  185. -- @
  186. -------------------------------
  187. function SubLevel(name,xp)
  188. newData[name].XpLevel = newData[name].XpLevel + XpLevel
  189. if newData[name].XpLevel >= 100 then
  190. newData[name].XpLevel = 100
  191. newData[name].Level = newData[name].Level + 1
  192. newData[name].XpLevel = newData[name].XpLevel - 100
  193. end
  194. end
  195. -------------------------------
  196. -- @ Sistema de jogar flechas
  197. -- @ Os caçadores atiram flechas
  198. --------------------------------
  199. function balls(name)
  200. if k == 32 and tfm.get.room.playerList[p].isFacingRight == true and info[p].time < os.time()-1500 then
  201. info[p].time = os.time()
  202. tfm.exec.movePlayer(p,0,0,true,100,0,false)
  203. elseif k == 32 and tfm.get.room.playerList[p].isFacingRight == false and info[p].time < os.time()-1500 then
  204. info[p].time = os.time()
  205. tfm.exec.movePlayer(p,0,0,true,-100,0,false)
  206. end
  207.  
  208. local facingLeft = {}
  209.  
  210. for name in pairs(tfm.get.room.playerList) do
  211. for _,key in pairs{0,2,3,32} do
  212. system.bindKeyboard(name, key, true)
  213. end
  214. end
  215. end
  216.  
  217. function eventKeyboard(name, key, down, x, y)
  218. if key == 3 and newData[name].tempo < os.time()-1050 then
  219. if newData[name].Team ~= "Monster" then
  220. newData[name].tempo = os.time();
  221.  
  222. if tfm.get.room.playerList[name].isFacingRight then
  223. obj_id = tfm.exec.addShamanObject(35, x+20, y, 0, 20)
  224. else
  225. obj_id = tfm.exec.addShamanObject(35, x-20, y, 0, -20)
  226. end
  227.  
  228. table.insert(deleteObject,{id=obj_id,time=os.time()})
  229. else
  230. eventKeyboard(name,32,down,x,y)
  231. end
  232. end
  233.  
  234. if key == 32 and newData[name].Team == "Monster" then
  235. for n,player in pairs(tfm.get.room.playerList) do
  236. if name ~= n and newData[n].Team ~= "Monster" and newData[n].Life ~= 0 and x >= player.x - 15 and x <= player.x + 15 and y >= player.y - 15 and y <= player.y + 15 then
  237. newData[n].Life = newData[n].Life - math.random(0,3)
  238. tfm.exec.displayParticle(5,x,y,-0.2,-0.2,0,0)
  239. LifeStatus(n)
  240. break
  241. end
  242. end
  243. end
  244. end
  245.  
  246. -------------------------------------------------
  247. -- @Local de armazenamento de dados dos jogadores.
  248. -- @
  249. --------------------------------------------------
  250. function eventNewPlayer(name)
  251. newData[name] = {
  252. Team = "",
  253. Xp = 0,
  254. XpLevel = 0,
  255. Level = 0,
  256. Life = 100,
  257. lang = "",
  258. LifeMonster = 3,
  259. winHunter = 0,
  260. winMonster = 0,
  261. tempo = os.time()
  262. }
  263. newData[name].lang = translations[tfm.get.room.playerList[name].community] and tfm.get.room.playerList[name].community or 'en' -- define a linguagem do jogador
  264. balls("Hpassos")
  265.  
  266. -----------------------
  267. -- @TextAreas do jogo.
  268. -- @TextAras do Xp/Mana
  269. -----------------------
  270. -- @TextAra dos dados dos player [Profile] / [Help]
  271. LifeStatus(name)
  272. ui.addTextArea(200, "", name, 9, 27, 22, 20, 0x2b8a34, 0x2b8a34, 1, true)
  273. ui.addTextArea(201, "<p align='center'><a href='event:help'><B>H</B></a></p>", name, 9, 27, 22, 20, 0x313a4a, 0x313a4a, 0.6, true)
  274. --ui.addTextArea(202, "", name, 44, 27, 22, 20, 0x2b8a34, 0x2b8a34, 1, true)
  275. --ui.addTextArea(203, "<p align='center'><a href='event:help'><B>H</B></a></p>", name, 44, 27, 22, 20, 0x313a4a, 0x313a4a, 0.6, true)
  276. end
  277. -------------------------------
  278. -- @EventTextAreaCallback
  279. -- @
  280. -------------------------------
  281. function eventTextAreaCallback(t,p,link)
  282. if link == [[profile]] then
  283. ui.addTextArea(40, "", p, 226, 37, 306, 205, 0x313a4a, 0x313a4a, 1, true)
  284. ui.addTextArea(41, "<font size='15'><p align='center'>"..p.."<b></p>", p, 226, 37, 306, 25, 0x2c3438, 0x2c3438, 1, true)
  285. ui.addTextArea(42, ""..translations[newData[p].lang].tab_victoriesHunter.."", p, 228, 74, 132, 20, 0x313a4a, 0x313a4a, 1, true)
  286. ui.addTextArea(43, "<font size='15'><p align='center'>"..newData[p].winHunter.."/1000<b></p>", p, 228, 100, 166, 22, 0x375361, 0x2c3438, 1, true)
  287. ui.addTextArea(44, ""..translations[newData[p].lang].tab_victoriesMonsters.."", p, 229, 134, 141, 20, 0x313a4a, 0x313a4a, 1, true)
  288. ui.addTextArea(45, "<font size='15'><p align='center'>"..newData[p].winMonster.."/1000<b></p>", p, 228, 161, 166, 22, 0x375361, 0x2c3438, 1, true)
  289. ui.addTextArea(46, ""..translations[newData[p].lang].tab_title.."", p, 427, 74, 100, 20, 0x313a4a, 0x313a4a, 1, true)
  290. ui.addTextArea(47, "<font size='15'><p align='center'><b></p>", p, 416, 100, 109, 22, 0x375361, 0x2c3438, 1, true)
  291. ui.addTextArea(48, ""..translations[newData[p].lang].tab_Level.."", p, 419, 134, 108, 20, 0x313a4a, 0x313a4a, 1, true)
  292. ui.addTextArea(49, "<font size='15'><p align='center'>"..newData[p].XpLevel.."<b></p>", p, 418, 161, 108, 22, 0x375361, 0x2c3438, 1, true)
  293. ui.addTextArea(50, "<font size='15'><a href='event:closeprofile'><b><R>X</R></a>", p, 512, 37, 17, 25, 0x2c3438, 0x2c3438, 0, true)
  294. elseif link == [[closeprofile]] then
  295. for i = 40,50 do --
  296. ui.removeTextArea(i,p)
  297. end
  298. elseif link == [[help]] then
  299. ui.addTextArea(100, "", p, 79, 74, 641, 252, 0x313a4a, 0x313a4a, 1, true)
  300. ui.addTextArea(103, ""..translations[newData[p].lang].tab_helpStarGame1.."", p, 86, 86, 628, 227, 0x313a4a, 0x2c3438, 1, true)
  301. ui.addTextArea(104, "<font size='15'><a href='event:closehelp'><b><R>X</R></a>", p, 686, 87, 28, 30, 0x2c3438, 0x2c3438, 0, true)
  302. elseif link == [[closehelp]] then
  303. for i = 100,104 do
  304. ui.removeTextArea(i,p)
  305. end
  306. elseif link == [[SkillHunter2]] and newData[p].Team ~= "Monster" then
  307. print("Chamou")
  308. if SkillHunter then
  309. newData[p].Life = newData[p].Life + 30
  310. tfm.exec.chatMessage("<B>Você está com + 30% de energia! Poderá usar essa skill temporaria, novamente na proxima rodada!</B>",p)
  311. SkillHunter = false
  312. print(""..newData[p].Life.."")
  313. end
  314. LifeStatus(p)
  315. elseif link == [[SkillMonster1]] and newData[p].Team == "Monster" then
  316. if SkillMonster then
  317. for i,v in pairs(tfm.get.room.playerList) do
  318. if newData[i].Team == "Hunter" then
  319. ui.addTextArea(5000, "", i, -4599, -4799, 9999, 9999, 0x1a0000, 0x1a0000, 0.9, true)
  320. tfm.exec.chatMessage("<B>Sua visão foi afetada por um mostro! .</B>", i)
  321. end
  322. end
  323. tfm.exec.chatMessage("<B>Você afetou a visão dos caçadores! Poderá usar essa skill temporaria, novamente na proxima rodada!</B>",i)
  324. SkillMonster = false
  325. end
  326. end
  327. end
  328. ------------------------
  329. -- @Sistema interligados a Vida/energia
  330. --@
  331. ------------------------
  332. -- @Status
  333. -- @TextArea da vida do Monster.
  334. function LifeStatusMonster(name)
  335. if newData[name].Team == "Monster" then
  336. local color = "#de0707"
  337. if newData[name].LifeMonster == 2 then
  338. color = "#23a62a"
  339. elseif newData[name].LifeMonster == 1 then
  340. color = "#8c278c"
  341. elseif newData[name].LifeMonster == 0 then
  342. color = "#b09d30"
  343. end
  344. ui.addTextArea(51, "<font size='40' color='"..color.."'>❤</font><font size='26'><B>x"..newData[name].LifeMonster.."</B>", name, 16, 344, 100, 100, 0xde0707, 0x000000, 0, true)
  345. end
  346. end
  347. ---
  348. --@Status
  349. -- @System Status Hunter
  350. function LifeStatus(name)
  351. if newData[name].Team ~= "Monster" then
  352. if newData[name].Life <= 0 then
  353. newData[name].Life = 0
  354. tfm.exec.killPlayer(name)
  355. end
  356. local cod = 226
  357. if newData[name].Life > 100 then
  358. cod = 280
  359. else
  360. cod = 226
  361. end
  362. ui.addTextArea(0, "", name, 254, 372, (newData[name].Life*2.1), 10, 0x006191, 0x006191, 1, true)
  363. ui.addTextArea(1, "<p align='center'>"..newData[name].Life.."/100</p>", name, 252, 368, cod, 18, 0x324650, 0x000000, 0.4, true)
  364. ui.addTextArea(2, "", name, 715, 365, 69, 18, 0x2b8a34, 0x2b8a34, 1, true)
  365. ui.addTextArea(3, "<a href='event:SkillHunter2'><B><R>"..translations[newData[name].lang].tab_SkillHunterName.."</R></B></a>", name, 715, 365, 69, 18, 0x313a4a, 0x313a4a, 0.8, true)
  366. else
  367. ui.removeTextArea(0,name)ui.removeTextArea(1,name)
  368. end
  369. ----------
  370. --@Verifica se o jogador é MOnstro e lhe dá skills de monstros.
  371. if newData[name].Team ~= "Hunter" then
  372. ui.addTextArea(001, "", name, 715, 365, 69, 18, 0x2b8a34, 0x2b8a34, 1, true)
  373. ui.addTextArea(002, "<a href='event:SkillMonster1'><B><BV>"..translations[newData[name].lang].tab_SkillMonsterName.."</BV></B></a>", name, 715, 365, 69, 18, 0x313a4a, 0x313a4a, 0.8, true)
  374. end
  375. -- @Verifica se o jogado está com a energia abaixo de 50, e lhe dá o poder de meep!
  376. --@Monstro Morre renasce 3 vezes.
  377. end
  378.  
  379. function eventPlayerDied(name)
  380. if newData[name].Team == "Monster" then
  381. newData[name].LifeMonster = newData[name].LifeMonster - 1
  382. LifeStatusMonster(name)
  383. if newData[name].LifeMonster <= 0 then
  384. monsters=monsters-1
  385. tfm.exec.chatMessage("Acabaram-se todas as suas vidas :(", name)
  386. else
  387. tfm.exec.respawnPlayer(name)
  388. tfm.exec.movePlayer(name,73,234,false,0,0,false)
  389. end
  390. else
  391. if newData[name].Life <= 0 then
  392. hunters=hunters-1
  393. end
  394. end
  395.  
  396. if newData[name].Life > 0 and newData[name].Team == "Hunter" then
  397. tfm.exec.respawnPlayer(name)
  398. tfm.exec.movePlayer(name,1500,250,false,0,0,false)
  399. ui.removeTextArea(5000,name)
  400. ui.removeTextArea(5001,name)
  401. newData[name].Life = newData[name].Life - 10
  402. if newData[name].Life <= 0 then
  403. tfm.exec.killPlayer(name)
  404. tfm.exec.chatMessage("<B>Sua energia chegou ao fim! </B>:(", name)
  405. end
  406. end
  407. LifeStatus(name)
  408. end
  409.  
  410. tfm.exec.newGame(maps[math.random(#maps)])
  411. table.foreach(tfm.get.room.playerList,eventNewPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement