local _,spell1,spell2,notInterruptible1,notInterruptible2

WhatsNext:AddConditionalStatement("Target Is Interruptable",{
	category = "Casting",
	test = function(checkTable) 
		spell1, _, _, _, _, _, _, _, notInterruptible1  = UnitCastingInfo(tostring(checkTable.unit))
		spell2, _, _, _, _, _, _, notInterruptible2  = UnitChannelInfo(tostring(checkTable.unit))
		return (spell1 and not notInterruptible1)  or (spell2 and not notInterruptible2)
	end,
	text = function(checkTable) 
		return GetUnitDisplayText(checkTable.unit) .. " is casting an interruptable spell."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	}
})

WhatsNext:AddConditionalStatement("Target Is Uninterruptable",{
	category = "Casting",
	test = function(checkTable) 
		spell1, _, _, _, _, _, _, _, notInterruptible1  = UnitCastingInfo(tostring(checkTable.unit))
		spell2, _, _, _, _, _, _, notInterruptible2  = UnitChannelInfo(tostring(checkTable.unit))
		return (spell1 and notInterruptible1)  or (spell2 and notInterruptible2)
	end,
	text = function(checkTable) 
		return GetUnitDisplayText(checkTable.unit) .. " is casting an uninterruptable spell."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	}
})

WhatsNext:AddConditionalStatement("Target Is Casting",{
	category = "Casting",
	test = function(checkTable) 
		return UnitCastingInfo(tostring(checkTable.unit)) or UnitChannelInfo(tostring(checkTable.unit))
	end,
	text = function(checkTable) 
		return GetUnitDisplayText(checkTable.unit) .. " is casting a spell."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	}
})

WhatsNext:AddConditionalStatement("Target Is Casting Specific",{
	category = "Casting",
	test = function(checkTable) 
		return UnitCastingInfo(tostring(checkTable.unit)) == WN_GetSpellName(checkTable.spellName) or UnitChannelInfo(tostring(checkTable.unit)) == WN_GetSpellName(checkTable.spellName)
	end,
	text = function(checkTable) 
		return GetUnitDisplayText(checkTable.unit) .. " is casting " .. WN_GetSpellName(checkTable.spellName)  .. "."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
		spellName = {type = "spell", default = ""}
	}
})