public double GetCoef(AuctionItem item) { double coef = 0; try { if (item.Template.GetClass() == EItemClass.Weapon) { coef = item.Template.GetDamagePerSecond(); foreach (var s in item.GetStats()) { if (StatCoefs.ContainsKey(s.Key)) { coef += StatCoefs[s.Key] * s.Value; } } } if (item.Template.GetClass() == EItemClass.Armor) { coef = item.Template.GetArmorDefence() * Host.CharacterSettings.EquipArmorCoef; foreach (var s in item.GetStats()) { if (StatCoefs.ContainsKey(s.Key)) { coef += StatCoefs[s.Key] * s.Value; } } } } catch (Exception e) { Host.log("" + e); } return(coef); }