Added GetItemRarityMultiplier
This commit is contained in:
@@ -76,7 +76,7 @@ public class RagfairPriceService(
|
||||
foreach (var (itemTpl, handbookPrice) in StaticPrices)
|
||||
{
|
||||
// Get new price to use
|
||||
var newBasePrice = handbookPrice * GetFleaBasePriceMultiplier(itemTpl);
|
||||
var newBasePrice = handbookPrice * (GetFleaBasePriceMultiplier(itemTpl) + GetItemRarityMultiplier(itemTpl));
|
||||
if (newBasePrice == 0)
|
||||
{
|
||||
continue;
|
||||
@@ -122,6 +122,24 @@ public class RagfairPriceService(
|
||||
return RagfairConfig.Dynamic.GenerateBaseFleaPrices.PriceMultiplier;
|
||||
}
|
||||
|
||||
protected double GetItemRarityMultiplier(MongoId itemTpl)
|
||||
{
|
||||
var itemDetails = itemHelper.GetItem(itemTpl);
|
||||
switch (itemDetails.Value?.Properties?.RarityPvE ?? string.Empty)
|
||||
{
|
||||
case "Common":
|
||||
return 0;
|
||||
case "Rare":
|
||||
return 0.2;
|
||||
case "Superrare":
|
||||
return 0.5;
|
||||
case "Not_exist":
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the dynamic price for an item. If value doesn't exist, use static (handbook) value.
|
||||
/// if no static value, return 1
|
||||
|
||||
Reference in New Issue
Block a user