card_remover.txt 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. // Card removal NPC by TyrNemesis^
  2. prt_in.gat,28,73,4 script Wise Old Woman 78,{
  3. UPGRADEROOT:
  4. mes "[Wise Old Woman]";
  5. mes "Good day, young one. I have the power to remove cards that you have compounded onto your equipment. Does this idea please you?";
  6. next;
  7. menu "Yes, it does.",REMOVEMENU,
  8. "What do you charge?",REMOVEPRICE,
  9. "No thanks.",CLOSEOUT;
  10. REMOVEPRICE:
  11. mes "[Wise Old Woman]";
  12. 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.";
  13. next;
  14. menu "Very well. Let's do it.",REMOVEMENU,
  15. "No thanks.",CLOSEOUT;
  16. REMOVEMENU:
  17. mes "[Wise Old Woman]";
  18. mes "Very well. Which item shall I examine for you?";
  19. next;
  20. menu "I changed my mind.",CLOSEOUT,
  21. getequipname(1),SLOT1,
  22. getequipname(2),SLOT2,
  23. getequipname(3),SLOT3,
  24. getequipname(4),SLOT4,
  25. getequipname(5),SLOT5,
  26. getequipname(6),SLOT6,
  27. getequipname(7),SLOT7,
  28. getequipname(8),SLOT8,
  29. getequipname(9),SLOT9,
  30. getequipname(10),SLOT10;
  31. SLOT1:
  32. set @part,1;
  33. goto CARDNUMCHECK;
  34. SLOT2:
  35. set @part,2;
  36. goto CARDNUMCHECK;
  37. SLOT3:
  38. set @part,3;
  39. goto CARDNUMCHECK;
  40. SLOT4:
  41. set @part,4;
  42. goto CARDNUMCHECK;
  43. SLOT5:
  44. set @part,5;
  45. goto CARDNUMCHECK;
  46. SLOT6:
  47. set @part,6;
  48. goto CARDNUMCHECK;
  49. SLOT7:
  50. set @part,7;
  51. goto CARDNUMCHECK;
  52. SLOT8:
  53. set @part,8;
  54. goto CARDNUMCHECK;
  55. SLOT9:
  56. set @part,9;
  57. goto CARDNUMCHECK;
  58. SLOT10:
  59. set @part,10;
  60. goto CARDNUMCHECK;
  61. CARDNUMCHECK:
  62. if(getequipcardcnt(@part) == 0) goto DENYCARDCOUNT;
  63. set @cardcount,getequipcardcnt(@part);
  64. if(@cardcount > 1) goto CARDNUMMULTIMSG;
  65. mes "[Wise Old Woman]";
  66. 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.";
  67. goto CARDNUMPOSTMSG;
  68. CARDNUMMULTIMSG:
  69. mes "[Wise Old Woman]";
  70. 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.";
  71. CARDNUMPOSTMSG:
  72. next;
  73. menu "Very well. Do it.",REMOVECARDWARNING,
  74. "Never mind.",CLOSEOUT;
  75. REMOVECARDWARNING:
  76. mes "[Wise Old Woman]";
  77. 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?";
  78. next;
  79. menu "I changed my mind about this.",CLOSEOUT,
  80. "The item.",PRIORITYITEM,
  81. "The cards.",PRIORITYCARD;
  82. PRIORITYITEM:
  83. set @failtype,1;
  84. goto REMOVECARD;
  85. PRIORITYCARD:
  86. set @failtype,2;
  87. goto REMOVECARD;
  88. REMOVECARD:
  89. mes "[Wise Old Woman]";
  90. mes "Very well. I shall begin.";
  91. next;
  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. mes "[Wise Old Woman]";
  107. mes "The process was a success. Here are your cards and your item. Farewell.";
  108. close;
  109. FAILREMOVECARD0:
  110. mes "[Wise Old Woman]";
  111. mes "The process was a total failure. I am afraid the item and the cards were destroyed.";
  112. failedremovecards @part,0;
  113. close;
  114. FAILREMOVECARD1:
  115. mes "[Wise Old Woman]";
  116. mes "While I have managed to remove the cards from the item, they were destroyed in the process. The item, however, is okay.";
  117. failedremovecards @part,1;
  118. close;
  119. FAILREMOVECARD2:
  120. mes "[Wise Old Woman]";
  121. mes "Most unfortunate. I succeeded at removing the cards, but the item itself was destroyed in the process.";
  122. failedremovecards @part,2;
  123. close;
  124. FAILREMOVECARD3:
  125. mes "[Wise Old Woman]";
  126. mes "I have failed to remove the cards. Luckily, however, both the item and the cards are still okay.";
  127. failedremovecards @part,3;
  128. close;
  129. DENYCARDCOUNT:
  130. mes "[Wise Old Woman]";
  131. mes "Young one... There are no cards compounded on this item. I can do nothing with it, I'm afraid.";
  132. close;
  133. DENYMATERIAL:
  134. mes "[Wise Old Woman]";
  135. mes "You do not have all the items I require to work my magic, child. Come again when you do.";
  136. close;
  137. CLOSEOUT:
  138. mes "[Wise Old Woman]";
  139. mes "Very well. Return at once if you seek my services.";
  140. close;
  141. }