1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
--血条仇恨变色
hooksecurefunc("CompactUnitFrame_OnUpdate", function(frame)
if C_NamePlate.GetNamePlateForUnit(frame.unit) ~= C_NamePlate.GetNamePlateForUnit("player") and not UnitIsPlayer(frame.unit) and not CompactUnitFrame_IsTapDenied(frame) then
   local threat = UnitThreatSituation("player", frame.unit) or 0
   local reaction = UnitReaction(frame.unit, "player")
   local name = UnitName(frame.unit)
   local A = UnitBuff(frame.unit,1)
   local B = UnitBuff(frame.unit,2)
   local C = UnitBuff(frame.unit,3)
  
    if name == "邪能炸药" then  --邪能炸药
      r, g, b = 0, 1, 0    
    elseif A == "戈霍恩共生体" or B == "戈霍恩共生体" or C == "戈霍恩共生体" then  --共生
      r, g, b = 0, 0, 1    
    elseif name == "戈霍恩之嗣" then  --共生小怪
      r, g, b = 1, 0, 1    
    elseif threat == 3 then
r, g, b = 0.3, 0, 0.6 -- 仇恨是你 颜色
elseif threat == 1 or threat == 2 then
r, g, b = 1, 0.5, 0    -- 高仇恨 颜色
    elseif UnitIsUnit(frame.displayedUnit, "target") then
      r, g, b = 0, 1, 1  -- 你的目标 颜色
    elseif reaction == 4 then
      r, g, b = 1, 1, 0    -- 中立怪 黄色
else
      r, g, b = 1, 0, 0
end
frame.healthBar:SetStatusBarColor(r, g, b, 1)
end
end)
--紫色 0.3, 0, 0.6
--蓝色 0, 0, 1
--橙色 1, 0.5, 0
--黄色 1, 1, 0
--红色 1, 0, 0
--绿色 0, 1, 0
--青色 0, 1, 1
--粉色 1, 0, 1
http://bbs.ngacn.cc/read.php?&tid=11477676
|