vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
Hi, i have problem with this script. I want add new rod to fishing fish 10224 for item 9662 but i can fishing fish without item... How repair it?
Code:
local useWorms = true
local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
math.randomseed(os.time())
function onUse(cid, item, fromPosition, itemEx, toPosition)
local fishSkill = getPlayerSkillLevel(cid, SKILL_FISHING)
local fishChance = math.random(1, fishSkill)
local wormCheck = false
if isInArray(waterIds, itemEx.itemid) then
if math.random(1, 100) <= math.min(math.max(10 + (fishSkill - 10) * 0.597, 10), 50) then
if useWorms and getPlayerItemById(cid, true, 9662) then
wormCheck = true
end
if wormCheck then
if fishChance < 15 then
doPlayerAddItem(cid, 10224, 1)
elseif fishChance > 14 and fishChance < 30 then
doPlayerAddItem(cid, 10224, 1)
elseif fishChance > 29 and fishChance < 45 then
doPlayerAddItem(cid, 10224, 1)
elseif fishChance > 44 and fishChance < 60 then
doPlayerAddItem(cid, 10224, 1)
elseif fishChance > 59 and fishChance < 75 then
doPlayerAddItem(cid, 10224, 1)
elseif fishChance > 74 and fishChance < 90 then
doPlayerAddItem(cid, 10224, 1)
elseif fishChance > 89 then
doPlayerAddItem(cid, 10224, 1)
end
if useWorms then
doPlayerRemoveItem(cid, 9662, 1)
end
end
end
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
return true
end
return false
end