old_pharmacist.txt 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. //===== rAthena Script =======================================
  2. //= Old Pharmacist
  3. //===== By: ==================================================
  4. //= DZeroX
  5. //===== Current Version: =====================================
  6. //= 1.4
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Trade in items for potions.
  11. //= Breakdown of arguments used:
  12. //= arg(0): Herb required.
  13. //= arg(1): Zeny cost.
  14. //= arg(2): Potion given.
  15. //===== Additional Comments: =================================
  16. //= 1.0 Fully working. [DZeroX]
  17. //= 1.0a Minor fixes [Lupus]
  18. //= 1.1 Added changed the dialogs and name to fit the
  19. //= the official information. [DZeroX]
  20. //= 1.1a Removed .GATs [Lupus]
  21. //= 1.1b Fixed a bug in Orange Potion creating. Copy&Pasting = bad. [L0ne_W0lf]
  22. //= 1.2 Added checkweight, and input min/max values. [L0ne_W0lf]
  23. //= 1.3 Fixed minor condition check bug. (bugreport:597) [L0ne_W0lf]
  24. //= 1.4 Updated to match AEGIS script. [Kisuka]
  25. //============================================================
  26. alberta_in,16,28,4 script Pharmacist 61,{
  27. if (checkweight(1201,1) == 0) {
  28. mes "- Wait a moment! -";
  29. mes "- Currently you're carrying -";
  30. mes "- too many items with you. -";
  31. mes "- Please come back later -";
  32. mes "- after you put some items into kafra storage. -";
  33. close;
  34. }
  35. mes "[Old Pharmacist]";
  36. mes "Ummmm...";
  37. mes "What brings you here...?";
  38. next;
  39. switch(select("Make Potion:Talk.:Mixing Information:Cancel")) {
  40. case 1:
  41. if (MaxWeight - Weight < 5000) {
  42. mes "[Old Pharmacist]";
  43. mes "Why are you carrying these so many!";
  44. mes "Don't be greedy, carry only as much you need!";
  45. next;
  46. mes "[Old Pharmacist]";
  47. mes "You are too heavy to receive potions from me...";
  48. mes "Go store some items in your storage first!";
  49. close;
  50. } else {
  51. mes "[Old Pharmacist]";
  52. mes "You have all the stuff ready, right? Which one would you like?";
  53. next;
  54. switch(select("Red Potion.:Orange Potion.:Yellow Potion.:White Potion.:Blue Potion.:Green Potion.:Actually, I don't want anything.")) {
  55. case 1:
  56. callsub L_Making,507,3,501;
  57. case 2:
  58. mes "[Old Pharmacist]";
  59. if (countitem(507) < countitem(713)) {
  60. set .@max,countitem(507);
  61. }
  62. else if (countitem(508) < countitem(713)) {
  63. set .@max,countitem(508);
  64. }
  65. else {
  66. set .@max,countitem(713);
  67. }
  68. if ((countitem(507) < 1) || (countitem(508) < 1) || (countitem(713) == 0)) {
  69. mes "You rascal! What did you expect?! Coming here with nothing. Tsk!";
  70. mes "Get lost!";
  71. close;
  72. }
  73. if (Zeny < 3) {
  74. mes "You rascal! What did you expect?! Coming here with nothing. Tsk!";
  75. mes "Get lost!";
  76. close;
  77. }
  78. mes "How many?";
  79. next;
  80. switch(select("Make as many as I can.:I want to choose an amount.:Actually, I don't want anything.")) {
  81. case 1:
  82. if ((countitem(507) < .@max) || (countitem(508) < .@max) || (countitem(713) < .@max) || (Zeny < .@max*3)) {
  83. mes "[Old Pharmacist]";
  84. mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
  85. close;
  86. }
  87. set Zeny,Zeny-(.@max*5);
  88. delitem 507,.@max; //Red_Herb
  89. delitem 508,.@max; //Yellow_Herb
  90. delitem 713,.@max; //Empty_Bottle
  91. getitem 502,.@max; //Orange_Potion
  92. break;
  93. case 2:
  94. mes "[Old Pharmacist]";
  95. mes "Then pick a number below 100. If you don't want any, just enter '0'. With the materials you have, you can make about "+.@max+" potions.";
  96. next;
  97. input .@amount,0,101;
  98. if (.@amount == 0) {
  99. mes "[Old Pharmacist]";
  100. mes "Make up your mind, will you?!";
  101. close;
  102. }
  103. if (.@amount > 100) {
  104. mes "[Old Pharmacist]";
  105. mes "Are you deaf? I said less than 100!";
  106. close;
  107. }
  108. if ((countitem(507) < .@amount) || (countitem(508) < .@amount) || (countitem(713) < .@amount) || (Zeny < .@amount*3)) {
  109. mes "[Old Pharmacist]";
  110. mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
  111. close;
  112. }
  113. next;
  114. set Zeny,Zeny-(.@amount*5);
  115. delitem 507,.@amount; //Red_Herb
  116. delitem 508,.@amount; //Yellow_Herb
  117. delitem 713,.@amount; //Empty_Bottle
  118. getitem 502,.@amount; //Orange_Potion
  119. break;
  120. case 3:
  121. mes "[Old Pharmacist]";
  122. mes "What?!";
  123. mes "Grrr...";
  124. mes "Bleh!";
  125. mes "Get lost!";
  126. close;
  127. }
  128. mes "[Old Pharmacist]";
  129. mes "Here you go. It's all done so you can take it. But remember! Abusing medicine is not good.";
  130. close;
  131. case 3:
  132. callsub L_Making,508,10,503;
  133. case 4:
  134. callsub L_Making,509,20,504;
  135. case 5:
  136. callsub L_Making,510,30,505;
  137. case 6:
  138. callsub L_Making,511,3,506;
  139. case 7:
  140. mes "[Old Pharmacist]";
  141. mes "What?!";
  142. mes "Grrr...";
  143. mes "Bleh!";
  144. mes "Get lost!";
  145. close;
  146. }
  147. }
  148. case 2:
  149. mes "[Old Pharmacist]";
  150. mes "With medicine, you can increase a person's ability to regenerate. But, they're only good up to a point. *Sigh* I'm starting to think of the days when I was young. I must be getting old.";
  151. next;
  152. mes "[Old Pharmacist]";
  153. mes "Anyways, a potion is merely a potion. Nothing more and nothing less.";
  154. close;
  155. case 3:
  156. mes "[Old Pharmacist]";
  157. mes "Hrrrmm...";
  158. mes "You young ones can be quite annoying. But, since you asked, I'll explain.";
  159. next;
  160. mes "[Old Pharmacist]";
  161. mes "Herbs work well by themselves, but if you use my special techniques and skills to make potions out of them, the effect is much much greater.";
  162. next;
  163. mes "[Old Pharmacist]";
  164. mes "If you ask eagerly and politely, I will make them for you. But, not for free... Don't worry though, I only charge a small fee, so it's not that expensive.";
  165. next;
  166. mes "[Old Pharmacist]";
  167. mes "Red Potion - ^0098E52 Red Herbs, 1 Empty Bottle, 2 zeny fee.^000000";
  168. mes "Orange Potion - ^0098E51 Red Herb, 1 Yellow Herb, 1 Empty Bottle, 5 zeny fee.^000000";
  169. mes "Yellow Potion - ^0098E52 Yellow Herbs, 1 Empty Bottle, 10 zeny.^000000";
  170. next;
  171. mes "[Old Pharmacist]";
  172. mes "White Potion - ^0098E52 White Herbs, 1 Empty Bottle, 20 zeny fee.^000000";
  173. mes "Blue Potion - ^0098E52 Blue Herbs, 1 Empty Bottle, 30 zeny fee.^000000";
  174. mes "Green Potion - ^0098E52 Green Herbs, 1 Empty Bottle, 3 zeny fee.^000000";
  175. close;
  176. case 4:
  177. mes "[Old Pharmacist]";
  178. mes "What a boring person. If you have something to say, why don't you say it?!";
  179. close;
  180. }
  181. L_Making:
  182. .@item_req = getarg(0);
  183. .@req_amount = getarg(1);
  184. mes "[Old Pharmacist]";
  185. if ((countitem(.@item_req)/2) < countitem(713)) {
  186. .@max = countitem(.@item_req) /2;
  187. } else {
  188. .@max = countitem(713);
  189. }
  190. if (countitem(.@item_req) < 2 || countitem(713) == 0) {
  191. mes "You rascal! What did you expect?! Coming here with nothing. Tsk!";
  192. mes "Get lost!";
  193. close;
  194. }
  195. if (Zeny < 3) {
  196. mes "You rascal! What did you expect?! Coming here with nothing. Tsk!";
  197. mes "Get lost!";
  198. close;
  199. }
  200. mes "How many?";
  201. next;
  202. switch(select("Make as many as I can.:I want to choose an amount.:Actually, I don't want anything.")) {
  203. case 1:
  204. if ((countitem(.@item_req) < .@max*2) || countitem(713) < .@max || (Zeny < .@max*.@req_amount)) {
  205. mes "[Old Pharmacist]";
  206. mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
  207. close;
  208. }
  209. Zeny = Zeny - (.@max*.@req_amount);
  210. delitem .@item_req,.@max*2;
  211. delitem 713,.@max; //Empty_Bottle
  212. getitem getarg(2),.@max;
  213. break;
  214. case 2:
  215. mes "[Old Pharmacist]";
  216. mes "Then pick a number below 100. If you don't want any, just enter '0'. With the materials you have, you can make about "+.@max+" potions.";
  217. next;
  218. input .@amount;
  219. if (.@amount == 0) {
  220. mes "[Old Pharmacist]";
  221. mes "Make up your mind, will you?!";
  222. close;
  223. }
  224. if (.@amount > 100) {
  225. mes "[Old Pharmacist]";
  226. mes "Are you deaf? I said less than 100!";
  227. close;
  228. }
  229. if ((countitem(.@item_req) < .@amount*2) || countitem(713) < .@amount || (Zeny < .@amount*.@req_amount)) {
  230. mes "[Old Pharmacist]";
  231. mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
  232. close;
  233. }
  234. Zeny = Zeny - (.@max*.@req_amount);
  235. delitem .@item_req,.@amount*2;
  236. delitem 713,.@amount; //Empty_Bottle
  237. getitem getarg(2),.@amount;
  238. break;
  239. case 3:
  240. mes "[Old Pharmacist]";
  241. mes "What?!";
  242. mes "Grrr...";
  243. mes "Bleh!";
  244. mes "Get lost!";
  245. close;
  246. }
  247. mes "[Old Pharmacist]";
  248. mes "Here you go. It's all done so you can take it. But remember! Abusing medicine is not good.";
  249. close;
  250. }