Ta ae :
local pokeballs = {'2222', '2224'}
local ultraballs = {'2220', '2227'}
local POKEBALL = {
-- Pokeball
[2222] = {0},
[2224] = {0},
-- Ultraball
[2227] = {0},
[2220] = {0}
}
function onUse(cid, item, frompos, item2, topos)
if isCreature(item2.uid) then
return doPlayerSendCancel(cid, "You can only use revive in pokeballs!")
end
if isPlayer(item2.uid) then
return doPlayerSendCancel(cid, "You can only use revive in pokeballs!")
end
if item2.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
return doPlayerSendCancel(cid, "You can only use revive in pokeballs in pokemon slot!")
end
local dust = POKEBALL[item2.itemid]
if(not dust) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
doSendMagicEffect(getThingPos(cid), 12)
doRemoveItem(item.uid, 1)
if isInArray(pokeballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2222)
end
if isInArray(ultraballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2220)
end
end
Ele ta igual ao do global, ou seja da pra usar em na Pokeball mesmo se o Pokemon estiver vivo ( O Pokemon n pode estar pra fora da ball )





info
Grupo: Campones
Registrado: 22/11/10
Posts: 14
Reputação: +4
Char no Tibia: xxxxxxx
Eae, galera.
Intão eu tenho 1 servidor com base no pokemon dash Arrumado +75% e Queria que alguem me passa-se o script do revive
acho que todos ja conheçem, seu pokemon morre, vc usa o item 2269 e Clika na pokebola e Kabum *-* o pokemon volta denovo \o Vllw galera
Moderação Pode Fecha o Tópico. Ja Achei o Que eu Procurava.