Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.23 KB | None | 0 0
  1. local special = specialevo --alterado v1.9 \/ peguem ele todo!
  2.  
  3. local types = {
  4. [leaf] = {"Bulbasaur", "Ivysaur", "Oddish", "Gloom", "Bellsprout", "Weepinbell", "Exeggcute", "Chikorita", "Bayleef", "Hoppip", "Skiploom", "Sunkern"},
  5. [water] = {"Squirtle", "Wartortle", "Horsea", "Goldeen", "Magikarp", "Psyduck", "Poliwag", "Poliwhirl", "Tentacool", "Krabby", "Staryu", "Omanyte", "Eevee", "Totodile", "Croconow", "Chinchou", "Marill", "Wooper", "Slowpoke", "Remoraid", "Seadra"},
  6. [venom] = {"Zubat", "Ekans", "Nidoran male", "Nidoran female", "Nidorino", "Nidorina", "Gloom", "Venonat", "Tentacool", "Grimer", "Koffing", "Spinarak", "Golbat"},
  7. [thunder] = {"Magnemite", "Pikachu", "Voltorb", "Eevee", "Chinchou", "Pichu", "Mareep", "Flaaffy", "Elekid"},
  8. [rock] = {"Geodude", "Graveler", "Rhyhorn", "Kabuto", "Slugma", "Pupitar"},
  9. [punch] = {"Machop", "Machoke", "Mankey", "Poliwhirl", "Tyrogue"},
  10. [fire] = {"Charmander", "Charmeleon", "Vulpix", "Growlithe", "Ponyta", "Eevee", "Cyndaquil", "Quilava", "Slugma", "Houndour", "Magby"},
  11. [coccon] = {"Caterpie", "Metapod", "Weedle", "Kakuna", "Paras", "Venonat", "Scyther", "Ledyba", "Spinarak", "Pineco"},
  12. [crystal] = {"Dratini", "Dragonair", "Magikarp", "Omanyte", "Kabuto", "Seadra"},
  13. [dark] = {"Gastly", "Haunter", "Eevee", "Houndour", "Pupitar"},
  14. [earth] = {"Cubone", "Sandshrew", "Nidorino", "Nidorina", "Diglett", "Onix", "Rhyhorn", "Wooper", "Swinub", "Phanpy", "Larvitar", "Pupitar"},
  15. [enigma] = {"Abra", "Kadabra", "Psyduck", "Slowpoke", "Drowzee", "Eevee", "Natu", "Smoochum"},
  16. [heart] = {"Rattata", "Pidgey", "Pidgeotto", "Spearow", "Clefairy", "Jigglypuff", "Meowth", "Doduo", "Porygon", "Chansey", "Sentret", "Hoothoot", "Cleffa", "Igglybuff", "Togepi", "Snubull", "Teddiursa"},
  17. [ice] = {"Seel", "Shellder", "Smoochum", "Swinub"},
  18. [metal] = {"Onix", "Scyther"},
  19. [ancient] = {"Sunkern", "Gloom", "Slowpoke", "Poliwhirl", "Seadra", "Porygon"},
  20. [sfire] = {"Shiny Charmander", "Shiny Charmeleon", "Shiny Magmortar", "Shiny Vulpix", "Shiny Growlithe", "Shiny Ponyta", "Shiny Eevee"},
  21. [swater] = {"Shiny Squirtle", "Shiny Wartortle", "Shiny Horsea", "Shiny Goldeen", "Shiny Magikarp", "Shiny Psyduck", "Shiny Poliwag", "Shiny Poliwhirl", "Shiny Tentacool", "Shiny Krabby", "Shiny Staryu", "Shiny Omanyte", "Shiny Eevee"},
  22. [sleaf] = {"Shiny Bulbasaur", "Shiny Ivysaur", "Shiny Oddish", "Shiny Gloom", "Shiny Bellsprout", "Shiny Weepinbell", "Shiny Exeggcute"},
  23. [sheart] = {"Shiny Rattata", "Shiny Pidgey", "Shiny Pidgeotto", "Shiny Spearow", "Shiny Clefairy", "Shiny Jigglypuff", "Shiny Meowth", "Shiny Doduo", "Shiny Porygon", "Shiny Chansey"},
  24. [senigma] = {"Shiny Abra", "Shiny Kadabra", "Shiny Psyduck", "Shiny Slowpoke", "Shiny Drowzee", "Shiny Eevee"},
  25. [srock] = {"Shiny Geodude", "Shiny Graveler", "Shiny Rhyhorn", "Shiny Kabuto"},
  26. [svenom] = {"Shiny Zubat", "Shiny Ekans", "Shiny Nidoran male", "Shiny Nidoran female", "Shiny Nidorino", "Shiny Nidorina", "Shiny Gloom", "Shiny Venonat", "Shiny Tentacool", "Shiny Grimer", "Shiny Koffing"},
  27. [sice] = {"Shiny Seel", "Shiny Shellder"},
  28. [sthunder] = {"Shiny Magnemite", "Shiny Pikachu", "Shiny electivire", "Shiny Voltorb", "Shiny Eevee"},
  29. [scrystal] = {"Shiny Dratini", "Shiny Dragonair", "Shiny Magikarp", "Shiny Omanyte", "Shiny Kabuto"},
  30. [scoccon] = {"Shiny Caterpie", "Shiny Metapod", "Shiny Weedle", "Shiny Kakuna", "Shiny Paras", "Shiny Venonat", "Shiny Scyther"},
  31. [sdarkness] = {"Shiny Gastly", "Shiny Haunter", "Shiny Eevee"},
  32. [spunch] = {"Shiny Machop", "Shiny Machoke", "Shiny Mankey", "Shiny Poliwhirl"},
  33. [searth] = {"Shiny Cubone", "Shiny Sandshrew", "Shiny Nidorino", "Shiny Nidorina", "Shiny Diglett", "Shiny Onix", "Shiny Rhyhorn"}
  34.  
  35. }
  36.  
  37. local specEvos = { --alterado v1.9 \/
  38. ["Eevee"] = {
  39. [thunder] = "Jolteon",
  40. [water] = "Vaporeon",
  41. [fire] = "Flareon",
  42. [enigma] = "Espeon",
  43. [dark] = "Umbreon",
  44. [ice] = "Glaceon",
  45. [leaf] = "Leafeon",
  46. [heart] = "Sylveon",
  47. },
  48. }
  49.  
  50. function onUse(cid, item, frompos, item2, topos)
  51.  
  52. local pokeball = getPlayerSlotItem(cid, 8)
  53.  
  54. if not isMonster(item2.uid) or not isSummon(item2.uid) then
  55. return true
  56. end
  57. if #getCreatureSummons(cid) > 1 then
  58. return true --alterado v1.9
  59. end
  60.  
  61. if isInArray({"ditto", "shiny ditto"}, getItemAttribute(pokeball.uid, "poke"):lower()) then
  62. doSendMsg(cid, "Ditto não tem evolução.")
  63. return true
  64. end
  65.  
  66. if getCreatureCondition(item2.uid, CONDITION_INVISIBLE) then return true end
  67.  
  68. local pevo = poevo[getCreatureName(item2.uid)]
  69.  
  70. if not isInArray(specialevo, getCreatureName(item2.uid)) then
  71. if not pevo then
  72. doPlayerSendCancel(cid, "This pokemon can't evolve.")
  73. return true
  74. end
  75. if not isPlayer(getCreatureMaster(item2.uid)) or getCreatureMaster(item2.uid) ~= cid then
  76. doPlayerSendCancel(cid, "You can only use stones on pokemons you own.")
  77. return true
  78. end
  79. if pevo.stoneid ~= item.itemid and pevo.stoneid2 ~= item.itemid then
  80. doPlayerSendCancel(cid, "This isn't the needed stone to evolve this pokemon.")
  81. return true
  82. end
  83. end
  84.  
  85. local minlevel = 0
  86.  
  87. if getPokemonName(item2.uid) == "Eevee" then
  88. local eevee = specEvos["Eevee"][item.itemid]
  89. if not eevee then
  90. doPlayerSendCancel(cid, "This isn't the required stone to evolve this pokemon.")
  91. return true
  92. end
  93.  
  94. minlevel = pokes[eevee].level
  95. local pb = getPlayerSlotItem(cid, 8)
  96. local levelon = getItemAttribute(pb.uid, "level")
  97. if levelon < minlevel then
  98. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  99. return true
  100. end
  101.  
  102. doRemoveItem(item.uid, 1)
  103. doEvolvePokemon(cid, item2, eevee, 0, 0)
  104. local ball = getPlayerSlotItem(cid, 8).uid
  105. doItemEraseAttribute(ball, "boost")
  106.  
  107. return true
  108. end
  109.  
  110. if isInArray(specialevo, getPokemonName(item2.uid)) then
  111. if getPokemonName(item2.uid) == "Poliwhirl" then
  112. local evolution = 0
  113. local theevo = ""
  114.  
  115. if item.itemid == water then
  116. if getPlayerItemCount(cid, king) >= 1 then
  117. evolution = king
  118. theevo = "Politoed"
  119. elseif getPlayerItemCount(cid, punch) >= 1 then
  120. evolution = punch
  121. theevo = "Poliwrath"
  122. else
  123. doPlayerSendCancel(cid, "You need a water stone and a punch stone (Poliwrath) or a King's Rock (Politoed) to evolve this pokemon.")
  124. return true
  125. end
  126.  
  127. minlevel = pokes[theevo].level
  128. local pb = getPlayerSlotItem(cid, 8)
  129. local levelon = getItemAttribute(pb.uid, "level")
  130. if levelon < minlevel then
  131. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  132. return true
  133. end
  134. if getPlayerItemCount(cid, punch) >= 1 and getPlayerItemCount(cid, king) >= 1 then
  135. doPlayerSendCancel(cid, "Please, use your Punch Stone to evolve this pokemon to a Poliwrath, or a King's Rock to a Politoed.")
  136. return true
  137. end
  138. doEvolvePokemon(cid, item2, theevo, evolution, water)
  139. local ball = getPlayerSlotItem(cid, 8).uid
  140. doItemEraseAttribute(ball, "boost")
  141. doTransformItem(ball, pokeballs[theevo:lower()].use)
  142.  
  143. elseif item.itemid == punch then
  144. minlevel = pokes["Poliwrath"].level
  145. local pb = getPlayerSlotItem(cid, 8)
  146. local levelon = getItemAttribute(pb.uid, "level")
  147. if levelon < minlevel then
  148. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  149. return true
  150. end
  151. if getPlayerItemCount(cid, water) <= 0 then
  152. doPlayerSendCancel(cid, "You need at least one Punch Stone and one Water Stone to evolve this pokemon.")
  153. return true
  154. end
  155.  
  156. local theevo = "Poliwrath"
  157. doEvolvePokemon(cid, item2, theevo, water, punch)
  158. local ball = getPlayerSlotItem(cid, 8).uid
  159. doItemEraseAttribute(ball, "boost")
  160. doItemSetAttribute(ball, "morta", "no")
  161. doItemSetAttribute(ball, "Icone", "yes")
  162. doTransformItem(ball, pokeballs[theevo:lower()].use)
  163.  
  164. elseif item.itemid == king then
  165. minlevel = pokes["Politoed"].level
  166. local pb = getPlayerSlotItem(cid, 8)
  167. local levelon = getItemAttribute(pb.uid, "level")
  168. if levelon < minlevel then
  169. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  170. return true
  171. end
  172. if getPlayerItemCount(cid, water) <= 0 then
  173. doPlayerSendCancel(cid, "You need at least one Punch Stone and one King's Rock to evolve this pokemon.")
  174. return true
  175. end
  176. local theevo = "Politoed"
  177. doEvolvePokemon(cid, item2, theevo, water, king)
  178. local ball = getPlayerSlotItem(cid, 8).uid
  179. doItemEraseAttribute(ball, "boost")
  180.  
  181. end
  182.  
  183. elseif getPokemonName(item2.uid) == "Gloom" then
  184. local theevo = ""
  185. local evolution = 0
  186. if item.itemid == leaf then
  187. if getPlayerItemCount(cid, leaf) >= 1 then
  188. theevo = "Vileplume"
  189. evolution = leaf
  190. elseif getPlayerItemCount(cid, sun) >= 1 then
  191. theevo = "Bellossom"
  192. evolution = sun
  193. else
  194. doPlayerSendCancel(cid, "You need at least one Leaf Stone, and a Sun Stone (Bellossom) or a 2 Leaf Stone (Vileplume) to evolve this pokemon.")
  195. return true
  196. end
  197.  
  198. minlevel = pokes[theevo].level
  199. local pb = getPlayerSlotItem(cid, 8)
  200. local levelon = getItemAttribute(pb.uid, "level")
  201.  
  202. if levelon < minlevel then
  203. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  204. return true
  205. end
  206. if getPlayerItemCount(cid, venom) >= 1 and getPlayerItemCount(cid, sun) >= 1 then
  207. doPlayerSendCancel(cid, "Please, use your Leaf Stone to evolve this pokemon to a Vileplume, or a Sun Stone to a Bellossom.")
  208. return true
  209. end
  210.  
  211. doEvolvePokemon(cid, item2, theevo, evolution, leaf)
  212. local ball = getPlayerSlotItem(cid, 8).uid
  213. doItemEraseAttribute(ball, "boost")
  214.  
  215.  
  216. elseif item.itemid == leaf then
  217. minlevel = pokes["Vileplume"].level
  218. local pb = getPlayerSlotItem(cid, 8)
  219. local levelon = getItemAttribute(pb.uid, "level")
  220. if levelon < minlevel then
  221. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  222. return true
  223. end
  224. if getPlayerItemCount(cid, leaf) <= 0 then
  225. doPlayerSendCancel(cid, "You need at least 2 Leaf Stones to evolve this pokemon.")
  226. return true
  227. end
  228. doEvolvePokemon(cid, item2, "Vileplume", leaf, leaf)
  229. local ball = getPlayerSlotItem(cid, 8).uid
  230. doItemEraseAttribute(ball, "boost")
  231.  
  232.  
  233. elseif item.itemid == sun then
  234. minlevel = pokes["Bellossom"].level
  235. local pb = getPlayerSlotItem(cid, 8)
  236. local levelon = getItemAttribute(pb.uid, "level")
  237. if levelon < minlevel then
  238. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  239. return true
  240. end
  241. if getPlayerItemCount(cid, leaf) <= 0 then
  242. doPlayerSendCancel(cid, "You need at least one Leaf Stone and one Sun Stone to evolve this pokemon.")
  243. return true
  244. end
  245. doEvolvePokemon(cid, item2, "Bellossom", sun, leaf)
  246. local ball = getPlayerSlotItem(cid, 8).uid
  247. doItemEraseAttribute(ball, "boost")
  248.  
  249. end
  250.  
  251. elseif getPokemonName(item2.uid) == "Slowpoke" then
  252. if item.itemid == enigma then
  253. minlevel = pokes["Slowbro"].level
  254. local pb = getPlayerSlotItem(cid, 8)
  255. local levelon = getItemAttribute(pb.uid, "level")
  256. if levelon < minlevel then
  257. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  258. return true
  259. end
  260. doEvolvePokemon(cid, item2, "Slowbro", enigma, 0)
  261. local ball = getPlayerSlotItem(cid, 8).uid
  262. doItemEraseAttribute(ball, "boost")
  263.  
  264. elseif item.itemid == king then
  265. minlevel = pokes["Slowking"].level
  266. local pb = getPlayerSlotItem(cid, 8)
  267. local levelon = getItemAttribute(pb.uid, "level")
  268. if levelon < minlevel then
  269. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  270. return true
  271. end
  272. doEvolvePokemon(cid, item2, "Slowking", king, 0)
  273. local ball = getPlayerSlotItem(cid, 8).uid
  274. doItemEraseAttribute(ball, "boost")
  275. end
  276.  
  277. elseif getPokemonName(item2.uid) == "Tyrogue" then
  278. local evolution = ""
  279.  
  280. evolution = choose("Hitmonlee", "Hitmonchan", "Hitmontop")
  281. minlevel = pokes[evolution].level
  282. local pb = getPlayerSlotItem(cid, 8)
  283. local levelon = getItemAttribute(pb.uid, "level")
  284.  
  285. if levelon < minlevel then
  286. doPlayerSendCancel(cid, "You don't have enough level to evolve this pokemon ("..minlevel..").")
  287. return true
  288. end
  289. doEvolvePokemon(cid, item2, evolution, punch, 0)
  290. local ball = getPlayerSlotItem(cid, 8).uid
  291. doItemEraseAttribute(ball, "boost")
  292. end
  293. return true
  294. end
  295.  
  296. local count = poevo[getPokemonName(item2.uid)].count
  297. local stnid = poevo[getPokemonName(item2.uid)].stoneid
  298. local stnid2 = poevo[getPokemonName(item2.uid)].stoneid2
  299. local evo = poevo[getPokemonName(item2.uid)].evolution
  300.  
  301. if not pokes[evo] then
  302. doSendMsg(cid, "Este pokemon nao existe.")
  303. print(">>>>>>EVO BUG: " .. evo)
  304. return true
  305. end
  306.  
  307. if stnid2 > 1 and (getPlayerItemCount(cid, stnid2) < count or getPlayerItemCount(cid, stnid) < count) then
  308. doPlayerSendCancel(cid, "You need at least one "..getItemNameById(stnid).." and one "..getItemNameById(stnid2).." to evolve this pokemon!")
  309. return true
  310. end
  311.  
  312. if getPlayerItemCount(cid, stnid) < count then
  313. local str = ""
  314. if count >= 2 then
  315. str = "s"
  316. end
  317. return doPlayerSendCancel(cid, "You need at least "..count.." "..getItemNameById(stnid)..""..str.." to evolve this pokemon!")
  318. end
  319.  
  320.  
  321.  
  322. if count >= 2 then
  323. stnid2 = stnid
  324. end
  325.  
  326. doEvolvePokemon(cid, item2, evo, stnid, stnid2)
  327. local ball = getPlayerSlotItem(cid, 8).uid
  328. doItemEraseAttribute(ball, "boost")
  329.  
  330. return TRUE
  331. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement