Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Maple2.Server.Game/Manager/StatsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BasicAttribute, BasicOption> kvp in item.Enchant.BasicOptions) {
Values[kvp.Key].AddTotal(kvp.Value);
}
}

if (item.LimitBreak is not null) {
foreach (KeyValuePair<BasicAttribute, BasicOption> 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();
Expand Down Expand Up @@ -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) {
Expand Down