annotate Monsters.cpp @ 671:2bb0e9da8302

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