1
0
EQ2Emu/docs/lua_functions/GetMostHated.md

25 lines
700 B
Markdown
Raw 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: GetMostHated(NPC)
**Description:**
Retrieves the spawn that currently has the highest hate (aggro) on the specified NPCs hate list. This is usually the NPCs current primary target in combat.
**Parameters:**
- `spawn` (Spawn) - Spawn object representing `spawn`.
**Example:**
```lua
-- From SpawnScripts/A Meeting of the Minds/Borxx.lua
function borxxConvo5(NPC, Spawn)
local overlord = GetSpawn(NPC, 5560003)
local hated = GetMostHated(overlord)
local braxx = GetSpawn(NPC, 5560004)
local brixx = GetSpawn(NPC, 5560005)
FaceTarget(NPC, overlord)
Say(NPC, "So be it.")
Attack(NPC, hated)
Attack(braxx, hated)
Attack(brixx, hated)
end
```