Amigo, poste aqui o seu catch.lua
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Sistema de Catch
[Encerrado] Sistema de Catch
Por jonatasjho, 11 de jul. de 2013 em Tópicos Sem Resposta
info
Grupo: Banidos
Registrado: 03/05/13
Posts: 271
Reputação: +23

info
Grupo: Campones
Registrado: 05/07/08
Posts: 8
Reputação: 0
Char no Tibia: Angrel Asteko

local ballcatch = {
[2394] = {cr = 5, on = 24, off = 23, ball = 11826, send = 47},
[2391] = {cr = 10, on = 198, off = 197, ball = 11832, send = 48},
[2393] = {cr = 15, on = 202, off = 201, ball = 11835, send = 46},
[2392] = {cr = 20, on = 200, off = 199, ball = 11829, send = 49},
[556] = {cr = 40, on = 187, off = 176, ball = 554, send = 45},
}
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,9}, 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
Segue ai Bhoris, desde ja Obrigado pela atenção!
info
Grupo: Banidos
Registrado: 03/05/13
Posts: 271
Reputação: +23

Amigo, tente esse:
info
Grupo: Campones
Registrado: 05/07/08
Posts: 8
Reputação: 0
Char no Tibia: Angrel Asteko

Amigo, tente esse:
local ballcatch = {[2394] = {cr = 5, on = 24, off = 23, ball = 11826, send = 47},[2391] = {cr = 10, on = 198, off = 197, ball = 11832, send = 48},[2393] = {cr = 15, on = 202, off = 201, ball = 11835, send = 46},[2392] = {cr = 20, on = 200, off = 199, ball = 11829, send = 49},[556] = {cr = 40, on = 187, off = 176, ball = 554, send = 45},}function onUse(cid, item, frompos, item3, topos)local item2 = getTopCorpse(topos)if item2 == null thenreturn trueendif getItemAttribute(item2.uid, "catching") == 1 thenreturn trueendif getItemAttribute(item2.uid, "golden") and getItemAttribute(item2.uid, "golden") == 1 thenreturn doPlayerSendCancel(cid, "You can't try to catch a pokemon in the Golden Arena!")endlocal lendarios = {"Kyogre"}if isInArray(lendarios, name) thenreturn trueendlocal name = string.lower(getItemNameById(item2.itemid))name = string.gsub(name, "fainted ", "")name = string.gsub(name, "defeated ", "")name = doCorrectPokemonName(name)local x = pokecatches[name]local storage = newpokedex[doCorrectPokemonName(name)].stoCatchif getPlayerStorageValue(cid, storage) == -1 or not string.find(getPlayerStorageValue(cid, storage), ";") thensetPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0;")endif not x then return true endlocal owner = getItemAttribute(item2.uid, "corpseowner")if owner and isCreature(owner) and isPlayer(owner) and cid ~= owner thendoPlayerSendCancel(cid, "You are not allowed to catch this pokemon.")return trueendlocal newidd = isShinyName(name) and ballcatch[item.itemid].ball[2] or ballcatch[item.itemid].ball[1]local typeee = ballcatch[item.itemid].typeeelocal catchinfo = {}catchinfo.rate = ballcatch[item.itemid].crcatchinfo.catch = ballcatch[item.itemid].oncatchinfo.fail = ballcatch[item.itemid].offcatchinfo.newid = newiddcatchinfo.name = doCorrectPokemonName(name)catchinfo.topos = toposcatchinfo.chance = x.chancedoSendDistanceShoot(getThingPos(cid), topos, ballcatch[item.itemid].send)doRemoveItem(item.uid, 1)local d = getDistanceBetween(getThingPos(cid), topos)if getPlayerStorageValue(cid, 98796) >= 1 and getPlayerItemCount(cid, 12617) <= 0 thensetPlayerStorageValue(cid, 98796, -1)setPlayerStorageValue(cid, 98797, -1)doTeleportThing(cid, SafariOut, false)doSendMagicEffect(getThingPos(cid), 21)doPlayerSendTextMessage(cid, 27, "You spend all your 'saffari balls', good luck in the next time...")endaddEvent(doSendPokeBall, d * 70 + 100 - (d * 14) , cid, catchinfo, false, false, typeee)addEvent(doSendMagicEffect, (d * 70 + 100 - (d * 14)) - 100, topos, 3)return trueend
Vixi Bhoris continua o erro, não da nem pra tacar a ball...
Negocinho complicado esse eim...
info
Grupo: Campones
Registrado: 07/06/11
Posts: 2
Reputação: 0
Char no Tibia: Knight Shirnarder

Eu também gostaria de saber como arrumar esse BUG, já tentei todos os scripts q passaram aí nas respostas mais nenhum deu certo ! ![]()
info
Grupo: Grão-Duque
Registrado: 28/07/11
Posts: 3.5k
Reputação: +570
Gênero: Masculino
Char no Tibia: Transloko

Tópico movido para a seção de dúvidas e pedidos resolvidos.
info
Grupo: Grão-Duque
Registrado: 28/07/11
Posts: 3.5k
Reputação: +570
Gênero: Masculino
Char no Tibia: Transloko

Tópico movido para a seção de dúvidas e pedidos resolvidos.
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.




info
Grupo: Campones
Registrado: 05/07/08
Posts: 8
Reputação: 0
Char no Tibia: Angrel Asteko
Bhoris tentei, mas agora nem aparece mais a ball quando coloco-a no corpo do pokemon, anteriormete a ball ia, mas não fazia nada, porem agora não da nem pra tacar a ball)...
Obs.: Os ID's das Balls estão todos batendo!
Caracas coisinha complicada eim kkk'