Hey I was wondering if there's a way to gather the distance between target A and B.
There is and it involves using highschool mathematics. Such highschool level mathematics have been implemented in the GUI function "Distance between points" as pOke has suggested.
The implementation of that GUI function is...
JASS:
function DistanceBetweenPoints takes location locA,location locB returns real
local real dx = GetLocationX(locB) - GetLocationX(locA)
local real dy = GetLocationY(locB) - GetLocationY(locA)
return SquareRoot(dx * dx + dy * dy)
endfunction
As you can see here, this is the kind of stuff you learn in S2 in Scotland at highschool, a long way from any kind of advanced mathematics so the sort everyone knows (should know...).
It is an implementation of 2D
Euclidean distance formula, equivalent to Pythagoras's theorem so invented at least 2500 years ago.
When one casts an ability or issues an order you can get a point for both the caster/ordered unit and the target unit/object/point. These can be put into the Euclidean distance formula to get a distance out.
Distance returned will be in Warcraft III units, which have a meaning of 128 units per tile edge. Eg a distance of 512 Warcraft III units is exactly 4 tiles if parallel with one of the tile edges. To this day no one is sure why Blizzard chose such strange distance unit for Warcraft III, with their later StarCraft II game having a much more sensible distance unit of tile edge length. Due to a lack of aspect ratio correction tiles may appear rectangular when Warcraft III is played on a non 4:3 display, however internally they are a perfect square when viewed top down.
Also: Is it possible to get if sum1 got hit by a Shockwave / Crushing Wave?
A damage detection system can detect the damage. However it is very difficult to detect if it was only from a shockwave / crushing wave / carrion swarm ability and not any other available damage source, especially which deals similar damage values.
In StarCraft II they really boosted damage detection by allowing one to filter and query what effect caused the damage. Unfortunately WC3 lacks the concept of damage effects so it is not something I would expect to see patched in any time soon.