From Divinity Engine Wiki
- call SetCanJoinCombat((GUIDSTRING)_Target, (INTEGER)_Enabled)
Sets whether or not _Target can enter combats depending on whether _Enabled is 0 or 1.
- Joining a combat means "participating in the turn order of a combat", i.e., not moving around in real time while nearby characters/items are in a combat. It does not mean that the character/item will also actively participate in the combat (perform actions during its turns in a combat). Controlling whether or not a character/item in a combat will do so happens using the SetCanFight call.
- If _Target is currently in a combat and 0 is passed to _Enabled, _Target will leave this combat immediately.
- Disabling this can easily wreak havoc due to interactions with other systems, such as the crime system.
- If you disable this for a player during a scripted event, ensure it is re-enabled in all possible exits!