summaryrefslogtreecommitdiff
path: root/npc/re/merchants/enchan_upg.txt
blob: c72479f38f734bac2bb9d040cc81158f4840aacd (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
//===== Hercules Script ======================================
//= Upgrade Weapon Enchants
//===== By: ==================================================
//= Skorm
//===== Current Version: =====================================
//= 1.1
//===== Description: =========================================
//= [Official Conversion]
//= Adds enchantments to Upgrade weapons.
//===== Additional Comments: =================================
//= 1.0 First version.
//= 1.1 Standardizing, grammar and bug fixes. [Euphy]
//============================================================

prt_in,28,73,3	script	Devil Enchant Master#prq	1_M_SMITH,{
	disable_items;
	if (checkweight(1201,1) == 0) {
		mes "You are carrying too many items, please reduce it and come back again!";
		close;
	}
	if (MaxWeight - Weight < 10000) {
		mes "You are over the weight limit, please reduce it and come back again!";
		close;
	}
	mes "[Devil Enchant Master]";
	mes "Yes?";
	mes "You are looking for me?";
	next;
	switch(select("This is the first time seeing you!:I heard that you are the best!:Please initialize the enchant.")) {
	case 1:
		mes "[Devil Enchant Master]";
		mes "Ha ha ha~ Of course, I am not the kind of person that simply deals with people.";
		next;
		mes "[Devil Enchant Master]";
		mes "Including you! Even if you offer me plenty of money, I will not simply enchant for you!!";
		next;
		mes "[Devil Enchant Master]";
		mes "Have you seen my title? Very few people have this title for a reason!";
		next;
		mes "[Devil Enchant Master]";
		mes "I will only enchant if you bring an ^0000ffEnchant Book^000000 along!";
		next;
		mes "[Devil Enchant Master]";
		mes "Else, I will not enchant for you....";
		close;
	case 2:
		if (!countitem(6484)) {
			mes "[Devil Enchant Master]";
			mes "Are you listening to me? I will only do for you if you bring the Enchant Book!";
			close;
		}
		set .@select,1;
		break;
	case 3:
		mes "[Devil Enchant Master]";
		if (Zeny < 100000) {
			mes "Initializing will cost 100,000 zeny. It seems you do not have enough zeny...";
			close;
		}
		mes "Initializing will cost 100,000 zeny and confirming whether the weapon is enchanted!";
		next;
		if (select("Let me think about it.:Initialize it now!") == 1) {
			mes "[Devil Enchant Master]";
			mes "Come back after you have confirmed!";
			close;
		}
		set .@select,2;
		break;
	}
	set .@part, EQI_HAND_R;

	mes "[Devil Enchant Master]";
	if (!getequipisequiped(.@part)) {
		mes "Are you trying to remove the enchanted equipment?";
		close;
	}
	setarray .@equip_card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
	if (!getequipisequiped(.@part)) {
		mes "It is dangerous to remove equipment during enchant process!";
		close;
	}
	set .@equip_id, getequipid(.@part);
	set .@item$, "|1292|1394|1491|1585|2015|13071|13115|16019|18112|21000|";
	if (!compare(.@item$,"|"+.@equip_id+"|")) {
		mes "I don't want to touch your equipment now!";
		close;
	}
	set .@equip_refine, getequiprefinerycnt(.@part);

	if (.@select == 1) {
		if (!countitem(6484)) {
			mes "Are you listening to me? I will only do for you if you bring the Enchant Book!";
			close;
		}
		mes "Which type of effect do you want to enchant?";
		next;
		switch(select("Let me think about it.:Physical Series:Magical Series")) {
		case 1:
			mes "[Devil Enchant Master]";
			mes "Come back again after you change your mind!";
			close;
		case 2:
			set .@enc_type,1;
			break;
		case 3:
			set .@enc_type,2;
			break;
		}
		mes "[Devil Enchant Master]";
		if (.@equip_card[3]) {
			mes "This equipment has been enchanted! You need to initialize first before you want to enchant it again.";
			close;
		}
		mes "The enchant process might fail, and ^ff0000it will reduce partial refine level^000000, but the slotted card and weapon will not be broken! Are you sure you want to continue?";
		next;
		if (select("Next time!:Start now!") == 1) {
			mes "[Devil Enchant Master]";
			mes "Come back again after you have decided!";
			close;
		}
		if (.@equip_card[3]) {
			mes "[Devil Enchant Master]";
			mes "It seems there's a problem, let me take a look.";
			close;
		}

		if (.@enc_type == 1) { // Physical Series
			set .@i, rand(1,1300);
			     if (.@i < 51)    set .@enchant,4734; //Agility5
			else if (.@i < 76)    set .@enchant,4735; //Agility6
			else if (.@i < 88)    set .@enchant,4736; //Agility7
			else if (.@i < 93)    set .@enchant,4737; //Agility8
			else if (.@i < 95)    set .@enchant,4738; //Agility9
			else if (.@i < 96)    set .@enchant,4739; //Agility10
			else if (.@i < 146)   set .@enchant,4724; //Dexterity5
			else if (.@i < 171)   set .@enchant,4725; //Dexterity6
			else if (.@i < 183)   set .@enchant,4726; //Dexterity7
			else if (.@i < 188)   set .@enchant,4727; //Dexterity8
			else if (.@i < 190)   set .@enchant,4728; //Dexterity9
			else if (.@i < 191)   set .@enchant,4729; //Dexterity10
			else if (.@i < 291)   set .@enchant,4704; //Strength5
			else if (.@i < 341)   set .@enchant,4705; //Strength6
			else if (.@i < 366)   set .@enchant,4706; //Strength7
			else if (.@i < 378)   set .@enchant,4707; //Strength8
			else if (.@i < 383)   set .@enchant,4708; //Strength9
			else if (.@i < 384)   set .@enchant,4709; //Strength10
			else if (.@i < 434)   set .@enchant,4754; //Luck5
			else if (.@i < 459)   set .@enchant,4755; //Luck6
			else if (.@i < 471)   set .@enchant,4756; //Luck7
			else if (.@i < 476)   set .@enchant,4757; //Luck8
			else if (.@i < 478)   set .@enchant,4758; //Luck9
			else if (.@i < 479)   set .@enchant,4759; //Luck10
			else if (.@i < 679)   set .@enchant,4744; //Vitality5
			else if (.@i < 779)   set .@enchant,4745; //Vitality6
			else if (.@i < 829)   set .@enchant,4746; //Vitality7
			else if (.@i < 854)   set .@enchant,4747; //Vitality8
			else if (.@i < 866)   set .@enchant,4748; //Vitality9
			else if (.@i < 867)   set .@enchant,4749; //Vitality10
			else if (.@i < 967)   set .@enchant,4808; //Fighting_Spirit4
			else if (.@i < 992)   set .@enchant,4820; //Fighting_Spirit5
			else if (.@i < 1092)  set .@enchant,4835; //Expert_Archer4
			else if (.@i < 1117)  set .@enchant,4836; //Expert_Archer5
			else if (.@i < 1217)  set .@enchant,4835; //Expert_Archer4
			else if (.@i < 1242)  set .@enchant,4836; //Expert_Archer5
			else set .@enchant,0;
		} else if (.@enc_type == 2) { // Magical Series
			set .@i, rand(1,1200);
			     if (.@i < 51)    set .@enchant,4714; //Inteligence5
			else if (.@i < 76)    set .@enchant,4715; //Inteligence6
			else if (.@i < 88)    set .@enchant,4716; //Inteligence7
			else if (.@i < 93)    set .@enchant,4717; //Inteligence8
			else if (.@i < 95)    set .@enchant,4718; //Inteligence9
			else if (.@i < 96)    set .@enchant,4719; //Inteligence10
			else if (.@i < 146)   set .@enchant,4724; //Dexterity5
			else if (.@i < 171)   set .@enchant,4725; //Dexterity6
			else if (.@i < 183)   set .@enchant,4726; //Dexterity7
			else if (.@i < 188)   set .@enchant,4727; //Dexterity8
			else if (.@i < 190)   set .@enchant,4728; //Dexterity9
			else if (.@i < 191)   set .@enchant,4729; //Dexterity10
			else if (.@i < 291)   set .@enchant,4734; //Agility5
			else if (.@i < 341)   set .@enchant,4735; //Agility6
			else if (.@i < 366)   set .@enchant,4736; //Agility7
			else if (.@i < 378)   set .@enchant,4737; //Agility8
			else if (.@i < 383)   set .@enchant,4738; //Agility9
			else if (.@i < 384)   set .@enchant,4739; //Agility10
			else if (.@i < 484)   set .@enchant,4754; //Luck5
			else if (.@i < 534)   set .@enchant,4755; //Luck6
			else if (.@i < 559)   set .@enchant,4756; //Luck7
			else if (.@i < 571)   set .@enchant,4757; //Luck8
			else if (.@i < 576)   set .@enchant,4758; //Luck9
			else if (.@i < 577)   set .@enchant,4759; //Luck10
			else if (.@i < 777)   set .@enchant,4744; //Vitality5
			else if (.@i < 877)   set .@enchant,4745; //Vitality6
			else if (.@i < 927)   set .@enchant,4746; //Vitality7
			else if (.@i < 952)   set .@enchant,4747; //Vitality8
			else if (.@i < 964)   set .@enchant,4748; //Vitality9
			else if (.@i < 969)   set .@enchant,4749; //Vitality10
			else if (.@i < 1069)  set .@enchant,4812; //Spell4
			else if (.@i < 1094)  set .@enchant,4826; //Spell5
			else if (.@i < 1119)  set .@enchant,4761; //Matk2
			else if (.@i < 1124)  set .@enchant,4806; //Matk3
			else set .@enchant,0;
		} else {
			mes "[Devil Enchant Master]";
			mes "Hmm! This item is having a problem, please check it again!";
			close;
		}
		mes "[Devil Enchant Master]";
		if (.@equip_card[3]) {
			mes "This item has been enchanted!";
			close;
		}
		if (!countitem(6484)) {
			mes "Are you listening to me? I will only do for you if you bring the Enchant Book!";
			close;
		}
		if (.@enchant == 0) {
			specialeffect EF_SHIELDCHARGE;
			mes "Oh! Unbelievable!! It failed!! Please come again!";
			set .@lost_refine, rand(0,.@equip_refine);
			set .@equip_refine, .@equip_refine - .@lost_refine;
		} else {
			specialeffect EF_REPAIRWEAPON;
			mes "The slot ^9900004^000000 has been enchanted!";
		}
		delitem 6484,1; //Enchant_Book
		delequip .@part;

//		GetNonSlotItemSock2 .@equip_refine .@equip_id .@equip_card[0] .@equip_card[1] .@equip_card[2] .@enchant
		getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@enchant;

		if (.@lost_refine) {
			next;
			mes "[Devil Enchant Master]";
			mes "The failure has reduced the refine by "+.@lost_refine+" level"+((.@lost_refine == 1)?"":"s")+"! Don't be depressed!";
		}
		close;
	} else if (.@select == 2) {
		if (Zeny < 100000) {
			mes "You need to bring some money to initialize!!";
			close;
		}
		if (.@equip_card[3] < 4700) { // Armor Enchant System
			mes "This item is not enchanted!";
			close;
		}
		if (!getequipisequiped(.@part)) {
			mes "Are you unequipping now?";
			close;
		}
		specialeffect EF_REPAIRWEAPON;
		mes "I initialized the enchant effects.";
		set Zeny, Zeny - 100000;
		delequip .@part;

//		GetNonSlotItemSock2 .@equip_refine .@equip_id .@equip_card[0] .@equip_card[1] .@equip_card[2] 0
		getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],0;

		close;
	} else {
		mes "It seems you have chosen the wrong job??";
		close;
	}
}