kunai_maker.txt 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. mes "[Kashin]";
  55. mes "You can exchange";
  56. mes ""+getarg(1)+" "+getitemname(getarg(0))+" and";
  57. mes ""+getarg(3)+" "+getitemname(getarg(2))+" for every";
  58. mes "set of 10 "+getitemname(getarg(4))+".";
  59. next;
  60. mes "[Kashin]";
  61. mes "I can only give you a maximum of 500 sets of Kunais at a time.";
  62. mes "If you want to cancel the trade, then please enter ''0.'' How many";
  63. mes "Kunai sets would you like?";
  64. next;
  65. input .@amount;
  66. if(.@amount < 1 || .@amount > 500) {
  67. mes "[Kashin]";
  68. mes "Eh? I'm sorry, but";
  69. mes "I can't give you that";
  70. mes "many Kunai sets. Please";
  71. mes "enter a value less than 500.";
  72. close;
  73. }
  74. if(countitem(getarg(0)) < .@amount*getarg(1) || countitem(getarg(2)) < .@amount*getarg(3)) {
  75. mes "[Kashin]";
  76. mes "Hmm, you don't have";
  77. mes "enough items for this";
  78. mes "Kunai exchange. Please";
  79. mes "check your items again.";
  80. close;
  81. }
  82. if(checkweight(getarg(4), .@amount*10) == 0) {
  83. mes "[Kashin]";
  84. mes "Hmm, it seems like your";
  85. mes "Inventory doesn't have";
  86. mes "enough space to store";
  87. mes "more items. You better";
  88. mes "free up some space first.";
  89. close;
  90. }
  91. mes "[Kashin]";
  92. mes "Great, everything is in";
  93. mes "order, so let's go ahead";
  94. mes "and complete this trade.";
  95. mes "I'm sure that you'll be";
  96. mes "quite satisfied with";
  97. mes "these Kunais.";
  98. delitem getarg(0),getarg(1)*.@amount;
  99. delitem getarg(2),getarg(3)*.@amount;
  100. getitem getarg(4),10*.@amount;
  101. close;
  102. }