viewing paste Unknown #5897 | PHP

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
prontera,145,168,5      script  TCG Shop        414,{
mes .name$;
mes "You currently have "+countitem(.tcg_item)+" TCG.";
mes "Would you like to look at the shop?";
if(select("Yes:No") == 2) {
close;
}
close2;
callshop "TCG_SHOP",1;
npcshopattach "TCG_SHOP";
dispbottom "You currently have "+countitem(.tcg_item)+" TCG.";
 
OnBuyItem:
for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
for(set @j,0; @j < getarraysize(.TCG_ITEMS); set @j,@j+2) {
if(.TCG_ITEMS[@j] == @bought_nameid[@i]) {
set @itemcost,(.TCG_ITEMS[(@j+1)]*@bought_quantity[@i]);
set @totalcost,(@totalcost+@itemcost);
break;
}
}
}
if(@totalcost > countitem(.tcg_item)) {
dispbottom "You don't have enough TCG CARD.";
}
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.";
dispbottom "You now have "+countitem(.TCG_item)+" TCG left.";
}
set @totalcost,0;
deletearray @bought_nameid[0],128;
deletearray @bought_quantity[0],128;
 
OnInit:
npcshopdelitem "TCG_SHOP",909;                   // Leave this alone
set .name$,"[TCG Trader]";
set .tcg_item,7227;                               // Input TCG ID
setarray .TCG_ITEMS[0],30043,250,30044,250,30045,250,30046,250,30047,250,30048,250,30049,250;       // Input as many items as you want (item::price)
                     
for(set .@i,0; .@i < getarraysize(.TCG_ITEMS); set .@i,.@i+2) {
npcshopadditem "TCG_SHOP",.TCG_ITEMS[.@i],.TCG_ITEMS[(.@i+1)];
}
}
 
-       shop    TCG_SHOP        139,909:1
 
OnInit:
        waitingroom "TCG Shop",0;
        end;
 
}
Viewed 254 times, submitted by unknown.