Advertisement
Guest User

ResetPoke.lua

a guest
Jul 26th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. function onUse(cid, item, topos, item2, frompos)
  2. local myball = getPlayerSlotItem(cid, 8)
  3. local Reset = getItemAttribute(myball.uid, "Reset") or 0
  4. local Resets = 0
  5. if Reset == 50 then
  6. return doPlayerSendCancel(cid, "Sorry, is not possible.")
  7. end
  8.  
  9. if #getCreatureSummons(cid) >= 1 then
  10. if getPlayerAccess(cid) == 6 then
  11. Resets = ( 10 )
  12. end
  13. Resets = Resets + 1
  14. local pokemon = getItemAttribute(myball.uid, "poke")
  15. local off = pokes[pokemon].offense * Reset_rate * Resets
  16. local def = pokes[pokemon].defense * Reset_rate * Resets
  17. local agi = pokes[pokemon].agility * Resets
  18. local spatk = pokes[pokemon].specialattack * Reset_rate * Resets
  19. local vit = pokes[pokemon].vitality * Reset_rate * Resets
  20. doSetItemAttribute(myball.uid, "Reset", Reset + Resets)
  21. doItemSetAttribute(myball.uid, "offense", getItemAttribute(myball.uid, "offense") + off)
  22. doItemSetAttribute(myball.uid, "defense", getItemAttribute(myball.uid, "defense") + def)
  23. doItemSetAttribute(myball.uid, "speed", getItemAttribute(myball.uid, "speed") + agi)
  24. doItemSetAttribute(myball.uid, "specialattack", getItemAttribute(myball.uid, "specialattack") + spatk)
  25. doItemSetAttribute(myball.uid, "vitality", getItemAttribute(myball.uid, "vitality") + vit)
  26. doRemoveItem(item.uid)
  27. doSendMagicEffect(getThingPos(item2.uid), 40)
  28. doPlayerSendTextMessage(cid, 27, "Congrulations, your "..pokemon..", as beem Reseted +1.")
  29. doPlayerSendTextMessage(cid, 27, "Now your "..pokemon.." have a Reset +"..Resets + Reset..".")
  30. doSendAnimatedText(getThingPos(item2.uid), "Reset!", 71)
  31. doPlayerSetVocation(cid,4)
  32. else
  33. return doPlayerSendCancel(cid, "Only use in yours pokemons.")
  34. end
  35. return true
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement