Add, Price and Remove Shop Items
This guide shows how to add an item to the shop, change its price, or take it off sale. It covers heroes, gear boxes, etc items and costumes. Pages for gacha boxes, medals and costumes go deeper into those parts.
All file names below come from the source code that loads them. Anything marked not confirmed yet was not verified in code or config.
How the shop is built
Section titled “How the shop is built”The shop is not one file. Each kind of item has its own table, and the server and the client both read it.
| What you sell | Server file (ls_gamesvr\config\) |
Client file (config\) |
Loaded by |
|---|---|---|---|
| Hero (mercenary) | sp2_item_price.ini, sp2_setitem_info.ini |
sp2_setitem_info.ini |
ioItemPriceManager::LoadPriceInfo, ioSetItemInfoManager |
| Gear box (machine) | sp2_extraitem_info.ini |
sp2_extraitem_info.ini |
ioExtraItemInfoManager.cpp |
| Etc item (packages, boxes, tickets) | sp2_etcitem_info.ini |
sp2_etcitem_info.ini |
ioEtcItemManager |
| Costume | sp2_costume_shop_goods.ini |
sp2_costume_shop_info.ini |
CostumeShopGoodsManager.cpp, ioCostumeShopInfoManager.cpp |
| Banners, text ads, links | not read by the server | sp2_shop.ini |
ioShopManager.cpp |
Two facts decide how you work:
- The server owns the price and the active flag. At login it sends the hero prices to the client. The client has no loader for
sp2_item_price.ini(ioClassPrice::ApplyPricetakes a packet). - The client owns the look: name, icon, tab, order and tooltip text. If the client has no entry, the item is not shown.
If the two files disagree, the item shows wrong data or cannot be bought. After every change, compare the matching server and client entry.
Sell a hero
Section titled “Sell a hero”-
Open
sp2_item_price.inion the server. Find the block[CLASS_n], wherenis the hero number (set_codeminus 700000 insp2_setitem_info.ini). -
Set the keys:
[CLASS_5]ACTIVE = 1CASH = 2500BONUS_PESO = 0ACTIVE = 0hides the hero from the shop.CASHis the gold price of the permanent hero. The loader also readsPC_ROOM_ACTIVE,FREE_DAY_ACTIVE,TYPEandSUBSCRIPTION_TYPE. -
The file header sets the hire lengths and price factors:
[PESO_LIMIT_1],[CASH_LIMIT_1]withLIMIT_DATE(seconds) andLIMIT_PER(price factor). The peso base price is loaded from the database (the file says so). Which table holds it: not confirmed yet. -
If you add a hero beyond the current count, raise
MAX_CLASSin[INFO]. Blocks pastMAX_CLASSare never read. -
In the client’s
sp2_setitem_info.ini, check the matching[set_item<n>]:shop_order(position,0means no fixed spot),shop_mark_type(badge),need_level_type1andneed_level1(level to unlock),img_name(shop picture).
The full hero setup is in Add a hero.
Sell gear boxes
Section titled “Sell gear boxes”Gear is sold as a “machine”. The block name is [random_machine<n>], and random_machine_cnt in [common_info] must be at least the highest n.
[random_machine2]type = 5machine_code = 1package = 0need_peso1 = 9800need_cash = 0bonus_peso = 0sell_peso = 1960need_level = 5; client onlyname = Basic Gear Supplyorder = 100icon = UIIconPack10#goods_extra1group = 1active = 1need_peso1,need_peso2… are prices for each period. The matchingperiod<n>orperiod_time<n>_valuesets the length in hours.need_cashis the gold price.sell_pesois what the player gets when selling it back.- Keys after
;client onlyare read by the client. The server ignores them but the config set keeps both in one file. active = 0removes the box from the shop (ioRandomMachineGroup::LoadMachineBasicInfo,ioExtraItemInfoManager.cpp).
Sell an etc item
Section titled “Sell an etc item”Etc items are blocks [etcitem<n>]. max in [common] must be at least the highest n, otherwise the client never reads the block.
[etcitem19]name = Hero Summon Tickettype = 1000022can_sell = 0sell_peso = 600active1 = 1value1 = 1peso1 = 600cash1 = 0- Keep
typeunique. The client skips a duplicate (ioEtcItemManager::AddEtcItem) and also skips a type that the code does not know: the log showsUNKOWN ETCITEM TYPE. You cannot invent a new type in config only. peso1andcash1are the price for entryvalue1. For several offers usevalue2,peso2,cash2and so on.- The client file adds the shop look:
shop_name1,shop_order1,shop_mark_type1,shop_tab_type1(1 hero, 2 gear, 3 costume, 4 special),main_manual1,icon_name.
Take an item off sale
Section titled “Take an item off sale”| Goal | Change |
|---|---|
| Hide it, keep owned copies working | ACTIVE = 0 (hero), active = 0 (gear box, costume machine), active1 = 0 (etc item) |
| Cash only, no peso offer | peso1 = 999999999 on the server and the client |
| Remove it completely | Delete the block on both sides and lower the count key (max, machine_count, costume_cnt). Only for items nobody owns |
The shipped configs use 999999999 for “not for sale”. The shop code has no special check for that number. It is only too high to pay.
Do not delete a block that players already own. Inventory entries still point to it. Hide it with the active flag instead.
Sales and timed prices
Section titled “Sales and timed prices”The comments in the config files show the sale keys, written as sale_start_date_1, sale_end_date_1, sale_cash_1, sale_peso_1. The date format in the examples is yyyymmddhh. They are read through ioSaleManager (g_SaleMgr.LoadINI). What a sale price of -1 does: not confirmed yet. Server and client need the same dates.
Differences between versions
Section titled “Differences between versions”| 2014 | 2019 | 2021 | |
|---|---|---|---|
| Server config in the repo | ls_gamesvr\config\ and ls_mainsvr\config\ |
only shop, gacha and gear files in ls_gamesvr\config\ (the testbed holds the full set) |
ls_gamesvr\config\ and ls_mainsvr\config\ |
| Client config | inside rs.iop |
inside rs.iop |
plain config\ folder |
Costume machine active key on the server |
not read | read | read |
HERO_POSSIBLE flag in sp2_item_price.ini |
not in code | in code, behind HERO_POSSIBLE_CHECK |
in code, behind HERO_POSSIBLE_CHECK |
sp2_shop.ini on the server |
present, server does not load it | not confirmed yet | not confirmed yet |
ls_mainsvr reads the event, clover and mileage shop files (EventGoodsManager.cpp). It does not load the gacha or costume goods files. Change the ls_gamesvr copies.
Check your change
Section titled “Check your change”- Reload or restart the game server. A new client file needs a client restart.
- Open the shop. Look for the item in the right tab, with the right name and price.
- Buy it with a test account. A wrong price means the server file is not the one you edited. A missing item means the client entry is missing or its
max/*_cntcount is too low.
Not confirmed yet: the exact reload command for a running server, and the shop tabs of the 2014 and 2019 clients (their config\ is packed).
