> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-Experience 스크립트 트리거 레퍼런스

확장 스크립트를 호출하는 이벤트 트리거의 레퍼런스



## 트리거

### rankCapScript



**관련 메서드:**
describeStatuses - 상태 목록 취득
describeStatusesByUserId - 사용자 ID를 지정하여 상태 목록 취득
getStatus - 상태 취득
getStatusByUserId - 사용자 ID를 지정하여 상태 취득
getStatusWithSignature - 서명 정보와 함께 상태 취득
getStatusWithSignatureByUserId - 사용자 ID를 지정하여 서명 정보와 함께 상태 취득
addExperienceByUserId - 사용자 ID를 지정하여 경험치를 가산
subExperience - 경험치를 감산
subExperienceByUserId - 사용자 ID를 지정하여 경험치를 감산
addRankCapByUserId - 사용자 ID를 지정하여 랭크 캡을 가산
subRankCap - 랭크 캡을 감산
subRankCapByUserId - 사용자 ID를 지정하여 랭크 캡을 감산
deleteStatusByUserId - 상태를 삭제
verifyRank - 랭크를 검증
verifyRankByUserId - 사용자 ID를 지정하여 랭크를 검증
verifyRankCap - 랭크 캡을 검증
verifyRankCapByUserId - 사용자 ID를 지정하여 랭크 캡을 검증
multiplyAcquireActionsByUserId - 사용자 ID를 지정하여 경험치 대상 프로퍼티의 랭크에 따라 리소스를 가산


#### 동기 실행 스크립트

 처리 전에, 스크립트가 동기 실행됩니다.

##### Request

| | 타입 | 설명 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | 네임스페이스 |
| experienceModel | [ExperienceModel](../sdk/#experiencemodel) | 경험치 모델 |
| userId | string | 사용자ID |
| propertyId | string | 프로퍼티ID<br>사용자 스코프 내에서 이 스테이터스를 고유하게 식별하는 개발자 정의 식별자입니다. 경험치를 보유한 GS2-Inventory의 아이템 세트 GRN이나 GS2-Dictionary의 엔트리 GRN 끝에 경험치 모델의 접미사를 붙인 값을 사용할 것을 권장합니다. |

##### Result

|  | 타입 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- |
| rankCap | long | ✓ |  | 0 ~ 2147483645 | 랭크 캡 |

##### 구현 예제


**Lua**
```lua

-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local userId = args.userId
local propertyId = args.propertyId

-- Business logic:
local rankCap = 0

-- Result
result = {
  rankCap=rankCap
}
```


---
  
### changeExperience



**관련 메서드:**
addExperienceByUserId - 사용자 ID를 지정하여 경험치를 가산
subExperience - 경험치를 감산
subExperienceByUserId - 사용자 ID를 지정하여 경험치를 감산
setExperienceByUserId - 사용자 ID를 지정하여 경험치를 설정


#### 동기 실행 스크립트

 처리 전에, 스크립트가 동기 실행됩니다.

##### Request

| | 타입 | 설명 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | 네임스페이스 |
| experienceModel | [ExperienceModel](../sdk/#experiencemodel) | 경험치 모델 |
| status | [Status](../sdk/#status) | 변화 전 상태 |
| afterStatus | [Status](../sdk/#status) | 변화 후 상태 |

##### Result

|  | 타입 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | 경험치 변화를 허용할지 여부 |
| overrideExperienceValue | long | ✓ |  | 0 ~ 2147483645 | 덮어쓸 경험치 |

##### 구현 예제


**Lua**
```lua

-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status
local afterStatus = args.afterStatus

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

-- Result
result = {
  permit=permit,
  overrideExperienceValue=overrideExperienceValue
}
```


#### 비동기 실행 스크립트

 처리 후에, 스크립트가 비동기 실행됩니다.

##### Request

| | 타입 | 설명 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | 네임스페이스 |
| experienceModel | [ExperienceModel](../sdk/#experiencemodel) | 경험치 모델 |
| oldStatus | [Status](../sdk/#status) | 변화 전 상태 |
| status | [Status](../sdk/#status) | 상태 |


##### 구현 예제


**Lua**
```lua

-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local oldStatus = args.oldStatus
local status = args.status

-- 비동기 스크립트는 일반적으로 API 응답에 영향을 주지 않습니다.
-- 로그 출력이나 분석, 외부 알림 등에 사용됩니다.

result = {
}
```


---
  
### changeRank



**관련 메서드:**
addExperienceByUserId - 사용자 ID를 지정하여 경험치를 가산
subExperience - 경험치를 감산
subExperienceByUserId - 사용자 ID를 지정하여 경험치를 감산


#### 동기 실행 스크립트

 처리 전에, 스크립트가 동기 실행됩니다.

##### Request

| | 타입 | 설명 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | 네임스페이스 |
| experienceModel | [ExperienceModel](../sdk/#experiencemodel) | 경험치 모델 |
| status | [Status](../sdk/#status) | 변화 전 상태 |
| afterStatus | [Status](../sdk/#status) | 변화 후 상태 |

##### Result

|  | 타입 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | 랭크 변화를 허용할지 여부 |

##### 구현 예제


**Lua**
```lua

-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status
local afterStatus = args.afterStatus

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### 비동기 실행 스크립트

 처리 후에, 스크립트가 비동기 실행됩니다.

##### Request

| | 타입 | 설명 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | 네임스페이스 |
| experienceModel | [ExperienceModel](../sdk/#experiencemodel) | 경험치 모델 |
| oldStatus | [Status](../sdk/#status) | 변화 전 상태 |
| status | [Status](../sdk/#status) | 상태 |


##### 구현 예제


**Lua**
```lua

-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local oldStatus = args.oldStatus
local status = args.status

-- 비동기 스크립트는 일반적으로 API 응답에 영향을 주지 않습니다.
-- 로그 출력이나 분석, 외부 알림 등에 사용됩니다.

result = {
}
```


---
  
### changeRankCap



**관련 메서드:**
addRankCapByUserId - 사용자 ID를 지정하여 랭크 캡을 가산
setRankCapByUserId - 사용자 ID를 지정하여 랭크 캡을 설정


#### 동기 실행 스크립트

 처리 전에, 스크립트가 동기 실행됩니다.

##### Request

| | 타입 | 설명 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | 네임스페이스 |
| experienceModel | [ExperienceModel](../sdk/#experiencemodel) | 경험치 모델 |
| status | [Status](../sdk/#status) | 변화 전 상태 |
| afterStatus | [Status](../sdk/#status) | 변화 후 상태 |

##### Result

|  | 타입 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | 랭크 캡 변화를 허용할지 여부 |
| overrideRankCapValue | long | ✓ |  | 0 ~ 2147483645 | 새로운 랭크 캡 |

##### 구현 예제


**Lua**
```lua

-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status
local afterStatus = args.afterStatus

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

-- Result
result = {
  permit=permit,
  overrideRankCapValue=overrideRankCapValue
}
```


#### 비동기 실행 스크립트

 처리 후에, 스크립트가 비동기 실행됩니다.

##### Request

| | 타입 | 설명 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | 네임스페이스 |
| experienceModel | [ExperienceModel](../sdk/#experiencemodel) | 경험치 모델 |
| status | [Status](../sdk/#status) | 상태 |


##### 구현 예제


**Lua**
```lua

-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status

-- 비동기 스크립트는 일반적으로 API 응답에 영향을 주지 않습니다.
-- 로그 출력이나 분석, 외부 알림 등에 사용됩니다.

result = {
}
```


---
  
### overflowExperience



**관련 메서드:**
addExperienceByUserId - 사용자 ID를 지정하여 경험치를 가산
subExperience - 경험치를 감산
subExperienceByUserId - 사용자 ID를 지정하여 경험치를 감산
setExperienceByUserId - 사용자 ID를 지정하여 경험치를 설정
addRankCapByUserId - 사용자 ID를 지정하여 랭크 캡을 가산
setRankCapByUserId - 사용자 ID를 지정하여 랭크 캡을 설정


#### 동기 실행 스크립트

 처리 전에, 스크립트가 동기 실행됩니다.

##### Request

| | 타입 | 설명 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | 네임스페이스 |
| experienceModel | [ExperienceModel](../sdk/#experiencemodel) | 경험치 모델 |
| status | [Status](../sdk/#status) | 상태 |
| overflowExperienceValue | long | 경험치 오버플로우 값 |

##### Result

|  | 타입 | 필수 | 기본값 | 값 제한 | 설명 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | 경험치 오버플로우를 허용할지 여부 |

##### 구현 예제


**Lua**
```lua

-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status
local overflowExperienceValue = args.overflowExperienceValue

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


---
  



