Skip to main content

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

ParameterDescription
BaseObjectThe character entity that will receive the buff (Self or Target)
S1Buff ID to add or transfer (Buff.json Id)
S2If set, triggers Transfer Mode: moves buff from NonBaseObject to BaseObject

Examples

DescriptionBaseObjectCommandS1S2
Add "Happy" buff to self characterSelfAddBuffHappy
Add "Tired" buff to target characterTargetAddBuffTired
Transfer "Sick" buff from NonBaseObject to selfSelfAddBuffSickReserveDuration