Execute_AddBuff
Description
Adds a buff to the BaseObject character, or transfers an existing buff from NonBaseObject to BaseObject. When S2 is None (Create Mode), a new buff with the specified BuffId is created and added to BaseObject's BuffComponent, with initiator and reason information populated from the script context. When S2 is set (Transfer Mode), the buff identified by S1 is moved from NonBaseObject to BaseObject.
Note
In Transfer Mode, the buff is moved (not duplicated) from NonBaseObject to BaseObject. In Create Mode, if the script reason is Interaction, Talk, or Action, additional context such as InteractionBagId and CreateBuffReason is captured from the Self character's InteractionComponent.
Parameters
| Parameter | Description |
|---|---|
| BaseObject | The character entity that will receive the buff (Self or Target) |
| S1 | Buff ID to add or transfer (Buff.json Id) |
| S2 | If set, triggers Transfer Mode: moves buff from NonBaseObject to BaseObject |
Examples
| Description | BaseObject | Command | S1 | S2 |
|---|---|---|---|---|
| Add "Happy" buff to self character | Self | AddBuff | Happy | |
| Add "Tired" buff to target character | Target | AddBuff | Tired | |
| Transfer "Sick" buff from NonBaseObject to self | Self | AddBuff | Sick | ReserveDuration |