LU
tfs 0.3

[Encerrado] [Duel PDA] Pokemons na bag

Por lucasmourahere, 14 de ago. de 2016 em Tópicos Sem Resposta

pokebag
duelsys
pda
7
897
14 de agosto de 2016 às 19:33

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 por lucasmourahere

15 de agosto de 2016 às 15:02

up

16 de agosto de 2016 às 15:55

up

17 de agosto de 2016 às 16:10

up

18 de agosto de 2016 às 00:08

up

2 semanas depois...
25 de agosto de 2016 às 00:29

up

1 ano depois...
StigalS
21 de abril de 2018 às 03:44
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.