Advertisement
johnlol

Shopping

Jul 23rd, 2023
672
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VeriLog 4.82 KB | Gaming | 0 0
  1. /*
  2. ________________     ______            ________      
  3. ___    |_____  /________  /______      ___  __ \_____
  4. __  /| |  __  /_  __ \_  __ \  _ \     __  /_/ /  __ \
  5. _  ___ / /_/ / / /_/ /  /_/ /  __/     _  _, _// /_/ /
  6. /_/  |_\__,_/  \____//_.___/\___/      /_/ |_| \____/
  7.  
  8. */
  9.  
  10. // Fixed some Bug. [ By Goddameit ]
  11.  
  12. // Leave this alone...
  13. -   shop    Emistry_Shop    -1,512:15
  14.  
  15.  
  16. prontera.gat,182,174,5  script  Shopping    411,{
  17. // NPC Name
  18. set .name$,"[^FF0000  Shop  ^000000]";
  19.  
  20. mes .name$;
  21. mes "Each Shop Buy Item Using Different Items.";
  22. mes "Which shop you like to look at it";
  23. next;
  24. deletearray .ItemLists[0],getarraysize( .ItemLists );
  25. deletearray .ItemPrice[0],getarraysize( .ItemPrice );
  26. npcshopitem "Emistry_Shop",512,1;
  27. select("Headgears:Midgears:Lowgears:Items Box:God Items");
  28. callsub CaseCH,@menu;
  29.  
  30. npcshopdelitem "Emistry_Shop",512;
  31. for(set .@i,0; .@i < getarraysize( .ItemLists ); set .@i,.@i+1)
  32.     npcshopadditem "Emistry_Shop",.ItemLists[.@i],.ItemPrice[.@i];
  33. mes "Okay...wait awhile";
  34. mes "This Shop use ^FF0000"+getitemname( @Currency )+"^000000 to buy the Items.";
  35. close2;
  36. callsub CaseCH,@menu;
  37. callshop "Emistry_Shop",1;
  38. npcshopattach "Emistry_Shop";
  39. dispbottom "You currently have "+countitem( @Currency )+" "+getitemname( @Currency )+".";
  40. end;
  41.  
  42. OnBuyItem:
  43.     callsub CaseCH,@menu;
  44.     for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
  45.         for(set @j,0; @j < getarraysize( .ItemLists ); set @j,@j+1)
  46.             if( .ItemLists[@j] == @bought_nameid[@i] )
  47.             set @TotalCost,@TotalCost + ( .ItemPrice[@j] * @bought_quantity[@i] );
  48.     if( countitem( @Currency ) < @TotalCost )
  49.     {
  50.         for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 )
  51.         {
  52.             mes "Item : ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000";
  53.             mes "Quantity : ^0000FF"+@bought_quantity[@i]+"^000000";
  54.         }
  55.         mes "^00FF00____________________________^000000";
  56.         mes "Total Cost : ^0000FF"+@TotalCost+" x "+getitemname( @Currency )+"^000000";
  57.         mes "^00FF00____________________________^000000";
  58.         mes "[ ^FF0000X^000000 ] You do not have enough ^0000FF"+getitemname( @Currency )+"^000000 to purchase this.";
  59.     } else {
  60.         for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
  61.         {
  62.             getitem @bought_nameid[@i],@bought_quantity[@i];
  63.             message strcharinfo(0),"Purchased "+getitemname( @bought_nameid[@i] );
  64.         }
  65.         delitem @Currency,@TotalCost;
  66.         mes "Thank you for shopping.";
  67.         mes "You now have "+countitem( @Currency )+" "+getitemname( @Currency )+" left.";
  68.     }
  69.     set @TotalCost,0;
  70.     deletearray @bought_nameid[0],getarraysize( @bought_nameid );
  71.     deletearray @bought_quantity[0],getarraysize( @bought_quantity );
  72.     close;
  73.  
  74. CaseCH:
  75.     switch(getarg(0))
  76.     {
  77.         Case 1:
  78.             // Item Currency
  79.             set @Currency,7227;
  80.             // Item ID Lists
  81.             setarray .ItemLists[0],5688,5137,5132,5490,5265,5386,18613,5765,5776,5809,5320,5283,5417,5340,5573,5563,5655,5595,5374,5518,5341,5363,5467,5423,5366,5415,5454,5547,5212,5310,5761,5388,5738,18596,5379,5343,5682,5466,5464;
  82.             // Item Price
  83.             setarray .ItemPrice[0],250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250;
  84.             return;
  85.         Case 2:
  86.             // Item Currency
  87.             set @Currency,7227;
  88.             // Item ID Lists
  89.             setarray .ItemLists[0],5788,5389,5401,5800,5135,5244,5470,5664,5471,5516,5610,5315,5325,5397,5592,18503,19087,18603,19245,18747,19126,5985,18657,18839,19024,19086,19162,19085,18682,19109,18576;
  90.             // Item Price
  91.             setarray .ItemPrice[0],200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200;
  92.             return;
  93.         Case 3:
  94.             // Item Currency
  95.             set @Currency,7227;
  96.             // Item ID Lists
  97.             setarray .ItemLists[0],18679,18859,19154,18845,18754,18844,5868,18666,19147,19153,18925,18936,18670,19095,18564,18917,19146,19150,5532,18650,18867,19139,5574,19145;
  98.             // Item Price
  99.             setarray .ItemPrice[0],150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150;
  100.             return;
  101.         Case 4:
  102.             // Item Currency
  103.             set @Currency,7539;
  104.             // Item ID Lists
  105.             setarray .ItemLists[0],12103,14175,13581,13577,13585,13589,13595,14223,13610,13611,13716,13718,13720,13742,13745,13751,13757,13871,13872,13873,13874,13875,13876,13926,13927,13928,13929,13930,13931,13945,13946,13947,13948,13949,13950,13973,14180,13995;
  106.             // Item Price
  107.             setarray .ItemPrice[0],5,5,20,25,25,25,25,25,20,20,25,10,10,15,15,30,30,70,70,70,70,70,70,75,75,75,75,75,75,80,80,80,80,80,80,15,15,5;
  108.             return;
  109.         Case 5:
  110.             // Item Currency
  111.             set @Currency,7179;
  112.             // Item ID Lists
  113.             setarray .ItemLists[0],2629,2630,2410,1530,2541,2383,1161;
  114.             // Item Price
  115.             setarray .ItemPrice[0],500,500,500,500,500,500,500;
  116.             return;
  117.  
  118.         // Case 4,5,6.....etc...
  119.  
  120.         default:
  121.             mes "Wrong Selection / Configurations";
  122.             close;
  123.     }
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement