Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fishing skill #1221

Merged
merged 3 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion data-canary/scripts/actions/tools/fishing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ function fishing.onUse(player, item, fromPosition, target, toPosition, isHotkey)
return true
end

player:addSkillTries(SKILL_FISHING, 1)
if player:getItemCount(3492) > 0 then
player:addSkillTries(SKILL_FISHING, 1, true)
end

if math.random(1, 100) <= math.min(math.max(10 + (player:getEffectiveSkillLevel(SKILL_FISHING) - 10) * 0.597, 10), 50) then
if useWorms and not player:removeItem(3976, 1) then
return true
Expand Down
7 changes: 5 additions & 2 deletions data-otservbr-global/scripts/actions/other/fishing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function fishing.onUse(player, item, fromPosition, target, toPosition, isHotkey)
return true
end

if useWorms and player:removeItem("worm", 1) and targetId == 21414 then
if useWorms and targetId == 21414 and player:removeItem("worm", 1) then
if player:getStorageValue(Storage.Quest.U10_55.Dawnport.TheDormKey) == 2 then
if math.random(100) >= 97 then
player:addItem(21402, 1)
Expand All @@ -94,7 +94,10 @@ function fishing.onUse(player, item, fromPosition, target, toPosition, isHotkey)
end
end

player:addSkillTries(SKILL_FISHING, 1, true)
if player:getItemCount(3492) > 0 then
player:addSkillTries(SKILL_FISHING, 1, true)
end

if math.random(100) <= math.min(math.max(10 + (player:getEffectiveSkillLevel(SKILL_FISHING) - 10) * 0.597, 10), 50) then
if useWorms and not player:removeItem("worm", 1) then
return true
Expand Down