Pegando Item ou Monstro com shovel.
Ae pessoal,
como prometido vo ensina a pega otros itens alem de scarab coin, e outros monstros alem de scarab;
Vá na pasta data/actions/scripts do seu ot e abra o arquivo shovel.lua
Vai tá assim:
-- Pegando scarab,scarab coin da areia!-- edited by darkedes for tibia use
-- To get it to working replace this code with your old shovel lua
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 28 then
return 0
end
if item2.itemid == 468 then
doTransformItem(item2.uid,469)
doDecayItem(item2.uid)
elseif item2.itemid == 481 then
doTransformItem(item2.uid,482)
doDecayItem(item2.uid)
elseif item2.itemid == 483 then
doTransformItem(item2.uid,484)
doDecayItem(item2.uid)
elseif item2.itemid == 231 then
rand = math.random(1,30)
if rand < 6 then
doSummonCreature("Scarab", topos)
elseif rand == 15 then
doPlayerAddItem(cid,2159,1)
else
doSendMagicEffect(topos,2)
end
else
return 0
end
return 1
end
Então se você quiser colocar novos monstros Adicione uma seguinte linha após:
doSummonCreature("Scarab", topos)elseif rand == 15 then
Vou fazer um exemplo:
Adicionarei esta linha:
doSummonCreature("Larva", topos)elseif rand == 15 then
Ficará assim:
-- Pegando scarab,scarab coin da areia!-- edited by darkedes for tibia use
-- To get it to working replace this code with your old shovel lua
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 28 then
return 0
end
if item2.itemid == 468 then
doTransformItem(item2.uid,469)
doDecayItem(item2.uid)
elseif item2.itemid == 481 then
doTransformItem(item2.uid,482)
doDecayItem(item2.uid)
elseif item2.itemid == 483 then
doTransformItem(item2.uid,484)
doDecayItem(item2.uid)
elseif item2.itemid == 231 then
rand = math.random(1,30)
if rand < 6 then
doSummonCreature("Scarab", topos)
elseif rand == 15 then
doSummonCreature("Larva", topos)
elseif rand == 15 then
doPlayerAddItem(cid,2159,1)
else
doSendMagicEffect(topos,2)
end
else
return 0
end
return 1
end
Pronto! Agora poderá sumonar Larva também!!
Se quiser adicionar outros monstros,apenas adicione esta linha após a do Scarab:
doSummonCreature("Nome Exato do monstro", topos)elseif rand == 15 then
E pronto!
Agora pegando outros itens além de Scarab Coin!!!
Vou usar o exemplo pronto do summon de Larva,
-- Pegando scarab,scarab coin da areia!-- edited by darkedes for tibia use
-- To get it to working replace this code with your old shovel lua
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 28 then
return 0
end
if item2.itemid == 468 then
doTransformItem(item2.uid,469)
doDecayItem(item2.uid)
elseif item2.itemid == 481 then
doTransformItem(item2.uid,482)
doDecayItem(item2.uid)
elseif item2.itemid == 483 then
doTransformItem(item2.uid,484)
doDecayItem(item2.uid)
elseif item2.itemid == 231 then
rand = math.random(1,30)
if rand < 6 then
doSummonCreature("Scarab", topos)
elseif rand == 15 then
doSummonCreature("Larva", topos)
elseif rand == 15 then
doPlayerAddItem(cid,2159,1)
else
doSendMagicEffect(topos,2)
end
else
return 0
end
return 1
end
Está vendo está linha?:
doPlayerAddItem(cid,2159,1)else
2159 é o id do item 1 é a quantidade; então se colocar um item que pode ter muita quantia aumente de 1 para quantidade que você quiser!
Tá , então é só mudar o id 2159 para o que você quiser.
Feito na versão 7.6; mas configurado com os parametros certos serve também para 7.5!!!
Abraços;
OBS: Caso a linha:
-- Pegando scarab,scarab coin da areia!-- edited by darkedes for tibia use
-- To get it to working replace this code with your old shovel lua
não esteja igual a sua, não tem problema ok?
Comentém, deem sua nota.
UFaa....terminei