Advertisement
Kevick

Ditto Memory

May 22nd, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.53 KB | None | 0 0
  1. Primeiramente vá em Data/actions/scripts/order.lua e Procure por:
  2.  
  3. -------- TRANSFORM ----------
  4. Apague tudo aqui dentro, até o:
  5.  
  6. -------- LIGHT ------------
  7. Ai dentro ditto coloque isto:
  8.  
  9. [spoiler]
  10. if (getCreatureName(mysum) == "Ditto") and getItemAttribute(thisball.uid, "ehditto") ~= -1 and isMonster(item2.uid) and pokes[getCreatureName(item2.uid)] then
  11. local m = getCreatureMaster(cid)
  12. local p = getPlayerSlotItem(m, 8)
  13. local proibidossempre = {"Celebi", "Moltres", "Zapdos", "Suicune", "Entei", "Raikou", "Suicune", "Lugia", "Mewtwo", "Mew", "Shiny Rhydon", "Shiny Ariados", "Shiny Magneton", "Shiny Ninetales", "Shiny Politoed", "Shiny Stantler", "Shiny Dodrio", "Shiny Espeon", "Shiny Umbreon"} -- Nunca permitir
  14. local proibidosboost = {"Shiny Dragonite", "Shiny Snorlax", "Shiny Gyarados", "Shiny Scyther"} -- Permitir se ditto for +50
  15. local boost = getItemAttribute(thisball.uid, "boost") or 0
  16. if getCreatureName(item2.uid) == "Ditto" or getCreatureName(item2.uid) == "Shiny Ditto" then
  17. doPlayerSendCancel(cid, "Your ditto can't transform into another ditto.")
  18. markPos(mysum, unfix)
  19. return true
  20. end
  21. if isInArray(proibidossempre, getCreatureName(item2.uid)) then --Checa a lista
  22. doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.")
  23. markPos(mysum, unfix)
  24. return true
  25. end
  26. if isInArray(proibidosboost, getCreatureName(item2.uid)) and boost < 50 then --Checa a lista
  27. doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.")
  28. markPos(mysum, unfix)
  29. return true
  30. end
  31.  
  32. if getCreatureName(item2.uid) == getPlayerStorageValue(mysum, 1010) then
  33. doPlayerSendCancel(cid, "Your ditto is already transformed into that pokemon.")
  34. markPos(mysum, unfix)
  35. return true
  36. end
  37. markPos(mysum, unfix)
  38. local name = getCreatureName(item2.uid)
  39. setPlayerStorageValue(mysum, 1010, getCreatureName(item2.uid))
  40. doItemSetAttribute(thisball.uid, "ehditto", 1)
  41. doItemSetAttribute(thisball.uid, "poke", getCreatureName(item2.uid))
  42. doUpdateMoves(cid)
  43. doSetCreatureOutfit(mysum, getCreatureOutfit(item2.uid), -1)
  44. doCreatureSay(mysum, "TRANSFORM!", TALKTYPE_MONSTER)
  45. doFaceCreature(mysum, getThingPos(item2.uid))
  46. doSendMagicEffect(getThingPos(mysum), 184)
  47. doPlayerSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", 1)
  48. return true
  49. end
  50. -----------------------------
  51.  
  52. -------- TRANSFORM Shiny Ditto ---------- --alterado v1.7
  53. if (getCreatureName(mysum) == "Shiny Ditto") and getItemAttribute(thisball.uid, "ehshinyditto") ~= -1 and isMonster(item2.uid) and pokes[getCreatureName(item2.uid)] then
  54. local m = getCreatureMaster(cid)
  55. local p = getPlayerSlotItem(m, 8)
  56. local proibidossempre = {"Celebi", "Moltres", "Zapdos", "Suicune", "Entei", "Raikou", "Suicune", "Lugia", "Mewtwo", "Mew", "Shiny Rhydon", "Shiny Ariados", "Shiny Magneton", "Shiny Ninetales", "Shiny Politoed", "Shiny Stantler", "Shiny Dodrio", "Shiny Espeon", "Shiny Umbreon"} -- Nunca permitir
  57. local proibidosboost = {"Shiny Dragonite", "Shiny Snorlax", "Shiny Gyarados", "Shiny Scyther"} -- Permitir se ditto for +50
  58. local boost = getItemAttribute(thisball.uid, "boost") or 0
  59. if getCreatureName(item2.uid) == "Ditto" or getCreatureName(item2.uid) == "Shiny Ditto" then
  60. doPlayerSendCancel(cid, "Your ditto can't transform into another ditto.")
  61. markPos(mysum, unfix)
  62. return true
  63. end
  64. if isInArray(proibidossempre, getCreatureName(item2.uid)) then --Checa a lista
  65. doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.")
  66. markPos(mysum, unfix)
  67. return true
  68. end
  69. if isInArray(proibidosboost, getCreatureName(item2.uid)) and boost < 50 then --Checa a lista
  70. doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.")
  71. markPos(mysum, unfix)
  72. return true
  73. end
  74.  
  75. if getCreatureName(item2.uid) == getPlayerStorageValue(mysum, 1010) then
  76. doPlayerSendCancel(cid, "Your ditto is already transformed into that pokemon.")
  77. markPos(mysum, unfix)
  78. return true
  79. end
  80. markPos(mysum, unfix)
  81. local name = getCreatureName(item2.uid)
  82. setPlayerStorageValue(mysum, 1010, getCreatureName(item2.uid))
  83. doItemSetAttribute(thisball.uid, "ehshinyditto", 1)
  84. doItemSetAttribute(thisball.uid, "poke", getCreatureName(item2.uid))
  85. doUpdateMoves(cid)
  86. doSetCreatureOutfit(mysum, getCreatureOutfit(item2.uid), -1)
  87. doCreatureSay(mysum, "TRANSFORM!", TALKTYPE_MONSTER)
  88. doFaceCreature(mysum, getThingPos(item2.uid))
  89. doSendMagicEffect(getThingPos(mysum), 184)
  90. --doPlayerSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", 1)
  91. doCreatureSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", TALKTYPE_ORANGE_1)
  92. return true
  93. end
  94. [/spoiler]
  95.  
  96. Pronto Agora esta transformando e copiando as habilidades e tudo! Agora Para o ditto e shiny ditto reverter a transformação .
  97.  
  98. Crie um arquivo chamado dittorevert.lua em data/talkactions e coloque isto dentro:
  99. [spoiler]
  100. function onSay(cid, words, param, channel)
  101. local thisball = getPlayerSlotItem(cid, 8)
  102. if getItemAttribute(thisball.uid, "ehditto") then
  103. doItemSetAttribute(thisball.uid, "poke", "Ditto")
  104. doItemSetAttribute(thisball.uid, "ehditto", 1)
  105. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Puxe o ditto para terminar a reversão do ditto.')
  106. elseif getItemAttribute(thisball.uid, "ehshinyditto") then
  107. doItemSetAttribute(thisball.uid, "poke", "Shiny Ditto")
  108. doItemSetAttribute(thisball.uid, "ehshinyditto", 1)
  109. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Puxe o Shiny Ditto para terminar a reversão do Shiny Ditto.')
  110. else
  111. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você Não Está Usando Um Ditto ou Shiny Ditto.')
  112. end
  113. end
  114. [/spoiler]
  115. e em talkactions.xml coloque isto:
  116. <talkaction words="!revert" event="script" value="dittorevert.lua"/>
  117. Pronto sistema 100% só que ele está com nome, poder, força tudo igual! para resolver isto vamos em lib/level system.lua
  118.  
  119. abra e procure por isto:
  120. [spoiler]
  121. setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level"))
  122. setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense)
  123. setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense)
  124. setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility)
  125. setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack)
  126. [/spoiler]
  127. e substitua por isto:
  128. [spoiler]
  129. if (getItemAttribute(item, "ehditto") == 1) then
  130. setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level"))
  131. setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense * 0.75)
  132. setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense * 0.75)
  133. setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility * 0.75)
  134. setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack * 0.75)
  135. elseif (getItemAttribute(item, "ehshinyditto") == 1) then
  136. setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level"))
  137. setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense * 0.50)
  138. setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense * 0.50)
  139. setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility * 0.50)
  140. setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack * 0.50)
  141. else
  142. setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level"))
  143. setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense)
  144. setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense)
  145. setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility)
  146. setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack)
  147. end
  148. [/spoiler]
  149. Pronto Agora o Shiny ditto ta com 75% de força do poke transformado e o ditto com 50% de força do pokemon transformado
  150.  
  151. Agora para identificar que é um ditto/shiny ditto vamos em creaturescript/scripts/look.lua, abra e procure por:
  152. table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n")
  153. substitua por:
  154. if getItemAttribute(thing.uid, "ehditto") == 1 then
  155. table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Ditto).\n")
  156. elseif getItemAttribute(thing.uid, "ehshinyditto") == 1 then
  157. table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Shiny Ditto).\n")
  158. else
  159. table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n")
  160. end
  161. Em actions/scripts/goback.lua procure por:
  162. [spoiler]
  163. if getCreatureName(pk) == "Ditto" or getCreatureName(pk) == "Shiny Ditto" then --edited
  164.  
  165. local left = getItemAttribute(item.uid, "transLeft")
  166. local name = getItemAttribute(item.uid, "transName")
  167.  
  168. if left and left > 0 then
  169. setPlayerStorageValue(pk, 1010, name)
  170. doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)
  171. addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))
  172. doItemSetAttribute(item.uid, "transBegin", os.clock())
  173. else
  174. setPlayerStorageValue(pk, 1010, getCreatureName(pk) == "Ditto" and "Ditto" or "Shiny Ditto") --edited
  175. end
  176. end
  177. [/spoiler]
  178. e apague!
  179.  
  180. em lib/Some Functions.lua procure por:
  181. [spoiler]
  182. function doAppear(cid) --Faz um poke q tava invisivel voltar a ser visivel...
  183. if not isCreature(cid) then return true end
  184. doRemoveCondition(cid, CONDITION_INVISIBLE)
  185. doRemoveCondition(cid, CONDITION_OUTFIT)
  186. doCreatureSetHideHealth(cid, false)
  187. if getCreatureName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then
  188. if isSummon(cid) then
  189. local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
  190. doSetCreatureOutfit(cid, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1) --alterado v1.6.1
  191. end
  192. end
  193. end
  194. [/spoiler]
  195. e substitua por:
  196. function doAppear(cid) --Faz um poke q tava invisivel voltar a ser visivel...
  197. if not isCreature(cid) then return true end
  198. doRemoveCondition(cid, CONDITION_INVISIBLE)
  199. doRemoveCondition(cid, CONDITION_OUTFIT)
  200. doCreatureSetHideHealth(cid, false)
  201. end
  202.  
  203. Ainda em Some functions procure por:
  204. if getCreatureName(pokemon) == "Ditto" then
  205. if isTransformed(pokemon) then
  206. local left = getItemAttribute(pokeball.uid, "transLeft") - (os.clock() - getItemAttribute(pokeball.uid, "transBegin"))
  207. doItemSetAttribute(pokeball.uid, "transLeft", left)
  208. end
  209. end
  210.  
  211. e apague
  212.  
  213. e para finalizar procure por:
  214. if getCreatureName(pokemon) == "Shiny Ditto" then
  215. if isTransformed(pokemon) then
  216. local left = getItemAttribute(pokeball.uid, "transLeft") - (os.clock() - getItemAttribute(pokeball.uid, "transBegin"))
  217. doItemSetAttribute(pokeball.uid, "transLeft", left)
  218. end
  219. end
  220. e Apague!!!!!!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement