Trader cart system

Shoppi Trader and Cart Commands

Shoppi is the trader cart system for Legion economy servers. It is designed to convert Discord shop orders into Object Spawner JSON files that the server can pick up during the spawn cycle.

Feature Disabled - Work In Progress

Shoppi is not available for live use yet. It is built around generated Object Spawner JSON, an internal proxy upload, and a restart pickup model, so it is being held back until checkout, file upload, and cleanup are ready.

What Shoppi is being built to do

Owner setup

Owners prepare a shopItems.json style config for the trader. That file defines what can be sold, the item class names, price values, stock state, attachments, magazines and ammo behaviour. Legion then stores that config against the selected server and uses the assigned trader channels for pricing, item output and command paths.

The owner also decides the delivery style: force all purchases to a fixed trader location, or let players set their own delivery coordinates through the Shoppi delivery command and location lookup.

Player cart

Players use Discord commands to view prices, inspect item entries, add configured shop items to a cart, review the cart, clear it or checkout. The cart is stored against the linked player record so checkout can charge the player's economy balance and turn the exact selected items into a spawn order.

Attachments are handled as part of the item entry, so an owner can sell a weapon with the configured attachments or magazines instead of making staff manually rebuild the purchase after payment.

Object Spawner output

Checkout does not try to spawn items directly from Discord. It builds an Object Spawner JSON file from the cart and delivery rules, then sends that file through Legion's internal upload/proxy path so the server-side spawn process can pick it up on restart.

How the internal proxy generates Object Spawner JSON

At checkout, Legion reads the player's stored cart, confirms the selected server has Shoppi config loaded, checks the player's cash/bank balance, resolves the delivery coordinates and builds the Object Spawner entries for the purchased items. The generated file is named against the Discord user, for example LK_123456789.json, so the order can be tracked, added, marked active and later removed without staff mixing one player's order with another player's order.

The internal proxy side is what makes Shoppi more than a basic shop embed. Legion prepares the JSON from the paid cart, uploads it into the server mission custom path through Nitrado, and stores the order reference in the scheduler list used by the spawn cycle. The server does the actual object spawning from that JSON on restart; Discord is the cart, payment and file-generation side.

When delivery is forced to a trader location, Legion uses the configured trader position and offsets each user into a safe slot so orders do not all stack on the same exact point. When player delivery is allowed, /shoppi delivery stores the player's chosen X/Y/Z coordinates, and /locate helps linked players copy their last logged location into the delivery command. Checkout also checks restart timing and blocks uploads when the next restart is too close, because uploading an Object Spawner order too late can miss the spawn window.

Settings that control it

Area Control Purpose
Trader setup /trader setup Uploads the item/pricing config and assigns the channels used for item browsing, pricing output and Shoppi commands.
Config seed /trader config start Sends starter files and points owners toward the JSON structure expected by the trader setup.
Restart rules /trader config restarts and /shoppi mode Sets the restart interval used for checkout safety checks and controls whether Shoppi's bot-managed restart handling is opened or closed.
Delivery point /trader config location, /shoppi delivery and /locate Controls whether orders spawn at a fixed trader point, at a player-selected X/Y/Z point or at coordinates copied from the player's last logged location.
Player purchase /shoppi cart add, /shoppi cart view, /shoppi cart clear and /shoppi cart checkout Builds the cart, shows total cost, charges the linked economy record and turns the paid order into the Object Spawner JSON when checkout is allowed.

Command paths

Command Options Use
/trader config start
Starter config files. Sends the base files for trader setup.
/trader setup
Configuration file and channel setup. Uploads shop items and assigns trader channels.
/trader config restarts
Restart interval and bot restart handling. Controls restart timing used by checkout uploads.
/trader config location
Trader location or disabled forced location. Controls where Shoppi orders spawn when using fixed trader delivery.
/shoppi pricing
Pricing output. Posts pricing information for players.
/shoppi items
Item lookup. Shows item details, attachments, ammo and magazines.
/shoppi cart add
Item and quantity. Adds configured shop entries to the cart.
/shoppi cart view
No required options. Shows current cart before checkout.
/shoppi cart checkout
Checkout. Pays, uploads the Object Spawner JSON order and queues the proxy/spawn cycle when enabled.
/shoppi status
Status view. Shows Shoppi state and pending order information.
/shoppi mode
Enable or disable bot-managed restart handling. Controls whether Shoppi manages its restart/spawn cycle.
/shoppi delivery
Coordinates for item spawn. Sets player delivery coordinates when fixed trader delivery is not forced.
/locate
Linked player location lookup. Supports delivery/location checks from stored player position data.

Related Legion features

Site search

Find pages, tools, and guides

Copyright