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
|
// TMW-2 Script.
// Author:
// Saulc
// Jesusalva
// Notes:
// Buys Tonori Delight
009-2,29,57,0 script Ryan NPC_PLAYER,{
if (BaseLevel < 17) goto L_Weak;
if (!getq(HalinarzoQuest_LifeDelight)) goto L_Prologue;
.@q=getq2(HalinarzoQuest_LifeDelight);
// This code is duplicated in npc/024-1/john.txt
if (.@q < 20)
.@a=(.@q**2)+18;
else if (.@q < 40)
.@a=400+18*(.@q-24);
else if (.@q < 50)
.@a=670+10*(.@q-39);
else
.@a=780+(.@q*(.@q < 75 ? 1 : 2));
if (.@q > 100) goto L_Complete;
mesn;
mesq l("Ah, I just wanted @@... Yummy, lovely @@...", getitemlink(TonoriDelight), getitemlink(TonoriDelight));
next;
mesn;
mesq l("If you bring me @@ @@, I'll give you a reward!", .@a, getitemlink(TonoriDelight));
next;
select
rif(countitem(TonoriDelight) >= .@a, l("I have everything!")),
rif(getskilllv(TMW2_COOKING), l("Actually, could you teach me some recipes?")),
l("Ah, not now...");
mes "";
if (@menu == 2) goto L_Cooking;
if (@menu == 3)
close;
inventoryplace ChefHat, 1;
inventoryplace PlatinumIngot, 1, IridiumIngot, 2;
// Generic rewards: XP Boost (.@l) and GP boost (.p)
.@l=BaseLevel+JobLevel;
// Main reward
delitem TonoriDelight, .@a;
getexp rand(.@a, .@a*2)+.@q*rand(10,30), .@l;
Zeny=Zeny+.@a*.p;
setq2 HalinarzoQuest_LifeDelight, .@q+1;
mesn;
mesq l("Hmmm... Yummy!");
// Landmark rewards
// Chef hat last stage: 120 Delights - 583 in total
.@r=getq(HalinarzoQuest_LifeDelight);
.@q=getq2(HalinarzoQuest_LifeDelight);
if (.@r < 2 && .@q >= 11) {
setq1 HalinarzoQuest_LifeDelight, 2;
getitem ChefHat, 1;
getexp 13500, 10;
next;
mesn;
mesq l("Ah, you really deserve this @@. Good job!", getitemlink(ChefHat));
}
// Bonus stage
if (.@q == 20)
getitem Coffee, 1;
if (.@q >= 21) {
Zeny+=rand2(1,.@a)*.p;
getexp rand2(1,.@q)*.@l, rand2(1, .@q);
Mobpt+=.@q; // From now on, Monster Points will be generated
}
// Bonus stage
if (.@q == 30)
getitem Manapple, 1;
// Bonus stage
if (.@q == 40)
getitem LoFWarpCrystal, 1;
// Elixir Of Life last stage: ~780 Delights - 20,890 in total
if (.@r < 3 && .@q >= 51) {
setq1 HalinarzoQuest_LifeDelight, 3;
getitem ElixirOfLife, 1;
getitem MylarinDust, 1;
getexp 30000, 5000;
next;
mesn;
mesq l("Hey, take this @@. It heals fully but who cares, I have Tonori Delight!", getitemlink(ElixirOfLife));
}
if (.@q >= 51) {
Zeny+=rand2(.@q,.@a)*.p;
getexp rand2(1,.@a)*.@l, rand2(1, .@q);
}
// Bonus stage
if (.@q == 60)
getitem SacredLifePotion, 1;
// Bonus stage
if (.@q == 70)
getitem MercBoxDD, 1;
// Bonus stage
if (.@q == 80)
getitem DivineApple, 1;
// Bonus stage
if (.@q == 90)
getitem MysteriousFruit, 1;
if (.@q >= 91) {
Zeny+=rand2(.@a, .@a+.@q)*.p;
getexp rand2(.@q,.@a)*.@l, rand2(1, .@q);
}
// Platinum + Iridium last stage: ~980 Delights - 64,960 in total
if (.@r < 4 && .@q == 100) {
setq1 HalinarzoQuest_LifeDelight, 4;
kamibroadcast(sprintf("Hear me, hear me! %s is the coolest player in the whole world!!!!", strcharinfo(0)), "Ryan Henryfield");
getitem SunnyCrystal, 1;
getitem PlatinumIngot, 1;
getitem IridiumIngot, 2;
getitem SaviorBlueprint, 1;
getitem EquipmentBlueprintE, 2;
getitem AlchemyBlueprintE, 2;
Mobpt+=1000000; // 1 Million Monster Points
getexp 500000, 50000; // Reference: Lv 74 / Lv 38
next;
mesn;
mesq l("Ah, I have enough @@ for a life! Take this EXTREMELY RARE @@. Good job!", getitemlink(TonoriDelight), getitemlink(SunnyCrystal));
mesc l("Got Master Blueprints!");
mesc l("Got 1,000,000 Monster Points!");
// Heheheh...
$@DROP_EVENT=25;
$@DROP_EVENT_TIME=1;
donpcevent "@droprate::OnPlayerCall";
}
close;
L_Complete:
mesn;
mesq l("Thanks for the help! Yummy!");
close;
L_Weak:
mesn;
mesq l("How did you even got here? There are dangerous swamps north, and dangerous deserts south...");
close;
L_Prologue:
setq HalinarzoQuest_LifeDelight, 1, 0;
mesn;
mesq l("Ah, I just wanted @@... Yummy, lovely @@...", getitemlink(TonoriDelight), getitemlink(TonoriDelight));
next;
mesn;
mesq l("There's a big prize in the end... Could you bring me some later?");
close;
L_Cooking:
.@total = getq3(HalinarzoQuest_LifeDelight);
mesn;
mesq l("Hmmm? Oh, a true connoisseur, I see! That's a rare sight these days.");
next;
mesn;
mesq l("I certainly can teach you some recipes. I work mostly with dessert-like plates. This includes %s by the way.", getitemlink(ZombieNachos));
next;
.@q=getq2(HalinarzoQuest_LifeDelight);
.@min = 10 * .@total + 20;
if (.@q < .@min) {
mesn;
mesq l("If you fulfill my request for %s %d more times, I'll gladly impart a new recipe with you.", getitemlink(TonoriDelight), (.@min - .@q));
close;
}
// Prepare a list of recipes you still haven't learned
if (!RECIPES_COOKING[CraftCaramelApple])
array_push(.@recipes, CraftCaramelApple);
if (!RECIPES_COOKING[CraftFruitSalad])
array_push(.@recipes, CraftFruitSalad);
if (!RECIPES_COOKING[CraftZombieNachos])
array_push(.@recipes, CraftZombieNachos);
if (!RECIPES_COOKING[CraftPancake])
array_push(.@recipes, CraftPancake);
// Check if there *are* recipes to be learned
if (!getarraysize(.@recipes)) {
mesn;
mesq l("...Except that I already told you everything I knew. So I wish you luck in your cooking journey!");
close;
}
// Decide on a random recipe that you'll now learn
array_shuffle(.@recipes);
.@new = array_pop(.@recipes);
// FIXME: Actually broken but who cares
.@const$ = data_to_string(.@new);
.@item = string_to_data(substr(.@const$, 5, getstrlen(.@const$) - 1));
// Actually teach you the recipe
setq3 HalinarzoQuest_LifeDelight, .@total + 1;
RECIPES_COOKING[.@new] = true;
// Some text so you know what you learned
mesn;
mesq l("So, today I'll teach you the %s recipe.", getitemlink(.@item));
next;
mesc l("Some time later...");
mes "";
mesn;
mesq l("Good. I also noted it down in your Recipe Book. The path of culinary is an arduous one but the fruits it yields are sweet!");
close;
OnInit:
.@npcId = getnpcid(.name$);
setunitdata(.@npcId, UDT_HEADTOP, ChefHat);
setunitdata(.@npcId, UDT_HEADMIDDLE, SilkRobe);
setunitdata(.@npcId, UDT_HEADBOTTOM, CottonTrousers);
setunitdata(.@npcId, UDT_WEAPON, Boots);
setunitdata(.@npcId, UDT_HAIRSTYLE, 26);
setunitdata(.@npcId, UDT_HAIRCOLOR, 2);
.sex = G_MALE;
.distance = 4;
.p=97; // Price in GP of each Tonori Delight.
// real price is 556 in ingredients (this gets a x2 sell price)
// + 120 GP of taxes
// Total: 676 GP per batch (5~9 units). We consider the average batch (7).
// NO EXTRA PROFIT IS REQUIRED/ALLOWED.
end;
}
|