Advertisement
Julianozns

Untitled

Oct 17th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.86 KB | None | 0 0
  1. local msgs = {"use ", ""}
  2.  
  3. function doAlertReady(cid, id, movename, n, cd)
  4. if not isCreature(cid) then return true end
  5. local myball = getPlayerSlotItem(cid, 8)
  6. if myball.itemid > 0 and getItemAttribute(myball.uid, cd) == "cd:"..id.."" then
  7. return true
  8. end
  9. local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
  10. if not p or #p <= 0 then return true end
  11. for a = 1, #p do
  12. if getItemAttribute(p[a], cd) == "cd:"..id.."" then
  13. return true
  14. end
  15. end
  16. end
  17.  
  18. function onSay(cid, words, param, channel)
  19.  
  20.  
  21. if param ~= "" then return true end
  22. if string.len(words) > 3 then return true end
  23.  
  24. if #getCreatureSummons(cid) == 0 then
  25. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa de um pokémon para usar moves.")
  26. return 0
  27. end
  28. --alterado v1.5
  29. local mypoke = getCreatureSummons(cid)[1]
  30.  
  31. if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end
  32. if getCreatureName(mypoke) == "Evolution" then return true end
  33.  
  34. if getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny Ditto" then
  35. name = getPlayerStorageValue(mypoke, 1010) --edited
  36. else
  37. name = getCreatureName(mypoke)
  38. end
  39.  
  40. --local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke)
  41.  
  42. local it = string.sub(words, 2, 3)
  43. local move = movestable[name].move1
  44. if getPlayerStorageValue(mypoke, 212123) >= 1 then
  45. cdzin = "cm_move"..it..""
  46. else
  47. cdzin = "move"..it.."" --alterado v1.5
  48. end
  49.  
  50. if it == "2" then
  51. move = movestable[name].move2
  52. elseif it == "3" then
  53. move = movestable[name].move3
  54. elseif it == "4" then
  55. move = movestable[name].move4
  56. elseif it == "5" then
  57. move = movestable[name].move5
  58. elseif it == "6" then
  59. move = movestable[name].move6
  60. elseif it == "7" then
  61. move = movestable[name].move7
  62. elseif it == "8" then
  63. move = movestable[name].move8
  64. elseif it == "9" then
  65. move = movestable[name].move9
  66. elseif it == "10" then
  67. move = movestable[name].move10
  68. elseif it == "11" then
  69. move = movestable[name].move11
  70. elseif it == "12" then
  71. move = movestable[name].move12
  72. elseif it == "13" then
  73. move = movestable[name].move13
  74. end
  75.  
  76. if not move then
  77. doPlayerSendCancel(cid, "Seu pokémon não reconhece esse move.")
  78. return true
  79. end
  80.  
  81. if getPlayerLevel(cid) < move.level then
  82. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa ser level "..move.level.." para usar este move.")
  83. return true
  84. end
  85.  
  86. if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) then
  87. doPlayerSendCancel(cid, "Você tem que esperar "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." segundos para usar "..move.name.." novamente.")
  88. return true
  89. end
  90.  
  91. if getTileInfo(getThingPos(mypoke)).protection then
  92. doPlayerSendCancel(cid, "Você não atacar em PZ.")
  93. return true
  94. end
  95. --alterado v1.6
  96. if (move.name == "Team Slice" or move.name == "Team Claw") and #getCreatureSummons(cid) < 2 then
  97. doPlayerSendCancel(cid, "Os seus pokemon precisa estar em uma equipe para usar este move!")
  98. return true
  99. end
  100. --alterado v1.7 \/\/\/
  101. if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) then
  102. local target = getCreatureTarget(cid)
  103. if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then
  104. if isCreature(getMasterTarget(target)) then --alterado v1.6
  105. doSendMagicEffect(getThingPos(target), 211)
  106. doSendAnimatedText(getThingPos(target), "TOO BAD", 215)
  107. doTeleportThing(target, getClosestFreeTile(target, getThingPos(mypoke)), false)
  108. doSendMagicEffect(getThingPos(target), 211)
  109. doFaceCreature(target, getThingPos(mypoke))
  110. return true --alterado v1.6
  111. end
  112. end
  113. end
  114.  
  115.  
  116. if move.target == 1 then
  117.  
  118. if not isCreature(getCreatureTarget(cid)) then
  119. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem um alvo.")
  120. return 0
  121. end
  122.  
  123. if getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then
  124. return 0
  125. end
  126.  
  127. if getCreatureHealth(getCreatureTarget(cid)) <= 0 then
  128. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já derrotou o seu alvo.")
  129. return 0
  130. end
  131.  
  132. if not isCreature(getCreatureSummons(cid)[1]) then
  133. return true
  134. end
  135.  
  136. if getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > move.dist then
  137. doPlayerSendCancel(cid, "Aproxime-se o alvo de usar este move.")
  138. return 0
  139. end
  140.  
  141. if not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then
  142. return 0
  143. end
  144. end
  145.  
  146. local newid = 0
  147.  
  148. if isSleeping(mypoke) or isSilence(mypoke) then --alterado v1.5
  149. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")
  150. return 0
  151. else
  152. newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)
  153. end
  154.  
  155. doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", 19)
  156.  
  157. local summons = getCreatureSummons(cid) --alterado v1.6
  158.  
  159. addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin)
  160.  
  161. for i = 2, #summons do
  162. if isCreature(summons[i]) and getPlayerStorageValue(cid, 637501) >= 1 then
  163. docastspell(summons[i], move.name) --alterado v1.6
  164. end
  165. end
  166.  
  167. docastspell(mypoke, move.name)
  168.  
  169. if useKpdoDlls then
  170. doUpdateCooldowns(cid)
  171. end
  172.  
  173. return 0
  174. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement