Ir para conteúdo
Entre para seguir isso  
Baxnie

Mineração

Recommended Posts

Baxnie    8
Baxnie

Nome do Sistema: Mining

Nome do Autor: Baxnie

Servidor Testado: OpenTibia last SVN - 8.52

Script de mineração.

Para usar, pegue uma pick e utilize em uma das pedras que está na variavel mining.

Para adicionar novas pedras, é só adicionar na variável mining.

Estrutura da variável mining:

{ pedraQueVamosUtilizarAPick, pedraQuePodeSerExtraida1, chanceDeSerExtraida1, pedraQuePodeSerExtraida2, chanceDeSerExtraida2, ... }

A chance é de 1 em X.

mining.lua

-- Mining script by Baxnie - 17/10/2009
-- Structure: {stone, ore1Id, ore1Chance, ore2Id, ore2Chance, ...}
-- Chance is 1 in X

local mining = {{8633, 2146, 10}, -- Blue Large Crystal, Small Sapphire, 10
               {8634, 2150, 10}, -- Light Blue Large Crystal, Small Amethyst, 10
               {8635, 2147, 10}, -- Red Large Crystal, Small Ruby, 10
               {8636, 2149, 10}, -- Green Large Crystal, Small Emerald, 10
               {8637, 2146, 10}, -- Blue Crystal, Small Sapphire, 10
               {8638, 2150, 10}, -- Light Blue Crystal, Small Amethyst, 10
               {8639, 2147, 10}, -- Red Crystal, Small Ruby, 10
               {8640, 2149, 10}, -- Green Crystal, Small Emerald, 10
               {1290, 5880, 10, 2145, 30}} -- Stone, Iron Ore, 10, Small Diamond, 30

function onUse(cid, item, frompos, item2, topos)
   for i = 1, #mining do
       if(item2.itemid == mining[i][1]) then
           local j = 2
           while j <= #mining[i] do
               if(math.random(1, mining[i][j+1]) == 1) then
                   doPlayerAddItem(cid, mining[i][j], 1)
                   doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)
               end
               j = j + 2
           end
           doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
           return TRUE
       end
   end
end

actions.xml

[color=Black][color=#000000][color=#007700]<[/color][color=#0000bb]action itemid[/color][color=#007700]=[/color][color=#dd0000]"2553" [/color][color=#0000bb]script[/color][color=#007700]=[/color][color=#dd0000]"mining.lua"[/color][color=#007700]/>[/color][/color][/color]

Editado por Baxnie

Compartilhar este post


Link para o post
Gpwjhlkdcf    21
Gpwjhlkdcf

Tópico Aprovado e Movido para Scripting > Scripts Prontos > Actions.

 

Padrão de Qualidade: OK

 

Muito bom. Apesar de haver vários desse tipo, este ficou curto e funcional. :)

Compartilhar este post


Link para o post
xkarolapt    0
xkarolapt

Funfa no 8.50???

Compartilhar este post


Link para o post
Kakaher    1
Kakaher

Alguem pode me explicar como que eu faço pra mudar a chance ?

Obrigado ;D

Compartilhar este post


Link para o post
Kydrai    0
Kydrai

@UP

{8634, 2150, 10}

Significa: {pedraQueVamosUtilizarAPick, pedraQuePodeSerExtraida1, chanceDeSerExtraida1}

 

Ou seja, vc muda o 10, quanto menor este mais chances de acerto.

Editado por Kydrai

Compartilhar este post


Link para o post
Kakaher    1
Kakaher

Consegui, valeu mano, brigadao ;D

Editado por Kakaher

Compartilhar este post


Link para o post
Proviem    0
Proviem

bem bom so q eu quero sabe oq esse script faz se pude me responde hj mesmo te agradeço e se n pude tambem te agradeço

 

-- Mining V2.6

-- Please understand this is more of a bug fix release

-- Coded by Roman, some credits to twiz for giving an example of his V1.0

function onUse(cid, item, frompos, item2, topos)

Level = getPlayerLevel(cid)

AxeSkill = getPlayerSkill(cid,1)

if item2.actionid == 387 and -- set the action id of rocks

Level >= 10 -- set the level requirement to be able to mine

and

AxeSkill >= 10 -- set the axe skill requirement to be able to mine

then

rand = math.random(1,2000)

if rand < 20 then

doPlayerSendTextMessage(cid,22,"A stone golem came out of the pile of rocks!")

doSummonCreature("Stone Golem", topos)

elseif rand == 1300 then

doPlayerSendTextMessage(cid,22,"You have found a golden nugget.")

doPlayerAddItem(cid,2157,1)

elseif rand > 1995 then

doPlayerSendTextMessage(cid,22,"You have found a diamond.")

doPlayerAddItem(cid,2145,1)

elseif rand >500 and rand <800 then

doPlayerAddItem(cid,2148,7)

elseif rand >700 and rand <1000 then

doPlayerAddItem(cid,2148,6)

elseif rand >1000 and rand <1300 then

doPlayerAddItem(cid,2148,4)

elseif rand >300 and rand <600 then

doPlayerAddItem(cid,2148,5)

elseif rand >1500 and rand <1800 then

doPlayerAddItem(cid,2148,3)

elseif rand >1100 and rand <1400 then

doPlayerAddItem(cid,2148,8)

elseif rand >800 and rand <1100 then

doPlayerAddHealth(cid,-20)

doPlayerSendTextMessage(cid,22,"You lost hitpoints due to exhaustion of mining.")

elseif rand >500 and rand <800 then

doPlayerSendTextMessage(cid,22,"You have found a ruby.")

doPlayerAddItem(cid,2147,1)

elseif rand >550 and rand <800 then

doPlayerSendTextMessage(cid,22,"A fierce dwarf came out of the pile of rocks!")

doSummonCreature("Dwarf", topos)

elseif rand == 40 then

doPlayerSendTextMessage(cid,22,"A fierce dwarf guard came out of the pile of rocks!")

doSummonCreature("Dwarf Guard", topos)

elseif rand == 20 then

doPlayerSendTextMessage(cid,22,"A weak troll has appeared from the pile of rocks!")

doSummonCreature("Troll", topos)

elseif rand >2000 then

doPlayerSendTextMessage(cid,22,"Earthquake!")

doPlayerAddHealth(cid,-100)

elseif rand == 100 and rand <140 then

doPlayerSendTextMessage(cid,22,"A weak troll has appeared from the pile of rocks!")

doSummonCreature("Troll", topos)

elseif rand == 200 then

doPlayerSendTextMessage(cid,22,"A dwarf soldier came out of the pile of rocks!")

doSummonCreature("Dwarf Soldier", topos)

elseif rand >= 105 and rand <150 then

end

doSendMagicEffect(topos,3)

doPlayerAddSkillTry(cid,1,0)

doPlayerSay(cid,"Mining!",1)

else

doPlayerSendCancel(cid,"Voce nao esta minando no lugar certo ou nao tem level minimo 10.")

end

return 1

end

Compartilhar este post


Link para o post
Dark Yoshiki    0
Dark Yoshiki

#Proviem

Pelo q intendi...

Esse script é de minerar conforme o seu axe skill e seu level

Você pode cavar um monstro ou causar um terremoto se tiver azar, e se tiver sorte pode vir uma pedra preciosa.

Espero ter ajudado :D

#All

Curti o script,

curtinho :D

Editado por Dark Yoshiki

Compartilhar este post


Link para o post
Proviem    0
Proviem

vlw so q minera onde? ali esplica em q pedra é pra minera?

Compartilhar este post


Link para o post
Dark Yoshiki    0
Dark Yoshiki

Sei lah to sem o id dos itens aki

Compartilhar este post


Link para o post
Zaffend    0
Zaffend

Apesar de eu não ter compreendido bem a explicação, eu sei q foi das melhores intenções voce ajudar. Boa Sorte ae :D

 

_____________________________________________________________

assignr.png

Compartilhar este post


Link para o post
Proviem    0
Proviem

mas qual é o id do item ?

pra minerar

Compartilhar este post


Link para o post
morvy    0
morvy

Mano, vlw ajudo eu d+ agora eu juntei este ai, com refinamento, ta mto massa o sistema q eu fiz, vc usa a pic numa pedra, ai da uma porcentagem de chance de vim ou iron ore, ou iron of smithing (item q eu inventei), ai vc tem q usar o hammer of smithing em uma armaduta, ai gasta iron of smithing, nossa q perfeito q ficou.

Compartilhar este post


Link para o post
god guizao    0
god guizao

Boa, funfo aki certinho :P

Compartilhar este post


Link para o post
ViniciusLelis    0
ViniciusLelis

Fico daora mano, Boa Imaginação :D

Compartilhar este post


Link para o post
yuyan_17    0
yuyan_17

ake n pego, e aqui eh stylle tibia 8.50....

oke fis de errado?

 

aki:

-- Mining script by Baxnie - 17/10/2009

-- Structure: {stone, ore1Id, ore1Chance, ore2Id, ore2Chance, ...}

-- Chance is 1 in X

 

local mining = {{8633, 8306, 11}}, -- Blue cave Crystal, pure energy, 11

 

function onUse(cid, item, frompos, item2, topos)

for i = 1, #mining do

if(item2.itemid == mining[1]) then

local j = 2

while j <= #mining do

if(math.random(1, mining[j+1]) == 1) then

doPlayerAddItem(cid, mining[j], 1)

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)

end

j = j + 2

end

doSendMagicEffect(topos, CONST_ME_BLOCKHIT)

return TRUE

end

end

end

Compartilhar este post


Link para o post
thays123    0
thays123

Aprovadoooo

 

 

Coloquei em meu OTserv!!! Um dos Topicos que eu mais Gostei foi o teu Parabens

Compartilhar este post


Link para o post
Demoniac Maker    0
Demoniac Maker

Esse Sistema é bem legal pow. Isso deveria ter até no GLOBAL

Compartilhar este post


Link para o post
Pandá s2    0
Pandá s2

Ficou bem legal e Criativo vou por em meu OTSERV

 

e tou esperando pelo sistemas de : Padeiro, Lenhador, Aquimista, Sapateiro, Alfaiate

Compartilhar este post


Link para o post
alemao96    0
alemao96

Script melhor que os outros do genero,obrigado por ajudar cara!

Compartilhar este post


Link para o post
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×