Ir para conteúdo

Featured Replies

Postado

Eaew galera do TK venho aqui pedir algo simple ou dificil (kkk)...

Tem como por storage junto com a msg > voce nao completou a quest pra poder pescar

e level tambem junto com a msg> voce nao tem level 130 pra pescar

 

A script é essa... desde ja muito obrigado!

Citar

local waterIDs = {10077}
local config = {
    
    {level = {10,math.huge}, fishes = {2695, 6541, 6542, 6543, 6544, 6545}, maxFish = 9, chance = 5},
    {level = {10,150}, fishes = {2160}, maxFish = 9, chance = 25},
    {level = {10,150}, fishes = {2152}, maxFish = 13, chance = 95}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isInArray(waterIDs, itemEx.itemid) then
        doSendMagicEffect(toPosition, 1)
        local random = math.random(1, 100)
        for _, fishing in pairs(config) do
            if random <= fishing.chance then
                if getPlayerSkillLevel(cid, 6) >= fishing.level[1] and getPlayerSkillLevel(cid, 6) <= fishing.level[2] then
                    doPlayerAddItem(cid, fishing.fishes[math.random(1, #fishing.fishes)], math.random(1, fishing.maxFish))
                    doPlayerAddSkillTry(cid, 6, 6)
                    doSendMagicEffect(toPosition, 53)
                    break
                end
            else
                doSendMagicEffect(toPosition, 1) 
                doPlayerAddSkillTry(cid, 2, 1)
            end
        end
doSendAnimatedText(getPlayerPosition(cid), "PESCA!", math.random(1,255))
    else
        doPlayerSendTextMessage(cid, 19, "Só é permitido pescar nos Roda-Moinhos!")
    end
    return true
end

 

Resolvido por Dwarfer

Ir para solução
Postado
  • Solução
Spoiler

local storage = 11111 -- storage necessário
local level = 130 

local waterIDs = {10077}
local config = {
    
    {level = {10,math.huge}, fishes = {2695, 6541, 6542, 6543, 6544, 6545}, maxFish = 9, chance = 5},
    {level = {10,150}, fishes = {2160}, maxFish = 9, chance = 25},
    {level = {10,150}, fishes = {2152}, maxFish = 13, chance = 95}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isInArray(waterIDs, itemEx.itemid) then
        if getPlayerStorageValue(cid, storage) == -1 then
            doPlayerSendTextMessage(cid, 19, "Você não completou a quest para pescar.")
            return true
        end
        if getPlayerLevel(cid) < level then
            doPlayerSendTextMessage(cid, 19, "Você não tem level "..level.." para pescar.")
            return true
        end
        doSendMagicEffect(toPosition, 1)
        local random = math.random(1, 100)
        for _, fishing in pairs(config) do
            if random <= fishing.chance then
                if getPlayerSkillLevel(cid, 6) >= fishing.level[1] and getPlayerSkillLevel(cid, 6) <= fishing.level[2] then
                    doPlayerAddItem(cid, fishing.fishes[math.random(1, #fishing.fishes)], math.random(1, fishing.maxFish))
                    doPlayerAddSkillTry(cid, 6, 6)
                    doSendMagicEffect(toPosition, 53)
                    break
                end
            else
                doSendMagicEffect(toPosition, 1) 
                doPlayerAddSkillTry(cid, 2, 1)
            end
        end
    doSendAnimatedText(getPlayerPosition(cid), "PESCA!", math.random(1,255))
    else
        doPlayerSendTextMessage(cid, 19, "Só é permitido pescar nos Roda-Moinhos!")
    end
    return true
end

 

 

Contato:

 

Postado
  • Autor

funcionou obrigado.

Mas agora estou com problema na quest kk

Postado
2 horas atrás, Joaoafp disse:

funcionou obrigado.

Mas agora estou com problema na quest kk

Basta você colocar a storage da quest aqui nesta parte do script

local storage = 11111 <-- aqui você coloca storage da questa que tem que fazer para que o jogador possa pescar.

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo