2025-05-06 12:21:14 -04:00
### Function: AddControlEffect(Spawn, Type, OnlyAddSpawn)
2025-05-04 14:34:15 -04:00
**Description:**
2025-05-06 12:21:14 -04:00
Apply a Control Effect to a Spawn, this includes Mesmerize, Stun, Root, so on.
2025-05-04 14:34:15 -04:00
**Parameters:**
2025-05-06 12:21:14 -04:00
- `Spawn` : Spawn - The spawn or entity involved.
- `Type` : UInt8 - Control Effect Type
- `OnlyAddSpawn` : Boolean (Optional) - False by default, set to True will only apply Control Effect to Spawn. Otherwise if Spell all Spawn Targets will apply control effect.
2025-05-04 14:34:15 -04:00
**Returns:** None.
2025-05-06 12:21:14 -04:00
**Notes:**
- See CONTROL_EFFECT_TYPE defines for more details.
2025-05-04 14:34:15 -04:00
**Example:**
```lua
2025-05-06 12:21:14 -04:00
-- Example usage: Will apply Control Effect to Spawn, or if in a Spell Script all Spell Targets, Type 1 is Mesmerize.
AddControlEffect(Spawn, 1)
2025-05-04 14:34:15 -04:00
```