root/npc/custom/card_remover.txt @ 1

Revision 1, 5.3 kB (checked in by jinshiro, 17 years ago)
RevLine 
[1]1// Card removal NPC by TyrNemesis^
2// DANGEROUS! TODO: Think.. think 8) [Lupus]
3
4
5prt_in,28,73,4  script  Wise Old Woman  78,{
6
7UPGRADEROOT:
8        mes "[Wise Old Woman]";
9        mes "Good day, young one. I have the power to remove cards that you have compounded onto your equipment. Does this idea please you?";
10        next;
11        menu "Yes, it does.",REMOVEMENU,
12             "What do you charge?",REMOVEPRICE,
13             "No thanks.",CLOSEOUT;
14
15REMOVEPRICE:
16        mes "[Wise Old Woman]";
17        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.";
18        next;
19        menu "Very well. Let's do it.",REMOVEMENU,
20             "No thanks.",CLOSEOUT;
21
22REMOVEMENU:
23        mes "[Wise Old Woman]";
24        mes "Very well. Which item shall I examine for you?";
25        next;
26        menu "I changed my mind.",CLOSEOUT,
27             getequipname(1),SLOT1,
28             getequipname(2),SLOT2,
29             getequipname(3),SLOT3,
30             getequipname(4),SLOT4,
31             getequipname(5),SLOT5,
32             getequipname(6),SLOT6,
33             getequipname(7),SLOT7,
34             getequipname(8),SLOT8,
35             getequipname(9),SLOT9,
36             getequipname(10),SLOT10;
37
38SLOT1:
39        set @part,1;
40        goto CARDNUMCHECK;
41
42SLOT2:
43        set @part,2;
44        goto CARDNUMCHECK;
45
46SLOT3:
47        set @part,3;
48        goto CARDNUMCHECK;
49
50SLOT4:
51        set @part,4;
52        goto CARDNUMCHECK;
53
54SLOT5:
55        set @part,5;
56        goto CARDNUMCHECK;
57
58SLOT6:
59        set @part,6;
60        goto CARDNUMCHECK;
61
62SLOT7:
63        set @part,7;
64        goto CARDNUMCHECK;
65
66SLOT8:
67        set @part,8;
68        goto CARDNUMCHECK;
69
70SLOT9:
71        set @part,9;
72        goto CARDNUMCHECK;
73
74SLOT10:
75        set @part,10;
76        goto CARDNUMCHECK;
77
78CARDNUMCHECK:
79        if(getequipcardcnt(@part) == 0) goto DENYCARDCOUNT;
80        set @cardcount,getequipcardcnt(@part);
81
82        // Ensure there is room for the items.
83        if (!checkweight(1202,(@cardcount+1))) {
84                mes "^3355FFJust a minute!";
85                mes "I can't offer any of my";
86                mes "services to you because";
87                mes "you're carrying too much";
88                mes "stuff. Put your extra items in";
89                mes "Kafra Storage and come again~";
90                close;
91        }
92
93        if(@cardcount > 1) goto CARDNUMMULTIMSG;
94        mes "[Wise Old Woman]";
95        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.";
96        goto CARDNUMPOSTMSG;
97CARDNUMMULTIMSG:
98        mes "[Wise Old Woman]";
99        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.";
100CARDNUMPOSTMSG:
101        next;
102        menu "Very well. Do it.",REMOVECARDWARNING,
103             "Never mind.",CLOSEOUT;
104
105REMOVECARDWARNING:
106        mes "[Wise Old Woman]";
107        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?";
108        next;
109        menu "I changed my mind about this.",CLOSEOUT,
110             "The item.",PRIORITYITEM,
111             "The cards.",PRIORITYCARD;
112
113PRIORITYITEM:
114        set @failtype,1;
115        goto REMOVECARD;
116
117PRIORITYCARD:
118        set @failtype,2;
119        goto REMOVECARD;
120
121REMOVECARD:
122        mes "[Wise Old Woman]";
123        mes "Very well. I shall begin.";
124        if((zeny < (200000+(@cardcount * 25000))) || (countitem(1000) < 1) || (countitem(715) < 1)) goto DENYMATERIAL;
125        set zeny,zeny - (200000+(@cardcount * 25000));
126        delitem 1000,1;
127        delitem 715,1;
128// Replace the constants in the next 3 lines with failure chance values defined in refine_db.txt
129// First value = Total failure chance (item and cards destroyed)
130// Second value = Partial failure chance (one or the other is destroyed, player decides which one is safe)
131// Third value = Harmless failure chance (all that's lost is your investment)
132
133        set @failchance,rand(100);
134//      if(@failchance < 2) goto FAILREMOVECARD0;
135//      if((@failchance < 8) && (@failtype == 1)) goto FAILREMOVECARD1;
136//      if((@failchance < 8) && (@failtype == 2)) goto FAILREMOVECARD2;
137        if(@failchance < 10) goto FAILREMOVECARD3;
138        successremovecards @part;
139        next;
140        mes "[Wise Old Woman]";
141        mes "The process was a success. Here are your cards and your item. Farewell.";
142        close;
143
144FAILREMOVECARD0:
145        failedremovecards @part,0;
146        next;
147        mes "[Wise Old Woman]";
148        mes "The process was a total failure. I am afraid the item and the cards were destroyed.";
149        close;
150
151FAILREMOVECARD1:
152        failedremovecards @part,1;
153        next;
154        mes "[Wise Old Woman]";
155        mes "While I have managed to remove the cards from the item, they were destroyed in the process. The item, however, is okay.";
156        close;
157
158FAILREMOVECARD2:
159        failedremovecards @part,2;
160        next;
161        mes "[Wise Old Woman]";
162        mes "Most unfortunate. I succeeded at removing the cards, but the item itself was destroyed in the process.";
163        close;
164
165FAILREMOVECARD3:
166        failedremovecards @part,3;
167        next;
168        mes "[Wise Old Woman]";
169        mes "I have failed to remove the cards. Luckily, however, both the item and the cards are still okay.";
170        close;
171
172DENYCARDCOUNT:
173        mes "[Wise Old Woman]";
174        mes "Young one... There are no cards compounded on this item. I can do nothing with it, I'm afraid.";
175        close;
176
177DENYMATERIAL:
178        next;
179        mes "[Wise Old Woman]";
180        mes "You do not have all the items I require to work my magic, child. Come again when you do.";
181        close;
182
183CLOSEOUT:
184        mes "[Wise Old Woman]";
185        mes "Very well. Return at once if you seek my services.";
186        close;
187}
Note: See TracBrowser for help on using the browser.