nuclearsilo583 / zephyrus-store-preview-new-syntax

My rewritten zephyrus store
62 stars 40 forks source link

Support multiple instances of the same item #107

Open Kamizun opened 2 years ago

Kamizun commented 2 years ago

My server's store setup makes it so people can only buy temporary items. The only way to get permanent items is through lootbox's. I do like that players have to trade items in order to get what they want but I found a problem using the store with this setup. In this example I have bought every "paintball" available for one day and then opened a lootbox that has a chance to give me permanent paintballs. The problem here is that since I do have the paintball (one day) when unboxing a permanent paintball the store refunds my lootbox because I already have the item. It would be nice if you could add support for multiple instances of the same item so players can hold the same item multiple times. I know this is probably difficult so I would suggest that atleast it should sell the item with the lowest time remaining and keep the permanent / the item with longest durability.

SC: Screenshot_1 Screenshot_2

There is also another problem when trading. Lets use the same items above as example: Lets say I have a temporary paintball and my friend wants to sell me his permanent paintball. If my friend hands over his item to me now I will have the same paintball twice but I can't choose which one I wan't to sell/trade because they merge into one in the store menus (they are separate in db) I know I could sell my temporary item first but we are talking about players that don't know about this. Sorry I couldn't take screenshots of this. Ask if needed.

Thanks!

bernardinosousa commented 2 years ago

There is any update about this?

azalty commented 2 years ago

Interesting suggestion, here are mines:

Create a cvar which allows different behaviors:

  1. Keep the current one
  2. If the client already has a temporary item and the same item is dropped temporarily, add the new item's time to the one already owned. If the dropped one is permanent, just make the old one permanent. Refund case if both old and new items are permanent.
  3. Same as 2, but if the dropped item is permanent, sell the old one and replace it by the permanent. Refund case if both old and new items are permanent.

-2 version: same as 2, but doesn't refund the case if a permanent item is dropped but the player already has it permanent.

-3 version: same as 3, but doesn't refund the case if a permanent item is dropped but the player already has it permanent, but sells the newly obtained permanent item instead.


Supporting the possession of multiple times the same item will probably be hard with the current implementation of the store, plus how the other modules are using it. I however think it could be a great thing if that would exist.

I'm considering to make a market-like plugin which would allow players to sell items from zeph store to a Steam-like market. It would allow ownership of multiple items, with only one being useable at all times, but it has been thought for permanent items only and to support my other private plugins and inventory systems, with xp and different items (from private plugins).

If I ever do it, I'll try to make a standalone version without my private plugins, but it'll be a lot of work.