card_separation.txt 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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 .@check_equip_card[0], getequipcardid(.@equip_num,0),getequipcardid(.@equip_num,1),getequipcardid(.@equip_num,2),getequipcardid(.@equip_num,3);
  103. setarray .@equip_card[0], .@check_equip_card[0], .@check_equip_card[1], .@check_equip_card[2], .@check_equip_card[3];
  104. set .@mvp_list$,
  105. "|4408|4128|4456|4168|4142"+ //Gloom_Under_Night_Card, Golden_Bug_Card, Nidhogg_Shadow_Card, Dark_Lord_Card, Doppelganger_Card
  106. "|4134|4137|4386|4407|4357"+ //Dracula_Card, Drake_Card, Detale_Card, Randgris_Card, B_Seyren_Card
  107. "|4146|4132|4147|4372|4145"+ //Maya_Card, Mistress_Card, Baphomet_Card, Bacsojin_Card, Berzebub_Card
  108. "|4374|4352|4367|4236|4425"+ //Apocalips_H_Card, B_Ygnizem_Card, B_Shecil_Card, Amon_Ra_Card, Atroce_Card
  109. "|4359|4123|4144|4135|4143"+ //B_Eremes_Card, Eddga_Card, Osiris_Card, Orc_Load_Card, Orc_Hero_Card
  110. "|4263|4131|4430|4276|4419"+ //Incant_Samurai_Card, Moonlight_Flower_Card, Ifrit_Card, Lord_Of_Death_Card, Ktullanux_Card
  111. "|4403|4399|4376|4441|4302"+ //Kiel_Card, Thanatos_Card, Lady_Tanee_Card, Fallen_Bishop_Card, Tao_Gunka_Card
  112. "|4305|4148|4318|4121|4365"+ //Turtle_General_Card, Pharaoh_Card, Knight_Windstorm_Card, Phreeoni_Card, B_Katrinn_Card
  113. "|4363|4324|4361|4330|4342|"; //B_Magaleta_Card, Garm_Card, B_Harword_Card, Dark_Snake_Lord_Card, Rsx_0806_Card
  114. if (.@Jeremy) {
  115. for ( .@i = 0; .@i < MAX_SLOTS; .@i++ ) {
  116. if (getiteminfo(.@equip_card[.@i], ITEMINFO_SUBTYPE) == CARD_ENCHANT)
  117. .@equip_card[.@i] = 0;// Armor Enchant System
  118. }
  119. if (!getarraysize(.@equip_card)) {
  120. mes .@n$;
  121. mes "The card is not equipped. Do you want to check again?";
  122. close;
  123. }
  124. if ((.@equip_card[0] && compare(.@mvp_list$,"|"+.@equip_card[0]+"|")) ||
  125. (.@equip_card[1] && compare(.@mvp_list$,"|"+.@equip_card[1]+"|")) ||
  126. (.@equip_card[2] && compare(.@mvp_list$,"|"+.@equip_card[2]+"|")) ||
  127. (.@equip_card[3] && compare(.@mvp_list$,"|"+.@equip_card[3]+"|")))
  128. set .@boss_chk,1;
  129. } else {
  130. // Official "Richard" script uses a hardcoded list including every possible item.
  131. //if (!getequipisequiped(.@equip_num)) {
  132. // mes "[Richard]";
  133. // mes "I'm sorry. We don't provide that equipment yet.";
  134. // close;
  135. //}
  136. mes "[Richard]";
  137. mes "Which number socket do you want to separate the card? From the left socket, they are sorted 1,2,3,4.";
  138. next;
  139. set .@menu$,"";
  140. for ( .@i = 0; .@i < MAX_SLOTS; .@i++ ) {
  141. if (.@equip_card[.@i] && getiteminfo(.@equip_card[.@i], ITEMINFO_SUBTYPE) == CARD_NORMAL) // Armor Enchant System
  142. .@menu$ = .@menu$ + "Socket " + (.@i+1) + " - " + getitemname(.@equip_card[.@i])+":";
  143. else {
  144. .@menu$ = .@menu$ + "^777777Socket " + (.@i+1) + " - No card^000000:";
  145. }
  146. }
  147. set .@i, select("Stop the work:"+.@menu$);
  148. switch(.@i) {
  149. case 1:
  150. mes .@n$;
  151. mes "Whenever you need to work, please come to me.";
  152. close;
  153. default:
  154. set .@slot, .@i-2;
  155. if (.@equip_card[.@slot] == 0 || getiteminfo(.@equip_card[.@slot], ITEMINFO_SUBTYPE) == CARD_ENCHANT) {
  156. mes .@n$;
  157. mes "This socket is not equipped with any card. Why don't you check again?";
  158. close;
  159. }
  160. break;
  161. }
  162. if (compare(.@mvp_list$,"|"+.@equip_card[.@slot]+"|"))
  163. set .@boss_chk,1;
  164. }
  165. if (.@boss_chk == 0) {
  166. mes .@n$;
  167. if (.@Jeremy)
  168. mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:";
  169. else
  170. mes "Please choose the working fee.";
  171. next;
  172. set .@menu$,
  173. "Next time...:"+
  174. ((Zeny >= 1000000)?"Use 1,000,000z (Do not use special item):":"^999999Use 1,000,000z (Insufficient)^000000:")+
  175. ((countitem(6441))?"Use Premium Lubricant:":"^999999Premium Lubricant (Insufficient)^000000:")+
  176. ((countitem(6440))?"Use Ordinary Lubricant":"^999999Ordinary Lubricant (Insufficient)^000000");
  177. switch(select(.@menu$)) {
  178. case 1:
  179. mes .@n$;
  180. mes "Whenever you need the work, visit me here.";
  181. close;
  182. case 2:
  183. if (Zeny < 1000000) {
  184. mes .@n$;
  185. mes "You don't have enough zeny. Please come back with enough fees.";
  186. close;
  187. }
  188. mes .@n$;
  189. 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?";
  190. next;
  191. if(select("Next time...:Continue") == 1) {
  192. mes .@n$;
  193. mes "Whenever you need the work, visit me here.";
  194. close;
  195. }
  196. set .@sf_c_num,150;
  197. set .@sf_r_num,150;
  198. set .@sf_w_num,150;
  199. set Zeny, Zeny - 1000000;
  200. break;
  201. case 3:
  202. if (countitem(6441) == 0) {
  203. mes .@n$;
  204. mes "You don't have Premium Lubricant.";
  205. close;
  206. }
  207. mes .@n$;
  208. 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?";
  209. next;
  210. if(select("Next time...:Continue") == 1) {
  211. mes .@n$;
  212. mes "Whenever you need the work, visit me here.";
  213. close;
  214. }
  215. set .@sf_c_num,75;
  216. set .@sf_r_num,75;
  217. set .@sf_w_num,75;
  218. delitem 6441,1; //High_RankLubricant
  219. break;
  220. case 4:
  221. if (countitem(6440) == 0) {
  222. mes .@n$;
  223. mes "You don't have Ordinary Lubricant.";
  224. close;
  225. }
  226. mes .@n$;
  227. 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?";
  228. next;
  229. if(select("Next time...:Continue") == 1) {
  230. mes .@n$;
  231. mes "Whenever you need the work, visit me here.";
  232. close;
  233. }
  234. set .@sf_c_num,75;
  235. set .@sf_r_num,150;
  236. set .@sf_w_num,150;
  237. delitem 6440,1; //General_Lubricant
  238. break;
  239. }
  240. } else if (.@boss_chk == 1) {
  241. mes .@n$;
  242. 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.";
  243. next;
  244. switch(select("Next time...:I have a Sillit Pong.")) {
  245. case 1:
  246. mes .@n$;
  247. mes "Whenever you need the work, visit me here.";
  248. close;
  249. case 2:
  250. if (countitem(6443) == 0) {
  251. mes .@n$;
  252. mes "You don't have Sillit Pong.";
  253. close;
  254. }
  255. break;
  256. }
  257. mes .@n$;
  258. if (.@Jeremy) {
  259. mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:";
  260. set .@menu$,"Alright, let's do it!";
  261. } else {
  262. mes "May I continue?";
  263. set .@menu$,"I got it. Just do it quickly!";
  264. }
  265. next;
  266. switch(select("Next time...:"+.@menu$)) {
  267. case 1:
  268. mes .@n$;
  269. mes "Whenever you need the work, visit me here.";
  270. close;
  271. case 2:
  272. set .@sf_c_num,60;
  273. set .@sf_r_num,60;
  274. set .@sf_w_num,60;
  275. delitem 6443,1; //Sillit_Pong_Bottle
  276. break;
  277. }
  278. }
  279. set .@equip_id, getequipid(.@equip_num);
  280. set .@equip_refine, getequiprefinerycnt(.@equip_num);
  281. // anti-hack
  282. if (callfunc("F_IsEquipCardHack", .@equip_num, .@check_equip_card[0], .@check_equip_card[1], .@check_equip_card[2], .@check_equip_card[3]))
  283. close;
  284. delequip .@equip_num;
  285. // Chance of retaining refine level.
  286. if (rand(1,.@sf_r_num) >= 61)
  287. set .@equip_refine,0;
  288. if (.@Jeremy) {
  289. // Chance of retaining equipment.
  290. if (rand(1,.@sf_w_num) < 61) {
  291. set .@equip_safe,1;
  292. getitem2 .@equip_id,1,1,.@equip_refine,0,0,0,0,0;
  293. }
  294. // Chance of retaining cards.
  295. for(set .@i,0; .@i<4; set .@i,.@i+1) {
  296. if (.@equip_card[.@i]) {
  297. if (rand(1,.@sf_c_num) < 61)
  298. getitem .@equip_card[.@i],1;
  299. else
  300. set .@card_break,1;
  301. }
  302. }
  303. } else {
  304. set .@card, .@equip_card[.@slot];
  305. set .@check_equip_card[.@slot],0;
  306. // Chance of retaining equipment (all enchantments are preserved).
  307. if (rand(1,.@sf_w_num) < 61) {
  308. set .@equip_safe,1;
  309. getitem2 .@equip_id,1,1,.@equip_refine,0,.@check_equip_card[0],.@check_equip_card[1],.@check_equip_card[2],.@check_equip_card[3];
  310. }
  311. // Chance of retaining card.
  312. if (rand(1,.@sf_c_num) < 61)
  313. getitem .@card,1;
  314. else
  315. set .@card_break,1;
  316. }
  317. // Display corresponding effect.
  318. if (!.@equip_safe && .@card_break)
  319. specialeffect2 EF_LORD;
  320. else if (.@equip_safe && .@card_break)
  321. specialeffect2 EF_SUI_EXPLOSION;
  322. else if (!.@equip_safe && !.@card_break)
  323. specialeffect2 EF_FIREPILLAR;
  324. else
  325. specialeffect2 EF_MAXPOWER;
  326. // Output results.
  327. mes "-- Result of Card Separation --";
  328. if (.@equip_safe) {
  329. mes "Crack has not occured during the card separation process.";
  330. mes "^0000FFEquipment separation is normal.^000000";
  331. } else {
  332. mes "Crack has occured during the card separation process.";
  333. mes "Equipment has been damaged. ^ff0000Unrecoverable.^000000";
  334. }
  335. mes "-------------------";
  336. if (!.@card_break) {
  337. mes "Erosion of surface has not occured during the card separation process.";
  338. mes "^0000ffCard separation has succeeded.^000000";
  339. } else {
  340. mes "Erosion of surface has occured during the card separation process.";
  341. mes "Card has been damaged. ^ff0000Unrecoverable.^000000";
  342. }
  343. next;
  344. mes .@n$;
  345. mes "That is all for the results of the card separation. Please come again.";
  346. close;
  347. }
  348. malangdo,215,166,4 duplicate(CardSeparation_mal) Jeremy#pa0829 553 // Armors :: mal_yong
  349. malangdo,208,166,6 duplicate(CardSeparation_mal) Richard#pa0829 559 // Weapons :: soc_weapon