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

Help with monster fishing.

aas

Unholy/Azilias
Joined
Nov 5, 2010
Messages
32
Reaction score
2
Location
Estonia
Well i got edited monster fishing script, but i cant seem to figure out how to limit it to catch only 1 monster at a time or not summoning a monster when theres not enough room around the player.

Heres my script:
Code:
local config =  {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    allowFromPz = false,
    useWorms = false
}
local v = {
    [1] = {name = "Quara Constrictor", chance = 30},
    [2] = {name = "Quara Hydromancer", chance = 20},
    [3] = {name = "Quara Mantassin", chance = 10},
    [4] = {name = "Quara Pincher", chance = 9},
    [5] = {name = "Quara Predator", chance = 7},
    [6] = {name = "Sea Serpent", chance = 4},
    [7] = {name = "Wyrm", chance = 2}   
}
       
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isInArray(config.waterIds, itemEx.itemid) then
        return false
    end
    if (config.allowFromPz or not getTileInfo(getThingPos(cid)).protection)  and itemEx.itemid ~= 493 and math.random and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and  doPlayerRemoveItem(cid, ITEM_WORM, 1))) then
        for i, k in pairs(v) do
            if getPlayerStorageValue(cid,85987) >= i then
                local c = math.random(100)
                if c <= k.chance then
                    doSummonCreature(k.name, getThingPos(cid))
                end
            end
        end
    end
    return doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
 
Code:
local monstersAround = getSpectators(getCreaturePosition(cid), 6, 6, false)
for _, pid in ipairs(monstersAround) do
    for r = 1, #v do
        if isInArray(v[r].name, getCreatureName(pid)) == true then
            return false
        else
           if (config.allowFromPz... -- rest of script --
 
Back
Top Bottom