Advertisement
Guest User

Functions Pokemon Moves

a guest
May 25th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. local function getSubName(cid, target)
  2. if not isCreature(cid) then return "" end
  3. if getCreatureName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
  4. return getPlayerStorageValue(cid, 1010)
  5. elseif pokeHaveReflect(cid) and isCreature(target) then
  6. return getCreatureName(target)
  7. else --alterado v1.6.1
  8. return getCreatureName(cid)
  9. end
  10. end
  11.  
  12. local function getThingName(cid)
  13. if not isCreature(cid) then return "" end --alterado v1.6
  14. return getCreatureName(cid)
  15. end
  16.  
  17. function getTableMove(cid, move) --alterado v1.6
  18. local backup = {f = 0, t = ""}
  19. if getThingName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
  20. name = getPlayerStorageValue(cid, 1010)
  21. else
  22. name = getThingName(cid)
  23. end
  24. if not isCreature(cid) or name == "" or not move then return backup end
  25. local x = movestable[name]
  26. if not x then return "" end
  27. 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}
  28. if getPlayerStorageValue(cid, 21103) ~= -1 then
  29. local sto = getPlayerStorageValue(cid, 21103)
  30. setPlayerStorageValue(cid, 21103, -1)
  31. return {f = sto, t = ""}
  32. end
  33. for j = 1, 15 do
  34. if z[j] and z[j].name == move then
  35. return z[j]
  36. end
  37. end
  38. return movesinfo[move]
  39. end
  40.  
  41. function getMasterTarget(cid)
  42. if isCreature(cid) and getPlayerStorageValue(cid, 21101) ~= -1 then
  43. return getPlayerStorageValue(cid, 21101) --alterado v1.6
  44. end
  45. if isSummon(cid) then
  46. return getCreatureTarget(getCreatureMaster(cid))
  47. else
  48. return getCreatureTarget(cid)
  49. end
  50. end
  51. --////////////////////////////////////////////////////////////////////////////////////////////////////////--
  52.  
  53. function docastspell(cid, spell, mina, maxa)
  54.  
  55. local target = 0
  56. local getDistDelay = 0
  57. if not isCreature(cid) or getCreatureHealth(cid) <= 0 then return false end --alterado v1.6
  58. if isSleeping(cid) and getPlayerStorageValue(cid, 21100) <= -1 then return true end --alterado v1.6
  59.  
  60. if isCreature(getMasterTarget(cid)) then
  61. target = getMasterTarget(cid)
  62. getDistDelay = getDistanceBetween(getThingPosWithDebug(cid), getThingPosWithDebug(target)) * const_distance_delay
  63. end
  64.  
  65. if isMonster(cid) and not isSummon(cid) then
  66. if getCreatureCondition(cid, CONDITION_EXHAUST) then
  67. return true
  68. end
  69. doCreatureAddCondition(cid, wildexhaust)
  70. end
  71.  
  72. local mydir = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid)
  73. local table = getTableMove(cid, spell) --alterado v1.6
  74.  
  75.  
  76. local min = 0
  77. local max = 0
  78.  
  79. --alterado v1.7 \/\/
  80. if ehMonstro(cid) and isCreature(getMasterTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getMasterTarget(cid))) then
  81. local target = getMasterTarget(cid)
  82. if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then
  83. if isCreature(getMasterTarget(target)) then --alterado v1.6
  84. doSendMagicEffect(getThingPosWithDebug(target), 211)
  85. doSendAnimatedText(getThingPosWithDebug(target), "TOO BAD", 215)
  86. doTeleportThing(target, getClosestFreeTile(target, getThingPosWithDebug(cid)), false)
  87. doSendMagicEffect(getThingPosWithDebug(target), 211)
  88. doFaceCreature(target, getThingPosWithDebug(cid))
  89. return false --alterado v1.8
  90. end
  91. end
  92. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement