From e1ae970636e46d039a446f023bdace7f99fdb182 Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 15 Mar 2026 14:02:56 -0400 Subject: [PATCH] fix: Fixes multiple factions bugs with sigil generation, lighting, and theft (#2375) --- .../Engines/Factions/Core/Generator.cs | 21 ++++++++++++++++++- .../Engines/Factions/Core/StrongholdRegion.cs | 1 + .../Engines/Factions/Items/BaseMonolith.cs | 7 +++++++ Projects/UOContent/Skills/Stealing.cs | 3 ++- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Projects/UOContent/Engines/Factions/Core/Generator.cs b/Projects/UOContent/Engines/Factions/Core/Generator.cs index 7e950ab95..1932eca8a 100644 --- a/Projects/UOContent/Engines/Factions/Core/Generator.cs +++ b/Projects/UOContent/Engines/Factions/Core/Generator.cs @@ -46,7 +46,11 @@ public static class Generator { var mono = new TownMonolith(town); mono.MoveToWorld(def.Monolith, facet); - mono.Sigil = new Sigil(town); + + if (!SigilExistsForTown(town)) + { + mono.Sigil = new Sigil(town); + } } if (!CheckExistence(def.TownStone, facet, typeof(TownStone))) @@ -96,4 +100,19 @@ public static class Generator return false; } + + private static bool SigilExistsForTown(Town town) + { + var sigils = Sigil.Sigils; + + for (var i = 0; i < sigils.Count; i++) + { + if (!sigils[i].Deleted && sigils[i].Town == town) + { + return true; + } + } + + return false; + } } \ No newline at end of file diff --git a/Projects/UOContent/Engines/Factions/Core/StrongholdRegion.cs b/Projects/UOContent/Engines/Factions/Core/StrongholdRegion.cs index 8397e9e0e..51049811f 100644 --- a/Projects/UOContent/Engines/Factions/Core/StrongholdRegion.cs +++ b/Projects/UOContent/Engines/Factions/Core/StrongholdRegion.cs @@ -13,6 +13,7 @@ public class StrongholdRegion : BaseRegion ) { Faction = faction; + GoLocation = faction.Definition.Stronghold.FactionStone; Register(); } diff --git a/Projects/UOContent/Engines/Factions/Items/BaseMonolith.cs b/Projects/UOContent/Engines/Factions/Items/BaseMonolith.cs index 465798370..031bf9d79 100644 --- a/Projects/UOContent/Engines/Factions/Items/BaseMonolith.cs +++ b/Projects/UOContent/Engines/Factions/Items/BaseMonolith.cs @@ -32,8 +32,14 @@ public abstract class BaseMonolith : BaseSystemController return; } + var oldSigil = m_Sigil; m_Sigil = value; + if (oldSigil != null) + { + oldSigil.Light = LightType.Empty; + } + if (m_Sigil?.LastMonolith != null && m_Sigil.LastMonolith != this && m_Sigil.LastMonolith.Sigil == m_Sigil) { m_Sigil.LastMonolith.Sigil = null; @@ -91,6 +97,7 @@ public abstract class BaseMonolith : BaseSystemController return; } + m_Sigil.Light = LightType.Circle225; m_Sigil.MoveToWorld(new Point3D(X, Y, Z + 18), Map); } diff --git a/Projects/UOContent/Skills/Stealing.cs b/Projects/UOContent/Skills/Stealing.cs index a7cd5eb7f..692376b8b 100644 --- a/Projects/UOContent/Skills/Stealing.cs +++ b/Projects/UOContent/Skills/Stealing.cs @@ -204,9 +204,10 @@ public static class Stealing if (sig.LastMonolith?.Sigil != null) { sig.LastMonolith.Sigil = null; - sig.LastStolen = Core.Now; } + sig.LastStolen = Core.Now; + return sig; } }