blessed_refiner.txt 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. //===== rAthena Script =======================================
  2. //= Blessed Refiner
  3. //===== Description: =========================================
  4. //= [Official Conversion]
  5. //= Refiners that use Blessed ores to refine equipment.
  6. //= Upon failure, the equipment is not destroyed. The success
  7. //= rate is identical to that for Enriched ores.
  8. //= - "Blacksmith Dister" only refines from +6~12.
  9. //= NOTE: This NPC is currently disabled on official servers.
  10. //===== Changelog: ===========================================
  11. //= 1.0 First version. [Euphy]
  12. //= 1.1 Removed re-roll behavior. [Secret]
  13. //============================================================
  14. // Main NPC :: new_smelting612
  15. //============================================================
  16. - script ::BlacksmithDister -1,{
  17. disable_items;
  18. mes "[Blacksmith Dister]";
  19. mes "In this highly competitive society, we must be different in order to survive!";
  20. mes "I only refine equipment at the +6 ~ 12 levels.";
  21. next;
  22. mes "[Blacksmith Dister]";
  23. mes "I will need ^ff9999Blessed Oridecon^000000 for weapons, and ^ff9999Blessed Elunium^000000 for armors.";
  24. mes "Failed refines ^FF0000will not break or reduce the refine level^000000.";
  25. next;
  26. mes "[Blacksmith Dister]";
  27. mes "How about it? 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]) +"-[Unequipped]" ) +":";
  32. set .@part, .@indices[ select(.@menu$) ];
  33. if (!getequipisequiped(.@part)) {
  34. mes "[Blacksmith Dister]";
  35. switch(.@part) {
  36. case EQI_HEAD_TOP:
  37. mes "I'm a blacksmith, not a hairstylist.";
  38. break;
  39. case EQI_ARMOR:
  40. mes "With my hammer, I will make you a star of the sky.";
  41. break;
  42. case EQI_HAND_L:
  43. case EQI_HAND_R:
  44. mes "Making artificial hands is not my specialty.";
  45. break;
  46. case EQI_GARMENT:
  47. mes "Bring out the item so I can refine it!";
  48. break;
  49. case EQI_SHOES:
  50. mes "Where is this weird smell coming from?";
  51. break;
  52. case EQI_ACC_L:
  53. case EQI_ACC_R:
  54. mes "Where is the accessory?";
  55. break;
  56. case EQI_HEAD_MID:
  57. mes "What do you want me to refine?";
  58. break;
  59. case EQI_HEAD_LOW:
  60. mes "Huh? What do you want me to do?";
  61. break;
  62. }
  63. close;
  64. }
  65. if (!getequipisenableref(.@part)) {
  66. mes "[Blacksmith Dister]";
  67. mes "This item cannot be refined.";
  68. close;
  69. }
  70. .@equip_id = getequipid(.@part);
  71. .@itemtype = getiteminfo( .@equip_id );
  72. .@equip_refine = getequiprefinerycnt(.@part);
  73. setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
  74. if (.@equip_refine < 6 || .@equip_refine > 12) {
  75. mes "[Blacksmith Dister]";
  76. mes "This equipment has refined to "+.@equip_refine+". I only handle items with refine levels from +6 to +12!";
  77. close;
  78. }
  79. if( .@itemtype == IT_ARMOR ){
  80. .@equip_lv = getequiparmorlv( .@part );
  81. .@type$ = "Armor";
  82. switch(.@equip_lv) {
  83. case 1:
  84. set .@price,20000;
  85. set .@material,6439; //Unbreakable_Def
  86. break;
  87. default:
  88. // TODO:
  89. close;
  90. }
  91. }else if( .@itemtype == IT_WEAPON ){
  92. .@equip_lv = getequipweaponlv( .@part );
  93. .@type$ = "Weapon";
  94. switch( .@equip_lv ){
  95. case 1:
  96. set .@price,1000;
  97. set .@material,6438; //Unbreakable_Weap
  98. break;
  99. case 2:
  100. set .@price,2000;
  101. set .@material,6438; //Unbreakable_Weap
  102. break;
  103. case 3:
  104. set .@price,20000;
  105. set .@material,6438; //Unbreakable_Weap
  106. break;
  107. case 4:
  108. set .@price,40000;
  109. set .@material,6438; //Unbreakable_Weap
  110. break;
  111. default:
  112. // TODO:
  113. close;
  114. }
  115. }else{
  116. // TODO:
  117. close;
  118. }
  119. set .@ore$,"^ff9999Blessed "+.@type$+" Ore^000000";
  120. mes "[Blacksmith Dister]";
  121. mes "This "+.@type$+" has been refined to "+.@equip_refine+". To refine it, I need "+.@ore$+" and a "+callfunc("F_InsertComma",.@price)+" zeny refining fee.";
  122. mes "Do you want to proceed?";
  123. next;
  124. if(select("Yes:No") == 2) {
  125. mes "[Blacksmith Dister]";
  126. mes "I am busy, don't joke with me!";
  127. close;
  128. }
  129. if (getequippercentrefinery(.@part) < 100) {
  130. mes "[Blacksmith Dister]";
  131. mes "This "+.@type$+" has been refined many times. Although it will not disappear upon failure, the "+.@ore$+" will disappear!";
  132. next;
  133. mes "[Blacksmith Dister]";
  134. mes "Of course, the refining fee will not be returned! Do you want to continue?";
  135. next;
  136. if(select("Yes:No") == 2) {
  137. mes "[Blacksmith Dister]";
  138. mes "Good. I'd be sad if it failed, too.";
  139. close;
  140. }
  141. }
  142. if (countitem(.@material) == 0 || Zeny < .@price) {
  143. mes "[Blacksmith Dister]";
  144. mes "Materials insufficient.";
  145. mes "To refine a level "+.@equip_lv+" "+.@type$+", I need "+.@ore$+" and a "+callfunc("F_InsertComma",.@price)+" zeny refining fee.";
  146. close;
  147. }
  148. delitem .@material,1;
  149. set Zeny, Zeny-.@price;
  150. // anti-hack
  151. if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) || callfunc("F_IsEquipRefineHack", .@part, .@equip_refine))
  152. close;
  153. mes "[Blacksmith Dister]";
  154. mes "Tac! Tac! Tac!";
  155. if (getequippercentrefinery(.@part, true) > rand(100)) {
  156. specialeffect EF_BLESSING;
  157. successrefitem .@part;
  158. next;
  159. mes "[Blacksmith Dister]";
  160. mes "Hahahahahaha!!!";
  161. next;
  162. mes "[Blacksmith Dister]";
  163. mes "Refine was a huge success~ Hahaha!";
  164. close;
  165. }
  166. specialeffect EF_CURSEATTACK;
  167. specialeffect2 EF_SUI_EXPLOSION;
  168. next;
  169. emotion (!rand(5))?ET_ANGER:ET_HUK;
  170. mes "[Blacksmith Dister]";
  171. mes "Oh my goodness!!!!";
  172. next;
  173. mes "[Blacksmith Dister]";
  174. mes "Oh! Although it was blessed by "+.@ore$+" to retain the equipment...";
  175. next;
  176. mes "[Blacksmith Dister]";
  177. mes "My mood is worse when I fail!!";
  178. close;
  179. }
  180. prt_in,52,56,3 duplicate(BlacksmithDister) Blacksmith Dister#prt 826
  181. payon,148,172,3 duplicate(BlacksmithDister) Blacksmith Dister#pay 826
  182. alberta_in,20,56,3 duplicate(BlacksmithDister) Blacksmith Dister#alb 826
  183. yuno_in01,175,18,3 duplicate(BlacksmithDister) Blacksmith Dister#yuno 826
  184. ein_in01,26,82,3 duplicate(BlacksmithDister) Blacksmith Dister#ein 826
  185. lhz_in02,280,15,3 duplicate(BlacksmithDister) Blacksmith Dister#lhz 826