diff --git a/data-otservbr-global/scripts/actions/tools/toolgear.lua b/data-otservbr-global/scripts/actions/tools/toolgear.lua index 7afafd32bea..8db5506c52d 100644 --- a/data-otservbr-global/scripts/actions/tools/toolgear.lua +++ b/data-otservbr-global/scripts/actions/tools/toolgear.lua @@ -1,14 +1,22 @@ local toolGear = Action() function toolGear.onUse(player, item, fromPosition, target, toPosition, isHotkey) - return onUseRope(player, item, fromPosition, target, toPosition, isHotkey) - or onUseShovel(player, item, fromPosition, target, toPosition, isHotkey) - or onUsePick(player, item, fromPosition, target, toPosition, isHotkey) - or onUseMachete(player, item, fromPosition, target, toPosition, isHotkey) - or onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey) - or onUseSpoon(player, item, fromPosition, target, toPosition, isHotkey) - or onUseScythe(player, item, fromPosition, target, toPosition, isHotkey) - or onUseKitchenKnife(player, item, fromPosition, target, toPosition, isHotkey) + if math.random(100) > 5 then + return onUseRope(player, item, fromPosition, target, toPosition, isHotkey) + or onUseShovel(player, item, fromPosition, target, toPosition, isHotkey) + or onUsePick(player, item, fromPosition, target, toPosition, isHotkey) + or onUseMachete(player, item, fromPosition, target, toPosition, isHotkey) + or onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey) + or onUseSpoon(player, item, fromPosition, target, toPosition, isHotkey) + or onUseScythe(player, item, fromPosition, target, toPosition, isHotkey) + or onUseKitchenKnife(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)