Master Data Reference of GS2-Lottery
Reference of the format of master data and various models to be imported
{
"version": "2019-02-21",
"lotteryModels": [
{
"name": "[string]Lottery Model Name",
"metadata": "[string?]Metadata",
"mode": "[string]Drawing mode",
"method": "[string]Lottery Method",
"prizeTableName": "[string]Name of prize table",
"choicePrizeTableScriptId": "[string]GS2-Script script to determine the emission probability table"
}
],
"prizeTables": [
{
"name": "[string]Name of prize table",
"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 of request"
}
],
"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"
}
]
}
]
}
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| version | | | ✓ | 2019-02-21 | | Format version of master data |
| lotteryModels | List<LotteryModel> | | | | ~ 100 items | Lottery Model The Lottery Model is the entity that defines the emission method and emission rate in Lottery. 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. |
| prizeTables | List<PrizeTable> | | | | ~ 100 items | 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. |
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.
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| prizeTableId | string | | ✓ | | ~ 1024 chars | Prize Table GRN |
| name | string | | ✓ | | ~ 128 chars | Name of prize table |
| metadata | string | | | | ~ 128 chars | Metadata |
| prizes | List<Prize> | | ✓ | | 1 ~ 100 items | List of Prizes |
Probability
Probability
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| prize | DrawnPrize | | ✓ | | | Type of prize |
| rate | float | | ✓ | | 0 ~ 1.0 | Emission probability (0.0-1.0) |
Prize
Prize
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| prizeId | string | | ✓ | UUID | ~ 36 chars | Prize ID |
| type | String Enum enum { “action”, “prize_table” }
| | ✓ | | ~ 128 chars | Type of prize| Enumerator String Definition | Description |
|---|
| “action” | Actions to acquire prizes | | “prize_table” | Further redrawing by specifying the lottery table |
|
| acquireActions | List<AcquireAction> | {type} == “action” | ✓* | [] | 1 ~ 100 items | List of Acquire Action
* Enabled if type is “action” |
| drawnLimit | int | {type} == “action” | | | 1 ~ 100000 | Maximum number of draws
* Enabled if type is “action” |
| limitFailOverPrizeId | string | {type} == “action” and {drawnLimit} > 0 | ✓* | | ~ 32 chars | Prize ID to be discharged instead when the maximum number of drawn has been reached.
* Enabled if type is “action” and drawnLimit is greater than 0 |
| prizeTableName | string | {type} == “prize_table” | ✓* | | ~ 128 chars | Name of prize table
* Enabled if type is “prize_table” |
| weight | int | | ✓ | | 1 ~ 2147483646 | Emission Weight |
DrawnPrize
Types of prizes
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| prizeId | string | | ✓ | | ~ 36 chars | Prize ID |
| acquireActions | List<AcquireAction> | | | | 0 ~ 100 items | List of Acquire Actions |
BoxItem
Item taken out of the lottery box
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| prizeId | string | | ✓ | | ~ 128 chars | Prize Id |
| acquireActions | List<AcquireAction> | | | [] | 0 ~ 100 items | List of Acquire Action |
| remaining | int | | ✓ | | 0 ~ 2147483646 | Remaining quantity |
| initial | int | | ✓ | | 0 ~ 2147483646 | Initial quantity |
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", }
| | ✓ | | ~ 128 chars | Types of actions to be performed in the acquire action |
| request | string | | ✓ | | ~ 524288 chars | JSON of request |
VerifyActionResult
Verify action execution result
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| action | String Enum enum { "Gs2Dictionary:VerifyEntryByUserId", "Gs2Distributor:IfExpressionByUserId", "Gs2Distributor:AndExpressionByUserId", "Gs2Distributor:OrExpressionByUserId", "Gs2Enchant:VerifyRarityParameterStatusByUserId", "Gs2Experience:VerifyRankByUserId", "Gs2Experience:VerifyRankCapByUserId", "Gs2Grade:VerifyGradeByUserId", "Gs2Grade:VerifyGradeUpMaterialByUserId", "Gs2Guild:VerifyCurrentMaximumMemberCountByGuildName", "Gs2Guild:VerifyIncludeMemberByUserId", "Gs2Inventory:VerifyInventoryCurrentMaxCapacityByUserId", "Gs2Inventory:VerifyItemSetByUserId", "Gs2Inventory:VerifyReferenceOfByUserId", "Gs2Inventory:VerifySimpleItemByUserId", "Gs2Inventory:VerifyBigItemByUserId", "Gs2Limit:VerifyCounterByUserId", "Gs2Matchmaking:VerifyIncludeParticipantByUserId", "Gs2Mission:VerifyCompleteByUserId", "Gs2Mission:VerifyCounterValueByUserId", "Gs2Ranking2:VerifyGlobalRankingScoreByUserId", "Gs2Ranking2:VerifyClusterRankingScoreByUserId", "Gs2Ranking2:VerifySubscribeRankingScoreByUserId", "Gs2Schedule:VerifyTriggerByUserId", "Gs2Schedule:VerifyEventByUserId", "Gs2SerialKey:VerifyCodeByUserId", "Gs2Stamina:VerifyStaminaValueByUserId", "Gs2Stamina:VerifyStaminaMaxValueByUserId", "Gs2Stamina:VerifyStaminaRecoverIntervalMinutesByUserId", "Gs2Stamina:VerifyStaminaRecoverValueByUserId", "Gs2Stamina:VerifyStaminaOverflowValueByUserId", }
| | ✓ | | ~ 128 chars | Types of actions to be performed in the verify task |
| verifyRequest | string | | ✓ | | ~ 524288 chars | JSON of request |
| statusCode | int | | | | 0 ~ 999 | Status code |
| verifyResult | string | | | | ~ 1048576 chars | Result payload |
ConsumeActionResult
Consume action execution result
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| action | String Enum enum { "Gs2AdReward:ConsumePointByUserId", "Gs2Dictionary:DeleteEntriesByUserId", "Gs2Enhance:DeleteProgressByUserId", "Gs2Exchange:DeleteAwaitByUserId", "Gs2Experience:SubExperienceByUserId", "Gs2Experience:SubRankCapByUserId", "Gs2Formation:SubMoldCapacityByUserId", "Gs2Grade:SubGradeByUserId", "Gs2Guild:DecreaseMaximumCurrentMaximumMemberCountByGuildName", "Gs2Idle:DecreaseMaximumIdleMinutesByUserId", "Gs2Inbox:OpenMessageByUserId", "Gs2Inbox:DeleteMessageByUserId", "Gs2Inventory:ConsumeItemSetByUserId", "Gs2Inventory:ConsumeSimpleItemsByUserId", "Gs2Inventory:ConsumeBigItemByUserId", "Gs2JobQueue:DeleteJobByUserId", "Gs2Limit:CountUpByUserId", "Gs2LoginReward:MarkReceivedByUserId", "Gs2Mission:ReceiveByUserId", "Gs2Mission:BatchReceiveByUserId", "Gs2Mission:DecreaseCounterByUserId", "Gs2Mission:ResetCounterByUserId", "Gs2Money:WithdrawByUserId", "Gs2Money:RecordReceipt", "Gs2Money2:WithdrawByUserId", "Gs2Money2:VerifyReceiptByUserId", "Gs2Quest:DeleteProgressByUserId", "Gs2Ranking2:CreateGlobalRankingReceivedRewardByUserId", "Gs2Ranking2:CreateClusterRankingReceivedRewardByUserId", "Gs2Schedule:DeleteTriggerByUserId", "Gs2SerialKey:UseByUserId", "Gs2Showcase:IncrementPurchaseCountByUserId", "Gs2SkillTree:MarkRestrainByUserId", "Gs2Stamina:DecreaseMaxValueByUserId", "Gs2Stamina:ConsumeStaminaByUserId", }
| | ✓ | | ~ 128 chars | Types of actions to be performed in the consume action |
| consumeRequest | string | | ✓ | | ~ 524288 chars | JSON of request |
| statusCode | int | | | | 0 ~ 999 | Status code |
| consumeResult | string | | | | ~ 1048576 chars | Result payload |
AcquireActionResult
Acquire action execution result
| 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", }
| | ✓ | | ~ 128 chars | Types of actions to be performed in the acquire action |
| acquireRequest | string | | ✓ | | ~ 524288 chars | JSON of request |
| statusCode | int | | | | 0 ~ 999 | Status code |
| acquireResult | string | | | | ~ 1048576 chars | Result payload |
TransactionResult
Transaction execution results
Transaction execution results executed using server-side transaction auto-execution functionality
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| transactionId | string | | ✓ | | 36 ~ 36 chars | Transaction ID |
| verifyResults | List<VerifyActionResult> | | | | 0 ~ 10 items | List of verify action execution results |
| consumeResults | List<ConsumeActionResult> | | | [] | 0 ~ 10 items | List of consume action execution results |
| acquireResults | List<AcquireActionResult> | | | [] | 0 ~ 100 items | List of acquire action execution results |
| hasError | bool | | ✓ | false | | Whether an error occurred during transaction execution |
LotteryModel
Lottery Model
The Lottery Model is the entity that defines the emission method and emission rate in Lottery.
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.
| Type | Condition | Required | Default | Value Limits | Description |
|---|
| lotteryModelId | string | | ✓ | | ~ 1024 chars | Prize Table GRN |
| name | string | | ✓ | | ~ 128 chars | Lottery Model Name |
| metadata | string | | | | ~ 2048 chars | Metadata |
| mode | String Enum enum { “normal”, “box” }
| | ✓ | | ~ 128 chars | Drawing mode| Enumerator String Definition | Description |
|---|
| “normal” | Normal | | “box” | Box |
|
| method | String Enum enum { “prize_table”, “script” }
| | ✓ | | ~ 128 chars | Lottery Method| Enumerator String Definition | Description |
|---|
| “prize_table” | Static lottery table | | “script” | GS2-Script dynamic lottery table |
|
| prizeTableName | string | {method} == “prize_table” | ✓* | | ~ 128 chars | Name of prize table
* Enabled if method is “prize_table” |
| choicePrizeTableScriptId | string | {method} == “script” | ✓* | | ~ 1024 chars | GS2-Script script to determine the emission probability table
* Enabled if method is “script” |