GS2-Enhance Script トリガー リファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
enhance
強化実行
同期実行スクリプト
強化実行処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| rateModel | RateModel | 強化レートモデル |
| targetItemSetId | string | 強化対象のアイテムセットのGRN |
| bonusRate | float | 経験値ボーナスの倍率(1.0=ボーナスなし) |
| experienceValue | long | 入手経験値量 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 強化実行を許可するか | ||
| overrideExperienceValue | long | 0 ~ 2147483645 | 上書きする入手経験値量 |
実装例
-- Request
local namespace = args.namespace
local rateModel = args.rateModel
local targetItemSetId = args.targetItemSetId
local bonusRate = args.bonusRate
local experienceValue = args.experienceValue
-- Business logic:
local permit = true
local overrideExperienceValue = 0
-- Result
result = {
permit=permit,
overrideExperienceValue=overrideExperienceValue
}非同期実行スクリプト
強化実行処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| rateModel | RateModel | 強化レートモデル |
| targetItemSetId | string | 強化対象のアイテムセットのGRN |
| bonusRate | float | 経験値ボーナスの倍率(1.0=ボーナスなし) |
| experienceValue | long | 入手経験値量 |
実装例
-- Request
local namespace = args.namespace
local rateModel = args.rateModel
local targetItemSetId = args.targetItemSetId
local bonusRate = args.bonusRate
local experienceValue = args.experienceValue
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}