Guest User

Untitled

a guest
Jul 18th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. //-----------------------------------------------
  2. //---------------- Points Trader --------------
  3. //-----------------------------------------------
  4. prontera,140,169,5 script Hourly Points Shop 405,{
  5. if(getgmlevel() >= 60) {
  6. mes "[ Hourly Points Shop ]";
  7. mes "Hello "+strcharinfo(0);
  8. mes "What can I help you with today?";
  9. menu "Normal Menu",Normalmenu,"GM Menu",gmmenushop;
  10. gmmenushop:
  11. callfunc "Event_Points_Viewer";
  12. end;
  13. }
  14.  
  15. Normalmenu:
  16. callshop "Donator_SHOP#02",1;
  17. npcshopattach "Donator_SHOP#02";
  18. message strcharinfo(0),"You currently have ["+#KAFRAPOINTS+"] Hourly Points.";
  19. end;
  20.  
  21. OnBuyItem:
  22. for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
  23. for(set @j,0; @j < getarraysize(.POD_ITEMS); set @j,@j+2) {
  24. if(.POD_ITEMS[@j] == @bought_nameid[@i]) {
  25. set @itemcost,(.POD_ITEMS[(@j+1)]*@bought_quantity[@i]);
  26. set @totalcost,(@totalcost+@itemcost);
  27. break;
  28. }
  29. }
  30. }
  31. if(@totalcost > #KAFRAPOINTS) {
  32. message strcharinfo(0),"You don't have enough Hourly Points.";
  33. } else {
  34. for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
  35. getitem @bought_nameid[@i],@bought_quantity[@i];
  36. }
  37. set #KAFRAPOINTS,#KAFRAPOINTS-@totalcost;
  38. //delitem .pod_item,@totalcost;
  39. message strcharinfo(0),"You now have ["+#KAFRAPOINTS+"] Hourly Points left.";
  40. }
  41. set @totalcost,0;
  42. deletearray @bought_nameid[0],128;
  43. deletearray @bought_quantity[0],128;
  44. end;
  45.  
  46. OnInit:
  47. npcshopdelitem "Donator_SHOP#02",909;
  48. set .name$,"^9933FF[Kafra Point Trader]^000000";
  49. setarray .POD_ITEMS[0],12215,1,12216,1,12218,3,12114,2,12115,2,12116,2,12117,2,14517,3,14518,3,14519,3,14520,3,14545,2,13517,15,30110,15,30021,1000,30004,1000,7086,3000,7077,3000,7078,3000,7079,3000,7088,3000,7089,3000,7090,3000,7091,3000,7092,3000,; // Input as many items as you want (item::price)
  50.  
  51. for(set .@i,0; .@i < getarraysize(.POD_ITEMS); set .@i,.@i+2) {
  52. npcshopadditem "Donator_SHOP#02",.POD_ITEMS[.@i],.POD_ITEMS[(.@i+1)];
  53. }
  54. }
  55.  
  56. - shop Donator_SHOP#02 139,909:10
Add Comment
Please, Sign In to add comment