--DISPLAY
function()
	return aura_env.stacks
end

--EVERY FRAME TRIGGER
function()
	if aura_env.tank ~= "" then
		for k,v in pairs(aura_env.spells) do
			if UnitDebuff("target", k) ~= nil then
				local _,_,_,stacks,_,dur,exptime = UnitDebuff("target", k)
				if v > 1 and stacks > v then
					aura_env.stacks = stacks
					aura_env.exptime = exptime
					aura_env.dur = dur
					return true
				end
				if v == 1 then
					aura_env.exptime = exptime
					aura_env.dur = dur
					return true
				end
				if v == 0 then
					local _,_,starttime,exptime = UnitCastingInfo("boss1")
					aura_env.exptime = exptime
					aura_env.dur = exptime - starttime
					return true
				end
			end
		end
	 end
end

--GROUP_ROSTER_UPDATE
function()
	aura_env.tank = ""
	for i = 1, GetNumGroupMembers() do --Find other tank
		if UnitGroupRolesAssigned("raid" .. i) == "TANK" and UnitName("raid" .. i) ~= UnitName("player") then
			aura_env.tank = UnitName("raid" .. i)
			print(aura_env.tank, i)
		end
	end
end

--DURATION TRIGGER
function()
	print(aura_env.dur, aura_env.exptime)
	return aura_env.dur, aura_env.exptime, 1
end

--INIT
aura_env.tank = ""
aura_env.stacks = 0
aura_env.exptime = 0
aura_env.spells = 
{
	--NH
	["Arcane Slash"] = 2,
	["Annihilate"] = 2,
	["Feast of Blood"] = 1,
	["Recursive Strikes"] = 7,
	["Gravitational Pull"] = 1,
	["Ablating Explosion"] = 1,
	["Bonds of Fel"] = 0,
	["Empowered Bonds of Fel"] = 0,
	--ToS
	["Burning Armor"] = 1,
	["Jagged Abrasion"] = 5,
	["Judgment of Light"] = 1,
}
for i = 1, GetNumGroupMembers() do --Find other tank
	if UnitGroupRolesAssigned("raid" .. i) == "TANK" and UnitName("raid" .. i) ~= UnitName("player") then
		aura_env.tank = UnitName("raid" .. i)
		print(aura_env.tank, i)
	end
end