advanced_refiner.txt 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. //===== rAthena Script =======================================
  2. //= Advanced Refiner
  3. //===== Description: =========================================
  4. //= [Official Conversion]
  5. //= Refiner that uses Enriched ores to increase upgrade success.
  6. //===== Changelog: ===========================================
  7. //= 1.0 Added Malangdo Refiner "Holink". [Euphy]
  8. //= 1.1 Removed re-roll behavior. [Secret]
  9. //= 1.2 Added db-based material ID [Secret]
  10. //============================================================
  11. // Main NPC :: mal_jerun
  12. //============================================================
  13. malangdo,221,174,6 script Holink#mal_cash 559,{
  14. disable_items;
  15. mes "[Holink]";
  16. mes "I am the meow~ Blacksmith Holink~";
  17. mes "Master of refining, Holink~";
  18. mes "I am the special cat Holink who learned from Morocc~";
  19. mes "My daughter is so proud of me, Holink~";
  20. mes "What should Holink~ refine today?";
  21. next;
  22. 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;
  23. for (set .@i,1; .@i<=10; set .@i,.@i+1)
  24. set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Empty]" ) +":";
  25. set .@part, .@indices[ select(.@menu$) ];
  26. if (!getequipisequiped(.@part)) {
  27. mes "[Holink]";
  28. switch(.@part) {
  29. case EQI_HEAD_TOP:
  30. mes "My teacher Aragam said meow~";
  31. mes "There's no cure for stupidity...";
  32. break;
  33. case EQI_ARMOR:
  34. mes "There's nothing to see here, meow!!";
  35. break;
  36. case EQI_HAND_L:
  37. mes "Meow? What do you want me to do with this left hand...?";
  38. break;
  39. case EQI_HAND_R:
  40. mes "Meow? What do you want me to do with this right hand...?";
  41. break;
  42. case EQI_GARMENT:
  43. mes "Meow? You don't have anything on.";
  44. break;
  45. case EQI_SHOES:
  46. mes "Kyang~! Do not mess with my sensitive olfactory, meow~.";
  47. break;
  48. case EQI_ACC_L:
  49. case EQI_ACC_R:
  50. mes "Meow? Where is the accessory?";
  51. break;
  52. case EQI_HEAD_MID:
  53. case EQI_HEAD_LOW:
  54. mes "Meow? You talking about the other head parts, meow?~";
  55. break;
  56. }
  57. close;
  58. }
  59. if (!getequipisenableref(.@part)) {
  60. mes "[Holink]";
  61. mes "Even Aragam can't refine such a thing, meow.";
  62. close;
  63. }
  64. if (getequiprefinerycnt(.@part) >= 10) {
  65. mes "[Holink]";
  66. mes "Meow~ Perfect refining. Did Aragam do this, meow?~";
  67. close;
  68. }
  69. mes "[Holink]";
  70. .@refineitemid = getequipid(.@part); // save id of the item
  71. .@itemtype = getiteminfo( .@refineitemid, ITEMINFO_TYPE );
  72. .@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
  73. setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
  74. // Holink has different hardcoded prices
  75. // .@price = getequiprefinecost(.@part, REFINE_COST_NORMAL, REFINE_ZENY_COST);
  76. .@material = getequiprefinecost(.@part, REFINE_COST_NORMAL, REFINE_MATERIAL_ID);
  77. if( .@itemtype == IT_ARMOR ){
  78. .@equip_lv = getequiparmorlv( .@part );
  79. .@type$ = "armor";
  80. mes "You have chosen an armor, meow~";
  81. switch(.@equip_lv) {
  82. case 1:
  83. .@price = 15000;
  84. break;
  85. default:
  86. // TODO:
  87. close;
  88. }
  89. }else if( .@itemtype == IT_WEAPON ){
  90. .@equip_lv = getequipweaponlv( .@part );
  91. .@type$ = "weapon";
  92. switch( .@equip_lv ){
  93. case 1: // Level 1 Weapon
  94. .@price = 500;
  95. mes "A level 1 weapon...?";
  96. break;
  97. case 2: // Level 2 Weapon
  98. .@price = 2000;
  99. mes "Meow, a level 2 weapon...?";
  100. break;
  101. case 3: // Level 3 Weapon
  102. .@price = 20000;
  103. mes "Meow Meow~~ A level 3 weapon~~";
  104. break;
  105. case 4: // Level 4 Weapon
  106. .@price = 50000;
  107. mes "Me-Meow!... A level 4 weapon...!";
  108. mes "I've only seen it twice while";
  109. mes "learning from Aragam... Me-Meow!!";
  110. break;
  111. default:
  112. // TODO:
  113. close;
  114. }
  115. }else{
  116. // TODO:
  117. close;
  118. }
  119. mes "You need ^ff9999"+getitemname(.@material)+"^000000 and ^ff9999"+.@price+"^000000 Zeny for this refine, meow~";
  120. mes "Want to continue, meow?~";
  121. next;
  122. if(select("Yes!!:No!!") == 2) {
  123. mes "[Holink]";
  124. mes "Kyack!!";
  125. mes "You don't believe in refine master Holink, meow?~";
  126. close;
  127. }
  128. if (getequippercentrefinery(.@part, true) < 100) {
  129. mes "[Holink]";
  130. mes "Meow!!";
  131. if (.@type$ == "armor")
  132. mes "This armor was already refined so many times, meow.";
  133. else {
  134. mes "Danger. Danger~";
  135. mes "This weapon was refined a lot, meow~";
  136. next;
  137. mes "[Holink]";
  138. }
  139. mes "You might break it if you continue";
  140. mes "to try refining this item further, meow.";
  141. next;
  142. mes "[Holink]";
  143. mes "Once the "+.@type$+" is broken, you can";
  144. mes "never use it again, meow. Not to mention... all current";
  145. mes "^ff0000cards and enchantments will vanish for sure^000000.";
  146. mes "You still want to try, meow~?";
  147. next;
  148. if(select("Yes, I do!!:Forget about it!!") == 2) {
  149. mes "[Holink]";
  150. mes "Meow! Wise choice, meow.";
  151. mes "But!!";
  152. mes "I am not happy to see you doubting the refine master Holink, meow~";
  153. close;
  154. }
  155. }
  156. if (countitem(.@material) == 0 || Zeny < .@price) {
  157. mes "[Holink]";
  158. mes "You don't have the ingredients.";
  159. mes "You need ^ff9999"+getitemname(.@material)+"^000000 and ^ff9999"+.@price+"^000000 Zeny, meow~";
  160. mes "Go get it, meow~";
  161. close;
  162. }
  163. delitem .@material,1;
  164. set Zeny, Zeny-.@price;
  165. // anti-hack
  166. if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) ||
  167. callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) {
  168. mes "[Holink]";
  169. emotion ET_FRET;
  170. mes "Wait a second...";
  171. mes "Do you think I'm stupid?!";
  172. mes "You switched the item while I wasn't looking! Get out of here!";
  173. close;
  174. }
  175. if (getequippercentrefinery(.@part, true) > rand(100)) {
  176. successrefitem .@part;
  177. mes "[Holink]";
  178. mes "Me~ Me~ Meow! Fun fun refining~";
  179. next;
  180. emotion ET_CHUP;
  181. mes "[Holink]";
  182. mes "Perfect!! Perfect, meow!!";
  183. mes "I am the disciple of the refining wizard Aragam~";
  184. mes "Holink!!";
  185. mes "Another day of successful refining, meow!!";
  186. close;
  187. }
  188. failedrefitem .@part;
  189. mes "[Holink]";
  190. mes "Meo~ Meow~ Kyaaak!!";
  191. next;
  192. switch(rand(1,5)) {
  193. case 1: emotion ET_CRY; break;
  194. case 2: emotion ET_PROFUSELY_SWEAT; break;
  195. case 3: emotion ET_KEK; break;
  196. case 4: emotion ET_SCRATCH; break;
  197. case 5: emotion ET_BIGTHROB; break;
  198. }
  199. mes "[Holink]";
  200. mes "Meow!! Aaaaakk~~!!!!";
  201. mes "Kyaaak!! I have failed, meow!!";
  202. next;
  203. mes "[Holink]";
  204. mes "......";
  205. mes "......";
  206. mes "All~ Everything~ Broken, meow...";
  207. next;
  208. mes "[Holink]";
  209. mes "Meow.... Master Aragam once said,";
  210. mes "learn from your failures...";
  211. mes "Human, this one failure will be the beginning of your success in the future.";
  212. close;
  213. }