3rd_trader.txt 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. //===== rAthena Script =======================================
  2. //= 3rd Item Seller
  3. //===== By: ==================================================
  4. //= Masao
  5. //= Mercurial
  6. //===== Current Version: =====================================
  7. //= 1.1
  8. //===== Compatible With: =====================================
  9. //= rAthena SVN
  10. //===== Description: =========================================
  11. //= [Aegis Conversion]
  12. //= Sells some 3rd Job related Items.
  13. //===== Additional Comments: =================================
  14. //= v1.1 Optimized Poison Herb Salesman NPC
  15. //= v1.0 First Version.
  16. //============================================================
  17. job3_guil01,79,96,3 script Poison Herb Salesman::PHS 877,{
  18. // We are unsure about agis script command equivalent please refer to 3rd_trader.sc line 3
  19. //if( (countitem(1201)>=30000) || checkweight() )
  20. for(set .x,0; .x<getarraysize(.herbs); set .x,.x+1)
  21. {
  22. if(!checkweight(.herbs[.x],.maxHerbs))
  23. {
  24. mes "- Wait a minute !! -";
  25. mes "- Currently you're carrying -";
  26. mes "- too many items with you. -";
  27. mes "- Please try again -";
  28. mes "- after you loose some weight. -";
  29. close;
  30. }
  31. }
  32. mes .npcName$;
  33. mes "I am the professional";
  34. mes "poison herb seller.";
  35. mes "Which one do you want?";
  36. mes "They cost "+.herbCost[0]+" zeny each!";
  37. set .herbType,select("Nerium:Rantana:Makulata:Seratum:Scopolia:Amoena:Poison Kit")-1;
  38. next;
  39. if(.herbType==(getarraysize(.herbs)-1))
  40. {
  41. mes .npcName$;
  42. mes "You can only buy";
  43. mes "1 Poison Kit and it costs "+.herbCost[(getarraysize(.herbs)-1)]+" zeny.";
  44. mes "Will you buy it?";
  45. switch(select("Yes, I will.:No, I won't."))
  46. {
  47. case 1:
  48. if(Zeny < .poisHerbCost)
  49. {
  50. next;
  51. mes .npcName$;
  52. mes "Please check the money you have.";
  53. mes "It doesn't seem like you have enough money.";
  54. close;
  55. }
  56. else
  57. {
  58. set Zeny,Zeny-.poisHerbCost;
  59. getitem .herbs[getarraysize(.herbs)-1],1;
  60. next;
  61. mes .npcName$;
  62. mes "Thank you. See you~!";
  63. close;
  64. }
  65. break;
  66. case 2:
  67. next;
  68. mes "[Poison Herb Salesman]";
  69. mes "Well, I see. See you~!";
  70. close;
  71. break;
  72. }
  73. }
  74. else
  75. {
  76. mes .npcName$;
  77. mes "How many do you want? You can";
  78. mes "only buy a maximum of "+.maxHerbs+" ea";
  79. mes "and if you want to cancel, enter '0'.";
  80. input .herbsCount;
  81. if(.herbsCount<=0) // check if player canceled herb purchase
  82. {
  83. next;
  84. mes .npcName$;
  85. mes "You've cancelled the trade.";
  86. close;
  87. }
  88. else if(.herbsCount>.maxHerbs) // checks if herbs count exceeds maxHerbs limit
  89. {
  90. next;
  91. mes .npcName$;
  92. mes "Please check the maximum";
  93. mes "amount and then try again.";
  94. close;
  95. }
  96. else if(.herbsCount+countitem(.herbs[.herbType]) > .maxItemStack) // Check item stack according to Aegis script
  97. {
  98. mes "- Wait a minute !! -";
  99. mes "- Currently you're carrying -";
  100. mes "- too many items with you. -";
  101. mes "- Please try again -";
  102. mes "- after you loose some weight. -";
  103. close;
  104. }
  105. else
  106. {
  107. if(Zeny<(.herbsCount*.herbCost)) // Check if Zeny is enough
  108. {
  109. next;
  110. mes .npcName$;
  111. mes "Please check the money you have.";
  112. mes "It doesn't seem like you have enough money.";
  113. close;
  114. }
  115. else // all requirements are met give the item
  116. {
  117. set Zeny,Zeny-(.herbsCount*.herbCost);
  118. getitem .herbs[.herbType],.herbsCount;
  119. next;
  120. mes .npcName$;
  121. mes "Thank you. See you~!";
  122. close;
  123. }
  124. }
  125. }
  126. OnInit:
  127. // Initialize Item Id's on script engine Init Event
  128. set .npcName$,"[Poison Herb Salesman]";
  129. setarray .herbs[0],7932,7933,7934,7935,7936,7937,7931;
  130. setarray .herbCost[0],4000,4000,4000,4000,4000,4000,5000;
  131. set .maxHerbs,2000;
  132. set .poisHerbCost,5000;
  133. set .maxItemStack,30000;
  134. }
  135. job3_rune01,90,62,3 script Rune Salesman::runesale 853,{
  136. if(checkweight(1201,1) == 0 || MaxWeight - Weight < 20000)
  137. {
  138. mes "- Wait a minute !! -";
  139. mes "- Currently you're carrying -";
  140. mes "- too many items with you. -";
  141. mes "- Please try again -";
  142. mes "- after you loose some weight. -";
  143. close;
  144. }
  145. mes "[Rune Salesman]";
  146. mes "Hey, do you need Runes?!";
  147. mes "I sell all kinds of Rune Stones!";
  148. mes "What kind of Rune do you want?";
  149. next;
  150. switch(select("Buy high-quality Rune Stones.:Buy ordinary Rune Stones."))
  151. {
  152. case 1:
  153. mes "[Rune Salesman]";
  154. mes "High-quality Runes!";
  155. mes "They cost 2,500 zeny each!";
  156. mes "Tell me how many you want to buy";
  157. mes "and remember, you can only";
  158. mes "buy a maximum amount of 2000 ea!";
  159. next;
  160. input .@amount;
  161. if(.@amount == 0)
  162. {
  163. mes "[Rune Salesman]";
  164. mes "You're not buying? Go away!";
  165. close;
  166. }
  167. else if(.@amount > 2000)
  168. {
  169. mes "[Rune Salesman]";
  170. mes "Please check the maximum";
  171. mes "amount and then come back to me again!";
  172. close;
  173. }
  174. else if(Zeny < .@amount * 2500)
  175. {
  176. mes "[Rune Salesman]";
  177. mes "Money! Money!";
  178. mes "You are short of money!";
  179. mes "Check the amount of money you have!!";
  180. close;
  181. }
  182. set .@checkweight,.@amount * 100;
  183. if (MaxWeight < .@checkweight)
  184. {
  185. mes "[Rune Salesman]";
  186. mes "You're not able to carry it, so why are you trying to buy it?!";
  187. close;
  188. }
  189. set Zeny,Zeny - .@amount * 2500;
  190. getitem 12734,.@amount;
  191. mes "[Rune Salesman]";
  192. mes "You can buy more again.";
  193. mes "So, see you later.";
  194. close;
  195. case 2:
  196. mes "[Rune Salesman]";
  197. mes "Ordinary Rune Stones?";
  198. mes "They cost 1,000 zeny each!";
  199. mes "Tell me how many you want to buy";
  200. mes "and remember, you can only";
  201. mes "buy a maximum amount of 2000 ea!";
  202. next;
  203. input .@amount;
  204. if(.@amount == 0)
  205. {
  206. mes "[Rune Salesman]";
  207. mes "You're not buying? Go away!";
  208. close;
  209. }
  210. else if(.@amount > 2000)
  211. {
  212. mes "[Rune Salesman]";
  213. mes "Please check the maximum";
  214. mes "amount and then come back to me again!";
  215. close;
  216. }
  217. else if(Zeny < .@amount * 1000)
  218. {
  219. mes "[Rune Salesman]";
  220. mes "Money! Money!";
  221. mes "You are short of money!";
  222. mes "Check the amount of money you have!!";
  223. close;
  224. }
  225. set .@checkweight,.@amount * 100;
  226. if (MaxWeight < .@checkweight)
  227. {
  228. mes "[Rune Salesman]";
  229. mes "You're not able to carry it, so why are you trying to buy it?!";
  230. close;
  231. }
  232. set Zeny,Zeny - .@amount * 1000;
  233. getitem 12737,.@amount;
  234. mes "[Rune Salesman]";
  235. mes "You can buy more again.";
  236. mes "So, see you later.";
  237. close;
  238. }
  239. }
  240. job3_guil01,91,93,3 script Rare Herb Collector 49,{
  241. if(checkweight(1201,1) == 0 || MaxWeight - Weight < 20000)
  242. {
  243. mes "- Wait a minute !! -";
  244. mes "- Currently you're carrying -";
  245. mes "- too many items with you. -";
  246. mes "- Please try again -";
  247. mes "- after you loose some weight. -";
  248. close;
  249. }
  250. if (Class == 4059 || Class == 4065)
  251. {
  252. mes "[Rare Poison Herb Collector]";
  253. mes "I wander around the world and collect rare poison herbs. Recently, I am dealing in the herb called Izidor. If you are interested, you can buy them.";
  254. next;
  255. switch(select("How can I buy them?:Exchange it with Animal Blood:Exchange it with a Bitter Herb:Exchange it with a Deadly Noxious Herb:Exchange it with a Frozen Rose:Exchange it with Ment:Exchange it with Hinalle"))
  256. {
  257. case 1:
  258. mes "[Rare Poison Herb Collector]";
  259. mes "You can buy any of those items for 10,000 zeny: Animal Blood, Bitter Herb, Deadly Noxious Herb, Frozen Rose, Ment or Hinalle. ";
  260. next;
  261. mes "[Rare Poison Herb Collector]";
  262. mes "Why I ask for money? That is just to pay a little respect to a collector like me. Ha ha ha...";
  263. close;
  264. case 2:
  265. if ((countitem(702) > 0) && (Zeny > 9999))
  266. {
  267. mes "[Rare Poison Herb Collector]";
  268. mes "Thank you. I've received your payment.";
  269. delitem 702,1;
  270. set Zeny,Zeny - 10000;
  271. getitem 709,1;
  272. close;
  273. }
  274. mes "[Rare Poison Herb Collector]";
  275. mes "Hey, try again after you've prepared all the requirements for the exchange.";
  276. close;
  277. case 3:
  278. if ((countitem(621) > 0) && (Zeny > 9999))
  279. {
  280. mes "[Rare Poison Herb Collector]";
  281. mes "Thank you. I've received your payment.";
  282. delitem 621,1;
  283. set Zeny,Zeny - 10000;
  284. getitem 709,1;
  285. close;
  286. }
  287. mes "[Rare Poison Herb Collector]";
  288. mes "Hey, try again after you've prepared all the requirements for the exchange.";
  289. close;
  290. case 4:
  291. if ((countitem(631) > 0) && (Zeny > 9999))
  292. {
  293. mes "[Rare Poison Herb Collector]";
  294. mes "Thank you. I've received your payment.";
  295. delitem 631,1;
  296. set Zeny,Zeny - 10000;
  297. getitem 709,1;
  298. close;
  299. }
  300. mes "[Rare Poison Herb Collector]";
  301. mes "Hey, try again after you've prepared all the requirements for the exchange.";
  302. close;
  303. case 5:
  304. if ((countitem(749) > 0) && (Zeny > 9999))
  305. {
  306. mes "[Rare Poison Herb Collector]";
  307. mes "Thank you. I've received your payment.";
  308. delitem 749,1;
  309. set Zeny,Zeny - 10000;
  310. getitem 709,1;
  311. close;
  312. }
  313. mes "[Rare Poison Herb Collector]";
  314. mes "Hey, try again after you've prepared all the requirements for the exchange.";
  315. close;
  316. case 6:
  317. if ((countitem(605) > 0) && (Zeny > 9999))
  318. {
  319. mes "[Rare Poison Herb Collector]";
  320. mes "Thank you. I've received your payment.";
  321. delitem 605,1;
  322. set Zeny,Zeny - 10000;
  323. getitem 709,1;
  324. close;
  325. }
  326. mes "[Rare Poison Herb Collector]";
  327. mes "Hey, try again after you've prepared all the requirements for the exchange.";
  328. close;
  329. case 7:
  330. if ((countitem(703) > 0) && (Zeny > 9999))
  331. {
  332. mes "[Rare Poison Herb Collector]";
  333. mes "Thank you. I've received your payment.";
  334. delitem 703,1;
  335. set Zeny,Zeny - 10000;
  336. getitem 709,1;
  337. close;
  338. }
  339. mes "[Rare Poison Herb Collector]";
  340. mes "Hey, try again after you've prepared all the requirements for the exchange.";
  341. close;
  342. }
  343. }
  344. mes "[Rare Poison Herb Collector]";
  345. mes "I wander around the world and collect rare poison herbs. But I don't feel like selling my herbs to a person like you... ha ha ha...";
  346. close;
  347. }
  348. gef_tower,105,172,5 script Point Salesman#Sorcerer 700,{
  349. if(checkweight(1201,1) == 0 || MaxWeight - Weight < 20000)
  350. {
  351. mes "- Wait a minute !! -";
  352. mes "- Currently you're carrying -";
  353. mes "- too many items with you. -";
  354. mes "- Please try again -";
  355. mes "- after you loose some weight. -";
  356. close;
  357. }
  358. mes "[Point Salesman]";
  359. mes "Hello. I'm selling a catalyst that are called ^FF0000Points^000000 for Sorcerers. What would you like?";
  360. next;
  361. switch(select("Scarlet Points - 200z:Lime Green Points - 200z:Indigo Points - 200z:Yellow Wish Points - 200z:Cancel"))
  362. {
  363. case 1:
  364. mes "[Point Salesman]";
  365. mes "You have chosen Scarlet Points.";
  366. mes "How many do you want?";
  367. mes "If you want to cancel, enter 0.";
  368. next;
  369. input .@amount;
  370. if (.@amount == 0)
  371. {
  372. mes "[Point Salesman]";
  373. mes "You've cancelled the trade.";
  374. close;
  375. }
  376. set .@po_weight,.@amount * 10;
  377. set .@tt_weight,MaxWeight - .@po_weight;
  378. set .@po_money,.@amount * 200;
  379. if (.@tt_weight > 0)
  380. {
  381. if (Zeny >= .@po_money)
  382. {
  383. set Zeny,Zeny - .@po_money;
  384. getitem 6360,.@amount;
  385. mes "[Point Salesman]";
  386. mes "Thank you very much. See you~!";
  387. close;
  388. }
  389. mes "[Point Salesman]";
  390. mes "You don't seem to have enough money.";
  391. close;
  392. }
  393. mes "[Point Salesman]";
  394. mes "You don't have enough space in your inventory to buy this amount.";
  395. close;
  396. case 2:
  397. mes "[Point Salesman]";
  398. mes "You have chosen Lime Green Points.";
  399. mes "How many do you want?";
  400. mes "If you want to cancel, enter 0.";
  401. next;
  402. input .@amount;
  403. if (.@amount == 0)
  404. {
  405. mes "[Point Salesman]";
  406. mes "You've cancelled the trade.";
  407. close;
  408. }
  409. set .@po_weight,.@amount * 10;
  410. set .@tt_weight,MaxWeight - .@po_weight;
  411. set .@po_money,.@amount * 200;
  412. if (.@tt_weight > 0)
  413. {
  414. if (Zeny >= .@po_money)
  415. {
  416. set Zeny,Zeny - .@po_money;
  417. getitem 6363,.@amount;
  418. mes "[Point Salesman]";
  419. mes "Thank you very much. See you~!";
  420. close;
  421. }
  422. mes "[Point Salesman]";
  423. mes "You don't seem to have enough money.";
  424. close;
  425. }
  426. mes "[Point Salesman]";
  427. mes "You don't have enough space in your inventory to buy this amount.";
  428. close;
  429. case 3:
  430. mes "[Point Salesman]";
  431. mes "You have chosen Indigo Points.";
  432. mes "How many do you want?";
  433. mes "If you want to cancel, enter 0.";
  434. next;
  435. input .@amount;
  436. if (.@amount == 0)
  437. {
  438. mes "[Point Salesman]";
  439. mes "You've cancelled the trade.";
  440. close;
  441. }
  442. set .@po_weight,.@amount * 10;
  443. set .@tt_weight,MaxWeight - .@po_weight;
  444. set .@po_money,.@amount * 200;
  445. if (.@tt_weight > 0)
  446. {
  447. if (Zeny >= .@po_money)
  448. {
  449. set Zeny,Zeny - .@po_money;
  450. getitem 6361,.@amount;
  451. mes "[Point Salesman]";
  452. mes "Thank you very much. See you~!";
  453. close;
  454. }
  455. mes "[Point Salesman]";
  456. mes "You don't seem to have enough money.";
  457. close;
  458. }
  459. mes "[Point Salesman]";
  460. mes "You don't have enough space in your inventory to buy this amount.";
  461. close;
  462. case 4:
  463. mes "[Point Salesman]";
  464. mes "You have chosen Yellow Wish Points.";
  465. mes "How many do you want?";
  466. mes "If you want to cancel, enter 0.";
  467. next;
  468. input .@amount;
  469. if (.@amount == 0)
  470. {
  471. mes "[Point Salesman]";
  472. mes "You've cancelled the trade.";
  473. close;
  474. }
  475. set .@po_weight,.@amount * 10;
  476. set .@tt_weight,MaxWeight - .@po_weight;
  477. set .@po_money,.@amount * 200;
  478. if (.@tt_weight > 0)
  479. {
  480. if (Zeny >= .@po_money)
  481. {
  482. set Zeny,Zeny - .@po_money;
  483. getitem 6362,.@amount;
  484. mes "[Point Salesman]";
  485. mes "Thank you very much. See you~!";
  486. close;
  487. }
  488. mes "[Point Salesman]";
  489. mes "You don't seem to have enough money.";
  490. close;
  491. }
  492. mes "[Point Salesman]";
  493. mes "You don't have enough space in your inventory to buy this amount.";
  494. close;
  495. case 5:
  496. mes "[Point Salesman]";
  497. mes "You can't find the stuff you need?";
  498. close;
  499. }
  500. }
  501. morocc,190,96,4 duplicate(PHS) Poison Herb Salesman#moc 877
  502. lhz_in02,16,205,4 duplicate(PHS) Poison Herb Salesman#lhz 877
  503. prontera,168,228,3 duplicate(runesale) Rune Salesman#1 853