Multi Currency Shop [ Version 3 ]
Help got an error
always says Out of Maximum Capacity
// Fixed some Bug. [ By Goddameit ]
// Leave this alone...
- shop Emistry_Shop -1,512:1
turbo_room,63,97,5 script Frei-RO Item Shop 811,{
// NPC Name
set .name$,"[^FF0000 Frei - RO Item Shop ^000000]";
mes .name$;
mes "Each Shop Buy Item Using Different Items.";
mes "Which shop you like to look at it";
next;
deletearray .ItemLists[0],getarraysize( .ItemLists );
deletearray .ItemPrice[0],getarraysize( .ItemPrice );
npcshopitem "Emistry_Shop",512,1;
select("Donation Item Shop:Weapon Shop:Headgear Shop:Armor Shop:Muffler Shop:Shoe Shop:Shield Shop:Accessory Shop:Card Shop");
callsub CaseCH,@menu;
npcshopdelitem "Emistry_Shop",512;
for(set .@i,0; .@i < getarraysize( .ItemLists ); set .@i,.@i+1)
npcshopadditem "Emistry_Shop",.ItemLists[.@i],.ItemPrice[.@i];
mes "Okay...wait awhile";
mes "This Shop use ^FF0000"+getitemname( @Currency )+"^000000 to buy the Items.";
close2;
callsub CaseCH,@menu;
callshop "Emistry_Shop",1;
npcshopattach "Emistry_Shop";
dispbottom "You currently have "+countitem( @Currency )+" "+getitemname( @Currency )+".";
end;
OnBuyItem:
callsub CaseCH,@menu;
for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
for(set @j,0; @j < getarraysize( .ItemLists ); set @j,@j+1)
if( .ItemLists[@j] == @bought_nameid[@i] )
set @TotalCost,@TotalCost + ( .ItemPrice[@j] * @bought_quantity[@i] );
if( countitem( @Currency ) < @TotalCost )
{
for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 )
{
mes "Item : ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000";
mes "Quantity : ^0000FF"+@bought_quantity[@i]+"^000000";
}
mes "^00FF00____________________________^000000";
mes "Total Cost : ^0000FF"+@TotalCost+" x "+getitemname( @Currency )+"^000000";
mes "^00FF00____________________________^000000";
mes "[ ^FF0000X^000000 ] You do not have enough ^0000FF"+getitemname( @Currency )+"^000000 to purchase this.";
} else {
for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
{
getitem @bought_nameid[@i],@bought_quantity[@i];
message strcharinfo(0),"Purchased "+getitemname( @bought_nameid[@i] );
}
delitem @Currency,@TotalCost;
mes "Thank you for shopping.";
mes "You now have "+countitem( @Currency )+" "+getitemname( @Currency )+" left.";
}
set @TotalCost,0;
deletearray @bought_nameid[0],getarraysize( @bought_nameid );
deletearray @bought_quantity[0],getarraysize( @bought_quantity );
close;
CaseCH:
switch(getarg(0))
{
Case 1:
// Item Currency //Donation Item Shop
set @Currency,7179;
// Item ID Lists
setarray .ItemLists[0],30307,30189,30063,2543,30500,30501,30502,30503,2383,2410,1530,2541;
// Item Price
setarray .ItemPrice[0],1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;
return;
Case 2:
// Item Currency //Weapon Shop
set @Currency,7227;
// Item ID Lists
setarray .ItemLists[0],1530,1228,13412,13413,1577,1640,1281,1826,1187,1310,1641,2202,1827,13416,13177,13042,13179,1927,13418,1743,1282,1486,1981,1546,13110,13417,13176,13178,13307,1426,1576,1382,13017,1266;
// Item Price
setarray .ItemPrice[0],100,70,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50;
return;
Case 3:
// Item Currency //Headgear Shop
set @Currency,7227;
// Item ID Lists
setarray .ItemLists[0],5495,30318,5800,30117,5397,5490,5311,5423,5375,5266,5805,5305,5313,5418,5558,5421;
// Item Price
setarray .ItemPrice[0],90,50,55,500,12,24,10,12,20,12,55,25,18,60,30,150;
return;
Case 4:
// Item Currency //Armor Shop
set @Currency,7227;
// Item ID Lists
setarray .ItemLists[0],2383,2345,2347,2349,2351,2382,2374,2375,2378,2376,2377,2381,2379,2380;
// Item Price
setarray .ItemPrice[0],80,20,20,20,20,40,35,35,40,40,40,40,40,40;
return;
Case 5:
// Item Currency //Muffler Shop
set @Currency,7227;
// Item ID Lists
setarray .ItemLists[0],2538,2539,2537,2542,2540,2536;
// Item Price
setarray .ItemPrice[0],40,40,35,50,40,20;
return;
Case 6:
// Item Currency //Shoe Shop
set @Currency,7227;
// Item ID Lists
setarray .ItemLists[0],2410,2449,2436,2433,2437,2435;
// Item Price
setarray .ItemPrice[0],40,80,30,35,30,30;
return;
Case 7:
// Item Currency //Shield Shop
set @Currency,7227;
// Item ID Lists
setarray .ItemLists[0],2130,2138;
// Item Price
setarray .ItemPrice[0],40,25;
return;
Case 8:
// Item Currency //Accessory Shop
set @Currency,7227;
// Item ID Lists
setarray .ItemLists[0],30374,2630,2712,2744,2729,2733;
// Item Price
setarray .ItemPrice[0],50,30,45,40,15,35;
return;
Case 9:
// Item Currency //Card Shop
set @Currency,7227;
// Item ID Lists
setarray .ItemLists[0],4145,4365,4399,4441,4357,4376,4361;
// Item Price
setarray .ItemPrice[0],30,50,25,100,25,100,50;
return;
// Case 4,5,6.....etc...
default:
mes "Wrong Selection / Configurations";
close;
}
}