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