-- Healthstone.lua local _; local frame = CreateFrame("Frame", "OmaHStone", UIParent); local UnitHealth, UnitHealthMax = UnitHealth, UnitHealthMax; local UnitIsDeadOrGhost = UnitIsDeadOrGhost; local function healthstone() frame:SetPoint("TOP"); frame:SetWidth(110); frame:SetHeight(110); frame.base = frame:CreateTexture(nil, "BACKGROUND"); frame.base:SetAllPoints(); frame.base:SetColorTexture(0, 0, 0, 0.5); frame.stone = frame:CreateTexture(nil, "BORDER"); frame.stone:SetPoint("TOPLEFT", frame.base, "TOPLEFT", 1, -1); frame.stone:SetPoint("BOTTOMRIGHT", frame.base, "BOTTOMRIGHT", -1, 1); frame.stone:SetTexCoord(0.07, 0.93, 0.07, 0.93); frame.stone:SetTexture(538745); -- "Interface\\ICONS\\Warlock_ Healthstone" frame:Hide(); frame:SetScript("OnEvent", function(self, event) if not UnitIsDeadOrGhost("player") and UnitHealth("player")/UnitHealthMax("player") < 0.3 then frame:Show(); else frame:Hide(); end end); frame:UnregisterAllEvents(); frame:RegisterUnitEvent("UNIT_HEALTH", "player"); end frame:SetScript("OnEvent", healthstone); frame:RegisterEvent("PLAYER_LOGIN");