ticket_refiner.txt 6.0 KB

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