From bd1db6685845aa3bb216aab59bd7c3fb329aeabb Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sun, 4 Dec 2022 14:20:17 -0800 Subject: [PATCH] fix: Fixes stat offset effects (#1292) --- Projects/UOContent/Spells/Base/SpellHelper.cs | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/Projects/UOContent/Spells/Base/SpellHelper.cs b/Projects/UOContent/Spells/Base/SpellHelper.cs index 0d16ac311..37d77127e 100644 --- a/Projects/UOContent/Spells/Base/SpellHelper.cs +++ b/Projects/UOContent/Spells/Base/SpellHelper.cs @@ -305,15 +305,9 @@ namespace Server.Spells var mod = target.GetStatMod(name); - if (mod?.Offset < 0) + if (mod == null || mod.Offset < bonus) { - target.AddStatMod(new StatMod(type, name, mod.Offset + bonus, duration)); - return true; - } - - if (mod == null || mod.Offset <= bonus) - { - target.AddStatMod(new StatMod(type, name, bonus, duration)); + target.AddStatMod(new StatMod(type, name, bonus - (mod?.Offset ?? 0), duration)); return true; } @@ -336,15 +330,9 @@ namespace Server.Spells var mod = target.GetStatMod(name); - if (mod?.Offset > 0) + if (mod == null || mod.Offset < offset) { - target.AddStatMod(new StatMod(type, name, mod.Offset + offset, duration)); - return true; - } - - if (mod == null || mod.Offset > offset) - { - target.AddStatMod(new StatMod(type, name, offset, duration)); + target.AddStatMod(new StatMod(type, name, offset - (mod?.Offset ?? 0), duration)); return true; }