GS2-Lottery Master Data Reference

Reference for the master data format and the models to be imported

Master Data Format

{
  "version": "2019-02-21",
  "lotteryModels": [
    {
      "name": "[string]Lottery Model name",
      "metadata": "[string?]Metadata",
      "mode": "[string (enum)]Drawing Mode",
      "method": "[string (enum)]Prize Table Selection Method",
      "prizeTableName": "[string]Prize Table Name",
      "choicePrizeTableScriptId": "[string]GS2-Script script GRN to determine the Prize Table"
    }
  ],
  "prizeTables": [
    {
      "name": "[string]Prize Table name",
      "metadata": "[string?]Metadata",
      "prizes": [
        {
          "prizeId": "[string]Prize ID",
          "type": "[string]Prize Type",
          "acquireActions": [
            {
              "action": "[string]Type of Acquire Action",
              "request": "[string]JSON string of the request used when executing the action"
            }
          ],
          "drawnLimit": "[int?]Maximum Number of Draws",
          "limitFailOverPrizeId": "[string]Limit Failover Prize ID",
          "prizeTableName": "[string]Prize Table Name",
          "weight": "[int]Draw Weight"
        }
      ]
    }
  ]
}
Type Condition Required Default Value Limits Description
version string
2019-02-21 Format version of master data
lotteryModels List<LotteryModel> ~ 100 items Lottery Model
Lottery Model is an entity that defines the draw method and how to reference the draw table.

Two draw methods are available: Normal Draw, which performs draws with a fixed probability each time, and Box Draw, where a predetermined number of prizes are placed in a box, and prizes are drawn from the box one by one with each draw.

The lottery process uses a Prize Table.
GS2-Script can be used to dynamically select the Prize Table with a different table when multiple drawings are performed.
By using this mechanism, it is possible to apply a different Prize Table only once in a 10-round gacha.
prizeTables List<PrizeTable> ~ 100 items Prize Table
A prize can either specify an acquire action directly or reference another Prize Table.
By nesting Prize Tables, you can configure a two-step drawing process—for example, the first step determines the rarity such as SSR, SR, or R, and the second step selects a specific item corresponding to that rarity.
This structure makes it easier to manage and adjust the overall distribution rates for each rarity in the game.

Models

PrizeTable

Prize Table

A prize can either specify an acquire action directly or reference another Prize Table. By nesting Prize Tables, you can configure a two-step drawing process—for example, the first step determines the rarity such as SSR, SR, or R, and the second step selects a specific item corresponding to that rarity. This structure makes it easier to manage and adjust the overall distribution rates for each rarity in the game.

Type Condition Required Default Value Limits Description
prizeTableId string
*
~ 1024 chars Prize Table GRN
* Set automatically by the server
name string
~ 128 chars Prize Table name
Prize Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
prizes List<Prize>
1 ~ 100 items Prizes
The list of prizes in this Prize Table. Each prize defines its draw weight (probability), the actions to execute when drawn, and optionally a draw limit. The actual draw probability of each prize is calculated as its weight divided by the total weight of all prizes in the table.

Prize

Prize

A single prize entry within a Prize Table. A prize can either directly specify acquire actions (granting items, currency, etc.) or reference another Prize Table to perform a nested draw. Each prize has a draw weight that determines its relative probability of being drawn.

Type Condition Required Default Value Limits Description
prizeId string
UUID ~ 36 chars Prize ID
A unique identifier for this prize within the Prize Table. Used to track draw limits and as a reference when specifying failover prizes.
type string (enum)
enum {
  “action”,
  “prize_table”
}
Prize Type
Determines whether this prize directly grants rewards or delegates to another Prize Table. “action” specifies acquire actions to execute when drawn. “prize_table” references another Prize Table for a nested drawing (e.g., first draw determines rarity, second draw determines specific item).
DefinitionDescription
“action”Acquire Actions for the prize
“prize_table”Delegates the draw to another Prize Table (performs a nested draw).
acquireActions List<AcquireAction> {type} == “action” [] 1 ~ 100 items List of Acquire Actions
The list of acquire actions to execute when this prize is drawn. Multiple actions can be specified to grant several rewards at once (e.g., an item and currency together).
* Enabled only if type is “action”
drawnLimit int {type} == “action” 1 ~ 1000000 Maximum Number of Draws
The maximum number of times this prize can be drawn across all users. When the limit is reached, the failover prize (limitFailOverPrizeId) is drawn instead. Used to implement limited-quantity prizes such as jackpot items.
* Enabled only if type is “action”
limitFailOverPrizeId string {type} == “action” and {drawnLimit} > 0
✓*
~ 32 chars Limit Failover Prize ID
The ID of the prize to draw instead when this prize’s draw limit (drawnLimit) has been reached. Must reference another prize within the same Prize Table.
* Required if type is “action” and drawnLimit is greater than 0
prizeTableName string {type} == “prize_table”
✓*
~ 128 chars Prize Table Name
The name of the Prize Table to delegate the draw to. Used when the prize type is “prize_table” for nested drawing.
* Required if type is “prize_table”
weight int
1 ~ 2147483646 Draw Weight
The relative weight of this prize in the Prize Table. The actual draw probability is calculated as this prize’s weight divided by the total weight of all prizes in the table. For example, if three prizes have weights of 70, 20, and 10, their draw probabilities are 70%, 20%, and 10% respectively.

AcquireAction

Acquire Action

Type Condition Required Default Value Limits Description
action string (enum)
enum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Schedule:ExtendTriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
Type of Acquire Action
request string
~ 524288 chars JSON string of the request used when executing the action

LotteryModel

Lottery Model

Lottery Model is an entity that defines the draw method and how to reference the draw table.

Two draw methods are available: Normal Draw, which performs draws with a fixed probability each time, and Box Draw, where a predetermined number of prizes are placed in a box, and prizes are drawn from the box one by one with each draw.

The lottery process uses a Prize Table. GS2-Script can be used to dynamically select the Prize Table with a different table when multiple drawings are performed. By using this mechanism, it is possible to apply a different Prize Table only once in a 10-round gacha.

Type Condition Required Default Value Limits Description
lotteryModelId string
*
~ 1024 chars Lottery Model GRN
* Set automatically by the server
name string
~ 128 chars Lottery Model name
Lottery Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
metadata string ~ 2048 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
mode string (enum)
enum {
  “normal”,
  “box”
}
Drawing Mode
Select the prize drawing method. “normal” performs draws with a fixed probability each time (prizes can be drawn repeatedly). “box” places a predetermined number of prizes in a virtual box, and each draw removes a prize from the box (guaranteeing all prizes will eventually be drawn).
DefinitionDescription
“normal”Normal Draw
“box”Box Draw
method string (enum)
enum {
  “prize_table”,
  “script”
}
Prize Table Selection Method
Determines how the Prize Table is referenced. “prize_table” uses a statically specified Prize Table. “script” uses GS2-Script to dynamically select the Prize Table at draw time, enabling scenarios like applying a different Prize Table for one draw in a 10-draw gacha.
DefinitionDescription
“prize_table”Static Prize Table
“script”Dynamically selected Prize Table using GS2-Script
prizeTableName string {method} == “prize_table”
✓*
~ 128 chars Prize Table Name
The name of the Prize Table to use for this lottery model. Required when the lottery method is “prize_table”.
* Required if method is “prize_table”
choicePrizeTableScriptId string {method} == “script”
✓*
~ 1024 chars GS2-Script script GRN to determine the Prize Table
Script Trigger Reference - choicePrizeTable
* Required if method is “script”