advanced_refiner.txt 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 Morroc~";
  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 1:
  30. mes "My teacher Aragam said meow~";
  31. mes "There's no cure for stupidity...";
  32. break;
  33. case 2:
  34. mes "There's nothing to see here, meow!!";
  35. break;
  36. case 3:
  37. mes "Meow? What do you want me to do with this left hand...?";
  38. break;
  39. case 4:
  40. mes "Meow? What do you want me to do with this right hand...?";
  41. break;
  42. case 5:
  43. mes "Meow? You don't have anything on.";
  44. break;
  45. case 6:
  46. mes "Kyang~! Do not mess with my sensitive olfactory, meow~.";
  47. break;
  48. case 7:
  49. case 8:
  50. mes "Meow? Where is the accessory?";
  51. break;
  52. case 9:
  53. case 10:
  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. .@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
  72. setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
  73. .@price = getequiprefinecost(.@part, REFINE_COST_HOLINK, REFINE_ZENY_COST);
  74. .@material = getequiprefinecost(.@part, REFINE_COST_HOLINK, REFINE_MATERIAL_ID);
  75. switch(getequipweaponlv(.@part)) {
  76. default:
  77. case 0: // Armor
  78. .@type$ = "armor";
  79. mes "You have chosen an armor, meow~";
  80. break;
  81. case 1: // Level 1 Weapon
  82. .@type$ = "weapon";
  83. mes "A level 1 weapon...?";
  84. break;
  85. case 2: // Level 2 Weapon
  86. .@type$ = "weapon";
  87. mes "Meow, a level 2 weapon...?";
  88. break;
  89. case 3: // Level 3 Weapon
  90. .@type$ = "weapon";
  91. mes "Meow Meow~~ A level 3 weapon~~";
  92. break;
  93. case 4: // Level 4 Weapon
  94. .@type$ = "weapon";
  95. mes "Me-Meow!... A level 4 weapon...!";
  96. mes "I've only seen it twice while";
  97. mes "learning from Aragam... Me-Meow!!";
  98. break;
  99. }
  100. mes "You need ^ff9999"+getitemname(.@material)+"^000000 and ^ff9999"+.@price+"^000000 Zeny for this refine, meow~";
  101. mes "Want to continue, meow?~";
  102. next;
  103. if(select("Yes!!:No!!") == 2) {
  104. mes "[Holink]";
  105. mes "Kyack!!";
  106. mes "You don't believe in refine master Holink, meow?~";
  107. close;
  108. }
  109. if (getequippercentrefinery(.@part, true) < 100) {
  110. mes "[Holink]";
  111. mes "Meow!!";
  112. if (.@type$ == "armor")
  113. mes "This armor was already refined so many times, meow.";
  114. else {
  115. mes "Danger. Danger~";
  116. mes "This weapon was refined a lot, meow~";
  117. next;
  118. mes "[Holink]";
  119. }
  120. mes "You might break it if you continue";
  121. mes "to try refining this item further, meow.";
  122. next;
  123. mes "[Holink]";
  124. mes "Once the "+.@type$+" is broken, you can";
  125. mes "never use it again, meow. Not to mention... all current";
  126. mes "^ff0000cards and enchantments will vanish for sure^000000.";
  127. mes "You still want to try, meow~?";
  128. next;
  129. if(select("Yes, I do!!:Forget about it!!") == 2) {
  130. mes "[Holink]";
  131. mes "Meow! Wise choice, meow.";
  132. mes "But!!";
  133. mes "I am not happy to see you doubting the refine master Holink, meow~";
  134. close;
  135. }
  136. }
  137. if (countitem(.@material) == 0 || Zeny < .@price) {
  138. mes "[Holink]";
  139. mes "You don't have the ingredients.";
  140. mes "You need ^ff9999"+getitemname(.@material)+"^000000 and ^ff9999"+.@price+"^000000 Zeny, meow~";
  141. mes "Go get it, meow~";
  142. close;
  143. }
  144. delitem .@material,1;
  145. set Zeny, Zeny-.@price;
  146. // anti-hack
  147. if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) ||
  148. callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) {
  149. mes "[Holink]";
  150. emotion ET_FRET;
  151. mes "Wait a second...";
  152. mes "Do you think I'm stupid?!";
  153. mes "You switched the item while I wasn't looking! Get out of here!";
  154. close;
  155. }
  156. if (getequippercentrefinery(.@part, true) > rand(100)) {
  157. successrefitem .@part;
  158. mes "[Holink]";
  159. mes "Me~ Me~ Meow! Fun fun refining~";
  160. next;
  161. emotion ET_CHUP;
  162. mes "[Holink]";
  163. mes "Perfect!! Perfect, meow!!";
  164. mes "I am the disciple of the refining wizard Aragam~";
  165. mes "Holink!!";
  166. mes "Another day of successful refining, meow!!";
  167. close;
  168. }
  169. failedrefitem .@part;
  170. mes "[Holink]";
  171. mes "Meo~ Meow~ Kyaaak!!";
  172. next;
  173. switch(rand(1,5)) {
  174. case 1: emotion ET_CRY; break;
  175. case 2: emotion ET_PROFUSELY_SWEAT; break;
  176. case 3: emotion ET_KEK; break;
  177. case 4: emotion ET_SCRATCH; break;
  178. case 5: emotion ET_BIGTHROB; break;
  179. }
  180. mes "[Holink]";
  181. mes "Meow!! Aaaaakk~~!!!!";
  182. mes "Kyaaak!! I have failed, meow!!";
  183. next;
  184. mes "[Holink]";
  185. mes "......";
  186. mes "......";
  187. mes "All~ Everything~ Broken, meow...";
  188. next;
  189. mes "[Holink]";
  190. mes "Meow.... Master Aragam once said,";
  191. mes "learn from your failures...";
  192. mes "Human, this one failure will be the beginning of your success in the future.";
  193. close;
  194. }