Skip to content

!coupon: GMs make Cash Shop coupons (row 205 NX source 2) - #1004

Merged
neeerp merged 1 commit into
masterfrom
v83/gm-coupon
Oct 25, 2026
Merged

neeerp merged 1 commit into
masterfrom
v83/gm-coupon

Conversation

@neeerp

@neeerp neeerp commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Row 205, NX source 2: coupon codes. The Cash Shop already redeemed coupons (0xE6, b072), but the only way to make one was SQL.

  • New !coupon <nx=N|mp=N|np=N|meso=N|item id[xN]>... [days=N] [code=CODE] (tier 2, GM). It takes one or more rewards, including cash items, which nothing else in the game gives.
  • With no code=, the code is 16 random letters and digits, leaving out 0/O/1/I. With no days= (1–3650), the coupon never expires.
  • Unknown items, amounts of 0 or less, and unknown keys get the usage line. A code that already exists gets "That code is taken."
  • WorldAction::MakeCoupon is resolved in runtime/src/actor/client/gm.rs by db::coupon::create. The reply names the code, and the result is logged under gm_audit.

Tests:

  • Unit test coupons_take_rewards_an_expiry_and_a_code.
  • Harness test coupons_a_gm_makes_are_redeemed: a named code, a duplicate code that is refused, and a random 3-day code. Both redeem with 0x59, and the balances come back as (700, 0, 0) and then (700, 5, 0).
  • gm_commands and cash_coupons pass.

…op coupon (NX, mesos, items incl. cash ones), with its own code or 16 random characters
@neeerp
neeerp merged commit 8504333 into master Oct 25, 2026
1 check passed
@neeerp
neeerp deleted the v83/gm-coupon branch October 25, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant