@Vitrue: Here are the changes --
case 5:
set @s, select(implode(.Names$,":"));
//...
callshop "mission_shop"+@s,1;
npcshopattach "mission_shop"+@s;
end;
OnBuyItem:
for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1)
for(set .@j,0; .@j<getarraysize(getd(".Shop"+@s)); set .@j,.@j+2)
if (getd(".Shop"+@s+"["+.@j+"]") == @bought_nameid[.@i]) {
set @cost, @cost+(getd(".Shop"+@s+"["+(.@j+1)+"]")*@bought_quantity[.@i]);
break;
}
OnInit:
// new shop arrays (be sure to rename the first one)
setarray .Shop1[0],1202,5,1229,20;
setarray .Shop2[0],5116,15;
setarray .Names$[0],"Weapons","Headgears";
for(set .@i,1; .@i<=getarraysize(.@Names$); set .@i,.@i+1) {
npcshopdelitem "mission_shop"+.@i,512;
for(set .@j,0; .@j<getarraysize(getd(".Shop"+.@i)); set .@j,.@j+2)
npcshopadditem "mission_shop"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
}
end;
}
// duplicate shops as necessary
- shop mission_shop1 -1,512:-1
- shop mission_shop2 -1,512:-1