function gen_unit_chance_krit(data)
	local text=""
	local cur_chance_krit = Attack.act_get_par(data, "krit")
	local base_chance_krit = Attack.act_get_par(data, "krit")
	cur_chance_krit = cur_chance_krit * ((0.6 / Logic.cur_lu_item( "rage", "limit" )) * Logic.cur_lu_item( "rage", "count" ) + 0.7)
	local moral = AU.moral(data)
	local mas_krit={0,0.5,0.75,1,1.25,1.5,2}
	local mas_moral={-3,-2,-1,0,1,2,3}
	for i=1,7 do
		if mas_moral[i]==moral then
	 		cur_chance_krit=math.floor(cur_chance_krit * mas_krit[i])
	  	end 
	end 	
	if cur_chance_krit>100 or Attack.act_is_spell( data, "special_preparation" ) then 
		cur_chance_krit = 100 
	end
	if cur_chance_krit<0 then 
		cur_chance_krit = 0 
	end
	local t=""
	if Attack.act_human(data) or Attack.act_is_spell( data, "special_preparation" ) or (Attack.act_belligerent(data) == 0) then 
		t="<br><color=222,194,94><label=cpi_cur_krit>:</color> "..cur_chance_krit.."%"
	end
	text=text..":</color> "..base_chance_krit.."%"..t
	return text
end

function gen_unit_chance_krit_att(data)
local text=""
	local cur_chance_krit = Attack.act_get_par(data, "krit")
	cur_chance_krit = cur_chance_krit * ((0.6 / Logic.cur_lu_item( "rage", "limit" )) * Logic.cur_lu_item( "rage", "count" ) + 0.7)
	local moral = AU.moral(data)
	local mas_krit={0,0.5,0.75,1,1.25,1.5,2}
	local mas_moral={-3,-2,-1,0,1,2,3}
	for i=1,7 do
		if mas_moral[i]==moral then
	 		cur_chance_krit=math.floor(cur_chance_krit * mas_krit[i])
	  	end 
	end 	
	if cur_chance_krit>100 or Attack.act_is_spell( data, "special_preparation" ) then 
		cur_chance_krit = 100 
	end
	if cur_chance_krit<0 then 
		cur_chance_krit = 0 
	end
	if Attack.act_human(data) or Attack.act_is_spell( data, "special_preparation" ) or (Attack.act_belligerent(data) == 0) then 
		text="<br><label=cpi_cur_krit_at>: "..cur_chance_krit.."%"
	end
	return text
end

function gen_krit()
	local text=""
	local krit = math.floor(((0.4 / Logic.cur_lu_item( "rage", "limit" )) * Logic.cur_lu_item( "rage", "count" ) + 0.3)*100)
	text=text.."<br><color=255,243,179><label=btn_krit>:</color> +"..krit.."%"
	return text
end