An easier method for the setshape bit would be
NPC Code:
setshape 1,16*x,16*y;
Replace the x with the amount of Graal tiles horizontal and the y with the amount of Graal tiles vertical, this stops you having to calculate the amount of pixels since each Graal tile is 16x16 pixels.