I am making a game that includes a feature that when players reach certain levels, they get discounts on store items.
I have roughly 50 items in the catalog and planning to add more. All items are categorized into 5 different categories (Residential, Commercial, Decorations, Roads, Special). Every item has 4 custom properties ("levelRequirement", "benefitValue", "benefitType", "xpValue").
When a player reaches level 2, the Residential category needs to be discounted by 5%.
When a player reaches level 3, the Residential and Decorations category needs to be discounted by 5%....and so on.
My first inclination would be to just apply the discount in-game, but I get the 1503 error "WrongPrice" (which is understandable).
My second inclination would be to create a specific store for every level. Is this the right approach? If so, how can I get all of the custom properties to migrate over to the new stores? When I create a new store, none of the custom properties come through, making this a super intensive time suck to copy/paste.
Secondly, if this is the case and at some point I want to increase or decrease the benefits (say instead of 5% I wanted to discount by 3% instead), would I have to go and manually update all stores?
Third, this is rather hard-coded in that I have to know how many levels the player could possibly achieve and setup a store for each one. This limits scalability as I'd like my players to just continue on leveling up as much as they care to.
It might be worth noting that I have the PlayerLevel set as a statistic and can create a segment out of it, but again, this doesn't seem super scalable.
TL;DR - Any suggestions on how to offer progressive discounts to store items based on player level?