From e6976a00d92d33aef9dab4ed7efaf9c253087473 Mon Sep 17 00:00:00 2001 From: pess0a Date: Fri, 7 Jul 2023 16:41:38 -0300 Subject: [PATCH 1/2] fix use fishing --- data-canary/scripts/actions/tools/fishing.lua | 5 ++++- data-otservbr-global/scripts/actions/other/fishing.lua | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/data-canary/scripts/actions/tools/fishing.lua b/data-canary/scripts/actions/tools/fishing.lua index 7e961409271..698110da318 100644 --- a/data-canary/scripts/actions/tools/fishing.lua +++ b/data-canary/scripts/actions/tools/fishing.lua @@ -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 diff --git a/data-otservbr-global/scripts/actions/other/fishing.lua b/data-otservbr-global/scripts/actions/other/fishing.lua index 2e9e8b2312b..a24da988eb4 100644 --- a/data-otservbr-global/scripts/actions/other/fishing.lua +++ b/data-otservbr-global/scripts/actions/other/fishing.lua @@ -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) @@ -94,11 +94,15 @@ 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 end + if targetId == 13988 then target:transform(targetId + 1) From 19f3678f9837dd3a0c0d4433547b9f9126af1bab Mon Sep 17 00:00:00 2001 From: pess0a Date: Fri, 7 Jul 2023 17:00:20 -0300 Subject: [PATCH 2/2] remove blankspace --- data-otservbr-global/scripts/actions/other/fishing.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/data-otservbr-global/scripts/actions/other/fishing.lua b/data-otservbr-global/scripts/actions/other/fishing.lua index a24da988eb4..991ce95e1c7 100644 --- a/data-otservbr-global/scripts/actions/other/fishing.lua +++ b/data-otservbr-global/scripts/actions/other/fishing.lua @@ -102,7 +102,6 @@ function fishing.onUse(player, item, fromPosition, target, toPosition, isHotkey) if useWorms and not player:removeItem("worm", 1) then return true end - if targetId == 13988 then target:transform(targetId + 1)