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) --------------------------------------------------------
|
694
|
185 signed int MonsterStats::FindMonsterByName(const char *Str2)
|
0
|
186 {
|
|
187 MonsterStats *v2; // esi@1
|
|
188 signed int v3; // ebx@1
|
|
189 MonsterInfo *v4; // edi@2
|
|
190 signed int result; // eax@6
|
694
|
191 /*
|
|
192 for (int i=1; i<=uNumMonsters; ++i)
|
|
193 {
|
|
194 if()
|
|
195 return i;
|
|
196 }
|
|
197 return -1;
|
|
198 */
|
0
|
199 v2 = this;
|
|
200 v3 = 1;
|
|
201 if ( (signed int)this->uNumMonsters <= 1 )
|
|
202 {
|
|
203 LABEL_6:
|
|
204 result = -1;
|
|
205 }
|
|
206 else
|
|
207 {
|
|
208 v4 = &this->pInfos[1];
|
694
|
209 while ( !v4->pName || _strcmpi(v4->pPictureName, Str2) )
|
0
|
210 {
|
|
211 ++v3;
|
|
212 ++v4;
|
|
213 if ( v3 >= (signed int)v2->uNumMonsters )
|
|
214 goto LABEL_6;
|
|
215 }
|
|
216 result = v3;
|
|
217 }
|
|
218 return result;
|
|
219 }
|
|
220
|
|
221
|
|
222 //----- (00454F4E) --------------------------------------------------------
|
|
223 void MonsterStats::InitializePlacements()
|
|
224 {
|
237
|
225 int i;
|
|
226 char* test_string;
|
|
227 unsigned char c;
|
|
228 bool break_loop;
|
|
229 unsigned int temp_str_len;
|
|
230 char* tmp_pos;
|
|
231 int decode_step;
|
|
232 int item_counter;
|
0
|
233
|
|
234 pMonsterPlacementTXT_Raw = (char *)pEvents_LOD->LoadRaw("placemon.txt", 0);
|
|
235 strtok(pMonsterPlacementTXT_Raw, "\r");
|
237
|
236 for (i=1; i<31; ++i)
|
|
237 {
|
|
238 test_string = strtok(NULL, "\r") + 1;
|
|
239 break_loop = false;
|
|
240 decode_step=0;
|
|
241 do
|
|
242 {
|
|
243 c = *(unsigned char*)test_string;
|
|
244 temp_str_len = 0;
|
|
245 while((c!='\t')&&(c>0))
|
|
246 {
|
|
247 ++temp_str_len;
|
|
248 c=test_string[temp_str_len];
|
|
249 }
|
|
250 tmp_pos=test_string+temp_str_len;
|
|
251 if (*tmp_pos == 0)
|
|
252 break_loop = true;
|
|
253 *tmp_pos = 0;
|
|
254 if (temp_str_len)
|
|
255 {
|
|
256 if (decode_step==1)
|
|
257 pPlaceStrings[i]=RemoveQuotes(test_string);
|
|
258 }
|
|
259 else
|
|
260 {
|
|
261 break_loop = true;
|
|
262 }
|
|
263 ++decode_step;
|
|
264 test_string=tmp_pos+1;
|
|
265 } while ((decode_step<3)&&!break_loop);
|
|
266 }
|
|
267 uNumPlacements = 31;
|
0
|
268 }
|
|
269
|
|
270 //----- (0045501E) --------------------------------------------------------
|
|
271 void MonsterStats::Initialize()
|
694
|
272 {
|
|
273 MonsterStats *v1; // ebx@1
|
|
274 int v2; // ebx@4
|
|
275 char v3; // cl@5
|
|
276 int v4; // eax@5
|
|
277 size_t v5; // eax@19
|
|
278 signed int v6; // edi@19
|
|
279 MonsterStats *v7; // ecx@23
|
|
280 int v8; // eax@23
|
|
281 unsigned int *pHP; // esi@23
|
|
282 size_t v10; // eax@29
|
|
283 signed int v11; // edi@29
|
|
284 MonsterStats *v12; // ecx@33
|
|
285 int v13; // eax@33
|
|
286 unsigned int *pExp; // esi@33
|
|
287 signed int v15; // edi@36
|
|
288 size_t v16; // esi@36
|
|
289 int v17; // eax@37
|
|
290 MonsterInfo *v18; // esi@45
|
|
291 size_t v19; // edi@50
|
|
292 int v20; // eax@51
|
|
293 unsigned __int8 v21; // al@55
|
|
294 size_t v22; // edi@59
|
|
295 char v23; // cl@63
|
|
296 const char *v24; // edi@63
|
|
297 unsigned __int16 *v25; // esi@114
|
|
298 int v26; // eax@118
|
|
299 size_t v27; // eax@136
|
|
300 int v28; // edi@137
|
|
301 MonsterStats *v29; // esi@137
|
|
302 int v30; // eax@138
|
|
303 int v31; // eax@142
|
|
304 int v32; // eax@143
|
|
305 int v33; // eax@144
|
|
306 int v34; // eax@151
|
|
307 int v35; // eax@152
|
|
308 int v36; // eax@153
|
|
309 int v37; // eax@162
|
|
310 int v38; // eax@163
|
|
311 int v39; // eax@164
|
|
312 int v40; // eax@171
|
|
313 int v41; // eax@172
|
|
314 size_t v42; // eax@180
|
|
315 int v43; // edi@180
|
|
316 MonsterInfo *v44; // esi@180
|
|
317 int v45; // edi@184
|
|
318 MonsterInfo *v46; // eax@232
|
|
319 char *v47; // edx@232
|
|
320 char *v48; // ecx@232
|
|
321 MonsterInfo *v49; // eax@236
|
|
322 FrameTableTxtLine *v50; // esi@240
|
|
323 int v51; // eax@240
|
|
324 int v52; // eax@241
|
|
325 int v53; // esi@242
|
|
326 int v54; // edi@242
|
|
327 char v55; // al@242
|
|
328 char *v56; // edi@242
|
|
329 FrameTableTxtLine *v57; // esi@249
|
|
330 int v58; // eax@249
|
|
331 MonsterInfo *v59; // eax@250
|
|
332 MonsterInfo *v60; // esi@251
|
|
333 int v61; // edi@251
|
|
334 char v62; // al@251
|
|
335 char *v63; // edi@251
|
|
336 char v64; // al@258
|
|
337 char v65; // al@262
|
|
338 char v66; // al@266
|
|
339 char v67; // al@270
|
|
340 char v68; // al@274
|
|
341 char v69; // al@278
|
|
342 char v70; // al@282
|
|
343 char v71; // al@286
|
|
344 char v72; // al@290
|
|
345 unsigned __int8 v73; // al@294
|
|
346 int v74; // edi@298
|
|
347 MonsterInfo *v75; // esi@300
|
|
348 MonsterInfo *v76; // esi@302
|
|
349 char **v77; // edi@306
|
|
350 __int16 v78; // ax@316
|
|
351 MonsterInfo *v79; // esi@323
|
|
352 const char *v80; // ecx@323
|
|
353 std::string v81; // [sp-14h] [bp-46Ch]@317
|
|
354 const char *v82; // [sp-8h] [bp-460h]@306
|
|
355 char *v83; // [sp-4h] [bp-45Ch]@23
|
|
356 char *v84; // [sp+0h] [bp-458h]@37
|
|
357 FrameTableTxtLine v85; // [sp+10h] [bp-448h]@297
|
|
358 FrameTableTxtLine v86; // [sp+8Ch] [bp-3CCh]@249
|
|
359 FrameTableTxtLine v87; // [sp+108h] [bp-350h]@240
|
|
360 char Src[120]; // [sp+184h] [bp-2D4h]@317
|
|
361 FrameTableTxtLine v89; // [sp+1FCh] [bp-25Ch]@249
|
|
362 FrameTableTxtLine v90; // [sp+278h] [bp-1E0h]@240
|
|
363 char Str[64]; // [sp+2F4h] [bp-164h]@240
|
|
364 char Dest[64]; // [sp+334h] [bp-124h]@249
|
|
365 char v93[64]; // [sp+374h] [bp-E4h]@297
|
|
366 FrameTableTxtLine v94; // [sp+3B4h] [bp-A4h]@297
|
|
367 int v95; // [sp+430h] [bp-28h]@317
|
|
368 int v96; // [sp+434h] [bp-24h]@9
|
|
369 int v97; // [sp+438h] [bp-20h]@4
|
|
370 char a3[5]; // [sp+43Fh] [bp-19h]@4
|
|
371 int a2; // [sp+444h] [bp-14h]@36
|
|
372 int v100; // [sp+448h] [bp-10h]@36
|
|
373 size_t v101; // [sp+44Ch] [bp-Ch]@19
|
|
374 MonsterStats *v102; // [sp+450h] [bp-8h]@1
|
|
375 int v103; // [sp+454h] [bp-4h]@3
|
|
376
|
|
377 int i,j;
|
|
378 char* test_string;
|
|
379 unsigned char c;
|
|
380 bool break_loop;
|
|
381 unsigned int temp_str_len;
|
|
382 char* tmp_pos;
|
|
383 int decode_step;
|
|
384 int item_counter;
|
|
385 int curr_rec_num;
|
|
386
|
|
387 v1 = this;
|
|
388 v102 = this;
|
|
389 if ( pMonstersTXT_Raw )
|
|
390 pAllocator->FreeChunk(pMonstersTXT_Raw);
|
|
391 pMonstersTXT_Raw = NULL;
|
|
392 pMonstersTXT_Raw = (char *)pEvents_LOD->LoadRaw("monsters.txt", 0);
|
|
393 strtok(pMonstersTXT_Raw, "\r");
|
|
394 strtok(NULL, "\r");
|
|
395 strtok(NULL, "\r");
|
|
396 strtok(NULL, "\r");
|
|
397 uNumMonsters = 265;
|
|
398 curr_rec_num=0;
|
|
399 for (i=0;i<uNumMonsters-1;++i)
|
|
400 {
|
|
401 test_string = strtok(NULL, "\r") + 1;
|
|
402 break_loop = false;
|
|
403 decode_step=0;
|
|
404 do
|
|
405 {
|
|
406 c = *(unsigned char*)test_string;
|
|
407 temp_str_len = 0;
|
|
408 while((c!='\t')&&(c>0))
|
|
409 {
|
|
410 ++temp_str_len;
|
|
411 c=test_string[temp_str_len];
|
|
412 }
|
|
413 tmp_pos=test_string+temp_str_len;
|
|
414 if (*tmp_pos == 0)
|
|
415 break_loop = true;
|
|
416 *tmp_pos = 0;
|
|
417 if (temp_str_len)
|
|
418 {
|
|
419 switch (decode_step)
|
|
420 {
|
|
421 case 0:
|
|
422 curr_rec_num=atoi(test_string);
|
|
423 pInfos[curr_rec_num].uID=curr_rec_num;
|
|
424 break;
|
|
425 case 1:
|
|
426 pInfos[curr_rec_num].pName=RemoveQuotes(test_string);
|
|
427 break;
|
|
428 case 2:
|
|
429 pInfos[curr_rec_num].pPictureName=RemoveQuotes(test_string);
|
|
430 break;
|
|
431 case 3:
|
|
432 {
|
|
433 pInfos[curr_rec_num].uLevel=atoi(test_string);
|
|
434 }
|
|
435 break;
|
|
436 case 4:
|
|
437 {
|
|
438 int str_len=0;
|
|
439 int str_pos=0;
|
|
440 pInfos[curr_rec_num].uHP=0;
|
|
441 if (test_string[0]=='"')
|
|
442 test_string[0]=' ';
|
|
443 str_len=strlen(test_string);
|
|
444 if (str_len==0)
|
|
445 break;
|
|
446 while ((test_string[str_pos]!=',')&&(str_pos<str_len))
|
|
447 ++str_pos;
|
|
448 if (str_len==str_pos)
|
|
449 pInfos[curr_rec_num].uHP=atoi(test_string);
|
|
450 else
|
|
451 {
|
|
452 test_string[str_pos]='\0';
|
|
453 pInfos[curr_rec_num].uHP=1000*atoi(test_string);
|
|
454 pInfos[curr_rec_num].uHP+=atoi(&test_string[str_pos+1]);
|
|
455 test_string[str_pos]=',';
|
|
456 }
|
|
457 }
|
|
458 break;
|
|
459 case 5:
|
|
460 {
|
|
461 pInfos[curr_rec_num].uAC=atoi(test_string);
|
|
462 }
|
|
463 break;
|
|
464 case 6:
|
|
465 {
|
|
466 int str_len=0;
|
|
467 int str_pos=0;
|
|
468 pInfos[curr_rec_num].uExp=0;
|
|
469 if (test_string[0]=='"')
|
|
470 test_string[0]=' ';
|
|
471 str_len=strlen(test_string);
|
|
472 if (str_len==0)
|
|
473 break;
|
|
474 while ((test_string[str_pos]!=',')&&(str_pos<str_len))
|
|
475 ++str_pos;
|
|
476 if (str_len==str_pos)
|
|
477 pInfos[curr_rec_num].uExp=atoi(test_string);
|
|
478 else
|
|
479 {
|
|
480 test_string[str_pos]='\0';
|
|
481 pInfos[curr_rec_num].uExp=1000*atoi(test_string);
|
|
482 pInfos[curr_rec_num].uExp+=atoi(&test_string[str_pos+1]);
|
|
483 test_string[str_pos]=',';
|
|
484 }
|
|
485 }
|
|
486 break;
|
|
487 case 7:
|
|
488 {
|
|
489 int str_len=0;
|
|
490 int str_pos=0;
|
|
491 bool chance_flag=false;
|
|
492 bool dice_flag=false;
|
|
493 bool item_type_flag=false;
|
|
494 char* item_name;
|
|
495 pInfos[curr_rec_num].uTreasureDropChance=0;
|
|
496 pInfos[curr_rec_num].uTreasureDiceRolls=0;
|
|
497 pInfos[curr_rec_num].uTreasureDiceSides=0;
|
|
498 if (test_string[0]=='"')
|
|
499 test_string[0]=' ';
|
|
500 str_len=strlen(test_string);
|
|
501 do
|
|
502 {
|
|
503 switch(tolower(test_string[str_pos]))
|
|
504 {
|
|
505 case '%': chance_flag=true; break;
|
|
506 case 'd': dice_flag=true; break;
|
|
507 case 'l': item_type_flag=true; break;
|
|
508 }
|
|
509 ++str_pos;
|
|
510 }
|
|
511 while(str_pos<str_len);
|
|
512 if (chance_flag)
|
|
513 {
|
|
514 pInfos[curr_rec_num].uTreasureDropChance=atoi(test_string);
|
|
515 }
|
|
516 else
|
|
517 {
|
|
518 if ((!dice_flag)&&(!item_type_flag))
|
|
519 break;
|
|
520 pInfos[curr_rec_num].uTreasureDropChance=100;
|
|
521 }
|
|
522 if (dice_flag)
|
|
523 {
|
|
524 str_pos=0;
|
|
525 dice_flag=false;
|
|
526 do
|
|
527 {
|
|
528 switch(tolower(test_string[str_pos]))
|
|
529 {
|
|
530 case '%':
|
|
531 pInfos[curr_rec_num].uTreasureDiceRolls=atoi(&test_string[str_pos+1]);
|
|
532 dice_flag=true;
|
|
533 break;
|
|
534 case 'd':
|
|
535 if(!dice_flag)
|
|
536 pInfos[curr_rec_num].uTreasureDiceRolls=atoi(test_string);
|
|
537 pInfos[curr_rec_num].uTreasureDiceSides=atoi(&test_string[str_pos+1]);
|
|
538 str_pos=str_len;
|
|
539 break;
|
0
|
540
|
694
|
541 }
|
|
542 ++str_pos;
|
|
543 }
|
|
544 while(str_pos<str_len);
|
|
545 }
|
|
546 if (item_type_flag)
|
|
547 {
|
|
548 str_pos=0;
|
|
549 do
|
|
550 {
|
|
551 if (tolower(test_string[str_pos])=='l')
|
|
552 break;
|
|
553 ++str_pos;
|
|
554 }
|
|
555 while(str_pos<str_len);
|
|
556 pInfos[curr_rec_num].uTreasureType=0;
|
|
557 pInfos[curr_rec_num].uTreasureLevel=test_string[str_pos+1]-'0';
|
|
558 item_name=&test_string[str_pos+2];
|
|
559 if (*item_name)
|
|
560 {
|
|
561 if ( !_strcmpi(item_name, "WEAPON"))
|
|
562 pInfos[curr_rec_num].uTreasureType= 20;
|
|
563 else if ( !_strcmpi(item_name, "ARMOR"))
|
|
564 pInfos[curr_rec_num].uTreasureType= 21;
|
|
565 else if ( !_strcmpi(item_name, "MISC"))
|
|
566 pInfos[curr_rec_num].uTreasureType= 22;
|
|
567 else if ( !_strcmpi(item_name, "SWORD"))
|
|
568 pInfos[curr_rec_num].uTreasureType= 23;
|
|
569 else if ( !_strcmpi(item_name, "DAGGER"))
|
|
570 pInfos[curr_rec_num].uTreasureType= 24;
|
|
571 else if ( !_strcmpi(item_name, "AXE"))
|
|
572 pInfos[curr_rec_num].uTreasureType= 25;
|
|
573 else if ( !_strcmpi(item_name, "SPEAR"))
|
|
574 pInfos[curr_rec_num].uTreasureType= 26;
|
|
575 else if ( !_strcmpi(item_name, "BOW"))
|
|
576 pInfos[curr_rec_num].uTreasureType= 27;
|
|
577 else if ( !_strcmpi(item_name, "MACE"))
|
|
578 pInfos[curr_rec_num].uTreasureType= 28;
|
|
579 else if ( !_strcmpi(item_name, "CLUB"))
|
|
580 pInfos[curr_rec_num].uTreasureType= 29;
|
|
581 else if ( !_strcmpi(item_name, "STAFF"))
|
|
582 pInfos[curr_rec_num].uTreasureType= 30;
|
|
583 else if ( !_strcmpi(item_name, "LEATHER"))
|
|
584 pInfos[curr_rec_num].uTreasureType= 31;
|
|
585 else if ( !_strcmpi(item_name, "CHAIN"))
|
|
586 pInfos[curr_rec_num].uTreasureType= 32;
|
|
587 else if ( !_strcmpi(item_name, "PLATE"))
|
|
588 pInfos[curr_rec_num].uTreasureType= 33;
|
|
589 else if ( !_strcmpi(item_name, "SHIELD"))
|
|
590 pInfos[curr_rec_num].uTreasureType= 34;
|
|
591 else if ( !_strcmpi(item_name, "HELM"))
|
|
592 pInfos[curr_rec_num].uTreasureType= 35;
|
|
593 else if ( !_strcmpi(item_name, "BELT"))
|
|
594 pInfos[curr_rec_num].uTreasureType= 36;
|
|
595 else if ( !_strcmpi(item_name, "CAPE"))
|
|
596 pInfos[curr_rec_num].uTreasureType= 37;
|
|
597 else if ( !_strcmpi(item_name, "GAUNTLETS"))
|
|
598 pInfos[curr_rec_num].uTreasureType= 38;
|
|
599 else if ( !_strcmpi(item_name, "BOOTS"))
|
|
600 pInfos[curr_rec_num].uTreasureType= 39;
|
|
601 else if ( !_strcmpi(item_name, "RING"))
|
|
602 pInfos[curr_rec_num].uTreasureType= 40;
|
|
603 else if ( !_strcmpi(item_name, "AMULET"))
|
|
604 pInfos[curr_rec_num].uTreasureType= 41;
|
|
605 else if ( !_strcmpi(item_name, "WAND"))
|
|
606 pInfos[curr_rec_num].uTreasureType= 42;
|
|
607 else if ( !_strcmpi(item_name, "SCROLL"))
|
|
608 pInfos[curr_rec_num].uTreasureType= 43;
|
|
609 else if ( !_strcmpi(item_name, "GEM"))
|
|
610 pInfos[curr_rec_num].uTreasureType= 46;
|
|
611 }
|
|
612 }
|
|
613
|
|
614 }
|
|
615 break;
|
|
616 case 8:
|
|
617 {
|
|
618 pInfos[curr_rec_num].bQuestMonster=0;
|
|
619 if (atoi(test_string))
|
|
620 pInfos[curr_rec_num].bQuestMonster=1;
|
|
621 }
|
|
622 break;
|
|
623 case 9:
|
|
624 {
|
|
625 pInfos[curr_rec_num].uFlying=false;
|
|
626 if (_strnicmp(test_string, "n",1))
|
|
627 pInfos[curr_rec_num].uFlying=true;
|
|
628 }
|
|
629 break;
|
|
630 case 10:
|
|
631 {
|
|
632 switch(tolower(test_string[0]))
|
|
633 {
|
|
634 case 's': pInfos[curr_rec_num].uMovementType=0;// short
|
|
635 if (tolower(test_string[1])!='h')
|
|
636 pInfos[curr_rec_num].uMovementType=5; //??
|
|
637 break; //short
|
|
638 case 'l': pInfos[curr_rec_num].uMovementType=2; break; //long
|
|
639 case 'm': pInfos[curr_rec_num].uMovementType=1; break; //med
|
|
640 case 'g': pInfos[curr_rec_num].uMovementType=3; break; //???
|
|
641 default:
|
|
642 pInfos[curr_rec_num].uMovementType=4; //free
|
|
643 }
|
|
644 }
|
|
645 break;
|
|
646 case 11:
|
|
647 {
|
|
648 switch(tolower(test_string[0]))
|
|
649 {
|
|
650 case 's': pInfos[curr_rec_num].uAIType=0; break; // suicide
|
|
651 case 'w': pInfos[curr_rec_num].uAIType=1; break; //wimp
|
|
652 case 'n': pInfos[curr_rec_num].uAIType=2; break; //normal
|
|
653 default:
|
|
654 pInfos[curr_rec_num].uAIType=3; //Agress
|
|
655 }
|
|
656 }
|
|
657 break;
|
|
658 case 12:
|
|
659 {
|
|
660 pInfos[curr_rec_num].uHostilityType=(MonsterInfo::HostilityRadius)atoi(test_string);
|
|
661 }
|
|
662 break;
|
|
663 case 13:
|
|
664 {
|
|
665 pInfos[curr_rec_num].uBaseSpeed=atoi(test_string);
|
|
666 }
|
|
667 break;
|
|
668 case 14:
|
|
669 {
|
|
670 pInfos[curr_rec_num].uRecoveryTime=atoi(test_string);
|
|
671 }
|
|
672 break;
|
|
673 case 15:
|
|
674 {
|
|
675 int str_len=0;
|
|
676 int str_pos=0;
|
|
677 pInfos[curr_rec_num].uAttackPreference=0;
|
|
678 pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=0;
|
|
679 str_len=strlen(test_string);
|
|
680 for (str_pos=0;str_pos<str_len;++str_pos )
|
|
681 {
|
|
682 switch(tolower(test_string[str_pos]))
|
|
683 {
|
|
684 case '0': pInfos[curr_rec_num].uAttackPreference|=0x0004; break;
|
|
685 case '2': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=2; break;
|
|
686 case '3': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=3; break;
|
|
687 case '4': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=4; break;
|
|
688 case 'c': pInfos[curr_rec_num].uAttackPreference|=0x0010; break;
|
|
689 case 'd': pInfos[curr_rec_num].uAttackPreference|=0x0008; break;
|
|
690 case 'e': pInfos[curr_rec_num].uAttackPreference|=0x0100; break;
|
|
691 case 'f': pInfos[curr_rec_num].uAttackPreference|=0x0400; break;
|
|
692 case 'h': pInfos[curr_rec_num].uAttackPreference|=0x0800; break;
|
|
693 case 'k': pInfos[curr_rec_num].uAttackPreference|=0x0001; break;
|
|
694 case 'm': pInfos[curr_rec_num].uAttackPreference|=0x0100; break;
|
|
695 case 'o': pInfos[curr_rec_num].uAttackPreference|=0x0400; break;
|
|
696 case 'p': pInfos[curr_rec_num].uAttackPreference|=0x0002; break;
|
|
697 case 'r': pInfos[curr_rec_num].uAttackPreference|=0x0040; break;
|
|
698 case 's': pInfos[curr_rec_num].uAttackPreference|=0x0020; break;
|
|
699 case 't': pInfos[curr_rec_num].uAttackPreference|=0x0080; break;
|
|
700 case 'w': pInfos[curr_rec_num].uAttackPreference|=0x2000; break;
|
|
701 case 'x': pInfos[curr_rec_num].uAttackPreference|=0x0200; break;
|
|
702 case 'l': break;
|
|
703 }
|
|
704 }
|
|
705 }
|
|
706 break;
|
|
707 /* case 16:
|
|
708 {
|
|
709
|
|
710 }
|
|
711 break;
|
|
712 case 17:
|
|
713 {
|
|
714
|
|
715 }
|
|
716 break;
|
|
717 case 18:
|
|
718 {
|
|
719
|
|
720 }
|
|
721 break;
|
|
722 case 19:
|
|
723 {
|
|
724
|
|
725 }
|
|
726 break;
|
|
727 case 20:
|
|
728 {
|
|
729
|
|
730 }
|
|
731 break;
|
|
732 case 21:
|
|
733 {
|
|
734
|
|
735 }
|
|
736 break;
|
|
737 case 22:
|
|
738 {
|
|
739
|
|
740 }
|
|
741 break;
|
|
742 case 23:
|
|
743 {
|
|
744
|
|
745 }
|
|
746 break;
|
|
747 case 24:
|
|
748 {
|
|
749
|
|
750 }
|
|
751 break;
|
|
752 case 25:
|
|
753 {
|
|
754
|
|
755 }
|
|
756 break;
|
|
757 case 26:
|
|
758 {
|
|
759
|
|
760 }
|
|
761 break;
|
|
762 case 27:
|
|
763 {
|
|
764
|
|
765 }
|
|
766 break;
|
|
767 case 28:
|
|
768 {
|
|
769
|
|
770 }
|
|
771 break;
|
|
772 case 29:
|
|
773 {
|
|
774
|
|
775 }
|
|
776 break;
|
|
777 case 30:
|
|
778 {
|
|
779
|
|
780 }
|
|
781 break;
|
|
782 case 31:
|
|
783 {
|
|
784
|
|
785 }
|
|
786 break;
|
|
787 case 32:
|
|
788 {
|
|
789
|
|
790 }
|
|
791 break;
|
|
792 case 33:
|
|
793 {
|
|
794
|
|
795 }
|
|
796 break;
|
|
797 case 34:
|
|
798 {
|
|
799
|
|
800 }
|
|
801 break;
|
|
802 case 35:
|
|
803 {
|
|
804
|
|
805 }
|
|
806 break;
|
|
807 case 36:
|
|
808 {
|
|
809
|
|
810 }
|
|
811 break;
|
|
812 case 37:
|
|
813 {
|
|
814
|
|
815 }
|
|
816 break;
|
|
817 case 38:
|
|
818 {
|
|
819
|
|
820 }
|
|
821 break; */
|
|
822 }
|
|
823 }
|
|
824 else
|
|
825 {
|
|
826 break_loop = true;
|
|
827 }
|
|
828 ++decode_step;
|
|
829 test_string=tmp_pos+1;
|
|
830 } while ((decode_step<39)&&!break_loop);
|
|
831 }
|
|
832 uNumMonsters = i;
|
|
833
|
|
834 /*
|
0
|
835 v103 = 0;
|
|
836 v1->uNumMonsters = 265;
|
|
837 do
|
|
838 {
|
694
|
839 v2 = (int)(strtok(NULL, "\r") + 1);
|
0
|
840 *(_DWORD *)&a3[1] = 0;
|
|
841 v97 = 0;
|
|
842 do
|
|
843 {
|
|
844 v3 = *(_BYTE *)v2;
|
|
845 v4 = 0;
|
|
846 while ( v3 != 9 && v3 )
|
|
847 {
|
|
848 ++v4;
|
|
849 v3 = *(_BYTE *)(v4 + v2);
|
|
850 }
|
|
851 v96 = v4 + v2;
|
|
852 if ( !*(_BYTE *)(v4 + v2) )
|
|
853 v97 = 1;
|
|
854 *(_BYTE *)(v4 + v2) = 0;
|
|
855 if ( v4 )
|
|
856 {
|
|
857 switch ( *(_DWORD *)&a3[1] )
|
|
858 {
|
694
|
859 /* case 0:
|
0
|
860 v103 = atoi((const char *)v2);
|
|
861 v102->pInfos[v103].uID = v103;
|
|
862 goto LABEL_325;
|
|
863 case 2:
|
694
|
864 v102->pInfos[v103].pPictureName = RemoveQuotes((char *)v2);
|
0
|
865 goto LABEL_325;
|
|
866 case 1:
|
|
867 v102->pInfos[v103].pName = RemoveQuotes((char *)v2);
|
|
868 goto LABEL_325;
|
|
869 case 3:
|
|
870 v102->pInfos[v103].uLevel = atoi((const char *)v2);
|
|
871 goto LABEL_325;
|
|
872 case 4:
|
|
873 if ( *(_BYTE *)v2 == 34 )
|
|
874 *(_BYTE *)v2 = 32;
|
|
875 v5 = strlen((const char *)v2);
|
|
876 v6 = 0;
|
|
877 v101 = v5;
|
|
878 if ( (signed int)v5 <= 0 )
|
|
879 goto LABEL_24;
|
|
880 while ( *(_BYTE *)(v6 + v2) != 44 )
|
|
881 {
|
|
882 ++v6;
|
|
883 if ( v6 >= (signed int)v5 )
|
|
884 goto LABEL_24;
|
|
885 }
|
|
886 v7 = v102;
|
|
887 v8 = v103;
|
|
888 *(_BYTE *)(v6 + v2) = 0;
|
|
889 pHP = &v7->pInfos[v8].uHP;
|
|
890 *pHP = 1000 * atoi((const char *)v2);
|
|
891 v83 = (char *)(v6 + v2 + 1);
|
|
892 *(_BYTE *)(v6 + v2) = 44;
|
|
893 *pHP += atoi(v83);
|
|
894 LABEL_24:
|
|
895 if ( v6 == v101 )
|
|
896 v102->pInfos[v103].uHP = atoi((const char *)v2);
|
|
897 goto LABEL_325;
|
|
898 case 5:
|
|
899 v102->pInfos[v103].uAC = atoi((const char *)v2);
|
|
900 goto LABEL_325;
|
|
901 case 6:
|
|
902 if ( *(_BYTE *)v2 == 34 )
|
|
903 *(_BYTE *)v2 = 32;
|
|
904 v10 = strlen((const char *)v2);
|
|
905 v11 = 0;
|
|
906 v101 = v10;
|
|
907 if ( (signed int)v10 <= 0 )
|
|
908 goto LABEL_34;
|
|
909 while ( *(_BYTE *)(v11 + v2) != 44 )
|
|
910 {
|
|
911 ++v11;
|
|
912 if ( v11 >= (signed int)v10 )
|
|
913 goto LABEL_34;
|
|
914 }
|
|
915 v12 = v102;
|
|
916 v13 = v103;
|
|
917 *(_BYTE *)(v11 + v2) = 0;
|
|
918 pExp = &v12->pInfos[v13].uExp;
|
|
919 *pExp = 1000 * atoi((const char *)v2);
|
|
920 v83 = (char *)(v11 + v2 + 1);
|
|
921 *(_BYTE *)(v11 + v2) = 44;
|
|
922 *pExp += atoi(v83);
|
|
923 LABEL_34:
|
|
924 if ( v11 == v101 )
|
|
925 v102->pInfos[v103].uExp = atoi((const char *)v2);
|
|
926 goto LABEL_325;
|
|
927 case 7:
|
|
928 v15 = 0;
|
|
929 a2 = 0;
|
|
930 v100 = 0;
|
|
931 v16 = 0;
|
|
932 v101 = strlen((const char *)v2);
|
|
933 if ( (signed int)v101 <= 0 )
|
|
934 goto LABEL_325;
|
|
935 do
|
|
936 {
|
|
937 v84 = (char *)*(_BYTE *)(v16 + v2);
|
|
938 v17 = tolower((int)v84);
|
|
939 switch ( v17 )
|
|
940 {
|
|
941 case 37:
|
|
942 v15 = 1;
|
|
943 break;
|
|
944 case 100:
|
|
945 v100 = 1;
|
|
946 break;
|
|
947 case 108:
|
|
948 a2 = 1;
|
|
949 break;
|
|
950 }
|
|
951 ++v16;
|
|
952 }
|
|
953 while ( (signed int)v16 < (signed int)v101 );
|
|
954 if ( v15 )
|
|
955 {
|
|
956 v18 = &v102->pInfos[v103];
|
|
957 v18->uTreasureDropChance = atoi((const char *)v2);
|
|
958 }
|
|
959 else
|
|
960 {
|
|
961 if ( !v100 && !a2 )
|
|
962 goto LABEL_325;
|
|
963 v18 = &v102->pInfos[v103];
|
|
964 v18->uTreasureDropChance = 100;
|
|
965 }
|
|
966 if ( v100 )
|
|
967 {
|
|
968 v19 = 0;
|
|
969 v100 = 0;
|
|
970 do
|
|
971 {
|
|
972 v84 = (char *)*(_BYTE *)(v19 + v2);
|
|
973 v20 = tolower((int)v84);
|
|
974 if ( v20 == 37 )
|
|
975 {
|
|
976 v84 = (char *)(v19 + v2 + 1);
|
|
977 v18->uTreasureDiceRolls = atoi(v84);
|
|
978 v100 = 1;
|
|
979 }
|
|
980 else
|
|
981 {
|
|
982 if ( v20 == 100 )
|
|
983 {
|
|
984 if ( !v100 )
|
|
985 v18->uTreasureDiceRolls = atoi((const char *)v2);
|
|
986 v84 = (char *)(v19 + v2 + 1);
|
|
987 v21 = atoi(v84);
|
|
988 v19 = v101;
|
|
989 v18->uTreasureDiceSides = v21;
|
|
990 }
|
|
991 }
|
|
992 ++v19;
|
|
993 }
|
|
994 while ( (signed int)v19 < (signed int)v101 );
|
|
995 }
|
|
996 if ( a2 )
|
|
997 {
|
|
998 v22 = 0;
|
|
999 while ( 1 )
|
|
1000 {
|
|
1001 v84 = (char *)*(_BYTE *)(v22 + v2);
|
|
1002 if ( tolower((int)v84) == 108 )
|
|
1003 break;
|
|
1004 ++v22;
|
|
1005 if ( (signed int)v22 >= (signed int)v101 )
|
|
1006 goto LABEL_325;
|
|
1007 }
|
|
1008 v23 = *(_BYTE *)(v22 + v2 + 1);
|
|
1009 v24 = (const char *)(v22 + v2 + 2);
|
|
1010 v18->uTreasureLevel = v23 - 48;
|
|
1011 if ( *v24 )
|
|
1012 {
|
|
1013 if ( _strcmpi(v24, "WEAPON") )
|
|
1014 {
|
|
1015 if ( _strcmpi(v24, "ARMOR") )
|
|
1016 {
|
|
1017 if ( _strcmpi(v24, "MISC") )
|
|
1018 {
|
|
1019 if ( _strcmpi(v24, "SWORD") )
|
|
1020 {
|
|
1021 if ( _strcmpi(v24, "DAGGER") )
|
|
1022 {
|
|
1023 if ( _strcmpi(v24, "AXE") )
|
|
1024 {
|
|
1025 if ( _strcmpi(v24, "SPEAR") )
|
|
1026 {
|
|
1027 if ( _strcmpi(v24, "BOW") )
|
|
1028 {
|
|
1029 if ( _strcmpi(v24, "MACE") )
|
|
1030 {
|
|
1031 if ( _strcmpi(v24, "CLUB") )
|
|
1032 {
|
|
1033 if ( _strcmpi(v24, "STAFF") )
|
|
1034 {
|
|
1035 if ( _strcmpi(v24, "LEATHER") )
|
|
1036 {
|
|
1037 if ( _strcmpi(v24, "CHAIN") )
|
|
1038 {
|
|
1039 if ( _strcmpi(v24, "PLATE") )
|
|
1040 {
|
|
1041 if ( _strcmpi(v24, "SHIELD") )
|
|
1042 {
|
|
1043 if ( _strcmpi(v24, "HELM") )
|
|
1044 {
|
|
1045 if ( _strcmpi(v24, "BELT") )
|
|
1046 {
|
|
1047 if ( _strcmpi(v24, "CAPE") )
|
|
1048 {
|
|
1049 if ( _strcmpi(v24, "GAUNTLETS") )
|
|
1050 {
|
|
1051 if ( _strcmpi(v24, "BOOTS") )
|
|
1052 {
|
|
1053 if ( _strcmpi(v24, "RING") )
|
|
1054 {
|
|
1055 if ( _strcmpi(v24, "AMULET") )
|
|
1056 {
|
|
1057 if ( _strcmpi(v24, "WAND") )
|
|
1058 {
|
|
1059 if ( _strcmpi(v24, "SCROLL") )
|
|
1060 {
|
|
1061 if ( !_strcmpi(v24, "GEM") )
|
|
1062 v18->uTreasureType = 46;
|
|
1063 }
|
|
1064 else
|
|
1065 {
|
|
1066 v18->uTreasureType = 43;
|
|
1067 }
|
|
1068 }
|
|
1069 else
|
|
1070 {
|
|
1071 v18->uTreasureType = 42;
|
|
1072 }
|
|
1073 }
|
|
1074 else
|
|
1075 {
|
|
1076 v18->uTreasureType = 41;
|
|
1077 }
|
|
1078 }
|
|
1079 else
|
|
1080 {
|
|
1081 v18->uTreasureType = 40;
|
|
1082 }
|
|
1083 }
|
|
1084 else
|
|
1085 {
|
|
1086 v18->uTreasureType = 39;
|
|
1087 }
|
|
1088 }
|
|
1089 else
|
|
1090 {
|
|
1091 v18->uTreasureType = 38;
|
|
1092 }
|
|
1093 }
|
|
1094 else
|
|
1095 {
|
|
1096 v18->uTreasureType = 37;
|
|
1097 }
|
|
1098 }
|
|
1099 else
|
|
1100 {
|
|
1101 v18->uTreasureType = 36;
|
|
1102 }
|
|
1103 }
|
|
1104 else
|
|
1105 {
|
|
1106 v18->uTreasureType = 35;
|
|
1107 }
|
|
1108 }
|
|
1109 else
|
|
1110 {
|
|
1111 v18->uTreasureType = 34;
|
|
1112 }
|
|
1113 }
|
|
1114 else
|
|
1115 {
|
|
1116 v18->uTreasureType = 33;
|
|
1117 }
|
|
1118 }
|
|
1119 else
|
|
1120 {
|
|
1121 v18->uTreasureType = 32;
|
|
1122 }
|
|
1123 }
|
|
1124 else
|
|
1125 {
|
|
1126 v18->uTreasureType = 31;
|
|
1127 }
|
|
1128 }
|
|
1129 else
|
|
1130 {
|
|
1131 v18->uTreasureType = 30;
|
|
1132 }
|
|
1133 }
|
|
1134 else
|
|
1135 {
|
|
1136 v18->uTreasureType = 29;
|
|
1137 }
|
|
1138 }
|
|
1139 else
|
|
1140 {
|
|
1141 v18->uTreasureType = 28;
|
|
1142 }
|
|
1143 }
|
|
1144 else
|
|
1145 {
|
|
1146 v18->uTreasureType = 27;
|
|
1147 }
|
|
1148 }
|
|
1149 else
|
|
1150 {
|
|
1151 v18->uTreasureType = 26;
|
|
1152 }
|
|
1153 }
|
|
1154 else
|
|
1155 {
|
|
1156 v18->uTreasureType = 25;
|
|
1157 }
|
|
1158 }
|
|
1159 else
|
|
1160 {
|
|
1161 v18->uTreasureType = 24;
|
|
1162 }
|
|
1163 }
|
|
1164 else
|
|
1165 {
|
|
1166 v18->uTreasureType = 23;
|
|
1167 }
|
|
1168 }
|
|
1169 else
|
|
1170 {
|
|
1171 v18->uTreasureType = 22;
|
|
1172 }
|
|
1173 }
|
|
1174 else
|
|
1175 {
|
|
1176 v18->uTreasureType = 21;
|
|
1177 }
|
|
1178 }
|
|
1179 else
|
|
1180 {
|
|
1181 v18->uTreasureType = 20;
|
|
1182 }
|
|
1183 }
|
|
1184 }
|
|
1185 goto LABEL_325;
|
|
1186 case 8:
|
|
1187 v84 = (char *)v2;
|
|
1188 v25 = &v102->pInfos[v103].bQuestMonster;
|
|
1189 *v25 = 0;
|
|
1190 if ( atoi(v84) )
|
|
1191 *(_BYTE *)v25 |= 1u;
|
|
1192 goto LABEL_325;
|
|
1193 case 9:
|
|
1194 v102->pInfos[v103].uFlying = _strnicmp((const char *)v2, "n", 1u);
|
|
1195 goto LABEL_325;
|
|
1196 case 0xA:
|
|
1197 v84 = (char *)*(_BYTE *)v2;
|
|
1198 v101 = 4;
|
|
1199 if ( tolower((int)v84) == 's' )
|
|
1200 {
|
|
1201 v84 = (char *)*(_BYTE *)(v2 + 1);
|
|
1202 v26 = tolower((int)v84) != 'h' ? 5 : 0;
|
|
1203 }
|
|
1204 else
|
|
1205 {
|
|
1206 v84 = (char *)*(_BYTE *)v2;
|
|
1207 if ( tolower((int)v84) == 'm' )
|
|
1208 {
|
|
1209 v101 = 1;
|
|
1210 }
|
|
1211 else
|
|
1212 {
|
|
1213 v84 = (char *)*(_BYTE *)v2;
|
|
1214 if ( tolower((int)v84) == 'l' )
|
|
1215 {
|
|
1216 v101 = 2;
|
|
1217 }
|
|
1218 else
|
|
1219 {
|
|
1220 v84 = (char *)*(_BYTE *)v2;
|
|
1221 if ( tolower((int)v84) == 'g' )
|
|
1222 v101 = 3;
|
|
1223 }
|
|
1224 }
|
|
1225 LOBYTE(v26) = v101;
|
|
1226 }
|
|
1227 v102->pInfos[v103].uMovementType = v26;
|
|
1228 goto LABEL_325;
|
|
1229 case 0xB:
|
|
1230 v84 = (char *)*(_BYTE *)v2;
|
|
1231 v101 = 3;
|
|
1232 if ( tolower((int)v84) == 's' )
|
|
1233 {
|
|
1234 v101 = 0;
|
|
1235 }
|
|
1236 else
|
|
1237 {
|
|
1238 v84 = (char *)*(_BYTE *)v2;
|
|
1239 if ( tolower((int)v84) == 'w' )
|
|
1240 {
|
|
1241 v101 = 1;
|
|
1242 }
|
|
1243 else
|
|
1244 {
|
|
1245 v84 = (char *)*(_BYTE *)v2;
|
|
1246 if ( tolower((int)v84) == 'n' )
|
|
1247 v101 = 2;
|
|
1248 }
|
|
1249 }
|
|
1250 v102->pInfos[v103].uAIType = v101;
|
|
1251 goto LABEL_325;
|
|
1252 case 0xC:
|
|
1253 v102->pInfos[v103].uHostilityType = (MonsterInfo::HostilityRadius)atoi((const char *)v2);
|
|
1254 goto LABEL_325;
|
|
1255 case 0xD:
|
|
1256 v102->pInfos[v103].uBaseSpeed = atoi((const char *)v2);
|
|
1257 goto LABEL_325;
|
|
1258 case 0xF:
|
|
1259 v27 = strlen((const char *)v2);
|
|
1260 v100 = 0;
|
|
1261 v101 = v27;
|
|
1262 if ( (signed int)v27 > 0 )
|
|
1263 {
|
|
1264 v28 = v103;
|
|
1265 v29 = v102;
|
|
1266 do
|
|
1267 {
|
|
1268 v84 = (char *)*(_BYTE *)(v100 + v2);
|
|
1269 v30 = tolower((int)v84);
|
|
1270 if ( v30 > 107 )
|
|
1271 {
|
|
1272 if ( v30 > 115 )
|
|
1273 {
|
|
1274 v40 = v30 - 116;
|
|
1275 if ( v40 )
|
|
1276 {
|
|
1277 v41 = v40 - 3;
|
|
1278 if ( v41 )
|
|
1279 {
|
|
1280 if ( v41 == 1 )
|
|
1281 BYTE1(v29->pInfos[v28].uAttackPreference) |= 2u;
|
|
1282 }
|
|
1283 else
|
|
1284 {
|
|
1285 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x20u;
|
|
1286 }
|
|
1287 }
|
|
1288 else
|
|
1289 {
|
|
1290 LOBYTE(v29->pInfos[v28].uAttackPreference) |= 0x80u;
|
|
1291 }
|
|
1292 }
|
|
1293 else
|
|
1294 {
|
|
1295 if ( v30 == 115 )
|
|
1296 {
|
|
1297 v29->pInfos[v28].uAttackPreference |= 0x20u;
|
|
1298 }
|
|
1299 else
|
|
1300 {
|
|
1301 v37 = v30 - 109;
|
|
1302 if ( v37 )
|
|
1303 {
|
|
1304 v38 = v37 - 2;
|
|
1305 if ( v38 )
|
|
1306 {
|
|
1307 v39 = v38 - 1;
|
|
1308 if ( v39 )
|
|
1309 {
|
|
1310 if ( v39 == 2 )
|
|
1311 v29->pInfos[v28].uAttackPreference |= 0x40u;
|
|
1312 }
|
|
1313 else
|
|
1314 {
|
|
1315 v29->pInfos[v28].uAttackPreference |= 2u;
|
|
1316 }
|
|
1317 }
|
|
1318 else
|
|
1319 {
|
|
1320 BYTE1(v29->pInfos[v28].uAttackPreference) |= 4u;
|
|
1321 }
|
|
1322 }
|
|
1323 else
|
|
1324 {
|
|
1325 BYTE1(v29->pInfos[v28].uAttackPreference) |= 1u;
|
|
1326 }
|
|
1327 }
|
|
1328 }
|
|
1329 }
|
|
1330 else
|
|
1331 {
|
|
1332 if ( v30 == 107 )
|
|
1333 {
|
|
1334 v29->pInfos[v28].uAttackPreference |= 1u;
|
|
1335 }
|
|
1336 else
|
|
1337 {
|
|
1338 if ( v30 > 99 )
|
|
1339 {
|
|
1340 v34 = v30 - 100;
|
|
1341 if ( v34 )
|
|
1342 {
|
|
1343 v35 = v34 - 1;
|
|
1344 if ( v35 )
|
|
1345 {
|
|
1346 v36 = v35 - 2;
|
|
1347 if ( v36 )
|
|
1348 {
|
|
1349 if ( v36 == 1 )
|
|
1350 BYTE1(v29->pInfos[v28].uAttackPreference) |= 8u;
|
|
1351 }
|
|
1352 else
|
|
1353 {
|
|
1354 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x40u;
|
|
1355 }
|
|
1356 }
|
|
1357 else
|
|
1358 {
|
|
1359 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x10u;
|
|
1360 }
|
|
1361 }
|
|
1362 else
|
|
1363 {
|
|
1364 v29->pInfos[v28].uAttackPreference |= 8u;
|
|
1365 }
|
|
1366 }
|
|
1367 else
|
|
1368 {
|
|
1369 if ( v30 == 99 )
|
|
1370 {
|
|
1371 v29->pInfos[v28].uAttackPreference |= 0x10u;
|
|
1372 }
|
|
1373 else
|
|
1374 {
|
|
1375 v31 = v30 - 50;
|
|
1376 if ( v31 )
|
|
1377 {
|
|
1378 v32 = v31 - 1;
|
|
1379 if ( v32 )
|
|
1380 {
|
|
1381 v33 = v32 - 1;
|
|
1382 if ( v33 )
|
|
1383 {
|
|
1384 if ( v33 == 45 )
|
|
1385 v29->pInfos[v28].uAttackPreference |= 4u;
|
|
1386 }
|
|
1387 else
|
|
1388 {
|
|
1389 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 4;
|
|
1390 }
|
|
1391 }
|
|
1392 else
|
|
1393 {
|
|
1394 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 3;
|
|
1395 }
|
|
1396 }
|
|
1397 else
|
|
1398 {
|
|
1399 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 2;
|
|
1400 }
|
|
1401 }
|
|
1402 }
|
|
1403 }
|
|
1404 }
|
|
1405 ++v100;
|
|
1406 }
|
|
1407 while ( v100 < (signed int)v101 );
|
|
1408 }
|
|
1409 goto LABEL_325;
|
|
1410 case 0xE:
|
|
1411 v102->pInfos[v103].uRecoveryTime = atoi((const char *)v2);
|
|
1412 goto LABEL_325;
|
|
1413 case 0x10:
|
|
1414 v42 = strlen((const char *)v2);
|
|
1415 v43 = 0;
|
|
1416 v44 = &v102->pInfos[v103];
|
|
1417 v100 = v42;
|
|
1418 v44->uSpecialAttackType = 1;
|
|
1419 if ( (signed int)v42 <= 0 )
|
|
1420 goto LABEL_185;
|
|
1421 break;
|
|
1422 case 0x11:
|
|
1423 v102->pInfos[v103].uAttack1Type = ParseAttackType((unsigned __int8 *)v2);
|
|
1424 goto LABEL_325;
|
|
1425 case 0x12:
|
|
1426 v46 = &v102->pInfos[v103];
|
|
1427 v47 = (char *)&v46->uAttack1DamageDiceRolls;
|
|
1428 v84 = (char *)&v46->uAttack1DamageBonus;
|
|
1429 v48 = (char *)&v46->uAttack1DamageDiceSides;
|
|
1430 goto LABEL_237;
|
|
1431 case 0x13:
|
|
1432 v102->pInfos[v103].uMissleAttack1Type = ParseMissleAttackType((const char *)v2);
|
|
1433 goto LABEL_325;
|
|
1434 case 0x14:
|
|
1435 v102->pInfos[v103].uAttack2Chance = atoi((const char *)v2);
|
|
1436 goto LABEL_325;
|
|
1437 case 0x15:
|
|
1438 v102->pInfos[v103].uAttack2Type = ParseAttackType((unsigned __int8 *)v2);
|
|
1439 goto LABEL_325;
|
|
1440 case 0x16:
|
|
1441 v49 = &v102->pInfos[v103];
|
|
1442 v47 = (char *)&v49->uAttack2DamageDiceRolls;
|
|
1443 v84 = (char *)&v49->uAttack2DamageBonus;
|
|
1444 v48 = (char *)&v49->uAttack2DamageDiceSides;
|
|
1445 LABEL_237:
|
|
1446 ParseDamage((const char *)v2, (int)v47, (int)v48, (int)v84);
|
|
1447 goto LABEL_325;
|
|
1448 case 0x17:
|
|
1449 v102->pInfos[v103].uMissleAttack2Type = ParseMissleAttackType((const char *)v2);
|
|
1450 goto LABEL_325;
|
|
1451 case 0x18:
|
|
1452 v102->pInfos[v103].uSpell1UseChance = atoi((const char *)v2);
|
|
1453 goto LABEL_325;
|
|
1454 case 0x19:
|
|
1455 strcpy(Str, (const char *)v2);
|
|
1456 Str[0] = ' ';
|
|
1457 Str[strlen(Str) - 1] = ' ';
|
|
1458 v50 = texture_frame_table_txt_parser(Str, &v87);
|
|
1459 v51 = 88 * v103;
|
|
1460 memcpy(&v90, v50, sizeof(v90));
|
|
1461 if ( v90.field_0 >= 3 )
|
|
1462 {
|
|
1463 v53 = (int)((char *)v102 + v51);
|
|
1464 a2 = 1;
|
|
1465 v102->pInfos[v51 / 0x58u].uSpell1ID = ParseSpellType(&v90, (int)&a2);
|
|
1466 v54 = a2;
|
|
1467 v84 = (char *)v90.pProperties[a2 + 1];
|
|
1468 v55 = atoi(v84);
|
|
1469 v56 = (char *)v90.pProperties[v54];
|
|
1470 v84 = "E";
|
|
1471 v83 = v56;
|
|
1472 *(_WORD *)(v53 + 56) = v55 & 0x3F;
|
|
1473 if ( _strcmpi(v83, v84) )
|
|
1474 {
|
|
1475 if ( _strcmpi(v56, "M") )
|
|
1476 {
|
|
1477 if ( !_strcmpi(v56, "G") )
|
|
1478 *(_BYTE *)(v53 + 57) |= 1u;
|
|
1479 }
|
|
1480 else
|
|
1481 {
|
|
1482 *(_BYTE *)(v53 + 56) |= 0x80u;
|
|
1483 }
|
|
1484 }
|
|
1485 else
|
|
1486 {
|
|
1487 *(_BYTE *)(v53 + 56) |= 0x40u;
|
|
1488 }
|
|
1489 }
|
|
1490 else
|
|
1491 {
|
|
1492 v52 = (int)((char *)v102 + v51);
|
|
1493 *(_BYTE *)(v52 + 33) = 0;
|
|
1494 *(_WORD *)(v52 + 56) = 0;
|
|
1495 }
|
|
1496 goto LABEL_325;
|
|
1497 case 0x1A:
|
|
1498 v102->pInfos[v103].uSpell2UseChance = atoi((const char *)v2);
|
|
1499 goto LABEL_325;
|
186
|
1500
|
0
|
1501 case 0x1B:
|
|
1502 strcpy(Dest, (const char *)v2);
|
|
1503 Dest[0] = ' ';
|
|
1504 Dest[strlen(Dest) - 1] = ' ';
|
|
1505 v57 = texture_frame_table_txt_parser(Dest, &v86);
|
|
1506 v58 = v103;
|
|
1507 memcpy(&v89, v57, sizeof(v89));
|
|
1508 if ( v89.field_0 >= 3 )
|
|
1509 {
|
|
1510 v60 = &v102->pInfos[v58];
|
|
1511 a2 = 1;
|
|
1512 v102->pInfos[v58].uSpell2ID = ParseSpellType(&v89, (int)&a2);
|
|
1513 v61 = a2;
|
|
1514 v84 = (char *)v89.pProperties[a2 + 1];
|
|
1515 v62 = atoi(v84);
|
|
1516 v63 = (char *)v89.pProperties[v61];
|
|
1517 v84 = "E";
|
|
1518 v83 = v63;
|
|
1519 v60->uSpellSkillAndMastery2 = v62 & 0x3F;
|
|
1520 if ( _strcmpi(v83, v84) )
|
|
1521 {
|
|
1522 if ( _strcmpi(v63, "M") )
|
|
1523 {
|
|
1524 if ( !_strcmpi(v63, "G") )
|
|
1525 HIBYTE(v60->uSpellSkillAndMastery2) |= 1u;
|
|
1526 }
|
|
1527 else
|
|
1528 {
|
|
1529 LOBYTE(v60->uSpellSkillAndMastery2) |= 0x80u;
|
|
1530 }
|
|
1531 }
|
|
1532 else
|
|
1533 {
|
|
1534 LOBYTE(v60->uSpellSkillAndMastery2) |= 0x40u;
|
|
1535 }
|
|
1536 }
|
|
1537 else
|
|
1538 {
|
|
1539 v59 = &v102->pInfos[v58];
|
|
1540 v59->uSpell2ID = 0;
|
|
1541 v59->uSpellSkillAndMastery2 = 0;
|
|
1542 }
|
|
1543 goto LABEL_325;
|
|
1544 case 0x1C:
|
|
1545 v84 = (char *)*(_BYTE *)v2;
|
|
1546 if ( tolower((int)v84) == 'i' )
|
|
1547 v64 = 200;
|
|
1548 else
|
|
1549 v64 = atoi((const char *)v2);
|
|
1550 v102->pInfos[v103].uResFire = v64;
|
|
1551 goto LABEL_325;
|
|
1552 case 0x1D:
|
|
1553 v84 = (char *)*(_BYTE *)v2;
|
|
1554 if ( tolower((int)v84) == 'i' )
|
|
1555 v65 = 200;
|
|
1556 else
|
|
1557 v65 = atoi((const char *)v2);
|
|
1558 v102->pInfos[v103].uResAir = v65;
|
|
1559 goto LABEL_325;
|
|
1560 case 0x1E:
|
|
1561 v84 = (char *)*(_BYTE *)v2;
|
|
1562 if ( tolower((int)v84) == 'i' )
|
|
1563 v66 = 200;
|
|
1564 else
|
|
1565 v66 = atoi((const char *)v2);
|
|
1566 v102->pInfos[v103].uResWater = v66;
|
|
1567 goto LABEL_325;
|
|
1568 case 0x1F:
|
|
1569 v84 = (char *)*(_BYTE *)v2;
|
|
1570 if ( tolower((int)v84) == 'i' )
|
|
1571 v67 = 200;
|
|
1572 else
|
|
1573 v67 = atoi((const char *)v2);
|
|
1574 v102->pInfos[v103].uResEarth = v67;
|
|
1575 goto LABEL_325;
|
|
1576 case 0x20:
|
|
1577 v84 = (char *)*(_BYTE *)v2;
|
|
1578 if ( tolower((int)v84) == 'i' )
|
|
1579 v68 = 200;
|
|
1580 else
|
|
1581 v68 = atoi((const char *)v2);
|
|
1582 v102->pInfos[v103].uResMind = v68;
|
|
1583 goto LABEL_325;
|
|
1584 case 0x21:
|
|
1585 v84 = (char *)*(_BYTE *)v2;
|
|
1586 if ( tolower((int)v84) == 'i' )
|
|
1587 v69 = 200;
|
|
1588 else
|
|
1589 v69 = atoi((const char *)v2);
|
|
1590 v102->pInfos[v103].uResSpirit = v69;
|
|
1591 goto LABEL_325;
|
|
1592 case 0x22:
|
|
1593 v84 = (char *)*(_BYTE *)v2;
|
|
1594 if ( tolower((int)v84) == 'i' )
|
|
1595 v70 = 200;
|
|
1596 else
|
|
1597 v70 = atoi((const char *)v2);
|
|
1598 v102->pInfos[v103].uResBody = v70;
|
|
1599 goto LABEL_325;
|
|
1600 case 0x23:
|
|
1601 v84 = (char *)*(_BYTE *)v2;
|
|
1602 if ( tolower((int)v84) == 'i' )
|
|
1603 v71 = 200;
|
|
1604 else
|
|
1605 v71 = atoi((const char *)v2);
|
|
1606 v102->pInfos[v103].uResLight = v71;
|
|
1607 goto LABEL_325;
|
|
1608 case 0x24:
|
|
1609 v84 = (char *)*(_BYTE *)v2;
|
|
1610 if ( tolower((int)v84) == 'i' )
|
|
1611 v72 = 200;
|
|
1612 else
|
|
1613 v72 = atoi((const char *)v2);
|
|
1614 v102->pInfos[v103].uResDark = v72;
|
|
1615 goto LABEL_325;
|
|
1616 case 0x25:
|
|
1617 v84 = (char *)*(_BYTE *)v2;
|
|
1618 if ( tolower((int)v84) == 'i' )
|
|
1619 v73 = 200;
|
|
1620 else
|
|
1621 v73 = atoi((const char *)v2);
|
|
1622 v102->pInfos[v103].uResPhysical = v73;
|
|
1623 goto LABEL_325;
|
|
1624 case 0x26:
|
|
1625 strcpy(v93, (const char *)v2);
|
|
1626 v93[0] = ' ';
|
|
1627 v93[strlen(v93) - 1] = ' ';
|
|
1628 memcpy(&v94, texture_frame_table_txt_parser(v93, &v85), sizeof(v94));
|
|
1629 if ( v94.field_0 )
|
|
1630 {
|
|
1631 v74 = v94.field_0;
|
|
1632 if ( v94.field_0 < 10 )
|
|
1633 {
|
|
1634 if ( _strcmpi(v94.pProperties[0], "shot") )
|
|
1635 {
|
|
1636 if ( _strcmpi(v94.pProperties[0], "summon") )
|
|
1637 {
|
|
1638 if ( !_strcmpi(v94.pProperties[0], "explode") )
|
|
1639 {
|
|
1640 v79 = &v102->pInfos[v103];
|
|
1641 v80 = v94.pProperties[1];
|
|
1642 v84 = (char *)&v79->uSpecialAbilityDamageDiceBonus;
|
|
1643 v83 = (char *)&v79->uSpecialAbilityDamageDiceSides;
|
|
1644 v79->uSpecialAbilityType = 3;
|
|
1645 ParseDamage(v80, (int)&v79->uSpecialAbilityDamageDiceRolls, (int)v83, (int)v84);
|
|
1646 v79->field_3C_some_special_attack = ParseAttackType((unsigned __int8 *)v2);
|
|
1647 }
|
|
1648 }
|
|
1649 else
|
|
1650 {
|
|
1651 v76 = &v102->pInfos[v103];
|
|
1652 v76->uSpecialAbilityType = 2;
|
|
1653 if ( v74 > 1 )
|
|
1654 {
|
|
1655 pTmpBuf[0] = 0;
|
|
1656 strcpy(pTmpBuf, v94.pProperties[2]);
|
|
1657 if ( v74 > 2 )
|
|
1658 {
|
|
1659 v100 = 3;
|
|
1660 if ( v74 > 3 )
|
|
1661 {
|
|
1662 do
|
|
1663 {
|
|
1664 strcat(pTmpBuf, " ");
|
|
1665 v77 = (char **)v94.pProperties[v100];
|
|
1666 v82 = v94.pProperties[v100];
|
|
1667 strcat(pTmpBuf, v82);
|
|
1668 if ( v100 == v94.field_0 - 1 )
|
|
1669 {
|
|
1670 v84 = (char *)*(_BYTE *)v77;
|
|
1671 if ( tolower((int)v84) == 'a' )
|
|
1672 {
|
|
1673 v76->uSpecialAbilityDamageDiceRolls = 1;
|
|
1674 }
|
|
1675 else
|
|
1676 {
|
|
1677 v84 = (char *)*(_BYTE *)v77;
|
|
1678 if ( tolower((int)v84) == 'b' )
|
|
1679 {
|
|
1680 v76->uSpecialAbilityDamageDiceRolls = 2;
|
|
1681 }
|
|
1682 else
|
|
1683 {
|
|
1684 v84 = (char *)*(_BYTE *)v77;
|
|
1685 if ( tolower((int)v84) == 'c' )
|
|
1686 v76->uSpecialAbilityDamageDiceRolls = 3;
|
|
1687 else
|
|
1688 v76->uSpecialAbilityDamageDiceRolls = 0;
|
|
1689 }
|
|
1690 }
|
|
1691 }
|
|
1692 ++v100;
|
|
1693 }
|
|
1694 while ( v100 < v94.field_0 );
|
|
1695 }
|
|
1696 }
|
|
1697 else
|
|
1698 {
|
|
1699 v76->uSpecialAbilityDamageDiceRolls = 0;
|
|
1700 }
|
|
1701 if ( pMonsterList->uNumMonsters )
|
|
1702 {
|
|
1703 v78 = pMonsterList->GetMonsterByName(pTmpBuf) + 1;
|
|
1704 v76->field_3C_some_special_attack = v78;
|
|
1705 if ( v78 == -1 )
|
|
1706 {
|
|
1707 sprintf(Src, "Can't create random monster: '%s' See MapStats!", Src);
|
|
1708 MessageBoxA(nullptr, Src, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:2239", 0);
|
|
1709 }
|
|
1710 }
|
|
1711 v76->uSpecialAbilityDamageDiceSides = 0;
|
|
1712 if ( !_strcmpi(v94.pProperties[1], "ground") )
|
|
1713 v76->uSpecialAbilityDamageDiceSides = 1;
|
|
1714 if ( v76->field_3C_some_special_attack == -1 )
|
|
1715 v76->uSpecialAbilityType = 0;
|
|
1716 }
|
|
1717 }
|
|
1718 }
|
|
1719 else
|
|
1720 {
|
|
1721 v75 = &v102->pInfos[v103];
|
|
1722 v84 = (char *)(v94.pProperties[1] + 1);
|
|
1723 v75->uSpecialAbilityType = 1;
|
|
1724 v75->uSpecialAbilityDamageDiceBonus = atoi(v84);
|
|
1725 }
|
|
1726 }
|
|
1727 }
|
|
1728 goto LABEL_325;
|
|
1729 default:
|
|
1730 goto LABEL_325;
|
|
1731 }
|
|
1732 while ( 1 )
|
|
1733 {
|
|
1734 v84 = (char *)*(_BYTE *)(v43 + v2);
|
|
1735 if ( tolower((int)v84) == 'x' )
|
|
1736 break;
|
|
1737 ++v43;
|
|
1738 if ( v43 >= v100 )
|
|
1739 goto LABEL_185;
|
|
1740 }
|
|
1741 v45 = v2 + v43;
|
|
1742 *(_BYTE *)v45 = 0;
|
|
1743 v44->uSpecialAttackType = atoi((const char *)(v45 + 1));
|
|
1744 *(_BYTE *)v45 = 100;
|
|
1745 LABEL_185:
|
|
1746 _strlwr((char *)v2);
|
|
1747 if ( strstr((const char *)v2, "curse") )
|
|
1748 {
|
|
1749 v44->uSpecialAttack = 1;
|
|
1750 }
|
|
1751 else
|
|
1752 {
|
|
1753 if ( strstr((const char *)v2, "weak") )
|
|
1754 {
|
|
1755 v44->uSpecialAttack = 2;
|
|
1756 }
|
|
1757 else
|
|
1758 {
|
|
1759 if ( strstr((const char *)v2, "asleep") )
|
|
1760 {
|
|
1761 v44->uSpecialAttack = 3;
|
|
1762 }
|
|
1763 else
|
|
1764 {
|
|
1765 if ( strstr((const char *)v2, "afraid") )
|
|
1766 {
|
|
1767 v44->uSpecialAttack = 23;
|
|
1768 }
|
|
1769 else
|
|
1770 {
|
|
1771 if ( strstr((const char *)v2, "drunk") )
|
|
1772 {
|
|
1773 v44->uSpecialAttack = 4;
|
|
1774 }
|
|
1775 else
|
|
1776 {
|
|
1777 if ( strstr((const char *)v2, "insane") )
|
|
1778 {
|
|
1779 v44->uSpecialAttack = 5;
|
|
1780 }
|
|
1781 else
|
|
1782 {
|
|
1783 if ( strstr((const char *)v2, "poison1") )
|
|
1784 {
|
|
1785 v44->uSpecialAttack = 6;
|
|
1786 }
|
|
1787 else
|
|
1788 {
|
|
1789 if ( strstr((const char *)v2, "poison2") )
|
|
1790 {
|
|
1791 v44->uSpecialAttack = 7;
|
|
1792 }
|
|
1793 else
|
|
1794 {
|
|
1795 if ( strstr((const char *)v2, "poison3") )
|
|
1796 {
|
|
1797 v44->uSpecialAttack = 8;
|
|
1798 }
|
|
1799 else
|
|
1800 {
|
|
1801 if ( strstr((const char *)v2, "disease1") )
|
|
1802 {
|
|
1803 v44->uSpecialAttack = 9;
|
|
1804 }
|
|
1805 else
|
|
1806 {
|
|
1807 if ( strstr((const char *)v2, "disease2") )
|
|
1808 {
|
|
1809 v44->uSpecialAttack = 10;
|
|
1810 }
|
|
1811 else
|
|
1812 {
|
|
1813 if ( strstr((const char *)v2, "disease3") )
|
|
1814 {
|
|
1815 v44->uSpecialAttack = 11;
|
|
1816 }
|
|
1817 else
|
|
1818 {
|
|
1819 if ( strstr((const char *)v2, "paralyze") )
|
|
1820 {
|
|
1821 v44->uSpecialAttack = 12;
|
|
1822 }
|
|
1823 else
|
|
1824 {
|
|
1825 if ( strstr((const char *)v2, "uncon") )
|
|
1826 {
|
|
1827 v44->uSpecialAttack = 13;
|
|
1828 }
|
|
1829 else
|
|
1830 {
|
|
1831 if ( strstr((const char *)v2, "dead") )
|
|
1832 {
|
|
1833 v44->uSpecialAttack = 14;
|
|
1834 }
|
|
1835 else
|
|
1836 {
|
|
1837 if ( strstr((const char *)v2, "stone") )
|
|
1838 {
|
|
1839 v44->uSpecialAttack = 15;
|
|
1840 }
|
|
1841 else
|
|
1842 {
|
|
1843 if ( strstr((const char *)v2, "errad") )
|
|
1844 {
|
|
1845 v44->uSpecialAttack = 16;
|
|
1846 }
|
|
1847 else
|
|
1848 {
|
|
1849 if ( strstr((const char *)v2, "brkitem") )
|
|
1850 {
|
|
1851 v44->uSpecialAttack = 17;
|
|
1852 }
|
|
1853 else
|
|
1854 {
|
|
1855 if ( strstr((const char *)v2, "brkarmor") )
|
|
1856 {
|
|
1857 v44->uSpecialAttack = 18;
|
|
1858 }
|
|
1859 else
|
|
1860 {
|
|
1861 if ( strstr((const char *)v2, "brkweapon") )
|
|
1862 {
|
|
1863 v44->uSpecialAttack = 19;
|
|
1864 }
|
|
1865 else
|
|
1866 {
|
|
1867 if ( strstr((const char *)v2, "steal") )
|
|
1868 {
|
|
1869 v44->uSpecialAttack = 20;
|
|
1870 }
|
|
1871 else
|
|
1872 {
|
|
1873 if ( strstr((const char *)v2, "age") )
|
|
1874 {
|
|
1875 v44->uSpecialAttack = 21;
|
|
1876 }
|
|
1877 else
|
|
1878 {
|
|
1879 if ( strstr((const char *)v2, "drainsp") )
|
|
1880 v44->uSpecialAttack = 22;
|
|
1881 }
|
|
1882 }
|
|
1883 }
|
|
1884 }
|
|
1885 }
|
|
1886 }
|
|
1887 }
|
|
1888 }
|
|
1889 }
|
|
1890 }
|
|
1891 }
|
|
1892 }
|
|
1893 }
|
|
1894 }
|
|
1895 }
|
|
1896 }
|
|
1897 }
|
|
1898 }
|
|
1899 }
|
|
1900 }
|
|
1901 }
|
|
1902 }
|
|
1903 }
|
|
1904 else
|
|
1905 {
|
|
1906 v97 = 1;
|
|
1907 }
|
|
1908 LABEL_325:
|
|
1909 ++*(_DWORD *)&a3[1];
|
|
1910 v2 = v96 + 1;
|
|
1911 }
|
|
1912 while ( *(_DWORD *)&a3[1] - 1 <= (signed int)v102->uNumMonsters && !v97 );
|
|
1913 ++v103;
|
|
1914 }
|
|
1915 while ( v103 < 265 );
|
|
1916 v102->uNumMonsters = v103;
|
694
|
1917 */
|
0
|
1918 }
|
|
1919
|
|
1920
|
|
1921
|
|
1922
|
|
1923 //----- (0044FA08) --------------------------------------------------------
|
|
1924 unsigned __int16 MonsterList::GetMonsterByName(const char *pMonsterName)
|
|
1925 {
|
|
1926 signed int v2; // ebx@1
|
|
1927 MonsterList *v3; // esi@1
|
|
1928 int v4; // edi@3
|
|
1929 unsigned __int16 result; // ax@6
|
|
1930
|
|
1931 v2 = 0;
|
|
1932 v3 = this;
|
|
1933 if ( pMonsterName && (signed int)this->uNumMonsters > 0 )
|
|
1934 {
|
|
1935 v4 = 0;
|
|
1936 while ( _strcmpi(pMonsterName, v3->pMonsters[v4].pMonsterName) )
|
|
1937 {
|
|
1938 ++v2;
|
|
1939 ++v4;
|
|
1940 if ( v2 >= (signed int)v3->uNumMonsters )
|
|
1941 goto LABEL_6;
|
|
1942 }
|
|
1943 result = v2;
|
|
1944 }
|
|
1945 else
|
|
1946 {
|
|
1947 LABEL_6:
|
|
1948 result = -1;
|
|
1949 }
|
|
1950 return result;
|
|
1951 }
|