Not that I know of... I've never tried OnEquip_Script inside of a npc script but I don't see how that would even work. That being said there is an alternative.
I'm just going to post the two methods I worked out feel free to use either although they are both untested.
Simple:
- script set_script_npc -1,{
for( .@a = 0; .@a < .len; .@a++ )
setitemscript .item_ids[.@a], "{ atcommand \"@refine "+getiteminfo( .item_ids[.@a], 5 )+" 20\"; }", 1;
end;
OnInit:
setarray .item_ids, 2220, 2301, 1201, 2101;
.len = getarraysize( .item_ids );
}
Convoluted:
- script set_script_npc -1,{
for( .@a = 0; .@a < .len; .@a++ ) {
.@equip_loc = getiteminfo( .item_ids[.@a], 5 );
for( .@b = 0; pow( 2, .@b ) <= .@equip_loc; .@b++ )
if( .@equip_loc & pow( 2, .@b ) ) {
setitemscript .item_ids[.@a], "{ callfunc(\"on_eq_refiner\","+.script_equip_slot[.@a]+"); }", 1;
break;
}
}
end;
OnInit:
setarray .item_ids, 2220, 2301, 1201, 2101;
setarray .script_equip_slot, EQI_HEAD_LOW, EQI_HAND_R, EQI_ACC_R, EQI_ARMOR, EQI_HAND_L, EQI_SHOES,
EQI_ACC_L, EQI_HEAD_TOP, EQI_HEAD_MID, EQI_COSTUME_HEAD_TOP, EQI_COSTUME_HEAD_MID,
EQI_COSTUME_HEAD_LOW, EQI_COSTUME_GARMENT, 0, EQI_AMMO, EQI_SHADOW_ARMOR, EQI_SHADOW_WEAPON,
EQI_SHADOW_SHIELD, EQI_SHADOW_SHOES, EQI_SHADOW_ACC_R, EQI_SHADOW_ACC_L;
.len = getarraysize( .item_ids );
}
function script on_eq_refiner {
.@refine = getequiprefinerycnt( getarg(0) );
if( .@refine < 20 )
successrefitem getarg(0), 20 - .@refine;
return;
}