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]Lottery 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 action to be executed in the 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"
        }
      ]
    }
  ]
}
TypeConditionRequiredDefaultValue LimitsDescription
versionstring
2019-02-21Format version of master data
lotteryModelsList<LotteryModel>~ 100 itemsLottery Model
Lottery Model is an entity that defines the draw method and how to reference the draw table.

Two draw methods are available: Standard 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 replace a part of 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.
prizeTablesList<PrizeTable>~ 100 itemsPrize 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.

Model

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.

TypeConditionRequiredDefaultValue LimitsDescription
prizeTableIdstring
*
~ 1024 charsPrize Table GRN
* Set automatically by the server
namestring
~ 128 charsPrize Table name
Prize Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 128 charsMetadata
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.
prizesList<Prize>
1 ~ 100 itemsPrizes
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 for nested drawing. Each prize has a draw weight that determines its relative probability of being drawn.

TypeConditionRequiredDefaultValue LimitsDescription
prizeIdstring
UUID~ 36 charsPrize ID
A unique identifier for this prize within the Prize Table. Used to track draw limits and as a reference when specifying failover prizes.
typeString 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”Actions to acquire prizes
“prize_table”Delegates the draw to another Prize Table.
acquireActionsList<AcquireAction>{type} == “action”[]1 ~ 100 itemsAcquire 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).
* Applicable only if type is “action”
drawnLimitint{type} == “action”1 ~ 1000000Maximum 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.
* Applicable only if type is “action”
limitFailOverPrizeIdstring{type} == “action” and {drawnLimit} > 0
✓*
~ 32 charsLimit 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
prizeTableNamestring{type} == “prize_table”
✓*
~ 128 charsPrize 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”
weightint
1 ~ 2147483646Draw 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

TypeConditionRequiredDefaultValue LimitsDescription
actionString 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 action to be executed in the Acquire Action
requeststring
~ 524288 charsJSON 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: Standard 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 replace a part of 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.

TypeConditionRequiredDefaultValue LimitsDescription
lotteryModelIdstring
*
~ 1024 charsLottery Model GRN
* Set automatically by the server
namestring
~ 128 charsLottery Model name
Lottery Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
metadatastring~ 2048 charsMetadata
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.
modeString 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
“box”Box
methodString Enum
enum {
  “prize_table”,
  “script”
}
Lottery 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”GS2-Script script GRN to dynamically select the Prize Table
prizeTableNamestring{method} == “prize_table”
✓*
~ 128 charsPrize 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”
choicePrizeTableScriptIdstring{method} == “script”
✓*
~ 1024 charsGS2-Script script GRN to determine the Prize Table
Script Trigger Reference - choicePrizeTable
* Required if method is “script”