The error is probably from wrong pet_data ... But i can't where exactly. Check your pet_data and see if it matches the itemdata IDs ...
The quest issue looks like an .htm mismatch in ai.obj ...
Check if it attepts to open the correct .htm file
Best of Luck!
EverCooL