A merchant randomly appears in the game and offers to buy random items(with soft or hard currency).
For example, two random common item(each 100 gems) and one uncommon(250 gems). Or just one rare item(1000 gems). The price is static, based on rarity.
Can this be somehow implemented through a store(as I understand it, you cannot select drop tables there)? Or does it need to be done through a cloud script?
Perhaps the correct option is to create a shop with all the items and use the drop tables to choose a random item? But for drop tables, we still need to use a cloud script, since they require server api?
Answer by SethDu · Aug 20, 2020 at 08:35 AM
I am not sure how you define the random item. If it is like a black box (which is drop table behavior), players only know what they get after the purchase, I think you can define 3 drop tables, where items in different rarity are contained separately, and let 3 bundles/containers have them so that you can add bundle/containers to the store.
If the Store is a global store and the randomly generated items are determined when this store shows up, since store management is administrative behavior, and you may use Admin API SetStoreItems or UpdateStoreItems. Cloud Script doesn’t support it because admin API is not permitted there. I believe you may use Azure function to make those changes, where items can be randomly generated in the function.
The user sees specific items and buys them. And the items themselves when the store appears are random.
We went to the location, a store appeared, there [Common Item 1, Common item 2, Common item 30]
We went to another location, a store appeared, there [Common Item 10, Common item 3, Ucommon item 5]
In terms of this scenario, it seems to be unnecessary to use PlayFab Store because the merchant is player-specific. My solution would be: