Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, topos, item2, frompos)
- local myball = getPlayerSlotItem(cid, 8)
- local Reset = getItemAttribute(myball.uid, "Reset") or 0
- local Resets = 0
- if Reset == 50 then
- return doPlayerSendCancel(cid, "Sorry, is not possible.")
- end
- if #getCreatureSummons(cid) >= 1 then
- if getPlayerAccess(cid) == 6 then
- Resets = ( 10 )
- end
- Resets = Resets + 1
- local pokemon = getItemAttribute(myball.uid, "poke")
- local off = pokes[pokemon].offense * Reset_rate * Resets
- local def = pokes[pokemon].defense * Reset_rate * Resets
- local agi = pokes[pokemon].agility * Resets
- local spatk = pokes[pokemon].specialattack * Reset_rate * Resets
- local vit = pokes[pokemon].vitality * Reset_rate * Resets
- doSetItemAttribute(myball.uid, "Reset", Reset + Resets)
- doItemSetAttribute(myball.uid, "offense", getItemAttribute(myball.uid, "offense") + off)
- doItemSetAttribute(myball.uid, "defense", getItemAttribute(myball.uid, "defense") + def)
- doItemSetAttribute(myball.uid, "speed", getItemAttribute(myball.uid, "speed") + agi)
- doItemSetAttribute(myball.uid, "specialattack", getItemAttribute(myball.uid, "specialattack") + spatk)
- doItemSetAttribute(myball.uid, "vitality", getItemAttribute(myball.uid, "vitality") + vit)
- doRemoveItem(item.uid)
- doSendMagicEffect(getThingPos(item2.uid), 40)
- doPlayerSendTextMessage(cid, 27, "Congrulations, your "..pokemon..", as beem Reseted +1.")
- doPlayerSendTextMessage(cid, 27, "Now your "..pokemon.." have a Reset +"..Resets + Reset..".")
- doSendAnimatedText(getThingPos(item2.uid), "Reset!", 71)
- doPlayerSetVocation(cid,4)
- else
- return doPlayerSendCancel(cid, "Only use in yours pokemons.")
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement