Postado Setembro 4, 2014 10 anos Este é um post popular. Bom, vi por aqui e não achei nenhum autoloot igual o da pxg ou sem bugs, então decidi vir aqui postar o que eu fiz. Vamos lá. 1º - Vá na pasta Lib, no arquivo some functions.lua e adicione isso depois do ultimo "end": function doPlayerAddItemStacking(cid, itemid, quant) local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid) local piles = 0 if #item > 0 then for i,x in pairs(item) do if getThing(x).type < 100 then local it = getThing(x) doTransformItem(it.uid, itemid, it.type+quant) if it.type+quant > 100 then doPlayerAddItem(cid, itemid, it.type+quant-100) end else piles = piles+1 end break end else return doPlayerAddItem(cid, itemid, quant) end if piles == #item then doPlayerAddItem(cid, itemid, quant) end end 2º - Vá em actions/script e crie um arquivo.lua com nome de Autoloot, dentro coloque: --local toloot = {11441, 11441, 11443, 11444, 11445, 11446, 11447, 11448, 11449,11450, 11451, 11452, 11453, 11454, 12618, 12232, 12244} -- PREFERENCIAL - SE QUISER APENAS COM ALGUNS ITENS function onUse(cid, item, frompos, item2, topos) if getItemAttribute(item.uid, "corpseowner") ~= cid then doPlayerSendCancel(cid, "You're not the owner.") return true end local items = {} for x=0, (getContainerSize(item.uid)) do local itens = getContainerItem(item.uid, x) --if isInArray(toloot, itens.itemid) then table.insert(items, {i=itens.itemid, q=itens.type}) doRemoveItem(itens.uid) --break --end end for y=1, #items do doPlayerAddItemStacking(cid, items[y].i, items[y].q) doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".") end if #items > 0 then return true else return false end end --[[ AUTO LOOT BY GABRIEL SALES SE QUISER ATIVAR O AUTOLOOT APENAS PARA ALGUNS ITENS, ADICIONE OS IDS NA TABELA toloot E TIRE OS COMENTÁRIOS(--). --]] Agora, no actions.xml adicione a tag: <action itemid="" event="script" value="Autoloot.lua"/> Dentro de itemid="", coloque o id dos corpses. Para conseguir o id dos corpses, podemos fazer um pequeno script, que pegará o corpse de cada pokemon capturável. 1º - Acesse o site: Compiler Online 2º - Vá em configuration.lua, localizado na pasta lib. Lá copie a tabela pokecatchs completa, ficando mais ou menos assim: pokecatchs = { // informações } 3º - Va no compiler online, e cole a tabela lá( ) - E depois, adicione isto em baixo: local corpses = {} for x,y in pairs(pokecatches) do table.insert(corpses, y.corpse) end print(table.concat(corpses, ";")) Clique em: Execute Script e terá todos os corpses de pokemons capturáveis. Créditos: Mkalo -- Auto Stacking Gabriel Sales(eu) -- Resto Editado Setembro 7, 2014 10 anos por Gabrielbsales (veja o histórico de edições)
Postado Setembro 4, 2014 10 anos Muito legal, acredito que da pra fazer com uma checagem se é corpse e evitar ter que colocar os IDS dos corpses um por um, mas tá legal o sistema, inves de ficar usando comentarios, você poderia ter feito uma variavel se utilizaria o sistema de itens especificos ou não e verificar a variavel com um IF, acredito que seja melhor para quem não tem conhecimento nenhum de scripts, eu modifiquei e ficou assim: local toloot = {11441, 11441, 11443, 11444, 11445, 11446, 11447, 11448, 11449,11450, 11451, 11452, 11453, 11454, 12618, 12232, 12244} -- PREFERENCIAL - SE QUISER APENAS COM ALGUNS ITENS local useSpecific = false --True para lotear somente os itens que estiverem na tabela toloot, false para todos os itens do corpse function onUse(cid, item, frompos, item2, topos) if getItemAttribute(item.uid, "corpseowner") ~= cid then doPlayerSendCancel(cid, "You're not the owner.") return true end local items = {} for x=0, (getContainerSize(item.uid)) do local itens = getContainerItem(item.uid, x) if useSpecific == true then if isInArray(toloot, itens.itemid) then table.insert(items, {i=itens.itemid, q=itens.type}) doRemoveItem(itens.uid) break end else table.insert(items, {i=itens.itemid, q=itens.type}) doRemoveItem(itens.uid) end end for y=1, #items do doPlayerAddItemStacking(cid, items[y].i, items[y].q) doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".") end if #items > 0 then return true else return false end end --[[ AUTO LOOT BY GABRIEL SALES SE QUISER ATIVAR O AUTOLOOT APENAS PARA ALGUNS ITENS, ADICIONE OS IDS NA TABELA toloot E TIRE OS COMENTÁRIOS(--). --]] Mais uma vez, excelente sistema, obrigado por disponibilizar. Grande abraço :3 Editado Setembro 4, 2014 10 anos por Mateuso (veja o histórico de edições)
Postado Setembro 4, 2014 10 anos Autor Eu nem ia deixar aquela tabela, só deixei porque poderia ser util. Quanto ao corpse, creio que não seja problema pegar todos eles por um pequeno script, é facil De qualquer maneira, de nada.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.