Advertisement
Guest User

pokemon moves.lua

a guest
Jul 20th, 2017
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 193.94 KB | None | 0 0
  1. const_distance_delay = 56
  2.  
  3. RollOuts = {
  4. ["Voltorb"] = {lookType = 638},
  5. ["Electrode"] = {lookType = 637},
  6. ["Sandshrew"] = {lookType = 635},
  7. ["Sandslash"] = {lookType = 636},
  8. ["Phanpy"] = {lookType = 1005},
  9. ["Donphan"] = {lookType = 1007},
  10. ["Miltank"] = {lookType = 1006},
  11. ["Golem"] = {lookType = 639},
  12. ["Omastar"] = {lookType = 1579},
  13. ["Shiny Electrode"] = {lookType = 1387},
  14. ["Shiny Golem"] = {lookType = 1403},
  15. ["Shiny Voltorb"] = {lookType = 1388},
  16. ["Shiny Sandslash"] = {lookType = 1506}
  17. }
  18.  
  19. FireOuts = {
  20. }
  21.  
  22. --//////////////////////////////////////////////////////////////////////////////////////////////////////////--
  23. local function getSubName(cid, target)
  24. if not isCreature(cid) then return "" end
  25. if getCreatureName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
  26. return getPlayerStorageValue(cid, 1010)
  27. elseif pokeHaveReflect(cid) and isCreature(target) then
  28. return getCreatureName(target)
  29. else --alterado v1.6.1
  30. return getCreatureName(cid)
  31. end
  32. end
  33.  
  34. local function getThingName(cid)
  35. if not isCreature(cid) then return "" end --alterado v1.6
  36. return getCreatureName(cid)
  37. end
  38.  
  39. function getTableMove(cid, move) --alterado v1.6
  40. local backup = {f = 0, t = ""}
  41. if getThingName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
  42. name = getPlayerStorageValue(cid, 1010)
  43. else
  44. name = getThingName(cid)
  45. end
  46. if not isCreature(cid) or name == "" or not move then return backup end
  47. local x = movestable[name]
  48. if not x then return "" end
  49. local z = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12, x.passive1, x.passive2, x.passive3}
  50. if getPlayerStorageValue(cid, 21103) ~= -1 then
  51. local sto = getPlayerStorageValue(cid, 21103)
  52. setPlayerStorageValue(cid, 21103, -1)
  53. return {f = sto, t = ""}
  54. end
  55. for j = 1, 15 do
  56. if z[j] and z[j].name == move then
  57. return z[j]
  58. end
  59. end
  60. return movesinfo[move]
  61. end
  62.  
  63. function getMasterTarget(cid)
  64. if isCreature(cid) and getPlayerStorageValue(cid, 21101) ~= -1 then
  65. return getPlayerStorageValue(cid, 21101) --alterado v1.6
  66. end
  67. if isSummon(cid) then
  68. return getCreatureTarget(getCreatureMaster(cid))
  69. else
  70. return getCreatureTarget(cid)
  71. end
  72. end
  73. --////////////////////////////////////////////////////////////////////////////////////////////////////////--
  74.  
  75. function docastspell(cid, spell, mina, maxa)
  76. Pkattacker = cid
  77.  
  78. local target = 0
  79. local getDistDelay = 0
  80. if not isCreature(cid) or getCreatureHealth(cid) <= 0 then return false end --alterado v1.6
  81. if isSleeping(cid) and getPlayerStorageValue(cid, 21100) <= -1 then return true end --alterado v1.6
  82.  
  83. if isCreature(getMasterTarget(cid)) then
  84. target = getMasterTarget(cid)
  85. getDistDelay = getDistanceBetween(getThingPosWithDebug(cid), getThingPosWithDebug(target)) * const_distance_delay
  86. end
  87.  
  88. if isMonster(cid) and not isSummon(cid) then
  89. if getCreatureCondition(cid, CONDITION_EXHAUST) then
  90. return true
  91. end
  92. doCreatureAddCondition(cid, wildexhaust)
  93. end
  94.  
  95. local mydir = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  96. local table = getTableMove(cid, spell) --alterado v1.6
  97.  
  98. local min = 0
  99. local max = 0
  100. --alterado v1.7 \/\/
  101. if ehMonstro(cid) and isCreature(getMasterTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getMasterTarget(cid))) then
  102. local target = getMasterTarget(cid)
  103. if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then
  104. if isCreature(getMasterTarget(target)) then --alterado v1.6
  105. doSendMagicEffect(getThingPosWithDebug(target), 211)
  106. doSendAnimatedText(getThingPosWithDebug(target), "TOO BAD", 215)
  107. doTeleportThing(target, getClosestFreeTile(target, getThingPosWithDebug(cid)), false)
  108. doSendMagicEffect(getThingPosWithDebug(target), 211)
  109. doFaceCreature(target, getThingPosWithDebug(cid))
  110. return false --alterado v1.8
  111. end
  112. end
  113. end
  114.  
  115. --- FEAR / ROAR / SILENCE ---
  116. if (isWithFear(cid) or isSilence(cid)) and getPlayerStorageValue(cid, 21100) <= -1 then
  117. return true --alterado v1.6!!
  118. end
  119. ----------------------------
  120.  
  121. if mina and maxa then
  122. min = math.abs(mina)
  123. max = math.abs(maxa)
  124. elseif not isPlayer(cid) then
  125. if table ~= "" then --alterado v1.6
  126.  
  127. min = getSpecialAttack(cid) * (table and table.f or 0) * 0.1 --alterado v1.6
  128. max = min + (isSummon(cid) and getMasterLevel(cid) or getPokemonLevel(cid))
  129.  
  130. if spell == "Selfdestruct" then
  131. min = getCreatureHealth(cid) --alterado v1.6
  132. max = getCreatureHealth(cid)
  133. end
  134.  
  135. if not isSummon(cid) and not isInArray({"Demon Puncher", "Demon Kicker", "Blaze Kicker"}, spell) then --alterado v1.7
  136. doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER)
  137. end
  138. if isNpcSummon(cid) then
  139. local mnn = {" use ", " "}
  140. local use = mnn[math.random(#mnn)]
  141. doCreatureSay(getCreatureMaster(cid), getPlayerStorageValue(cid, 1007)..","..use..""..doCorrectString(spell).."!", 1)
  142. end
  143. else
  144. print("Error trying to use move "..spell..", move not specified in the pokemon table.")
  145. end
  146.  
  147. end
  148.  
  149.  
  150. --- FOCUS ----------------------------------
  151. if getPlayerStorageValue(cid, 253) >= 0 and table ~= "" and table.f ~= 0 then --alterado v1.6
  152. min = min * 2
  153. max = max * 2
  154. setPlayerStorageValue(cid, 253, -1)
  155. end
  156. --- Shredder Team -------------------------------
  157. if getPlayerStorageValue(cid, 637501) >= 1 then
  158. if #getCreatureSummons(cid) == 1 then
  159. docastspell(getCreatureSummons(cid)[1], spell)
  160. elseif #getCreatureSummons(cid) == 2 then
  161. docastspell(getCreatureSummons(cid)[1], spell)
  162. docastspell(getCreatureSummons(cid)[2], spell)
  163. end
  164.  
  165. elseif getPlayerStorageValue(cid, 637500) >= 1 then
  166. min = 0
  167. max = 0
  168. end
  169. ------------------Miss System--------------------------
  170. local cd = getPlayerStorageValue(cid, conds["Miss"])
  171. local cd2 = getPlayerStorageValue(cid, conds["Confusion"]) --alterado v1.5
  172. local cd3 = getPlayerStorageValue(cid, conds["Stun"])
  173. if cd >= 0 or cd2 >= 0 or cd3 >= 0 then --alterado v1.7
  174. if not isInArray({"Shock-Counter", "Lava-Counter", "Counter Helix", "Demon Puncher", "Blaze Kicker", "Demon Kicker", "Stunning Confusion", "Electric Charge", "Melody", "Mirror Coat", "Mega Drain",
  175. "Aromateraphy", "Heal Bell", "Emergency Call", "Magical Leaf", "Sunny Day", "Taunt", "Skull Bash", "Safeguard", "Rain Dance", "Spores Reaction", "Giroball", "Counter Claw", "Counter Spin", "Dragon Fury",
  176. "Amnesia", "Zen Mind", "Bone Spin"}, spell) and getPlayerStorageValue(cid, 21100) <= -1 then
  177. if math.random(1, 100) > 30 then --alterado v1.6
  178. doSendAnimatedText(getThingPosWithDebug(cid), "MISS", 215)
  179. return false
  180. end
  181. end
  182. end
  183. ---------------GHOST DAMAGE-----------------------
  184. ghostDmg = GHOSTDAMAGE
  185. psyDmg = PSYCHICDAMAGE
  186.  
  187. if getPlayerStorageValue(cid, 999457) >= 1 and table ~= "" and table.f ~= 0 then --alterado v1.6
  188. psyDmg = MIRACLEDAMAGE
  189. ghostDmg = DARK_EYEDAMAGE
  190. addEvent(setPlayerStorageValue, 50, cid, 999457, -1)
  191. end
  192. --------------------REFLECT----------------------
  193. setPlayerStorageValue(cid, 21100, -1) --alterado v1.6
  194. if not isInArray({"Psybeam", "Sand Attack", "Flamethrower", "Heal Bell"}, spell) then --alterado v1.8
  195. setPlayerStorageValue(cid, 21101, -1)
  196. end
  197. setPlayerStorageValue(cid, 21102, spell)
  198. ---------------------------------------------------
  199.  
  200.  
  201.  
  202. if spell == "Reflect" or spell == "Mimic" or spell == "Magic Coat" then
  203.  
  204. if spell == "Magic Coat" then
  205. eff = 11
  206. else
  207. eff = 135
  208. end
  209.  
  210. doSendMagicEffect(getThingPosWithDebug(cid), eff)
  211. setPlayerStorageValue(cid, 21099, 1)
  212.  
  213. elseif spell == "Quick Attack" then
  214.  
  215. doDanoWithProtect(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 111)
  216.  
  217. elseif spell == "Razor Leaf" or spell == "Magical Leaf" then
  218.  
  219. local eff = spell == "Razor Leaf" and 8 or 21
  220.  
  221. local function throw(cid, target)
  222. if not isCreature(cid) or not isCreature(target) then return false end
  223. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), eff)
  224. doDanoInTargetWithDelay(cid, target, GRASSDAMAGE, min, max, 245) --alterado v1.7
  225. end
  226.  
  227. addEvent(throw, 0, cid, target)
  228. addEvent(throw, 100, cid, target) --alterado v1.7
  229.  
  230. elseif spell == "Vine Whip" then
  231.  
  232. local area = getThingPosWithDebug(cid)
  233. local dano = {}
  234. local effect = 255
  235.  
  236. if mydir == 0 then
  237. area.x = area.x + 1
  238. area.y = area.y - 1
  239. dano = whipn
  240. effect = 80
  241. elseif mydir == 1 then
  242. area.x = area.x + 2
  243. area.y = area.y + 1
  244. dano = whipe
  245. effect = 83
  246. elseif mydir == 2 then
  247. area.x = area.x + 1
  248. area.y = area.y + 2
  249. dano = whips
  250. effect = 81
  251. elseif mydir == 3 then
  252. area.x = area.x - 1
  253. area.y = area.y + 1
  254. dano = whipw
  255. effect = 82
  256. end
  257.  
  258. doSendMagicEffect(area, effect)
  259. doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(cid), dano, -min, -max, 255)
  260.  
  261. elseif spell == "Headbutt" then
  262.  
  263. doAreaCombatHealth(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 118)
  264.  
  265. elseif spell == "Mega Evolution" then
  266. local effect = 170 --Efeito de mega evolução.
  267. if isSummon(cid) then
  268. local pid = getCreatureMaster(cid)
  269. if isPlayer(pid) then
  270. local ball = getPlayerSlotItem(pid, 8).uid
  271. if ball > 0 then
  272. local attr = getItemAttribute(ball, "megaStone")
  273. if attr and megaEvolutions[attr] then
  274. local oldPosition, oldLookdir = getThingPos(cid), getCreatureLookDir(cid)
  275. doItemSetAttribute(ball, "poke", megaEvolutions[attr][2])
  276. doSendMagicEffect(getThingPos(cid), effect)
  277. doRemoveCreature(cid)
  278. doSummonMonster(pid, megaEvolutions[attr][2])
  279. local newPoke = getCreatureSummons(pid)[1]
  280. doTeleportThing(newPoke, oldPosition, false)
  281. doCreatureSetLookDir(newPoke, oldLookdir)
  282. adjustStatus(newPoke, ball, true, false)
  283. if useKpdoDlls then
  284. addEvent(doUpdateMoves, 5, pid)
  285. end
  286. end
  287. end
  288. end
  289. end
  290. elseif spell == "Magnitude" then
  291.  
  292. local pos = getThingPosWithDebug(cid)
  293. local areas = {rock1, rock2, rock3, rock4, rock5}
  294. local ret = {}
  295. ret.id = 0
  296. ret.cd = 12
  297. ret.eff = 0
  298. ret.check = 0
  299. ret.spell = spell
  300. ret.cond = "Stun"
  301.  
  302. local function endMove(cid)
  303. if isCreature(cid) then
  304. doRemoveCondition(cid, CONDITION_OUTFIT)
  305. end
  306. end
  307.  
  308. if getSubName(cid, target) == "Mega Swampert" then
  309. doSetCreatureOutfit(cid, {lookType = 1828}, -1)
  310. else
  311. doSetCreatureOutfit(cid, {lookType = 1828}, -1)
  312. end
  313. stopNow(cid, 16*360)
  314. addEvent(endMove, 16*360, cid)
  315. ----
  316. for i = 0, 4 do
  317. addEvent(doMoveInArea2, i*350, cid, 100, areas[i+1], GROUNDDAMAGE, min, max, spell, ret)
  318. addEvent(doMoveInArea2, i*360, cid, 100, areas[i+1], GROUNDDAMAGE, 0, 0, spell, ret)
  319. end
  320. for i = 4, 8 do
  321. local a = i-3
  322. addEvent(doMoveInArea2, i*350, cid, 100, areas[a], GROUNDDAMAGE, min, max, spell, ret)
  323. addEvent(doMoveInArea2, i*360, cid, 100, areas[a], GROUNDDAMAGE, 0, 0, spell, ret)
  324. end
  325. for i = 8, 12 do
  326. local a = i-7
  327. addEvent(doMoveInArea2, i*350, cid, 100, areas[a], GROUNDDAMAGE, min, max, spell, ret)
  328. addEvent(doMoveInArea2, i*360, cid, 100, areas[a], GROUNDDAMAGE, 0, 0, spell, ret)
  329. end
  330. for i = 12, 16 do
  331. local a = i-11
  332. addEvent(doMoveInArea2, i*350, cid, 100, areas[a], GROUNDDAMAGE, min, max, spell, ret)
  333. addEvent(doMoveInArea2, i*360, cid, 100, areas[a], GROUNDDAMAGE, 0, 0, spell, ret)
  334. end
  335. for i = 16, 20 do
  336. local a = i-15
  337. addEvent(doMoveInArea2, i*350, cid, 100, areas[a], GROUNDDAMAGE, min, max, spell, ret)
  338. addEvent(doMoveInArea2, i*360, cid, 100, areas[a], GROUNDDAMAGE, 0, 0, spell, ret)
  339. end
  340.  
  341. elseif spell == "Hex" then
  342.  
  343.  
  344. local ret = {}
  345. ret.id = 0
  346. ret.cd = 9
  347. ret.eff = 0
  348. ret.check = 0
  349. ret.first = true
  350. ret.cond = "Slow"
  351.  
  352. docastspell(cid, "Protect")
  353. doRaiseStatus(cid, 0, 0, 150, 5)
  354. addEvent(doMoveInArea2, 5000, cid, 222, hex, GHOSTDAMAGE, min, max, spell, ret)
  355.  
  356.  
  357. elseif spell == "Instant Teleportation" then
  358.  
  359. doDisapear(cid)
  360. p = getThingPosWithDebug(cid)
  361. doSendMagicEffect(p, 211)
  362. if isMonster(cid) then
  363. local pos = getThingPosWithDebug(cid)
  364. doTeleportThing(cid, {x=4, y=3, z=10}, false) --
  365. doTeleportThing(cid, pos, false)
  366. end
  367. addEvent(doAppear, 3000, cid)
  368. addEvent(sendEffWithProtect, 3000, cid, getThingPosWithDebug(cid), 211)
  369.  
  370. local ret = {}
  371. ret.id = cid
  372. ret.cd = 3
  373. ret.eff = 0
  374. ret.check = 0
  375. ret.buff = spell
  376. ret.first = true
  377.  
  378. doCondition2(ret)
  379.  
  380. elseif spell == "Kinesis" then
  381.  
  382. local function doCurse(cid)
  383. if not isCreature(cid) then return false end
  384. local uid = checkAreaUid(getThingPosWithDebug(cid), confusion, 0, 1)
  385. for _,pid in pairs(uid) do
  386. if isCreature(cid) and isCreature(pid) and pid ~= cid then
  387. doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPos(pid), 0, -min, -max, 220)
  388. end
  389. end
  390. end
  391.  
  392. for i = 0, 9 do
  393. addEvent(doCurse, 300 * i, cid)
  394. end
  395.  
  396.  
  397. elseif spell == "Protect" then
  398. local ret = {}
  399. ret.id = cid
  400. ret.cd = 5
  401. ret.eff = 117
  402. ret.check = 0
  403. ret.buff = spell
  404. ret.first = true
  405.  
  406. doCondition2(ret)
  407.  
  408.  
  409.  
  410.  
  411. elseif spell == "Leech Seed" then
  412.  
  413. local ret = {}
  414. ret.id = target
  415. ret.attacker = cid
  416. ret.cd = 5
  417. ret.check = getPlayerStorageValue(target, conds["Leech"])
  418. ret.damage = isSummon(cid) and getMasterLevel(cid)+getPokemonBoost(cid) or getPokemonLevel(cid)
  419. ret.cond = "Leech"
  420.  
  421. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 1)
  422. addEvent(doMoveDano2, 1000, cid, target, GRASSDAMAGE, 0, 0, ret, spell)
  423.  
  424. elseif spell == "Protection" then
  425.  
  426. local pos = getPosfromArea(cid, heal)
  427. local n = 0
  428.  
  429. while n < #pos do
  430. n = n+1
  431. thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
  432. local pid = getThingFromPosWithProtect(thing)
  433. local pospid = getThingPosWithDebug(pid)
  434. local poscid = getThingPosWithDebug(cid)
  435.  
  436. doSendMagicEffect(pos[n], 12)
  437. for i = 0, 9 do
  438. if isCreature(pid) then
  439. if isSummon(cid) and (isSummon(pid) or isPlayer(pid)) then
  440. if canAttackOther(cid, pid) == "Cant" then
  441. doCreatureSetNoMove(pid, true)
  442. doCreatureSetNoMove(cid, true)
  443. setPlayerStorageValue(pid, 9658783, 1)
  444. setPlayerStorageValue(cid, 9658783, 1)
  445. addEvent(doSendMagicEffect, i*800, pospid, 117)
  446. addEvent(doSendMagicEffect, i*800, poscid, 117)
  447. addEvent(setPlayerStorageValue, 8000, pid, 9658783, -1)
  448. addEvent(setPlayerStorageValue, 8000, cid, 9658783, -1)
  449. addEvent(doCreatureSetNoMove, 8000, pid, false)
  450. addEvent(doCreatureSetNoMove, 8000, cid, false)
  451. end
  452. elseif ehMonstro(cid) and ehMonstro(pid) then
  453. doCreatureSetNoMove(pid, true)
  454. doCreatureSetNoMove(cid, true)
  455. setPlayerStorageValue(pid, 9658783, 1)
  456. setPlayerStorageValue(cid, 9658783, 1)
  457. addEvent(doSendMagicEffect, i*800, pospid, 117)
  458. addEvent(doSendMagicEffect, i*800, poscid, 117)
  459. addEvent(setPlayerStorageValue, 8000, pid, 9658783, -1)
  460. addEvent(setPlayerStorageValue, 8000, cid, 9658783, -1)
  461. addEvent(doCreatureSetNoMove, 8000, pid, false)
  462. addEvent(doCreatureSetNoMove, 8000, cid, false)
  463. end
  464. end
  465. end
  466. end
  467.  
  468. elseif spell == "Solar Beam" then
  469.  
  470. local function useSolarBeam(cid)
  471. if not isCreature(cid) then
  472. return true
  473. end
  474. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then
  475. return true
  476. end
  477. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then
  478. return true
  479. end
  480. local effect1 = 255
  481. local effect2 = 255
  482. local effect3 = 255
  483. local effect4 = 255
  484. local effect5 = 255
  485. local area = {}
  486. local pos1 = getThingPosWithDebug(cid)
  487. local pos2 = getThingPosWithDebug(cid)
  488. local pos3 = getThingPosWithDebug(cid)
  489. local pos4 = getThingPosWithDebug(cid)
  490. local pos5 = getThingPosWithDebug(cid)
  491. if getCreatureLookDir(cid) == 1 then
  492. effect1 = 4
  493. effect2 = 10
  494. effect3 = 10
  495. effect4 = 10
  496. effect5 = 0
  497. pos1.x = pos1.x + 2
  498. pos1.y = pos1.y + 1
  499. pos2.x = pos2.x + 3
  500. pos2.y = pos2.y + 1
  501. pos3.x = pos3.x + 4
  502. pos3.y = pos3.y + 1
  503. pos4.x = pos4.x + 5
  504. pos4.y = pos4.y + 1
  505. pos5.x = pos5.x + 6
  506. pos5.y = pos5.y + 1
  507. area = solare
  508. elseif getCreatureLookDir(cid) == 0 then
  509. effect1 = 36
  510. effect2 = 37
  511. effect3 = 37
  512. effect4 = 38
  513. pos1.x = pos1.x + 1
  514. pos1.y = pos1.y - 1
  515. pos2.x = pos2.x + 1
  516. pos2.y = pos2.y - 3
  517. pos3.x = pos3.x + 1
  518. pos3.y = pos3.y - 4
  519. pos4.x = pos4.x + 1
  520. pos4.y = pos4.y - 5
  521. area = solarn
  522. elseif getCreatureLookDir(cid) == 2 then
  523. effect1 = 46
  524. effect2 = 50
  525. effect3 = 50
  526. effect4 = 59
  527. pos1.x = pos1.x + 1
  528. pos1.y = pos1.y + 2
  529. pos2.x = pos2.x + 1
  530. pos2.y = pos2.y + 3
  531. pos3.x = pos3.x + 1
  532. pos3.y = pos3.y + 4
  533. pos4.x = pos4.x + 1
  534. pos4.y = pos4.y + 5
  535. area = solars
  536. elseif getCreatureLookDir(cid) == 3 then
  537. effect1 = 115
  538. effect2 = 162
  539. effect3 = 162
  540. effect4 = 162
  541. effect5 = 163
  542. pos1.x = pos1.x - 1
  543. pos1.y = pos1.y + 1
  544. pos2.x = pos2.x - 3
  545. pos2.y = pos2.y + 1
  546. pos3.x = pos3.x - 4
  547. pos3.y = pos3.y + 1
  548. pos4.x = pos4.x - 5
  549. pos4.y = pos4.y + 1
  550. pos5.x = pos5.x - 6
  551. pos5.y = pos5.y + 1
  552. area = solarw
  553. end
  554.  
  555. if effect1 ~= 255 then
  556. doSendMagicEffect(pos1, effect1)
  557. end
  558. if effect2 ~= 255 then
  559. doSendMagicEffect(pos2, effect2)
  560. end
  561. if effect3 ~= 255 then
  562. doSendMagicEffect(pos3, effect3)
  563. end
  564. if effect4 ~= 255 then
  565. doSendMagicEffect(pos4, effect4)
  566. end
  567. if effect5 ~= 255 then
  568. doSendMagicEffect(pos5, effect5)
  569. end
  570.  
  571. doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(cid), area, -min, -max, 255)
  572. doRegainSpeed(cid)
  573. setPlayerStorageValue(cid, 3644587, -1)
  574. end
  575.  
  576. local function ChargingBeam(cid)
  577. if not isCreature(cid) then
  578. return true
  579. end
  580. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then
  581. return true
  582. end
  583. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then
  584. return true
  585. end
  586. local tab = {}
  587.  
  588. for x = -2, 2 do
  589. for y = -2, 2 do
  590. local pos = getThingPosWithDebug(cid)
  591. pos.x = pos.x + x
  592. pos.y = pos.y + y
  593. if pos.x ~= getThingPosWithDebug(cid).x and pos.y ~= getThingPosWithDebug(cid).y then
  594. table.insert(tab, pos)
  595. end
  596. end
  597. end
  598. doSendDistanceShoot(tab[math.random(#tab)], getThingPosWithDebug(cid), 37)
  599. end
  600.  
  601. doChangeSpeed(cid, -getCreatureSpeed(cid))
  602. setPlayerStorageValue(cid, 3644587, 1) --alterado v1.6 n sei pq mas tava dando debug o.O
  603.  
  604. doSendMagicEffect(getThingPosWithDebug(cid), 132)
  605. addEvent(useSolarBeam, 650, cid)
  606.  
  607. elseif spell == "Sleep Powder" then
  608.  
  609. local ret = {}
  610. ret.id = 0
  611. ret.cd = math.random(6, 9)
  612. ret.check = 0
  613. ret.first = true --alterado v1.6
  614. ret.cond = "Sleep"
  615.  
  616. doMoveInArea2(cid, 27, confusion, NORMALDAMAGE, 0, 0, spell, ret)
  617.  
  618. elseif spell == "Stun Spore" then
  619.  
  620. local ret = {}
  621. ret.id = 0
  622. ret.cd = 9
  623. ret.eff = 0
  624. ret.check = 0
  625. ret.spell = spell
  626. ret.cond = "Stun"
  627.  
  628. doMoveInArea2(cid, 85, confusion, GRASSDAMAGE, 0, 0, spell, ret)
  629.  
  630. elseif spell == "Poison Powder" then
  631.  
  632. local ret = {}
  633. ret.id = 0
  634. ret.cd = math.random(6, 15) --alterado v1.6
  635. ret.check = 0
  636. local lvl = isSummon(cid) and getMasterLevel(cid) or getPokemonLevel(cid)
  637. ret.damage = math.floor((getPokemonLevel(cid)+lvl * 3)/2)
  638. ret.cond = "Poison"
  639.  
  640. doMoveInArea2(cid, 84, confusion, NORMALDAMAGE, 0, 0, spell, ret)
  641.  
  642. elseif spell == "Bullet Seed" then
  643. --cid, effDist, effDano, areaEff, areaDano, element, min, max
  644. doMoveInAreaMulti(cid, 1, 45, bullet, bulletDano, GRASSDAMAGE, min, max)
  645.  
  646. elseif spell == "Body Slam" then
  647.  
  648. doAreaCombatHealth(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 118)
  649.  
  650. elseif spell == "Leaf Storm" or tonumber(spell) == 73 then
  651.  
  652. addEvent(doDanoWithProtect, 150, cid, GRASSDAMAGE, getThingPosWithDebug(cid), grassarea, -min, -max, 0)
  653.  
  654. local pos = getThingPosWithDebug(cid)
  655.  
  656. local function doSendLeafStorm(cid, pos) --alterado!!
  657. if not isCreature(cid) then return true end
  658. doSendDistanceShoot(getThingPosWithDebug(cid), pos, 8)
  659. end
  660.  
  661. for a = 1, 100 do
  662. local lugar = {x = pos.x + math.random(-6, 6), y = pos.y + math.random(-5, 5), z = pos.z}
  663. addEvent(doSendLeafStorm, a * 2, cid, lugar)
  664. end
  665.  
  666. elseif spell == "Scratch" then
  667.  
  668. doDanoWithProtect(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 142)
  669.  
  670. elseif spell == "Iron Head" then
  671.  
  672. doDanoWithProtect(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 77)
  673.  
  674. elseif spell == "Ember" then
  675.  
  676. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 3)
  677. doDanoInTargetWithDelay(cid, target, FIREDAMAGE, min, max, 15) --alterado v1.7
  678.  
  679. elseif spell == "Flamethrower" then
  680.  
  681. local flamepos = getThingPosWithDebug(cid)
  682. local effect = 255
  683. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  684.  
  685. if a == 0 then
  686. flamepos.x = flamepos.x+1
  687. flamepos.y = flamepos.y-1
  688. effect = 106
  689. elseif a == 1 then
  690. flamepos.x = flamepos.x+3
  691. flamepos.y = flamepos.y+1
  692. effect = 109
  693. elseif a == 2 then
  694. flamepos.x = flamepos.x+1
  695. flamepos.y = flamepos.y+3
  696. effect = 107
  697. elseif a == 3 then
  698. flamepos.x = flamepos.x-1
  699. flamepos.y = flamepos.y+1
  700. effect = 108
  701. end
  702.  
  703. doMoveInArea2(cid, 0, flamek, FIREDAMAGE, min, max, spell)
  704. doSendMagicEffect(flamepos, effect)
  705.  
  706.  
  707. elseif spell == "Fireball" then
  708.  
  709. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 3)
  710. addEvent(doDanoWithProtect, 200, cid, FIREDAMAGE, getThingPosWithDebug(target), waba, min, max, 5)
  711.  
  712. elseif spell == "Fire Fang" then
  713.  
  714. doSendMagicEffect(getThingPosWithDebug(target), 138)
  715. doDanoInTargetWithDelay(cid, target, FIREDAMAGE, min, max, 15) --alterado v1.7
  716.  
  717. elseif spell == "Fire Blast" then
  718.  
  719. local p = getThingPosWithDebug(cid)
  720. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  721.  
  722. function sendAtk(cid, area, eff)
  723. if isCreature(cid) then
  724. if not isSightClear(p, area, false) then return true end
  725. doAreaCombatHealth(cid, FIREDAMAGE, area, 0, 0, 0, eff)
  726. doAreaCombatHealth(cid, FIREDAMAGE, area, whirl3, -min, -max, 35)
  727. end
  728. end
  729.  
  730. for a = 0, 4 do
  731.  
  732. local t = {
  733. [0] = {60, {x=p.x, y=p.y-(a+1), z=p.z}}, --alterado v1.4
  734. [1] = {61, {x=p.x+(a+1), y=p.y, z=p.z}},
  735. [2] = {62, {x=p.x, y=p.y+(a+1), z=p.z}},
  736. [3] = {63, {x=p.x-(a+1), y=p.y, z=p.z}}
  737. }
  738. addEvent(sendAtk, 300*a, cid, t[d][2], t[d][1])
  739. end
  740.  
  741. elseif spell == "Rage" then
  742.  
  743. local ret = {}
  744. ret.id = cid
  745. ret.cd = 15
  746. ret.eff = 13
  747. ret.check = 0
  748. ret.buff = spell
  749. ret.first = true
  750.  
  751. doCondition2(ret)
  752.  
  753. elseif spell == "Raging Blast" then
  754.  
  755. --cid, effDist, effDano, areaEff, areaDano, element, min, max
  756. doMoveInAreaMulti(cid, 3, 6, bullet, bulletDano, FIREDAMAGE, min, max)
  757.  
  758. elseif spell == "Dragon Claw" then
  759.  
  760. doDanoWithProtect(cid, DRAGONDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 141)
  761.  
  762. elseif spell == "Wing Attack" or spell == "Steel Wing" then
  763.  
  764. local effectpos = getThingPosWithDebug(cid)
  765. local effect = 255
  766. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  767.  
  768. if a == 0 then
  769. effect = spell == "Steel Wing" and 251 or 128
  770. effectpos.x = effectpos.x + 1
  771. effectpos.y = effectpos.y - 1 --alterado v1.4
  772. elseif a == 1 then
  773. effectpos.x = effectpos.x + 2
  774. effectpos.y = effectpos.y + 1
  775. effect = spell == "Steel Wing" and 253 or 129
  776. elseif a == 2 then
  777. effectpos.x = effectpos.x + 1
  778. effectpos.y = effectpos.y + 2
  779. effect = spell == "Steel Wing" and 252 or 131
  780. elseif a == 3 then
  781. effectpos.x = effectpos.x - 1
  782. effectpos.y = effectpos.y + 1
  783. effect = spell == "Steel Wing" and 254 or 130
  784. end
  785.  
  786. doSendMagicEffect(effectpos, effect)
  787. doMoveInArea2(cid, 0, wingatk, FLYINGDAMAGE, min, max, spell)
  788.  
  789. elseif spell == "Magma Storm" then
  790.  
  791. local eff = {6, 35, 35, 6}
  792. local area = {flames1, flames2, flames3, flames4}
  793.  
  794. addEvent(doMoveInArea2, 2*450, cid, 2, flames0, FIREDAMAGE, min, max, spell)
  795. for i = 0, 3 do
  796. addEvent(doMoveInArea2, i*450, cid, eff[i+1], area[i+1], FIREDAMAGE, min, max, spell)
  797. end
  798.  
  799. elseif spell == "Magma Storm" then
  800.  
  801.  
  802. elseif spell == "Bubbles" then
  803.  
  804. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 2)
  805. doDanoInTargetWithDelay(cid, target, WATERDAMAGE, min, max, 68) --alterado v1.7
  806.  
  807. elseif spell == "Clamp" then
  808.  
  809. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 2)
  810. doDanoInTargetWithDelay(cid, target, WATERDAMAGE, min, max, 53) --alterado v1.7
  811.  
  812. elseif spell == "Water Gun" then
  813.  
  814. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  815. local p = getThingPosWithDebug(cid)
  816. local t = {
  817. [0] = {69, {x=p.x, y=p.y-1, z=p.z}},
  818. [1] = {70, {x=p.x+6, y=p.y, z=p.z}}, --alterado v1.8
  819. [2] = {71, {x=p.x, y=p.y+6, z=p.z}},
  820. [3] = {72, {x=p.x-1, y=p.y, z=p.z}},
  821. }
  822.  
  823. doMoveInArea2(cid, 0, triplo6, WATERDAMAGE, min, max, spell)
  824. doSendMagicEffect(t[a][2], t[a][1])
  825.  
  826. elseif spell == "Waterball" then
  827.  
  828. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 2)
  829. doDanoWithProtectWithDelay(cid, target, WATERDAMAGE, min, max, 68, waba)
  830.  
  831. elseif spell == "Aqua Tail" then
  832.  
  833. local function rebackSpd(cid, sss)
  834. if not isCreature(cid) then return true end
  835. doChangeSpeed(cid, sss)
  836. setPlayerStorageValue(cid, 446, -1)
  837. end
  838.  
  839. local x = getCreatureSpeed(cid)
  840. doFaceOpposite(cid)
  841. doChangeSpeed(cid, -x)
  842. addEvent(rebackSpd, 400, cid, x)
  843. setPlayerStorageValue(cid, 446, 1)
  844. doAreaCombatHealth(cid, WATERDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 68)
  845.  
  846. elseif spell == "Hydro Cannon" then
  847.  
  848. local p = getThingPosWithDebug(cid)
  849. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  850.  
  851. function sendAtk(cid, area, eff)
  852. if isCreature(cid) then
  853. if not isSightClear(p, area, false) then return true end
  854. doAreaCombatHealth(cid, WATERDAMAGE, area, 0, 0, 0, eff)
  855. doAreaCombatHealth(cid, WATERDAMAGE, area, whirl3, -min, -max, 68)
  856. end
  857. end
  858.  
  859. for a = 0, 4 do
  860.  
  861. local t = { --alterado v1.4
  862. [0] = {64, {x=p.x, y=p.y-(a+1), z=p.z}},
  863. [1] = {65, {x=p.x+(a+1), y=p.y, z=p.z}},
  864. [2] = {66, {x=p.x, y=p.y+(a+1), z=p.z}},
  865. [3] = {67, {x=p.x-(a+1), y=p.y, z=p.z}}
  866. }
  867. addEvent(sendAtk, 300*a, cid, t[d][2], t[d][1])
  868. end
  869.  
  870. elseif spell == "Harden" or spell == "Calm Mind" or spell == "Defense Curl" or spell == "Charm" then
  871. --alterado v1.4
  872. if spell == "Calm Mind" then
  873. eff = 133
  874. elseif spell == "Charm" then
  875. eff = 147 --efeito n eh esse.. e n sei se eh soh bonus de def, ou sp.def tb.. ;x
  876. else
  877. eff = 144
  878. end
  879.  
  880. local ret = {}
  881. ret.id = cid
  882. ret.cd = 8
  883. ret.eff = eff
  884. ret.check = 0
  885. ret.buff = spell
  886. ret.first = true
  887.  
  888. doCondition2(ret)
  889.  
  890. elseif spell == "Bubble Blast" then
  891.  
  892. --cid, effDist, effDano, areaEff, areaDano, element, min, max
  893. doMoveInAreaMulti(cid, 2, 68, bullet, bulletDano, WATERDAMAGE, min, max)
  894.  
  895. elseif spell == "Skull Bash" then
  896. local ret = {}
  897. ret.id = 0
  898. ret.cd = 9 --alterado v1.6
  899. ret.eff = 118
  900. ret.check = 0
  901. ret.first = true
  902. ret.cond = "Paralyze"
  903.  
  904. doMoveInArea2(cid, 118, reto5, NORMALDAMAGE, min, max, spell, ret)
  905.  
  906. elseif spell == "Hydropump" then
  907.  
  908. local pos = getThingPosWithDebug(cid)
  909.  
  910. local function doSendBubble(cid, pos)
  911. if not isCreature(cid) then return true end
  912. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  913. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  914. doSendDistanceShoot(getThingPosWithDebug(cid), pos, 2)
  915. doSendMagicEffect(pos, 53)
  916. end
  917. --alterado!!
  918. for a = 1, 20 do
  919. local lugar = {x = pos.x + math.random(-4, 4), y = pos.y + math.random(-3, 3), z = pos.z}
  920. addEvent(doSendBubble, a * 25, cid, lugar)
  921. end
  922. addEvent(doDanoWithProtect, 150, cid, WATERDAMAGE, pos, waterarea, -min, -max, 0)
  923.  
  924. elseif spell == "Giga Impact" then
  925.  
  926. local tempo = 3 --Tempo, em segundos.
  927. local a = {}
  928. local ret1 = {}
  929. ret1.id = 0
  930. ret1.cd = 5
  931. ret1.eff = 0
  932. ret1.check = 0
  933. ret1.first = true
  934. ret1.cond = "Slow"
  935. local ret2 = {}
  936. ret2.id = 0
  937. ret2.cd = 5
  938. ret2.eff = 0
  939. ret2.check = 0
  940. ret2.first = true
  941. ret2.cond = "Miss"
  942. a.speed = getCreatureSpeed(cid)
  943. doChangeSpeed(cid, -getCreatureSpeed(cid))
  944. doChangeSpeed(cid, a.speed*2)
  945. addEvent(function()
  946. if not isCreature(cid) then return true end
  947. doRegainSpeed(cid)
  948. doMoveInArea2(cid, 118, quake, NORMALDAMAGE, min, max, spell, ret1)
  949. doMoveInArea2(cid, 118, quake, NORMALDAMAGE, 0, 0, spell, ret2)
  950. end, tempo*1000)
  951.  
  952. elseif spell == "String Shot" then
  953.  
  954. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 23)
  955.  
  956. local ret = {}
  957. ret.id = target
  958. ret.cd = 6
  959. ret.eff = 137
  960. ret.check = getPlayerStorageValue(target, conds["Stun"])
  961. ret.spell = spell
  962. ret.cond = "Stun"
  963.  
  964. addEvent(doMoveDano2, 100, cid, target, BUGDAMAGE, 0, 0, ret, spell)
  965.  
  966. elseif spell == "Bug Bite" then
  967.  
  968. doSendMagicEffect(getThingPosWithDebug(target), 244)
  969. doDanoInTargetWithDelay(cid, target, BUGDAMAGE, min, max, 8) --alterado v1.7
  970.  
  971. elseif spell == "Super Sonic" then
  972.  
  973. local rounds = math.random(4, 7)
  974. rounds = rounds + math.floor(getPokemonLevel(cid) / 35)
  975.  
  976. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 32)
  977. local ret = {}
  978. ret.id = target
  979. ret.cd = rounds
  980. ret.check = getPlayerStorageValue(target, conds["Confusion"])
  981. ret.cond = "Confusion"
  982.  
  983. addEvent(doMoveDano2, 100, cid, target, NORMALDAMAGE, 0, 0, ret, spell)
  984.  
  985. elseif spell == "Whirlwind" then
  986.  
  987. area = {SL1, SL2, SL3, SL4}
  988.  
  989. for i = 0, 3 do
  990. addEvent(doMoveInArea2, i*300, cid, 42, area[i+1], FLYINGDAMAGE, min, max, spell)
  991. end
  992.  
  993. elseif spell == "Razor Wind" then
  994.  
  995. area = {SL1, SL2, SL3, SL4}
  996.  
  997. for i = 0, 3 do
  998. addEvent(doMoveInArea2, i*300, cid, 131, area[i+1], NORMALDAMAGE, min, max, spell)
  999. end
  1000.  
  1001. elseif spell == "Psybeam" then
  1002.  
  1003. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  1004. local t = {
  1005. [0] = 58, --alterado v1.6
  1006. [1] = 234,
  1007. [2] = 58,
  1008. [3] = 209,
  1009. }
  1010.  
  1011. doMoveInArea2(cid, t[a], reto4, psyDmg, min, max, spell) --alterado v1.4
  1012.  
  1013. elseif spell == "Sand Attack" then
  1014.  
  1015. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  1016. local t = {
  1017. [0] = 120,
  1018. [1] = 121,
  1019. [2] = 122,
  1020. [3] = 119,
  1021. }
  1022.  
  1023. local ret = {}
  1024. ret.id = 0
  1025. ret.cd = 9
  1026. ret.eff = 34
  1027. ret.check = 0
  1028. ret.spell = spell
  1029. ret.cond = "Miss"
  1030.  
  1031. doCreatureSetLookDir(cid, a) --sera? '-'
  1032. stopNow(cid, 1000)
  1033. doMoveInArea2(cid, t[a], reto5, GROUNDDAMAGE, 0, 0, spell, ret)
  1034.  
  1035. elseif spell == "Confusion" or spell == "Night Shade" then
  1036.  
  1037. local rounds = math.random(4, 7) --rever area...
  1038. rounds = rounds + math.floor(getPokemonLevel(cid) / 35)
  1039.  
  1040. if spell == "Confusion" then
  1041. dano = psyDmg --alterado v1.4
  1042. else
  1043. dano = ghostDmg
  1044. end
  1045.  
  1046. local ret = {}
  1047. ret.id = 0
  1048. ret.check = 0
  1049. ret.cd = rounds
  1050. ret.cond = "Confusion"
  1051.  
  1052. doMoveInArea2(cid, 136, selfArea1, dano, min, max, spell, ret)
  1053.  
  1054. elseif spell == "Horn Attack" then
  1055.  
  1056. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 15)
  1057. doDanoInTargetWithDelay(cid, target, NORMALDAMAGE, min, max, 3) --alterado v1.7
  1058.  
  1059. elseif spell == "Poison Sting" then
  1060.  
  1061. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 15)
  1062. doDanoInTargetWithDelay(cid, target, POISONDAMAGE, min, max, 8) --alterado v1.7
  1063.  
  1064. elseif spell == "Fury Cutter" or spell == "Red Fury" then
  1065.  
  1066. local effectpos = getThingPosWithDebug(cid)
  1067. local effect = 255
  1068. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  1069.  
  1070. if a == 0 then
  1071. if getSubName(cid, target) == "Scizor" then --alterado v1.6.1
  1072. effect = 236
  1073. else
  1074. effect = 128
  1075. end
  1076. effectpos.x = effectpos.x + 1
  1077. effectpos.y = effectpos.y - 1
  1078. elseif a == 1 then
  1079. effectpos.x = effectpos.x + 2
  1080. effectpos.y = effectpos.y + 1
  1081. if getSubName(cid, target) == "Scizor" then --alterado v1.6.1
  1082. effect = 232
  1083. else
  1084. effect = 129
  1085. end
  1086. elseif a == 2 then
  1087. effectpos.x = effectpos.x + 1
  1088. effectpos.y = effectpos.y + 2
  1089. if getSubName(cid, target) == "Scizor" then --alterado v1.6.1
  1090. effect = 233
  1091. else
  1092. effect = 131
  1093. end
  1094. elseif a == 3 then
  1095. effectpos.x = effectpos.x - 1
  1096. effectpos.y = effectpos.y + 1
  1097. if getSubName(cid, target) == "Scizor" then --alterado v1.6.1
  1098. effect = 224
  1099. else
  1100. effect = 130
  1101. end
  1102. end
  1103. local function doFury(cid, effect)
  1104. if not isCreature(cid) then return true end
  1105. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1106. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1107. doSendMagicEffect(effectpos, effect)
  1108. doMoveInArea2(cid, 2, wingatk, BUGDAMAGE, min, max, spell)
  1109. end
  1110.  
  1111. addEvent(doFury, 0, cid, effect)
  1112. addEvent(doFury, 350, cid, effect)
  1113.  
  1114. elseif spell == "Pin Missile" then
  1115.  
  1116. doMoveInAreaMulti(cid, 13, 7, bullet, bulletDano, BUGDAMAGE, min, max)
  1117.  
  1118. elseif spell == "Strafe" or spell == "Agility" then
  1119.  
  1120. local ret = {}
  1121. ret.id = cid
  1122. ret.cd = 15
  1123. ret.eff = 14
  1124. ret.check = 0
  1125. ret.buff = spell
  1126. ret.first = true
  1127.  
  1128. doCondition2(ret)
  1129.  
  1130. elseif spell == "Gust" then
  1131.  
  1132. doMoveInArea2(cid, 42, reto5, FLYINGDAMAGE, min, max, spell)
  1133.  
  1134. elseif spell == "Drill Peck" then
  1135.  
  1136. doDanoWithProtect(cid, FLYINGDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 148)
  1137.  
  1138. elseif spell == "Tornado" then
  1139.  
  1140. local pos = getThingPosWithDebug(cid)
  1141.  
  1142. local function doSendTornado(cid, pos)
  1143. if not isCreature(cid) then return true end
  1144. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1145. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1146. doSendDistanceShoot(getThingPosWithDebug(cid), pos, 22)
  1147. doSendMagicEffect(pos, 42)
  1148. end
  1149.  
  1150. for b = 1, 3 do
  1151. for a = 1, 20 do
  1152. local lugar = {x = pos.x + math.random(-4, 4), y = pos.y + math.random(-3, 3), z = pos.z}
  1153. addEvent(doSendTornado, a * 75, cid, lugar)
  1154. end
  1155. end
  1156. doDanoWithProtect(cid, FLYINGDAMAGE, pos, waterarea, -min, -max, 0)
  1157.  
  1158. elseif spell == "Bite" or tonumber(spell) == 5 then
  1159.  
  1160. doDanoWithProtect(cid, DARKDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 146)
  1161.  
  1162. elseif spell == "Super Fang" then
  1163.  
  1164. doDanoWithProtect(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 244)
  1165.  
  1166. elseif spell == "Poison Fang" then
  1167.  
  1168. doSendMagicEffect(getThingPosWithDebug(target), 244)
  1169. doDanoInTargetWithDelay(cid, target, POISONDAMAGE, min, max, 114) --alterado v1.7
  1170.  
  1171. elseif spell == "Sting Gun" then
  1172.  
  1173. local function doGun(cid, target)
  1174. if not isCreature(cid) or not isCreature(target) then return true end --alterado v1.7
  1175. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 13)
  1176. doDanoInTargetWithDelay(cid, target, POISONDAMAGE, min, max, 8) --alterado v1.7
  1177. end
  1178.  
  1179. setPlayerStorageValue(cid, 3644587, 1)
  1180. addEvent(setPlayerStorageValue, 200, cid, 3644587, 1)
  1181. for i = 0, 2 do
  1182. addEvent(doGun, i*100, cid, target)
  1183. end
  1184.  
  1185. elseif spell == "Acid" then
  1186.  
  1187. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 14)
  1188. doDanoInTargetWithDelay(cid, target, POISONDAMAGE, min, max, 20) --alterado v1.7
  1189.  
  1190. elseif spell == "Fear" or spell == "Roar" then
  1191.  
  1192. local ret = {}
  1193. ret.id = 0
  1194. ret.cd = 5
  1195. ret.check = 0
  1196. ret.skill = spell
  1197. ret.cond = "Fear"
  1198.  
  1199. doMoveInArea2(cid, 0, confusion, DARKDAMAGE, 0, 0, spell, ret)
  1200.  
  1201. elseif spell == "Iron Tail" then
  1202.  
  1203. local function rebackSpd(cid, sss)
  1204. if not isCreature(cid) then return true end
  1205. doChangeSpeed(cid, sss)
  1206. setPlayerStorageValue(cid, 446, -1)
  1207. end
  1208.  
  1209. local x = getCreatureSpeed(cid)
  1210. doFaceOpposite(cid)
  1211. doChangeSpeed(cid, -x)
  1212. addEvent(rebackSpd, 400, cid, x)
  1213. setPlayerStorageValue(cid, 446, 1)
  1214. doDanoWithProtect(cid, STEELDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 160)
  1215.  
  1216. elseif spell == "Thunder Shock" then
  1217.  
  1218. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 40)
  1219. doDanoInTargetWithDelay(cid, target, ELECTRICDAMAGE, min, max, 48) --alterado v1.7
  1220.  
  1221. elseif spell == "Thunder Bolt" then
  1222.  
  1223. --alterado v1.7
  1224. local function doThunderFall(cid, frompos, target)
  1225. if not isCreature(target) or not isCreature(cid) then return true end
  1226. local pos = getThingPosWithDebug(target)
  1227. local ry = math.abs(frompos.y - pos.y)
  1228. doSendDistanceShoot(frompos, getThingPosWithDebug(target), 41)
  1229. addEvent(doDanoInTarget, ry * 11, cid, target, ELECTRICDAMAGE, min, max, 48) --alterado v1.7
  1230. end
  1231.  
  1232. local function doThunderUp(cid, target)
  1233. if not isCreature(target) or not isCreature(cid) then return true end
  1234. local pos = getThingPosWithDebug(target)
  1235. local mps = getThingPosWithDebug(cid)
  1236. local xrg = math.floor((pos.x - mps.x) / 2)
  1237. local topos = mps
  1238. topos.x = topos.x + xrg
  1239. local rd = 7
  1240. topos.y = topos.y - rd
  1241. doSendDistanceShoot(getThingPosWithDebug(cid), topos, 41)
  1242. addEvent(doThunderFall, rd * 49, cid, topos, target)
  1243. end
  1244.  
  1245. setPlayerStorageValue(cid, 3644587, 1)
  1246. addEvent(setPlayerStorageValue, 350, cid, 3644587, -1)
  1247. for thnds = 1, 2 do
  1248. addEvent(doThunderUp, thnds * 155, cid, target)
  1249. end
  1250.  
  1251. elseif spell == "Thunder Wave" then
  1252.  
  1253. local ret = {}
  1254. ret.id = 0
  1255. ret.cd = 9
  1256. ret.check = 0
  1257. ret.eff = 48
  1258. ret.spell = spell
  1259. ret.cond = "Stun"
  1260.  
  1261. doMoveInArea2(cid, 48, db1, ELECTRICDAMAGE, min, max, spell, ret) --alterado v1.8
  1262.  
  1263. elseif spell == "Thunder" then
  1264.  
  1265. local ret = {}
  1266. ret.id = 0
  1267. ret.cd = 9
  1268. ret.check = 0
  1269. ret.eff = 48
  1270. ret.spell = spell
  1271. ret.cond = "Stun"
  1272.  
  1273. doMoveInArea2(cid, 48, thunderr, ELECTRICDAMAGE, min, max, spell, ret)
  1274.  
  1275. elseif spell == "Web Shot" then
  1276.  
  1277. local ret = {}
  1278. ret.id = target
  1279. ret.cd = 9
  1280. ret.eff = 26
  1281. ret.check = 0
  1282. ret.spell = spell
  1283. ret.cond = "Paralyze"
  1284.  
  1285. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 23)
  1286. addEvent(doMoveDano2, 100, cid, target, BUGDAMAGE, -min, -max, ret, spell)
  1287.  
  1288.  
  1289. elseif spell == "Sky Uppercut" then
  1290. sendEffWithProtect(cid, getThingPosWithDebug(cid), 211)
  1291. local function doSkyUpper(cid, target)
  1292. if not isCreature(cid) or not isCreature(target) then return false end
  1293. doTeleportThing(cid, getPosByDir(getThingPosWithDebug(target), math.random(0, 7)), false)
  1294. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  1295. doDanoInTargetWithDelay(cid, target, FIGHTINGDAMAGE, min, max, 113)
  1296. return true
  1297. end
  1298. addEvent(doSkyUpper, 200, cid, target)
  1299. addEvent(sendEffWithProtect, 300, cid, getThingPosWithDebug(cid), 211)
  1300. addEvent(doSkyUpper, 500, cid, target)
  1301. addEvent(sendEffWithProtect, 700, cid, getThingPosWithDebug(cid), 211)
  1302. addEvent(doSkyUpper, 1000, cid, target)
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308. elseif spell == "Dragon Flight" then
  1309. sendEffWithProtect(cid, getThingPosWithDebug(cid), 211)
  1310. local function doSkyUpper(cid, target)
  1311. if not isCreature(cid) or not isCreature(target) then return false end
  1312. doTeleportThing(cid, getPosByDir(getThingPosWithDebug(target), math.random(0, 7)), false)
  1313. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 5)
  1314. doDanoInTargetWithDelay(cid, target, FIGHTINGDAMAGE, min, max, 141)
  1315. return true
  1316. end
  1317. addEvent(doSkyUpper, 200, cid, target)
  1318. addEvent(sendEffWithProtect, 300, cid, getThingPosWithDebug(cid), 211)
  1319. addEvent(doSkyUpper, 500, cid, target)
  1320. addEvent(sendEffWithProtect, 700, cid, getThingPosWithDebug(cid), 211)
  1321. addEvent(doSkyUpper, 1000, cid, target)
  1322.  
  1323.  
  1324. elseif spell == "Double Kick" then
  1325.  
  1326. doDanoWithProtect(cid, FIGHTINGDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 113)
  1327. addEvent(doDanoWithProtect, 100, cid, FIGHTINGDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 113)
  1328.  
  1329. elseif spell == "Outrage" then
  1330. local config = {
  1331. outfit = {
  1332. --["pokemon_name"] = outfit,
  1333. ["Salamence"] = 1737,
  1334. ["Mega Charizardx"] = 1778,
  1335. ["Mega Sceptile"] = 1790,
  1336. ["Mega Salamence"] = 1737,
  1337. },
  1338. AOE = {
  1339. times = 2, --Quantas vezes o golpe AOE será usado.
  1340. interval = 3000, --Intervalo de tempo, em milésimos de segundo, entre cada golpe AOE.
  1341. combat = DRAGONDAMAGE, --Elemento.
  1342. spell = {
  1343. --Uma tabela deverá ser configurada com a área e efeito da parte com socos, e a outra com a parte do efeito do Draco Meteor.
  1344. {area = OutrageArea1, effect = 171}, --{area = área do dano AOE, effect = efeito}
  1345. {area = OutrageArea2, effect = 157}
  1346. },
  1347. }
  1348. }
  1349.  
  1350. local function doOutrage(cid, times)
  1351. if not isCreature(cid) then return true end
  1352. for i = 1, #config.AOE.spell do
  1353. doMoveInArea2(cid, config.AOE.spell[i].effect, config.AOE.spell[i].area, config.AOE.combat, min, max, spell)
  1354. end
  1355. times = times - 1
  1356. if times <= 0 then
  1357. local rounds = math.random(4, 7)
  1358. rounds = rounds + math.floor(getPokemonLevel(cid) / 35)
  1359. local ret = {}
  1360. ret.id = cid
  1361. ret.cd = rounds
  1362. ret.check = getPlayerStorageValue(cid, conds["Confusion"])
  1363. ret.cond = "Confusion"
  1364. doCondition2(ret)
  1365. return true
  1366. end
  1367. addEvent(doOutrage, config.AOE.interval, cid, times)
  1368. end
  1369.  
  1370. local ret = {}
  1371. ret.id = cid
  1372. ret.cd = config.AOE.interval / 1000 * config.AOE.times
  1373. ret.eff = 0
  1374. ret.check = 0
  1375. ret.buff = spell
  1376. ret.first = true
  1377. doCondition2(ret)
  1378. doSetCreatureOutfit(cid, {lookType = config.outfit[getCreatureName(cid)]}, config.AOE.interval * config.AOE.times)
  1379. addEvent(doOutrage, config.AOE.interval, cid, config.AOE.times)
  1380.  
  1381.  
  1382.  
  1383. elseif spell == "Fire Spin" then
  1384.  
  1385. local function setOutfit(cid, outfit)
  1386. if isCreature(cid) and getCreatureCondition(cid, CONDITION_OUTFIT) == true then
  1387. if getCreatureOutfit(cid).lookType == outfit then
  1388. doRemoveCondition(cid, CONDITION_OUTFIT)
  1389. end
  1390. end
  1391. end
  1392.  
  1393. if FireOuts[getSubName(cid, target)] then
  1394. doSetCreatureOutfit(cid, FireOuts[getSubName(cid, target)], -1) --alterado v1.6.1
  1395. end
  1396.  
  1397. local outfit = getCreatureOutfit(cid).lookType
  1398.  
  1399. local function roll(cid, outfit)
  1400. if not isCreature(cid) then return true end
  1401. if isSleeping(cid) then return true end
  1402. if FireOuts[getSubName(cid, target)] then
  1403. doSetCreatureOutfit(cid, FireOuts[getSubName(cid, target)], -1) --alterado v1.6.1
  1404. end
  1405. doDanoWithProtect(cid, FIREDAMAGE, getThingPosWithDebug(cid), splash, -min, -max, 0)
  1406. end
  1407.  
  1408. setPlayerStorageValue(cid, 3644587, 1)
  1409. addEvent(setPlayerStorageValue, 9000, cid, 3644587, -1)
  1410. for r = 0, 10 do --8
  1411. addEvent(roll, 750 * r, cid, outfit)
  1412. end
  1413. addEvent(setOutfit, 9050, cid, outfit)
  1414. doRaiseStatus(cid, 0, 0, 150, 10)
  1415.  
  1416.  
  1417.  
  1418. elseif spell == "Mega Kick" then
  1419.  
  1420. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  1421. doDanoInTargetWithDelay(cid, target, FIGHTINGDAMAGE, min, max, 113) --alterado v1.7
  1422.  
  1423. elseif spell == "Thunder Punch" then
  1424.  
  1425. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  1426. doSendMagicEffect(getThingPosWithDebug(target), 112)
  1427. doDanoInTargetWithDelay(cid, target, ELECTRICDAMAGE, min, max, 48) --alterado v1.7
  1428.  
  1429. elseif spell == "Electric Storm" then
  1430.  
  1431. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  1432.  
  1433. local function doFall(cid)
  1434. for rocks = 1, 42 do
  1435. addEvent(fall, rocks*35, cid, master, ELECTRICDAMAGE, 41, 48)
  1436. end
  1437. end
  1438.  
  1439. for up = 1, 10 do
  1440. addEvent(upEffect, up*75, cid, 41)
  1441. end
  1442. addEvent(doFall, 450, cid)
  1443.  
  1444. local ret = {}
  1445. ret.id = 0
  1446. ret.cd = 9
  1447. ret.check = 0
  1448. ret.eff = 48
  1449. ret.spell = spell
  1450. ret.cond = "Stun"
  1451.  
  1452. addEvent(doMoveInArea2, 1400, cid, 0, BigArea2, ELECTRICDAMAGE, min, max, spell, ret)
  1453.  
  1454. elseif spell == "Web Rain" then
  1455.  
  1456. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  1457.  
  1458. local function doFall(cid)
  1459. for rocks = 1, 42 do
  1460. addEvent(fall, rocks*35, cid, master, BUGDAMAGE, 23)
  1461. end
  1462. end
  1463.  
  1464. for up = 1, 10 do
  1465. addEvent(upEffect, up*75, cid, 23)
  1466. end
  1467. addEvent(doFall, 450, cid)
  1468.  
  1469. local ret = {}
  1470. ret.id = 0
  1471. ret.cd = 9
  1472. ret.check = 0
  1473. ret.eff = 26
  1474. ret.spell = spell
  1475. ret.cond = "Silence"
  1476.  
  1477. addEvent(doMoveInArea2, 1400, cid, 0, BigArea2, BUGDAMAGE, min, max, spell, ret)
  1478.  
  1479. elseif spell == "Spider Web" then
  1480.  
  1481. local ret = {}
  1482. ret.id = 0
  1483. ret.cd = 9
  1484. ret.check = 0
  1485. ret.eff = 26
  1486. ret.cond = "Silence"
  1487.  
  1488. doMoveInAreaMulti(cid, 23, 26, multi, multiDano, BUGDAMAGE, min, max)
  1489. doMoveInArea2(cid, 0, multiDano, BUGDAMAGE, 0, 0, spell, ret)
  1490.  
  1491.  
  1492. elseif spell == "Mud Shot" or spell == "Mud Slap" then
  1493.  
  1494. if isCreature(target) then --alterado v1.8
  1495. local contudion = spell == "Mud Shot" and "Miss" or "Stun"
  1496. local ret = {}
  1497. ret.id = target
  1498. ret.cd = 9
  1499. ret.eff = 34
  1500. ret.check = getPlayerStorageValue(target, conds[contudion])
  1501. ret.spell = spell
  1502. ret.cond = contudion
  1503.  
  1504. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 6)
  1505. addEvent(doMoveDano2, 100, cid, target, GROUNDDAMAGE, -min, -max, ret, spell)
  1506. end
  1507.  
  1508. elseif spell == "Rollout" then
  1509.  
  1510. local function setOutfit(cid, outfit)
  1511. if isCreature(cid) and getCreatureCondition(cid, CONDITION_OUTFIT) == true then
  1512. if getCreatureOutfit(cid).lookType == outfit then
  1513. doRemoveCondition(cid, CONDITION_OUTFIT)
  1514. if getCreatureName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
  1515. if isSummon(cid) then
  1516. local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
  1517. doSetCreatureOutfit(cid, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1) --alterado v1.8
  1518. end
  1519. end
  1520. end
  1521. end
  1522. end
  1523.  
  1524. if RollOuts[getSubName(cid, target)] then
  1525. doSetCreatureOutfit(cid, RollOuts[getSubName(cid, target)], -1) --alterado v1.6.1
  1526. end
  1527.  
  1528. local outfit = getCreatureOutfit(cid).lookType
  1529.  
  1530. local function roll(cid, outfit)
  1531. if not isCreature(cid) then return true end
  1532. if isSleeping(cid) then return true end
  1533. if RollOuts[getSubName(cid, target)] then
  1534. doSetCreatureOutfit(cid, RollOuts[getSubName(cid, target)], -1) --alterado v1.6.1
  1535. end
  1536. doDanoWithProtect(cid, ROCKDAMAGE, getThingPosWithDebug(cid), splash, -min, -max, 0)
  1537. end
  1538.  
  1539. setPlayerStorageValue(cid, 3644587, 1)
  1540. addEvent(setPlayerStorageValue, 9000, cid, 3644587, -1)
  1541. for r = 1, 11 do --8
  1542. addEvent(roll, 750 * r, cid, outfit)
  1543. end
  1544. addEvent(setOutfit, 9050, cid, outfit)
  1545.  
  1546. elseif spell == "Shockwave" then
  1547.  
  1548. local p = getThingPosWithDebug(cid)
  1549. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  1550.  
  1551. function sendAtk(cid, area, areaEff, eff)
  1552. if isCreature(cid) then
  1553. if not isSightClear(p, area, false) then return true end --testar o atk!!
  1554. doAreaCombatHealth(cid, GROUNDDAMAGE, areaEff, 0, 0, 0, eff)
  1555. doAreaCombatHealth(cid, GROUNDDAMAGE, area, whirl3, -min, -max, 255)
  1556. end
  1557. end
  1558.  
  1559. for a = 0, 5 do
  1560.  
  1561. local t = {
  1562. [0] = {126, {x=p.x, y=p.y-(a+1), z=p.z}, {x=p.x+1, y=p.y-(a+1), z=p.z}},
  1563. [1] = {124, {x=p.x+(a+1), y=p.y, z=p.z}, {x=p.x+(a+1), y=p.y+1, z=p.z}},
  1564. [2] = {125, {x=p.x, y=p.y+(a+1), z=p.z}, {x=p.x+1, y=p.y+(a+1), z=p.z}},
  1565. [3] = {123, {x=p.x-(a+1), y=p.y, z=p.z}, {x=p.x-(a+1), y=p.y+1, z=p.z}}
  1566. }
  1567. addEvent(sendAtk, 325*a, cid, t[d][2], t[d][3], t[d][1])
  1568. end
  1569.  
  1570. elseif spell == "Earthshock" then
  1571.  
  1572. local eff = getSubName(cid, target) == "Shiny Onix" and 179 or 127 --alterado v1.6.1
  1573.  
  1574. doAreaCombatHealth(cid, GROUNDDAMAGE, getThingPosWithDebug(cid), splash, -min, -max, 255)
  1575.  
  1576. local sps = getThingPosWithDebug(cid)
  1577. sps.x = sps.x+1
  1578. sps.y = sps.y+1
  1579. doSendMagicEffect(sps, eff)
  1580.  
  1581. elseif spell == "Earthquake" then
  1582.  
  1583. local eff = getSubName(cid, target) == "Shiny Onix" and 175 or 118 --alterado v1.6.1
  1584.  
  1585. local function doQuake(cid)
  1586. if not isCreature(cid) then return false end
  1587. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end
  1588. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1589. doMoveInArea2(cid, eff, confusion, GROUNDDAMAGE, min, max, spell)
  1590. end
  1591.  
  1592. times = {0, 500, 1000, 1500, 2300, 2800, 3300, 3800, 4600, 5100, 5600, 6100, 6900, 7400, 7900, 8400, 9200, 10000}
  1593.  
  1594. setPlayerStorageValue(cid, 3644587, 1)
  1595. addEvent(setPlayerStorageValue, 10000, cid, 3644587, -1)
  1596. for i = 1, #times do --alterado v1.4
  1597. addEvent(doQuake, times[i], cid)
  1598. end
  1599.  
  1600. elseif spell == "Portais" then
  1601.  
  1602. local eff = getSubName(cid, target) == "Hoopa" and 135 or 135 --alterado v1.6.1
  1603.  
  1604. local function doQuake(cid)
  1605. if not isCreature(cid) then return false end
  1606. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end
  1607. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1608. doMoveInArea2(cid, eff, confusion, GROUNDDAMAGE, min, max, spell)
  1609. end
  1610.  
  1611. times = {0, 500, 1000, 1500, 2300, 2800, 3300, 3800, 4600, 5100, 5600, 6100, 6900, 7400, 7900, 8400, 9200, 10000}
  1612.  
  1613. setPlayerStorageValue(cid, 3644587, 1)
  1614. addEvent(setPlayerStorageValue, 10000, cid, 3644587, -1)
  1615. for i = 1, #times do --alterado v1.4
  1616. addEvent(doQuake, times[i], cid)
  1617. end
  1618.  
  1619. elseif spell == "PsyQuake" then
  1620.  
  1621. local eff = getSubName(cid, target) == "Hoopa" and 238 or 238 --alterado v1.6.1
  1622.  
  1623. local function doQuake(cid)
  1624. if not isCreature(cid) then return false end
  1625. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end
  1626. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1627. doMoveInArea2(cid, eff, confusion, PSYCHICDAMAGE, min, max, spell)
  1628. end
  1629.  
  1630. times = {0, 500, 1000, 1500, 2300, 2800, 3300, 3800, 4600, 5100, 5600, 6100, 6900, 7400, 7900, 8400, 9200, 10000, 10100, 11000, 15000, 18000, 20000}
  1631.  
  1632. setPlayerStorageValue(cid, 3644587, 1)
  1633. addEvent(setPlayerStorageValue, 10000, cid, 3644587, -1)
  1634. for i = 1, #times do --alterado v1.4
  1635. addEvent(doQuake, times[i], cid)
  1636. end
  1637.  
  1638. elseif spell == "DarkQuake" then
  1639.  
  1640. local eff = getSubName(cid, target) == "Mega Hoopa" and 136 or 136 --alterado v1.6.1
  1641.  
  1642. local function doQuake(cid)
  1643. if not isCreature(cid) then return false end
  1644. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end
  1645. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1646. doMoveInArea2(cid, eff, confusion, DARKDAMAGE, min, max, spell)
  1647. end
  1648.  
  1649. times = {0, 500, 1000, 1500, 2300, 2800, 3300, 3800, 4600, 5100, 5600, 6100, 6900, 7400, 7900, 8400, 9200, 10000, 10100, 11000, 15000, 18000, 20000}
  1650.  
  1651. setPlayerStorageValue(cid, 3644587, 1)
  1652. addEvent(setPlayerStorageValue, 10000, cid, 3644587, -1)
  1653. for i = 1, #times do --alterado v1.4
  1654. addEvent(doQuake, times[i], cid)
  1655. end
  1656.  
  1657. elseif spell == "LeafQuake" then
  1658.  
  1659. local eff = getSubName(cid, target) == "Tangrowth" and 105 or 105 --alterado v1.6.1
  1660.  
  1661. local function doQuake(cid)
  1662. if not isCreature(cid) then return false end
  1663. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end
  1664. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1665. doMoveInArea2(cid, eff, confusion, GRASSDAMAGE, min, max, spell)
  1666. end
  1667.  
  1668. times = {0, 500, 1000, 1500, 2300, 2800, 3300, 3800, 4600, 5100, 5600, 6100, 6900, 7400, 7900, 8400, 9200, 10000, 10100, 11000, 15000, 18000, 20000}
  1669.  
  1670. setPlayerStorageValue(cid, 3644587, 1)
  1671. addEvent(setPlayerStorageValue, 10000, cid, 3644587, -1)
  1672. for i = 1, #times do --alterado v1.4
  1673. addEvent(doQuake, times[i], cid)
  1674. end
  1675.  
  1676. elseif spell == "Stomp" then
  1677.  
  1678. local ret = {}
  1679. ret.id = 0
  1680. ret.cd = 9
  1681. ret.check = 0
  1682. ret.eff = 34
  1683. ret.spell = spell
  1684. ret.cond = "Stun"
  1685.  
  1686. doMoveInArea2(cid, 118, stomp, GROUNDDAMAGE, min, max, spell, ret)
  1687.  
  1688. elseif spell == "Toxic Spikes" then
  1689.  
  1690. local function doToxic(cid, target)
  1691. if not isCreature(cid) or not isCreature(target) then return true end --alterado v1.7
  1692. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 15)
  1693. doDanoInTargetWithDelay(cid, target, POISONDAMAGE, min, max, 114) --alterado v1.7
  1694. end
  1695.  
  1696. setPlayerStorageValue(cid, 3644587, 1)
  1697. addEvent(setPlayerStorageValue, 300, cid, 3644587, -1)
  1698. addEvent(doToxic, 0, cid, target)
  1699. addEvent(doToxic, 300, cid, target)
  1700.  
  1701. elseif spell == "Horn Drill" then
  1702.  
  1703. local function doHorn(cid, target)
  1704. if not isCreature(cid) or not isCreature(target) then return true end --alterado v1.7
  1705. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 25)
  1706. doDanoInTargetWithDelay(cid, target, NORMALDAMAGE, min, max, 3) --alterado v1.7
  1707. end
  1708.  
  1709. setPlayerStorageValue(cid, 3644587, 1)
  1710. addEvent(setPlayerStorageValue, 300, cid, 3644587, -1)
  1711. addEvent(doHorn, 0, cid, target)
  1712. addEvent(doHorn, 300, cid, target)
  1713.  
  1714. elseif spell == "Doubleslap" then
  1715.  
  1716. doAreaCombatHealth(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 148)
  1717.  
  1718. elseif spell == "Lovely Kiss" then
  1719.  
  1720. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 16)
  1721.  
  1722. local ret = {}
  1723. ret.id = target
  1724. ret.cd = 9
  1725. ret.check = getPlayerStorageValue(target, conds["Stun"])
  1726. ret.eff = 147
  1727. ret.spell = spell
  1728. ret.cond = "Stun"
  1729.  
  1730. addEvent(doMoveDano2, 100, cid, target, NORMALDAMAGE, 0, 0, ret, spell)
  1731.  
  1732. elseif spell == "Sing" then
  1733.  
  1734. local ret = {}
  1735. ret.id = 0
  1736. ret.cd = math.random(6, 10)
  1737. ret.check = 0
  1738. ret.first = true
  1739. ret.cond = "Sleep" --alterado v1.6
  1740.  
  1741. doMoveInArea2(cid, 33, selfArea1, NORMALDAMAGE, 0, 0, spell, ret)
  1742.  
  1743. elseif spell == "Multislap" then
  1744.  
  1745. doAreaCombatHealth(cid, NORMALDAMAGE, getThingPosWithDebug(cid), splash, -min, -max, 3)
  1746.  
  1747. elseif spell == "Metronome" then
  1748.  
  1749. local spells = {"Shadow Storm", "Electric Storm", "Magma Storm", "Blizzard", "Meteor Mash", "Leaf Storm", "Hydropump", "Falling Rocks"}
  1750.  
  1751. local random = math.random(1, #spells)
  1752.  
  1753. local randommove = spells[random]
  1754. local pos = getThingPosWithDebug(cid)
  1755. pos.y = pos.y - 1
  1756.  
  1757. doSendMagicEffect(pos, 161)
  1758.  
  1759. local function doMetronome(cid, skill)
  1760. if not isCreature(cid) then return true end
  1761. docastspell(cid, skill)
  1762. end
  1763.  
  1764. addEvent(doMetronome, 200, cid, randommove)
  1765.  
  1766. elseif spell == "Sketch 1" then
  1767.  
  1768. local spells = {"Psy Pulse", "Shadow Ball", "Thunder Bolt", "Ember", "Rock Throw", "Razor Leaf", "Bubbles", "Ice Shards", "Egg Bomb", "Poison Bomb"}
  1769.  
  1770. local random = math.random(1, #spells)
  1771.  
  1772. local randommove = spells[random]
  1773. local pos = getThingPosWithDebug(cid)
  1774. pos.y = pos.y - 1
  1775.  
  1776. doSendMagicEffect(pos, 0)
  1777.  
  1778. local function doMetronome(cid, skill)
  1779. if not isCreature(cid) then return true end
  1780. docastspell(cid, skill)
  1781. end
  1782.  
  1783. addEvent(doMetronome, 200, cid, randommove)
  1784.  
  1785. elseif spell == "Sketch 2" then
  1786.  
  1787. local spells = {"Mud Bomb", "Cyber Pulse", "Dark Pulse", "Rock Slide", "Magical Leaf", "Fireball", "Waterball", "Feather Dance"}
  1788.  
  1789. local random = math.random(1, #spells)
  1790.  
  1791. local randommove = spells[random]
  1792. local pos = getThingPosWithDebug(cid)
  1793. pos.y = pos.y - 1
  1794.  
  1795. doSendMagicEffect(pos, 0)
  1796.  
  1797. local function doMetronome(cid, skill)
  1798. if not isCreature(cid) then return true end
  1799. docastspell(cid, skill)
  1800. end
  1801.  
  1802. addEvent(doMetronome, 200, cid, randommove)
  1803.  
  1804. elseif spell == "Sketch 3" then
  1805.  
  1806. local spells = {"Poison Gas", "Earthquake", "Petal Tornado", "Electro Field", "Flame Wheel"}
  1807.  
  1808. local random = math.random(1, #spells)
  1809.  
  1810. local randommove = spells[random]
  1811. local pos = getThingPosWithDebug(cid)
  1812. pos.y = pos.y - 1
  1813.  
  1814. doSendMagicEffect(pos, 0)
  1815.  
  1816. local function doMetronome(cid, skill)
  1817. if not isCreature(cid) then return true end
  1818. docastspell(cid, skill)
  1819. end
  1820.  
  1821. addEvent(doMetronome, 200, cid, randommove)
  1822.  
  1823. elseif spell == "Sketch 4" then
  1824.  
  1825. local spells = {"Thunder", "Night Slash", "Confusion", "Air Slash", "Confusion", "Night Shade"}
  1826.  
  1827. local random = math.random(1, #spells)
  1828.  
  1829. local randommove = spells[random]
  1830. local pos = getThingPosWithDebug(cid)
  1831. pos.y = pos.y - 1
  1832.  
  1833. doSendMagicEffect(pos, 0)
  1834.  
  1835. local function doMetronome(cid, skill)
  1836. if not isCreature(cid) then return true end
  1837. docastspell(cid, skill)
  1838. end
  1839.  
  1840. addEvent(doMetronome, 200, cid, randommove)
  1841.  
  1842. elseif spell == "Sketch 5" then
  1843.  
  1844. local spells = {"Solar Beam", "Bullet Seed", "Raging Blast", "Fire Blast", "Bubble Blast", "Hydro Cannon", "Pin Missile"}
  1845.  
  1846. local random = math.random(1, #spells)
  1847.  
  1848. local randommove = spells[random]
  1849. local pos = getThingPosWithDebug(cid)
  1850. pos.y = pos.y - 1
  1851.  
  1852. doSendMagicEffect(pos, 0)
  1853.  
  1854. local function doMetronome(cid, skill)
  1855. if not isCreature(cid) then return true end
  1856. docastspell(cid, skill)
  1857. end
  1858.  
  1859. addEvent(doMetronome, 200, cid, randommove)
  1860.  
  1861. elseif spell == "Sketch 6" then
  1862.  
  1863. local spells = {"Shockwave", "Petal Dance", "Hyper Beam", "Zap Cannon", "Aurora Beam", "Ice Beam", "Ground Chop"}
  1864.  
  1865. local random = math.random(1, #spells)
  1866.  
  1867. local randommove = spells[random]
  1868. local pos = getThingPosWithDebug(cid)
  1869. pos.y = pos.y - 1
  1870.  
  1871. doSendMagicEffect(pos, 0)
  1872.  
  1873. local function doMetronome(cid, skill)
  1874. if not isCreature(cid) then return true end
  1875. docastspell(cid, skill)
  1876. end
  1877.  
  1878. addEvent(doMetronome, 200, cid, randommove)
  1879.  
  1880. elseif spell == "Sketch 7" then
  1881.  
  1882. local spells = {"Fear", "Sunny Day", "Scary Face", "Skull Bash", "Cotton Spore", "Sleep Powder"}
  1883.  
  1884. local random = math.random(1, #spells)
  1885.  
  1886. local randommove = spells[random]
  1887. local pos = getThingPosWithDebug(cid)
  1888. pos.y = pos.y - 1
  1889.  
  1890. doSendMagicEffect(pos, 0)
  1891.  
  1892. local function doMetronome(cid, skill)
  1893. if not isCreature(cid) then return true end
  1894. docastspell(cid, skill)
  1895. end
  1896.  
  1897. addEvent(doMetronome, 200, cid, randommove)
  1898.  
  1899. elseif spell == "Sketch 8" then
  1900.  
  1901. local spells = {"Reflect", "Charm", "Agility", "Safeguard", "Synthesis", "Emergency Call", "Healarea", "Sing"}
  1902.  
  1903. local random = math.random(1, #spells)
  1904.  
  1905. local randommove = spells[random]
  1906. local pos = getThingPosWithDebug(cid)
  1907. pos.y = pos.y - 1
  1908.  
  1909. doSendMagicEffect(pos, 0)
  1910.  
  1911. local function doMetronome(cid, skill)
  1912. if not isCreature(cid) then return true end
  1913. docastspell(cid, skill)
  1914. end
  1915.  
  1916. addEvent(doMetronome, 200, cid, randommove)
  1917.  
  1918. elseif spell == "Sketch 9" then
  1919.  
  1920. local spells = {"Psychic", "Epicenter", "Mortal Gas", "Hydropump", "Muddy Water"}
  1921.  
  1922. local random = math.random(1, #spells)
  1923.  
  1924. local randommove = spells[random]
  1925. local pos = getThingPosWithDebug(cid)
  1926. pos.y = pos.y - 1
  1927.  
  1928. doSendMagicEffect(pos, 0)
  1929.  
  1930. local function doMetronome(cid, skill)
  1931. if not isCreature(cid) then return true end
  1932. docastspell(cid, skill)
  1933. end
  1934.  
  1935. addEvent(doMetronome, 200, cid, randommove)
  1936.  
  1937. elseif spell == "Sketch 10" then
  1938.  
  1939. local spells = {"Focus Blast", "Blizzard", "Shadow Storm", "Falling Rocks", "Meteor Mash", "Electric Storm", "Hydro Dance", "Magma Storm", "Draco Meteor", "Psy Impact"}
  1940.  
  1941. local random = math.random(1, #spells)
  1942.  
  1943. local randommove = spells[random]
  1944. local pos = getThingPosWithDebug(cid)
  1945. pos.y = pos.y - 1
  1946.  
  1947. doSendMagicEffect(pos, 0)
  1948.  
  1949. local function doMetronome(cid, skill)
  1950. if not isCreature(cid) then return true end
  1951. docastspell(cid, skill)
  1952. end
  1953.  
  1954. addEvent(doMetronome, 200, cid, randommove)
  1955.  
  1956. elseif spell == "Focus" or spell == "Charge" or spell == "Swords Dance" then
  1957. --alterado v1.4
  1958. if spell == "Charge" then
  1959. doSendAnimatedText(getThingPosWithDebug(cid), "CHARGE", 168)
  1960. doSendMagicEffect(getThingPosWithDebug(cid), 177)
  1961. elseif spell == "Swords Dance" then
  1962. doSendMagicEffect(getThingPosWithDebug(cid), 132)
  1963. else
  1964. doSendAnimatedText(getThingPosWithDebug(cid), "FOCUS", 144)
  1965. doSendMagicEffect(getThingPosWithDebug(cid), 132)
  1966. end
  1967. setPlayerStorageValue(cid, 253, 1)
  1968.  
  1969. elseif spell == "Growth" then
  1970. --alterado v1.4
  1971. if spell == "Growth" then
  1972. doSendAnimatedText(getThingPosWithDebug(cid), "Growth", 168)
  1973. doSendMagicEffect(getThingPosWithDebug(cid), 177)
  1974. end
  1975. setPlayerStorageValue(cid, 253, 1)
  1976.  
  1977.  
  1978.  
  1979. --[[elseif spell == "Flame Wheel" then
  1980. --alterado v1.8 o atk ta la pra baixo agora...
  1981. local function sendFireEff(cid, dir)
  1982. if not isCreature(cid) then return true end
  1983. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end
  1984. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  1985. doDanoWithProtect(cid, FIREDAMAGE, getPosByDir(getThingPosWithDebug(cid), dir), 0, -min, -max, 15)
  1986. end
  1987.  
  1988. local function doWheel(cid)
  1989. if not isCreature(cid) then return true end
  1990. local t = {
  1991. [1] = SOUTH,
  1992. [2] = SOUTHEAST,
  1993. [3] = EAST,
  1994. [4] = NORTHEAST,
  1995. [5] = NORTH, --alterado!
  1996. [6] = NORTHWEST,
  1997. [7] = WEST,
  1998. [8] = SOUTHWEST,
  1999. }
  2000. for a = 1, 8 do
  2001. addEvent(sendFireEff, a * 140, cid, t[a])
  2002. end
  2003. end
  2004.  
  2005. doWheel(cid, false, cid) ]]
  2006.  
  2007. elseif spell == "Hyper Voice" then
  2008.  
  2009. local ret = {}
  2010. ret.id = 0
  2011. ret.cd = 9
  2012. ret.check = 0
  2013. ret.eff = 22
  2014. ret.spell = spell
  2015. ret.cond = "Stun"
  2016.  
  2017. doMoveInArea2(cid, 22, tw1, NORMALDAMAGE, min, max, spell, ret)
  2018.  
  2019. elseif spell == "Restore" or spell == "Selfheal" then
  2020.  
  2021. local min = (getCreatureMaxHealth(cid) * 75) / 100
  2022. local max = (getCreatureMaxHealth(cid) * 85) / 100
  2023.  
  2024. local function doHealArea(cid, min, max)
  2025. local amount = math.random(min, max)
  2026. if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
  2027. amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
  2028. end
  2029. if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
  2030. doCreatureAddHealth(cid, amount)
  2031. doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
  2032. end
  2033. end
  2034.  
  2035. doSendMagicEffect(getThingPosWithDebug(cid), 132)
  2036. doHealArea(cid, min, max)
  2037.  
  2038. elseif spell == "Aqua Ring" then
  2039.  
  2040. local min = (getCreatureMaxHealth(cid) * 75) / 100
  2041. local max = (getCreatureMaxHealth(cid) * 85) / 100
  2042.  
  2043. local function doHealArea(cid, min, max)
  2044. local amount = math.random(min, max)
  2045. if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
  2046. amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
  2047. end
  2048. if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
  2049. doCreatureAddHealth(cid, amount)
  2050. doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
  2051. end
  2052. end
  2053.  
  2054. doSendMagicEffect(getThingPosWithDebug(cid), 132)
  2055. doHealArea(cid, min, max)
  2056.  
  2057.  
  2058. elseif spell == "Healarea" then
  2059.  
  2060. local min = (getCreatureMaxHealth(cid) * 50) / 100
  2061. local max = (getCreatureMaxHealth(cid) * 60) / 100
  2062.  
  2063. local function doHealArea(cid, min, max)
  2064. local amount = math.random(min, max)
  2065. if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
  2066. amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
  2067. end
  2068. if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
  2069. doCreatureAddHealth(cid, amount)
  2070. doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
  2071. end
  2072. end
  2073.  
  2074. local pos = getPosfromArea(cid, heal)
  2075. local n = 0
  2076. doHealArea(cid, min, max)
  2077.  
  2078. while n < #pos do
  2079. n = n+1
  2080. thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
  2081. local pid = getThingFromPosWithProtect(thing)
  2082.  
  2083. doSendMagicEffect(pos[n], 12)
  2084. if isCreature(pid) then
  2085. if isSummon(cid) and (isSummon(pid) or isPlayer(pid)) then
  2086. if canAttackOther(cid, pid) == "Cant" then
  2087. doHealArea(pid, min, max)
  2088. end
  2089. elseif ehMonstro(cid) and ehMonstro(pid) then
  2090. doHealArea(pid, min, max)
  2091. end
  2092. end
  2093. end
  2094.  
  2095. elseif spell == "Milk Drink" then
  2096.  
  2097. local min = (getCreatureMaxHealth(cid) * 50) / 100
  2098. local max = (getCreatureMaxHealth(cid) * 60) / 100
  2099.  
  2100. local function doHealArea(cid, min, max)
  2101. local amount = math.random(min, max)
  2102. if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
  2103. amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
  2104. end
  2105. if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
  2106. doCreatureAddHealth(cid, amount)
  2107. doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
  2108. end
  2109. end
  2110.  
  2111. local pos = getPosfromArea(cid, heal)
  2112. local n = 0
  2113. doHealArea(cid, min, max)
  2114.  
  2115. while n < #pos do
  2116. n = n+1
  2117. thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
  2118. local pid = getThingFromPosWithProtect(thing)
  2119.  
  2120. doSendMagicEffect(pos[n], 12)
  2121. if isCreature(pid) then
  2122. if isSummon(cid) and (isSummon(pid) or isPlayer(pid)) then
  2123. if canAttackOther(cid, pid) == "Cant" then
  2124. doHealArea(pid, min, max)
  2125. end
  2126. elseif ehMonstro(cid) and ehMonstro(pid) then
  2127. doHealArea(pid, min, max)
  2128. end
  2129. end
  2130. end
  2131.  
  2132. elseif spell == "Toxic" then
  2133.  
  2134. doMoveInArea2(cid, 114, reto5, POISONDAMAGE, min, max, spell)
  2135.  
  2136. elseif spell == "Absorb" then
  2137.  
  2138. local life = getCreatureHealth(target)
  2139.  
  2140. doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14)
  2141.  
  2142. local newlife = life - getCreatureHealth(target)
  2143.  
  2144. doSendMagicEffect(getThingPosWithDebug(cid), 14)
  2145. if newlife >= 1 then
  2146. doCreatureAddHealth(cid, newlife)
  2147. doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32)
  2148. end
  2149.  
  2150. elseif spell == "Poison Bomb" then
  2151.  
  2152. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 14)
  2153. doDanoWithProtectWithDelay(cid, target, POISONDAMAGE, min, max, 20, bombWee2)
  2154.  
  2155. elseif spell == "Poison Gas" then
  2156.  
  2157. local dmg = isSummon(cid) and getMasterLevel(cid)+getPokemonBoost(cid) or getPokemonLevel(cid)
  2158.  
  2159. local ret = {id = 0, cd = 13, eff = 34, check = 0, spell = spell, cond = "Miss"}
  2160. local ret2 = {id = 0, cd = 13, check = 0, damage = dmg, cond = "Poison"} --rever isso ainda!!
  2161.  
  2162. local function gas(cid)
  2163. doMoveInArea2(cid, 114, confusion, POISONDAMAGE, 0, 0, spell, ret)
  2164. doMoveInArea2(cid, 0, confusion, POISONDAMAGE, min, max, spell)
  2165. end
  2166.  
  2167. times = {0, 500, 1000, 1500, 2300, 2800, 3300, 3800, 4600, 5100, 5600, 6100, 6900, 7400, 7900, 8400, 9200, 10000}
  2168.  
  2169. for i = 1, #times do
  2170. addEvent(gas, times[i], cid)
  2171. end
  2172.  
  2173. elseif spell == "Petal Dance" then
  2174.  
  2175. doMoveInAreaMulti(cid, 21, 245, bullet, bulletDano, GRASSDAMAGE, min, max)
  2176.  
  2177.  
  2178. elseif spell == "Dynamic Punch" then
  2179.  
  2180. local pos = getThingPosWithDebug(cid)
  2181. local areas = {rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1}
  2182.  
  2183. for i = 0, 9 do
  2184. addEvent(doMoveInArea2, i*400, cid, 112, areas[i+1], FIGHTINGDAMAGE, min, max, spell)
  2185. addEvent(doMoveInArea2, i*410, cid, 112, areas[i+1], FIGHTINGDAMAGE, 0, 0, spell)
  2186. end
  2187.  
  2188.  
  2189. elseif spell == "Revenge" then
  2190.  
  2191. local function doRevenge(cid)
  2192. if not isCreature(cid) then return false end
  2193. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end
  2194. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  2195. local rev = getThingPosWithDebug(cid)
  2196. rev.x = rev.x+1
  2197. rev.y = rev.y+1
  2198. doSendMagicEffect(rev, 99)
  2199. doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPosWithDebug(cid), splash, -min, -max, 255)
  2200.  
  2201. end
  2202.  
  2203. times = {0, 500, 1000, 1500, 2300}
  2204.  
  2205. setPlayerStorageValue(cid, 3644587, 1)
  2206. addEvent(setPlayerStorageValue, 10000, cid, 3644587, -1)
  2207. for i = 1, #times do --alterado v1.4
  2208. addEvent(doRevenge, times[i], cid)
  2209. end
  2210.  
  2211.  
  2212. elseif spell == "Close Combat" then
  2213. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 26)
  2214. doDanoInTargetWithDelay(cid, target, FIGHTINGDAMAGE, -min, -max, 237) --alterado v1.7
  2215. doSendAnimatedText(getThingPosWithDebug(cid), "FOCUS", 144)
  2216. setPlayerStorageValue(cid, 253, 1)
  2217.  
  2218. elseif spell == "Sand Storm" then
  2219.  
  2220. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  2221. ------------
  2222. local ret = {}
  2223. ret.id = 0
  2224. ret.cd = 9
  2225. ret.check = 0
  2226. ret.eff = 34
  2227. ret.cond = "Silence"
  2228. ---
  2229. local function doFall(cid)
  2230. for rocks = 1, 42 do --62
  2231. addEvent(fall, rocks*35, cid, master, GROUNDDAMAGE, 22, 158)
  2232. end
  2233. end
  2234. ---
  2235. local function doRain(cid)
  2236. if isSummon(cid) then
  2237. doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")
  2238. end --cura status
  2239. doCureStatus(cid, "all")
  2240. ---
  2241. setPlayerStorageValue(cid, 253, 1) --focus
  2242. doSendMagicEffect(getThingPosWithDebug(cid), 132)
  2243. ---
  2244. doMoveInArea2(cid, 0, confusion, GROUNDDAMAGE, 0, 0, spell, ret)
  2245. end
  2246. ---
  2247. addEvent(doFall, 200, cid)
  2248. addEvent(doRain, 1000, cid)
  2249.  
  2250. elseif spell == "Powder Snow" then
  2251.  
  2252. snowP = getThingPosWithDebug(cid)
  2253.  
  2254. local ret = {}
  2255. ret.id = 0
  2256. ret.cd = 10
  2257. ret.check = 0
  2258. ret.eff = 43
  2259. ret.spell = spell
  2260. ret.cond = "Slow"
  2261.  
  2262. doMoveInArea2(cid, 0, check, ICEDAMAGE, min, max, spell, ret)
  2263. doSendMagicEffect({x = snowP.x + 1, y = snowP.y, z = snowP.z}, 206)
  2264.  
  2265. elseif spell == "Slash" then
  2266.  
  2267. doAreaCombatHealth(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 159)
  2268.  
  2269. elseif spell == "X-Scissor" then
  2270.  
  2271. local a = getThingPosWithDebug(cid)
  2272.  
  2273. local X = {
  2274. {{x = a.x+1, y = a.y, z = a.z}, 16}, --norte
  2275. {{x = a.x+2, y = a.y+1, z = a.z}, 221}, --leste
  2276. {{x = a.x+1, y = a.y+2, z = a.z}, 223}, --sul
  2277. {{x = a.x, y = a.y+1, z = a.z}, 243}, --oeste
  2278. }
  2279.  
  2280. local pos = X[mydir+1]
  2281.  
  2282. for b = 1, 3 do
  2283. addEvent(doSendMagicEffect, b * 70, pos[1], pos[2])
  2284. end
  2285.  
  2286. doMoveInArea2(cid, 2, xScissor, BUGDAMAGE, min, max, spell)
  2287.  
  2288. elseif spell == "Psychic" then
  2289.  
  2290. doDanoWithProtect(cid, psyDmg, getThingPosWithDebug(cid), selfArea2, min, max, 133)
  2291.  
  2292. elseif spell == "Pay Day" then
  2293.  
  2294. --alterado v1.7
  2295. local function doThunderFall(cid, frompos, target)
  2296. if not isCreature(target) or not isCreature(cid) then return true end
  2297. local pos = getThingPosWithDebug(target)
  2298. local ry = math.abs(frompos.y - pos.y)
  2299. doSendDistanceShoot(frompos, getThingPosWithDebug(target), 39)
  2300. addEvent(doDanoInTarget, ry * 11, cid, target, NORMALDAMAGE, min, max, 28) --alterado v1.7
  2301. end
  2302.  
  2303. local function doThunderUp(cid, target)
  2304. if not isCreature(target) or not isCreature(cid) then return true end
  2305. local pos = getThingPosWithDebug(target)
  2306. local mps = getThingPosWithDebug(cid)
  2307. local xrg = math.floor((pos.x - mps.x) / 2)
  2308. local topos = mps
  2309. topos.x = topos.x + xrg
  2310. local rd = 7
  2311. topos.y = topos.y - rd
  2312. doSendDistanceShoot(getThingPosWithDebug(cid), topos, 39)
  2313. addEvent(doThunderFall, rd * 49, cid, topos, target)
  2314. end
  2315.  
  2316. setPlayerStorageValue(cid, 3644587, 1)
  2317. addEvent(setPlayerStorageValue, 350, cid, 3644587, -1)
  2318. for thnds = 1, 2 do
  2319. addEvent(doThunderUp, thnds * 155, cid, target)
  2320. end
  2321.  
  2322. elseif spell == "Psywave" then
  2323.  
  2324. doMoveInArea2(cid, 133, db1, psyDmg, min, max, spell)
  2325.  
  2326. elseif spell == "Triple Kick" or spell == "Triple Kick Lee" then
  2327.  
  2328. doDanoWithProtect(cid, FIGHTINGDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 110)
  2329.  
  2330. elseif spell == "Karate Chop" then
  2331.  
  2332. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  2333. doDanoInTargetWithDelay(cid, target, FIGHTINGDAMAGE, -min, -max, 113) --alterado v1.7
  2334.  
  2335. elseif spell == "Ground Chop" then
  2336.  
  2337. local p = getThingPosWithDebug(cid)
  2338. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  2339.  
  2340. function sendAtk(cid, area, area2, eff) --alterado v1.6
  2341. if isCreature(cid) then
  2342. if not isSightClear(p, area, false) then return true end
  2343. doAreaCombatHealth(cid, FIGHTINGDAMAGE, area, 0, 0, 0, eff)
  2344. doAreaCombatHealth(cid, FIGHTINGDAMAGE, area2, whirl3, -min, -max, 255) --alterado v1.6
  2345. end
  2346. end
  2347.  
  2348. for a = 0, 4 do
  2349.  
  2350. local t = {
  2351. [0] = {99, {x=p.x+1, y=p.y-(a+1), z=p.z}, {x=p.x, y=p.y-(a+1), z=p.z}}, --alterado v1.6
  2352. [1] = {99, {x=p.x+(a+2), y=p.y+1, z=p.z}, {x=p.x+(a+1), y=p.y, z=p.z}},
  2353. [2] = {99, {x=p.x+1, y=p.y+(a+2), z=p.z}, {x=p.x, y=p.y+(a+1), z=p.z}},
  2354. [3] = {99, {x=p.x-(a+1), y=p.y+1, z=p.z}, {x=p.x-(a+1), y=p.y, z=p.z}}
  2355. }
  2356. addEvent(sendAtk, 270*a, cid, t[d][2], t[d][3], t[d][1]) --alterado v1.6
  2357. end
  2358.  
  2359. elseif spell == "Mega Punch" then
  2360.  
  2361. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  2362. doDanoInTargetWithDelay(cid, target, FIGHTINGDAMAGE, -min, -max, 112) --alterado v1.7
  2363.  
  2364. elseif spell == "Tri Flames" then
  2365.  
  2366. local ret = {}
  2367. ret.id = 0
  2368. ret.cd = 9
  2369. ret.check = 0
  2370. ret.eff = 39
  2371. ret.cond = "Silence"
  2372.  
  2373. doMoveInArea2(cid, 6, triflames, FIREDAMAGE, min, max, spell, ret)
  2374.  
  2375. elseif spell == "War Dog" then
  2376.  
  2377. local ret = {}
  2378. ret.id = cid
  2379. ret.cd = 15
  2380. ret.eff = 28
  2381. ret.check = 0
  2382. ret.buff = spell
  2383. ret.first = true
  2384.  
  2385. doCondition2(ret)
  2386.  
  2387. elseif spell == "Hypnosis" then
  2388.  
  2389. local ret = {}
  2390. ret.id = target
  2391. ret.cd = math.random(6, 9)
  2392. ret.check = getPlayerStorageValue(target, conds["Sleep"])
  2393. ret.first = true --alterado v1.6
  2394. ret.cond = "Sleep"
  2395.  
  2396. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 24)
  2397. addEvent(doMoveDano2, 150, cid, target, PSYCHICDAMAGE, 0, 0, ret, spell)
  2398.  
  2399. elseif spell == "Dizzy Punch" then
  2400.  
  2401. local rounds = getPokemonLevel(cid) / 12
  2402. rounds = rounds + 2
  2403.  
  2404. local ret = {}
  2405. ret.id = target
  2406. ret.check = getPlayerStorageValue(target, conds["Confusion"])
  2407. ret.cd = rounds
  2408. ret.cond = "Confusion"
  2409.  
  2410. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 26)
  2411. doDanoWithProtect(cid, FIGHTINGDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 112)
  2412. addEvent(doMoveDano2, 50, cid, target, NORMALDAMAGE, 0, 0, ret, spell)
  2413.  
  2414. elseif spell == "Ice Punch" then
  2415.  
  2416. local ret = {}
  2417. ret.id = target
  2418. ret.cd = 9
  2419. ret.eff = 43
  2420. ret.check = getPlayerStorageValue(target, conds["Slow"])
  2421. ret.first = true
  2422. ret.cond = "Slow"
  2423.  
  2424. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 28)
  2425. doSendMagicEffect(getThingPosWithDebug(target), 112)
  2426. doDanoWithProtectWithDelay(cid, target, ICEDAMAGE, min, max, 43)
  2427. addEvent(doMoveDano2, 50, cid, target, ICEDAMAGE, 0, 0, ret, spell)
  2428.  
  2429. elseif spell == "Ice Beam" then
  2430.  
  2431. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  2432. local p = getThingPosWithDebug(cid)
  2433. local t = {
  2434. [0] = {97, {x=p.x+1, y=p.y-1, z=p.z}},
  2435. [1] = {96, {x=p.x+6, y=p.y+1, z=p.z}},
  2436. [2] = {97, {x=p.x+1, y=p.y+6, z=p.z}},
  2437. [3] = {96, {x=p.x-1, y=p.y+1, z=p.z}},
  2438. }
  2439.  
  2440. local ret = {}
  2441. ret.id = 0
  2442. ret.cd = 9
  2443. ret.eff = 43
  2444. ret.check = 0
  2445. ret.first = true
  2446. ret.cond = "Slow"
  2447.  
  2448. doMoveInArea2(cid, 0, triplo6, ICEDAMAGE, min, max, spell, ret)
  2449. doSendMagicEffect(t[a][2], t[a][1])
  2450.  
  2451.  
  2452. elseif spell == "Psy Pulse" or spell == "Cyber Pulse" or spell == "Dark Pulse" then
  2453.  
  2454. damage = skill == "Dark Pulse" and DARKDAMAGE or psyDmg
  2455.  
  2456. local function doPulse(cid, eff)
  2457. if not isCreature(cid) then return true end
  2458. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 3)
  2459. doDanoInTargetWithDelay(cid, target, damage, min, max, eff) --alterado v1.7
  2460. end
  2461.  
  2462. if spell == "Cyber Pulse" then
  2463. eff = 11
  2464. elseif spell == "Dark Pulse" then
  2465. eff = 47 --efeito n eh esse mas... ;p
  2466. else
  2467. eff = 133
  2468. end
  2469.  
  2470. addEvent(doPulse, 0, cid, eff)
  2471. addEvent(doPulse, 250, cid, eff)
  2472.  
  2473. elseif spell == "Psyusion" then
  2474.  
  2475. local rounds = math.random(4, 7)
  2476. rounds = rounds + math.floor(getPokemonLevel(cid) / 35)
  2477. local eff = {136, 133, 136, 133, 137}
  2478. local area = {psy1, psy2, psy3, psy4, psy5}
  2479.  
  2480. local ret = {}
  2481. ret.id = 0
  2482. ret.check = 0
  2483. ret.cd = rounds
  2484. ret.cond = "Confusion"
  2485.  
  2486. setPlayerStorageValue(cid, 3644587, 1)
  2487. addEvent(setPlayerStorageValue, 4*400, cid, 3644587, -1)
  2488. for i = 0, 4 do
  2489. addEvent(doMoveInArea2, i*400, cid, eff[i+1], area[i+1], psyDmg, min, max, spell, ret)
  2490. end
  2491.  
  2492. elseif spell == "Triple Punch" then
  2493.  
  2494. doDanoWithProtect(cid, FIGHTINGDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 110)
  2495.  
  2496. elseif spell == "Fist Machine" then
  2497.  
  2498. local mpos = getThingPosWithDebug(cid)
  2499. local b = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  2500. local effect = 0
  2501. local xvar = 0
  2502. local yvar = 0
  2503.  
  2504. if b == SOUTH then
  2505. effect = 218
  2506. yvar = 2
  2507. elseif b == NORTH then
  2508. effect = 217
  2509. elseif b == WEST then
  2510. effect = 216
  2511. elseif b == EAST then
  2512. effect = 215
  2513. xvar = 2
  2514. end
  2515.  
  2516. mpos.x = mpos.x + xvar
  2517. mpos.y = mpos.y + yvar
  2518.  
  2519. doSendMagicEffect(mpos, effect)
  2520. doMoveInArea2(cid, 0, machine, FIGHTINGDAMAGE, min, max, spell)
  2521.  
  2522. elseif spell == "Destroyer Hand" then
  2523.  
  2524. doMoveInAreaMulti(cid, 26, 111, bullet, bulletDano, FIGHTINGDAMAGE, min, max)
  2525.  
  2526. elseif spell == "Rock Throw" then
  2527.  
  2528. local effD = getSubName(cid, target) == "Shiny Onix" and 0 or 11
  2529. local eff = getSubName(cid, target) == "Shiny Onix" and 176 or 44 --alterado v1.6.1
  2530.  
  2531. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), effD)
  2532. doDanoInTargetWithDelay(cid, target, ROCKDAMAGE, min, max, eff) --alterado v1.7
  2533.  
  2534. elseif spell == "Rock Slide" or spell == "Stone Edge" then
  2535.  
  2536. atk = {
  2537. ["Rock Slide"] = {11, 44, 0, 176},
  2538. ["Stone Edge"] = {11, 239}
  2539. }
  2540.  
  2541. local effD = getSubName(cid, target) == "Shiny Onix" and atk[spell][3] or atk[spell][1]
  2542. local eff = getSubName(cid, target) == "Shiny Onix" and atk[spell][4] or atk[spell][2] --alterado v1.6.1
  2543.  
  2544. --alterado v1.7
  2545. local function doRockFall(cid, frompos, target)
  2546. if not isCreature(target) or not isCreature(cid) then return true end
  2547. local pos = getThingPosWithDebug(target)
  2548. local ry = math.abs(frompos.y - pos.y)
  2549. doSendDistanceShoot(frompos, getThingPosWithDebug(target), effD)
  2550. addEvent(doDanoInTarget, ry * 11, cid, target, ROCKDAMAGE, min, max, eff) --alterado v1.7
  2551. end
  2552.  
  2553. local function doRockUp(cid, target)
  2554. if not isCreature(target) or not isCreature(cid) then return true end
  2555. local pos = getThingPosWithDebug(target)
  2556. local mps = getThingPosWithDebug(cid)
  2557. local xrg = math.floor((pos.x - mps.x) / 2)
  2558. local topos = mps
  2559. topos.x = topos.x + xrg
  2560. local rd = 7
  2561. topos.y = topos.y - rd
  2562. doSendDistanceShoot(getThingPosWithDebug(cid), topos, effD)
  2563. addEvent(doRockFall, rd * 49, cid, topos, target)
  2564. end
  2565.  
  2566. setPlayerStorageValue(cid, 3644587, 1)
  2567. addEvent(setPlayerStorageValue, 350, cid, 3644587, -1)
  2568. for thnds = 1, 2 do
  2569. addEvent(doRockUp, thnds * 155, cid, target)
  2570. end
  2571.  
  2572. elseif spell == "Falling Rocks" then
  2573.  
  2574. local effD = getSubName(cid, target) == "Shiny Onix" and 0 or 11
  2575. local eff = getSubName(cid, target) == "Shiny Onix" and 176 or 44 --alterado v1.6.1
  2576.  
  2577. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  2578. ------------
  2579.  
  2580. local function doFall(cid)
  2581. for rocks = 1, 62 do
  2582. addEvent(fall, rocks*35, cid, master, ROCKDAMAGE, effD, eff)
  2583. end
  2584. end
  2585.  
  2586. for up = 1, 10 do
  2587. addEvent(upEffect, up*75, cid, effD)
  2588. end
  2589. addEvent(doFall, 450, cid)
  2590. addEvent(doDanoWithProtect, 1400, cid, ROCKDAMAGE, getThingPosWithDebug(cid), waterarea, -min, -max, 0)
  2591.  
  2592. elseif spell == "Selfdestruct" then
  2593.  
  2594. local function death(cid)
  2595. if isCreature(cid) then
  2596. if pokeHaveReflect(cid) then return true end --alterado v1.6
  2597. doCreatureAddHealth(cid, -getCreatureMaxHealth(cid))
  2598. end
  2599. end
  2600.  
  2601. doMoveInArea2(cid, 5, selfArea1, NORMALDAMAGE, min, max, spell) --alterado v1.6
  2602. addEvent(death, 300, cid)
  2603.  
  2604. elseif spell == "Crusher Stomp" then
  2605.  
  2606. local pL = getThingPosWithDebug(cid)
  2607. pL.x = pL.x+5
  2608. pL.y = pL.y+1
  2609. -----------------
  2610. local pO = getThingPosWithDebug(cid)
  2611. pO.x = pO.x-3
  2612. pO.y = pO.y+1
  2613. ------------------
  2614. local pN = getThingPosWithDebug(cid)
  2615. pN.x = pN.x+1
  2616. pN.y = pN.y+5
  2617. -----------------
  2618. local pS = getThingPosWithDebug(cid)
  2619. pS.x = pS.x+1
  2620. pS.y = pS.y-3
  2621.  
  2622. local po = {pL, pO, pN, pS}
  2623. local po2 = {
  2624. {x = pL.x, y = pL.y-1, z = pL.z},
  2625. {x = pO.x, y = pO.y-1, z = pO.z},
  2626. {x = pN.x-1, y = pN.y, z = pN.z},
  2627. {x = pS.x-1, y = pS.y, z = pS.z},
  2628. }
  2629.  
  2630. local ret = {}
  2631. ret.id = 0
  2632. ret.cd = 9
  2633. ret.check = 0
  2634. ret.eff = 34
  2635. ret.spell = spell
  2636. ret.cond = "Stun"
  2637.  
  2638. for i = 1, 4 do
  2639. doSendMagicEffect(po[i], 127)
  2640. doAreaCombatHealth(cid, GROUNDDAMAGE, po2[i], crusher, -min, -max, 255)
  2641. end
  2642. doMoveInArea2(cid, 118, stomp, GROUNDDAMAGE, min, max, spell, ret)
  2643.  
  2644. elseif spell == "Water Pulse" then
  2645.  
  2646. doDanoWithProtect(cid, WATERDAMAGE, getThingPosWithDebug(cid), selfArea2, min, max, 155)
  2647.  
  2648. elseif spell == "Sonicboom" then
  2649.  
  2650. local function doBoom(cid)
  2651. if not isCreature(cid) then return true end
  2652. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 33)
  2653. doDanoInTargetWithDelay(cid, target, NORMALDAMAGE, min, max, 3) --alterado v1.7
  2654. end
  2655.  
  2656. addEvent(doBoom, 0, cid)
  2657. addEvent(doBoom, 250, cid)
  2658.  
  2659. elseif spell == "Stickmerang" then
  2660.  
  2661. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 34)
  2662. doDanoInTargetWithDelay(cid, target, FLYINGDAMAGE, min, max, 212) --alterado v1.7
  2663.  
  2664. elseif spell == "Stickslash" then
  2665.  
  2666. local function sendStickEff(cid, dir)
  2667. if not isCreature(cid) then return true end
  2668. doAreaCombatHealth(cid, FLYINGDAMAGE, getPosByDir(getThingPosWithDebug(cid), dir), 0, -min, -max, 212)
  2669. end
  2670.  
  2671. local function doStick(cid)
  2672. if not isCreature(cid) then return true end
  2673. local t = {
  2674. [1] = SOUTHWEST,
  2675. [2] = SOUTH,
  2676. [3] = SOUTHEAST,
  2677. [4] = EAST,
  2678. [5] = NORTHEAST,
  2679. [6] = NORTH,
  2680. [7] = NORTHWEST,
  2681. [8] = WEST,
  2682. [9] = SOUTHWEST,
  2683. }
  2684. for a = 1, 9 do
  2685. addEvent(sendStickEff, a * 140, cid, t[a])
  2686. end
  2687. end
  2688.  
  2689. doStick(cid, false, cid)
  2690.  
  2691. elseif spell == "Stick Throw" then
  2692.  
  2693. local area = {Throw01, Throw02, Throw03, Throw04, Throw03, Throw02, Throw01}
  2694.  
  2695. for i = 0, 6 do
  2696. addEvent(doMoveInArea2, i*400, cid, 212, area[i+1], FLYINGDAMAGE, min, max, spell)
  2697. end
  2698.  
  2699. elseif spell == "Cannon Ball" then
  2700.  
  2701. local area = {Throw01, Throw02, Throw03, Throw04, Throw03, Throw02, Throw01}
  2702.  
  2703. for i = 0, 6 do
  2704. addEvent(doMoveInArea2, i*400, cid, 100, area[i+1], GROUNDDAMAGE, min, max, spell)
  2705. end
  2706.  
  2707.  
  2708. elseif spell == "Pluck" then
  2709.  
  2710. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  2711. doDanoInTargetWithDelay(cid, target, FLYINGDAMAGE, min, max, 111) --alterado v1.7
  2712.  
  2713. elseif spell == "Tri-Attack" then
  2714.  
  2715. --alterado v1.7
  2716. setPlayerStorageValue(cid, 3644587, 1)
  2717. addEvent(setPlayerStorageValue, 600, cid, 3644587, -1)
  2718. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 42) --alterado v1.6
  2719. for i = 0, 2 do
  2720. addEvent(doDanoInTargetWithDelay, i*300, cid, target, NORMALDAMAGE, min, max, 238) --alterado v1.7
  2721. end
  2722.  
  2723. elseif spell == "Fury Attack" then
  2724.  
  2725. --alterado v1.7
  2726. setPlayerStorageValue(cid, 3644587, 1)
  2727. addEvent(setPlayerStorageValue, 600, cid, 3644587, -1)
  2728. for i = 0, 2 do
  2729. addEvent(doDanoInTargetWithDelay, i*300, cid, target, NORMALDAMAGE, min, max, 110) --alterado v1.7
  2730. end
  2731.  
  2732. elseif spell == "Ice Shards" then
  2733.  
  2734. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 28)
  2735. doDanoInTargetWithDelay(cid, target, ICEDAMAGE, min, max, 43) --alterado v1.7
  2736.  
  2737. elseif spell == "Icy Wind" then
  2738.  
  2739. local ret = {}
  2740. ret.id = 0
  2741. ret.cd = 9
  2742. ret.eff = 43
  2743. ret.check = 0
  2744. ret.first = true
  2745. ret.cond = "Slow"
  2746.  
  2747. doMoveInArea2(cid, 17, db1, ICEDAMAGE, min, max, spell, ret)
  2748.  
  2749. elseif spell == "Aurora Beam" then
  2750.  
  2751. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  2752. local p = getThingPosWithDebug(cid)
  2753. local t = {
  2754. [0] = {186, {x=p.x+1, y=p.y-1, z=p.z}},
  2755. [1] = {57, {x=p.x+6, y=p.y+1, z=p.z}}, --alterado v1.6
  2756. [2] = {186, {x=p.x+1, y=p.y+6, z=p.z}},
  2757. [3] = {57, {x=p.x-1, y=p.y+1, z=p.z}}, --alterado v1.6
  2758. }
  2759.  
  2760. local ret = {}
  2761. ret.id = 0
  2762. ret.cd = 9
  2763. ret.eff = 43
  2764. ret.check = 0
  2765. ret.first = true
  2766. ret.cond = "Slow"
  2767.  
  2768. doMoveInArea2(cid, 0, triplo6, ICEDAMAGE, min, max, spell, ret)
  2769. doSendMagicEffect(t[a][2], t[a][1])
  2770.  
  2771. elseif spell == "Rest" then
  2772.  
  2773. local ret = {}
  2774. ret.id = cid
  2775. ret.cd = 6
  2776. ret.eff = 0
  2777. ret.check = 0
  2778. ret.buff = spell
  2779. ret.first = true
  2780.  
  2781. doCondition2(ret)
  2782.  
  2783. elseif spell == "Sludge" then
  2784.  
  2785. --alterado v1.7
  2786. local function doSludgeFall(cid, frompos, target)
  2787. if not isCreature(target) or not isCreature(cid) then return true end
  2788. local pos = getThingPosWithDebug(target)
  2789. local ry = math.abs(frompos.y - pos.y)
  2790. doSendDistanceShoot(frompos, getThingPosWithDebug(target), 6)
  2791. addEvent(doDanoInTargetWithDelay, ry * 11, cid, target, POISONDAMAGE, min, max, 116) --alterado v1.7
  2792. end
  2793.  
  2794. local function doSludgeUp(cid, target)
  2795. if not isCreature(target) or not isCreature(cid) then return true end
  2796. local pos = getThingPosWithDebug(target)
  2797. local mps = getThingPosWithDebug(cid)
  2798. local xrg = math.floor((pos.x - mps.x) / 2)
  2799. local topos = mps
  2800. topos.x = topos.x + xrg
  2801. local rd = 7
  2802. topos.y = topos.y - rd
  2803. doSendDistanceShoot(getThingPosWithDebug(cid), topos, 6)
  2804. addEvent(doSludgeFall, rd * 49, cid, topos, target)
  2805. end
  2806.  
  2807. setPlayerStorageValue(cid, 3644587, 1)
  2808. addEvent(setPlayerStorageValue, 350, cid, 3644587, -1)
  2809. for thnds = 1, 2 do
  2810. addEvent(doSludgeUp, thnds * 155, cid, target)
  2811. end --alterado v1.5
  2812.  
  2813. elseif spell == "Mud Bomb" then
  2814.  
  2815. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 6) --alterado v1.8
  2816. doDanoWithProtectWithDelay(cid, target, MUDBOMBDAMAGE, min, max, 116, bombWee2)
  2817.  
  2818. elseif spell == "Mortal Gas" then
  2819.  
  2820. local pos = getThingPosWithDebug(cid)
  2821.  
  2822. local function doSendAcid(cid, pos)
  2823. if not isCreature(cid) then return true end
  2824. doSendDistanceShoot(getThingPosWithDebug(cid), pos, 14)
  2825. doSendMagicEffect(pos, 114)
  2826. end
  2827.  
  2828. for b = 1, 3 do
  2829. for a = 1, 20 do
  2830. local lugar = {x = pos.x + math.random(-4, 4), y = pos.y + math.random(-3, 3), z = pos.z}
  2831. addEvent(doSendAcid, a * 75, cid, lugar)
  2832. end
  2833. end
  2834. doDanoWithProtect(cid, POISONDAMAGE, pos, waterarea, -min, -max, 0)
  2835.  
  2836. elseif spell == "Rock Drill" or spell == "Megahorn" or spell == "Rock Blast" then
  2837.  
  2838. local damage = spell == "Megahorn" and BUGDAMAGE or ROCKDAMAGE
  2839. local eff = spell == "Megahorn" and 8 or 44
  2840. local effD = spell == "Rock Blast" and 11 or 25
  2841. --cid, effDist, effDano, areaEff, areaDano, element, min, max
  2842. doMoveInAreaMulti(cid, effD, eff, bullet, bulletDano, damage, min, max)
  2843.  
  2844. elseif spell == "Egg Bomb" then
  2845.  
  2846. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 12)
  2847. doDanoWithProtectWithDelay(cid, target, NORMALDAMAGE, min, max, 5, crusher)
  2848.  
  2849. elseif spell == "Super Vines" then
  2850.  
  2851. stopNow(cid, 200) --alterado v1.6
  2852. doCreatureSetLookDir(cid, 2)
  2853.  
  2854. local effect = 0
  2855. local pos = getThingPosWithDebug(cid)
  2856. pos.x = pos.x + 1
  2857. pos.y = pos.y + 1
  2858.  
  2859. local effect = getSubName(cid, target) == "Tangrowth" and 268 or 229 --alterado v1.6.1
  2860.  
  2861. doSendMagicEffect(pos, effect)
  2862. doDanoWithProtect(cid, GRASSDAMAGE, getThingPosWithDebug(cid), splash, -min, -max, 0)
  2863.  
  2864. elseif spell == "Epicenter" then
  2865.  
  2866. doMoveInArea2(cid, 127, epicenter, GROUNDDAMAGE, min, max, spell)
  2867.  
  2868. elseif spell == "Bubblebeam" then
  2869.  
  2870. local function sendBubbles(cid)
  2871. if not isCreature(cid) or not isCreature(target) then return true end
  2872. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 2)
  2873. doDanoInTargetWithDelay(cid, target, WATERDAMAGE, min, max, 68) --alterado v1.7
  2874. end
  2875.  
  2876. sendBubbles(cid)
  2877. addEvent(sendBubbles, 250, cid)
  2878.  
  2879. elseif spell == "Swift" then
  2880.  
  2881. local function sendSwift(cid, target)
  2882. if not isCreature(cid) or not isCreature(target) then return true end
  2883. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 32)
  2884. doDanoInTargetWithDelay(cid, target, NORMALDAMAGE, min, max, 3) --alterado v1.7
  2885. end
  2886.  
  2887. addEvent(sendSwift, 100, cid, target)
  2888. addEvent(sendSwift, 200, cid, target)
  2889.  
  2890. elseif spell == "Spark" then
  2891.  
  2892. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 32)
  2893. doDanoInTargetWithDelay(cid, target, ELECTRICDAMAGE, min, max, 48) --alterado v1.7
  2894.  
  2895.  
  2896. elseif spell == "Mimic Wall" then
  2897.  
  2898. local p = getThingPosWithDebug(cid)
  2899. local dirr = getCreatureLookDir(cid)
  2900.  
  2901. if dirr == 0 or dirr == 2 then
  2902. item = 11439
  2903. else
  2904. item = 11440
  2905. end
  2906.  
  2907. local wall = {
  2908. [0] = {{x = p.x, y = p.y-1, z = p.z}, {x = p.x+1, y = p.y-1, z = p.z}, {x = p.x-1, y = p.y-1, z = p.z}},
  2909. [2] = {{x = p.x, y = p.y+1, z = p.z}, {x = p.x+1, y = p.y+1, z = p.z}, {x = p.x-1, y = p.y+1, z = p.z}},
  2910. [1] = {{x = p.x+1, y = p.y, z = p.z}, {x = p.x+1, y = p.y+1, z = p.z}, {x = p.x+1, y = p.y-1, z = p.z}},
  2911. [3] = {{x = p.x-1, y = p.y, z = p.z}, {x = p.x-1, y = p.y+1, z = p.z}, {x = p.x-1, y = p.y-1, z = p.z}},
  2912. }
  2913.  
  2914. function removeAllActionIDs(pos, onlyOne)
  2915. if onlyOne then
  2916. local thing1 = {x=pos.x,y=pos.y,z=pos.z,stackpos=0}
  2917. local tile1 = getTileThingWithProtect(thing1).uid
  2918. doSetItemActionId(tile1, 0)
  2919. end
  2920. n = 0
  2921. for i = 1, #pos do
  2922. n = n + 1
  2923. thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=0}
  2924. local tile = getTileThingWithProtect(thing).uid
  2925. doSetItemActionId(tile, 0)
  2926. end
  2927. end
  2928.  
  2929.  
  2930. for i = 1, 3 do
  2931. if wall[dirr] then
  2932. local t = wall[dirr]
  2933. if hasTile(t[i]) and canWalkOnPos2(t[i], true, true, true, true, false) then --alterado v1.6
  2934. doCreateItem(item, 1, t[i])
  2935. --
  2936. local Tile = getTileThingWithProtect({x=t[i].x,y=t[i].y,z=t[i].z,stackpos=0})
  2937. doSetItemActionId(Tile.uid, 88072)
  2938. addEvent(removeAllActionIDs, 15000, t[i], true)
  2939. --
  2940. addEvent(doRemoveItemFromPos, 15000, t[i], item, 1)
  2941. end
  2942. end
  2943. end
  2944.  
  2945. local pos = getPosfromArea(cid, wall_1)
  2946. local pos2 = getPosfromArea(cid, wall_2)
  2947.  
  2948. if hasTile({x=p.x,y=p.y,z=p.z,stackpos=0}) then
  2949. tile0 = getTileThingWithProtect({x=p.x,y=p.y,z=p.z,stackpos=0}).uid
  2950. end
  2951. doSetItemActionId(tile0, 88070)
  2952. addEvent(removeAllActionIDs, 15000, p, true)
  2953.  
  2954. n = 0
  2955.  
  2956. while n < #pos do
  2957. if not isCreature(cid) then return true end
  2958. n = n+1
  2959. local tile1 = getTileThingWithProtect({x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=0}).uid
  2960. ---
  2961. local tile2 = getTileThingWithProtect({x=pos2[n].x,y=pos2[n].y,z=pos2[n].z,stackpos=0}).uid
  2962.  
  2963. doSetItemActionId(tile1, 88071)
  2964. doSetItemActionId(tile2, 88070)
  2965. end
  2966. addEvent(removeAllActionIDs, 15000, pos)
  2967. addEvent(removeAllActionIDs, 15000, pos2)
  2968.  
  2969. elseif spell == "Shredder Team" then --alterado v1.8 \/
  2970.  
  2971. local team = {
  2972. ["Scyther"] = "ScytherTeam",
  2973. ["Shiny Scyther"] = "Shiny ScytherTeam",
  2974. ["Scizor"] = "ScizorTeam",
  2975. }
  2976.  
  2977. local function RemoveTeam(cid)
  2978. if isCreature(cid) then
  2979. doSendMagicEffect(getThingPosWithDebug(cid), 211)
  2980. doRemoveCreature(cid)
  2981. end
  2982. end
  2983.  
  2984. local function sendEff(cid, master, t)
  2985. if isCreature(cid) and isCreature(master) and t > 0 and #getCreatureSummons(master) >= 2 then
  2986. doSendMagicEffect(getThingPosWithDebug(cid), 86, master)
  2987. addEvent(sendEff, 1000, cid, master, t-1) --alterado v1.9
  2988. end
  2989. end
  2990.  
  2991. if getPlayerStorageValue(cid, 637500) >= 1 then
  2992. return true
  2993. end
  2994.  
  2995. local master = getCreatureMaster(cid)
  2996. local item = getPlayerSlotItem(master, 8)
  2997. local life, maxLife = getCreatureHealth(cid), getCreatureMaxHealth(cid)
  2998. local name = getItemAttribute(item.uid, "poke")
  2999. local pos = getThingPosWithDebug(cid)
  3000. local time = 21
  3001.  
  3002. doItemSetAttribute(item.uid, "hp", (life/maxLife))
  3003.  
  3004. local num = getSubName(cid, target) == "Scizor" and 4 or 3
  3005. local pk = {}
  3006.  
  3007. doTeleportThing(cid, {x=4, y=3, z=10}, false)
  3008.  
  3009. if team[name] then
  3010. pk[1] = cid
  3011. for b = 2, num do
  3012. pk[b] = doSummonCreature(team[name], pos)
  3013. doConvinceCreature(master, pk[b])
  3014. end
  3015.  
  3016. for a = 1, num do
  3017. addEvent(doTeleportThing, math.random(0, 5), pk[a], getClosestFreeTile(pk[a], pos), false)
  3018. addEvent(doAdjustWithDelay, 5, master, pk[a], true, true, true)
  3019. doSendMagicEffect(getThingPosWithDebug(pk[a]), 211)
  3020. end
  3021. sendEff(cid, master, time) --alterado v1.9
  3022. setPlayerStorageValue(master, 637501, 1)
  3023. addEvent(setPlayerStorageValue, time * 1000, master, 637501, -2)
  3024. -----
  3025. setPlayerStorageValue(pk[2], 637500, 1)
  3026. addEvent(RemoveTeam, time * 1000, pk[2])
  3027. -----
  3028. setPlayerStorageValue(pk[3], 637500, 1)
  3029. addEvent(RemoveTeam, time * 1000, pk[3])
  3030. ----
  3031. if getSubName(cid, target) == "Scizor" then
  3032. setPlayerStorageValue(pk[4], 637500, 1)
  3033. addEvent(RemoveTeam, time * 1000, pk[4])
  3034. end
  3035. end
  3036.  
  3037.  
  3038. elseif spell == "Team Slice" or spell == "Team Claw" then
  3039.  
  3040. local master = getCreatureMaster(cid)
  3041. if #getCreatureSummons(master) < 2 or not isCreature(target) then return true end
  3042.  
  3043. local summons = getCreatureSummons(master)
  3044. local posis = {[1] = pos1, [2] = pos2, [3] = pos3, [4] = pos4}
  3045.  
  3046. if getSubName(cid, target) == "Scyther" then --alterado v1.6.1
  3047. eff = 39
  3048. elseif getSubName(cid, target) == "Shiny Scyther" then --alterado v1.6.1
  3049. eff = 39
  3050. else
  3051. eff = 42 --alterado v1.5
  3052. end
  3053.  
  3054. if #getCreatureSummons(master) >= 2 and isCreature(target) then
  3055. if isCreature(cid) then
  3056. addEvent(doDanoInTarget, 500, cid, target, BUGDAMAGE, -min, -max, 0) --alterado v1.7
  3057. for i = 1, #summons do
  3058. posis[i] = getThingPosWithDebug(summons[i])
  3059. doDisapear(summons[i])
  3060. stopNow(summons[i], 670)
  3061. addEvent(doSendMagicEffect, 300, posis[i], 211)
  3062. addEvent(doSendDistanceShoot, 350, posis[i], getThingPosWithDebug(target), eff)
  3063. addEvent(doSendDistanceShoot, 450, getThingPosWithDebug(target), posis[i], eff)
  3064. addEvent(doSendDistanceShoot, 600, posis[i], getThingPosWithDebug(target), eff)
  3065. addEvent(doSendDistanceShoot, 650, getThingPosWithDebug(target), posis[i], eff)
  3066. addEvent(doAppear, 670, summons[i])
  3067. end
  3068. end
  3069. end
  3070.  
  3071. elseif spell == "Blizzard" then
  3072.  
  3073. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  3074. local ret = {}
  3075. ret.id = 0
  3076. ret.cd = 9
  3077. ret.eff = 43
  3078. ret.check = 0
  3079. ret.first = true
  3080. ret.cond = "Slow"
  3081.  
  3082. local function doFall(cid)
  3083. for rocks = 1, 42 do
  3084. addEvent(fall, rocks*35, cid, master, ICEDAMAGE, 28, 52)
  3085. end
  3086. end
  3087.  
  3088. for up = 1, 10 do
  3089. addEvent(upEffect, up*75, cid, 28)
  3090. end --alterado v1.4
  3091. addEvent(doFall, 450, cid)
  3092. addEvent(doMoveInArea2, 1400, cid, 0, BigArea2, ICEDAMAGE, min, max, spell, ret)
  3093.  
  3094. elseif spell == "Bulk Up" then
  3095.  
  3096. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  3097. local ret = {}
  3098. ret.id = 0
  3099. ret.cd = 9
  3100. ret.eff = 15
  3101. ret.check = 0
  3102. ret.first = true
  3103. ret.cond = "Slow"
  3104.  
  3105. local function doFall(cid)
  3106. for rocks = 1, 42 do
  3107. addEvent(fall, rocks*35, cid, master, FIREDAMAGE, -1, 241)
  3108. end
  3109. end
  3110.  
  3111. for up = 1, 10 do
  3112. --addEvent(upEffect, up*75, cid, 3)
  3113. end
  3114. addEvent(doFall, 450, cid)
  3115. addEvent(doMoveInArea2, 1400, cid, 0, BigArea2, FIREDAMAGE, min, max, spell, ret)
  3116.  
  3117. elseif spell == "Meteor Mash" then
  3118.  
  3119. local effD = 5
  3120. local eff = 249
  3121. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  3122.  
  3123. local function doFall(cid)
  3124. for rocks = 5, 42 do
  3125. addEvent(fall, rocks*35, cid, master, STEELDAMAGE, effD, eff)
  3126. end
  3127. end
  3128.  
  3129. for up = 1, 10 do
  3130. addEvent(upEffect, up*75, cid, effD)
  3131. end
  3132. addEvent(doFall, 450, cid)
  3133. addEvent(doDanoWithProtect, 1400, cid, STEELDAMAGE, getThingPosWithDebug(cid), waterarea, -min, -max, 0)
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139. elseif spell == "Great Love" then
  3140.  
  3141. local master = getCreatureMaster(cid) or 0
  3142. local ret = {}
  3143. ret.id = 0
  3144. ret.cd = 9
  3145. ret.eff = 147
  3146. ret.check = 0
  3147. ret.spell = spell
  3148. ret.cond = "Stun"
  3149.  
  3150. for rocks = 1, 62 do
  3151. addEvent(fall, rocks*35, cid, master, NORMALDAMAGE, -1, 147)
  3152. end
  3153.  
  3154. addEvent(doMoveInArea2, 500, cid, 0, BigArea2, NORMALDAMAGE, min, max, spell, ret)
  3155.  
  3156. elseif spell == "Fire Punch" then
  3157.  
  3158. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  3159. doSendMagicEffect(getThingPosWithDebug(target), 112)
  3160. doDanoInTargetWithDelay(cid, target, FIREDAMAGE, min, max, 35) --alterado v1.7
  3161.  
  3162. elseif spell == "Guillotine" then
  3163.  
  3164. doDanoWithProtect(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 146)
  3165.  
  3166. elseif spell == "Hyper Beam" then --alterado v1.7 \/
  3167.  
  3168. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3169. local p = getThingPosWithDebug(cid)
  3170. local t = {
  3171. [0] = {149, {x=p.x+1, y=p.y-1, z=p.z}},
  3172. [1] = {150, {x=p.x+6, y=p.y+1, z=p.z}},
  3173. [2] = {149, {x=p.x+1, y=p.y+6, z=p.z}},
  3174. [3] = {150, {x=p.x-1, y=p.y+1, z=p.z}},
  3175. }
  3176.  
  3177. doMoveInArea2(cid, 0, triplo6, NORMALDAMAGE, min, max, spell)
  3178. doSendMagicEffect(t[a][2], t[a][1])
  3179.  
  3180. elseif spell == "Signal Beam" then --alterado v1.7 \/
  3181.  
  3182. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3183. local p = getThingPosWithDebug(cid)
  3184. local t = {
  3185. [0] = {262, {x=p.x+1, y=p.y-1, z=p.z}},
  3186. [1] = {263, {x=p.x+6, y=p.y+1, z=p.z}},
  3187. [2] = {264, {x=p.x+1, y=p.y+6, z=p.z}},
  3188. [3] = {265, {x=p.x-1, y=p.y+1, z=p.z}},
  3189. }
  3190.  
  3191. doMoveInArea2(cid, 0, triplo6, BUGDAMAGE, min, max, spell)
  3192. doSendMagicEffect(t[a][2], t[a][1])
  3193.  
  3194.  
  3195. elseif spell == "Flash Cannon" then --alterado v1.7 \/
  3196.  
  3197. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3198. local p = getThingPosWithDebug(cid)
  3199. local t = {
  3200. [0] = {260, {x=p.x+1, y=p.y-1, z=p.z}},
  3201. [1] = {259, {x=p.x+6, y=p.y+1, z=p.z}},
  3202. [2] = {260, {x=p.x+1, y=p.y+6, z=p.z}},
  3203. [3] = {259, {x=p.x-1, y=p.y+1, z=p.z}},
  3204. }
  3205.  
  3206. doMoveInArea2(cid, 0, triplo6, STEELDAMAGE, min, max, spell)
  3207. doSendMagicEffect(t[a][2], t[a][1])
  3208.  
  3209.  
  3210. elseif spell == "Thrash" then
  3211.  
  3212. --cid, effDist, effDano, areaEff, areaDano, element, min, max
  3213. doMoveInAreaMulti(cid, 10, 111, bullet, bulletDano, NORMALDAMAGE, min, max)
  3214.  
  3215. elseif spell == "Splash" or tonumber(spell) == 7 then
  3216.  
  3217. doAreaCombatHealth(cid, WATERDAMAGE, getThingPosWithDebug(cid), splash, -min, -max, 255)
  3218. doSendMagicEffect(getThingPosWithDebug(cid), 53)
  3219.  
  3220. elseif spell == "Dragon Breath" then
  3221.  
  3222. doMoveInArea2(cid, 143, db1, DRAGONDAMAGE, min, max, spell)
  3223.  
  3224. elseif spell == "Muddy Water" then
  3225.  
  3226. local pos = getThingPosWithDebug(cid)
  3227.  
  3228. doMoveInArea2(cid, 55, doSurf1, GROUNDDAMAGE, 0, 0, spell)
  3229. addEvent(doDanoWithProtect, math.random(100, 400), cid, GROUNDDAMAGE, pos, doSurf2, -min, -max, 0)
  3230.  
  3231. elseif spell == "Venom Motion" then
  3232.  
  3233. local ret = {}
  3234. ret.id = 0
  3235. ret.cd = 9
  3236. ret.eff = 34
  3237. ret.check = 0
  3238. ret.spell = spell
  3239. ret.cond = "Miss"
  3240.  
  3241. doMoveInArea2(cid, 114, muddy, POISONDAMAGE, min, max, spell, ret)
  3242.  
  3243. elseif spell == "Thunder Fang" then
  3244.  
  3245. doSendMagicEffect(getThingPosWithDebug(target), 146)
  3246. doDanoInTargetWithDelay(cid, target, ELECTRICDAMAGE, min, max, 48) --alterado v1.7
  3247.  
  3248. elseif spell == "Zap Cannon" then
  3249.  
  3250. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3251. local p = getThingPosWithDebug(cid)
  3252. local t = {
  3253. [0] = {73, {x=p.x, y=p.y-1, z=p.z}},
  3254. [1] = {74, {x=p.x+6, y=p.y, z=p.z}}, --alterado v1.8
  3255. [2] = {75, {x=p.x, y=p.y+6, z=p.z}},
  3256. [3] = {76, {x=p.x-1, y=p.y, z=p.z}},
  3257. }
  3258.  
  3259. doMoveInArea2(cid, 0, triplo6, ELECTRICDAMAGE, min, max, spell)
  3260. doMoveInArea2(cid, 177, reto6, ELECTRICDAMAGE, 0, 0, "Zap Cannon Eff")
  3261. doSendMagicEffect(t[a][2], t[a][1])
  3262.  
  3263. elseif spell == "Charge Beam" then
  3264.  
  3265. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3266. local p = getThingPosWithDebug(cid)
  3267. local t = {
  3268. [0] = {73, {x=p.x, y=p.y-1, z=p.z}},
  3269. [1] = {74, {x=p.x+6, y=p.y, z=p.z}}, --alterado v1.8
  3270. [2] = {75, {x=p.x, y=p.y+6, z=p.z}},
  3271. [3] = {76, {x=p.x-1, y=p.y, z=p.z}},
  3272. }
  3273.  
  3274. doMoveInArea2(cid, 0, triplo6, ELECTRICDAMAGE, min, max, spell)
  3275. doSendMagicEffect(t[a][2], t[a][1])
  3276.  
  3277. elseif spell == "Sacred Fire" then
  3278.  
  3279. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 3)
  3280. doDanoWithProtectWithDelay(cid, target, SACREDDAMAGE, min, max, 143, sacred) --alterado v1.6
  3281.  
  3282. elseif spell == "Blaze Kick" then
  3283.  
  3284. doMoveInArea2(cid, 6, blaze, FIREDAMAGE, min, max, spell)
  3285. addEvent(doMoveInArea2, 200, cid, 6, kick, FIREDAMAGE, min, max, spell)
  3286.  
  3287. elseif spell == "Cross Chop" then
  3288.  
  3289. doMoveInArea2(cid, 118, blaze, FIGHTINGDAMAGE, min, max, spell)
  3290. addEvent(doMoveInArea2, 200, cid, 118, kick, FIGHTINGDAMAGE, min, max, spell)
  3291.  
  3292. elseif spell == "Overheat" then
  3293.  
  3294. doMoveInArea2(cid, 5, reto5, FIREDAMAGE, min, max, spell)
  3295.  
  3296. elseif spell == "Ancient Power" then
  3297.  
  3298. local p = getThingPosWithDebug(cid)
  3299. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3300.  
  3301. function sendAtk(cid, area, eff)
  3302. if isCreature(cid) then
  3303. if not isSightClear(p, area, false) then return true end
  3304. doAreaCombatHealth(cid, ROCKDAMAGE, area, 0, 0, 0, eff)
  3305. doAreaCombatHealth(cid, ROCKDAMAGE, area, whirl3, -min, -max, 137)
  3306. end
  3307. end
  3308.  
  3309. for a = 0, 4 do
  3310.  
  3311. local t = {
  3312. [0] = {18, {x=p.x, y=p.y-(a+1), z=p.z}}, --alterado v1.4
  3313. [1] = {18, {x=p.x+(a+1), y=p.y, z=p.z}},
  3314. [2] = {18, {x=p.x, y=p.y+(a+1), z=p.z}},
  3315. [3] = {18, {x=p.x-(a+1), y=p.y, z=p.z}}
  3316. }
  3317. addEvent(sendAtk, 300*a, cid, t[d][2], t[d][1])
  3318. end
  3319.  
  3320. elseif spell == "Twister" then
  3321.  
  3322. doMoveInAreaMulti(cid, 28, 42, bullet, bulletDano, DRAGONDAMAGE, min, max)
  3323.  
  3324. elseif spell == "Multi-Kick" then
  3325.  
  3326. doMoveInAreaMulti(cid, 39, 113, multi, multiDano, FIGHTINGDAMAGE, min, max)
  3327.  
  3328. elseif spell == "Multi-Punch" then
  3329.  
  3330. doMoveInAreaMulti(cid, 39, 112, multi, multiDano, FIGHTINGDAMAGE, min, max)
  3331.  
  3332. elseif spell == "Squisky Licking" then
  3333.  
  3334. local ret = {}
  3335. ret.id = 0
  3336. ret.cd = 9
  3337. ret.check = 0
  3338. ret.eff = 0
  3339. ret.spell = spell
  3340. ret.cond = "Stun"
  3341.  
  3342. local areas = {SL1, SL2, SL3, SL4}
  3343.  
  3344. for i = 0, 3 do
  3345. addEvent(doMoveInArea2, i*200, cid, 145, areas[i+1], NORMALDAMAGE, min, max, spell, ret)
  3346. end
  3347.  
  3348. elseif spell == "Lick" then
  3349.  
  3350. local ret = {}
  3351. ret.id = target
  3352. ret.cd = 9
  3353. ret.check = getPlayerStorageValue(target, conds["Stun"])
  3354. ret.eff = 0
  3355. ret.spell = spell
  3356. ret.cond = "Stun"
  3357.  
  3358. doSendMagicEffect(getThingPosWithDebug(target), 145) --alterado v1.4!
  3359. addEvent(doMoveDano2, 100, cid, target, NORMALDAMAGE, 0, 0, ret, spell)
  3360.  
  3361. elseif spell == "Bonemerang" then
  3362.  
  3363. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 7)
  3364. doDanoInTargetWithDelay(cid, target, GROUNDDAMAGE, min, max, 227) --alterado v1.7
  3365. addEvent(doSendDistanceShoot, 250, getThingPosWithDebug(target), getThingPosWithDebug(cid), 7)
  3366.  
  3367. elseif spell == "Bone Club" then
  3368.  
  3369. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 7)
  3370. doDanoInTargetWithDelay(cid, target, GROUNDDAMAGE, min, max, 118) --alterado v1.7
  3371.  
  3372. elseif spell == "Bone Slash" then
  3373.  
  3374. local function sendStickEff(cid, dir)
  3375. if not isCreature(cid) then return true end
  3376. doAreaCombatHealth(cid, GROUNDDAMAGE, getPosByDir(getThingPosWithDebug(cid), dir), 0, -min, -max, 227)
  3377. end
  3378.  
  3379. local function doStick(cid)
  3380. if not isCreature(cid) then return true end
  3381. local t = {
  3382. [1] = SOUTHWEST,
  3383. [2] = SOUTH,
  3384. [3] = SOUTHEAST,
  3385. [4] = EAST,
  3386. [5] = NORTHEAST,
  3387. [6] = NORTH,
  3388. [7] = NORTHWEST,
  3389. [8] = WEST,
  3390. [9] = SOUTHWEST,
  3391. }
  3392. for a = 1, 9 do
  3393. addEvent(sendStickEff, a * 140, cid, t[a])
  3394. end
  3395. end
  3396.  
  3397. doStick(cid, false, cid)
  3398. --alterado v1.4
  3399. elseif spell == "Furious Legs" or spell == "Ultimate Champion" or spell == "Fighter Spirit" then
  3400.  
  3401. local ret = {}
  3402. ret.id = cid
  3403. ret.cd = 15
  3404. ret.eff = 13
  3405. ret.check = 0
  3406. ret.buff = spell
  3407. ret.first = true
  3408.  
  3409. doCondition2(ret)
  3410.  
  3411. elseif spell == "Sludge Wave" then
  3412.  
  3413. local p = getThingPosWithDebug(cid)
  3414. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3415.  
  3416. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  3417. local ret = {}
  3418. ret.id = 0
  3419. ret.cd = 9
  3420. ret.eff = 34
  3421. ret.check = 0
  3422. ret.spell = spell
  3423. ret.cond = "Miss"
  3424.  
  3425. function sendAtk(cid, area, eff)
  3426. if isCreature(cid) then
  3427. if not isSightClear(p, area, false) then return true end
  3428. doAreaCombatHealth(cid, POISONDAMAGE, area, 0, 0, 0, eff)
  3429. doAreaCombatHealth(cid, POISONDAMAGE, area, whirl3, -min, -max, 114)
  3430. end
  3431. end
  3432.  
  3433. for a = 0, 4 do
  3434.  
  3435. local t = {
  3436. [0] = {114, {x=p.x, y=p.y-(a+1), z=p.z}}, --alterado v1.4
  3437. [1] = {114, {x=p.x+(a+1), y=p.y, z=p.z}},
  3438. [2] = {114, {x=p.x, y=p.y+(a+1), z=p.z}},
  3439. [3] = {114, {x=p.x-(a+1), y=p.y, z=p.z}}
  3440. }
  3441. addEvent(sendAtk, 300*a, cid, t[d][2], t[d][1])
  3442. end
  3443.  
  3444. elseif spell == "Sludge Rain" then
  3445.  
  3446. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  3447. local ret = {}
  3448. ret.id = 0
  3449. ret.cd = 9
  3450. ret.eff = 34
  3451. ret.check = 0
  3452. ret.spell = spell
  3453. ret.cond = "Miss"
  3454.  
  3455. local function doFall(cid)
  3456. for rocks = 1, 42 do
  3457. addEvent(fall, rocks*35, cid, master, POISONDAMAGE, 6, 116)
  3458. end
  3459. end
  3460.  
  3461. for up = 1, 10 do
  3462. addEvent(upEffect, up*75, cid, 6)
  3463. end
  3464.  
  3465. addEvent(doFall, 450, cid)
  3466. addEvent(doMoveInArea2, 1400, cid, 0, BigArea2, POISONDAMAGE, min, max, spell, ret)
  3467.  
  3468. elseif spell == "Shadow Ball" then
  3469.  
  3470. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 18)
  3471.  
  3472. local function doDamageWithDelay(cid, target)
  3473. if not isCreature(cid) or not isCreature(target) then return true end
  3474. if isSleeping(cid) then return false end
  3475. if getPlayerStorageValue(cid, conds["Fear"]) >= 1 then return true end
  3476. doAreaCombatHealth(cid, ghostDmg, getThingPosWithDebug(target), 0, -min, -max, 255)
  3477. local pos = getThingPosWithDebug(target)
  3478. pos.x = pos.x + 1
  3479. doSendMagicEffect(pos, 140)
  3480. end
  3481.  
  3482. addEvent(doDamageWithDelay, 100, cid, target)
  3483.  
  3484. elseif spell == "Shadow Punch" then
  3485.  
  3486. local pos = getThingPosWithDebug(target)
  3487. doSendMagicEffect(pos, 112)
  3488.  
  3489. local function doPunch(cid, target)
  3490. if not isCreature(cid) or not isCreature(target) then return true end
  3491. doAreaCombatHealth(cid, ghostDmg, getThingPosWithDebug(target), 0, -min, -max, 255)
  3492. pos.x = pos.x + 1
  3493. doSendMagicEffect(pos, 140)
  3494. end
  3495.  
  3496. addEvent(doPunch, 200, cid, target)
  3497.  
  3498.  
  3499. elseif spell == "Brick Beak" then
  3500.  
  3501. local ret = {}
  3502. ret.id = 0
  3503. ret.cd = 9
  3504. ret.eff = 88
  3505. ret.check = 0
  3506. ret.first = true
  3507. ret.cond = "Paralyze"
  3508. ret.id = 0
  3509. ret.cd = 9
  3510. ret.eff = 88
  3511. ret.check = 0
  3512. ret.first = true
  3513. ret.cond = "Silence"
  3514.  
  3515. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3516. local p = getThingPosWithDebug(cid)
  3517. local t = {
  3518. [0] = {90, {x=p.x+1, y=p.y-1, z=p.z}},
  3519. [1] = {90, {x=p.x+2, y=p.y+1, z=p.z}},
  3520. [2] = {90, {x=p.x+1, y=p.y+2, z=p.z}},
  3521. [3] = {90, {x=p.x-1, y=p.y+1, z=p.z}},
  3522. }
  3523.  
  3524. doMoveInArea2(cid, 0, BrickBeak, FIGHTINGDAMAGE, min, max, spell, ret)
  3525. doSendMagicEffect(t[a][2], t[a][1])
  3526.  
  3527.  
  3528. elseif spell == "Shadow Storm" then
  3529.  
  3530. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  3531.  
  3532. local function doFall(cid)
  3533. for rocks = 1, 42 do --62
  3534. addEvent(fall, rocks*35, cid, master, ghostDmg, 18, 140)
  3535. end
  3536. end
  3537.  
  3538. for up = 1, 10 do
  3539. addEvent(upEffect, up*75, cid, 18)
  3540. end
  3541. addEvent(doFall, 450, cid)
  3542. addEvent(doMoveInArea2, 1400, cid, 2, BigArea2, ghostDmg, min, max, spell)
  3543.  
  3544. elseif spell == "Invisible" then
  3545.  
  3546. doDisapear(cid)
  3547. doSendMagicEffect(getThingPosWithDebug(cid), 134)
  3548. if isMonster(cid) then
  3549. local pos = getThingPosWithDebug(cid) --alterei!
  3550. doTeleportThing(cid, {x=4, y=3, z=10}, false)
  3551. doTeleportThing(cid, pos, false)
  3552. end
  3553. addEvent(doAppear, 4000, cid)
  3554.  
  3555. elseif spell == "Nightmare" then
  3556.  
  3557. if not isSleeping(target) then
  3558. doSendMagicEffect(getThingPosWithDebug(target), 3)
  3559. doSendAnimatedText(getThingPosWithDebug(target), "FAIL", 155)
  3560. return true
  3561. end
  3562.  
  3563. doDanoWithProtectWithDelay(cid, target, ghostDmg, -min, -max, 138)
  3564.  
  3565. elseif spell == "Dream Eater" then
  3566.  
  3567. if not isSleeping(target) then
  3568. doSendMagicEffect(getThingPosWithDebug(target), 3)
  3569. doSendAnimatedText(getThingPosWithDebug(target), "FAIL", 155)
  3570. return true
  3571. end
  3572. --alterado v1.6
  3573. setPlayerStorageValue(cid, 95487, 1)
  3574. doSendMagicEffect(getThingPosWithDebug(cid), 132)
  3575. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  3576. doDanoWithProtectWithDelay(cid, target, psyDmg, -min, -max, 138)
  3577.  
  3578. elseif spell == "Dark Eye" or spell == "Miracle Eye" then
  3579.  
  3580. doSendMagicEffect(getThingPosWithDebug(cid), 47)
  3581. setPlayerStorageValue(cid, 999457, 1)
  3582.  
  3583. elseif spell == "Elemental Hands" then
  3584.  
  3585. if getCreatureOutfit(cid).lookType == 1301 then
  3586. print("Error occurred with move 'Elemental Hands', outfit of hitmonchan is wrong")
  3587. doPlayerSendTextMessage(getCreatureMaster(cid), MESSAGE_STATUS_CONSOLE_BLUE, "A error are ocurred... A msg is sent to gamemasters!")
  3588. return true
  3589. end --proteçao pra n usar o move com o shiny hitmonchan com outfit diferente da do elite monchan do PO...
  3590.  
  3591. local e = getCreatureMaster(cid)
  3592. local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")
  3593. local hands = getItemAttribute(getPlayerSlotItem(e, 8).uid, "hands")
  3594.  
  3595. if hands == 4 then
  3596. doItemSetAttribute(getPlayerSlotItem(e, 8).uid, "hands", 0)
  3597. doSendMagicEffect(getThingPosWithDebug(cid), hitmonchans[name][0].eff)
  3598. doSetCreatureOutfit(cid, {lookType = hitmonchans[name][0].out}, -1)
  3599. else
  3600. doItemSetAttribute(getPlayerSlotItem(e, 8).uid, "hands", hands+1)
  3601. doSendMagicEffect(getThingPosWithDebug(cid), hitmonchans[name][hands+1].eff)
  3602. doSetCreatureOutfit(cid, {lookType = hitmonchans[name][hands+1].out}, -1)
  3603. end
  3604.  
  3605. elseif spell == "Crabhammer" then
  3606.  
  3607. doDanoWithProtect(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 225)
  3608.  
  3609. elseif spell == "Ancient Fury" then
  3610.  
  3611. local ret = {}
  3612. ret.id = cid
  3613. ret.cd = 15
  3614. ret.eff = 0
  3615. ret.check = 0
  3616. ret.buff = spell
  3617. ret.first = true
  3618.  
  3619. doCondition2(ret)
  3620.  
  3621. elseif spell == "Divine Punishment" then
  3622.  
  3623. local roardirections = {
  3624. [NORTH] = {SOUTH},
  3625. [SOUTH] = {NORTH},
  3626. [WEST] = {EAST},
  3627. [EAST] = {WEST}}
  3628.  
  3629. local function divineBack(cid)
  3630. if not isCreature(cid) then return true end
  3631. local uid = checkAreaUid(getCreaturePosition(cid), check, 1, 1)
  3632. for _,pid in pairs(uid) do
  3633. dirrr = getCreatureDirectionToTarget(pid, cid)
  3634. delay = getNextStepDelay(pid, 0)
  3635. if isSummon(cid) and (isMonster(pid) or (isSummon(pid) and canAttackOther(cid, pid) == "Can") or (isPlayer(pid) and canAttackOther(cid, pid) == "Can")) and pid ~= cid then
  3636. setPlayerStorageValue(pid, 654878, 1)
  3637. doChangeSpeed(pid, -getCreatureSpeed(pid))
  3638. doChangeSpeed(pid, 100)
  3639. doPushCreature(pid, roardirections[dirrr][1], 1, 0)
  3640. doChangeSpeed(pid, -getCreatureSpeed(pid))
  3641. addEvent(setPlayerStorageValue, 6450, pid, 654878, -1)
  3642. addEvent(doRegainSpeed, 6450, pid)
  3643. elseif isMonster(cid) and (isSummon(pid) or (isPlayer(pid) and #getCreatureSummons(pid) <= 0)) and pid ~= cid then
  3644. setPlayerStorageValue(pid, 654878, 1)
  3645. doChangeSpeed(pid, -getCreatureSpeed(pid))
  3646. doChangeSpeed(pid, 100)
  3647. doPushCreature(pid, roardirections[dirrr][1], 1, 0)
  3648. doChangeSpeed(pid, -getCreatureSpeed(pid))
  3649. addEvent(doRegainSpeed, 6450, pid)
  3650. addEvent(setPlayerStorageValue, 6450, pid, 654878, -1)
  3651. end
  3652. end
  3653. end
  3654.  
  3655. local function doDivine(cid, min, max, spell, rounds, area)
  3656. if not isCreature(cid) then return true end
  3657. local ret = {}
  3658. ret.id = 0
  3659. ret.check = 0
  3660. ret.cd = rounds
  3661. ret.cond = "Confusion"
  3662.  
  3663. for i = 1, 9 do
  3664. addEvent(doMoveInArea2, i*500, cid, 137, area[i], psyDmg, min, max, spell, ret)
  3665. end
  3666. end
  3667.  
  3668. local rounds = math.random(9, 12)
  3669. local area = {punish1, punish2, punish3, punish1, punish2, punish3, punish1, punish2, punish3}
  3670.  
  3671. local posi = getThingPosWithDebug(cid)
  3672. posi.x = posi.x+1
  3673. posi.y = posi.y+1
  3674.  
  3675. setPlayerStorageValue(cid, 2365487, 1)
  3676. addEvent(setPlayerStorageValue, 6450, cid, 2365487, -1) --alterado v1.4
  3677. doDisapear(cid)
  3678. doChangeSpeed(cid, -getCreatureSpeed(cid))
  3679. doSendMagicEffect(posi, 247)
  3680. addEvent(doAppear, 6450, cid)
  3681. addEvent(doRegainSpeed, 6450, cid)
  3682.  
  3683. local uid = checkAreaUid(getCreaturePosition(cid), check, 1, 1)
  3684. for _,pid in pairs(uid) do
  3685. if isSummon(cid) and (isMonster(pid) or (isSummon(pid) and canAttackOther(cid, pid) == "Can") or (isPlayer(pid) and canAttackOther(cid, pid) == "Can")) and pid ~= cid then
  3686. doChangeSpeed(pid, -getCreatureSpeed(pid))
  3687. elseif isMonster(cid) and (isSummon(pid) or (isPlayer(pid) and #getCreatureSummons(pid) <= 0)) and pid ~= cid then
  3688. doChangeSpeed(pid, -getCreatureSpeed(pid))
  3689. end
  3690. end
  3691.  
  3692. addEvent(divineBack, 2100, cid)
  3693. addEvent(doDivine, 2200, cid, min, max, spell, rounds, area)
  3694.  
  3695. elseif isInArray({"Psychic Sight", "Future Sight", "Camouflage", "Acid Armor", "Iron Defense", "Minimize"}, spell) then
  3696.  
  3697. local ret = {}
  3698. ret.id = cid
  3699. ret.cd = 10
  3700. ret.eff = 0
  3701. ret.check = 0
  3702. ret.buff = spell
  3703. ret.first = true
  3704.  
  3705. doCondition2(ret)
  3706.  
  3707. elseif spell == "Shadowave" then
  3708.  
  3709. doMoveInArea2(cid, 222, db1, DARKDAMAGE, min, max, spell)
  3710.  
  3711. elseif spell == "Confuse Ray" then
  3712.  
  3713. local rounds = math.random(4, 7)
  3714. rounds = rounds + math.floor(getPokemonLevel(cid) / 35)
  3715.  
  3716. local ret = {}
  3717. ret.id = target
  3718. ret.cd = rounds
  3719. ret.check = getPlayerStorageValue(target, conds["Confusion"])
  3720. ret.cond = "Confusion"
  3721.  
  3722. posi = getThingPosWithDebug(target)
  3723. posi.y = posi.y+1
  3724. ---
  3725. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  3726. addEvent(doSendMagicEffect, 100, posi, 222)
  3727. addEvent(doMoveDano2, 100, cid, target, GHOSTDAMAGE, -min, -max, ret, spell)
  3728.  
  3729. elseif spell == "Leaf Blade" then
  3730.  
  3731. local a = getThingPosWithDebug(target)
  3732. posi = {x = a.x+1, y = a.y+1, z = a.z}
  3733.  
  3734. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  3735. addEvent(doSendMagicEffect, 200, posi, 240)
  3736. doDanoWithProtectWithDelay(cid, target, GRASSDAMAGE, -min, -max, 0, LeafBlade)
  3737.  
  3738. elseif spell == "Eruption" or spell == "Elecball" then
  3739.  
  3740.  
  3741. local ret = {}
  3742. ret.id = cid
  3743. ret.cd = 15
  3744. ret.eff = 14
  3745. ret.check = 0
  3746. ret.buff = spell
  3747. ret.first = true
  3748.  
  3749. doCondition2(ret)
  3750.  
  3751. pos = getThingPosWithDebug(cid)
  3752. pos.x = pos.x+1
  3753. pos.y = pos.y+1
  3754.  
  3755. atk = {
  3756. ["Eruption"] = {241, FIREDAMAGE},
  3757. ["Elecball"] = {171, ELECTRICDAMAGE}
  3758. }
  3759.  
  3760. stopNow(cid, 1000)
  3761. doSendMagicEffect(pos, atk[spell][1])
  3762. doMoveInArea2(cid, 0, bombWee1, atk[spell][2], min, max, spell)
  3763.  
  3764. elseif spell == "Meteor Smash" then
  3765.  
  3766. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 20)
  3767. doDanoInTargetWithDelay(cid, target, NORMALDAMAGE, -min, -max, 242) --alterado v1.7
  3768.  
  3769. elseif spell == "Draco Meteor" then
  3770.  
  3771. local effD = 5
  3772. local eff = 248
  3773. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  3774.  
  3775. local function doFall(cid)
  3776. for rocks = 5, 42 do
  3777. addEvent(fall, rocks*35, cid, master, DRAGONDAMAGE, effD, eff)
  3778. end
  3779. end
  3780.  
  3781. for up = 1, 10 do
  3782. addEvent(upEffect, up*75, cid, effD)
  3783. end
  3784. addEvent(doFall, 450, cid)
  3785. addEvent(doDanoWithProtect, 1400, cid, DRAGONDAMAGE, getThingPosWithDebug(cid), waterarea, -min, -max, 0)
  3786.  
  3787.  
  3788. elseif spell == "Dragon Pulse" then
  3789.  
  3790. local p = getThingPosWithDebug(cid)
  3791. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3792.  
  3793. function sendAtk(cid, area)
  3794. if isCreature(cid) then
  3795. if not isSightClear(p, area, false) then return true end
  3796. doAreaCombatHealth(cid, DRAGONDAMAGE, area, pulse2, -min, -max, 255)
  3797. end
  3798. end
  3799.  
  3800. for a = 0, 3 do
  3801.  
  3802. local t = {
  3803. [0] = {249, {x=p.x, y=p.y-(a+1), z=p.z}},
  3804. [1] = {249, {x=p.x+(a+1), y=p.y, z=p.z}},
  3805. [2] = {249, {x=p.x, y=p.y+(a+1), z=p.z}},
  3806. [3] = {249, {x=p.x-(a+1), y=p.y, z=p.z}}
  3807. }
  3808. addEvent(sendAtk, 300*a, cid, t[d][2])
  3809. addEvent(doDanoWithProtect, 400*a, cid, DRAGONDAMAGE, t[d][2], pulse2, 0, 0, 177)
  3810. addEvent(doDanoWithProtect, 400*a, cid, DRAGONDAMAGE, t[d][2], pulse1, 0, 0, t[d][1])
  3811. end
  3812.  
  3813. elseif spell == "Psy Ball" then
  3814.  
  3815. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 3)
  3816. doDanoInTargetWithDelay(cid, target, psyDmg, min, max, 250) --alterado v1.7
  3817.  
  3818. elseif spell == "SmokeScreen" then
  3819.  
  3820. local ret = {}
  3821. ret.id = 0
  3822. ret.cd = 9
  3823. ret.eff = 34
  3824. ret.check = 0
  3825. ret.spell = spell
  3826. ret.cond = "Miss"
  3827.  
  3828. local function smoke(cid)
  3829. if not isCreature(cid) then return true end
  3830. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end
  3831. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  3832. doMoveInArea2(cid, 34, confusion, NORMALDAMAGE, 0, 0, spell, ret)
  3833. end
  3834.  
  3835. setPlayerStorageValue(cid, 3644587, 1)
  3836. addEvent(setPlayerStorageValue, 1000, cid, 3644587, -1)
  3837. for i = 0, 2 do
  3838. addEvent(smoke, i*500, cid)
  3839. end
  3840.  
  3841. elseif spell == "Faint Attack" or spell == "Sucker Punch" then --alterado v1.5
  3842.  
  3843. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  3844. doDanoInTargetWithDelay(cid, target, DARKDAMAGE, min, max, 237) --alterado v1.7
  3845.  
  3846. elseif spell == "Assurance" then
  3847.  
  3848. local p = getThingPosWithDebug(cid)
  3849. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  3850.  
  3851. function sendAtk(cid, area1, area2, eff)
  3852. if isCreature(cid) then
  3853. if not isSightClear(p, area1, false) then return true end
  3854. if not isSightClear(p, area2, false) then return true end
  3855. doAreaCombatHealth(cid, DARKDAMAGE, area1, 0, 0, 0, eff)
  3856. doAreaCombatHealth(cid, DARKDAMAGE, area2, whirl3, -min, -max, 0)
  3857. end
  3858. end
  3859.  
  3860. for a = 0, 3 do
  3861.  
  3862. local t = {
  3863. [0] = {230, {x=p.x+1, y=p.y-(a+1), z=p.z}, {x=p.x, y=p.y-(a+1), z=p.z}},
  3864. [1] = {226, {x=p.x+(a+2), y=p.y+1, z=p.z}, {x=p.x+(a+1), y=p.y, z=p.z}},
  3865. [2] = {235, {x=p.x+1, y=p.y+(a+1), z=p.z}, {x=p.x, y=p.y+(a+1), z=p.z}},
  3866. [3] = {231, {x=p.x-(a+1), y=p.y+1, z=p.z}, {x=p.x-(a+1), y=p.y, z=p.z}}
  3867. }
  3868. addEvent(sendAtk, 300*a, cid, t[d][2], t[d][3], t[d][1])
  3869. end
  3870.  
  3871. elseif spell == "Scary Face" then
  3872.  
  3873. local ret = {}
  3874. ret.id = 0
  3875. ret.cd = 9
  3876. ret.check = 0
  3877. ret.eff = 0
  3878. ret.spell = spell
  3879. ret.cond = "Stun"
  3880.  
  3881.  
  3882. local p = getThingPosWithDebug(cid)
  3883. doSendMagicEffect({x=p.x+1, y=p.y+1, z=p.z}, 228)
  3884. doMoveInArea2(cid, 0, electro, NORMALDAMAGE, 0, 0, spell, ret)
  3885.  
  3886. elseif spell == "Surf" then
  3887.  
  3888. local pos = getThingPosWithDebug(cid)
  3889.  
  3890. doMoveInArea2(cid, 246, doSurf1, WATERDAMAGE, 0, 0, spell)
  3891. addEvent(doDanoWithProtect, math.random(100, 400), cid, WATERDAMAGE, pos, doSurf2, -min, -max, 0)
  3892.  
  3893. elseif spell == "Sunny Day" then
  3894.  
  3895. local ret = {}
  3896. ret.id = 0
  3897. ret.cd = 9
  3898. ret.check = 0
  3899. ret.eff = 39
  3900. ret.cond = "Silence"
  3901. ----
  3902. local p = getThingPosWithDebug(cid)
  3903. doSendMagicEffect({x=p.x+1, y=p.y, z=p.z}, 181)
  3904. ---
  3905. if isSummon(cid) then
  3906. doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")
  3907. end
  3908. doCureStatus(cid, "all")
  3909. setPlayerStorageValue(cid, 253, 1) --focus
  3910. doMoveInArea2(cid, 0, electro, NORMALDAMAGE, 0, 0, spell, ret)
  3911.  
  3912.  
  3913. elseif spell == "Taunt" then
  3914.  
  3915. local ret = {}
  3916. ret.id = 0
  3917. ret.cd = 9
  3918. ret.check = 0
  3919. ret.eff = 136
  3920. ret.cond = "Silence"
  3921. ----
  3922. local p = getThingPosWithDebug(cid)
  3923. doSendMagicEffect({x=p.x+1, y=p.y, z=p.z}, 140)
  3924. ---
  3925. if isSummon(cid) then
  3926. doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")
  3927. end
  3928. doCureStatus(cid, "all")
  3929. setPlayerStorageValue(cid, 253, 1) --focus
  3930. doMoveInArea2(cid, 0, electro, NORMALDAMAGE, 0, 0, spell, ret)
  3931.  
  3932.  
  3933.  
  3934.  
  3935. elseif isInArray({"Pursuit", "ExtremeSpeed", "U-Turn", "Shell Attack"}, spell) then
  3936.  
  3937. local atk = {
  3938. ["Pursuit"] = {17, DARKDAMAGE},
  3939. ["ExtremeSpeed"] = {50, NORMALDAMAGE, 51},
  3940. ["U-Turn"] = {19, BUGDAMAGE},
  3941. ["Shell Attack"] = {45, BUGDAMAGE} --alterado v1.5
  3942. }
  3943.  
  3944. local pos = getThingPosWithDebug(cid)
  3945. local p = getThingPosWithDebug(target)
  3946. local newPos = getClosestFreeTile(target, p)
  3947.  
  3948. local eff = getSubName(cid, target) == "Shiny Arcanine" and atk[spell][3] or atk[spell][1] --alterado v1.6.1
  3949.  
  3950. local damage = atk[spell][2]
  3951. -----------
  3952. doDisapear(cid)
  3953. doChangeSpeed(cid, -getCreatureSpeed(cid))
  3954. -----------
  3955. addEvent(doSendMagicEffect, 300, pos, 211)
  3956. addEvent(doSendDistanceShoot, 400, pos, p, eff)
  3957. addEvent(doSendDistanceShoot, 400, newPos, p, eff)
  3958. addEvent(doDanoInTarget, 400, cid, target, damage, -min, -max, 0) --alterado v1.7
  3959. addEvent(doSendDistanceShoot, 800, p, pos, eff)
  3960. addEvent(doSendMagicEffect, 850, pos, 211)
  3961. addEvent(doRegainSpeed, 1000, cid)
  3962. addEvent(doAppear, 1000, cid)
  3963.  
  3964. elseif spell == "Egg Rain" then
  3965.  
  3966. local effD = 12
  3967. local eff = 5
  3968. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  3969. ------------
  3970.  
  3971. local function doFall(cid)
  3972. for rocks = 1, 62 do
  3973. addEvent(fall, rocks*35, cid, master, ROCKDAMAGE, effD, eff)
  3974. end
  3975. end
  3976.  
  3977. for up = 1, 10 do
  3978. addEvent(upEffect, up*75, cid, effD)
  3979. end
  3980. addEvent(doFall, 450, cid)
  3981. addEvent(doDanoWithProtect, 1400, cid, NORMALDAMAGE, getThingPosWithDebug(cid), waterarea, -min, -max, 0)
  3982.  
  3983.  
  3984. elseif spell == "Stampade" then
  3985.  
  3986. local master = getCreatureMaster(cid) or 0
  3987. local ret = {}
  3988. ret.id = 0
  3989. ret.cd = 9
  3990. ret.eff = 0
  3991. ret.check = 0
  3992. ret.spell = spell
  3993. ret.cond = "Stun"
  3994.  
  3995. for rocks = 1, 42 do
  3996. addEvent(fall, rocks*35, cid, master, NORMALDAMAGE, -1, 187)
  3997. end
  3998.  
  3999. addEvent(doMoveInArea2, 500, cid, 0, BigArea2, NORMALDAMAGE, min, max, spell, ret)
  4000.  
  4001. elseif spell == "Stampage" then
  4002.  
  4003. local master = getCreatureMaster(cid) or 0
  4004. local ret = {}
  4005. ret.id = 0
  4006. ret.cd = 9
  4007. ret.eff = 0
  4008. ret.check = 0
  4009. ret.spell = spell
  4010. ret.cond = "Stun"
  4011.  
  4012. for rocks = 1, 42 do
  4013. addEvent(fall, rocks*35, cid, master, NORMALDAMAGE, -1, 194)
  4014. end
  4015.  
  4016. addEvent(doMoveInArea2, 500, cid, 0, BigArea2, NORMALDAMAGE, min, max, spell, ret)
  4017.  
  4018. elseif spell == "Barrier" then
  4019. if not isCreature(getCreatureTarget(cid)) then
  4020. local function sendAtk(cid)
  4021. if not isCreature(cid) then return true end
  4022. setPlayerStorageValue(cid, 9658783, -1)
  4023. setPlayerStorageValue(cid, 734276, -1)
  4024. end
  4025. setPlayerStorageValue(cid, 734276, 1)
  4026. setPlayerStorageValue(cid, 9658783, 1)
  4027. pos = getThingPosWithDebug(cid)
  4028.  
  4029. local function doSendEff(cid)
  4030. if not isCreature(cid) then return true end
  4031. doSendMagicEffect({x = pos.x + 1, y = pos.y + 1, z = pos.z}, 172)
  4032. end
  4033. for i = 0, 7 do
  4034. addEvent(doSendEff, i*1000, cid)
  4035. end
  4036. addEvent(sendAtk, 8000, cid)
  4037. stopNow(cid, 8 * 800)
  4038. else
  4039. local ret = {}
  4040. ret.id = target
  4041. ret.cd = 10
  4042. ret.check = getPlayerStorageValue(target, conds["Sleep"])
  4043. ret.eff = 0
  4044. ret.cond = "Sleep"
  4045.  
  4046. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 24)
  4047. pos = getThingPosWithDebug(target)
  4048. addEvent(doMoveDano2, 150, cid, target, PSYCHICDAMAGE, 0, 0, ret, spell)
  4049. local function doSendEff(cid)
  4050. if not isCreature(cid) then return true end
  4051. doSendMagicEffect({x = pos.x + 1, y = pos.y + 1, z = pos.z}, 172)
  4052. end
  4053. for i = 0, 7 do
  4054. addEvent(doSendEff, i*1000, cid)
  4055. end
  4056. stopNow(target, 8 * 800)
  4057. end
  4058.  
  4059. elseif spell == "Air Cutter" then
  4060. local p = getThingPosWithDebug(cid)
  4061. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  4062.  
  4063. function sendAtk(cid, area)
  4064. if isCreature(cid) then
  4065. if not isSightClear(p, area, false) then return true end
  4066. doAreaCombatHealth(cid, FLYINGDAMAGE, area, whirl3, -min, -max, 255)
  4067. end
  4068. end
  4069.  
  4070. for a = 0, 5 do
  4071.  
  4072. local t = {
  4073. [0] = {128, {x=p.x, y=p.y-(a+1), z=p.z}, {x=p.x+1, y=p.y-(a+1), z=p.z}},
  4074. [1] = {129, {x=p.x+(a+1), y=p.y, z=p.z}, {x=p.x+(a+2), y=p.y+1, z=p.z}},
  4075. [2] = {131, {x=p.x, y=p.y+(a+1), z=p.z}, {x=p.x+1, y=p.y+(a+2), z=p.z}},
  4076. [3] = {130, {x=p.x-(a+1), y=p.y, z=p.z}, {x=p.x-(a+1), y=p.y+1, z=p.z}}
  4077. }
  4078. addEvent(doSendMagicEffect, 300*a, t[d][3], t[d][1])
  4079. addEvent(sendAtk, 300*a, cid, t[d][2])
  4080. end
  4081.  
  4082. elseif spell == "Venom Gale" then
  4083.  
  4084. local area = {gale1, gale2, gale3, gale4, gale3, gale2, gale1}
  4085.  
  4086. for i = 0, 6 do
  4087. addEvent(doMoveInArea2, i*400, cid, 138, area[i+1], POISONDAMAGE, min, max, spell)
  4088. end
  4089.  
  4090. elseif spell == "Crunch" then
  4091.  
  4092. doMoveInArea2(cid, 146, Crunch1, DARKDAMAGE, min, max, spell)
  4093. addEvent(doMoveInArea2, 300, cid, 146, Crunch2, DARKDAMAGE, min, max, spell)
  4094.  
  4095. elseif spell == "Ice Fang" then
  4096.  
  4097. doTargetCombatHealth(cid, target, ICEDAMAGE, 0, 0, 146)
  4098. addEvent(doDanoWithProtect, 250, cid, ICEDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 17)
  4099.  
  4100. elseif spell == "Psyshock" then
  4101.  
  4102. local p = getThingPosWithDebug(cid)
  4103. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  4104.  
  4105. function sendAtk(cid, area, eff)
  4106. if isCreature(cid) then
  4107. if not isSightClear(p, area, false) then return true end
  4108. doAreaCombatHealth(cid, psyDmg, area, 0, 0, 0, eff) --alterado v1.4
  4109. doAreaCombatHealth(cid, psyDmg, area, whirl3, -min, -max, 255) --alterado v1.4
  4110. end
  4111. end
  4112.  
  4113. for a = 0, 4 do
  4114.  
  4115. local t = {
  4116. [0] = {250, {x=p.x, y=p.y-(a+1), z=p.z}}, --alterado v1.4
  4117. [1] = {250, {x=p.x+(a+1), y=p.y, z=p.z}},
  4118. [2] = {250, {x=p.x, y=p.y+(a+1), z=p.z}},
  4119. [3] = {250, {x=p.x-(a+1), y=p.y, z=p.z}}
  4120. }
  4121. addEvent(sendAtk, 370*a, cid, t[d][2], t[d][1])
  4122. end
  4123.  
  4124.  
  4125. elseif spell == "Hurricane" then
  4126.  
  4127. local function hurricane(cid)
  4128. if not isCreature(cid) then return true end
  4129. if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end
  4130. if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
  4131. doMoveInArea2(cid, 42, bombWee1, FLYINGDAMAGE, min, max, spell)
  4132. end
  4133.  
  4134. doSetCreatureOutfit(cid, {lookType = 1398}, 10000)
  4135.  
  4136. setPlayerStorageValue(cid, 3644587, 1)
  4137. addEvent(setPlayerStorageValue, 17*600, cid, 3644587, -1)
  4138. for i = 1, 17 do
  4139. addEvent(hurricane, i*600, cid) --alterado v1.4
  4140. end
  4141.  
  4142. elseif spell == "Aromateraphy" or spell == "Emergency Call" then
  4143.  
  4144. eff = spell == "Aromateraphy" and 14 or 13
  4145.  
  4146. doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(cid), bombWee3, 0, 0, eff)
  4147. if isSummon(cid) then
  4148. doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")
  4149. end
  4150. doCureStatus(cid, "all")
  4151.  
  4152. local uid = checkAreaUid(getThingPosWithDebug(cid), confusion, 1, 1)
  4153. for _,pid in pairs(uid) do
  4154. if isCreature(pid) then
  4155. if ehMonstro(cid) and ehMonstro(pid) and pid ~= cid then
  4156. doCureStatus(pid, "all")
  4157. elseif isSummon(cid) and ((isSummon(pid) and canAttackOther(cid, pid) == "Cant") or (isPlayer(pid) and canAttackOther(cid, pid) == "Cant")) and pid ~= cid then
  4158. if isSummon(pid) then
  4159. doCureBallStatus(getPlayerSlotItem(getCreatureMaster(pid), 8).uid, "all")
  4160. end
  4161. doCureStatus(pid, "all")
  4162. end
  4163. end
  4164. end
  4165.  
  4166. elseif spell == "Synthesis" or spell == "Roost" then
  4167.  
  4168. local min = (getCreatureMaxHealth(cid) * 45) / 100
  4169. local max = (getCreatureMaxHealth(cid) * 60) / 100
  4170.  
  4171. local function doHealArea(cid, min, max)
  4172. local amount = math.random(min, max)
  4173. if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
  4174. amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
  4175. end
  4176. if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
  4177. doCreatureAddHealth(cid, amount)
  4178. doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
  4179. end
  4180. end
  4181.  
  4182. doSendMagicEffect(getThingPosWithDebug(cid), 39)
  4183. doHealArea(cid, min, max)
  4184.  
  4185. elseif spell == "Cotton Spore" then
  4186.  
  4187. local ret = {}
  4188. ret.id = 0
  4189. ret.cd = 9
  4190. ret.eff = 0
  4191. ret.check = 0
  4192. ret.spell = spell
  4193. ret.cond = "Stun"
  4194.  
  4195. doMoveInArea2(cid, 85, confusion, GRASSDAMAGE, 0, 0, spell, ret)
  4196.  
  4197. elseif spell == "Peck" then
  4198.  
  4199. sendDistanceShootWithProtect(cid, getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  4200. doDanoInTargetWithDelay(cid, target, FLYINGDAMAGE, min, max, 3) --alterado v1.7
  4201.  
  4202. elseif spell == "Night Daze" then
  4203.  
  4204. local pos = getThingPosWithDebug(cid)
  4205. local eff = spell == "Night Daze" and 222 or 113
  4206. local dmg = spell == "Night Daze" and DARKDAMAGE or FIGHTINGDAMAGE
  4207.  
  4208. local out = getSubName(cid, target) == "Hitmontop" and 1193 or 1451 --alterado v1.6.1
  4209.  
  4210. local function doSendBubble(cid, pos)
  4211. if not isCreature(cid) then return true end
  4212. doSendDistanceShoot(getThingPosWithDebug(cid), pos, 39)
  4213. doSendMagicEffect(pos, eff)
  4214. end
  4215. --alterado!!
  4216. for a = 1, 20 do
  4217. local r1 = math.random(-4, 4)
  4218. local r2 = r1 == 0 and choose(-3, -2, -1, 2, 3) or math.random(-3, 3)
  4219. --
  4220. local lugar = {x = pos.x + r1, y = pos.y + r2, z = pos.z}
  4221. addEvent(doSendBubble, a * 25, cid, lugar)
  4222. end
  4223. if isInArray({"Hitmontop", "Shiny Hitmontop"}, getSubName(cid, target)) then --alterado v1.6.1
  4224. doSetCreatureOutfit(cid, {lookType = out}, 400)
  4225. end
  4226. addEvent(doDanoWithProtect, 150, cid, dmg, pos, waterarea, -min, -max, 0)
  4227.  
  4228. elseif spell == "Rolling Kick" then
  4229.  
  4230. local pos = getThingPosWithDebug(cid)
  4231. local eff = spell == "Night Daze" and 222 or 113
  4232. local dmg = spell == "Night Daze" and DARKDAMAGE or FIGHTINGDAMAGE
  4233.  
  4234. local out = getSubName(cid, target) == "Hitmontop" and 1193 or 1451 --alterado v1.6.1
  4235.  
  4236. local function doSendBubble(cid, pos)
  4237. if not isCreature(cid) then return true end
  4238. doSendDistanceShoot(getThingPosWithDebug(cid), pos, 27)
  4239. doSendMagicEffect(pos, eff)
  4240. end
  4241. --alterado!!
  4242. for a = 1, 20 do
  4243. local r1 = math.random(-4, 4)
  4244. local r2 = r1 == 0 and choose(-3, -2, -1, 2, 3) or math.random(-3, 3)
  4245. --
  4246. local lugar = {x = pos.x + r1, y = pos.y + r2, z = pos.z}
  4247. addEvent(doSendBubble, a * 25, cid, lugar)
  4248. end
  4249. if isInArray({"Hitmontop", "Shiny Hitmontop"}, getSubName(cid, target)) then --alterado v1.6.1
  4250. doSetCreatureOutfit(cid, {lookType = out}, 400)
  4251. end
  4252. addEvent(doDanoWithProtect, 150, cid, dmg, pos, waterarea, -min, -max, 0)
  4253.  
  4254. elseif spell == "Safeguard" then
  4255.  
  4256. doSendMagicEffect(getThingPosWithDebug(cid), 1)
  4257. if isSummon(cid) then
  4258. doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")
  4259. end
  4260. doCureStatus(cid, "all")
  4261.  
  4262. elseif spell == "Air Slash" then
  4263.  
  4264. local p = getThingPosWithDebug(cid)
  4265.  
  4266. local t = {
  4267. {{128, {x = p.x+1, y = p.y-1, z = p.z}}, {16, {x = p.x+1, y = p.y-1, z = p.z}}},
  4268. {{129, {x = p.x+2, y = p.y+1, z = p.z}}, {221, {x = p.x+3, y = p.y+1, z = p.z}}},
  4269. {{131, {x = p.x+1, y = p.y+2, z = p.z}}, {223, {x = p.x+1, y = p.y+3, z = p.z}}},
  4270. {{130, {x = p.x-1, y = p.y+1, z = p.z}}, {243, {x = p.x-1, y = p.y+1, z = p.z}}},
  4271. }
  4272.  
  4273. for i = 1, 4 do
  4274. doSendMagicEffect(t[i][2][2], t[i][2][1])
  4275. end
  4276. doDanoWithProtect(cid, FLYINGDAMAGE, getThingPosWithDebug(cid), airSlash, -min, -max, 0)
  4277.  
  4278. for i = 1, 4 do
  4279. addEvent(doSendMagicEffect, 400, t[i][1][2], t[i][1][1])
  4280. end
  4281. addEvent(doDanoWithProtect, 400, cid, FLYINGDAMAGE, getThingPosWithDebug(cid), bombWee2, -min, -max, 0)
  4282.  
  4283. elseif spell == "Feather Dance" then
  4284.  
  4285. local function doPulse(cid, eff)
  4286. if not isCreature(cid) or not isCreature(target) then return true end
  4287. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 9)
  4288. doDanoInTargetWithDelay(cid, target, FLYINGDAMAGE, -min, -max, eff) --alterado v1.7
  4289. end
  4290.  
  4291. addEvent(doPulse, 0, cid, 137)
  4292. addEvent(doPulse, 100, cid, 137)
  4293.  
  4294.  
  4295. elseif spell == "Tailwind" then
  4296.  
  4297. local ret = {}
  4298. ret.id = cid
  4299. ret.cd = 10
  4300. ret.eff = 137
  4301. ret.check = 0
  4302. ret.buff = spell
  4303. ret.first = true
  4304.  
  4305. doCondition2(ret)
  4306.  
  4307. elseif spell == "Double Team" then
  4308.  
  4309. local function RemoveTeam(cid, master)
  4310. if isCreature(cid) then
  4311. local p = getThingPosWithDebug(cid)
  4312. doSendMagicEffect(p, 211)
  4313. doRemoveCreature(cid)
  4314. end
  4315. end
  4316.  
  4317. local function sendEff(cid, master, t)
  4318. if isCreature(cid) and isCreature(master) and t > 0 and #getCreatureSummons(master) >= 2 then
  4319. doSendMagicEffect(getThingPosWithDebug(cid), 86, master)
  4320. addEvent(sendEff, 1000, cid, master, t-1) --alterado v1.9
  4321. end
  4322. end
  4323.  
  4324. if getPlayerStorageValue(cid, 637500) >= 1 then
  4325. return true
  4326. end
  4327.  
  4328. local s = {
  4329. ["Xatu"] = "XatuTeam",
  4330. ["Shiny Xatu"] = "Shiny XatuTeam",
  4331. ["Yanma"] = "YanmaTeam",
  4332. }
  4333.  
  4334. local master = getCreatureMaster(cid)
  4335. local item = getPlayerSlotItem(master, 8)
  4336. local pos = getThingPosWithDebug(cid)
  4337. local time = 20
  4338. local pokelife = (getCreatureHealth(cid) / getCreatureMaxHealth(cid))
  4339. local random = math.random(5, 10)
  4340. local dir = getCreatureLookDir(cid)
  4341. ---------
  4342. doItemSetAttribute(item.uid, "hp", pokelife)
  4343. ---------
  4344. doDisapear(cid)
  4345. doTeleportThing(cid, {x=4, y=3, z=10}, false)
  4346. doAppear(cid)
  4347. ---------
  4348. doSummonMonster(master, s[getSubName(cid, target)]) --alterado v1.6.1
  4349. local pk = getCreatureSummons(master)[2]
  4350. adjustStatus(pk, item.uid, true, true, true)
  4351. ---------
  4352. doTeleportThing(pk, getClosestFreeTile(pk, pos), false)
  4353. doTeleportThing(cid, getClosestFreeTile(cid, pos), false)
  4354. doCreatureSetLookDir(pk, dir)
  4355. doCreatureSetLookDir(cid, dir)
  4356. doSendMagicEffect(getThingPosWithDebug(pk), 211)
  4357. doSendMagicEffect(getThingPosWithDebug(cid), 211)
  4358. if getPlayerStorageValue(cid, 9658783) >= 1 then --gambiarra
  4359. doSetCreatureOutfit(cid, {lookType = 1446}, -1)
  4360. end
  4361. sendEff(cid, master, time) --alterado v1.9
  4362. --------
  4363. setPlayerStorageValue(pk, 637500, 1)
  4364. setPlayerStorageValue(master, 637501, 1)
  4365. addEvent(RemoveTeam, time*1000, pk, master)
  4366. addEvent(setPlayerStorageValue, time*1000, master, 637501, -2) --alterado v1.6
  4367.  
  4368. elseif spell == "Tackle" then
  4369.  
  4370. doDanoWithProtect(cid, NORMALDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 111)
  4371.  
  4372. elseif spell == "Giga Drain" then
  4373.  
  4374. local life = getCreatureHealth(target)
  4375.  
  4376. doDanoWithProtect(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14)
  4377.  
  4378. local newlife = life - getCreatureHealth(target)
  4379.  
  4380. doSendMagicEffect(getThingPosWithDebug(cid), 14)
  4381. if newlife >= 1 then
  4382. doCreatureAddHealth(cid, newlife)
  4383. doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32)
  4384. end
  4385.  
  4386.  
  4387. elseif spell == "Leech Life" then
  4388.  
  4389. local life = getCreatureHealth(target)
  4390.  
  4391. doDanoWithProtect(cid, BUGDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14)
  4392.  
  4393. local newlife = life - getCreatureHealth(target)
  4394.  
  4395. doSendMagicEffect(getThingPosWithDebug(cid), 14)
  4396. if newlife >= 1 then
  4397. doCreatureAddHealth(cid, newlife)
  4398. doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32)
  4399. end
  4400.  
  4401. elseif spell == "Bug Fighter" then
  4402.  
  4403. local ret = {}
  4404. ret.id = cid
  4405. ret.cd = 10
  4406. ret.eff = 0
  4407. ret.check = 0
  4408. ret.buff = spell
  4409. ret.first = true
  4410.  
  4411. doCondition2(ret)
  4412.  
  4413. elseif spell == "Metal Claw" then
  4414.  
  4415. doDanoWithProtect(cid, STEELDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 160)
  4416.  
  4417. elseif spell == "Power Gem" then
  4418.  
  4419. local p = getThingPosWithDebug(cid)
  4420. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  4421.  
  4422. function sendAtk(cid, area)
  4423. if isCreature(cid) then
  4424. if not isSightClear(p, area, false) then return true end
  4425. doAreaCombatHealth(cid, ROCKDAMAGE, area, pulse2, -min, -max, 255)
  4426. end
  4427. end
  4428.  
  4429. for a = 0, 3 do
  4430.  
  4431. local t = {
  4432. [0] = {29, {x=p.x, y=p.y-(a+1), z=p.z}},
  4433. [1] = {29, {x=p.x+(a+1), y=p.y, z=p.z}},
  4434. [2] = {29, {x=p.x, y=p.y+(a+1), z=p.z}},
  4435. [3] = {29, {x=p.x-(a+1), y=p.y, z=p.z}}
  4436. }
  4437. addEvent(sendAtk, 400*a, cid, t[d][2])
  4438. addEvent(doAreaCombatHealth, 400*a, cid, ROCKDAMAGE, t[d][2], pulse1, 0, 0, t[d][1])
  4439. addEvent(doAreaCombatHealth, 400*a, cid, ROCKDAMAGE, t[d][2], pulse1, 0, 0, 103)
  4440. end
  4441.  
  4442. elseif spell == "Octazooka" then
  4443.  
  4444. local ret = {}
  4445. ret.id = 0
  4446. ret.cd = 9
  4447. ret.check = 0
  4448. ret.eff = 34
  4449. ret.cond = "Silence"
  4450.  
  4451. doMoveInAreaMulti(cid, 6, 116, multi, multiDano, WATERDAMAGE, min, max)
  4452. doMoveInArea2(cid, 0, multiDano, WATERDAMAGE, 0, 0, spell, ret)
  4453.  
  4454.  
  4455. elseif spell == "Take Down" then
  4456.  
  4457. doMoveInArea2(cid, 111, reto5, NORMALDAMAGE, min, max, spell)
  4458.  
  4459. elseif spell == "Yawn" then
  4460.  
  4461. local ret = {}
  4462. ret.id = target
  4463. ret.cd = math.random(6, 9)
  4464. ret.check = getPlayerStorageValue(target, conds["Sleep"])
  4465. ret.first = true
  4466. ret.cond = "Sleep"
  4467.  
  4468. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 11)
  4469. addEvent(doMoveDano2, 1500, cid, target, NORMALDAMAGE, 0, 0, ret, spell)
  4470.  
  4471. elseif spell == "Tongue Hook" then
  4472.  
  4473. sendDistanceShootWithProtect(cid, getThingPosWithDebug(cid), getThingPosWithDebug(target), 38)
  4474. addEvent(doTeleportThing, 200, target, getClosestFreeTile(cid, getThingPosWithDebug(cid)), true)
  4475. addEvent(sendDistanceShootWithProtect, 200, cid, getThingPosWithDebug(target), getThingPosWithDebug(cid), 38)
  4476.  
  4477.  
  4478. elseif spell == "Tongue Grap" then
  4479.  
  4480. local function distEff(cid, target)
  4481. if not isCreature(cid) or not isCreature(target) or not isSilence(target) then return true end --alterado v1.6
  4482. sendDistanceShootWithProtect(cid, getThingPosWithDebug(target), getThingPosWithDebug(cid), 38)
  4483. end
  4484.  
  4485. local ret = {}
  4486. ret.id = target
  4487. ret.cd = 10
  4488. ret.check = getPlayerStorageValue(target, conds["Silence"])
  4489. ret.eff = 185
  4490. ret.cond = "Silence"
  4491.  
  4492. sendDistanceShootWithProtect(cid, getThingPosWithDebug(cid), getThingPosWithDebug(target), 38)
  4493. addEvent(doMoveDano2, 100, cid, target, NORMALDAMAGE, 0, 0, ret, spell)
  4494.  
  4495. for i = 1, 10 do
  4496. addEvent(distEff, i*930, cid, target)
  4497. end
  4498.  
  4499. elseif spell == "Struggle Bug" then
  4500.  
  4501. local function sendFireEff(cid, dir)
  4502. if not isCreature(cid) then return true end
  4503. doDanoWithProtect(cid, BUGDAMAGE, getPosByDir(getThingPosWithDebug(cid), dir), 0, -min, -max, 105)
  4504. end
  4505.  
  4506. local function doWheel(cid)
  4507. if not isCreature(cid) then return true end
  4508. local t = {
  4509. [1] = SOUTH,
  4510. [2] = SOUTHEAST,
  4511. [3] = EAST,
  4512. [4] = NORTHEAST,
  4513. [5] = NORTH, --alterado v1.5
  4514. [6] = NORTHWEST,
  4515. [7] = WEST,
  4516. [8] = SOUTHWEST,
  4517. }
  4518. for a = 1, 8 do
  4519. addEvent(sendFireEff, a * 200, cid, t[a])
  4520. end
  4521. end
  4522.  
  4523. doWheel(cid, false, cid)
  4524.  
  4525. elseif spell == "Low Kick" then
  4526.  
  4527. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  4528. doDanoInTargetWithDelay(cid, target, FIGHTINGDAMAGE, min, max, 113) --alterado v1.7
  4529.  
  4530. elseif spell == "Present" then
  4531.  
  4532. local function sendHeal(cid)
  4533. if isCreature(cid) and isCreature(target) then
  4534. doAreaCombatHealth(cid, NORMALDAMAGE, getThingPosWithDebug(target), crusher, min, max, 5)
  4535. doSendAnimatedText(getThingPosWithDebug(target), "HEALTH!", 65)
  4536. end
  4537. end
  4538.  
  4539. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 31)
  4540. if math.random(1, 100) >= 10 then
  4541. doDanoWithProtectWithDelay(cid, target, NORMALDAMAGE, min, max, 5, crusher)
  4542. else
  4543. addEvent(sendHeal, 100, cid)
  4544. end
  4545.  
  4546. elseif spell == "Inferno" or spell == "Fissure" then
  4547.  
  4548. local pos = getThingPosWithDebug(cid)
  4549.  
  4550. atk = {
  4551. ["Inferno"] = {101, FIREDAMAGE},
  4552. ["Fissure"] = {102, GROUNDDAMAGE}
  4553. }
  4554.  
  4555. doMoveInArea2(cid, atk[spell][1], inferno1, atk[spell][2], 0, 0, spell)
  4556. addEvent(doDanoWithProtect, math.random(100, 400), cid, atk[spell][2], pos, inferno2, -min, -max, 0)
  4557.  
  4558.  
  4559. elseif spell == "Wrap" then
  4560.  
  4561. local ret = {}
  4562. ret.id = target
  4563. ret.cd = 10
  4564. ret.check = getPlayerStorageValue(target, conds["Silence"])
  4565. ret.eff = 104
  4566. ret.cond = "Silence"
  4567.  
  4568. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  4569. addEvent(doMoveDano2, 100, cid, target, NORMALDAMAGE, 0, 0, ret, spell)
  4570.  
  4571. elseif spell == "Rock n'Roll" then
  4572.  
  4573. local pos = getThingPosWithDebug(cid)
  4574. local areas = {rock1, rock2, rock3, rock4, rock5, rock4, rock3, rock2, rock1}
  4575. local ret = {}
  4576. ret.id = 0
  4577. ret.cd = 9
  4578. ret.eff = 1
  4579. ret.check = 0
  4580. ret.spell = spell
  4581. ret.cond = "Miss"
  4582.  
  4583. for i = 0, 8 do
  4584. addEvent(doMoveInArea2, i*400, cid, 1, areas[i+1], NORMALDAMAGE, min, max, spell, ret)
  4585. addEvent(doMoveInArea2, i*410, cid, 1, areas[i+1], NORMALDAMAGE, 0, 0, spell)
  4586. end
  4587.  
  4588. elseif spell == "Power Wave" then
  4589.  
  4590. local pos = getThingPosWithDebug(cid)
  4591. local areas = {rock1, rock2, rock3, rock4, rock5}
  4592. local ret = {}
  4593. ret.id = 0
  4594. ret.cd = 9
  4595. ret.eff = 103
  4596. ret.check = 0
  4597. ret.first = true
  4598. ret.cond = "Paralyze"
  4599.  
  4600. local function sendAtk(cid)
  4601. if isCreature(cid) then
  4602. doRemoveCondition(cid, CONDITION_OUTFIT)
  4603. setPlayerStorageValue(cid, 9658783, -1)
  4604. for i = 0, 4 do
  4605. addEvent(doMoveInArea2, i*400, cid, 103, areas[i+1], psyDmg, min, max, spell, ret)
  4606. addEvent(doMoveInArea2, i*410, cid, 103, areas[i+1], psyDmg, 0, 0, spell)
  4607. end
  4608. end
  4609. end
  4610.  
  4611. doSetCreatureOutfit(cid, {lookType = 1001}, -1)
  4612. setPlayerStorageValue(cid, 9658783, 1)
  4613. addEvent(sendAtk, 2000, cid)
  4614.  
  4615.  
  4616. elseif spell == "Future Shight" then
  4617.  
  4618. local pos = getThingPosWithDebug(cid)
  4619. local areas = {rock1, rock2, rock3, rock4, rock5}
  4620. local ret = {}
  4621. ret.id = 0
  4622. ret.cd = 9
  4623. ret.eff = 103
  4624. ret.check = 0
  4625. ret.first = true
  4626. ret.cond = "Paralyze"
  4627.  
  4628. local function sendAtk(cid)
  4629. if isCreature(cid) then
  4630. doRemoveCondition(cid, CONDITION_OUTFIT)
  4631. setPlayerStorageValue(cid, 9658783, -1)
  4632. for i = 0, 4 do
  4633. addEvent(doMoveInArea2, i*400, cid, 103, areas[i+1], psyDmg, min, max, spell, ret)
  4634. addEvent(doMoveInArea2, i*410, cid, 103, areas[i+1], psyDmg, 0, 0, spell)
  4635. end
  4636. end
  4637. end
  4638.  
  4639. doSetCreatureOutfit(cid, {lookType = 1782}, -1)
  4640. setPlayerStorageValue(cid, 9658783, 1)
  4641. addEvent(sendAtk, 2000, cid)
  4642.  
  4643.  
  4644.  
  4645. elseif spell == "Heal Bell" then
  4646.  
  4647. if isSummon(cid) then
  4648. doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")
  4649. end
  4650. doCureStatus(cid, "all")
  4651.  
  4652. local areas = {rock1, rock2, rock3, rock4, rock5, rock1, rock2, rock3, rock4, rock5, rock1, rock2, rock3, rock4, rock5, rock1, rock2, rock3, rock4, rock5, rock1, rock2, rock3, rock4, rock5}
  4653. local ret = {}
  4654. ret.id = cid
  4655. ret.cd = 10
  4656. ret.eff = 0
  4657. ret.check = 0
  4658. ret.buff = spell
  4659. ret.first = true
  4660.  
  4661. doCondition2(ret)
  4662.  
  4663. for i = 0, 22 do
  4664. addEvent(doMoveInArea2, i*400, cid, 33, areas[i+1], NORMALDAMAGE, 0, 0, spell)
  4665. end
  4666.  
  4667. elseif spell == "Ground Crusher" then
  4668.  
  4669. local pos = getThingPosWithDebug(cid)
  4670. local areas = {rock1, rock2, rock3, rock4, rock5}
  4671. local ret = {}
  4672. ret.id = 0
  4673. ret.cd = 12
  4674. ret.eff = 0
  4675. ret.check = 0
  4676. ret.spell = spell
  4677. ret.cond = "Stun"
  4678.  
  4679. local function endMove(cid)
  4680. if isCreature(cid) then
  4681. doRemoveCondition(cid, CONDITION_OUTFIT)
  4682. end
  4683. end
  4684.  
  4685. doSetCreatureOutfit(cid, {lookType = 1449}, -1)
  4686. stopNow(cid, 16*360)
  4687. addEvent(endMove, 16*360, cid)
  4688. ----
  4689. for i = 0, 4 do
  4690. addEvent(doMoveInArea2, i*350, cid, 100, areas[i+1], GROUNDDAMAGE, min, max, spell, ret)
  4691. addEvent(doMoveInArea2, i*360, cid, 100, areas[i+1], GROUNDDAMAGE, 0, 0, spell, ret)
  4692. end
  4693. for i = 4, 8 do
  4694. local a = i-3
  4695. addEvent(doMoveInArea2, i*350, cid, 100, areas[a], GROUNDDAMAGE, min, max, spell, ret)
  4696. addEvent(doMoveInArea2, i*360, cid, 100, areas[a], GROUNDDAMAGE, 0, 0, spell, ret)
  4697. end
  4698. for i = 8, 12 do
  4699. local a = i-7
  4700. addEvent(doMoveInArea2, i*350, cid, 100, areas[a], GROUNDDAMAGE, min, max, spell, ret)
  4701. addEvent(doMoveInArea2, i*360, cid, 100, areas[a], GROUNDDAMAGE, 0, 0, spell, ret)
  4702. end
  4703. for i = 12, 16 do
  4704. local a = i-11
  4705. addEvent(doMoveInArea2, i*350, cid, 100, areas[a], GROUNDDAMAGE, min, max, spell, ret)
  4706. addEvent(doMoveInArea2, i*360, cid, 100, areas[a], GROUNDDAMAGE, 0, 0, spell, ret)
  4707. end
  4708. for i = 16, 20 do
  4709. local a = i-15
  4710. addEvent(doMoveInArea2, i*350, cid, 100, areas[a], GROUNDDAMAGE, min, max, spell, ret)
  4711. addEvent(doMoveInArea2, i*360, cid, 100, areas[a], GROUNDDAMAGE, 0, 0, spell, ret)
  4712. end
  4713.  
  4714. elseif spell == "Last Resort" then
  4715.  
  4716. local pos = getThingPosWithDebug(cid)
  4717. local areas = {rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1}
  4718.  
  4719. for i = 0, 9 do
  4720. addEvent(doMoveInArea2, i*400, cid, 3, areas[i+1], NORMALDAMAGE, min, max, spell)
  4721. addEvent(doMoveInArea2, i*410, cid, 3, areas[i+1], NORMALDAMAGE, 0, 0, spell)
  4722. end
  4723.  
  4724. elseif spell == "Ice Resort" then
  4725.  
  4726. local pos = getThingPosWithDebug(cid)
  4727. local areas = {rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1}
  4728.  
  4729. for i = 0, 15 do
  4730. addEvent(doMoveInArea2, i*400, cid, 52, areas[i+1], ICEDAMAGE, min, max, spell)
  4731. addEvent(doMoveInArea2, i*410, cid, 43, areas[i+1], iCEDAMAGE, 0, 0, spell)
  4732. end
  4733.  
  4734. elseif spell == "Psy Impact" then
  4735.  
  4736. local master = getCreatureMaster(cid) or 0
  4737. local ret = {}
  4738. ret.id = 0
  4739. ret.cd = 9
  4740. ret.eff = 0
  4741. ret.check = 0
  4742. ret.spell = spell
  4743. ret.cond = "Miss"
  4744.  
  4745. for rocks = 1, 42 do
  4746. addEvent(fall, rocks*35, cid, master, psyDmg, -1, 98)
  4747. end
  4748.  
  4749. addEvent(doMoveInArea2, 500, cid, 0, BigArea2, psyDmg, min, max, spell, ret)
  4750.  
  4751. elseif spell == "Two Face Shock" then
  4752.  
  4753. local atk = {
  4754. [1] = {179, ICEDAMAGE},
  4755. [2] = {127, GROUNDDAMAGE}
  4756. }
  4757.  
  4758. local rand = math.random(1, 2)
  4759.  
  4760. doAreaCombatHealth(cid, atk[rand][2], getThingPosWithDebug(cid), splash, -min, -max, 255)
  4761.  
  4762. local sps = getThingPosWithDebug(cid)
  4763. sps.x = sps.x+1
  4764. sps.y = sps.y+1
  4765. doSendMagicEffect(sps, atk[rand][1])
  4766.  
  4767.  
  4768. elseif spell == "Aerial Ace" then
  4769.  
  4770. local eff = {16, 221, 223, 243}
  4771.  
  4772. for rocks = 1, 32 do
  4773. addEvent(fall, rocks*22, cid, master, FLYINGDAMAGE, -1, eff[math.random(1, 4)])
  4774. end
  4775.  
  4776. addEvent(doMoveInArea2, 500, cid, 0, BigArea2, FLYINGDAMAGE, min, max, spell)
  4777.  
  4778. elseif spell == "Echoed Voice" then
  4779.  
  4780. local p = getThingPosWithDebug(cid)
  4781. local d = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  4782.  
  4783. function sendAtk(cid, area)
  4784. if isCreature(cid) then
  4785. if not isSightClear(p, area, false) then return true end
  4786. doAreaCombatHealth(cid, NORMALDAMAGE, area, pulse2, -min, -max, 255)
  4787. end
  4788. end
  4789.  
  4790. for a = 0, 5 do
  4791.  
  4792. local t = {
  4793. [0] = {39, {x=p.x, y=p.y-(a+1), z=p.z}},
  4794. [1] = {39, {x=p.x+(a+1), y=p.y, z=p.z}},
  4795. [2] = {39, {x=p.x, y=p.y+(a+1), z=p.z}},
  4796. [3] = {39, {x=p.x-(a+1), y=p.y, z=p.z}}
  4797. }
  4798. addEvent(sendAtk, 400*a, cid, t[d][2])
  4799. addEvent(doAreaCombatHealth, 400*a, cid, ROCKDAMAGE, t[d][2], pulse1, 0, 0, t[d][1])
  4800. end
  4801.  
  4802. elseif spell == "Flare Blitz" then
  4803.  
  4804.  
  4805. local p = getThingPos(cid)
  4806.  
  4807. local pos1 = {
  4808.  
  4809. [1] = {{x = p.x, y = p.y+4, z = p.z}, {x = p.x+1, y = p.y+4, z = p.z}, {x = p.x+2, y = p.y+3, z = p.z}, {x = p.x+3, y = p.y+2, z = p.z}, {x = p.x+4, y = p.y+1, z = p.z}, {x = p.x+4, y = p.y, z = p.z}},
  4810.  
  4811. [2] = {{x = p.x, y = p.y+3, z = p.z}, {x = p.x+1, y = p.y+3, z = p.z}, {x = p.x+2, y = p.y+2, z = p.z}, {x = p.x+3, y = p.y+1, z = p.z}, {x = p.x+3, y = p.y, z = p.z}},
  4812.  
  4813. [3] = {{x = p.x, y = p.y+2, z = p.z}, {x = p.x+1, y = p.y+2, z = p.z}, {x = p.x+2, y = p.y+1, z = p.z}, {x = p.x+2, y = p.y, z = p.z}},
  4814.  
  4815. [4] = {{x = p.x, y = p.y+1, z = p.z}, {x = p.x+1, y = p.y+1, z = p.z}, {x = p.x+1, y = p.y, z = p.z}},
  4816.  
  4817. }
  4818.  
  4819.  
  4820. local pos2 = {
  4821.  
  4822. [1] = {{x = p.x, y = p.y-4, z = p.z}, {x = p.x-1, y = p.y-4, z = p.z}, {x = p.x-2, y = p.y-3, z = p.z}, {x = p.x-3, y = p.y-2, z = p.z}, {x = p.x-4, y = p.y-1, z = p.z}, {x = p.x-4, y = p.y, z = p.z}},
  4823.  
  4824. [2] = {{x = p.x, y = p.y-3, z = p.z}, {x = p.x-1, y = p.y-3, z = p.z}, {x = p.x-2, y = p.y-2, z = p.z}, {x = p.x-3, y = p.y-1, z = p.z}, {x = p.x-3, y = p.y, z = p.z}},
  4825.  
  4826. [3] = {{x = p.x, y = p.y-2, z = p.z}, {x = p.x-1, y = p.y-2, z = p.z}, {x = p.x-2, y = p.y-1, z = p.z}, {x = p.x-2, y = p.y, z = p.z}},
  4827.  
  4828. [4] = {{x = p.x, y = p.y-1, z = p.z}, {x = p.x-1, y = p.y-1, z = p.z}, {x = p.x-1, y = p.y, z = p.z}},
  4829.  
  4830. }
  4831.  
  4832.  
  4833.  
  4834. local pos3 = {
  4835.  
  4836. [1] = {{x = p.x+4, y = p.y, z = p.z}, {x = p.x+4, y = p.y-1, z = p.z}, {x = p.x+3, y = p.y-2, z = p.z}, {x = p.x+2, y = p.y-3, z = p.z}, {x = p.x+1, y = p.y-4, z = p.z}, {x = p.x, y = p.y-4, z = p.z}},
  4837.  
  4838. [2] = {{x = p.x+3, y = p.y, z = p.z}, {x = p.x+3, y = p.y-1, z = p.z}, {x = p.x+2, y = p.y-2, z = p.z}, {x = p.x+1, y = p.y-3, z = p.z}, {x = p.x, y = p.y-3, z = p.z}},
  4839. [3] = {{x = p.x+2, y = p.y, z = p.z}, {x = p.x+2, y = p.y-1, z = p.z}, {x = p.x+1, y = p.y-2, z = p.z}, {x = p.x, y = p.y-2, z = p.z}},
  4840. [4] = {{x = p.x+1, y = p.y, z = p.z}, {x = p.x+1, y = p.y-1, z = p.z}, {x = p.x, y = p.y-1, z = p.z}},
  4841. }
  4842.  
  4843. local pos4 = {
  4844. [1] = {{x = p.x-4, y = p.y, z = p.z}, {x = p.x-4, y = p.y+1, z = p.z}, {x = p.x-3, y = p.y+2, z = p.z}, {x = p.x-2, y = p.y+3, z = p.z}, {x = p.x-1, y = p.y+4, z = p.z}, {x = p.x, y = p.y+4, z = p.z}},
  4845. [2] = {{x = p.x-3, y = p.y, z = p.z}, {x = p.x-3, y = p.y+1, z = p.z}, {x = p.x-2, y = p.y+2, z = p.z}, {x = p.x-1, y = p.y+3, z = p.z}, {x = p.x, y = p.y+3, z = p.z}},
  4846. [3] = {{x = p.x-2, y = p.y, z = p.z}, {x = p.x-2, y = p.y+1, z = p.z}, {x = p.x-1, y = p.y+2, z = p.z}, {x = p.x, y = p.y+2, z = p.z}},
  4847. [4] = {{x = p.x-1, y = p.y, z = p.z}, {x = p.x-1, y = p.y+1, z = p.z}, {x = p.x, y = p.y+1, z = p.z}},
  4848. }
  4849.  
  4850. local atk = {
  4851. ["Flare Blitz"] = {3, 78, FIREDAMAGE},
  4852.  
  4853. }
  4854. local ret = {}
  4855. ret.id = 0
  4856. ret.cd = 12
  4857. ret.eff = 48
  4858. ret.check = 0
  4859. ret.spell = spell
  4860. ret.cond = "Stun"
  4861.  
  4862. local function canMove(cid)
  4863. if not isCreature(cid) then return true end
  4864. doCreatureSetNoMove(cid, false)
  4865. end
  4866. local function sendDist(cid, posi1, posi2, eff, delay)
  4867. if posi1 and posi2 and isCreature(cid) then
  4868. addEvent(sendDistanceShootWithProtect, delay, cid, posi1, posi2, eff)
  4869. end
  4870. end
  4871.  
  4872. local function sendDano(cid, pos, eff, delay, min, max)
  4873. if pos and isCreature(cid) then
  4874. addEvent(doDanoWithProtect, delay, cid, atk[spell][3], pos, 0, -min, -max, eff)
  4875. end
  4876. end
  4877.  
  4878. local function doTornado(cid)
  4879. if isCreature(cid) then
  4880. for j = 1, 4 do
  4881. for i = 1, 6 do --41/207 -- 14/54
  4882. addEvent(sendDist, 350, cid, pos1[j][i], pos1[j][i+1], atk[spell][1], i*330)
  4883. addEvent(sendDano, 350, cid, pos1[j][i], atk[spell][2], i*300, min, max)
  4884. addEvent(sendDano, 350, cid, pos1[j][i], atk[spell][2], i*310, 0, 0)
  4885. ---
  4886. addEvent(sendDist, 350, cid, pos2[j][i], pos2[j][i+1], atk[spell][1], i*330)
  4887. addEvent(sendDano, 350, cid, pos2[j][i], atk[spell][2], i*300, min, max)
  4888. addEvent(sendDano, 350, cid, pos2[j][i], atk[spell][2], i*310, 0, 0)
  4889. ----
  4890. addEvent(sendDist, 800, cid, pos3[j][i], pos3[j][i+1], atk[spell][1], i*330)
  4891. addEvent(sendDano, 800, cid, pos3[j][i], atk[spell][2], i*300, min, max)
  4892. addEvent(sendDano, 800, cid, pos3[j][i], atk[spell][2], i*310, 0, 0)
  4893. ---
  4894. addEvent(sendDist, 800, cid, pos4[j][i], pos4[j][i+1], atk[spell][1], i*330)
  4895. addEvent(sendDano, 800, cid, pos4[j][i], atk[spell][2], i*300, min, max)
  4896. addEvent(sendDano, 800, cid, pos4[j][i], atk[spell][2], i*310, 0, 0)
  4897. end
  4898. end
  4899. end
  4900. end
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906. elseif spell == "Electro Field" or spell == "Petal Tornado" or spell == "Waterfall" or spell == "Flame Wheel" then --alterado v1.8
  4907.  
  4908. local p = getThingPos(cid)
  4909. local pos1 = {
  4910. [1] = {{x = p.x, y = p.y+4, z = p.z}, {x = p.x+1, y = p.y+4, z = p.z}, {x = p.x+2, y = p.y+3, z = p.z}, {x = p.x+3, y = p.y+2, z = p.z}, {x = p.x+4, y = p.y+1, z = p.z}, {x = p.x+4, y = p.y, z = p.z}},
  4911. [2] = {{x = p.x, y = p.y+3, z = p.z}, {x = p.x+1, y = p.y+3, z = p.z}, {x = p.x+2, y = p.y+2, z = p.z}, {x = p.x+3, y = p.y+1, z = p.z}, {x = p.x+3, y = p.y, z = p.z}},
  4912. [3] = {{x = p.x, y = p.y+2, z = p.z}, {x = p.x+1, y = p.y+2, z = p.z}, {x = p.x+2, y = p.y+1, z = p.z}, {x = p.x+2, y = p.y, z = p.z}},
  4913. [4] = {{x = p.x, y = p.y+1, z = p.z}, {x = p.x+1, y = p.y+1, z = p.z}, {x = p.x+1, y = p.y, z = p.z}},
  4914. }
  4915.  
  4916. local pos2 = {
  4917. [1] = {{x = p.x, y = p.y-4, z = p.z}, {x = p.x-1, y = p.y-4, z = p.z}, {x = p.x-2, y = p.y-3, z = p.z}, {x = p.x-3, y = p.y-2, z = p.z}, {x = p.x-4, y = p.y-1, z = p.z}, {x = p.x-4, y = p.y, z = p.z}},
  4918. [2] = {{x = p.x, y = p.y-3, z = p.z}, {x = p.x-1, y = p.y-3, z = p.z}, {x = p.x-2, y = p.y-2, z = p.z}, {x = p.x-3, y = p.y-1, z = p.z}, {x = p.x-3, y = p.y, z = p.z}},
  4919. [3] = {{x = p.x, y = p.y-2, z = p.z}, {x = p.x-1, y = p.y-2, z = p.z}, {x = p.x-2, y = p.y-1, z = p.z}, {x = p.x-2, y = p.y, z = p.z}},
  4920. [4] = {{x = p.x, y = p.y-1, z = p.z}, {x = p.x-1, y = p.y-1, z = p.z}, {x = p.x-1, y = p.y, z = p.z}},
  4921. }
  4922.  
  4923. local pos3 = {
  4924. [1] = {{x = p.x+4, y = p.y, z = p.z}, {x = p.x+4, y = p.y-1, z = p.z}, {x = p.x+3, y = p.y-2, z = p.z}, {x = p.x+2, y = p.y-3, z = p.z}, {x = p.x+1, y = p.y-4, z = p.z}, {x = p.x, y = p.y-4, z = p.z}},
  4925. [2] = {{x = p.x+3, y = p.y, z = p.z}, {x = p.x+3, y = p.y-1, z = p.z}, {x = p.x+2, y = p.y-2, z = p.z}, {x = p.x+1, y = p.y-3, z = p.z}, {x = p.x, y = p.y-3, z = p.z}},
  4926. [3] = {{x = p.x+2, y = p.y, z = p.z}, {x = p.x+2, y = p.y-1, z = p.z}, {x = p.x+1, y = p.y-2, z = p.z}, {x = p.x, y = p.y-2, z = p.z}},
  4927. [4] = {{x = p.x+1, y = p.y, z = p.z}, {x = p.x+1, y = p.y-1, z = p.z}, {x = p.x, y = p.y-1, z = p.z}},
  4928. }
  4929.  
  4930. local pos4 = {
  4931. [1] = {{x = p.x-4, y = p.y, z = p.z}, {x = p.x-4, y = p.y+1, z = p.z}, {x = p.x-3, y = p.y+2, z = p.z}, {x = p.x-2, y = p.y+3, z = p.z}, {x = p.x-1, y = p.y+4, z = p.z}, {x = p.x, y = p.y+4, z = p.z}},
  4932. [2] = {{x = p.x-3, y = p.y, z = p.z}, {x = p.x-3, y = p.y+1, z = p.z}, {x = p.x-2, y = p.y+2, z = p.z}, {x = p.x-1, y = p.y+3, z = p.z}, {x = p.x, y = p.y+3, z = p.z}},
  4933. [3] = {{x = p.x-2, y = p.y, z = p.z}, {x = p.x-2, y = p.y+1, z = p.z}, {x = p.x-1, y = p.y+2, z = p.z}, {x = p.x, y = p.y+2, z = p.z}},
  4934. [4] = {{x = p.x-1, y = p.y, z = p.z}, {x = p.x-1, y = p.y+1, z = p.z}, {x = p.x, y = p.y+1, z = p.z}},
  4935. }
  4936.  
  4937. local atk = {
  4938. --[atk] = {distance, eff, damage}
  4939. ["Electro Field"] = {41, 207, ELECTRICDAMAGE},
  4940. ["Petal Tornado"] = {14, 54, GRASSDAMAGE},
  4941.  
  4942. ["Flame Wheel"] = {-1, 6, FIREDAMAGE}, --alterado v1.9
  4943. ["Waterfall"] = {-1, 155, WATERDAMAGE},
  4944. }
  4945.  
  4946. local function sendDist(cid, posi1, posi2, eff, delay)
  4947. if posi1 and posi2 and isCreature(cid) then
  4948. addEvent(sendDistanceShootWithProtect, delay, cid, posi1, posi2, eff) --alterado v1.6
  4949. end
  4950. end
  4951.  
  4952. local function sendDano(cid, pos, eff, delay, min, max)
  4953. if pos and isCreature(cid) then
  4954. addEvent(doDanoWithProtect, delay, cid, atk[spell][3], pos, 0, -min, -max, eff) --alterado v1.6
  4955. end
  4956. end
  4957.  
  4958. local function doTornado(cid)
  4959. if isCreature(cid) then
  4960. for j = 1, 4 do
  4961. for i = 1, 6 do --41/207 -- 14/54
  4962. addEvent(sendDist, 350, cid, pos1[j][i], pos1[j][i+1], atk[spell][1], i*330)
  4963. addEvent(sendDano, 350, cid, pos1[j][i], atk[spell][2], i*300, min, max)
  4964. addEvent(sendDano, 350, cid, pos1[j][i], atk[spell][2], i*310, 0, 0)
  4965. ---
  4966. addEvent(sendDist, 350, cid, pos2[j][i], pos2[j][i+1], atk[spell][1], i*330)
  4967. addEvent(sendDano, 350, cid, pos2[j][i], atk[spell][2], i*300, min, max)
  4968. addEvent(sendDano, 350, cid, pos2[j][i], atk[spell][2], i*310, 0, 0)
  4969. ----
  4970. addEvent(sendDist, 800, cid, pos3[j][i], pos3[j][i+1], atk[spell][1], i*330)
  4971. addEvent(sendDano, 800, cid, pos3[j][i], atk[spell][2], i*300, min, max)
  4972. addEvent(sendDano, 800, cid, pos3[j][i], atk[spell][2], i*310, 0, 0)
  4973. ---
  4974. addEvent(sendDist, 800, cid, pos4[j][i], pos4[j][i+1], atk[spell][1], i*330)
  4975. addEvent(sendDano, 800, cid, pos4[j][i], atk[spell][2], i*300, min, max)
  4976. addEvent(sendDano, 800, cid, pos4[j][i], atk[spell][2], i*310, 0, 0)
  4977. end
  4978. end
  4979. end
  4980. end
  4981.  
  4982. if spell == "Electro Field" then
  4983. addEvent(doMoveInArea2, 1000, cid, 0, electro, ELECTRICDAMAGE, 0, 0, spell, ret)
  4984. end
  4985.  
  4986. if spell == "Waterfall" then
  4987. addEvent(doMoveInArea2, 1000, cid, 0, electro, WATERDAMAGE, 0, 0, spell, ret)
  4988. end
  4989.  
  4990. if spell == "Flame Wheel" then --alterado v1.8
  4991. doTornado(cid)
  4992. else
  4993. for b = 0, 2 do
  4994. addEvent(doTornado, b*1500, cid)
  4995. end
  4996. end
  4997.  
  4998. elseif spell == "Seed Bomb" then --alterado v1.6
  4999.  
  5000. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  5001.  
  5002. local function doFall(cid)
  5003. for rocks = 1, 42 do --62
  5004. addEvent(fall, rocks*35, cid, master, SEED_BOMBDAMAGE, 1, 54)
  5005. end
  5006. end
  5007.  
  5008. for up = 1, 10 do
  5009. addEvent(upEffect, up*75, cid, 1)
  5010. end
  5011. addEvent(doFall, 450, cid)
  5012. addEvent(doMoveInArea2, 1400, cid, 2, BigArea2, SEED_BOMBDAMAGE, min, max, spell)
  5013.  
  5014.  
  5015. elseif spell == "Reverse Earthshock" then
  5016.  
  5017. local p = getThingPosWithDebug(cid)
  5018. p.x = p.x+1
  5019. p.y = p.y+1
  5020.  
  5021. sendEffWithProtect(cid, p, 151) --send eff
  5022.  
  5023. local function doDano(cid)
  5024. local pos = getThingPosWithDebug(cid)
  5025.  
  5026. local function doSendBubble(cid, pos)
  5027. if not isCreature(cid) then return true end
  5028. doSendDistanceShoot(getThingPosWithDebug(cid), pos, 39)
  5029. doSendMagicEffect(pos, 239)
  5030. end
  5031. --alterado!!
  5032. for a = 1, 20 do
  5033. local r1 = math.random(-4, 4)
  5034. local r2 = r1 == 0 and choose(-3, -2, -1, 2, 3) or math.random(-3, 3)
  5035. --
  5036. local lugar = {x = pos.x + r1, y = pos.y + r2, z = pos.z}
  5037. addEvent(doSendBubble, a * 25, cid, lugar)
  5038. end
  5039.  
  5040. addEvent(doDanoWithProtect, 150, cid, ROCKDAMAGE, pos, waterarea, -min, -max, 0)
  5041. end
  5042.  
  5043. addEvent(doDano, 1250, cid)
  5044.  
  5045.  
  5046. elseif spell == "Fury Swipes" then
  5047.  
  5048. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 23)
  5049. doDanoInTargetWithDelay(cid, target, NORMALDAMAGE, min, max, 152)
  5050.  
  5051.  
  5052. elseif spell == "Poison Jab" then
  5053.  
  5054. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 15)
  5055. doDanoInTargetWithDelay(cid, target, POISONDAMAGE, min, max, 153)
  5056.  
  5057.  
  5058. elseif spell == "Cross Poison" then
  5059.  
  5060. doMoveInArea2(cid, 153, cross, POISONDAMAGE, -min, -max, spell)
  5061.  
  5062.  
  5063. elseif spell == "Hydro Dance" then
  5064.  
  5065. local eff = {155, 154, 53, 155, 53}
  5066. local area = {psy1, psy2, psy3, psy4, psy5}
  5067.  
  5068. setPlayerStorageValue(cid, 3644587, 1)
  5069. addEvent(setPlayerStorageValue, 4*400, cid, 3644587, -1)
  5070. for i = 0, 4 do
  5071. addEvent(doMoveInArea2, i*400, cid, eff[i+1], area[i+1], WATERDAMAGE, min, max, spell)
  5072. end
  5073.  
  5074. elseif spell == "Gyro Ball" then
  5075.  
  5076. local ret = {}
  5077. ret.id = 0
  5078. ret.cd = 9
  5079. ret.check = 0
  5080. ret.eff = 0
  5081. ret.spell = spell
  5082. ret.cond = "Stun"
  5083.  
  5084. stopNow(cid, 2000)
  5085. doMoveInArea2(cid, 156, reto5, STEELDAMAGE, min, max, spell, ret)
  5086.  
  5087. elseif spell == "Rock Tomb" then
  5088.  
  5089. local ret = {}
  5090. ret.id = target
  5091. ret.cd = 9
  5092. ret.eff = 0
  5093. ret.check = getPlayerStorageValue(target, conds["Slow"])
  5094. ret.first = true
  5095. ret.cond = "Slow"
  5096.  
  5097. local function doRockFall(cid, frompos, target)
  5098. if not isCreature(target) or not isCreature(cid) then return true end
  5099. local pos = getThingPosWithDebug(target)
  5100. local ry = math.abs(frompos.y - pos.y)
  5101. doSendDistanceShoot(frompos, pos, 39)
  5102. addEvent(doMoveDano2, ry * 11, cid, target, ROCKDAMAGE, min, max, ret, spell)
  5103. addEvent(sendEffWithProtect, ry*11, cid, pos, 157)
  5104. end
  5105.  
  5106. local function doRockUp(cid, target)
  5107. if not isCreature(target) or not isCreature(cid) then return true end
  5108. local pos = getThingPosWithDebug(target)
  5109. local mps = getThingPosWithDebug(cid)
  5110. local xrg = math.floor((pos.x - mps.x) / 2)
  5111. local topos = mps
  5112. topos.x = topos.x + xrg
  5113. local rd = 7
  5114. topos.y = topos.y - rd
  5115. doSendDistanceShoot(getThingPosWithDebug(cid), topos, 39)
  5116. addEvent(doRockFall, rd * 49, cid, topos, target)
  5117. end
  5118. addEvent(doRockUp, 155, cid, target)
  5119.  
  5120. elseif spell == "Sand Tomb" then
  5121.  
  5122. local ret = {}
  5123. ret.id = 0
  5124. ret.cd = 9
  5125. ret.eff = 34
  5126. ret.check = 0
  5127. ret.spell = spell
  5128. ret.cond = "Miss"
  5129.  
  5130. doMoveInAreaMulti(cid, 22, 158, bullet, bulletDano, GROUNDDAMAGE, min, max, ret)
  5131.  
  5132. elseif spell == "Magnet Bomb" then
  5133.  
  5134. local ret = {}
  5135. ret.id = 0
  5136. ret.cd = 9
  5137. ret.eff = 48
  5138. ret.check = 0
  5139. ret.spell = spell
  5140. ret.cond = "Miss"
  5141.  
  5142. doMoveInAreaMulti(cid, 22, 171, bullet, bulletDano, ELECTRICDAMAGE, min, max, ret)
  5143.  
  5144. elseif spell == "Rain Dance" then
  5145.  
  5146. local master = isSummon(cid) and getCreatureMaster(cid) or cid
  5147. ------------
  5148. local ret = {}
  5149. ret.id = 0
  5150. ret.cd = 9
  5151. ret.check = 0
  5152. ret.eff = 1
  5153. ret.cond = "Silence"
  5154. ---
  5155. local function doFall(cid)
  5156. for rocks = 1, 42 do --62
  5157. addEvent(fall, rocks*35, cid, master, WATERDAMAGE, 52, 1)
  5158. end
  5159. end
  5160. ---
  5161. local function doRain(cid)
  5162. if isSummon(cid) then
  5163. doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")
  5164. end --cura status
  5165. doCureStatus(cid, "all")
  5166. ---
  5167. setPlayerStorageValue(cid, 253, 1) --focus
  5168. doSendMagicEffect(getThingPosWithDebug(cid), 132)
  5169. ---
  5170. doMoveInArea2(cid, 0, confusion, WATERDAMAGE, 0, 0, spell, ret)
  5171. end
  5172. ---
  5173. addEvent(doFall, 200, cid)
  5174. addEvent(doRain, 1000, cid)
  5175.  
  5176.  
  5177. elseif spell == "Night Slash" then
  5178.  
  5179. local p = getThingPosWithDebug(cid)
  5180.  
  5181. local t = {
  5182. {251, {x = p.x+1, y = p.y-1, z = p.z}},
  5183. {253, {x = p.x+2, y = p.y+1, z = p.z}},
  5184. {252, {x = p.x+1, y = p.y+2, z = p.z}},
  5185. {254, {x = p.x-1, y = p.y+1, z = p.z}},
  5186. }
  5187.  
  5188. doAreaCombatHealth(cid, DARKDAMAGE, p, scyther5, -min, -max, 165)
  5189. for a = 0, 1 do
  5190. for i = 1, 4 do
  5191. addEvent(doSendMagicEffect, a*400, t[i][2], t[i][1]) --alterado v1.8
  5192. end
  5193. end
  5194. addEvent(doAreaCombatHealth, 400, cid, DARKDAMAGE, p, scyther5, -min, -max, 165)
  5195.  
  5196. elseif spell == "Heavy Slam" then
  5197.  
  5198. local p = getThingPosWithDebug(cid)
  5199.  
  5200. local t = {
  5201. {251, {x = p.x+1, y = p.y-1, z = p.z}},
  5202. {253, {x = p.x+2, y = p.y+1, z = p.z}},
  5203. {252, {x = p.x+1, y = p.y+2, z = p.z}},
  5204. {254, {x = p.x-1, y = p.y+1, z = p.z}},
  5205. }
  5206.  
  5207. doAreaCombatHealth(cid, STEELDAMAGE, p, confusion, -min, -max, 77)
  5208. for a = 0, 1 do
  5209. for i = 1, 4 do
  5210. addEvent(doSendMagicEffect, a*400, t[i][2], t[i][1]) --alterado v1.8
  5211. end
  5212. end
  5213. addEvent(doAreaCombatHealth, 400, cid, STEELDAMAGE, p, confusion, -min, -max, 165)
  5214.  
  5215. elseif spell == "Wild Charge" then
  5216.  
  5217. local ret = {}
  5218. ret.id = 0
  5219. ret.cd = 9
  5220. ret.eff = 48
  5221. ret.check = 0
  5222. ret.spell = spell
  5223. ret.cond = "Stun"
  5224.  
  5225. local pos = getThingPosWithDebug(cid)
  5226. local areas = {rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1}
  5227.  
  5228. for i = 0, 14 do
  5229. addEvent(doMoveInArea2, i*320, cid, 48, areas[i+1], ELECTRICDAMAGE, min, max, spell, ret)
  5230. addEvent(doMoveInArea2, i*330, cid, 48, areas[i+1], ELECTRICDAMAGE, 0, 0, spell)
  5231. end
  5232.  
  5233. elseif spell == "Focus Blast" then
  5234.  
  5235. local ret = {}
  5236. ret.id = 0
  5237. ret.cd = 9
  5238. ret.eff = 136
  5239. ret.check = 0
  5240. ret.spell = spell
  5241. ret.cond = "Confusion"
  5242.  
  5243. local pos = getThingPosWithDebug(cid)
  5244. local areas = {rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1}
  5245.  
  5246. for i = 0, 14 do
  5247. addEvent(doMoveInArea2, i*320, cid, 112, areas[i+1], FIGHTINGDAMAGE, min, max, spell, ret)
  5248. addEvent(doMoveInArea2, i*330, cid, 112, areas[i+1], FIGHTINGDAMAGE, 0, 0, spell)
  5249. end
  5250.  
  5251. elseif spell == "PsyPower" then
  5252.  
  5253. local ret = {}
  5254. ret.id = 0
  5255. ret.cd = 9
  5256. ret.eff = 136
  5257. ret.check = 0
  5258. ret.spell = spell
  5259. ret.cond = "Confusion"
  5260.  
  5261. local pos = getThingPosWithDebug(cid)
  5262. local areas = {rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1, rock5, rock4, rock3, rock2, rock1}
  5263.  
  5264. for i = 0, 14 do
  5265. addEvent(doMoveInArea2, i*320, cid, 112, areas[i+1], PSYCHICDAMAGE, min, max, spell, ret)
  5266. addEvent(doMoveInArea2, i*330, cid, 112, areas[i+1], PSYCHICDAMAGE, 0, 0, spell)
  5267. end
  5268.  
  5269. elseif spell == "Jump Kick" then --ver essa
  5270.  
  5271. doMoveInAreaMulti(cid, 42, 113, bullet, bulletDano, FIGHTINGDAMAGE, min, max)
  5272.  
  5273. elseif spell == "Lava Plume" then --alterado v1.8 \/\/\/
  5274.  
  5275. doMoveInArea2(cid, 5, cross, FIREDAMAGE, -min, -max, spell)
  5276. doMoveInArea2(cid, 87, cross, FIREDAMAGE, 0, 0, spell)
  5277.  
  5278. elseif spell == "Silver Wind" then
  5279.  
  5280. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  5281. doDanoWithProtectWithDelay(cid, target, BUGDAMAGE, min, max, 78, SilverWing)
  5282.  
  5283. elseif spell == "Bug Buzz" then
  5284.  
  5285. local ret = {}
  5286. ret.id = target
  5287. ret.cd = 9
  5288. ret.eff = 34
  5289. ret.check = 0
  5290. ret.spell = spell
  5291. ret.cond = "Stun"
  5292.  
  5293. doMoveInArea2(cid, 86, db1, BUGDAMAGE, min, max, spell, ret)
  5294. addEvent(doMoveInArea2, 250, cid, 86, db1, BUGDAMAGE, 0, 0, spell)
  5295.  
  5296. elseif spell == "Whirlpool" then
  5297.  
  5298. local function setSto(cid)
  5299. if isCreature(cid) then
  5300. setPlayerStorageValue(cid, 3644587, -1)
  5301. end
  5302. end
  5303.  
  5304. local function doDano(cid)
  5305. if isSleeping(cid) then return true end
  5306. doDanoWithProtect(cid, WATERDAMAGE, getThingPosWithDebug(cid), splash, min, max, 89)
  5307. end
  5308.  
  5309. setPlayerStorageValue(cid, 3644587, 1)
  5310. for r = 0, 10 do
  5311. addEvent(doDano, 600 * r, cid)
  5312. end
  5313. addEvent(setSto, 600*10, cid)
  5314.  
  5315. elseif spell == "Iron Head" then
  5316.  
  5317. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  5318. doDanoInTargetWithDelay(cid, target, STEELDAMAGE, -min, -max, 77)
  5319.  
  5320. elseif spell == "Brick Break" or spell == "Hammer Arm" then
  5321.  
  5322. local ret = {}
  5323. ret.id = 0
  5324. ret.cd = 9
  5325. ret.eff = 88
  5326. ret.check = 0
  5327. ret.first = true
  5328. ret.cond = "Paralyze"
  5329.  
  5330. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  5331. local p = getThingPosWithDebug(cid)
  5332. local t = {
  5333. [0] = {90, {x=p.x+1, y=p.y-1, z=p.z}},
  5334. [1] = {90, {x=p.x+2, y=p.y+1, z=p.z}},
  5335. [2] = {90, {x=p.x+1, y=p.y+2, z=p.z}},
  5336. [3] = {90, {x=p.x-1, y=p.y+1, z=p.z}},
  5337. }
  5338.  
  5339. doMoveInArea2(cid, 0, BrickBeak, FIGHTINGDAMAGE, min, max, spell, ret)
  5340. doSendMagicEffect(t[a][2], t[a][1])
  5341.  
  5342.  
  5343. elseif spell == "Volcano Burst" then
  5344.  
  5345. local pos = getThingPosWithDebug(cid)
  5346.  
  5347. doMoveInArea2(cid, 91, inferno1, FIREDAMAGE, 0, 0, spell)
  5348. addEvent(doDanoWithProtect, math.random(100, 400), cid, FIREDAMAGE, pos, inferno2, -min, -max, 0)
  5349.  
  5350. elseif spell == "Bone Rush" then
  5351.  
  5352. local area = {gale1, gale2, gale3, gale4, gale3, gale2, gale1}
  5353.  
  5354. for i = 0, 6 do
  5355. addEvent(doMoveInArea2, i*400, cid, 227, area[i+1], ROCKDAMAGE, min, max, spell)
  5356. end
  5357.  
  5358.  
  5359. elseif spell == "Giant Water Gun" then
  5360.  
  5361. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  5362. local p = getThingPosWithDebug(cid)
  5363.  
  5364. eff = 64
  5365. if a == 0 then
  5366.  
  5367. doSendMagicEffect({x=p.x-1, y=p.y-1, z=p.z}, 69)
  5368. doSendMagicEffect({x=p.x, y=p.y-1, z=p.z}, 69)
  5369. doSendMagicEffect({x=p.x+1, y=p.y-1, z=p.z}, 69)
  5370. eff = 64
  5371. elseif a == 1 then
  5372. eff = 65
  5373. doSendMagicEffect({x=p.x+6, y=p.y, z=p.z}, 70)
  5374. doSendMagicEffect({x=p.x+6, y=p.y+1, z=p.z}, 70)
  5375. doSendMagicEffect({x=p.x+6, y=p.y-1, z=p.z}, 70)
  5376. elseif a == 2 then
  5377. eff = 66
  5378. doSendMagicEffect({x=p.x, y=p.y+6, z=p.z}, 71)
  5379. doSendMagicEffect({x=p.x+1, y=p.y+6, z=p.z}, 71)
  5380. doSendMagicEffect({x=p.x-1, y=p.y+6, z=p.z}, 71)
  5381. elseif a == 3 then
  5382. eff = 67
  5383. doSendMagicEffect({x=p.x-1, y=p.y, z=p.z}, 70)
  5384. doSendMagicEffect({x=p.x-1, y=p.y+1, z=p.z}, 70)
  5385. doSendMagicEffect({x=p.x-1, y=p.y-1, z=p.z}, 70)
  5386. end
  5387. doMoveInArea2(cid, eff, triplo6, WATERDAMAGE, min, max, spell)
  5388. elseif spell == "Dual Water Gun" then
  5389.  
  5390. local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  5391. local p = getThingPosWithDebug(cid)
  5392.  
  5393. if a == 0 then
  5394.  
  5395. doSendMagicEffect({x=p.x-1, y=p.y-1, z=p.z}, 69)
  5396. doSendMagicEffect({x=p.x+1, y=p.y-1, z=p.z}, 69)
  5397. elseif a == 1 then
  5398. doSendMagicEffect({x=p.x+6, y=p.y+1, z=p.z}, 70)
  5399. doSendMagicEffect({x=p.x+6, y=p.y-1, z=p.z}, 70)
  5400. elseif a == 2 then
  5401. doSendMagicEffect({x=p.x+1, y=p.y+6, z=p.z}, 71)
  5402. doSendMagicEffect({x=p.x-1, y=p.y+6, z=p.z}, 71)
  5403. elseif a == 3 then
  5404. doSendMagicEffect({x=p.x-1, y=p.y+1, z=p.z}, 70)
  5405. doSendMagicEffect({x=p.x-1, y=p.y-1, z=p.z}, 70)
  5406. end
  5407. doMoveInArea2(cid, 0, duplo6, WATERDAMAGE, min, max, spell)
  5408.  
  5409. --elseif spell == "Hammer Arm" then
  5410.  
  5411. --local ret = {}
  5412. --ret.id = 0
  5413. --ret.cd = 9
  5414. --ret.eff = 88
  5415. --ret.check = 0
  5416. --ret.first = true
  5417. --ret.cond = "Paralyze"
  5418.  
  5419. --local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  5420. --local p = getThingPosWithDebug(cid)
  5421. --local t = {
  5422. --[0] = {92, {x=p.x, y=p.y-1, z=p.z}},
  5423. --[1] = {94, {x=p.x+2, y=p.y, z=p.z}},
  5424. --[2] = {95, {x=p.x+1, y=p.y+2, z=p.z}},
  5425. --[3] = {93, {x=p.x-1, y=p.y, z=p.z}},
  5426. --}
  5427.  
  5428. --doMoveInArea2(cid, 0, BrickBeak, FIGHTINGDAMAGE, min, max, spell, ret)
  5429. --doSendMagicEffect(t[a][2], t[a][1]) -->
  5430.  
  5431. elseif spell == "Dragon Tail" then
  5432.  
  5433. local function rebackSpd(cid, sss)
  5434. if not isCreature(cid) then return true end
  5435. doChangeSpeed(cid, sss)
  5436. setPlayerStorageValue(cid, 446, -1)
  5437. end
  5438.  
  5439. local x = getCreatureSpeed(cid)
  5440. doFaceOpposite(cid)
  5441. doChangeSpeed(cid, -x)
  5442. addEvent(rebackSpd, 400, cid, x)
  5443. setPlayerStorageValue(cid, 446, 1)
  5444. doAreaCombatHealth(cid, DRAGONDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 136)
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450. elseif spell == "Discharge" then
  5451.  
  5452. local pL = getThingPosWithDebug(cid)
  5453. pL.x = pL.x+5
  5454. pL.y = pL.y+1
  5455. -----------------
  5456. local pO = getThingPosWithDebug(cid)
  5457. pO.x = pO.x-3
  5458. pO.y = pO.y+1
  5459. ------------------
  5460. local pN = getThingPosWithDebug(cid)
  5461. pN.x = pN.x+1
  5462. pN.y = pN.y+5
  5463. -----------------
  5464. local pS = getThingPosWithDebug(cid)
  5465. pS.x = pS.x+1
  5466. pS.y = pS.y-3
  5467.  
  5468. local po = {pL, pO, pN, pS}
  5469. local po2 = {
  5470. {x = pL.x, y = pL.y-1, z = pL.z},
  5471. {x = pO.x, y = pO.y-1, z = pO.z},
  5472. {x = pN.x-1, y = pN.y, z = pN.z},
  5473. {x = pS.x-1, y = pS.y, z = pS.z},
  5474. }
  5475.  
  5476. local ret = {}
  5477. ret.id = 0
  5478. ret.cd = 7
  5479. ret.check = 0
  5480. ret.eff = 0
  5481. ret.spell = spell
  5482. ret.cond = "Stun"
  5483.  
  5484. doSendMagicEffect(getThingPosWithDebug(cid), 92) --92
  5485. for i = 1, 4 do
  5486. doSendMagicEffect(po[i], 86) --86
  5487. doAreaCombatHealth(cid, ELECTRICDAMAGE, po2[i], crusher, -min, -max, 255)
  5488. end
  5489. doMoveInArea2(cid, 40, crusherstomp, ELECTRICDAMAGE, min, max, spell, ret) --40
  5490.  
  5491.  
  5492.  
  5493.  
  5494.  
  5495. --/////////////////////// PASSIVAS /////////////////////////--
  5496.  
  5497. elseif spell == "Counter Helix" then
  5498. -- [nome] = {out = outfit girando, efeitos}
  5499. local OutFit = {
  5500. ["Scyther"] = {out = 496, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --scyther
  5501. ["Scizor"] = {out = 918, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Scizor
  5502. ["Shiny Scyther"] = {out = 849, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Shiny Scyther
  5503. ["Hitmontop"] = {out = 1193, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Hitmontop
  5504. ["Shiny Hitmontop"] = {out = 1451, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Shiny Hitmontop
  5505. ["Pineco"] = {out = 1194, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --pineco
  5506. ["Forretress"] = {out = 1192, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Forretress
  5507. ["Wobbuffet"] = {out = 924, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --wobb
  5508. ["Alakazam"] = {out = 569, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --alaka
  5509. ["Kadabra"] = {out = 570, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --kadabra
  5510. ["Shiny Abra"] = {out = 1257, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --s abra
  5511. ["Kangaskhan"] = {out = 549, cima = 251, direita = 253, esquerda = 254, baixo = 252}, --test
  5512. }
  5513.  
  5514. if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a passiva 2x seguidas...
  5515. return true
  5516. end
  5517.  
  5518.  
  5519. local nome1 = getSubName(cid, target) --alterado v1.6.1
  5520. local outfitt = OutFit[nome1] --alterado v1.6.1
  5521.  
  5522. local function damage(cid, min, max)
  5523. if isCreature(cid) then
  5524. if isInArray({"Scyther", "Shiny Scyther", "Pineco"}, nome1) then --alterado v1.6
  5525. damage = BUGDAMAGE
  5526. elseif isInArray({"Hitmontop", "Shiny Hitmontop", "Kangaskhan"}, nome1) then
  5527. damage = FIGHTINGDAMAGE --alterado v1.6.1
  5528. else
  5529. damage = STEELDAMAGE
  5530. end
  5531. doAreaCombatHealth(cid, damage, getThingPosWithDebug(cid), scyther5, -min, -max, CONST_ME_NONE) --alterado v1.6.1
  5532. ---
  5533. doAreaCombatHealth(cid, null, getThingPos(cid), scythe1, 0, 0, outfitt.cima) --cima
  5534. doAreaCombatHealth(cid, null, getThingPos(cid), scythe2, 0, 0, outfitt.baixo) --baixo
  5535. doAreaCombatHealth(cid, null, getThingPos(cid), scythe3, 0, 0, outfitt.direita) --direita
  5536. doAreaCombatHealth(cid, null, getThingPos(cid), scythe4, 0, 0, outfitt.esquerda) --esquerda
  5537. end
  5538. end
  5539.  
  5540. local function sendEff(cid)
  5541. if isCreature(cid) then
  5542. doAreaCombatHealth(cid, null, getThingPos(cid), scythe1, 0, 0, outfitt.cima) --cima
  5543. doAreaCombatHealth(cid, null, getThingPos(cid), scythe2, 0, 0, outfitt.baixo) --baixo
  5544. doAreaCombatHealth(cid, null, getThingPos(cid), scythe3, 0, 0, outfitt.direita) --direita --alterado v1.6
  5545. doAreaCombatHealth(cid, null, getThingPos(cid), scythe4, 0, 0, outfitt.esquerda) --esquerda
  5546. end
  5547. end
  5548.  
  5549. local function doChangeO(cid)
  5550. if not isCreature(cid) then return true end
  5551. setPlayerStorageValue(cid, 32623, 0)
  5552. if isSleeping(cid) and getMonsterInfo(getCreatureName(cid)).lookCorpse ~= 0 then
  5553. doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(cid)).lookCorpse}, -1)
  5554. else
  5555. doRemoveCondition(cid, CONDITION_OUTFIT)
  5556. end
  5557. end
  5558.  
  5559. local delay = 200 -- não mexe
  5560. local master = isSummon(cid) and getCreatureMaster(cid) or cid --alterado v1.6
  5561. local summons = getCreatureSummons(master)
  5562.  
  5563. if (isPlayer(master) and #summons >= 2) or (ehMonstro(master) and #summons >= 1) then
  5564. for j = 1, #summons do
  5565. setPlayerStorageValue(summons[j], 32623, 1)
  5566. doSetCreatureOutfit(summons[j], {lookType = outfit.out}, -1)
  5567.  
  5568. for i = 1, 2 do --alterado v1.6
  5569. addEvent(sendEff, delay*i, summons[j])
  5570. end
  5571. addEvent(doChangeO, 2 * 300 + 10, summons[j])
  5572. end
  5573. for i = 1, 2 do
  5574. addEvent(damage, delay*i, (isPlayer(master) and summons[1] or master), min, max)
  5575. end
  5576. else
  5577. setPlayerStorageValue(cid, 32623, 1)
  5578. setPlayerStorageValue(cid, 98654, 1)
  5579.  
  5580. for i = 1, 2 do --alterado v1.6
  5581. addEvent(damage, delay*i, cid, min, max)
  5582. end
  5583. addEvent(doChangeO, 2 * 300 + 10, cid)
  5584. end
  5585.  
  5586. elseif spell == "Lava-Counter" then
  5587.  
  5588. local function sendStickEff(cid, dir)
  5589. if not isCreature(cid) then return true end
  5590. doAreaCombatHealth(cid, FIREDAMAGE, getPosByDir(getThingPosWithDebug(cid), dir), 0, -min, -max, 5)
  5591. end
  5592.  
  5593. local function doStick(cid)
  5594. if not isCreature(cid) then return true end
  5595. local t = {
  5596. [1] = SOUTHWEST,
  5597. [2] = SOUTH,
  5598. [3] = SOUTHEAST,
  5599. [4] = EAST,
  5600. [5] = NORTHEAST,
  5601. [6] = NORTH,
  5602. [7] = NORTHWEST,
  5603. [8] = WEST,
  5604. [9] = SOUTHWEST,
  5605. }
  5606. for a = 1, 9 do
  5607. addEvent(sendStickEff, a * 140, cid, t[a])
  5608. end
  5609. end
  5610.  
  5611. doStick(cid, false, cid)
  5612. setPlayerStorageValue(cid, 98654, 1)
  5613.  
  5614. elseif spell == "Mega Drain" then
  5615.  
  5616. local uid = checkAreaUid(getThingPos(cid), check, 1, 1)
  5617. for _,pid in pairs(uid) do
  5618. if isCreature(cid) and isCreature(pid) and pid ~= cid then
  5619. if isPlayer(pid) and #getCreatureSummons(pid) >= 1 then return false end
  5620.  
  5621. local life = getCreatureHealth(pid)
  5622.  
  5623. doAreaCombatHealth(cid, GRASSDAMAGE, getThingPos(pid), 0, -min, -max, 14)
  5624.  
  5625. local newlife = life - getCreatureHealth(pid)
  5626.  
  5627. doSendMagicEffect(getThingPos(cid), 14)
  5628. setPlayerStorageValue(cid, 98654, 1)
  5629. if newlife >= 1 then
  5630. doCreatureAddHealth(cid, newlife)
  5631. doSendAnimatedText(getThingPos(cid), "+"..newlife.."", 32)
  5632. end
  5633. end
  5634. end
  5635.  
  5636. elseif spell == "Spores Reaction" then
  5637.  
  5638. local random = math.random(1, 3)
  5639.  
  5640. if random == 1 then
  5641. local ret = {}
  5642. ret.id = 0
  5643. ret.cd = math.random(2, 3)
  5644. ret.check = 0 --alterado v1.6
  5645. ret.first = true
  5646. ret.cond = "Sleep"
  5647.  
  5648. doMoveInArea2(cid, 27, confusion, GRASSDAMAGE, 0, 0, "Spores Reaction", ret)
  5649. setPlayerStorageValue(cid, 98654, 1)
  5650. elseif random == 2 then
  5651. local ret = {}
  5652. ret.id = 0
  5653. ret.cd = 6
  5654. ret.eff = 0
  5655. ret.check = 0
  5656. ret.spell = spell
  5657. ret.cond = "Stun"
  5658.  
  5659. doMoveInArea2(cid, 85, confusion, GRASSDAMAGE, 0, 0, "Spores Reaction", ret)
  5660. setPlayerStorageValue(cid, 98654, 1)
  5661. else
  5662. local ret = {}
  5663. ret.id = 0
  5664. ret.cd = math.random(6, 10)
  5665. ret.check = 0
  5666. local lvl = isSummon(cid) and getMasterLevel(cid) or getPokemonLevel(cid) --alterado v1.6
  5667. ret.damage = math.floor((getPokemonLevel(cid)+lvl * 3)/2)
  5668. ret.cond = "Poison"
  5669.  
  5670. doMoveInArea2(cid, 84, confusion, POISONDAMAGE, 0, 0, "Spores Reaction", ret)
  5671. setPlayerStorageValue(cid, 98654, 1)
  5672. end
  5673.  
  5674. elseif spell == "Stunning Confusion" then
  5675.  
  5676. if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a spell 2x seguidas...
  5677. return true
  5678. end
  5679.  
  5680. local function damage(cid)
  5681. if isCreature(cid) then
  5682. doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPosWithDebug(cid), bombWee3, -min, -max, 133)
  5683. end
  5684. end
  5685.  
  5686. setPlayerStorageValue(cid, 32623, 1) --proteçao
  5687. for i = 1, 7 do
  5688. addEvent(damage, i*500, cid)
  5689. end
  5690. addEvent(setPlayerStorageValue, 3500, cid, 32623, 0) --proteçao
  5691. setPlayerStorageValue(cid, 98654, 1)
  5692.  
  5693. elseif spell == "Bone-Spin" then
  5694.  
  5695. local function sendStickEff(cid, dir)
  5696. if not isCreature(cid) then return true end
  5697. doAreaCombatHealth(cid, GROUNDDAMAGE, getPosByDir(getThingPosWithDebug(cid), dir), 0, -min, -max, 227)
  5698. end
  5699.  
  5700. local function doStick(cid)
  5701. if not isCreature(cid) then return true end
  5702. local t = {
  5703. [1] = SOUTHWEST,
  5704. [2] = SOUTH,
  5705. [3] = SOUTHEAST,
  5706. [4] = EAST,
  5707. [5] = NORTHEAST,
  5708. [6] = NORTH,
  5709. [7] = NORTHWEST,
  5710. [8] = WEST,
  5711. [9] = SOUTHWEST,
  5712. }
  5713. for a = 1, 9 do
  5714. addEvent(sendStickEff, a * 140, cid, t[a])
  5715. end
  5716. end
  5717.  
  5718. doStick(cid, false, cid)
  5719. setPlayerStorageValue(cid, 98654, 1)
  5720. --alterado v1.4
  5721. elseif spell == "Amnesia" then
  5722.  
  5723. if getPlayerStorageValue(cid, 253) >= 1 then return true end
  5724.  
  5725. doCreatureSay(cid, "????", 20)
  5726. doSendMagicEffect(getThingPosWithDebug(cid), 132)
  5727. setPlayerStorageValue(cid, 253, 1)
  5728. setPlayerStorageValue(cid, 98654, 1)
  5729.  
  5730. elseif spell == "Dragon Fury" then
  5731.  
  5732. if getPlayerStorageValue(cid, 32623) == 1 then
  5733. return true
  5734. end
  5735.  
  5736. setPlayerStorageValue(cid, 32623, 1)
  5737. setPlayerStorageValue(cid, 98654, 1)
  5738.  
  5739. if isInArray({"Persian", "Raticate", "Shiny Raticate"}, getSubName(cid, target)) then --alterado v1.6.1
  5740. doRaiseStatus(cid, 1.5, 0, 0, 10)
  5741. else --alterado v1.5
  5742. doRaiseStatus(cid, 1.5, 1.5, 0, 10) --ver isso
  5743. end
  5744.  
  5745. for t = 1, 7 do --alterado v1.5
  5746. addEvent(sendMoveEffect, t*1500, cid, 12)
  5747. end
  5748. addEvent(setPlayerStorageValue, 10500, cid, 32623, 0) --alterado v1.8
  5749.  
  5750. elseif spell == "Electric Charge" then
  5751.  
  5752. if getPlayerStorageValue(cid, 253) >= 1 then
  5753. return true
  5754. end
  5755.  
  5756. setPlayerStorageValue(cid, 253, 1)
  5757. setPlayerStorageValue(cid, 98654, 1)
  5758. doSendMagicEffect(getThingPosWithDebug(cid), 207)
  5759. doSendAnimatedText(getThingPosWithDebug(cid), "FOCUS", 144)
  5760.  
  5761. elseif spell == "Shock-Counter" then
  5762.  
  5763. local function sendStickEff(cid, dir)
  5764. if not isCreature(cid) then return true end
  5765. doAreaCombatHealth(cid, ELECTRICDAMAGE, getPosByDir(getThingPosWithDebug(cid), dir), 0, -min, -max, 207)
  5766. end
  5767.  
  5768. local function doStick(cid)
  5769. if not isCreature(cid) then return true end
  5770. local t = {
  5771. [1] = SOUTHWEST,
  5772. [2] = SOUTH,
  5773. [3] = SOUTHEAST,
  5774. [4] = EAST,
  5775. [5] = NORTHEAST,
  5776. [6] = NORTH,
  5777. [7] = NORTHWEST,
  5778. [8] = WEST,
  5779. [9] = SOUTHWEST,
  5780. }
  5781. for a = 1, 9 do
  5782. addEvent(sendStickEff, a * 140, cid, t[a])
  5783. end
  5784. end
  5785.  
  5786. doStick(cid, false, cid)
  5787. setPlayerStorageValue(cid, 98654, 1)
  5788.  
  5789. elseif spell == "Mirror Coat" then
  5790.  
  5791. if spell == "Magic Coat" then
  5792. eff = 11
  5793. else
  5794. eff = 135
  5795. end
  5796.  
  5797. doSendMagicEffect(getThingPosWithDebug(cid), eff)
  5798. setPlayerStorageValue(cid, 21099, 1)
  5799. setPlayerStorageValue(cid, 98654, 1)
  5800.  
  5801. elseif spell == "Zen Mind" then
  5802.  
  5803. function doCure(cid)
  5804. if not isCreature(cid) then return true end
  5805. if isSummon(cid) then
  5806. doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")
  5807. end
  5808. doCureStatus(cid, "all")
  5809. end
  5810.  
  5811. addEvent(doCure, 1000, cid)
  5812. doSetCreatureOutfit(cid, {lookType = 1001}, 2000)
  5813. setPlayerStorageValue(cid, 98654, 1)
  5814.  
  5815. elseif spell == "Demon Kicker" then
  5816.  
  5817. --[outfit] = outfit chutando,
  5818. local hitmonlees = {
  5819. ["Hitmonlee"] = 652, --hitmonlee
  5820. ["Shiny Hitmonlee"] = 878, --shiny hitmonlee
  5821. }
  5822.  
  5823. local nome = getCreatureName(cid)
  5824. --alterado v1.6 --alterado v1.7
  5825. if (not hitmonlees[nome] and isCreature(target)) or (isCreature(target) and math.random(1, 100) <= passivesChances["Demon Kicker"][nome]) then
  5826.  
  5827. if getDistanceBetween(getThingPos(cid), getThingPos(target)) > 1 then
  5828. return true
  5829. end
  5830. if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a passiva 2x seguidas...
  5831. return true
  5832. end
  5833.  
  5834. if not isSummon(cid) then --alterado v1.7
  5835. doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER)
  5836. end
  5837.  
  5838. local function doChangeHitmon(cid)
  5839. if not isCreature(cid) then return true end
  5840. setPlayerStorageValue(cid, 32623, 0) --proteçao
  5841. if isSleeping(cid) and getMonsterInfo(getCreatureName(cid)).lookCorpse ~= 0 then
  5842. doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(cid)).lookCorpse}, -1)
  5843. else
  5844. doRemoveCondition(cid, CONDITION_OUTFIT)
  5845. end
  5846. end
  5847.  
  5848. setPlayerStorageValue(cid, 32623, 1) --proteçao
  5849. setPlayerStorageValue(cid, 98654, 1)
  5850.  
  5851. local look = hitmonlees[nome] or getPlayerStorageValue(cid, 21104) --alterado v1.6
  5852.  
  5853. doCreatureSetLookDir(cid, getCreatureDirectionToTarget(cid, target))
  5854. doSetCreatureOutfit(cid, {lookType = look}, -1) --alterado v1.6
  5855. doTargetCombatHealth(cid, target, FIGHTINGDAMAGE, -min, -max, 255)
  5856.  
  5857. addEvent(doChangeHitmon, 700, cid)
  5858. end
  5859.  
  5860. elseif spell == "Blaze Kicker" then
  5861.  
  5862. --[outfit] = outfit chutando,
  5863. local blazikens = {
  5864. ["Blaziken"] = 1628, --Blaziken
  5865. ["Shiny Blaziken"] = 1629, --shiny Blaziken
  5866. }
  5867.  
  5868. local nome = getCreatureName(cid)
  5869. --alterado v1.6 --alterado v1.7
  5870. if (not blazikens[nome] and isCreature(target)) or (isCreature(target) and math.random(1, 100) <= passivesChances["Blaze Kicker"][nome]) then
  5871.  
  5872. if getDistanceBetween(getThingPos(cid), getThingPos(target)) > 1 then
  5873. return true
  5874. end
  5875. if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a passiva 2x seguidas...
  5876. return true
  5877. end
  5878.  
  5879. if not isSummon(cid) then --alterado v1.7
  5880. doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER)
  5881. end
  5882.  
  5883. local function doChangeHitmon(cid)
  5884. if not isCreature(cid) then return true end
  5885. setPlayerStorageValue(cid, 32623, 0) --proteçao
  5886. if isSleeping(cid) and getMonsterInfo(getCreatureName(cid)).lookCorpse ~= 0 then
  5887. doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(cid)).lookCorpse}, -1)
  5888. else
  5889. doRemoveCondition(cid, CONDITION_OUTFIT)
  5890. end
  5891. end
  5892.  
  5893. setPlayerStorageValue(cid, 32623, 1) --proteçao
  5894. setPlayerStorageValue(cid, 98654, 1)
  5895.  
  5896. local look = blazikens[nome] or getPlayerStorageValue(cid, 21104) --alterado v1.6
  5897.  
  5898. doCreatureSetLookDir(cid, getCreatureDirectionToTarget(cid, target))
  5899. doSetCreatureOutfit(cid, {lookType = look}, -1) --alterado v1.6
  5900. doTargetCombatHealth(cid, target, FIREDAMAGE, -min, -max, 255)
  5901.  
  5902. addEvent(doChangeHitmon, 700, cid)
  5903. end
  5904.  
  5905.  
  5906. elseif spell == "Illusion" then
  5907.  
  5908. local team = {
  5909. ["Misdreavus"] = "MisdreavusTeam",
  5910. ["Shiny Stantler"] = "Shiny StantlerTeam",
  5911. ["Stantler"] = "StantlerTeam",
  5912. }
  5913.  
  5914. local function RemoveTeam(cid)
  5915. if isCreature(cid) then
  5916. doSendMagicEffect(getThingPosWithDebug(cid), 211)
  5917. doRemoveCreature(cid)
  5918. end
  5919. end
  5920.  
  5921. local function sendEff(cid, master, t)
  5922. if isCreature(cid) and isCreature(master) and t > 0 and #getCreatureSummons(master) >= 2 then
  5923. doSendMagicEffect(getThingPosWithDebug(cid), 86, master)
  5924. addEvent(sendEff, 1000, cid, master, t-1) --alterado v1.9
  5925. end
  5926. end
  5927.  
  5928. if getPlayerStorageValue(cid, 637500) >= 1 then
  5929. return true
  5930. end
  5931.  
  5932. local master = getCreatureMaster(cid)
  5933. local item = getPlayerSlotItem(master, 8)
  5934. local life, maxLife = getCreatureHealth(cid), getCreatureMaxHealth(cid)
  5935. local name = getItemAttribute(item.uid, "poke")
  5936. local pos = getThingPosWithDebug(cid)
  5937. local time = 5
  5938.  
  5939. doItemSetAttribute(item.uid, "hp", (life/maxLife))
  5940.  
  5941. local num = getSubName(cid, target) == "Misdreavus" and 3 or 2
  5942. local pk = {}
  5943.  
  5944. doTeleportThing(cid, {x=4, y=3, z=10}, true)
  5945.  
  5946. if team[name] then
  5947. pk[1] = cid
  5948. for b = 2, num do
  5949. pk[b] = doSummonCreature(team[name], pos)
  5950. doConvinceCreature(master, pk[b])
  5951. end
  5952.  
  5953. for a = 1, num do
  5954. addEvent(doTeleportThing, math.random(0, 5), pk[a], getClosestFreeTile(pk[a], pos), true)
  5955. addEvent(doAdjustWithDelay, 5, master, pk[a], true, true, true)
  5956. doSendMagicEffect(getThingPosWithDebug(pk[a]), 211)
  5957. end
  5958. sendEff(cid, master, time) --alterado v1.9
  5959. setPlayerStorageValue(master, 637501, 1)
  5960. addEvent(setPlayerStorageValue, time * 1000, master, 637501, -2)
  5961. -----
  5962. setPlayerStorageValue(pk[2], 637500, 1)
  5963. addEvent(RemoveTeam, time * 1000, pk[2])
  5964. -----
  5965. setPlayerStorageValue(pk[3], 637500, 1)
  5966. addEvent(RemoveTeam, time * 1000, pk[3])
  5967. ----
  5968. if getSubName(cid, target) == "Scizor" then
  5969. setPlayerStorageValue(pk[4], 637500, 1)
  5970. addEvent(RemoveTeam, time * 1000, pk[4])
  5971. end
  5972. end
  5973.  
  5974.  
  5975. elseif spell == "Demon Puncher" then
  5976.  
  5977. local name = getCreatureName(cid)
  5978. --alterado v1.7
  5979. if (not hitmonchans[name] and isCreature(target)) or (isCreature(target) and math.random(1, 100) <= passivesChances["Demon Puncher"][name]) then
  5980.  
  5981. if getDistanceBetween(getThingPosWithDebug(cid), getThingPosWithDebug(target)) > 1 then
  5982. return true
  5983. end
  5984.  
  5985. if not isSummon(cid) then --alterado v1.7
  5986. doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER)
  5987. end
  5988.  
  5989. if ehMonstro(cid) or not hitmonchans[name] then
  5990. hands = 0
  5991. else
  5992. hands = getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "hands")
  5993. end
  5994.  
  5995. if not hitmonchans[name] then
  5996. tabela = hitmonchans[getCreatureName(target)][hands]
  5997. else
  5998. tabela = hitmonchans[name][hands]
  5999. end
  6000.  
  6001. doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 39)
  6002. doTargetCombatHealth(cid, target, tabela.type, -min, -max, 255)
  6003.  
  6004. local alvo = getThingPosWithDebug(target)
  6005. alvo.x = alvo.x + 1 ---alterado v1.7
  6006.  
  6007. if hands == 4 then
  6008. doSendMagicEffect(alvo, tabela.eff)
  6009. else
  6010. doSendMagicEffect(getThingPosWithDebug(target), tabela.eff)
  6011. end
  6012.  
  6013. if hands == 3 then
  6014. local ret = {}
  6015. ret.id = target
  6016. ret.cd = 9 --alterado v1.6
  6017. ret.eff = 43
  6018. ret.check = getPlayerStorageValue(target, conds["Slow"])
  6019. ret.first = true
  6020. ret.cond = "Slow"
  6021.  
  6022. doMoveDano2(cid, target, FIGHTINGDAMAGE, 0, 0, ret, spell)
  6023. setPlayerStorageValue(cid, 98654, 1)
  6024. end
  6025. end
  6026.  
  6027. -- X elemental --
  6028. elseif spell == "Elemental" then
  6029. local types = {
  6030. ["dark"] = {efct = 87, dmg = DARKDAMAGE},
  6031. ["ghost"] = {efct = 138, dmg = GHOSTDAMAGE},
  6032. ["poison"] = {efct = 114, dmg = POISONDAMAGE},
  6033. ["grass"] = {efct = 45, dmg = GRASSDAMAGE},
  6034. ["bug"] = {efct = 105, dmg = BUGDAMAGE},
  6035. ["rock"] = {efct = 44, dmg = ROCKDAMAGE},
  6036. ["ground"] = {efct = 100, dmg = GROUNDDAMAGE},
  6037. ["steel"] = {efct = 77, dmg = STEELDAMAGE},
  6038. ["ice"] = {efct = 43, dmg = ICEDAMAGE},
  6039. ["water"] = {efct = 154, dmg = WATERDAMAGE},
  6040. ["electric"] = {efct = 48, dmg = ELECTRICDAMAGE},
  6041. ["fire"] = {efct = 35, dmg = FIREDAMAGE},
  6042. ["psychic"] = {efct = 133, dmg = PSYCHICDAMAGE},
  6043. ["flying"] = {efct = 41, dmg = FLYINGDAMAGE},
  6044. ["dragon"] = {efct = 143, dmg = DRAGONDAMAGE},
  6045. ["normal"] = {efct = 111, dmg = NORMALDAMAGE},
  6046. ["fighting"] = {efct = 112, dmg = FIGHTINGDAMAGE},
  6047. }
  6048. local ptype = pokes[getCreatureName(cid)].type
  6049. local ptype2 = pokes[getCreatureName(cid)].type2
  6050. local eff = {}
  6051. local damag = {}
  6052. if ptype2 ~= "no type" then
  6053. local math = math.random(1,100)
  6054. if math <= 50 then
  6055. eff = types[ptype].efct
  6056. damag = types[ptype].dmg
  6057. else
  6058. eff = types[ptype2].efct
  6059. damag = types[ptype2].dmg
  6060. end
  6061. else
  6062. eff = types[ptype].efct
  6063. damag = types[ptype].dmg
  6064. end
  6065. local function sendStickEff(cid, dir)
  6066. if not isCreature(cid) then return true end
  6067. doAreaCombatHealth(cid, damag, getPosByDir(getThingPosWithDebug(cid), dir), 0, -5000, -5000, eff)
  6068. end
  6069.  
  6070. local function doStick(cid)
  6071. if not isCreature(cid) then return true end
  6072. local t = {
  6073. [1] = SOUTHWEST,
  6074. [2] = SOUTH,
  6075. [3] = SOUTHEAST,
  6076. [4] = EAST,
  6077. [5] = NORTHEAST,
  6078. [6] = NORTH,
  6079. [7] = NORTHWEST,
  6080. [8] = WEST,
  6081. [9] = SOUTHWEST,
  6082. }
  6083. for a = 1, 9 do
  6084. addEvent(sendStickEff, a * 200, cid, t[a])
  6085. end
  6086. end
  6087.  
  6088. stopNow(cid, 1800)
  6089. doStick(cid, false, cid)
  6090. -- X elemental --
  6091.  
  6092.  
  6093. end
  6094. return true
  6095. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement