Ola galera do Xtibia,
Estou com uma duvida e espero que possam me ajudar,
Bem vamos la, eu uso o pokeserver pokemon Xd.
só que n sei como mecher no system de cath,
ja criei o poke nos items, ja colokei o portrait mais ñ vai,
quero que me expliquem passo a passo como por pokes no catch.
ta ae meu system de cath
local ballcatch = {
[2394] = {cr = 1, on = 24, off = 23, ball = 11826, send = 47},
[2391] = {cr = 3, on = 198, off = 197, ball = 11832, send = 48},
[2393] = {cr = 15, on = 204, off = 203, ball = 11835, send = 46},
[2392] = {cr = 10, on = 200, off = 199, ball = 11829, send = 49},
}
function onUse(cid, item, frompos, item3, topos)
local item2 = getTopCorpse(topos)
if item2 == null then
return true
end
if getItemAttribute(item2.uid, "catching") == 1 then
return true
end
local name = string.lower(getItemNameById(item2.itemid))
name = string.gsub(name, "fainted ", "")
name = string.gsub(name, "defeated ", "")
local x = pokecatches[doCorrectPokemonName(name)]
if not x then return true end
local owner = getItemAttribute(item2.uid, "corpseowner")
if owner and isCreature(owner) and isPlayer(owner) and cid ~= owner and isInArray({1,8}, getPlayerGroupId(cid)) then
doPlayerSendCancel(cid, "You are not allowed to catch this pokemon.")
return true
end
local catchinfo = {}
catchinfo.rate = ballcatch[item.itemid].cr
catchinfo.catch = ballcatch[item.itemid].on
catchinfo.fail = ballcatch[item.itemid].off
catchinfo.newid = ballcatch[item.itemid].ball
catchinfo.name = doCorrectPokemonName(name)
catchinfo.topos = topos
catchinfo.chance = x.chance
doSendDistanceShoot(getThingPos(cid), topos, ballcatch[item.itemid].send)
doRemoveItem(item.uid, 1)
local d = getDistanceBetween(getThingPos(cid), topos)
addEvent(doSendPokeBall, d * 70 + 100 - (d * 14) , cid, catchinfo, false, false)
addEvent(doSendMagicEffect, (d * 70 + 100 - (d * 14)) - 100, topos, 3)
return true
end