card_remover.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. // Card removal NPC by TyrNemesis^
  2. // DANGEROUS! TODO: Think.. think 8) [Lupus]
  3. prt_in.gat,28,73,4 script Wise Old Woman 78,{
  4. UPGRADEROOT:
  5. mes "[Wise Old Woman]";
  6. mes "Good day, young one. I have the power to remove cards that you have compounded onto your equipment. Does this idea please you?";
  7. next;
  8. menu "Yes, it does.",REMOVEMENU,
  9. "What do you charge?",REMOVEPRICE,
  10. "No thanks.",CLOSEOUT;
  11. REMOVEPRICE:
  12. mes "[Wise Old Woman]";
  13. 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.";
  14. next;
  15. menu "Very well. Let's do it.",REMOVEMENU,
  16. "No thanks.",CLOSEOUT;
  17. REMOVEMENU:
  18. mes "[Wise Old Woman]";
  19. mes "Very well. Which item shall I examine for you?";
  20. next;
  21. menu "I changed my mind.",CLOSEOUT,
  22. getequipname(1),SLOT1,
  23. getequipname(2),SLOT2,
  24. getequipname(3),SLOT3,
  25. getequipname(4),SLOT4,
  26. getequipname(5),SLOT5,
  27. getequipname(6),SLOT6,
  28. getequipname(7),SLOT7,
  29. getequipname(8),SLOT8,
  30. getequipname(9),SLOT9,
  31. getequipname(10),SLOT10;
  32. SLOT1:
  33. set @part,1;
  34. goto CARDNUMCHECK;
  35. SLOT2:
  36. set @part,2;
  37. goto CARDNUMCHECK;
  38. SLOT3:
  39. set @part,3;
  40. goto CARDNUMCHECK;
  41. SLOT4:
  42. set @part,4;
  43. goto CARDNUMCHECK;
  44. SLOT5:
  45. set @part,5;
  46. goto CARDNUMCHECK;
  47. SLOT6:
  48. set @part,6;
  49. goto CARDNUMCHECK;
  50. SLOT7:
  51. set @part,7;
  52. goto CARDNUMCHECK;
  53. SLOT8:
  54. set @part,8;
  55. goto CARDNUMCHECK;
  56. SLOT9:
  57. set @part,9;
  58. goto CARDNUMCHECK;
  59. SLOT10:
  60. set @part,10;
  61. goto CARDNUMCHECK;
  62. CARDNUMCHECK:
  63. if(getequipcardcnt(@part) == 0) goto DENYCARDCOUNT;
  64. set @cardcount,getequipcardcnt(@part);
  65. if(@cardcount > 1) goto CARDNUMMULTIMSG;
  66. mes "[Wise Old Woman]";
  67. mes "This item has " + @cardcount + " card compounded on it. To perform my magic, I will need 225000 zeny, a ^0000FFStar Crumb^000000, and a ^0000FFYellow Gemstone^000000.";
  68. goto CARDNUMPOSTMSG;
  69. CARDNUMMULTIMSG:
  70. mes "[Wise Old Woman]";
  71. 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.";
  72. CARDNUMPOSTMSG:
  73. next;
  74. menu "Very well. Do it.",REMOVECARDWARNING,
  75. "Never mind.",CLOSEOUT;
  76. REMOVECARDWARNING:
  77. mes "[Wise Old Woman]";
  78. 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?";
  79. next;
  80. menu "I changed my mind about this.",CLOSEOUT,
  81. "The item.",PRIORITYITEM,
  82. "The cards.",PRIORITYCARD;
  83. PRIORITYITEM:
  84. set @failtype,1;
  85. goto REMOVECARD;
  86. PRIORITYCARD:
  87. set @failtype,2;
  88. goto REMOVECARD;
  89. REMOVECARD:
  90. mes "[Wise Old Woman]";
  91. mes "Very well. I shall begin.";
  92. if((zeny < (200000+(@cardcount * 25000))) || (countitem(1000) < 1) || (countitem(715) < 1)) goto DENYMATERIAL;
  93. set zeny,zeny - (200000+(@cardcount * 25000));
  94. delitem 1000,1;
  95. delitem 715,1;
  96. // Replace the constants in the next 3 lines with failure chance values defined in refine_db.txt
  97. // First value = Total failure chance (item and cards destroyed)
  98. // Second value = Partial failure chance (one or the other is destroyed, player decides which one is safe)
  99. // Third value = Harmless failure chance (all that's lost is your investment)
  100. set @failchance,rand(100);
  101. // if(@failchance < 2) goto FAILREMOVECARD0;
  102. // if((@failchance < 8) && (@failtype == 1)) goto FAILREMOVECARD1;
  103. // if((@failchance < 8) && (@failtype == 2)) goto FAILREMOVECARD2;
  104. if(@failchance < 10) goto FAILREMOVECARD3;
  105. successremovecards @part;
  106. next;
  107. mes "[Wise Old Woman]";
  108. mes "The process was a success. Here are your cards and your item. Farewell.";
  109. close;
  110. FAILREMOVECARD0:
  111. failedremovecards @part,0;
  112. next;
  113. mes "[Wise Old Woman]";
  114. mes "The process was a total failure. I am afraid the item and the cards were destroyed.";
  115. close;
  116. FAILREMOVECARD1:
  117. failedremovecards @part,1;
  118. next;
  119. mes "[Wise Old Woman]";
  120. mes "While I have managed to remove the cards from the item, they were destroyed in the process. The item, however, is okay.";
  121. close;
  122. FAILREMOVECARD2:
  123. failedremovecards @part,2;
  124. next;
  125. mes "[Wise Old Woman]";
  126. mes "Most unfortunate. I succeeded at removing the cards, but the item itself was destroyed in the process.";
  127. close;
  128. FAILREMOVECARD3:
  129. failedremovecards @part,3;
  130. next;
  131. mes "[Wise Old Woman]";
  132. mes "I have failed to remove the cards. Luckily, however, both the item and the cards are still okay.";
  133. close;
  134. DENYCARDCOUNT:
  135. mes "[Wise Old Woman]";
  136. mes "Young one... There are no cards compounded on this item. I can do nothing with it, I'm afraid.";
  137. close;
  138. DENYMATERIAL:
  139. next;
  140. mes "[Wise Old Woman]";
  141. mes "You do not have all the items I require to work my magic, child. Come again when you do.";
  142. close;
  143. CLOSEOUT:
  144. mes "[Wise Old Woman]";
  145. mes "Very well. Return at once if you seek my services.";
  146. close;
  147. }