ticket_refiner.txt 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. //===== rAthena Script =======================================
  2. //= Ticket Refiner
  3. //===== By: ==================================================
  4. //= Euphy
  5. //===== Current Version: =====================================
  6. //= 1.1
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Refiner that uses +5~9/+11 refine tickets to refine
  12. //= equipment with no chance of failure.
  13. //= NOTE: This NPC is currently disabled on official servers.
  14. //===== Additional Comments: =================================
  15. //= 1.0 First version. [Euphy]
  16. //= 1.1 Do not refine above ticket level. [Euphy]
  17. //============================================================
  18. // Main NPC :: safety_Ref_NPC
  19. //============================================================
  20. prontera,184,177,6 script Refine Master 851,{
  21. disable_items;
  22. if (countitem(6238) || countitem(6228) || countitem(6229) || countitem(6230) || countitem(6231) || countitem(6456))
  23. set .@bWeaponUp,1;
  24. if (countitem(6239) || countitem(6232) || countitem(6233) || countitem(6234) || countitem(6235) || countitem(6457))
  25. set .@bArmorUp,1;
  26. if (!.@bWeaponUp && !.@bArmorUp) {
  27. mes "[Refine Master]";
  28. mes "Hello!";
  29. mes "What's up?";
  30. mes "I'm a specialist";
  31. mes "for refining items,";
  32. mes "but I don't work anymore.";
  33. next;
  34. switch(select("I'll go on my way.:Hmm... this makes me curious.")) {
  35. case 1:
  36. mes "[Refine Master]";
  37. mes "Take care, adventurer.";
  38. close;
  39. case 2:
  40. mes "[Refine Master]";
  41. mes "Actully, I sometimes provide refine services for adventurers with a ^006400Refine Ticket^000000...";
  42. mes "Bye bye~!";
  43. close;
  44. }
  45. }
  46. emotion e_gasp;
  47. mes "[Refine Master]";
  48. mes "Greetings!";
  49. mes "I can refine an item up to the ^006400same level as your ticket^000000.";
  50. mes "You don't have to worry! There's no chance of breaking your item.";
  51. next;
  52. if(select("I'll come back later.:Refine item with ticket.") == 1) {
  53. mes "[Refine Master]";
  54. mes "Okay.";
  55. mes "You can come again later.";
  56. close;
  57. }
  58. mes "[Refine Master]";
  59. mes "Which equipment would you like to refine?";
  60. next;
  61. setarray .@position$[1],"Head upper","Armor","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head middle","Head lower";
  62. setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW;
  63. for(set .@i,1; .@i<=10; set .@i,.@i+1)
  64. set .@menu$, .@menu$+((getequipisequiped(.@indices[.@i]))?getequipname(.@indices[.@i]):.@position$[.@i]+"- [Empty]")+":";
  65. set .@part, .@indices[ select(.@menu$) ];
  66. if (!getequipisequiped(.@part)) {
  67. mes "[Refine Master]";
  68. mes "You have to equip the item you want to refine.";
  69. close;
  70. }
  71. if (!getequipisenableref(.@part)) {
  72. emotion e_otl;
  73. mes "[Refine Master]";
  74. mes "Oh, I'm sorry.";
  75. mes "This item is impossible to refine.";
  76. close;
  77. }
  78. switch(getequipweaponlv(.@part)) {
  79. default:
  80. case 0:
  81. setarray .@tickets[0],6457,6235,6234,6233,6232,6239;
  82. setarray .@levels[0],5,6,7,8,9,11;
  83. set .@type$,"Armor";
  84. set .@check,.@bArmorUp;
  85. break;
  86. case 1:
  87. case 2:
  88. case 3:
  89. case 4:
  90. setarray .@tickets[0],6456,6231,6230,6229,6228,6238;
  91. setarray .@levels[0],5,6,7,8,9,11;
  92. set .@type$,"Weapon";
  93. set .@check,.@bWeaponUp;
  94. break;
  95. }
  96. if (!.@check) {
  97. emotion e_dots;
  98. mes "[Refine Master]";
  99. mes "If you want to refine this ^006400"+.@type$+"^000000, please come along with ^006400"+.@type$+" Refine Ticket^000000.";
  100. mes "See you later!";
  101. close;
  102. }
  103. mes "[Refine Master]";
  104. mes "Please choose which ^006400"+.@type$+" Refine Ticket^000000 you want to use.";
  105. next;
  106. set .@menu$,"";
  107. for(set .@i,0; .@i<getarraysize(.@tickets); set .@i,.@i+1)
  108. set .@menu$, .@menu$+getitemname(.@tickets[.@i])+":";
  109. set .@select, select(.@menu$)-1;
  110. set .@ticket_lv, .@levels[.@select];
  111. set .@ticket_id, .@tickets[.@select];
  112. if (countitem(.@ticket_id) == 0) {
  113. emotion e_what;
  114. mes "[Refine Master]";
  115. mes getitemname(.@ticket_id)+" is not in your inventory. Did you put it in your storage?";
  116. mes "Please check again.";
  117. mes "See you later!";
  118. close;
  119. }
  120. if (getequiprefinerycnt(.@part) >= .@ticket_lv) {
  121. emotion e_swt2;
  122. mes "[Refine Master]";
  123. mes "^8B4513This item is already refined as much as your deed.^000000";
  124. mes "Please come along with an item refined less than your ticket.";
  125. close;
  126. }
  127. mes "[Refine Master]";
  128. mes "I'm going to refine ^006400"+getequipname(.@part)+"^8B4513 up to the +"+.@ticket_lv+" level^000000 with ^006400"+getitemname(.@ticket_id)+"^000000.";
  129. mes "May I proceed?";
  130. next;
  131. if(select("No.:Yes.") == 1) {
  132. emotion e_dots;
  133. mes "[Refine Master]";
  134. mes "Oh, you changed your mind.";
  135. mes "Ok.";
  136. mes "You can come back later.";
  137. close;
  138. }
  139. mes "[Refine Master]";
  140. mes "Great.";
  141. mes "As you wish!";
  142. mes "I have my own special way to refine...";
  143. mes ".......ka boom!";
  144. specialeffect EF_SUI_EXPLOSION;
  145. if (countitem(.@ticket_id))
  146. delitem .@ticket_id,1;
  147. else {
  148. next;
  149. mes "Error!";
  150. mes "Please report this.";
  151. close;
  152. }
  153. successrefitem .@part, .@ticket_lv - getequiprefinerycnt(.@part);
  154. next;
  155. emotion e_ho;
  156. mes "[Refine Master]";
  157. mes "Alright, here it is~";
  158. mes "Well, ^0000FF"+strcharinfo(0)+"^000000!";
  159. mes "Congratulations on your shining "+.@type$+".";
  160. mes "You look GREAT!";
  161. mes "Farewell~!";
  162. close;
  163. }