Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Show, explicativo! irei testar!

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Link para o post
Compartilhar em outros sites

Estava querendo esse Sistema *--* 

Mais tem Caras que Diz que da Lag no servidor é Vdd? 

 

Creio que não, o sistema parece estar normal, em mods ainda, não afetará em nada, apenas ajudará no sistema de loot hehe ^^

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Link para o post
Compartilhar em outros sites

Esse sistema funciona em qualquer versão, até em poketibia? Pq coloquei aqui no meu poketibia, ele carrega o sistema de boa e até adiciona um item, mas na hora de adicionar o segundo item ele buga e aparece esta msg no console>

 

post-32370-0-95462300-1403454998_thumb.p

 

 

Link para o post
Compartilhar em outros sites

Tenta :

 

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="none.com" enabled="yes">
<config name="Loot_func"><![CDATA[

info = {
OnlyPremium = true,
AutomaticDeposit = true,
BlockMonsters = {},
BlockItemsList = {2123,2515}
}

function setPlayerStorageTable(cid, storage, tab)
local tabstr = "&"
for i,x in pairs(tab) do
tabstr = tabstr .. i .. "," .. x .. ";"
end
setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1))
end
function getPlayerStorageTable(cid, storage)
local tabstr = getPlayerStorageValue(cid, storage)
local tab = {}
if type(tabstr) ~= "string" then
return {}
end
if tabstr:sub(1,1) ~= "&" then
return {}
end
local tabstr = tabstr:sub(2, #tabstr)
local a = string.explode(tabstr, ";")
for i,x in pairs(a) do
local b = string.explode(x, ",")
tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2]
end
return tab
end

function isInTable(cid, item)
for _,i in pairs(getPlayerStorageTable(cid, 27000))do
if tonumber(i) == tonumber(item) then
return true
end
end
return false
end
function addItemTable(cid, item)
local x = {}
for i = 1,#getPlayerStorageTable(cid, 27000) do
table.insert(x,getPlayerStorageTable(cid, 27000))
end
if x ~= 0 then
table.insert(x,tonumber(item))
setPlayerStorageTable(cid, 27000, x)
else
setPlayerStorageTable(cid, 27000, {item})
end
end
function removeItemTable(cid, item)
local x = {}
for i = 1,#getPlayerStorageTable(cid, 27000) do
table.insert(x,getPlayerStorageTable(cid, 27000))
end
for i,v in ipairs(x) do
if tonumber(v) == tonumber(item) then
table.remove(x,i)
end
end
return setPlayerStorageTable(cid, 27000, x)
end
function ShowItemsTabble(cid)
local str,n = "-- My Loot List --\n\n",0
for i = 1,#getPlayerStorageTable(cid, 27000) do
n = n + 1
str = str..""..n.." - "..getItemNameById(getPlayerStorageTable(cid, 27000)).."\n"
end
return doShowTextDialog(cid, 2529, str)
end
function getContainerItems(containeruid)
local items = {}
local containers = {}
if type(getContainerSize(containeruid)) ~= "number" then
return false
end
for slot = 0, getContainerSize(containeruid)-1 do
local item = getContainerItem(containeruid, slot)
if item.itemid == 0 then
break
end
if isContainer(item.uid) then
table.insert(containers, item.uid)
end
table.insert(items, item)
end
if #containers > 0 then
for i,x in ipairs(getContainerItems(containers[1])) do
table.insert(items, x)
end
table.remove(containers, 1)
end
return items
end
function getItemsInContainerById(container, itemid) -- Function By Kydrai
local items = {}
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 = 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 doPlayerAddItemStacking(cid, itemid, quant) -- by mkalo
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
end
else
return doPlayerAddItem(cid, itemid, quant)
end
if piles == #item then
doPlayerAddItem(cid, itemid, quant)
end
end
function AutomaticDeposit(cid,item,n)
local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n*1)
return doPlayerDepositMoney(cid, deposit)
end
function corpseRetireItems(cid, pos)
local check = false
for i = 0, 255 do
pos.stackpos = i
tile = getTileThingByPos(pos)
if tile.uid > 0 and isCorpse(tile.uid) then
check = true break
end
end
if check == true then
local items = getContainerItems(tile.uid)
for i,x in pairs(items) do
if isInArray(getPlayerStorageTable(cid, 27000), tonumber(x.itemid)) then
if isItemStackable(x.itemid) then
doPlayerAddItemStacking(cid, x.itemid, x.type)
if info.AutomaticDeposit == true and isInArray({"2148","2152","2160"},tonumber(x.itemid)) then
AutomaticDeposit(cid,x.itemid,x.type)
end
else
doPlayerAddItem(cid, x.itemid)
end
doRemoveItem(x.uid)
end
end
end
end
]]></config>
<event type="login" name="LootLogin" event="script"><![CDATA[
function onLogin(cid)
registerCreatureEvent(cid, "MonsterAttack")
return true
end]]></event>
<event type="death" name="LootEventDeath" event="script"><![CDATA[
domodlib('Loot_func')
function onDeath(cid, corpse, deathList)
local killer,pos = deathList[1],getCreaturePosition(cid)
addEvent(corpseRetireItems,1,killer,pos)
return true
end]]></event>
<event type="combat" name="MonsterAttack" event="script"><![CDATA[
domodlib('Loot_func')
if isPlayer(cid) and isMonster(target) and not isInArray(info.BlockMonsters,string.lower(getCreatureName(target))) then
registerCreatureEvent(target, "LootEventDeath")
end
return true]]></event>
<talkaction words="!autoloot;/autoloot" event="buffer"><![CDATA[
domodlib('Loot_func')
local t = string.explode(string.lower(param), ",")
if info_OnlyPremium == true and not isPremium(cid) then
doPlayerSendCancel(cid, "you must be a premium account.") return true
elseif not t[1] then
ShowItemsTabble(cid) return true
elseif tonumber(t[1]) or tonumber(t[2]) then
doPlayerSendCancel(cid, "enter!autoloot add,name or !autoloot remove,name") return true
elseif isInArray({"add","remove"}, tostring(t[1])) then
local func,check = tostring(t[1]) == "add" and addItemTable or removeItemTable, tostring(t[1]) == "add" and true or false
local item = getItemIdByName(tostring(t[2]), false)
if not item then
doPlayerSendCancel(cid, "This item does not exist.") return true
elseif check == true and isInArray(info.BlockItemsList, item) then
doPlayerSendCancel(cid, "You can not add this item in the list!") return true
elseif isInTable(cid, item) == check then
doPlayerSendCancel(cid, "This Item "..(check == true and "already" or "is not").." in your list.") return true
end
func(cid, item)
doPlayerSave(cid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,check == true and "you added the item "..t[2].." in the list" or "you removed the item "..t[2].." from the list") return true
end
return true]]></talkaction>
</mod>

 

Link para o post
Compartilhar em outros sites

Mesma coisa :(

 

Só da para add 1 se adicionar outro o sistema buga.

Link para o post
Compartilhar em outros sites

Aparece uma msg de erro na lib parece que não tem a função para ele funcionar corretamente.

Link para o post
Compartilhar em outros sites

Utilizei o comando /autoloot e ele mostrou a janela sem item nenhum. Adicionei um novo item com o comando /autoloot add,gold coin ele apareceu a mensagem em azul que adicionou, porém quando eu utilizo novamente o comando /autoloot para verificar ele me da esses erros na distro e não abre a janela com a lista de itens adicionado. 

Segue imagem:

7iy555J.jpg

1508741_4.png

         Acesse: www.7wars.com          Global 8.60 full

 

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

Estava querendo esse Sistema *--* 

Mais tem Caras que Diz que da Lag no servidor é Vdd? 

o sistema é baseado em uma 'gambiarra' de tabelas em storage e é um creaturescript executado a todo momento que alguem mata qualquer monstro; entao pode pesar um pouco sim no servidor, se a máquina nao for boa

 

 

facebook.com/PokeJota

Link para o post
Compartilhar em outros sites

:foreverhappy: LOL :LOL: 

 

COMO VOCÊ APRENDE ISSO?

REP+++++++++++++++++

 

PARABÉNS, IREI COLOCAR NO MEU SERVER....

Meus Contatos!

 

Minhas Funções:

 

               Skype: TsplayerT

         Facebook: TakaFukushii

          YouTube: ADoseDupla

           Twitter: @_Splayer_

 

 

 

 

 

 

 

                             Mapper:▓▓▓▓▓▓▓▓▓▓ 97%

     Programmer:▓▓▓▓▓▒▒▒▒▒ 45%

             Scripter:▓▓▓▓▓▓▓▓▓▒ 83%

              Spriter:▓▓▓▓▓▓▒▒▒▒ 57%

    Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99%

        Ot Creator:▓▓▓▓▓▓▓▒▒▒71%

Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%

 

Link para o post
Compartilhar em outros sites
  • 4 weeks later...
  • 7 months later...

Para quem não sabe como funciona : É um sistema onde o player pode digitar um comando para adicionar ou remover um item ao auto loot,que no caso é para coletar o item automaticamente.

 

Adicionando o script

 

Em "data/mods/autoloot.xml" :

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="none.com" enabled="yes">
<config name="Loot_func"><![CDATA[

info = {
OnlyPremium = true,
AutomaticDeposit = true,
BlockMonsters = {},
BlockItemsList = {2123,2515}
}

function setPlayerStorageTable(cid, storage, tab)
local tabstr = "&"
for i,x in pairs(tab) do
tabstr = tabstr .. i .. "," .. x .. ";"
end
setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1))
end
function getPlayerStorageTable(cid, storage)
local tabstr = getPlayerStorageValue(cid, storage)
local tab = {}
if type(tabstr) ~= "string" then
return {}
end
if tabstr:sub(1,1) ~= "&" then
return {}
end
local tabstr = tabstr:sub(2, #tabstr)
local a = string.explode(tabstr, ";")
for i,x in pairs(a) do
local b = string.explode(x, ",")
tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2]
end
return tab
end

function isInTable(cid, item)
for _,i in pairs(getPlayerStorageTable(cid, 27000))do
if tonumber(i) == tonumber(item) then
return true
end
end
return false
end
function addItemTable(cid, item)
local x = {}
for i = 1,#getPlayerStorageTable(cid, 27000) do
table.insert(x,getPlayerStorageTable(cid, 27000))
end
if x ~= 0 then
table.insert(x,tonumber(item))
setPlayerStorageTable(cid, 27000, x)
else
setPlayerStorageTable(cid, 27000, {item})
end
end
function removeItemTable(cid, item)
local x = {}
for i = 1,#getPlayerStorageTable(cid, 27000) do
table.insert(x,getPlayerStorageTable(cid, 27000))
end
for i,v in ipairs(x) do
if tonumber(v) == tonumber(item) then
table.remove(x,i)
end
end
return setPlayerStorageTable(cid, 27000, x)
end
function ShowItemsTabble(cid)
local str,n = "-- My Loot List --\n\n",0
for i = 1,#getPlayerStorageTable(cid, 27000) do
n = n + 1
str = str..""..n.." - "..getItemNameById(getPlayerStorageTable(cid, 27000)).."\n"
end
return doShowTextDialog(cid, 2529, str)
end
function getContainerItems(containeruid)
local items = {}
local containers = {}
if type(getContainerSize(containeruid)) ~= "number" then
return false
end
for slot = 0, getContainerSize(containeruid)-1 do
local item = getContainerItem(containeruid, slot)
if item.itemid == 0 then
break
end
if isContainer(item.uid) then
table.insert(containers, item.uid)
end
table.insert(items, item)
end
if #containers > 0 then
for i,x in ipairs(getContainerItems(containers[1])) do
table.insert(items, x)
end
table.remove(containers, 1)
end
return items
end
function getItemsInContainerById(container, itemid) -- Function By Kydrai
local items = {}
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 = 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 doPlayerAddItemStacking(cid, itemid, quant) -- by mkalo
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
end
else
return doPlayerAddItem(cid, itemid, quant)
end
if piles == #item then
doPlayerAddItem(cid, itemid, quant)
end
end
function AutomaticDeposit(cid,item,n)
local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n*1)
return doPlayerDepositMoney(cid, deposit)
end
function corpseRetireItems(cid, pos)
local check = false
for i = 0, 255 do
pos.stackpos = i
tile = getTileThingByPos(pos)
if tile.uid > 0 and isCorpse(tile.uid) then
check = true break
end
end
if check == true then
local items = getContainerItems(tile.uid)
for i,x in pairs(items) do
if isInArray(getPlayerStorageTable(cid, 27000), tonumber(x.itemid)) then
if isItemStackable(x.itemid) then
doPlayerAddItemStacking(cid, x.itemid, x.type)
if info.AutomaticDeposit == true and isInArray({"2148","2152","2160"},tonumber(x.itemid)) then
AutomaticDeposit(cid,x.itemid,x.type)
end
else
doPlayerAddItem(cid, x.itemid)
end
doRemoveItem(x.uid)
end
end
end
end
]]></config>
<event type="login" name="LootLogin" event="script"><![CDATA[
function onLogin(cid)
registerCreatureEvent(cid, "MonsterAttack")
return true
end]]></event>
<event type="death" name="LootEventDeath" event="script"><![CDATA[
domodlib('Loot_func')
function onDeath(cid, corpse, deathList)
local killer,pos = deathList[1],getCreaturePosition(cid)
addEvent(corpseRetireItems,1,killer,pos)
return true
end]]></event>
<event type="combat" name="MonsterAttack" event="script"><![CDATA[
domodlib('Loot_func')
if isPlayer(cid) and isMonster(target) and not isInArray(info.BlockMonsters,string.lower(getCreatureName(target))) then
registerCreatureEvent(target, "LootEventDeath")
end
return true]]></event>
<talkaction words="!autoloot;/autoloot" event="buffer"><![CDATA[
domodlib('Loot_func')
local t = string.explode(string.lower(param), ",")
if info_OnlyPremium == true and not isPremium(cid) then
doPlayerSendCancel(cid, "you must be a premium account.") return true
elseif not t[1] then
ShowItemsTabble(cid) return true
elseif tonumber(t[1]) or tonumber(t[2]) then
doPlayerSendCancel(cid, "enter!autoloot add,name or !autoloot remove,name") return true
elseif isInArray({"add","remove"}, tostring(t[1])) then
local func,check = tostring(t[1]) == "add" and addItemTable or removeItemTable, tostring(t[1]) == "add" and true or false
local item = getItemIdByName(tostring(t[2]), false)
if not item then
doPlayerSendCancel(cid, "This item does not exist.") return true
elseif check == true and isInArray(info.BlockItemsList, item) then
doPlayerSendCancel(cid, "You can not add this item in the list!") return true
elseif isInTable(cid, item) == check then
doPlayerSendCancel(cid, "This Item "..(check == true and "already" or "is not").." in your list.") return true
end
func(cid, item)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,check == true and "you added the item "..t[2].." in the list" or "you removed the item "..t[2].." from the list") return true
end
return true]]></talkaction>
</mod>

 

Comandos

 

 

 

 

Configurando

ViitinG  não sei sé com todo mundo mais quando coloquei no meu ot ele funciona ate um certo ponto porque ele pega um iten só e não pega mais nenhum sabe me dizer aonde esta o erro ?? ja tentei com os dois link q voce posto e da o msm erro 

 

grato

Kamyllo

Link para o post
Compartilhar em outros sites
  • 10 months later...

Quando junta 100 itens, ele não pega mais o item.

 

Exemplo: coloquei fire stone no auto loot, quando eu pegar 100 fire stone, ele para de coletar fire stone, se eu "separar" 50 e 50, dai ele volta a pegar até juntar 100 denovo.

Link para o post
Compartilhar em outros sites

@samlecter Adaptou pra Pokémon? me passa ae <3 

​Obstaculo Impossível?

Impossível é existir algo Impossível ;) 

 

 

 

 

Confira os Meus Conteúdos ! 

Te ajudei ? REP + E Ficamos KIT ;)

Link para o post
Compartilhar em outros sites
  • 1 month later...
Em 28/01/2016 15:02:24, samlecter disse:

Quando junta 100 itens, ele não pega mais o item.

 

Exemplo: coloquei fire stone no auto loot, quando eu pegar 100 fire stone, ele para de coletar fire stone, se eu "separar" 50 e 50, dai ele volta a pegar até juntar 100 denovo.

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)

Tente mudar para uma quantidade maior os números em vermelho, pois ai está mesmo para catar apenas 100 lots e o restante vai para o chão, e me fale se deu certo.

Editado por pauliinho157 (veja o histórico de edições)

Criador, a procura de mapper e scripter para server de tibia 8.6 DEDICADO

 

| IP: real-world.servegame.com | XP: 650 | Baiak EDITED (PRÓPRIO) | DEDICADO 24horas Online | Aberto 10.12.15 |

logo.png

Link para o post
Compartilhar em outros sites
Em 11/03/2016 at 00:57, pauliinho157 disse:

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)

Tente mudar para uma quantidade maior os números em vermelho, pois ai está mesmo para catar apenas 100 lots e o restante vai para o chão, e me fale se deu certo.

 

 

 

O sistema de Auto Loot que uso funciona exatamente igual a esse porém é diferente, não tem esse script na pasta mod, não tem essa parte que vc mencionou, eu consegui concertar, na verdade o @Lucas Barreto que conseguiu, ta funcionando perfeitamente agora :)  segue a solução que ele deu:

 

 

Citar

Usando da matemática pra corrigir o problema de empilhamento. Adaptei aqui no meu server e funcionou, espero ajudar. Segue a mudança

 

La em creaturescripts no seu aloot.lua 

Como está:

 


if (count > 100) then

			count = count - math.floor(count / 100) * 100

		end

Como deve Ficar:


if (count >= 100) then

			count = count - math.floor(count / 100) * 100

		end

Só mudar a linha na qual verifica a quantidade de items na bag, a atual verifica só ate + que 100, com isso tem que estar 101+. Com o outro ele ja verifica o 100+. Espero ter ajudado.

 

Ele me ajudou, estou repassando aqui pra ajudar mais pessoas, Vlw Lucas ^^

 

 

 

Link para o post
Compartilhar em outros sites
8 horas atrás, samlecter disse:

O sistema de Auto Loot que uso funciona exatamente igual a esse porém é diferente, não tem esse script na pasta mod, não tem essa parte que vc mencionou, eu consegui concertar, na verdade o @Lucas Barreto que conseguiu, ta funcionando perfeitamente agora :)  segue a solução que ele deu:

 

 

 

Ele me ajudou, estou repassando aqui pra ajudar mais pessoas, Vlw Lucas ^^

 

 

 

Exclui o [MOD] ou pode manter ?

Criador, a procura de mapper e scripter para server de tibia 8.6 DEDICADO

 

| IP: real-world.servegame.com | XP: 650 | Baiak EDITED (PRÓPRIO) | DEDICADO 24horas Online | Aberto 10.12.15 |

logo.png

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Naze
      Uns dos problemas das maiorias dos otserv casual que estão online é o autoloot, alguns com erros e defeito na checagem dos containers e sempre consumindo muito por ser em lua fazendo checagens de tile, corpo, itens e etc. Por isso decidi da uma contribuição a essa comunidade que me evoluiu bastante um autoloot diretamente na source na função que insere os itens no corpo, otimizando em 100% na hr da entrega do item, e não tendo problemas ocasionais como corpos sobre corpos ou varias bags.
       
           Esse sistema já é bem comum quando comprado, mas gratuito acredito que ainda não tinha disponível, então fiz esse totalmente do 0 na source tfs 0.4 rev 3999 (do yan).
          
          Atenção na instalação! Qualquer problema pra compilar que envolva as linhas presente no código verifique novamente se instalou corretamente antes de pedir ajuda para evitar flood. Qualquer bug, erro ou mal funcionamento encontrado pode postar que estarei corrigindo, mas não irei customizar a seu agrado, você consegue fazer isso sozinho com atenção e calma, e se precisa de ajuda é só posta as duvidas.
       
      Imagens do Sistema:
       
      Características: 
      -> Otimizado executando apenas funções necessarias -> Comandos simples e praticos -> !autoloot on/off //Autoloot estara sempre ligado, e caso queria desliga use '!autoloot off' -> !autoloot bank/bag //Define para onde ira o dinheiro coletado, direto banco ou no inventario -> !autoloot list //Lista todos itens adicionados para coleta -> !autoloot clear/clean //Remove todos itens da lista -> !autoloot add, name item, name item, ... //Adiciona itens na lista, podendo adicionar quantos quiser de uma vez. Ele retorna um messagem dizendo os itens que foram adicionados e os que deram erro e não foram adicionados, talvez por escrito errado, ja existente na lista, na lista de bloquados, etc. -> !autoloot remove, item name, item name, ... //Remove itens da lista, com a mesma logica do add. -> Opções configuravel pelo Config.lua -> AutoLoot_MoneyIDs //IDs dos Itens Moedas do servidor como gold coins, platinium coins, crystal coins. -> AutoLoot_BlockIDs //IDs dos itens bloqueados para autoloot -> AutoLoot_MaxItem //Quantidade maxima de itens para adicionar a lista -> Sistema livres de bugs ou logs de erros.  
      Instalação:
      Toda instalação será feita na source, exceto por 1 linha em talkactions.xml e 3 variáveis no config.lua
       
      TFS 0.4 :
       
      Link para Otx -> https://tibiaking.com/forums/topic/101086-otimizado-autoloot-in-sources-for-otx2-ou-menor/
       
      Nas versões atual da TFS para servidores 10+ não ira funcionar pois algumas funções são diferente e não irei corrigir agora, em breve passo o mesmo pra tfs 1.x e otx3.
       
      Esse sistema foi totalmente feito por mim, mas dou créditos também ao @Mathias Kenfi por me ajudar muito na evolução em lua/c++ e a tabela sql é a mesma usada no quick autoloot 1.3 postado por Pedriinz
       
      @Edit: 
      Quem usa source de derivados caso ocorra erro aplica as alterações dos comentários abaixo.
      Pequena correção em talkactions.cpp na parte remove na linha if(!player->checkAutoLoot(itemId)), para if(player->checkAutoLoot(itemId))
    • Por Digoshow
      Ola eu instalei um scrip no meu otserv que e o Auto-loot, tudo certinho blz, mais eu queria editar o comando que e usado para diciona um item, o comando que esta e esse /aloot remove:2170 eu queria deixa assim /aloot remove, 2170 tirar os 2 pontos e deixa uma virgula e um espaco depois da virgula, alguem consegue editar pra mim porfavor:
      Scrip que estou usando : http://www.tibiaking.com/forum/topic/8172-sistema-auto-loot/
      Obrigado, REP+ !
    • Por Tricoder
      SCREENSHOT
      http://3.1m.yt/Zwo99Sdx.png
      http://4.1m.yt/oG_cwli8u.png
      ______________________________________________ COMANDOS
      !autoloot add, itemId ou name -- Adicionando um item na lista !autoloot remove, itemId or name -- Remover um item da lista !autoloot show -- Mostrar a lista do autoLoot !autoloot clear -- Limpar a lista do autoLoot ______________________________________________ SCRIPT data/global.lua
      -- AutoLoot config AUTO_LOOT_MAX_ITEMS = 5 -- Reserved storage AUTOLOOT_STORAGE_START = 10000 AUTOLOOT_STORAGE_END = AUTOLOOT_STORAGE_START + AUTO_LOOT_MAX_ITEMS -- AutoLoot config end talkactions/talkactions.xml
      <talkaction words="!autoloot" separator=" " script="autoloot.lua"/> talkactions/scripts/autoloot.lua
      function onSay(player, words, param) local split = param:split(",") local action = split[1] if action == "add" then local item = split[2]:gsub("%s+", "", 1) local itemType = ItemType(item) if itemType:getId() == 0 then itemType = ItemType(tonumber(item)) if itemType:getId() == 0 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is no item with that id or name.") return false end end local itemName = tonumber(split[2]) and itemType:getName() or item local size = 0 for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do local storage = player:getStorageValue(i) if size == AUTO_LOOT_MAX_ITEMS then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The list is full, please remove from the list to make some room.") break end if storage == itemType:getId() then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." is already in the list.") break end if storage <= 0 then player:setStorageValue(i, itemType:getId()) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." has been added to the list.") break end size = size + 1 end elseif action == "remove" then local item = split[2]:gsub("%s+", "", 1) local itemType = ItemType(item) if itemType:getId() == 0 then itemType = ItemType(tonumber(item)) if itemType:getId() == 0 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is no item with that id or name.") return false end end local itemName = tonumber(split[2]) and itemType:getName() or item for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do if player:getStorageValue(i) == itemType:getId() then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." has been removed from the list.") player:setStorageValue(i, 0) return false end end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." was not founded in the list.") elseif action == "show" then local text = "-- Auto Loot List --\n" local count = 1 for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do local storage = player:getStorageValue(i) if storage > 0 then text = string.format("%s%d. %s\n", text, count, ItemType(storage):getName()) count = count + 1 end end if text == "" then text = "Empty" end player:showTextDialog(1950, text, false) elseif action == "clear" then for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do player:setStorageValue(i, 0) end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The autoloot list has been cleared.") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Use the commands: !autoloot {add, remove, show, clear}") end return false end creaturescripts/creaturescripts.xml
      <event type="kill" name="AutoLoot" script="autoloot.lua" /> creaturescripts/scripts/autoloot.lua
      local function scanContainer(cid, position) local player = Player(cid) if not player then return end local corpse = Tile(position):getTopDownItem() if not corpse then return end if corpse:getType():isCorpse() and corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == cid then for i = corpse:getSize() - 1, 0, -1 do local containerItem = corpse:getItem(i) if containerItem then for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do if player:getStorageValue(i) == containerItem:getId() then containerItem:moveTo(player) end end end end end end function onKill(player, target) if not target:isMonster() then return true end addEvent(scanContainer, 100, player:getId(), target:getPosition()) return true end creaturescripts/scripts/login.lua
      player:registerEvent("AutoLoot") ______________________________________________ CRÉDITOS
      Printer
    • Por AgaSsI
      creaturescripts.xml
        <event type="login" name="aloot_reg" event="script" value="aloot.lua"/> <event type="kill" name="aloot_kill" event="script" value="aloot.lua"/> creaturescripts/scritps aloot.lua
        function onLogin(cid) registerCreatureEvent(cid, "aloot_kill") return true end local stor = 7575 function autoloot(cid, target, pos) local function doStack(cid, itemid, new) local count = getPlayerItemCount(cid, itemid) if (count > 100) then count = count - math.floor(count / 100) * 100 end local newCount = count + new if (count ~= 0) then local find = getPlayerItemById(cid, true, itemid, count).uid if (find > 0) then doRemoveItem(find) else newCount = new end end local item = doCreateItemEx(itemid, newCount) doPlayerAddItemEx(cid, item, true) end local function scanContainer(cid, uid, list) for k = (getContainerSize(uid) - 1), 0, -1 do local tmp = getContainerItem(uid, k) if (isInArray(list, tmp.itemid)) then if isItemStackable(tmp.itemid) and (getPlayerItemCount(cid, tmp.itemid) > 0) then doStack(cid, tmp.itemid, tmp.type) else local item = doCreateItemEx(tmp.itemid, tmp.type) doPlayerAddItemEx(cid, item, true) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Looted ' .. tmp.type .. ' ' .. getItemNameById(tmp.itemid) .. '.') doRemoveItem(tmp.uid) elseif isContainer(tmp.uid) then scanContainer(cid, tmp.uid, list) end end end local items = {} for i = getTileInfo(pos).items, 1, -1 do pos.stackpos = i table.insert(items, getThingFromPos(pos)) end if (#items == 0) then return end local corpse = -1 for _, item in ipairs(items) do local name = getItemName(item.uid):lower() if name:find(target:lower()) then corpse = item.uid break end end if (corpse ~= -1) and isContainer(corpse) then scanContainer(cid, corpse, tostring(getPlayerStorageValue(cid, stor)):gsub('_', ''):explode(',')) end end function onKill(cid, target, lastHit) if not isPlayer(target) then local infos = getPlayerStorageValue(cid, stor) if (infos == -1) then return true end local list = tostring(infos):explode(',') if (#list == 0) then return true end addEvent(autoloot, 150, cid, getCreatureName(target), getCreaturePosition(target)) end return true end talkactios.xml
        <talkaction words="/aloot" hide="yes" event="script" value="aloot.lua"/> Talkaction/scrips
        local stor, limit = 7575, 5 --storage, limit to add. local allow_container = false --empty! not looted with items, atleast for now. function onSay(cid, words, param) local expl = param:explode(':') local action, rst = expl[1], expl[2] if (action:lower() == 'check') then local infos, list = getPlayerStorageValue(cid, stor), {} if (infos ~= -1) then list = tostring(infos):explode(',') end local txt = 'Autoloot List:\n' if (#list > 0) then for k, id in ipairs(list) do id = id:gsub('_', '') if tonumber(id) then txt = txt .. getItemNameById(tonumber(id)) .. ((k < #list) and '\n' or '') end end else txt = 'Empty' end doPlayerPopupFYI(cid, txt) elseif (action:lower() == 'add') then local infos, list = getPlayerStorageValue(cid, stor), {} if (infos ~= -1) then list = tostring(infos):gsub('_', ''):explode(',') end if (#list >= limit) then return doPlayerSendCancel(cid, 'You already have ' .. limit .. ' autolooting items.') end local item = tonumber(rst) if not item then item = getItemIdByName(rst, false) if not item then return doPlayerSendCancel(cid, 'not valid item.') end end if not allow_container and isItemContainer(item) then return doPlayerSendCancel(cid, 'this item can not be autolooted.') end local attrs = getItemInfo(item) if not attrs then return doPlayerSendCancel(cid, 'not valid item.') elseif not attrs.movable or not attrs.pickupable then return doPlayerSendCancel(cid, 'this item can not be autolooted.') end if isInArray(list, item) then return doPlayerSendCancel(cid, 'already added.') end table.insert(list, tostring(item)) local new = '' for v, id in ipairs(list) do new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '') end doPlayerSetStorageValue(cid, stor, tostring(new)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< has been added to the autoloot list.') elseif (action:lower() == 'remove') then local infos, list = getPlayerStorageValue(cid, stor), {} if (infos ~= -1) then list = tostring(infos):gsub('_', ''):explode(',') end if (#list == 0) then return doPlayerSendCancel(cid, 'You dont have any item added.') end if (#list >= limit) then return doPlayerSendCancel(cid, 'You already have ' .. limit .. ' autolooting items.') end local item = tonumber(rst) if not item then item = getItemIdByName(rst, false) if not item then return doPlayerSendCancel(cid, 'not valid item.') end end if not isInArray(list, item) then return doPlayerSendCancel(cid, 'This item is not in the list.') end local new = '' for v, id in ipairs(list) do if (tonumber(id) ~= item) then new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '') end end doPlayerSetStorageValue(cid, stor, tostring(new)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removed from the autoloot list.') end return true end Usando
      /aloot check
      Cheka a Lista dos Loots
      /aloot add:itemid ou nome do item
      Exemplo
      /aloot add:worm
      /aloot add:2170
      16:42 Item >>worm<< has been added to the autoloot list.
      Para remover
      /aloot remove:worm
      /aloot remove:2170
      Exemplo Testado:
      16:41 Looted 2 gold coin.
      16:41 Looted 1 cheese.
      CREDITOS: eduardobean
      é isso pessoal gosto da + Rep
    • Por xWhiteWolf
      Fala galera, hoje vim trazer o projeto pronto do Magnus Challenger pra vocês instalarem no servidor de vocês!   

      Pra quem não conhece é um sistema de Tasks baseado no Zezenia onde você pode escolher entre tasks de matar monstros ou de coletar certos items para o npc Magnus, um guerreiro famoso da cidade que está atolado de tarefas e precisa da sua ajuda!

      Peguei os aspectos que eu julguei serem os principais do modelo do Zezenia e editei com algumas coisas que eu achei que ficariam melhores.
      Quem quiser pode ver um vídeo comentado de como o sistema funciona:




      Dito isso vou ensinar vocês como instalar isso no server:
      Pra começar vá em data\creaturescripts\scripts e procure login.lua, agora vá até o final do arquivo e antes do último return true coloque essas linhas abaixo

      ainda em creaturescripts procure creaturescripts.xml e adicione essa linha junto com as outras que já estão lá (seguindo o padrão)
      <!-- TASK SYSTEM --> <event type="kill" name="tasksystem" script="tasksystem.lua"/> Agora crie um arquivo em creaturescripts\scripts com o nome de tasksystem.lua e adicione o seguinte à ele:




      Terminada a parte da contagem de kill vamos ao NPC em si.
      Crie um arquivo chamado Magnus.xml em data\npc e coloque isso dentro dele:




      Agora em data\npc\scripts crie um arquivo chamado zezeniaa.lua e adicione esse conteúdo dentro do arquivo:





      ~~~~~~~~~~~~~~~~ FEITO ISSO ESTÁ TERMINADO ~~~~~~~~~~~~~~~~~~

      Agora aprendendo a configurar:
       
      No tasksystem vc pode editar isso daqui:
      Eu fiz um sistema onde se vc estiver em party com alguém e a pessoa matar os bixos conta como se você tivesse matado; Assim incentiva o pessoal a ir numa cave de Dragon e ao invés de matar quem está lá pra ficar sozinho na cave, eles vão chamar party pra fazerem a task juntos.. assim fazer amigos fica mais fácil e com maiores laços é maior a chance do povo não abandonar o seu server.

      Apenas digite "true" ou "false" pra ativar/desativar esse sistema e em baixo temos a distancia máxima pro monstro estar do cara que está fazendo a task pra contar o kill. Se a distancia entre o monstro e a pessoa for maior que 7 não vai contar pra ele a kill.


      No zezeniaa.lua as coisas que dão pra configurar são maiores mas são igualmente simples:
      Toda vez que vc pedir uma task short (curta) vc vai ter de 100 a 400 monstros pra matar, ele gera um número de 0 a 6 e multiplica por 5 e soma com os 100 iniciais.. o mesmo vale pra todos os outros valores.

      levelcollect é o level mínimo pra fazer tasks do tipo collect.
      time é o tempo em segundos que você vai ficar sem poder falar com o npc caso desista de alguma task, o padrão é 8 * 60 * 60 (8 horas)
      bonus é por quanto vai multiplicar caso vc permita que o npc escolha aleatoriamente entre todas as opções.. o padrão é 20% de bonus (1.2)
      multiplicador é uma coisa que eu adicionei pra ficar mais fácil mexer na fórmula sem cometer cagadas, se vc tá ganhando 10% de exp e quer ganhar 80% é só colocar 8 no multiplicador.

       
      Isso daqui é o banco de dados principal do sistema de kill, toda vez que vc escolher uma task do tipo fácil, médio, dificil ele vai acessar essas tabelas contendo o nome das criaturas.. vc pode facilmente adicionar novos nomes, o npc já está programado pra lidar com isso, apenas siga o padrão e mantenha sempre o último sem vírgula!

      Ex: adicionando Morgaroth na tabela de hard
      local hard = { [1] = "Giant Spider", [2] = "Dragon Lord", [3] = "Grim Reaper", [4] = "Demon", [5] = "Crystal Spider", [6] = "Demon Skeleton", [7] = "Juggernaut", [8] = "Destroyer", [9] = "Hand of Cursed Fate", [10] = "Morgaroth" } atente-se também pra não repetir o número no index.. se o anterior era [9] use [10].

      O restante das tabelas são separadas para o banco de dados das tasks de collect:
       
      segue a mesma lógica da de kill só que aqui você tem o id dos itens que serão usados... aquela count não tem nada a ver com o item pois ele vai gerar tanto o item aleatoriamente quanto à count;
      Ex: 
      [1] = {id = 5880, count = 20}, -- iron ore isso não significa que se cair iron ore (id 5880) irá cair sempre 20.. até porque eu poderia escolher uma task long e easy e pegar a task de trazer até 50 iron ores, apenas tente manter os padrões que são os intervalos definidos.
      No easy ele varia de 10 a 20, no medium ele varia de 20 a 35 e no hard de 40 a 50.



      Espero que vocês tenham curtido, é um sistema grande mas bem simples de se mexer... se tiverem quaisquer problemas podem comentar aqui. Deu trabalho fazer isso então se você gostou deixe o seu comentário aí e o seu "Gostei" que vai me incentivar a trazer mais coisas desse tipo pra cá. Abraços do lobo.


      PS: Pra sumonar o npc digite com o GOD: /n Magnus ou coloque ele pelo map editor.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo