hd_refiner.txt 11 KB

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