LUACN论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
热搜: YJWOW MagicStone BoL
查看: 754|回复: 7

求一款HealthWarning低血量视觉警报插件

[复制链接]
发表于 2015-8-13 20:23:55 | 显示全部楼层 |阅读模式
求一款HealthWarning低血量视觉警报单体插件,蘑菇上有,但是我不晓得怎么下载


回复

使用道具 举报

发表于 2015-8-13 20:29:37 | 显示全部楼层
--[低血量报警]
-- NephHealth
-- By lieandswell <Nephthys @ Hyjal-US>
-- Warns when health is low

local myFrame = CreateFrame(&quot;Frame&quot;, &quot;NephHealthFrame&quot;, UIParent)
myFrame:SetAllPoints()
myFrame:SetFrameStrata(&quot;BACKGROUND&quot;)
myFrame:RegisterUnitEvent(&quot;UNIT_HEALTH&quot;, &quot;player&quot;)
myFrame:SetScript(&quot;OnEvent&quot;, function(self, event, ...) self[event](self, event, ...); end)

local warningTexture = myFrame:CreateTexture(nil, &quot;BACKGROUND&quot;)
warningTexture:SetTexture(&quot;InterfaceFullScreenTexturesLowHealth&quot;)
warningTexture:SetAllPoints(myFrame)
warningTexture:SetBlendMode(&quot;ADD&quot;)
myFrame.texture = warningTexture

local showWarning = false
myFrame:Hide()

function NephHealthFrame:UNIT_HEALTH(_, arg1)
        if UnitIsDeadOrGhost(&quot;player&quot;) then
                if showWarning then
                        showWarning = false
                        myFrame:Hide()
                end
        else
                local lowHealth = (UnitHealth(&quot;player&quot;) / UnitHealthMax(&quot;player&quot;) < 0.3)
                if lowHealth and not showWarning then
                        showWarning = true
                        myFrame:Show()
                        PlaySoundFile(&quot;SoundinterfaceRaidWarning.wav&quot;)
                elseif not lowHealth and showWarning then
                        showWarning = false
                        myFrame:Hide()
                end
        end
end


--[[

function RunicPercent_OnLoad()
end
frame = CreateFrame(&quot;Frame&quot;,&quot;Frame&quot;, WorldFrame)
frame:SetPoint(&quot;CENTER&quot;)
frame:SetWidth(40)
frame:SetHeight(40)
frame:Hide()
frame:SetScale(1) -- this does not effect the text size.
FrameText = frame:CreateFontString(nil,&quot;ARTWORK&quot;);
FrameText:SetFontObject(GameFontNormal);
FrameText:SetFont(STANDARD_TEXT_FONT, 20,&quot;outline&quot;)
FrameText:SetTextColor(0.8,0,0,1) -- change this to change color
FrameText:SetPoint(&quot;CENTER&quot;,UIParent,&quot;CENTER&quot;,0,0)
frame:SetScript(&quot;OnEvent&quot;, function(self, event, arg1,arg2, ...)   
   if event == &quot;UNIT_HEALTH&quot; then
      FrameText:SetText(format(&quot;%d&quot;,UnitHealth(&quot;player&quot;)/UnitHealthMax(&quot;player&quot;)*100)..&quot;%&quot;)
   end
   local hp = UnitHealth(&quot;player&quot;) / UnitHealthMax(&quot;player&quot;)
   if hp > 0.40 then
         frame:Hide()
         else
         frame:Show()
         end
end)
frame:RegisterEvent(&quot;UNIT_HEALTH&quot;)
frame:RegisterEvent(&quotLAYER_ENTERING_WORLD&quot;)
RunicPercent_OnLoad()


]]
回复 支持 反对

使用道具 举报

发表于 2015-8-13 20:31:56 | 显示全部楼层
随便找一个LUA放进去

--[低血量报警]
-- NephHealth
-- By lieandswell <Nephthys @ Hyjal-US>
-- Warns when health is low

local myFrame = CreateFrame(&quot;Frame&quot;, &quot;NephHealthFrame&quot;, UIParent)
myFrame:SetAllPoints()
myFrame:SetFrameStrata(&quot;BACKGROUND&quot;)
myFrame:RegisterUnitEvent(&quot;UNIT_HEALTH&quot;, &quot;player&quot;)
myFrame:SetScript(&quot;OnEvent&quot;, function(self, event, ...) self[event](self, event, ...); end)

local warningTexture = myFrame:CreateTexture(nil, &quot;BACKGROUND&quot;)
warningTexture:SetTexture(&quot;InterfaceFullScreenTexturesLowHealth&quot;)
warningTexture:SetAllPoints(myFrame)
warningTexture:SetBlendMode(&quot;ADD&quot;)
myFrame.texture = warningTexture

local showWarning = false
myFrame:Hide()

function NephHealthFrame:UNIT_HEALTH(_, arg1)
        if UnitIsDeadOrGhost(&quot;player&quot;) then
                if showWarning then
                        showWarning = false
                        myFrame:Hide()
                end
        else
                local lowHealth = (UnitHealth(&quot;player&quot;) / UnitHealthMax(&quot;player&quot;) < 0.3)
                if lowHealth and not showWarning then
                        showWarning = true
                        myFrame:Show()
                        PlaySoundFile(&quot;SoundinterfaceRaidWarning.wav&quot;)
                elseif not lowHealth and showWarning then
                        showWarning = false
                        myFrame:Hide()
                end
        end
end


--[[

function RunicPercent_OnLoad()
end
frame = CreateFrame(&quot;Frame&quot;,&quot;Frame&quot;, WorldFrame)
frame:SetPoint(&quot;CENTER&quot;)
frame:SetWidth(40)
frame:SetHeight(40)
frame:Hide()
frame:SetScale(1) -- this does not effect the text size.
FrameText = frame:CreateFontString(nil,&quot;ARTWORK&quot;);
FrameText:SetFontObject(GameFontNormal);
FrameText:SetFont(STANDARD_TEXT_FONT, 20,&quot;outline&quot;)
FrameText:SetTextColor(0.8,0,0,1) -- change this to change color
FrameText:SetPoint(&quot;CENTER&quot;,UIParent,&quot;CENTER&quot;,0,0)
frame:SetScript(&quot;OnEvent&quot;, function(self, event, arg1,arg2, ...)   
   if event == &quot;UNIT_HEALTH&quot; then
      FrameText:SetText(format(&quot;%d&quot;,UnitHealth(&quot;player&quot;)/UnitHealthMax(&quot;player&quot;)*100)..&quot;%&quot;)
   end
   local hp = UnitHealth(&quot;player&quot;) / UnitHealthMax(&quot;player&quot;)
   if hp > 0.40 then
         frame:Hide()
         else
         frame:Show()
         end
end)
frame:RegisterEvent(&quot;UNIT_HEALTH&quot;)
frame:RegisterEvent(&quotLAYER_ENTERING_WORLD&quot;)
RunicPercent_OnLoad()


]]
回复 支持 反对

使用道具 举报

发表于 2015-8-13 20:35:25 | 显示全部楼层
把这个文件夹解压到interface下的addons里面
回复 支持 反对

使用道具 举报

发表于 2015-8-13 20:36:54 | 显示全部楼层
了解!!3Q
回复 支持 反对

使用道具 举报

发表于 2015-8-13 20:47:06 | 显示全部楼层
试试看  应该是可以用的。
回复 支持 反对

使用道具 举报

发表于 2015-8-13 20:49:34 | 显示全部楼层
恩,可以用
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

小黑屋|手机版|Archiver|LUACN论坛

GMT+8, 2025-5-12 04:32 PM , Processed in 0.053312 second(s), 25 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表