1
0
EQ2Emu/docs/lua_functions/GetMostHated.md
2025-05-13 22:57:49 -04:00

17 lines
618 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:
NPC: Spawn The NPC whose hate list to examine.
Returns: Spawn The entity with top hate on the NPC (often the tank or highest damage dealer), or nil if the NPC has no hate list.
Example:
-- Example usage (make the boss shout at whoever has top aggro)
local topAggro = GetMostHated(BossNPC)
if topAggro ~= nil then
Say(BossNPC, "I will destroy you, " .. GetName(topAggro) .. "!")
end