View Single Post
11-30-14, 01:00 PM   #12
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Thanks again Phanx - as I told you via PM the code is not working, even tryed to disable all AddOns.
Maybe someone else can help to fix it? If possible even add a BigWigs alert to it with the screen light up thing?

I added names for all Bodyguards in all languages to the file:


BodyguardFocusAlert.toc
Code:
## Interface: 60000
## Author: Phanx
## Version: 1.0
## Title: BodyguardFocusAlert
## Notes: Alerts when focused Bodyguard gets low HP
BodyguardFocusAlert.lua
Code:
local alertFor = {
    ["Krallenpriester Ishaal"] = true,  -- Horde/Alliance
    ["Talonpriest Ishaal"] = true,
    ["Sacerdote de la garra Ishaal"] = true,
    ["Prêtre de la serre Ishaal"] = true,
    ["Sacerdote dell'Artiglio Ishaal"] = true,
    ["Sacerdote da Garra Ishaal"] = true,
    ["Жрец Когтя Ишааль"] = true,
	
    ["Tormmok"] = true, -- Horde/Alliance
    ["Тормок"] = true,
	
    ["Leorajh"] = true,  -- Horde/Alliance
    ["Леорадж"] = true,

    ["Aeda Morgenglanz"] = true, -- Horde
    ["Aeda Brightdawn"] = true,
    ["Aeda Alba Brillante"] = true,	
    ["Aeda Brillaube"] = true,		
    ["Aeda Albaluce"] = true,
    ["Aeda Brilhalvo"] = true,
    ["Аеда Ясная Заря"] = true,
    ["Beschützerin Illona"] = true, -- Alliance
    ["Defender Illona"] = true,
    ["Defensora Illona"] = true,
    ["Défenseur Illona"] = true,	
    ["Difensore Illona"] = true,
    ["Defensora Illona"] = true,
    ["Защитница Иллона"] = true,

    ["Vivianne"] = true, -- Horde
    ["Вивианна"] = true,
    ["Delvar Eisenfaust"] = true, -- Alliance
    ["Delvar Ironfist"] = true,	
    ["Delvar Puño de Hierro"] = true,
    ["Delvar Poing-de-Fer"] = true,
    ["Delvar Pugnoferreo"] = true,	
    ["Delvar Punho de Ferro"] = true,
    ["Делвар Железный Кулак"] = true,
}
local f = CreateFrame("Frame")
f:RegisterUnitEvent("UNIT_HEALTH", "focus")
f:SetScript("OnEvent", function(self, event, unit)
     local name = UnitName(unit)
     if not alertFor[name] then return end
     local hp, hpmax = UnitHealth(unit), UnitHealthMax(unit)
     local percent = hp / hpmax
     if percent < 0.6 then
          UIErrorsFrame:AddMessage(format("%s @ %d%% HP!", name, percent * 100)
     end
end)
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote