Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Olá caros membros do TibiaKing.

Hoje estou disponibilizando para vocês o script de action da shovel com digging system (sistema de escavação em inglês), ou seja você pode usar a shovel no chão para cavar buracos e desenterrar itens ou criaturas, além da funcionalidade tradicional da shovel, que é abrir buracos.
-- Pequenas observações --
<> Foi testado apenas em Alissow OTS 0.3.9 (Client 8.54)!
<> Tirei essa idéia do TibiaME onde o player usa a shovel para cavar no chão e encontrar gold e potions, mas troquei para achar itens(tipo minhocas) e criaturas pra ficar mais realista RPG!
Veja o vídeo que explica como funciona:

Hidden Content

    Give reaction to this post to see the hidden content.

(gravei só pra esse tópico)

Se quiser adicionar esse sistema em seu OT, siga os passos do tutorial abaixo!


  • Primeiro Passo​: "Configurando sua shovel"

​Em

data\actions\scripts


Abra seu shovel.lua e caso você não tenha crie e adicione o seguinte conteúdo dentro:

  Mostrar conteúdo oculto

function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 28 then
return 0
end
--Shovel digging system 8.54~8.60 by Rudkiller
--Como funciona: Você pode usar a shovel ou light shovel para cavar. Você pode encontrar surpresas como itens e criaturas quando cavar em um determinado tile.
grass = {106,108,109,3263,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,9043,9044,9045,9046,9047,9048,9049,9050,9051,9052,9053,9054,9055,9056,9057,9058}
dirt = {103,194,280,351,352,353,354,355,368,3264,3265,7352,9021,9022,9023,9024,9025,8594}
chance = math.random(1,100)
randomizer = math.random(3,9)
if isInArray(grass, item2.itemid) == TRUE and chance >= 8 and chance <= 12 then -- 5%
doCreateItem(3311, topos)
doDecayItem(item2.uid)
doSummonCreature("Bug", topos)
doPlayerSendTextMessage(cid,24, "You dug the grass and found a bug!")
elseif isInArray(grass, item2.itemid) == TRUE and chance >= 4 and chance <= 7 then -- 4%
doCreateItem(3311, topos)
doDecayItem(item2.uid)
doCreateItem(3976, 2, topos)
doPlayerSendTextMessage(cid,24,"You dug the grass and found two worms!")
elseif isInArray(grass, item2.itemid) == TRUE and chance <= 3 then -- 3%
doCreateItem(3311, topos)
doDecayItem(item2.uid)
doCreateItem(11216, topos)
doPlayerSendTextMessage(cid,24,"You dug the grass and found a lump of earth!")
elseif isInArray(dirt, item2.itemid) == TRUE and chance >= 7 and chance <= 12 then -- 6%
doCreateItem(3311, topos)
doDecayItem(item2.uid)
doCreateItem(3976, randomizer, topos)
doPlayerSendTextMessage(cid,24,"You dug the dirt and found worms!")
elseif isInArray(dirt, item2.itemid) == TRUE and chance <= 5 then -- 5%
doCreateItem(3311, topos)
doDecayItem(item2.uid)
doCreateItem(5880, topos)
doPlayerSendTextMessage(cid,24,"You dug the dirt and found an iron ore!")
elseif isInArray(dirt, item2.itemid) == TRUE or isInArray(grass, item2.itemid) == TRUE and chance >= 13 and chance <= 19 then -- 7 %
doCreateItem(3311, topos)
doDecayItem(item2.uid)
doPlayerSendTextMessage(cid,24,"You dug the ground and did not find nothing.")
elseif isInArray(dirt, item2.itemid) == TRUE or isInArray(grass, item2.itemid) == TRUE and chance >= 20 then
doPlayerSendTextMessage(cid,24,"You tried to dig the ground but you did not had sucess.")

doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
elseif item2.itemid == 231 and chance >= 15 then
doTransformItem(item2.uid,8323)
doDecayItem(item2.uid)
doPlayerSendTextMessage(cid,24,"You dug the sand and did not find nothing.")
elseif item2.itemid == 9059 and chance >= 15 then
doTransformItem(item2.uid,8567)
doDecayItem(item2.uid)
doPlayerSendTextMessage(cid,24,"You dug the sand and did not find nothing.")
elseif item2.itemid == 231 and chance >= 4 and chance <= 14 then -- 11%
doTransformItem(item2.uid,8323)
doDecayItem(item2.uid)
doSummonCreature("Sandcrawler", topos)
doPlayerSendTextMessage(cid,24,"You dug the sand and found a sandcrawler!")
elseif item2.itemid == 9059 and chance >= 4 and chance <= 14 then -- 11%
doTransformItem(item2.uid,8567)
doDecayItem(item2.uid)
doSummonCreature("Sandcrawler", topos)
doPlayerSendTextMessage(cid,24,"You dug the sand and found a sandcrawler!")
elseif item2.itemid == 231 and chance >= 1 and chance <= 3 then -- 3%
doTransformItem(item2.uid,8323)
doDecayItem(item2.uid)
doCreateItem(2159, topos)
doPlayerSendTextMessage(cid,24,"You dug the sand and found a scarab coin!")
elseif item2.itemid == 9059 and chance >= 1 and chance <= 3 then -- 11%
doTransformItem(item2.uid,8567)
doDecayItem(item2.uid)
doCreateItem(2159, topos)
doPlayerSendTextMessage(cid,24,"You dug the sand and found a scarab coin!")
elseif 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)
else
doPlayerSendTextMessage(cid,24,"You can not dig here.")
doDecayItem(item2.uid)
end
return 1
end



Lembre-se da linha, em:

data\actions\actions.xml


infos40x40.png

<action itemid="2554" script="tools/shovel.lua"/> <!--Shovel-->
<action itemid="5710" script="tools/shovel.lua"/> <!--Light Shovel-->

  • Segundo Passo: "Configurando os buracos"

Em:

data\items\items.xml


Troque os atributos dos itens 3311, 8323, 8567.
Deixe desta maneira:
infos40x40.png

<item id="3311" article="a" name="hole">
<attribute key="decayTo" value="0"/>
<attribute key="duration" value="120"/>
</item>
---------------------------------------------------------
<item id="8323" article="a" name="hole">
<attribute key="decayTo" value="231"/>
<attribute key="duration" value="60"/>
</item>
---------------------------------------------------------
<item id="8567" article="a" name="hole">
<attribute key="decayTo" value="9059"/>
<attribute key="duration" value="60"/>
</item>

Se não quiser seguir o passo 2 (criar e configurar buracos), simplesmente remova as linhas "doCreateItem(3311, topos)" do seu script e o player apenas irá "cavar" o solo sem criar nenhum buraco.
É isso galera! Até o próximo script... Editado por Rudkiller (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Boa @Rudkiller, mas. acho que o tópico ficaria muito mais atraente com imagens e uma formatação das letras..   Usando o negrito para destacar as coisas mais importantes, por exemplo.

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


  Mostrar conteúdo oculto

 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Link para o post
Compartilhar em outros sites

Gente, desculpa a demora pra responder (é que eu viajei no dia), mas eu estou muito agradecido de vocês terem gostado e reputado, e a pedidos de vocês atualizei o tópico e até coloquei um vídeo pra vocês verem como funciona. 

Boas férias a todos!

Editado por Rudkiller (veja o histórico de edições)
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.

  • Estatísticas dos Fóruns

    96844
    Tópicos
    519597
    Posts
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo