DE
pedido scripts

[Resolvido] SCRIPT FISHING OT/EXAUST

Por Denver, 13 de mar. de 2018 em Resolvidos

4
1.8k
DenverD
13 de março de 2018 às 11:50

Boa tarde

 

 

Eu tenho um OT que tem um sistema de pescar, eu uso esse abaixo porém se eu fico dando use na agua ele pesca muito rapido, eu queria um exaust de por exemplo, uma bolinha na agua por segundo

 

 

Tipo, dar um USE por segundo entende?

 

image.png.0ed270f70542dc36ca7c35fe409c096c.png

 

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000
local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}
function onUse(cid, item, frompos, item2, topos)
    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end
QwizerQ
13 de março de 2018 às 12:39
Melhor resposta
local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local segundos = 60
local storage = 123456
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000
local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, storage) <= os.time() then
	setPlayerStorageValue(cid, storage, os.time() + segundos)
    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
	
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
else
doPlayerSendCancel(cid, "You're exhausted.")
end	
    return true
end

 

Editado Março 13 por Qwizer

DenverD
13 de março de 2018 às 14:05

Resolvido.

1 mês depois...
StigalS
21 de abril de 2018 às 02:39
O pedido neste tópico de foi atendido e/ou o autor do tópico resolveu sua duvida. Este tópico está fechado e foi movido para Pedidos - Resolvidos. Se você tiver outros pedidos, crie um novo tópico.