0
|
1 #include <stdlib.h>
|
|
2 #include <stdio.h>
|
|
3 #include <string.h>
|
|
4
|
|
5 #include "Monsters.h"
|
|
6 #include "FrameTableInc.h"
|
|
7 #include "Allocator.h"
|
|
8 #include "LOD.h"
|
189
|
9 #include "texts.h"
|
0
|
10 #include "mm7_data.h"
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16 struct MonsterStats *pMonsterStats;
|
|
17 struct MonsterList *pMonsterList;
|
|
18
|
698
|
19 unsigned int __fastcall ParseSpellType(struct FrameTableTxtLine *, int a2);
|
|
20
|
|
21 int ParseAttackType(const char *damage_type_str);
|
|
22 void ParseDamage( char *damage_str, unsigned __int8* dice_rolls, unsigned __int8* dice_sides, unsigned __int8* dmg_bonus );
|
|
23 int ParseMissleAttackType(const char *missle_attack_str);
|
|
24 int ParseSpecialAttack(const char *spec_att_str);
|
|
25
|
|
26 //----- (004548E2) --------------------------------------------------------
|
701
|
27 unsigned int __fastcall ParseSpellType(FrameTableTxtLine *a1, int a2)
|
698
|
28 {
|
|
29 int v2; // edi@1
|
|
30 int v3; // esi@1
|
|
31 unsigned int result; // eax@1
|
|
32 std::string v5; // [sp-18h] [bp-28h]@75
|
|
33 const char *v6; // [sp-8h] [bp-18h]@75
|
|
34 signed int v7; // [sp-4h] [bp-14h]@3
|
|
35 std::string *v8; // [sp+8h] [bp-8h]@75
|
|
36 int a3; // [sp+Fh] [bp-1h]@75
|
|
37
|
|
38 v2 = (int)a1;
|
|
39 v3 = a2;
|
|
40 result = (int)a1->pProperties[0];
|
|
41 if ( result )
|
|
42 {
|
|
43 if ( !_strcmpi((const char *)result, "Dispel") )
|
|
44 {
|
|
45 v7 = 80;
|
|
46 LABEL_71:
|
|
47 result = v7;
|
|
48 LABEL_76:
|
|
49 ++*(int *)v3;
|
|
50 return result;
|
|
51 }
|
|
52 if ( _strcmpi(*(const char **)(v2 + 4), "Day") )
|
|
53 {
|
|
54 if ( _strcmpi(*(const char **)(v2 + 4), "Hour") )
|
|
55 {
|
|
56 if ( _strcmpi(*(const char **)(v2 + 4), "Shield") )
|
|
57 {
|
|
58 if ( !_strcmpi(*(const char **)(v2 + 4), "Spirit") )
|
|
59 {
|
|
60 v7 = 52;
|
|
61 goto LABEL_71;
|
|
62 }
|
|
63 if ( !_strcmpi(*(const char **)(v2 + 4), "Power") )
|
|
64 {
|
|
65 v7 = 77;
|
|
66 goto LABEL_71;
|
|
67 }
|
|
68 if ( !_strcmpi(*(const char **)(v2 + 4), "Meteor") )
|
|
69 {
|
|
70 v7 = 9;
|
|
71 goto LABEL_71;
|
|
72 }
|
|
73 if ( !_strcmpi(*(const char **)(v2 + 4), "Lightning") )
|
|
74 {
|
|
75 v7 = 18;
|
|
76 goto LABEL_71;
|
|
77 }
|
|
78 if ( _strcmpi(*(const char **)(v2 + 4), "Implosion") )
|
|
79 {
|
|
80 if ( !_strcmpi(*(const char **)(v2 + 4), "Stone") )
|
|
81 {
|
|
82 v7 = 38;
|
|
83 goto LABEL_71;
|
|
84 }
|
|
85 if ( _strcmpi(*(const char **)(v2 + 4), "Haste") )
|
|
86 {
|
|
87 if ( _strcmpi(*(const char **)(v2 + 4), "Heroism") )
|
|
88 {
|
|
89 if ( !_strcmpi(*(const char **)(v2 + 4), "Pain") )
|
|
90 {
|
|
91 v7 = 95;
|
|
92 goto LABEL_71;
|
|
93 }
|
|
94 if ( _strcmpi(*(const char **)(v2 + 4), "Sparks") )
|
|
95 {
|
|
96 if ( !_strcmpi(*(const char **)(v2 + 4), "Light") )
|
|
97 {
|
|
98 v7 = 78;
|
|
99 goto LABEL_71;
|
|
100 }
|
|
101 if ( !_strcmpi(*(const char **)(v2 + 4), "Toxic") )
|
|
102 {
|
|
103 v7 = 90;
|
|
104 goto LABEL_71;
|
|
105 }
|
|
106 if ( _strcmpi(*(const char **)(v2 + 4), "ShrapMetal") )
|
|
107 {
|
|
108 if ( _strcmpi(*(const char **)(v2 + 4), "Paralyze") )
|
|
109 {
|
|
110 if ( _strcmpi(*(const char **)(v2 + 4), "Fireball") )
|
|
111 {
|
|
112 if ( _strcmpi(*(const char **)(v2 + 4), "Incinerate") )
|
|
113 {
|
|
114 if ( !_strcmpi(*(const char **)(v2 + 4), "Fire") )
|
|
115 {
|
|
116 v7 = 2;
|
|
117 goto LABEL_71;
|
|
118 }
|
|
119 if ( !_strcmpi(*(const char **)(v2 + 4), "Rock") )
|
|
120 {
|
|
121 v7 = 41;
|
|
122 goto LABEL_71;
|
|
123 }
|
|
124 if ( !_strcmpi(*(const char **)(v2 + 4), "Mass") )
|
|
125 {
|
|
126 v7 = 44;
|
|
127 goto LABEL_71;
|
|
128 }
|
|
129 if ( !_strcmpi(*(const char **)(v2 + 4), "Ice") )
|
|
130 {
|
|
131 v7 = 26;
|
|
132 goto LABEL_71;
|
|
133 }
|
|
134 if ( !_strcmpi(*(const char **)(v2 + 4), "Acid") )
|
|
135 {
|
|
136 v7 = 29;
|
|
137 goto LABEL_71;
|
|
138 }
|
|
139 if ( _strcmpi(*(const char **)(v2 + 4), "Bless") )
|
|
140 {
|
|
141 if ( !_strcmpi(*(const char **)(v2 + 4), "Dragon") )
|
|
142 {
|
|
143 v7 = 97;
|
|
144 goto LABEL_71;
|
|
145 }
|
|
146 if ( _strcmpi(*(const char **)(v2 + 4), "Reanimate") )
|
|
147 {
|
|
148 if ( !_strcmpi(*(const char **)(v2 + 4), "Summon") )
|
|
149 {
|
|
150 v7 = 82;
|
|
151 goto LABEL_71;
|
|
152 }
|
|
153 if ( _strcmpi(*(const char **)(v2 + 4), "Fate") )
|
|
154 {
|
|
155 if ( _strcmpi(*(const char **)(v2 + 4), "Harm") )
|
|
156 {
|
|
157 if ( !_strcmpi(*(const char **)(v2 + 4), "Mind") )
|
|
158 {
|
|
159 v7 = 57;
|
|
160 goto LABEL_71;
|
|
161 }
|
|
162 if ( _strcmpi(*(const char **)(v2 + 4), "Blades") )
|
|
163 {
|
|
164 if ( !_strcmpi(*(const char **)(v2 + 4), "Psychic") )
|
|
165 {
|
|
166 v7 = 65;
|
|
167 goto LABEL_71;
|
|
168 }
|
|
169 if ( _strcmpi(*(const char **)(v2 + 4), "Hammerhands") )
|
|
170 {
|
|
171 sprintf(pTmpBuf, "Unknown monster spell %s", *(int *)(v2 + 4));
|
|
172 MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
|
|
173 result = 0;
|
|
174 goto LABEL_76;
|
|
175 }
|
|
176 v7 = 73;
|
|
177 }
|
|
178 else
|
|
179 {
|
|
180 v7 = 39;
|
|
181 }
|
|
182 }
|
|
183 else
|
|
184 {
|
|
185 v7 = 70;
|
|
186 }
|
|
187 }
|
|
188 else
|
|
189 {
|
|
190 v7 = 47;
|
|
191 }
|
|
192 }
|
|
193 else
|
|
194 {
|
|
195 v7 = 89;
|
|
196 }
|
|
197 }
|
|
198 else
|
|
199 {
|
|
200 v7 = 46;
|
|
201 }
|
|
202 }
|
|
203 else
|
|
204 {
|
|
205 v7 = 11;
|
|
206 }
|
|
207 }
|
|
208 else
|
|
209 {
|
|
210 v7 = 6;
|
|
211 }
|
|
212 }
|
|
213 else
|
|
214 {
|
|
215 v7 = 81;
|
|
216 }
|
|
217 }
|
|
218 else
|
|
219 {
|
|
220 v7 = 93;
|
|
221 }
|
|
222 }
|
|
223 else
|
|
224 {
|
|
225 v7 = 15;
|
|
226 }
|
|
227 }
|
|
228 else
|
|
229 {
|
|
230 v7 = 51;
|
|
231 }
|
|
232 }
|
|
233 else
|
|
234 {
|
|
235 v7 = 5;
|
|
236 }
|
|
237 }
|
|
238 else
|
|
239 {
|
|
240 v7 = 20;
|
|
241 }
|
|
242 }
|
|
243 else
|
|
244 {
|
|
245 v7 = 17;
|
|
246 }
|
|
247 return v7;
|
|
248 }
|
|
249 v7 = 86;
|
|
250 }
|
|
251 else
|
|
252 {
|
|
253 v7 = 85;
|
|
254 }
|
|
255 *(int *)v3 += 2;
|
|
256 result = v7;
|
|
257 }
|
|
258 return result;
|
|
259 }
|
|
260
|
|
261 //----- (00454CB4) --------------------------------------------------------
|
|
262 int ParseAttackType( const char *damage_type_str )
|
|
263 {
|
|
264
|
|
265 switch (tolower(*damage_type_str))
|
|
266 {
|
|
267 case 'f': return 0; //fire
|
|
268 case 'a': return 1; //air
|
|
269 case 'w': return 2; //water
|
|
270 case 'e': return 3; //earth
|
|
271
|
|
272 case 's': return 6; //spirit
|
|
273 case 'm': return 7; //mind
|
|
274 //m ?? 8
|
|
275 case 'l': return 9; //light
|
|
276 case 'd': return 10; //dark
|
|
277 // d?? 11
|
|
278 }
|
|
279 return 4; //phis
|
|
280
|
|
281 }
|
|
282
|
|
283 //----- (00454D7D) --------------------------------------------------------
|
|
284 void ParseDamage( char *damage_str, unsigned __int8* dice_rolls, unsigned __int8* dice_sides, unsigned __int8* dmg_bonus )
|
|
285 {
|
|
286 int str_len=0;
|
|
287 int str_pos=0;
|
|
288 bool dice_flag=false;
|
|
289
|
|
290 *dice_rolls = 0;
|
|
291 *dice_sides = 1;
|
|
292 *dmg_bonus = 0;
|
|
293
|
|
294 str_len = strlen(damage_str);
|
|
295 if (str_len<=0)
|
|
296 return;
|
|
297 for (str_pos=0;str_pos<str_len;++str_pos )
|
|
298 {
|
|
299 if (tolower(damage_str[str_pos])=='d')
|
|
300 {
|
|
301 damage_str[str_pos]='\0';
|
|
302 *dice_rolls=atoi(damage_str);
|
|
303 *dice_sides=atoi(&damage_str[str_pos+1]);
|
|
304 dice_flag=true;
|
|
305 damage_str[str_pos]='d';
|
|
306 }
|
|
307 else if (tolower(damage_str[str_pos])=='+')
|
|
308 *dmg_bonus=atoi(&damage_str[str_pos+1]);
|
|
309 }
|
|
310 if (!dice_flag)
|
|
311 {
|
|
312 if ((*damage_str>='0')&&(*damage_str<='9'))
|
|
313 {
|
|
314 *dice_rolls =atoi(damage_str);
|
|
315 *dice_sides = 1;
|
|
316 }
|
|
317 }
|
|
318 }
|
|
319
|
|
320 //----- (00454E3A) --------------------------------------------------------
|
|
321 int ParseMissleAttackType(const char *missle_attack_str)
|
|
322 {
|
|
323 if ( !_strcmpi(missle_attack_str, "ARROW") )
|
|
324 return 1;
|
|
325 else if ( !_strcmpi(missle_attack_str, "ARROWF") )
|
|
326 return 2;
|
|
327 else if ( !_strcmpi(missle_attack_str, "FIRE") )
|
|
328 return 3;
|
|
329 else if ( !_strcmpi(missle_attack_str, "AIR") )
|
|
330 return 4;
|
|
331 else if ( !_strcmpi(missle_attack_str, "WATER") )
|
|
332 return 5;
|
|
333 else if ( !_strcmpi(missle_attack_str, "EARTH") )
|
|
334 return 6;
|
|
335 else if ( !_strcmpi(missle_attack_str, "SPIRIT") )
|
|
336 return 7;
|
|
337 else if ( !_strcmpi(missle_attack_str, "MIND") )
|
|
338 return 8;
|
|
339 else if ( !_strcmpi(missle_attack_str, "BODY") )
|
|
340 return 9;
|
|
341 else if ( !_strcmpi(missle_attack_str, "LIGHT") )
|
|
342 return 10;
|
|
343 else if ( !_strcmpi(missle_attack_str, "DARK") )
|
|
344 return 11;
|
|
345 else if ( !_strcmpi(missle_attack_str, "ENER") )
|
|
346 return 13;
|
|
347 else return 0;
|
|
348 }
|
|
349
|
|
350
|
|
351 int ParseSpecialAttack(const char *spec_att_str)
|
|
352 {
|
|
353 if ( strstr(spec_att_str, "curse") )
|
|
354 return 1;
|
|
355 else if ( strstr(spec_att_str, "weak") )
|
|
356 return 2;
|
|
357 else if ( strstr(spec_att_str, "asleep") )
|
|
358 return 3;
|
|
359 else if ( strstr(spec_att_str, "afraid") )
|
|
360 return 23;
|
|
361 else if ( strstr(spec_att_str, "drunk") )
|
|
362 return 4;
|
|
363 else if ( strstr(spec_att_str, "insane") )
|
|
364 return 5;
|
|
365 else if ( strstr(spec_att_str, "poison1") )
|
|
366 return 6;
|
|
367 else if ( strstr(spec_att_str, "poison2") )
|
|
368 return 7;
|
|
369 else if ( strstr(spec_att_str, "poison3") )
|
|
370 return 8;
|
|
371 else if ( strstr(spec_att_str, "disease1") )
|
|
372 return 9;
|
|
373 else if ( strstr(spec_att_str, "disease2") )
|
|
374 return 10;
|
|
375 else if ( strstr(spec_att_str, "disease3") )
|
|
376 return 11;
|
|
377 else if ( strstr(spec_att_str, "paralyze") )
|
|
378 return 12;
|
|
379 else if ( strstr(spec_att_str, "uncon") )
|
|
380 return 13;
|
|
381 else if ( strstr(spec_att_str, "dead") )
|
|
382 return 14;
|
|
383 else if ( strstr(spec_att_str, "stone") )
|
|
384 return 15;
|
|
385 else if ( strstr(spec_att_str, "errad") )
|
|
386 return 16;
|
|
387 else if ( strstr(spec_att_str, "brkitem") )
|
|
388 return 17;
|
|
389 else if ( strstr(spec_att_str, "brkarmor") )
|
|
390 return 18;
|
|
391 else if ( strstr(spec_att_str, "brkweapon") )
|
|
392 return 19;
|
|
393 else if ( strstr(spec_att_str, "steal") )
|
|
394 return 20;
|
|
395 else if ( strstr(spec_att_str, "age") )
|
|
396 return 21;
|
|
397 else if ( strstr(spec_att_str, "drainsp") )
|
|
398 return 22;
|
|
399 else return 0;
|
|
400 }
|
0
|
401
|
|
402 //----- (004598FC) --------------------------------------------------------
|
|
403 bool MonsterList::FromFileTxt(const char *Args)
|
|
404 {
|
|
405 MonsterList *v2; // ebx@1
|
|
406 FILE *v3; // eax@1
|
|
407 unsigned int v4; // esi@3
|
|
408 void *v5; // eax@9
|
|
409 FILE *v6; // ST14_4@11
|
|
410 char *i; // eax@11
|
|
411 signed int v8; // esi@12
|
|
412 unsigned __int16 v9; // ax@16
|
|
413 const char *v10; // ST18_4@16
|
|
414 unsigned __int16 v11; // ax@16
|
|
415 const char *v12; // ST14_4@16
|
|
416 unsigned __int16 v13; // ax@16
|
|
417 const char *v14; // ST10_4@16
|
|
418 __int16 v15; // ax@16
|
|
419 const char *v16; // ST0C_4@16
|
|
420 int v17; // esi@16
|
|
421 unsigned __int8 v18; // al@16
|
|
422 signed int v19; // esi@16
|
|
423 unsigned __int16 v20; // ax@17
|
|
424 int v21; // ecx@17
|
|
425 char Buf; // [sp+4h] [bp-304h]@3
|
|
426 FrameTableTxtLine v24; // [sp+1F8h] [bp-110h]@4
|
|
427 FrameTableTxtLine v25; // [sp+274h] [bp-94h]@4
|
|
428 int v26; // [sp+2F0h] [bp-18h]@16
|
|
429 char v27; // [sp+2F4h] [bp-14h]@14
|
|
430 char v28; // [sp+2F5h] [bp-13h]@14
|
|
431 char v29; // [sp+2F6h] [bp-12h]@14
|
|
432 char v30; // [sp+2F7h] [bp-11h]@14
|
|
433 char v31; // [sp+2F8h] [bp-10h]@14
|
|
434 char v32; // [sp+2F9h] [bp-Fh]@14
|
|
435 char v33; // [sp+2FAh] [bp-Eh]@14
|
|
436 char v34; // [sp+2FBh] [bp-Dh]@14
|
|
437 char v35; // [sp+2FCh] [bp-Ch]@14
|
|
438 char v36; // [sp+2FDh] [bp-Bh]@14
|
|
439 char v37; // [sp+2FEh] [bp-Ah]@14
|
|
440 char v38; // [sp+2FFh] [bp-9h]@14
|
|
441 char v39; // [sp+300h] [bp-8h]@14
|
|
442 char v40; // [sp+301h] [bp-7h]@14
|
|
443 char v41; // [sp+302h] [bp-6h]@14
|
|
444 char v42; // [sp+303h] [bp-5h]@14
|
|
445 FILE *File; // [sp+304h] [bp-4h]@1
|
|
446 unsigned int Argsa; // [sp+310h] [bp+8h]@3
|
|
447 int Argsb; // [sp+310h] [bp+8h]@16
|
|
448
|
|
449 v2 = this;
|
|
450 v3 = fopen(Args, "r");
|
|
451 File = v3;
|
|
452 if ( !v3 )
|
|
453 Abortf("MonsterRaceListStruct::load - Unable to open file: %s.");
|
|
454 v4 = 0;
|
|
455 Argsa = 0;
|
|
456 if ( fgets(&Buf, 490, v3) )
|
|
457 {
|
|
458 do
|
|
459 {
|
|
460 *strchr(&Buf, 10) = 0;
|
|
461 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
|
701
|
462 if ( v25.uPropCount && *v25.pProperties[0] != 47 )
|
0
|
463 ++Argsa;
|
|
464 }
|
|
465 while ( fgets(&Buf, 490, File) );
|
|
466 v4 = Argsa;
|
|
467 }
|
|
468 v2->uNumMonsters = v4;
|
|
469 v5 = pAllocator->AllocNamedChunk(v2->pMonsters, 152 * v4, "Mon Race");
|
|
470 v2->pMonsters = (MonsterDesc *)v5;
|
|
471 if ( !v5 )
|
|
472 Abortf("MonsterRaceListStruct::load - Out of Memory!");
|
|
473 v6 = File;
|
|
474 v2->uNumMonsters = 0;
|
|
475 fseek(v6, 0, 0);
|
|
476 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
|
|
477 {
|
|
478 *strchr(&Buf, 10) = 0;
|
|
479 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
|
|
480 v8 = 0;
|
701
|
481 if ( v25.uPropCount && *v25.pProperties[0] != 47 )
|
0
|
482 {
|
|
483 strcpy(v2->pMonsters[v2->uNumMonsters].pMonsterName, v25.pProperties[0]);
|
|
484 v35 = 0;
|
|
485 v36 = 1;
|
|
486 v37 = 7;
|
|
487 v38 = 2;
|
|
488 v39 = 3;
|
|
489 v40 = 4;
|
|
490 v41 = 5;
|
|
491 v42 = 6;
|
|
492 v27 = 1;
|
|
493 v28 = 2;
|
|
494 v29 = 3;
|
|
495 v30 = 4;
|
|
496 v31 = 4;
|
|
497 v32 = 5;
|
|
498 v33 = 6;
|
|
499 v34 = 7;
|
|
500 do
|
|
501 {
|
|
502 strcpy(
|
|
503 v2->pMonsters[v2->uNumMonsters].pSpriteNames[(unsigned __int8)*(&v35 + v8)],
|
|
504 v25.pProperties[(unsigned __int8)*(&v27 + v8)]);
|
|
505 ++v8;
|
|
506 }
|
|
507 while ( v8 < 8 );
|
|
508 v9 = atoi(v25.pProperties[8]);
|
|
509 v10 = v25.pProperties[9];
|
|
510 v2->pMonsters[v2->uNumMonsters].uMonsterHeight = v9;
|
|
511 v11 = atoi(v10);
|
|
512 v12 = v25.pProperties[10];
|
|
513 v2->pMonsters[v2->uNumMonsters].uMovementSpeed = v11;
|
|
514 v13 = atoi(v12);
|
|
515 v14 = v25.pProperties[11];
|
|
516 v2->pMonsters[v2->uNumMonsters].uMonsterRadius = v13;
|
|
517 v15 = atoi(v14);
|
|
518 v16 = v25.pProperties[12];
|
|
519 v2->pMonsters[v2->uNumMonsters].uToHitRadius = v15;
|
|
520 v17 = (unsigned __int8)atoi(v16);
|
701
|
521 Argsb = atoi(v25.pProperties[13]) & 0xFF;
|
|
522 v26 = atoi(v25.pProperties[14]) & 0xFF;
|
|
523 v18 = atoi(v25.pProperties[15]);
|
0
|
524 v2->pMonsters[v2->uNumMonsters].uTintColor = v18 | ((v26 | ((Argsb | (v17 << 8)) << 8)) << 8);
|
|
525 v19 = 0;
|
|
526 do
|
|
527 {
|
701
|
528 v20 = atoi(v25.pProperties[v19 + 16]);
|
|
529 v21 = v19++ ;
|
|
530 v2->pMonsters[v2->uNumMonsters].pSoundSampleIDs[v21] = v20;
|
0
|
531 }
|
|
532 while ( v19 < 4 );
|
|
533 ++v2->uNumMonsters;
|
|
534 }
|
|
535 }
|
|
536 fclose(File);
|
|
537 return 1;
|
|
538 }
|
|
539
|
|
540 //----- (004598AF) --------------------------------------------------------
|
|
541 void MonsterList::FromFile(void *pSerialized)
|
|
542 {
|
|
543 uNumMonsters = *(int *)pSerialized;
|
698
|
544 pMonsters = (MonsterDesc *)pAllocator->AllocNamedChunk(pMonsters, sizeof(MonsterDesc) * uNumMonsters, "Mon Race");
|
|
545 memcpy(pMonsters, (char *)pSerialized + 4, sizeof(MonsterDesc) * uNumMonsters);
|
0
|
546 }
|
|
547
|
|
548 //----- (00459860) --------------------------------------------------------
|
|
549 void MonsterList::ToFile()
|
|
550 {
|
|
551 MonsterList *v1; // esi@1
|
|
552 FILE *v2; // eax@1
|
|
553 FILE *v3; // edi@1
|
|
554
|
|
555 v1 = this;
|
|
556 v2 = fopen("data\\dmonlist.bin", "wb");
|
|
557 v3 = v2;
|
|
558 if ( !v2 )
|
|
559 Abortf("Unable to save dmonlist.bin!");
|
|
560 fwrite(v1, 4u, 1u, v2);
|
|
561 fwrite(v1->pMonsters, 0x98u, v1->uNumMonsters, v3);
|
|
562 fclose(v3);
|
|
563 }
|
|
564
|
|
565
|
|
566 //----- (004563FF) --------------------------------------------------------
|
694
|
567 signed int MonsterStats::FindMonsterByName(const char *Str2)
|
0
|
568 {
|
|
569 MonsterStats *v2; // esi@1
|
|
570 signed int v3; // ebx@1
|
|
571 MonsterInfo *v4; // edi@2
|
|
572 signed int result; // eax@6
|
694
|
573 /*
|
|
574 for (int i=1; i<=uNumMonsters; ++i)
|
|
575 {
|
|
576 if()
|
|
577 return i;
|
|
578 }
|
|
579 return -1;
|
|
580 */
|
0
|
581 v2 = this;
|
|
582 v3 = 1;
|
|
583 if ( (signed int)this->uNumMonsters <= 1 )
|
|
584 {
|
|
585 LABEL_6:
|
|
586 result = -1;
|
|
587 }
|
|
588 else
|
|
589 {
|
|
590 v4 = &this->pInfos[1];
|
694
|
591 while ( !v4->pName || _strcmpi(v4->pPictureName, Str2) )
|
0
|
592 {
|
|
593 ++v3;
|
|
594 ++v4;
|
|
595 if ( v3 >= (signed int)v2->uNumMonsters )
|
|
596 goto LABEL_6;
|
|
597 }
|
|
598 result = v3;
|
|
599 }
|
|
600 return result;
|
|
601 }
|
|
602
|
|
603
|
|
604 //----- (00454F4E) --------------------------------------------------------
|
|
605 void MonsterStats::InitializePlacements()
|
|
606 {
|
237
|
607 int i;
|
|
608 char* test_string;
|
|
609 unsigned char c;
|
|
610 bool break_loop;
|
|
611 unsigned int temp_str_len;
|
|
612 char* tmp_pos;
|
|
613 int decode_step;
|
|
614 int item_counter;
|
0
|
615
|
|
616 pMonsterPlacementTXT_Raw = (char *)pEvents_LOD->LoadRaw("placemon.txt", 0);
|
|
617 strtok(pMonsterPlacementTXT_Raw, "\r");
|
237
|
618 for (i=1; i<31; ++i)
|
|
619 {
|
|
620 test_string = strtok(NULL, "\r") + 1;
|
|
621 break_loop = false;
|
|
622 decode_step=0;
|
|
623 do
|
|
624 {
|
|
625 c = *(unsigned char*)test_string;
|
|
626 temp_str_len = 0;
|
|
627 while((c!='\t')&&(c>0))
|
|
628 {
|
|
629 ++temp_str_len;
|
|
630 c=test_string[temp_str_len];
|
|
631 }
|
|
632 tmp_pos=test_string+temp_str_len;
|
|
633 if (*tmp_pos == 0)
|
|
634 break_loop = true;
|
|
635 *tmp_pos = 0;
|
|
636 if (temp_str_len)
|
|
637 {
|
|
638 if (decode_step==1)
|
|
639 pPlaceStrings[i]=RemoveQuotes(test_string);
|
|
640 }
|
|
641 else
|
|
642 {
|
|
643 break_loop = true;
|
|
644 }
|
|
645 ++decode_step;
|
|
646 test_string=tmp_pos+1;
|
|
647 } while ((decode_step<3)&&!break_loop);
|
|
648 }
|
|
649 uNumPlacements = 31;
|
0
|
650 }
|
|
651
|
|
652 //----- (0045501E) --------------------------------------------------------
|
|
653 void MonsterStats::Initialize()
|
694
|
654 {
|
|
655 MonsterStats *v1; // ebx@1
|
|
656 int v2; // ebx@4
|
|
657 char v3; // cl@5
|
|
658 int v4; // eax@5
|
|
659 size_t v5; // eax@19
|
|
660 signed int v6; // edi@19
|
|
661 MonsterStats *v7; // ecx@23
|
|
662 int v8; // eax@23
|
|
663 unsigned int *pHP; // esi@23
|
|
664 size_t v10; // eax@29
|
|
665 signed int v11; // edi@29
|
|
666 MonsterStats *v12; // ecx@33
|
|
667 int v13; // eax@33
|
|
668 unsigned int *pExp; // esi@33
|
|
669 signed int v15; // edi@36
|
|
670 size_t v16; // esi@36
|
|
671 int v17; // eax@37
|
|
672 MonsterInfo *v18; // esi@45
|
|
673 size_t v19; // edi@50
|
|
674 int v20; // eax@51
|
|
675 unsigned __int8 v21; // al@55
|
|
676 size_t v22; // edi@59
|
|
677 char v23; // cl@63
|
|
678 const char *v24; // edi@63
|
|
679 unsigned __int16 *v25; // esi@114
|
|
680 int v26; // eax@118
|
|
681 size_t v27; // eax@136
|
|
682 int v28; // edi@137
|
|
683 MonsterStats *v29; // esi@137
|
|
684 int v30; // eax@138
|
|
685 int v31; // eax@142
|
|
686 int v32; // eax@143
|
|
687 int v33; // eax@144
|
|
688 int v34; // eax@151
|
|
689 int v35; // eax@152
|
|
690 int v36; // eax@153
|
|
691 int v37; // eax@162
|
|
692 int v38; // eax@163
|
|
693 int v39; // eax@164
|
|
694 int v40; // eax@171
|
|
695 int v41; // eax@172
|
|
696 size_t v42; // eax@180
|
|
697 int v43; // edi@180
|
|
698 MonsterInfo *v44; // esi@180
|
|
699 int v45; // edi@184
|
|
700 MonsterInfo *v46; // eax@232
|
|
701 char *v47; // edx@232
|
|
702 char *v48; // ecx@232
|
|
703 MonsterInfo *v49; // eax@236
|
|
704 FrameTableTxtLine *v50; // esi@240
|
|
705 int v51; // eax@240
|
|
706 int v52; // eax@241
|
|
707 int v53; // esi@242
|
|
708 int v54; // edi@242
|
|
709 char v55; // al@242
|
|
710 char *v56; // edi@242
|
|
711 FrameTableTxtLine *v57; // esi@249
|
|
712 int v58; // eax@249
|
|
713 MonsterInfo *v59; // eax@250
|
|
714 MonsterInfo *v60; // esi@251
|
|
715 int v61; // edi@251
|
|
716 char v62; // al@251
|
|
717 char *v63; // edi@251
|
|
718 char v64; // al@258
|
|
719 char v65; // al@262
|
|
720 char v66; // al@266
|
|
721 char v67; // al@270
|
|
722 char v68; // al@274
|
|
723 char v69; // al@278
|
|
724 char v70; // al@282
|
|
725 char v71; // al@286
|
|
726 char v72; // al@290
|
|
727 unsigned __int8 v73; // al@294
|
|
728 int v74; // edi@298
|
|
729 MonsterInfo *v75; // esi@300
|
|
730 MonsterInfo *v76; // esi@302
|
|
731 char **v77; // edi@306
|
|
732 __int16 v78; // ax@316
|
|
733 MonsterInfo *v79; // esi@323
|
|
734 const char *v80; // ecx@323
|
|
735 std::string v81; // [sp-14h] [bp-46Ch]@317
|
|
736 const char *v82; // [sp-8h] [bp-460h]@306
|
|
737 char *v83; // [sp-4h] [bp-45Ch]@23
|
|
738 char *v84; // [sp+0h] [bp-458h]@37
|
|
739 FrameTableTxtLine v85; // [sp+10h] [bp-448h]@297
|
|
740 FrameTableTxtLine v86; // [sp+8Ch] [bp-3CCh]@249
|
|
741 FrameTableTxtLine v87; // [sp+108h] [bp-350h]@240
|
|
742 char Src[120]; // [sp+184h] [bp-2D4h]@317
|
|
743 FrameTableTxtLine v89; // [sp+1FCh] [bp-25Ch]@249
|
|
744 FrameTableTxtLine v90; // [sp+278h] [bp-1E0h]@240
|
|
745 char Str[64]; // [sp+2F4h] [bp-164h]@240
|
|
746 char Dest[64]; // [sp+334h] [bp-124h]@249
|
|
747 char v93[64]; // [sp+374h] [bp-E4h]@297
|
|
748 FrameTableTxtLine v94; // [sp+3B4h] [bp-A4h]@297
|
|
749 int v95; // [sp+430h] [bp-28h]@317
|
|
750 int v96; // [sp+434h] [bp-24h]@9
|
|
751 int v97; // [sp+438h] [bp-20h]@4
|
|
752 char a3[5]; // [sp+43Fh] [bp-19h]@4
|
|
753 int a2; // [sp+444h] [bp-14h]@36
|
|
754 int v100; // [sp+448h] [bp-10h]@36
|
|
755 size_t v101; // [sp+44Ch] [bp-Ch]@19
|
|
756 MonsterStats *v102; // [sp+450h] [bp-8h]@1
|
|
757 int v103; // [sp+454h] [bp-4h]@3
|
|
758
|
|
759 int i,j;
|
|
760 char* test_string;
|
|
761 unsigned char c;
|
|
762 bool break_loop;
|
|
763 unsigned int temp_str_len;
|
|
764 char* tmp_pos;
|
|
765 int decode_step;
|
|
766 int item_counter;
|
|
767 int curr_rec_num;
|
|
768
|
|
769 v1 = this;
|
|
770 v102 = this;
|
|
771 if ( pMonstersTXT_Raw )
|
|
772 pAllocator->FreeChunk(pMonstersTXT_Raw);
|
|
773 pMonstersTXT_Raw = NULL;
|
|
774 pMonstersTXT_Raw = (char *)pEvents_LOD->LoadRaw("monsters.txt", 0);
|
|
775 strtok(pMonstersTXT_Raw, "\r");
|
|
776 strtok(NULL, "\r");
|
|
777 strtok(NULL, "\r");
|
|
778 strtok(NULL, "\r");
|
|
779 uNumMonsters = 265;
|
|
780 curr_rec_num=0;
|
|
781 for (i=0;i<uNumMonsters-1;++i)
|
|
782 {
|
|
783 test_string = strtok(NULL, "\r") + 1;
|
|
784 break_loop = false;
|
|
785 decode_step=0;
|
|
786 do
|
|
787 {
|
|
788 c = *(unsigned char*)test_string;
|
|
789 temp_str_len = 0;
|
|
790 while((c!='\t')&&(c>0))
|
|
791 {
|
|
792 ++temp_str_len;
|
|
793 c=test_string[temp_str_len];
|
|
794 }
|
|
795 tmp_pos=test_string+temp_str_len;
|
|
796 if (*tmp_pos == 0)
|
|
797 break_loop = true;
|
|
798 *tmp_pos = 0;
|
|
799 if (temp_str_len)
|
|
800 {
|
|
801 switch (decode_step)
|
|
802 {
|
|
803 case 0:
|
|
804 curr_rec_num=atoi(test_string);
|
|
805 pInfos[curr_rec_num].uID=curr_rec_num;
|
|
806 break;
|
|
807 case 1:
|
|
808 pInfos[curr_rec_num].pName=RemoveQuotes(test_string);
|
|
809 break;
|
|
810 case 2:
|
|
811 pInfos[curr_rec_num].pPictureName=RemoveQuotes(test_string);
|
|
812 break;
|
|
813 case 3:
|
|
814 pInfos[curr_rec_num].uLevel=atoi(test_string);
|
|
815 break;
|
|
816 case 4:
|
|
817 {
|
|
818 int str_len=0;
|
|
819 int str_pos=0;
|
|
820 pInfos[curr_rec_num].uHP=0;
|
|
821 if (test_string[0]=='"')
|
|
822 test_string[0]=' ';
|
|
823 str_len=strlen(test_string);
|
|
824 if (str_len==0)
|
|
825 break;
|
|
826 while ((test_string[str_pos]!=',')&&(str_pos<str_len))
|
|
827 ++str_pos;
|
|
828 if (str_len==str_pos)
|
|
829 pInfos[curr_rec_num].uHP=atoi(test_string);
|
|
830 else
|
|
831 {
|
|
832 test_string[str_pos]='\0';
|
|
833 pInfos[curr_rec_num].uHP=1000*atoi(test_string);
|
|
834 pInfos[curr_rec_num].uHP+=atoi(&test_string[str_pos+1]);
|
|
835 test_string[str_pos]=',';
|
|
836 }
|
|
837 }
|
|
838 break;
|
|
839 case 5:
|
|
840 pInfos[curr_rec_num].uAC=atoi(test_string);
|
|
841 break;
|
|
842 case 6:
|
|
843 {
|
|
844 int str_len=0;
|
|
845 int str_pos=0;
|
|
846 pInfos[curr_rec_num].uExp=0;
|
|
847 if (test_string[0]=='"')
|
|
848 test_string[0]=' ';
|
|
849 str_len=strlen(test_string);
|
|
850 if (str_len==0)
|
|
851 break;
|
|
852 while ((test_string[str_pos]!=',')&&(str_pos<str_len))
|
|
853 ++str_pos;
|
|
854 if (str_len==str_pos)
|
|
855 pInfos[curr_rec_num].uExp=atoi(test_string);
|
|
856 else
|
|
857 {
|
|
858 test_string[str_pos]='\0';
|
|
859 pInfos[curr_rec_num].uExp=1000*atoi(test_string);
|
|
860 pInfos[curr_rec_num].uExp+=atoi(&test_string[str_pos+1]);
|
|
861 test_string[str_pos]=',';
|
|
862 }
|
|
863 }
|
|
864 break;
|
|
865 case 7:
|
|
866 {
|
|
867 int str_len=0;
|
|
868 int str_pos=0;
|
|
869 bool chance_flag=false;
|
|
870 bool dice_flag=false;
|
|
871 bool item_type_flag=false;
|
|
872 char* item_name;
|
|
873 pInfos[curr_rec_num].uTreasureDropChance=0;
|
|
874 pInfos[curr_rec_num].uTreasureDiceRolls=0;
|
|
875 pInfos[curr_rec_num].uTreasureDiceSides=0;
|
698
|
876 pInfos[curr_rec_num].uTreasureType=0;
|
|
877 pInfos[curr_rec_num].uTreasureLevel=0;
|
694
|
878 if (test_string[0]=='"')
|
|
879 test_string[0]=' ';
|
|
880 str_len=strlen(test_string);
|
|
881 do
|
|
882 {
|
|
883 switch(tolower(test_string[str_pos]))
|
|
884 {
|
|
885 case '%': chance_flag=true; break;
|
|
886 case 'd': dice_flag=true; break;
|
|
887 case 'l': item_type_flag=true; break;
|
|
888 }
|
|
889 ++str_pos;
|
|
890 }
|
|
891 while(str_pos<str_len);
|
|
892 if (chance_flag)
|
|
893 {
|
|
894 pInfos[curr_rec_num].uTreasureDropChance=atoi(test_string);
|
|
895 }
|
|
896 else
|
|
897 {
|
|
898 if ((!dice_flag)&&(!item_type_flag))
|
|
899 break;
|
|
900 pInfos[curr_rec_num].uTreasureDropChance=100;
|
|
901 }
|
|
902 if (dice_flag)
|
|
903 {
|
|
904 str_pos=0;
|
|
905 dice_flag=false;
|
|
906 do
|
|
907 {
|
|
908 switch(tolower(test_string[str_pos]))
|
|
909 {
|
|
910 case '%':
|
|
911 pInfos[curr_rec_num].uTreasureDiceRolls=atoi(&test_string[str_pos+1]);
|
|
912 dice_flag=true;
|
|
913 break;
|
|
914 case 'd':
|
|
915 if(!dice_flag)
|
|
916 pInfos[curr_rec_num].uTreasureDiceRolls=atoi(test_string);
|
|
917 pInfos[curr_rec_num].uTreasureDiceSides=atoi(&test_string[str_pos+1]);
|
|
918 str_pos=str_len;
|
|
919 break;
|
0
|
920
|
694
|
921 }
|
|
922 ++str_pos;
|
|
923 }
|
|
924 while(str_pos<str_len);
|
|
925 }
|
|
926 if (item_type_flag)
|
|
927 {
|
|
928 str_pos=0;
|
|
929 do
|
|
930 {
|
|
931 if (tolower(test_string[str_pos])=='l')
|
|
932 break;
|
|
933 ++str_pos;
|
|
934 }
|
|
935 while(str_pos<str_len);
|
698
|
936
|
694
|
937 pInfos[curr_rec_num].uTreasureLevel=test_string[str_pos+1]-'0';
|
|
938 item_name=&test_string[str_pos+2];
|
|
939 if (*item_name)
|
|
940 {
|
|
941 if ( !_strcmpi(item_name, "WEAPON"))
|
|
942 pInfos[curr_rec_num].uTreasureType= 20;
|
|
943 else if ( !_strcmpi(item_name, "ARMOR"))
|
|
944 pInfos[curr_rec_num].uTreasureType= 21;
|
|
945 else if ( !_strcmpi(item_name, "MISC"))
|
|
946 pInfos[curr_rec_num].uTreasureType= 22;
|
|
947 else if ( !_strcmpi(item_name, "SWORD"))
|
|
948 pInfos[curr_rec_num].uTreasureType= 23;
|
|
949 else if ( !_strcmpi(item_name, "DAGGER"))
|
|
950 pInfos[curr_rec_num].uTreasureType= 24;
|
|
951 else if ( !_strcmpi(item_name, "AXE"))
|
|
952 pInfos[curr_rec_num].uTreasureType= 25;
|
|
953 else if ( !_strcmpi(item_name, "SPEAR"))
|
|
954 pInfos[curr_rec_num].uTreasureType= 26;
|
|
955 else if ( !_strcmpi(item_name, "BOW"))
|
|
956 pInfos[curr_rec_num].uTreasureType= 27;
|
|
957 else if ( !_strcmpi(item_name, "MACE"))
|
|
958 pInfos[curr_rec_num].uTreasureType= 28;
|
|
959 else if ( !_strcmpi(item_name, "CLUB"))
|
|
960 pInfos[curr_rec_num].uTreasureType= 29;
|
|
961 else if ( !_strcmpi(item_name, "STAFF"))
|
|
962 pInfos[curr_rec_num].uTreasureType= 30;
|
|
963 else if ( !_strcmpi(item_name, "LEATHER"))
|
|
964 pInfos[curr_rec_num].uTreasureType= 31;
|
|
965 else if ( !_strcmpi(item_name, "CHAIN"))
|
|
966 pInfos[curr_rec_num].uTreasureType= 32;
|
|
967 else if ( !_strcmpi(item_name, "PLATE"))
|
|
968 pInfos[curr_rec_num].uTreasureType= 33;
|
|
969 else if ( !_strcmpi(item_name, "SHIELD"))
|
|
970 pInfos[curr_rec_num].uTreasureType= 34;
|
|
971 else if ( !_strcmpi(item_name, "HELM"))
|
|
972 pInfos[curr_rec_num].uTreasureType= 35;
|
|
973 else if ( !_strcmpi(item_name, "BELT"))
|
|
974 pInfos[curr_rec_num].uTreasureType= 36;
|
|
975 else if ( !_strcmpi(item_name, "CAPE"))
|
|
976 pInfos[curr_rec_num].uTreasureType= 37;
|
|
977 else if ( !_strcmpi(item_name, "GAUNTLETS"))
|
|
978 pInfos[curr_rec_num].uTreasureType= 38;
|
|
979 else if ( !_strcmpi(item_name, "BOOTS"))
|
|
980 pInfos[curr_rec_num].uTreasureType= 39;
|
|
981 else if ( !_strcmpi(item_name, "RING"))
|
|
982 pInfos[curr_rec_num].uTreasureType= 40;
|
|
983 else if ( !_strcmpi(item_name, "AMULET"))
|
|
984 pInfos[curr_rec_num].uTreasureType= 41;
|
|
985 else if ( !_strcmpi(item_name, "WAND"))
|
|
986 pInfos[curr_rec_num].uTreasureType= 42;
|
|
987 else if ( !_strcmpi(item_name, "SCROLL"))
|
|
988 pInfos[curr_rec_num].uTreasureType= 43;
|
|
989 else if ( !_strcmpi(item_name, "GEM"))
|
|
990 pInfos[curr_rec_num].uTreasureType= 46;
|
|
991 }
|
|
992 }
|
|
993
|
|
994 }
|
|
995 break;
|
|
996 case 8:
|
|
997 {
|
|
998 pInfos[curr_rec_num].bQuestMonster=0;
|
|
999 if (atoi(test_string))
|
|
1000 pInfos[curr_rec_num].bQuestMonster=1;
|
|
1001 }
|
|
1002 break;
|
|
1003 case 9:
|
|
1004 {
|
|
1005 pInfos[curr_rec_num].uFlying=false;
|
|
1006 if (_strnicmp(test_string, "n",1))
|
|
1007 pInfos[curr_rec_num].uFlying=true;
|
|
1008 }
|
|
1009 break;
|
|
1010 case 10:
|
|
1011 {
|
|
1012 switch(tolower(test_string[0]))
|
|
1013 {
|
|
1014 case 's': pInfos[curr_rec_num].uMovementType=0;// short
|
|
1015 if (tolower(test_string[1])!='h')
|
|
1016 pInfos[curr_rec_num].uMovementType=5; //??
|
|
1017 break; //short
|
|
1018 case 'l': pInfos[curr_rec_num].uMovementType=2; break; //long
|
|
1019 case 'm': pInfos[curr_rec_num].uMovementType=1; break; //med
|
|
1020 case 'g': pInfos[curr_rec_num].uMovementType=3; break; //???
|
|
1021 default:
|
|
1022 pInfos[curr_rec_num].uMovementType=4; //free
|
|
1023 }
|
|
1024 }
|
|
1025 break;
|
|
1026 case 11:
|
|
1027 {
|
|
1028 switch(tolower(test_string[0]))
|
|
1029 {
|
|
1030 case 's': pInfos[curr_rec_num].uAIType=0; break; // suicide
|
|
1031 case 'w': pInfos[curr_rec_num].uAIType=1; break; //wimp
|
|
1032 case 'n': pInfos[curr_rec_num].uAIType=2; break; //normal
|
|
1033 default:
|
|
1034 pInfos[curr_rec_num].uAIType=3; //Agress
|
|
1035 }
|
|
1036 }
|
|
1037 break;
|
|
1038 case 12:
|
|
1039 pInfos[curr_rec_num].uHostilityType=(MonsterInfo::HostilityRadius)atoi(test_string);
|
|
1040 break;
|
|
1041 case 13:
|
|
1042 pInfos[curr_rec_num].uBaseSpeed=atoi(test_string);
|
|
1043 break;
|
|
1044 case 14:
|
|
1045 pInfos[curr_rec_num].uRecoveryTime=atoi(test_string);
|
|
1046 break;
|
|
1047 case 15:
|
|
1048 {
|
|
1049 int str_len=0;
|
|
1050 int str_pos=0;
|
|
1051 pInfos[curr_rec_num].uAttackPreference=0;
|
|
1052 pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=0;
|
|
1053 str_len=strlen(test_string);
|
|
1054 for (str_pos=0;str_pos<str_len;++str_pos )
|
|
1055 {
|
|
1056 switch(tolower(test_string[str_pos]))
|
|
1057 {
|
|
1058 case '0': pInfos[curr_rec_num].uAttackPreference|=0x0004; break;
|
|
1059 case '2': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=2; break;
|
|
1060 case '3': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=3; break;
|
|
1061 case '4': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=4; break;
|
|
1062 case 'c': pInfos[curr_rec_num].uAttackPreference|=0x0010; break;
|
|
1063 case 'd': pInfos[curr_rec_num].uAttackPreference|=0x0008; break;
|
698
|
1064 case 'e': pInfos[curr_rec_num].uAttackPreference|=0x1000; break;
|
694
|
1065 case 'f': pInfos[curr_rec_num].uAttackPreference|=0x0400; break;
|
|
1066 case 'h': pInfos[curr_rec_num].uAttackPreference|=0x0800; break;
|
|
1067 case 'k': pInfos[curr_rec_num].uAttackPreference|=0x0001; break;
|
|
1068 case 'm': pInfos[curr_rec_num].uAttackPreference|=0x0100; break;
|
|
1069 case 'o': pInfos[curr_rec_num].uAttackPreference|=0x0400; break;
|
|
1070 case 'p': pInfos[curr_rec_num].uAttackPreference|=0x0002; break;
|
|
1071 case 'r': pInfos[curr_rec_num].uAttackPreference|=0x0040; break;
|
|
1072 case 's': pInfos[curr_rec_num].uAttackPreference|=0x0020; break;
|
|
1073 case 't': pInfos[curr_rec_num].uAttackPreference|=0x0080; break;
|
|
1074 case 'w': pInfos[curr_rec_num].uAttackPreference|=0x2000; break;
|
|
1075 case 'x': pInfos[curr_rec_num].uAttackPreference|=0x0200; break;
|
|
1076 }
|
|
1077 }
|
|
1078 }
|
|
1079 break;
|
698
|
1080 case 16:
|
694
|
1081 {
|
|
1082
|
|
1083 }
|
|
1084 break;
|
|
1085 case 17:
|
698
|
1086 pInfos[curr_rec_num].uAttack1Type=ParseAttackType(test_string);
|
694
|
1087 break;
|
|
1088 case 18:
|
|
1089 {
|
698
|
1090 ParseDamage(test_string, &pInfos[curr_rec_num].uAttack1DamageDiceRolls,
|
|
1091 &pInfos[curr_rec_num].uAttack1DamageDiceSides,
|
|
1092 &pInfos[curr_rec_num].uAttack1DamageBonus);
|
694
|
1093 }
|
|
1094 break;
|
698
|
1095 case 19:
|
|
1096 pInfos[curr_rec_num].uMissleAttack1Type=ParseMissleAttackType(test_string);
|
694
|
1097 break;
|
|
1098 case 20:
|
698
|
1099 pInfos[curr_rec_num].uAttack2Chance=atoi(test_string);
|
694
|
1100 break;
|
|
1101 case 21:
|
698
|
1102 pInfos[curr_rec_num].uAttack2Type=ParseAttackType(test_string);
|
694
|
1103 break;
|
|
1104 case 22:
|
|
1105 {
|
698
|
1106 ParseDamage(test_string, &pInfos[curr_rec_num].uAttack2DamageDiceRolls,
|
|
1107 &pInfos[curr_rec_num].uAttack2DamageDiceSides,
|
|
1108 &pInfos[curr_rec_num].uAttack2DamageBonus);
|
694
|
1109 }
|
|
1110 break;
|
|
1111 case 23:
|
698
|
1112 pInfos[curr_rec_num].uMissleAttack2Type=ParseMissleAttackType(test_string);
|
694
|
1113 break;
|
|
1114 case 24:
|
698
|
1115 pInfos[curr_rec_num].uSpell1UseChance=atoi(test_string);
|
694
|
1116 break;
|
|
1117 case 25:
|
|
1118 {
|
|
1119
|
|
1120 }
|
|
1121 break;
|
|
1122 case 26:
|
698
|
1123 pInfos[curr_rec_num].uSpell2UseChance=atoi(test_string);
|
694
|
1124 break;
|
|
1125 case 27:
|
|
1126 {
|
|
1127
|
|
1128 }
|
|
1129 break;
|
|
1130 case 28:
|
|
1131 {
|
698
|
1132 if (tolower(test_string[0])=='i')
|
|
1133 pInfos[curr_rec_num].uResFire=200;
|
|
1134 else
|
|
1135 pInfos[curr_rec_num].uResFire=atoi(test_string);
|
694
|
1136 }
|
|
1137 break;
|
|
1138 case 29:
|
|
1139 {
|
698
|
1140 if (tolower(test_string[0])=='i')
|
|
1141 pInfos[curr_rec_num].uResAir=200;
|
|
1142 else
|
|
1143 pInfos[curr_rec_num].uResAir=atoi(test_string);
|
694
|
1144 }
|
|
1145 break;
|
|
1146 case 30:
|
|
1147 {
|
698
|
1148 if (tolower(test_string[0])=='i')
|
|
1149 pInfos[curr_rec_num].uResWater=200;
|
|
1150 else
|
|
1151 pInfos[curr_rec_num].uResWater=atoi(test_string);
|
694
|
1152 }
|
|
1153 break;
|
|
1154 case 31:
|
|
1155 {
|
698
|
1156 if (tolower(test_string[0])=='i')
|
|
1157 pInfos[curr_rec_num].uResEarth=200;
|
|
1158 else
|
|
1159 pInfos[curr_rec_num].uResEarth=atoi(test_string);
|
694
|
1160 }
|
|
1161 break;
|
|
1162 case 32:
|
|
1163 {
|
698
|
1164 if (tolower(test_string[0])=='i')
|
|
1165 pInfos[curr_rec_num].uResMind=200;
|
|
1166 else
|
|
1167 pInfos[curr_rec_num].uResMind=atoi(test_string);
|
694
|
1168 }
|
|
1169 break;
|
|
1170 case 33:
|
|
1171 {
|
698
|
1172 if (tolower(test_string[0])=='i')
|
|
1173 pInfos[curr_rec_num].uResSpirit=200;
|
|
1174 else
|
|
1175 pInfos[curr_rec_num].uResSpirit=atoi(test_string);
|
694
|
1176 }
|
|
1177 break;
|
|
1178 case 34:
|
|
1179 {
|
698
|
1180 if (tolower(test_string[0])=='i')
|
|
1181 pInfos[curr_rec_num].uResBody=200;
|
|
1182 else
|
|
1183 pInfos[curr_rec_num].uResBody=atoi(test_string);
|
694
|
1184 }
|
|
1185 break;
|
|
1186 case 35:
|
|
1187 {
|
698
|
1188 if (tolower(test_string[0])=='i')
|
|
1189 pInfos[curr_rec_num].uResLight=200;
|
|
1190 else
|
|
1191 pInfos[curr_rec_num].uResLight=atoi(test_string);
|
694
|
1192 }
|
|
1193 break;
|
|
1194 case 36:
|
|
1195 {
|
698
|
1196 if (tolower(test_string[0])=='i')
|
|
1197 pInfos[curr_rec_num].uResDark=200;
|
|
1198 else
|
|
1199 pInfos[curr_rec_num].uResDark=atoi(test_string);
|
694
|
1200 }
|
|
1201 break;
|
|
1202 case 37:
|
|
1203 {
|
698
|
1204 if (tolower(test_string[0])=='i')
|
|
1205 pInfos[curr_rec_num].uResPhysical=200;
|
|
1206 else
|
|
1207 pInfos[curr_rec_num].uResPhysical=atoi(test_string);
|
694
|
1208 }
|
|
1209 break;
|
|
1210 case 38:
|
|
1211 {
|
|
1212
|
|
1213 }
|
698
|
1214 break;
|
694
|
1215 }
|
|
1216 }
|
|
1217 else
|
|
1218 {
|
|
1219 break_loop = true;
|
|
1220 }
|
|
1221 ++decode_step;
|
|
1222 test_string=tmp_pos+1;
|
|
1223 } while ((decode_step<39)&&!break_loop);
|
|
1224 }
|
|
1225 uNumMonsters = i;
|
|
1226
|
|
1227 /*
|
0
|
1228 v103 = 0;
|
|
1229 v1->uNumMonsters = 265;
|
|
1230 do
|
|
1231 {
|
694
|
1232 v2 = (int)(strtok(NULL, "\r") + 1);
|
0
|
1233 *(_DWORD *)&a3[1] = 0;
|
|
1234 v97 = 0;
|
|
1235 do
|
|
1236 {
|
|
1237 v3 = *(_BYTE *)v2;
|
|
1238 v4 = 0;
|
|
1239 while ( v3 != 9 && v3 )
|
|
1240 {
|
|
1241 ++v4;
|
|
1242 v3 = *(_BYTE *)(v4 + v2);
|
|
1243 }
|
|
1244 v96 = v4 + v2;
|
|
1245 if ( !*(_BYTE *)(v4 + v2) )
|
|
1246 v97 = 1;
|
|
1247 *(_BYTE *)(v4 + v2) = 0;
|
|
1248 if ( v4 )
|
|
1249 {
|
|
1250 switch ( *(_DWORD *)&a3[1] )
|
|
1251 {
|
694
|
1252 /* case 0:
|
0
|
1253 v103 = atoi((const char *)v2);
|
|
1254 v102->pInfos[v103].uID = v103;
|
|
1255 goto LABEL_325;
|
|
1256 case 2:
|
694
|
1257 v102->pInfos[v103].pPictureName = RemoveQuotes((char *)v2);
|
0
|
1258 goto LABEL_325;
|
|
1259 case 1:
|
|
1260 v102->pInfos[v103].pName = RemoveQuotes((char *)v2);
|
|
1261 goto LABEL_325;
|
|
1262 case 3:
|
|
1263 v102->pInfos[v103].uLevel = atoi((const char *)v2);
|
|
1264 goto LABEL_325;
|
|
1265 case 4:
|
|
1266 if ( *(_BYTE *)v2 == 34 )
|
|
1267 *(_BYTE *)v2 = 32;
|
|
1268 v5 = strlen((const char *)v2);
|
|
1269 v6 = 0;
|
|
1270 v101 = v5;
|
|
1271 if ( (signed int)v5 <= 0 )
|
|
1272 goto LABEL_24;
|
|
1273 while ( *(_BYTE *)(v6 + v2) != 44 )
|
|
1274 {
|
|
1275 ++v6;
|
|
1276 if ( v6 >= (signed int)v5 )
|
|
1277 goto LABEL_24;
|
|
1278 }
|
|
1279 v7 = v102;
|
|
1280 v8 = v103;
|
|
1281 *(_BYTE *)(v6 + v2) = 0;
|
|
1282 pHP = &v7->pInfos[v8].uHP;
|
|
1283 *pHP = 1000 * atoi((const char *)v2);
|
|
1284 v83 = (char *)(v6 + v2 + 1);
|
|
1285 *(_BYTE *)(v6 + v2) = 44;
|
|
1286 *pHP += atoi(v83);
|
|
1287 LABEL_24:
|
|
1288 if ( v6 == v101 )
|
|
1289 v102->pInfos[v103].uHP = atoi((const char *)v2);
|
|
1290 goto LABEL_325;
|
|
1291 case 5:
|
|
1292 v102->pInfos[v103].uAC = atoi((const char *)v2);
|
|
1293 goto LABEL_325;
|
|
1294 case 6:
|
|
1295 if ( *(_BYTE *)v2 == 34 )
|
|
1296 *(_BYTE *)v2 = 32;
|
|
1297 v10 = strlen((const char *)v2);
|
|
1298 v11 = 0;
|
|
1299 v101 = v10;
|
|
1300 if ( (signed int)v10 <= 0 )
|
|
1301 goto LABEL_34;
|
|
1302 while ( *(_BYTE *)(v11 + v2) != 44 )
|
|
1303 {
|
|
1304 ++v11;
|
|
1305 if ( v11 >= (signed int)v10 )
|
|
1306 goto LABEL_34;
|
|
1307 }
|
|
1308 v12 = v102;
|
|
1309 v13 = v103;
|
|
1310 *(_BYTE *)(v11 + v2) = 0;
|
|
1311 pExp = &v12->pInfos[v13].uExp;
|
|
1312 *pExp = 1000 * atoi((const char *)v2);
|
|
1313 v83 = (char *)(v11 + v2 + 1);
|
|
1314 *(_BYTE *)(v11 + v2) = 44;
|
|
1315 *pExp += atoi(v83);
|
|
1316 LABEL_34:
|
|
1317 if ( v11 == v101 )
|
|
1318 v102->pInfos[v103].uExp = atoi((const char *)v2);
|
|
1319 goto LABEL_325;
|
|
1320 case 7:
|
|
1321 v15 = 0;
|
|
1322 a2 = 0;
|
|
1323 v100 = 0;
|
|
1324 v16 = 0;
|
|
1325 v101 = strlen((const char *)v2);
|
|
1326 if ( (signed int)v101 <= 0 )
|
|
1327 goto LABEL_325;
|
|
1328 do
|
|
1329 {
|
|
1330 v84 = (char *)*(_BYTE *)(v16 + v2);
|
|
1331 v17 = tolower((int)v84);
|
|
1332 switch ( v17 )
|
|
1333 {
|
|
1334 case 37:
|
|
1335 v15 = 1;
|
|
1336 break;
|
|
1337 case 100:
|
|
1338 v100 = 1;
|
|
1339 break;
|
|
1340 case 108:
|
|
1341 a2 = 1;
|
|
1342 break;
|
|
1343 }
|
|
1344 ++v16;
|
|
1345 }
|
|
1346 while ( (signed int)v16 < (signed int)v101 );
|
|
1347 if ( v15 )
|
|
1348 {
|
|
1349 v18 = &v102->pInfos[v103];
|
|
1350 v18->uTreasureDropChance = atoi((const char *)v2);
|
|
1351 }
|
|
1352 else
|
|
1353 {
|
|
1354 if ( !v100 && !a2 )
|
|
1355 goto LABEL_325;
|
|
1356 v18 = &v102->pInfos[v103];
|
|
1357 v18->uTreasureDropChance = 100;
|
|
1358 }
|
|
1359 if ( v100 )
|
|
1360 {
|
|
1361 v19 = 0;
|
|
1362 v100 = 0;
|
|
1363 do
|
|
1364 {
|
|
1365 v84 = (char *)*(_BYTE *)(v19 + v2);
|
|
1366 v20 = tolower((int)v84);
|
|
1367 if ( v20 == 37 )
|
|
1368 {
|
|
1369 v84 = (char *)(v19 + v2 + 1);
|
|
1370 v18->uTreasureDiceRolls = atoi(v84);
|
|
1371 v100 = 1;
|
|
1372 }
|
|
1373 else
|
|
1374 {
|
|
1375 if ( v20 == 100 )
|
|
1376 {
|
|
1377 if ( !v100 )
|
|
1378 v18->uTreasureDiceRolls = atoi((const char *)v2);
|
|
1379 v84 = (char *)(v19 + v2 + 1);
|
|
1380 v21 = atoi(v84);
|
|
1381 v19 = v101;
|
|
1382 v18->uTreasureDiceSides = v21;
|
|
1383 }
|
|
1384 }
|
|
1385 ++v19;
|
|
1386 }
|
|
1387 while ( (signed int)v19 < (signed int)v101 );
|
|
1388 }
|
|
1389 if ( a2 )
|
|
1390 {
|
|
1391 v22 = 0;
|
|
1392 while ( 1 )
|
|
1393 {
|
|
1394 v84 = (char *)*(_BYTE *)(v22 + v2);
|
|
1395 if ( tolower((int)v84) == 108 )
|
|
1396 break;
|
|
1397 ++v22;
|
|
1398 if ( (signed int)v22 >= (signed int)v101 )
|
|
1399 goto LABEL_325;
|
|
1400 }
|
|
1401 v23 = *(_BYTE *)(v22 + v2 + 1);
|
|
1402 v24 = (const char *)(v22 + v2 + 2);
|
|
1403 v18->uTreasureLevel = v23 - 48;
|
|
1404 if ( *v24 )
|
|
1405 {
|
|
1406 if ( _strcmpi(v24, "WEAPON") )
|
|
1407 {
|
|
1408 if ( _strcmpi(v24, "ARMOR") )
|
|
1409 {
|
|
1410 if ( _strcmpi(v24, "MISC") )
|
|
1411 {
|
|
1412 if ( _strcmpi(v24, "SWORD") )
|
|
1413 {
|
|
1414 if ( _strcmpi(v24, "DAGGER") )
|
|
1415 {
|
|
1416 if ( _strcmpi(v24, "AXE") )
|
|
1417 {
|
|
1418 if ( _strcmpi(v24, "SPEAR") )
|
|
1419 {
|
|
1420 if ( _strcmpi(v24, "BOW") )
|
|
1421 {
|
|
1422 if ( _strcmpi(v24, "MACE") )
|
|
1423 {
|
|
1424 if ( _strcmpi(v24, "CLUB") )
|
|
1425 {
|
|
1426 if ( _strcmpi(v24, "STAFF") )
|
|
1427 {
|
|
1428 if ( _strcmpi(v24, "LEATHER") )
|
|
1429 {
|
|
1430 if ( _strcmpi(v24, "CHAIN") )
|
|
1431 {
|
|
1432 if ( _strcmpi(v24, "PLATE") )
|
|
1433 {
|
|
1434 if ( _strcmpi(v24, "SHIELD") )
|
|
1435 {
|
|
1436 if ( _strcmpi(v24, "HELM") )
|
|
1437 {
|
|
1438 if ( _strcmpi(v24, "BELT") )
|
|
1439 {
|
|
1440 if ( _strcmpi(v24, "CAPE") )
|
|
1441 {
|
|
1442 if ( _strcmpi(v24, "GAUNTLETS") )
|
|
1443 {
|
|
1444 if ( _strcmpi(v24, "BOOTS") )
|
|
1445 {
|
|
1446 if ( _strcmpi(v24, "RING") )
|
|
1447 {
|
|
1448 if ( _strcmpi(v24, "AMULET") )
|
|
1449 {
|
|
1450 if ( _strcmpi(v24, "WAND") )
|
|
1451 {
|
|
1452 if ( _strcmpi(v24, "SCROLL") )
|
|
1453 {
|
|
1454 if ( !_strcmpi(v24, "GEM") )
|
|
1455 v18->uTreasureType = 46;
|
|
1456 }
|
|
1457 else
|
|
1458 {
|
|
1459 v18->uTreasureType = 43;
|
|
1460 }
|
|
1461 }
|
|
1462 else
|
|
1463 {
|
|
1464 v18->uTreasureType = 42;
|
|
1465 }
|
|
1466 }
|
|
1467 else
|
|
1468 {
|
|
1469 v18->uTreasureType = 41;
|
|
1470 }
|
|
1471 }
|
|
1472 else
|
|
1473 {
|
|
1474 v18->uTreasureType = 40;
|
|
1475 }
|
|
1476 }
|
|
1477 else
|
|
1478 {
|
|
1479 v18->uTreasureType = 39;
|
|
1480 }
|
|
1481 }
|
|
1482 else
|
|
1483 {
|
|
1484 v18->uTreasureType = 38;
|
|
1485 }
|
|
1486 }
|
|
1487 else
|
|
1488 {
|
|
1489 v18->uTreasureType = 37;
|
|
1490 }
|
|
1491 }
|
|
1492 else
|
|
1493 {
|
|
1494 v18->uTreasureType = 36;
|
|
1495 }
|
|
1496 }
|
|
1497 else
|
|
1498 {
|
|
1499 v18->uTreasureType = 35;
|
|
1500 }
|
|
1501 }
|
|
1502 else
|
|
1503 {
|
|
1504 v18->uTreasureType = 34;
|
|
1505 }
|
|
1506 }
|
|
1507 else
|
|
1508 {
|
|
1509 v18->uTreasureType = 33;
|
|
1510 }
|
|
1511 }
|
|
1512 else
|
|
1513 {
|
|
1514 v18->uTreasureType = 32;
|
|
1515 }
|
|
1516 }
|
|
1517 else
|
|
1518 {
|
|
1519 v18->uTreasureType = 31;
|
|
1520 }
|
|
1521 }
|
|
1522 else
|
|
1523 {
|
|
1524 v18->uTreasureType = 30;
|
|
1525 }
|
|
1526 }
|
|
1527 else
|
|
1528 {
|
|
1529 v18->uTreasureType = 29;
|
|
1530 }
|
|
1531 }
|
|
1532 else
|
|
1533 {
|
|
1534 v18->uTreasureType = 28;
|
|
1535 }
|
|
1536 }
|
|
1537 else
|
|
1538 {
|
|
1539 v18->uTreasureType = 27;
|
|
1540 }
|
|
1541 }
|
|
1542 else
|
|
1543 {
|
|
1544 v18->uTreasureType = 26;
|
|
1545 }
|
|
1546 }
|
|
1547 else
|
|
1548 {
|
|
1549 v18->uTreasureType = 25;
|
|
1550 }
|
|
1551 }
|
|
1552 else
|
|
1553 {
|
|
1554 v18->uTreasureType = 24;
|
|
1555 }
|
|
1556 }
|
|
1557 else
|
|
1558 {
|
|
1559 v18->uTreasureType = 23;
|
|
1560 }
|
|
1561 }
|
|
1562 else
|
|
1563 {
|
|
1564 v18->uTreasureType = 22;
|
|
1565 }
|
|
1566 }
|
|
1567 else
|
|
1568 {
|
|
1569 v18->uTreasureType = 21;
|
|
1570 }
|
|
1571 }
|
|
1572 else
|
|
1573 {
|
|
1574 v18->uTreasureType = 20;
|
|
1575 }
|
|
1576 }
|
|
1577 }
|
|
1578 goto LABEL_325;
|
|
1579 case 8:
|
|
1580 v84 = (char *)v2;
|
|
1581 v25 = &v102->pInfos[v103].bQuestMonster;
|
|
1582 *v25 = 0;
|
|
1583 if ( atoi(v84) )
|
|
1584 *(_BYTE *)v25 |= 1u;
|
|
1585 goto LABEL_325;
|
|
1586 case 9:
|
|
1587 v102->pInfos[v103].uFlying = _strnicmp((const char *)v2, "n", 1u);
|
|
1588 goto LABEL_325;
|
|
1589 case 0xA:
|
|
1590 v84 = (char *)*(_BYTE *)v2;
|
|
1591 v101 = 4;
|
|
1592 if ( tolower((int)v84) == 's' )
|
|
1593 {
|
|
1594 v84 = (char *)*(_BYTE *)(v2 + 1);
|
|
1595 v26 = tolower((int)v84) != 'h' ? 5 : 0;
|
|
1596 }
|
|
1597 else
|
|
1598 {
|
|
1599 v84 = (char *)*(_BYTE *)v2;
|
|
1600 if ( tolower((int)v84) == 'm' )
|
|
1601 {
|
|
1602 v101 = 1;
|
|
1603 }
|
|
1604 else
|
|
1605 {
|
|
1606 v84 = (char *)*(_BYTE *)v2;
|
|
1607 if ( tolower((int)v84) == 'l' )
|
|
1608 {
|
|
1609 v101 = 2;
|
|
1610 }
|
|
1611 else
|
|
1612 {
|
|
1613 v84 = (char *)*(_BYTE *)v2;
|
|
1614 if ( tolower((int)v84) == 'g' )
|
|
1615 v101 = 3;
|
|
1616 }
|
|
1617 }
|
|
1618 LOBYTE(v26) = v101;
|
|
1619 }
|
|
1620 v102->pInfos[v103].uMovementType = v26;
|
|
1621 goto LABEL_325;
|
|
1622 case 0xB:
|
|
1623 v84 = (char *)*(_BYTE *)v2;
|
|
1624 v101 = 3;
|
|
1625 if ( tolower((int)v84) == 's' )
|
|
1626 {
|
|
1627 v101 = 0;
|
|
1628 }
|
|
1629 else
|
|
1630 {
|
|
1631 v84 = (char *)*(_BYTE *)v2;
|
|
1632 if ( tolower((int)v84) == 'w' )
|
|
1633 {
|
|
1634 v101 = 1;
|
|
1635 }
|
|
1636 else
|
|
1637 {
|
|
1638 v84 = (char *)*(_BYTE *)v2;
|
|
1639 if ( tolower((int)v84) == 'n' )
|
|
1640 v101 = 2;
|
|
1641 }
|
|
1642 }
|
|
1643 v102->pInfos[v103].uAIType = v101;
|
|
1644 goto LABEL_325;
|
|
1645 case 0xC:
|
|
1646 v102->pInfos[v103].uHostilityType = (MonsterInfo::HostilityRadius)atoi((const char *)v2);
|
|
1647 goto LABEL_325;
|
|
1648 case 0xD:
|
|
1649 v102->pInfos[v103].uBaseSpeed = atoi((const char *)v2);
|
|
1650 goto LABEL_325;
|
|
1651 case 0xF:
|
|
1652 v27 = strlen((const char *)v2);
|
|
1653 v100 = 0;
|
|
1654 v101 = v27;
|
|
1655 if ( (signed int)v27 > 0 )
|
|
1656 {
|
|
1657 v28 = v103;
|
|
1658 v29 = v102;
|
|
1659 do
|
|
1660 {
|
|
1661 v84 = (char *)*(_BYTE *)(v100 + v2);
|
|
1662 v30 = tolower((int)v84);
|
|
1663 if ( v30 > 107 )
|
|
1664 {
|
|
1665 if ( v30 > 115 )
|
|
1666 {
|
|
1667 v40 = v30 - 116;
|
|
1668 if ( v40 )
|
|
1669 {
|
|
1670 v41 = v40 - 3;
|
|
1671 if ( v41 )
|
|
1672 {
|
|
1673 if ( v41 == 1 )
|
|
1674 BYTE1(v29->pInfos[v28].uAttackPreference) |= 2u;
|
|
1675 }
|
|
1676 else
|
|
1677 {
|
|
1678 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x20u;
|
|
1679 }
|
|
1680 }
|
|
1681 else
|
|
1682 {
|
|
1683 LOBYTE(v29->pInfos[v28].uAttackPreference) |= 0x80u;
|
|
1684 }
|
|
1685 }
|
|
1686 else
|
|
1687 {
|
|
1688 if ( v30 == 115 )
|
|
1689 {
|
|
1690 v29->pInfos[v28].uAttackPreference |= 0x20u;
|
|
1691 }
|
|
1692 else
|
|
1693 {
|
|
1694 v37 = v30 - 109;
|
|
1695 if ( v37 )
|
|
1696 {
|
|
1697 v38 = v37 - 2;
|
|
1698 if ( v38 )
|
|
1699 {
|
|
1700 v39 = v38 - 1;
|
|
1701 if ( v39 )
|
|
1702 {
|
|
1703 if ( v39 == 2 )
|
|
1704 v29->pInfos[v28].uAttackPreference |= 0x40u;
|
|
1705 }
|
|
1706 else
|
|
1707 {
|
|
1708 v29->pInfos[v28].uAttackPreference |= 2u;
|
|
1709 }
|
|
1710 }
|
|
1711 else
|
|
1712 {
|
|
1713 BYTE1(v29->pInfos[v28].uAttackPreference) |= 4u;
|
|
1714 }
|
|
1715 }
|
|
1716 else
|
|
1717 {
|
|
1718 BYTE1(v29->pInfos[v28].uAttackPreference) |= 1u;
|
|
1719 }
|
|
1720 }
|
|
1721 }
|
|
1722 }
|
|
1723 else
|
|
1724 {
|
|
1725 if ( v30 == 107 )
|
|
1726 {
|
|
1727 v29->pInfos[v28].uAttackPreference |= 1u;
|
|
1728 }
|
|
1729 else
|
|
1730 {
|
|
1731 if ( v30 > 99 )
|
|
1732 {
|
|
1733 v34 = v30 - 100;
|
|
1734 if ( v34 )
|
|
1735 {
|
|
1736 v35 = v34 - 1;
|
|
1737 if ( v35 )
|
|
1738 {
|
|
1739 v36 = v35 - 2;
|
|
1740 if ( v36 )
|
|
1741 {
|
|
1742 if ( v36 == 1 )
|
|
1743 BYTE1(v29->pInfos[v28].uAttackPreference) |= 8u;
|
|
1744 }
|
|
1745 else
|
|
1746 {
|
|
1747 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x40u;
|
|
1748 }
|
|
1749 }
|
|
1750 else
|
|
1751 {
|
|
1752 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x10u;
|
|
1753 }
|
|
1754 }
|
|
1755 else
|
|
1756 {
|
|
1757 v29->pInfos[v28].uAttackPreference |= 8u;
|
|
1758 }
|
|
1759 }
|
|
1760 else
|
|
1761 {
|
|
1762 if ( v30 == 99 )
|
|
1763 {
|
|
1764 v29->pInfos[v28].uAttackPreference |= 0x10u;
|
|
1765 }
|
|
1766 else
|
|
1767 {
|
|
1768 v31 = v30 - 50;
|
|
1769 if ( v31 )
|
|
1770 {
|
|
1771 v32 = v31 - 1;
|
|
1772 if ( v32 )
|
|
1773 {
|
|
1774 v33 = v32 - 1;
|
|
1775 if ( v33 )
|
|
1776 {
|
|
1777 if ( v33 == 45 )
|
|
1778 v29->pInfos[v28].uAttackPreference |= 4u;
|
|
1779 }
|
|
1780 else
|
|
1781 {
|
|
1782 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 4;
|
|
1783 }
|
|
1784 }
|
|
1785 else
|
|
1786 {
|
|
1787 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 3;
|
|
1788 }
|
|
1789 }
|
|
1790 else
|
|
1791 {
|
|
1792 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 2;
|
|
1793 }
|
|
1794 }
|
|
1795 }
|
|
1796 }
|
|
1797 }
|
|
1798 ++v100;
|
|
1799 }
|
|
1800 while ( v100 < (signed int)v101 );
|
|
1801 }
|
|
1802 goto LABEL_325;
|
|
1803 case 0xE:
|
|
1804 v102->pInfos[v103].uRecoveryTime = atoi((const char *)v2);
|
|
1805 goto LABEL_325;
|
|
1806 case 0x10:
|
|
1807 v42 = strlen((const char *)v2);
|
|
1808 v43 = 0;
|
|
1809 v44 = &v102->pInfos[v103];
|
|
1810 v100 = v42;
|
|
1811 v44->uSpecialAttackType = 1;
|
|
1812 if ( (signed int)v42 <= 0 )
|
|
1813 goto LABEL_185;
|
|
1814 break;
|
|
1815 case 0x11:
|
|
1816 v102->pInfos[v103].uAttack1Type = ParseAttackType((unsigned __int8 *)v2);
|
|
1817 goto LABEL_325;
|
|
1818 case 0x12:
|
|
1819 v46 = &v102->pInfos[v103];
|
|
1820 v47 = (char *)&v46->uAttack1DamageDiceRolls;
|
|
1821 v84 = (char *)&v46->uAttack1DamageBonus;
|
|
1822 v48 = (char *)&v46->uAttack1DamageDiceSides;
|
|
1823 goto LABEL_237;
|
|
1824 case 0x13:
|
|
1825 v102->pInfos[v103].uMissleAttack1Type = ParseMissleAttackType((const char *)v2);
|
|
1826 goto LABEL_325;
|
|
1827 case 0x14:
|
|
1828 v102->pInfos[v103].uAttack2Chance = atoi((const char *)v2);
|
|
1829 goto LABEL_325;
|
|
1830 case 0x15:
|
|
1831 v102->pInfos[v103].uAttack2Type = ParseAttackType((unsigned __int8 *)v2);
|
|
1832 goto LABEL_325;
|
|
1833 case 0x16:
|
|
1834 v49 = &v102->pInfos[v103];
|
|
1835 v47 = (char *)&v49->uAttack2DamageDiceRolls;
|
|
1836 v84 = (char *)&v49->uAttack2DamageBonus;
|
|
1837 v48 = (char *)&v49->uAttack2DamageDiceSides;
|
|
1838 LABEL_237:
|
|
1839 ParseDamage((const char *)v2, (int)v47, (int)v48, (int)v84);
|
|
1840 goto LABEL_325;
|
|
1841 case 0x17:
|
|
1842 v102->pInfos[v103].uMissleAttack2Type = ParseMissleAttackType((const char *)v2);
|
|
1843 goto LABEL_325;
|
|
1844 case 0x18:
|
|
1845 v102->pInfos[v103].uSpell1UseChance = atoi((const char *)v2);
|
|
1846 goto LABEL_325;
|
|
1847 case 0x19:
|
|
1848 strcpy(Str, (const char *)v2);
|
|
1849 Str[0] = ' ';
|
|
1850 Str[strlen(Str) - 1] = ' ';
|
|
1851 v50 = texture_frame_table_txt_parser(Str, &v87);
|
|
1852 v51 = 88 * v103;
|
|
1853 memcpy(&v90, v50, sizeof(v90));
|
|
1854 if ( v90.field_0 >= 3 )
|
|
1855 {
|
|
1856 v53 = (int)((char *)v102 + v51);
|
|
1857 a2 = 1;
|
|
1858 v102->pInfos[v51 / 0x58u].uSpell1ID = ParseSpellType(&v90, (int)&a2);
|
|
1859 v54 = a2;
|
|
1860 v84 = (char *)v90.pProperties[a2 + 1];
|
|
1861 v55 = atoi(v84);
|
|
1862 v56 = (char *)v90.pProperties[v54];
|
|
1863 v84 = "E";
|
|
1864 v83 = v56;
|
|
1865 *(_WORD *)(v53 + 56) = v55 & 0x3F;
|
|
1866 if ( _strcmpi(v83, v84) )
|
|
1867 {
|
|
1868 if ( _strcmpi(v56, "M") )
|
|
1869 {
|
|
1870 if ( !_strcmpi(v56, "G") )
|
|
1871 *(_BYTE *)(v53 + 57) |= 1u;
|
|
1872 }
|
|
1873 else
|
|
1874 {
|
|
1875 *(_BYTE *)(v53 + 56) |= 0x80u;
|
|
1876 }
|
|
1877 }
|
|
1878 else
|
|
1879 {
|
|
1880 *(_BYTE *)(v53 + 56) |= 0x40u;
|
|
1881 }
|
|
1882 }
|
|
1883 else
|
|
1884 {
|
|
1885 v52 = (int)((char *)v102 + v51);
|
|
1886 *(_BYTE *)(v52 + 33) = 0;
|
|
1887 *(_WORD *)(v52 + 56) = 0;
|
|
1888 }
|
|
1889 goto LABEL_325;
|
|
1890 case 0x1A:
|
|
1891 v102->pInfos[v103].uSpell2UseChance = atoi((const char *)v2);
|
|
1892 goto LABEL_325;
|
186
|
1893
|
0
|
1894 case 0x1B:
|
|
1895 strcpy(Dest, (const char *)v2);
|
|
1896 Dest[0] = ' ';
|
|
1897 Dest[strlen(Dest) - 1] = ' ';
|
|
1898 v57 = texture_frame_table_txt_parser(Dest, &v86);
|
|
1899 v58 = v103;
|
|
1900 memcpy(&v89, v57, sizeof(v89));
|
|
1901 if ( v89.field_0 >= 3 )
|
|
1902 {
|
|
1903 v60 = &v102->pInfos[v58];
|
|
1904 a2 = 1;
|
|
1905 v102->pInfos[v58].uSpell2ID = ParseSpellType(&v89, (int)&a2);
|
|
1906 v61 = a2;
|
|
1907 v84 = (char *)v89.pProperties[a2 + 1];
|
|
1908 v62 = atoi(v84);
|
|
1909 v63 = (char *)v89.pProperties[v61];
|
|
1910 v84 = "E";
|
|
1911 v83 = v63;
|
|
1912 v60->uSpellSkillAndMastery2 = v62 & 0x3F;
|
|
1913 if ( _strcmpi(v83, v84) )
|
|
1914 {
|
|
1915 if ( _strcmpi(v63, "M") )
|
|
1916 {
|
|
1917 if ( !_strcmpi(v63, "G") )
|
|
1918 HIBYTE(v60->uSpellSkillAndMastery2) |= 1u;
|
|
1919 }
|
|
1920 else
|
|
1921 {
|
|
1922 LOBYTE(v60->uSpellSkillAndMastery2) |= 0x80u;
|
|
1923 }
|
|
1924 }
|
|
1925 else
|
|
1926 {
|
|
1927 LOBYTE(v60->uSpellSkillAndMastery2) |= 0x40u;
|
|
1928 }
|
|
1929 }
|
|
1930 else
|
|
1931 {
|
|
1932 v59 = &v102->pInfos[v58];
|
|
1933 v59->uSpell2ID = 0;
|
|
1934 v59->uSpellSkillAndMastery2 = 0;
|
|
1935 }
|
|
1936 goto LABEL_325;
|
|
1937 case 0x1C:
|
|
1938 v84 = (char *)*(_BYTE *)v2;
|
|
1939 if ( tolower((int)v84) == 'i' )
|
|
1940 v64 = 200;
|
|
1941 else
|
|
1942 v64 = atoi((const char *)v2);
|
|
1943 v102->pInfos[v103].uResFire = v64;
|
|
1944 goto LABEL_325;
|
|
1945 case 0x1D:
|
|
1946 v84 = (char *)*(_BYTE *)v2;
|
|
1947 if ( tolower((int)v84) == 'i' )
|
|
1948 v65 = 200;
|
|
1949 else
|
|
1950 v65 = atoi((const char *)v2);
|
|
1951 v102->pInfos[v103].uResAir = v65;
|
|
1952 goto LABEL_325;
|
|
1953 case 0x1E:
|
|
1954 v84 = (char *)*(_BYTE *)v2;
|
|
1955 if ( tolower((int)v84) == 'i' )
|
|
1956 v66 = 200;
|
|
1957 else
|
|
1958 v66 = atoi((const char *)v2);
|
|
1959 v102->pInfos[v103].uResWater = v66;
|
|
1960 goto LABEL_325;
|
|
1961 case 0x1F:
|
|
1962 v84 = (char *)*(_BYTE *)v2;
|
|
1963 if ( tolower((int)v84) == 'i' )
|
|
1964 v67 = 200;
|
|
1965 else
|
|
1966 v67 = atoi((const char *)v2);
|
|
1967 v102->pInfos[v103].uResEarth = v67;
|
|
1968 goto LABEL_325;
|
|
1969 case 0x20:
|
|
1970 v84 = (char *)*(_BYTE *)v2;
|
|
1971 if ( tolower((int)v84) == 'i' )
|
|
1972 v68 = 200;
|
|
1973 else
|
|
1974 v68 = atoi((const char *)v2);
|
|
1975 v102->pInfos[v103].uResMind = v68;
|
|
1976 goto LABEL_325;
|
|
1977 case 0x21:
|
|
1978 v84 = (char *)*(_BYTE *)v2;
|
|
1979 if ( tolower((int)v84) == 'i' )
|
|
1980 v69 = 200;
|
|
1981 else
|
|
1982 v69 = atoi((const char *)v2);
|
|
1983 v102->pInfos[v103].uResSpirit = v69;
|
|
1984 goto LABEL_325;
|
|
1985 case 0x22:
|
|
1986 v84 = (char *)*(_BYTE *)v2;
|
|
1987 if ( tolower((int)v84) == 'i' )
|
|
1988 v70 = 200;
|
|
1989 else
|
|
1990 v70 = atoi((const char *)v2);
|
|
1991 v102->pInfos[v103].uResBody = v70;
|
|
1992 goto LABEL_325;
|
|
1993 case 0x23:
|
|
1994 v84 = (char *)*(_BYTE *)v2;
|
|
1995 if ( tolower((int)v84) == 'i' )
|
|
1996 v71 = 200;
|
|
1997 else
|
|
1998 v71 = atoi((const char *)v2);
|
|
1999 v102->pInfos[v103].uResLight = v71;
|
|
2000 goto LABEL_325;
|
|
2001 case 0x24:
|
|
2002 v84 = (char *)*(_BYTE *)v2;
|
|
2003 if ( tolower((int)v84) == 'i' )
|
|
2004 v72 = 200;
|
|
2005 else
|
|
2006 v72 = atoi((const char *)v2);
|
|
2007 v102->pInfos[v103].uResDark = v72;
|
|
2008 goto LABEL_325;
|
|
2009 case 0x25:
|
|
2010 v84 = (char *)*(_BYTE *)v2;
|
|
2011 if ( tolower((int)v84) == 'i' )
|
|
2012 v73 = 200;
|
|
2013 else
|
|
2014 v73 = atoi((const char *)v2);
|
|
2015 v102->pInfos[v103].uResPhysical = v73;
|
|
2016 goto LABEL_325;
|
|
2017 case 0x26:
|
|
2018 strcpy(v93, (const char *)v2);
|
|
2019 v93[0] = ' ';
|
|
2020 v93[strlen(v93) - 1] = ' ';
|
|
2021 memcpy(&v94, texture_frame_table_txt_parser(v93, &v85), sizeof(v94));
|
|
2022 if ( v94.field_0 )
|
|
2023 {
|
|
2024 v74 = v94.field_0;
|
|
2025 if ( v94.field_0 < 10 )
|
|
2026 {
|
|
2027 if ( _strcmpi(v94.pProperties[0], "shot") )
|
|
2028 {
|
|
2029 if ( _strcmpi(v94.pProperties[0], "summon") )
|
|
2030 {
|
|
2031 if ( !_strcmpi(v94.pProperties[0], "explode") )
|
|
2032 {
|
|
2033 v79 = &v102->pInfos[v103];
|
|
2034 v80 = v94.pProperties[1];
|
|
2035 v84 = (char *)&v79->uSpecialAbilityDamageDiceBonus;
|
|
2036 v83 = (char *)&v79->uSpecialAbilityDamageDiceSides;
|
|
2037 v79->uSpecialAbilityType = 3;
|
|
2038 ParseDamage(v80, (int)&v79->uSpecialAbilityDamageDiceRolls, (int)v83, (int)v84);
|
|
2039 v79->field_3C_some_special_attack = ParseAttackType((unsigned __int8 *)v2);
|
|
2040 }
|
|
2041 }
|
|
2042 else
|
|
2043 {
|
|
2044 v76 = &v102->pInfos[v103];
|
|
2045 v76->uSpecialAbilityType = 2;
|
|
2046 if ( v74 > 1 )
|
|
2047 {
|
|
2048 pTmpBuf[0] = 0;
|
|
2049 strcpy(pTmpBuf, v94.pProperties[2]);
|
|
2050 if ( v74 > 2 )
|
|
2051 {
|
|
2052 v100 = 3;
|
|
2053 if ( v74 > 3 )
|
|
2054 {
|
|
2055 do
|
|
2056 {
|
|
2057 strcat(pTmpBuf, " ");
|
|
2058 v77 = (char **)v94.pProperties[v100];
|
|
2059 v82 = v94.pProperties[v100];
|
|
2060 strcat(pTmpBuf, v82);
|
|
2061 if ( v100 == v94.field_0 - 1 )
|
|
2062 {
|
|
2063 v84 = (char *)*(_BYTE *)v77;
|
|
2064 if ( tolower((int)v84) == 'a' )
|
|
2065 {
|
|
2066 v76->uSpecialAbilityDamageDiceRolls = 1;
|
|
2067 }
|
|
2068 else
|
|
2069 {
|
|
2070 v84 = (char *)*(_BYTE *)v77;
|
|
2071 if ( tolower((int)v84) == 'b' )
|
|
2072 {
|
|
2073 v76->uSpecialAbilityDamageDiceRolls = 2;
|
|
2074 }
|
|
2075 else
|
|
2076 {
|
|
2077 v84 = (char *)*(_BYTE *)v77;
|
|
2078 if ( tolower((int)v84) == 'c' )
|
|
2079 v76->uSpecialAbilityDamageDiceRolls = 3;
|
|
2080 else
|
|
2081 v76->uSpecialAbilityDamageDiceRolls = 0;
|
|
2082 }
|
|
2083 }
|
|
2084 }
|
|
2085 ++v100;
|
|
2086 }
|
|
2087 while ( v100 < v94.field_0 );
|
|
2088 }
|
|
2089 }
|
|
2090 else
|
|
2091 {
|
|
2092 v76->uSpecialAbilityDamageDiceRolls = 0;
|
|
2093 }
|
|
2094 if ( pMonsterList->uNumMonsters )
|
|
2095 {
|
|
2096 v78 = pMonsterList->GetMonsterByName(pTmpBuf) + 1;
|
|
2097 v76->field_3C_some_special_attack = v78;
|
|
2098 if ( v78 == -1 )
|
|
2099 {
|
|
2100 sprintf(Src, "Can't create random monster: '%s' See MapStats!", Src);
|
|
2101 MessageBoxA(nullptr, Src, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:2239", 0);
|
|
2102 }
|
|
2103 }
|
|
2104 v76->uSpecialAbilityDamageDiceSides = 0;
|
|
2105 if ( !_strcmpi(v94.pProperties[1], "ground") )
|
|
2106 v76->uSpecialAbilityDamageDiceSides = 1;
|
|
2107 if ( v76->field_3C_some_special_attack == -1 )
|
|
2108 v76->uSpecialAbilityType = 0;
|
|
2109 }
|
|
2110 }
|
|
2111 }
|
|
2112 else
|
|
2113 {
|
|
2114 v75 = &v102->pInfos[v103];
|
|
2115 v84 = (char *)(v94.pProperties[1] + 1);
|
|
2116 v75->uSpecialAbilityType = 1;
|
|
2117 v75->uSpecialAbilityDamageDiceBonus = atoi(v84);
|
|
2118 }
|
|
2119 }
|
|
2120 }
|
|
2121 goto LABEL_325;
|
|
2122 default:
|
|
2123 goto LABEL_325;
|
|
2124 }
|
|
2125 while ( 1 )
|
|
2126 {
|
|
2127 v84 = (char *)*(_BYTE *)(v43 + v2);
|
|
2128 if ( tolower((int)v84) == 'x' )
|
|
2129 break;
|
|
2130 ++v43;
|
|
2131 if ( v43 >= v100 )
|
|
2132 goto LABEL_185;
|
|
2133 }
|
|
2134 v45 = v2 + v43;
|
|
2135 *(_BYTE *)v45 = 0;
|
|
2136 v44->uSpecialAttackType = atoi((const char *)(v45 + 1));
|
|
2137 *(_BYTE *)v45 = 100;
|
|
2138 LABEL_185:
|
|
2139 _strlwr((char *)v2);
|
|
2140 if ( strstr((const char *)v2, "curse") )
|
|
2141 {
|
|
2142 v44->uSpecialAttack = 1;
|
|
2143 }
|
|
2144 else
|
|
2145 {
|
|
2146 if ( strstr((const char *)v2, "weak") )
|
|
2147 {
|
|
2148 v44->uSpecialAttack = 2;
|
|
2149 }
|
|
2150 else
|
|
2151 {
|
|
2152 if ( strstr((const char *)v2, "asleep") )
|
|
2153 {
|
|
2154 v44->uSpecialAttack = 3;
|
|
2155 }
|
|
2156 else
|
|
2157 {
|
|
2158 if ( strstr((const char *)v2, "afraid") )
|
|
2159 {
|
|
2160 v44->uSpecialAttack = 23;
|
|
2161 }
|
|
2162 else
|
|
2163 {
|
|
2164 if ( strstr((const char *)v2, "drunk") )
|
|
2165 {
|
|
2166 v44->uSpecialAttack = 4;
|
|
2167 }
|
|
2168 else
|
|
2169 {
|
|
2170 if ( strstr((const char *)v2, "insane") )
|
|
2171 {
|
|
2172 v44->uSpecialAttack = 5;
|
|
2173 }
|
|
2174 else
|
|
2175 {
|
|
2176 if ( strstr((const char *)v2, "poison1") )
|
|
2177 {
|
|
2178 v44->uSpecialAttack = 6;
|
|
2179 }
|
|
2180 else
|
|
2181 {
|
|
2182 if ( strstr((const char *)v2, "poison2") )
|
|
2183 {
|
|
2184 v44->uSpecialAttack = 7;
|
|
2185 }
|
|
2186 else
|
|
2187 {
|
|
2188 if ( strstr((const char *)v2, "poison3") )
|
|
2189 {
|
|
2190 v44->uSpecialAttack = 8;
|
|
2191 }
|
|
2192 else
|
|
2193 {
|
|
2194 if ( strstr((const char *)v2, "disease1") )
|
|
2195 {
|
|
2196 v44->uSpecialAttack = 9;
|
|
2197 }
|
|
2198 else
|
|
2199 {
|
|
2200 if ( strstr((const char *)v2, "disease2") )
|
|
2201 {
|
|
2202 v44->uSpecialAttack = 10;
|
|
2203 }
|
|
2204 else
|
|
2205 {
|
|
2206 if ( strstr((const char *)v2, "disease3") )
|
|
2207 {
|
|
2208 v44->uSpecialAttack = 11;
|
|
2209 }
|
|
2210 else
|
|
2211 {
|
|
2212 if ( strstr((const char *)v2, "paralyze") )
|
|
2213 {
|
|
2214 v44->uSpecialAttack = 12;
|
|
2215 }
|
|
2216 else
|
|
2217 {
|
|
2218 if ( strstr((const char *)v2, "uncon") )
|
|
2219 {
|
|
2220 v44->uSpecialAttack = 13;
|
|
2221 }
|
|
2222 else
|
|
2223 {
|
|
2224 if ( strstr((const char *)v2, "dead") )
|
|
2225 {
|
|
2226 v44->uSpecialAttack = 14;
|
|
2227 }
|
|
2228 else
|
|
2229 {
|
|
2230 if ( strstr((const char *)v2, "stone") )
|
|
2231 {
|
|
2232 v44->uSpecialAttack = 15;
|
|
2233 }
|
|
2234 else
|
|
2235 {
|
|
2236 if ( strstr((const char *)v2, "errad") )
|
|
2237 {
|
|
2238 v44->uSpecialAttack = 16;
|
|
2239 }
|
|
2240 else
|
|
2241 {
|
|
2242 if ( strstr((const char *)v2, "brkitem") )
|
|
2243 {
|
|
2244 v44->uSpecialAttack = 17;
|
|
2245 }
|
|
2246 else
|
|
2247 {
|
|
2248 if ( strstr((const char *)v2, "brkarmor") )
|
|
2249 {
|
|
2250 v44->uSpecialAttack = 18;
|
|
2251 }
|
|
2252 else
|
|
2253 {
|
|
2254 if ( strstr((const char *)v2, "brkweapon") )
|
|
2255 {
|
|
2256 v44->uSpecialAttack = 19;
|
|
2257 }
|
|
2258 else
|
|
2259 {
|
|
2260 if ( strstr((const char *)v2, "steal") )
|
|
2261 {
|
|
2262 v44->uSpecialAttack = 20;
|
|
2263 }
|
|
2264 else
|
|
2265 {
|
|
2266 if ( strstr((const char *)v2, "age") )
|
|
2267 {
|
|
2268 v44->uSpecialAttack = 21;
|
|
2269 }
|
|
2270 else
|
|
2271 {
|
|
2272 if ( strstr((const char *)v2, "drainsp") )
|
|
2273 v44->uSpecialAttack = 22;
|
|
2274 }
|
|
2275 }
|
|
2276 }
|
|
2277 }
|
|
2278 }
|
|
2279 }
|
|
2280 }
|
|
2281 }
|
|
2282 }
|
|
2283 }
|
|
2284 }
|
|
2285 }
|
|
2286 }
|
|
2287 }
|
|
2288 }
|
|
2289 }
|
|
2290 }
|
|
2291 }
|
|
2292 }
|
|
2293 }
|
|
2294 }
|
|
2295 }
|
|
2296 }
|
|
2297 else
|
|
2298 {
|
|
2299 v97 = 1;
|
|
2300 }
|
|
2301 LABEL_325:
|
|
2302 ++*(_DWORD *)&a3[1];
|
|
2303 v2 = v96 + 1;
|
|
2304 }
|
|
2305 while ( *(_DWORD *)&a3[1] - 1 <= (signed int)v102->uNumMonsters && !v97 );
|
|
2306 ++v103;
|
|
2307 }
|
|
2308 while ( v103 < 265 );
|
|
2309 v102->uNumMonsters = v103;
|
694
|
2310 */
|
0
|
2311 }
|
|
2312
|
|
2313
|
|
2314
|
|
2315
|
|
2316 //----- (0044FA08) --------------------------------------------------------
|
|
2317 unsigned __int16 MonsterList::GetMonsterByName(const char *pMonsterName)
|
|
2318 {
|
|
2319 signed int v2; // ebx@1
|
|
2320 MonsterList *v3; // esi@1
|
|
2321 int v4; // edi@3
|
|
2322 unsigned __int16 result; // ax@6
|
|
2323
|
|
2324 v2 = 0;
|
|
2325 v3 = this;
|
|
2326 if ( pMonsterName && (signed int)this->uNumMonsters > 0 )
|
|
2327 {
|
|
2328 v4 = 0;
|
|
2329 while ( _strcmpi(pMonsterName, v3->pMonsters[v4].pMonsterName) )
|
|
2330 {
|
|
2331 ++v2;
|
|
2332 ++v4;
|
|
2333 if ( v2 >= (signed int)v3->uNumMonsters )
|
|
2334 goto LABEL_6;
|
|
2335 }
|
|
2336 result = v2;
|
|
2337 }
|
|
2338 else
|
|
2339 {
|
|
2340 LABEL_6:
|
|
2341 result = -1;
|
|
2342 }
|
|
2343 return result;
|
|
2344 }
|