Ir para conteúdo

[Ajuda] Mining System


peckets

Posts Recomendados

Versão : 8.7 ~ 8.71

Server : Azeroth 1.0

 

 

Olá Xtibianos...

 

Venho Aqui Pedir uma pequenina ajuda... colocar para mostra quantas pedras faltas pra upa pro proximo level talz pq tipo eu tenho um system de mining que ele quebra as pedras talz um monte talz ai nao da pra ve quantas falta pra upa proximo nivel de mining é do nv 0 ao 250 estou no nv 7 no GOD meu ... mas demorei pra upar queria saber como faz para ver quantas pedras talz precisa querbrar o script da mining é essa :

 

 

local configs = {

sign = {{level = {0,15}, quant = {1,2}, percent = 30},

{level = {16,30}, quant = {2,4}, percent = 40},

{level = {31,45}, quant = {2,6}, percent = 45},

{level = {46,60}, quant = {3,7}, percent = 50},

{level = {61,100}, quant = {3,8}, percent = 55},

{level = {101,150}, quant = {4,10}, percent = 60},

{level = {250}, quant = {10,20}, percent = 65}},

stones = {11537},

gold = {{2157, 'all'}},

stone_delay = 30,

MaxLevel = 250

}

--END Configs--

function onUse(cid, item, fromPosition, itemEx, toPosition, onUse)

local STORAGE_SKILL_LEVEL = 20000

local STORAGE_SKILL_TRY = 20001

local skillLevel = getPlayerStorageValue(cid,STORAGE_SKILL_LEVEL)

local skillTry = getPlayerStorageValue(cid,STORAGE_SKILL_TRY)

local objeto2 = getThingFromPos(toPosition)

local player = getCreaturePosition(cid)

 

if skillLevel == -1 then

setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,1)

end

for Q = 1, #configs.sign do

if configs.sign[Q].level[2] == nil then

configs.sign[Q].level[2] = configs.sign[Q].level[1]

end

if skillLevel >= configs.sign[Q].level[1] and skillLevel <= configs.sign[Q].level[2] then

quant = math.random(configs.sign[Q].quant[1],configs.sign[Q].quant[2])

percent = configs.sign[Q].percent

break

end

end

for i = 1, #configs.stones do

if objeto2.itemid == configs.stones then

if math.random(20,100) <= percent then

possible_gold = {{},{}}

for h = 1, #configs.gold do

if configs.gold[h][2] == objeto2.itemid then

possible_gold[1][#possible_gold[1]+1] = configs.gold[h][1]

else

if configs.gold[h][2] == 'all' then

possible_gold[2][#possible_gold[2]+1] = configs.gold[h][1]

end

end

end

if possible_gold[1][1] == nil and possible_gold[2][1] == nil then

doPlayerSendTextMessage(cid,22,"Isso não pode ser extraido do minerio.")

elseif possible_gold[1][1] ~= nil then

doPlayerAddItem(cid,possible_gold[1][math.random(1,#possible_gold[1])],quant)

elseif possible_gold[1][1] == nil and possible_gold[2][1] ~= nil then

doPlayerAddItem(cid,possible_gold[2][math.random(1,#possible_gold[2])],quant)

end

if possible_gold[1][1] ~= nil or possible_gold[2][1] ~= nil then

if skillTry >= 0 then

setPlayerStorageValue(cid,STORAGE_SKILL_TRY,skillTry + 1)

else

setPlayerStorageValue(cid,STORAGE_SKILL_TRY,1)

end

doSendMagicEffect(getCreaturePosition(cid), 12)

doPlayerSendTextMessage(cid,22,"Você pegou "..quant.." Gold Darkden do "..getItemNameById(objeto2.itemid)..".")

doSendAnimatedText(getCreaturePosition(cid), 'Sucesso ! '..quant..'', 168, cid)

setItemName(objeto2.uid, ''..getItemNameById(objeto2.itemid))

doSendMagicEffect(toPosition, 3)

addEvent(dostoneReturn,configs.stone_delay * 1000,toPosition,objeto2.itemid)

doTransformItem(objeto2.uid, 11535)

doTransformItem(objeto2.uid, 11536)

break

end

else

doPlayerSendCancel(cid,"Não Há Gold Darkden.")

doSendMagicEffect(toPosition, 3)

setItemName(objeto2.uid, ' '..getItemNameById(objeto2.itemid))

doSendAnimatedText(getCreaturePosition(cid), 'Falhou!', 180, cid)

addEvent(dostoneReturn,configs.stone_delay * 1000,toPosition,objeto2.itemid)

doTransformItem(objeto2.uid, 11535)

doTransformItem(objeto2.uid, 11536)

break

end

else

doPlayerSendCancel(cid,"So Pode Minerio.")

end

end

if skillTry >= ((skillLevel+1)*3) then

if skillLevel == configs.MaxLevel then

doPlayerSendTextMessage(cid, 22, "Você Está No Maximo De Level De Mine Darkden.")

setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0)

else

setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,skillLevel + 1)

setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0)

doPlayerSendTextMessage(cid, 22, "Você Upou Do Level ".. skillLevel .." para o Level ".. skillLevel + 1 .." De Mine Darkden.")

doSendMagicEffect(getCreaturePosition(cid),14)

doSendAnimatedText(getCreaturePosition(cid), 'Mine Up!', 18, cid)

end

end

end

 

function dostoneReturn(itemposition,oldid)

local pos = getThingfromPos(itemposition)

doTransformItem(pos.uid,oldid)

setItemName(pos.uid, getItemNameById(oldid))

doSendMagicEffect(itemposition,math.random(28,30))

end

 

 

:arrow: REP MAIS PRA QUEM AJUDAR !!!!!!!!!!!!

 

Flw xTibianos :greenperson: :hi:

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...