From 92a540b2d03e32365af72fc07acea48d56ba1748 Mon Sep 17 00:00:00 2001 From: Marcelo Paez Sequeira Date: Tue, 9 Jun 2026 12:01:03 -0300 Subject: [PATCH] feat(server): add Mobile.SayTo localized overload with explicit hue (#2481) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary `Mobile.SayTo(Mobile to, int number, string args = "")` always sends the localized message using `SpeechHue`. This adds a parallel overload that accepts an explicit `hue`: ```csharp public void SayTo(Mobile to, int number, int hue, string args = "") => to.NetState.SendMessageLocalized(Serial, Body, MessageType.Regular, hue, 3, number, Name, args); ``` It mirrors the existing localized overload exactly, only substituting the caller-provided `hue` for `SpeechHue`, so content can send a cliloc message to a single mobile in a chosen color without dropping down to `NetState.SendMessageLocalized` directly. This restores the hued-cliloc `SayTo` that RunUO/ServUO content commonly relied on (e.g. `SayTo(from, 1042205, 0x3B2)`). ## Notes - Purely additive; no behavior change to existing call sites. - No overload ambiguity: `SayTo(m, num)` and `SayTo(m, num, "args")` still bind to the existing overload; `SayTo(m, num, hue)` binds to the new one (the third positional arg is `int` vs `string`). - Null-safe to the same degree as the existing overload (`SendMessageLocalized` guards via `CannotSendPackets()`). ## Test Plan - [x] `dotnet build Projects/Server` — 0 warnings, 0 errors. - One-line additive overload mirroring an existing (untested) method; no existing `Mobile.SayTo` unit tests to extend. Happy to add coverage if preferred. --- Projects/Server/Mobiles/Mobile.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Projects/Server/Mobiles/Mobile.cs b/Projects/Server/Mobiles/Mobile.cs index 632dbcda9..f20d972b6 100644 --- a/Projects/Server/Mobiles/Mobile.cs +++ b/Projects/Server/Mobiles/Mobile.cs @@ -8132,6 +8132,9 @@ public partial class Mobile : IHued, IComparable, ISpawnable, IObjectPro public void SayTo(Mobile to, int number, string args = "") => to.NetState.SendMessageLocalized(Serial, Body, MessageType.Regular, SpeechHue, 3, number, Name, args); + public void SayTo(Mobile to, int number, int hue, string args = "") => + to.NetState.SendMessageLocalized(Serial, Body, MessageType.Regular, hue, 3, number, Name, args); + public bool SendHuePicker(HuePicker p) { if (m_NetState != null)