Guest User

Untitled

a guest
Nov 7th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. function onUse(cid, item, fromPosition, itemEx, toPosition)
  2.  
  3. local meuovo = {
  4. qnt = 1,
  5. maxi = 30,
  6. chance = 64,
  7. boost_fail = 6,
  8. falhar = 5,
  9. }
  10.  
  11. local minhabola = getPlayerSlotItem(cid, 8).uid
  12. local boost = getItemAttribute(minhabola, "boost") or 0
  13.  
  14. if minhabola <= 0 then
  15. return doPlayerSendCancel(cid, "Coloque um pokémon no Main Slot!")
  16. elseif boost >= meuovo.maxi then
  17. return doPlayerSendCancel(cid, "Seu pokémon já se encontra no nível máximo de boost!")
  18. end
  19.  
  20. if boost >= meuovo.boost_fail then
  21. if math.random(1, 100) <= meuovo.chance then
  22. doItemSetAttribute(minhabola, "boost", (boost + meuovo.qnt))
  23. doSendMagicEffect(fromPosition, 173)
  24. doRemoveItem(item.uid, 1)
  25. else
  26. doPlayerSendCancel(cid,"Falhou!")
  27. doItemSetAttribute(minhabola, "boost", (meuovo.falhar))
  28. doRemoveItem(item.uid, 1)
  29. end
  30. else
  31. doItemSetAttribute(minhabola, "boost", (boost + meuovo.qnt))
  32. doSendMagicEffect(fromPosition, 173)
  33. doRemoveItem(item.uid, 1)
  34. end
  35. return true
  36. end
Advertisement
Add Comment
Please, Sign In to add comment