It was not too hard to code. d_meele_texture1 and d_meele_texture2 might be using the item number instead of the item texture. The code for the npc equiping a primary weapon directly from the db is as follows:
Code:
npc->d_meele_texture1=atoi(newid);
npc->equipment[7]=item2->item_nr;
if (item2->common.spellId0!=0)
npc->CastToMob()->AddProcToWeapon(item2->common.spellId0,true);
npc->AC+=item2->common.AC;
npc->STR+=item2->common.STR;
See how equipment[7] (primary slot) uses the item id? When an npc spawns, its d_meele_texture1 is automatically set to the equipment[7] so without looking to deep into the code, it might very well be the item id number its looking for.