milk_trader.txt 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //===== rAthena Script =======================================
  2. //= Milk Trader
  3. //===== By: ==================================================
  4. //= kobra_k88; L0ne_W0lf
  5. //===== Current Version: =====================================
  6. //= 1.5
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Trades bottles for milk
  12. //===== Additional Comments: =================================
  13. //= Fully working
  14. //= 1.1 Negative input bug fixed [Lupus]
  15. //= 1.2 Raised the price to close zeny exploit [Lupus]
  16. //= 1.2a Switched to Lupus's "loopless" technique.[kobra_k88]
  17. //= 1.3 Rescripted to Aegis 10.3 standards. [L0ne_W0lf]
  18. //= 1.4 Implemented checkweight. [L0ne_W0lf]
  19. //= 1.5 Fixed missed variable. (bugreport:1523) [L0ne_W0lf]
  20. //============================================================
  21. prontera,73,140,0 script Milk Vendor 86,{
  22. if (checkweight(1201,1) == 0) {
  23. mes "^3355FFJust a minute!";
  24. mes "I can't offer any of my";
  25. mes "services to you because";
  26. mes "you're carrying too much";
  27. mes "stuff. Put your extra items in";
  28. mes "Kafra Storage and come again~";
  29. close;
  30. }
  31. mes "[Milk Vendor]";
  32. mes "Hey, hey...";
  33. mes "If you bring me";
  34. mes "1 Empty Bottle and";
  35. mes "15 Zeny, I'll exchange";
  36. mes "them for 1 Milk. How";
  37. mes "does that sound?";
  38. next;
  39. if (select("Exchange all empty bottles.:Cancel") == 1) {
  40. if (countitem(713) <= 0) {
  41. mes "[Milk Vendor]";
  42. mes "Hey...";
  43. mes "You don't have";
  44. mes "any Empty Bottles.";
  45. mes "I can't really give you";
  46. mes "this milk any other";
  47. mes "way, you know...";
  48. close;
  49. }
  50. set .@bottles,countitem(713);
  51. set .@total_weight,.@bottles * 50;
  52. set .@total_cost,.@bottles * 15;
  53. if (Zeny < .@Total_cost) {
  54. mes "[Milk Vendor]";
  55. mes "Oh, whoa~!";
  56. mes "You don't have enough";
  57. mes "zeny to exchange all";
  58. mes "these Empty Bottles for";
  59. mes "Milk. You need to have";
  60. mes "at least " + .@total_cost + " zeny.";
  61. close;
  62. }
  63. if (MaxWeight - Weight < .@total_weight) {
  64. mes "[Milk Vendor]";
  65. mes "Hmm...";
  66. mes "Would you make";
  67. mes "a little more room";
  68. mes "in your inventory";
  69. mes "before I give you";
  70. mes "all of this milk?";
  71. close;
  72. }
  73. set Zeny, Zeny-.@total_cost;
  74. delitem 713,.@bottles; //Empty Bottles
  75. getitem 519,.@bottles; //Milk
  76. close;
  77. }
  78. close;
  79. }