Era só pesquisa um pouco ![]()
- Forums
- xTibia - Notícias e Suporte
- Soluções
- Archived
- [pedido] Look Loot System
info
Group: Visconde
Joined: 20/08/06
Posts: 250
Reputation: +146

info
Group: Artesão
Joined: 02/12/06
Posts: 149
Reputation: +3
Tibia Character: Kanye Rusty

Eu ja tinha testado esse, e infelizmente nao funcionou..
Edited Setembro 27 by caiocesar2
Se não funcionou é porque voce deve ter feito algo errado, eu ja usei esse script genial do Mock
e ele funcionou perfeitamente em um TFS 0.3.1231. Revise todos os passos e tente denovo.
info
Group: Artesão
Joined: 02/12/06
Posts: 149
Reputation: +3
Tibia Character: Kanye Rusty

Estranho pois axo que fiz tudo certo...
Olhe:
creaturescripts.xml
<event type="kill" name="loot" event="script" value="loot.lua"/>
login.lua
function onLogin(cid)local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "loot")
return TRUE
end
loot.lua
--- Script by mocklocal function find(pa)--- Script by mock
for i=1,255 do
pa.stackpos = i
local corpse = getThingfromPos(pa)
if isCorpse(corpse.uid) == TRUE then
if isContainer(corpse.uid) == TRUE then
return corpse.uid
end
end
end
return FALSE
end
local function getConteiner(item)--- Script by mock
if isContainer(item.uid) == FALSE then
return ""
end
local items = getItemName(item.itemid)..": ("
local g = doAddContainerItem(item.uid,2815,1)
for i=1, getContainerCap(item.uid) do
local k = getContainerItem(item.uid, i)
if k.itemid ~= 0 then
if isContainer(k.uid) == TRUE then
items = items..getConteiner(k)..', '
print('o0')
else
if k.type > 1 then
items = items..k.type..'x '..getItemNameById(k.itemid).."s, "
else
items = items..getItemNameById(k.itemid)..", "
end
end
end
end
items = items:sub(1,#items-2)..'.'
doRemoveItem(g,-1)
return items..')'
end
function getLoot(pa,cid,nam)--- Script by mock
corpse = find(pa)
if corpse == FALSE then
return FALSE
end
local g = doAddContainerItem(corpse,2815,1)
local str = 'Loot de '..nam..': '
for i=1, getContainerCap(corpse) do
local a = getContainerItem(corpse, i)
if a.itemid ~= 0 then
if isContainer(a.uid) == TRUE then
str = str..getConteiner(a)..' , '
else
if a.type > 1 then
str = str..a.type..'x '..getItemNameById(a.itemid)..'s, '
else
str = str..getItemNameById(a.itemid)..', '
end
end
end
end
doRemoveItem(g,-1)
str = str:sub(1,#str-2)..'.'
doPlayerSendTextMessage(cid, 23, str)
end
function onKill(cid, target)--- Script by mock
addEvent(getLoot,100,getCreaturePosition(target),cid,getCreatureName(target))
return 1
end
Edited Setembro 27 by caiocesar2
Dá algum erro no console do OTserver quando você mata algum bixo, ou quando
algum player loga ?
info
Group: Artesão
Joined: 02/12/06
Posts: 149
Reputation: +3
Tibia Character: Kanye Rusty

Sim, da um erro no console qd mata um bixo apontando erro no loot.xml
Edited Setembro 28 by caiocesar2
Então poste esse erro aqui, pra poder te ajudar melhor, aliás ja deveria ter postado no inicio do topico né ...
info
Group: Artesão
Joined: 02/12/06
Posts: 149
Reputation: +3
Tibia Character: Kanye Rusty

Sim, mas agora eu troquei o loot.xml por um outro arquivo que peguei de outro Ot... agora nada adiantou e nem erro + aparece
~~edit
esse eh o erro q aparecia:

Edited Setembro 28 by caiocesar2
info
Group: Campones
Joined: 05/02/08
Posts: 48
Reputation: 0
Tibia Character: Lola Chermont

Muito estranho,
Talvez sua Distro não esteja rodando..
Qual você usa?
E olhando para o tópico sugerido pelo nosso amigo kydrai,
pude notar um comentário logo abaixo do próprio criador do tópico:
Mock
mas esse script funciona em servidores até 8.1 ^^.
Então.. "talvez" pode ser esse o problema.
Bom, espero o post da Distro que você utiliza.
Att. Sheikah
info
Group: Artesão
Joined: 02/12/06
Posts: 149
Reputation: +3
Tibia Character: Kanye Rusty

é, também percebi isto, porém ainda estou na dúvida.




info
Group: Artesão
Joined: 02/12/06
Posts: 149
Reputation: +3
Tibia Character: Kanye Rusty
Olá
Gostaria de saber como faço para adicionar o sistema de mostrar o Loot quando mata o monstro em meu Servidor 8.5, pois ainda não tem.
Obrigado :smile_positivo:
Edited Setembro 27 by caiocesar2