//skill settings:
/*
//call with 
[_mygroupname, skill] spawn EGG_EVO_skill;
0 = random
1 = conscript
2 = irregular/rebel
3 = regular army
4 = elite infantry
5 = spec ops

tweaked by parameter 23 - skillfactor

values[] = {0,1,2,3,4,5};
texts[] = {"Pussy fobbits", "Weekend Warriors","Pongos & Craphats","Bootnecks","The Regiment","Suicide Squad"};
default = 2;

adjusted ingame by officer class using radio 0-0-3 (up) and 0-0-4 (down)
*/

EGG_EVO_skill =
{
	_grp =  _this select 0;
	_skill = _this select 1;

	if (_skill==0) then
	{
		_skill=(round random 4)+1;
	};

//skillfactor set in init

	if (skillfactor==0) then
	{
		_skill=1;
	};
	if (skillfactor==1) then 
	{
		if ((_skill==0)||(_skill==3)||(_skill==4)||(_skill==5)) then
		{
			_skill=2;
		};
	};
	if (skillfactor==3) then 
	{
		if ((_skill==0)||(_skill==1)||(_skill==2)) then
		{
			_skill=3;
		};
	};
	if (skillfactor==4) then 
	{
		if ((_skill==0)||(_skill==1)||(_skill==2)||(_skill==3)) then
		{
			_skill=4;
		};
	};
	if (skillfactor==5) then
	{
		_skill=5;
	};

	if (isnil ("EGG_EVO_accfactor")) then
	{
		EGG_EVO_accfactor = 0.1; //0.01; //used in accuracy.sqf to tweak this
	};

	switch (_skill) do
	{
		case 1: //conscript very low skill
		{
			{
				_x setSkill ["aimingspeed", 0.2];
				_x setSkill ["spotdistance", 0.2];
				_x setSkill ["aimingaccuracy", (0.01+EGG_EVO_accfactor)];
				_x setSkill ["aimingshake", 0.1];
				_x setSkill ["spottime", 0.2];
				_x setSkill ["spotdistance", 0.3];
				_x setSkill ["commanding", 0.5];
				_x setSkill ["general", 0.5];
			} forEach (units _grp); 
		};
		case 2: //rebels low skill
		{
			{
				_x setSkill ["aimingspeed", 0.3];
				_x setSkill ["spotdistance", 0.3];
				_x setSkill ["aimingaccuracy", (0.05+EGG_EVO_accfactor)];
				_x setSkill ["aimingshake", 0.3];
				_x setSkill ["spottime", 0.3];
				_x setSkill ["spotdistance", 0.4];
				_x setSkill ["commanding", 0.6];
				_x setSkill ["general", 0.6];
			} forEach (units _grp); 
		};
		case 3: //regular fair skill
		{
			{
				_x setSkill ["aimingspeed", 0.4];
				_x setSkill ["spotdistance", 0.4];
				_x setSkill ["aimingaccuracy", (0.1+EGG_EVO_accfactor)];
				_x setSkill ["aimingshake", 0.4];
				_x setSkill ["spottime", 0.4];
				_x setSkill ["spotdistance", 0.6];
				_x setSkill ["commanding", 0.7];
				_x setSkill ["general", 0.7];
			} forEach (units _grp); 
		};
		case 4: //elite soldiers medium skill
		{
			{
				_x setSkill ["aimingspeed", 0.5];
				_x setSkill ["spotdistance", 0.5];
				_x setSkill ["aimingaccuracy", (0.15+EGG_EVO_accfactor)];
				_x setSkill ["aimingshake", 0.5];
				_x setSkill ["spottime", 0.5];
				_x setSkill ["spotdistance", 0.7];
				_x setSkill ["commanding", 0.8];
				_x setSkill ["general", 0.8];
			} forEach (units _grp); 
		};
		case 5: // specops good skill
		{
			{
				_x setSkill ["aimingspeed", 0.7];
				_x setSkill ["spotdistance", 0.7];
				_x setSkill ["aimingaccuracy", (0.2+EGG_EVO_accfactor)];
				_x setSkill ["aimingshake", 0.7];
				_x setSkill ["spottime", 0.7];
				_x setSkill ["spotdistance", 0.8];
				_x setSkill ["commanding", 1];
				_x setSkill ["general", 1];
			} forEach (units _grp); 
		};
	};
};
