card_separation.txt 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. //===== rAthena Script =======================================
  2. //= Card Separation System
  3. //===== By: ==================================================
  4. //= Muad_Dib
  5. //===== Current Version: =====================================
  6. //= 1.1
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Separates cards from equipment.
  12. //===== Additional Comments: =================================
  13. //= 1.0 First Version. [Euphy]
  14. //= 1.1 Added "Richard" NPC. [Euphy]
  15. //============================================================
  16. - script ::CardSeparation_mal -1,{
  17. disable_items;
  18. if (checkweight(1201,1) == 0) {
  19. mes "You have too many kinds of objects. Let's try to continue after reducing those objects.";
  20. close;
  21. }
  22. if (MaxWeight - Weight < 10000) {
  23. mes "Can't continue because you have too many heavy objects. Let's try to continue after reducing the weight.";
  24. close;
  25. }
  26. if (strnpcinfo(1) == "Jeremy") {
  27. set .@Jeremy,1;
  28. set .@n$, "[Jeremy]";
  29. setarray .@equip_name$[0], "Armor", "Shoes", "Garment", "Upper Hat";
  30. setarray .@equip_slot[0], EQI_ARMOR,EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP;
  31. mes .@n$;
  32. mes "Long time no see~";
  33. mes "I have learned a new skill that separates cards from Armor, Shoes, Garment and Headgear. Do you want to try it?";
  34. } else {
  35. set .@Jeremy,0;
  36. set .@n$, "[Richard]";
  37. setarray .@equip_name$[0], "Left hand", "Right hand";
  38. setarray .@equip_slot[0], EQI_HAND_L, EQI_HAND_R;
  39. mes .@n$;
  40. mes "Silly Jeremy does not want to touch weapons and shields because of picking several cards that might be damaged. That is why I prepared a card separaion skill for weapons and shields...";
  41. }
  42. next;
  43. mes .@n$;
  44. mes "Generally the fee is 1,000,000 Zeny. During the card separation, you can use ^990000special items that reduce the rate of destroying equipment or cards^000000. We don't charge additional zeny for this.";
  45. next;
  46. mes .@n$;
  47. mes "There is a possibility of destroying them even using a special item. Also, ^ff0000the refine level might be lost^000000. Do you have any equipment to separate?";
  48. next;
  49. for(set .@i,0; .@i<getarraysize(.@equip_slot); set .@i,.@i+1) {
  50. if (getequipisequiped(.@equip_slot[.@i]))
  51. set .@menu$, .@menu$+getequipname(.@equip_slot[.@i])+":";
  52. else
  53. set .@menu$, .@menu$+"^999999"+.@equip_name$[.@i]+" (empty)^000000:";
  54. }
  55. set .@i, select("Stop the work:"+((.@Jeremy)?"How is it possible?":"")+":"+.@menu$);
  56. switch(.@i) {
  57. case 1:
  58. mes .@n$;
  59. mes "Whenever you need the work, visit me here.";
  60. close;
  61. case 2:
  62. mes .@n$;
  63. mes "You wonder what is so special. Well, I hate to give only a guide, so let me tell you the story...";
  64. next;
  65. mes "^000099Jeremy is stretching his shoulders and hands. He might be waiting for someone to talk with him.^000000";
  66. next;
  67. mes .@n$;
  68. mes "Do you know that Malangdo's specialty is canned food?";
  69. next;
  70. select("I knew that well. Is it that limited?");
  71. mes .@n$;
  72. mes "Hehe... Everyone loves it. But there were some problems before.";
  73. next;
  74. select("Problems? Is there any faulty fish?");
  75. mes .@n$;
  76. mes "No, the fish does not have any problem. The problem is lots of fish oil produced after processing. That is such an industrial waste.";
  77. next;
  78. mes .@n$;
  79. mes "However, after a revitalizing refining process, this fish oil became valuable to use for old equipment care and industrial lubricant.";
  80. next;
  81. mes .@n$;
  82. mes "In addition, this oil is so useful to separate relics from equipped weapons that we can't buy Premium Lubricant and Ordinary Lubricant with Zeny.";
  83. next;
  84. mes .@n$;
  85. mes "Well, don't worry about money. Surely the Premium Lubricant is expensive. If you pay some zeny, I can give you cheaper lubricant.";
  86. next;
  87. mes .@n$;
  88. mes "I'm not sure about the quality of success. Anyway, this is so cheap, right?";
  89. close;
  90. default:
  91. set .@equip_num, .@equip_slot[.@i-3];
  92. if (!getequipisequiped(.@equip_num)) {
  93. mes .@n$;
  94. if (.@Jeremy)
  95. mes "In this part, there is nothing?";
  96. else
  97. mes "There is nothing on that part?";
  98. close;
  99. }
  100. break;
  101. }
  102. setarray .@equip_card[0], getequipcardid(.@equip_num,0),getequipcardid(.@equip_num,1),getequipcardid(.@equip_num,2),getequipcardid(.@equip_num,3);
  103. set .@mvp_list$,
  104. "|4408|4128|4456|4168|4142"+ //Gloom_Under_Night_Card, Golden_Bug_Card, Nidhogg_Shadow_Card, Dark_Lord_Card, Doppelganger_Card
  105. "|4134|4137|4386|4407|4357"+ //Dracula_Card, Drake_Card, Detale_Card, Randgris_Card, B_Seyren_Card
  106. "|4146|4132|4147|4372|4145"+ //Maya_Card, Mistress_Card, Baphomet_Card, Bacsojin_Card, Berzebub_Card
  107. "|4374|4352|4367|4236|4425"+ //Apocalips_H_Card, B_Ygnizem_Card, B_Shecil_Card, Amon_Ra_Card, Atroce_Card
  108. "|4359|4123|4144|4135|4143"+ //B_Eremes_Card, Eddga_Card, Osiris_Card, Orc_Load_Card, Orc_Hero_Card
  109. "|4263|4131|4430|4276|4419"+ //Incant_Samurai_Card, Moonlight_Flower_Card, Ifrit_Card, Lord_Of_Death_Card, Ktullanux_Card
  110. "|4403|4399|4376|4441|4302"+ //Kiel_Card, Thanatos_Card, Lady_Tanee_Card, Fallen_Bishop_Card, Tao_Gunka_Card
  111. "|4305|4148|4318|4121|4365"+ //Turtle_General_Card, Pharaoh_Card, Knight_Windstorm_Card, Phreeoni_Card, B_Katrinn_Card
  112. "|4363|4324|4361|4330|4342|"; //B_Magaleta_Card, Garm_Card, B_Harword_Card, Dark_Snake_Lord_Card, Rsx_0806_Card
  113. if (.@Jeremy) {
  114. for(set .@i,0; .@i<4; set .@i,.@i+1) {
  115. if (.@equip_card[.@i] >= 4700) // Armor Enchant System
  116. set .@equip_card[.@i],0;
  117. }
  118. if (!getarraysize(.@equip_card)) {
  119. mes .@n$;
  120. mes "The card is not equipped. Do you want to check again?";
  121. close;
  122. }
  123. if ((.@equip_card[0] && compare(.@mvp_list$,"|"+.@equip_card[0]+"|")) ||
  124. (.@equip_card[1] && compare(.@mvp_list$,"|"+.@equip_card[1]+"|")) ||
  125. (.@equip_card[2] && compare(.@mvp_list$,"|"+.@equip_card[2]+"|")) ||
  126. (.@equip_card[3] && compare(.@mvp_list$,"|"+.@equip_card[3]+"|")))
  127. set .@boss_chk,1;
  128. } else {
  129. // Official "Richard" script uses a hardcoded list including every possible item.
  130. //if (!getequipisequiped(.@equip_num)) {
  131. // mes "[Richard]";
  132. // mes "I'm sorry. We don't provide that equipmnet yet.";
  133. // close;
  134. //}
  135. mes "[Richard]";
  136. mes "Which number socket do you want to separate the card? From the left socket, they are sorted 1,2,3,4.";
  137. next;
  138. set .@menu$,"";
  139. for(set .@i,0; .@i<4; set .@i,.@i+1) {
  140. if (.@equip_card[.@i] && .@equip_card[.@i] < 4700) // Armor Enchant System
  141. set .@menu$, .@menu$+"Socket "+(.@i+1)+" - "+getitemname(.@equip_card[.@i])+":";
  142. else
  143. set .@menu$, .@menu$+"^777777Socket "+(.@i+1)+" - No card^000000:";
  144. }
  145. set .@i, select("Stop the work:"+.@menu$);
  146. switch(.@i) {
  147. case 1:
  148. mes .@n$;
  149. mes "Whenever you need to work, please come to me.";
  150. close;
  151. default:
  152. set .@slot, .@i-2;
  153. if (.@equip_card[.@slot] == 0 || .@equip_card[.@slot] >= 4700) {
  154. mes .@n$;
  155. mes "This socket is not equipped with any card. Why don't you check again?";
  156. close;
  157. }
  158. break;
  159. }
  160. if (compare(.@mvp_list$,"|"+.@equip_card[.@slot]+"|"))
  161. set .@boss_chk,1;
  162. }
  163. if (.@boss_chk == 0) {
  164. mes .@n$;
  165. if (.@Jeremy)
  166. mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:";
  167. else
  168. mes "Please choose the working fee.";
  169. next;
  170. set .@menu$,
  171. "Next time...:"+
  172. ((Zeny >= 1000000)?"Use 1,000,000z (Do not use special item):":"^999999Use 1,000,000z (Insufficient)^000000:")+
  173. ((countitem(6441))?"Use Premium Lubricant:":"^999999Premium Lubricant (Insufficient)^000000:")+
  174. ((countitem(6440))?"Use Ordinary Lubricant":"^999999Ordinary Lubricant (Insufficient)^000000");
  175. switch(select(.@menu$)) {
  176. case 1:
  177. mes .@n$;
  178. mes "Whenever you need the work, visit me here.";
  179. close;
  180. case 2:
  181. if (Zeny < 1000000) {
  182. mes .@n$;
  183. mes "You don't have enough zeny. Please come back with enough fees.";
  184. close;
  185. }
  186. mes .@n$;
  187. mes "This is pretty old equipment. There is a high rate of destroying the cards or equipment during the work. Are you sure you want to continue?";
  188. next;
  189. if(select("Next time...:Continue") == 1) {
  190. mes .@n$;
  191. mes "Whenever you need the work, visit me here.";
  192. close;
  193. }
  194. set .@sf_c_num,150;
  195. set .@sf_r_num,150;
  196. set .@sf_w_num,150;
  197. set Zeny, Zeny - 1000000;
  198. break;
  199. case 3:
  200. if (countitem(6441) == 0) {
  201. mes .@n$;
  202. mes "You don't have Premium Lubricant.";
  203. close;
  204. }
  205. mes .@n$;
  206. mes "If you use the Premium Lubricant, the rate of destruction will be decreased highly, but I can't give you a 100% guarantee. Are you sure you want to continue?";
  207. next;
  208. if(select("Next time...:Continue") == 1) {
  209. mes .@n$;
  210. mes "Whenever you need the work, visit me here.";
  211. close;
  212. }
  213. set .@sf_c_num,75;
  214. set .@sf_r_num,75;
  215. set .@sf_w_num,75;
  216. delitem 6441,1; //High_RankLubricant
  217. break;
  218. case 4:
  219. if (countitem(6440) == 0) {
  220. mes .@n$;
  221. mes "You don't have Ordinary Lubricant.";
  222. close;
  223. }
  224. mes .@n$;
  225. mes "If you use the Ordinary Lubricant, the rate of destruction will be decreased highly, but I can't give you a 100% guarantee. Are you sure you want to continue?";
  226. next;
  227. if(select("Next time...:Continue") == 1) {
  228. mes .@n$;
  229. mes "Whenever you need the work, visit me here.";
  230. close;
  231. }
  232. set .@sf_c_num,75;
  233. set .@sf_r_num,150;
  234. set .@sf_w_num,150;
  235. delitem 6440,1; //General_Lubricant
  236. break;
  237. }
  238. } else if (.@boss_chk == 1) {
  239. mes .@n$;
  240. mes "This equipment contains a precious MVP card. This card can't be separated with lubricant. If you bring the super surfactant ^0000ffSillit Pong^000000, I will be able to work.";
  241. next;
  242. switch(select("Next time...:I have a Sillit Pong.")) {
  243. case 1:
  244. mes .@n$;
  245. mes "Whenever you need the work, visit me here.";
  246. close;
  247. case 2:
  248. if (countitem(6443) == 0) {
  249. mes .@n$;
  250. mes "You don't have Sillit Pong.";
  251. close;
  252. }
  253. break;
  254. }
  255. mes .@n$;
  256. if (.@Jeremy) {
  257. mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:";
  258. set .@menu$,"Alright, let's do it!";
  259. } else {
  260. mes "May I continue?";
  261. set .@menu$,"I got it. Just do it quickly!";
  262. }
  263. next;
  264. switch(select("Next time...:"+.@menu$)) {
  265. case 1:
  266. mes .@n$;
  267. mes "Whenever you need the work, visit me here.";
  268. close;
  269. case 2:
  270. set .@sf_c_num,60;
  271. set .@sf_r_num,60;
  272. set .@sf_w_num,60;
  273. delitem 6443,1; //Sillit_Pong_Bottle
  274. break;
  275. }
  276. }
  277. set .@equip_id, getequipid(.@equip_num);
  278. set .@equip_refine, getequiprefinerycnt(.@equip_num);
  279. // anti-hack
  280. if (callfunc("F_IsEquipCardHack", .@equip_num, .@equip_card[0], .@equip_card[1], .@equip_card[2], .@equip_card[3]))
  281. close;
  282. delequip .@equip_num;
  283. // Chance of retaining refine level.
  284. if (rand(1,.@sf_r_num) >= 61)
  285. set .@equip_refine,0;
  286. if (.@Jeremy) {
  287. // Chance of retaining equipment.
  288. if (rand(1,.@sf_w_num) < 61) {
  289. set .@equip_safe,1;
  290. getitem2 .@equip_id,1,1,.@equip_refine,0,0,0,0,0;
  291. }
  292. // Chance of retaining cards.
  293. for(set .@i,0; .@i<4; set .@i,.@i+1) {
  294. if (.@equip_card[.@i]) {
  295. if (rand(1,.@sf_c_num) < 61)
  296. getitem .@equip_card[.@i],1;
  297. else
  298. set .@card_break,1;
  299. }
  300. }
  301. } else {
  302. set .@card, .@equip_card[.@slot];
  303. set .@equip_card[.@slot],0;
  304. // Chance of retaining equipment.
  305. if (rand(1,.@sf_w_num) < 61) {
  306. set .@equip_safe,1;
  307. getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
  308. }
  309. // Chance of retaining card.
  310. if (rand(1,.@sf_c_num) < 61)
  311. getitem .@card,1;
  312. else
  313. set .@card_break,1;
  314. }
  315. // Display corresponding effect.
  316. if (!.@equip_safe && .@card_break)
  317. specialeffect2 EF_LORD;
  318. else if (.@equip_safe && .@card_break)
  319. specialeffect2 EF_SUI_EXPLOSION;
  320. else if (!.@equip_safe && !.@card_break)
  321. specialeffect2 EF_FIREPILLAR;
  322. else
  323. specialeffect2 EF_MAXPOWER;
  324. // Output results.
  325. mes "-- Result of Card Separation --";
  326. if (.@equip_safe) {
  327. mes "Crack has not occured during the card separation process.";
  328. mes "^0000FFEquipment separation is normal.^000000";
  329. } else {
  330. mes "Crack has occured during the card separation process.";
  331. mes "Equipment has been damaged. ^ff0000Unrecoverable.^000000";
  332. }
  333. mes "-------------------";
  334. if (!.@card_break) {
  335. mes "Erosion of surface has not occured during the card separation process.";
  336. mes "^0000ffCard separation has succeeded.^000000";
  337. } else {
  338. mes "Erosion of surface has occured during the card separation process.";
  339. mes "Card has been damaged. ^ff0000Unrecoverable.^000000";
  340. }
  341. next;
  342. mes .@n$;
  343. mes "That is all for the results of the card separation. Please come again.";
  344. close;
  345. }
  346. malangdo,215,166,4 duplicate(CardSeparation_mal) Jeremy#pa0829 553 // Armors :: mal_yong
  347. malangdo,208,166,6 duplicate(CardSeparation_mal) Richard#pa0829 559 // Weapons :: soc_weapon