diff --git a/src/Controllers/Common/ContentController.cs b/src/Controllers/Common/ContentController.cs index 9637c40..932ddf8 100644 --- a/src/Controllers/Common/ContentController.cs +++ b/src/Controllers/Common/ContentController.cs @@ -819,17 +819,36 @@ public class ContentController : Controller { for (int i = 0; i < itemIdArr.Length; i++) { ItemData item = itemService.GetItem(itemIdArr[i]); UserGameCurrency currency = achievementService.GetUserCurrency(viking); - if (currency.GameCurrency - item.Cost < 0 && currency.CashCurrency - item.CashCost < 0) { + int coinCost = (int)Math.Round(0.8 * item.Cost); // 20% discount for members + int gemCost = (int)Math.Round(0.8 * item.CashCost); + if (currency.GameCurrency - coinCost < 0 && currency.CashCurrency - gemCost < 0) { success = false; break; } - achievementService.AddAchievementPoints(viking, AchievementPointTypes.GameCurrency, -item.Cost); - achievementService.AddAchievementPoints(viking, AchievementPointTypes.CashCurrency, -item.CashCost); - itemService.CheckAndOpenBox(itemIdArr[i], gender, out int itemId, out int quantity); - for (int j=0; j