You need a type of pain message for every monster base, like
Look at the pain.txt file to pick which one you want.
EDIT:Oops, didn't read fully. Probably you are giving one of your monster bases a pain index that doesn't exist in pain.txt; make sure that the types of pain are in sequence from 1, and that all your monster bases have a
line where n is one of the types in your pain.txt file.