hd_refiner.txt 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. //===== rAthena Script =======================================
  2. //= HD Refiners
  3. //===== By: ==================================================
  4. //= Euphy
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Refiners that use HD ores to refine equipment. Upon
  12. //= failure, the equipment is not destroyed; rather, its
  13. //= refine level decreases by 1. The success rate is identical
  14. //= to that for Enriched ores.
  15. //= - "Blacksmith Mighty Hammer" only refines from +7~9.
  16. //= - "Basta" only refines from +10 and up.
  17. //===== Additional Comments: =================================
  18. //= 1.0 First version. [Euphy]
  19. //============================================================
  20. // Blacksmith Mighty Hammer (+7~9) :: cash_smelting79
  21. //============================================================
  22. - script ::MightyHammer -1,{
  23. disable_items;
  24. mes "[Blacksmith Mighty Hammer]";
  25. mes "Unlike others, I am a blacksmith who refines a very limited number of items.";
  26. mes "I refine only items that are ^CC0000+7 to +9^000000.";
  27. next;
  28. mes "[Blacksmith Mighty Hammer]";
  29. mes "My specialty is that even if my refining fails, the refine level decreases by 1 without losing the gear. Isn't it great?";
  30. next;
  31. mes "[Blacksmith Mighty Hammer]";
  32. mes "So lets kick this into overdrive, what d' ya say? What item do you want to refine?";
  33. next;
  34. 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;
  35. for(set .@i,1; .@i<=10; set .@i,.@i+1)
  36. set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Not equipped]" ) +":";
  37. set .@part, .@indices[ select(.@menu$) ];
  38. if (!getequipisequiped(.@part)) {
  39. mes "[Blacksmith Mighty Hammer]";
  40. switch(.@part) {
  41. case 1:
  42. mes "I'm a blacksmith, not a hairstylist.";
  43. break;
  44. case 2:
  45. mes "With my hammer, I will make you a star of the sky.";
  46. break;
  47. case 3:
  48. case 4:
  49. mes "Making artificial hands is not my specialty.";
  50. break;
  51. case 5:
  52. mes "Bring out the item so I can refine it!";
  53. break;
  54. case 6:
  55. mes "Where is this foot odor coming from?";
  56. break;
  57. case 7:
  58. case 8:
  59. mes "Where is the accessory?";
  60. break;
  61. case 9:
  62. mes "What do you want me to refine?";
  63. break;
  64. case 10:
  65. mes "Huh? What do you want me to do?";
  66. break;
  67. }
  68. close;
  69. }
  70. if (!getequipisenableref(.@part)) {
  71. mes "[Blacksmith Mighty Hammer]";
  72. mes "This item can't be refined.";
  73. close;
  74. }
  75. if (getequiprefinerycnt(.@part) < 7 || getequiprefinerycnt(.@part) > 9) {
  76. mes "[Blacksmith Mighty Hammer]";
  77. mes "I only handle items with refine levels from +7 to +9.";
  78. close;
  79. }
  80. switch(getequipweaponlv(.@part)) {
  81. default:
  82. case 0:
  83. set .@price,20000;
  84. set .@material,6241; //HD_Elunium
  85. break;
  86. case 1:
  87. case 2:
  88. case 3:
  89. case 4:
  90. set .@price,20000;
  91. set .@material,6240; //HD_Oridecon
  92. break;
  93. }
  94. mes "[Blacksmith Mighty Hammer]";
  95. mes "In order to refine the gear you selected you need ^ff9999"+getitemname(.@material)+"^000000 and 20,000 zeny as a fee.";
  96. mes "Do you have them ready?";
  97. next;
  98. if(select("Yes:No") == 2) {
  99. mes "[Blacksmith Mighty Hammer]";
  100. mes "I will wait until you are ready.";
  101. close;
  102. }
  103. if (getequippercentrefinery(.@part) < 100) {
  104. mes "[Blacksmith Mighty Hammer]";
  105. mes "It looks like this item will likely fail to be refined.";
  106. mes "Well, even if it fails, it only decreases by 1 refine level.";
  107. mes "Would you like to continue refining?";
  108. next;
  109. if(select("Yes:No") == 2) {
  110. mes "[Blacksmith Mighty Hammer]";
  111. mes "Only those who overcome fear of failure will obtain a masterpiece.";
  112. close;
  113. }
  114. }
  115. if (countitem(.@material) == 0 || Zeny < .@price) {
  116. mes "[Blacksmith Mighty Hammer]";
  117. mes "Didn't you just say you had everything ready?";
  118. close;
  119. }
  120. delitem .@material,1;
  121. set Zeny, Zeny-.@price;
  122. mes "[Blacksmith Mighty Hammer]";
  123. mes "Tac! Tac! Tac!";
  124. if (getequippercentrefinery(.@part) > rand(100) || getequippercentrefinery(.@part) > rand(100)) {
  125. successrefitem .@part;
  126. next;
  127. emotion e_no1;
  128. mes "[Blacksmith Mighty Hammer]";
  129. mes "The sound refreshes my mind everytime I hear it.";
  130. mes "Here, have it. Refine succeeded flawlessly!";
  131. close;
  132. }
  133. downrefitem .@part;
  134. next;
  135. emotion e_omg;
  136. mes "[Blacksmith Mighty Hammer]";
  137. mes "Oops!!";
  138. next;
  139. mes "[Blacksmith Mighty Hammer]";
  140. mes "I am sure a person like you would never blame me for a decrease in refine level by 1. Hmm.";
  141. close;
  142. }
  143. prt_in,59,54,3 duplicate(MightyHammer) Mighty Hammer#prt 826
  144. morocc_in,65,30,3 duplicate(MightyHammer) Mighty Hammer#morocc 826
  145. payon,148,176,3 duplicate(MightyHammer) Mighty Hammer#pay 826
  146. alberta_in,16,56,3 duplicate(MightyHammer) Mighty Hammer#alb 826
  147. yuno_in01,171,18,3 duplicate(MightyHammer) Mighty Hammer#yuno 826
  148. ein_in01,22,82,3 duplicate(MightyHammer) Mighty Hammer#ein 826
  149. lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 826
  150. // iRO NPC locations:
  151. // payon,174,133,4 duplicate(MightyHammer) Mighty Hammer#im 826
  152. // Basta (+10 and up) :: cash_smelting
  153. //============================================================
  154. - script ::Basta -1,{
  155. disable_items;
  156. mes "[Basta]";
  157. mes "I'm the best Blacksmith in the whole world, Basta.";
  158. mes "But I don't provide a normal refine service.";
  159. mes "I only refine equipment ^CC0000over +10^000000.";
  160. next;
  161. mes "[Basta]";
  162. mes "Which equipment do you want to refine?";
  163. next;
  164. 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;
  165. for(set .@i,1; .@i<=10; set .@i,.@i+1)
  166. set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Unequipped]" ) +":";
  167. set .@part, .@indices[ select(.@menu$) ];
  168. if (!getequipisequiped(.@part)) {
  169. mes "[Basta]";
  170. switch(.@part) {
  171. case 1:
  172. mes "Is your head an equipment?";
  173. break;
  174. case 2:
  175. mes "What do you want me to do?";
  176. break;
  177. case 3:
  178. case 4:
  179. mes "Making artificial hands is not my specialty.";
  180. break;
  181. case 5:
  182. mes "Do you even know what a robe is?";
  183. break;
  184. case 6:
  185. mes "If you want to refine your feet, don't come to me, try running a marathon.";
  186. break;
  187. case 7:
  188. case 8:
  189. mes "Where is the accessory?";
  190. break;
  191. case 9:
  192. mes "Well... I don't see any equipment worth refining.";
  193. break;
  194. case 10:
  195. mes "I can't make you smart. Go see a school teacher for that.";
  196. break;
  197. }
  198. close;
  199. }
  200. if (!getequipisenableref(.@part)) {
  201. mes "[Basta]";
  202. mes "Even I cannot refine this item. There's no way.";
  203. close;
  204. }
  205. if (getequiprefinerycnt(.@part) < 10) {
  206. mes "[Basta]";
  207. mes "Haven't I told you? I only refine equipments that are +10 and above.";
  208. close;
  209. }
  210. if (getequiprefinerycnt(.@part) == 20) {
  211. mes "[Basta]";
  212. mes "This weapon is perfect, no need to refine it anymore~";
  213. close;
  214. }
  215. switch(getequipweaponlv(.@part)) {
  216. default:
  217. case 0:
  218. set .@price,100000;
  219. set .@material,6225; //HD_Carnium
  220. set .@type$,"armor";
  221. break;
  222. case 1:
  223. case 2:
  224. case 3:
  225. case 4:
  226. set .@price,100000;
  227. set .@material,6226; //HD_Bradium
  228. set .@type$,"weapon";
  229. break;
  230. }
  231. mes "[Basta]";
  232. mes "Hmm... is this the one you want to refine?";
  233. mes "To refine this equipment, I need 1 ^ff9999"+getitemname(.@material)+"^000000 and 100,000 zeny as a fee.";
  234. mes "Do you really want to refine this?";
  235. next;
  236. if(select("Yes:No") == 2) {
  237. mes "[Basta]";
  238. mes "Okay. If that's what you want...";
  239. close;
  240. }
  241. if (getequippercentrefinery(.@part) < 100) {
  242. mes "[Basta]";
  243. mes "This "+.@type$+" has already been refined pretty high.";
  244. mes "If you try to refine it more, the refine level could decrease.";
  245. next;
  246. mes "[Basta]";
  247. mes "I am different from the blacksmiths in others places.";
  248. mes "It is impossible that the refine level will drop by, say, 3 or 4... that sounds scary.";
  249. mes "Here it can only decrease by 1 level.";
  250. next;
  251. mes "[Basta]";
  252. mes "Compared to other blacksmiths, the risk is smaller.";
  253. mes "I've given all precautions. Do you want to try it?";
  254. next;
  255. if(select("Yes:No") == 2) {
  256. mes "[Basta]";
  257. mes "Well~";
  258. mes "Not challenging at all could also be a kind of wisdom in life.";
  259. close;
  260. }
  261. }
  262. if (countitem(.@material) == 0 || Zeny < .@price) {
  263. mes "[Basta]";
  264. mes "Hmm... You didn't bring all the materials needed.";
  265. mes "Come back when you have them all.";
  266. close;
  267. }
  268. delitem .@material,1;
  269. set Zeny, Zeny-.@price;
  270. mes "Pow! Pow! Pow! Pow!";
  271. if (getequippercentrefinery(.@part) > rand(100) || getequippercentrefinery(.@part) > rand(100)) {
  272. successrefitem .@part;
  273. next;
  274. emotion e_no1;
  275. mes "[Basta]";
  276. mes "Great! Nicely done!!";
  277. mes "I really am the best blacksmith in the whole wide world!";
  278. close;
  279. }
  280. downrefitem .@part;
  281. next;
  282. emotion (!rand(5))?e_cash:e_omg;
  283. mes "[Basta]";
  284. mes "Aaaaaaaaaaak!!!";
  285. next;
  286. mes "[Basta]";
  287. mes "Damn it!";
  288. mes "Refining failed and refine level has decreased!";
  289. mes "Even the best blacksmith in the world doesn't guarantee 100% success!";
  290. mes "Too bad.";
  291. next;
  292. mes "[Basta]";
  293. mes "I'll do better next time! Don't worry!";
  294. close;
  295. }
  296. prt_in,57,54,3 duplicate(Basta) Basta#prt 826
  297. morocc_in,68,30,3 duplicate(Basta) Basta#morocc 826
  298. payon,148,174,3 duplicate(Basta) Basta#payon 826
  299. alberta_in,18,56,3 duplicate(Basta) Basta#alberta 826
  300. yuno_in01,173,18,3 duplicate(Basta) Basta#yuno 826
  301. ein_in01,24,82,3 duplicate(Basta) Basta#einbroch 826
  302. lhz_in02,280,17,3 duplicate(Basta) Basta#lighthalzen 826