• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Fishing Script Help..

oliverpadron86

New Member
Joined
Mar 1, 2018
Messages
40
Reaction score
0
Hi everyone i'm looking for a fishing script that when u caught a monster appears a message(broadcast) like this..
Triton Has been caught by Juan!

I got this script.. Im using crying damson server 0.3.6


local config = {
waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
rateSkill = 0.25,
allowFromPz = false,
useWorms = false
}
local t = {
targetId = 0,
SpeakClasses = TALKTYPE_CHANNEL_W,
message = '',
channel = 12
}
local v = {
[{200,100}] = {name = "Water Elemental", msg="You have caught a Water Elemental!", chance = 262500, storage = 36000},
[{400,100}] = {name = "Hydros", chance = 52500, storage = 36001},
[{600,100}] = {name = "Tyria", chance = 8750, storage = 36002},
[{1000,110}] = {name = "Doctor Octagonapus", chance = 4375, storage = 36003},
[{1500,110}] = {name = "Triton", chance = 1225, storage = 36004},
[{2000,120}] = {name = "Jaws", chance = 875, storage = 36005},
[{2000,120}] = {name = "Aegaeus", chance = 437.5, storage = 36006},
[{2500,130}] = {name = "Sobek", chance = 35, storage = 36007},
[{3000,130}] = {name = "Blastoise", chance = 17.5, storage = 36008},
[{3000,135}] = {name = "Aekre", chance = 8.75, storage = 36009},
[{4000,140}] = {name = "Kraken", chance = 1.75, storage = 36010},
[{5000,140}] = {name = "Pyria", chance = 0.175, storage = 360011},
[{6000,145}] = {name = "Tha Exp Carrier", chance = 0.00175, storage = 36012}
}

function reallyLongReturn(cid, config)
return math.random((100 + (getPlayerSkill(cid, SKILL_FISHING) / 60))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
t.targetId = getPlayerGUID(cid)
if not isInArray(config.waterIds, itemEx.itemid) then
return false
end
if getTilePzInfo(getPlayerPosition(cid)) then
doPlayerSendCancel(cid, "You can't use this in pz.")
return false
end
if itemEx.itemid ~= 493 and reallyLongReturn(cid, config) then
for i, k in pairs(v) do
if getPlayerLevel(cid) >= i[1] and getPlayerSkillLevel(cid, SKILL_FISHING) >= i[2] then
local c = math.random(200000000)
if c <= k.chance then
t.message = getPlayerName(cid).." has caught a ".. k.name ..", level ".. getPlayerLevel(cid) .."."
doSummonCreature(k.name, getThingPos(cid))
setPlayerStorageValue(cid, k.storage, getPlayerStorageValue(cid, k.storage) +1)
doPlayerSendChannelMessage(cid, t.targetId, t.message, t.SpeakClasses, t.channel)
end
end
if k.broadcast then
dobroadcastMessage(bsMessage:format(getCreatureName(cid), k.name))
break
end
end
end
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
doSendMagicEffect(toPosition, CONST_ME_WATERSPLASH)
end
 
Always format the script (indent) and use code tags... so people can read it, like this.
LUA:
local config = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = 0.25,
    allowFromPz = false,
    useWorms = false
}
local t = {
    targetId = 0,
    SpeakClasses = TALKTYPE_CHANNEL_W,
    message = '',
    channel = 12
}
local v = {
    [{200,100}] = {name = "Water Elemental", msg="You have caught a Water Elemental!", chance = 262500, storage = 36000},
    [{400,100}] = {name = "Hydros", chance = 52500, storage = 36001},
    [{600,100}] = {name = "Tyria", chance = 8750, storage = 36002},
    [{1000,110}] = {name = "Doctor Octagonapus", chance = 4375, storage = 36003},
    [{1500,110}] = {name = "Triton", chance = 1225, storage = 36004},
    [{2000,120}] = {name = "Jaws", chance = 875, storage = 36005},
    [{2000,120}] = {name = "Aegaeus", chance = 437.5, storage = 36006},
    [{2500,130}] = {name = "Sobek", chance = 35, storage = 36007},
    [{3000,130}] = {name = "Blastoise", chance = 17.5, storage = 36008},
    [{3000,135}] = {name = "Aekre", chance = 8.75, storage = 36009},
    [{4000,140}] = {name = "Kraken", chance = 1.75, storage = 36010},
    [{5000,140}] = {name = "Pyria", chance = 0.175, storage = 360011},
    [{6000,145}] = {name = "Tha Exp Carrier", chance = 0.00175, storage = 36012}
}

function reallyLongReturn(cid, config)
    return math.random((100 + (getPlayerSkill(cid, SKILL_FISHING) / 60))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    t.targetId = getPlayerGUID(cid)
    if not isInArray(config.waterIds, itemEx.itemid) then
        return false
    end
    if getTilePzInfo(getPlayerPosition(cid)) then
        doPlayerSendCancel(cid, "You can't use this in pz.")
        return false
    end
    if itemEx.itemid ~= 493 and reallyLongReturn(cid, config) then
        for i, k in pairs(v) do
            if getPlayerLevel(cid) >= i[1] and getPlayerSkillLevel(cid, SKILL_FISHING) >= i[2] then
                local c = math.random(200000000)
                if c <= k.chance then
                    t.message = getPlayerName(cid).." has caught a ".. k.name ..", level ".. getPlayerLevel(cid) .."."
                    doSummonCreature(k.name, getThingPos(cid))
                    setPlayerStorageValue(cid, k.storage, getPlayerStorageValue(cid, k.storage) +1)
                    doPlayerSendChannelMessage(cid, t.targetId, t.message, t.SpeakClasses, t.channel)
                end
            end
            if k.broadcast then
                dobroadcastMessage(bsMessage:format(getCreatureName(cid), k.name))
                break
            end
        end
    end
    doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
    doSendMagicEffect(toPosition, CONST_ME_WATERSPLASH)
end
 
Back
Top