kunai_maker.txt 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //===== eAthena Script =======================================
  2. //= Kunai "Trader" @ que_ng.gat
  3. //===== By: ==================================================
  4. //= erKURITA
  5. //===== Current Version: =====================================
  6. //= 1.0
  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. //============================================================
  17. que_ng.gat,72,29,3 script Kunai Seller 83,{
  18. mes "[Jin]";
  19. mes "Hi, I sell elemental enchanted kunais. I'll trade you some elemental stones and one kind of shuriken for a determined elemental Kunai";
  20. next;
  21. mes "[Jin]";
  22. mes "What would you like to trade some? It's free";
  23. switch(select("10 Poison Kunais:10 Icycle Kunais:10 Rough Wind Kunais:10 Black Soil Kunai:10 Explosion Kunai:Nothing at the Moment")) {
  24. //Callfunc usage: callfunc "Kunai_Trade",itemreqid1,itemreqct1,itemreqid2,itemreqct2,itemidtrade;
  25. case 1:
  26. callfunc "Kunai_Trade",13250,20,7524,1,13259;
  27. goto L_Bye;
  28. case 2:
  29. callfunc "Kunai_Trade",13251,8,7522,2,13255;
  30. goto L_Bye;
  31. case 3:
  32. callfunc "Kunai_Trade",13252,4,7523,2,13257;
  33. goto L_Bye;
  34. case 4:
  35. callfunc "Kunai_Trade",13253,2,7524,1,13256;
  36. goto L_Bye;
  37. case 5:
  38. callfunc "Kunai_Trade",13254,1,7521,2,13258;
  39. goto L_Bye;
  40. case 6:
  41. goto L_Bye;
  42. }
  43. L_Bye:
  44. next;
  45. mes "[Jin]";
  46. mes "Good bye and hope to see you again then";
  47. close;
  48. }
  49. function script Kunai_Trade -1,{
  50. next;
  51. mes "[Jin]";
  52. if (MaxWeight*50/100 < Weight) {
  53. if (MaxWeight*90/100 < Weight) {
  54. mes "Sorry but you have more than 90% weight. Your kunais might drop. I can't give you anything.";
  55. return;
  56. }
  57. mes "You have 50% or more weight, do you still want to continue?";
  58. menu "Yes",-,"No, thanks",L_Return;
  59. }
  60. mes "Would you like to trade my 10 "+getitemname(getarg(4))+" for your "+getarg(1)+" "+getitemname(getarg(0))+" and "+getarg(3)+" "+getitemname(getarg(2))+" ?";
  61. switch(select("Yes:I'll think about it")) {
  62. case 1:
  63. next;
  64. mes "[Jin]";
  65. if (countitem(getarg(0)) < getarg(1) || countitem(getarg(2)) < getarg(3)) {
  66. mes "Sorry but you're missing one of the required items. Please get them";
  67. close;
  68. } else
  69. mes "How many do you want to trade? I can only trade you ^FF0000500^000000 units at once.";
  70. mes "^00FF001 Unit^000000 ^FF0000=^000000 ^0000FF10 Kunais^000000 of your desire";
  71. input @trade;
  72. next;
  73. mes "[Jin]";
  74. if (@trade > 500) {
  75. mes "Sorry, but I told you I could only trade you 500 units at once. Try again";
  76. close;
  77. } else if (@trade < 1) {
  78. mes "Sorry, but 1 unit is the minimun I can trade. Try again please.";
  79. close;
  80. } else if ((countitem(getarg(0)) < @trade*getarg(1)) || (countitem(getarg(2)) < @trade*getarg(3))) {
  81. mes "Sorry, but you don't have enough items to trade "+@trade+" unit(s). Get more please";
  82. close;
  83. } else
  84. mes "Here you go, enjoy them";
  85. delitem getarg(0),getarg(1)*@trade;
  86. delitem getarg(2),getarg(3)*@trade;
  87. getitem getarg(4),10*@trade;
  88. next;
  89. return;
  90. case 2:
  91. return;
  92. }
  93. L_Return:
  94. return;
  95. }