ticket_refiner.txt 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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 "Actually, I sometimes provide refine services for adventurers with a ^006400Refine Ticket^000000...";
  42. mes "Bye bye~!";
  43. close;
  44. }
  45. }
  46. emotion ET_SURPRISE;
  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 ET_OTL;
  73. mes "[Refine Master]";
  74. mes "Oh, I'm sorry.";
  75. mes "This item is impossible to refine.";
  76. close;
  77. }
  78. .@refineitemid = getequipid(.@part); // save id of the item
  79. .@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
  80. setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
  81. .@itemtype = getiteminfo( .@refineitemid );
  82. if( .@itemtype == IT_WEAPON ){
  83. switch( getequipweaponlv( .@part ) ){
  84. case 1:
  85. case 2:
  86. case 3:
  87. case 4:
  88. setarray .@tickets[0],6456,6231,6230,6229,6228,6238;
  89. setarray .@levels[0],5,6,7,8,9,11;
  90. set .@type$,"Weapon";
  91. set .@check,.@bWeaponUp;
  92. break;
  93. default:
  94. // TODO:
  95. close;
  96. }
  97. }else if( .@itemtype == IT_ARMOR ){
  98. switch( getequiparmorlv( .@part ) ){
  99. case 1:
  100. setarray .@tickets[0],6457,6235,6234,6233,6232,6239;
  101. setarray .@levels[0],5,6,7,8,9,11;
  102. set .@type$,"Armor";
  103. set .@check,.@bArmorUp;
  104. break;
  105. default:
  106. // TODO:
  107. close;
  108. }else{
  109. // TODO:
  110. close;
  111. }
  112. if (!.@check) {
  113. emotion ET_THINK;
  114. mes "[Refine Master]";
  115. mes "If you want to refine this ^006400"+.@type$+"^000000, please come along with ^006400"+.@type$+" Refine Ticket^000000.";
  116. mes "See you later!";
  117. close;
  118. }
  119. mes "[Refine Master]";
  120. mes "Please choose which ^006400"+.@type$+" Refine Ticket^000000 you want to use.";
  121. next;
  122. set .@menu$,"";
  123. for(set .@i,0; .@i<getarraysize(.@tickets); set .@i,.@i+1)
  124. set .@menu$, .@menu$+getitemname(.@tickets[.@i])+":";
  125. set .@select, select(.@menu$)-1;
  126. set .@ticket_lv, .@levels[.@select];
  127. set .@ticket_id, .@tickets[.@select];
  128. if (countitem(.@ticket_id) == 0) {
  129. emotion ET_QUESTION;
  130. mes "[Refine Master]";
  131. mes getitemname(.@ticket_id)+" is not in your inventory. Did you put it in your storage?";
  132. mes "Please check again.";
  133. mes "See you later!";
  134. close;
  135. }
  136. if (getequiprefinerycnt(.@part) >= .@ticket_lv) {
  137. emotion ET_PROFUSELY_SWEAT;
  138. mes "[Refine Master]";
  139. mes "^8B4513This item is already refined as much as your deed.^000000";
  140. mes "Please come along with an item refined less than your ticket.";
  141. close;
  142. }
  143. mes "[Refine Master]";
  144. mes "I'm going to refine ^006400"+getequipname(.@part)+"^8B4513 up to the +"+.@ticket_lv+" level^000000 with ^006400"+getitemname(.@ticket_id)+"^000000.";
  145. mes "May I proceed?";
  146. next;
  147. if(select("No.:Yes.") == 1) {
  148. emotion ET_THINK;
  149. mes "[Refine Master]";
  150. mes "Oh, you changed your mind.";
  151. mes "Ok.";
  152. mes "You can come back later.";
  153. close;
  154. }
  155. mes "[Refine Master]";
  156. mes "Great.";
  157. mes "As you wish!";
  158. mes "I have my own special way to refine...";
  159. mes ".......ka boom!";
  160. specialeffect EF_SUI_EXPLOSION;
  161. if (countitem(.@ticket_id)) {
  162. delitem .@ticket_id,1;
  163. // anti-hack
  164. if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) ||
  165. callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3])) {
  166. mes "[Refine Master]";
  167. emotion ET_FRET;
  168. mes "Wait a second...";
  169. mes "Do you think I'm stupid?!";
  170. mes "You switched the item while I wasn't looking! Get out of here!";
  171. close;
  172. }
  173. } else {
  174. next;
  175. mes "Error!";
  176. mes "Please report this.";
  177. close;
  178. }
  179. successrefitem .@part, .@ticket_lv - getequiprefinerycnt(.@part);
  180. next;
  181. emotion ET_DELIGHT;
  182. mes "[Refine Master]";
  183. mes "Alright, here it is~";
  184. mes "Well, ^0000FF"+strcharinfo(0)+"^000000!";
  185. mes "Congratulations on your shining "+.@type$+".";
  186. mes "You look GREAT!";
  187. mes "Farewell~!";
  188. close;
  189. }