refine.txt 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. //===== rAthena Script =======================================
  2. //= Renewal Refining NPCs
  3. //===== By: ==================================================
  4. //= rAthena Dev Team
  5. //===== Current Version: =====================================
  6. //= 1.4
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Renewal-specific refining NPCs and material merchants.
  11. //===== Additional Comments: =================================
  12. //= 1.0 Moved some scripts to Renewal file, optimized "Austry" NPC. [Euphy]
  13. //= 1.0a Added 'disable_items' command. [Euphy]
  14. //= 1.1 Added Malangdo Refiner "Clink". [Euphy]
  15. //= 1.2 Added official success calculation, thanks to Helvetica.
  16. //= The safe/multiple refine feature is now functional. [Euphy]
  17. //= 1.3 Updated to match the latest official script. [Euphy]
  18. //= 1.4 Added correct safe refines. [Haruna]
  19. //= 1.5 Added Refine UI [Atemo, Lemongrass]
  20. //= 1.6 Added Barter exchange npcs [Atemo]
  21. //============================================================
  22. // +11 and above Refiners
  23. //============================================================
  24. prt_in,90,72,5 script Vestri#prt 4_M_DWARF,{
  25. if( getbattleflag( "feature.refineui" ) ){
  26. mes "[Vestri]";
  27. mes "I'm the most skillful blacksmith!";
  28. close2;
  29. refineui();
  30. end;
  31. }else{
  32. callfunc "refinenew","Vestri",0;
  33. end;
  34. }
  35. }
  36. morocc_in,64,41,5 duplicate(Vestri#prt) Vestri#moc 4_M_DWARF
  37. payon_in01,18,132,3 duplicate(Vestri#prt) Vestri#pay 4_M_DWARF
  38. //============================================================
  39. // +11 and above Refiner Function
  40. //============================================================
  41. //= To allow auto safe refining/multiple refining set the
  42. //= second argument to '1' in the function call.
  43. //= If you enable this function, be sure to edit the value of
  44. //= .@safe to the max safe refine in refine.yml as well.
  45. //=
  46. //= On official servers, if an item is unsuccessfully refined
  47. //= it will break at a 20% rate and downgrade at an 80% rate.
  48. //============================================================
  49. function script refinenew {
  50. .@npc_name$ = getarg(0);
  51. disable_items;
  52. mes "["+ .@npc_name$ +"]";
  53. mes "I am the best Armsmith ever!";
  54. mes "I don't refine normal, boring items.";
  55. mes "I only refine items that are Level 10 or higher.";
  56. next;
  57. mes "["+ .@npc_name$ +"]";
  58. mes "Anyway, you may use my services if your item is Level 10 or higher.";
  59. mes "What do you want me to refine?";
  60. next;
  61. 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;
  62. for(.@i = 1; .@i<=10; ++.@i) {
  63. if (getequipisequiped(.@indices[.@i])) {
  64. .@menu$ = .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]";
  65. .@equipped = 1;
  66. }
  67. .@menu$ = .@menu$ + ":";
  68. }
  69. if (.@equipped == 0) {
  70. mes "["+ .@npc_name$ +"]";
  71. mes "I don't think I can refine any items you have...";
  72. close;
  73. }
  74. .@part = .@indices[ select(.@menu$) ];
  75. if (!getequipisequiped(.@part)) { //custom check
  76. mes "["+ .@npc_name$ +"]";
  77. mes "You're not wearing";
  78. mes "anything there that";
  79. mes "I can refine.";
  80. emotion ET_FRET;
  81. close;
  82. }
  83. if (!getequipisenableref(.@part)) {
  84. mes "["+ .@npc_name$ +"]";
  85. mes "I don't think I can";
  86. mes "refine this item at all...";
  87. close;
  88. }
  89. .@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
  90. if (.@refinerycnt < 10) {
  91. mes "["+ .@npc_name$ +"]";
  92. mes "I said I don't work with items that are lower than Level 10.";
  93. close;
  94. }
  95. if (.@refinerycnt >= 20) { //custom check
  96. mes "["+ .@npc_name$ +"]";
  97. mes "I can't refine this";
  98. mes "any more. This is as";
  99. mes "refined as it gets!";
  100. close;
  101. }
  102. .@refineitemid = getequipid(.@part); // save id of the item
  103. setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
  104. .@price = getequiprefinecost(.@part, REFINE_COST_NORMAL, REFINE_ZENY_COST);
  105. .@material = getequiprefinecost(.@part, REFINE_COST_NORMAL, REFINE_MATERIAL_ID);
  106. .@safe = 10;
  107. .@itemtype = getiteminfo( .@refineitemid, ITEMINFO_TYPE );
  108. if( .@itemtype == IT_WEAPON ){
  109. .@article$ = "a";
  110. .@type$ = "weapon";
  111. }else if( .@itemtype == IT_ARMOR ){
  112. .@article$ = "an";
  113. .@type$ = "armor";
  114. }else{
  115. // TODO:
  116. close;
  117. }
  118. mes "["+ .@npc_name$ +"]";
  119. mes "Hmm " + .@article$ + " " + .@type$ + ", is that ok?";
  120. mes "If you want to refine this " + .@type$ + ",";
  121. mes "I will need 1 ^003366" + getitemname(.@material) + "^000000 and " + callfunc("F_InsertComma",.@price) + " zeny.";
  122. mes "Are you sure you want to continue?";
  123. next;
  124. if (select("Yes:No") == 2) {
  125. mes "["+ .@npc_name$ +"]";
  126. mes "Hm... if you mind... never mind...";
  127. close;
  128. }
  129. if (getarg(1) != 1) {
  130. if (getequippercentrefinery(.@part) < 100) {
  131. mes "["+ .@npc_name$ +"]";
  132. mes "This "+.@type$+" already has been refined several times.";
  133. mes "It could be destroyed if I try again.";
  134. mes "It won't break for sure, but there is has a small chance.";
  135. next;
  136. mes "["+ .@npc_name$ +"]";
  137. mes "You could be ^FF0000lowering the upgrade level^000000 of the "+.@type$+",";
  138. mes "or if it breaks, you will lose ^FF0000any cards^000000 or special properties added to it.";
  139. next;
  140. mes "["+ .@npc_name$ +"]";
  141. mes "Do you still want me to refine it?";
  142. mes "I think I have given you enough warning.";
  143. next;
  144. if(select("Yes.:No.") == 2) {
  145. mes "["+ .@npc_name$ +"]";
  146. mes "Well, no challenge is one way to go...";
  147. mes "No risk... that could be wise.";
  148. close;
  149. }
  150. }
  151. if (countitem(.@material) < 1 || Zeny < .@price) {
  152. mes "["+ .@npc_name$ +"]";
  153. mes "Hm. You don't seem to have enough money or "+getitemname(.@material)+".";
  154. mes "Please come back when you have them.";
  155. close;
  156. }
  157. Zeny = Zeny - .@price;
  158. delitem .@material,1;
  159. // anti-hack
  160. if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) ||
  161. callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) {
  162. mes "["+ .@npc_name$ +"]";
  163. emotion ET_FRET;
  164. mes "Wait a second...";
  165. mes "Do you think I'm stupid?!";
  166. mes "You switched the item while I wasn't looking! Get out of here!";
  167. close;
  168. }
  169. if (getequippercentrefinery(.@part) > rand(100)) {
  170. mes "Clang! Clang! Clang! Clang!";
  171. successrefitem .@part;
  172. next;
  173. emotion ET_BEST;
  174. mes "["+ .@npc_name$ +"]";
  175. mes "Good! Succes!!!";
  176. mes "I am the best Armsmith.";
  177. close;
  178. } else {
  179. if (rand(100) < 80) {
  180. mes "["+ .@npc_name$ +"]";
  181. mes "Clang! Clang! Clang! Clang!";
  182. downrefitem .@part,3; // Failed refine attempts decrease the item's refine level by 3
  183. next;
  184. emotion (!rand(5))?ET_MONEY:ET_HUK;
  185. mes "["+ .@npc_name$ +"]";
  186. mes "Ahhh!!!";
  187. next;
  188. mes "["+ .@npc_name$ +"]";
  189. mes "Oh my god!";
  190. mes "The upgrade level has dropped...";
  191. } else {
  192. mes "["+ .@npc_name$ +"]";
  193. mes "Clang! Clang! Clang!";
  194. failedrefitem .@part;
  195. next;
  196. emotion (!rand(5))?ET_MONEY:ET_HUK;
  197. mes "["+ .@npc_name$ +"]";
  198. mes "Hmmm!";
  199. next;
  200. mes "["+ .@npc_name$ +"]";
  201. mes "Oh my! I've failed to refine stuff...";
  202. mes "I didn't mean it!";
  203. }
  204. mes "I could have made a mistake even though I am the best Armsmith ever.";
  205. mes "It just wasn't meant to be.";
  206. next;
  207. mes "["+ .@npc_name$ +"]";
  208. mes "I will do a better job next time! Don't worry!";
  209. close;
  210. }
  211. }
  212. // New +11 and above Refining Functions ========================
  213. if (.@refinerycnt < .@safe) {
  214. mes "["+ .@npc_name$ +"]";
  215. mes "I can refine this to the safe limit or a desired number of times. It's your choice.";
  216. next;
  217. .@menu2 = select("To the safe limit, please.","I'll decide how many times.","I've changed my mind...");
  218. } else
  219. .@menu2 = 2;
  220. switch(.@menu2){
  221. case 1:
  222. .@refinecnt = .@safe - .@refinerycnt;
  223. break;
  224. case 2:
  225. mes "["+ .@npc_name$ +"]";
  226. mes "How many times would you like me to refine your item?";
  227. next;
  228. input .@refinecnt;
  229. .@refinecheck = .@refinecnt + .@refinerycnt;
  230. if (.@refinecnt < 1 || .@refinecheck > 20) {
  231. mes "["+ .@npc_name$ +"]";
  232. mes "I can't refine this item that many times.";
  233. close;
  234. }
  235. if (.@refinecheck > .@safe) {
  236. .@refinecheck = .@refinecheck - .@safe;
  237. mes "["+ .@npc_name$ +"]";
  238. mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?";
  239. next;
  240. if(select("Yes...","No...") == 2){
  241. mes "["+ .@npc_name$ +"]";
  242. mes "You said so... So be it.";
  243. close;
  244. }
  245. }
  246. break;
  247. case 3:
  248. mes "["+ .@npc_name$ +"]";
  249. mes "You said so... So be it.";
  250. close;
  251. }
  252. .@fullprice = .@price * .@refinecnt;
  253. mes "["+ .@npc_name$ +"]";
  254. mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
  255. next;
  256. if(select("Yes:No...") == 2){
  257. mes "["+ .@npc_name$ +"]";
  258. mes "You said so... So be it.";
  259. close;
  260. }
  261. if (countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
  262. mes "["+ .@npc_name$ +"]";
  263. mes "Hm. You don't seem to have enough money or "+getitemname(.@material)+".";
  264. mes "Please come back when you have them.";
  265. close;
  266. }
  267. Zeny = Zeny - .@fullprice;
  268. delitem .@material,.@refinecnt;
  269. while(.@refinecnt){
  270. if (getequipisequiped(.@part) == 0) {
  271. mes "["+ .@npc_name$ +"]";
  272. mes "Look here... you don't have any items on...";
  273. close;
  274. }
  275. // anti-hack
  276. if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) ||
  277. callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt))
  278. close;
  279. if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
  280. mes "["+ .@npc_name$ +"]";
  281. mes "Clang... No, but did you imagine I could be so stupid?!";
  282. mes "You changed it...";
  283. mes "Get out before I stun you with my Hammer!!";
  284. close;
  285. }
  286. if (getequippercentrefinery(.@part) > rand(100)) {
  287. mes "Clang! Clang! Clang! Clang!";
  288. successrefitem .@part;
  289. .@refinecnt = .@refinecnt - 1;
  290. next;
  291. } else {
  292. if (rand(100) < 80) {
  293. mes "["+ .@npc_name$ +"]";
  294. mes "Clang! Clang! Clang! Clang!";
  295. downrefitem .@part,3; // Failed refine attempts decrease the item's refine level by 3
  296. next;
  297. emotion (!rand(5))?ET_MONEY:ET_HUK;
  298. mes "["+ .@npc_name$ +"]";
  299. mes "Ahhh!!!";
  300. next;
  301. mes "["+ .@npc_name$ +"]";
  302. mes "Oh my god!";
  303. mes "The upgrade level has dropped...";
  304. } else {
  305. mes "["+ .@npc_name$ +"]";
  306. mes "Clang! Clang! Clang!";
  307. failedrefitem .@part;
  308. next;
  309. emotion (!rand(5))?ET_MONEY:ET_HUK;
  310. mes "["+ .@npc_name$ +"]";
  311. mes "Hmmm!";
  312. next;
  313. mes "["+ .@npc_name$ +"]";
  314. mes "Oh my! I've failed to refine stuff...";
  315. mes "I didn't mean it!";
  316. }
  317. mes "I could have made a mistake even though I am the best Armsmith ever.";
  318. mes "It just wasn't meant to be.";
  319. next;
  320. mes "["+ .@npc_name$ +"]";
  321. mes "I will do a better job next time! Don't worry!";
  322. close;
  323. }
  324. .@refinerycnt = getequiprefinerycnt(.@part);
  325. }
  326. emotion ET_BEST;
  327. mes "["+ .@npc_name$ +"]";
  328. mes "Good! Succes!!!";
  329. mes "I am the best Blacksmith.";
  330. close;
  331. }
  332. // Ori/Elu to Carnium/Bradium Refiners
  333. //============================================================
  334. - script Austri#ref -1,{
  335. if (checkweight(1201,1) == 0) {
  336. mes "- Wait a minute !! -";
  337. mes "- Currently you're carrying -";
  338. mes "- too many items with you. -";
  339. mes "- Please try again -";
  340. mes "- after you lose some weight. -";
  341. close;
  342. }
  343. mes "[Austri]";
  344. mes "If you bring me 3";
  345. mes "Oridecon or Elunium";
  346. mes "I can exchange them for";
  347. mes "Bradium or Carnium.";
  348. mes "Just give me 50,000z.";
  349. next;
  350. switch(select("Oridecon to Bradium.:Elunium to Carnium.:Purified Bradium to Carnium.:No thanks.")) {
  351. case 1:
  352. setarray .@i[0],984,3,6224; //Oridecon -> Bradium
  353. break;
  354. case 2:
  355. setarray .@i[0],985,3,6223; //Elunium -> Carnium
  356. break;
  357. case 3:
  358. setarray .@i[0],6090,1,6223; //Purified_Bradium -> Carnium
  359. break;
  360. case 4:
  361. mes "[Austri]";
  362. mes "Hmm...";
  363. close;
  364. }
  365. if (countitem(.@i[0]) >= .@i[1] && Zeny >= 50000) {
  366. delitem .@i[0],.@i[1];
  367. Zeny = Zeny - 50000;
  368. getitem .@i[2],1;
  369. mes "[Austri]";
  370. if (.@i[0] == 6090) {
  371. mes "Refining with Refined Bradium";
  372. mes "can be a little expensive.";
  373. mes "I can exchange it for some Carnium.";
  374. } else
  375. mes "Ok! Here's your "+getitemname(.@i[2])+".";
  376. mes "Take it and use it well.";
  377. close;
  378. }
  379. mes "[Austri]";
  380. mes "You better not be trying";
  381. mes "to cheat me because you";
  382. mes "don't have enough money";
  383. mes "or "+getitemname(.@i[0])+".";
  384. close;
  385. }
  386. prt_in,85,71,5 duplicate(Austri#ref) Austri#prt 826
  387. payon_in01,14,125,5 duplicate(Austri#ref) Austri#pay 826
  388. morocc_in,60,38,5 duplicate(Austri#ref) Austri#moc 826
  389. // Malangdo Refiner
  390. //============================================================
  391. malangdo,224,172,6 script Clink#mal_normal 544,{
  392. disable_items;
  393. mes "[Clink]";
  394. mes "My cool dad Holink said I have the world's greatest refine hammer!!";
  395. mes "Meow Meow~";
  396. mes "Who do you think I am?";
  397. mes "Yes!!! You!! You want to refine?";
  398. next;
  399. 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;
  400. for(.@i = 1; .@i<=10; set .@i,.@i+1)
  401. .@menu$ = .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Empty]" ) +":";
  402. .@part = .@indices[ select(.@menu$) ];
  403. if (!getequipisequiped(.@part)) {
  404. mes "[Clink]";
  405. switch(.@part) {
  406. case EQI_HEAD_TOP:
  407. mes "Dad said. There's no cure for stupidity...";
  408. break;
  409. case EQI_ARMOR:
  410. mes "There's nothing to see here!!";
  411. break;
  412. case EQI_HAND_L:
  413. mes "What an arrogant left hand this is!";
  414. break;
  415. case EQI_HAND_R:
  416. mes "What an arrogant right hand this is!";
  417. break;
  418. case EQI_GARMENT:
  419. mes "Get that dirty thing off my face!!";
  420. break;
  421. case EQI_SHOES:
  422. mes "Kyaong~! Do not provoke me.";
  423. break;
  424. case EQI_ACC_L:
  425. case EQI_ACC_R:
  426. mes "Where is the accessory?";
  427. break;
  428. case EQI_HEAD_MID:
  429. case EQI_HEAD_LOW:
  430. mes "Are you talking about the other head part?";
  431. break;
  432. }
  433. close;
  434. }
  435. if (!getequipisenableref(.@part)) {
  436. mes "[Clink]";
  437. mes "This can't be refined!!";
  438. close;
  439. }
  440. .@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
  441. if (.@refinerycnt >= 10) {
  442. mes "[Clink]";
  443. mes "Perfect refining. Did I do this for you?";
  444. close;
  445. }
  446. .@refineitemid = getequipid(.@part); // save id of the item
  447. setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
  448. .@price = getequiprefinecost(.@part, REFINE_COST_NORMAL, REFINE_ZENY_COST);
  449. .@material = getequiprefinecost(.@part, REFINE_COST_NORMAL, REFINE_MATERIAL_ID);
  450. .@itemtype = getiteminfo( .@refineitemid, ITEMINFO_TYPE );
  451. mes "[Clink]";
  452. if( .@itemtype == IT_ARMOR ){
  453. switch( getequiparmorlv( .@part ) ){
  454. case 1: // Armor
  455. .@type$ = "armor";
  456. mes "Hmm, an armor refine? Someone like you?";
  457. break;
  458. default:
  459. // TODO:
  460. close;
  461. }
  462. }else if( .@itemtype == IT_WEAPON ){
  463. switch( getequipweaponlv( .@part ) ){
  464. case 1: // Level 1 Weapon
  465. .@type$ = "weapon";
  466. mes "A level 1 weapon?";
  467. mes "Urr... Annoying... Okay, let's try...";
  468. break;
  469. case 2: // Level 2 Weapon
  470. .@type$ = "weapon";
  471. mes "A level 2 weapon?";
  472. break;
  473. case 3: // Level 3 Weapon
  474. .@type$ = "weapon";
  475. mes "Woot!! A level 3 weapon? Impressive~";
  476. break;
  477. case 4: // Level 4 Weapon
  478. .@type$ = "weapon";
  479. mes "Wow!... A level 4 weapon~!!";
  480. break;
  481. default:
  482. // TODO:
  483. close;
  484. }
  485. }else{
  486. // TODO:
  487. close;
  488. }
  489. mes "You need ^ff9999"+getitemname(.@material)+"^000000 and ^ff9999"+.@price+"^000000 Zeny. Do you have them?";
  490. next;
  491. if(select("Yes, I do!!:Forget about it!!") == 2) {
  492. mes "[Clink]";
  493. mes "I knew it!!";
  494. mes "I knew you were not worth trying my magical refining hammer for.";
  495. close;
  496. }
  497. if (getequippercentrefinery(.@part) < 100) {
  498. mes "[Clink]";
  499. mes "Wow!!";
  500. mes "This "+.@type$+" has been refined quite a bit, huh?";
  501. mes "You do know that this might break, right?";
  502. next;
  503. mes "[Clink]";
  504. mes "If you break the "+.@type$+", you can never use it again.";
  505. mes "Cards and enchant effects...";
  506. mes "the ^ff0000whole thing will disappear^000000.";
  507. mes "You still up for this~?";
  508. next;
  509. if(select("Yes, I am!!:Forget about it!!") == 2) {
  510. mes "[Clink]";
  511. mes "I knew it!!";
  512. mes "You can't even take this big step. Don't think about refining...";
  513. close;
  514. }
  515. }
  516. if (countitem(.@material) == 0 || Zeny < .@price) {
  517. mes "[Clink]";
  518. mes "Hey you!! Didn't I tell you";
  519. mes "that you need ^ff9999"+getitemname(.@material)+"^000000 and ^ff9999"+.@price+"^000000 Zeny??!!";
  520. close;
  521. }
  522. delitem .@material,1;
  523. Zeny = Zeny-.@price;
  524. // anti-hack
  525. if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) ||
  526. callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) {
  527. mes "[Clink]";
  528. emotion ET_FRET;
  529. mes "Wait a second...";
  530. mes "Do you think I'm stupid?!";
  531. mes "You switched the item while I wasn't looking! Get out of here!";
  532. close;
  533. }
  534. if (getequippercentrefinery(.@part) <= rand(100)) {
  535. failedrefitem .@part;
  536. mes "[Clink]";
  537. mes "Cry Hammer!! Cry!!!";
  538. next;
  539. switch(rand(1,5)) {
  540. case 1: emotion ET_CRY; break;
  541. case 2: emotion ET_PROFUSELY_SWEAT; break;
  542. case 3: emotion ET_KEK; break;
  543. case 4: emotion ET_SCRATCH; break;
  544. case 5: emotion ET_BIGTHROB; break;
  545. }
  546. mes "[Clink]";
  547. mes "Huh?! I failed?!";
  548. next;
  549. mes "[Clink]";
  550. mes "Arrgg~ It's all~ Broken...? What a pity~";
  551. next;
  552. mes "[Clink]";
  553. mes "Hey...!! Get me another one.";
  554. mes "This is not possible.";
  555. mes "How can my hammer fail from refining?";
  556. close;
  557. }
  558. successrefitem .@part;
  559. mes "[Clink]";
  560. mes "Cry Hammer!! Cry!!!";
  561. next;
  562. emotion ET_CHUP;
  563. mes "[Clink]";
  564. mes "Ok!! Perfect!!";
  565. mes "There's nothing I can't refine";
  566. mes "with this special hammer.";
  567. mes "You can praise me!!";
  568. mes "What a day!!";
  569. close;
  570. }
  571. // Renewal barter shops
  572. - script refine_barter_init -1,{
  573. end;
  574. OnInit:
  575. if (getbattleflag("feature.barter")) {
  576. unloadnpc "Vurewell";
  577. unloadnpc "Begnahd";
  578. unloadnpc "Sade";
  579. unloadnpc "Kahlamanlith";
  580. unloadnpc "Dilemma";
  581. unloadnpc "Tirehaus";
  582. unloadnpc "Krugg";
  583. unloadnpc "Hakhim";
  584. unloadnpc "Abdula";
  585. unloadnpc "Xenophon";
  586. unloadnpc "Delight";
  587. unloadnpc "Matestein";
  588. unloadnpc "Fruel";
  589. npcshopupdate "market_refine_prt_in",1010,200,999999;
  590. npcshopupdate "market_refine_payon",1010,200,999999;
  591. npcshopupdate "market_refine_morocc_in",1010,200,999999;
  592. npcshopupdate "market_refine_alberta_in",1010,200,999999;
  593. npcshopupdate "market_refine_yuno_in01",1010,200,999999;
  594. npcshopupdate "market_refine_ein_in01",1010,200,999999;
  595. npcshopupdate "market_refine_lhz_in02",1010,200,999999;
  596. npcshopupdate "market_refine_prt_in",1011,1000,999999;
  597. npcshopupdate "market_refine_payon",1011,1000,999999;
  598. npcshopupdate "market_refine_morocc_in",1011,1000,999999;
  599. npcshopupdate "market_refine_alberta_in",1011,1000,999999;
  600. npcshopupdate "market_refine_yuno_in01",1011,1000,999999;
  601. npcshopupdate "market_refine_ein_in01",1011,1000,999999;
  602. npcshopupdate "market_refine_lhz_in02",1011,1000,999999;
  603. }
  604. else {
  605. unloadnpc "market_refine_prt_in";
  606. unloadnpc "market_refine_payon";
  607. unloadnpc "market_refine_morocc_in";
  608. unloadnpc "market_refine_alberta_in";
  609. unloadnpc "market_refine_yuno_in01";
  610. unloadnpc "market_refine_ein_in01";
  611. unloadnpc "market_refine_lhz_in02";
  612. unloadnpc "Dietrich#ns_prt";
  613. unloadnpc "Pauline";
  614. }
  615. end;
  616. }
  617. - marketshop market_refine_prt_in -1,1010:-1:999999,1011:-1:999999
  618. - marketshop market_refine_payon -1,1010:-1:999999,1011:-1:999999
  619. - marketshop market_refine_morocc_in -1,1010:-1:999999,1011:-1:999999
  620. - marketshop market_refine_alberta_in -1,1010:-1:999999,1011:-1:999999
  621. - marketshop market_refine_yuno_in01 -1,1010:-1:999999,1011:-1:999999
  622. - marketshop market_refine_ein_in01 -1,1010:-1:999999,1011:-1:999999
  623. - marketshop market_refine_lhz_in02 -1,1010:-1:999999,1011:-1:999999
  624. prt_in,63,69,3 script Dietrich#ns_prt 4_M_02,{
  625. mes "[" + strnpcinfo(1) + "]";
  626. mes "We sell and exchange various ores used in smelting.";
  627. next;
  628. switch( select( "View basic smelting ores", "View advanced smelting ores", "View Ether smelting ores", "Cancel" ) ) {
  629. case 1:
  630. mes "[" + strnpcinfo(1) + "]";
  631. mes "Phracon and Emveretarcon are available for use in smelting low-level weapons.";
  632. close2;
  633. callshop "market_refine_" + strnpcinfo(4);
  634. end;
  635. case 2:
  636. mes "[" + strnpcinfo(1) + "]";
  637. mes "We are purifying Elunium Stone or Oridecon Stone, or exchanging them with Bradium or Carnium.";
  638. close2;
  639. callshop "barter_refine_1";
  640. end;
  641. case 3:
  642. mes "[" + strnpcinfo(1) + "]";
  643. mes "We add Etel Dust to existing smelting ores and replace them with Ether-bearing smelting ores.";
  644. close2;
  645. callshop "barter_refine_2";
  646. end;
  647. case 4:
  648. mes "[" + strnpcinfo(1) + "]";
  649. mes "If you lack the materials used for smelting, come anytime.";
  650. close;
  651. }
  652. end;
  653. OnInit:
  654. setunittitle getnpcid(0), "<Responsible for smelting products>";
  655. end;
  656. }
  657. payon,137,178,5 duplicate(Dietrich#ns_prt) Hakhim#2 4_M_ORIENT01
  658. morocc_in,72,32,3 duplicate(Dietrich#ns_prt) Abdula#2 4W_M_03
  659. alberta_in,21,63,5 duplicate(Dietrich#ns_prt) Xenophon#ns_albe 4_M_02
  660. yuno_in01,164,27,4 duplicate(Dietrich#ns_prt) Delight#2 4_M_ORIENT01
  661. ein_in01,18,82,5 duplicate(Dietrich#ns_prt) Matestein#2 4_M_02
  662. lhz_in02,281,24,5 duplicate(Dietrich#ns_prt) Fruel#2 4_M_02
  663. // Shadowdecon/Zelunium exchange npcs
  664. prt_in,64,57,3 script Pauline 4_M_02,{
  665. mes "[" + strnpcinfo(1) + "]";
  666. mes "Do you have " + mesitemlink( 25728 ) + " or " + mesitemlink( 25730 ) + "?";
  667. mes "We will exchange them for refined products for use as smelting goods.";
  668. close2;
  669. callshop "barter_refine_3";
  670. end;
  671. }
  672. payon,142,179,3 duplicate(Pauline) Jihu 4_M_ORIENT01
  673. morocc_in,64,37,3 duplicate(Pauline) Marik 4W_M_03
  674. alberta_in,24,63,5 duplicate(Pauline) Satana 4_M_02
  675. yuno_in01,164,31,6 duplicate(Pauline) Dimir 4_M_ORIENT01
  676. lhz_in02,275,23,5 duplicate(Pauline) Nemil 4_M_02
  677. ein_in01,30,88,5 duplicate(Pauline) Galan 4_M_02