gemstone.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //===== rAthena Script =======================================
  2. //= Gemstone Trader
  3. //===== By: ==================================================
  4. //= L0ne_W0lf
  5. //===== Current Version: =====================================
  6. //= 1.3
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Trade various colors of gemstones for other color gemstones.
  12. //===== Additional Comments: =================================
  13. //= 1.0 Rescripted to Aegis 10.3 standards. [L0ne_W0lf]
  14. //= Any notes pertaining to the prior trader may be found
  15. //= in the cities/payon.txt
  16. //= 1.1 Corrected NPC names to fall within proper restrictions. [L0ne_W0lf]
  17. //= 1.2 Updated input with min/max values. [L0ne_W0lf]
  18. //= Added a checkweight.
  19. //= 1.3 Fixed checks. [Euphy]
  20. //============================================================
  21. payon,173,238,5 script Jade#pay 754,{
  22. if (checkweight(1201,1) == 0) {
  23. mes "^3355FFWait a second! Right now, you're carrying too many items with you. Please come back after putting some of your things into Kafra Storage.^000000";
  24. close;
  25. }
  26. mes "[Jade]";
  27. mes "Bring me two";
  28. mes "Gemstones of the";
  29. mes "same color, and I will";
  30. mes "change them to Gemstones";
  31. mes "of a different color.";
  32. next;
  33. switch(select("Blue Gemstones into Red ones!:Red Gemstones into Yellow ones!:Yellow Gemstones into Blue ones!")) {
  34. case 1: callsub S_TradeGems,717,716;
  35. case 2: callsub S_TradeGems,716,715;
  36. case 3: callsub S_TradeGems,715,717;
  37. }
  38. S_TradeGems:
  39. .@item_req = getarg(0);
  40. .@item_id = getarg(1);
  41. if (countitem(.@item_req) < 2) {
  42. mes "[Jade]";
  43. mes "Hah...!";
  44. mes "You're kidding me, right?";
  45. mes "I can't provide you with this";
  46. mes "service if you don't";
  47. mes "give me at least";
  48. mes "2 "+ getitemname(.@item_req) +"s!";
  49. close;
  50. }
  51. else {
  52. .@gems = countitem(.@item_req) /2;
  53. mes "[Jade]";
  54. mes "I believe I can create";
  55. mes "a total of "+ .@gems +" "+ getitemname(.@item_id) +"s";
  56. mes "using the "+ getitemname(.@item_req) +"s";
  57. mes "that you currently have.";
  58. mes "What do you want to do?";
  59. next;
  60. switch(select("Give me as many as you can.:I want to set the amount.:I quit.")) {
  61. case 1:
  62. delitem .@item_req,.@gems * 2;
  63. getitem .@item_id,.@gems;
  64. break;
  65. case 2:
  66. mes "[Jade]";
  67. mes "So how many";
  68. mes "do you want?";
  69. mes "The maximum number";
  70. mes "that you can enter is 100.";
  71. next;
  72. while(1) {
  73. input .@input,0,101;
  74. if (.@input == 0) {
  75. mes "[Jade]";
  76. mes "None at all?";
  77. mes "I guess you";
  78. mes "changed your mind...";
  79. close;
  80. }
  81. else if (.@input > 100) {
  82. mes "[Jade]";
  83. mes "Errm...";
  84. mes "I asked you to enter";
  85. mes "an amount no greater";
  86. mes "than 100, remember...?";
  87. next;
  88. }
  89. else if (.@gems < .@input) {
  90. // Custom dialogue
  91. mes "[Jade]";
  92. mes "Errm...";
  93. mes "You don't have that";
  94. mes "many gems to trade...";
  95. next;
  96. }
  97. else break;
  98. }
  99. delitem .@item_req,.@input * 2;
  100. getitem .@item_id,.@input;
  101. break;
  102. case 3:
  103. mes "[Jade]";
  104. mes "Sure, no problem.";
  105. mes "Come back any time.";
  106. close;
  107. }
  108. mes "[Jade]";
  109. mes "There you go.";
  110. mes "Feel free to come";
  111. mes "back any time.";
  112. mes "Hm, what's that look for?";
  113. mes "Is there something on my face?";
  114. close;
  115. }
  116. }