Djonga 11 Postado Março 8, 2014 Share Postado Março 8, 2014 Estou com alguns bugs no actions, principalmente na catch: catch erro: [08/03/2014 15:19:01] [Error - Action Interface][08/03/2014 15:19:01] In a timer event called from:[08/03/2014 15:19:01] data/actions/scripts/catch.lua:onUse[08/03/2014 15:19:01] Description:[08/03/2014 15:19:01] (luaDoItemSetAttribute) Invalid data type catch script: local ballcatch = { --id normal, id da ball shiy[2394] = {cr = 10, on = 193, off = 192, ball = {11826, 11737}, send = 47, typeee = "normal", boost = "0"}, --alterado v1.9 \/[2391] = {cr = 20, on = 198, off = 197, ball = {11832, 11740}, send = 48, typeee = "great", boost = "0"},[2393] = {cr = 30, on = 202, off = 201, ball = {11835, 11743}, send = 46, typeee = "super", boost = "0"},[2392] = {cr = 55, on = 200, off = 199, ball = {11829, 11746}, send = 49, typeee = "ultra", boost = "0"},[12617] = {cr = 20, on = 204, off = 203, ball = {10975, 12621}, send = 35, typeee = "saffari", boost = "0"},[12832] = {cr = 100000000000000000000000000, on = 23, off = 24, ball = {12826, 12829}, send = 181, typeee = "dark", boost = "50"},}function onUse(cid, item, frompos, item3, topos)local item2 = getTopCorpse(topos)if item2 == null then return trueendif getItemAttribute(item2.uid, "catching") == 1 then return trueend if getItemAttribute(item2.uid, "golden") and getItemAttribute(item2.uid, "golden") == 1 then return doPlayerSendCancel(cid, "You can't try to catch a pokemon in the Golden Arena!") endlocal name = string.lower(getItemNameById(item2.itemid)) name = string.gsub(name, "fainted ", "") name = string.gsub(name, "defeated ", "") name = doCorrectPokemonName(name)local x = pokecatches[name]if not x then return true endlocal shinys = {"Shiny Alakazam", "Shiny Scyther", "Shiny Magmar", "Shiny Gyarados", "Shiny Snorlax", "Shiny Onix", "Shiny Electabuzz", "Shiny Pidgeot", "Aerodactyl", "Ditto", "Shiny Gengar"}if item.itemid == 12832 and isInArray(shinys, name) then doPlayerSendCancel(cid, "Você não pode catar esse pokemon com a master ball!")return trueendlocal storage = newpokedex[name].stoCatchif getPlayerStorageValue(cid, storage) == -1 or not string.find(getPlayerStorageValue(cid, storage), ";") then --alterado v1.9 setPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0, dark = 0;") --alterado v1.9end local owner = getItemAttribute(item2.uid, "corpseowner")if owner and isCreature(owner) and isPlayer(owner) and cid ~= owner then doPlayerSendCancel(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] --alterado v1.9 local typeee = ballcatch[item.itemid].typeeelocal boost = ballcatch[item.itemid].boostlocal catchinfo = {} catchinfo.rate = ballcatch[item.itemid].cr catchinfo.catch = ballcatch[item.itemid].on catchinfo.fail = ballcatch[item.itemid].off catchinfo.newid = newidd catchinfo.name = doCorrectPokemonName(name) catchinfo.topos = topos catchinfo.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 then --alterado v1.9 setPlayerStorageValue(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 Link para o comentário https://xtibia.com/forum/topic/229740-catch/ Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Março 8, 2014 Share Postado Março 8, 2014 Área incorreta, tópico movido. Mais cuidado da próxima vez. Sobre seu erro, acho que a causa é este valor, tipo, absurdamente alto (colocado como catch rate da última pokeball adicionada na tabela): 100000000000000000000000000 Link para o comentário https://xtibia.com/forum/topic/229740-catch/#findComment-1620603 Compartilhar em outros sites More sharing options...
Djonga 11 Postado Março 8, 2014 Autor Share Postado Março 8, 2014 eu diminui pra 100 e o erro continua e_e só que menos constantemente xD Link para o comentário https://xtibia.com/forum/topic/229740-catch/#findComment-1620619 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Março 8, 2014 Share Postado Março 8, 2014 Tenta diminuir para um valor menor ainda, semelhante à rate das outras pokeballs (20, por exemplo). Link para o comentário https://xtibia.com/forum/topic/229740-catch/#findComment-1620640 Compartilhar em outros sites More sharing options...
Djonga 11 Postado Março 8, 2014 Autor Share Postado Março 8, 2014 eu coloquei 100 '-' 99 então? Link para o comentário https://xtibia.com/forum/topic/229740-catch/#findComment-1620649 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Março 8, 2014 Share Postado Março 8, 2014 Tenta 20, para confirmarmos se é esta a causa do erro. Link para o comentário https://xtibia.com/forum/topic/229740-catch/#findComment-1620700 Compartilhar em outros sites More sharing options...
Djonga 11 Postado Março 8, 2014 Autor Share Postado Março 8, 2014 tentei e não é Link para o comentário https://xtibia.com/forum/topic/229740-catch/#findComment-1620721 Compartilhar em outros sites More sharing options...
Posts Recomendados