From 227bcbeae639c1eda16ad3b525f6b59331b9588a Mon Sep 17 00:00:00 2001 From: Majesty <32709570+majestyotbr@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:20:01 -0300 Subject: [PATCH] fix --- data-canary/scripts/actions/tools/crowbar.lua | 8 ------- .../scripts/actions/tools/kitchen_knife.lua | 8 ------- data-canary/scripts/actions/tools/machete.lua | 8 ------- data-canary/scripts/actions/tools/pick.lua | 8 ------- data-canary/scripts/actions/tools/rope.lua | 8 ------- data-canary/scripts/actions/tools/scythe.lua | 8 ------- data-canary/scripts/actions/tools/shovel.lua | 8 ------- data-canary/scripts/actions/tools/spoon.lua | 8 ------- .../scripts/actions/tools/toolgear.lua | 23 ------------------- data-canary/scripts/lib/register_actions.lua | 22 ++++++++---------- 10 files changed, 10 insertions(+), 99 deletions(-) delete mode 100644 data-canary/scripts/actions/tools/crowbar.lua delete mode 100644 data-canary/scripts/actions/tools/kitchen_knife.lua delete mode 100644 data-canary/scripts/actions/tools/machete.lua delete mode 100644 data-canary/scripts/actions/tools/pick.lua delete mode 100644 data-canary/scripts/actions/tools/rope.lua delete mode 100644 data-canary/scripts/actions/tools/scythe.lua delete mode 100644 data-canary/scripts/actions/tools/shovel.lua delete mode 100644 data-canary/scripts/actions/tools/spoon.lua delete mode 100644 data-canary/scripts/actions/tools/toolgear.lua diff --git a/data-canary/scripts/actions/tools/crowbar.lua b/data-canary/scripts/actions/tools/crowbar.lua deleted file mode 100644 index e21a43cc0cf..00000000000 --- a/data-canary/scripts/actions/tools/crowbar.lua +++ /dev/null @@ -1,8 +0,0 @@ -local crowbar = Action() - -function crowbar.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return ActionsLib.useCrowbar(player, item, fromPosition, target, toPosition, isHotkey) -end - -crowbar:id(3304) -crowbar:register() diff --git a/data-canary/scripts/actions/tools/kitchen_knife.lua b/data-canary/scripts/actions/tools/kitchen_knife.lua deleted file mode 100644 index 921baf9092d..00000000000 --- a/data-canary/scripts/actions/tools/kitchen_knife.lua +++ /dev/null @@ -1,8 +0,0 @@ -local kitchenKnife = Action() - -function kitchenKnife.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return ActionsLib.useKitchenKnife(player, item, fromPosition, target, toPosition, isHotkey) -end - -kitchenKnife:id(3469) -kitchenKnife:register() diff --git a/data-canary/scripts/actions/tools/machete.lua b/data-canary/scripts/actions/tools/machete.lua deleted file mode 100644 index 1cbab2495a6..00000000000 --- a/data-canary/scripts/actions/tools/machete.lua +++ /dev/null @@ -1,8 +0,0 @@ -local machete = Action() - -function machete.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return ActionsLib.useMachete(player, item, fromPosition, target, toPosition, isHotkey) -end - -machete:id(3308) -machete:register() diff --git a/data-canary/scripts/actions/tools/pick.lua b/data-canary/scripts/actions/tools/pick.lua deleted file mode 100644 index 37cbc136948..00000000000 --- a/data-canary/scripts/actions/tools/pick.lua +++ /dev/null @@ -1,8 +0,0 @@ -local pick = Action() - -function pick.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return ActionsLib.usePick(player, item, fromPosition, target, toPosition, isHotkey) -end - -pick:id(3456) -pick:register() diff --git a/data-canary/scripts/actions/tools/rope.lua b/data-canary/scripts/actions/tools/rope.lua deleted file mode 100644 index f2dc348b505..00000000000 --- a/data-canary/scripts/actions/tools/rope.lua +++ /dev/null @@ -1,8 +0,0 @@ -local rope = Action() - -function rope.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return ActionsLib.useRope(player, item, fromPosition, target, toPosition, isHotkey) -end - -rope:id(3003, 646) -rope:register() diff --git a/data-canary/scripts/actions/tools/scythe.lua b/data-canary/scripts/actions/tools/scythe.lua deleted file mode 100644 index 5a29085d188..00000000000 --- a/data-canary/scripts/actions/tools/scythe.lua +++ /dev/null @@ -1,8 +0,0 @@ -local scythe = Action() - -function scythe.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return ActionsLib.useScythe(player, item, fromPosition, target, toPosition, isHotkey) -end - -scythe:id(3453) -scythe:register() diff --git a/data-canary/scripts/actions/tools/shovel.lua b/data-canary/scripts/actions/tools/shovel.lua deleted file mode 100644 index cd2930223b8..00000000000 --- a/data-canary/scripts/actions/tools/shovel.lua +++ /dev/null @@ -1,8 +0,0 @@ -local shovel = Action() - -function shovel.onUse(player, item, itemEx, fromPosition, target, toPosition, isHotkey) - return ActionsLib.useShovel(player, item, itemEx, fromPosition, target, toPosition, isHotkey) -end - -shovel:id(3457, 5710) -shovel:register() diff --git a/data-canary/scripts/actions/tools/spoon.lua b/data-canary/scripts/actions/tools/spoon.lua deleted file mode 100644 index b2a98422d2a..00000000000 --- a/data-canary/scripts/actions/tools/spoon.lua +++ /dev/null @@ -1,8 +0,0 @@ -local spoon = Action() - -function spoon.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return ActionsLib.useSpoon(player, item, fromPosition, target, toPosition, isHotkey) -end - -spoon:id(3468) -spoon:register() diff --git a/data-canary/scripts/actions/tools/toolgear.lua b/data-canary/scripts/actions/tools/toolgear.lua deleted file mode 100644 index d8b5bdde5b1..00000000000 --- a/data-canary/scripts/actions/tools/toolgear.lua +++ /dev/null @@ -1,23 +0,0 @@ -local toolGear = Action() - -function toolGear.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if math.random(100) > 5 then - return ActionsLib.useRope(player, item, fromPosition, target, toPosition, isHotkey) - or ActionsLib.useShovel(player, item, fromPosition, target, toPosition, isHotkey) - or ActionsLib.usePick(player, item, fromPosition, target, toPosition, isHotkey) - or ActionsLib.useMachete(player, item, fromPosition, target, toPosition, isHotkey) - or ActionsLib.useCrowbar(player, item, fromPosition, target, toPosition, isHotkey) - or ActionsLib.useSpoon(player, item, fromPosition, target, toPosition, isHotkey) - or ActionsLib.useScythe(player, item, fromPosition, target, toPosition, isHotkey) - or ActionsLib.useKitchenKnife(player, item, fromPosition, target, toPosition, isHotkey) - else - player:say("Oh no! Your tool is jammed and can't be used for a minute.", TALKTYPE_MONSTER_SAY) - player:addAchievementProgress("Bad Timing", 10) - item:transform(item.itemid + 1) - item:decay() - end - return true -end - -toolGear:id(9594, 9596, 9598) -toolGear:register() diff --git a/data-canary/scripts/lib/register_actions.lua b/data-canary/scripts/lib/register_actions.lua index c5320864b62..fc2a9c03595 100644 --- a/data-canary/scripts/lib/register_actions.lua +++ b/data-canary/scripts/lib/register_actions.lua @@ -55,9 +55,7 @@ local sandIds = { 231, 9059 } -- desert sand local fruits = { 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3595, 3596, 5096, 8011, 8012, 8013 } -- fruits to make decorated cake with knife local ropeSpots = { 386, 421, 12935, 12936, 14238, 17238, 21501, 21965, 21966, 21967, 21968, 23363 } -ActionsLib = {} - -ActionsLib.destroyItem = function(player, target, toPosition) +function destroyItem(player, target, toPosition) if type(target) ~= "userdata" or not target:isItem() then return false end @@ -97,7 +95,7 @@ ActionsLib.destroyItem = function(player, target, toPosition) return true end -ActionsLib.useMachete = function(player, item, fromPosition, target, toPosition, isHotkey) +function onUseMachete(player, item, fromPosition, target, toPosition, isHotkey) local targetId = target.itemid if not targetId then return true @@ -119,7 +117,7 @@ ActionsLib.useMachete = function(player, item, fromPosition, target, toPosition, return false end -ActionsLib.usePick = function(player, item, fromPosition, target, toPosition, isHotkey) +function onUsePick(player, item, fromPosition, target, toPosition, isHotkey) if target.itemid == 10310 then -- shiny stone refining local chance = math.random(1, 100) if chance == 1 then @@ -167,7 +165,7 @@ ActionsLib.usePick = function(player, item, fromPosition, target, toPosition, is return false end -ActionsLib.useRope = function(player, item, fromPosition, target, toPosition, isHotkey) +function onUseRope(player, item, fromPosition, target, toPosition, isHotkey) local tile = Tile(toPosition) if not tile then return false @@ -201,7 +199,7 @@ ActionsLib.useRope = function(player, item, fromPosition, target, toPosition, is return false end -ActionsLib.useShovel = function(player, item, fromPosition, target, toPosition, isHotkey) +function onUseShovel(player, item, fromPosition, target, toPosition, isHotkey) local tile = Tile(toPosition) if not tile then return false @@ -265,7 +263,7 @@ ActionsLib.useShovel = function(player, item, fromPosition, target, toPosition, return true end -ActionsLib.useScythe = function(player, item, fromPosition, target, toPosition, isHotkey) +function onUseScythe(player, item, fromPosition, target, toPosition, isHotkey) if not table.contains({ 3453, 9596 }, item.itemid) then return false end @@ -280,21 +278,21 @@ ActionsLib.useScythe = function(player, item, fromPosition, target, toPosition, return false end -ActionsLib.useCrowbar = function(player, item, fromPosition, target, toPosition, isHotkey) +function onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey) if not table.contains({ 3304, 9598 }, item.itemid) then return false end return false end -ActionsLib.useSpoon = function(player, item, fromPosition, target, toPosition, isHotkey) +function onUseSpoon(player, item, fromPosition, target, toPosition, isHotkey) if not table.contains({ 3468, 3470 }, item.itemid) then return false end return false end -ActionsLib.useSickle = function(player, item, fromPosition, target, toPosition, isHotkey) +function onUseSickle(player, item, fromPosition, target, toPosition, isHotkey) if not table.contains({ 3293, 3306 }, item.itemid) then return false end @@ -309,7 +307,7 @@ ActionsLib.useSickle = function(player, item, fromPosition, target, toPosition, return false end -ActionsLib.useKitchenKnife = function(player, item, fromPosition, target, toPosition, isHotkey) +function onUseKitchenKnife(player, item, fromPosition, target, toPosition, isHotkey) if not table.contains({ 3469, 9594, 9598 }, item.itemid) then return false end