<Ui xmlns="http://www.blizzard.com/wow/ui/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd">
	<Frame name="StatRingsComboPoints" parent="UIParent" inherits="StatRingsRingTemplate">
		<Anchors>
			<Anchor point="CENTER" relativeTo="StatRingsAnchor">
				<Offset>
					<AbsDimension x="0" y="0"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Scripts>
			<OnLoad>
				StatRings_RegisterRing(this, "Combo Points");
      			StatRingsRingTemplate_OnLoad();
      			
        		this.twoPi = (this.PI * 2);
				this:SetAlpha(0.6);
        		this.pulse = false;
        		this.alphaPulse = 0;
        		
				this:RegisterEvent("PLAYER_COMBO_POINTS");
				this:RegisterEvent("PLAYER_ENTERING_WORLD");
				    			
				this:UpdateColor({["r"] = 1, ["g"] = 0, ["b"] = 0});
				this:SetMax(5);
				this:SetValue(GetComboPoints());

				function this:UpdateAlpha(arg1)
					if this.pulse then
						this.alphaPulse = this.alphaPulse + arg1; --math.mod(this.alphaPulse + arg1, this.twoPi);
						local amt = math.sin(this.alphaPulse * this.twoPi) * 0.5 + 0.5;
						local camt = math.cos(this.alphaPulse * this.twoPi) * 0.2 + 0.5;
						this:SetAlpha(0.7-camt);
						this:UpdateColor({["r"] = 1, ["g"] = amt, ["b"] = amt});
					end
					
					if GetComboPoints() &lt; 5 and GetComboPoints() &gt; 0 then
						this:UpdateColor({["r"] = 1, ["g"] = 0, ["b"] = 0});
						this.pulse = false;
						this.alphaPulse = 0;
						StatRingsTest_SetAlpha(self, 0.6);
					elseif GetComboPoints() == 0 then
						this.pulse = false;
						this.alphaPulse = 0;
						this:UpdateColor({["r"] = 1, ["g"] = 0, ["b"] = 0});
					else
						this.pulse = true;
					end
				end
				this:AddUpdateFunction(this.UpdateAlpha);
			</OnLoad>
			<OnEvent>
				if (event == "PLAYER_ENTERING_WORLD") then
					this:UpdateColor({["r"] = 1, ["g"] = 0, ["b"] = 0});
					this:SetValue(UnitHealth("target"));
					return;
				elseif event == "PLAYER_COMBO_POINTS" then
					if GetComboPoints() == 0 then
						this:SetValue(5);
						StatRingsTest_SetAlpha(this, 0.1);
					else
						StatRingsTest_SetAlpha(this, 0.6);
						this:SetValue(GetComboPoints());
					end
				end
			</OnEvent>
		</Scripts>
	</Frame>
</Ui>