Advertisement
Guest User

Untitled

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