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
|
|
19
|
|
20 //----- (004598FC) --------------------------------------------------------
|
|
21 bool MonsterList::FromFileTxt(const char *Args)
|
|
22 {
|
|
23 MonsterList *v2; // ebx@1
|
|
24 FILE *v3; // eax@1
|
|
25 unsigned int v4; // esi@3
|
|
26 void *v5; // eax@9
|
|
27 FILE *v6; // ST14_4@11
|
|
28 char *i; // eax@11
|
|
29 signed int v8; // esi@12
|
|
30 unsigned __int16 v9; // ax@16
|
|
31 const char *v10; // ST18_4@16
|
|
32 unsigned __int16 v11; // ax@16
|
|
33 const char *v12; // ST14_4@16
|
|
34 unsigned __int16 v13; // ax@16
|
|
35 const char *v14; // ST10_4@16
|
|
36 __int16 v15; // ax@16
|
|
37 const char *v16; // ST0C_4@16
|
|
38 int v17; // esi@16
|
|
39 unsigned __int8 v18; // al@16
|
|
40 signed int v19; // esi@16
|
|
41 unsigned __int16 v20; // ax@17
|
|
42 int v21; // ecx@17
|
|
43 char Buf; // [sp+4h] [bp-304h]@3
|
|
44 FrameTableTxtLine v24; // [sp+1F8h] [bp-110h]@4
|
|
45 FrameTableTxtLine v25; // [sp+274h] [bp-94h]@4
|
|
46 int v26; // [sp+2F0h] [bp-18h]@16
|
|
47 char v27; // [sp+2F4h] [bp-14h]@14
|
|
48 char v28; // [sp+2F5h] [bp-13h]@14
|
|
49 char v29; // [sp+2F6h] [bp-12h]@14
|
|
50 char v30; // [sp+2F7h] [bp-11h]@14
|
|
51 char v31; // [sp+2F8h] [bp-10h]@14
|
|
52 char v32; // [sp+2F9h] [bp-Fh]@14
|
|
53 char v33; // [sp+2FAh] [bp-Eh]@14
|
|
54 char v34; // [sp+2FBh] [bp-Dh]@14
|
|
55 char v35; // [sp+2FCh] [bp-Ch]@14
|
|
56 char v36; // [sp+2FDh] [bp-Bh]@14
|
|
57 char v37; // [sp+2FEh] [bp-Ah]@14
|
|
58 char v38; // [sp+2FFh] [bp-9h]@14
|
|
59 char v39; // [sp+300h] [bp-8h]@14
|
|
60 char v40; // [sp+301h] [bp-7h]@14
|
|
61 char v41; // [sp+302h] [bp-6h]@14
|
|
62 char v42; // [sp+303h] [bp-5h]@14
|
|
63 FILE *File; // [sp+304h] [bp-4h]@1
|
|
64 unsigned int Argsa; // [sp+310h] [bp+8h]@3
|
|
65 int Argsb; // [sp+310h] [bp+8h]@16
|
|
66
|
|
67 v2 = this;
|
|
68 v3 = fopen(Args, "r");
|
|
69 File = v3;
|
|
70 if ( !v3 )
|
|
71 Abortf("MonsterRaceListStruct::load - Unable to open file: %s.");
|
|
72 v4 = 0;
|
|
73 Argsa = 0;
|
|
74 if ( fgets(&Buf, 490, v3) )
|
|
75 {
|
|
76 do
|
|
77 {
|
|
78 *strchr(&Buf, 10) = 0;
|
|
79 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
|
|
80 if ( v25.field_0 && *v25.pProperties[0] != 47 )
|
|
81 ++Argsa;
|
|
82 }
|
|
83 while ( fgets(&Buf, 490, File) );
|
|
84 v4 = Argsa;
|
|
85 }
|
|
86 v2->uNumMonsters = v4;
|
|
87 v5 = pAllocator->AllocNamedChunk(v2->pMonsters, 152 * v4, "Mon Race");
|
|
88 v2->pMonsters = (MonsterDesc *)v5;
|
|
89 if ( !v5 )
|
|
90 Abortf("MonsterRaceListStruct::load - Out of Memory!");
|
|
91 v6 = File;
|
|
92 v2->uNumMonsters = 0;
|
|
93 fseek(v6, 0, 0);
|
|
94 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
|
|
95 {
|
|
96 *strchr(&Buf, 10) = 0;
|
|
97 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
|
|
98 v8 = 0;
|
|
99 if ( v25.field_0 && *v25.pProperties[0] != 47 )
|
|
100 {
|
|
101 strcpy(v2->pMonsters[v2->uNumMonsters].pMonsterName, v25.pProperties[0]);
|
|
102 v35 = 0;
|
|
103 v36 = 1;
|
|
104 v37 = 7;
|
|
105 v38 = 2;
|
|
106 v39 = 3;
|
|
107 v40 = 4;
|
|
108 v41 = 5;
|
|
109 v42 = 6;
|
|
110 v27 = 1;
|
|
111 v28 = 2;
|
|
112 v29 = 3;
|
|
113 v30 = 4;
|
|
114 v31 = 4;
|
|
115 v32 = 5;
|
|
116 v33 = 6;
|
|
117 v34 = 7;
|
|
118 do
|
|
119 {
|
|
120 strcpy(
|
|
121 v2->pMonsters[v2->uNumMonsters].pSpriteNames[(unsigned __int8)*(&v35 + v8)],
|
|
122 v25.pProperties[(unsigned __int8)*(&v27 + v8)]);
|
|
123 ++v8;
|
|
124 }
|
|
125 while ( v8 < 8 );
|
|
126 v9 = atoi(v25.pProperties[8]);
|
|
127 v10 = v25.pProperties[9];
|
|
128 v2->pMonsters[v2->uNumMonsters].uMonsterHeight = v9;
|
|
129 v11 = atoi(v10);
|
|
130 v12 = v25.pProperties[10];
|
|
131 v2->pMonsters[v2->uNumMonsters].uMovementSpeed = v11;
|
|
132 v13 = atoi(v12);
|
|
133 v14 = v25.pProperties[11];
|
|
134 v2->pMonsters[v2->uNumMonsters].uMonsterRadius = v13;
|
|
135 v15 = atoi(v14);
|
|
136 v16 = v25.pProperties[12];
|
|
137 v2->pMonsters[v2->uNumMonsters].uToHitRadius = v15;
|
|
138 v17 = (unsigned __int8)atoi(v16);
|
|
139 Argsb = atoi(v25.pProperties2[0]) & 0xFF;
|
|
140 v26 = atoi(v25.pProperties2[1]) & 0xFF;
|
|
141 v18 = atoi(v25.pProperties2[2]);
|
|
142 v2->pMonsters[v2->uNumMonsters].uTintColor = v18 | ((v26 | ((Argsb | (v17 << 8)) << 8)) << 8);
|
|
143 v19 = 0;
|
|
144 do
|
|
145 {
|
|
146 v20 = atoi(v25.pProperties2[v19 + 4]);
|
|
147 v21 = v19++ + 76 * v2->uNumMonsters;
|
|
148 v2->pMonsters->pSoundSampleIDs[v21] = v20;
|
|
149 }
|
|
150 while ( v19 < 4 );
|
|
151 ++v2->uNumMonsters;
|
|
152 }
|
|
153 }
|
|
154 fclose(File);
|
|
155 return 1;
|
|
156 }
|
|
157
|
|
158 //----- (004598AF) --------------------------------------------------------
|
|
159 void MonsterList::FromFile(void *pSerialized)
|
|
160 {
|
|
161 uNumMonsters = *(int *)pSerialized;
|
|
162 pMonsters = (MonsterDesc *)pAllocator->AllocNamedChunk(pMonsters, 152 * uNumMonsters, "Mon Race");
|
|
163 memcpy(pMonsters, (char *)pSerialized + 4, 152 * uNumMonsters);
|
|
164 }
|
|
165
|
|
166 //----- (00459860) --------------------------------------------------------
|
|
167 void MonsterList::ToFile()
|
|
168 {
|
|
169 MonsterList *v1; // esi@1
|
|
170 FILE *v2; // eax@1
|
|
171 FILE *v3; // edi@1
|
|
172
|
|
173 v1 = this;
|
|
174 v2 = fopen("data\\dmonlist.bin", "wb");
|
|
175 v3 = v2;
|
|
176 if ( !v2 )
|
|
177 Abortf("Unable to save dmonlist.bin!");
|
|
178 fwrite(v1, 4u, 1u, v2);
|
|
179 fwrite(v1->pMonsters, 0x98u, v1->uNumMonsters, v3);
|
|
180 fclose(v3);
|
|
181 }
|
|
182
|
|
183
|
|
184 //----- (004563FF) --------------------------------------------------------
|
|
185 signed int MonsterStats::_4563FF(const char *Str2)
|
|
186 {
|
|
187 MonsterStats *v2; // esi@1
|
|
188 signed int v3; // ebx@1
|
|
189 MonsterInfo *v4; // edi@2
|
|
190 signed int result; // eax@6
|
|
191
|
|
192 v2 = this;
|
|
193 v3 = 1;
|
|
194 if ( (signed int)this->uNumMonsters <= 1 )
|
|
195 {
|
|
196 LABEL_6:
|
|
197 result = -1;
|
|
198 }
|
|
199 else
|
|
200 {
|
|
201 v4 = &this->pInfos[1];
|
|
202 while ( !v4->pName || _strcmpi(v4->pTexture, Str2) )
|
|
203 {
|
|
204 ++v3;
|
|
205 ++v4;
|
|
206 if ( v3 >= (signed int)v2->uNumMonsters )
|
|
207 goto LABEL_6;
|
|
208 }
|
|
209 result = v3;
|
|
210 }
|
|
211 return result;
|
|
212 }
|
|
213
|
|
214
|
|
215 //----- (00454F4E) --------------------------------------------------------
|
|
216 void MonsterStats::InitializePlacements()
|
|
217 {
|
237
|
218 int i;
|
|
219 char* test_string;
|
|
220 unsigned char c;
|
|
221 bool break_loop;
|
|
222 unsigned int temp_str_len;
|
|
223 char* tmp_pos;
|
|
224 int decode_step;
|
|
225 int item_counter;
|
0
|
226
|
|
227 pMonsterPlacementTXT_Raw = (char *)pEvents_LOD->LoadRaw("placemon.txt", 0);
|
|
228 strtok(pMonsterPlacementTXT_Raw, "\r");
|
237
|
229 for (i=1; i<31; ++i)
|
|
230 {
|
|
231 test_string = strtok(NULL, "\r") + 1;
|
|
232 break_loop = false;
|
|
233 decode_step=0;
|
|
234 do
|
|
235 {
|
|
236 c = *(unsigned char*)test_string;
|
|
237 temp_str_len = 0;
|
|
238 while((c!='\t')&&(c>0))
|
|
239 {
|
|
240 ++temp_str_len;
|
|
241 c=test_string[temp_str_len];
|
|
242 }
|
|
243 tmp_pos=test_string+temp_str_len;
|
|
244 if (*tmp_pos == 0)
|
|
245 break_loop = true;
|
|
246 *tmp_pos = 0;
|
|
247 if (temp_str_len)
|
|
248 {
|
|
249 if (decode_step==1)
|
|
250 pPlaceStrings[i]=RemoveQuotes(test_string);
|
|
251 }
|
|
252 else
|
|
253 {
|
|
254 break_loop = true;
|
|
255 }
|
|
256 ++decode_step;
|
|
257 test_string=tmp_pos+1;
|
|
258 } while ((decode_step<3)&&!break_loop);
|
|
259 }
|
|
260 uNumPlacements = 31;
|
0
|
261 }
|
|
262
|
|
263 //----- (0045501E) --------------------------------------------------------
|
|
264 void MonsterStats::Initialize()
|
|
265 {
|
|
266 MonsterStats *v1; // ebx@1
|
|
267 int v2; // ebx@4
|
|
268 char v3; // cl@5
|
|
269 int v4; // eax@5
|
|
270 size_t v5; // eax@19
|
|
271 signed int v6; // edi@19
|
|
272 MonsterStats *v7; // ecx@23
|
|
273 int v8; // eax@23
|
|
274 unsigned int *pHP; // esi@23
|
|
275 size_t v10; // eax@29
|
|
276 signed int v11; // edi@29
|
|
277 MonsterStats *v12; // ecx@33
|
|
278 int v13; // eax@33
|
|
279 unsigned int *pExp; // esi@33
|
|
280 signed int v15; // edi@36
|
|
281 size_t v16; // esi@36
|
|
282 int v17; // eax@37
|
|
283 MonsterInfo *v18; // esi@45
|
|
284 size_t v19; // edi@50
|
|
285 int v20; // eax@51
|
|
286 unsigned __int8 v21; // al@55
|
|
287 size_t v22; // edi@59
|
|
288 char v23; // cl@63
|
|
289 const char *v24; // edi@63
|
|
290 unsigned __int16 *v25; // esi@114
|
|
291 int v26; // eax@118
|
|
292 size_t v27; // eax@136
|
|
293 int v28; // edi@137
|
|
294 MonsterStats *v29; // esi@137
|
|
295 int v30; // eax@138
|
|
296 int v31; // eax@142
|
|
297 int v32; // eax@143
|
|
298 int v33; // eax@144
|
|
299 int v34; // eax@151
|
|
300 int v35; // eax@152
|
|
301 int v36; // eax@153
|
|
302 int v37; // eax@162
|
|
303 int v38; // eax@163
|
|
304 int v39; // eax@164
|
|
305 int v40; // eax@171
|
|
306 int v41; // eax@172
|
|
307 size_t v42; // eax@180
|
|
308 int v43; // edi@180
|
|
309 MonsterInfo *v44; // esi@180
|
|
310 int v45; // edi@184
|
|
311 MonsterInfo *v46; // eax@232
|
|
312 char *v47; // edx@232
|
|
313 char *v48; // ecx@232
|
|
314 MonsterInfo *v49; // eax@236
|
|
315 FrameTableTxtLine *v50; // esi@240
|
|
316 int v51; // eax@240
|
|
317 int v52; // eax@241
|
|
318 int v53; // esi@242
|
|
319 int v54; // edi@242
|
|
320 char v55; // al@242
|
|
321 char *v56; // edi@242
|
|
322 FrameTableTxtLine *v57; // esi@249
|
|
323 int v58; // eax@249
|
|
324 MonsterInfo *v59; // eax@250
|
|
325 MonsterInfo *v60; // esi@251
|
|
326 int v61; // edi@251
|
|
327 char v62; // al@251
|
|
328 char *v63; // edi@251
|
|
329 char v64; // al@258
|
|
330 char v65; // al@262
|
|
331 char v66; // al@266
|
|
332 char v67; // al@270
|
|
333 char v68; // al@274
|
|
334 char v69; // al@278
|
|
335 char v70; // al@282
|
|
336 char v71; // al@286
|
|
337 char v72; // al@290
|
|
338 unsigned __int8 v73; // al@294
|
|
339 int v74; // edi@298
|
|
340 MonsterInfo *v75; // esi@300
|
|
341 MonsterInfo *v76; // esi@302
|
|
342 char **v77; // edi@306
|
|
343 __int16 v78; // ax@316
|
|
344 MonsterInfo *v79; // esi@323
|
|
345 const char *v80; // ecx@323
|
|
346 std::string v81; // [sp-14h] [bp-46Ch]@317
|
|
347 const char *v82; // [sp-8h] [bp-460h]@306
|
|
348 char *v83; // [sp-4h] [bp-45Ch]@23
|
|
349 char *v84; // [sp+0h] [bp-458h]@37
|
|
350 FrameTableTxtLine v85; // [sp+10h] [bp-448h]@297
|
|
351 FrameTableTxtLine v86; // [sp+8Ch] [bp-3CCh]@249
|
|
352 FrameTableTxtLine v87; // [sp+108h] [bp-350h]@240
|
|
353 char Src[120]; // [sp+184h] [bp-2D4h]@317
|
|
354 FrameTableTxtLine v89; // [sp+1FCh] [bp-25Ch]@249
|
|
355 FrameTableTxtLine v90; // [sp+278h] [bp-1E0h]@240
|
|
356 char Str[64]; // [sp+2F4h] [bp-164h]@240
|
|
357 char Dest[64]; // [sp+334h] [bp-124h]@249
|
|
358 char v93[64]; // [sp+374h] [bp-E4h]@297
|
|
359 FrameTableTxtLine v94; // [sp+3B4h] [bp-A4h]@297
|
|
360 int v95; // [sp+430h] [bp-28h]@317
|
|
361 int v96; // [sp+434h] [bp-24h]@9
|
|
362 int v97; // [sp+438h] [bp-20h]@4
|
|
363 char a3[5]; // [sp+43Fh] [bp-19h]@4
|
|
364 int a2; // [sp+444h] [bp-14h]@36
|
|
365 int v100; // [sp+448h] [bp-10h]@36
|
|
366 size_t v101; // [sp+44Ch] [bp-Ch]@19
|
|
367 MonsterStats *v102; // [sp+450h] [bp-8h]@1
|
|
368 int v103; // [sp+454h] [bp-4h]@3
|
|
369
|
|
370 v1 = this;
|
|
371 v102 = this;
|
|
372 if ( pMonstersTXT_Raw )
|
|
373 pAllocator->FreeChunk(pMonstersTXT_Raw);
|
|
374 pMonstersTXT_Raw = 0;
|
|
375 pMonstersTXT_Raw = (char *)pEvents_LOD->LoadRaw("monsters.txt", 0);
|
|
376 strtok(pMonstersTXT_Raw, "\r");
|
|
377 strtok(0, "\r");
|
|
378 strtok(0, "\r");
|
|
379 strtok(0, "\r");
|
|
380 v103 = 0;
|
|
381 v1->uNumMonsters = 265;
|
|
382 do
|
|
383 {
|
|
384 v2 = (int)(strtok(0, "\r") + 1);
|
|
385 *(_DWORD *)&a3[1] = 0;
|
|
386 v97 = 0;
|
|
387 do
|
|
388 {
|
|
389 v3 = *(_BYTE *)v2;
|
|
390 v4 = 0;
|
|
391 while ( v3 != 9 && v3 )
|
|
392 {
|
|
393 ++v4;
|
|
394 v3 = *(_BYTE *)(v4 + v2);
|
|
395 }
|
|
396 v96 = v4 + v2;
|
|
397 if ( !*(_BYTE *)(v4 + v2) )
|
|
398 v97 = 1;
|
|
399 *(_BYTE *)(v4 + v2) = 0;
|
|
400 if ( v4 )
|
|
401 {
|
|
402 switch ( *(_DWORD *)&a3[1] )
|
|
403 {
|
|
404 case 0:
|
|
405 v103 = atoi((const char *)v2);
|
|
406 v102->pInfos[v103].uID = v103;
|
|
407 goto LABEL_325;
|
|
408 case 2:
|
|
409 v102->pInfos[v103].pTexture = RemoveQuotes((char *)v2);
|
|
410 goto LABEL_325;
|
|
411 case 1:
|
|
412 v102->pInfos[v103].pName = RemoveQuotes((char *)v2);
|
|
413 goto LABEL_325;
|
|
414 case 3:
|
|
415 v102->pInfos[v103].uLevel = atoi((const char *)v2);
|
|
416 goto LABEL_325;
|
|
417 case 4:
|
|
418 if ( *(_BYTE *)v2 == 34 )
|
|
419 *(_BYTE *)v2 = 32;
|
|
420 v5 = strlen((const char *)v2);
|
|
421 v6 = 0;
|
|
422 v101 = v5;
|
|
423 if ( (signed int)v5 <= 0 )
|
|
424 goto LABEL_24;
|
|
425 while ( *(_BYTE *)(v6 + v2) != 44 )
|
|
426 {
|
|
427 ++v6;
|
|
428 if ( v6 >= (signed int)v5 )
|
|
429 goto LABEL_24;
|
|
430 }
|
|
431 v7 = v102;
|
|
432 v8 = v103;
|
|
433 *(_BYTE *)(v6 + v2) = 0;
|
|
434 pHP = &v7->pInfos[v8].uHP;
|
|
435 *pHP = 1000 * atoi((const char *)v2);
|
|
436 v83 = (char *)(v6 + v2 + 1);
|
|
437 *(_BYTE *)(v6 + v2) = 44;
|
|
438 *pHP += atoi(v83);
|
|
439 LABEL_24:
|
|
440 if ( v6 == v101 )
|
|
441 v102->pInfos[v103].uHP = atoi((const char *)v2);
|
|
442 goto LABEL_325;
|
|
443 case 5:
|
|
444 v102->pInfos[v103].uAC = atoi((const char *)v2);
|
|
445 goto LABEL_325;
|
|
446 case 6:
|
|
447 if ( *(_BYTE *)v2 == 34 )
|
|
448 *(_BYTE *)v2 = 32;
|
|
449 v10 = strlen((const char *)v2);
|
|
450 v11 = 0;
|
|
451 v101 = v10;
|
|
452 if ( (signed int)v10 <= 0 )
|
|
453 goto LABEL_34;
|
|
454 while ( *(_BYTE *)(v11 + v2) != 44 )
|
|
455 {
|
|
456 ++v11;
|
|
457 if ( v11 >= (signed int)v10 )
|
|
458 goto LABEL_34;
|
|
459 }
|
|
460 v12 = v102;
|
|
461 v13 = v103;
|
|
462 *(_BYTE *)(v11 + v2) = 0;
|
|
463 pExp = &v12->pInfos[v13].uExp;
|
|
464 *pExp = 1000 * atoi((const char *)v2);
|
|
465 v83 = (char *)(v11 + v2 + 1);
|
|
466 *(_BYTE *)(v11 + v2) = 44;
|
|
467 *pExp += atoi(v83);
|
|
468 LABEL_34:
|
|
469 if ( v11 == v101 )
|
|
470 v102->pInfos[v103].uExp = atoi((const char *)v2);
|
|
471 goto LABEL_325;
|
|
472 case 7:
|
|
473 v15 = 0;
|
|
474 a2 = 0;
|
|
475 v100 = 0;
|
|
476 v16 = 0;
|
|
477 v101 = strlen((const char *)v2);
|
|
478 if ( (signed int)v101 <= 0 )
|
|
479 goto LABEL_325;
|
|
480 do
|
|
481 {
|
|
482 v84 = (char *)*(_BYTE *)(v16 + v2);
|
|
483 v17 = tolower((int)v84);
|
|
484 switch ( v17 )
|
|
485 {
|
|
486 case 37:
|
|
487 v15 = 1;
|
|
488 break;
|
|
489 case 100:
|
|
490 v100 = 1;
|
|
491 break;
|
|
492 case 108:
|
|
493 a2 = 1;
|
|
494 break;
|
|
495 }
|
|
496 ++v16;
|
|
497 }
|
|
498 while ( (signed int)v16 < (signed int)v101 );
|
|
499 if ( v15 )
|
|
500 {
|
|
501 v18 = &v102->pInfos[v103];
|
|
502 v18->uTreasureDropChance = atoi((const char *)v2);
|
|
503 }
|
|
504 else
|
|
505 {
|
|
506 if ( !v100 && !a2 )
|
|
507 goto LABEL_325;
|
|
508 v18 = &v102->pInfos[v103];
|
|
509 v18->uTreasureDropChance = 100;
|
|
510 }
|
|
511 if ( v100 )
|
|
512 {
|
|
513 v19 = 0;
|
|
514 v100 = 0;
|
|
515 do
|
|
516 {
|
|
517 v84 = (char *)*(_BYTE *)(v19 + v2);
|
|
518 v20 = tolower((int)v84);
|
|
519 if ( v20 == 37 )
|
|
520 {
|
|
521 v84 = (char *)(v19 + v2 + 1);
|
|
522 v18->uTreasureDiceRolls = atoi(v84);
|
|
523 v100 = 1;
|
|
524 }
|
|
525 else
|
|
526 {
|
|
527 if ( v20 == 100 )
|
|
528 {
|
|
529 if ( !v100 )
|
|
530 v18->uTreasureDiceRolls = atoi((const char *)v2);
|
|
531 v84 = (char *)(v19 + v2 + 1);
|
|
532 v21 = atoi(v84);
|
|
533 v19 = v101;
|
|
534 v18->uTreasureDiceSides = v21;
|
|
535 }
|
|
536 }
|
|
537 ++v19;
|
|
538 }
|
|
539 while ( (signed int)v19 < (signed int)v101 );
|
|
540 }
|
|
541 if ( a2 )
|
|
542 {
|
|
543 v22 = 0;
|
|
544 while ( 1 )
|
|
545 {
|
|
546 v84 = (char *)*(_BYTE *)(v22 + v2);
|
|
547 if ( tolower((int)v84) == 108 )
|
|
548 break;
|
|
549 ++v22;
|
|
550 if ( (signed int)v22 >= (signed int)v101 )
|
|
551 goto LABEL_325;
|
|
552 }
|
|
553 v23 = *(_BYTE *)(v22 + v2 + 1);
|
|
554 v24 = (const char *)(v22 + v2 + 2);
|
|
555 v18->uTreasureLevel = v23 - 48;
|
|
556 if ( *v24 )
|
|
557 {
|
|
558 if ( _strcmpi(v24, "WEAPON") )
|
|
559 {
|
|
560 if ( _strcmpi(v24, "ARMOR") )
|
|
561 {
|
|
562 if ( _strcmpi(v24, "MISC") )
|
|
563 {
|
|
564 if ( _strcmpi(v24, "SWORD") )
|
|
565 {
|
|
566 if ( _strcmpi(v24, "DAGGER") )
|
|
567 {
|
|
568 if ( _strcmpi(v24, "AXE") )
|
|
569 {
|
|
570 if ( _strcmpi(v24, "SPEAR") )
|
|
571 {
|
|
572 if ( _strcmpi(v24, "BOW") )
|
|
573 {
|
|
574 if ( _strcmpi(v24, "MACE") )
|
|
575 {
|
|
576 if ( _strcmpi(v24, "CLUB") )
|
|
577 {
|
|
578 if ( _strcmpi(v24, "STAFF") )
|
|
579 {
|
|
580 if ( _strcmpi(v24, "LEATHER") )
|
|
581 {
|
|
582 if ( _strcmpi(v24, "CHAIN") )
|
|
583 {
|
|
584 if ( _strcmpi(v24, "PLATE") )
|
|
585 {
|
|
586 if ( _strcmpi(v24, "SHIELD") )
|
|
587 {
|
|
588 if ( _strcmpi(v24, "HELM") )
|
|
589 {
|
|
590 if ( _strcmpi(v24, "BELT") )
|
|
591 {
|
|
592 if ( _strcmpi(v24, "CAPE") )
|
|
593 {
|
|
594 if ( _strcmpi(v24, "GAUNTLETS") )
|
|
595 {
|
|
596 if ( _strcmpi(v24, "BOOTS") )
|
|
597 {
|
|
598 if ( _strcmpi(v24, "RING") )
|
|
599 {
|
|
600 if ( _strcmpi(v24, "AMULET") )
|
|
601 {
|
|
602 if ( _strcmpi(v24, "WAND") )
|
|
603 {
|
|
604 if ( _strcmpi(v24, "SCROLL") )
|
|
605 {
|
|
606 if ( !_strcmpi(v24, "GEM") )
|
|
607 v18->uTreasureType = 46;
|
|
608 }
|
|
609 else
|
|
610 {
|
|
611 v18->uTreasureType = 43;
|
|
612 }
|
|
613 }
|
|
614 else
|
|
615 {
|
|
616 v18->uTreasureType = 42;
|
|
617 }
|
|
618 }
|
|
619 else
|
|
620 {
|
|
621 v18->uTreasureType = 41;
|
|
622 }
|
|
623 }
|
|
624 else
|
|
625 {
|
|
626 v18->uTreasureType = 40;
|
|
627 }
|
|
628 }
|
|
629 else
|
|
630 {
|
|
631 v18->uTreasureType = 39;
|
|
632 }
|
|
633 }
|
|
634 else
|
|
635 {
|
|
636 v18->uTreasureType = 38;
|
|
637 }
|
|
638 }
|
|
639 else
|
|
640 {
|
|
641 v18->uTreasureType = 37;
|
|
642 }
|
|
643 }
|
|
644 else
|
|
645 {
|
|
646 v18->uTreasureType = 36;
|
|
647 }
|
|
648 }
|
|
649 else
|
|
650 {
|
|
651 v18->uTreasureType = 35;
|
|
652 }
|
|
653 }
|
|
654 else
|
|
655 {
|
|
656 v18->uTreasureType = 34;
|
|
657 }
|
|
658 }
|
|
659 else
|
|
660 {
|
|
661 v18->uTreasureType = 33;
|
|
662 }
|
|
663 }
|
|
664 else
|
|
665 {
|
|
666 v18->uTreasureType = 32;
|
|
667 }
|
|
668 }
|
|
669 else
|
|
670 {
|
|
671 v18->uTreasureType = 31;
|
|
672 }
|
|
673 }
|
|
674 else
|
|
675 {
|
|
676 v18->uTreasureType = 30;
|
|
677 }
|
|
678 }
|
|
679 else
|
|
680 {
|
|
681 v18->uTreasureType = 29;
|
|
682 }
|
|
683 }
|
|
684 else
|
|
685 {
|
|
686 v18->uTreasureType = 28;
|
|
687 }
|
|
688 }
|
|
689 else
|
|
690 {
|
|
691 v18->uTreasureType = 27;
|
|
692 }
|
|
693 }
|
|
694 else
|
|
695 {
|
|
696 v18->uTreasureType = 26;
|
|
697 }
|
|
698 }
|
|
699 else
|
|
700 {
|
|
701 v18->uTreasureType = 25;
|
|
702 }
|
|
703 }
|
|
704 else
|
|
705 {
|
|
706 v18->uTreasureType = 24;
|
|
707 }
|
|
708 }
|
|
709 else
|
|
710 {
|
|
711 v18->uTreasureType = 23;
|
|
712 }
|
|
713 }
|
|
714 else
|
|
715 {
|
|
716 v18->uTreasureType = 22;
|
|
717 }
|
|
718 }
|
|
719 else
|
|
720 {
|
|
721 v18->uTreasureType = 21;
|
|
722 }
|
|
723 }
|
|
724 else
|
|
725 {
|
|
726 v18->uTreasureType = 20;
|
|
727 }
|
|
728 }
|
|
729 }
|
|
730 goto LABEL_325;
|
|
731 case 8:
|
|
732 v84 = (char *)v2;
|
|
733 v25 = &v102->pInfos[v103].bQuestMonster;
|
|
734 *v25 = 0;
|
|
735 if ( atoi(v84) )
|
|
736 *(_BYTE *)v25 |= 1u;
|
|
737 goto LABEL_325;
|
|
738 case 9:
|
|
739 v102->pInfos[v103].uFlying = _strnicmp((const char *)v2, "n", 1u);
|
|
740 goto LABEL_325;
|
|
741 case 0xA:
|
|
742 v84 = (char *)*(_BYTE *)v2;
|
|
743 v101 = 4;
|
|
744 if ( tolower((int)v84) == 's' )
|
|
745 {
|
|
746 v84 = (char *)*(_BYTE *)(v2 + 1);
|
|
747 v26 = tolower((int)v84) != 'h' ? 5 : 0;
|
|
748 }
|
|
749 else
|
|
750 {
|
|
751 v84 = (char *)*(_BYTE *)v2;
|
|
752 if ( tolower((int)v84) == 'm' )
|
|
753 {
|
|
754 v101 = 1;
|
|
755 }
|
|
756 else
|
|
757 {
|
|
758 v84 = (char *)*(_BYTE *)v2;
|
|
759 if ( tolower((int)v84) == 'l' )
|
|
760 {
|
|
761 v101 = 2;
|
|
762 }
|
|
763 else
|
|
764 {
|
|
765 v84 = (char *)*(_BYTE *)v2;
|
|
766 if ( tolower((int)v84) == 'g' )
|
|
767 v101 = 3;
|
|
768 }
|
|
769 }
|
|
770 LOBYTE(v26) = v101;
|
|
771 }
|
|
772 v102->pInfos[v103].uMovementType = v26;
|
|
773 goto LABEL_325;
|
|
774 case 0xB:
|
|
775 v84 = (char *)*(_BYTE *)v2;
|
|
776 v101 = 3;
|
|
777 if ( tolower((int)v84) == 's' )
|
|
778 {
|
|
779 v101 = 0;
|
|
780 }
|
|
781 else
|
|
782 {
|
|
783 v84 = (char *)*(_BYTE *)v2;
|
|
784 if ( tolower((int)v84) == 'w' )
|
|
785 {
|
|
786 v101 = 1;
|
|
787 }
|
|
788 else
|
|
789 {
|
|
790 v84 = (char *)*(_BYTE *)v2;
|
|
791 if ( tolower((int)v84) == 'n' )
|
|
792 v101 = 2;
|
|
793 }
|
|
794 }
|
|
795 v102->pInfos[v103].uAIType = v101;
|
|
796 goto LABEL_325;
|
|
797 case 0xC:
|
|
798 v102->pInfos[v103].uHostilityType = (MonsterInfo::HostilityRadius)atoi((const char *)v2);
|
|
799 goto LABEL_325;
|
|
800 case 0xD:
|
|
801 v102->pInfos[v103].uBaseSpeed = atoi((const char *)v2);
|
|
802 goto LABEL_325;
|
|
803 case 0xF:
|
|
804 v27 = strlen((const char *)v2);
|
|
805 v100 = 0;
|
|
806 v101 = v27;
|
|
807 if ( (signed int)v27 > 0 )
|
|
808 {
|
|
809 v28 = v103;
|
|
810 v29 = v102;
|
|
811 do
|
|
812 {
|
|
813 v84 = (char *)*(_BYTE *)(v100 + v2);
|
|
814 v30 = tolower((int)v84);
|
|
815 if ( v30 > 107 )
|
|
816 {
|
|
817 if ( v30 > 115 )
|
|
818 {
|
|
819 v40 = v30 - 116;
|
|
820 if ( v40 )
|
|
821 {
|
|
822 v41 = v40 - 3;
|
|
823 if ( v41 )
|
|
824 {
|
|
825 if ( v41 == 1 )
|
|
826 BYTE1(v29->pInfos[v28].uAttackPreference) |= 2u;
|
|
827 }
|
|
828 else
|
|
829 {
|
|
830 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x20u;
|
|
831 }
|
|
832 }
|
|
833 else
|
|
834 {
|
|
835 LOBYTE(v29->pInfos[v28].uAttackPreference) |= 0x80u;
|
|
836 }
|
|
837 }
|
|
838 else
|
|
839 {
|
|
840 if ( v30 == 115 )
|
|
841 {
|
|
842 v29->pInfos[v28].uAttackPreference |= 0x20u;
|
|
843 }
|
|
844 else
|
|
845 {
|
|
846 v37 = v30 - 109;
|
|
847 if ( v37 )
|
|
848 {
|
|
849 v38 = v37 - 2;
|
|
850 if ( v38 )
|
|
851 {
|
|
852 v39 = v38 - 1;
|
|
853 if ( v39 )
|
|
854 {
|
|
855 if ( v39 == 2 )
|
|
856 v29->pInfos[v28].uAttackPreference |= 0x40u;
|
|
857 }
|
|
858 else
|
|
859 {
|
|
860 v29->pInfos[v28].uAttackPreference |= 2u;
|
|
861 }
|
|
862 }
|
|
863 else
|
|
864 {
|
|
865 BYTE1(v29->pInfos[v28].uAttackPreference) |= 4u;
|
|
866 }
|
|
867 }
|
|
868 else
|
|
869 {
|
|
870 BYTE1(v29->pInfos[v28].uAttackPreference) |= 1u;
|
|
871 }
|
|
872 }
|
|
873 }
|
|
874 }
|
|
875 else
|
|
876 {
|
|
877 if ( v30 == 107 )
|
|
878 {
|
|
879 v29->pInfos[v28].uAttackPreference |= 1u;
|
|
880 }
|
|
881 else
|
|
882 {
|
|
883 if ( v30 > 99 )
|
|
884 {
|
|
885 v34 = v30 - 100;
|
|
886 if ( v34 )
|
|
887 {
|
|
888 v35 = v34 - 1;
|
|
889 if ( v35 )
|
|
890 {
|
|
891 v36 = v35 - 2;
|
|
892 if ( v36 )
|
|
893 {
|
|
894 if ( v36 == 1 )
|
|
895 BYTE1(v29->pInfos[v28].uAttackPreference) |= 8u;
|
|
896 }
|
|
897 else
|
|
898 {
|
|
899 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x40u;
|
|
900 }
|
|
901 }
|
|
902 else
|
|
903 {
|
|
904 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x10u;
|
|
905 }
|
|
906 }
|
|
907 else
|
|
908 {
|
|
909 v29->pInfos[v28].uAttackPreference |= 8u;
|
|
910 }
|
|
911 }
|
|
912 else
|
|
913 {
|
|
914 if ( v30 == 99 )
|
|
915 {
|
|
916 v29->pInfos[v28].uAttackPreference |= 0x10u;
|
|
917 }
|
|
918 else
|
|
919 {
|
|
920 v31 = v30 - 50;
|
|
921 if ( v31 )
|
|
922 {
|
|
923 v32 = v31 - 1;
|
|
924 if ( v32 )
|
|
925 {
|
|
926 v33 = v32 - 1;
|
|
927 if ( v33 )
|
|
928 {
|
|
929 if ( v33 == 45 )
|
|
930 v29->pInfos[v28].uAttackPreference |= 4u;
|
|
931 }
|
|
932 else
|
|
933 {
|
|
934 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 4;
|
|
935 }
|
|
936 }
|
|
937 else
|
|
938 {
|
|
939 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 3;
|
|
940 }
|
|
941 }
|
|
942 else
|
|
943 {
|
|
944 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 2;
|
|
945 }
|
|
946 }
|
|
947 }
|
|
948 }
|
|
949 }
|
|
950 ++v100;
|
|
951 }
|
|
952 while ( v100 < (signed int)v101 );
|
|
953 }
|
|
954 goto LABEL_325;
|
|
955 case 0xE:
|
|
956 v102->pInfos[v103].uRecoveryTime = atoi((const char *)v2);
|
|
957 goto LABEL_325;
|
|
958 case 0x10:
|
|
959 v42 = strlen((const char *)v2);
|
|
960 v43 = 0;
|
|
961 v44 = &v102->pInfos[v103];
|
|
962 v100 = v42;
|
|
963 v44->uSpecialAttackType = 1;
|
|
964 if ( (signed int)v42 <= 0 )
|
|
965 goto LABEL_185;
|
|
966 break;
|
|
967 case 0x11:
|
|
968 v102->pInfos[v103].uAttack1Type = ParseAttackType((unsigned __int8 *)v2);
|
|
969 goto LABEL_325;
|
|
970 case 0x12:
|
|
971 v46 = &v102->pInfos[v103];
|
|
972 v47 = (char *)&v46->uAttack1DamageDiceRolls;
|
|
973 v84 = (char *)&v46->uAttack1DamageBonus;
|
|
974 v48 = (char *)&v46->uAttack1DamageDiceSides;
|
|
975 goto LABEL_237;
|
|
976 case 0x13:
|
|
977 v102->pInfos[v103].uMissleAttack1Type = ParseMissleAttackType((const char *)v2);
|
|
978 goto LABEL_325;
|
|
979 case 0x14:
|
|
980 v102->pInfos[v103].uAttack2Chance = atoi((const char *)v2);
|
|
981 goto LABEL_325;
|
|
982 case 0x15:
|
|
983 v102->pInfos[v103].uAttack2Type = ParseAttackType((unsigned __int8 *)v2);
|
|
984 goto LABEL_325;
|
|
985 case 0x16:
|
|
986 v49 = &v102->pInfos[v103];
|
|
987 v47 = (char *)&v49->uAttack2DamageDiceRolls;
|
|
988 v84 = (char *)&v49->uAttack2DamageBonus;
|
|
989 v48 = (char *)&v49->uAttack2DamageDiceSides;
|
|
990 LABEL_237:
|
|
991 ParseDamage((const char *)v2, (int)v47, (int)v48, (int)v84);
|
|
992 goto LABEL_325;
|
|
993 case 0x17:
|
|
994 v102->pInfos[v103].uMissleAttack2Type = ParseMissleAttackType((const char *)v2);
|
|
995 goto LABEL_325;
|
|
996 case 0x18:
|
|
997 v102->pInfos[v103].uSpell1UseChance = atoi((const char *)v2);
|
|
998 goto LABEL_325;
|
|
999 case 0x19:
|
|
1000 strcpy(Str, (const char *)v2);
|
|
1001 Str[0] = ' ';
|
|
1002 Str[strlen(Str) - 1] = ' ';
|
|
1003 v50 = texture_frame_table_txt_parser(Str, &v87);
|
|
1004 v51 = 88 * v103;
|
|
1005 memcpy(&v90, v50, sizeof(v90));
|
|
1006 if ( v90.field_0 >= 3 )
|
|
1007 {
|
|
1008 v53 = (int)((char *)v102 + v51);
|
|
1009 a2 = 1;
|
|
1010 v102->pInfos[v51 / 0x58u].uSpell1ID = ParseSpellType(&v90, (int)&a2);
|
|
1011 v54 = a2;
|
|
1012 v84 = (char *)v90.pProperties[a2 + 1];
|
|
1013 v55 = atoi(v84);
|
|
1014 v56 = (char *)v90.pProperties[v54];
|
|
1015 v84 = "E";
|
|
1016 v83 = v56;
|
|
1017 *(_WORD *)(v53 + 56) = v55 & 0x3F;
|
|
1018 if ( _strcmpi(v83, v84) )
|
|
1019 {
|
|
1020 if ( _strcmpi(v56, "M") )
|
|
1021 {
|
|
1022 if ( !_strcmpi(v56, "G") )
|
|
1023 *(_BYTE *)(v53 + 57) |= 1u;
|
|
1024 }
|
|
1025 else
|
|
1026 {
|
|
1027 *(_BYTE *)(v53 + 56) |= 0x80u;
|
|
1028 }
|
|
1029 }
|
|
1030 else
|
|
1031 {
|
|
1032 *(_BYTE *)(v53 + 56) |= 0x40u;
|
|
1033 }
|
|
1034 }
|
|
1035 else
|
|
1036 {
|
|
1037 v52 = (int)((char *)v102 + v51);
|
|
1038 *(_BYTE *)(v52 + 33) = 0;
|
|
1039 *(_WORD *)(v52 + 56) = 0;
|
|
1040 }
|
|
1041 goto LABEL_325;
|
|
1042 case 0x1A:
|
|
1043 v102->pInfos[v103].uSpell2UseChance = atoi((const char *)v2);
|
|
1044 goto LABEL_325;
|
186
|
1045
|
0
|
1046 case 0x1B:
|
|
1047 strcpy(Dest, (const char *)v2);
|
|
1048 Dest[0] = ' ';
|
|
1049 Dest[strlen(Dest) - 1] = ' ';
|
|
1050 v57 = texture_frame_table_txt_parser(Dest, &v86);
|
|
1051 v58 = v103;
|
|
1052 memcpy(&v89, v57, sizeof(v89));
|
|
1053 if ( v89.field_0 >= 3 )
|
|
1054 {
|
|
1055 v60 = &v102->pInfos[v58];
|
|
1056 a2 = 1;
|
|
1057 v102->pInfos[v58].uSpell2ID = ParseSpellType(&v89, (int)&a2);
|
|
1058 v61 = a2;
|
|
1059 v84 = (char *)v89.pProperties[a2 + 1];
|
|
1060 v62 = atoi(v84);
|
|
1061 v63 = (char *)v89.pProperties[v61];
|
|
1062 v84 = "E";
|
|
1063 v83 = v63;
|
|
1064 v60->uSpellSkillAndMastery2 = v62 & 0x3F;
|
|
1065 if ( _strcmpi(v83, v84) )
|
|
1066 {
|
|
1067 if ( _strcmpi(v63, "M") )
|
|
1068 {
|
|
1069 if ( !_strcmpi(v63, "G") )
|
|
1070 HIBYTE(v60->uSpellSkillAndMastery2) |= 1u;
|
|
1071 }
|
|
1072 else
|
|
1073 {
|
|
1074 LOBYTE(v60->uSpellSkillAndMastery2) |= 0x80u;
|
|
1075 }
|
|
1076 }
|
|
1077 else
|
|
1078 {
|
|
1079 LOBYTE(v60->uSpellSkillAndMastery2) |= 0x40u;
|
|
1080 }
|
|
1081 }
|
|
1082 else
|
|
1083 {
|
|
1084 v59 = &v102->pInfos[v58];
|
|
1085 v59->uSpell2ID = 0;
|
|
1086 v59->uSpellSkillAndMastery2 = 0;
|
|
1087 }
|
|
1088 goto LABEL_325;
|
|
1089 case 0x1C:
|
|
1090 v84 = (char *)*(_BYTE *)v2;
|
|
1091 if ( tolower((int)v84) == 'i' )
|
|
1092 v64 = 200;
|
|
1093 else
|
|
1094 v64 = atoi((const char *)v2);
|
|
1095 v102->pInfos[v103].uResFire = v64;
|
|
1096 goto LABEL_325;
|
|
1097 case 0x1D:
|
|
1098 v84 = (char *)*(_BYTE *)v2;
|
|
1099 if ( tolower((int)v84) == 'i' )
|
|
1100 v65 = 200;
|
|
1101 else
|
|
1102 v65 = atoi((const char *)v2);
|
|
1103 v102->pInfos[v103].uResAir = v65;
|
|
1104 goto LABEL_325;
|
|
1105 case 0x1E:
|
|
1106 v84 = (char *)*(_BYTE *)v2;
|
|
1107 if ( tolower((int)v84) == 'i' )
|
|
1108 v66 = 200;
|
|
1109 else
|
|
1110 v66 = atoi((const char *)v2);
|
|
1111 v102->pInfos[v103].uResWater = v66;
|
|
1112 goto LABEL_325;
|
|
1113 case 0x1F:
|
|
1114 v84 = (char *)*(_BYTE *)v2;
|
|
1115 if ( tolower((int)v84) == 'i' )
|
|
1116 v67 = 200;
|
|
1117 else
|
|
1118 v67 = atoi((const char *)v2);
|
|
1119 v102->pInfos[v103].uResEarth = v67;
|
|
1120 goto LABEL_325;
|
|
1121 case 0x20:
|
|
1122 v84 = (char *)*(_BYTE *)v2;
|
|
1123 if ( tolower((int)v84) == 'i' )
|
|
1124 v68 = 200;
|
|
1125 else
|
|
1126 v68 = atoi((const char *)v2);
|
|
1127 v102->pInfos[v103].uResMind = v68;
|
|
1128 goto LABEL_325;
|
|
1129 case 0x21:
|
|
1130 v84 = (char *)*(_BYTE *)v2;
|
|
1131 if ( tolower((int)v84) == 'i' )
|
|
1132 v69 = 200;
|
|
1133 else
|
|
1134 v69 = atoi((const char *)v2);
|
|
1135 v102->pInfos[v103].uResSpirit = v69;
|
|
1136 goto LABEL_325;
|
|
1137 case 0x22:
|
|
1138 v84 = (char *)*(_BYTE *)v2;
|
|
1139 if ( tolower((int)v84) == 'i' )
|
|
1140 v70 = 200;
|
|
1141 else
|
|
1142 v70 = atoi((const char *)v2);
|
|
1143 v102->pInfos[v103].uResBody = v70;
|
|
1144 goto LABEL_325;
|
|
1145 case 0x23:
|
|
1146 v84 = (char *)*(_BYTE *)v2;
|
|
1147 if ( tolower((int)v84) == 'i' )
|
|
1148 v71 = 200;
|
|
1149 else
|
|
1150 v71 = atoi((const char *)v2);
|
|
1151 v102->pInfos[v103].uResLight = v71;
|
|
1152 goto LABEL_325;
|
|
1153 case 0x24:
|
|
1154 v84 = (char *)*(_BYTE *)v2;
|
|
1155 if ( tolower((int)v84) == 'i' )
|
|
1156 v72 = 200;
|
|
1157 else
|
|
1158 v72 = atoi((const char *)v2);
|
|
1159 v102->pInfos[v103].uResDark = v72;
|
|
1160 goto LABEL_325;
|
|
1161 case 0x25:
|
|
1162 v84 = (char *)*(_BYTE *)v2;
|
|
1163 if ( tolower((int)v84) == 'i' )
|
|
1164 v73 = 200;
|
|
1165 else
|
|
1166 v73 = atoi((const char *)v2);
|
|
1167 v102->pInfos[v103].uResPhysical = v73;
|
|
1168 goto LABEL_325;
|
|
1169 case 0x26:
|
|
1170 strcpy(v93, (const char *)v2);
|
|
1171 v93[0] = ' ';
|
|
1172 v93[strlen(v93) - 1] = ' ';
|
|
1173 memcpy(&v94, texture_frame_table_txt_parser(v93, &v85), sizeof(v94));
|
|
1174 if ( v94.field_0 )
|
|
1175 {
|
|
1176 v74 = v94.field_0;
|
|
1177 if ( v94.field_0 < 10 )
|
|
1178 {
|
|
1179 if ( _strcmpi(v94.pProperties[0], "shot") )
|
|
1180 {
|
|
1181 if ( _strcmpi(v94.pProperties[0], "summon") )
|
|
1182 {
|
|
1183 if ( !_strcmpi(v94.pProperties[0], "explode") )
|
|
1184 {
|
|
1185 v79 = &v102->pInfos[v103];
|
|
1186 v80 = v94.pProperties[1];
|
|
1187 v84 = (char *)&v79->uSpecialAbilityDamageDiceBonus;
|
|
1188 v83 = (char *)&v79->uSpecialAbilityDamageDiceSides;
|
|
1189 v79->uSpecialAbilityType = 3;
|
|
1190 ParseDamage(v80, (int)&v79->uSpecialAbilityDamageDiceRolls, (int)v83, (int)v84);
|
|
1191 v79->field_3C_some_special_attack = ParseAttackType((unsigned __int8 *)v2);
|
|
1192 }
|
|
1193 }
|
|
1194 else
|
|
1195 {
|
|
1196 v76 = &v102->pInfos[v103];
|
|
1197 v76->uSpecialAbilityType = 2;
|
|
1198 if ( v74 > 1 )
|
|
1199 {
|
|
1200 pTmpBuf[0] = 0;
|
|
1201 strcpy(pTmpBuf, v94.pProperties[2]);
|
|
1202 if ( v74 > 2 )
|
|
1203 {
|
|
1204 v100 = 3;
|
|
1205 if ( v74 > 3 )
|
|
1206 {
|
|
1207 do
|
|
1208 {
|
|
1209 strcat(pTmpBuf, " ");
|
|
1210 v77 = (char **)v94.pProperties[v100];
|
|
1211 v82 = v94.pProperties[v100];
|
|
1212 strcat(pTmpBuf, v82);
|
|
1213 if ( v100 == v94.field_0 - 1 )
|
|
1214 {
|
|
1215 v84 = (char *)*(_BYTE *)v77;
|
|
1216 if ( tolower((int)v84) == 'a' )
|
|
1217 {
|
|
1218 v76->uSpecialAbilityDamageDiceRolls = 1;
|
|
1219 }
|
|
1220 else
|
|
1221 {
|
|
1222 v84 = (char *)*(_BYTE *)v77;
|
|
1223 if ( tolower((int)v84) == 'b' )
|
|
1224 {
|
|
1225 v76->uSpecialAbilityDamageDiceRolls = 2;
|
|
1226 }
|
|
1227 else
|
|
1228 {
|
|
1229 v84 = (char *)*(_BYTE *)v77;
|
|
1230 if ( tolower((int)v84) == 'c' )
|
|
1231 v76->uSpecialAbilityDamageDiceRolls = 3;
|
|
1232 else
|
|
1233 v76->uSpecialAbilityDamageDiceRolls = 0;
|
|
1234 }
|
|
1235 }
|
|
1236 }
|
|
1237 ++v100;
|
|
1238 }
|
|
1239 while ( v100 < v94.field_0 );
|
|
1240 }
|
|
1241 }
|
|
1242 else
|
|
1243 {
|
|
1244 v76->uSpecialAbilityDamageDiceRolls = 0;
|
|
1245 }
|
|
1246 if ( pMonsterList->uNumMonsters )
|
|
1247 {
|
|
1248 v78 = pMonsterList->GetMonsterByName(pTmpBuf) + 1;
|
|
1249 v76->field_3C_some_special_attack = v78;
|
|
1250 if ( v78 == -1 )
|
|
1251 {
|
|
1252 sprintf(Src, "Can't create random monster: '%s' See MapStats!", Src);
|
|
1253 MessageBoxA(nullptr, Src, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:2239", 0);
|
|
1254 }
|
|
1255 }
|
|
1256 v76->uSpecialAbilityDamageDiceSides = 0;
|
|
1257 if ( !_strcmpi(v94.pProperties[1], "ground") )
|
|
1258 v76->uSpecialAbilityDamageDiceSides = 1;
|
|
1259 if ( v76->field_3C_some_special_attack == -1 )
|
|
1260 v76->uSpecialAbilityType = 0;
|
|
1261 }
|
|
1262 }
|
|
1263 }
|
|
1264 else
|
|
1265 {
|
|
1266 v75 = &v102->pInfos[v103];
|
|
1267 v84 = (char *)(v94.pProperties[1] + 1);
|
|
1268 v75->uSpecialAbilityType = 1;
|
|
1269 v75->uSpecialAbilityDamageDiceBonus = atoi(v84);
|
|
1270 }
|
|
1271 }
|
|
1272 }
|
|
1273 goto LABEL_325;
|
|
1274 default:
|
|
1275 goto LABEL_325;
|
|
1276 }
|
|
1277 while ( 1 )
|
|
1278 {
|
|
1279 v84 = (char *)*(_BYTE *)(v43 + v2);
|
|
1280 if ( tolower((int)v84) == 'x' )
|
|
1281 break;
|
|
1282 ++v43;
|
|
1283 if ( v43 >= v100 )
|
|
1284 goto LABEL_185;
|
|
1285 }
|
|
1286 v45 = v2 + v43;
|
|
1287 *(_BYTE *)v45 = 0;
|
|
1288 v44->uSpecialAttackType = atoi((const char *)(v45 + 1));
|
|
1289 *(_BYTE *)v45 = 100;
|
|
1290 LABEL_185:
|
|
1291 _strlwr((char *)v2);
|
|
1292 if ( strstr((const char *)v2, "curse") )
|
|
1293 {
|
|
1294 v44->uSpecialAttack = 1;
|
|
1295 }
|
|
1296 else
|
|
1297 {
|
|
1298 if ( strstr((const char *)v2, "weak") )
|
|
1299 {
|
|
1300 v44->uSpecialAttack = 2;
|
|
1301 }
|
|
1302 else
|
|
1303 {
|
|
1304 if ( strstr((const char *)v2, "asleep") )
|
|
1305 {
|
|
1306 v44->uSpecialAttack = 3;
|
|
1307 }
|
|
1308 else
|
|
1309 {
|
|
1310 if ( strstr((const char *)v2, "afraid") )
|
|
1311 {
|
|
1312 v44->uSpecialAttack = 23;
|
|
1313 }
|
|
1314 else
|
|
1315 {
|
|
1316 if ( strstr((const char *)v2, "drunk") )
|
|
1317 {
|
|
1318 v44->uSpecialAttack = 4;
|
|
1319 }
|
|
1320 else
|
|
1321 {
|
|
1322 if ( strstr((const char *)v2, "insane") )
|
|
1323 {
|
|
1324 v44->uSpecialAttack = 5;
|
|
1325 }
|
|
1326 else
|
|
1327 {
|
|
1328 if ( strstr((const char *)v2, "poison1") )
|
|
1329 {
|
|
1330 v44->uSpecialAttack = 6;
|
|
1331 }
|
|
1332 else
|
|
1333 {
|
|
1334 if ( strstr((const char *)v2, "poison2") )
|
|
1335 {
|
|
1336 v44->uSpecialAttack = 7;
|
|
1337 }
|
|
1338 else
|
|
1339 {
|
|
1340 if ( strstr((const char *)v2, "poison3") )
|
|
1341 {
|
|
1342 v44->uSpecialAttack = 8;
|
|
1343 }
|
|
1344 else
|
|
1345 {
|
|
1346 if ( strstr((const char *)v2, "disease1") )
|
|
1347 {
|
|
1348 v44->uSpecialAttack = 9;
|
|
1349 }
|
|
1350 else
|
|
1351 {
|
|
1352 if ( strstr((const char *)v2, "disease2") )
|
|
1353 {
|
|
1354 v44->uSpecialAttack = 10;
|
|
1355 }
|
|
1356 else
|
|
1357 {
|
|
1358 if ( strstr((const char *)v2, "disease3") )
|
|
1359 {
|
|
1360 v44->uSpecialAttack = 11;
|
|
1361 }
|
|
1362 else
|
|
1363 {
|
|
1364 if ( strstr((const char *)v2, "paralyze") )
|
|
1365 {
|
|
1366 v44->uSpecialAttack = 12;
|
|
1367 }
|
|
1368 else
|
|
1369 {
|
|
1370 if ( strstr((const char *)v2, "uncon") )
|
|
1371 {
|
|
1372 v44->uSpecialAttack = 13;
|
|
1373 }
|
|
1374 else
|
|
1375 {
|
|
1376 if ( strstr((const char *)v2, "dead") )
|
|
1377 {
|
|
1378 v44->uSpecialAttack = 14;
|
|
1379 }
|
|
1380 else
|
|
1381 {
|
|
1382 if ( strstr((const char *)v2, "stone") )
|
|
1383 {
|
|
1384 v44->uSpecialAttack = 15;
|
|
1385 }
|
|
1386 else
|
|
1387 {
|
|
1388 if ( strstr((const char *)v2, "errad") )
|
|
1389 {
|
|
1390 v44->uSpecialAttack = 16;
|
|
1391 }
|
|
1392 else
|
|
1393 {
|
|
1394 if ( strstr((const char *)v2, "brkitem") )
|
|
1395 {
|
|
1396 v44->uSpecialAttack = 17;
|
|
1397 }
|
|
1398 else
|
|
1399 {
|
|
1400 if ( strstr((const char *)v2, "brkarmor") )
|
|
1401 {
|
|
1402 v44->uSpecialAttack = 18;
|
|
1403 }
|
|
1404 else
|
|
1405 {
|
|
1406 if ( strstr((const char *)v2, "brkweapon") )
|
|
1407 {
|
|
1408 v44->uSpecialAttack = 19;
|
|
1409 }
|
|
1410 else
|
|
1411 {
|
|
1412 if ( strstr((const char *)v2, "steal") )
|
|
1413 {
|
|
1414 v44->uSpecialAttack = 20;
|
|
1415 }
|
|
1416 else
|
|
1417 {
|
|
1418 if ( strstr((const char *)v2, "age") )
|
|
1419 {
|
|
1420 v44->uSpecialAttack = 21;
|
|
1421 }
|
|
1422 else
|
|
1423 {
|
|
1424 if ( strstr((const char *)v2, "drainsp") )
|
|
1425 v44->uSpecialAttack = 22;
|
|
1426 }
|
|
1427 }
|
|
1428 }
|
|
1429 }
|
|
1430 }
|
|
1431 }
|
|
1432 }
|
|
1433 }
|
|
1434 }
|
|
1435 }
|
|
1436 }
|
|
1437 }
|
|
1438 }
|
|
1439 }
|
|
1440 }
|
|
1441 }
|
|
1442 }
|
|
1443 }
|
|
1444 }
|
|
1445 }
|
|
1446 }
|
|
1447 }
|
|
1448 }
|
|
1449 else
|
|
1450 {
|
|
1451 v97 = 1;
|
|
1452 }
|
|
1453 LABEL_325:
|
|
1454 ++*(_DWORD *)&a3[1];
|
|
1455 v2 = v96 + 1;
|
|
1456 }
|
|
1457 while ( *(_DWORD *)&a3[1] - 1 <= (signed int)v102->uNumMonsters && !v97 );
|
|
1458 ++v103;
|
|
1459 }
|
|
1460 while ( v103 < 265 );
|
|
1461 v102->uNumMonsters = v103;
|
|
1462 }
|
|
1463
|
|
1464
|
|
1465
|
|
1466
|
|
1467 //----- (0044FA08) --------------------------------------------------------
|
|
1468 unsigned __int16 MonsterList::GetMonsterByName(const char *pMonsterName)
|
|
1469 {
|
|
1470 signed int v2; // ebx@1
|
|
1471 MonsterList *v3; // esi@1
|
|
1472 int v4; // edi@3
|
|
1473 unsigned __int16 result; // ax@6
|
|
1474
|
|
1475 v2 = 0;
|
|
1476 v3 = this;
|
|
1477 if ( pMonsterName && (signed int)this->uNumMonsters > 0 )
|
|
1478 {
|
|
1479 v4 = 0;
|
|
1480 while ( _strcmpi(pMonsterName, v3->pMonsters[v4].pMonsterName) )
|
|
1481 {
|
|
1482 ++v2;
|
|
1483 ++v4;
|
|
1484 if ( v2 >= (signed int)v3->uNumMonsters )
|
|
1485 goto LABEL_6;
|
|
1486 }
|
|
1487 result = v2;
|
|
1488 }
|
|
1489 else
|
|
1490 {
|
|
1491 LABEL_6:
|
|
1492 result = -1;
|
|
1493 }
|
|
1494 return result;
|
|
1495 }
|