Trigger Reference of GS2-Lottery Script

Reference of event triggers that call extended scripts

lottery

Event trigger to call GS2-Script when drawing.

Request

TypeDescription
namespaceNamespaceNamespace
lotteryModelLotteryModelLottery Model Name
drawnPrizesDrawnPrize[]List of Drawn Prizes
boxItemsBoxItemsList of items taken out of the box

Result

TypeRequireDefaultLimitationDescription
permitbool
Allow lottery
overrideDrawnPrizesDrawnPrize[]~ 1000 itemsList of Drawn Prizes

Implementation Example

namespace = args.namespace
lotteryModel = args.lotteryModel
drawnPrizes = args.drawnPrizes
boxItems = args.boxItems

result = {
  permit=permit,
  overrideDrawnPrizes=overrideDrawnPrizes
}

choicePrizeTable

Event trigger to call GS2-Script when A script that dynamically changes the lottery table.

Request

TypeDescription
namespaceNamespaceNamespace
lotteryModelLotteryModelCost increase type exchange rate model
userIdstringUser Id
countintNumber of draws

Result

TypeRequireDefaultLimitationDescription
prizeTableNamesstring[]
1 ~ 1000 itemsList of prize table names to be used for the lottery

Implementation Example

namespace = args.namespace
lotteryModel = args.lotteryModel
userId = args.userId
count = args.count

result = {
  prizeTableNames=prizeTableNames
}