// sub objective rewards
_sop = _this select 0;
_sot = _this select 1;
_sor = _this select 2;

_txtpasshead = format["%1 at %2",localize "STR_M04t68",(EGG_EVO_Townnames select EGG_EVO_MissionProgress)];//Tower Destroyed - at - city

_txtcommon = localize "STR_M04t0_5"; //Points
_txtpassbody = format["+%1 %2",_sor,_txtcommon];
_city = "";

//_RadioTowerMessage = composeText [parseText format ["<t color='#FFFF00'>%1</t><br/><br/><t color='#FFFFFF'>+%2 %3</t>",_TextTower,_sor,_TextPoints]];

if(_sor > 0) then
{
	switch (_sot) do
	{
	    case "cityA1":
	    {
			_city = (EGG_EVO_Townnames select 0);
	    	[West,"HQ"] SideChat format[localize "STR_M04t62",_city];//COMMUNICATIONS CUT AT %1, GOOD WORK
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityA2":
	    {
			_city = (EGG_EVO_Townnames select 0);
	    	[West,"HQ"] SideChat format[localize "STR_M04t63",_city]; //OFFICER DETAINED AT %1, GOOD WORK
			playSound "Goodjob";
	    };
	    case "cityB1":
	    {
			_city = (EGG_EVO_Townnames select 1);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityB2":
	    {
			_city = (EGG_EVO_Townnames select 1);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    };
	    case "cityC1":
	    {
			_city = (EGG_EVO_Townnames select 2);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityC2":
	    {
			_city = (EGG_EVO_Townnames select 2);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    };
	    case "cityD1":
	    {
			_city = (EGG_EVO_Townnames select 3);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityD2":
	    {
			_city = (EGG_EVO_Townnames select 3);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    };
	    case "cityE1":
	    {
			_city = (EGG_EVO_Townnames select 4);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityE2":
	    {
			_city = (EGG_EVO_Townnames select 4);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    };
	    case "cityF1":
	    {
			_city = (EGG_EVO_Townnames select 5);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };    
	    case "cityF2":
	    {
			_city = (EGG_EVO_Townnames select 5);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    };
	    case "cityG1":
	    {
			_city = (EGG_EVO_Townnames select 6);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityG2":
	    {
			_city = (EGG_EVO_Townnames select 6);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    };
	    case "cityH1":
	    {
			_city = (EGG_EVO_Townnames select 7);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityH2":
	    {
			_city = (EGG_EVO_Townnames select 7);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    };
	    case "cityI1":
	    {
			_city = (EGG_EVO_Townnames select 8);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityI2":
	    {
			_city = (EGG_EVO_Townnames select 8);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    };
	    case "cityJ1":
	    {
			_city = (EGG_EVO_Townnames select 9);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityJ2":
	    {
			_city = (EGG_EVO_Townnames select 9);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    };
	    case "cityK1":
	    {
			_city = (EGG_EVO_Townnames select 10);
			[West,"HQ"] SideChat format[localize "STR_M04t62",_city];
			if (_sop == player) then {["#0000FF",_txtpasshead,_txtpassbody] call EGG_EVO_Message};
			playSound "Goodjob";
	    };
	    case "cityK2":
	    {
			_city = (EGG_EVO_Townnames select 10);
			[West,"HQ"] SideChat format[localize "STR_M04t63",_city];
			playSound "Goodjob";
	    }; 
	};
};
//if(isServer) then {_sop addscore _sor};

//adding to make whole group receive points
if(isServer) then 
{
//group rewards - officer and radio
	if (EGG_EVO_sor == EGG_EVO_offscore) then
	{
		EGG_EVO_punit = _sop;
		EGG_EVO_prew  = _sor;
		publicVariable "EGG_EVO_prew";
		publicVariable "EGG_EVO_punit";
	};
	if (EGG_EVO_sor == EGG_EVO_radioscore) then
	{
		EGG_EVO_punit = _sop;
		EGG_EVO_prew  = _sor;
		publicVariable "EGG_EVO_prew";
		publicVariable "EGG_EVO_punit";
	};
//solo POW reward if powcamp off group reward if on
	if (EGG_EVO_sor == EGG_EVO_powscore) then
	{
		if (POWfactor ==1) then  
		{
			EGG_EVO_punit = _sop;
			EGG_EVO_prew  = _sor;
			publicVariable "EGG_EVO_prew";
			publicVariable "EGG_EVO_punit";
		}else
		{
			EGG_EVO_lunit = _sop;
			EGG_EVO_lrew  = _sor;
			publicVariable "EGG_EVO_lrew";
			publicVariable "EGG_EVO_lunit";
		};
	};
//officer/POW group kill penalty
	if ( (EGG_EVO_sor == EGG_EVO_offpen) or (EGG_EVO_sor == EGG_EVO_powpen) )then
	{
		EGG_EVO_punit = _sop;
		EGG_EVO_prew  = EGG_EVO_Gpowpen;
		publicVariable "EGG_EVO_prew";
		publicVariable "EGG_EVO_punit";
	};
};

//if POW or officer killed then _sot is the killer

if (_sot == format["%1",player]) exitWith 
{
	_txtpasshead = localize "STR_M04t69";//ROE Violation
	_txtcommon = localize "STR_M04t0_5";//Points
	_txtpassbody = localize "STR_M04t70";//You have broken the rules of engagement.
	_txtpassbodyf = format["%1: %2 %3 %4",_sop,_txtpassbody,_sor,_txtcommon];
	["#FF0000",_txtpasshead,_txtpassbodyf] call EGG_EVO_Message;

//severely punish killer
	EGG_EVO_lunit = _sop;
	EGG_EVO_lrew  = _sor;
	publicVariable "EGG_EVO_lrew";
	publicVariable "EGG_EVO_lunit";
};




