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
|
// TMW-2 Script
// Author:
// Jesusalva
// Description:
// Homunculus Evolution System
031-6,75,64,0 script Siegfried NPC_RED_OFFICER,{
function attributeText;
function attributeTime;
mesn;
mesq l("My name is Siegfried. Welcome to my humble abode.");
if ($GAME_STORYLINE >= 4 && HEC_GetTier() == 1) goto L_Main;
if ($GAME_STORYLINE >= 5 && HEC_GetTier() == 2) goto L_Main;
// Not unlocked by game storyline
mesq l("In future I'll have something to discuss with you, but today is not the day.");
close;
L_Main:
next;
mesn;
// Not summoned
if (!gethominfo(0)) {
mesq l("I used to take care of Homunculus a few centuries ago, before it became lost knowledge. A pity that my knowledge is no longer useful to anyone.");
close;
}
// Sleeping
if (homstatus()) {
mesq l("To be honest, I wouldn't believe anyone claiming to have a homunculus if I don't see for my own eyes. Homunculus creation is, after all, lost knowledge.");
close;
}
// Active
mesq l("Oh, what lovely Lv %d %s Homunculus you have here!", gethominfo(6), HEC_GetCName());
if (!gethominfo(5))
mesq l("I don't suppose it have a name yet?");
else
mesq l("...\"%s\", hm? That's a fine name for a Homunculus, in my not so humble opinion.", gethominfo(2));
next;
.@type = gethominfo(1);
.@loya = gethominfo(3) / 100;
.@next = HEC_GetTier() * 50;
mesn;
// Loyalty not yet earned
if (.@loya < 900) {
mesq l("When it reaches over 900 intimacy, it'll unlock better skills and bonuses to you. Let me know when this happen.");
close;
// Level not yet reached
} else if (gethominfo(6) <= .@next) {
mesq l("Once it reaches level %d who knows, something nice might happen.", .@next + 1);
close;
// No evolution available (yet)
} else if (HEC_SimpleEvolve() < 1) {
mesq l("And it's so loyal to you... Maybe you should consider requesting the evolution feature soon.");
close;
// All conditions met
} else {
mesq l("And it's so loyal to you... You probably could evolve it.");
}
goto L_Evolution;
L_Evolution:
next;
if (!.@next) end;
mesn;
mesq l("Now, you have a Tier %d homunculi. The highest the tier, the more difficult to evolve it is. For a simple Tier 2 evolution I can do it myself, whereas a Tier 3 evolution requires an Embryo.", HEC_GetTier());
next;
mesn;
mesq l("Evolving your Homunculus will drain 900 points of intimacy and %d levels. Homunculus are slightly weak right after evolving, but some healthy exercise will put them in form in no time.", .@next);
mesc l("In theory, I could also change it to another type without losing any levels, but I ran out of %s.", b(l("Jesusalva's Magic Debug Powder")));
next;
switch (HEC_GetTier()) {
case 1:
mesn;
mesq l("For Tier 2 Evolution, I'll need %s GP, %d %s, a %s and a %s.", 5000, 10, getitemlink(FluoPowder), getitemlink(Trout), getitemlink(Tench));
if (Zeny < 5000) close;
if (countitem(FluoPowder) < 10) close;
if (!countitem(Trout)) close;
if (!countitem(Tench)) close;
next;
mesc l("Evolve your Homunculus? This is irreversible!"), 1;
mesc l("Class after evolution: %s", HEC_GetCName(HEC_SimpleEvolve()));
if (askyesnosafe("Yes", "No", "Never") != ASK_YES) {
closeclientdialog; close;
}
// Initiate the Riddle, consume the GP and Intimacy first
// Only drain 899 units to give you a "grace" period for the puzzle.
Zeny -= 5000;
atcommand("@homfriendly "+(gethominfo(3)/100-899));
mesn;
mesq l("Alright, for such simple evolution I can do it myself. It'll evolve to a %s Type Homunculus.", b(HEC_GetCName(HEC_SimpleEvolve())));
next;
mesn;
mesq l("But you'll still need to help me! The homunculus evolve when four aspects evolve: They are %s, %s, %s and %s.", l("%%A Existence"), l("%%D Rationality"), l("%%F Emotionality"), l("%%? Inexistence"));
next;
mesn;
mesq l("I can only evolve two aspects at once. Whenever an aspect evolves, I need to sacrifice an aspect, so to start the process, I'll use the fish to bootstrap a null aspect."); // For tier 3, fish wouldn't be enough.
next;
mesn;
mesq l("Once I finish evolving the two aspects, you'll be able to decide which aspect you'll downgrade to resume the evolution process. However, you only have %s time units to evolve the four aspects!", b("200"));
next;
mesn;
mesq l("If you can't evolve the four aspects in the alloted time, I'll revert the evolution, but all your money and the Homunculus Intimacy will be consumed. So worth noting that if the intimacy drops to zero, it dies.");
next;
mesn;
mesq l("Ready? Let's begin.");
.@time=0;
.@attr=0;
goto L_Evol2Puzzle;
default:
mesn;
mesq l("I don't know how to evolve your homunculus.");
}
close;
L_Evol2Puzzle:
// INHERITED: .@time / .@attr
clear;
mesc l("Time spent: %d/%d", .@time, 200);
mes "";
mesc l("Evolved attributes: %s", attributeText(.@attr));
mes "";
mes l("Evolution time:");
mesc ("%%A 10");
mesc ("%%D 20");
mesc ("%%F 90");
mesc ("%%? 120");
// Reset the buffers
.@tf=0; .@fa=.@attr; // tf = time buffer; fa = final attribute
mes "";
mes l("Which attribute do you wish to evolve first?");
menuint
// TODO FIXME: Need menuimage because emotes doesn't work...? WTF?
rif(!(.@fa & 1), l("%%A Existence")), 1,
rif(!(.@fa & 2), l("%%D Rationality")), 2,
rif(!(.@fa & 4), l("%%F Emotionality")), 4,
rif(!(.@fa & 8), l("%%? Inexistence")), 8;
mes "";
.@fa = .@fa | @menuret;
.@tf = max(.@tf, attributeTime(@menuret));
mes "";
mes l("Which attribute do you wish to evolve next?");
menuint
rif(!(.@fa & 1), l("%%A Existence")), 1,
rif(!(.@fa & 2), l("%%D Rationality")), 2,
rif(!(.@fa & 4), l("%%F Emotionality")), 4,
rif(!(.@fa & 8), l("%%? Inexistence")), 8,
l("None"), 0;
mes "";
.@fa = .@fa | @menuret;
.@tf = max(.@tf, attributeTime(@menuret));
// Apply the time change
.@time += .@tf; .@tf = 0;
mes b(l("Time spent: %d/%d", .@time, 200));
// You finished
if (.@fa == 15) goto L_Evol2Finish;
// Update the display with the temporary data in the making
clear;
mesc l("Time spent: %d/%d", .@time, 200);
mes "";
mesc l("Evolved attributes: %s", attributeText(.@fa));
mes "";
mes l("Evolution time:");
mesc ("%%A 10");
mesc ("%%D 20");
mesc ("%%F 90");
mesc ("%%? 120");
// Revert one attribute
mes "";
mesc l("Which attribute do you wish to downgrade?"), 1;
menuint
rif((.@fa & 1), l("%%A Existence")), 1,
rif((.@fa & 2), l("%%D Rationality")), 2,
rif((.@fa & 4), l("%%F Emotionality")), 4,
rif((.@fa & 8), l("%%? Inexistence")), 8;
.@fa = .@fa ^ @menuret;
.@attr = .@fa;
.@time += attributeTime(@menuret);
// Continue the cycle
goto L_Evol2Puzzle;
L_Evol2Finish:
// Validate if you really won
if (.@time < 120 || .@time > 200) goto L_Evol2Fail;
if (gethominfo(6) <= .@next) goto L_Evol2Fail;
if (.@next < 1) Exception("Illegal value for level cost", RB_SPEECH|RB_DEBUGMES|RB_PLEASEREPORT|RB_ISFATAL);
// Consume the materials
delitem Trout, 1;
delitem Tench, 1;
delitem FluoPowder, 10;
// Perform the Evolution
.@evol = sethomunclass(HEC_SimpleEvolve());
if (.@evol)
Exception(sprintf("Illegal Homunculus Evolution performed, error %d for type %d.", .@evol, HEC_SimpleEvolve()), RB_IRCBROADCAST|RB_SPEECH|RB_DEBUGMES|RB_PLEASEREPORT|RB_ISFATAL);
// Reset the Homunculus level
.@level = gethominfo(6) - .@next;
sethomunlevel(.@level);
// Update player display
atcommand("@refresh");
atcommand("@hominfo");
// Finale
clear;
mesn;
mesq l("Congratulations! Your homunculus has just evolved.");
close;
L_Evol2Fail:
clear;
mesc l(".:: Failure ::."), 1;
mesc l("You took too long."), 1;
debugmes "Spent %d time units", .@time;
close;
function attributeText {
.@a$=""; .@a=getarg(0);
if (.@a & 1)
.@a$+=l("%%A Existence");
.@a$+=" ";
if (.@a & 2)
.@a$+=l("%%D Rationality");
.@a$+=" ";
if (.@a & 4)
.@a$+=l("%%F Emotionality");
.@a$+=" ";
if (.@a & 8)
.@a$+=l("%%? Inexistence");
return .@a$;
}
function attributeTime {
switch (getarg(0)) {
case 0: return 0;
case 1: return 10;
case 2: return 20;
case 4: return 90;
case 8: return 120;
default: Exception("Invalid attribute selected"); return 9999;
}
}
OnInit:
.sex = G_MALE;
.distance = 5;
end;
}
|