lucasmourahere 4 Postado Agosto 14, 2016 Share Postado Agosto 14, 2016 (editado) Olá XTibia, estou com um grande problema ao chamar Duel no meu servidor. Quando chamo Duelo tendo 2 pokemons na bag, da pra chamar Duel para 4 pokemons.. ou seja, está contando 2 pokemons a mais na bag na hora de chamar o Duel. alguem poderia me ajudar? segue a função que está sendo usada para checar os pokemons na bag: creaturescripts/scripts/tvsys.lua ---------------- Proteçao para os 2 players terem a qntdade de pokes pro duel local pokes1 = getLivePokeballs(cid, getPlayerSlotItem(cid, 3).uid, true) local pokes2 = getLivePokeballs(sid, getPlayerSlotItem(sid, 3).uid, true) if #pokes1 < (channelId-12) or #pokes2 < (channelId-12) then local tpw = getPlayerStorageValue(cid, 52480) > 1 and "ally" or "opponent" doPlayerSendTextMessage(cid, 20, "You or your "..tpw.." doesn't have that amount of pokemons in their bags! Duel are canceled!") doPlayerSetVocation(cid, 1) for i = 1, #storagesDuel do setPlayerStorageValue(cid, storagesDuel[i], -1) end doCreatureSetSkullType(cid, 0) return false end ---------------- e sobre esta função "getLivePokeballs" está armazenada em some functions.lua em /lib. Segue a função "getLivePokeballs". function getLivePokeballs(cid, container, duel) --alterado v2.8 if not isCreature(cid) then return {} end if not isContainer(container) then return {} end local items = {} --- local ballSlot = getPlayerSlotItem(cid, 8) if ballSlot.uid ~= 0 then for a, b in pairs (pokeballs) do if ballSlot.itemid == b.on or ballSlot.itemid == b.use then if duel and getPlayerLevel(cid) >= (pokes[getItemAttribute(ballSlot.uid, "poke")].level + getPokeballBoost(ballSlot)) then table.insert(items, ballSlot.uid) --alterado v2.8 elseif not duel then table.insert(items, ballSlot.uid) end end end end --- if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getPokeballsInContainer(item.uid) for i=0, #itemsbag do if not isInArray(items, itemsbag[i]) then table.insert(items, itemsbag[i]) end end elseif isPokeball(item.itemid) then for a, b in pairs (pokeballs) do if item.itemid == b.on then if duel and getPlayerLevel(cid) >= (pokes[getItemAttribute(item.uid, "poke")].level + getPokeballBoost(item)) then table.insert(items, item.uid) --alterado v2.8 elseif not duel then table.insert(items, item.uid) end end end end end endreturn itemsend Grato desde já para quem me ajudar! Atenciosamente, Lucas. Editado Agosto 14, 2016 por lucasmourahere Link para o comentário https://xtibia.com/forum/topic/241754-encerrado-duel-pda-pokemons-na-bag/ Compartilhar em outros sites More sharing options...
lucasmourahere 4 Postado Agosto 15, 2016 Autor Share Postado Agosto 15, 2016 up Link para o comentário https://xtibia.com/forum/topic/241754-encerrado-duel-pda-pokemons-na-bag/#findComment-1701760 Compartilhar em outros sites More sharing options...
lucasmourahere 4 Postado Agosto 16, 2016 Autor Share Postado Agosto 16, 2016 up Link para o comentário https://xtibia.com/forum/topic/241754-encerrado-duel-pda-pokemons-na-bag/#findComment-1701829 Compartilhar em outros sites More sharing options...
lucasmourahere 4 Postado Agosto 17, 2016 Autor Share Postado Agosto 17, 2016 up Link para o comentário https://xtibia.com/forum/topic/241754-encerrado-duel-pda-pokemons-na-bag/#findComment-1701880 Compartilhar em outros sites More sharing options...
lucasmourahere 4 Postado Agosto 18, 2016 Autor Share Postado Agosto 18, 2016 up Link para o comentário https://xtibia.com/forum/topic/241754-encerrado-duel-pda-pokemons-na-bag/#findComment-1701933 Compartilhar em outros sites More sharing options...
lucasmourahere 4 Postado Agosto 25, 2016 Autor Share Postado Agosto 25, 2016 up Link para o comentário https://xtibia.com/forum/topic/241754-encerrado-duel-pda-pokemons-na-bag/#findComment-1702526 Compartilhar em outros sites More sharing options...
Stigal 584 Postado Abril 21, 2018 Share Postado Abril 21, 2018 A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. + 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. Link para o comentário https://xtibia.com/forum/topic/241754-encerrado-duel-pda-pokemons-na-bag/#findComment-1737294 Compartilhar em outros sites More sharing options...
Posts Recomendados