local function PlayerHasBuff(buff)

	for i=1,40 do
		local name, _, _, count, _, _, expirationTime = UnitBuff('player',i) 
		if WN_GetSpellName(buff) == name then
			return 1
		end			
	end
	return 0
end 


WhatsNext:AddConditionalStatement("Combo Points",{
	category = "Rogue",
	test = function(checkTable) 
		return GetComboPoints("player",tostring(checkTable.unit)) >= tonumber(checkTable.amount)
	end,
	text = function(checkTable) 
		return "player has at least "..tostring(checkTable.amount).." combo points on " .. GetUnitDisplayText(checkTable.unit) .. "."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
		amount = {type = "integer", default = 5},
	}
})
WhatsNext:AddConditionalStatement("Roll the Bones Buff Count",{
	category = "Rogue",
	test = function(checkTable) 
		return PlayerHasBuff(193359) + PlayerHasBuff(193356) + PlayerHasBuff(193358) + PlayerHasBuff(199603) + PlayerHasBuff(193357) + PlayerHasBuff(199600)  >= tonumber(checkTable.amount)
	end,
	text = function(checkTable) 
		return "player has at least "..tostring(checkTable.amount).." buffs from " .. WN_GetSpellName(193316) .. "."
	end,
	arguments = {
		amount = {type = "integer", default = 2},
	}
})
