GS2-Buff Script Trigger Reference

Reference of event triggers that call extended scripts

Trigger

apply

Buff application

Synchronous Execution Script

The script is executed synchronously before the buff application process.

Request
TypeDescription
namespaceNamespaceNamespace
buffEntryModelBuffEntryModelBuff Entry Model
userIdstringUser ID
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow the application of buffs
overrideBuffRatefloat
0 ~ 100Override rate applied to the buff
Implementation Example
-- Request
local namespace = args.namespace
local buffEntryModel = args.buffEntryModel
local userId = args.userId

-- Business logic:
local permit = true
local overrideBuffRate = 0

-- Result
result = {
  permit=permit,
  overrideBuffRate=overrideBuffRate
}

Asynchronous Execution Script

The script is executed asynchronously after the buff application process.

Request
TypeDescription
namespaceNamespaceNamespace
buffEntryModelBuffEntryModelBuff Entry Model
userIdstringUser ID
Implementation Example
-- Request
local namespace = args.namespace
local buffEntryModel = args.buffEntryModel
local userId = args.userId

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}