kunai_maker.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //===== rAthena Script =======================================
  2. //= Kunai Merchant Kashin
  3. //===== By: ==================================================
  4. //= rAthena Dev Team
  5. //===== Current Version: =====================================
  6. //= 1.3a
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Trades a few shurikens + ninja stones for elemental kunai.
  11. //===== Additional Comments: =================================
  12. //= 1.0 Added the npc. It uses a function that sends the item
  13. //= id of the 2 required items plus the amount. Can trade
  14. //= up to 500 units (5,000 kunais) at once. [erKURITA]
  15. //= 1.1 Officialized script [Playtester]
  16. //= 1.2a Optimized/cleaned up a bit [ultramage]
  17. //= 1.3 Updated to match AEGIS script. [Kisuka]
  18. //= 1.3a Kagerou/Oboro support (BaseJob -> BaseClass) [Euphy]
  19. //============================================================
  20. que_ng,72,29,3 script Kunai Merchant Kashin 83,{
  21. if(BaseClass == Job_Ninja) {
  22. mes "[Kashin]";
  23. mes "I am Kashin, distributor";
  24. mes "of Kunai for Ninjas. Take";
  25. mes "a look around and let me";
  26. mes "know if you're interested";
  27. mes "in any of my wares.";
  28. next;
  29. switch(select("10 Fell Poison Kunai:10 Icicle Kunai:10 High Wind Kunai:10 Black Earth Kunai:10 Heat Wave Kunai:Cancel")) {
  30. case 1: callfunc "Kunai_Trade",13250,20,7524,1,13259; break;
  31. case 2: callfunc "Kunai_Trade",13251,8,7522,2,13255; break;
  32. case 3: callfunc "Kunai_Trade",13252,4,7523,2,13257; break;
  33. case 4: callfunc "Kunai_Trade",13253,2,7524,1,13256; break;
  34. case 5: callfunc "Kunai_Trade",13254,1,7521,2,13258; break;
  35. case 6:
  36. mes "[Kashin]";
  37. mes "Well then, thank you";
  38. mes "for visiting my shop.";
  39. mes "Please come to me when";
  40. mes "you need to buy some";
  41. mes "Kunais. Goodbye for now~";
  42. close;
  43. }
  44. }
  45. mes "[Kashin]";
  46. mes "I am Kashin, distributor";
  47. mes "of Kunai for Ninjas. If you";
  48. mes "have any friends that are";
  49. mes "Ninjas, then you might";
  50. mes "want to tell them about me.";
  51. close;
  52. }
  53. function script Kunai_Trade {
  54. setarray .@item_req[0], getarg(0), getarg(2);
  55. setarray .@req_amount[0], getarg(1), getarg(3);
  56. .@item_id = getarg(4);
  57. mes "[Kashin]";
  58. mes "You can exchange";
  59. mes .@req_amount[0] +" "+ getitemname(.@item_req[0]) +" and";
  60. mes .@req_amount[1] +" "+ getitemname(.@item_req[1]) +" for every";
  61. mes "set of 10 "+ getitemname(.@item_id) +".";
  62. next;
  63. mes "[Kashin]";
  64. mes "I can only give you a maximum of 500 sets of Kunais at a time.";
  65. mes "If you want to cancel the trade, then please enter ''0.'' How many";
  66. mes "Kunai sets would you like?";
  67. next;
  68. input .@amount;
  69. if(.@amount < 1 || .@amount > 500) {
  70. mes "[Kashin]";
  71. mes "Eh? I'm sorry, but";
  72. mes "I can't give you that";
  73. mes "many Kunai sets. Please";
  74. mes "enter a value less than 500.";
  75. close;
  76. }
  77. if (countitem(.@item_req[0]) < .@amount*.@req_amount[0] || countitem(.@item_req[1]) < .@amount*.@req_amount[1]) {
  78. mes "[Kashin]";
  79. mes "Hmm, you don't have";
  80. mes "enough items for this";
  81. mes "Kunai exchange. Please";
  82. mes "check your items again.";
  83. close;
  84. }
  85. if (checkweight(.@item_id, .@amount*10) == 0) {
  86. mes "[Kashin]";
  87. mes "Hmm, it seems like your";
  88. mes "Inventory doesn't have";
  89. mes "enough space to store";
  90. mes "more items. You better";
  91. mes "free up some space first.";
  92. close;
  93. }
  94. mes "[Kashin]";
  95. mes "Great, everything is in";
  96. mes "order, so let's go ahead";
  97. mes "and complete this trade.";
  98. mes "I'm sure that you'll be";
  99. mes "quite satisfied with";
  100. mes "these Kunais.";
  101. delitem .@item_req[0],.@req_amount[0]*.@amount;
  102. delitem .@item_req[1],.@req_amount[1]*.@amount;
  103. getitem .@item_id,10*.@amount;
  104. close;
  105. }