diff --git a/Maple2.Server.Game/Manager/StatsManager.cs b/Maple2.Server.Game/Manager/StatsManager.cs index 434705ee6..b8035b882 100644 --- a/Maple2.Server.Game/Manager/StatsManager.cs +++ b/Maple2.Server.Game/Manager/StatsManager.cs @@ -157,6 +157,20 @@ private void AddEquips(FieldPlayer player) { if (item.Stats != null) { AddItemStats(item.Stats); } + + // Add enhancement attributes to character attributes + if (item.Enchant is not null) { + foreach (KeyValuePair kvp in item.Enchant.BasicOptions) { + Values[kvp.Key].AddTotal(kvp.Value); + } + } + + if (item.LimitBreak is not null) { + foreach (KeyValuePair kvp in item.LimitBreak.BasicOptions) { + Values[kvp.Key].AddTotal(kvp.Value); + } + } + Log.Logger.Debug("Calculating Gearscore. Item ID: {id} - Gearscore: {gearscore} - Rarity: {rarity}, Enchant Level: {enchantLevel}, Limit Break Level: {limitBreakLevel}", item.Metadata.Id, item.Metadata.Property.GearScore, item.Rarity, item.Enchant?.Enchants ?? 0, item.LimitBreak?.Level ?? 0); Values.GearScore += Lua.CalcItemLevel(item.Metadata.Property.GearScore, item.Rarity, item.Type.Type, item.Enchant?.Enchants ?? 0, item.LimitBreak?.Level ?? 0).Item1; player.Session.Dungeon.UpdateDungeonEnterLimit(); @@ -206,9 +220,6 @@ private void StatConversion(FieldPlayer player) { private void AddItemStats(ItemStats stats) { for (int type = 0; type < ItemStats.TYPE_COUNT; type++) { foreach ((BasicAttribute attribute, BasicOption option) in stats[(ItemStats.Type) type].Basic) { - if (attribute is BasicAttribute.CriticalDamage) { - Log.Logger.Information("Adding {attribute} {option} to {actor}", attribute, option, Actor); - } Values[attribute].AddTotal(option); } foreach ((SpecialAttribute attribute, SpecialOption option) in stats[(ItemStats.Type) type].Special) {