[SDT] Killua Fishing System - Pesca diferente

Killua
Por Killua
em Actions e Talkactions

Killua

Vivendo e Aprendendo
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 29/04/09Posts: 904Char no Tibia: Jabuti Selvagem

Olá a todos, hoje é terça, portanto venho trazer mais um script. Esse é bem simples, mas é legal... Fiz ele baseando-me em um pedido: http://www.xtibia.com/forum/topic/229539-sistema-de-pesca-de-itens/#entry1619129. Para ver os outros scripts de terça, clique aqui.

O que ele faz? É um simples sistema de pesca (com efeitos bem legais), onde se pode configurar tudo a seu gosto. Quando se usa a vara na água aparece um efeito, espera-se um tempo (3 segundos) e começam a aparecer vários efeitos na água. Nesse momento, você pode ou não conseguir um peixe.

Para instalar, crie Killua Fishing System.lua em data/actions/scripts e coloque:


local waterIDs = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
local config = {
    {level = {10,19}, fishes = {2667}, maxFish = 1, chance = 50}, -- {level = {Do level, Até o level}, fishes = {id dos peixes que podem vir}, maxFish = quantidade máxima de peixes que podem vir, chance = chance em %
    {level = {20,29}, fishes = {2667, 2669}, maxFish = 2, chance = 60},
    {level = {30,39}, fishes = {2667, 2669}, maxFish = 3, chance = 70},
    {level = {40,49}, fishes = {2667, 2669, 2668}, maxFish = 4, chance = 80},
    {level = {50,59}, fishes = {2667, 2669, 2668}, maxFish = 5, chance = 80},
    {level = {60,69}, fishes = {2667, 2669, 2668, 2670}, maxFish = 6, chance = 80},
    {level = {70,79}, fishes = {2667, 2669, 2668, 2670, 2160}, maxFish = 6, chance = 80},
    {level = {80,math.huge}, fishes = {2667, 2669, 2668, 2670, 2160, 2157}, maxFish = 7, chance = 90}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local worms = math.random(1, 5)
    if getPlayerStorageValue(cid, 381921) < os.time() then
        if isInArray(waterIDs, itemEx.itemid) then
            if getPlayerItemCount(cid, 3976) >= worms then
                doPlayerRemoveItem(cid, 3976, worms)
                doSendMagicEffect(toPosition, 1)
                local times = {2900, 3100, 3300, 3500, 3700, 3900, 4000}
                for i = 1, #times do
                    addEvent(doSendMagicEffect, times[i], toPosition, 1)
                end
                addEvent(function()
                    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, 25) 
                            doPlayerAddSkillTry(cid, 6, 1)
                        end
                    end
                end, 4000)
                doPlayerSetStorageValue(cid, 381921, os.time() + 5)
            else
                doPlayerSendCancel(cid, "Voce precisa de mais minhocas!")
            end
        else
            doPlayerSendCancel(cid, "Voce nao pode pescar aqui")
        end
    else
        doPlayerSendCancel(cid, "Sua isca ainda esta na agua!")
    end
    return true
end

Em actions.xml, coloque essa tag:

<action itemid="2580" script="Killua Fishing System.lua" allowfaruse="1"/>

ATENÇAO: para evitar problemas, remova a seguinte tag do actions.xml

<action itemid="2580" event="script" value="tools/fishing.lua" allowfaruse="1"/>

Configure a tabela config a seu gosto (siga o comentário no script).

Strogman

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 04/11/12Posts: 464Gênero: MasculinoChar no Tibia: Lysty Of Death

não entendi bem ele só pesca itens de vez de monstro?

 

                                 logo_full_1600.png.f8d0c5d8ba71c660bad630b327c3e64d.png

                                                              htps://www.facebook.com/PokemonOnlineSVKE

                                                                                                                       PokeSvke

180319mu

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/12/09Posts: 31Char no Tibia: Noope

Killua, eu tava precisando de um script de fishing e o seu é o que chegou mais perto doque eu preciso, mas ainda tem algumas coisas que eu queria mudar, como: não usar worms (iscas) e que fosse um fishing normal, que não precisasse esperar os 3 segundos e que pescasse os seguintes items: 6541 - 6542 - 6543 - 6544 - 6545 e tal, teria como você modificar ele desse jeito pra mim? não tenho a menor ideia de como se faz isso :(

Killua

Vivendo e Aprendendo
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 29/04/09Posts: 904Char no Tibia: Jabuti Selvagem

Ele pesca somente itens


Killua, eu tava precisando de um script de fishing e o seu é o que chegou mais perto doque eu preciso, mas ainda tem algumas coisas que eu queria mudar, como: não usar worms (iscas) e que fosse um fishing normal, que não precisasse esperar os 3 segundos e tal, teria como você modificar ele desse jeito pra mim? não tenho a menor ideia de como se faz isso :(


 

 

local waterIDs = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
local config = {
    {level = {10,19}, fishes = {2667}, maxFish = 1, chance = 50}, -- {level = {Do level, Até o level}, fishes = {id dos peixes que podem vir}, maxFish = quantidade máxima de peixes que podem vir, chance = chance em %
    {level = {20,29}, fishes = {2667, 2669}, maxFish = 2, chance = 60},
    {level = {30,39}, fishes = {2667, 2669}, maxFish = 3, chance = 70},
    {level = {40,49}, fishes = {2667, 2669, 2668}, maxFish = 4, chance = 80},
    {level = {50,59}, fishes = {2667, 2669, 2668}, maxFish = 5, chance = 80},
    {level = {60,69}, fishes = {2667, 2669, 2668, 2670}, maxFish = 6, chance = 80},
    {level = {70,79}, fishes = {2667, 2669, 2668, 2670, 2160}, maxFish = 6, chance = 80},
    {level = {80,math.huge}, fishes = {2667, 2669, 2668, 2670, 2160, 2157}, maxFish = 7, chance = 90}
}

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, 25) 
                doPlayerAddSkillTry(cid, 6, 1)
            end
        end
    else
        doPlayerSendCancel(cid, "Voce nao pode pescar aqui")
    end
    return true
end

 

 

180319mu

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/12/09Posts: 31Char no Tibia: Noope

Ae, perfeito, muito obrigado já consegui modificar os items..

 

PS: pra terem uma ideia de como eu n tenho noçao dessas coisas, mechi em coisa no script por conta propria começou criar umas alavanca na agua.. rsrs