View Single Post
03-25-24, 04:48 AM   #12
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,938
Not quite, give this a go. Hopefully despite the functions having the word target in them they will work on mouseover too.


Lua Code:
  1. local addonName, addon = ...
  2. local llRI = nil
  3. local npcToWatch = 205089
  4.  
  5. local function OnEvent(self,event,...)
  6.    if event == "UPDATE_MOUSEOVER_UNIT" then
  7.  
  8.       local guid = UnitGUID("mouseover")
  9.       if guid == nil then return end
  10.  
  11.       local guidType, _, _, _, _, npc_id, _ = strsplit("-",guid)
  12.       if guidType == "Creature" and tonumber(npc_id) == npcToWatch then      
  13.          if GetRaidTargetIndex("mouseover") == nil then
  14.             if llRI == nil then
  15.                llRI = 0
  16.             end
  17.             llRI = (llRI % 8) + 1
  18.             if GetRaidTargetIndex("mouseover") ~= llRI then
  19.                SetRaidTarget("mouseover", llRI)
  20.                PlaySound(SOUNDKIT.GM_CHAT_WARNING)
  21.             end
  22.          end
  23.       end
  24.    end
  25. end
  26.  
  27. local f = CreateFrame("Frame")
  28. f:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
  29. f:SetScript("OnEvent",OnEvent)
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote