Not quite, give this a go. Hopefully despite the functions having the word target in them they will work on mouseover too.
Lua Code:
local addonName, addon = ...
local llRI = nil
local npcToWatch = 205089
local function OnEvent(self,event,...)
if event == "UPDATE_MOUSEOVER_UNIT" then
local guid = UnitGUID("mouseover")
if guid == nil then return end
local guidType, _, _, _, _, npc_id, _ = strsplit("-",guid)
if guidType == "Creature" and tonumber(npc_id) == npcToWatch then
if GetRaidTargetIndex("mouseover") == nil then
if llRI == nil then
llRI = 0
end
llRI = (llRI % 8) + 1
if GetRaidTargetIndex("mouseover") ~= llRI then
SetRaidTarget("mouseover", llRI)
PlaySound(SOUNDKIT.GM_CHAT_WARNING)
end
end
end
end
end
local f = CreateFrame("Frame")
f:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
f:SetScript("OnEvent",OnEvent)