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