Try this one:

Code:
float4x4 matWorld;
float4x4 matWorldViewProj;

float4 vecSunDir;
float4 vecAmbient;
float4 vecSunColor;
float2 tiles = {50,50};

texture entSkin1;

texture dmap1_bmap;
texture dmap2_bmap;
texture dmap3_bmap;
texture dmap4_bmap;
texture dmap5_bmap;

sampler2D blend = sampler_state {	Texture = <entSkin1>;mipfilter=2;minfilter=2;magfilter=2;};

sampler2D skin1 = sampler_state {	Texture = <dmap1_bmap>;mipfilter=2;minfilter=2;magfilter=2;};
sampler2D skin2 = sampler_state {	Texture = <dmap2_bmap>;mipfilter=2;minfilter=2;magfilter=2;};
sampler2D skin3 = sampler_state {	Texture = <dmap3_bmap>;mipfilter=2;minfilter=2;magfilter=2;};
sampler2D skin4 = sampler_state {	Texture = <dmap4_bmap>;mipfilter=2;minfilter=2;magfilter=2;};
sampler2D skin5 = sampler_state {	Texture = <dmap5_bmap>;mipfilter=2;minfilter=2;magfilter=2;};

void VS (	in float4 iPos : POSITION,
		in float3 iNorm : NORMAL,
		in float4 iTex : TEXCOORD0,
		out float4 oPos : POSITION,
		out float3 oNorm : TEXCOORD1,
		out float4 oTex : TEXCOORD0)
	{
	oPos = mul (iPos,matWorldViewProj);
	oNorm = mul(iNorm,matWorld);
	oTex = iTex;
	}

float4 PS(	in float2 tex : TEXCOORD0,
		in float3 iNorm : TEXCOORD1) : COLOR {

	float4 map = tex2D(blend,tex);

	float4 color = tex2D(skin1,tiles * tex);
	color = lerp(color,tex2D(skin2,tiles * tex),map.r);
	color = lerp(color,tex2D(skin3,tiles * tex),map.g);
	color = lerp(color,tex2D(skin4,tiles * tex),map.b);
	color = lerp(color,tex2D(skin5,tiles * tex),map.a);

	color *= vecSunColor * saturate(dot(-vecSunDir, normalize(iNorm))) + vecAmbient;	
	return color;}

technique t{ pass p{	AlphaBlendEnable = 0;
			zWriteEnable = 1;
			VertexShader = compile vs_2_0 VS();		
			PixelShader = compile ps_2_0 PS();			
		}}



You have to define 5 BMAPs named dmap1...dmap5. The first skin of the terrain / model ist the blendmap.

dmap1 is the basecolor, dmap2,3,4 are RGB and dmap5 is Alpha.
This shader only supports the sun. But adding more lights is no problem (if you need them). You can add as many textures as the shader model supports (in a single pass). This is done by "splitting" the RGBA channels. You can use for example 4 textures per channel (would be 17 textures in one pass!) But there are restrictions (of course). You can't blend straight between all textures! If you use such a 17-texture-shader, i recommend to use the 4 textures per channel only as texture variations and not as completely different textures.

I hope you understand what i mean...

The same can be done by using more blendmaps.