Guest User

Order_by Slicer

a guest
Nov 21st, 2010
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.08 KB | None | 0 0
  1. local function doRemoveItemFromPos(position, itemid, count)
  2. local item = getTileItemById(position, itemid)
  3. if(item.uid ~= 0)then
  4. return doRemoveItem(item.uid, count or -1)
  5. end
  6. return false
  7. end
  8.  
  9. local tRock = {
  10. ['geodude'] = {1},
  11. ['diglett'] = {1},
  12. ['dugtrio'] = {1},
  13. ['sandshrew'] = {1},
  14. ['primeape'] = {1},
  15. ['graveler'] = {1},
  16. ['golem'] = {1},
  17. ['onix'] = {1},
  18. ['cubone'] = {1},
  19. ['marowak'] = {1},
  20. ['rhyhorn'] = {1},
  21. ['rhydon'] = {1},
  22. ['kangaskhan'] = {1},
  23. ['tauros'] = {1},
  24. ['snorlax'] = {1},
  25. ['crystal Onix'] = {1},
  26. }
  27. local tCut = {
  28. ['bulbasaur'] = {1},
  29. ['ivysaur'] = {1},
  30. ['venusaur'] = {1},
  31. ['bellsprout'] = {1},
  32. ['charmeleon'] = {1},
  33. ['sandshrew'] = {1},
  34. ['sandslash'] = {1},
  35. ['gloom'] = {1},
  36. ['vileplume'] = {1},
  37. ['paras'] = {1},
  38. ['parasect'] = {1},
  39. ['meowth'] = {1},
  40. ['persian'] = {1},
  41. ['weepinbell'] = {1},
  42. ['victreebel'] = {1},
  43. ['farfetchd'] = {1},
  44. ['exeggutor'] = {1},
  45. ['cubone'] = {1},
  46. ['marowak'] = {1},
  47. ['scyther'] = {1},
  48. ['jynx'] = {1},
  49. ['tangela'] = {1},
  50. ['pinsir'] = {1},
  51. ['tangela'] = {1},
  52. ['pidgeot'] = {1},
  53. }
  54. local tDig = {
  55. ['sandshrew'] = {1},
  56. ['sandslash'] = {1},
  57. ['nidoran'] = {1},
  58. ['nidorina'] = {1},
  59. ['nidoqueen'] = {1},
  60. ['nidoranma'] = {1},
  61. ['nidorino'] = {1},
  62. ['nidoking'] = {1},
  63. ['diglett'] = {1},
  64. ['dugtrio'] = {1},
  65. ['geodude'] = {1},
  66. ['graveler'] = {1},
  67. ['golem'] = {1},
  68. ['onix'] = {1},
  69. ['crystal onix'] = {1},
  70. ['eevee'] = {1},
  71. }
  72. local tBuracos = {
  73. [468] = {469},
  74. [481] = {482},
  75. [483] = {484},
  76. }
  77.  
  78. local tLight = {'electabuzz','alakazam','abra','hypno','mr.mime','electrode','magnemite','pikachu','raichu','kadabra','shiny raichu','shiny electrode','shiny voltorb','voltorb','shiny electabuzz','jolteon','porygon','mew','mewtwo', 'flareon'}
  79. local tRide = {
  80. ['tauros'] = {128, 200},
  81. ['ninetales'] = {129, 300},
  82. ['rapidash'] = {130, 350},
  83. ['ponyta'] = {131, 200},
  84. ['rhyhorn'] = {132, 150},
  85. ['arcanine'] = {12, 500},
  86. ['shiny arcanine'] = {492, 800},
  87. ['shiny venusaur'] = {494, 700},
  88. ['crystal onix'] = {293, 400},
  89. ['onix'] = {126, 350},
  90. ['venusaur'] = {134, 350},
  91. ['dodrio'] = {133, 350},
  92. ['doduo'] = {135, 250},
  93. }
  94. local idballs = {
  95. [2568] = {"Pokeball"},
  96. [2538] = {"Superball"},
  97. [2539] = {"Greatball"},
  98. [2537] = {"Ultraball"},
  99. [2542] = {"Masterball"},
  100. [2195] = {"Masterball"},
  101. [2532] = {"Pokeball"},
  102. [2653] = {"Superball"},
  103. [2652] = {"Greatball"},
  104. [2654] = {"Ultraball"},
  105. }
  106. local tFly = {
  107. ['moltres'] = {229, 800},
  108. ['articuno'] = {230, 800},
  109. ['zapdos'] = {224, 800},
  110. ['mew'] = {232, 800},
  111. ['mewtwo'] = {233, 800},
  112. ['dragonite'] = {221, 300},
  113. ['pidgeot'] = {222, 350},
  114. ['fearow'] = {226, 400},
  115. ['aerodactyl'] = {227, 490},
  116. ['charizard'] = {216, 590},
  117. ['elder charizard'] = {295, 800},
  118. ['porygon'] = {316, 350},
  119. }
  120. local tSurf = {
  121. ["Poliwag"] = {278, 400},
  122. ["Tentacruel"] = {185, 400},
  123. ["blastoise"] = {184, 400},
  124. ["Dewgong"] = {183, 400},
  125. ["Kabutops"] = {189, 400},
  126. ["Omastar"] = {188, 400},
  127. ["Gyarados"] = {187, 400},
  128. ["Poliwrath"] = {190, 400},
  129. ["Shiny Gyarados"] = {529, 410},
  130. ["Shiny Seadra"] = {522, 400},
  131. ["Shiny Tentacruel"] = {522, 400},
  132. ["Squirtle"] = {273, 400},
  133. ["Shiny Blastoise"] = {523, 400},
  134. ["Wartotle"] = {275, 400},
  135. ['Tentacool'] = {274, 400},
  136. ['Staryu'] = {266, 400},
  137. ['Starmie'] = {267, 400},
  138. ['Golduck'] = {271, 400},
  139. ['Poliwhirl'] = {137, 400},
  140. ['Tentacool'] = {277, 400},
  141. ['Goldeen'] = {268, 400},
  142. ['Seaking'] = {269, 400},
  143. ['Seadra'] = {270, 400},
  144. ['Snorlax'] = {300, 400},
  145. ['Vaporeon'] = {191, 400},
  146. }
  147. local configs = {
  148. [4647] = {x = -2, y = 0}, -- 4647 é o id da borda oeste (lado esquerdo do player) ----- Deixa assim
  149. [4645] = {x = 2, y = 0}, -- 4645 é o id da borda leste (lado direito do player) ----- Deixa assim
  150. [4646] = {x = 0, y = 2}, -- 4646 é o id da borda sul (abaixo do player) ----- Deixa assim
  151. [4644] = {x = 0, y = -2}, -- 4644 é o id da borda norte (acima do player) ----- Deixa assim
  152. }
  153. local configs2 = {4647, 4645, 4646, 4644}
  154. function onUse(cid, item, fromPosition, itemEx, toPosition)
  155.  
  156. function rockSmach(uid, itemid, toPostion, Pname, sid)
  157. local pos = getThingPos(itemEx.uid)
  158. if itemEx.itemid == 1285 and tRock[Pname] then
  159. if #getCreatureSummons(cid) < 1 then
  160. return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Rock Smash!")
  161. end
  162. doCreatureSay(cid,""..Pname..", smash it!",1)
  163. doCreatureWalkTo(sid, toPosition)
  164. doRemoveItem(itemEx.uid,1)
  165. doCreateItem(3610,1,toPosition)
  166. doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
  167. addEvent(doRemoveItemFromPos, 10000, toPosition, 3610)
  168. addEvent(doCreateItem,10005,1285,1,pos)
  169. return true
  170. elseif not tRock[Pname] and itemEx.itemid == 1285 then
  171. return doPlayerSendCancel(cid, "Este pokemon não pode usar Rock Smach!")
  172. end
  173. end
  174. ---------------------------fim rock------------------------------------
  175. function doCut(uid, itemid, toPosition, Pname, sid)
  176. local pos = getThingPos(itemEx.uid)
  177. if itemEx.itemid == 2767 and tCut[Pname] then
  178. if #getCreatureSummons(cid) < 1 then
  179. return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Cut!")
  180. end
  181. doCreatureSay(cid,""..Pname..", cut it!",1)
  182. doCreatureWalkTo(sid, toPosition)
  183. doRemoveItem(itemEx.uid,1)
  184. doCreateItem(6216,1,toPosition)
  185. doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
  186. addEvent(doRemoveItemFromPos, 10000, toPosition, 6216)
  187. addEvent(doCreateItem,10005,2767,1,pos)
  188. return true
  189. elseif not tCut[Pname] and itemEx.itemid == 2767 then
  190. return doPlayerSendCancel(cid, "Este pokemon não pode usar Cut!")
  191. end
  192. end
  193. --------------------------fim Cut-----------------------------------------
  194. function doDig(uid, itemid, toPosition, Pname, sid)
  195. local pos = getThingPos(itemEx.uid)
  196. local Buracos = tBuracos[itemEx.itemid]
  197. if Buracos and tDig[Pname] then
  198. if #getCreatureSummons(cid) < 1 then
  199. return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Dig!")
  200. end
  201. doCreatureSay(cid, "Dig it, "..Pname.."",1)
  202. doCreatureWalkTo(sid, toPosition)
  203. doRemoveItem(itemEx.uid,1)
  204. doCreateItem(Buracos[1],1,toPosition)
  205. doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
  206. addEvent(doRemoveItemFromPos, 10000, toPosition, Buracos[1])
  207. addEvent(doCreateItem,10005,Buracos[1] - 1,1,pos)
  208. return true
  209. elseif not tDig[Pname] and Buracos then
  210. return doPlayerSendCancel(cid, "Este pokemon não pode usar Dig!")
  211. end
  212. end
  213. ------------------------fim dig-----------------------------------------
  214. function doLight(uid, time, Pname)
  215. if isInArray(tLight, Pname) and itemEx.uid == getCreatureSummons(cid)[1] then
  216. if #getCreatureSummons(cid) < 1 then
  217. return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Light!")
  218. end
  219. doPlayerSay(cid, ""..Pname..", light!", 1)
  220. doSetCreatureLight(getCreatureSummons(cid)[1], 10, 210, time*1000)
  221. return true
  222. elseif not isInArray(tLight, Pname) and itemEx.uid == getCreatureSummons(cid)[1] then
  223. return doPlayerSendCancel(cid, "Este pokemon não pode usar Light!")
  224. end
  225. end
  226. -------------------------fim light--------------------------------------
  227. function doRide(uid, Pname, actionID)
  228. if getPlayerStorageValue(cid, 18000) == 10 then
  229. if itemEx.uid == cid and getPlayerStorageValue(cid, 18000) == 10 then
  230. doChangeSpeed(cid, -(getCreatureSpeed(cid) - getCreatureBaseSpeed(cid)))
  231. doRemoveCondition(cid, CONDITION_OUTFIT)
  232. setPlayerStorageValue(cid, 18000, 7)
  233. setPlayerStorageValue(cid, 25000, 6)
  234. setPlayerStorageValue(cid,10000,0)
  235. setPlayerStorageValue(cid,8889,0)
  236. local monster = doCreateMonster(Pname, getCreaturePosition(cid))
  237. doConvinceCreature(cid, monster)
  238. doCreatureAddHealth(monster, -(tonumber(getPokemonMaxLife(Pname) - actionID)))
  239. doCreatureSay(cid, Pname .. ", I'm tired of riding!", TALKTYPE_SAY)
  240. return true
  241. elseif itemEx.uid ~= cid and getPlayerStorageValue(cid, 18000) == 10 then
  242. return doPlayerSendCancel(cid, "Click em você pra sair do ride!")
  243. end
  244. end
  245. local pokemon = tRide[Pname]
  246. if itemEx.uid == cid and tRide[Pname] then
  247. if #getCreatureSummons(cid) < 1 then
  248. return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Ride!")
  249. end
  250. doChangeSpeed(cid, pokemon[2])
  251. setPlayerStorageValue(cid, 18000, 10)
  252. setPlayerStorageValue(cid, 25000, 5)
  253. doSetCreatureOutfit(cid, {lookType = pokemon[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
  254. setPlayerStorageValue(cid,10000,pokemon[1])
  255. setPlayerStorageValue(cid,8889,pokemon[2])
  256. doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid", getCreatureHealth(getCreatureSummons(cid)[1]))
  257. local summons = getCreatureSummons(cid)
  258. function getPokemonId(summons)
  259. for _, pid in ipairs(summons) do
  260. return pid
  261. end
  262. end
  263. doRemoveCreature(getPokemonId(summons))
  264. doCreatureSay(cid, Pname .. ", Let's go RIDE!", TALKTYPE_SAY)
  265. end
  266. end
  267. ----------------------------------fim ride--------------------------------------------
  268. function doFly(uid, Pname, actionID)
  269. if getPlayerStorageValue(cid, 17000) == 10 then
  270. if getSqmId(getCreaturePosition(cid)).itemid == CONST_FLYVOID then
  271. return doPlayerSendCancel(cid,"Desça antes de sair do fly")
  272. end
  273. if itemEx.uid == cid and getPlayerStorageValue(cid, 17000) == 10 then
  274. doChangeSpeed(cid, -(getCreatureSpeed(cid) - getCreatureBaseSpeed(cid)))
  275. doRemoveCondition(cid, CONDITION_OUTFIT)
  276. setPlayerStorageValue(cid, 17000, 7)
  277. setPlayerStorageValue(cid, 23000, 6)
  278. local monster2 = doCreateMonster(Pname, getCreaturePosition(cid))
  279. doConvinceCreature(cid, monster2)
  280. doCreatureAddHealth(monster2, -(tonumber(getPokemonMaxLife(Pname) - actionID)))
  281. doPlayerSay(cid, Pname .. ", I'm tired of flying!", TALKTYPE_SAY)
  282. setPlayerStorageValue(cid, 9999,-1)
  283. setPlayerStorageValue(cid, 8888,-1)
  284. return true
  285. elseif itemEx.uid ~= cid and getPlayerStorageValue(cid, 17000) == 10 then
  286. return doPlayerSendCancel(cid, "Click em você pra sair do fly!")
  287. end
  288. end
  289. local pokemon2 = tFly[Pname]
  290. if itemEx.uid == cid and tFly[Pname] then
  291. if #getCreatureSummons(cid) < 1 then
  292. return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Fly!")
  293. end
  294. doChangeSpeed(cid, pokemon2[2])
  295. setPlayerStorageValue(cid, 17000, 10)
  296. setPlayerStorageValue(cid, 23000, 5)
  297. doSetCreatureOutfit(cid, {lookType = pokemon2[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
  298. setPlayerStorageValue(cid,9999,pokemon2[1])
  299. setPlayerStorageValue(cid,8888,pokemon2[2])
  300. doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid", getCreatureHealth(getCreatureSummons(cid)[1]))
  301. local summons = getCreatureSummons(cid)
  302. function getPokemonId(summons)
  303. for _, pid in ipairs(summons) do
  304. return pid
  305. end
  306. end
  307. doRemoveCreature(getPokemonId(summons))
  308. doPlayerSay(cid, Pname .. ", Vamos voar!", TALKTYPE_SAY)
  309. doPlayerSendTextMessage(cid,27,'Fale \'up\' para subir e \'down\' para descer!.' )
  310. end
  311. if fly.using(cid) then
  312. local p = getCreaturePosition(cid)
  313. p.stackpos = 0
  314. local f = getTileThingByPos(p)
  315. if fly.del(cid) then
  316. if f.itemid ~= 0 and f.itemid ~= 1 and f.itemid ~= CONST_FLYVOID then
  317. return true
  318. else
  319. setPlayerStorageValue(cid,10941,1)
  320. local p = getCreaturePosition(cid)
  321. setPlayerStorageValue(cid, 102011,p.x)
  322. setPlayerStorageValue(cid, 102012,p.y)
  323. setPlayerStorageValue(cid, 102013,p.z)
  324. return true
  325. end
  326. else
  327. doPlayerSendTextMessage(cid,27,'Você não pode voar neste local.')
  328. end
  329. end
  330. end
  331. --------------------------------------fim fly-------------------------------------------------
  332. function doSurf(uid, Pname, actionID)
  333. local playerpos = getCreaturePosition(cid)
  334. if isInArray(configs2, itemEx.itemid) and getPlayerStorageValue(cid, 63215) == 10 then
  335. doTeleportThing(cid, {x=playerpos.x-configs[itemEx.itemid].x, y=playerpos.y-configs[itemEx.itemid].y, z=playerpos.z})
  336. setPlayerStorageValue(cid, 63215, 0)
  337. setPlayerStorageValue(cid, 27000, 0)
  338. doRemoveCondition(cid, CONDITION_OUTFIT)
  339. local monster = doCreateMonster(Pname, getCreaturePosition(cid))
  340. doConvinceCreature(cid, monster)
  341. doCreatureAddHealth(monster, -(tonumber(getPokemonMaxLife(Pname) - actionID)))
  342. doCreatureSay(cid, "Im tired of surf, "..Pname, TALKTYPE_SAY)
  343. doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid))
  344. return true
  345. elseif not isInArray(configs2, itemEx.itemid) and getPlayerStorageValue(cid, 63215) == 10 then
  346. return doPlayerSendCancel(cid, "Click na borda pra sair do Surf!")
  347. end
  348. local pokemon = tSurf[Pname]
  349. if isInArray(configs2, itemEx.itemid) and tSurf[Pname] then
  350. if #getCreatureSummons(cid) < 1 then
  351. return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Surf!")
  352. end
  353. doTeleportThing(cid, {x=playerpos.x+configs[itemEx.itemid].x, y=playerpos.y+configs[itemEx.itemid].y, z=playerpos.z})
  354. setPlayerStorageValue(cid, 63215, 10)
  355. setPlayerStorageValue(cid, 27000, 5)
  356. doSetCreatureOutfit(cid, {lookType = pokemon[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
  357. setPlayerStorageValue(cid,61209,pokemon[1])
  358. setPlayerStorageValue(cid,61210,pokemon[2])
  359. doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid", getCreatureHealth(getCreatureSummons(cid)[1]))
  360. local summons = getCreatureSummons(cid)
  361. function getPokemonId(summons)
  362. for _, pid in ipairs(summons) do
  363. return pid
  364. end
  365. end
  366. doRemoveCreature(getPokemonId(summons))
  367. doCreatureSay(cid, "Let's surf, "..Pname, TALKTYPE_SAY)
  368. end
  369. end
  370. -----------------------------------------fim surf---------------------------------------
  371. local function doMove(uid, sid, Pname)
  372. if itemEx.uid ~= cid then
  373. doCreatureWalkTo(sid, toPosition)
  374. doCreatureSay(cid, Pname ..", Move!", TALKTYPE_SAY)
  375. return doCreatureSetNoMove(sid, false)
  376. end
  377. end
  378. ----------------------------------------fim Move-----------------------------------------
  379. local itemid = itemEx.itemid
  380. local time = 300
  381. local actionID = getItemAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid")local old_speed = getCreatureBaseSpeed(cid)
  382. local nome = getItemName(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid)
  383. local balls = idballs[getPlayerSlotItem(cid,8).itemid]
  384. local Pname = nome:match('(.-) '..balls[1])
  385. local sid = getCreatureSummons(cid)[1]
  386. if rockSmach(cid, 1285, toPosition, Pname, sid) == true then
  387. return true
  388. end
  389. if doCut(cid, 2767, toPosition, Pname, sid) == true then
  390. return true
  391. end
  392. if doDig(cid, tBuracos[itemEx.itemid], toPosition, Pname, sid) == true then
  393. return true
  394. end
  395. if doLight(cid, time, Pname) == true then
  396. return true
  397. end
  398. if doRide(cid, Pname, actionID) == true then
  399. return true
  400. end
  401. if doFly(cid, Pname, actionID) == true then
  402. return true
  403. end
  404. if doSurf(cid, Pname, actionID) == true then
  405. return true
  406. end
  407. if doMove(cid, sid, Pname) == true then
  408. return true
  409. end
  410. end
Advertisement
Add Comment
Please, Sign In to add comment