yuhsing

Untitled

Aug 19th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.85 KB | None | 0 0
  1. //===== eAthena Script =======================================
  2. //= Renewal Refiners Script
  3. //===== By: ==================================================
  4. //= Chilly
  5. //===== Current Version: =====================================
  6. //= 1.1
  7. //===== Compatible With: =====================================
  8. //= Any Athena Version
  9. //===== Description: =========================================
  10. //= Uses Bradium and Kalunium to upgrade weapons and armors from +10 up to +20.
  11. //= Includes trader who exchanges Oridecon and Elunium for Bradium and Kalunium.
  12. //= Added refiner for High Density Bradium and Kalunium too (similar to enriched elunium/oridecon).
  13. //===== Additional Comments: =================================
  14. //= 1.0 First Release
  15. //= 1.1 Moved npcs to official locations and using offiical sprites
  16. // MyRO
  17. // Removed High Density NPC and Badium/Kalunium Refiners
  18. //============================================================
  19.  
  20. //=====================================================================================
  21. // +20 Refiners
  22. //=====================================================================================
  23. prt_in,90,72,4 script Refiner +11 to +20#001 826,{
  24. callfunc "refinenew","Bestri",0;
  25. end;
  26. }
  27. payon_in01,18,132,4 script Refiner +11 to +20#002 826,{
  28. callfunc "refinenew","Bestri",0;
  29. end;
  30. }
  31. morocc_in,64,41,4 script Refiner +11 to +20#003 826,{
  32. callfunc "refinenew","Bestri",0;
  33. end;
  34. }
  35.  
  36. //============================================================
  37. // +20 Refiner Function
  38. //============================================================
  39. // To allow auto safe refining/multiple refining set the
  40. // second argument to '1' in the function call.
  41. //============================================================
  42. function script refinenew {
  43. set .@features,getarg(1);
  44. mes "[" + getarg(0) + "]";
  45. mes "I can refine all kinds of weapons, armor and equipment from ^0000FF+11 up to +20^000000.";
  46. next;
  47. mes "[" + getarg(0) + "]";
  48. mes "The equipment refine has a ^FF0000chance to fail^000000 depending on the refine level which may reduce its current refine to ^FF0000-3 refine levels^000000.";
  49. next;
  50. mes "[" + getarg(0) + "]";
  51. mes "I will need ^0000FFOne (1) Kalunium^000000 and a fee of ^0000FF100,000 Zeny^000000 for armors.";
  52. mes "...and ^0000FFOne (1) Bradium^000000 and a fee of ^0000FF100,000 Zeny^000000 for weapons.";
  53. next;
  54. mes "[" + getarg(0) + "]";
  55. mes "^0000FFKaluniums^000000 and ^0000FFBradiums^000000 can be obtained from special monsters, from events and from the Donation Items NPC.";
  56. next;
  57. mes "[" + getarg(0) + "]";
  58. mes "So what do you want me to refine?";
  59. setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
  60. set .@menu$,"";
  61. for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
  62. {
  63. if( getequipisequiped(.@i) )
  64. set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
  65.  
  66. set .@menu$, .@menu$ + ":";
  67. }
  68. set .@part,select(.@menu$);
  69. if(!getequipisequiped(.@part)) {
  70. mes "[" + getarg(0) + "]";
  71. mes "You're not wearing";
  72. mes "anything there that";
  73. mes "I can refine.";
  74. emotion 6;
  75. close;
  76. }
  77. //Check if the item is refinable...
  78. if(!getequipisenableref(.@part)) {
  79. mes "[" + getarg(0) + "]";
  80. mes "I don't think I can";
  81. mes "refine this item at all...";
  82. close;
  83. }
  84. //Check if the item is identified... (Don't know why this is in here... but kept it anyway)
  85. if(!getequipisidentify(.@part)) {
  86. mes "[" + getarg(0) + "]";
  87. mes "You can't refine this";
  88. mes "if you haven't appraised";
  89. mes "it first. Make sure your";
  90. mes "stuff is identified before";
  91. mes "I can refine it.";
  92. close;
  93. }
  94. //Check to see if the items is between +10 and +20
  95. if(getequiprefinerycnt(.@part) >= 20) {
  96. mes "[" + getarg(0) + "]";
  97. mes "I can't refine this";
  98. mes "any more. This is as";
  99. mes "refined as it gets!";
  100. close;
  101. }
  102. if(getequiprefinerycnt(.@part) <= 9) {
  103. mes "[" + getarg(0) + "]";
  104. mes "I can't refine this yet.";
  105. mes "Upgrade it to ^0000FFatleast +10^000000";
  106. mes "before you bring it to me.";
  107. close;
  108. }
  109. set .@refineitemid, getequipid(.@part); // save id of the item
  110. set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
  111. switch(getequipweaponlv(.@part)){
  112. case 0: //Refine Armor
  113. set .@price,100000;
  114. set .@material,6223;
  115. set .@safe,4;
  116. break;
  117. case 1: //Refine Level 1 Weapon
  118. set .@price,100000;
  119. set .@material,6224;
  120. set .@safe,7;
  121. break;
  122. case 2: //Refine Level 2 Weapon
  123. set .@price,100000;
  124. set .@material,6224;
  125. set .@safe,6;
  126. break;
  127. case 3: //Refine Level 3 Weapon
  128. set .@price,100000;
  129. set .@material,6224;
  130. set .@safe,5;
  131. break;
  132. case 4: //Refine Level 4 Weapon
  133. set .@price,100000;
  134. set .@material,6224;
  135. set .@safe,4;
  136. break;
  137. case 5: //Refine other stuff?
  138. set .@price,100000;
  139. set .@material,6223;
  140. set .@safe,4;
  141. break;
  142. }
  143. if(.@features != 1) {
  144. mes "[" + getarg(0) + "]";
  145. mes "To refine this I need";
  146. mes "one ^003366"+getitemname(.@material)+"^000000 and";
  147. mes "a service fee of " + .@price + " Zeny.";
  148. mes "Do you really wish to continue?";
  149. next;
  150. if(select("Yes:No") == 2){
  151. mes "[" + getarg(0) + "]";
  152. mes "Yeah...";
  153. mes "There's no need to";
  154. mes "rush. Take your time.";
  155. close;
  156. }
  157. if(getequippercentrefinery(.@part) < 100) {
  158. mes "[" + getarg(0) + "]";
  159. mes "Oh no! If I continue to";
  160. mes "refine this, there's a risk it could";
  161. mes "be ^FF0000downgraded by 3 levels!^000000";
  162. mes "Do you still want to refine?";
  163. next;
  164. if(select("Yes:No") == 2){
  165. mes "[" + getarg(0) + "]";
  166. mes "I completely agree...";
  167. mes "I might be a great refiner, but sometimes even I make mistakes.";
  168. close;
  169. }
  170. }
  171. if((countitem(.@material) < 1) || (Zeny < .@price)) {
  172. mes "[" + getarg(0) + "]";
  173. mes "You don't seem to have";
  174. mes "enough Zeny or "+getitemname(.@material)+"...";
  175. mes "Go get some more. I'll be";
  176. mes "here all day if you need me.";
  177. close;
  178. }
  179. set Zeny,Zeny-.@price;
  180. delitem .@material,1;
  181. if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
  182. mes "[" + getarg(0) + "]";
  183. mes "Look here... you don't have any Items on...";
  184. close;
  185. }
  186. if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
  187. mes "[" + getarg(0) + "]";
  188. Emotion e_an;
  189. mes "Wait a second...";
  190. mes "Do you think I'm stupid?!";
  191. mes "You switched the item while I wasn't looking! Get out of here!";
  192. close;
  193. }
  194. if(getequippercentrefinery(.@part) <= rand(100)) {
  195. failedrefitemR .@part;
  196. specialeffect2 155;
  197. mes "[" + getarg(0) + "]";
  198. set .@emo,rand(1,5);
  199. if (.@emo == 1) {
  200. Emotion e_cash;
  201. } else {
  202. Emotion e_swt;
  203. }
  204. set .@lose,rand(1,2);
  205. if (.@lose == 1) {
  206. mes "OH! MY GOD!";
  207. mes "Damn it! Not again!";
  208. mes "I'm terribly sorry, but you know practice does make perfect.";
  209. mes "Um, right? Heh heh...";
  210. } else {
  211. mes "Crap!";
  212. mes "It couldn't take";
  213. mes "much more tempering!";
  214. mes "Sorry about this...";
  215. }
  216. close;
  217. }
  218. mes "["+getarg(0)+"]";
  219. successrefitem .@part;
  220. Emotion e_heh;
  221. set .@win,rand(1,3);
  222. if (.@win == 1) {
  223. mes "Perfect!";
  224. mes "Heh heh!";
  225. mes "Once again,";
  226. mes "flawless work";
  227. mes "from the master~";
  228. } else if(.@win == 2) {
  229. mes "Success...!";
  230. mes "Yet again, my amazing";
  231. mes "talent truly dazzles";
  232. mes "and shines today.";
  233. } else {
  234. mes "Heh heh!";
  235. mes "I'm all done.";
  236. mes "No doubt, my work is";
  237. mes "to your satisfaction.";
  238. mes "Sheer, utter perfection~";
  239. }
  240. close;
  241. }
  242.  
  243. // New Refining Functions ========================
  244. mes "[" + getarg(0) + "]";
  245. mes "I can refine this to the limit or a desired number of times... it's your choice...";
  246. next;
  247. switch(select("I'll decide how many times.","I've changed my mind...")) {
  248. case 1:
  249. mes "[" + getarg(0) + "]";
  250. mes "So how many times would you like me to refine your item?";
  251. next;
  252. input .@refinecnt;
  253. set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
  254. if (.@refinecnt < 1 || .@refinecheck > 20) {
  255. mes "[" + getarg(0) + "]";
  256. mes "I can't refine this item that many times.";
  257. close;
  258. }
  259. if(.@refinecheck > .@safe) {
  260. set .@refinecheck,.@refinecheck - .@safe;
  261. mes "[" + getarg(0) + "]";
  262. mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be ^FF0000downgraded by 3 levels^000000 if i fail... is that ok?";
  263. next;
  264. if(select("Yes...","No...") == 2){
  265. mes "[" + getarg(0) + "]";
  266. mes "You said so..Hmm so be it...";
  267. close;
  268. }
  269. }
  270. break;
  271. case 2:
  272. mes "[" + getarg(0) + "]";
  273. mes "You said so..Hmm so be it...";
  274. close;
  275. }
  276. set .@fullprice,.@price * .@refinecnt;
  277. mes "[" + getarg(0) + "]";
  278. mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
  279. next;
  280. if(select("Yes","No...") == 2){
  281. mes "[" + getarg(0) + "]";
  282. mes "You said so..Hmm so be it...";
  283. close;
  284. }
  285. if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
  286. mes "[" + getarg(0) + "]";
  287. mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
  288. close;
  289. }
  290. set Zeny,Zeny - .@fullprice;
  291. delitem .@material,.@refinecnt;
  292. while(.@refinecnt){
  293. if (getequipisequiped(.@part) == 0) {
  294. mes "[" + getarg(0) + "]";
  295. mes "Look here... you don't have any Items on...";
  296. close;
  297. }
  298. if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
  299. mes "[" + getarg(0) + "]";
  300. mes "Clan... No, but Did you imagine I could be so stupid !?!";
  301. mes "You have changed it...";
  302. mes "Go out before I stun you with my Hammer!!!";
  303. close;
  304. }
  305. mes "Clang, clang!!!";
  306. if(getequippercentrefinery(.@part) <= rand(100)) {
  307. failedrefitemR .@part;
  308. specialeffect2 155;
  309. emotion 23;
  310. mes "[" + getarg(0) + "]";
  311. mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
  312. set .@refinecnt,.@refinecnt - 1;
  313. if(.@refinecnt == 0) close;
  314. mes "Here's the unused Zeny and Material back...";
  315. getitem .@material,.@refinecnt;
  316. set .@fullprice,.@refinecnt * .@price;
  317. set Zeny,Zeny + .@fullprice;
  318. close;
  319. }
  320. successrefitem .@part;
  321. emotion 21;
  322. set .@refinecnt,.@refinecnt - 1;
  323. next;
  324. }
  325. mes "[" + getarg(0) + "]";
  326. mes "All finished... Come again soon.";
  327. close;
  328. }
  329.  
  330. //==============================================================================
  331. // Badium/Kalunium Refiners --- removed Badium/Kalunium Refiners
  332. //==============================================================================
  333. //prt_in,85,71,4 script Austri#001 826,{
  334. // callfunc "purifynew","Austri";
  335. // end;
  336. //}
  337. //payon_in01,14,125,4 script Austri#002 826,{
  338. // callfunc "purifynew","Austri";
  339. // end;
  340. //}
  341. //morocc_in,60,38,4 script Austri#003 826,{
  342. // callfunc "purifynew","Austri";
  343. // end;
  344. //}
  345.  
  346. //============================================================
  347. // Bradium/Kalunium Functions
  348. //============================================================
  349. /*
  350. //function script purifynew {
  351. // if (checkweight(1201,1) == 0) {
  352. // mes "- Wait a minute !! -";
  353. // mes "- Currently you're carrying -";
  354. // mes "- too many items with you. -";
  355. // mes "- Please try again -";
  356. // mes "- after you loose some weight. -";
  357. // close;
  358. // }
  359. // mes "[" + getarg(0) + "]";
  360. // mes "For ^0000FF50,000 Zeny^000000 and ^0000FF3 Oridecons^000000, I can make ^0000FF1 Bradium^000000 for you.";
  361. // mes "For ^0000FF50,000 Zeny^000000 and ^0000FF3 Eluniums^000000, I can make ^0000FF1 Kalunium^000000 for you.";
  362. // next;
  363. // mes "[" + getarg(0) + "]";
  364. // mes "I can also purify your";
  365. // mes "Bradium into Kalunium. I'll need";
  366. // mes "^0000FF500,000 Zeny and 1 Bradium^000000 to";
  367. // mes "complete this process for you.";
  368. // next;
  369. // switch(select("Make Bradium:Make Kalunium:Exchange Bradium for Kalunium")) {
  370. // case 1:
  371. // if ((countitem(984) < 3) || (Zeny < 50000)) {
  372. // mes "[" + getarg(0) + "]";
  373. // mes "You're kidding me, right?";
  374. // mes "I just told you that I need ^0000FF50,000 Zeny^000000 and ^0000FF3 Oridecons^000000 to make a Bradium.";
  375. // close;
  376. // }
  377. // set Zeny,Zeny-50000;
  378. // delitem 984,3; // Oridecon
  379. // //getitem 6224,1; // Bradium --- edited removed bradium giver
  380. // mes "[" + getarg(0) + "]";
  381. // mes "Here's your Bradium.";
  382. // mes "You're welcome to come";
  383. // mes "back whenever you want.";
  384. // close;
  385. // case 2:
  386. // if ((countitem(985) < 3) || (Zeny < 50000)) {
  387. // mes "[" + getarg(0) + "]";
  388. // mes "You're kidding me, right?";
  389. // mes "I just told you that I need ^0000FF50,000 Zeny^000000 and ^0000FF3 Eluniums^000000 to make a Kalunium.";
  390. // close;
  391. // }
  392. // set Zeny,Zeny-50000;
  393. // delitem 985,3; // Elunium
  394. // //getitem 6223,1; // Kalunium --- edited removed kalunium giver
  395. // mes "[" + getarg(0) + "]";
  396. // mes "Here's your Kalunium.";
  397. // mes "You're welcome to come";
  398. // mes "back whenever you want.";
  399. // close;
  400. // case 3:
  401. // if ((countitem(6224) < 1) || (Zeny < 500000)) {
  402. // mes "[" + getarg(0) + "]";
  403. // mes "You're kidding me, right?";
  404. // mes "I just told you that I need ^0000FF500,000 Zeny^000000 and ^0000FF1 Bradium^000000 to make a Kalunium.";
  405. // close;
  406. // }
  407. // set Zeny,Zeny-500000;
  408. // delitem 6224,1; // Bradium
  409. // getitem 6223,1; // Kalunium
  410. // mes "[" + getarg(0) + "]";
  411. // mes "Here's your Kalunium.";
  412. // mes "You're welcome to come";
  413. // mes "back whenever you want.";
  414. // close;
  415. // }
  416. //}
  417. */
  418.  
  419.  
  420. /*
  421.  
  422. // Disabled the NPC below as of Jan 2013.
  423.  
  424. // High Density Bradium & Kalunium
  425. prt_in,93,70,2 script High Density#cash02 63,{
  426. mes "[Suhnbi]";
  427. mes "This is disabled.";
  428. close;
  429. end;
  430. mes "[Suhnbi]";
  431. mes "I am Suhnbi";
  432. mes "I can refine all kinds of weapons,";
  433. mes "armor and equipment, so let me";
  434. mes "know what you want to refine.";
  435. next;
  436.  
  437. setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
  438. set .@menu$,"";
  439. for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
  440. {
  441. if( getequipisequiped(.@i) )
  442. set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
  443.  
  444. set .@menu$, .@menu$ + ":";
  445. }
  446. set .@part,select(.@menu$);
  447.  
  448. if( !getequipisequiped(.@part) )
  449. close;
  450.  
  451. if( !getequipisenableref(.@part) )
  452. {
  453. mes "[Suhnbi]";
  454. mes "I don't think I can refine this item at all.";
  455. close;
  456. }
  457. if( !getequipisidentify(.@part) )
  458. {
  459. mes "[Suhnbi]";
  460. mes "This has not been identified. So, it can't be refined...";
  461. close;
  462. }
  463. if( getequiprefinerycnt(.@part) < 10 )
  464. {
  465. mes "[Suhnbi]";
  466. mes "This item cannot be refined yet, come back after you upgrade it to ^0000FFatleast +10^000000...";
  467. close;
  468. }
  469. if( getequiprefinerycnt(.@part) >= 20 )
  470. {
  471. mes "[Suhnbi]";
  472. mes "This item cannot be refined because it has already reached its maximum level...";
  473. close;
  474. }
  475.  
  476. // Make sure you have the neccessary items and Zeny to refine your items
  477. // Determines chance of failure and verifies that you want to continue.
  478. switch( getequipweaponlv(.@part) )
  479. {
  480. case 1: callsub S_RefineValidate,1,6226,100000,.@part; break;
  481. case 2: callsub S_RefineValidate,2,6226,100000,.@part; break;
  482. case 3: callsub S_RefineValidate,3,6226,100000,.@part; break;
  483. case 4: callsub S_RefineValidate,4,6226,100000,.@part; break;
  484. default: callsub S_RefineValidate,0,6225,100000,.@part; break;
  485. }
  486.  
  487. if( getequippercentrefinery(.@part) > rand(100) || getequippercentrefinery(.@part) > rand(100) )
  488. {
  489. mes "[Suhnbi]";
  490. mes "Clink! Clank! Clunk!";
  491. SuccessRefItem .@part;
  492. next;
  493. Emotion e_no1;
  494. mes "[Suhnbi]";
  495. mes "Here you are! It's done.";
  496. mes "It's been a while since I've made such a fine weapon. You must be happy because it has become stronger!";
  497. close;
  498. }
  499. else
  500. {
  501. mes "[Suhnbi]";
  502. mes "Clink! Clank! Clunk!";
  503. failedrefitemR .@part;
  504. specialeffect2 155;
  505. next;
  506. if (rand(5) == 1)
  507. Emotion e_cash;
  508. else
  509. Emotion e_omg;
  510. mes "[Suhnbi]";
  511. mes "Cough!!!!";
  512. next;
  513. mes "[Suhnbi]";
  514. mes "Cough...Cough..";
  515. mes "What a shame...";
  516. mes "Your equipment was ^FF0000downgraded 3 levels^000000 during the refining process. I had told you earlier this might happen!";
  517. close;
  518. }
  519.  
  520. S_RefineValidate:
  521. mes "[Suhnbi]";
  522. if (getarg(0))
  523. mes "A level " + getarg(0) + " weapon...";
  524. mes "To refine this I need one ^ff9999" + getitemname(getarg(1)) + "^000000 and a service fee of " + getarg(2) + " Zeny.";
  525. mes "Do you wish to continue?";
  526. next;
  527. if( select("Yes:No") == 1 )
  528. {
  529. if( getequippercentrefinery(getarg(3)) < 100 )
  530. {
  531. mes "[Suhnbi]";
  532. mes "Wow!! This weapon, probably";
  533. mes "looks like it's been refined...";
  534. mes "many times...";
  535. next;
  536. mes "[Suhnbi]";
  537. mes "It may ^FF0000downgrade by 3 levels^000000 if you refine it again.";
  538. mes "Are you sure you still want to continue?";
  539. next;
  540. if( select("Yes:No") == 2 )
  541. {
  542. mes "[Suhnbi]";
  543. mes "I completely agree...";
  544. mes "I might be a great refiner, but sometimes even I make mistakes.";
  545. close;
  546. }
  547. }
  548. if( countitem(getarg(1)) > 0 && Zeny > getarg(2) )
  549. {
  550. delitem getarg(1), 1;
  551. set Zeny, Zeny - getarg(2);
  552. return;
  553. }
  554. else
  555. {
  556. mes "[Suhnbi]";
  557. mes "You don't seem to have enough Zeny or " + getitemname(getarg(1)) + "...";
  558. mes "Go get some more. I'll be here all day if you need me.";
  559. close;
  560. }
  561. }
  562. else
  563. {
  564. mes "[Suhnbi]";
  565. mes "Yeah... There's no need to rush.";
  566. mes "Take your time.";
  567. close;
  568. }
  569. }
  570. // Disabled High Density NPC above as of Jan 2013
  571.  
  572. */
  573.  
  574.  
  575. //my addition below duplicates
  576.  
  577. turbo_room,78,97,5 duplicate(Refiner +11 to +20#001) Refiner +11 to +20#004 826
  578.  
  579. //turbo_room,103,111,6 duplicate(Austri#001) Austri#004 826 --- removed maker of bradium and kalunium
Advertisement
Add Comment
Please, Sign In to add comment