• 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!

Lua TFS 1.3 Fishing Monsters

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
549
Solutions
1
Reaction score
58
Location
Lo Mochis, Sinaloa
I am looking for a system to fish and catch monsters, in water and lava; I have seen one that fishes in water, lava and swamp, and I thought it was great, I tried to install it but I think it was not compliant with tfs 1.3, if anyone could help me.
 
Solution
S
Lua:
local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825, 4608, 4609, 4610, 4611, 4612, 4613, 7236}
local lava = {598, 599, 600, 601, 9883}
local swamp = {4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4752}

local water_monsters = {
    [1] = {name = "Jaul", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Jaul!", broadcastToServer = true},
    [2] = {name = "Tanjis", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Tanjis!", broadcastToServer = true},
    [3] = {name = "Moohtant", chance = 0, fishing = 10, level = 200000...
You belong to a cartel?
w1.png
v-video-games-thread-graphic-transparent-library-pepe-monkas-11562935256csj3mncowv.png
 
Lua:
local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825, 4608, 4609, 4610, 4611, 4612, 4613, 7236}
local lava = {598, 599, 600, 601, 9883}
local swamp = {4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4752}

local water_monsters = {
    [1] = {name = "Jaul", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Jaul!", broadcastToServer = true},
    [2] = {name = "Tanjis", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Tanjis!", broadcastToServer = true},
    [3] = {name = "Moohtant", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Raging Mage!", broadcastToServer = false}
}

local lava_monsters = {
    [1] = {name = "Jaul", chance = 35000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Jaul!", broadcastToServer = false},
    [2] = {name = "Tanjis", chance = 35000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Deepling Spellsinger!", broadcastToServer = false},
    [3] = {name = "Deepling Spellsinger", chance = 15000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Deepling Spellsinger!", broadcastToServer = true}
}

local swap_monsters = {
    [1] = {name = "rat", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Raging Mage!", broadcastToServer = false}
}

local chance = 500000

local catchFishStorage = 15000 --This is used to so players can turn catching regular fish off or on.
local chanceCatchNormalFish = 70 --20% chance to catch normal fish
local chanceCatchNorthernPike = 70 --10% chance to catch northerpike
local fishId = 2667 -- Item id of normal fish
local NorthernPikeId = 2669 -- Item id of northern pike
exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) + 1))
   
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
        if player:getCondition(CONDITION_EXHAUST_HEAL) then
            return player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        end
       
    if Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
        return player:sendCancelMessage("You may not fish from protection zone.")
    end
  if not Tile(player:getPosition()):getItemById(12698) then
        return player:sendCancelMessage("You can't fish monsters outside fishing island, it's too dangerous for newbies.")
  end
    if not isInArray(waters, target.itemid) and not isInArray(lava, target.itemid) and not isInArray(swamp, target.itemid) then
        return false
    end
 
    local tmp_table = {}
 
    if isInArray(waters, target.itemid) then
        tmp_table = water_monsters
        toPosition:sendMagicEffect(CONST_ME_LOSEENERGY)
    elseif isInArray(lava, target.itemid) then
        tmp_table = lava_monsters
        toPosition:sendMagicEffect(CONST_ME_HITBYFIRE)
    elseif isInArray(swamp, target.itemid) then
        tmp_table = swap_monsters
        toPosition:sendMagicEffect(9)
    end
 
    for i = 1, #tmp_table do
        if (player:getLevel() >= tmp_table[i].level and player:getSkillLevel(SKILL_FISHING) >= tmp_table[i].fishing) then
            local catchChance = math.random(1, chance)
         
            if catchChance <= tmp_table[i].chance then
                local MONS = Game.createMonster(tmp_table[i].name, player:getPosition())
             
                if MONS then
                    if tmp_table[i].broadcastToServer then
                        local text = string.gsub(tmp_table[i].msg, "|PLAYERNAME|", player:getName())
                        Game.broadcastMessage(text)
                    end
                end
            break
            end
        end
    end
 
    if isInArray(waters, target.itemid) then
        if player:getStorageValue(catchFishStorage) == 1 then
            if math.random(1, 100) <= chanceCatchNormalFish then
                player:addItem(fishId, 1, true)
            else
                if math.random(1, 100) <= chanceCatchNorthernPike then
                    player:addItem(northernPikeId, 1, true)
                end
            end
        end
    end
    player:addSkillTries(SKILL_FISHING, 1)
    player:addCondition(exhaust)
return true
end
 
Last edited by a moderator:
Solution

no
Post automatically merged:

Lua:
local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825, 4608, 4609, 4610, 4611, 4612, 4613, 7236}
local lava = {598, 599, 600, 601, 9883}
local swamp = {4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4752}

local water_monsters = {
    [1] = {name = "Jaul", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Jaul!", broadcastToServer = true},
    [2] = {name = "Tanjis", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Tanjis!", broadcastToServer = true},
    [3] = {name = "Moohtant", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Raging Mage!", broadcastToServer = false}
}

local lava_monsters = {
    [1] = {name = "Jaul", chance = 35000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Jaul!", broadcastToServer = false},
    [2] = {name = "Tanjis", chance = 35000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Deepling Spellsinger!", broadcastToServer = false},
    [3] = {name = "Deepling Spellsinger", chance = 15000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Deepling Spellsinger!", broadcastToServer = true}
}

local swap_monsters = {
    [1] = {name = "rat", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Raging Mage!", broadcastToServer = false}
}

local chance = 500000

local catchFishStorage = 15000 --This is used to so players can turn catching regular fish off or on.
local chanceCatchNormalFish = 70 --20% chance to catch normal fish
local chanceCatchNorthernPike = 70 --10% chance to catch northerpike
local fishId = 2667 -- Item id of normal fish
local NorthernPikeId = 2669 -- Item id of northern pike
exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) + 1))
   
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
        if player:getCondition(CONDITION_EXHAUST_HEAL) then
            return player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        end
       
    if Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
        return player:sendCancelMessage("You may not fish from protection zone.")
    end
  if not Tile(player:getPosition()):getItemById(12698) then
        return player:sendCancelMessage("You can't fish monsters outside fishing island, it's too dangerous for newbies.")
  end
    if not isInArray(waters, target.itemid) and not isInArray(lava, target.itemid) and not isInArray(swamp, target.itemid) then
        return false
    end
 
    local tmp_table = {}
 
    if isInArray(waters, target.itemid) then
        tmp_table = water_monsters
        toPosition:sendMagicEffect(CONST_ME_LOSEENERGY)
    elseif isInArray(lava, target.itemid) then
        tmp_table = lava_monsters
        toPosition:sendMagicEffect(CONST_ME_HITBYFIRE)
    elseif isInArray(swamp, target.itemid) then
        tmp_table = swap_monsters
        toPosition:sendMagicEffect(9)
    end
 
    for i = 1, #tmp_table do
        if (player:getLevel() >= tmp_table[i].level and player:getSkillLevel(SKILL_FISHING) >= tmp_table[i].fishing) or player:getRebirth() >= 1 then
            local catchChance = math.random(1, chance)
         
            if catchChance <= tmp_table[i].chance then
                local MONS = Game.createMonster(tmp_table[i].name, player:getPosition())
             
                if MONS then
                    if tmp_table[i].broadcastToServer then
                        local text = string.gsub(tmp_table[i].msg, "|PLAYERNAME|", player:getName())
                        Game.broadcastMessage(text)
                    end
                end
            break
            end
        end
    end
 
    if isInArray(waters, target.itemid) then
        if player:getStorageValue(catchFishStorage) == 1 then
            if math.random(1, 100) <= chanceCatchNormalFish then
                player:addItem(fishId, 1, true)
            else
                if math.random(1, 100) <= chanceCatchNorthernPike then
                    player:addItem(northernPikeId, 1, true)
                end
            end
        end
    end
    player:addSkillTries(SKILL_FISHING, 1)
    player:addCondition(exhaust)
return true
end

1595284527116.png

I have that error
 
Last edited:
if you paid close attention at the beginning of the script the config is already clear
Lua:
local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825, 4608, 4609, 4610, 4611, 4612, 4613, 7236}
local lava = {598, 599, 600, 601, 9883}
local swamp = {4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4752}

local water_monsters = { -- water fishing monsters chance to fish and fishing level needed and level and message if broadcast is opened
    [1] = {name = "Jaul", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Jaul!", broadcastToServer = true},
    [2] = {name = "Tanjis", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Tanjis!", broadcastToServer = true},
    [3] = {name = "Moohtant", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Raging Mage!", broadcastToServer = false}
}

local lava_monsters = { -- the same but fishing monsters in lava
    [1] = {name = "Jaul", chance = 35000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Jaul!", broadcastToServer = false},
    [2] = {name = "Tanjis", chance = 35000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Deepling Spellsinger!", broadcastToServer = false},
    [3] = {name = "Deepling Spellsinger", chance = 15000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Deepling Spellsinger!", broadcastToServer = true}
}
i wrote you guidelines hope it helps
local swap_monsters = { -- same fishing in swamp
    [1] = {name = "rat", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Raging Mage!", broadcastToServer = false}
}
 
if you paid close attention at the beginning of the script the config is already clear
Lua:
local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825, 4608, 4609, 4610, 4611, 4612, 4613, 7236}
local lava = {598, 599, 600, 601, 9883}
local swamp = {4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4752}

local water_monsters = { -- water fishing monsters chance to fish and fishing level needed and level and message if broadcast is opened
    [1] = {name = "Jaul", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Jaul!", broadcastToServer = true},
    [2] = {name = "Tanjis", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Tanjis!", broadcastToServer = true},
    [3] = {name = "Moohtant", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Raging Mage!", broadcastToServer = false}
}

local lava_monsters = { -- the same but fishing monsters in lava
    [1] = {name = "Jaul", chance = 35000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Jaul!", broadcastToServer = false},
    [2] = {name = "Tanjis", chance = 35000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Deepling Spellsinger!", broadcastToServer = false},
    [3] = {name = "Deepling Spellsinger", chance = 15000, fishing = 10, level = 100000, msg = "|PLAYERNAME| has caught a Deepling Spellsinger!", broadcastToServer = true}
}
i wrote you guidelines hope it helps
local swap_monsters = { -- same fishing in swamp
    [1] = {name = "rat", chance = 0, fishing = 10, level = 200000, msg = "|PLAYERNAME| has caught Raging Mage!", broadcastToServer = false}
}

nevermind, i figured out xD

when you edit
Lua:
local chance = 10000

You can customized the catch chance of the every monster

Thank you very much, it will be very useful
 
I have just added to the code, 'tries' which means that only when you catch you get tries included in table. Also I have added to the catchChance calculation a boost from your fishing skill, this means the higher the fishing level, you have a higher chance to catch.
This is the script:
Lua:
local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825, 4608, 4609, 4610, 4611, 4612, 4613, 7236}
local lava = {598, 599, 600, 601, 9883}
local swamp = {4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4752}

local water_monsters = {
    [1] = {name = "Fish", chance = 75000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a tortoise!", broadcastToServer = false},
    [2] = {name = "Tortoise", chance = 50000, fishing = 10, level = 15, tries = 2, msg = "|PLAYERNAME| has caught a tortoise!", broadcastToServer = false},
    [3] = {name = "Thornback Tortoise", chance = 35000, fishing = 10, level = 20, tries = 3, msg = "|PLAYERNAME| has caught a thornback tortoise!", broadcastToServer = false},
    [4] = {name = "Shark", chance = 25000, fishing = 10, level = 10, tries = 5, msg = "|PLAYERNAME| has caught a sea serpent!", broadcastToServer = false},
    [5] = {name = "Northern Pike", chance = 15000, fishing = 10, level = 10, tries = 3, msg = "|PLAYERNAME| has caught a sea serpent!", broadcastToServer = false},
    [6] = {name = "Manta Ray", chance = 15000, fishing = 10, level = 20, tries = 3, msg = "|PLAYERNAME| has caught a sea serpent!", broadcastToServer = false}
}

local lava_monsters = {
    [1] = {name = "Fire Elemental", chance = 35000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a fire elemental!", broadcastToServer = false},
    [2] = {name = "Fire Devil", chance = 35000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a fire devil!", broadcastToServer = false},
    [3] = {name = "Dragon Lord", chance = 15000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a dragon lord!", broadcastToServer = false}
}

local swap_monsters = {
    [1] = {name = "rat", chance = 100000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a rat!", broadcastToServer = false}
}

local chance = 500000

local catchFishStorage = 15000 --This is used to so players can turn catching regular fish off or on.
local chanceCatchNormalFish = 70 --20% chance to catch normal fish
local chanceCatchNorthernPike = 70 --10% chance to catch northerpike
local fishId = 2667 -- Item id of normal fish
local NorthernPikeId = 2669 -- Item id of northern pike
exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) + 1))
  
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
        if player:getCondition(CONDITION_EXHAUST_HEAL) then
            return player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        end
      
    if Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
        return player:sendCancelMessage("You may not fish from protection zone.")
    end
    if not isInArray(waters, target.itemid) and not isInArray(lava, target.itemid) and not isInArray(swamp, target.itemid) then
        return false
    end
 
    local tmp_table = {}
 
    if isInArray(waters, target.itemid) then
        tmp_table = water_monsters
        toPosition:sendMagicEffect(CONST_ME_LOSEENERGY)
    elseif isInArray(lava, target.itemid) then
        tmp_table = lava_monsters
        toPosition:sendMagicEffect(CONST_ME_HITBYFIRE)
    elseif isInArray(swamp, target.itemid) then
        tmp_table = swap_monsters
        toPosition:sendMagicEffect(9)
    end
 
    for i = 1, #tmp_table do
        if (player:getLevel() >= tmp_table[i].level and player:getSkillLevel(SKILL_FISHING) >= tmp_table[i].fishing) then
            local catchChance = math.random(1, chance)
        local fishSkill = player:getSkillLevel(SKILL_FISHING)       
            if catchChance <= (tmp_table[i].chance + ((fishSkill - 10)* 1000)) then
                local MONS = Game.createMonster(tmp_table[i].name, player:getPosition())
        player:addSkillTries(SKILL_FISHING, tmp_table[i].tries)             
                if MONS then
                    if tmp_table[i].broadcastToServer then
                        local text = string.gsub(tmp_table[i].msg, "|PLAYERNAME|", player:getName())
                        Game.broadcastMessage(text)
                    end
                end
            break
            end
        end
    end
 
    if isInArray(waters, target.itemid) then
        if player:getStorageValue(catchFishStorage) == 1 then
            if math.random(1, 100) <= chanceCatchNormalFish then
                player:addItem(fishId, 1, true)
            else
                if math.random(1, 100) <= chanceCatchNorthernPike then
                    player:addItem(northernPikeId, 1, true)
                end
            end
        end
    end

    player:addCondition(exhaust)
return true
end
 
I have just added to the code, 'tries' which means that only when you catch you get tries included in table. Also I have added to the catchChance calculation a boost from your fishing skill, this means the higher the fishing level, you have a higher chance to catch.
This is the script:
Lua:
local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825, 4608, 4609, 4610, 4611, 4612, 4613, 7236}
local lava = {598, 599, 600, 601, 9883}
local swamp = {4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4752}

local water_monsters = {
    [1] = {name = "Fish", chance = 75000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a tortoise!", broadcastToServer = false},
    [2] = {name = "Tortoise", chance = 50000, fishing = 10, level = 15, tries = 2, msg = "|PLAYERNAME| has caught a tortoise!", broadcastToServer = false},
    [3] = {name = "Thornback Tortoise", chance = 35000, fishing = 10, level = 20, tries = 3, msg = "|PLAYERNAME| has caught a thornback tortoise!", broadcastToServer = false},
    [4] = {name = "Shark", chance = 25000, fishing = 10, level = 10, tries = 5, msg = "|PLAYERNAME| has caught a sea serpent!", broadcastToServer = false},
    [5] = {name = "Northern Pike", chance = 15000, fishing = 10, level = 10, tries = 3, msg = "|PLAYERNAME| has caught a sea serpent!", broadcastToServer = false},
    [6] = {name = "Manta Ray", chance = 15000, fishing = 10, level = 20, tries = 3, msg = "|PLAYERNAME| has caught a sea serpent!", broadcastToServer = false}
}

local lava_monsters = {
    [1] = {name = "Fire Elemental", chance = 35000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a fire elemental!", broadcastToServer = false},
    [2] = {name = "Fire Devil", chance = 35000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a fire devil!", broadcastToServer = false},
    [3] = {name = "Dragon Lord", chance = 15000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a dragon lord!", broadcastToServer = false}
}

local swap_monsters = {
    [1] = {name = "rat", chance = 100000, fishing = 10, level = 10, tries = 1, msg = "|PLAYERNAME| has caught a rat!", broadcastToServer = false}
}

local chance = 500000

local catchFishStorage = 15000 --This is used to so players can turn catching regular fish off or on.
local chanceCatchNormalFish = 70 --20% chance to catch normal fish
local chanceCatchNorthernPike = 70 --10% chance to catch northerpike
local fishId = 2667 -- Item id of normal fish
local NorthernPikeId = 2669 -- Item id of northern pike
exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) + 1))
 
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
        if player:getCondition(CONDITION_EXHAUST_HEAL) then
            return player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        end
   
    if Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
        return player:sendCancelMessage("You may not fish from protection zone.")
    end
    if not isInArray(waters, target.itemid) and not isInArray(lava, target.itemid) and not isInArray(swamp, target.itemid) then
        return false
    end
 
    local tmp_table = {}
 
    if isInArray(waters, target.itemid) then
        tmp_table = water_monsters
        toPosition:sendMagicEffect(CONST_ME_LOSEENERGY)
    elseif isInArray(lava, target.itemid) then
        tmp_table = lava_monsters
        toPosition:sendMagicEffect(CONST_ME_HITBYFIRE)
    elseif isInArray(swamp, target.itemid) then
        tmp_table = swap_monsters
        toPosition:sendMagicEffect(9)
    end
 
    for i = 1, #tmp_table do
        if (player:getLevel() >= tmp_table[i].level and player:getSkillLevel(SKILL_FISHING) >= tmp_table[i].fishing) then
            local catchChance = math.random(1, chance)
        local fishSkill = player:getSkillLevel(SKILL_FISHING)    
            if catchChance <= (tmp_table[i].chance + ((fishSkill - 10)* 1000)) then
                local MONS = Game.createMonster(tmp_table[i].name, player:getPosition())
        player:addSkillTries(SKILL_FISHING, tmp_table[i].tries)          
                if MONS then
                    if tmp_table[i].broadcastToServer then
                        local text = string.gsub(tmp_table[i].msg, "|PLAYERNAME|", player:getName())
                        Game.broadcastMessage(text)
                    end
                end
            break
            end
        end
    end
 
    if isInArray(waters, target.itemid) then
        if player:getStorageValue(catchFishStorage) == 1 then
            if math.random(1, 100) <= chanceCatchNormalFish then
                player:addItem(fishId, 1, true)
            else
                if math.random(1, 100) <= chanceCatchNorthernPike then
                    player:addItem(northernPikeId, 1, true)
                end
            end
        end
    end

    player:addCondition(exhaust)
return true
end

Hi, thanks for the script. This is an old thread and I don't wish to bump it, but I wonder how does tries, level, and fishing param works on this one? If someone can explain me it, so I can configure and start using it. I have no idea what does that params do. Thanks in advance!

Edit/
I've found this one, and worked perfectly for me
 
Last edited:
Hi, thanks for the script. This is an old thread and I don't wish to bump it, but I wonder how does tries, level, and fishing param works on this one? If someone can explain me it, so I can configure and start using it. I have no idea what does that params do. Thanks in advance!
Tries are how much experience you get for successfully fishing.
Level and Fishing is minimum level required to randomly spawn creatures while using the fishing rod. (player level, fishing level)


Minor Note:
The chance system here is slightly broken, as the script will try to spawn creatures near the top of the list first..
And since you can only fish 1 monster, the subsequent chances of monsters lower in the list will be artificially lowered.
 
Back
Top