[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
[/jass]
[codes=jass] local unit u = GetTriggerUnit()
local real ux = GetUnitX(u)
local real uy = GetUnitY(u)
local location l = GetSpellTargetLoc()
local real lx = GetLocationX(l)
local real ly = GetLocationY(l)
local real angle = Atan2(ly - uy,lx - ux)
local real move = SquareRoot((ly - uy)*(ly - uy)+(lx - ux)*(lx - ux))/50.00[/codes]