feat: get best trader offer for items

TODO: Make a better conversion for USD/EUR to RUB
This commit is contained in:
Yui
2024-11-08 17:17:10 -03:00
parent a86213d3a6
commit db4003caa7
8 changed files with 132 additions and 6 deletions

View File

@@ -16,8 +16,23 @@ namespace LootValueEX.Extensions
/// <param name="item">The item to check.</param>
/// <returns>True if the item has been examined, false otherwise.</returns>
internal static bool IsExamined(this Item? item) => item != null && ClientAppUtils.GetMainApp().GetClientBackEndSession().Profile.Examined(item);
internal static bool IsStacked(this Item? item) => item != null && (item.StackObjectsCount > 1 || item.UnlimitedCount);
internal static string PrehashTemplate(this Item? item) => string.Format("{0}|{1}|{2}", item?.TemplateId, item.GetDurability(), item.GetUses());
internal static Item? UnstackItem(this Item? item)
{
if (item == null)
return null;
if (!item.IsStacked())
return item;
Item? itemClone = item.CloneItem();
itemClone.StackObjectsCount = 1;
itemClone.UnlimitedCount = false;
return itemClone;
}
/// <summary>
/// Retrieves the value of a specific attribute from an item.
/// </summary>