Advertisement
Kevick

MEGA STONE

May 22nd, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1.  
  2.  
  3.  
  4. Segue:
  5. action itemid="IDDASTONE" event="script" value="mega stone.lua" allowfaruse="1"/>
  6.  
  7.  
  8. e o script:
  9.  
  10. local evo = {["Charizard"] = {"Mega Charizard", QUANTIANECESSARIADESTONES},
  11. }
  12. local balls = {
  13. [IDDAPOKEBALL] = {newBall = IDDAPOKEBALL},
  14. }
  15.  
  16.  
  17. function onUse(cid, item, fromPosition, itemEx, toPosition)
  18. if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
  19. local monster = getCreatureName(itemEx.uid)
  20. if evo[monster] then
  21. if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
  22. doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
  23. local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
  24. doSendMagicEffect(getThingPos(itemEx.uid), 18)
  25. doRemoveCreature(itemEx.uid)
  26. doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
  27. doRemoveItem(item.uid, 1)
  28. doSummonMonster(cid,evo[monster][1])
  29. local pokeball = getPlayerSlotItem(cid, 8)
  30. doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
  31. doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
  32. doItemSetAttribute(ball, "hp", 1)
  33. doItemSetAttribute(ball, "happy", 110)
  34. local pk = getCreatureSummons(cid)[1]
  35. local getMegaPokeballs = balls[getPlayerSlotItem(cid, 8).itemid]
  36. doTransformItem(getPlayerSlotItem(cid, 8).uid, getMegaPokeballs.newBall)
  37. adjustStatus(pk, pokeball.uid, true, false, true)
  38. return TRUE
  39. else
  40. return doPlayerSendTextMessage(cid, 27, "Voce precisa de ".. evo[monster][2] .." stones para isso!")
  41. end
  42. end
  43. end
  44. return FALSE
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement