local function PlayerHasBuff(buff)

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


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