annotate Monsters.cpp @ 694:52329962fcdb

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