DE
dúvida

Auto Loot System.

Por DenerAlc98, 07 de mai. de 2012 em Scripts

script
6
2k
DenerAlc98D
07 de maio de 2012 às 15:31

Bom,peguei um script aqui no fórum mais preciso da ajuda de vocês para me ajudar.

Esse auto loot é muito bom e tals mais ele não tá juntando os gold's , eu jogo um ot que junta os gold's tudo certinho e tals , olha a imagem .

 

post-346652-0-19888700-1336415432.jpg

 

Bom,queria que ele juntasse o gold e virasse platinum direto e 100 platinum virasse o Crystal.

POR FAVOR ME AJUDEM !

Obrigado Desde já! =]

Editado Junho 13 por Vilden

jhon992J
07 de maio de 2012 às 16:52

Se tu passar o script de auto loot que esta usando, tem maior chance de ser ajudado. happy.png

1 mês depois...
deeners2D
12 de junho de 2012 às 17:01

Bom cara , eu perdi meu cadastro a cima , mais sou o mesmo então vou te paasar meu script por favor me ajude .

 

local configs = {

ids = {2148, 2152, 2160}, -- adicionado somente os dos dinheiros, mais pode adicionar qual id quiser.

premium = true -- só premium usar o auto loot ? [true ou false]

}

 

function getItemsInContainerById(container, itemid)

local items = {}

if getContainerSize(container) > 0 then

for slot=0, (getContainerSize(container)-1) do

local item = getContainerItem(container, slot)

if isContainer(item.uid) then

local itemsbag = getItemsInContainerById(item.uid, itemid)

for i=0, #itemsbag do

table.insert(items, itemsbag)

end

else

if itemid == item.itemid then

table.insert(items, item.uid)

end

end

end

end

return items

end

 

function autoGold(cid, pos, stack)

if stack > 255 then return true end

local position = {x = pos.x, y = pos.y, z = pos.z, stackpos = stack}

local tile = getThingFromPos(position)

if isCorpse(tile.uid) then

corpse = tile

else

autoGold(cid, pos, stack + 1)

end

if corpse ~= nil then

for _, idmoney in pairs(configs.ids) do

tab = getItemsInContainerById(corpse.uid, idmoney)

if #tab ~= 0 then

for _, uid in pairs(tab) do

item = getThing(uid)

doPlayerAddItem(cid, idmoney, item.type)

doRemoveItem(item.uid, item.type)

end

end

end

end

end

 

function onKill(cid, target)

if not isPremium(cid) and configs.premium then return true end

return addEvent(autoGold, 10, cid, getCreaturePosition(target), 0)

end

jhon992J
12 de junho de 2012 às 17:34
local configs = {
   ids = {2148, 2152, 2160}, -- adicionado somente os dos dinheiros, mais pode adicionar qual id quiser.
   premium = true -- só premium usar o auto loot ? [true ou false]
}

function getItemsInContainerById(container, itemid)
local items = {}
   if getContainerSize(container) > 0 then
       for slot=0, (getContainerSize(container)-1) do
           local item = getContainerItem(container, slot)
           if isContainer(item.uid) then
               local itemsbag = getItemsInContainerById(item.uid, itemid)
               for i=0, #itemsbag do
                   table.insert(items, itemsbag[i])
               end
           else
               if itemid == item.itemid then
                   table.insert(items, item.uid)
               end
           end
       end
   end
return items
end

function autoGold(cid, pos, stack)
if stack > 255 then
   return true
end

local position = {x = pos.x, y = pos.y, z = pos.z, stackpos = stack}
local tile = getThingFromPos(position)
if isCorpse(tile.uid) then
   corpse = tile
else
   autoGold(cid, pos, stack + 1)
end

if corpse ~= nil then
   for _, idmoney in pairs(configs.ids) do
       tab = getItemsInContainerById(corpse.uid, idmoney)
       if #tab ~= 0 then
           for _, uid in pairs(tab) do
               money = getPlayerMoney(cid)
               item = getThing(uid)
               doPlayerRemoveMoney(cid, money)
               doPlayerAddMoney(cid, money+item.type)
               doRemoveItem(item.uid, item.type)
           end
       end
   end
end
end

function onKill(cid, target)
if not isPremium(cid) and configs.premium then
   return true
end
return addEvent(autoGold, 10, cid, getCreaturePosition(target), 0)
end

deeners2D
13 de junho de 2012 às 13:13

O Valeu ai mano , deu certinho! =]

VildenV
13 de junho de 2012 às 13:15

Quando sua dúvida for sanada, use o botão denunciar para que um moderador venha mover o tópico.

Movido.