Ir para conteúdo
Entre para seguir isso  
Kemix

[8.0+]Mining System com skill

Recommended Posts

Kemix    3
Kemix

Nome: Mining System

Versão: A partir da 8.10

Tipo do script: Action

Servidor Testado: Thyrania 0.2.81 XML

Autor: Kemix / Exausted by Alreth

 

Criei alguns sitemas com skill a algum tempo, não estava muito organizado então eu arrumei e descide postar aki um deles pra quem quiser.

 

Modo de uso: Com uma pick em sua mão direita,de use nela e click no piso com id especificado no script.Desse modo,upando skill de mining,ira ficar cada ve mais facil encoontrar algo.

Para mais informações dêem uma olhada no script.

 

miningbykemix.lua

----Mining System made by Kemix------

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

 

local grounds = {351, 352, 353, 354, 355} --- Id dos pisos possiveis de minerar

local pedras = {1294, 2157, 2145, 2146, 2147, 2148, 2149, 2150, 2177} --- Id das pedras mineradas(em ordem crescente de dificuldade)

local dificuldade = 10 ---------- Skill hate (quanto maior mais dificil de passar)

local time = 1 ------------- Tempo de exausted

 

local num = 123456 -- se ja estiver em uso mude

local skill = 159159 -- se ja estiver em uso mude

local storageValue = 35981 -- se ja estiver em uso mude

 

local skillchance = 1000 - getPlayerStorageValue(cid, skill)*8

local random = math.random(1, skillchance)

local random2 = math.random(100,200)

local random3 = math.random(110,200)

local random4 = math.random(120,200)

local store = getPlayerStorageValue(cid, skill)

local formula = store * store * dificuldade

 

 

----Script------

 

if getPlayerStorageValue(cid, skill) == -1 then

setPlayerStorageValue(cid, skill, 1)

end

if getPlayerStorageValue(cid, num) == -1 then

setPlayerStorageValue(cid, num, 1)

end

if getPlayerStorageValue(cid, skill) == 0 then

setPlayerStorageValue(cid, skill, 1)

end

if getPlayerStorageValue(cid, num) == 0 then

setPlayerStorageValue(cid, num, 1)

end

 

 

if getPlayerSlotItem(cid, 6).itemid == 2553 then

if (isInArray(grounds, item2.itemid) == TRUE) then

if (exhaust(cid, storageValue, time) == 1) then

 

--====----==== Pocibilidades Ruins ====----====--

 

if random == random2 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddHealth(cid,-40)

doSendMagicEffect(getPlayerPosition(cid), DRAWBLOOD)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você perdeu 40 hitpoints.')

 

elseif random == random3 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddHealth(cid,-60)

doSendMagicEffect(getPlayerPosition(cid), DRAWBLOOD)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você perdeu 60 hitpoints.')

 

elseif random == random4 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerRemoveItem(cid, item.itemid, 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você perdeu sua pick!!.')

end

 

--====----==== Pocibilidades Boas ====----====--

 

if random > 0 and random < 2 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddItem(cid, pedras[9], 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você achou um ' .. getItemName(pedras[9]) .. '!!.')

 

elseif random > 0 and random < 11 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddItem(cid, pedras[8], 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você achou um ' .. getItemName(pedras[8]) .. '!!.')

 

elseif random > 0 and random < 21 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddItem(cid, pedras[7], 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você achou um ' .. getItemName(pedras[7]) .. '!!.')

 

elseif random > 0 and random < 31 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddItem(cid, pedras[6], 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você achou um ' .. getItemName(pedras[6]) .. '!!.')

 

elseif random > 0 and random < 41 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddItem(cid, pedras[5], 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você achou um ' .. getItemName(pedras[5]) .. '!!.')

 

elseif random > 0 and random < 51 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddItem(cid, pedras[4], 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você achou um ' .. getItemName(pedras[4]) .. '!!.')

 

elseif random > 0 and random < 61 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddItem(cid, pedras[3], 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você achou um ' .. getItemName(pedras[3]) .. '!!.')

 

elseif random > 0 and random < 71 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddItem(cid, pedras[2], 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você achou um ' .. getItemName(pedras[2]) .. '!!.')

 

elseif random > 0 and random < 81 then

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

doPlayerAddItem(cid, pedras[1], 1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você achou um ' .. getItemName(pedras[1]) .. '!!.')

else

setPlayerStorageValue(cid, num,getPlayerStorageValue(cid, num)+1)

end

doSendMagicEffect(topos, CONST_ME_BLOCKHIT)

else

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Voce esta exausto.')

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

end

else

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Nao eh pocivel minerar nesse piso.')

end

else

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'A pick tem que estar na mao direita.')

end

 

--====----==== Skills ====----====--

 

if getPlayerStorageValue(cid, num) == formula then

setPlayerStorageValue(cid, skill,store+1)

doPlayerSendTextMessage(cid,22,"You advanced in mining ("..store..").")

 

end

end

 

--====----==== Skills Fim ====----====--

 

 

 

 

 

-- Exhaustion system Made by Alreth

function exhaust(cid, storeValue, exhaustTime)

exhaustMsg = "You are exhausted."

 

newExhaust = os.time()

oldExhaust = getPlayerStorageValue(cid, storeValue)

if (oldExhaust == nil or oldExhaust < 0) then

oldExhaust = 0

end

if (exhaustTime == nil or exhaustTime < 0) then

exhaustTime = 5

end

diffTime = os.difftime(newExhaust, oldExhaust)

if (diffTime >= exhaustTime) then

setPlayerStorageValue(cid, storeValue, newExhaust)

return 1

else

return 0

end

end

 

Adicione isso no actions.xml

<action itemid="2553" script="miningbykemix.lua" />

 

 

Beijus i aproveitem! :lol:

:style::bye:

Compartilhar este post


Link para o post
Dark    3
Dark

Aprovado

Compartilhar este post


Link para o post
º°kReXt°º    0
º°kReXt°º

OOooOoOOwww

 

 

vlw ai ta massa!

 

mas vc podia bota os ids do xao especificado, e tal pros menos experientes saberem ao certo!

 

vlw!

Compartilhar este post


Link para o post
Jonny249    0
Jonny249

Er man... o script está bom mais.... normalmente botamos aonde o script fica mesmo sendo um download que a pessoa apenas pega, pois muitos nao experientes nao sabem onde ficam.

Bem só pra informar os iniciantes:

Va na pasta actions/scripts, copie e cole qualquer arquivo lua. Abra essa cópia e bote o script que o kemix deu. Depois renomeie esse arquivo para "miningbykemix". SEM AS ASPAS!

Agora va na pasta actions e edite o actions.xml.

Copie e cole essa tag:

<action itemid="2553" script="miningbykemix.lua" />

pronto, o script está instalado.

 

Kemix, da proxima vez de a "instalação" do script, vai ser melhor :D, pois o script está muito bom! Aé, organize seu tópico de um jeito melhor ok?

falous

By Jonny~

Compartilhar este post


Link para o post
wilsonic10    0
wilsonic10

rx rox

Compartilhar este post


Link para o post
Wolowizard    0
Wolowizard

Otimo Script :]

Compartilhar este post


Link para o post
Zeephiroth    42
Zeephiroth

Ótimo, vai pro meu projeto ;*

//Ybridus

Compartilhar este post


Link para o post
megaman    0
megaman

Coloquei em meu ot...

Correu tudo certo e os player adorarao =)

Compartilhar este post


Link para o post
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×