summaryrefslogtreecommitdiff
path: root/npc/merchants/grandpa_pharmacist.txt
blob: 35e662a851b821d73a30fd44672a250e3cd92cf1 (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
//===== eAthena Script ======================================= 
//= Grandpa Pharmacist
//===== By: ================================================== 
//= kobra_k88
//===== Current Version: ===================================== 
//= 1.1
//===== Compatible With: ===================================== 
//= eAthena 7.15 +
//===== Description: ========================================= 
//= trade in items for potions
//===== Additional Comments: ================================= 
//= Fully working
//= 1.1 Negative input bug fixed [Lupus]
//============================================================ 




alberta_in.gat,16,28,4	script	Grampa Pharmacist	61,
{
	set @count, 0;

	mes "[Grampa Pharmacist]";
	mes "Hmmm... what do you want...?";
	next;
	menu "Make Potion",M_Make, "Talk",M_Talk, "Information",M_Info, "Cancel",M_End;
	
	M_Make:
		if(countitem(713) < 1) goto ssL_NdBottle;
		mes "[Grampa Pharmacist]";
		mes "Did you prepare all the items needed? If so what potion do you want?";
		M_Menu:
		next;
		menu 	"Red Potion",M_0, "Orange Potion",M_1, "Yellow Potion",M_2, "White Potion",M_3, "Blue Potion",M_4, "Green Potion",M_5,
			"Nah, I change my mind.",M_End;
		
		M_0:
			set @pot$, "red";
			set @pot, 501;
			set @item1, 507;
			set @zeny, 3;
			goto sL_Make;
		M_1:
			if(countitem(507)<1 || countitem(508)<1) goto ssL_NdHerbs;
			if(Zeny < 5) goto ssL_NdZeny;
			set @pot$, "orange";
			set @pot, 502;
			mes "[Grampa Pharmacist]";
			mes "How many?";
			next;
			menu "As many as possible.",sM_1a, "I will set the amount.",sM_1b, "Nah, forget about it",M_Menu;

			sM_1a:
				if(countitem(507)<1 || countitem(508)<1 || countitem(713)<1 || Zeny< 5) goto ssL_End;
				set @count, @count +1;
				delitem 507, 1;
				delitem 508, 1;
				delitem 713, 1;
				set Zeny, Zeny - 5;
				goto sM_1a;

			sM_1b:
				input @count;
				if(@count<1) goto ssL_NdNegative;
				if(countitem(507)<@count || countitem(508)<@count) goto ssL_NdHerbs;
				if(countitem(713) < @count) goto ssL_NdBottle;
				if(Zeny<(5*@count)) goto ssL_NdZeny;
				delitem 507, @count;
				delitem 508, @count;
				delitem 713, @count;
				set Zeny, Zeny - (@zeny*@count);
				goto ssL_End;

		M_2:
			set @pot$, "yellow";
			set @pot, 503;
			set @item1, 508;
			set @zeny, 10;
			goto sL_Make;
		M_3:
			set @pot$, "white";
			set @pot, 504;
			set @item1, 509;
			set @zeny, 20;
			goto sL_Make;
		M_4:
			set @pot$, "blue";
			set @pot, 505;
			set @item1, 510;
			set @zeny, 30;
			goto sL_Make;
		M_5:
			set @pot$, "green";
			set @pot, 506;
			set @item1, 511;
			set @zeny, 3;

		sL_Make:
			if(countitem(@item1) < 2) goto ssL_NdHerbs;
			if(Zeny < @zeny) goto ssL_NdZeny;

			mes "[Grampa Pharmacist]";
			mes "How many?";
			next;
			menu "As many as possible.",sM_0a, "I will set the amount.",sM_0b, "Nah, forget about it",M_Menu;

			sM_0a:
				if((countitem(@item1) < 2) || (countitem(713) < 1) || (Zeny < @zeny)) goto ssL_End;
				set @count, @count +1;
				delitem @item1, 2;
				delitem 713, 1;
				set Zeny, Zeny - @zeny;
				goto sM_0a;
				
			sM_0b:
				input @count;
				if(@count<1) goto ssL_NdNegative;
				if(countitem(@item1) < (2*@count)) goto ssL_NdHerbs;
				if(countitem(713) < @count) goto ssL_NdBottle;
				if(Zeny < (@zeny*@count)) goto ssL_NdZeny;
				delitem @item1, (2*@count);
				delitem 713, @count;
				set Zeny, Zeny - (@zeny*@count);

			ssL_End:
				mes "[Grampa Pharmacist]";
				mes "Here are your "+@pot$+" potions.";
				getitem @pot, @count;
				close;

			ssL_NdBottle:
				mes "[Grampa Pharmacist]";
				mes "You don't have enough empty tubes to put the medicine in you idiot!!";
				close;

			ssL_NdHerbs:
				mes "[Grampa Pharmacist]";
				mes "You rascal! What did you expect from me? You didn't even bring all of the right herbs!";
				mes "Get lost!";
				close;

			ssL_NdNegative:
				mes "[Grampa Pharmacist]";
				mes "You dirty cheater!  What did you expect from me?  Next time set positive amount of the potions!";
				mes "Get off!";
				close;

			ssL_NdZeny:
				mes "[Gramp Pharmacist]";
				mes "You don't have enough zeny for potions.";
				close;

	M_Talk:
		mes "[Grampa Pharmacist]";
		mes "The right type of medicinal Herbs can replenish a person's HP or SP.";
		mes "~Sigh~ I'm starting to reminisce about my youth.... a sign that I must be getting old.....";
		next;
		mes "[Grampa Pharmacist]";
		mes "Anyways, a potion is merely an, 'easy to use', form of medicinal Herbs..... nothing more and nothing less.";
		close;
	M_Info:
		mes "[Grampa Pharmacist]";
		mes "~Sigh~... you young ones can be quite bothersome... Fine, I will explain to you how potions work....";
		next;
		mes "[Grampa Pharmacist]";
		mes "Though the bennefits from consuming the various Herbs found around Rune-Midgard are great......";
		mes "By refining them into potions, the effects of the Herbs are dramatically enhanced.";
		next;
		mes "[Grampa Pharmacist]";
		mes "The process of refining herbs into potions is a special one that I created.  For a small fee I can make any potion you desire.";
		next;
		mes "[Grampa Pharmacist]";
		mes "^FF5533Red Potion^000000 - 2 Red Herbs, 1 Empty Bottle, 2 Zeny fee.";
		mes "^FF8000Orange Potion^000000 - 1 Red Herb, 1 Yellow Herb, 1 Empty Bottle, 5 Zeny fee.";
		mes "^E8CF20Yellow Potion^000000 - 2 Yellow Herbs, 1 Empty Bottle, 10 Zeny fee.";
		next;
		mes "[Grampa Pharmacist]";
		mes "^999999White Potion^000000 -  2 White Herbs, 1 Empty Bottle, 20 Zeny fee.";
		mes "^3355FFBlue Potion^000000 - 2 Blue Herbs, 1 Empty Bottle, 30 Zeny fee.";
		mes "^00B000Green Potion^000000 - 2 Green Herbs, 1 Empty Bottle, 3 Zeny fee.";
		close;
	M_End:
		mes "[Grampa Pharmacist]";
		mes "Didn't you have something to say?!";
		close;
}