Since ids only range from 0-31, try
npcid[32]
instead (unless npcid is supposed to be a single id, in which case you'd use a normal variable...).
[edit] Damn you, beat me to it.
__________________
STEPS IN TROUBLESHOOTING<insert anything here>: 1.Narrow down the problem to a specific condition or conditions. 2.Fix it.