From 0dbb0f5a2cffc9e23624cb46087a7de94a2df841 Mon Sep 17 00:00:00 2001 From: Sergi Rosell <50594106+srosellj@users.noreply.github.com> Date: Fri, 9 Oct 2026 09:21:43 +0200 Subject: [PATCH] fix: stealing from a container on the ground follows its lift rules (#2697) `Stealing` moves the item with `AddToBackpack` and never asks the container, so a theft skipped the rules a container sets for a hand lift: a treasure chest's crime, refusal and guardian roll, a boat hold from outside the boat, a house's moving crate, and the Haochi/Emino quest chests. An item in a container on the ground now goes through its `CheckLift` after the weight check, and a successful theft calls `OnItemLifted`, as a hand lift does. Deco containers are skipped: their `CheckLift` refuses everyone, and stealing is the only way into them. These are the containers with their own `CheckLift` that a thief can reach: | Container on the ground | What a hand lift already enforces | A theft until now | |---|---|---| | Treasure map chest | crime for a non-owner; refused if temporary, or for a non-owner on Trammel rules; guardian roll | none of it | | Boat hold | only from aboard, while the boat is stopped | also from outside the boat, or while it moves | | House moving crate | owner only | anyone | | Haochi / Emino quest chests | one item, only while on the quest | anyone, any number, and it didn't count for the quest | | Fish bowl not locked down | the fish stay in | the fish could be stolen | --- Projects/UOContent/Skills/Stealing.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Projects/UOContent/Skills/Stealing.cs b/Projects/UOContent/Skills/Stealing.cs index 01c530c79..bf8dbb1bc 100644 --- a/Projects/UOContent/Skills/Stealing.cs +++ b/Projects/UOContent/Skills/Stealing.cs @@ -7,6 +7,7 @@ using Server.Factions; using Server.Items; using Server.Misc; using Server.Mobiles; +using Server.Network; using Server.Spells; using Server.Spells.Fifth; using Server.Spells.Ninjitsu; @@ -259,12 +260,17 @@ public static class Stealing else { var w = toSteal.Weight + toSteal.TotalWeight; + var reject = LRReason.Inspecific; if (w > MaxWeightToSteal) { // This item is too heavy to steal from someone's backpack. _thief.SendLocalizedMessage(502722); } + else if (root is Container { IsDecoContainer: false } && !toSteal.CheckLift(_thief, toSteal, ref reject)) + { + _thief.SendLocalizedMessage(502710); // You can't steal that! + } else { if (toSteal.Stackable && toSteal.Amount > 1) @@ -375,6 +381,11 @@ public static class Stealing if (stolen != null) { + if (root is Container) + { + stolen.OnItemLifted(from, stolen); + } + from.AddToBackpack(stolen); if (!(stolen is Container || stolen.Stackable))