Jump to content

[FR] Permission discounts + Wipe block

Fixed 2.1.0 2.2.2

MaxiJonson
MaxiJonson

Posted

Hey! The rewrite is looking nice! Ive already started looking into moving from Welcome Panel & Shop to the new plugins!
I hit two features from Shop 1.x that I cant find in ShopCore 2.1.0. My server sells both as perks, so I cant drop them. Until this gets added, I might look into patching it myself, similarly to how I had a couple custom patches to tweak Welcome Panel too.

1. Permission discounts

Shop 1.x had Global Sales > Permission Sales in the config, a map of permission to discount:

"Permission Sales": { "shop.sale10": 0.1, "shop.sale20": 0.2, "shop.sale50": 0.5 }

The player got the biggest discount among the permisssions they held, applied to every buy price. My VIP, Early Bird and Discord ranks come with 50%, 20% and 10% shop discounts.

What's missing:

  • A config map of permission to discount percent, registered as permissions on load.
  • A buyer's best discount applies wherever a prcie is computed for them: buying, the cart, the max-affordable count, API_GetBuyQuote, and the listing data sent to templates. When both apply, the bigger of the item sale and the permission discount wins.
  • Templates show it the same way as a sale (sale / priceBeforeSale in the listing info), so players can see their discount (e.g: 50% OFF).

2. Wipe block

Shop 1.x had ItemsWipeBlock.json: per item, a number of seconds after map wipe during which it can't be bought. Players saw a countdown on the locked item. I use it to keep a few progression items (research items, explosives) out of the shop for the first days of a wipe.

What would cover it:

  • A per-item "available after wipe" delay (seconds or hours), set in the config or the editor.
  • Buying is blocked until it passes, and the listing sends the time left so templates can show a lock with a countdown.

Smaller asks, just some QoL if its easy for you to add

  • A price hook, for example OnShopBuyPrice(BasePlayer player, string itemId, double price) returning a modified price. That would let servers handle discount cases like these without patching.
  • A per-item max packs per purchase. Command items run their commands once per pack, up to 999 packs, so a timed permission can be bought many times in one click. A cap of 1 on those items would match how Shop 1.x worked.
  • A per-item permission for command items. PermissionName comes from the shortname, so every command item shares shopcore.item.note.

Im happy to test a build! 🙂

David

Posted

Hey. Thanks for feedback.

  • global sales added
  • wipe block added
  • price hook added exactly as you requested
  • max packs per purchase added
  • custom permission names added
David

Posted

Changed Status from Pending to Fixed
Changed Fixed In from Not set to 2.2.2

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
3.4m
Total downloads
Customers
12.5k
Customers served
Files Sold
177.2k
Total sales
Payments
3.9m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.