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

Solved Monster fishing [HELP]

Keeq

New Member
Joined
Nov 6, 2012
Messages
100
Reaction score
0
Hi, I have a script from another forum
and works as it should but the problem is because the monster can catch out of the water even if I do not have WORMS help someone improve? I using REP + + + + +
script :
local configg = {
waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
}
local monsters = {
{'Fish'},
{'Fish'}
}
local numero = 1 -- numero de monstros que voce colocou /\
local number = 10 -- < quanto maior, mais dificil de pescar um monstro
local config = {
rateSkill = getConfigValue("rateSkill"),
allowFromPz = false,
useWorms = true
}
function onUse(cid, item, frompos, item2, topos)
if(not isInArray(configg.waterIds, item2.itemid)) then
return false
end
local chance = math.random(1,numero+number) --
if chance >= 1 and chance <= numero then
create = monsters[chance][1]
doSummonCreature(create, getCreaturePosition(cid))
doSendMagicEffect(topos, 11)
doCreatureSay(cid, "Kill MAGIC FISH and look loot!", TEXTCOLOR_BLUE)
else
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
end
if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
(not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
doPlayerAddItem(cid, ITEM_CENT, 1)
doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
else
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
end
return true
end
 
Lua:
local configg = {
waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
}
local monsters = {
{'Fish'},
{'Fish'}
}
local numero = 1 -- numero de monstros que voce colocou /\
local number = 10 -- < quanto maior, mais dificil de pescar um monstro
local config = {
rateSkill = getConfigValue("rateSkill"),
allowFromPz = false,
useWorms = true
}
function onUse(cid, item, frompos, item2, topos)
if(not isInArray(configg.waterIds, item2.itemid)) then
return false
end
local chance = math.random(1,numero+number) --
if chance >= 1 and chance <= numero then
create = monsters[chance][1]
doSummonCreature(create, getCreaturePosition(cid))
doSendMagicEffect(topos, 11)
doCreatureSay(cid, "Kill MAGIC FISH and look loot!", TEXTCOLOR_BLUE)
else
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
end
if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, 3976) > 0 and doPlayerRemoveItem(cid, 3976, 1)))) then
doPlayerAddItem(cid, ITEM_CENT, 1)
doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
else
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
end
return true
end

- - - Updated - - -

Next Time Don't Make Quote Tags, Make it Lua or Code
 
if the code you have worked except for not taking worm, then what i have should work. it won't take a worm unless you put the remove worm line in the "if" that calls "dosummoncreature" just copy the code below and see if it works

---UPDATE---

sorry i forgot a part,
Lua:
if chance >= 1 and chance <= numero and doPlayerRemoveItem(cid, 3976, 1) then
should be
Lua:
if chance >= 1 and chance <= numero and (not config.useWorms or doPlayerRemoveItem(cid, 3976, 1)) then

It is fixed in script posted below. I hope it works, it did on mine :)

Lua:
local configg = {
waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
}
local monsters = {
{'Fish'},
{'Fish'}
}
local numero = 1 -- numero de monstros que voce colocou /\
local number = 10 -- < quanto maior, mais dificil de pescar um monstro
local config = {
rateSkill = getConfigValue("rateSkill"),
allowFromPz = false,
useWorms = true
}
function onUse(cid, item, frompos, item2, topos)
if(not isInArray(configg.waterIds, item2.itemid)) then
return false
end
local chance = math.random(1,numero+number) --
if chance >= 1 and chance <= numero and (not config.useWorms or doPlayerRemoveItem(cid, 3976, 1)) then
create = monsters[chance][1]
doSummonCreature(create, getCreaturePosition(cid))
doSendMagicEffect(topos, 11)
doCreatureSay(cid, "Kill MAGIC FISH and look loot!", TEXTCOLOR_BLUE)
else
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
end
if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
(not config.useWorms or (getPlayerItemCount(cid, 3976) > 0))) then
doPlayerAddItem(cid, ITEM_CENT, 1)
doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
else
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
end
return true
end
 
Last edited:
@Rote Faust the script is working execpt that ITEM_WORM isn't mentioned in constant. i got the same script.

it can be fixed by 2 ways
-1-:use my code
-2-put this in constant
Lua:
ITEM_WORM = 3976
 
@tetra20

when i copied your script it still summoned monster without taking worm. it works perfectly in my server the way i made the script.
notice where it says
Lua:
if chance >= 1 and chance <= numero and (not config.useWorms or doPlayerRemoveItem(cid, 3976, 1)) then
create = monsters[chance][1]
doSummonCreature(create, getCreaturePosition(cid))
it has to have the removeitem function to remove the worm before summoning the monster, yours doesn't have that.

@Keeq please let me know which one worked, thanks.

---UPDATED---

@tetra20
yours would still remove a worm though because you have that function later, but try fishing with no worms, it will still summon monster i bet
 
Last edited:
Back
Top