Check the raw data on the Greatstaff of the Four Winds and scroll down to the 'idfile' for it. It's IT10507, and we'll drop the IT off it to get what we need:
Code:
UPDATE npc_types SET d_meele_texture1 = 10507 WHERE id = 580001;
Looks like you were using the first value, the Allakhazam item ID
See if that doesn't work for you.