eq2emu/docs/lua_functions/SetTarget.md

18 lines
599 B
Markdown
Raw Permalink Normal View History

2025-05-28 21:48:33 -04:00
### Function: SetTarget(Originator, Target)
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
**Description:** Forces one spawn (Originator) to target another (Target). This can make an NPC switch targets mid-combat or cause a players target to change under certain conditions.
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
**Parameters:**
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
`Originator`: Spawn The entity whose target will be changed.
`Target`: Spawn The entity to set as the new target.
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
**Returns:** None.
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
**Example:**
2025-05-15 09:50:31 -04:00
2025-05-28 21:48:33 -04:00
```lua
2025-05-15 09:50:31 -04:00
-- Example usage (boss switches target to a healer)
SetTarget(BossNPC, HealerNPC)
2025-05-28 21:48:33 -04:00
SetInfoFlag(BossNPC) -- assures we send the changes out immediately versus waiting for process loop
```