Note that this function completely ignores setLucent() values. If you want to have an image with both an alpha mask and a general translucency value (such as if you want an anti-aliased image that fades in or fades out), the best way to do this is to edit the mask image. So you have a source_image and alpha_image, and then you need a 3rd image so you don't have to keep reloading a fresh alpha_image to edit. So let's make the 3rd image called alpha_original. Obviously all three images need to be the same dimensions.
For any time when you want to AlphaBlit the image at a certain translucency, use the following method. First, set up the images:
int source_image = loadimage("my_image.pcx");
int alpha_original = loadimage("my_image_alpha.pcx");
int alpha_image = newImage(imagewidth(source_image),imageHeight(source_image));
Then when you actually want to display the image with both alpha and transparency:
Blit(0,0,alpha_original,alpha_image);
setlucent(50); //or whatever
rectfill(0,0,imagewidth(source_image),image_height(source_image),RGB(0,0,0),alpha_image);
setlucent(0);
AlphaBlit(x,y,source_image,alpha_image,screen);
The rectfill will darken each pixel of the mask appropriately. It
should work exactly as it would if AlphaBlit used setlucent values.
Editing the alpha masks is an extremely powerful technique for creating effects on images without altering the original.