annotate Monsters.cpp @ 147:c70fea5013aa

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