Ir para conteúdo

Featured Replies

Postado

Salve rapazeada do TK, preciso de um script de pesca simples, onde o player usa a vara na água, aumenta o fishing e tem a chance de pescar um peixe, como meu servidor é 7.4, não precisa de worms pra pescar, procurei por esse script no fórum porém não encontrei, se houver algum por favor me mande o link e peço desculpas!!

  • Respostas 10
  • Visualizações 722
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Anderson Sacani
    Anderson Sacani

    local config = { rate = 10, -- Speed at which the skill will progress cooldown = 2, -- Time in seconds of character exhaustion } function onUse(cid, item, frompos, item2, topos) local wat

  • funcionou certinho, obrigado! rep+

Postado
-- By GriZzm0

function onUse(cid, item, frompos, item2, topos)
	-- 490 fish
	-- 491 no fish 
	-- 492 fish regeneration
	if (item2.itemid == 490) then
		fishingskill = getPlayerSkill(cid,6)
		formula = fishingskill / 200 + 0.85 * math.random()
		if formula > 0.70 then
			doTransformItem(item2.uid, 492)
			doDecayItem(item2.uid)
			doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, 2)
			doPlayerAddItem(cid, 2667, 1)
		else
			doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, 1)
		end
		
		doSendMagicEffect(topos, CONST_ME_LOSEENERGY)

	elseif (item2.itemid == 491 or item2.itemid == 492) then
		doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
	end
	
	return true
end

 

Editado por Anderson Sacani (veja o histórico de edições)

Postado
  • Autor
  Em 20/02/2023 em 19:51, Anderson Sacani disse:

-- By GriZzm0

function onUse(cid, item, frompos, item2, topos)
	-- 490 fish
	-- 491 no fish 
	-- 492 fish regeneration
	if (item2.itemid == 490) then
		fishingskill = getPlayerSkill(cid,6)
		formula = fishingskill / 200 + 0.85 * math.random()
		if formula > 0.70 then
			doTransformItem(item2.uid, 492)
			doDecayItem(item2.uid)
			doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, 2)
			doPlayerAddItem(cid, 2667, 1)
		else
			doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, 1)
		end
		
		doSendMagicEffect(topos, CONST_ME_LOSEENERGY)

	elseif (item2.itemid == 491 or item2.itemid == 492) then
		doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
	end
	
	return true
end

 

não deu certo, meu script para pesca é esse:

 

Mostrar conteúdo oculto

 

O fishing skill sobe normalmente, o único problema é que não pesca nenhum peixe.

 

Postado

Criei minha própria versão, testa e me retorna:

local rateSkill = 10

function onUse(cid, item, frompos, item2, topos)
    if item2.itemid ~= 490 then
        return false
    end

    if ((math.random(1, 100000)) <= (getPlayerSkill(cid, 6) * 500)) then
        doPlayerAddItem(cid, 2667, 1)
    end

    doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * rateSkill))

    return true
end

Em rateSkill tu configura a velocidade em que o skill subirá

Dei uma brincada e melhorei o script, pode usar que é sucesso:

local config = {
    rate = 10, -- Speed at which the skill will progress
    cooldown = 2, -- Time in seconds of character exhaustion
}

function onUse(cid, item, frompos, item2, topos)
    local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011
    local now = os.time()
    local check = (now - getPlayerStorageValue(cid, storage))
    if item2.itemid ~= 490 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You can only use the fishing rod in the water.")
        return true
    end

    if check < 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.")
        return true
    end

    if ((math.random(1, 100000)) <= (skill * 500)) then
        if skill > 50 then
            amount = math.random(1, ((skill / 10) - 3))
        end
        doPlayerAddItem(cid, 2667, amount)
        if amount > 7 then
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!")
        end
    end

    doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate))
    setPlayerStorageValue(cid, storage, (now + config.cooldown))

    return true
end

 

Editado por Anderson Sacani (veja o histórico de edições)

Postado
  • Autor
  Em 20/02/2023 em 21:07, Anderson Sacani disse:

Criei minha própria versão, testa e me retorna:


local rateSkill = 10

function onUse(cid, item, frompos, item2, topos)
    if item2.itemid ~= 490 then
        return false
    end

    if ((math.random(1, 100000)) <= (getPlayerSkill(cid, 6) * 500)) then
        doPlayerAddItem(cid, 2667, 1)
    end

    doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * rateSkill))

    return true
end

Em rateSkill tu configura a velocidade em que o skill subirá

o script em si está tudo ok, porém só da pra pescar em uma certa água, no meu servidor existem diversas diferentes, como eu poderia adaptar ali no ID 490 para aceitar todos os IDS de água?

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