Advertisement
Nysman

Untitled

Nov 3rd, 2020
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.48 KB | None | 0 0
  1. local EFFECTS = {
  2. ["Perfect Zygarde Full"] = 45,
  3. ["Mystic Mewtwo"] = 136,
  4. ["Groudon"] = 34,
  5. ["Shiny Groudon"] = 44,
  6. ["Arch Heatran"] = 105,
  7. ["Obscure Arceus"] = 55,
  8. ["Zygarde M1"] = 45,
  9. ["Zygarde M2"] = 45,
  10. ["Zygarde M3"] = 105,
  11. ["Tornadus"] = 152,
  12. ["Landorus"] = 152,
  13. ["Thundurus"] = 152,
  14. ["Majestic Lugia M1"] = 136,
  15. ["Majestic Lugia M2"] = 136,
  16. ["Majestic Lugia M3"] = 136,
  17. ["Mew"] = 136,
  18. ["Mewtwo"] = 136,
  19. ["Shiny Mew"] = 136,
  20. ["Shiny Mewtwo"] = 136,
  21. ["Giratina Star"] = 55,
  22. ["Giratina Star M1"] = 55,
  23. ["Giratina Star M2"] = 55,
  24. ["Giratina Star M3"] = 55,
  25. ["Raikou"] = 360,
  26. ["Kyogre"] = 17,
  27. ["Shiny Kyogre"] = 17,
  28. ["Rayquaza"] = 17,
  29. ["Suicune"] = 17,
  30. ["Ditto"] = 17,
  31. ["Phione"] = 17,
  32. ["Zoroak"] = 55,
  33. ["Shiny Zoroak"] = 55,
  34. ["Zygard"] = 55,
  35. ["Regigigas"] = 35,
  36. ["Shiny Regigigas"] = 26,
  37. ["Genesect"] = 26,
  38. ["Zekrom"] = 26,
  39. ["Shiny Zekrom"] = 26,
  40. ["Black Zygarde"] = 55,
  41. ["Black Alpha Zekrom"] = 55,
  42. ["Black Groudon"] = 55,
  43. ["Deoxys Lunar"] = 55,
  44. }
  45.  
  46. local cd = 3
  47.  
  48. local function volta(cid, init)
  49.  
  50. exhausted = 10
  51. storage = 31332
  52.  
  53. if(getPlayerStorageValue(cid, storage) > os.time() and getPlayerStorageValue(cid, storage) < 100+os.time()) then
  54. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, storage) - os.time()) == 1 and "" or "s") .. " to use new pokemon.")
  55. return true
  56. end
  57.  
  58. -- if getPlayerStorageValue(cid, 69891) >= 1 then
  59. -- doPlayerSendCancel(cid, "Voce nao pode chamar seu pokemon enquanto usa seu pet.")
  60. -- return false --alterado v1.5
  61. -- end
  62.  
  63. if getPlayerSlotItem(cid, CONST_SLOT_FEET).uid > 0 then
  64. local item = getPlayerSlotItem(cid, CONST_SLOT_FEET)
  65.  
  66. if getPlayerStorageValue(cid, 912351) > os.time () then
  67. doPlayerSendCancel(cid, "Espere "..getPlayerStorageValue(cid, 912351) - os.time ().." segundo(s) para usar novamente")
  68. return true
  69. end
  70.  
  71. if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end
  72.  
  73. if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1
  74. or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 5700) >= 1 then --alterado v1.9 <<
  75. return true
  76. end
  77.  
  78. local ballName = getItemAttribute(item.uid, "poke")
  79. local btype = getPokeballType(item.itemid)
  80. local usando = pokeballs[btype].use
  81.  
  82. local effect = pokeballs[btype].effect
  83. if not effect then
  84. effect = 21
  85. end
  86.  
  87. if not getItemAttribute(item.uid, "tadport") and ballName then
  88. doItemSetAttribute(item.uid, "tadport", fotos[ballName])
  89. end
  90.  
  91. unLock(item.uid) --alterado v1.8
  92.  
  93. if item.itemid == usando then
  94.  
  95. -- if getPlayerStorageValue(cid, 990) == 1 then -- GYM
  96. -- doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")
  97. -- return true
  98. -- end
  99. if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then --alterado v1.6
  100. if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then
  101. BackTeam(cid)
  102. end
  103. end
  104. if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then
  105. doPlayerSendCancel(cid, "You can't do that while is controling a mind")
  106. return true --alterado v1.5
  107. end
  108. if #getCreatureSummons(cid) <= 0 then
  109. if isInArray(pokeballs[btype].all, item.itemid) then
  110. doTransformItem(item.uid, pokeballs[btype].off)
  111. doItemSetAttribute(item.uid, "hp", 0)
  112. doPlayerSendCancel(cid, "This pokemon is fainted.")
  113. return true
  114. end
  115. end
  116.  
  117. local cd = getCD(item.uid, "blink", 30)
  118. if cd > 0 then
  119. setCD(item.uid, "blink", 0)
  120. end
  121.  
  122. local z = getCreatureSummons(cid)[1]
  123.  
  124. if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then
  125. return true
  126. end
  127. doReturnPokemon(cid, z, item, effect)
  128.  
  129. end
  130.  
  131. if init then
  132. if item.itemid == pokeballs[btype].on then
  133. if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
  134. doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
  135. return TRUE
  136. end
  137.  
  138. local thishp = getItemAttribute(item.uid, "hp")
  139.  
  140. if thishp <= 0 then
  141. if isInArray(pokeballs[btype].all, item.itemid) then
  142. doTransformItem(item.uid, pokeballs[btype].off)
  143. doItemSetAttribute(item.uid, "hp", 0)
  144. doPlayerSendCancel(cid, "This pokemon is fainted.")
  145. return true
  146. end
  147. end
  148.  
  149. local pokemon = getItemAttribute(item.uid, "poke")
  150.  
  151. if not pokes[pokemon] then
  152. return true
  153. end
  154. ---------------------------------------------------------------------------------------------------------------------------------------------------
  155.  
  156. local x = pokes[pokemon]
  157. local boost = getItemAttribute(item.uid, "boost") or 0
  158.  
  159. if getPlayerLevel(cid) < (x.level+boost) then
  160. doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")
  161. return true
  162. end
  163.  
  164. --------------------------------------------------------------------------------------
  165.  
  166. doSummonMonster(cid, pokemon)
  167.  
  168. local pk = getCreatureSummons(cid)[1]
  169. if not isCreature(pk) then return true end
  170.  
  171. ------------------------passiva hitmonchan------------------------------
  172. if isSummon(pk) then --alterado v1.8 \/
  173. if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then
  174. if not getItemAttribute(item.uid, "hands") then
  175. doSetItemAttribute(item.uid, "hands", 0)
  176. end
  177. local hands = getItemAttribute(item.uid, "hands")
  178. doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)
  179. end
  180. end
  181. -------------------------------------------------------------------------
  182. ---------movement magmar, jynx-------------
  183. if EFFECTS[getCreatureName(pk)] then
  184. markPosEff(pk, getThingPos(pk))
  185. sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))
  186. end
  187. --------------------------------------------------------------------------
  188.  
  189. ---if getCreatureName(pk) == "Ditto" or getCreatureName(pk) == "Shiny Ditto" then --edited
  190.  
  191. -- local left = getItemAttribute(item.uid, "transLeft")
  192. -- local name = getItemAttribute(item.uid, "transName")
  193.  
  194. -- if left and left > 0 then
  195. -- setPlayerStorageValue(pk, 1010, name)
  196. -- doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)
  197. -- addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))
  198. -- doItemSetAttribute(item.uid, "transBegin", os.clock())
  199. -- else
  200. -- setPlayerStorageValue(pk, 1010, getCreatureName(pk) == "Ditto" and "Ditto" or "Shiny Ditto") --edited
  201. -- end
  202. -- end
  203.  
  204. if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end
  205.  
  206. doCreatureSetLookDir(pk, 2)
  207.  
  208. adjustStatus(pk, item.uid, true, true, true)
  209. -- doCureWithY(getCreatureMaster(pk), pk)
  210.  
  211. doTransformItem(item.uid, item.itemid+1)
  212.  
  213. local pokename = getPokeName(pk) --alterado v1.7
  214.  
  215. local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
  216. doCreatureSay(cid, mgo, TALKTYPE_ORANGE_1)
  217. if getItemAttribute(item.uid, "ballorder") then
  218. doPlayerSendCancel(cid, "KGT,"..getItemAttribute(item.uid, "ballorder").."|".."0")
  219. end
  220. setPlayerStorageValue(cid, 912351, os.time () + cd)
  221. doSendMagicEffect(getCreaturePosition(pk), effect)
  222.  
  223. local pk = getCreatureSummons(cid)[1]
  224. local pb = getPlayerSlotItem(cid, 8).uid
  225. local look = getItemAttribute(pb, "addon")
  226.  
  227. if not look then
  228. doSetItemAttribute(pb, "addon", 0)
  229. end
  230.  
  231. if look and look > 0 then
  232. doSetCreatureOutfit(pk, {lookType = look}, -1)
  233. end
  234.  
  235. if useOTClient then
  236. doPlayerSendCancel(cid, '12//,show') --alterado v1.7
  237. end
  238.  
  239. local pk = getCreatureSummons(cid)[1]
  240. local pb = getPlayerSlotItem(cid, 8).uid
  241. local look = getItemAttribute(pb,"addon")
  242. if not look then
  243. doSetItemAttribute(pb,"addon",0)
  244.  
  245. end
  246. if look > 0 then
  247. doSetCreatureOutfit(pk, {lookType = look}, -1)
  248.  
  249. end
  250.  
  251.  
  252. end
  253. end
  254. end
  255. if useKpdoDlls then
  256. doUpdateMoves(cid)
  257. end
  258. return true
  259. end
  260.  
  261. function onSay(cid, words, param, channel)
  262. if getPlayerSlotItem(cid, CONST_SLOT_FEET).uid > 0 then
  263. if getItemAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "ballorder") == tonumber(param) then
  264. volta(cid, true)
  265. return true
  266. else
  267. volta(cid, false)
  268. end
  269.  
  270. end
  271. doMoveBar(cid, tonumber(param))
  272. volta(cid, true)
  273. return true
  274. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement