• 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 heLp with fishing script

redguy

New Member
Joined
Mar 20, 2010
Messages
45
Reaction score
1
local config = {
waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
rateSkill = getConfigValue("rateSkill"),
allowFromPz = false,
useWorms = true
}
local v = {
[{200,80}] = {name = "Enraged Water Elemental", chance = 10}
}

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((100 + (getPlayerSkill(cid, SKILL_FISHING) / 50))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1))) then
local bsMessage = "%s have caught %s"
for i, k in pairs(v) do
if getPlayerLevel(cid) >= i[1] and getPlayerSkillLevel(cid, SKILL_FISHING) >= i[2] then
local c = math.random(100)
if c <= k.chance then
doSummonCreature(k.name, getThingPos(cid))
end
end
if k.broadcast then
doBroadcastMessage(bsMessage:format(getCreatureName(cid), k.name))
break
end
end
end
return doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
 
i need help
i need the script to be edited with these monsters and these lvls:
combat: Fish lvl: monster:
500 75 Quara Hydromancer
500 75 Quara Constrictor
1000 80 Quara Mantassin
1000 80 Quara Pincher
2000 90 Quara Predator
2000 90 Blood Crab
3000 100 Wyrm
3000 100 Serpent Spawn
4000 100 Young Sea Serpent
4000 100 Sea Serpent
5000 100 Massive Water Elemental
5000 100 Slick Water Elemental
5000 110 boss
 
you guys don't know how to copypaste these days?
Lua:
local config = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = getConfigValue('rateSkill'),
    allowFromPz = false,
    useWorms = true
    }

local v = {
    [{5000,150}] = {name = 'boss', chance = 2},
    [{5000,130}] = {name = 'massive water elemental', chance = 4},
    [{5000,120}] = {name = 'slick water elemental', chance = 4},
    [{4000,110}] = {name = 'sea serpent', chance = 4},
    [{4000,100}] = {name = 'young sea serpent', chance = 6},
    [{3000,95}] = {name = 'serpent spawn', chance = 6},
    [{3000,90}] = {name = 'wyrm', chance = 6},
    [{2000,85}] = {name = 'blood crab', chance = 8},
    [{2000,80}] = {name = 'quara predator', chance = 8},
    [{1000,75}] = {name = 'quara pincher', chance = 8},
    [{1000,70}] = {name = 'quara mantassin', chance = 10},
    [{500,65}] = {name = 'quara constrictor', chance = 10},
    [{500,60}] = {name = 'quara hydromancer', chance = 10},
}

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((100 + (getPlayerSkill(cid, SKILL_FISHING) / 50))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1))) then
        local bsMessage = '%s have caught %s'
        for i, k in pairs(v) do
            if getPlayerLevel(cid) >= i[1] and getPlayerSkillLevel(cid, SKILL_FISHING) >= i[2] then
                local c = math.random(100)
                if c <= k.chance then
                    doSummonCreature(k.name, getThingPos(cid))
                end
            end
            if k.broadcast then
                doBroadcastMessage(bsMessage:format(getCreatureName(cid), k.name))
                break
            end
        end
    end
return doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
the array was kinda weird, i shuffled it
 
hey CyberM, how could i use that script, but make the fishing rod have exhaust? because atm.. when i use that fishing script, or any Monster fishing script, all the rod dose is SPAM.. so how could i fix this?
 
oh alrighty
Lua:
local config = {
	waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
	rateSkill = getConfigValue('rateSkill'),
	allowFromPz = false,
	useWorms = true,
	exhKey = 150,
	exhSec = 3
}

local t = {
	[{5000,150}] = {name = 'boss', chance = 2},
	[{5000,130}] = {name = 'massive water elemental', chance = 4},
	[{5000,120}] = {name = 'slick water elemental', chance = 4},
	[{4000,110}] = {name = 'sea serpent', chance = 4},
	[{4000,100}] = {name = 'young sea serpent', chance = 6},
	[{3000,95}] = {name = 'serpent spawn', chance = 6},
	[{3000,90}] = {name = 'wyrm', chance = 6},
	[{2000,85}] = {name = 'blood crab', chance = 8},
	[{2000,80}] = {name = 'quara predator', chance = 8},
	[{1000,75}] = {name = 'quara pincher', chance = 8},
	[{1000,70}] = {name = 'quara mantassin', chance = 10},
	[{500,65}] = {name = 'quara constrictor', chance = 10},
	[{500,60}] = {name = 'quara hydromancer', chance = 10},
}

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 b >= k[2] and math.random(100) <= v.chance then
				local r = doCreateMonster(v.name, getThingPos(cid), false)
				if isMonster(r) then
					doSendMagicEffect(getThingPos(r), CONST_ME_WATERSPLASH)
					if v.broadcast then
						doBroadcastMessage(('%s has caught a %s'):format(getCreatureName(cid), v.name))
					end
					break
				end
			end
		end
	end
	return doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
 
Lua:
local config = {
	waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
	rateSkill = getConfigValue('rateSkill'),
	allowFromPz = false,
	useWorms = true,
	exhKey = 150,
	exhSec = 3
}
 
local t = {
	[{5000,150}] = {name = 'boss', chance = 2},
	[{5000,130}] = {name = 'massive water elemental', chance = 4},
	[{5000,120}] = {name = 'slick water elemental', chance = 4},
	[{4000,110}] = {name = 'sea serpent', chance = 4},
	[{4000,100}] = {name = 'young sea serpent', chance = 6},
	[{3000,95}] = {name = 'serpent spawn', chance = 6},
	[{3000,90}] = {name = 'wyrm', chance = 6},
	[{2000,85}] = {name = 'blood crab', chance = 8},
	[{2000,80}] = {name = 'quara predator', chance = 8},
	[{1000,75}] = {name = 'quara pincher', chance = 8},
	[{1000,70}] = {name = 'quara mantassin', chance = 10},
	[{500,65}] = {name = 'quara constrictor', chance = 10},
	[{500,60}] = {name = 'quara hydromancer', chance = 10},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(config.waterIds, itemEx.itemid) == FALSE then
		return FALSE
	elseif getPlayerStorageValue(cid, config.exhKey) >= os.time() then
		return TRUE, doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	elseif itemEx.itemid ~= 493 and (config.allowFromPz or getTileInfo(getThingPos(cid)).protection) and math.random(100 + getPlayerSkillLevel(cid, SKILL_FISHING) / 50) < getPlayerSkillLevel(cid, SKILL_FISHING) and (not config.useWorms or doPlayerRemoveItem(cid, ITEM_WORM, 1) == TRUE) then
		setPlayerStorageValue(cid, config.exhKey, os.time() + config.exhSec)
		local a, b = getPlayerLevel(cid), getPlayerSkillLevel(cid, SKILL_FISHING)
		for k, v in pairs(t) do
			if a >= k[1] and b >= k[2] and math.random(100) <= v.chance then
				local r = doCreateMonster(v.name, getThingPos(cid), false)
				if isCreature(r) == TRUE then
					doSendMagicEffect(getThingPos(r), CONST_ME_WATERSPLASH)
					if v.broadcast then
						doBroadcastMessage(('%s has caught a %s'):format(getCreatureName(cid), v.name))
					end
					break
				end
			end
		end
	end
	return TRUE, doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
 
Lua:
local config = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = getConfigValue('rateSkill'),
    allowFromPz = false,
    useWorms = true,
    exhKey = 150,
    exhSec = 3
}
 
local t = {
    [{5000,150}] = {name = 'boss', chance = 2},
    [{5000,130}] = {name = 'massive water elemental', chance = 4},
    [{5000,120}] = {name = 'slick water elemental', chance = 4},
    [{4000,110}] = {name = 'sea serpent', chance = 4},
    [{4000,100}] = {name = 'young sea serpent', chance = 6},
    [{3000,95}] = {name = 'serpent spawn', chance = 6},
    [{3000,90}] = {name = 'wyrm', chance = 6},
    [{2000,85}] = {name = 'blood crab', chance = 8},
    [{2000,80}] = {name = 'quara predator', chance = 8},
    [{1000,75}] = {name = 'quara pincher', chance = 8},
    [{1000,70}] = {name = 'quara mantassin', chance = 10},
    [{500,65}] = {name = 'quara constrictor', chance = 10},
    [{500,60}] = {name = 'quara hydromancer', chance = 10},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isInArray(config.waterIds, itemEx.itemid) == FALSE then
        return FALSE
    elseif getPlayerStorageValue(cid, config.exhKey) >= os.time() then
        return TRUE, doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
    elseif itemEx.itemid ~= 493 and (config.allowFromPz or getTileInfo(getThingPos(cid)).protection) and math.random(100 + getPlayerSkillLevel(cid, SKILL_FISHING) / 50) < getPlayerSkillLevel(cid, SKILL_FISHING) and (not config.useWorms or doPlayerRemoveItem(cid, ITEM_WORM, 1) == TRUE) then
        setPlayerStorageValue(cid, config.exhKey, os.time() + config.exhSec)
        local a, b = getPlayerLevel(cid), getPlayerSkillLevel(cid, SKILL_FISHING)
        for k, v in pairs(t) do
            if a >= k[1] and b >= k[2] and math.random(100) <= v.chance then
                local r = doCreateMonster(v.name, getThingPos(cid), false)
                if isCreature(r) == TRUE then
                    doSendMagicEffect(getThingPos(r), CONST_ME_WATERSPLASH)
                    if v.broadcast then
                        doBroadcastMessage(('%s has caught a %s'):format(getCreatureName(cid), v.name))
                    end
                    break
                end
            end
        end
    end
    return TRUE, doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
It does not work for me if it works as fishing but no monster tfs, 0.3.2
 
Back
Top