I just wish it'd allow us to create custom functions like that, along with global custom NPC-Server functions.
Like:
NPC Code:
if (created) {
this.dist=GetDist(x,y,playerx,playery);
}
function GetDist(a,b,c,d) {
this.temp=((c-a)^2+(d-b)^2)^0.5;
return this.temp;
}