@Animagus, @WeedTerminator
Дубль 2:
Видим индикатор угрозы, когда хант отправил пета на лока:
Скрытый текст
Вот пруф:
Скрытый текст
Код из аддона:
Сам аддон: https://disk.yandex.ru/d/XneMFfHvdlw-YQPHP код:
local function GetRGBAsBytes(r, g, b)
return r * 255, g * 255, b * 255;
end
local function GenerateHexColor(r, g, b)
return ("ff%.2x%.2x%.2x"):format(GetRGBAsBytes(r, g, b));
end
hooksecurefunc("UnitFrame_UpdateThreatIndicator", function(indicator, numericIndicator, unit)
if ( not indicator ) then
return;
end
if ( not unit or unit == indicator.feedbackUnit ) then
local status;
if ( indicator.feedbackUnit ~= indicator.unit ) then
status = UnitThreatSituation(indicator.feedbackUnit, indicator.unit);
else
status = UnitThreatSituation(indicator.feedbackUnit);
end
if ( status and status > 0 ) then
local threat = "\nСтатус угрозы: "..status;
local feedbackUnit = "feedbackUnit: "..indicator.feedbackUnit;
local Unit = "unit: "..indicator.unit;
local texture = indicator:GetTexture();
local r, g, b = GetThreatStatusColor(status);
local hex = GenerateHexColor(r, g, b)
print(threat.."\n"..feedbackUnit.."\n"..Unit.."\n|c"..hex..texture.."|r")
end
end
end)
Пояснение:
Хукается функция из FrameXML (Близзард интерфейс!!!!!!!!!!!!!!!!!!!!!!), которая отвечает за отображение индикатора угрозы!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Если юнит попадает в трит лист у кого-то, то на фрейме появляется ТЕКСТУРА УГРОЗЫ!!!!!!!!!!!!!!! И МЕНЯТСЯ ЦВЕТ В ЗА-ВИ-СИ-МО-СТИ ОТ СТЕПЕНИ УГРОЗЫ!!!
Отсюда делаем вывод, что если показывается ТЕКСТУРА УГРОЗЫ, когда на нас направлен чей-то питомец или суммон (копии мага например), у этих питомцев должен быть Список угроз - без него не будет работать API, стрелять эвент и ОТОБРАЖАТЬСЯ ТЕКСТУРА.
[свернуть]