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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| buffEntryModel | BuffEntryModel | Buff Entry Model |
| userId | string | User ID |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow the application of buffs | ||
| overrideBuffRate | float | ✓ | 0 ~ 100 | Override 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| buffEntryModel | BuffEntryModel | Buff Entry Model |
| userId | string | User 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 = {
}