Basicly you can start with making a serverside class that handles movement (either by using move() or x,y altering using cos and sin) and acts like a projectile.
And to cast it, simply do something like..
PHP Code:
function onCastProjectile(level, x, y, angle, speed) {
with(findlevel(level).putnpc2(x, y, "")) {
this.angle = angle;
this.speed = speed; // tiles per 0.1 sec
this.join("custom_projectile");
}
}
But beware to use
destroy(); inside the class when it hits a player or a wall (Use custom checks for that) so it's properly destroyed
This is just an idea of how you can do it. If others have an other suggestion of how to do it, they can post that.