Advertisement
Guest User

Untitled

a guest
May 21st, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.48 KB | None | 0 0
  1. //============================================================
  2. //= Main Refiner Function
  3. //============================================================
  4. //= To allow auto safe refining/multiple refining set the
  5. //= @features variable to 1
  6. //============================================================
  7. moc_ruins,130,185,4 script refinemain 100,{
  8. set @features,1;
  9.  
  10. mes "[" + @name$ + "]";
  11. mes "I am the Armsmith... I can refine any weapon or piece of armor you choose!";
  12. mes "Which piece of equipment do you want to refine?";
  13. M_Menu:
  14. next;
  15. menu getequipname(1),PART1,getequipname(2),PART2,getequipname(3),PART3,getequipname(4),PART4,getequipname(5),PART5,
  16. getequipname(6),PART6,getequipname(7),PART7,getequipname(8),PART8,getequipname(9),PART9,getequipname(10),PART10;
  17.  
  18. //Head Gear
  19. PART1:
  20. set @part,1;
  21. // if (getequipisequiped(1)) goto CHECK1;
  22. mes "[" + @name$ + "]";
  23. mes "Do you want me to refine your dumb brain?";
  24. emotion 6;
  25. goto M_Menu;
  26. //Armor
  27. PART2:
  28. set @part,2;
  29. // if (getequipisequiped(2)) goto CHECK1;
  30. mes "[" + @name$ + "]";
  31. mes "Do you want me to melt your body with blazing heat...?";
  32. emotion 6;
  33. goto M_Menu;
  34. //Left Hand
  35. PART3:
  36. set @part,3;
  37. // if (getequipisequiped(3)) goto CHECK1;
  38. mes "[" + @name$ + "]";
  39. mes "I can't make your left hand into an ultimate weapon...";
  40. emotion 4;
  41. goto M_Menu;
  42. //Right Hand
  43. PART4:
  44. set @part,4;
  45. // if (getequipisequiped(4)) goto CHECK1;
  46. mes "[" + @name$ + "]";
  47. mes "I can't make your right hand into an ultimate weapon...";
  48. emotion 4;
  49. goto M_Menu;
  50. //Garment
  51. PART5:
  52. set @part,5;
  53. // if (getequipisequiped(5)) goto CHECK1;
  54. mes "[" + @name$ + "]";
  55. mes "Look here... you don't have any Garments on...";
  56. goto M_Menu;
  57. //Foot Gear
  58. PART6:
  59. set @part,6;
  60. // if (getequipisequiped(6)) goto CHECK1;
  61. mes "[" + @name$ + "]";
  62. mes "Ack!! Those are some stinky feet. I definitely can't refine those... uck!!";
  63. emotion 16;
  64. goto M_Menu;
  65. //Accessory1
  66. PART7:
  67. set @part,7;
  68. // if (getequipisequiped(7)) goto CHECK1;
  69. mes "[" + @name$ + "]";
  70. mes "What do you mean by Accessory? Which One?";
  71. emotion 20;
  72. goto M_Menu;
  73. //Accessory2
  74. PART8:
  75. set @part,8;
  76. // if (getequipisequiped(8)) goto CHECK1;
  77. mes "[" + @name$ + "]";
  78. mes "What do you mean by Accessory? Which One?";
  79. emotion 20;
  80. goto M_Menu;
  81. PART9:
  82. set @part,9;
  83. // if (getequipisequiped(9)) goto CHECK1;
  84. mes "[" + @name$ + "]";
  85. mes "What do you want from me? There's nothing equipped there...";
  86. emotion 20;
  87. goto M_Menu;
  88. PART10:
  89. set @part,10;
  90. // if (getequipisequiped(10)) goto CHECK1;
  91. mes "[" + @name$ + "]";
  92. mes "What do you want from me? There's nothing equipped there...";
  93. emotion 20;
  94. goto M_Menu;
  95.  
  96. //Check if the item is refinable...
  97. CHECK1:
  98. if(getequipisenableref(@part)) goto CHECK2;
  99. mes "[" + @name$ + "]";
  100. mes "I can't work on this item...";
  101. close;
  102.  
  103. //Check if the item is identified... (Don't know why this is in here... but kept it anyway)
  104. CHECK2:
  105. // if(getequipisidentify(@part)) goto CHECK3;
  106. mes "[" + @name$ + "]";
  107. mes "You must appraise this item first.";
  108. close;
  109.  
  110. //Check to see if the items is already +10
  111. CHECK3:
  112. // if(getequiprefinerycnt(@part) < 10) goto REFINE0;
  113. mes "[" + @name$ + "]";
  114. mes "This weapon is already at its maximum level and can no longer be refined.";
  115. close;
  116.  
  117. //Refine Armor
  118. REFINE0:
  119. set @refineitemid, getequipid(@part); // save id of the item
  120. set @refinerycnt, getequiprefinerycnt(@part); //save refinery count
  121. if(getequipweaponlv(@part) > 0) goto REFINE1;
  122. set @matname$,"Elunium";
  123. set @material,985;
  124. set @price,2000;
  125. set @safe,4;
  126. if(@features == 1) goto L_refinefeatures;
  127. goto L_refinenormal;
  128. //Refine Level 1 Weapon
  129. REFINE1:
  130. if(getequipweaponlv(@part) > 1) goto REFINE2;
  131. set @matname$,"Phracon";
  132. set @material,1010;
  133. set @price,50;
  134. set @safe,7;
  135. if(@features == 1) goto L_refinefeatures;
  136. goto L_refinenormal;
  137. //Refine Level 2 Weapon
  138. REFINE2:
  139. if(getequipweaponlv(@part) > 2) goto REFINE3;
  140. set @matname$,"Emveretarcon";
  141. set @material,1011;
  142. set @price,200;
  143. set @safe,6;
  144. if(@features == 1) goto L_refinefeatures;
  145. goto L_refinenormal;
  146. //Refine Level 3 Weapon
  147. REFINE3:
  148. if(getequipweaponlv(@part) > 3) goto REFINE4;
  149. set @matname$,"Oridecon";
  150. set @material,984;
  151. set @price,5000;
  152. set @safe,5;
  153. if(@features == 1) goto L_refinefeatures;
  154. goto L_refinenormal;
  155. //Refine Level 4 Weapon
  156. REFINE4:
  157. set @matname$,"Oridecon";
  158. set @material,984;
  159. set @price,20000;
  160. set @safe,4;
  161. if(@features == 1) goto L_refinefeatures;
  162. goto L_refinenormal;
  163.  
  164. L_refinenormal:
  165. mes "[" + @name$ + "]";
  166. mes "To refine this stuff, I need ^ff9999" + @matname$ + "^000000 and the fee " + @price + " Zeny.";
  167. mes "Continue?";
  168. next;
  169. menu "Yes",-,"No",Lcancel;
  170.  
  171. if (getequippercentrefinery(@part) == 100) goto L_Sub;
  172. mes "[" + @name$ + "]";
  173. mes "Hmm... Hold on! This piece of equipment has already been refined to its maximum safety level.";
  174. mes "I must warn you if it is refined ANYMORE, It could be DESTROYED and become USELESS!!";
  175. next;
  176. mes "["+@name$+"]";
  177. mes "Do you still wish you refine it? If so I will not be able to guarantee my work...";
  178. next;
  179. menu "Yes",-,"No",Lcancel1;
  180.  
  181. L_Sub:
  182. if ((countitem(@material) < 1) || (Zeny < @price)) goto Lcancel2;
  183. set Zeny,Zeny-@price;
  184. delitem @material,1;
  185.  
  186. Lrefine:
  187. if (getequipisequiped(@part) == 0) goto LNoItem; // hacker has removed the item (not changed, why?)
  188. if (getequipid(@part) != @refineitemid) goto LNoFake; // hacker has changed the item
  189. if (getequiprefinerycnt(@part) != @refinerycnt) goto LNoFake; // hacker has changed the item
  190. if (getequippercentrefinery(@part) <= rand(100)) goto Lfail;
  191. mes "["+@name$+"]";
  192. mes "Clang! Clang! Clang!";
  193. successrefitem @part;
  194. next;
  195. mes "["+@name$+"]";
  196. mes "HAHA! It seems my skills haven't gotten rusty yet! Splendid... just splendid...";
  197. emotion 21;
  198. close;
  199.  
  200. Lfail:
  201. mes "[" + @name$ + "]";
  202. mes "Clang! Clang! Clang!";
  203. failedrefitem @part;
  204. next;
  205. mes "["+@name$+"]";
  206. mes "Aaahhh!! Oh no...!!";
  207. emotion 16;
  208. next;
  209. mes "["+@name$+"]";
  210. mes "Eh..Ehem... I'm sorry but the refining process ^ff0000failed^000000.";
  211. next;
  212. mes "["+@name$+"]";
  213. mes "I am deeply ashamed of what I've done... but I DID warn you earlier about the risks.";
  214. close;
  215.  
  216. LNoItem:
  217. mes "[" + @name$ + "]";
  218. mes "Look here... you don't have any Items on...";
  219. close;
  220.  
  221. LNoFake:
  222. mes "[" + @name$ + "]";
  223. mes "Clan... No, but Did you imagine I could be so stupid !?!";
  224. mes "You have changed it...";
  225. mes "Go out before I stun you with my Hammer!!!";
  226. close;
  227.  
  228. Lcancel:
  229. mes "[" + @name$ + "]";
  230. mes "You said so..Hmm so be it...";
  231. close;
  232.  
  233. Lcancel1:
  234. mes "[" + @name$ + "]";
  235. mes "Good Choice.";
  236. mes "Ah... good choice. I'd feel awful if I'd destroyed another persons piece of equipment with my own hands.";
  237. close;
  238.  
  239. Lcancel2:
  240. mes "[" + @name$ + "]";
  241. mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
  242. close;
  243.  
  244. // New Refining Functions ========================
  245. L_refinefeatures:
  246. if(getequiprefinerycnt(@part) >= @safe) goto Lnosafe;
  247. mes "[" + @name$ + "]";
  248. mes "I can refine this to the safe limit or a desired number of times... it's your choice...";
  249. next;
  250. menu "To the safe limit please.",Lsafe,"I'll decide how many times.",Lnosafe,"I've changed my mind...",Lcancel;
  251.  
  252. Lsafe:
  253. set @refinecnt,@safe - getequiprefinerycnt(@part);
  254. set @fullprice,@price * @refinecnt;
  255. mes "[" + @name$ + "]";
  256. mes "That will cost you " + @refinecnt + " " + @matname$ + " and " + @fullprice + " Zeny. Is that ok?";
  257. next;
  258. menu "Yes",-,"No...",Lcancel;
  259. if((countitem(@material) < @refinecnt) || (Zeny < @fullprice)) goto Lcancel2;
  260. set Zeny,Zeny - @fullprice;
  261. delitem @material,@refinecnt;
  262. goto L_refinesafe;
  263.  
  264. Lnosafe:
  265. mes "[" + @name$ + "]";
  266. mes "So how many times would you like me to refine your item?";
  267. next;
  268. input @refinecnt;
  269. if (@refinecnt<1) goto Lcancel3; //fixed by Lupus
  270. set @refinecheck,@refinecnt + getequiprefinerycnt(@part);
  271. if(@refinecheck > 10) goto Lcancel3;
  272. set @fullprice,@price * @refinecnt;
  273. mes "[" + @name$ + "]";
  274. mes "This will cost you " + @refinecnt + " " + @matname$ + " and " + @fullprice + " Zeny... Is that ok?";
  275. next;
  276. menu "Yes...",-,"No...",Lcancel;
  277. if(@refinecheck > @safe) goto Lwarn;
  278. if((countitem(@material) < @refinecnt) || (Zeny < @fullprice)) goto Lcancel2;
  279. set Zeny,Zeny - @fullprice;
  280. delitem @material,@refinecnt;
  281. goto L_refinenumber;
  282. end;
  283.  
  284. Lwarn:
  285. set @refinecheck,@refinecheck - @safe;
  286. mes "[" + @name$ + "]";
  287. mes "This will try to refine the equipment " + @refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?";
  288. next;
  289. menu "Yes",-,"No...",Lcancel1;
  290. if((countitem(@material) < @refinecnt) || (Zeny < @fullprice)) goto Lcancel2;
  291. set Zeny,Zeny - @fullprice;
  292. delitem @material,@refinecnt;
  293. goto L_refinenumber;
  294.  
  295. Lcancel3:
  296. mes "[" + @name$ + "]";
  297. mes "I can't refine this item that many times.";
  298. close;
  299.  
  300. // SubFunction: Safe Refine ---------------------
  301. L_refinesafe:
  302. if (getequipisequiped(@part) == 0) goto LNoItem; // hacker has removed the item (no changed, why?)
  303. if (getequipid(@part) != @refineitemid) goto LNoFake; // hacker has changed the item
  304. if (getequippercentrefinery(@part) < 100) goto LNoFake; // hacker has changed the item (it is not safe anymore)
  305. mes "Clang, clang!!!";
  306. successrefitem @part;
  307. emotion 21;
  308. set @refinecnt,@refinecnt - 1;
  309. next;
  310. if(@refinecnt == 0) goto Lend;
  311. goto L_refinesafe;
  312.  
  313. Lend:
  314. mes "[" + @name$ + "]";
  315. mes "All finished... Come again soon.";
  316. close;
  317.  
  318. // SubFunction: Refine
  319. L_refinenumber:
  320. if (getequipisequiped(@part) == 0) goto LNoItem; // hacker has removed the item (no changed, why?)
  321. if (getequipid(@part) != @refineitemid) goto LNoFake; // hacker has changed the item
  322. mes "Clang, clang!!!";
  323. if (getequippercentrefinery(@part)<=rand(100)) goto Lfail_number;
  324. successrefitem @part;
  325. emotion 21;
  326. set @refinecnt,@refinecnt - 1;
  327. next;
  328. if(@refinecnt == 0) goto Lend;
  329. goto L_refinenumber;
  330.  
  331. Lfail_number:
  332. failedrefitem @part;
  333. emotion 23;
  334. mes "[" + @name$ + "]";
  335. mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
  336. set @refinecnt,@refinecnt - 1;
  337. if(@refinecnt == 0) goto Lend2;
  338. mes "Here's the unused Zeny and Material back...";
  339. getitem @material,@refinecnt;
  340. set @fullprice,@refinecnt * @price;
  341. set Zeny,Zeny + @fullprice;
  342.  
  343. Lend2:
  344. close;
  345. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement