kunai_maker.txt 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //===== eAthena Script =======================================
  2. //= Kunai "Trader" @ que_ng
  3. //===== By: ==================================================
  4. //= eAthena dev team
  5. //===== Current Version: =====================================
  6. //= 1.2a
  7. //===== Compatible With: =====================================
  8. //= eAthena 1.0
  9. //===== Description: =========================================
  10. //= NPC that trades you a few shurikens + ninja stones for
  11. //= elemental kunais.
  12. //===== Additional Comments: =================================
  13. //= 1.0 Added the npc. It uses a function that sends the item
  14. //= id of the 2 required items plus the amount. Can trade
  15. //= up to 500 units (5,000 kunais) at once. [erKURITA]
  16. //= 1.1 Officialized script [Playtester]
  17. //= 1.2a Optimized/cleaned up a bit [ultramage]
  18. //============================================================
  19. que_ng,72,29,3 script Kunai Merchant Kashin 83,{
  20. mes "[Kashin]";
  21. if(BaseJob != Job_Ninja) {
  22. mes "I am Kashin of the Wind. I distribute trade items to the shadows.";
  23. next;
  24. mes "[Kashin]";
  25. mes "It doesn't seem like you are a Ninja... Just take a good look around and be on your way.";
  26. close;
  27. }
  28. mes "I'm Kashin!";
  29. mes "If you're ever short on Shurikens, come and see me.";
  30. next;
  31. mes "[Kashin]";
  32. mes "What will it be?";
  33. mes "Choose what you want.";
  34. next;
  35. switch(select("Poison Kunais:Frost Kunais:Wind Kunais:Earth Kunais:Fire Kunais:Cancel")) {
  36. //usage: callfunc "Kunai_Trade",itemreqid1,itemreqct1,itemreqid2,itemreqct2,itemidtrade;
  37. case 1: callfunc "Kunai_Trade",13250,20,7524,1,13259; break;
  38. case 2: callfunc "Kunai_Trade",13251,8,7522,2,13255; break;
  39. case 3: callfunc "Kunai_Trade",13252,4,7523,2,13257; break;
  40. case 4: callfunc "Kunai_Trade",13253,2,7524,1,13256; break;
  41. case 5: callfunc "Kunai_Trade",13254,1,7521,2,13258; break;
  42. default:
  43. mes "[Kashin]";
  44. mes "Hmm~ Ok~";
  45. mes "Come again~";
  46. mes "I, Kashin of the Wind, will always be at this place.";
  47. close;
  48. }
  49. close;
  50. }
  51. function script Kunai_Trade {
  52. mes "[Kashin]";
  53. mes "If you give me "+getarg(1)+" "+getitemname(getarg(0))+" and "+getarg(3)+" "+getitemname(getarg(2))+", I'll give you a pack of 10 "+getitemname(getarg(4))+".";
  54. next;
  55. mes "[Kashin]";
  56. mes "You can trade up to 500 packs at a time.";
  57. mes "If you don't want to trade, just enter 0 as the amount.";
  58. next;
  59. input .@amount;
  60. mes "[Kashin]";
  61. if(.@amount < 1) {
  62. mes "Hmm~ Ok~";
  63. mes "Come again~";
  64. mes "I, Kashin of the Wind, will always be at this place.";
  65. close;
  66. }
  67. if(.@amount > 500) {
  68. mes "You've exceeded the input amount!";
  69. mes "Enter a valid number next time~!";
  70. close;
  71. }
  72. if(countitem(getarg(0)) < .@amount*getarg(1) || countitem(getarg(2)) < .@amount*getarg(3)) {
  73. mes "Hmm... this is no good~";
  74. mes "You don't have enough materials to trade in for the amount of Kunai's that you want.";
  75. mes "Bring some more if you want this amount.";
  76. close;
  77. }
  78. if(checkweight(getarg(4), .@amount*10) == 0) {
  79. mes "Your bag is too full to carry the trade items. Come back after you made room for the traded items.";
  80. close;
  81. }
  82. mes "Ok~ Very well!";
  83. mes "Amount verified!";
  84. mes "Here are your traded items.";
  85. delitem getarg(0),getarg(1)*.@amount;
  86. delitem getarg(2),getarg(3)*.@amount;
  87. getitem getarg(4),10*.@amount;
  88. close;
  89. }