Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. function doRemoveCreatureWithTime(creatures,time) -- dev by Crypter 24/06/18
  2. if #creatures <= 0 then
  3. return false
  4. end
  5. addEvent(function()
  6. for i, v in pairs(creatures) do
  7. if isCreature(v) then
  8. doRemoveCreature(cid,v)
  9. end
  10. end
  11. end, time*1000)
  12. return true
  13. end
  14.  
  15. function doCreateMonsters(cid,monsters_name,convince) -- dev by Crypter 24/06/18
  16. if not monsters_name and #monsters_name <= 0 then
  17. return false
  18. end
  19. local monster_table = {}
  20. for i, v in pairs(monsters_name) do
  21. local monster = doCreateMonster(v, getPlayerPosition(cid))
  22. if convince then
  23. doConvinceCreature(cid, besta)
  24. end
  25. monster_table[i] = monster
  26. end
  27. return monster_table -- return id of all monsters
  28. end
  29.  
  30.  
  31. function onCastSpell(cid, var)
  32.  
  33. local exhaustion_values = {
  34. storage=290000,
  35. time = 60,
  36. }
  37.  
  38. local time_toRemoveBestas = 10 -- em segundos
  39.  
  40. local from,to = {x=962, y=885, z=7},{x=973, y=892, z=7} -- começo e final do mapa ??
  41. local from2,to2 = {x=979, y=901, z=7},{x=991, y=905, z=7} -- começo e final do mapa ??
  42.  
  43. if isInRange(getCreaturePosition(cid), from, to) or isInRange(getCreaturePosition(cid), from2, to2) then
  44. doPlayerSendCancel(cid, "Você não pode usar Summons Aqui!")
  45. return false
  46. elseif exhaustion.check(cid, exhaustion_values.storage) then
  47. doPlayerSendCancel(cid, "Aguarde "..exhaustion.get(cid, exhaustion_values.storage).." segundos para usar novamente.")
  48. return false
  49. end
  50.  
  51. local bestas = {"Gobi","Hachibi","Isobu","Kurama","Matatabi","Nanabi","Rokubi","Shukaku","Shukaku","Son Goku"}
  52. local minhas_bestas = doCreateMonsters(cid,bestas,true)
  53.  
  54. if doRemoveCreatureWithTime(minhas_bestas,time_toRemoveBestas) then
  55. addEvent(doPlayerSendTextMessage,time_toRemoveBestas*1000,cid,27,'Suas bestas foram removidas!')
  56. end
  57.  
  58. local position_1 = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y+1, z=getPlayerPosition(cid).z}
  59. local position_2 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
  60. doSendMagicEffect(position_1, 238)
  61. doSendMagicEffect(position_2, 278)
  62.  
  63. doPlayerSendTextMessage(cid,27,'BIJU SOSHINGEKI!')
  64.  
  65. return true
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement