This should work. please test it first because I haven't tested it myself:
//================ DONATION Trader===================
turbo_room,99,120,6<tab>script<tab>Donation Shop<tab>403,{
mes .name$;
mes "You currently have "+countitem(.tcg_item)+" TCG.";
mes "Would you like to look at the shop?";
next;
if (select("Yes:No") == 2) close;
close2;
callshop "Donation_SHOP",1;
npcshopattach "Donation_SHOP";
dispbottom "You currently have "+countitem(.Donation_item)+" TCG.";
end;
OnBuyItem:
for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
for(set @j,0; @j < getarraysize(.TCG_ITEMS); set @j,@j+1) {
if(.TCG_ITEMS[@j] == @bought_nameid[@i]) {
set @itemcost,(.ITEMPRICE[@j]*@bought_quantity[@i]);
set @totalcost,(@totalcost+@itemcost);
break;
}
}
}
if(@totalcost > countitem(.tcg_item)) {
dispbottom "You don't have enough TCG.";
} else {
for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
getitem @bought_nameid[@i],@bought_quantity[@i];
announce strcharinfo(0) + " has purchase a " + getitemname(@bought_nameid[@i]) + " from the donation NPC";
}
delitem .tcg_item,@totalcost;
dispbottom "Thank you for shopping.";
}
set @totalcost,0;
deletearray @bought_nameid[0],128;
deletearray @bought_quantity[0],128;
end;
OnInit:
npcshopdelitem "Donation_SHOP",909; // Leave this alone
set .name$,"[Donation Trader]";
set .tcg_item,7179; // Input TCG ID
setarray .TCG_ITEMS[0],5467,2720,2721,2722,2723,2724,2725,5374,5518,2629,20001,1228,13017,2630,4441,2554,5325;
setarray .ITEMPRICE[0],10,7,7,7,7,7,7,10,10,8,6,5,6,4,10,6,4; // Item prices - Should followe ID's order
for(set .@item,0; .@item < getarraysize(.TCG_ITEMS); set .@item,.@item+1) {
npcshopadditem "Donation_SHOP",.TCG_ITEMS[.@item],.ITEMPRICE[.@item];
}
end;
}
- shop Donation_SHOP -1,909:5
EDIT:
xD too late