local c = {
waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
rateSkill = getConfigValue("rateSkill"),
bossLevel = 300, -- min level to catch a "boss"
bossSkill = 90, -- min skill to catch a "boss"
useWorms = true,
wormId = 10943,
noFishTile = 493 -- this is the water tile you can't get fish from
}
local monsters = {
-- [minLevel] = {"monster", "names", "for", "level"}
[100] = {"Quara Hydromancer", "Quara Constrictor", "Quara Mantassin"},
[150] = {"Quara Pincher", "Quara Predator"},
[200] = {"Serpent Spawn", "Wyrm"},
[300] = {"Sea Serpent"},
}
local bosses = {
-- Monsters that can only be caught with "max" level and skill
"Titan Goddess of Water",
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isInArray(c.waterIds, itemEx.itemid) then
return false
end
if c.useWorms then
if getPlayerItemCount(cid, c.wormId) < 1 then
doPlayerSendCancel(cid, "You do not have enough worms to fish.")
return false
end
end
if not getTileInfo(getCreaturePosition(cid)).protection and itemEx.itemid ~= c.noFishTile then
local level = getPlayerLevel(cid)
local skill = getPlayerSkill(cid, SKILL_FISHING)
local tmpMonsters = {}
for minLevel, data in ipairs(monsters) do
if level >= minLevel then
for i = 1, #data do
table.insert(tmpMonsters, data[i])
end
else
break
end
end
if level >= c.bossLevel and skill >= c.bossSkill then
for i = 1, #bosses do
table.insert(tmpMonsters, bosses[i])
end
end
doSummonMonster(tmpMonsters[math.random(1, #tmpMonsters)], getCreaturePosition(cid))
doPlayerAddSkillTry(cid, SKILL_FISHING, c.rateSkill)
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
doPlayerRemoveItem(cid, c.wormId, 1)
else
doPlayerSendCancel(cid, "You cannot fish here.")
return false
end
return true
end