Master Data Reference of GS2-Lottery

Reference of the format of master data and various 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]Name of prize table",
      "choicePrizeTableScriptId": "[string]GS2-Script script GRN to determine the emission probability table"
    }
  ],
  "prizeTables": [
    {
      "name": "[string]Prize Table Name",
      "metadata": "[string?]Metadata",
      "prizes": [
        {
          "prizeId": "[string]Prize ID",
          "type": "[string]Type of prize",
          "acquireActions": [
            {
              "action": "[string]Types of actions to be performed in the acquire action",
              "request": "[string]JSON string of the request used when executing the action"
            }
          ],
          "drawnLimit": "[int?]Maximum number of draws",
          "limitFailOverPrizeId": "[string]Prize ID to be discharged instead when the maximum number of drawn has been reached.",
          "prizeTableName": "[string]Name of prize table",
          "weight": "[int]Emission Weight"
        }
      ]
    }
  ]
}
TypeConditionRequiredDefaultValue LimitsDescription
versionstring
2019-02-21Format version of master data
lotteryModelsList<LotteryModel>~ 100 itemsLottery Model
The 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 probability table.
By nesting probability 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 probability table. By nesting probability 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
* Automatically configured on 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 itemsList of Prizes

Prize

Prize

TypeConditionRequiredDefaultValue LimitsDescription
prizeIdstring
UUID~ 36 charsPrize ID
typeString Enum
enum {
  “action”,
  “prize_table”
}
Type of prize
Enumerator String DefinitionDescription
“action”Actions to acquire prizes
“prize_table”Further redrawing by specifying the lottery table
acquireActionsList<AcquireAction>{type} == “action”
✓*
[]1 ~ 100 itemsList of Acquire Action
* Required if type is “action”
drawnLimitint{type} == “action”1 ~ 1000000Maximum number of draws
* Enabled if type is “action”
limitFailOverPrizeIdstring{type} == “action” and {drawnLimit} > 0
✓*
~ 32 charsPrize ID to be discharged instead when the maximum number of drawn has been reached.
* Required if type is “action” and drawnLimit is greater than 0
prizeTableNamestring{type} == “prize_table”
✓*
~ 128 charsName of prize table
* Required if type is “prize_table”
weightint
1 ~ 2147483646Emission Weight

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",
}
Types of actions to be performed in the acquire action
requeststring
~ 524288 charsJSON string of the request used when executing the action

LotteryModel

Lottery Model

The 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
* Automatically configured on 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
Enumerator String DefinitionDescription
“normal”Normal
“box”Box
methodString Enum
enum {
  “prize_table”,
  “script”
}
Lottery Method
Enumerator String DefinitionDescription
“prize_table”Static lottery table
“script”GS2-Script dynamic lottery table
prizeTableNamestring{method} == “prize_table”
✓*
~ 128 charsName of prize table
* Required if method is “prize_table”
choicePrizeTableScriptIdstring{method} == “script”
✓*
~ 1024 charsGS2-Script script GRN to determine the emission probability table
* Required if method is “script”