1
0
EQ2Emu/docs/lua_functions/SetTarget.md
2025-05-28 21:48:33 -04:00

18 lines
599 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### Function: SetTarget(Originator, Target)
**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.
**Parameters:**
`Originator`: Spawn The entity whose target will be changed.
`Target`: Spawn The entity to set as the new target.
**Returns:** None.
**Example:**
```lua
-- Example usage (boss switches target to a healer)
SetTarget(BossNPC, HealerNPC)
SetInfoFlag(BossNPC) -- assures we send the changes out immediately versus waiting for process loop
```