You use mathematics to calculate the angle needed. from the poisition of the unit and the position of the target location. Just like you can convert from polar form to cordinates in an X/Y plane using sin and cos, you can convert from cordinates in a X/Y plane to an angle.
WC3 even provides you with the
native Atan2 takes real y,real x returns real
function which will even return an angle between -pi and pi (normal arctan just goes between -pi/2 and pi).
This is the pesudo code of what you are after.
SetUnitFacing(theunit,Atan2(targety-unity,targetx-unitx)*180/pi)
What you do is create a X/Y vector of the target point relative to the units position and pass that to the Atan2 function as the appropiate y and x arguments. You then need to perform unit conversion to get from radians to degrees (no idea why WC3 is not consistant...).
This is how the GUI real parameter for angle between 2 points does it.
function AngleBetweenPoints takes location locA,location locB returns real
return bj_RADTODEG * Atan2(GetLocationY(locB) - GetLocationY(locA), GetLocationX(locB) - GetLocationX(locA))
endfunction