//============ TCG Shop ==========
trinity,118,74,3 script Mid Shop 706,{
mes .name$;
mes "You currently have "+countitem(.TCG_item)+" TCGs.";
mes "Would you like to look at the shop?";
next;
if(select("Yes:No") == 2) {
close;
}
close2;
callshop "TCG_SHOP",1;
npcshopattach "TCG_SHOP";
dispbottom "You currently have "+countitem(.TCG_item)+" TCGs.";
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 TCGs.";
} else {
for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
getitem @bought_nameid[@i],@bought_quantity[@i];
}
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 "TCG_SHOP",908; // Leave this alone
set .name$,"[TCG Trader]";
set .TCG_item,7227; // Input TCG ID
setarray .TCG_ITEMS[0],23300; // Item IDs - 128 max
setarray .ITEMPRICE[0],100; // Item prices - Should followe ID's order
for(set .@i,0; .@i < getarraysize(.TCG_ITEMS); set .@i,.@i+1) {
npcshopadditem "TCG_SHOP",.TCG_ITEMS[.@i],.ITEMPRICE[.@i];
}
end;
}
- shop TCG_SHOP -2,908:-2
how to be this npc to duplicate with different item inside i try to make another TCG shop duplicate in npc\custom but the item is merging in the same npc ..
Question
Diss
hi guys i need help with this
this is the main TCG SHOP
how to be this npc to duplicate with different item inside i try to make another TCG shop duplicate in npc\custom but the item is merging in the same npc ..
how it can be guys
thanks for the help
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.