Skip to Content
ModulesStore and money

Cases

The Cases module: paid and free cases with prizes from rewards, chances on the case page, a fairness check, upgrades, contracts and battles.

The module adds a "Cases" section to the site: a player pays with the balance or site coins, opens a case and gets a prize. Prizes are rewards of the Rewards module, so a case can hold anything the site can grant: balance, a role, a server group, a command, a game item. Every prize's chance is shown on the case page, and anyone can recompute the outcome of any opening.

The Cases catalogue with categories and the Latest drop feed
DependenciesGamesPermissionsStudio blocksBot commandsCron tasks
Flute 2.0, the Rewards module; optionally Chat and Migrationany, prizes are granted through Rewardsadmin.cases, admin.cases.view, admin.cases.edit, admin.cases.toggle, admin.cases.delete, admin.cases.categories, admin.cases.preview"Cases" (cases.grid), "Latest prizes from cases" (cases.feed)nonetwo, below

Install and first setup

Install the module from the marketplace together with Rewards, as described in first steps. The admin menu gains two rows: "Cases" with the list of cases and "Battles and exchanges" with the players' games. On the site the section opens at /cases and under the "Cases" menu item.

AdminCases
The list of cases in the admin with the Cases switched on, Openings in total and Actual return summary

There are no cases right after install. A case is paid for with the site balance or site coins; coins are switched on in the reward settings, see site coins. For a prize to reach a game server, the server has to be linked to the site with the GameLink plugin, see reward delivery.

Cases and categories from an LR Web site are carried over by the Migration module.

Build a case and its chances

Add a category

Categories are the sections of the catalogue. Press "Add a category" and fill in "Name" and "Order". A case of no category comes last, and with no categories at all every case goes in one list.

Create the case

Press "Add a case". In "Address" type Latin letters, for example gold: the case opens at /cases/gold. The address never changes once created. Fill in "Name", pick a "Category" and a "Picture" or a "Picture from the set".

In "Price and free openings" set "Price of an opening" and "Currency": the balance, or site coins as a whole number. A new case starts switched off.

Add prizes

Open the case, go to the "Prizes and chances" tab and press "Add a prize". In "What is given" pick the reward type and fill its fields, then "Name of the prize" and "Weight". "Stock" caps how many times the prize can drop in total, "Per player, times" caps one player. "Rarity" is shown on the case page, and players can sort prizes by it.

The Prizes and chances tab: price of an opening, average prize, return by chances and the prize table

Check the return

Above the prize table you see "Average prize" and "Return by chances", the share of the price the case gives back as prizes on average. A case with a return above "Return limit, %" (100 by default) cannot be switched on. If some prizes have no worth, the admin warns you that the average prize is understated.

Switch the case on

Press "Switch on" in the case header or in its row of the list. To look at the case on the site first, turn on "Preview": only staff see the case, and opening it charges and grants nothing.

A prize's chance is its weight divided by the sum of the weights of the prizes switched on. Say a case has three prizes weighted 70, 25 and 5: the chances are 70%, 25% and 5%. Add a fourth with weight 100 and they become 35%, 12.5%, 2.5% and 50%. The chances always add up to 100%, so a new prize takes its share from the others. A prize of weight 0 never drops. Neither does a prize whose "Stock" has run out, until you enter a new number, which starts the stock over.

The contents can also be changed from the list: "Contents and chances" opens the same set of prizes. Prizes live in a prize pool of the Rewards module, so only someone with the admin.rewards.pools permission can edit them. "Copy" makes a switched-off copy with its own pool of the same prizes.

A case that has been opened cannot be deleted, only switched off.

Free cases

Set "Price of an opening" to 0 and the case becomes free. Then pick a period in "Free once a" ("Day", "Week", "Month" or "In all (never renewed)") and a number from 1 to 50 in "Openings per period".

A free case opens only for an account older than 3 days with a game account linked; both are module settings. A free case cannot give money or prizes that sell for the balance. Openings can also be gifted: the "Case opening" reward type grants free openings of a chosen case, for example from another case or for a quest in Quests.

What the player sees

The catalogue lists cases by category, with the "Summary" of today's openings and the "Latest drop" feed beside it. A case page lists the prizes with their chances and rarity, the "How many to open" choice and the "Open for …" button. Guests see the catalogue and the chances, but only a signed-in player can open a case.

The result of an opening with the Claim, Sell for and Check fairness buttons

After the animation the player sees the prize. It is credited at once or waits for the player in the inventory, where the "Claim" button grants it. If the reward has a "Selling price from the inventory", a "Sell for …" button appears. The player's profile has a "Cases" tab with the opening history, visible only to them.

"Check fairness" leads to the "Fair play" page (/fair). The outcome is fixed before the press: the site publishes the hash of its server seed in advance, the player can set a client seed of their own, and after "Change the seed" the server seed is revealed, so any past draw can be recomputed with the formula on that page.

Upgrades, contracts and battles

The cases section has three more games played with inventory items. Each one can be switched off in the module settings.

GameHow it works
"Upgrade"the player gives an item for a chance at a dearer one. The chance is the worth given over the worth wanted, minus "Site share, %"
"Contract"the player puts in 3 to 10 items, and their worth less the site share opens the dearest case it pays for
"Battles"2 to 4 players open the same cases, the dearest haul takes all. Stakes are in site coins by default

All battles, upgrades and contracts are listed in AdminCasesBattles and exchanges. A battle still waiting for players can be stopped with "Call the battle off", and the stakes go back to the players.

Where the module plugs into the site

PlaceWhat is there
Studiothe "Cases" block with "Title", "Category" and "How many to show" (1 to 24, 4 by default), and the "Latest prizes from cases" block with "Rare prizes only" (8 prizes by default)
Site profilea "Cases" tab with the opening history
Player card in the admina "Cases" tab: prizes, price, when
Site header"Free case mark in the header", when on
Game menu"Cases in the game menu": on servers with the Flute plugin cases open in game, see game menu
Webhooksthe "A case was opened" event, see webhooks

Placing blocks is covered in Studio blocks.

Settings

Settings open with the "Settings" button in the header of the "Cases" screen: AdminCasesSettings. The page address is /admin/modules/Cases/settings and it needs admin.cases.

Cases module settings, the Section and Economy groups
FieldWhat it changesDefault
"Cases section is on"when off, the section answers "page not found"on
"Show to guests"guests see the catalogue and the chanceson
"Section address"the first segment of the address, the old one redirects to the newcases
"18+ notice"a line with an age limit and a link to the rulesoff
"Order of cases"how cases are ordered inside a category"As set in the catalogue"
"Cases per one press"at 1 cases open one at a time10
"Count choices"the numbers in "How many to open"1,2,3,5,10
"Animation length, ms"at 0 the prize shows at once, the outcome never depends on the animation6000
"Feed of the latest prizes"the block with the latest prizeson
"Winners' names in the feed"without them every prize is signed "Player"on
"Account age for free cases, days"at 0 anyone can open a free case3
"Free cases need a game account"a linked Steam or other game account is requiredon
"Remind of the free case"the "The free case is available again" notificationoff
"Return limit, %"a case with a higher return is not switched on, a switched-on one is switched off100
"Warn about a return above, %"a warning in the list of cases95
"Top-up address"where "Top up" leads, empty means the site's top-upempty
"Cases in the game menu"cases in the menu of the Flute plugin on serverson

Permissions

PermissionWhat it gives
admin.caseseverything in the module and its settings
admin.cases.viewviewing the catalogue and the expected economy
admin.cases.editcreating, changing and copying
admin.cases.toggleswitching on and off
admin.cases.deletedeleting cases never opened
admin.cases.categoriesediting categories
admin.cases.previewseeing and opening cases in preview

A case's prizes are edited with the admin.rewards.pools permission of the Rewards module.

Background tasks

The tasks are listed in AdminScheduler and run only if the scheduler starts once a minute.

TaskHow often
Cases: reminder of the free caseevery 30 minutes
Cases: calling off battles that did not fillevery minute

Game servers

Rewards gives the prize, and the GameLink plugin carries it to the server. Groups, commands and game items in prizes reach only servers with that plugin; the game pages explain how to install it, for example Counter-Strike 2, Rust and Minecraft. Game items as prizes come from RustKit, GmodKit, FiveMKit and Minecraft.

FiveM and RedM servers with the Tebex module do not receive case prizes until cases are added to "What else may be given on these servers".

For developers

After every opening the module dispatches the flute.cases.opened event (CaseOpened: the case, the player, the round, the prizes drawn, whether it was free, the price) and sends the cases.opened webhook. The catalogue is readable through the REST API as the cases resource; every case carries a poolKey, and GET /fair/pool/{key} returns its chances. The cases.open reward type grants free openings of a case.

How the core side works: Events and listeners, Module REST API.

Troubleshooting

For any other message, use the error lookup.

Paid cases can't be opened

Draws paid from the balance are switched off in the reward settings, so cases priced in balance cannot be opened. The "Open settings" button above the list of cases leads to that field.

Coin cases can't be opened

Site coins are switched off in the reward settings. Press "Turn on coins" above the list of cases or move the cases to the balance.

Switched off automatically: an opening found a violation. Fix the contents and switch it on again.

The site switches a case off by itself when an opening shows it gives back more than the return limit or hands out money where it may not. The reason is in the "Notes" column of the list. Adjust the weights or the worth of the prizes and press "Switch on".

MessageWhat to do
"The case holds no prize that can be drawn."add a prize with a weight above 0 or restore its "Stock"
"The expected return is above … %: on average the case gives back more than it costs."lower the weight of dear prizes or raise the price
"A free case cannot give money or prizes that sell for the balance."remove such prizes or their "Selling price from the inventory"
"A case paid in coins gives money or prizes that sell for the balance…"set what a coin is worth in the reward settings
"The case was opened already: it can only be switched off."press "Switch off" instead of "Delete"
"This address is taken."choose another "Address"
"This case is not open to you yet"the player does not meet the conditions; for a free case these are account age and a game account
"The free openings of this period are used up"the player waits for the next period
"Battles won't start"the "Battles and exchanges" screen shows the reason under the heading, with a button that fixes it

Next

On this page