socket_enchant2.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. //===== rAthena Script =======================================
  2. //= Episode 12 Socket Enchant NPC
  3. //===== By: ==================================================
  4. //= Gepard
  5. //===== Current Version: =====================================
  6. //= 1.1a
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Adds slots to selected weapons and armor.
  12. //===== Additional Comments: =================================
  13. //= 1.0 First version.
  14. //= 1.1 Duplicates now spawn from floating NPCs. [L0ne_W0lf]
  15. //= 1.1a Added 'disable_items' command. [Euphy]
  16. //============================================================
  17. - script Leablem#dummy::SocketEnchant2 -1,{
  18. if (checkweight(1201,1) == 0)
  19. {
  20. mes "- Wait a minute !! -";
  21. mes "- Currently you're carrying -";
  22. mes "- too many items with you. -";
  23. mes "- Please try again -";
  24. mes "- after you lose some weight. -";
  25. close;
  26. }
  27. mes "[Leablem]";
  28. mes "Good day. My name is Leablem,";
  29. mes "and I'm a technician that specializes in";
  30. mes "adding slots to weapons and armors.";
  31. mes "It can be very hard sometimes, but I like";
  32. mes "what I do, and take pride in it.";
  33. next;
  34. mes "[Leablem]";
  35. mes "I've learned most of the things from my brother, Seyablem,";
  36. mes "but I think I still have a lot to learn.";
  37. mes "So please understand my slotting services are limited,";
  38. mes "unlike my brother Seyablem.";
  39. next;
  40. mes "[Leablem]";
  41. mes "My brother wasn't so happy to teach me";
  42. mes "his skills because he was worried that his skills";
  43. mes "wouldn't be unique anymore. He did, however, his best";
  44. mes "to teach me.";
  45. next;
  46. mes "[Leablem]";
  47. mes "Thanks to him, I've learned lots of things.";
  48. mes "I'm not very confident";
  49. mes "in trying many different things,";
  50. mes "but I'll do what";
  51. mes "I can do for now.";
  52. next;
  53. mes "[Leablem]";
  54. mes "In fact, there's one thing";
  55. mes "that my brother doesn't want me to do.";
  56. mes "I don't want to upset him, so...let's just skip that part.";
  57. mes "I'll say no more about it!";
  58. next;
  59. mes "[Leablem]";
  60. mes "Anyways, do you have any equipment";
  61. mes "which you'd like to add to the slots?";
  62. mes "My service charge, the materials,";
  63. mes "and the success chance all depend on";
  64. mes "the specific item I'm working on.";
  65. next;
  66. switch(select("Weapon:Armor:About that thing you skipped:More information:Quit"))
  67. {
  68. case 1:
  69. mes "[Leablem]";
  70. mes "Weapon, you said? Sure, no problem.";
  71. mes "Weapons are divided into 4 different class";
  72. mes "depending on the work difficulty.";
  73. mes "C class is the easiest one, and S class is the hardest one.";
  74. mes "Which class would you like to try?";
  75. next;
  76. switch(select("C:B:A:S"))
  77. {
  78. case 1:
  79. mes "[Leablem]";
  80. mes "C class, I see.";
  81. mes "So, what kind of weapon do you have?";
  82. next;
  83. switch(select("Book of Mother Earth:Book of Billows:Book of Gust of Wind:Book of the Blazing Sun"))
  84. {
  85. case 1: callfunc "Func_Socket2",1554,1569,40,66,200,1010,10;
  86. case 2: callfunc "Func_Socket2",1553,1568,40,66,200,1010,10;
  87. case 3: callfunc "Func_Socket2",1556,1571,40,66,200,1010,10;
  88. case 4: callfunc "Func_Socket2",1555,1570,40,66,200,1010,10;
  89. }
  90. case 2:
  91. mes "[Leablem]";
  92. mes "You have chosen average B class.";
  93. mes "So, what kind of weapon do you have?";
  94. next;
  95. switch(select("Orcish Axe:Scimiter:Spike"))
  96. {
  97. case 1: callfunc "Func_Socket2",1304,1309,40,66,200,984,1;
  98. case 2: callfunc "Func_Socket2",1113,1114,40,66,200,984,1;
  99. case 3: callfunc "Func_Socket2",1523,1538,40,61,300,984,1;
  100. }
  101. case 3:
  102. mes "[Leablem]";
  103. mes "A class? You seem to want little too much. But, no problem.";
  104. mes "So, what kind of weapon do you have?";
  105. next;
  106. switch(select("Dragon Killer:Katar of Quaking:Katar of Raging Blaze:Katar of Frozen Icicle:Katar of Piercing Wind:Golden Mace:Oriental Lute:Queen's Whip:Spectral Spear:Gae Bolg:Schweizersabel"))
  107. {
  108. case 1: callfunc "Func_Socket2",13001,13030,40,61,500,984,2;
  109. case 2: callfunc "Func_Socket2", 1257, 1276,40,66,500,984,2;
  110. case 3: callfunc "Func_Socket2", 1258, 1277,40,66,500,984,2;
  111. case 4: callfunc "Func_Socket2", 1256, 1275,40,66,500,984,2;
  112. case 5: callfunc "Func_Socket2", 1259, 1278,40,66,500,984,2;
  113. case 6: callfunc "Func_Socket2", 1524, 1539,40,61,500,984,2;
  114. case 7: callfunc "Func_Socket2", 1918, 1922,40,61,500,984,2;
  115. case 8: callfunc "Func_Socket2", 1970, 1976,40,61,500,984,2;
  116. case 9: callfunc "Func_Socket2", 1477, 1479,40,56,500,984,2;
  117. case 10: callfunc "Func_Socket2", 1474, 1480,40,56,500,984,2;
  118. case 11: callfunc "Func_Socket2", 1167, 1178,40,61,500,984,2;
  119. }
  120. case 4:
  121. mes "[Leablem]";
  122. mes "Huh, S Class?! Oh my god, are you serious?*Tremble*";
  123. mes "So...which S class weapon would you like to make a slot?!";
  124. next;
  125. switch(select("Zephyrus:Mailbreaker:Dragon Slayer:Swordbreaker:Assasin Dagger:Grand Cross:Executioner"))
  126. {
  127. case 1: callfunc "Func_Socket2",1468, 1481,40,51,1000,984,5,999,10;
  128. case 2: callfunc "Func_Socket2",1225,13032,40,51,1000,984,5,999,10;
  129. case 3: callfunc "Func_Socket2",1166, 1180,40,51,1000,984,5,999,10;
  130. case 4: callfunc "Func_Socket2",1224,13031,40,51,1000,984,5,999,10;
  131. case 5: callfunc "Func_Socket2",1232,13033,40,51,1000,984,5,999,10;
  132. case 6: callfunc "Func_Socket2",1528, 1540,40,51,1000,984,5,999,10;
  133. case 7: callfunc "Func_Socket2",1169, 1179,40,51,1000,984,5,999,10;
  134. }
  135. }
  136. case 2:
  137. mes "[Leablem]";
  138. mes "Armor, you said? Sure, no problem.";
  139. mes "Armors are divided into 4 different class";
  140. mes "depending on the work difficulty.";
  141. mes "C class is the easiest one, and S class is the hardest one.";
  142. mes "Which class would you like to try?";
  143. next;
  144. switch(select("C:B:A:S"))
  145. {
  146. case 1:
  147. mes "[Leablem]";
  148. mes "C class, I see.";
  149. mes "So, what kind of armor do you have?";
  150. next;
  151. switch(select("Sunflower:Ph.D Hat:Big Ribbon:Boys Cap"))
  152. {
  153. case 1: callfunc "Func_Socket2",2253,5351,40,66,100,999,3;
  154. case 2: callfunc "Func_Socket2",5012,5347,40,66,100,999,3;
  155. case 3: callfunc "Func_Socket2",2244,5348,40,66,100,999,5;
  156. case 4: callfunc "Func_Socket2",5016,5349,40,66,100,999,5;
  157. }
  158. case 2:
  159. mes "[Leablem]";
  160. mes "You have chosen average B class.";
  161. mes "So, what kind of armor do you have?";
  162. next;
  163. switch(select("Skull Ring:High Heels"))
  164. {
  165. case 1: callfunc "Func_Socket2",2609,2715,40,61,300,999,5;
  166. case 2: callfunc "Func_Socket2",2409,2432,40,61,300,999,5;
  167. }
  168. case 3:
  169. mes "[Leablem]";
  170. mes "A class? You seem to want little too much. But, no problem.";
  171. mes "So, what kind of armor do you have?";
  172. next;
  173. switch(select("Pirate Bandana:Black Leather Boots"))
  174. {
  175. case 1: callfunc "Func_Socket2",2287,5350,50,61,500,985,1; // 50,61 - it's not a typo
  176. case 2: callfunc "Func_Socket2",2425,2434,40,51,500,985,1;
  177. //case 3: callfunc "Func_Socket2",15053,15056,x,x,x,x,x; // Special Ninja Suit (Needs more info)
  178. }
  179. case 4:
  180. mes "[Leablem]";
  181. mes "Huh, S Class?! Oh my god, are you serious?*Tremble*";
  182. mes "So...which S class armor would you like to make a slot?!";
  183. next;
  184. switch(select("Mage Coat:Holy Robe:Sacred Mission:Undershirt:Pantie"))
  185. {
  186. case 1: callfunc "Func_Socket2",2334,2372,40,51,1000,985,1; // Mage Coat has 10% success chance
  187. case 2: callfunc "Func_Socket2",2327,2373,45,51,1000,985,1; // the rest has 5%
  188. case 3: callfunc "Func_Socket2",2111,2128,45,51,1000,985,1;
  189. case 4: callfunc "Func_Socket2",2522,2523,45,51,1000,985,1;
  190. case 5: callfunc "Func_Socket2",2339,2371,45,51,1000,985,1;
  191. }
  192. }
  193. case 3:
  194. mes "[Leablem]";
  195. mes "Oh, it's nothing special, but he thinks";
  196. mes "it's not something for humans to mess with. ";
  197. mes "I don't want to upset my brother,";
  198. mes "so I'd better forget about it.";
  199. next;
  200. mes "[Leablem]";
  201. mes "...That service itself has a very high success chance,";
  202. mes "but requires a lot of materials and a high-rate service charge.";
  203. mes "I highly doubt that anyone would actually want to use";
  204. mes "the service, even if I did open it.";
  205. next;
  206. mes "[Leablem]";
  207. mes "...Ummm...";
  208. next;
  209. mes "[Leablem]";
  210. mes ".............";
  211. next;
  212. mes "[Leablem]";
  213. mes ".............";
  214. next;
  215. mes "[Leablem]";
  216. mes "You seem interested in using that service.";
  217. mes "If you want, I can at least tell you about it.";
  218. mes "But you must promise to keep this a secret.";
  219. mes "If my brother finds out what I'm about to tell you,";
  220. mes "he's gonna give me a beating!";
  221. next;
  222. mes "[Leablem]";
  223. mes "This special service has a 90% success chance,";
  224. mes "but requires 2 Gold and 2 hundred million zeny:";
  225. mes "I can add slots to the Hat of the Sun God.";
  226. next;
  227. mes "[Leablem]";
  228. mes "My brother said that, even since ancient times, it's forbidden to modify that hat.";
  229. mes "But I believe humans are too curious not to";
  230. mes "experiment, especially when it's forbidden.";
  231. mes "I just don't want my brother to yell at me. That's all.";
  232. next;
  233. switch(select("Use the Service","Quit"))
  234. {
  235. case 1:
  236. mes "[Leablem]";
  237. mes ".................";
  238. next;
  239. mes "[Leablem]";
  240. mes ".................";
  241. next;
  242. mes "[Leablem]";
  243. mes "...Wh... What? No!";
  244. mes "Giving me that dirty look";
  245. mes "won't make me do it!";
  246. mes "No, I said no! No is no! No!";
  247. next;
  248. mes "[Leablem]";
  249. mes "No, I won't! No!";
  250. next;
  251. mes "[Leablem]";
  252. mes "I can't do it...";
  253. next;
  254. mes "[Leablem]";
  255. mes "I can't do... It...";
  256. next;
  257. mes "[Leablem]";
  258. mes ".................";
  259. next;
  260. mes "[Leablem]";
  261. mes "Umm...";
  262. next;
  263. mes "[Leablem]";
  264. mes "You're so persistent. Okay, I'll make you an exception.";
  265. mes "Just don't tell anyone,";
  266. mes "especially my brother. Do you promise?";
  267. next;
  268. mes "[Leablem]";
  269. mes "Okay then, please bring me";
  270. mes "^FF00002 Gold, 2 hundred million zeny -- the service charge --,";
  271. mes "^FF0000and a Hat of the Sun God.";
  272. mes "^FF0000You know your chance of success is 90% with this, don't you?^000000";
  273. mes "We don't have time to waste,";
  274. mes "so let's get down to business right away.";
  275. next;
  276. if ((Zeny > 199999999) && (countitem(969) > 1) && (countitem(5022) > 0))
  277. {
  278. mes "[Leablem]";
  279. mes "Shall we start now?";
  280. mes "Pray to your gods for good luck.";
  281. next;
  282. set .@a, rand(1,100);
  283. if ((.@a > 4) && (.@a < 95))
  284. {
  285. specialeffect EF_LORD;
  286. mes "[Leablem]";
  287. mes "Excellent! Wow, I guess the 90% success chance is true!";
  288. mes "Look, the slot was added in the perfect place.";
  289. mes "Congratulations.";
  290. delitem 5022,1; //Helm_Of_Sun
  291. delitem 969,2; //Gold
  292. set Zeny, Zeny - 200000000;
  293. getitem 5353,1; //Helm_Of_Sun_
  294. next;
  295. mes "[Leablem]";
  296. mes "This is the first and last time I will do this for you.";
  297. mes "Don't ever tell anyone";
  298. mes "about this. Okay?";
  299. close;
  300. }
  301. else
  302. {
  303. specialeffect EF_SUI_EXPLOSION;
  304. mes "[Leablem]";
  305. mes "Wah! Oh my god, we failed!";
  306. mes "My god, I guess we had the worst kind of luck...";
  307. mes "What should we do? ...This is why";
  308. mes "I didn't want to do in the first place!";
  309. delitem 5022,1; //Helm_Of_Sun
  310. delitem 969,2; //Gold
  311. set Zeny, Zeny - 200000000;
  312. next;
  313. mes "[Leablem]";
  314. mes "No, don't ever ask me to do such a risky thing again!";
  315. mes "Bah~";
  316. close;
  317. }
  318. }
  319. else
  320. {
  321. mes "[Leablem]";
  322. mes "Umm...";
  323. next;
  324. mes "[Leablem]";
  325. mes "You don't have enough materials.";
  326. mes "Man, why did you even ask me to try?";
  327. mes "I'm not going to do this again for you,";
  328. mes "even if you bring enough materials. Bah~";
  329. close;
  330. }
  331. case 2:
  332. mes "[Leablem]";
  333. mes "Don't ever tell anyone";
  334. mes "about what I told you. Okay?";
  335. close;
  336. }
  337. case 4:
  338. mes "[Leablem]";
  339. mes "Do you want to know more information?";
  340. mes "Well, I don't think there's something";
  341. mes "that you specifically need to know.";
  342. mes "But I can at least give you a tip.";
  343. next;
  344. mes "[Leablem]";
  345. mes "The slot technicians in each town";
  346. mes "provide different slotting success chances";
  347. mes "depending on your equipment's upgrade level.";
  348. mes "I don't know if that's true,";
  349. mes "but I can see the difference in each town.";
  350. next;
  351. mes "[Leablem]";
  352. mes "For instance, a slot technician in one town";
  353. mes "provides a higher success chance to";
  354. mes "equipment items at higher upgrade levels,";
  355. mes "while a technician in another town has higher";
  356. mes "success at lower upgrade levels.";
  357. next;
  358. mes "[Leablem]";
  359. mes "When you fail to add a slot, the equipment";
  360. mes "will become broken and disappear.";
  361. mes "I try my best to succeed, but";
  362. mes "slotting is complicated work.";
  363. next;
  364. mes "[Leablem]";
  365. mes "Oh, there's an important thing that you need to be careful about.";
  366. mes "^FF0000Try not to carry two identical equipment items";
  367. mes "^FF0000with you when you add slots.";
  368. mes "^FF0000Otherwise, slots may be added to one of the randomly chosen items,";
  369. mes "^FF0000and in the worst case, you may lose an item that is more valuable to you.^000000";
  370. next;
  371. mes "[Leablem]";
  372. mes "I hope this information will be helpful to you.";
  373. mes "Thanks.";
  374. close;
  375. case 5:
  376. mes "[Leablem]";
  377. mes "Alright, then.";
  378. close;
  379. }
  380. }
  381. payon,236,199,3 duplicate(SocketEnchant2) Leablem#pay 86
  382. lighthalzen,96,137,3 duplicate(SocketEnchant2) Leablem#lhz 86
  383. prt_in,22,60,6 duplicate(SocketEnchant2) Leablem#prt 86
  384. function script Func_Socket2 {
  385. .@item_id = getarg(0);
  386. .@zeny_req = getarg(4);
  387. setarray .@item_req[0], getarg(5), getarg(7,0);
  388. setarray .@req_amount[0], getarg(6), getarg(8,0);
  389. disable_items;
  390. mes "[Leablem]";
  391. if (.@item_req[1] != 0 && .@req_amount[1] != 0)
  392. {
  393. mes getitemname(.@item_id) +"... Okay, then you need to bring me";
  394. mes "^FF0000"+ (.@zeny_req >= 1000 ? (.@zeny_req /1000 +",000") : .@zeny_req) +",000 zeny as service charge,";
  395. mes "^FF0000"+ .@req_amount[0] +"ea "+ getitemname(.@item_req[0]) +" and "+ .@req_amount[1] +"ea "+ getitemname(.@item_req[1]) +".";
  396. mes "^FF0000Of course, you need a "+ getitemname(.@item_id) +".^000000";
  397. }
  398. else
  399. {
  400. mes getitemname(.@item_id) +"? Okay, then you need to bring me";
  401. mes "^FF0000"+ (.@zeny_req >= 1000 ? (.@zeny_req/1000 +",000") : .@zeny_req) +",000 zeny as service charge and "+ .@req_amount[0] +" "+ getitemname(.@item_req[0]) + (.@req_amount[0] > 1 && .@item_req[0] != 999 ? "s":"") +" as the requirement.";
  402. mes "^FF0000Of course, don't forget to bring me a "+ getitemname(.@item_id) +".";
  403. mes "^FF0000You should have all items.^000000";
  404. }
  405. next;
  406. mes "[Leablem]";
  407. mes "Did you already bring all of them?";
  408. mes "For your information, if you fail to create a slot,";
  409. mes "you will lose all the item requirement as well as the target "+ ((getiteminfo(.@item_id, ITEMINFO_LOCATIONS)&EQP_HAND_R) ? "weapon" : "armor") +".";
  410. mes "Also remember, if the "+ ((getiteminfo(.@item_id, ITEMINFO_LOCATIONS)&EQP_HAND_R) ? "weapon" : "armor") +" has been upgraded, and has been inserted with a card,";
  411. mes "you will lose them even if you succeed in creating a slot.";
  412. next;
  413. switch(select("Ask for slot creation.:Try next time."))
  414. {
  415. case 1:
  416. if ((Zeny >= .@zeny_req*1000) && countitem(.@item_req[0]) >= .@req_amount[0] && countitem(getarg(7,512)) >= .@req_amount[1] && countitem(.@item_id) > 0)// if there's no .@req_amount[0] and .@req_amount[1] provided, check itemcount against 0 (we still need a valid item ID though)
  417. {
  418. mes "[Leablem]";
  419. mes "Alright then, let the work begin!";
  420. mes "You'd better pray for a successful result.";
  421. next;
  422. set .@a, rand(1,100);
  423. if ((.@a > getarg(2)) && (.@a < getarg(3)))
  424. {
  425. specialeffect EF_LORD;
  426. mes "[Leablem]";
  427. mes "Great, it seems to be successful.";
  428. mes "It looks pretty well done. Congratulations!";
  429. delitem .@item_id,1;
  430. delitem .@item_req[0],.@req_amount[0];
  431. if (.@item_req[1] != 0 && .@req_amount[1] != 0)
  432. delitem .@item_req[1],.@req_amount[1];
  433. Zeny = Zeny - .@zeny_req *1000;
  434. getitem getarg(1),1;
  435. next;
  436. mes "[Leablem]";
  437. mes "See you again, buddy!";
  438. close;
  439. }
  440. else
  441. {
  442. specialeffect EF_SUI_EXPLOSION;
  443. mes "[Leablem]";
  444. mes "Wah! ...I am so sorry, it failed.";
  445. mes "However, I am completely innocent.";
  446. mes "This is your luck, and it is destined by god, okay?";
  447. mes "Don't be so disappointed,";
  448. mes "and try next time.";
  449. delitem .@item_id,1;
  450. delitem .@item_req[0],.@req_amount[0];
  451. if (.@item_req[1] != 0 && .@req_amount[1] != 0)
  452. delitem .@item_req[1],.@req_amount[1];
  453. Zeny = Zeny - .@zeny_req *1000;
  454. next;
  455. mes "[Leablem]";
  456. mes "See you again, buddy!";
  457. close;
  458. }
  459. }
  460. else
  461. {
  462. mes "[Leablem]";
  463. mes "Are you stupid or what? You didn't bring all of the required items!";
  464. mes "Go bring them quick!";
  465. close;
  466. }
  467. case 2:
  468. mes "[Leablem]";
  469. mes "See you next time.";
  470. close;
  471. }
  472. }