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

[Nostalrius] Fishing Rod Script

Azleh

Well-Known Member
Joined
Mar 2, 2009
Messages
435
Solutions
5
Reaction score
57
Location
Underworld
As the title says, this is an edited fishing rod script for Nostalrius distro, it has the chance to summon monsters and items with the cipsoft chance (1 of 100k).

Java:
local WORMID = 3492 -- Nost: 3492
local fishableThings = {
    [1] = {
        thingId = 3032, -- Small Emerald
        chance = 5,
        monster = false,
    },
    [2] = {
        thingId = 3030, -- Small Ruby
        chance = 5,
        monster = false,
    },
    [3] = {
        thingId = "Rat",
        chance = 10,
        monster = true,
    },
    [4] = {
        thingId = 3029, -- Small Saph
        chance = 5,
        monster = false,
    },
    [5] = {
        thingId = 3028, -- Small Diamond
        chance = 5,
        monster = false,
    },
    [6] = {
        thingId = 3027, -- Black Pearl
        chance = 3,
        monster = false,
    },
    [7] = {
        thingId = 2874, -- Fluid
        chance = 5,
        monster = false,
    },
    [8] = {
        thingId = 3578, -- Fish
        chance = 15,
        monster = false,
    },
}

local water = {
    4597, 4598, 4599, 4600, 4601, 4602,
    4609, 4610, 4611, 4612, 4613, 4614,
    4615, 4616, 4617, 4618, 4619, 4620,
    622
}

local fishableWater = {
    4597, 4598, 4599, 4600, 4601, 4602
}

function Player.fishRandom(self, fRepeat)
    local fMonster = false
    
    for i = 1, #fishableThings do
        local chanceRandom = math.random(1, 100000)
        if (chanceRandom < (fishableThings[i].chance * 1000)) then
            if fishableThings[i].monster then
                fMonster = true
            end
                
            fRepeat = false
            self:finishFishing(fMonster, fishableThings[i].thingId)
            break
        end
    end
    
    if fRepeat then
        self:fishRandom(true)
    end
return true
end

function Player.finishFishing(self, fMonster, resultingId)   
    if fMonster then
        Game.createMonster(resultingId, self:getPosition())
    else
        self:addItem(resultingId, 1)
    end
return true
end

function onUse(player, item, fromPosition, target, toPosition)
    if not target:isItem() then
        return false
    end
    
    if not table.contains(water, target:getId()) then
        return false
    end
    
    if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
        if player:getItemCount(WORMID) >= 1 then
            player:addSkillTries(SKILL_FISHING, 1)
            player:fishRandom(true)
            
            if target:getId() ~= 622 then
                target:transform(4609, 1)
            end
                
            target:decay()
            player:removeItem(WORMID, 1)
        end
    end
    
    target:getPosition():sendMagicEffect(2)
return true
end
 
As the title says, this is an edited fishing rod script for Nostalrius distro, it has the chance to summon monsters and items with the cipsoft chance (1 of 100k).

Java:
local WORMID = 3492 -- Nost: 3492
local fishableThings = {
    [1] = {
        thingId = 3032, -- Small Emerald
        chance = 5,
        monster = false,
    },
    [2] = {
        thingId = 3030, -- Small Ruby
        chance = 5,
        monster = false,
    },
    [3] = {
        thingId = "Rat",
        chance = 10,
        monster = true,
    },
    [4] = {
        thingId = 3029, -- Small Saph
        chance = 5,
        monster = false,
    },
    [5] = {
        thingId = 3028, -- Small Diamond
        chance = 5,
        monster = false,
    },
    [6] = {
        thingId = 3027, -- Black Pearl
        chance = 3,
        monster = false,
    },
    [7] = {
        thingId = 2874, -- Fluid
        chance = 5,
        monster = false,
    },
    [8] = {
        thingId = 3578, -- Fish
        chance = 15,
        monster = false,
    },
}

local water = {
    4597, 4598, 4599, 4600, 4601, 4602,
    4609, 4610, 4611, 4612, 4613, 4614,
    4615, 4616, 4617, 4618, 4619, 4620,
    622
}

local fishableWater = {
    4597, 4598, 4599, 4600, 4601, 4602
}

function Player.fishRandom(self, fRepeat)
    local fMonster = false
   
    for i = 1, #fishableThings do
        local chanceRandom = math.random(1, 100000)
        if (chanceRandom < (fishableThings[i].chance * 1000)) then
            if fishableThings[i].monster then
                fMonster = true
            end
               
            fRepeat = false
            self:finishFishing(fMonster, fishableThings[i].thingId)
            break
        end
    end
   
    if fRepeat then
        self:fishRandom(true)
    end
return true
end

function Player.finishFishing(self, fMonster, resultingId)  
    if fMonster then
        Game.createMonster(resultingId, self:getPosition())
    else
        self:addItem(resultingId, 1)
    end
return true
end

function onUse(player, item, fromPosition, target, toPosition)
    if not target:isItem() then
        return false
    end
   
    if not table.contains(water, target:getId()) then
        return false
    end
   
    if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
        if player:getItemCount(WORMID) >= 1 then
            player:addSkillTries(SKILL_FISHING, 1)
            player:fishRandom(true)
           
            if target:getId() ~= 622 then
                target:transform(4609, 1)
            end
               
            target:decay()
            player:removeItem(WORMID, 1)
        end
    end
   
    target:getPosition():sendMagicEffect(2)
return true
end
work on 0.4?
 
As the title says, this is an edited fishing rod script for Nostalrius distro, it has the chance to summon monsters and items with the cipsoft chance (1 of 100k).

Java:
local WORMID = 3492 -- Nost: 3492
local fishableThings = {
    [1] = {
        thingId = 3032, -- Small Emerald
        chance = 5,
        monster = false,
    },
    [2] = {
        thingId = 3030, -- Small Ruby
        chance = 5,
        monster = false,
    },
    [3] = {
        thingId = "Rat",
        chance = 10,
        monster = true,
    },
    [4] = {
        thingId = 3029, -- Small Saph
        chance = 5,
        monster = false,
    },
    [5] = {
        thingId = 3028, -- Small Diamond
        chance = 5,
        monster = false,
    },
    [6] = {
        thingId = 3027, -- Black Pearl
        chance = 3,
        monster = false,
    },
    [7] = {
        thingId = 2874, -- Fluid
        chance = 5,
        monster = false,
    },
    [8] = {
        thingId = 3578, -- Fish
        chance = 15,
        monster = false,
    },
}

local water = {
    4597, 4598, 4599, 4600, 4601, 4602,
    4609, 4610, 4611, 4612, 4613, 4614,
    4615, 4616, 4617, 4618, 4619, 4620,
    622
}

local fishableWater = {
    4597, 4598, 4599, 4600, 4601, 4602
}

function Player.fishRandom(self, fRepeat)
    local fMonster = false
   
    for i = 1, #fishableThings do
        local chanceRandom = math.random(1, 100000)
        if (chanceRandom < (fishableThings[i].chance * 1000)) then
            if fishableThings[i].monster then
                fMonster = true
            end
               
            fRepeat = false
            self:finishFishing(fMonster, fishableThings[i].thingId)
            break
        end
    end
   
    if fRepeat then
        self:fishRandom(true)
    end
return true
end

function Player.finishFishing(self, fMonster, resultingId)  
    if fMonster then
        Game.createMonster(resultingId, self:getPosition())
    else
        self:addItem(resultingId, 1)
    end
return true
end

function onUse(player, item, fromPosition, target, toPosition)
    if not target:isItem() then
        return false
    end
   
    if not table.contains(water, target:getId()) then
        return false
    end
   
    if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
        if player:getItemCount(WORMID) >= 1 then
            player:addSkillTries(SKILL_FISHING, 1)
            player:fishRandom(true)
           
            if target:getId() ~= 622 then
                target:transform(4609, 1)
            end
               
            target:decay()
            player:removeItem(WORMID, 1)
        end
    end
   
    target:getPosition():sendMagicEffect(2)
return true
end

NICE! thank you very much.
 
Teach me where I should specifically put this script please, and to edit which items have a chance to come, just change there in the script the ones you already have, small ruby, rat, small emerald etc?
 
Back
Top