• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action Fishing up Monsters

where i can change how much skill need to take harder monster? can i config it in this script? Something like
with fishing lvl 10-20 i can easy catch rat/snake, with fish 20-30 i can easy catch troll BUT i still catch rat/snake

You'll have to add that part yourself.
 
Would be cool to have just wish it worked.
Tested on TFS 0.3.6 and doesn't work just shoots the error repetitively (Yes I have changed all monsters and edited it about 100 times to make it fit and same result regardless the monster selection)
Code:
[15/10/2010 11:32:12] [Error - Action Interface]
[15/10/2010 11:32:12] data/actions/scripts/tools/fishing.lua:onUse
[15/10/2010 11:32:12] Description:
[15/10/2010 11:32:12] (luaDoSummonMonster) Creature not found

Would be an amazing script to have just wish someone could make it work.
~Sin

--Updated--
Did my own script so thanks for layout!
 
Last edited:
title pretty much says it all. im not sure if this works but someone might like it or be able to use it. pretty easy to edit to your needs.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = true
}

local monsters = {"Quara Hydromancer", "Quara Constrictor", "Quara Mantassin", "Quara Pincher", "Quara Predator", "Serpent Spawn", "Wyrm", "Sea Serpent", "Titan Goddess of Water"}

    if(not isInArray(config.waterIds, itemEx.itemid)) then
        return false
    end

    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and itemEx.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
        if getPlayerLevel(cid) >= 5000 and getPlayerSkillLevel(cid, SKILL_FISHING) >= 100 then
            randsummon = math.random(0,9)
        elseif getPlayerLevel(cid) >= 5000 then
            randsummon = math.random(0,8)
        elseif getPlayerLevel(cid) >= 3000 then
            randsummon = math.random(0,6)
        elseif getPlayerLevel(cid) >= 1500 then
            randsummon = math.random(0,4)
        elseif getPlayerLevel(cid) >= 500 then
            randsummon = math.random(0,2)
        else
            doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        end

        if randsummon == 0 then
            doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        else
            doSummonMonster(monsters[randsummon], getCreaturePosition(cid))
            doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        end
    end

    doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
    return true
end
mmm not working when i fish nothing appear only the effect on water and there weren't any monsters summoned and only required 1 sqm not more
tfs 0.3.6
 
I didn't test this, can someone confirm if it works?
Code:
local c = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = getConfigValue("rateSkill"),
    useWorms = true,
    wormId = 10943
}

local monsters = {
    "Quara Hydromancer",
    "Quara Constrictor",
    "Quara Mantassin",
    "Quara Pincher",
    "Quara Predator",
    "Serpent Spawn",
    "Wyrm",
    "Sea Serpent",
    "Titan Goddess of Water"
    }

local player = {
    level = 0,
    skill = 0,
    multiplier = 2, -- this is your base multiplier, do not edit
    noFishTile = 493 -- this is the water tile you can't get fish from
}

local minLevels = {
    500,
    1500,
    3000,
    5000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isInArray(c.waterIds, itemEx.itemid) then
        return false
    end

    player.level = getPlayerLevel(cid)
    player.skill = getPlayerSkill(cid, SKILL_FISHING)

    if c.useWorms then
        if getPlayerItemCount(cid, c.wormId) < 1 then
            doPlayerSendCancel(cid, "You do not have enough worms to fish.")
            return false
        end
    end

    if not getTileInfo(getCreaturePosition(cid)).protection and itemEx.itemid ~= player.noFishTile then
        if player.level >= minLevels[#minLevels] and player.skill > 99 then
            randsummon = math.random(1, (player.multiplier * #minLevels) + 1)
        else
            for i = 1, (#minLevels - 1) do
                if player.level >= minLevels[i]  then
                    randsummon = math.random(1, player.multiplier * i)
                end
            end
        end
        doSummonMonster(monsters[randsummon], getCreaturePosition(cid))
        doPlayerAddSkillTry(cid, SKILL_FISHING, c.rateSkill)
        doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
        doPlayerRemoveItem(cid, c.wormId, 1)
    else
        doPlayerSendCancel(cid, "You cannot fish here.")
        return false
    end
    return true
end
 
Last edited:
It doesn't work because of randsummon, it's never defines for starters, second it is assigned a number, but that number is in no way connected at all to the table with the monster list
 
It doesn't work because of randsummon, it's never defines for starters, second it is assigned a number, but that number is in no way connected at all to the table with the monster list
Don't just bitch about it... fix it
 
Don't just bitch about it... fix it
:)

I suck at math breed, can't really tell what number you get, but it looks like yours should work excellently. So I shall just wait for response to see if it worked for players, since I don't have an environment to test it on anyways... I like to test everything I do, it's part of the fun, seeing it work in action....
 
Last edited:
Actually after thinking about it, yeah I was right, the same problem exists. The problem is that you guys are passing the "key" or "index" of the monsters, but we have the monsters names, and keys that's it right? Well for doSummonMonster() wouldn't we need the cid? So we would need to add the cid's to the table or use a function to get the cid from the name, or maybe we can use the monsters name for that function? I don't know, not familiar with the older distro's but yeah that's the problem...

I think that's the problem, anyone else wanna take a look at the script and correct me if I am wrong?

Shoutout to some scripting pro's, @Limos @Ninja @Summ @andu @forgee what do you guys think? Am I completely off here, or does breed's script work for anyone, someone else chime in with feedback anytime you feel like it...
 
I don't see anything wrong in @Breed's script. The correlation between the number of entries in monsters and minLevel and player.multiplier is quite clever, but could be hard for the average user to maintain if he wanted to change the monsters around.

I would have maybe done something like this:
Code:
local c = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = getConfigValue("rateSkill"),
    bossLevel = 300, -- min level to catch a "boss"
    bossSkill = 90, -- min skill to catch a "boss"
    useWorms = true,
    wormId = 10943,
    noFishTile = 493 -- this is the water tile you can't get fish from
}

local monsters = {
    -- [minLevel] = {"monster", "names", "for", "level"}
    [100] = {"Quara Hydromancer", "Quara Constrictor", "Quara Mantassin"},
    [150] = {"Quara Pincher", "Quara Predator"},
    [200] = {"Serpent Spawn", "Wyrm"},
    [300] = {"Sea Serpent"},
}

local bosses = {
    -- Monsters that can only be caught with "max" level and skill
    "Titan Goddess of Water",
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isInArray(c.waterIds, itemEx.itemid) then
        return false
    end

    if c.useWorms then
        if getPlayerItemCount(cid, c.wormId) < 1 then
            doPlayerSendCancel(cid, "You do not have enough worms to fish.")
            return false
        end
    end

    if not getTileInfo(getCreaturePosition(cid)).protection and itemEx.itemid ~= c.noFishTile then
        local level = getPlayerLevel(cid)
        local skill = getPlayerSkill(cid, SKILL_FISHING)
        local tmpMonsters = {}
        for minLevel, data in ipairs(monsters) do
            if level >= minLevel then
                for i = 1, #data do
                    table.insert(tmpMonsters, data[i])
                end
            else
                break
            end
        end
        if level >= c.bossLevel and skill >= c.bossSkill then
            for i = 1, #bosses do
                table.insert(tmpMonsters, bosses[i])
            end
        end
        doSummonMonster(tmpMonsters[math.random(1, #tmpMonsters)], getCreaturePosition(cid))
        doPlayerAddSkillTry(cid, SKILL_FISHING, c.rateSkill)
        doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
        doPlayerRemoveItem(cid, c.wormId, 1)
    else
        doPlayerSendCancel(cid, "You cannot fish here.")
        return false
    end
    return true
end
I'm also not familiar with the older distros so I have no idea if it will work. Move on to TFS 1.x people! :D
 
I didn't test this, can someone confirm if it works?
Code:
local c = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = getConfigValue("rateSkill"),
    useWorms = true,
    wormId = 10943
}

local monsters = {
    "Quara Hydromancer",
    "Quara Constrictor",
    "Quara Mantassin",
    "Quara Pincher",
    "Quara Predator",
    "Serpent Spawn",
    "Wyrm",
    "Sea Serpent",
    "Titan Goddess of Water"
    }

local player = {
    level = 0,
    skill = 0,
    multiplier = 2, -- this is your base multiplier, do not edit
    noFishTile = 493 -- this is the water tile you can't get fish from
}

local minLevels = {
    500,
    1500,
    3000,
    5000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isInArray(c.waterIds, itemEx.itemid) then
        return false
    end

    player.level = getPlayerLevel(cid)
    player.skill = getPlayerSkill(cid, SKILL_FISHING)

    if c.useWorms then
        if getPlayerItemCount(cid, c.wormId) < 1 then
            doPlayerSendCancel(cid, "You do not have enough worms to fish.")
            return false
        end
    end

    if not getTileInfo(getCreaturePosition(cid)).protection and itemEx.itemid ~= player.noFishTile then
        if player.level >= minLevels[#minLevels] and player.skill > 99 then
            randsummon = math.random(1, (player.multiplier * #minLevels) + 1)
        else
            for i = 1, (#minLevels - 1) do
                if player.level >= minLevels[i]  then
                    randsummon = math.random(1, player.multiplier * i)
                end
            end
        end
        doSummonMonster(monsters[randsummon], getCreaturePosition(cid))
        doPlayerAddSkillTry(cid, SKILL_FISHING, c.rateSkill)
        doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
        doPlayerRemoveItem(cid, c.wormId, 1)
    else
        doPlayerSendCancel(cid, "You cannot fish here.")
        return false
    end
    return true
end
I don't see anything wrong in @Breed's script. The correlation between the number of entries in monsters and minLevel and player.multiplier is quite clever, but could be hard for the average user to maintain if he wanted to change the monsters around.

I would have maybe done something like this:
Code:
local c = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = getConfigValue("rateSkill"),
    bossLevel = 300, -- min level to catch a "boss"
    bossSkill = 90, -- min skill to catch a "boss"
    useWorms = true,
    wormId = 10943,
    noFishTile = 493 -- this is the water tile you can't get fish from
}

local monsters = {
    -- [minLevel] = {"monster", "names", "for", "level"}
    [100] = {"Quara Hydromancer", "Quara Constrictor", "Quara Mantassin"},
    [150] = {"Quara Pincher", "Quara Predator"},
    [200] = {"Serpent Spawn", "Wyrm"},
    [300] = {"Sea Serpent"},
}

local bosses = {
    -- Monsters that can only be caught with "max" level and skill
    "Titan Goddess of Water",
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isInArray(c.waterIds, itemEx.itemid) then
        return false
    end

    if c.useWorms then
        if getPlayerItemCount(cid, c.wormId) < 1 then
            doPlayerSendCancel(cid, "You do not have enough worms to fish.")
            return false
        end
    end

    if not getTileInfo(getCreaturePosition(cid)).protection and itemEx.itemid ~= c.noFishTile then
        local level = getPlayerLevel(cid)
        local skill = getPlayerSkill(cid, SKILL_FISHING)
        local tmpMonsters = {}
        for minLevel, data in ipairs(monsters) do
            if level >= minLevel then
                for i = 1, #data do
                    table.insert(tmpMonsters, data[i])
                end
            else
                break
            end
        end
        if level >= c.bossLevel and skill >= c.bossSkill then
            for i = 1, #bosses do
                table.insert(tmpMonsters, bosses[i])
            end
        end
        doSummonMonster(tmpMonsters[math.random(1, #tmpMonsters)], getCreaturePosition(cid))
        doPlayerAddSkillTry(cid, SKILL_FISHING, c.rateSkill)
        doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
        doPlayerRemoveItem(cid, c.wormId, 1)
    else
        doPlayerSendCancel(cid, "You cannot fish here.")
        return false
    end
    return true
end
I'm also not familiar with the older distros so I have no idea if it will work. Move on to TFS 1.x people! :D
It doesn't work because of randsummon, it's never defines for starters, second it is assigned a number, but that number is in no way connected at all to the table with the monster list
its not working ,there is error with it :p
Code:
[31/01/2015 01:13:33] [Error - Action Interface]
[31/01/2015 01:13:33] data/actions/scripts/tools/mechanical_fishing2.lua:onUse
[31/01/2015 01:13:33] Description:
[31/01/2015 01:13:33] data/actions/scripts/tools/mechanical_fishing2.lua:54: bad argument #2 to 'random' (interval is empty)
[31/01/2015 01:13:33] stack traceback:
[31/01/2015 01:13:33]     [C]: in function 'random'
[31/01/2015 01:13:33]     data/actions/scripts/tools/mechanical_fishing2.lua:54: in function <data/actions/scripts/tools/mechanical_fishing2.lua:24>
 
its not working ,there is error with it :p
Code:
[31/01/2015 01:13:33] [Error - Action Interface]
[31/01/2015 01:13:33] data/actions/scripts/tools/mechanical_fishing2.lua:onUse
[31/01/2015 01:13:33] Description:
[31/01/2015 01:13:33] data/actions/scripts/tools/mechanical_fishing2.lua:54: bad argument #2 to 'random' (interval is empty)
[31/01/2015 01:13:33] stack traceback:
[31/01/2015 01:13:33]     [C]: in function 'random'
[31/01/2015 01:13:33]     data/actions/scripts/tools/mechanical_fishing2.lua:54: in function <data/actions/scripts/tools/mechanical_fishing2.lua:24>
Replace
Code:
doSummonMonster(tmpMonsters[math.random(1, #tmpMonsters)], getCreaturePosition(cid))
With
Code:
if #tmpMonsters > 0 then
    doSummonMonster(tmpMonsters[math.random(1, #tmpMonsters)], getCreaturePosition(cid))
end
Sorry if I made any typos as I'm writing this on my phone.
 
Sorry if I made any typos as I'm writing this on my phone.
No one is perfect :p

I don't see anything wrong in @Breed's script. The correlation between the number of entries in monsters and minLevel and player.multiplier is quite clever, but could be hard for the average user to maintain if he wanted to change the monsters around.
I knew there was going to be an issue with adding monster & I am glad you caught that but I was living in the moment :)
 
Replace
Code:
doSummonMonster(tmpMonsters[math.random(1, #tmpMonsters)], getCreaturePosition(cid))
With
Code:
if #tmpMonsters > 0 then
    doSummonMonster(tmpMonsters[math.random(1, #tmpMonsters)], getCreaturePosition(cid))
end
Sorry if I made any typos as I'm writing this on my phone.
there are 2 problems Now :D its working but there aren't any monsters caught from sea and my fishing skill is leveling too fast Oo
 
there are 2 problems Now :D its working but there aren't any monsters caught from sea and my fishing skill is leveling too fast Oo
You won't catch anything unless your level is above any of the minLevels in "monsters".
Add this at the top in monsters and you will be able to catch rat, troll and rotworm from level 10:
Code:
[10] = {"Rat", "Troll", "Rotworm"},

I have no idea how skill rate works on the old distros but getConfigValue("rateSkill") looks right to me. It should depend on the skill rate on your server. If it's really a problem you could experiment by setting c.rateSkill to a number and see if you can find a value that suits you.
 
I don't see anything wrong in @Breed's script. The correlation between the number of entries in monsters and minLevel and player.multiplier is quite clever, but could be hard for the average user to maintain if he wanted to change the monsters around.

I would have maybe done something like this:
Code:
local c = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = getConfigValue("rateSkill"),
    bossLevel = 300, -- min level to catch a "boss"
    bossSkill = 90, -- min skill to catch a "boss"
    useWorms = true,
    wormId = 10943,
    noFishTile = 493 -- this is the water tile you can't get fish from
}

local monsters = {
    -- [minLevel] = {"monster", "names", "for", "level"}
    [100] = {"Quara Hydromancer", "Quara Constrictor", "Quara Mantassin"},
    [150] = {"Quara Pincher", "Quara Predator"},
    [200] = {"Serpent Spawn", "Wyrm"},
    [300] = {"Sea Serpent"},
}

local bosses = {
    -- Monsters that can only be caught with "max" level and skill
    "Titan Goddess of Water",
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isInArray(c.waterIds, itemEx.itemid) then
        return false
    end

    if c.useWorms then
        if getPlayerItemCount(cid, c.wormId) < 1 then
            doPlayerSendCancel(cid, "You do not have enough worms to fish.")
            return false
        end
    end

    if not getTileInfo(getCreaturePosition(cid)).protection and itemEx.itemid ~= c.noFishTile then
        local level = getPlayerLevel(cid)
        local skill = getPlayerSkill(cid, SKILL_FISHING)
        local tmpMonsters = {}
        for minLevel, data in ipairs(monsters) do
            if level >= minLevel then
                for i = 1, #data do
                    table.insert(tmpMonsters, data[i])
                end
            else
                break
            end
        end
        if level >= c.bossLevel and skill >= c.bossSkill then
            for i = 1, #bosses do
                table.insert(tmpMonsters, bosses[i])
            end
        end
        doSummonMonster(tmpMonsters[math.random(1, #tmpMonsters)], getCreaturePosition(cid))
        doPlayerAddSkillTry(cid, SKILL_FISHING, c.rateSkill)
        doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
        doPlayerRemoveItem(cid, c.wormId, 1)
    else
        doPlayerSendCancel(cid, "You cannot fish here.")
        return false
    end
    return true
end
I'm also not familiar with the older distros so I have no idea if it will work. Move on to TFS 1.x people! :D

Why don't you post a "New Release" for TFS 1.X? I Believe pretty much everyone would use it right away. :)
We're waiting for ya. :rolleyes:

Kind Regards,
Eldin.
 
Last edited:
Back
Top