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

Fishing script error in fishing requirements

zcorpy

New Member
Joined
Sep 12, 2017
Messages
85
Reaction score
4
fishing script error in fishing requirements for example in monster tyria level 1000 and fishing level 105 is needed and the mistake is that someone level 1000 with fish skill 20 can fish it
another explanation the level requirement does work but the fishing level requirement does not work

local config = {
waterIds = {493, 4608, 4609, 4665, 4666, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
rateSkill = 0.2,
allowFromPz = false,
useWorms = false,
exhKey = 150,
exhSec = 0.8
}

local t = {
[{7000,170}] = {name = 'leviathan', chance = 100, storage = 36013},
[{6000,150}] = {name = 'lady adshara', chance = 500, storage = 36012},
[{5000,140}] = {name = 'blastoise', chance = 1000, storage = 36011},
[{4000,135}] = {name = 'kraken', chance = 2000, storage = 36010},
[{3500,130}] = {name = 'aekre', chance = 5000, storage = 36009},
[{2500,125}] = {name = 'aegaeus', chance = 8000, storage = 36008},
[{2000,120}] = {name = 'jaws', chance = 15000, storage = 36007},
[{1500,120}] = {name = 'nessi', chance = 25000, storage = 36006},
[{1500,120}] = {name = 'triton', chance = 25000, storage = 36005},
[{1400,110}] = {name = 'kingler', chance = 38000, storage = 36004},
[{1300,110}] = {name = 'doctor octagonapus', chance = 45000, storage = 36003},
[{1000,105}] = {name = 'tyria', chance = 55000, storage = 36002},
[{500,100}] = {name = 'hydros', chance = 70000, storage = 36001},
[{10,100}] = {name = 'water elemental', chance = 75000, storage = 36000}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isInArray(config.waterIds, itemEx.itemid) then
return false
elseif exhaustion.check(cid, config.exhKey) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
elseif itemEx.itemid ~= 493 and (config.allowFromPz or not getTileInfo(getThingPos(cid)).protection) and math.random((100 + (getPlayerSkill(cid, SKILL_FISHING) / 50))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or doPlayerRemoveItem(cid, ITEM_WORM, 1)) then
exhaustion.set(cid, config.exhKey, config.exhSec)
local a, b = getPlayerLevel(cid), getPlayerSkill(cid, SKILL_FISHING)
for k, v in pairs(t) do
if a >= k[1] and math.random(200000000) <= v.chance then
local r = doCreateMonster(v.name, getThingPos(cid), false)
setPlayerStorageValue(cid, v.storage, getPlayerStorageValue(cid, v.storage) +1)
if isMonster(r) then
doSendMagicEffect(getThingPos(r), CONST_ME_WATERSPLASH)

doBroadcastMessage(('%s has caught a %s be very careful!'):format(getCreatureName(cid), v.name), MESSAGE_EVENT_ADVANCE)

break
end
end
end
end
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
return doSendMagicEffect(toPosition, CONST_ME_WATERSPLASH)

end
 
Solution
Change your fishing with this:

Lua:
local config = {
waterIds = {493, 4608, 4609, 4665, 4666, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
allowFromPz = false,
useWorms = false,
chance_catch = 20000000
}

--Use |PLAYERNAME| to call the players name into the message.
local monsters = {
[1] = {name = 'Leviathan', chance = 100, storage = 36013, level = 7000, fishing = 170, msg = "|PLAYERNAME| has caught a Leviathan"},
[2] = {name = 'Lady Adshara', chance = 500, storage = 36012, level = 6000, fishing = 150, msg = "|PLAYERNAME| has caught a Leviathan"},
[3] = {name = 'Blastoise', chance = 1000, storage = 36011, level = 5000, fishing = 140, msg = "|PLAYERNAME| has caught a Leviathan"},
[4] =...
Change your fishing with this:

Lua:
local config = {
waterIds = {493, 4608, 4609, 4665, 4666, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
allowFromPz = false,
useWorms = false,
chance_catch = 20000000
}

--Use |PLAYERNAME| to call the players name into the message.
local monsters = {
[1] = {name = 'Leviathan', chance = 100, storage = 36013, level = 7000, fishing = 170, msg = "|PLAYERNAME| has caught a Leviathan"},
[2] = {name = 'Lady Adshara', chance = 500, storage = 36012, level = 6000, fishing = 150, msg = "|PLAYERNAME| has caught a Leviathan"},
[3] = {name = 'Blastoise', chance = 1000, storage = 36011, level = 5000, fishing = 140, msg = "|PLAYERNAME| has caught a Leviathan"},
[4] = {name = 'Kraken', chance = 2000, storage = 36010, level = 4000, fishing = 135, msg = "|PLAYERNAME| has caught a Leviathan"},
[5] = {name = 'Aekre', chance = 5000, storage = 36009, level = 3500, fishing = 130, msg = "|PLAYERNAME| has caught a Leviathan"},
[6] = {name = 'Aegaeus', chance = 8000, storage = 36008, level = 2500, fishing = 125, msg = "|PLAYERNAME| has caught a Leviathan"},
[7] = {name = 'Jaws', chance = 15000, storage = 36007, level = 2000, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[8] = {name = 'Nessi', chance = 25000, storage = 36006, level = 1500, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[9] = {name = 'Triton', chance = 25000, storage = 36005, level = 1500, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[10] = {name = 'Kingler', chance = 38000, storage = 36004, level = 1400, fishing = 110, msg = "|PLAYERNAME| has caught a Leviathan"},
[11] = {name = 'Doctor Octagonapus', chance = 45000, storage = 36003, level = 1300, fishing = 110, msg = "|PLAYERNAME| has caught a Leviathan"},
[12] = {name = 'Tyria', chance = 55000, storage = 36002, level = 1000, fishing = 105, msg = "|PLAYERNAME| has caught a Leviathan"},
[13] = {name = 'Hydros', chance = 70000, storage = 36001, level = 500, fishing = 100, msg = nil},
[14] = {name = 'Water Elemental', chance = 75000, storage = 36000, level = 10, fishing = 100, msg = nil}
}

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

if not allowFromPz and getTilePzInfo(getCreaturePosition(cid)) then
    return doPlayerSendCancel("You cannot fish in protection zone.")
end

if useWorms and getPlayerItemCount(cid, ITEM_WORM) < 1 then
    return doPlayerSendCancel("You need worms to fish.")
elseif getPlayerItemCount(cid, ITEM_WORM) >= 1 then
    doPlayerRemoveItem(cid, ITEM_WORM, 1)
end

    for i = 1, #monsters do
        if getPlayerLevel(cid) >= monsters[i].level and getPlayerSkillLevel(cid, SKILL_FISHING) >= monsters[i].fishing then
            if math.random(1, config.chance_catch) <= monsters[i].chance then
                local MONS = doCreateMonster(monsters[i].name, getCreaturePosition(cid))
            
                if MONS then
                    releasedMonsters[MONS] = getPlayerAccountId(cid)
                end
            
                if getPlayerStorageValue(cid, monsters[i].storage) == -1 then
                    setPlayerStorageValue(cid, monsters[i].storage, 1)
                else
                    setPlayerStorageValue(cid, monsters[i].storage, getPlayerStorageValue(cid, monsters[i].storage) + 1)
                end
            
                if monsters[i].msg then
                    local text = string.gsub(monsters[i].msg, "|PLAYERNAME|", getCreatureName(cid))
                    doBroadcastMessage(text, MESSAGE_EVENT_ADVANCE)
                end
            end
        end
    end
 

doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
return true
end

Change your bowl script with this:
Lua:
local monsters = {
    [1] = {name = "Troll", aid = 1000},
    [2] = {name = "Cyclops", aid = 1001},
    [3] = {name = "Dragon", aid = 1002},
    [4] = {name = "Demon", aid = 1003}
}

local effects = {
[1] = {28, 210},
[2] = {29, 180},
[3] = {30, 45}
}

function onUse(cid, item, frompos, item2, topos)
if item.itemid == 5928 then
    if getTilePzInfo(getPlayerPosition(cid)) then
        return doPlayerSendCancel(cid, "You cannot capture monsters in protection zone.")
    end

  local MONS = nil
    for i = 1, #monsters do
        if monsters[i].name == getCreatureName(item2.uid) then
            MONS = monsters[i]
            break
        end
    end

    if not MONS then
        return doPlayerSendCancel(cid, "You cannot capture this monster.")
    end

    local EFF = effects[math.random(1, 3)]

    if not EFF then
        return doPlayerSendCancel(cid, "Please report this error to the gamemaster.")
    end

    if releasedMonsters[item2.uid] and releasedMonsters[item2.uid] ~= getPlayerAccountId(cid) then
        return doPlayerSendCancel(cid, "This monster is not yours to catch.")
    end

    doItemSetAttribute(item.uid, "description", "It contains a: "..getCreatureName(item2.uid)..".")
    doItemSetAttribute(item.uid, "aid", MONS.aid)
    if releasedMonsters[item2.uid] then
        releasedMonsters[item2.uid] = nil
    end
    doRemoveCreature(item2.uid)
    doSendMagicEffect(topos, EFF[1])
    doSendAnimatedText(topos, 'Captured!', EFF[2])
    doTransformItem(item.uid, 5929)

elseif item.itemid == 5929 then
    if getTilePzInfo(getPlayerPosition(cid)) then
        return doPlayerSendCancel(cid, "You cannot release monsters in protection zone.")
    end
    local MONS = nil
    for i = 1, #monsters do
        if monsters[i].aid == getItemAttribute(item.uid, "aid") then
            MONS = monsters[i]
            break
        end
    end

    if not MONS then
        return doPlayerSendCancel(cid, "Please report this error to the gamemaster.")
    end

    local EFF = effects[math.random(1, 3)]

    if not EFF then
        return doPlayerSendCancel(cid, "Please report this error to the gamemaster.")
    end

    local mons = doCreateMonster(MONS.name, getCreaturePosition(cid))

    if mons then
        releasedMonsters[mons] = getPlayerAccountId(cid)
        doSendMagicEffect(getCreaturePosition(mons), EFF[1])
        doSendAnimatedText(getCreaturePosition(mons), 'Released!', EFF[2])
        doRemoveItem(item.uid, 1)
    else
        return doPlayerSendCancel(cid, "Could not release monster.")
    end
end
return true
end
 
Last edited:
Solution
Change your fishing with this:

Lua:
local config = {
waterIds = {493, 4608, 4609, 4665, 4666, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
allowFromPz = false,
useWorms = false,
chance_catch = 20000000
}

--Use |PLAYERNAME| to call the players name into the message.
local monsters = {
[1] = {name = 'Leviathan', chance = 100, storage = 36013, level = 7000, fishing = 170, msg = "|PLAYERNAME| has caught a Leviathan"},
[2] = {name = 'Lady Adshara', chance = 500, storage = 36012, level = 6000, fishing = 150, msg = "|PLAYERNAME| has caught a Leviathan"},
[3] = {name = 'Blastoise', chance = 1000, storage = 36011, level = 5000, fishing = 140, msg = "|PLAYERNAME| has caught a Leviathan"},
[4] = {name = 'Kraken', chance = 2000, storage = 36010, level = 4000, fishing = 135, msg = "|PLAYERNAME| has caught a Leviathan"},
[5] = {name = 'Aekre', chance = 5000, storage = 36009, level = 3500, fishing = 130, msg = "|PLAYERNAME| has caught a Leviathan"},
[6] = {name = 'Aegaeus', chance = 8000, storage = 36008, level = 2500, fishing = 125, msg = "|PLAYERNAME| has caught a Leviathan"},
[7] = {name = 'Jaws', chance = 15000, storage = 36007, level = 2000, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[8] = {name = 'Nessi', chance = 25000, storage = 36006, level = 1500, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[9] = {name = 'Triton', chance = 25000, storage = 36005, level = 1500, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[10] = {name = 'Kingler', chance = 38000, storage = 36004, level = 1400, fishing = 110, msg = "|PLAYERNAME| has caught a Leviathan"},
[11] = {name = 'Doctor Octagonapus', chance = 45000, storage = 36003, level = 1300, fishing = 110, msg = "|PLAYERNAME| has caught a Leviathan"},
[12] = {name = 'Tyria', chance = 55000, storage = 36002, level = 1000, fishing = 105, msg = "|PLAYERNAME| has caught a Leviathan"},
[13] = {name = 'Hydros', chance = 70000, storage = 36001, level = 500, fishing = 100, msg = nil},
[14] = {name = 'Water Elemental', chance = 75000, storage = 36000, level = 10, fishing = 100, msg = nil}
}

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

if not allowFromPz and getTilePzInfo(getCreaturePosition(cid)) then
    return doPlayerSendCancel("You cannot fish in protection zone.")
end

if useWorms and getPlayerItemCount(cid, ITEM_WORM) < 1 then
    return doPlayerSendCancel("You need worms to fish.")
elseif getPlayerItemCount(cid, ITEM_WORM) >= 1 then
    doPlayerRemoveItem(cid, ITEM_WORM, 1)
end

    for i = 1, #monsters do
        if getPlayerLevel(cid) >= monsters[i].level and getPlayerSkillLevel(cid, SKILL_FISHING) >= monsters[i].fishing then
            if math.random(1, config.chance_catch) <= monsters[i].chance then
                local MONS = doCreateMonster(monsters[i].name, getCreaturePosition(cid))
            
                if MONS then
                    releasedMonsters[MONS] = getPlayerAccountId(cid)
                end
            
                if getPlayerStorageValue(cid, monsters[i].storage) == -1 then
                    setPlayerStorageValue(cid, monsters[i].storage, 1)
                else
                    setPlayerStorageValue(cid, monsters[i].storage, getPlayerStorageValue(cid, monsters[i].storage) + 1)
                end
            
                if monsters[i].msg then
                    local text = string.gsub(monsters[i].msg, "|PLAYERNAME|", getCreatureName(cid))
                    doBroadcastMessage(text, MESSAGE_EVENT_ADVANCE)
                end
            end
        end
    end
 

doPlayerAddSkillTries(cid, SKILL_FISHING, 1)
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
return true
end

Change your bowl script with this:
Lua:
local monsters = {
    [1] = {name = "Troll", aid = 1000},
    [2] = {name = "Cyclops", aid = 1001},
    [3] = {name = "Dragon", aid = 1002},
    [4] = {name = "Demon", aid = 1003}
}

local effects = {
[1] = {28, 210},
[2] = {29, 180},
[3] = {30, 45}
}

function onUse(cid, item, frompos, item2, topos)
if item.itemid == 5928 then
    if getTilePzInfo(getPlayerPosition(cid)) then
        return doPlayerSendCancel(cid, "You cannot capture monsters in protection zone.")
    end

  local MONS = nil
    for i = 1, #monsters do
        if monsters[i].name == getCreatureName(item2.uid) then
            MONS = monsters[i]
            break
        end
    end

    if not MONS then
        return doPlayerSendCancel(cid, "You cannot capture this monster.")
    end

    local EFF = effects[math.random(1, 3)]

    if not EFF then
        return doPlayerSendCancel(cid, "Please report this error to the gamemaster.")
    end

    if releasedMonsters[item2.uid] and releasedMonsters[item2.uid] ~= getPlayerAccountId(cid) then
        return doPlayerSendCancel(cid, "This monster is not yours to catch.")
    end

    doItemSetAttribute(item.uid, "description", "It contains a: "..getCreatureName(item2.uid)..".")
    doItemSetAttribute(item.uid, "aid", MONS.aid)
    if releasedMonsters[item2.uid] then
        releasedMonsters[item2.uid] = nil
    end
    doRemoveCreature(item2.uid)
    doSendMagicEffect(topos, EFF[1])
    doSendAnimatedText(topos, 'Captured!', EFF[2])
    doTransformItem(item.uid, 5929)

elseif item.itemid == 5929 then
    if getTilePzInfo(getPlayerPosition(cid)) then
        return doPlayerSendCancel(cid, "You cannot release monsters in protection zone.")
    end
    local MONS = nil
    for i = 1, #monsters do
        if monsters[i].aid == getItemAttribute(item.uid, "aid") then
            MONS = monsters[i]
            break
        end
    end

    if not MONS then
        return doPlayerSendCancel(cid, "Please report this error to the gamemaster.")
    end

    local EFF = effects[math.random(1, 3)]

    if not EFF then
        return doPlayerSendCancel(cid, "Please report this error to the gamemaster.")
    end

    local mons = doCreateMonster(MONS.name, getCreaturePosition(cid))

    if mons then
        releasedMonsters[mons] = getPlayerAccountId(cid)
        doSendMagicEffect(getCreaturePosition(mons), EFF[1])
        doSendAnimatedText(getCreaturePosition(mons), 'Released!', EFF[2])
        doRemoveItem(item.uid, 1)
    else
        return doPlayerSendCancel(cid, "Could not release monster.")
    end
end
return true
end

Error in console and not fishing this image --> Imgur: The magic of the Internet
 
Change your fishing with this:

Lua:
local config = {
waterIds = {493, 4608, 4609, 4665, 4666, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
allowFromPz = false,
useWorms = false,
chance_catch = 20000000
}

--Use |PLAYERNAME| to call the players name into the message.
local monsters = {
[1] = {name = 'Leviathan', chance = 100, storage = 36013, level = 7000, fishing = 170, msg = "|PLAYERNAME| has caught a Leviathan"},
[2] = {name = 'Lady Adshara', chance = 500, storage = 36012, level = 6000, fishing = 150, msg = "|PLAYERNAME| has caught a Leviathan"},
[3] = {name = 'Blastoise', chance = 1000, storage = 36011, level = 5000, fishing = 140, msg = "|PLAYERNAME| has caught a Leviathan"},
[4] = {name = 'Kraken', chance = 2000, storage = 36010, level = 4000, fishing = 135, msg = "|PLAYERNAME| has caught a Leviathan"},
[5] = {name = 'Aekre', chance = 5000, storage = 36009, level = 3500, fishing = 130, msg = "|PLAYERNAME| has caught a Leviathan"},
[6] = {name = 'Aegaeus', chance = 8000, storage = 36008, level = 2500, fishing = 125, msg = "|PLAYERNAME| has caught a Leviathan"},
[7] = {name = 'Jaws', chance = 15000, storage = 36007, level = 2000, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[8] = {name = 'Nessi', chance = 25000, storage = 36006, level = 1500, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[9] = {name = 'Triton', chance = 25000, storage = 36005, level = 1500, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[10] = {name = 'Kingler', chance = 38000, storage = 36004, level = 1400, fishing = 110, msg = "|PLAYERNAME| has caught a Leviathan"},
[11] = {name = 'Doctor Octagonapus', chance = 45000, storage = 36003, level = 1300, fishing = 110, msg = "|PLAYERNAME| has caught a Leviathan"},
[12] = {name = 'Tyria', chance = 55000, storage = 36002, level = 1000, fishing = 105, msg = "|PLAYERNAME| has caught a Leviathan"},
[13] = {name = 'Hydros', chance = 70000, storage = 36001, level = 500, fishing = 100, msg = nil},
[14] = {name = 'Water Elemental', chance = 75000, storage = 36000, level = 10, fishing = 100, msg = nil}
}

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

if not allowFromPz and getTilePzInfo(getCreaturePosition(cid)) then
    return doPlayerSendCancel("You cannot fish in protection zone.")
end

if useWorms and getPlayerItemCount(cid, ITEM_WORM) < 1 then
    return doPlayerSendCancel("You need worms to fish.")
elseif getPlayerItemCount(cid, ITEM_WORM) >= 1 then
    doPlayerRemoveItem(cid, ITEM_WORM, 1)
end

    for i = 1, #monsters do
        if getPlayerLevel(cid) >= monsters[i].level and getPlayerSkillLevel(cid, SKILL_FISHING) >= monsters[i].fishing then
            if math.random(1, config.chance_catch) <= monsters[i].chance then
                local MONS = doCreateMonster(monsters[i].name, getCreaturePosition(cid))
           
                if MONS then
                    releasedMonsters[MONS] = getPlayerAccountId(cid)
                end
           
                if getPlayerStorageValue(cid, monsters[i].storage) == -1 then
                    setPlayerStorageValue(cid, monsters[i].storage, 1)
                else
                    setPlayerStorageValue(cid, monsters[i].storage, getPlayerStorageValue(cid, monsters[i].storage) + 1)
                end
           
                if monsters[i].msg then
                    local text = string.gsub(monsters[i].msg, "|PLAYERNAME|", getCreatureName(cid))
                    doBroadcastMessage(text, MESSAGE_EVENT_ADVANCE)
                end
            end
        end
    end
 

doPlayerAddSkillTries(cid, SKILL_FISHING, 1)
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
return true
end

Change your bowl script with this:
Lua:
local monsters = {
    [1] = {name = "Troll", aid = 1000},
    [2] = {name = "Cyclops", aid = 1001},
    [3] = {name = "Dragon", aid = 1002},
    [4] = {name = "Demon", aid = 1003}
}

local effects = {
[1] = {28, 210},
[2] = {29, 180},
[3] = {30, 45}
}

function onUse(cid, item, frompos, item2, topos)
if item.itemid == 5928 then
    if getTilePzInfo(getPlayerPosition(cid)) then
        return doPlayerSendCancel(cid, "You cannot capture monsters in protection zone.")
    end

  local MONS = nil
    for i = 1, #monsters do
        if monsters[i].name == getCreatureName(item2.uid) then
            MONS = monsters[i]
            break
        end
    end

    if not MONS then
        return doPlayerSendCancel(cid, "You cannot capture this monster.")
    end

    local EFF = effects[math.random(1, 3)]

    if not EFF then
        return doPlayerSendCancel(cid, "Please report this error to the gamemaster.")
    end

    if releasedMonsters[item2.uid] and releasedMonsters[item2.uid] ~= getPlayerAccountId(cid) then
        return doPlayerSendCancel(cid, "This monster is not yours to catch.")
    end

    doItemSetAttribute(item.uid, "description", "It contains a: "..getCreatureName(item2.uid)..".")
    doItemSetAttribute(item.uid, "aid", MONS.aid)
    if releasedMonsters[item2.uid] then
        releasedMonsters[item2.uid] = nil
    end
    doRemoveCreature(item2.uid)
    doSendMagicEffect(topos, EFF[1])
    doSendAnimatedText(topos, 'Captured!', EFF[2])
    doTransformItem(item.uid, 5929)

elseif item.itemid == 5929 then
    if getTilePzInfo(getPlayerPosition(cid)) then
        return doPlayerSendCancel(cid, "You cannot release monsters in protection zone.")
    end
    local MONS = nil
    for i = 1, #monsters do
        if monsters[i].aid == getItemAttribute(item.uid, "aid") then
            MONS = monsters[i]
            break
        end
    end

    if not MONS then
        return doPlayerSendCancel(cid, "Please report this error to the gamemaster.")
    end

    local EFF = effects[math.random(1, 3)]

    if not EFF then
        return doPlayerSendCancel(cid, "Please report this error to the gamemaster.")
    end

    local mons = doCreateMonster(MONS.name, getCreaturePosition(cid))

    if mons then
        releasedMonsters[mons] = getPlayerAccountId(cid)
        doSendMagicEffect(getCreaturePosition(mons), EFF[1])
        doSendAnimatedText(getCreaturePosition(mons), 'Released!', EFF[2])
        doRemoveItem(item.uid, 1)
    else
        return doPlayerSendCancel(cid, "Could not release monster.")
    end
end
return true
end
Is solved only 1 little problem in the script --> doPlayerAddSkillTries(cid, SKILL_FISHING, 1) change for --> doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
thank you very very much! you are amazing!
 
No problem man just hmu if you need more help. By the way, all players on the person who fish monster or release from bowl can bowl the monster.

So any player on owners account can bowl it no one else.
 
No problem man just hmu if you need more help. By the way, all players on the person who fish monster or release from bowl can bowl the monster.

So any player on owners account can bowl it no one else.

Well yes, but I think that is very complicated if you know the collapser server Zulu will understand me when I'm fishing I'm in the bush and the time comes when I catch something, I do not fish if the text appears that I fish something but in reality the monster does not appear and in collapser zulu "the server where I knew that" if it could and the monster appeared like that, I'll leave you an image where I am and a monster above the brush did not appear, I did that to give it An example
-->Imgur: The magic of the Internet
 
I am not sure I understand what the problem is? Do you want it to only show text that the monster is being caught if it is spawned? So it wont show the message if it is not spawned? What exactly is the problem?

Is there a way I can get on your server so you can show me?
 
I am not sure I understand what the problem is? Do you want it to only show text that the monster is being caught if it is spawned? So it wont show the message if it is not spawned? What exactly is the problem?

Is there a way I can get on your server so you can show me?
Look at the picture 1 monster appears on top of the weed okay? that I put it for you to look at an example, well now it's me when I'm fishing the moment comes that caught something and if I'm in the bush the monster is not generated but if the text appears as if, if it had appeared
 
If the grass is grown it will not spawn the monster. It will always show the msg even if the monster cannot spawn. The monster should be able to spawn on cut grass just fine.
 
If the grass is grown it will not spawn the monster. It will always show the msg even if the monster cannot spawn. The monster should be able to spawn on cut grass just fine.
Maybe you should check for the spawn position of the creature and determine if anything at that position is walkable?
 
Just replace code with this
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isInArray(config.waterIds, itemEx.itemid) then
    return false
end

if not allowFromPz and getTilePzInfo(getCreaturePosition(cid)) then
    return doPlayerSendCancel("You cannot fish in protection zone.")
end

if useWorms and getPlayerItemCount(cid, ITEM_WORM) < 1 then
    return doPlayerSendCancel("You need worms to fish.")
elseif getPlayerItemCount(cid, ITEM_WORM) >= 1 then
    doPlayerRemoveItem(cid, ITEM_WORM, 1)
end

    for i = 1, #monsters do
        if getPlayerLevel(cid) >= monsters[i].level and getPlayerSkillLevel(cid, SKILL_FISHING) >= monsters[i].fishing then
            if math.random(1, config.chance_catch) <= monsters[i].chance then
                local MONS = doCreateMonster(monsters[i].name, getCreaturePosition(cid))
           
                if MONS then
                    releasedMonsters[MONS] = getPlayerAccountId(cid)
                    if monsters[i].msg then
                        local text = string.gsub(monsters[i].msg, "|PLAYERNAME|", getCreatureName(cid))
                        doBroadcastMessage(text, MESSAGE_EVENT_ADVANCE)
                    end
                end
           
                if getPlayerStorageValue(cid, monsters[i].storage) == -1 then
                    setPlayerStorageValue(cid, monsters[i].storage, 1)
                else
                    setPlayerStorageValue(cid, monsters[i].storage, getPlayerStorageValue(cid, monsters[i].storage) + 1)
                end
            end
        end
    end


doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
return true
end
 
You only want msg to not send if monster doesn't spawn? That is all?
hmm I think I can not explain look I'll leave these 2 images of example the first 1. -> I just fish 1 monster and if the text comes out but the monster did not appear 2 .-> this is what I want to be able to fish and appear even if there is the undergrowth there

Image 1 no summon monster because it has no place where, but I want it to be possible ----> Imgur: The magic of the Internet
Image 2 example of what I want -----> Imgur: The magic of the Internet
 
Lua:
local config = {
waterIds = {493, 4608, 4609, 4665, 4666, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
allowFromPz = false,
useWorms = false,
chance_catch = 20000000
}

--Use |PLAYERNAME| to call the players name into the message.
local monsters = {
[1] = {name = 'Leviathan', chance = 100, storage = 36013, level = 7000, fishing = 170, msg = "|PLAYERNAME| has caught a Leviathan"},
[2] = {name = 'Lady Adshara', chance = 500, storage = 36012, level = 6000, fishing = 150, msg = "|PLAYERNAME| has caught a Leviathan"},
[3] = {name = 'Blastoise', chance = 1000, storage = 36011, level = 5000, fishing = 140, msg = "|PLAYERNAME| has caught a Leviathan"},
[4] = {name = 'Kraken', chance = 2000, storage = 36010, level = 4000, fishing = 135, msg = "|PLAYERNAME| has caught a Leviathan"},
[5] = {name = 'Aekre', chance = 5000, storage = 36009, level = 3500, fishing = 130, msg = "|PLAYERNAME| has caught a Leviathan"},
[6] = {name = 'Aegaeus', chance = 8000, storage = 36008, level = 2500, fishing = 125, msg = "|PLAYERNAME| has caught a Leviathan"},
[7] = {name = 'Jaws', chance = 15000, storage = 36007, level = 2000, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[8] = {name = 'Nessi', chance = 25000, storage = 36006, level = 1500, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[9] = {name = 'Triton', chance = 25000, storage = 36005, level = 1500, fishing = 120, msg = "|PLAYERNAME| has caught a Leviathan"},
[10] = {name = 'Kingler', chance = 38000, storage = 36004, level = 1400, fishing = 110, msg = "|PLAYERNAME| has caught a Leviathan"},
[11] = {name = 'Doctor Octagonapus', chance = 45000, storage = 36003, level = 1300, fishing = 110, msg = "|PLAYERNAME| has caught a Leviathan"},
[12] = {name = 'Tyria', chance = 55000, storage = 36002, level = 1000, fishing = 105, msg = "|PLAYERNAME| has caught a Leviathan"},
[13] = {name = 'Hydros', chance = 70000, storage = 36001, level = 500, fishing = 100, msg = nil},
[14] = {name = 'Water Elemental', chance = 75000, storage = 36000, level = 10, fishing = 100, msg = nil}
}

local grass = {
    [2782] = {cut = 4526},
    [3985] = {cut = 4526},
    [2739] = {cut = 2737}
}

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

if not allowFromPz and getTilePzInfo(getCreaturePosition(cid)) then
    return doPlayerSendCancel("You cannot fish in protection zone.")
end

if useWorms and getPlayerItemCount(cid, ITEM_WORM) < 1 then
    return doPlayerSendCancel("You need worms to fish.")
elseif getPlayerItemCount(cid, ITEM_WORM) >= 1 then
    doPlayerRemoveItem(cid, ITEM_WORM, 1)
end

    for i = 1, #monsters do
        if getPlayerLevel(cid) >= monsters[i].level and getPlayerSkillLevel(cid, SKILL_FISHING) >= monsters[i].fishing then
            if math.random(1, config.chance_catch) <= monsters[i].chance then
                local MONS = doCreateMonster(monsters[i].name, getCreaturePosition(cid))
             
                if not MONS then
                    local positions = {
                        [1] = {x = getCreaturePosition(cid).x - 1, y = getCreaturePosition(cid).y - 1, z = getCreaturePosition(cid).z},
                        [2] = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y - 1, z = getCreaturePosition(cid).z},
                        [3] = {x = getCreaturePosition(cid).x + 1, y = getCreaturePosition(cid).y - 1, z = getCreaturePosition(cid).z},
                        [4] = {x = getCreaturePosition(cid).x - 1, y = getCreaturePosition(cid).y, z = getCreaturePosition(cid).z},
                        [5] = {x = getCreaturePosition(cid).x + 1, y = getCreaturePosition(cid).y, z = getCreaturePosition(cid).z},
                        [6] = {x = getCreaturePosition(cid).x - 1, y = getCreaturePosition(cid).y + 1, z = getCreaturePosition(cid).z},
                        [7] = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y + 1, z = getCreaturePosition(cid).z},
                        [8] = {x = getCreaturePosition(cid).x + 1, y = getCreaturePosition(cid).y + 1, z = getCreaturePosition(cid).z}
                    }
                 
                    for i = 1, #positions do
                        local ITEM = grass[getThingFromPos(positions[i]).itemid]
                        if ITEM then
                            doTransformItem(getThingFromPos(positions[i]).uid, ITEM.cut)
                            break
                        end
                    end
                  local MONS = doCreateMonster(monsters[i].name, getCreaturePosition(cid))
                end

              

                if MONS then
                    releasedMonsters[MONS] = getPlayerAccountId(cid)
                    if monsters[i].msg then
                        local text = string.gsub(monsters[i].msg, "|PLAYERNAME|", getCreatureName(cid))
                        doBroadcastMessage(text, MESSAGE_EVENT_ADVANCE)
                    end
                end
         
                if getPlayerStorageValue(cid, monsters[i].storage) == -1 then
                    setPlayerStorageValue(cid, monsters[i].storage, 1)
                else
                    setPlayerStorageValue(cid, monsters[i].storage, getPlayerStorageValue(cid, monsters[i].storage) + 1)
                end
            end
        end
    end


doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
return true
end
 
Last edited:
Back
Top