socket_enchant.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. //===== rAthena Script =======================================
  2. //= Episode 11.1 Socket Enchant NPC
  3. //===== By: ==================================================
  4. //= rAthena Dev Team
  5. //===== Current Version: =====================================
  6. //= 2.0a
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Adds slots to selected weapons and armor.
  12. //===== Additional Comments: =================================
  13. //= 0.1a added missing L_No: to 2 funcs [Lupus]
  14. //= 0.1b Removed duplicates [Toms]
  15. //= 0.2 Added missing next;'s [Evera]
  16. //= 0.3 Fixed Zweihander[+] id [Lupus]
  17. //= 1.0 Fixed ingredients check [Lupus]
  18. //= 1.1 Updated to official. [SinSloth]
  19. //= 1.1b Optimized/cleaned [ultramage]
  20. //= 1.2 Fixed some typos and a nasty bug. [SinSloth]
  21. //= 1.3 Fixed a wrong item ID with Sphinx Hat. [SinSloth]
  22. //= 1.4 Corrected NPC names to fall within proper restrictions. [L0ne_W0lf]
  23. //= 1.5 Removed Ontouch trigger area from NPCs. [L0ne_W0lf]
  24. //= 1.6 Replaced effect numerics with constants. [Samuray22]
  25. //= 1.7 Adjusted prices on some armor and weapons. [L0ne_W0lf]
  26. //= 1.8 Added missing Gae Bolg and Dragon Slayer. [Kisuka]
  27. //= 1.9 Moved Episode 12 items to separate NPC.
  28. //= Some cleanup & optimization. [Gepard]
  29. //= 2.0 Duplicates now spawn from floating NPCs. [L0ne_W0lf]
  30. //= 2.0a Added 'disable_items' command. [Euphy]
  31. //============================================================
  32. - script Seiyablem#dummy::SocketEnchant -1,{
  33. if (checkweight(1201,1) == 0)
  34. {
  35. mes "- Wait a minute !! -";
  36. mes "- Currently you're carrying -";
  37. mes "- too many items with you. -";
  38. mes "- Please try again -";
  39. mes "- after you lose some weight. -";
  40. close;
  41. }
  42. mes "[Seiyablem]";
  43. mes "I'm an engineer that specializes in adding Slots to normal Weapons and Armor.";
  44. mes "My service fee, the required materials and the chance of success all depend on the specific item I'm working on.";
  45. next;
  46. mes "[Seiyablem]";
  47. mes "Adding Slots may seem simple, but it's far more complicated than it looks.";
  48. mes "If you're interested in my service, let me know.";
  49. next;
  50. switch(select("Add Slot to Weapon:Add Slot to Armor:Slot Attempt Info:Cancel"))
  51. {
  52. case 1:
  53. mes "[Seiyablem]";
  54. mes "You want to add a Slot to a weapon?";
  55. mes "I categorize weapons by their difficulty in adding a Slot, C Class being easiest and S Class the most difficult.";
  56. mes "Which class would you like to try?";
  57. next;
  58. switch(select("C Class:B Class:A Class:S Class"))
  59. {
  60. case 1:
  61. mes "[Seiyablem]";
  62. mes "C Class, eh?";
  63. mes "Now, I can only upgrade certain equipment in that class, so please choose one of the following items, so we can try to add a Slot to it.";
  64. next;
  65. switch(select("Trident:Rope:Violin"))
  66. {
  67. case 1: callfunc "Func_Socket",1460,1461,40,66,200,1010,10;
  68. case 2: callfunc "Func_Socket",1950,1951,40,66,200,1010,10;
  69. case 3: callfunc "Func_Socket",1901,1902,40,66,200,1010,10;
  70. }
  71. case 2:
  72. mes "[Seiyablem]";
  73. mes "B Class?";
  74. mes "Alright, this is the average equipment category.";
  75. mes "Please choose the weapon to which you'd like me to try to add a Slot.";
  76. next;
  77. switch(select("Chain:Gladius:Gakkung Bow:Pike:Haedonggum:Lute:Wire:Waghnakh:Arbalest Bow"))
  78. {
  79. case 1: callfunc "Func_Socket",1519,1520,40,61,300,1010,10;
  80. case 2: callfunc "Func_Socket",1219,1220,40,61,300, 984, 1,999,5;
  81. case 3: callfunc "Func_Socket",1714,1716,40,61,300, 984, 2,999,5;
  82. case 4: callfunc "Func_Socket",1407,1408,40,61,200,1010,10;
  83. case 5: callfunc "Func_Socket",1123,1128,40,61,300, 984, 2,999,5;
  84. case 6: callfunc "Func_Socket",1905,1906,40,61,300,1011,10;
  85. case 7: callfunc "Func_Socket",1954,1955,40,61,300,1011,10;
  86. case 8: callfunc "Func_Socket",1801,1802,40,61,300,1010,10;
  87. case 9: callfunc "Func_Socket",1713,1715,40,61,300, 984, 2,999,5;
  88. }
  89. case 3:
  90. mes "[Seiyablem]";
  91. mes "Ooh, A Class.";
  92. mes "This is some high risk territory!";
  93. mes "Alright, which weapon would you like me to try adding a Slot?";
  94. next;
  95. switch(select("Hunter Bow:Survivor's Rod(INT):Zweihander:Flamberge:Infiltrator:Ballista:Stunner:Berserk:Claymore"))
  96. {
  97. case 1: callfunc "Func_Socket",1718,1726,40,61,500,984,2,999,10;
  98. case 2: callfunc "Func_Socket",1619,1620,40,61,500,984,5,999,10;
  99. case 3: callfunc "Func_Socket",1168,1171,40,61,800,984,5,999,10;
  100. case 4: callfunc "Func_Socket",1129,1149,40,61,500,984,2,999,10;
  101. case 5: callfunc "Func_Socket",1261,1266,40,61,700,984,5,999,10;
  102. case 6: callfunc "Func_Socket",1722,1727,40,61,500,984,5,999,10;
  103. case 7: callfunc "Func_Socket",1522,1532,40,61,500,984,2,999,10;
  104. case 8: callfunc "Func_Socket",1814,1816,40,61,500,984,5,999,10;
  105. case 9: callfunc "Func_Socket",1163,1172,40,61,500,984,2,999,10; // NPC says "5 Oridecon" (Aegis) but takes only 2
  106. }
  107. case 4:
  108. mes "[Seiyablem]";
  109. mes "Whoa, whoa, whoa...";
  110. mes "S class? Alright...";
  111. mes "It'd be a near miracle if I can actually pull this off.";
  112. mes "Okay... Which weapon shall we try adding a Slot to?";
  113. next;
  114. switch(select("Gungnir:Poison Knife:Ice Pick:Sucsamad:Ginnungagap:Cutlas:Crescent Scythe:Survivor's Rod(DEX)"))
  115. {
  116. case 1: callfunc "Func_Socket", 1413, 1418,40,51,1000,984,5,999,10;
  117. case 2: callfunc "Func_Socket", 1239,13016,40,51,1000,984,5,999,10;
  118. case 3: callfunc "Func_Socket", 1230,13017,40,51,2000,984,5,999,10;
  119. case 4: callfunc "Func_Socket", 1236,13018,40,51,1000,984,5,999,10;
  120. case 5: callfunc "Func_Socket",13002,13019,40,51,1000,984,5,999,10;
  121. case 6: callfunc "Func_Socket", 1135,13400,40,51,1000,984,5,999,10;
  122. case 7: callfunc "Func_Socket", 1466, 1476,40,51,1000,984,5,999,10;
  123. case 8: callfunc "Func_Socket", 1617, 1618,40,51,2000,984,5,999,10;
  124. }
  125. }
  126. case 2:
  127. mes "[Seiyablem]";
  128. mes "Armor, you said?";
  129. mes "Sure, no problem.";
  130. mes "Armor is divided into 4 different classes, depending on the work difficulty.";
  131. mes "C Class is the easiest one, and S Class he hardest one.";
  132. mes "Which class would you like to try?";
  133. next;
  134. switch(select("C Class:B Class:A Class:S Class"))
  135. {
  136. case 1:
  137. mes "[Seiyablem]";
  138. mes "C Class Armor, eh?";
  139. mes "Sounds reasonable.";
  140. mes "Which armor would you like to try adding a Slot?";
  141. next;
  142. switch(select("Mantle:Coat:Circlet:Biretta"))
  143. {
  144. case 1: callfunc "Func_Socket",2307,2308,40,66,200,999,3;
  145. case 2: callfunc "Func_Socket",2309,2310,40,66,200,999,3;
  146. case 3: callfunc "Func_Socket",2232,2233,40,66,200,999,3;
  147. case 4: callfunc "Func_Socket",2216,2217,40,66,200,999,3;
  148. }
  149. case 2:
  150. mes "[Seiyablem]";
  151. mes "You have chosen average B Class.";
  152. mes "So, what kind of armor do you have?";
  153. next;
  154. switch(select("Mirror Shield:Chain Mail:Saint Robe:Silk Robe:Boots:Shoes:Muffler:Guard:Buckler:Shield:Bongun Hat"))
  155. {
  156. case 1: callfunc "Func_Socket",2107,2108,40,61,250,999,5;
  157. case 2: callfunc "Func_Socket",2314,2315,40,61,250,999,5;
  158. case 3: callfunc "Func_Socket",2325,2326,40,61,300,999,5;
  159. case 4: callfunc "Func_Socket",2321,2322,40,61,300,999,5;
  160. case 5: callfunc "Func_Socket",2405,2406,40,61,300,999,5;
  161. case 6: callfunc "Func_Socket",2403,2404,40,61,300,999,5;
  162. case 7: callfunc "Func_Socket",2503,2504,40,61,300,999,5;
  163. case 8: callfunc "Func_Socket",2101,2102,40,61,300,999,5;
  164. case 9: callfunc "Func_Socket",2103,2104,40,61,300,999,5;
  165. case 10: callfunc "Func_Socket",2105,2106,40,61,250,999,5;
  166. case 11: callfunc "Func_Socket",5046,5168,40,61,250,999,5;
  167. }
  168. case 3:
  169. mes "[Seiyablem]";
  170. mes "Ooh, A Class.";
  171. mes "This is some high risk territory!";
  172. mes "Alright, which armor would you like me to try adding a Slot?";
  173. next;
  174. switch(select("Gemmed Sallet:Bucket Hat:Memory Book:Tights:Legion Plate Armor:Full Plate:Thief Clothes:Greaves:Coif:Manteau:Helm:Ninja Suit:Orc Helm:Ancient Cape:Monk Hat:Golden Gear:Brooch:Munak Hat"))
  175. {
  176. case 1: callfunc "Func_Socket",2230,2231,40,61,400,985,1;
  177. case 2: callfunc "Func_Socket",5114,5120,40,61,400,985,1;
  178. case 3: callfunc "Func_Socket",2109,2121,40,61,400,985,1;
  179. case 4: callfunc "Func_Socket",2330,2331,40,61,400,985,1;
  180. case 5: callfunc "Func_Socket",2341,2342,40,61,400,985,1;
  181. case 6: callfunc "Func_Socket",2316,2317,40,61,400,985,1;
  182. case 7: callfunc "Func_Socket",2335,2336,40,61,400,985,1;
  183. case 8: callfunc "Func_Socket",2411,2412,40,61,400,985,1;
  184. case 9: callfunc "Func_Socket",5092,5093,40,61,400,985,1;
  185. case 10: callfunc "Func_Socket",2505,2506,40,61,400,985,1;
  186. case 11: callfunc "Func_Socket",2228,2229,40,61,400,985,1;
  187. case 12: callfunc "Func_Socket",2337,2359,40,61,400,985,1;
  188. case 13: callfunc "Func_Socket",2299,5157,40,61,400,985,1;
  189. case 14: callfunc "Func_Socket",2507,2525,40,61,400,985,1;
  190. case 15: callfunc "Func_Socket",2251,5158,40,61,400,985,1;
  191. case 16: callfunc "Func_Socket",2246,5159,40,61,400,985,1;
  192. case 17: callfunc "Func_Socket",2605,2625,40,61,400,985,1;
  193. case 18: callfunc "Func_Socket",2264,5167,40,61,300,985,1;
  194. }
  195. case 4:
  196. mes "[Seiyablem]";
  197. mes "Um... S Class?";
  198. mes "You sure about this?";
  199. mes "Alright... Let me know the Armor to which you'd like to add a Slot, and I'll tell what I need to try it.";
  200. next;
  201. switch(select("Majestic Goat:Spiky Band:Bone Helm:Corsair:Crown:Tiara:Sphinx Hat:Robe of Cast:Earring:Ring:Bow Thimble"))
  202. {
  203. case 1: callfunc "Func_Socket",2256,5160,40,51,2000,985,2;
  204. case 2: callfunc "Func_Socket",2258,5161,40,51,2000,985,2;
  205. case 3: callfunc "Func_Socket",5017,5162,40,51,2000,985,2;
  206. case 4: callfunc "Func_Socket",5019,5163,40,51,2000,985,2;
  207. case 5: callfunc "Func_Socket",2235,5165,40,51,2000,985,2;
  208. case 6: callfunc "Func_Socket",2234,5164,40,51,2000,985,2;
  209. case 7: callfunc "Func_Socket",5053,5166,40,51,1000,985,2;
  210. case 8: callfunc "Func_Socket",2343,2360,40,51,1000,985,2;
  211. case 9: callfunc "Func_Socket",2602,2622,40,51,1000,985,2;
  212. case 10: callfunc "Func_Socket",2601,2621,40,51,1000,985,2;
  213. case 11: callfunc "Func_Socket",2619,2671,40,51,1000,985,2;
  214. }
  215. }
  216. case 3:
  217. mes "[Seiyablem]";
  218. mes "Well, I haven't really refined the art of Slot Addition.";
  219. mes "It's so complicated that I'd be lying if I told you that I knew every factor that affected the process.";
  220. mes "Still, I do notice a few trends...";
  221. next;
  222. mes "[Seiyablem]";
  223. mes "In some towns, Slot addition attempts are more successful for equipment with fewer upgrades.";
  224. mes "In other towns, the opposite is true.";
  225. mes "isn't that really peculiar?";
  226. next;
  227. mes "[Seiyablem]";
  228. mes "Oh, there's also something really important that you should know.";
  229. mes "If you ask me to add a Slot to something, make sure that you don't have multiples of it in your inventory.";
  230. next;
  231. mes "[Seiyablem]";
  232. mes "Here's an example: if you have a +7 Manteau and a normal Manteau in your inventory, then I will randomly pick one of them for my Slot Addition attempt.";
  233. mes "Just remember to be careful.";
  234. next;
  235. mes "[Seiyablem]";
  236. mes "Again, ^FF0000only carry one of the equipment to which you want me to add a Slot^000000.";
  237. mes "All other equipment with the same name should be placed in your Kafra Storage, got it?";
  238. close;
  239. case 4:
  240. mes "[Seiyablem]";
  241. mes "Take it easy, adventurer.";
  242. mes "If you ever want to try adding a Slot to some of your equipment, come back and let me know.";
  243. mes "Seeya~";
  244. close;
  245. }
  246. }
  247. function script Func_Socket {
  248. .@item_id = getarg(0);
  249. .@zeny_req = getarg(4);
  250. setarray .@item_req[0], getarg(5), getarg(7,0);
  251. setarray .@req_amount[0], getarg(6), getarg(8,0);
  252. disable_items;
  253. mes "[Seiyablem]";
  254. mes "You want to add a Slot to a "+ getitemname(.@item_id) +"?";
  255. mes "Alright, please bring me ^FF0000"+ .@req_amount[0] +" "+ getitemname(.@item_req[0]) + (.@req_amount[0] > 1 && .@item_req[0] != 999 ? "s":"") +"^000000, "+ (.@item_req[1] != 0 && .@req_amount[1] != 0 ? ("^FF0000"+ .@req_amount[1] +" "+ getitemname(.@item_req[1]) + (.@req_amount[1] > 1 && .@item_req[1] != 999 ? "s":"") + "^000000 ") : "") + "and my ^FF0000" + (.@zeny_req >= 1000 ? (.@zeny_req /1000 +",000") : .@zeny_req) +",000 zeny^000000 service fee.";
  256. mes "Ah, and don't forget to bring that "+ getitemname(.@item_id) +"!";
  257. next;
  258. mes "[Seiyablem]";
  259. if (getiteminfo(.@item_id, ITEMINFO_LOCATIONS) & EQP_HAND_R) // weapon
  260. {
  261. mes "I can try to add a slot now if you have the required items and zeny.";
  262. mes "However, you should know that there's a chance that I might fail.";
  263. mes "Therefore, I need to give you a fair warning...";
  264. next;
  265. mes "[Seiyablem]";
  266. mes "If this attempt to add a Slot to your Weapon fails, then the ^FF0000Weapon^000000, ^FF0000and any Cards compounded to it will be destroyed^000000.";
  267. }
  268. else // armor
  269. {
  270. mes "If you have all the required materials, my zeny service fee and the Armor, then we can go ahead with the Slot Addition attempt.";
  271. mes "But before that, I must warn you of the risk.";
  272. next;
  273. mes "[Seiyablem]";
  274. mes "If this attempt to add a Slot to your Armor fails, then the ^FF0000Armor^000000, ^FF0000it's upgrades^000000 ^FF0000and any Cards compounded to it will be destroyed^000000.";
  275. }
  276. mes "Do you still want to try to add a Slot?";
  277. next;
  278. switch(select("Attempt Slot Addition:Cancel"))
  279. {
  280. case 1:
  281. 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 getarg(7) and getarg(8) provided, check itemcount against 0 (we still need a valid item ID though)
  282. {
  283. mes "[Seiyablem]";
  284. mes "Alright then, let the work begin!";
  285. mes "You'd better pray for a successful result.";
  286. next;
  287. set .@a, rand(1,100);
  288. if ((.@a > getarg(2)) && (.@a < getarg(3)))
  289. {
  290. specialeffect getarg(3) == 51 ? EF_LORD : EF_SANCTUARY; // only S Class items have Lord of Vermillion effect
  291. mes "[Seiyablem]";
  292. mes "Great, it seems to be successful.";
  293. mes "It looks pretty well done. Congratulations!";
  294. delitem .@item_id,1;
  295. delitem .@item_req[0],.@req_amount[0];
  296. if (.@item_req[1] != 0 && .@req_amount[1] != 0)
  297. delitem .@item_req[1],.@req_amount[1];
  298. Zeny = Zeny - .@zeny_req *1000;
  299. getitem getarg(1),1;
  300. next;
  301. mes "[Seiyablem]";
  302. mes "See you again, buddy!";
  303. close;
  304. }
  305. else
  306. {
  307. specialeffect EF_SUI_EXPLOSION;
  308. mes "[Seiyablem]";
  309. mes "Wah! ...I am so sorry, it failed.";
  310. mes "However, I am completely innocent.";
  311. mes "This is your luck, and it is destined by god, okay?";
  312. mes "Don't be so disappointed, and try next time.";
  313. delitem .@item_id,1;
  314. delitem .@item_req[0],.@req_amount[0];
  315. if (.@item_req[1] != 0 && .@req_amount[1] != 0)
  316. delitem .@item_req[1],.@req_amount[1];
  317. Zeny = Zeny - .@zeny_req *1000;
  318. next;
  319. mes "[Seiyablem]";
  320. mes "I wish you good luck next time!";
  321. close;
  322. }
  323. }
  324. else
  325. {
  326. mes "[Seiyablem]";
  327. mes "I'd like to go ahead with this Slot Addition attempt, but you're missing a few things.";
  328. mes "You sure that you have the equipment, required materials and the zeny?";
  329. close;
  330. }
  331. case 2:
  332. mes "[Seiyablem]";
  333. mes "Need some time to think about it, huh?";
  334. mes "Alright, I can understand.";
  335. mes "Just remember that life's no fun if you're always playing it safe~";
  336. close;
  337. }
  338. }
  339. payon,140,151,5 duplicate(SocketEnchant) Seiyablem#pay 84
  340. lhz_in02,281,35,5 duplicate(SocketEnchant) Seiyablem#lhz 84
  341. prt_in,33,70,5 duplicate(SocketEnchant) Seiyablem#prt 84
  342. morocc,51,41,4 duplicate(SocketEnchant) Seiyablem#moc 84
  343. - script Young Man#dummy::SocketMan -1,{
  344. mes "[Young Man]";
  345. mes "I'm considering becoming a Slotting Engineer.";
  346. mes "It's a new field where you can add Slots to equipment, and it'd be cool if I can work in such a lucrative career.";
  347. next;
  348. mes "[Young Man]";
  349. mes "There's a huge element of luck involved in successfully adding Slots from what I can understand.";
  350. mes "You fail sometimes, but if you're super lucky, you can add two Slots.";
  351. mes "Crazy. Huh?";
  352. next;
  353. mes "[Young Man]";
  354. mes "But don't get too excited.";
  355. mes "Only certain equipment can handle the addition of two extra Slots.";
  356. mes "There's so much more I have to learn before I can even be an apprentice...";
  357. close;
  358. }
  359. prt_in,31,57,1 duplicate(SocketMan) Young Man#prt 97
  360. payon,143,143,7 duplicate(SocketMan) Young Man#pay 97
  361. morocc,60,42,3 duplicate(SocketMan) Young Man#moc 97
  362. lhz_in02,269,33,5 duplicate(SocketMan) Young Man#lhz 97