socket_enchant2.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  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 "Weapons 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. }
  178. case 4:
  179. mes "[Leablem]";
  180. mes "Huh, S Class?! Oh my god, are you serious?*Tremble*";
  181. mes "So...which S class armor would you like to make a slot?!";
  182. next;
  183. switch(select("Mage Coat:Holy Robe:Sacred Mission:Undershirt:Pantie"))
  184. {
  185. case 1: callfunc "Func_Socket2",2334,2372,40,51,1000,985,1; // Mage Coat has 10% success chance
  186. case 2: callfunc "Func_Socket2",2327,2373,45,51,1000,985,1; // the rest has 5%
  187. case 3: callfunc "Func_Socket2",2111,2128,45,51,1000,985,1;
  188. case 4: callfunc "Func_Socket2",2522,2523,45,51,1000,985,1;
  189. case 5: callfunc "Func_Socket2",2339,2371,45,51,1000,985,1;
  190. }
  191. }
  192. case 3:
  193. mes "[Leablem]";
  194. mes "Oh, it's nothing special, but he thinks";
  195. mes "it's not something for humans to mess with. ";
  196. mes "I don't want to upset my brother,";
  197. mes "so I'd better forget about it.";
  198. next;
  199. mes "[Leablem]";
  200. mes "...That service itself has a very high success chance,";
  201. mes "but requires a lot of materials and a high-rate service charge. ";
  202. mes "I highly doubt that anyone would actually want to use";
  203. mes "the service, even if I did open it.";
  204. next;
  205. mes "[Leablem]";
  206. mes "...Ummm...";
  207. next;
  208. mes "[Leablem]";
  209. mes ".............";
  210. next;
  211. mes "[Leablem]";
  212. mes ".............";
  213. next;
  214. mes "[Leablem]";
  215. mes "You seem interested in using that service.";
  216. mes "If you want, I can at least tell you about it. ";
  217. mes "But you must promise to keep this a secret.";
  218. mes "If my brother finds out what I'm about to tell you,";
  219. mes "he's gonna give me a beating!";
  220. next;
  221. mes "[Leablem]";
  222. mes "This special service has a 90% success chance,";
  223. mes "but requires 2 Gold and 2 hundred million zeny:";
  224. mes "I can add slots to the Hat of the Sun God.";
  225. next;
  226. mes "[Leablem]";
  227. mes "My brother said that, even since ancient times, it's forbidden to modify that hat. ";
  228. mes "But I believe humans are too curious not to";
  229. mes "experiment, especially when it's forbidden.";
  230. mes "I just don't want my brother to yell at me. That's all.";
  231. next;
  232. switch(select("Use the Service","Quit"))
  233. {
  234. case 1:
  235. mes "[Leablem]";
  236. mes ".................";
  237. next;
  238. mes "[Leablem]";
  239. mes ".................";
  240. next;
  241. mes "[Leablem]";
  242. mes "...Wh... What? No!";
  243. mes "Giving me that dirty look";
  244. mes "won't make me do it!";
  245. mes "No, I said no! No is no! No!";
  246. next;
  247. mes "[Leablem]";
  248. mes "No, I won't! No!";
  249. next;
  250. mes "[Leablem]";
  251. mes "I can't do it...";
  252. next;
  253. mes "[Leablem]";
  254. mes "I can't do... It...";
  255. next;
  256. mes "[Leablem]";
  257. mes ".................";
  258. next;
  259. mes "[Leablem]";
  260. mes "Umm...";
  261. next;
  262. mes "[Leablem]";
  263. mes "You're so persistent. Okay, I'll make you an exception.";
  264. mes "Just don't tell anyone,";
  265. mes "especially my brother. Do you promise?";
  266. next;
  267. mes "[Leablem]";
  268. mes "Okay then, please bring me";
  269. mes "^FF00002 Gold, 2 hundred million zeny -- the service charge --,";
  270. mes "^FF0000and a Hat of the Sun God.";
  271. mes "^FF0000You know your chance of success is 90% with this, don't you?^000000";
  272. mes "We don't have time to waste,";
  273. mes "so let's get down to business right away.";
  274. next;
  275. if ((Zeny > 199999999) && (countitem(969) > 1) && (countitem(5022) > 0))
  276. {
  277. mes "[Leablem]";
  278. mes "Shall we start now?";
  279. mes "Pray to your gods for good luck.";
  280. next;
  281. set .@a, rand(1,100);
  282. if ((.@a > 4) && (.@a < 95))
  283. {
  284. specialeffect EF_LORD;
  285. mes "[Leablem]";
  286. mes "Excellent! Wow, I guess the 90% success chance is true!";
  287. mes "Look, the slot was added in the perfect place.";
  288. mes "Congratulations.";
  289. delitem 5022,1; //Helm_Of_Sun
  290. delitem 969,2; //Gold
  291. set Zeny, Zeny - 200000000;
  292. getitem 5353,1; //Helm_Of_Sun_
  293. next;
  294. mes "[Leablem]";
  295. mes "This is the first and last time I will do this for you.";
  296. mes "Don't ever tell anyone";
  297. mes "about this. Okay?";
  298. close;
  299. }
  300. else
  301. {
  302. specialeffect EF_SUI_EXPLOSION;
  303. mes "[Leablem]";
  304. mes "Wah! Oh my god, we failed!";
  305. mes "My god, I guess we had the worst kind of luck...";
  306. mes "What should we do? ...This is why";
  307. mes "I didn't want to do in the first place!";
  308. delitem 5022,1; //Helm_Of_Sun
  309. delitem 969,2; //Gold
  310. set Zeny, Zeny - 200000000;
  311. next;
  312. mes "[Leablem]";
  313. mes "No, don't ever ask me to do such a risky thing again!";
  314. mes "Bah~";
  315. close;
  316. }
  317. }
  318. else
  319. {
  320. mes "[Leablem]";
  321. mes "Umm...";
  322. next;
  323. mes "[Leablem]";
  324. mes "You don't have enough materials.";
  325. mes "Man, why did you even ask me to try?";
  326. mes "I'm not going to do this again for you,";
  327. mes "even if you bring enough materials. Bah~";
  328. close;
  329. }
  330. case 2:
  331. mes "[Leablem]";
  332. mes "Don't ever tell anyone";
  333. mes "about what I told you. Okay?";
  334. close;
  335. }
  336. case 4:
  337. mes "[Leablem]";
  338. mes "Do you want to know more information?";
  339. mes "Well, I don't think there's something";
  340. mes "that you specifically need to know.";
  341. mes "But I can at least give you a tip.";
  342. next;
  343. mes "[Leablem]";
  344. mes "The slot technicians in each town";
  345. mes "provide different slotting success chances";
  346. mes "depending on your equipment's upgrade level.";
  347. mes "I don't know if that's true,";
  348. mes "but I can see the difference in each town.";
  349. next;
  350. mes "[Leablem]";
  351. mes "For instance, a slot technician in one town";
  352. mes "provides a higher success chance to";
  353. mes "equipment items at higher upgrade levels,";
  354. mes "while a technician in another town has higher";
  355. mes "success at lower upgrade levels.";
  356. next;
  357. mes "[Leablem]";
  358. mes "When you fail to add a slot, the equipment";
  359. mes "will become broken and disappear.";
  360. mes "I try my best to succeed, but";
  361. mes "slotting is complicated work.";
  362. next;
  363. mes "[Leablem]";
  364. mes "Oh, there's an important thing that you need to be careful about.";
  365. mes "^FF0000Try not to carry two identical equipment items";
  366. mes "^FF0000with you when you add slots.";
  367. mes "^FF0000Otherwise, slots may be added to one of the randomly chosen items,";
  368. mes "^FF0000and in the worst case, you may lose an item that is more valuable to you.^000000";
  369. next;
  370. mes "[Leablem]";
  371. mes "I hope this information will be helpful to you.";
  372. mes "Thanks.";
  373. close;
  374. case 5:
  375. mes "[Leablem]";
  376. mes "Alright, then.";
  377. close;
  378. }
  379. }
  380. payon,236,199,3 duplicate(SocketEnchant2) Leablem#pay 86
  381. lighthalzen,96,137,3 duplicate(SocketEnchant2) Leablem#lhz 86
  382. prt_in,22,60,6 duplicate(SocketEnchant2) Leablem#prt 86
  383. moc_ruins,154,86,3 duplicate(SocketEnchant2) Leablem#moc 86
  384. function script Func_Socket2 {
  385. disable_items;
  386. mes "[Leablem]";
  387. if(getarg(7,0) != 0 && getarg(8,0) != 0)
  388. {
  389. mes getitemname(getarg(0)) + "... Okay, then you need to bring me";
  390. mes "^FF0000" + (getarg(4) >= 1000 ? (getarg(4)/1000 + ",000") : getarg(4)) + ",000 zeny as service charge,";
  391. mes "^FF0000" + getarg(6) + "ea " + getitemname(getarg(5)) + " and " + getarg(8) + "ea " + getitemname(getarg(7)) + ".";
  392. mes "^FF0000Of course, you need a " + getitemname(getarg(0)) + ".^000000";
  393. }
  394. else
  395. {
  396. mes getitemname(getarg(0)) + "? Okay, then you need to bring me";
  397. mes "^FF0000" + (getarg(4) >= 1000 ? (getarg(4)/1000 + ",000") : getarg(4)) + ",000 zeny as service charge and " + getarg(6) + " " + getitemname(getarg(5)) + (getarg(6) > 1 && getarg(5) != 999 ? "s":"") + " as the requirement.";
  398. mes "^FF0000Of course, don't forget to bring me a " + getitemname(getarg(0)) + ".";
  399. mes "^FF0000You should have all items.^000000";
  400. }
  401. next;
  402. mes "[Leablem]";
  403. mes "Did you already bring all of them?";
  404. mes "For your information, if you fail to create a slot,";
  405. mes "you will lose all the item requirement as well as the target " + (getiteminfo(getarg(0),5)&2 ? "weapon" : "armor") + "."; // EQP_HAND_R = 2, it's a weapon, otherwise armor
  406. mes "Also remember, if the " + (getiteminfo(getarg(0),5)&2 ? "weapon" : "armor") + " has been upgraded, and has been inserted with a card,";
  407. mes "you will lose them even if you succeed in creating a slot.";
  408. next;
  409. switch(select("Ask for slot creation.:Try next time."))
  410. {
  411. case 1:
  412. if ((Zeny >= getarg(4)*1000) && (countitem(getarg(5)) >= getarg(6)) && (countitem(getarg(7,512)) >= getarg(8,0)) && (countitem(getarg(0)) > 0)) // if there's no getarg(7) and getarg(8) provided, check itemcount against 0 (we still need a valid item ID though)
  413. {
  414. mes "[Leablem]";
  415. mes "Alright then, let the work begin!";
  416. mes "You'd better pray for a successful result.";
  417. next;
  418. set .@a, rand(1,100);
  419. if ((.@a > getarg(2)) && (.@a < getarg(3)))
  420. {
  421. specialeffect EF_LORD;
  422. mes "[Leablem]";
  423. mes "Great, it seems to be successful.";
  424. mes "It looks pretty well done. Congratulations!";
  425. delitem getarg(0),1;
  426. delitem getarg(5),getarg(6);
  427. if (getarg(7,0) != 0 && getarg(8,0) != 0)
  428. delitem getarg(7),getarg(8);
  429. set Zeny, Zeny - getarg(4)*1000;
  430. getitem getarg(1),1;
  431. next;
  432. mes "[Leablem]";
  433. mes "See you again, buddy!";
  434. close;
  435. }
  436. else
  437. {
  438. specialeffect EF_SUI_EXPLOSION;
  439. mes "[Leablem]";
  440. mes "Wah! ...I am so sorry, it failed.";
  441. mes "However, I am completely innocent.";
  442. mes "This is your luck, and it is destined by god, okay?";
  443. mes "Don't be so disappointed,";
  444. mes "and try next time.";
  445. delitem getarg(0),1;
  446. delitem getarg(5),getarg(6);
  447. if (getarg(7,0) != 0 && getarg(8,0) != 0)
  448. delitem getarg(7),getarg(8);
  449. set Zeny, Zeny - getarg(4)*1000;
  450. next;
  451. mes "[Leablem]";
  452. mes "See you again, buddy!";
  453. close;
  454. }
  455. }
  456. else
  457. {
  458. mes "[Leablem]";
  459. mes "Are you stupid or what? You didn't bring all of the required items!";
  460. mes "Go bring them quick!";
  461. close;
  462. }
  463. case 2:
  464. mes "[Leablem]";
  465. mes "See you next time.";
  466. close;
  467. }
  468. }