novice_exchange.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. //===== rAthena Script =======================================
  2. //= Novice Goods Exchanger
  3. //===== By: ==================================================
  4. //= ???, rAthena Team
  5. //===== Current Version: =====================================
  6. //= 1.4
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Exchanges your Basic Monster drops for Red Potions.
  12. //===== Additional Comments: =================================
  13. //= 1.2 Rescripted to Aegis 10.standards. [L0ne_W0lf[
  14. //= Made it easier to add new items to exhange list
  15. //= meaning only the exchange is done in a function now.
  16. //= 1.3 Fixed dialog mix-up in function. [L0ne_W0lf]
  17. //= 1.4 Added checkweight, and input min/max values. [L0ne_W0lf]
  18. //============================================================
  19. prontera,123,102,5 script Merchant#pron 85,{
  20. if (MaxWeight - Weight < 6301 || checkweight(1201,1) == 0) {
  21. mes "[Merchant]";
  22. mes "Haha!";
  23. mes "What are you, superhuman?";
  24. mes "You're carrying so much stuff!";
  25. mes "You better put some of that";
  26. mes "into Kafra Storage~";
  27. close;
  28. }
  29. mes "[Merchant]";
  30. mes "Good day!";
  31. mes "Have you collected any";
  32. mes "items like Shells or Fluff?";
  33. mes "What about Jellopies? Oh yeah,";
  34. mes "I need those for something.";
  35. next;
  36. mes "[Merchant]";
  37. mes "Of course, I won't ask you";
  38. mes "to give me that stuff for free. What about if I trade a Red Potion for 5 Shells, 10 Fluff,";
  39. mes "or 10 Jellopies?";
  40. next;
  41. switch(select("Sure!:I think it's a rip-off!:No, thanks.")) {
  42. case 1:
  43. mes "[Merchant]";
  44. mes "So which item do";
  45. mes "you want to bring me?";
  46. mes "Shells, Fluffs, or Jellopies?";
  47. next;
  48. switch(select("Shells:Jellopies:Fluff:Cancel")) {
  49. case 1: callfunc "F_PotExchange",935,5;
  50. case 2: callfunc "F_PotExchange",909,10;
  51. case 3: callfunc "F_PotExchange",914,10;
  52. case 4:
  53. mes "[Merchant]";
  54. mes "Sure~";
  55. mes "No problem.";
  56. close;
  57. }
  58. case 2:
  59. mes "[Merchant]";
  60. mes "A rip-off...?";
  61. mes "If you check the market value";
  62. mes "of the items being traded, I'm actually the one getting";
  63. mes "ripped off here.";
  64. close;
  65. case 3:
  66. mes "[Merchant]";
  67. mes "Alright,";
  68. mes "no problem.";
  69. mes "But come back to me";
  70. mes "if you change your mind.";
  71. close;
  72. }
  73. }
  74. morocc,180,259,3 script Merchant#Morocc 85,{
  75. if (MaxWeight - Weight < 6301 || checkweight(1201,1) == 0) {
  76. mes "[Merchant]";
  77. mes "Haha!";
  78. mes "What are you, superhuman?";
  79. mes "You're carrying so much stuff!";
  80. mes "You better put some of that";
  81. mes "into Kafra Storage~";
  82. close;
  83. }
  84. mes "[Merchant]";
  85. mes "Good day!";
  86. mes "Have you collected any";
  87. mes "Shells or Feathers of Bird?";
  88. mes "What about Jellopies? Oh yeah,";
  89. mes "I need those for something.";
  90. next;
  91. mes "[Merchant]";
  92. mes "Of course, I won't ask you";
  93. mes "to give me that stuff for free. What about if I trade a Red Potion for 5 Shells, 7 Feathers of Bird";
  94. mes "or 10 Jellopies?";
  95. next;
  96. switch(select("Sure!:I think it's a rip-off!:No, thanks.")) {
  97. case 1:
  98. mes "[Merchant]";
  99. mes "So which item do";
  100. mes "you want to bring me?";
  101. mes "Shells, Feathers of Birds,";
  102. mes "or Jellopies?";
  103. next;
  104. switch(select("Shells:Feathers of Birds:Jellopies:Cancel")) {
  105. case 1: callfunc "F_PotExchange",935,5;
  106. case 2: callfunc "F_PotExchange",916,7;
  107. case 3: callfunc "F_PotExchange",909,10;
  108. case 4:
  109. mes "[Merchant]";
  110. mes "Sure~";
  111. mes "No problem.";
  112. close;
  113. }
  114. case 2:
  115. mes "[Merchant]";
  116. mes "A rip-off...?";
  117. mes "If you check the market value";
  118. mes "of the items being traded, I'm actually the one getting";
  119. mes "ripped off here.";
  120. close;
  121. case 3:
  122. mes "[Merchant]";
  123. mes "Alright,";
  124. mes "no problem.";
  125. mes "But come back to me";
  126. mes "if you change your mind.";
  127. close;
  128. }
  129. }
  130. payon,200,134,5 script Merchant#pay 85,{
  131. if (MaxWeight - Weight < 6301 || checkweight(1201,1) == 0) {
  132. mes "[Merchant]";
  133. mes "Haha!";
  134. mes "What are you, superhuman?";
  135. mes "You're carrying so much stuff!";
  136. mes "You better put some of that";
  137. mes "into Kafra Storage~";
  138. close;
  139. }
  140. mes "[Merchant]";
  141. mes "Good day!";
  142. mes "Have you collected";
  143. mes "items like Tree Roots?";
  144. mes "What about Jellopies? Oh yeah,";
  145. mes "I need those for something.";
  146. next;
  147. mes "[Merchant]";
  148. mes "Of course, I won't ask you";
  149. mes "to give me that stuff for free. What about if I trade a Red Potion for 6 Tree Roots or 10 Jellopies?";
  150. next;
  151. switch(select("Sure!:I think it's a rip-off!:No, thanks.")) {
  152. case 1:
  153. mes "[Merchant]";
  154. mes "So which item do";
  155. mes "you want to bring me?";
  156. mes "Tree Roots, or Jellopies?";
  157. next;
  158. switch(select("Tree Roots:Jellopies:Cancel")) {
  159. case 1: callfunc "F_PotExchange",902,6;
  160. case 2: callfunc "F_PotExchange",909,10;
  161. case 3:
  162. mes "[Merchant]";
  163. mes "Sure~";
  164. mes "No problem.";
  165. close;
  166. }
  167. case 2:
  168. mes "[Merchant]";
  169. mes "A rip-off...?";
  170. mes "If you check the market value";
  171. mes "of the items being traded, I'm actually the one getting";
  172. mes "ripped off here.";
  173. close;
  174. case 3:
  175. mes "[Merchant]";
  176. mes "Alright,";
  177. mes "no problem.";
  178. mes "But come back to me";
  179. mes "if you change your mind.";
  180. close;
  181. }
  182. }
  183. aldebaran,152,63,5 script Merchant#alde 85,{
  184. if (MaxWeight - Weight < 6301 || checkweight(1201,1) == 0) {
  185. mes "[Merchant]";
  186. mes "Haha!";
  187. mes "What are you, superhuman?";
  188. mes "You're carrying so much stuff!";
  189. mes "You better put some of that";
  190. mes "into Kafra Storage~";
  191. close;
  192. }
  193. mes "[Merchant]";
  194. mes "Good day!";
  195. mes "Have you collected any";
  196. mes "Worm Peelings or Feather of Birds?";
  197. mes "How about Jellopies? Oh yeah,";
  198. mes "I need those for something.";
  199. next;
  200. mes "[Merchant]";
  201. mes "Of course, I won't ask you";
  202. mes "to give me that stuff for free. What about if I trade a Red Potion for 1 Worm Peeling, 7 Feather of Birds, or 10 Jellopies?";
  203. next;
  204. switch(select("Sure!:I think it's a rip-off!:No, thanks.")) {
  205. case 1:
  206. mes "[Merchant]";
  207. mes "So which item do";
  208. mes "you want to bring me?";
  209. mes "Feathers of Birds?";
  210. mes "Worm Peelings?";
  211. mes "Or Jellopies?";
  212. next;
  213. switch(select("Worm Peelings:Feathers of Birds:Jellopies:Cancel")) {
  214. case 1: callfunc "F_PotExchange",955,1;
  215. case 2: callfunc "F_PotExchange",916,7;
  216. case 3: callfunc "F_PotExchange",909,10;
  217. case 4:
  218. mes "[Merchant]";
  219. mes "Sure~";
  220. mes "No problem.";
  221. close;
  222. }
  223. case 2:
  224. mes "[Merchant]";
  225. mes "A rip-off...?";
  226. mes "If you check the market value";
  227. mes "of the items being traded, I'm actually the one getting";
  228. mes "ripped off here.";
  229. close;
  230. case 3:
  231. mes "[Merchant]";
  232. mes "Alright,";
  233. mes "no problem.";
  234. mes "But come back to me";
  235. mes "if you change your mind.";
  236. close;
  237. }
  238. }
  239. geffen,173,88,5 script Merchant#geff 85,{
  240. if (MaxWeight - Weight < 6301 || checkweight(1201,1) == 0) {
  241. mes "[Merchant]";
  242. mes "Haha!";
  243. mes "What are you, superhuman?";
  244. mes "You're carrying so much stuff!";
  245. mes "You better put some of that";
  246. mes "into Kafra Storage~";
  247. close;
  248. }
  249. mes "[Merchant]";
  250. mes "Good day!";
  251. mes "Have you collected any";
  252. mes "items like Shells or Chrysalises?";
  253. mes "What about Jellopies? Oh yeah,";
  254. mes "I need those for something.";
  255. next;
  256. mes "[Merchant]";
  257. mes "Of course, I won't ask you";
  258. mes "to give me that stuff for free. What about if I trade a Red Potion for 5 Shells or 6 Chrysalises, or 10 Jellopies?";
  259. next;
  260. switch(select("Sure!:I think it's a rip-off!:No, thanks.")) {
  261. case 1:
  262. mes "[Merchant]";
  263. mes "So which item do";
  264. mes "you want to bring me?";
  265. mes "Shells, Chrysalises, or Jellopies?";
  266. next;
  267. switch(select("Shells:Chrysalises:Jellopies:Cancel")) {
  268. case 1: callfunc "F_PotExchange",935,5;
  269. case 2: callfunc "F_PotExchange",915,6;
  270. case 3: callfunc "F_PotExchange",909,10;
  271. case 4:
  272. mes "[Merchant]";
  273. mes "Sure~";
  274. mes "No problem.";
  275. close;
  276. }
  277. case 2:
  278. mes "[Merchant]";
  279. mes "A rip-off...?";
  280. mes "If you check the market value";
  281. mes "of the items being traded, I'm actually the one getting";
  282. mes "ripped off here.";
  283. close;
  284. case 3:
  285. mes "[Merchant]";
  286. mes "Alright,";
  287. mes "no problem.";
  288. mes "But come back to me";
  289. mes "if you change your mind.";
  290. close;
  291. }
  292. }
  293. function script F_PotExchange {
  294. .@item_req = getarg(0);
  295. .@req_amount = getarg(1);
  296. if (countitem(.@item_req) < .@req_amount) {
  297. mes "[Merchant]";
  298. mes "Hey, where are";
  299. mes "all those "+ getitemname(.@item_req) +"";
  300. mes "that you promised?";
  301. mes "Give me "+ getitemname(.@item_req) +"!";
  302. close;
  303. }
  304. else {
  305. mes "[Merchant]";
  306. mes "Okay, let me check";
  307. mes "how many "+ getitemname(.@item_req) +" you";
  308. mes "have on you. Hmm...";
  309. next;
  310. mes "[Merchant]";
  311. mes "You have";
  312. mes "a total of "+ countitem(.@item_req) +" "+ getitemname(.@item_req) +".";
  313. mes "I can give you a total";
  314. mes "of "+ (countitem(.@item_req)/.@req_amount) +" Red Potions for those.";
  315. next;
  316. mes "[Merchant]";
  317. mes "What do you say?";
  318. mes "Do we have a deal?";
  319. next;
  320. if (select("Deal.:No deal.") == 1) {
  321. mes "[Merchant]";
  322. mes "You know the exact";
  323. mes "number of Red Potions";
  324. mes "you want to receive for";
  325. mes "those "+ getitemname(.@item_req) +", don't you?";
  326. next;
  327. mes "[Merchant]";
  328. mes "Now, I can trade you";
  329. mes "a minimum of 1 Red Potion";
  330. mes "and a maximum of 100 Red Potions";
  331. mes "at one time. If you change your";
  332. mes "mind, just enter '0' to cancel.";
  333. next;
  334. while(1) {
  335. input .@input,0,101;
  336. if (.@input == 0) {
  337. mes "[Merchant]";
  338. mes "What...?";
  339. mes "Why the hell do you";
  340. mes "even bother to talk to me?";
  341. mes "Pretty indecisive, aren't you?";
  342. close;
  343. }
  344. else if (.@input > 100) {
  345. mes "[Merchant]";
  346. mes "I can't give you more";
  347. mes "than 100 Red Potions";
  348. mes "at once. Let's try";
  349. mes "this again.";
  350. next;
  351. }
  352. else {
  353. break;
  354. }
  355. }
  356. .@put_out_item = .@input * .@req_amount;
  357. if (countitem(.@item_req) < .@put_out_item) {
  358. mes "[Merchant]";
  359. mes "Uh oh, the number you entered doesn't seem right. You better check the number of Red Potions that you can trade for again.";
  360. close;
  361. }
  362. mes "[Merchant]";
  363. mes "There you go!";
  364. mes "Check how many Red Potions";
  365. mes "I've given you, it should be good. Thanks, that was a good deal~";
  366. delitem .@item_req,.@put_out_item; //Shell
  367. getitem 501,.@input; //Red_Potion
  368. close;
  369. }
  370. mes "[Merchant]";
  371. mes "Huh~";
  372. mes "Alright.";
  373. mes "Though aren't";
  374. mes "Red Potions more useful";
  375. mes "to an adventurer like you?";
  376. close;
  377. }
  378. }
  379. //============================================================
  380. // Old changelog
  381. //============================================================
  382. //= 1.1 Made it as a function. U can add your own Merchs [Lupus]
  383. //= 1.1a Fixed item select [KarLaeda]
  384. //============================================================