ammo_dealer.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. //===== rAthena Script =======================================
  2. //= Bullet Dealers
  3. //===== Description: =========================================
  4. //= Bullet trader.
  5. //===== Changelogs: ==========================================
  6. //= 1.0 First version [Playtester]
  7. //= 1.1 Converted from Aegis [Paradox924X]
  8. //= 1.2 More optimized conversion [Legionaire]
  9. //= 1.2a Removed .GATs [Lupus]
  10. //= 1.3 Fixed [Playtester] Optimized. Got rid of @vars [Lupus]
  11. //= 1.4 Updated to match AEGIS script. [Kisuka]
  12. //= 1.5 Updated to match AEGIS script again. [Masao]
  13. //= 1.6 Moved Izlude duplicate to pre-re/re paths. [Euphy]
  14. //= 2.0 Clean-up. [Capuche]
  15. //= 2.1 Fixes Issue #1482, where Rebellion jobs cannot use this npc. [Limestone]
  16. //============================================================
  17. alberta,118,160,3 script Bullet Dealer Tony#alb::bdt 4_M_04,{
  18. mes "[Tony]";
  19. if (BaseClass == Job_Gunslinger) {
  20. mes "I'm Tony, the Bullet Dealer.";
  21. mes "Come to me whenever you're";
  22. mes "short on ammo. Just bring me";
  23. mes "the materials, and I'll make";
  24. mes "you the bullets you need.";
  25. next;
  26. switch(select("Poison Sphere:Flare Sphere:Lighting Sphere:Blind Sphere:Freezing Sphere:Cancel")) {
  27. case 1: callsub S_BulletTrade,937,10,13205;// <item required>, <amount req>, <bullet id>
  28. case 2: callsub S_BulletTrade,7097,2,13203;
  29. case 3: callsub S_BulletTrade,7053,3,13204;
  30. case 4: callsub S_BulletTrade,1024,5,13206;
  31. case 5: callsub S_BulletTrade,7054,2,13207;
  32. case 6:
  33. mes "[Tony]";
  34. mes "Changed your mind?";
  35. mes "Well, if you ever need";
  36. mes "any bullets, I'll be right";
  37. mes "here. Come back whenever";
  38. mes "you think you'll need more";
  39. mes "ammunition, Gunslinger.";
  40. close;
  41. }
  42. }
  43. mes "Hey, I'm Tony. I'm in";
  44. mes "charge of distributing";
  45. mes "and making bullets for";
  46. mes "Gunslingers. It's just";
  47. mes "how our guild likes";
  48. mes "to do things.";
  49. next;
  50. mes "[Tony]";
  51. mes "I'm sorry if you came";
  52. mes "here to buy some bullets.";
  53. mes "I can only do business with";
  54. mes "fully fledged Gunslingers.";
  55. close;
  56. S_BulletTrade:
  57. .@required_id = getarg(0);
  58. .@required_amount = getarg(1);
  59. .@bullet_id = getarg(2);
  60. mes "[Tony]";
  61. mes "For every set of";
  62. mes callfunc("F_InsertPlural",30,getitemname(.@bullet_id))+",";
  63. mes "you must give me";
  64. mes "1 Emveretarcon,";
  65. mes "1 Phracon, and";
  66. mes callfunc("F_InsertPlural",.@required_amount,getitemname(.@required_id))+".";
  67. next;
  68. mes "[Tony]";
  69. mes "Remember that I can give";
  70. mes "a maximum of 500 sets of";
  71. mes "30 bullets at a time. Please";
  72. mes "enter the number of bullet sets";
  73. mes "that you'd like. If you want to";
  74. mes "cancel, then just enter ''0.''";
  75. next;
  76. input .@amount;
  77. mes "[Tony]";
  78. if (.@amount < 1 || .@amount > 500) {
  79. mes "Hey, I can't give you";
  80. mes "that many bullets. Don't";
  81. mes "forget to enter a number";
  82. mes "that's no higher than 500";
  83. mes "if you want to trade your";
  84. mes "items for some bullets.";
  85. }
  86. else if (countitem(1010) >= .@amount && countitem(1011) >= .@amount && countitem(.@required_id) >= (.@amount*.@required_amount)) {
  87. if (checkweight(.@bullet_id,.@amount * 30) == 0) {
  88. mes "Eh? Your Inventory doesn't";
  89. mes "have enough space for this";
  90. mes "many bullets. Come back later";
  91. mes "after you make more space";
  92. mes "available. Try putting some of";
  93. mes "your things into Kafra Storage.";
  94. } else {
  95. mes "Great, everything seems";
  96. mes "to be in order. Let me take";
  97. mes "these materials, and here are";
  98. mes "your bullets. It's a pleasure";
  99. mes "to do business with you~";
  100. delitem 1010,.@amount; //Phracon
  101. delitem 1011,.@amount; //Emveretarcon
  102. delitem .@required_id,.@amount * .@required_amount;
  103. getitem .@bullet_id,.@amount * 30;
  104. }
  105. } else {
  106. mes "Huh. It looks like you";
  107. mes "don't have enough materials";
  108. mes "for that many bullets. Well,";
  109. mes "it's no problem. Just come";
  110. mes "back after gathering everything";
  111. mes "that you need, okay?";
  112. }
  113. close;
  114. }
  115. que_ng,187,156,3 duplicate(bdt) Bullet Dealer Tony#ng 86
  116. izlude,171,133,3 duplicate(bdt) Bullet Dealer Tony#iz 86