card_remover.txt 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. //===== eAthena Script =======================================
  2. //= Card Removal NPC
  3. //===== By: ==================================================
  4. //= TyrNemesis^
  5. //===== Current Version: =====================================
  6. //= 1.2
  7. //===== Compatible With: =====================================
  8. //= eAthena SVN
  9. //===== Description: =========================================
  10. //= Removes cards from equipped items.
  11. //===== Additional Comments: =================================
  12. //= 1.0 First version. [TyrNemesis^]
  13. //= 1.2 Optimized and fixed getequipname menu. [Kisuka]
  14. //============================================================
  15. prt_in,28,73,4 script Wise Old Woman#eAcustom 78,{
  16. mes "[Wise Old Woman]";
  17. mes "Good day, young one. I have the power to remove cards that you have compounded onto your equipment. Does this idea please you?";
  18. next;
  19. switch(select("Yes, it does.:What do you charge?:No thanks.")) {
  20. case 1:
  21. mes "[Wise Old Woman]";
  22. mes "Very well. Which item shall I examine for you?";
  23. next;
  24. setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
  25. set .@menu$,"";
  26. for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
  27. {
  28. if( getequipisequiped(.@i) )
  29. set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
  30. set .@menu$, .@menu$ + ":";
  31. }
  32. set .@part,select(.@menu$);
  33. if(!getequipisequiped(.@part)) {
  34. mes "[Wise Old Woman]";
  35. mes "Young one... Your not wearing anything there that I can remove cards from.";
  36. close;
  37. }
  38. if(getequipcardcnt(.@part) == 0) {
  39. mes "[Wise Old Woman]";
  40. mes "Young one... There are no cards compounded on this item. I can do nothing with it, I'm afraid.";
  41. close;
  42. }
  43. set .@cardcount,getequipcardcnt(.@part);
  44. if (!checkweight(1202,(.@cardcount+1))) {
  45. mes "^3355FFJust a minute!";
  46. mes "I can't offer any of my";
  47. mes "services to you because";
  48. mes "you're carrying too much";
  49. mes "stuff. Put your extra items in";
  50. mes "Kafra Storage and come again~";
  51. close;
  52. }
  53. mes "[Wise Old Woman]";
  54. mes "This item has " + .@cardcount + " cards compounded on it. To perform my magic, I will need " + (200000+(.@cardcount * 25000)) + " zeny, a ^0000FFStar Crumb^000000, and a ^0000FFYellow Gemstone^000000.";
  55. next;
  56. if(select("Very well. Do it.:Nevermind.") == 2) {
  57. mes "[Wise Old Woman]";
  58. mes "Very well. Return at once if you seek my services.";
  59. close;
  60. }
  61. if((zeny < (200000+(.@cardcount * 25000))) || (countitem(1000) < 1) || (countitem(715) < 1)) {
  62. mes "[Wise Old Woman]";
  63. mes "You do not have all the items I require to work my magic, child. Come again when you do.";
  64. close;
  65. }
  66. mes "[Wise Old Woman]";
  67. mes "Before I begin, I must warn you--I may fail. If I do, I may destroy the cards, the item, or both. I do not give refunds. That being said, which is more important to you: The cards, or the item?";
  68. next;
  69. switch(select("I changed my mind about this.:The item.:The cards.")) {
  70. case 1:
  71. mes "[Wise Old Woman]";
  72. mes "Very well. Return at once if you seek my services.";
  73. close;
  74. case 2:
  75. set .@failtype,1;
  76. break;
  77. case 3:
  78. set .@failtype,2;
  79. }
  80. mes "[Wise Old Woman]";
  81. mes "Very well. I shall begin.";
  82. set zeny,zeny - (200000+(.@cardcount * 25000));
  83. delitem 1000,1;
  84. delitem 715,1;
  85. // Replace the constants in the next 3 lines with failure chance values defined in refine_db.txt
  86. // First value = Total failure chance (item and cards destroyed)
  87. // Second value = Partial failure chance (one or the other is destroyed, player decides which one is safe)
  88. // Third value = Harmless failure chance (all that's lost is your investment)
  89. set .@failchance,rand(100);
  90. /*
  91. if(.@failchance < 2) {
  92. next;
  93. failedremovecards .@part,0;
  94. mes "[Wise Old Woman]";
  95. mes "The process was a total failure. I am afraid the item and the cards were destroyed.";
  96. close;
  97. }
  98. if(.@failchance < 8) {
  99. if (.@failtype == 1) {
  100. next;
  101. failedremovecards .@part,1;
  102. mes "[Wise Old Woman]";
  103. mes "While I have managed to remove the cards from the item, they were destroyed in the process. The item, however, is okay.";
  104. close;
  105. }
  106. if (.@failtype == 2) {
  107. next;
  108. failedremovecards .@part,2;
  109. mes "[Wise Old Woman]";
  110. mes "Most unfortunate. I succeeded at removing the cards, but the item itself was destroyed in the process.";
  111. close;
  112. }
  113. }
  114. */
  115. if(.@failchance < 10) {
  116. next;
  117. failedremovecards .@part,3;
  118. mes "[Wise Old Woman]";
  119. mes "I have failed to remove the cards. Luckily, however, both the item and the cards are still okay.";
  120. close;
  121. }
  122. next;
  123. successremovecards .@part;
  124. mes "[Wise Old Woman]";
  125. mes "The process was a success. Here are your cards and your item. Farewell.";
  126. close;
  127. case 2:
  128. mes "[Wise Old Woman]";
  129. mes "I charge a flat fee of 200000 zeny, plus 25000 zeny for each card I remove from the item. In addition, I need a star crumb and a yellow gemstone to work my magic.";
  130. close;
  131. case 3:
  132. mes "[Wise Old Woman]";
  133. mes "Very well. Return at once if you seek my services.";
  134. close;
  135. }
  136. }