summaryrefslogtreecommitdiff
path: root/npc/re/merchants/card_separation.txt
blob: 0e5b31ea2953ead563bfcb437c093ef4ceea7bcc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
//================= Hercules Script =======================================
//=       _   _                     _
//=      | | | |                   | |
//=      | |_| | ___ _ __ ___ _   _| | ___  ___
//=      |  _  |/ _ \ '__/ __| | | | |/ _ \/ __|
//=      | | | |  __/ | | (__| |_| | |  __/\__ \
//=      \_| |_/\___|_|  \___|\__,_|_|\___||___/
//================= License ===============================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
//= Copyright (C) 2012-2015  Hercules Dev Team
//= Copyright (C)  Euphy
//= Copyright (C)  Muad_Dib
//=
//= Hercules is free software: you can redistribute it and/or modify
//= it under the terms of the GNU General Public License as published by
//= the Free Software Foundation, either version 3 of the License, or
//= (at your option) any later version.
//=
//= This program is distributed in the hope that it will be useful,
//= but WITHOUT ANY WARRANTY; without even the implied warranty of
//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//= GNU General Public License for more details.
//=
//= You should have received a copy of the GNU General Public License
//= along with this program.  If not, see <http://www.gnu.org/licenses/>.
//=========================================================================
//= Card Separation System
//================= Description ===========================================
//= Separates cards from equipment.
//================= Current Version =======================================
//= 1.1
//=========================================================================

-	script	::CardSeparation_mal	FAKE_NPC,{
	disable_items;
	if (checkweight(Knife,1) == 0) {
		mes "You have too many kinds of objects. Let's try to continue after reducing those objects.";
		close;
	}
	if (MaxWeight - Weight < 10000) {
		mes "Can't continue because you have too many heavy objects. Let's try to continue after reducing the weight.";
		close;
	}
	if (strnpcinfo(NPC_NAME_VISIBLE) == "Jeremy") {
		.@Jeremy = 1;
		.@n$ = "[Jeremy]";
		setarray .@equip_name$[0],  "Armor",  "Shoes",  "Garment", "Upper Hat";
		setarray .@equip_slot[0], EQI_ARMOR,EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP;

		mes .@n$;
		mes "Long time no see~";
		mes "I have learned a new skill that separates cards from Armor, Shoes, Garment and Headgear. Do you want to try it?";
	} else {
		.@Jeremy = 0;
		.@n$ = "[Richard]";
		setarray .@equip_name$[0], "Left hand", "Right hand";
		setarray .@equip_slot[0],   EQI_HAND_L,   EQI_HAND_R;

		mes .@n$;
		mes "Silly Jeremy does not want to touch weapons and shields because of picking several cards that might be damaged. That is why I prepared a card separaion skill for weapons and shields...";
	}
	next;
	mes .@n$;
	mes "Generally the fee is 1,000,000 Zeny. During the card separation, you can use ^990000special items that reduce the rate of destroying equipment or cards^000000. We don't charge additional zeny for this.";
	next;
	mes .@n$;
	mes "There is a possibility of destroying them even using a special item. Also, ^ff0000the refine level might be lost^000000. Do you have any equipment to separate?";
	next;

	for(.@i = 0; .@i<getarraysize(.@equip_slot); ++.@i) {
		if (getequipisequiped(.@equip_slot[.@i]))
			.@menu$ += getequipname(.@equip_slot[.@i])+":";
		else
			.@menu$ += "^999999"+.@equip_name$[.@i]+" (empty)^000000:";
	}

	.@i = select("Stop the work:"+((.@Jeremy)?"How is it possible?":"")+":"+.@menu$);
	switch(.@i) {
	case 1:
		mes .@n$;
		mes "Whenever you need the work, visit me here.";
		close;
	case 2:
		mes .@n$;
		mes "You wonder what is so special. Well, I hate to give only a guide, so let me tell you the story...";
		next;
		mes "^000099Jeremy is stretching his shoulders and hands. He might be waiting for someone to talk with him.^000000";
		next;
		mes .@n$;
		mes "Do you know that Malangdo's specialty is canned food?";
		next;
		select("I knew that well. Is it that limited?");
		mes .@n$;
		mes "Hehe... Everyone loves it. But there were some problems before.";
		next;
		select("Problems? Is there any faulty fish?");
		mes .@n$;
		mes "No, the fish does not have any problem. The problem is lots of fish oil produced after processing. That is such an industrial waste.";
		next;
		mes .@n$;
		mes "However, after a revitalizing refining process, this fish oil became valuable to use for old equipment care and industrial lubricant.";
		next;
		mes .@n$;
		mes "In addition, this oil is so useful to separate relics from equipped weapons that we can't buy Premium Lubricant and Ordinary Lubricant with Zeny.";
		next;
		mes .@n$;
		mes "Well, don't worry about money. Surely the Premium Lubricant is expensive. If you pay some zeny, I can give you cheaper lubricant.";
		next;
		mes .@n$;
		mes "I'm not sure about the quality of success. Anyway, this is so cheap, right?";
		close;
	default:
		.@equip_num = .@equip_slot[.@i-3];
		if (!getequipisequiped(.@equip_num)) {
			mes .@n$;
			if (.@Jeremy)
				mes "In this part, there is nothing?";
			else
				mes "There is nothing on that part?";
			close;
		}
		break;
	}

	setarray .@equip_card, getequipcardid(.@equip_num,0),getequipcardid(.@equip_num,1),getequipcardid(.@equip_num,2),getequipcardid(.@equip_num,3);
	setarray .@mvp_list, Gloom_Under_Night_Card, Golden_Bug_Card, Nidhogg_Shadow_Card, Dark_Lord_Card, Doppelganger_Card,
		Dracula_Card, Drake_Card, Detale_Card, Randgris_Card, B_Seyren_Card,
		Maya_Card, Mistress_Card, Baphomet_Card, Bacsojin_Card, Berzebub_Card,
		Apocalips_H_Card, B_Ygnizem_Card, B_Shecil_Card, Amon_Ra_Card, Atroce_Card,
		B_Eremes_Card, Eddga_Card, Osiris_Card, Orc_Load_Card, Orc_Hero_Card,
		Incant_Samurai_Card, Moonlight_Flower_Card, Ifrit_Card, Lord_Of_Death_Card, Ktullanux_Card,
		Kiel_Card, Thanatos_Card, Lady_Tanee_Card, Fallen_Bishop_Card, Tao_Gunka_Card,
		Turtle_General_Card, Pharaoh_Card, Knight_Windstorm_Card, Phreeoni_Card, B_Katrinn_Card,
		B_Magaleta_Card, Garm_Card, B_Harword_Card, Dark_Snake_Lord_Card, Rsx_0806_Card;
	.@boss_chk = false;

	if (.@Jeremy) {
		.@cardcount = 4;
		for (.@i = 0; .@i < 4; ++.@i) {
			if (.@equip_card[.@i] >= 4700 // Armor Enchant System
			 || .@equip_card[.@i] == 0) {
				.@equip_card[.@i] = 0;
				--.@cardcount;
			}
		}
		if (!.@cardcount) {
			mes .@n$;
			mes "The card is not equipped. Do you want to check again?";
			close;
		}
		for (.@i = 0; .@i < 4; ++.@i) {
			if (.@equip_card[.@i] == 0)
				continue;
			for (.@j = 0; .@j < getarraysize(.@mvp_list); ++.@j) {
				if (.@equip_card[.@i] == .@mvp_list[.@j])
					.@boss_chk = true;
			}
		}
	} else {
		// Official "Richard" script uses a hardcoded list including every possible item.
		//if (!getequipisequiped(.@equip_num)) {
		//	mes "[Richard]";
		//	mes "I'm sorry. We don't provide that equipmnet yet.";
		//	close;
		//}

		mes "[Richard]";
		mes "Which number socket do you want to separate the card? From the left socket, they are sorted 1,2,3,4.";
		next;
		.@menu$ = "";
		for(.@i = 0; .@i<4; ++.@i) {
			if (.@equip_card[.@i] && .@equip_card[.@i] < 4700) // Armor Enchant System
				.@menu$ += "Socket "+(.@i+1)+" - "+getitemname(.@equip_card[.@i])+":";
			else
				.@menu$ += "^777777Socket "+(.@i+1)+" - No card^000000:";
		}
		.@i = select("Stop the work:"+ .@menu$);
		switch(.@i) {
		case 1:
			mes .@n$;
			mes "Whenever you need to work, please come to me.";
			close;
		default:
			.@slot = .@i-2;
			if (.@equip_card[.@slot] == 0 || .@equip_card[.@slot] >= 4700) {
				mes .@n$;
				mes "This socket is not equipped with any card. Why don't you check again?";
				close;
			}
			break;
		}
		for (.@i = 0; .@i < getarraysize(.@mvp_list); ++.@i) {
			if (.@equip_card[.@slot] == .@mvp_list[.@i])
				.@boss_chk = true;
		}
	}
	if (!.@boss_chk) {
		mes .@n$;
		if (.@Jeremy)
			mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:";
		else
			mes "Please choose the working fee.";
		next;
		.@menu$ = "Next time...:"+
			((Zeny >= 1000000)?"Use 1,000,000z (Do not use special item):":"^999999Use 1,000,000z (Insufficient)^000000:")+
			((countitem(High_RankLubricant))?"Use Premium Lubricant:":"^999999Premium Lubricant (Insufficient)^000000:")+
			((countitem(General_Lubricant))?"Use Ordinary Lubricant":"^999999Ordinary Lubricant (Insufficient)^000000");
		switch(select(.@menu$)) {
		case 1:
			mes .@n$;
			mes "Whenever you need the work, visit me here.";
			close;
		case 2:
			if (Zeny < 1000000) {
				mes .@n$;
				mes "You don't have enough zeny. Please come back with enough fees.";
				close;
			}
			mes .@n$;
			mes "This is pretty old equipment. There is a high rate of destroying the cards or equipment during the work. Are you sure you want to continue?";
			next;
			if(select("Next time...", "Continue") == 1) {
				mes .@n$;
				mes "Whenever you need the work, visit me here.";
				close;
			}
			.@sf_c_num = 150;
			.@sf_r_num = 150;
			.@sf_w_num = 150;
			Zeny -= 1000000;
			break;
		case 3:
			if (countitem(High_RankLubricant) == 0) {
				mes .@n$;
				mes "You don't have Premium Lubricant.";
				close;
			}
			mes .@n$;
			mes "If you use the Premium Lubricant, the rate of destruction will be decreased highly, but I can't give you a 100% guarantee. Are you sure you want to continue?";
			next;
			if(select("Next time...", "Continue") == 1) {
				mes .@n$;
				mes "Whenever you need the work, visit me here.";
				close;
			}
			.@sf_c_num = 75;
			.@sf_r_num = 75;
			.@sf_w_num = 75;
			delitem High_RankLubricant,1;
			break;
		case 4:
			if (countitem(General_Lubricant) == 0) {
				mes .@n$;
				mes "You don't have Ordinary Lubricant.";
				close;
			}
			mes .@n$;
			mes "If you use the Ordinary Lubricant, the rate of destruction will be decreased highly, but I can't give you a 100% guarantee. Are you sure you want to continue?";
			next;
			if(select("Next time...", "Continue") == 1) {
				mes .@n$;
				mes "Whenever you need the work, visit me here.";
				close;
			}
			.@sf_c_num = 75;
			.@sf_r_num = 150;
			.@sf_w_num = 150;
			delitem General_Lubricant,1;
			break;
		}
	} else {
		mes .@n$;
		mes "This equipment contains a precious MVP card. This card can't be separated with lubricant. If you bring the super surfactant ^0000ffSillit Pong^000000, I will be able to work.";
		next;
		switch(select("Next time...", "I have a Sillit Pong.")) {
		case 1:
			mes .@n$;
			mes "Whenever you need the work, visit me here.";
			close;
		case 2:
			if (countitem(Sillit_Pong_Bottle) == 0) {
				mes .@n$;
				mes "You don't have Sillit Pong.";
				close;
			}
			break;
		}
		mes .@n$;
		if (.@Jeremy) {
			mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:";
			.@menu$ = "Alright, let's do it!";
		} else {
			mes "May I continue?";
			.@menu$ = "I got it. Just do it quickly!";
		}
		next;
		switch(select("Next time...:"+ .@menu$)) {
		case 1:
			mes .@n$;
			mes "Whenever you need the work, visit me here.";
			close;
		case 2:
			.@sf_c_num = 60;
			.@sf_r_num = 60;
			.@sf_w_num = 60;
			delitem Sillit_Pong_Bottle,1;
			break;
		}
	}

	.@equip_id = getequipid(.@equip_num);
	.@equip_refine = getequiprefinerycnt(.@equip_num);
	delequip .@equip_num;

	// Chance of retaining refine level.
	if (rand(1,.@sf_r_num) >= 61)
		.@equip_refine = 0;

	if (.@Jeremy) {
		// Chance of retaining equipment.
		if (rand(1,.@sf_w_num) < 61) {
			.@equip_safe = 1;
			getitem2 .@equip_id,1,1,.@equip_refine,0,0,0,0,0;
		}

		// Chance of retaining cards.
		for(.@i = 0; .@i<4; ++.@i) {
			if (.@equip_card[.@i]) {
				if (rand(1,.@sf_c_num) < 61)
					getitem .@equip_card[.@i],1;
				else
					.@card_break = 1;
			}
		}
	} else {
		.@card = .@equip_card[.@slot];
		.@equip_card[.@slot] = 0;

		// Chance of retaining equipment.
		if (rand(1,.@sf_w_num) < 61) {
			.@equip_safe = 1;
			getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
		}

		// Chance of retaining card.
		if (rand(1,.@sf_c_num) < 61)
			getitem .@card,1;
		else
			.@card_break = 1;
	}

	// Display corresponding effect.
	if (!.@equip_safe && .@card_break)
		specialeffect2 EF_LORD;
	else if (.@equip_safe && .@card_break)
		specialeffect2 EF_SUI_EXPLOSION;
	else if (!.@equip_safe && !.@card_break)
		specialeffect2 EF_FIREPILLAR;
	else
		specialeffect2 EF_MAXPOWER;

	// Output results.
	mes "-- Result of Card Separation --";
	if (.@equip_safe) {
		mes "Crack has not occured during the card separation process.";
		mes "^0000FFEquipment separation is normal.^000000";
	} else {
		mes "Crack has occured during the card separation process.";
		mes "Equipment has been damaged. ^ff0000Unrecoverable.^000000";
	}
	mes "-------------------";
	if (!.@card_break) {
		mes "Erosion of surface has not occured during the card separation process.";
		mes "^0000ffCard separation has succeeded.^000000";
	} else {
		mes "Erosion of surface has occured during the card separation process.";
		mes "Card has been damaged. ^ff0000Unrecoverable.^000000";
	}
	next;
	mes .@n$;
	mes "That is all for the results of the card separation. Please come again.";
	close;
}
malangdo,215,166,4	duplicate(CardSeparation_mal)	Jeremy#pa0829	4_CAT_DOWN
malangdo,208,166,6	duplicate(CardSeparation_mal)	Richard#pa0829	4_CAT_ADV1