Mercurial > mm7
annotate mm7_6.cpp @ 170:91fa025e6ca6
font cleaning code
author | C:\Documents and Settings\Administrator.SDF-1\Application Data\The Bat! |
---|---|
date | Fri, 15 Feb 2013 01:21:53 +0400 |
parents | d1dde383af89 |
children | 49728858c35e 038a4d09406f |
rev | line source |
---|---|
0 | 1 #include "MM7.h" |
2 | |
3 #include "MapInfo.h" | |
4 #include "Game.h" | |
5 #include "GUIWindow.h" | |
6 #include "GUIFont.h" | |
7 #include "GUIButton.h" | |
8 #include "GUIProgressBar.h" | |
9 #include "Party.h" | |
10 #include "AudioPlayer.h" | |
11 #include "Outdoor.h" | |
12 #include "IndoorCamera.h" | |
13 #include "Overlays.h" | |
14 #include "Monsters.h" | |
15 #include "Arcomage.h" | |
16 #include "LOD.h" | |
17 #include "Actor.h" | |
18 #include "Allocator.h" | |
19 #include "Events.h" | |
20 #include "Viewport.h" | |
21 #include "FrameTableInc.h" | |
22 #include "Math.h" | |
23 #include "LayingItem.h" | |
24 #include "ObjectList.h" | |
25 #include "Chest.h" | |
26 #include "PaletteManager.h" | |
27 #include "DecorationList.h" | |
28 #include "SaveLoad.h" | |
29 #include "stru123.h" | |
30 #include "Time.h" | |
31 #include "IconFrameTable.h" | |
32 #include "stru179.h" | |
33 #include "Awards.h" | |
34 #include "Autonotes.h" | |
35 #include "stru160.h" | |
36 #include "stru279.h" | |
37 #include "TurnEngine.h" | |
38 #include "stru277.h" | |
39 #include "Weather.h" | |
40 #include "stru272.h" | |
41 #include "stru298.h" | |
42 #include "StorylineTextTable.h" | |
43 #include "Events2D.h" | |
44 | |
45 #include "mm7_data.h" | |
46 | |
47 | |
48 | |
49 //----- (00424EE0) -------------------------------------------------------- | |
50 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
51 { | |
52 unsigned int v1; // edx@1 | |
53 double v2; // st7@1 | |
54 signed int v3; // edi@1 | |
55 char *v4; // esi@4 | |
56 char *v5; // ecx@4 | |
57 unsigned int v6; // eax@4 | |
58 char *v7; // edx@4 | |
59 double v8; // st6@10 | |
60 double v9; // st5@10 | |
61 double v10; // st6@11 | |
62 unsigned __int8 v11; // c2@15 | |
63 unsigned __int8 v12; // c3@15 | |
64 void *v13; // edi@22 | |
65 char *v14; // eax@22 | |
66 double v15; // st6@22 | |
67 char *v16; // ecx@22 | |
68 signed int result; // eax@24 | |
69 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
70 bool v19; // [sp+Ch] [bp-28h]@6 | |
71 char *v20; // [sp+10h] [bp-24h]@4 | |
72 char *v21; // [sp+14h] [bp-20h]@4 | |
73 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
74 char *v23; // [sp+1Ch] [bp-18h]@4 | |
75 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
76 char *v25; // [sp+24h] [bp-10h]@4 | |
77 char *v26; // [sp+28h] [bp-Ch]@4 | |
78 char *v27; // [sp+2Ch] [bp-8h]@4 | |
79 char *v28; // [sp+30h] [bp-4h]@4 | |
80 | |
81 v1 = uVertexID; | |
82 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
83 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
84 v3 = 0; | |
85 v22 = 0; | |
86 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | |
87 v3 = 1; | |
88 if ( (signed int)(uVertexID + 1) <= 1 ) | |
89 return 0; | |
90 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
91 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
92 v6 = v1; | |
93 v23 = (char *)&array_507D30[0].flt_2C; | |
168 | 94 v26 = (char *)&array_507D30[0]._rhw; |
0 | 95 v24 = array_507D30; |
96 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
97 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
98 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
99 v27 = (char *)&array_507D30[0].v; | |
100 v28 = (char *)&array_507D30[0].u; | |
101 v7 = (char *)&array_50AC10[0].v; | |
102 v18 = v6; | |
103 do | |
104 { | |
105 v19 = v2 >= *((float *)v7 + 5); | |
106 if ( v3 != v19 ) | |
107 { | |
108 if ( v19 ) | |
109 { | |
110 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | |
111 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | |
112 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | |
113 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | |
114 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | |
115 } | |
116 else | |
117 { | |
118 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | |
119 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | |
120 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | |
121 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | |
122 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | |
123 } | |
124 *(float *)v27 = v9; | |
125 *(float *)v25 = v2; | |
126 *(float *)v26 = 1.0 / v2; | |
127 if ( v3 ) | |
128 { | |
129 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
130 { | |
131 v11 = 0; | |
132 v12 = *(float *)v4 == *((float *)v7 - 5); | |
133 goto LABEL_19; | |
134 } | |
135 } | |
136 else | |
137 { | |
138 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
139 { | |
140 v11 = 0; | |
141 v12 = *(float *)v4 == *((float *)v7 + 7); | |
142 LABEL_19: | |
143 if ( v12 | v11 ) | |
144 goto LABEL_21; | |
145 goto LABEL_20; | |
146 } | |
147 } | |
148 LABEL_20: | |
149 v26 += 48; | |
150 ++v24; | |
151 v25 += 48; | |
152 v27 += 48; | |
153 v28 += 48; | |
154 v5 += 48; | |
155 v4 += 48; | |
156 ++v22; | |
157 v23 += 48; | |
158 v21 = v5; | |
159 v20 = v4; | |
160 } | |
161 LABEL_21: | |
162 if ( v19 ) | |
163 { | |
164 v13 = v24; | |
165 v14 = v26; | |
166 v21 += 48; | |
167 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
168 v20 += 48; | |
169 ++v22; | |
170 v28 += 48; | |
171 v27 += 48; | |
172 v25 += 48; | |
173 ++v24; | |
174 v26 += 48; | |
175 memcpy(v13, v7 + 8, 0x30u); | |
176 v16 = v23; | |
177 v23 += 48; | |
178 v4 = v20; | |
179 *(float *)v14 = v15; | |
180 *(int *)v16 = *((int *)v7 + 13); | |
181 v5 = v21; | |
182 } | |
183 v3 = v19; | |
184 v7 += 48; | |
185 --v18; | |
186 } | |
187 while ( v18 ); | |
188 result = v22; | |
189 if ( v22 < 3 ) | |
190 return 0; | |
191 return result; | |
192 } | |
193 | |
194 //----- (004250FE) -------------------------------------------------------- | |
195 signed int __fastcall sr_4250FE(unsigned int uVertexID) | |
196 { | |
197 unsigned int v1; // edx@1 | |
198 char *v2; // edi@5 | |
199 char *v3; // esi@5 | |
200 char *v4; // ecx@5 | |
201 int v5; // ebx@6 | |
202 double v6; // st6@11 | |
203 double v7; // st5@11 | |
204 double v8; // st6@12 | |
205 unsigned __int8 v9; // c2@16 | |
206 unsigned __int8 v10; // c3@16 | |
207 void *v11; // edi@23 | |
208 double v12; // st6@23 | |
209 char *v13; // ecx@23 | |
210 char v14; // zf@24 | |
211 signed int result; // eax@25 | |
212 unsigned int v16; // [sp+8h] [bp-28h]@5 | |
213 bool v17; // [sp+Ch] [bp-24h]@2 | |
214 bool v18; // [sp+10h] [bp-20h]@7 | |
215 char *v19; // [sp+14h] [bp-1Ch]@5 | |
216 char *v20; // [sp+18h] [bp-18h]@5 | |
217 signed int v21; // [sp+1Ch] [bp-14h]@1 | |
218 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5 | |
219 char *v23; // [sp+24h] [bp-Ch]@5 | |
220 char *v24; // [sp+28h] [bp-8h]@5 | |
221 char *v25; // [sp+2Ch] [bp-4h]@5 | |
222 | |
223 v1 = uVertexID; | |
224 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
225 v21 = 0; | |
226 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0; | |
227 if ( (signed int)(uVertexID + 1) <= 1 ) | |
228 return 0; | |
229 v2 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
230 v3 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 231 v24 = (char *)&array_507D30[0]._rhw; |
0 | 232 v22 = array_507D30; |
233 v19 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
234 v20 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
235 v23 = (char *)&array_507D30[0].vWorldViewPosition; | |
236 v25 = (char *)&array_507D30[0].flt_2C; | |
237 v4 = (char *)&array_50AC10[0].vWorldViewPosition; | |
238 v16 = v1; | |
239 do | |
240 { | |
241 v5 = (int)(v4 + 48); | |
242 v18 = *((float *)v4 + 12) >= 8.0; | |
243 if ( v17 != v18 ) | |
244 { | |
245 if ( v18 ) | |
246 { | |
247 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4); | |
248 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1); | |
249 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2); | |
250 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8); | |
251 } | |
252 else | |
253 { | |
254 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5); | |
255 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13); | |
256 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14); | |
257 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20); | |
258 } | |
259 *(float *)v25 = v7; | |
260 *(float *)v23 = 8.0; | |
261 *(int *)v24 = 0x3E000000u; | |
262 if ( v17 ) | |
263 { | |
264 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) ) | |
265 { | |
266 v9 = 0; | |
267 v10 = *(float *)v2 == *((float *)v4 + 2); | |
268 goto LABEL_20; | |
269 } | |
270 } | |
271 else | |
272 { | |
273 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) ) | |
274 { | |
275 v9 = 0; | |
276 v10 = *(float *)v2 == *((float *)v4 + 14); | |
277 LABEL_20: | |
278 if ( v10 | v9 ) | |
279 goto LABEL_22; | |
280 goto LABEL_21; | |
281 } | |
282 } | |
283 LABEL_21: | |
284 ++v22; | |
285 v23 += 48; | |
286 v25 += 48; | |
287 v3 += 48; | |
288 v2 += 48; | |
289 ++v21; | |
290 v24 += 48; | |
291 v20 = v3; | |
292 v19 = v2; | |
293 } | |
294 LABEL_22: | |
295 if ( v18 ) | |
296 { | |
297 v11 = v22; | |
298 v20 += 48; | |
299 v19 += 48; | |
300 v12 = 1.0 / (*(float *)v5 + 0.0000001); | |
301 ++v21; | |
302 v25 += 48; | |
303 v23 += 48; | |
304 ++v22; | |
305 memcpy(v11, v4 + 36, 0x30u); | |
306 v13 = v24; | |
307 v24 += 48; | |
308 v3 = v20; | |
309 v2 = v19; | |
310 *(float *)v13 = v12; | |
311 } | |
312 v14 = v16-- == 1; | |
313 v17 = v18; | |
314 v4 = (char *)v5; | |
315 } | |
316 while ( !v14 ); | |
317 result = v21; | |
318 if ( v21 < 3 ) | |
319 return 0; | |
320 return result; | |
321 } | |
322 | |
323 //----- (004252E8) -------------------------------------------------------- | |
324 signed int __fastcall sr_4252E8(unsigned int uVertexID) | |
325 { | |
326 unsigned int v1; // edx@1 | |
327 double v2; // st7@1 | |
328 char *v3; // edi@5 | |
329 char *v4; // esi@5 | |
330 char *v5; // ecx@5 | |
331 int v6; // ebx@6 | |
332 double v7; // st6@11 | |
333 double v8; // st5@11 | |
334 double v9; // st6@12 | |
335 unsigned __int8 v10; // c2@16 | |
336 unsigned __int8 v11; // c3@16 | |
337 void *v12; // edi@23 | |
338 double v13; // st6@23 | |
339 char *v14; // ecx@23 | |
340 char v15; // zf@24 | |
341 signed int result; // eax@25 | |
342 unsigned int v17; // [sp+8h] [bp-28h]@5 | |
343 bool v18; // [sp+Ch] [bp-24h]@2 | |
344 bool v19; // [sp+10h] [bp-20h]@7 | |
345 char *v20; // [sp+14h] [bp-1Ch]@5 | |
346 char *v21; // [sp+18h] [bp-18h]@5 | |
347 signed int v22; // [sp+1Ch] [bp-14h]@1 | |
348 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5 | |
349 char *v24; // [sp+24h] [bp-Ch]@5 | |
350 char *v25; // [sp+28h] [bp-8h]@5 | |
351 char *v26; // [sp+2Ch] [bp-4h]@5 | |
352 | |
353 v1 = uVertexID; | |
354 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
355 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
356 v22 = 0; | |
357 v18 = array_50AC10[0].vWorldViewPosition.x <= v2; | |
358 if ( (signed int)(uVertexID + 1) <= 1 ) | |
359 return 0; | |
360 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
361 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 362 v25 = (char *)&array_507D30[0]._rhw; |
0 | 363 v23 = array_507D30; |
364 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
365 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
366 v24 = (char *)&array_507D30[0].vWorldViewPosition; | |
367 v26 = (char *)&array_507D30[0].flt_2C; | |
368 v5 = (char *)&array_50AC10[0].vWorldViewPosition; | |
369 v17 = v1; | |
370 do | |
371 { | |
372 v6 = (int)(v5 + 48); | |
373 v19 = v2 >= *((float *)v5 + 12); | |
374 if ( v18 != v19 ) | |
375 { | |
376 if ( v19 ) | |
377 { | |
378 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5); | |
379 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1); | |
380 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2); | |
381 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8); | |
382 } | |
383 else | |
384 { | |
385 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6); | |
386 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13); | |
387 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14); | |
388 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20); | |
389 } | |
390 *(float *)v26 = v8; | |
391 *(float *)v24 = v2; | |
392 *(float *)v25 = 1.0 / v2; | |
393 if ( v18 ) | |
394 { | |
395 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) ) | |
396 { | |
397 v10 = 0; | |
398 v11 = *(float *)v3 == *((float *)v5 + 2); | |
399 goto LABEL_20; | |
400 } | |
401 } | |
402 else | |
403 { | |
404 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) ) | |
405 { | |
406 v10 = 0; | |
407 v11 = *(float *)v3 == *((float *)v5 + 14); | |
408 LABEL_20: | |
409 if ( v11 | v10 ) | |
410 goto LABEL_22; | |
411 goto LABEL_21; | |
412 } | |
413 } | |
414 LABEL_21: | |
415 ++v23; | |
416 v24 += 48; | |
417 v26 += 48; | |
418 v4 += 48; | |
419 v3 += 48; | |
420 ++v22; | |
421 v25 += 48; | |
422 v21 = v4; | |
423 v20 = v3; | |
424 } | |
425 LABEL_22: | |
426 if ( v19 ) | |
427 { | |
428 v12 = v23; | |
429 v21 += 48; | |
430 v20 += 48; | |
431 v13 = 1.0 / (*(float *)v6 + 0.0000001); | |
432 ++v22; | |
433 v26 += 48; | |
434 v24 += 48; | |
435 ++v23; | |
436 memcpy(v12, v5 + 36, 0x30u); | |
437 v14 = v25; | |
438 v25 += 48; | |
439 v4 = v21; | |
440 v3 = v20; | |
441 *(float *)v14 = v13; | |
442 } | |
443 v15 = v17-- == 1; | |
444 v18 = v19; | |
445 v5 = (char *)v6; | |
446 } | |
447 while ( !v15 ); | |
448 result = v22; | |
449 if ( v22 < 3 ) | |
450 return 0; | |
451 return result; | |
452 } | |
453 | |
454 | |
455 | |
456 //----- (004361EF) -------------------------------------------------------- | |
457 IndoorCameraD3D::IndoorCameraD3D() | |
458 { | |
459 IndoorCameraD3D *v1; // esi@1 | |
460 double v2; // st7@1 | |
461 double v3; // st6@1 | |
462 double v4; // st5@1 | |
463 double v5; // st7@1 | |
464 double v6; // st6@1 | |
465 double v7; // st5@1 | |
466 | |
467 v1 = this; | |
468 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4); | |
469 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14); | |
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24); | |
471 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, | |
472 24, | |
473 6, | |
474 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
475 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ | |
476 v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
477 v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
478 v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; | |
479 v1->field_108 = 0.0; | |
480 v1->field_DC = v4; | |
481 v1->field_E0 = v3; | |
482 v1->field_E4 = v2; | |
483 v5 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
484 v6 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
485 v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300); | |
486 v1->field_138 = 0.0; | |
487 v1->field_10C = v7; | |
488 v1->field_110 = v6; | |
489 v1->field_114 = v5; | |
490 v1->field_168 = 0.0; | |
491 v1->field_198 = 0.0; | |
492 v1->field_1C8 = 0.0; | |
493 v1->field_1F8 = 0.0; | |
494 v1->field_228 = 0.0; | |
495 v1->field_258 = 0.0; | |
496 v1->field_288 = 0.0; | |
497 v1->field_2B8 = 0.0; | |
498 v1->field_2E8 = 0.0; | |
499 v1->field_2BC = 0.0; | |
500 v1->field_2C0 = 0.0; | |
501 v1->field_2C4 = 0.0; | |
502 v1->field_318 = 0.0; | |
503 v1->field_2EC = 0.0; | |
504 v1->field_2F0 = 0.0; | |
505 v1->field_2F4 = 0.0; | |
506 v1->field_348 = 0.0; | |
507 v1->field_31C = 0.0; | |
508 v1->field_320 = 0.0; | |
509 v1->field_324 = 0.0; | |
510 v1->field_378 = 0.0; | |
511 v1->field_34C = 0.0; | |
512 v1->field_350 = 0.0; | |
513 v1->field_354 = 0.0; | |
514 for (uint i = 0; i < 16384; ++i) | |
515 { | |
516 list_0037C[i].field_0 = 0; | |
517 list_0037C[i].flt_30 = 0.0f; | |
518 } | |
519 | |
520 list_0037C_size = 0; | |
521 for (uint i = 0; i < 256; ++i) | |
522 list_E0380[i].mm7__vector_000004_size = 0; | |
523 /*v10 = v1->list_E0380; | |
524 v12 = 256; | |
525 do | |
526 { | |
527 v10->mm7__vector_000004_size = 0; | |
528 //mm7__vector_constructor( | |
529 // v10->mm7__vector_000004, | |
530 // 48, | |
531 // 64, | |
532 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); | |
533 //++v10; | |
534 --v12; | |
535 } | |
536 while ( v12 );*/ | |
537 list_E0380_size = 0; | |
538 //v1->vdestructor_ptr = &stru8_pvdtor; | |
539 } | |
540 | |
541 | |
542 //----- (004254D2) -------------------------------------------------------- | |
543 int __fastcall sr_4254D2(signed int a1) | |
544 { | |
545 signed int v1; // ebx@2 | |
546 int v2; // ecx@2 | |
547 int result; // eax@11 | |
548 double v4; // ST74_8@12 | |
549 bool v5; // edi@12 | |
550 char *v6; // esi@13 | |
551 char *v7; // ebx@13 | |
552 double v8; // st7@15 | |
553 double v9; // st7@16 | |
554 double v10; // st6@16 | |
555 double v11; // st7@17 | |
556 float v12; // eax@18 | |
557 double v13; // ST4C_8@19 | |
558 double v14; // ST10_8@19 | |
559 double v15; // ST28_8@20 | |
560 double v16; // ST34_8@20 | |
561 char v17; // zf@20 | |
562 double v18; // ST18_8@21 | |
563 double v19; // ST3C_8@21 | |
564 double v20; // ST44_8@22 | |
565 double v21; // ST54_8@22 | |
566 void *v22; // edi@26 | |
567 double v23; // ST54_8@29 | |
568 bool v24; // esi@29 | |
569 char *v25; // edi@30 | |
570 char *v26; // ebx@30 | |
571 bool v27; // ecx@32 | |
572 double v28; // st7@33 | |
573 double v29; // st7@34 | |
574 double v30; // st6@34 | |
575 double v31; // st7@35 | |
576 double v32; // ST44_8@37 | |
577 double v33; // ST3C_8@37 | |
578 double v34; // ST18_8@38 | |
579 double v35; // ST34_8@38 | |
580 char v36; // zf@38 | |
581 double v37; // ST28_8@39 | |
582 double v38; // ST10_8@39 | |
583 double v39; // ST20_8@40 | |
584 double v40; // ST5C_8@40 | |
585 void *v41; // edi@44 | |
586 double v42; // ST5C_8@47 | |
587 bool v43; // edi@47 | |
588 char *v44; // esi@48 | |
589 char *v45; // ebx@48 | |
590 bool v46; // ecx@49 | |
591 double v47; // st6@50 | |
592 double v48; // st6@51 | |
593 double v49; // st5@51 | |
594 double v50; // st6@52 | |
595 double v51; // ST20_8@54 | |
596 double v52; // ST54_8@54 | |
597 double v53; // ST44_8@55 | |
598 double v54; // ST3C_8@55 | |
599 char v55; // zf@55 | |
600 double v56; // ST18_8@56 | |
601 double v57; // ST34_8@56 | |
602 double v58; // ST28_8@57 | |
603 double v59; // ST10_8@57 | |
604 void *v60; // edi@61 | |
605 double v61; // ST5C_8@64 | |
606 bool v62; // edi@64 | |
607 char *v63; // esi@65 | |
608 char *v64; // ebx@65 | |
609 bool v65; // ecx@66 | |
610 double v66; // st6@67 | |
611 double v67; // st6@68 | |
612 double v68; // st5@68 | |
613 double v69; // st6@69 | |
614 double v70; // ST20_8@71 | |
615 double v71; // ST54_8@71 | |
616 double v72; // ST44_8@72 | |
617 double v73; // ST3C_8@72 | |
618 char v74; // zf@72 | |
619 double v75; // ST18_8@73 | |
620 double v76; // ST34_8@73 | |
621 double v77; // ST28_8@74 | |
622 double v78; // ST10_8@74 | |
623 void *v79; // edi@78 | |
624 int v80; // ebx@81 | |
625 char *v81; // ecx@82 | |
626 signed int v82; // esi@82 | |
627 float v83; // ST78_4@83 | |
628 double v84; // ST5C_8@83 | |
629 float v85; // eax@84 | |
630 double v86; // ST20_8@85 | |
631 double v87; // ST54_8@88 | |
632 float v88; // eax@89 | |
633 double v89; // ST44_8@90 | |
634 unsigned __int8 v90; // sf@94 | |
635 unsigned __int8 v91; // of@94 | |
636 int v92; // edx@97 | |
637 int v93; // esi@97 | |
638 int v94; // edi@97 | |
639 int v95; // eax@97 | |
640 int v96; // eax@104 | |
641 double v97; // [sp+4Ch] [bp-8Ch]@32 | |
642 double v98; // [sp+54h] [bp-84h]@49 | |
643 double v99; // [sp+54h] [bp-84h]@66 | |
644 float v100; // [sp+5Ch] [bp-7Ch]@1 | |
645 float v101; // [sp+60h] [bp-78h]@1 | |
646 float v102; // [sp+64h] [bp-74h]@1 | |
647 double v103; // [sp+6Ch] [bp-6Ch]@14 | |
648 float v104; // [sp+A8h] [bp-30h]@1 | |
649 signed int v105; // [sp+A8h] [bp-30h]@96 | |
650 bool v106; // [sp+ACh] [bp-2Ch]@14 | |
651 bool v107; // [sp+ACh] [bp-2Ch]@32 | |
652 bool v108; // [sp+ACh] [bp-2Ch]@49 | |
653 bool v109; // [sp+ACh] [bp-2Ch]@66 | |
654 signed int v110; // [sp+B0h] [bp-28h]@12 | |
655 char *v111; // [sp+B8h] [bp-20h]@30 | |
656 signed int v112; // [sp+B8h] [bp-20h]@48 | |
657 signed int v113; // [sp+B8h] [bp-20h]@65 | |
658 char *v114; // [sp+BCh] [bp-1Ch]@13 | |
659 signed int v115; // [sp+BCh] [bp-1Ch]@29 | |
660 signed int v116; // [sp+BCh] [bp-1Ch]@64 | |
661 signed int v117; // [sp+C0h] [bp-18h]@1 | |
662 char *v118; // [sp+C0h] [bp-18h]@30 | |
663 char *v119; // [sp+C0h] [bp-18h]@48 | |
664 char *v120; // [sp+C0h] [bp-18h]@65 | |
665 char *v121; // [sp+C4h] [bp-14h]@13 | |
666 char *v122; // [sp+C4h] [bp-14h]@30 | |
667 signed int v123; // [sp+C4h] [bp-14h]@47 | |
668 char *v124; // [sp+C8h] [bp-10h]@30 | |
669 char *v125; // [sp+C8h] [bp-10h]@48 | |
670 char *v126; // [sp+C8h] [bp-10h]@65 | |
671 signed int v127; // [sp+CCh] [bp-Ch]@2 | |
672 char *v128; // [sp+CCh] [bp-Ch]@13 | |
673 char *v129; // [sp+CCh] [bp-Ch]@30 | |
674 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48 | |
675 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65 | |
676 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13 | |
677 char *v133; // [sp+D0h] [bp-8h]@30 | |
678 char *v134; // [sp+D0h] [bp-8h]@48 | |
679 char *v135; // [sp+D0h] [bp-8h]@65 | |
680 signed int v136; // [sp+D4h] [bp-4h]@1 | |
681 char *v137; // [sp+D4h] [bp-4h]@13 | |
682 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30 | |
683 char *v139; // [sp+D4h] [bp-4h]@48 | |
684 char *v140; // [sp+D4h] [bp-4h]@65 | |
685 | |
686 v101 = (double)(signed int)pViewport->uViewportX; | |
687 v100 = (double)(signed int)pViewport->uViewportZ; | |
688 v117 = a1; | |
689 v136 = 1; | |
690 v104 = (double)(signed int)pViewport->uViewportY; | |
691 v102 = (double)(pViewport->uViewportW + 1); | |
692 if ( a1 <= 0 ) | |
693 return v117; | |
694 v127 = a1; | |
695 v1 = a1; | |
696 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2)); | |
697 v2 = 0; | |
698 do | |
699 { | |
700 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 ) | |
701 v136 = 0; | |
702 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 ) | |
703 v136 = 0; | |
704 ++v2; | |
705 --v127; | |
706 } | |
707 while ( v127 ); | |
708 if ( v136 ) | |
709 return v117; | |
710 v110 = 0; | |
711 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1])); | |
712 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15; | |
713 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportX; | |
714 if ( v117 < 1 ) | |
715 goto LABEL_112; | |
716 v6 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
717 v132 = array_50A2B0; | |
718 v137 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
719 v128 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
720 v121 = (char *)&array_50A2B0[0].flt_2C; | |
168 | 721 v114 = (char *)&array_50A2B0[0]._rhw; |
0 | 722 v7 = (char *)&array_50AC10[0].flt_2C; |
723 do | |
724 { | |
725 v103 = *((float *)v7 + 7) + 6.7553994e15; | |
726 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportX; | |
727 if ( !(v5 ^ v106) ) | |
728 goto LABEL_25; | |
729 v8 = v101; | |
730 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportX ) | |
731 { | |
732 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5)); | |
733 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4); | |
734 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3); | |
735 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7; | |
736 } | |
737 else | |
738 { | |
739 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7)); | |
740 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8); | |
741 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9); | |
742 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12); | |
743 } | |
744 *(float *)v121 = v10; | |
745 *(int *)v137 = LODWORD(v101); | |
746 LODWORD(v12) = *(int *)v6; | |
747 if ( v5 ) | |
748 { | |
749 v13 = v12 + 6.7553994e15; | |
750 v14 = *((float *)v7 - 4) + 6.7553994e15; | |
751 if ( LODWORD(v13) == LODWORD(v14) ) | |
752 { | |
753 v15 = *(float *)v137 + 6.7553994e15; | |
754 v16 = *((float *)v7 - 5) + 6.7553994e15; | |
755 v17 = LODWORD(v15) == LODWORD(v16); | |
756 goto LABEL_23; | |
757 } | |
758 } | |
759 else | |
760 { | |
761 v18 = v12 + 6.7553994e15; | |
762 v19 = *((float *)v7 + 8) + 6.7553994e15; | |
763 if ( LODWORD(v18) == LODWORD(v19) ) | |
764 { | |
765 v20 = *(float *)v137 + 6.7553994e15; | |
766 v21 = *((float *)v7 + 7) + 6.7553994e15; | |
767 v17 = LODWORD(v20) == LODWORD(v21); | |
768 LABEL_23: | |
769 if ( v17 ) | |
770 goto LABEL_25; | |
771 goto LABEL_24; | |
772 } | |
773 } | |
774 LABEL_24: | |
775 v121 += 48; | |
776 v114 += 48; | |
777 v6 += 48; | |
778 ++v110; | |
779 ++v132; | |
780 v128 = v6; | |
781 v137 += 48; | |
782 LABEL_25: | |
783 if ( v106 ) | |
784 { | |
785 v22 = v132; | |
786 v128 += 48; | |
787 ++v110; | |
788 v114 += 48; | |
789 v121 += 48; | |
790 v137 += 48; | |
791 ++v132; | |
792 memcpy(v22, v7 + 4, 0x30u); | |
793 v6 = v128; | |
794 } | |
795 v5 = v106; | |
796 v7 += 48; | |
797 --v117; | |
798 } | |
799 while ( v117 ); | |
800 if ( v110 < 3 | |
801 || (v115 = 0, | |
802 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])), | |
803 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15, | |
804 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportZ, | |
805 v110 < 1) ) | |
806 goto LABEL_112; | |
168 | 807 v25 = (char *)&array_509950[0]._rhw; |
0 | 808 v138 = array_509950; |
809 v129 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
810 v118 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
811 v133 = (char *)&array_509950[0].vWorldViewProjX; | |
812 v122 = (char *)&array_509950[0].vWorldViewProjY; | |
813 v124 = (char *)&array_509950[0].flt_2C; | |
168 | 814 v111 = (char *)&array_509950[0]._rhw; |
0 | 815 v26 = (char *)&array_50A2B0[0].flt_2C; |
816 while ( 2 ) | |
817 { | |
818 v97 = *((float *)v26 + 7) + 6.7553994e15; | |
819 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
820 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
821 if ( v24 != v27 ) | |
822 { | |
823 v28 = v100; | |
824 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportZ ) | |
825 { | |
826 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5)); | |
827 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4); | |
828 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3); | |
829 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26; | |
830 } | |
831 else | |
832 { | |
833 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7)); | |
834 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8); | |
835 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9); | |
836 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12); | |
837 } | |
838 *(float *)v124 = v30; | |
839 *(int *)v133 = LODWORD(v100); | |
840 if ( v24 ) | |
841 { | |
842 v32 = *(float *)v122 + 6.7553994e15; | |
843 v33 = *((float *)v26 - 4) + 6.7553994e15; | |
844 if ( LODWORD(v32) == LODWORD(v33) ) | |
845 { | |
846 v34 = *(float *)v133 + 6.7553994e15; | |
847 v35 = *((float *)v26 - 5) + 6.7553994e15; | |
848 v36 = LODWORD(v34) == LODWORD(v35); | |
849 goto LABEL_41; | |
850 } | |
851 goto LABEL_42; | |
852 } | |
853 v37 = *(float *)v118 + 6.7553994e15; | |
854 v38 = *((float *)v26 + 8) + 6.7553994e15; | |
855 if ( LODWORD(v37) != LODWORD(v38) ) | |
856 goto LABEL_42; | |
857 v39 = *(float *)v129 + 6.7553994e15; | |
858 v40 = *((float *)v26 + 7) + 6.7553994e15; | |
859 v36 = LODWORD(v39) == LODWORD(v40); | |
860 LABEL_41: | |
861 if ( !v36 ) | |
862 { | |
863 LABEL_42: | |
864 v129 += 48; | |
865 v118 += 48; | |
866 v133 += 48; | |
867 v122 += 48; | |
868 v124 += 48; | |
869 v111 += 48; | |
870 ++v115; | |
871 ++v138; | |
872 } | |
873 } | |
874 if ( v27 ) | |
875 { | |
876 v41 = v138; | |
877 ++v115; | |
878 v111 += 48; | |
879 v124 += 48; | |
880 v122 += 48; | |
881 v133 += 48; | |
882 v118 += 48; | |
883 v129 += 48; | |
884 ++v138; | |
885 memcpy(v41, v26 + 4, 0x30u); | |
886 } | |
887 v24 = v107; | |
888 v26 += 48; | |
889 --v110; | |
890 if ( v110 ) | |
891 { | |
892 v25 = v111; | |
893 continue; | |
894 } | |
895 break; | |
896 } | |
897 if ( v115 < 3 | |
898 || (v123 = 0, | |
899 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])), | |
900 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15, | |
901 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportY, | |
902 v115 < 1) ) | |
903 goto LABEL_112; | |
904 v44 = (char *)&array_508FF0[0].vWorldViewProjX; | |
905 v130 = array_508FF0; | |
906 v119 = (char *)&array_508FF0[0].vWorldViewProjX; | |
907 v139 = (char *)&array_508FF0[0].vWorldViewProjY; | |
908 v125 = (char *)&array_508FF0[0].flt_2C; | |
168 | 909 v134 = (char *)&array_508FF0[0]._rhw; |
0 | 910 v45 = (char *)&array_509950[0].flt_2C; |
911 v112 = v115; | |
912 while ( 2 ) | |
913 { | |
914 v98 = *((float *)v45 + 8) + 6.7553994e15; | |
915 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
916 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
917 if ( v43 != v46 ) | |
918 { | |
919 v47 = v104; | |
920 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportY ) | |
921 { | |
922 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4)); | |
923 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5); | |
924 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3); | |
925 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45; | |
926 } | |
927 else | |
928 { | |
929 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8)); | |
930 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7); | |
931 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9); | |
932 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12); | |
933 } | |
934 *(float *)v125 = v49; | |
935 *(float *)v139 = v104; | |
936 if ( v43 ) | |
937 { | |
938 v51 = v104 + 6.7553994e15; | |
939 v52 = *((float *)v45 - 4) + 6.7553994e15; | |
940 if ( LODWORD(v51) == LODWORD(v52) ) | |
941 { | |
942 v53 = *(float *)v44 + 6.7553994e15; | |
943 v54 = *((float *)v45 - 5) + 6.7553994e15; | |
944 v55 = LODWORD(v53) == LODWORD(v54); | |
945 goto LABEL_58; | |
946 } | |
947 goto LABEL_59; | |
948 } | |
949 v56 = v104 + 6.7553994e15; | |
950 v57 = *((float *)v45 + 8) + 6.7553994e15; | |
951 if ( LODWORD(v56) != LODWORD(v57) ) | |
952 goto LABEL_59; | |
953 v58 = *(float *)v44 + 6.7553994e15; | |
954 v59 = *((float *)v45 + 7) + 6.7553994e15; | |
955 v55 = LODWORD(v58) == LODWORD(v59); | |
956 LABEL_58: | |
957 if ( !v55 ) | |
958 { | |
959 LABEL_59: | |
960 v139 += 48; | |
961 v125 += 48; | |
962 v134 += 48; | |
963 v44 += 48; | |
964 ++v123; | |
965 ++v130; | |
966 v119 = v44; | |
967 } | |
968 } | |
969 if ( v46 ) | |
970 { | |
971 v60 = v130; | |
972 v119 += 48; | |
973 ++v123; | |
974 v134 += 48; | |
975 v125 += 48; | |
976 v139 += 48; | |
977 ++v130; | |
978 memcpy(v60, v45 + 4, 0x30u); | |
979 v44 = v119; | |
980 } | |
981 v43 = v108; | |
982 v45 += 48; | |
983 --v112; | |
984 if ( v112 ) | |
985 continue; | |
986 break; | |
987 } | |
988 if ( v123 < 3 | |
989 || (v116 = 0, | |
990 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])), | |
991 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15, | |
992 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportW, | |
993 v123 < 1) ) | |
994 goto LABEL_112; | |
995 v63 = (char *)&array_508690[0].vWorldViewProjX; | |
996 v131 = array_508690; | |
997 v120 = (char *)&array_508690[0].vWorldViewProjX; | |
998 v140 = (char *)&array_508690[0].vWorldViewProjY; | |
999 v126 = (char *)&array_508690[0].flt_2C; | |
168 | 1000 v135 = (char *)&array_508690[0]._rhw; |
0 | 1001 v64 = (char *)&array_508FF0[0].flt_2C; |
1002 v113 = v123; | |
1003 while ( 2 ) | |
1004 { | |
1005 v99 = *((float *)v64 + 8) + 6.7553994e15; | |
1006 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1007 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1008 if ( v62 != v65 ) | |
1009 { | |
1010 v66 = v102; | |
1011 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportW ) | |
1012 { | |
1013 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4)); | |
1014 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5); | |
1015 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3); | |
1016 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64; | |
1017 } | |
1018 else | |
1019 { | |
1020 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8)); | |
1021 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7); | |
1022 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9); | |
1023 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12); | |
1024 } | |
1025 *(float *)v126 = v68; | |
1026 *(float *)v140 = v102; | |
1027 if ( v62 ) | |
1028 { | |
1029 v70 = v102 + 6.7553994e15; | |
1030 v71 = *((float *)v64 - 4) + 6.7553994e15; | |
1031 if ( LODWORD(v70) == LODWORD(v71) ) | |
1032 { | |
1033 v72 = *(float *)v63 + 6.7553994e15; | |
1034 v73 = *((float *)v64 - 5) + 6.7553994e15; | |
1035 v74 = LODWORD(v72) == LODWORD(v73); | |
1036 goto LABEL_75; | |
1037 } | |
1038 goto LABEL_76; | |
1039 } | |
1040 v75 = v102 + 6.7553994e15; | |
1041 v76 = *((float *)v64 + 8) + 6.7553994e15; | |
1042 if ( LODWORD(v75) != LODWORD(v76) ) | |
1043 goto LABEL_76; | |
1044 v77 = *(float *)v63 + 6.7553994e15; | |
1045 v78 = *((float *)v64 + 7) + 6.7553994e15; | |
1046 v74 = LODWORD(v77) == LODWORD(v78); | |
1047 LABEL_75: | |
1048 if ( !v74 ) | |
1049 { | |
1050 LABEL_76: | |
1051 v140 += 48; | |
1052 v126 += 48; | |
1053 v135 += 48; | |
1054 v63 += 48; | |
1055 ++v116; | |
1056 ++v131; | |
1057 v120 = v63; | |
1058 } | |
1059 } | |
1060 if ( v65 ) | |
1061 { | |
1062 v79 = v131; | |
1063 v120 += 48; | |
1064 ++v116; | |
1065 v135 += 48; | |
1066 v126 += 48; | |
1067 v140 += 48; | |
1068 ++v131; | |
1069 memcpy(v79, v64 + 4, 0x30u); | |
1070 v63 = v120; | |
1071 } | |
1072 v62 = v109; | |
1073 v64 += 48; | |
1074 --v113; | |
1075 if ( v113 ) | |
1076 continue; | |
1077 break; | |
1078 } | |
1079 if ( v116 < 3 ) | |
1080 goto LABEL_112; | |
1081 v80 = v116; | |
1082 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116])); | |
1083 if ( v116 > 0 ) | |
1084 { | |
1085 v81 = (char *)&array_508690[0].vWorldViewProjX; | |
1086 v82 = v116; | |
1087 do | |
1088 { | |
1089 LODWORD(v83) = *(int *)v81; | |
1090 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2); | |
1091 v84 = v83 + 6.7553994e15; | |
1092 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportZ ) | |
1093 { | |
1094 v86 = *(float *)v81 + 6.7553994e15; | |
1095 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportX ) | |
1096 goto LABEL_88; | |
1097 v85 = v101; | |
1098 } | |
1099 else | |
1100 { | |
1101 v85 = v100; | |
1102 } | |
1103 *(int *)v81 = LODWORD(v85); | |
1104 LABEL_88: | |
1105 v87 = *((float *)v81 + 1) + 6.7553994e15; | |
1106 if ( SLODWORD(v87) > (signed int)pViewport->uViewportW ) | |
1107 { | |
1108 v88 = v102; | |
1109 LABEL_92: | |
1110 *((int *)v81 + 1) = LODWORD(v88); | |
1111 goto LABEL_93; | |
1112 } | |
1113 v89 = *((float *)v81 + 1) + 6.7553994e15; | |
1114 if ( SLODWORD(v89) < (signed int)pViewport->uViewportY ) | |
1115 { | |
1116 v88 = v104; | |
1117 goto LABEL_92; | |
1118 } | |
1119 LABEL_93: | |
1120 v81 += 48; | |
1121 --v82; | |
1122 } | |
1123 while ( v82 ); | |
1124 } | |
1125 v91 = __OFSUB__(v116, 3); | |
1126 v90 = v116 - 3 < 0; | |
1127 if ( v116 > 3 ) | |
1128 { | |
1129 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1])); | |
1130 if ( v116 > 0 ) | |
1131 { | |
1132 v105 = 1; | |
1133 do | |
1134 { | |
1135 v92 = v105; | |
1136 v93 = v105 - 1; | |
1137 v94 = v105 + 1; | |
1138 v95 = v105 + 1; | |
1139 if ( v105 - 1 >= v80 ) | |
1140 v93 -= v80; | |
1141 if ( v105 >= v80 ) | |
1142 v92 = v105 - v80; | |
1143 if ( v94 >= v80 ) | |
1144 v95 = v94 - v80; | |
1145 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1146 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY) | |
1147 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1148 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 ) | |
1149 { | |
1150 ++v105; | |
1151 } | |
1152 else | |
1153 { | |
1154 v96 = v105; | |
1155 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) ) | |
1156 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2)); | |
1157 --v80; | |
1158 } | |
1159 } | |
1160 while ( v105 - 1 < v80 ); | |
1161 } | |
1162 v91 = __OFSUB__(v80, 3); | |
1163 v90 = v80 - 3 < 0; | |
1164 } | |
1165 if ( v90 ^ v91 ) | |
1166 LABEL_112: | |
1167 result = 0; | |
1168 else | |
1169 result = v80; | |
1170 return result; | |
1171 } | |
1172 | |
1173 //----- (0042620A) -------------------------------------------------------- | |
1174 bool __thiscall sr_42620A(RenderVertexSoft *p) | |
1175 { | |
1176 __int16 v1; // fps@1 | |
1177 unsigned __int8 v2; // c0@2 | |
1178 char v3; // c2@2 | |
1179 unsigned __int8 v4; // c3@2 | |
1180 bool result; // eax@2 | |
1181 unsigned __int8 v6; // c0@4 | |
1182 char v7; // c2@4 | |
1183 unsigned __int8 v8; // c3@4 | |
1184 unsigned __int8 v9; // c0@6 | |
1185 char v10; // c2@6 | |
1186 unsigned __int8 v11; // c3@6 | |
1187 double v12; // st6@7 | |
1188 float v13; // ST04_4@7 | |
1189 float v14; // ST00_4@7 | |
1190 double v15; // st7@7 | |
1191 double v16; // st6@8 | |
1192 float v17; // ST04_4@8 | |
1193 float v18; // ST00_4@8 | |
1194 double v19; // st7@8 | |
1195 | |
1196 //UNDEF(v1); | |
1197 if ( p->vWorldViewPosition.x < 300.0 | |
1198 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
1199 v3 = 0, | |
1200 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
1201 BYTE1(result) = HIBYTE(v1), | |
1202 !(v2 | v4)) ) | |
1203 { | |
1204 if ( p->vWorldViewPosition.x < 300.0 ) | |
1205 { | |
1206 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
1207 v7 = 0; | |
1208 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
1209 BYTE1(result) = HIBYTE(v1); | |
1210 if ( !(v6 | v8) ) | |
1211 { | |
1212 LOBYTE(result) = 0; | |
1213 return result; | |
1214 } | |
1215 } | |
1216 v9 = 300.0 < p->vWorldViewPosition.x; | |
1217 v10 = 0; | |
1218 v11 = 300.0 == p->vWorldViewPosition.x; | |
1219 BYTE1(result) = HIBYTE(v1); | |
1220 if ( v9 | v11 ) | |
1221 { | |
1222 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
1223 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
1224 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
1225 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
1226 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
1227 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
1228 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
1229 } | |
1230 else | |
1231 { | |
1232 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
1233 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
1234 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
1235 v15 = 300.0 - p->vWorldViewPosition.x; | |
1236 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
1237 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
1238 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
1239 } | |
1240 } | |
1241 LOBYTE(result) = 1; | |
1242 return result; | |
1243 } | |
1244 | |
1245 | |
1246 | |
1247 | |
1248 //----- (004268E3) -------------------------------------------------------- | |
1249 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) | |
1250 { | |
1251 unsigned int v1; // eax@1 | |
1252 unsigned int v2; // edx@1 | |
1253 int v3; // eax@1 | |
1254 int v4; // edx@1 | |
1255 unsigned int v5; // ecx@1 | |
1256 | |
1257 v1 = uColor >> 9; | |
1258 v2 = uColor >> 6; | |
1259 LOWORD(v1) = (uColor >> 9) & 0x7C00; | |
1260 LOWORD(v2) = (uColor >> 6) & 0x3E0; | |
1261 v3 = v2 | v1; | |
1262 v4 = (unsigned __int8)uColor >> 3; | |
1263 v5 = uColor >> 16; | |
1264 LOWORD(v5) = v5 & 0x8000; | |
1265 return v5 | v4 | v3; | |
1266 } | |
1267 | |
1268 //----- (0042690D) -------------------------------------------------------- | |
1269 int __fastcall _42690D_colors_cvt(unsigned int a1) | |
1270 { | |
1271 unsigned int v1; // eax@1 | |
1272 unsigned int v2; // edx@1 | |
1273 | |
1274 v1 = a1 >> 8; | |
1275 v2 = a1 >> 5; | |
1276 LOWORD(v1) = (a1 >> 8) & 0xF800; | |
1277 LOWORD(v2) = (a1 >> 5) & 0x7E0; | |
1278 return ((unsigned __int8)a1 >> 3) | v2 | v1; | |
1279 } | |
1280 | |
1281 //----- (00426947) -------------------------------------------------------- | |
1282 void __cdecl sub_426947() | |
1283 { | |
1284 dword_50C968 = 0; | |
1285 dword_50C994 = 0; | |
1286 dword_50C998_turnbased_icon_1A = 0; | |
1287 } | |
1288 // 50C968: using guessed type int dword_50C968; | |
1289 // 50C994: using guessed type int dword_50C994; | |
1290 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A; | |
1291 | |
1292 | |
1293 | |
1294 //----- (004269A2) -------------------------------------------------------- | |
1295 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1) | |
1296 { | |
89 | 1297 //unsigned __int64 v1; // qax@1 |
1298 Player *v1; | |
1299 int v1b; | |
0 | 1300 signed int v2; // ecx@1 |
82 | 1301 int *v3; // esi@1 |
0 | 1302 bool v4; // edi@6 |
82 | 1303 int *v5; // edi@10 |
1304 Player *v6; // esi@10 | |
0 | 1305 int v7; // eax@13 |
1306 unsigned __int8 v8; // cf@13 | |
89 | 1307 int v10[4]; // [sp+Ch] [bp-14h]@1 |
0 | 1308 int v11; // [sp+1Ch] [bp-4h]@10 |
1309 | |
89 | 1310 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1); |
1311 v1 = pParty->pPlayers; | |
1312 v1b = a1; | |
0 | 1313 v2 = 0; |
89 | 1314 v3 = v10; |
0 | 1315 do |
1316 { | |
89 | 1317 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8)) |
0 | 1318 && !*(int *)HIDWORD(v1) |
1319 && !*(_QWORD *)(HIDWORD(v1) + 8) | |
89 | 1320 && !*(_QWORD *)(HIDWORD(v1) + 16);*/ |
1321 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13])) | |
1322 && !v1->pConditions[14] | |
1323 && !v1->pConditions[15] | |
1324 && !v1->pConditions[16]; | |
82 | 1325 *v3 = v4; |
89 | 1326 //HIDWORD(v1) += 6972; |
1327 ++v1; | |
0 | 1328 v2 += v4; |
82 | 1329 ++v3; |
0 | 1330 } |
89 | 1331 while ( v1 <= &pParty->pPlayers[3] ); |
0 | 1332 if ( v2 ) |
1333 { | |
89 | 1334 v1b = v1b / v2; |
1335 v5 = v10; | |
82 | 1336 v6 = pParty->pPlayers;//[0].uExperience; |
89 | 1337 v11 = v1b; |
0 | 1338 do |
1339 { | |
82 | 1340 if ( *v5 ) |
0 | 1341 { |
1342 if ( v11 ) | |
1343 { | |
82 | 1344 LOBYTE(v7) = v6->GetLearningPercent(); |
89 | 1345 v1b = v11 + v11 * v7 / 100; |
1346 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience)); | |
1347 //need review | |
1348 LODWORD(v6->uExperience) += v1b; | |
1349 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8; | |
82 | 1350 if ( v6->uExperience > 4000000000i64 ) |
0 | 1351 { |
82 | 1352 HIDWORD(v6->uExperience) = 0; |
1353 LODWORD(v6->uExperience) = -294967296; | |
0 | 1354 } |
1355 } | |
1356 } | |
82 | 1357 ++v6; |
1358 ++v5; | |
0 | 1359 } |
82 | 1360 while ( v6 <= &pParty->pPlayers[3] ); |
0 | 1361 } |
89 | 1362 return v1b; |
0 | 1363 } |
1364 | |
1365 //----- (00426A5A) -------------------------------------------------------- | |
1366 void stru319::LootActor(Actor *pActor) | |
1367 { | |
1368 signed int v2; // edi@1 | |
1369 char v3; // zf@1 | |
1370 unsigned int v4; // eax@13 | |
1371 unsigned int v5; // esi@13 | |
1372 int v6; // eax@14 | |
1373 unsigned __int8 v7; // al@30 | |
1374 Party *v8; // esi@34 | |
1375 char *v9; // [sp-4h] [bp-3Ch]@10 | |
1376 char *v10; // [sp-4h] [bp-3Ch]@31 | |
1377 char *v11; // [sp-4h] [bp-3Ch]@38 | |
1378 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 | |
1379 int v13; // [sp+30h] [bp-8h]@1 | |
1380 int v14; // [sp+34h] [bp-4h]@1 | |
1381 | |
1382 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1383 Dst.Reset(); | |
1384 v2 = 0; | |
1385 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; | |
1386 v13 = 0; | |
1387 v14 = 0; | |
1388 if ( v3 ) | |
1389 { | |
1390 if ( !pActor->pMonsterInfo.uTreasureDiceRolls ) | |
1391 goto LABEL_9; | |
1392 do | |
1393 { | |
1394 ++v2; | |
1395 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | |
1396 } | |
1397 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); | |
1398 } | |
1399 else | |
1400 { | |
1401 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 ) | |
1402 goto LABEL_9; | |
1403 v14 = pActor->array_000234[3].uAdditionalValue; | |
1404 pActor->array_000234[3].Reset(); | |
1405 } | |
1406 if ( v14 ) | |
1407 { | |
1408 party_finds_gold(v14, 0); | |
1409 viewparams->bRedrawGameUI = 1; | |
1410 } | |
1411 LABEL_9: | |
1412 if ( pActor->uCarriedItemID ) | |
1413 { | |
1414 Dst.Reset(); | |
1415 Dst.uItemID = pActor->uCarriedItemID; | |
1416 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1417 if ( v14 ) | |
1418 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v9); | |
1419 else | |
1420 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v9); | |
1421 ShowStatusBarString(pTmpBuf2, 2u); | |
1422 v4 = Dst.uItemID; | |
1423 v5 = Dst.uItemID; | |
1424 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) | |
1425 { | |
1426 v5 = Dst.uItemID; | |
1427 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1; | |
1428 Dst.uNumCharges = v6; | |
1429 Dst.uMaxCharges = v6; | |
1430 v4 = Dst.uItemID; | |
1431 } | |
1432 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) | |
1433 Dst._bonus_type = 2 * rand() % 4 + 2; | |
1434 pItemsTable->SetSpecialBonus(&Dst); | |
1435 if ( !pParty->AddItem(&Dst) ) | |
1436 pParty->SetHoldingItem(&Dst); | |
1437 pActor->uCarriedItemID = 0; | |
1438 if ( pActor->array_000234[0].uItemID ) | |
1439 { | |
1440 if ( !pParty->AddItem(pActor->array_000234) ) | |
1441 { | |
1442 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1443 pParty->SetHoldingItem(pActor->array_000234); | |
1444 } | |
1445 pActor->array_000234[0].Reset(); | |
1446 } | |
1447 if ( pActor->array_000234[1].uItemID ) | |
1448 { | |
1449 if ( !pParty->AddItem(&pActor->array_000234[1]) ) | |
1450 { | |
1451 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1452 pParty->SetHoldingItem(&pActor->array_000234[1]); | |
1453 } | |
1454 pActor->array_000234[1].Reset(); | |
1455 } | |
1456 LABEL_55: | |
1457 pActor->Remove(); | |
1458 return; | |
1459 } | |
1460 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) | |
1461 { | |
1462 if ( pActor->array_000234[3].uItemID ) | |
1463 { | |
1464 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); | |
1465 pActor->array_000234[3].Reset(); | |
1466 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1467 if ( v14 ) | |
1468 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); | |
1469 else | |
1470 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); | |
1471 ShowStatusBarString(pTmpBuf2, 2u); | |
1472 if ( !pParty->AddItem(&Dst) ) | |
1473 pParty->SetHoldingItem(&Dst); | |
1474 v13 = 1; | |
1475 } | |
1476 goto LABEL_44; | |
1477 } | |
1478 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | |
1479 { | |
1480 LABEL_44: | |
1481 v8 = pParty; | |
1482 goto LABEL_45; | |
1483 } | |
1484 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | |
1485 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1486 if ( v14 ) | |
1487 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); | |
1488 else | |
1489 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); | |
1490 ShowStatusBarString(pTmpBuf2, 2u); | |
1491 v8 = pParty; | |
1492 if ( !pParty->AddItem(&Dst) ) | |
1493 pParty->SetHoldingItem(&Dst); | |
1494 v13 = 1; | |
1495 LABEL_45: | |
1496 if ( pActor->array_000234[0].uItemID ) | |
1497 { | |
1498 if ( !v8->AddItem(pActor->array_000234) ) | |
1499 { | |
1500 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1501 v8->SetHoldingItem(pActor->array_000234); | |
1502 v13 = 1; | |
1503 } | |
1504 pActor->array_000234[0].Reset(); | |
1505 } | |
1506 if ( pActor->array_000234[1].uItemID ) | |
1507 { | |
1508 if ( !v8->AddItem(&pActor->array_000234[1]) ) | |
1509 { | |
1510 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1511 v8->SetHoldingItem(&pActor->array_000234[1]); | |
1512 v13 = 1; | |
1513 } | |
1514 pActor->array_000234[1].Reset(); | |
1515 } | |
1516 if ( !v13 || rand() % 100 < 90 ) | |
1517 goto LABEL_55; | |
1518 } | |
1519 | |
1520 //----- (00426E10) -------------------------------------------------------- | |
1521 int stru319::which_player_would_attack(Actor *pActor) | |
1522 { | |
1523 signed int v2; // ebx@1 | |
1524 int v3; // ecx@2 | |
1525 signed int v4; // edx@3 | |
1526 char v5; // zf@3 | |
1527 unsigned int v6; // eax@3 | |
1528 int v7; // eax@6 | |
1529 int v8; // eax@7 | |
1530 int v9; // eax@8 | |
1531 int v10; // eax@9 | |
1532 int v11; // eax@10 | |
1533 int v12; // eax@11 | |
1534 int v13; // esi@35 | |
1535 signed int v14; // edi@37 | |
1536 enum CHARACTER_RACE v15; // eax@44 | |
1537 Player *v16; // ecx@47 | |
1538 unsigned __int8 v17; // sf@50 | |
1539 unsigned __int8 v18; // of@50 | |
1540 int v19; // esi@52 | |
1541 Player *v20; // ecx@53 | |
1542 int result; // eax@57 | |
1543 int v22[16]; // [sp+8h] [bp-140h]@3 | |
1544 int v23[60]; // [sp+48h] [bp-100h]@48 | |
1545 int v24; // [sp+138h] [bp-10h]@2 | |
1546 int v25; // [sp+13Ch] [bp-Ch]@1 | |
1547 int v26; // [sp+140h] [bp-8h]@1 | |
1548 int v27; // [sp+144h] [bp-4h]@1 | |
1549 | |
1550 v27 = -1; | |
1551 v26 = -1; | |
1552 v25 = -1; | |
1553 v2 = 0; | |
1554 if ( pActor->pMonsterInfo.uAttackPreference ) | |
1555 { | |
1556 v3 = 0; | |
1557 v24 = 0; | |
1558 do | |
1559 { | |
1560 v4 = 1; | |
1561 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); | |
1562 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; | |
1563 v22[v3] = v6; | |
1564 if ( !v5 ) | |
1565 { | |
1566 if ( (signed int)v6 > 128 ) | |
1567 { | |
1568 switch ( v6 ) | |
1569 { | |
1570 case 0x100u: | |
1571 v27 = 8; | |
1572 break; | |
1573 case 0x200u: | |
1574 v25 = 0; | |
1575 break; | |
1576 case 0x400u: | |
1577 v25 = 1; | |
1578 break; | |
1579 case 0x800u: | |
1580 v26 = 0; | |
1581 break; | |
1582 case 0x1000u: | |
1583 v26 = 1; | |
1584 break; | |
1585 case 0x2000u: | |
1586 v26 = 3; | |
1587 break; | |
1588 case 0x4000u: | |
1589 v26 = 2; | |
1590 break; | |
1591 } | |
1592 } | |
1593 else | |
1594 { | |
1595 if ( v6 == 128 ) | |
1596 { | |
1597 v27 = 4; | |
1598 } | |
1599 else | |
1600 { | |
1601 v7 = v6 - 1; | |
1602 if ( v7 ) | |
1603 { | |
1604 v8 = v7 - 1; | |
1605 if ( v8 ) | |
1606 { | |
1607 v9 = v8 - 2; | |
1608 if ( v9 ) | |
1609 { | |
1610 v10 = v9 - 4; | |
1611 if ( v10 ) | |
1612 { | |
1613 v11 = v10 - 8; | |
1614 if ( v11 ) | |
1615 { | |
1616 v12 = v11 - 16; | |
1617 if ( v12 ) | |
1618 { | |
1619 if ( v12 == 32 ) | |
1620 v27 = 20; | |
1621 } | |
1622 else | |
1623 { | |
1624 v27 = 32; | |
1625 } | |
1626 } | |
1627 else | |
1628 { | |
1629 v27 = 24; | |
1630 } | |
1631 } | |
1632 else | |
1633 { | |
1634 v27 = 28; | |
1635 } | |
1636 } | |
1637 else | |
1638 { | |
1639 v27 = 16; | |
1640 } | |
1641 } | |
1642 else | |
1643 { | |
1644 v27 = 12; | |
1645 } | |
1646 } | |
1647 else | |
1648 { | |
1649 v27 = 0; | |
1650 } | |
1651 } | |
1652 } | |
1653 v2 = 0; | |
1654 v13 = 0; | |
1655 while ( 1 ) | |
1656 { | |
1657 v14 = 0; | |
135 | 1658 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType ) |
0 | 1659 v14 = v4; |
1660 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) | |
1661 v14 = v4; | |
1662 if ( v26 != -1 ) | |
1663 { | |
1664 v15 = pPlayers[v13 + 1]->GetRace(); | |
1665 if ( v26 == v15 ) | |
1666 v14 = 1; | |
1667 } | |
1668 if ( v14 == 1 ) | |
1669 { | |
1670 v16 = pPlayers[v13 + 1]; | |
1671 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) | |
1672 v23[v2++] = v13; | |
1673 } | |
1674 ++v13; | |
1675 if ( v13 >= 4 ) | |
1676 break; | |
1677 v4 = 1; | |
1678 } | |
1679 } | |
1680 v3 = v24 + 1; | |
1681 v18 = __OFSUB__(v24 + 1, 15); | |
1682 v17 = v24++ - 14 < 0; | |
1683 } | |
1684 while ( v17 ^ v18 ); | |
1685 if ( v2 ) | |
1686 goto LABEL_61; | |
1687 } | |
1688 v19 = 0; | |
1689 do | |
1690 { | |
1691 v20 = pPlayers[v19 + 1]; | |
1692 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) | |
1693 v23[v2++] = v19; | |
1694 ++v19; | |
1695 } | |
1696 while ( v19 < 4 ); | |
1697 if ( v2 ) | |
1698 LABEL_61: | |
1699 result = v23[rand() % v2]; | |
1700 else | |
1701 result = 0; | |
1702 return result; | |
1703 } | |
1704 | |
1705 | |
1706 //----- (0042704B) -------------------------------------------------------- | |
1707 bool stru319::special_ability_use_check(Actor *pActor, int a2) | |
1708 { | |
1709 stru319 *v3; // edi@1 | |
1710 signed int v4; // ebx@5 | |
1711 signed int v5; // edi@5 | |
1712 | |
1713 v3 = this; | |
1714 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
1715 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
1716 && rand() % 100 < 5 ) | |
1717 pActor->_44FD29(a2); | |
1718 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); | |
1719 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); | |
1720 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
1721 return 2; | |
1722 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
1723 return 3; | |
1724 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance; | |
1725 } | |
1726 | |
1727 //----- (00427102) -------------------------------------------------------- | |
1728 int stru319::_427102(Actor *pActor, signed int a2) | |
1729 { | |
1730 unsigned __int8 v3; // cf@11 | |
1731 unsigned __int8 v4; // zf@11 | |
1732 SpellBuff *v6; // ecx@46 | |
89 | 1733 Player *v7; // esi@49 |
0 | 1734 signed int v8; // edx@50 |
89 | 1735 SpellBuff *v9; // ecx@50 |
0 | 1736 |
1737 if ( a2 > 73 ) | |
1738 { | |
1739 if ( a2 == 77 ) | |
1740 { | |
1741 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP ) | |
1742 return 0; | |
1743 return 1; | |
1744 } | |
1745 if ( a2 == 80 ) | |
1746 { | |
1747 v6 = pParty->pPartyBuffs; | |
1748 while ( (signed __int64)v6->uExpireTime <= 0 ) | |
1749 { | |
1750 ++v6; | |
89 | 1751 if ( v6 > &pParty->pPartyBuffs[19] ) |
1752 { | |
1753 v7 = pParty->pPlayers;//[0].pPlayerBuffs; | |
0 | 1754 v8 = 0; |
89 | 1755 v9 = v7->pPlayerBuffs; |
1756 while ( v9->uExpireTime <= 0i64 ) | |
0 | 1757 { |
1758 ++v8; | |
89 | 1759 ++v9; |
0 | 1760 if ( v8 >= 24 ) |
1761 { | |
89 | 1762 ++v7; |
1763 if ( v7 <= &pParty->pPlayers[3] ) | |
1764 { | |
1765 v8 = 0; | |
1766 v9 = v7->pPlayerBuffs; | |
1767 } | |
1768 else | |
1769 return 0; | |
0 | 1770 } |
1771 } | |
1772 return 1; | |
1773 } | |
1774 } | |
1775 return 1; | |
1776 } | |
1777 if ( a2 == 85 ) | |
1778 { | |
1779 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 ) | |
1780 return 1; | |
1781 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 ) | |
1782 return 0; | |
1783 v3 = 0; | |
1784 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0; | |
1785 } | |
1786 else | |
1787 { | |
1788 if ( a2 == 86 ) | |
1789 { | |
1790 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 ) | |
1791 return 1; | |
1792 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 ) | |
1793 return 0; | |
1794 v3 = 0; | |
1795 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0; | |
1796 } | |
1797 else | |
1798 { | |
1799 if ( a2 != 95 || SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 ) | |
1800 return 1; | |
1801 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 ) | |
1802 return 0; | |
1803 v3 = 0; | |
1804 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0; | |
1805 } | |
1806 } | |
1807 } | |
1808 else | |
1809 { | |
1810 if ( a2 == 73 ) | |
1811 { | |
1812 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 ) | |
1813 return 1; | |
1814 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 ) | |
1815 return 0; | |
1816 v3 = 0; | |
1817 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0; | |
1818 } | |
89 | 1819 else if ( a2 == 5 ) |
0 | 1820 { |
1821 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 ) | |
1822 return 1; | |
1823 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 ) | |
1824 return 0; | |
1825 v3 = 0; | |
1826 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0; | |
1827 } | |
89 | 1828 else if ( a2 == 17 ) |
0 | 1829 { |
1830 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 ) | |
1831 return 1; | |
1832 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 ) | |
1833 return 0; | |
1834 v3 = 0; | |
1835 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0; | |
1836 } | |
89 | 1837 else if ( a2 == 38 ) |
0 | 1838 { |
1839 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 ) | |
1840 return 1; | |
1841 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 ) | |
1842 return 0; | |
1843 v3 = 0; | |
1844 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0; | |
1845 } | |
89 | 1846 else if ( a2 == 46 ) |
0 | 1847 { |
1848 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 ) | |
1849 return 1; | |
1850 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 ) | |
1851 return 0; | |
1852 v3 = 0; | |
1853 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0; | |
1854 } | |
89 | 1855 else |
1856 { | |
1857 if ( a2 != 47 ) | |
1858 { | |
1859 if ( a2 != 51 || SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 ) | |
1860 return 1; | |
1861 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 ) | |
1862 { | |
1863 v3 = 0; | |
1864 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0; | |
1865 } | |
1866 else | |
1867 return 0; | |
1868 } | |
1869 else | |
1870 { | |
1871 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 ) | |
1872 return 1; | |
1873 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 ) | |
1874 return 0; | |
1875 v3 = 0; | |
1876 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0; | |
1877 } | |
1878 } | |
0 | 1879 } |
1880 if ( !(v3 | v4) ) | |
1881 return 0; | |
1882 return 1; | |
1883 } | |
1884 | |
1885 //----- (004272F5) -------------------------------------------------------- | |
1886 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
1887 { | |
1888 signed int v5; // esi@1 | |
1889 signed int v6; // edi@1 | |
1890 int v7; // esi@8 | |
1891 int v8; // eax@9 | |
1892 int v9; // edx@11 | |
1893 int v10; // edx@13 | |
1894 int v11; // esi@13 | |
1895 unsigned __int8 v12; // sf@13 | |
1896 unsigned __int8 v13; // of@13 | |
1897 int v14; // edx@14 | |
1898 int v15; // eax@14 | |
1899 signed int result; // eax@17 | |
1900 | |
1901 v5 = pActor->pMonsterInfo.uAC; | |
1902 v6 = 0; | |
1903 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 ) | |
1904 v5 /= 2; | |
1905 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1906 v6 = pActor->pActorBuffs[15].uPower; | |
1907 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 ) | |
1908 v6 = pActor->pActorBuffs[16].uPower; | |
1909 v7 = v6 + v5; | |
1910 if ( a3 ) | |
1911 v8 = pPlayer->GetRangedAttack(); | |
1912 else | |
1913 v8 = pPlayer->GetActualAttack(0); | |
1914 v9 = rand() % (v7 + 2 * v8 + 30); | |
1915 if ( a3 == 2 ) | |
1916 { | |
1917 v14 = a4 + v9; | |
1918 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1919 } | |
1920 else | |
1921 { | |
1922 if ( a3 != 3 ) | |
1923 { | |
1924 v10 = a4 + v9; | |
1925 v11 = v7 + 15; | |
1926 v13 = __OFSUB__(v10, v11); | |
1927 v12 = v10 - v11 < 0; | |
1928 goto LABEL_16; | |
1929 } | |
1930 v14 = a4 + v9; | |
1931 v15 = 2 * v7 + 30; | |
1932 } | |
1933 v13 = __OFSUB__(v14, v15); | |
1934 v12 = v14 - v15 < 0; | |
1935 LABEL_16: | |
1936 if ( v12 ^ v13 ) | |
1937 result = 0; | |
1938 else | |
1939 result = 1; | |
1940 return result; | |
1941 } | |
1942 | |
1943 //----- (004273BB) -------------------------------------------------------- | |
1944 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
1945 { | |
1946 Actor *v5; // ecx@1 | |
1947 signed int v6; // ebx@1 | |
1948 signed int v7; // esi@1 | |
1949 unsigned __int8 v8; // zf@1 | |
1950 unsigned __int8 v9; // sf@1 | |
1951 int v10; // ebx@10 | |
1952 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
1953 | |
1954 v5 = a2; | |
1955 v6 = a2->pMonsterInfo.uAC; | |
1956 v7 = 0; | |
1957 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0; | |
1958 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0; | |
1959 a2a = 0; | |
1960 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) ) | |
1961 v6 /= 2; | |
1962 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 ) | |
1963 v7 = v5->pActorBuffs[14].uPower; | |
1964 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 ) | |
1965 v7 = v5->pActorBuffs[16].uPower; | |
1966 v10 = v7 + v6; | |
1967 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1968 a2a = pActor->pActorBuffs[14].uPower; | |
1969 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a ) | |
1970 a2a = pActor->pActorBuffs[17].uPower; | |
1971 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1972 { | |
1973 a2a += pActor->pActorBuffs[11].uPower; | |
1974 pActor->pActorBuffs[11].Reset(); | |
1975 } | |
1976 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
1977 } | |
1978 | |
1979 //----- (004274AD) -------------------------------------------------------- | |
1980 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
1981 { | |
1982 signed int v3; // edi@1 | |
1983 signed int v4; // esi@8 | |
1984 int v5; // esi@8 | |
1985 | |
1986 v3 = 0; | |
1987 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1988 v3 = pActor->pActorBuffs[14].uPower; | |
1989 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 ) | |
1990 v3 = pActor->pActorBuffs[17].uPower; | |
1991 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1992 { | |
1993 v3 += pActor->pActorBuffs[11].uPower; | |
1994 pActor->pActorBuffs[11].Reset(); | |
1995 } | |
1996 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
1997 v5 = rand() % v4 + 1; | |
1998 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
1999 } | |
2000 | |
2001 //----- (00427546) -------------------------------------------------------- | |
2002 int stru319::_427546(int a2) | |
2003 { | |
2004 int result; // eax@2 | |
2005 | |
2006 if ( a2 >= 0 ) | |
2007 { | |
2008 if ( a2 >= 1 ) | |
2009 result = (a2 >= 2) + 2; | |
2010 else | |
2011 result = 1; | |
2012 } | |
2013 else | |
2014 { | |
2015 result = 0; | |
2016 } | |
2017 return result; | |
2018 } | |
2019 | |
2020 //----- (0042756B) -------------------------------------------------------- | |
2021 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
2022 { | |
2023 int v4; // edx@1 | |
2024 int v5; // ecx@1 | |
2025 signed int v6; // eax@4 | |
2026 signed int result; // eax@17 | |
2027 signed int v8; // esi@18 | |
2028 | |
2029 v4 = 0; | |
2030 v5 = 0; | |
2031 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
2032 v5 = pActor->pActorBuffs[14].uPower; | |
2033 switch ( a2 ) | |
2034 { | |
2035 case 4: | |
2036 v6 = pActor->pMonsterInfo.uResPhysical; | |
2037 break; | |
2038 case 0: | |
2039 v6 = pActor->pMonsterInfo.uResFire; | |
2040 goto LABEL_12; | |
2041 case 1: | |
2042 v6 = pActor->pMonsterInfo.uResAir; | |
2043 goto LABEL_12; | |
2044 case 2: | |
2045 v6 = pActor->pMonsterInfo.uResWater; | |
2046 goto LABEL_12; | |
2047 case 3: | |
2048 v6 = pActor->pMonsterInfo.uResEarth; | |
2049 goto LABEL_12; | |
2050 case 6: | |
2051 v6 = pActor->pMonsterInfo.uResSpirit; | |
2052 break; | |
2053 case 7: | |
2054 v6 = pActor->pMonsterInfo.uResMind; | |
2055 goto LABEL_12; | |
2056 case 8: | |
2057 v6 = pActor->pMonsterInfo.uResBody; | |
2058 LABEL_12: | |
2059 v4 = v5; | |
2060 break; | |
2061 case 9: | |
2062 v6 = pActor->pMonsterInfo.uResLight; | |
2063 break; | |
2064 case 10: | |
2065 v6 = pActor->pMonsterInfo.uResDark; | |
2066 break; | |
2067 default: | |
2068 v6 = 0; | |
2069 break; | |
2070 } | |
2071 if ( v6 < 200 ) | |
2072 { | |
2073 v8 = v4 + v6 + 30; | |
2074 if ( rand() % v8 >= 30 ) | |
2075 { | |
2076 a3 >>= 1; | |
2077 if ( rand() % v8 >= 30 ) | |
2078 { | |
2079 a3 >>= 1; | |
2080 if ( rand() % v8 >= 30 ) | |
2081 { | |
2082 a3 >>= 1; | |
2083 if ( rand() % v8 >= 30 ) | |
2084 a3 >>= 1; | |
2085 } | |
2086 } | |
2087 } | |
2088 result = a3; | |
2089 } | |
2090 else | |
2091 { | |
2092 result = 0; | |
2093 } | |
2094 return result; | |
2095 } | |
2096 | |
2097 //----- (00427662) -------------------------------------------------------- | |
2098 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
2099 { | |
2100 Actor *v3; // edi@2 | |
2101 signed int v4; // esi@2 | |
2102 bool result; // eax@13 | |
2103 | |
2104 switch ( uType ) | |
2105 { | |
2106 case 0u: | |
2107 v3 = pActor; | |
2108 v4 = pActor->pMonsterInfo.uResFire; | |
2109 goto LABEL_12; | |
2110 case 1u: | |
2111 v3 = pActor; | |
2112 v4 = pActor->pMonsterInfo.uResAir; | |
2113 goto LABEL_12; | |
2114 case 2u: | |
2115 v3 = pActor; | |
2116 v4 = pActor->pMonsterInfo.uResWater; | |
2117 goto LABEL_12; | |
2118 case 3u: | |
2119 v3 = pActor; | |
2120 v4 = pActor->pMonsterInfo.uResEarth; | |
2121 goto LABEL_12; | |
2122 case 7u: | |
2123 v3 = pActor; | |
2124 v4 = pActor->pMonsterInfo.uResMind; | |
2125 goto LABEL_12; | |
2126 case 6u: | |
2127 v3 = pActor; | |
2128 v4 = pActor->pMonsterInfo.uResSpirit; | |
2129 goto LABEL_12; | |
2130 case 8u: | |
2131 v3 = pActor; | |
2132 v4 = pActor->pMonsterInfo.uResBody; | |
2133 goto LABEL_12; | |
2134 case 9u: | |
2135 v3 = pActor; | |
2136 v4 = pActor->pMonsterInfo.uResLight; | |
2137 goto LABEL_12; | |
2138 case 0xAu: | |
2139 v3 = pActor; | |
2140 v4 = pActor->pMonsterInfo.uResDark; | |
2141 goto LABEL_12; | |
2142 case 4u: | |
2143 v3 = pActor; | |
2144 v4 = pActor->pMonsterInfo.uResPhysical; | |
2145 LABEL_12: | |
2146 if ( v4 < 200 ) | |
2147 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | |
2148 else | |
2149 result = 0; | |
2150 break; | |
2151 default: | |
2152 result = 1; | |
2153 break; | |
2154 } | |
2155 return result; | |
2156 } | |
2157 | |
2158 | |
2159 //----- (00427769) -------------------------------------------------------- | |
2160 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
2161 { | |
2162 bool result; // eax@2 | |
2163 | |
2164 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) | |
2165 result = 1; | |
2166 else | |
2167 result = 0; | |
2168 return result; | |
2169 } | |
2170 | |
2171 //----- (0042777D) -------------------------------------------------------- | |
2172 bool __fastcall _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) | |
2173 { | |
2174 bool result; // eax@2 | |
2175 __int16 v6; // bx@4 | |
2176 Player *v7; // eax@4 | |
2177 char v8; // zf@12 | |
2178 unsigned __int16 v9; // cx@16 | |
2179 unsigned int v10; // eax@18 | |
2180 unsigned __int8 v11; // sf@18 | |
2181 unsigned __int8 v12; // of@18 | |
2182 unsigned __int16 v13; // cx@21 | |
2183 unsigned int v14; // eax@23 | |
2184 stru277 *v15; // esi@27 | |
2185 stru277 *v16; // eax@28 | |
2186 GUIWindow *v17; // eax@43 | |
2187 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | |
2188 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | |
2189 unsigned int v20; // [sp-28h] [bp-40h]@44 | |
2190 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | |
2191 unsigned int v22; // [sp-20h] [bp-38h]@44 | |
2192 int v23; // [sp-1Ch] [bp-34h]@44 | |
2193 int v24; // [sp-18h] [bp-30h]@44 | |
2194 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | |
2195 unsigned int v26; // [sp-10h] [bp-28h]@43 | |
2196 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | |
2197 char *v28; // [sp-8h] [bp-20h]@43 | |
2198 Texture *v29; // [sp-4h] [bp-1Ch]@43 | |
2199 __int16 a3a; // [sp+10h] [bp-8h]@1 | |
2200 __int16 a2a; // [sp+14h] [bp-4h]@1 | |
2201 | |
2202 a3a = uPlayerID; | |
2203 a2a = a1; | |
2204 if ( pParty->bTurnBasedModeOn != 1 | |
2205 || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | |
2206 { | |
2207 v6 = a5; | |
2208 v7 = &pParty->pPlayers[uPlayerID]; | |
2209 if ( !(a5 & 0x10) ) | |
2210 { | |
2211 switch ( a1 ) | |
2212 { | |
2213 case 47: | |
2214 case 68: | |
2215 case 89: | |
2216 HIBYTE(v6) = HIBYTE(a5) | 1; | |
2217 break; | |
2218 case 4: | |
2219 case 28: | |
2220 case 30: | |
2221 case 91: | |
2222 LOBYTE(v6) = a5 | 0x80; | |
2223 break; | |
2224 case 2: | |
2225 case 6: | |
2226 case 11: | |
2227 case 18: | |
2228 case 20: | |
2229 case 24: | |
2230 case 26: | |
2231 case 29: | |
2232 case 32: | |
2233 case 34: | |
2234 case 35: | |
2235 case 37: | |
2236 case 39: | |
2237 case 44: | |
2238 case 52: | |
2239 case 57: | |
2240 case 60: | |
2241 case 65: | |
2242 case 70: | |
2243 case 76: | |
2244 case 78: | |
2245 case 79: | |
2246 case 87: | |
2247 case 90: | |
2248 case 92: | |
2249 case 93: | |
2250 case 97: | |
2251 if ( !a6 ) | |
2252 goto LABEL_9; | |
2253 break; | |
2254 case 59: | |
2255 case 62: | |
2256 case 66: | |
2257 case 81: | |
2258 case 94: | |
2259 LABEL_9: | |
2260 v6 = a5 | 8; | |
2261 break; | |
2262 case 42: | |
2263 v6 = a5 | 0x40; | |
2264 break; | |
2265 case 46: | |
2266 if ( a4 ) | |
2267 v8 = (a4 & 0x1C0) == 0; | |
2268 else | |
2269 v8 = (v7->pActiveSkills[16] & 0x1C0) == 0; | |
2270 if ( v8 ) | |
2271 goto LABEL_25; | |
2272 break; | |
2273 case 50: | |
2274 v9 = a4; | |
2275 if ( !a4 ) | |
2276 v9 = v7->pActiveSkills[16]; | |
2277 goto LABEL_18; | |
2278 case 95: | |
2279 v9 = a4; | |
2280 if ( !a4 ) | |
2281 v9 = v7->pActiveSkills[20]; | |
2282 LABEL_18: | |
2283 v10 = SkillToMastery(v9); | |
2284 v12 = __OFSUB__(v10, 3); | |
2285 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2286 goto LABEL_24; | |
2287 case 73: | |
2288 v13 = a4; | |
2289 if ( !a4 ) | |
2290 v13 = v7->pActiveSkills[18]; | |
2291 v14 = SkillToMastery(v13); | |
2292 v12 = __OFSUB__(v14, 4); | |
2293 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2294 LABEL_24: | |
2295 if ( v11 ^ v12 ) | |
2296 goto LABEL_25; | |
2297 break; | |
2298 case 40: | |
2299 case 49: | |
2300 case 53: | |
2301 case 55: | |
2302 case 56: | |
2303 case 61: | |
2304 case 64: | |
2305 case 67: | |
2306 case 71: | |
2307 case 72: | |
2308 case 74: | |
2309 LABEL_25: | |
2310 v6 = a5 | 2; | |
2311 break; | |
2312 case 96: | |
2313 HIBYTE(v6) = HIBYTE(a5) | 2; | |
2314 break; | |
2315 default: | |
2316 break; | |
2317 } | |
2318 } | |
2319 v15 = pStru277; | |
2320 if ( v6 & 0x3CA ) | |
2321 { | |
2322 v16 = pStru277; | |
2323 while ( !(v16->field_8 & 0x3CA) ) | |
2324 { | |
2325 ++v16; | |
2326 if ( (signed int)v16 >= (signed int)&unk_50C190 ) | |
2327 goto LABEL_33; | |
2328 } | |
2329 v16->spellnum = 0; | |
2330 } | |
2331 do | |
2332 { | |
2333 LABEL_33: | |
2334 if ( v15->spellnum ) | |
2335 { | |
2336 v8 = (v15->field_8 & 0x3CA) == 0; | |
2337 v15->spellnum = 0; | |
2338 if ( !v8 ) | |
2339 { | |
2340 pGUIWindow_Settings->Release(); | |
2341 pGUIWindow_Settings = 0; | |
2342 pMouse->SetCursorBitmap("MICON1"); | |
2343 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2344 unk_50C9A0 = 0; | |
2345 back_to_game(); | |
2346 } | |
2347 } | |
2348 ++v15; | |
2349 } | |
2350 while ( (signed int)v15 < (signed int)&unk_50C190 ); | |
2351 result = pStru277->PushStru277(a2a, a3a, a4, v6, a6); | |
2352 if ( result != -1 ) | |
2353 { | |
2354 if ( v6 & 2 ) | |
2355 { | |
2356 if ( pGUIWindow_Settings ) | |
2357 return result; | |
2358 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
2359 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2360 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2361 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2362 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
2363 return sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2364 } | |
2365 if ( v6 & 8 ) | |
2366 { | |
2367 if ( pGUIWindow_Settings ) | |
2368 return result; | |
2369 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
2370 v29 = 0; | |
2371 v28 = ""; | |
2372 v27 = 0; | |
2373 v26 = 0; | |
2374 v25 = 70; | |
2375 LABEL_44: | |
2376 v24 = 0; | |
2377 v23 = 1; | |
2378 v22 = 344; | |
2379 v21 = 460; | |
2380 v20 = 8; | |
2381 v19 = 8; | |
2382 pGUIWindow_Settings = v17; | |
2383 v18 = v17; | |
2384 LABEL_56: | |
2385 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
2386 return sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2387 } | |
2388 if ( v6 & 0x40 ) | |
2389 { | |
2390 if ( pGUIWindow_Settings ) | |
2391 return result; | |
2392 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
2393 v29 = 0; | |
2394 v28 = ""; | |
2395 v27 = 0; | |
2396 v26 = 0; | |
2397 v25 = 190; | |
2398 goto LABEL_44; | |
2399 } | |
2400 if ( (char)v6 < 0 ) | |
2401 { | |
2402 if ( pGUIWindow_Settings ) | |
2403 return result; | |
2404 ++pIcons_LOD->uTexturePacksCount; | |
2405 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2406 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2407 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2408 unk_50C9A0 = 1; | |
2409 some_active_character = uActiveCharacter; | |
2410 return sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2411 } | |
2412 if ( HIBYTE(v6) & 1 ) | |
2413 { | |
2414 if ( pGUIWindow_Settings ) | |
2415 return result; | |
2416 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0); | |
2417 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); | |
2418 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2419 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2420 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
2421 v29 = 0; | |
2422 v28 = ""; | |
2423 v27 = 0; | |
2424 v26 = 0; | |
2425 v25 = 140; | |
2426 v24 = 0; | |
2427 v23 = 1; | |
2428 v22 = 344; | |
2429 v21 = 460; | |
2430 v20 = 8; | |
2431 v19 = 8; | |
2432 v18 = pGUIWindow_Settings; | |
2433 goto LABEL_56; | |
2434 } | |
2435 if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings ) | |
2436 { | |
2437 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0); | |
2438 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( | |
2439 0x1D5u, | |
2440 0xB2u, | |
2441 (uTextureID_507990 != -1 ? pIcons_LOD->pTextures[uTextureID_507990].uTextureWidth : 24), | |
2442 (uTextureID_507990 != -1 ? pIcons_LOD->pTextures[uTextureID_507990].uTextureHeight : 26), | |
2443 1, | |
2444 0, | |
2445 0xBCu, | |
2446 0, | |
2447 0, | |
2448 "", | |
2449 (Texture *)(uTextureID_507990 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507990] : 0), | |
2450 0); | |
2451 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2452 0x272u, | |
2453 0xB2u, | |
2454 (uTextureID_50798C != -1 ? pIcons_LOD->pTextures[uTextureID_50798C].uTextureWidth : 24), | |
2455 (uTextureID_50798C != -1 ? pIcons_LOD->pTextures[uTextureID_50798C].uTextureHeight : 26), | |
2456 1, | |
2457 0, | |
2458 0xBCu, | |
2459 1u, | |
2460 0, | |
2461 "", | |
2462 (Texture *)(uTextureID_50798C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50798C] : 0), | |
2463 0); | |
2464 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
2465 result = (bool)pGUIWindow_Settings->CreateButton( | |
2466 0x231u, | |
2467 0x95u, | |
2468 0x40u, | |
2469 0x4Au, | |
2470 1, | |
2471 0, | |
2472 0x8Fu, | |
2473 5u, | |
2474 0x36u, | |
2475 "", | |
2476 0); | |
2477 } | |
2478 } | |
2479 } | |
2480 return result; | |
2481 } | |
2482 | |
2483 | |
2484 | |
2485 //----- (00427D48) -------------------------------------------------------- | |
2486 void stru277::_427D48(unsigned int uPlayerID) | |
2487 { | |
2488 stru277 *v2; // esi@1 | |
2489 signed int v3; // ebx@1 | |
2490 | |
2491 v2 = this; | |
2492 v3 = 10; | |
2493 do | |
2494 { | |
2495 if ( v2->spellnum ) | |
2496 { | |
2497 if ( v2->field_8 & 0x3CA ) | |
2498 { | |
2499 v2->spellnum = 0; | |
2500 pGUIWindow_Settings->Release(); | |
2501 pGUIWindow_Settings = 0; | |
2502 pMouse->SetCursorBitmap("MICON1"); | |
2503 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2504 unk_50C9A0 = 0; | |
2505 back_to_game(); | |
2506 } | |
2507 } | |
2508 ++v2; | |
2509 --v3; | |
2510 } | |
2511 while ( v3 ); | |
2512 } | |
2513 | |
2514 //----- (00427DA0) -------------------------------------------------------- | |
2515 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6) | |
2516 { | |
2517 unsigned int result; // eax@1 | |
2518 stru277 *v7; // edx@1 | |
2519 stru277 *v8; // ecx@5 | |
2520 | |
2521 result = 0; | |
2522 v7 = this; | |
2523 while ( v7->spellnum ) | |
2524 { | |
2525 ++result; | |
2526 ++v7; | |
2527 if ( (signed int)result >= 10 ) | |
2528 goto LABEL_8; | |
2529 } | |
2530 v8 = &this[result]; | |
2531 v8->spellnum = a2; | |
2532 v8->uPlayerID = uPlayerID; | |
2533 if ( a5 & 0x10 ) | |
2534 v8->uPlayerID_2 = uPlayerID; | |
2535 v8->field_6 = 0; | |
2536 *(int *)&v8->field_C = 0; | |
2537 v8->field_8 = a5; | |
2538 v8->field_A = a4; | |
2539 v8->field_10 = a6; | |
2540 LABEL_8: | |
2541 if ( result == 10 ) | |
2542 result = -1; | |
2543 return result; | |
2544 } | |
2545 | |
2546 //----- (00427E01) -------------------------------------------------------- | |
2547 void stru277::_427E01_cast_spell() | |
2548 { | |
2549 int v1; // esi@1 | |
2550 int v2; // edi@1 | |
2551 stru277 *v3; // ebx@2 | |
2552 signed int v4; // eax@8 | |
2553 __int16 v5; // ax@9 | |
2554 signed int v6; // eax@14 | |
2555 __int16 v7; // ax@23 | |
2556 __int16 v8; // ax@24 | |
2557 char v9; // al@44 | |
2558 int v10; // eax@45 | |
2559 unsigned __int16 v11; // cx@45 | |
2560 signed int v12; // ecx@48 | |
2561 int v13; // eax@53 | |
2562 unsigned __int8 v14; // zf@53 | |
2563 unsigned int v15; // edx@53 | |
2564 signed int v16; // eax@53 | |
2565 Player *v17; // esi@70 | |
2566 int v18; // eax@72 | |
2567 int v19; // eax@74 | |
2568 char *v20; // eax@74 | |
2569 signed int i; // esi@76 | |
2570 int v22; // eax@88 | |
2571 __int16 v23; // ax@88 | |
2572 int v24; // ecx@93 | |
2573 int v25; // ecx@94 | |
2574 signed __int64 v26; // qax@100 | |
2575 char *v27; // ecx@100 | |
2576 unsigned __int64 v28; // qax@102 | |
2577 int v29; // ecx@105 | |
2578 int v30; // ecx@106 | |
2579 int v31; // eax@112 | |
2580 int v32; // eax@112 | |
2581 char *v33; // edx@113 | |
2582 int v34; // eax@121 | |
2583 int v35; // eax@123 | |
2584 int v36; // edx@125 | |
2585 int v37; // eax@129 | |
2586 signed int v38; // edi@129 | |
2587 signed int v39; // eax@129 | |
2588 int v40; // ecx@129 | |
2589 int v41; // eax@129 | |
2590 signed int v42; // eax@129 | |
2591 int *v43; // ecx@129 | |
2592 int v44; // eax@132 | |
2593 int v45; // ecx@132 | |
2594 int v46; // eax@132 | |
2595 unsigned int v47; // edx@133 | |
2596 int v48; // eax@137 | |
2597 int v49; // eax@137 | |
2598 int v50; // eax@141 | |
2599 int v51; // eax@146 | |
2600 __int16 v52; // ax@153 | |
2601 int v53; // eax@153 | |
2602 signed __int64 v54; // qax@164 | |
2603 int v55; // edi@164 | |
2604 stru6 *v56; // eax@165 | |
2605 int v57; // eax@169 | |
2606 signed __int64 v58; // qax@177 | |
2607 int v59; // edi@177 | |
2608 unsigned __int16 v60; // ax@184 | |
2609 int v61; // ecx@184 | |
2610 int v62; // eax@186 | |
2611 int v63; // ecx@187 | |
2612 int v64; // ecx@188 | |
2613 int v65; // ecx@189 | |
2614 const char *v66; // ecx@200 | |
2615 unsigned int v67; // edx@201 | |
2616 char v68; // al@207 | |
89 | 2617 ItemGen *v69; // esi@211 |
0 | 2618 int v70; // ecx@214 |
2619 int v71; // ecx@215 | |
2620 int v72; // ecx@216 | |
2621 __int16 v73; // ST1C_2@222 | |
2622 __int16 v74; // ST18_2@222 | |
2623 stru6 *v75; // eax@222 | |
2624 int v76; // ecx@223 | |
2625 int v77; // ecx@224 | |
2626 int v78; // ecx@225 | |
2627 int v79; // eax@227 | |
2628 int v80; // eax@232 | |
2629 __int16 v81; // ST18_2@245 | |
2630 stru6 *v82; // eax@245 | |
2631 signed int v83; // edi@245 | |
2632 __int16 v84; // ST18_2@245 | |
2633 stru6 *v85; // eax@245 | |
2634 __int16 v86; // ST18_2@245 | |
2635 stru6 *v87; // eax@245 | |
2636 __int16 v88; // ST18_2@245 | |
2637 stru6 *v89; // eax@245 | |
2638 double v90; // st7@245 | |
2639 int v91; // eax@250 | |
89 | 2640 Player *v92; // eax@255 |
0 | 2641 __int16 v93; // ST18_2@260 |
2642 stru6 *v94; // eax@260 | |
2643 __int16 v95; // ST18_2@260 | |
2644 stru6 *v96; // eax@260 | |
2645 __int16 v97; // ST18_2@260 | |
2646 stru6 *v98; // eax@260 | |
2647 __int16 v99; // ST18_2@260 | |
2648 stru6 *v100; // eax@260 | |
2649 int v101; // ecx@261 | |
2650 int v102; // ecx@262 | |
2651 int v103; // ecx@263 | |
2652 int v104; // eax@265 | |
2653 int v105; // edi@271 | |
2654 __int16 v106; // ST18_2@272 | |
2655 stru6 *v107; // eax@272 | |
2656 __int16 v108; // ST1C_2@274 | |
2657 __int16 v109; // ST18_2@274 | |
2658 stru6 *v110; // eax@274 | |
2659 int v111; // eax@274 | |
2660 Actor *v112; // esi@278 | |
2661 int v113; // eax@278 | |
2662 int v114; // ebx@278 | |
2663 unsigned int v115; // ecx@278 | |
2664 int v116; // edx@279 | |
2665 int v117; // edx@281 | |
2666 int v118; // edx@283 | |
2667 int v119; // edi@286 | |
2668 int v120; // eax@286 | |
2669 int v121; // eax@286 | |
2670 signed int v122; // eax@286 | |
2671 int v123; // ecx@288 | |
2672 int v124; // ecx@289 | |
2673 int v125; // ecx@290 | |
2674 int v126; // eax@292 | |
2675 int v127; // eax@296 | |
2676 __int16 v128; // ST18_2@303 | |
2677 stru6 *v129; // eax@303 | |
2678 __int16 v130; // ST18_2@303 | |
2679 stru6 *v131; // eax@303 | |
2680 __int16 v132; // ST18_2@303 | |
2681 stru6 *v133; // eax@303 | |
2682 __int16 v134; // ST18_2@303 | |
2683 stru6 *v135; // eax@303 | |
2684 unsigned __int64 v136; // qax@304 | |
2685 char *v137; // ecx@304 | |
2686 int v138; // ecx@305 | |
2687 int v139; // ecx@306 | |
2688 int v140; // eax@308 | |
2689 __int16 v141; // ST18_2@311 | |
2690 stru6 *v142; // eax@311 | |
2691 __int16 v143; // ST18_2@311 | |
2692 stru6 *v144; // eax@311 | |
2693 __int16 v145; // ST18_2@311 | |
2694 stru6 *v146; // eax@311 | |
2695 __int16 v147; // ST18_2@311 | |
2696 stru6 *v148; // eax@311 | |
2697 int v149; // ecx@312 | |
2698 int v150; // ecx@313 | |
2699 int v151; // ecx@314 | |
2700 signed int v152; // eax@322 | |
2701 int v153; // ecx@322 | |
2702 int v154; // eax@322 | |
2703 int v155; // eax@323 | |
2704 int v156; // eax@323 | |
2705 int v157; // eax@326 | |
2706 double v158; // st7@326 | |
2707 double v159; // st6@326 | |
2708 signed __int64 v160; // qtt@334 | |
2709 int v161; // eax@339 | |
2710 int v162; // edi@340 | |
2711 int v163; // eax@340 | |
2712 signed int v164; // eax@340 | |
2713 signed int v165; // edi@340 | |
2714 stru6 *v166; // eax@340 | |
2715 stru6 *v167; // eax@340 | |
2716 signed int v168; // edi@343 | |
2717 int v169; // eax@344 | |
2718 int v170; // ecx@346 | |
2719 int v171; // ecx@347 | |
2720 int v172; // ecx@348 | |
2721 int v173; // edi@350 | |
2722 signed int v174; // edi@355 | |
2723 __int16 v175; // ST18_2@357 | |
2724 stru6 *v176; // eax@357 | |
2725 __int16 v177; // ST18_2@357 | |
2726 stru6 *v178; // eax@357 | |
2727 __int16 v179; // ST18_2@357 | |
2728 stru6 *v180; // eax@357 | |
2729 __int16 v181; // ST18_2@357 | |
2730 stru6 *v182; // eax@357 | |
2731 signed __int64 v183; // qax@357 | |
2732 int v184; // ecx@358 | |
2733 int v185; // ecx@359 | |
2734 int v186; // ecx@360 | |
2735 int v187; // eax@367 | |
2736 int v188; // esi@369 | |
2737 int v189; // edi@369 | |
2738 const char *v190; // ecx@377 | |
2739 signed int v191; // edi@379 | |
2740 int v192; // ecx@382 | |
2741 int v193; // ecx@383 | |
2742 int v194; // ecx@384 | |
2743 int v195; // eax@386 | |
2744 int v196; // eax@387 | |
2745 __int16 v197; // ST18_2@395 | |
2746 stru6 *v198; // eax@395 | |
2747 __int16 v199; // ST18_2@395 | |
2748 stru6 *v200; // eax@395 | |
2749 __int16 v201; // ST18_2@395 | |
2750 stru6 *v202; // eax@395 | |
2751 __int16 v203; // ST18_2@395 | |
2752 stru6 *v204; // eax@395 | |
2753 signed int v205; // edi@405 | |
2754 int v206; // eax@407 | |
2755 __int16 v207; // cx@407 | |
2756 int v208; // eax@411 | |
2757 signed int v209; // ecx@412 | |
2758 int v210; // edx@412 | |
2759 signed int v211; // ecx@412 | |
2760 int v212; // eax@413 | |
2761 int v213; // eax@413 | |
2762 int v214; // eax@413 | |
2763 int v215; // eax@415 | |
2764 double v216; // st7@415 | |
2765 double v217; // st6@415 | |
2766 signed __int64 v218; // qtt@423 | |
2767 int v219; // ecx@425 | |
2768 int v220; // ecx@426 | |
2769 int v221; // edi@428 | |
2770 char *v222; // edi@434 | |
2771 char v223; // al@438 | |
2772 int v224; // ecx@442 | |
2773 int v225; // ecx@443 | |
2774 int v226; // eax@451 | |
2775 int v227; // esi@453 | |
2776 unsigned int v228; // edi@454 | |
2777 int v229; // edi@466 | |
2778 __int16 v230; // ST18_2@469 | |
2779 stru6 *v231; // eax@469 | |
2780 signed int v232; // esi@469 | |
2781 __int16 v233; // ST18_2@469 | |
2782 stru6 *v234; // eax@469 | |
2783 __int16 v235; // ST18_2@469 | |
2784 stru6 *v236; // eax@469 | |
2785 __int16 v237; // ST18_2@469 | |
2786 stru6 *v238; // eax@469 | |
2787 __int16 v239; // ST1C_2@469 | |
2788 char *v240; // ecx@472 | |
2789 double v241; // st7@478 | |
2790 signed __int64 v242; // qax@484 | |
2791 char *v243; // ecx@484 | |
2792 char *v244; // eax@488 | |
2793 int v245; // edi@492 | |
2794 int v246; // eax@492 | |
2795 char *v247; // eax@497 | |
2796 char v248; // al@497 | |
2797 char v249; // cf@500 | |
2798 float v250; // esi@507 | |
2799 char v251; // al@507 | |
2800 int v252; // edx@510 | |
2801 int m; // esi@510 | |
2802 int v254; // eax@513 | |
2803 int v255; // esi@513 | |
2804 int v256; // ecx@513 | |
2805 int v257; // edx@514 | |
2806 int v258; // ecx@514 | |
2807 char v259; // al@516 | |
2808 int v260; // eax@518 | |
2809 int v261; // esi@519 | |
2810 int v262; // edx@521 | |
2811 int v263; // ecx@521 | |
2812 int v264; // esi@521 | |
2813 int v265; // edx@521 | |
2814 int *ii; // eax@522 | |
2815 int v267; // eax@524 | |
2816 int v268; // eax@524 | |
2817 int v269; // eax@526 | |
2818 char *v270; // eax@531 | |
2819 char v271; // al@531 | |
2820 char v272; // cf@534 | |
2821 float v273; // esi@541 | |
2822 char v274; // al@541 | |
2823 int v275; // edx@544 | |
2824 int k; // esi@544 | |
2825 int v277; // edx@548 | |
2826 int v278; // ecx@548 | |
2827 char v279; // al@550 | |
2828 int v280; // eax@552 | |
2829 int v281; // esi@553 | |
2830 int v282; // edx@555 | |
2831 int v283; // ecx@555 | |
2832 int v284; // esi@555 | |
2833 int v285; // edx@555 | |
2834 int *l; // eax@556 | |
2835 int v287; // eax@558 | |
2836 int v288; // eax@558 | |
2837 ItemGen *v289; // eax@560 | |
2838 signed int v290; // eax@560 | |
2839 unsigned __int8 v291; // al@564 | |
2840 char v292; // al@573 | |
2841 int v293; // eax@575 | |
2842 ItemGen *v294; // esi@575 | |
2843 int v295; // edx@575 | |
2844 int kk; // edi@575 | |
2845 int v297; // edx@579 | |
2846 int v298; // ecx@579 | |
2847 char v299; // al@581 | |
2848 int v300; // eax@583 | |
2849 int v301; // edi@584 | |
2850 int v302; // edx@586 | |
2851 int v303; // ecx@586 | |
2852 int v304; // edi@586 | |
2853 int v305; // edx@586 | |
2854 int *jj; // eax@587 | |
2855 int v307; // eax@589 | |
2856 int v308; // eax@589 | |
2857 char *v309; // ecx@593 | |
2858 char v310; // sf@593 | |
2859 unsigned __int8 v311; // of@593 | |
2860 char v312; // cl@597 | |
2861 char v313; // al@606 | |
2862 int v314; // edx@607 | |
2863 int j; // esi@607 | |
2864 unsigned int v316; // eax@613 | |
2865 const char *v317; // ecx@617 | |
2866 Player *v318; // ecx@619 | |
2867 unsigned int v319; // edi@627 | |
2868 int v320; // ecx@629 | |
2869 int v321; // ecx@630 | |
2870 int v322; // edi@632 | |
2871 int v323; // edi@635 | |
2872 char *v324; // eax@635 | |
2873 Player *v325; // ecx@640 | |
2874 int v326; // eax@643 | |
2875 int v327; // eax@648 | |
2876 int v328; // ecx@651 | |
2877 int v329; // ecx@652 | |
2878 int v330; // edi@654 | |
2879 __int16 v331; // ST18_2@658 | |
2880 stru6 *v332; // eax@658 | |
2881 __int16 v333; // ST18_2@658 | |
2882 stru6 *v334; // eax@658 | |
2883 __int16 v335; // ST18_2@658 | |
2884 stru6 *v336; // eax@658 | |
2885 __int16 v337; // ST18_2@658 | |
2886 stru6 *v338; // eax@658 | |
2887 int v339; // ecx@659 | |
2888 int v340; // ecx@660 | |
2889 int v341; // eax@663 | |
2890 signed int v342; // edi@668 | |
2891 signed int v343; // edi@670 | |
2892 unsigned __int64 v344; // ST08_8@670 | |
2893 __int16 v345; // ST1C_2@671 | |
2894 __int16 v346; // ST18_2@671 | |
2895 stru6 *v347; // eax@671 | |
2896 int v348; // ecx@672 | |
2897 int v349; // ecx@673 | |
2898 int v350; // edi@676 | |
2899 Player *v351; // edi@680 | |
2900 __int16 v352; // ST18_2@685 | |
2901 stru6 *v353; // eax@685 | |
2902 int v354; // ecx@686 | |
2903 int v355; // ecx@687 | |
2904 int v356; // eax@689 | |
112 | 2905 Player *v357; // edi@694 |
0 | 2906 unsigned __int16 v358; // ST1C_2@695 |
2907 __int16 v359; // ST18_2@695 | |
2908 stru6 *v360; // eax@695 | |
2909 __int16 v361; // ST1C_2@697 | |
2910 __int16 v362; // ST18_2@697 | |
2911 stru6 *v363; // eax@697 | |
2912 int v364; // ecx@698 | |
2913 int v365; // ecx@699 | |
2914 int v366; // eax@701 | |
2915 stru6 *v367; // eax@704 | |
2916 int v368; // eax@704 | |
2917 Actor *v369; // edi@705 | |
2918 int v370; // eax@706 | |
2919 int v371; // ecx@709 | |
2920 int v372; // ecx@710 | |
2921 int v373; // eax@715 | |
2922 int v374; // eax@717 | |
112 | 2923 Player *v375; // edi@717 |
0 | 2924 int v376; // eax@717 |
2925 Player *v377; // ecx@719 | |
2926 int v378; // ecx@721 | |
2927 int v379; // ecx@722 | |
2928 int v380; // eax@724 | |
2929 int v381; // edi@727 | |
2930 int v382; // ecx@727 | |
2931 Player *v383; // eax@728 | |
2932 int v384; // eax@733 | |
2933 int v385; // edi@736 | |
2934 signed int v386; // eax@736 | |
2935 Player *v387; // edi@738 | |
2936 int v388; // edi@740 | |
2937 unsigned __int16 v389; // ST1C_2@740 | |
2938 __int16 v390; // ST18_2@740 | |
2939 stru6 *v391; // eax@740 | |
2940 int v392; // ecx@742 | |
2941 int v393; // ecx@743 | |
2942 int v394; // ecx@744 | |
2943 int v395; // edi@747 | |
2944 int v396; // eax@752 | |
2945 int v397; // eax@757 | |
2946 int v398; // eax@757 | |
2947 int v399; // eax@757 | |
2948 char *v400; // esi@757 | |
2949 Game *v401; // ecx@759 | |
2950 __int16 v402; // ST1C_2@759 | |
2951 __int16 v403; // ST18_2@759 | |
2952 stru6 *v404; // eax@759 | |
2953 int v405; // ecx@761 | |
2954 int v406; // ecx@762 | |
2955 int v407; // edi@765 | |
2956 __int16 v408; // ST1C_2@769 | |
2957 __int16 v409; // ST18_2@769 | |
2958 stru6 *v410; // eax@769 | |
2959 int v411; // ecx@772 | |
2960 int v412; // ecx@773 | |
2961 int v413; // edi@775 | |
2962 __int16 v414; // ST1C_2@781 | |
2963 __int16 v415; // ST18_2@781 | |
2964 stru6 *v416; // eax@781 | |
2965 int v417; // eax@787 | |
2966 int v418; // ecx@789 | |
2967 __int16 v419; // ax@791 | |
2968 signed int v420; // eax@793 | |
2969 int v421; // edx@793 | |
2970 const char *v422; // eax@801 | |
2971 int v423; // ecx@808 | |
2972 int v424; // ecx@809 | |
2973 int v425; // eax@811 | |
2974 signed int v426; // eax@815 | |
2975 signed int v427; // eax@820 | |
2976 int v428; // ecx@825 | |
2977 int v429; // ecx@826 | |
2978 int v430; // eax@828 | |
2979 stru6 *v431; // eax@831 | |
2980 int v432; // eax@831 | |
2981 Actor *v433; // edi@832 | |
2982 int v434; // eax@833 | |
2983 int v435; // ecx@837 | |
2984 int v436; // ecx@838 | |
2985 __int16 v437; // ST1C_2@843 | |
2986 __int16 v438; // ST18_2@843 | |
2987 stru6 *v439; // eax@843 | |
2988 int v440; // eax@843 | |
2989 int v441; // eax@847 | |
2990 int v442; // ecx@850 | |
2991 int v443; // ecx@851 | |
2992 int v444; // eax@853 | |
2993 signed int v445; // edi@857 | |
2994 int v446; // ecx@862 | |
2995 LevelDecoration *v447; // edi@864 | |
2996 __int16 v448; // ax@864 | |
2997 char *v449; // esi@870 | |
2998 int v450; // eax@870 | |
2999 int v451; // ecx@875 | |
3000 int v452; // ecx@876 | |
3001 int v453; // edi@878 | |
3002 __int16 v454; // ST1C_2@884 | |
3003 __int16 v455; // ST18_2@884 | |
3004 stru6 *v456; // eax@884 | |
3005 int v457; // ecx@887 | |
3006 int v458; // ecx@888 | |
3007 int v459; // eax@890 | |
3008 signed int v460; // eax@895 | |
3009 Actor *v461; // eax@897 | |
3010 unsigned __int16 v462; // cx@897 | |
3011 signed int v463; // edx@897 | |
3012 int v464; // ecx@905 | |
3013 int v465; // ecx@906 | |
3014 int v466; // edi@909 | |
3015 __int16 v467; // ST1C_2@913 | |
3016 __int16 v468; // ST18_2@913 | |
3017 stru6 *v469; // eax@913 | |
3018 int v470; // edi@913 | |
3019 int v471; // eax@917 | |
3020 int v472; // eax@917 | |
3021 char *v473; // esi@918 | |
3022 __int16 v474; // ST18_2@920 | |
3023 stru6 *v475; // eax@920 | |
3024 __int16 v476; // ST18_2@920 | |
3025 stru6 *v477; // eax@920 | |
3026 __int16 v478; // ST18_2@920 | |
3027 stru6 *v479; // eax@920 | |
3028 __int16 v480; // ST18_2@920 | |
3029 stru6 *v481; // eax@920 | |
3030 __int16 v482; // ST18_2@923 | |
3031 stru6 *v483; // eax@923 | |
3032 __int16 v484; // ST18_2@923 | |
3033 stru6 *v485; // eax@923 | |
3034 __int16 v486; // ST18_2@923 | |
3035 stru6 *v487; // eax@923 | |
3036 __int16 v488; // ST18_2@923 | |
3037 stru6 *v489; // eax@923 | |
3038 __int16 v490; // ST1C_2@924 | |
3039 __int16 v491; // ST18_2@924 | |
3040 stru6 *v492; // eax@924 | |
3041 int v493; // ecx@925 | |
3042 int v494; // ecx@926 | |
3043 __int16 v495; // ST1C_2@931 | |
3044 __int16 v496; // ST18_2@931 | |
3045 stru6 *v497; // eax@931 | |
3046 int v498; // edi@931 | |
3047 int v499; // eax@935 | |
3048 int v500; // eax@935 | |
3049 Player *v501; // edi@939 | |
3050 __int16 v502; // ST18_2@940 | |
3051 stru6 *v503; // eax@940 | |
3052 stru6 *v504; // eax@943 | |
3053 int v505; // eax@943 | |
3054 int v506; // eax@943 | |
3055 int v507; // edi@944 | |
3056 int v508; // eax@944 | |
3057 signed int v509; // eax@944 | |
3058 signed int v510; // edi@944 | |
3059 Actor *v511; // edi@946 | |
3060 int v512; // eax@946 | |
3061 SpellBuff *v513; // edi@946 | |
3062 int v514; // ecx@950 | |
3063 int v515; // ecx@951 | |
3064 int v516; // eax@953 | |
3065 int v517; // eax@956 | |
90 | 3066 Actor *v518; // edx@957 |
0 | 3067 __int16 v519; // cx@958 |
3068 int v520; // ecx@968 | |
3069 int v521; // ecx@969 | |
3070 int v522; // eax@971 | |
3071 __int16 v523; // ST18_2@975 | |
3072 stru6 *v524; // eax@975 | |
3073 __int16 v525; // ST18_2@975 | |
3074 stru6 *v526; // eax@975 | |
3075 __int16 v527; // ST18_2@975 | |
3076 stru6 *v528; // eax@975 | |
3077 __int16 v529; // ST18_2@975 | |
3078 stru6 *v530; // eax@975 | |
3079 int v531; // eax@982 | |
3080 int v532; // eax@982 | |
3081 int v533; // edi@983 | |
3082 int v534; // eax@983 | |
3083 signed int v535; // eax@983 | |
3084 signed int v536; // edi@983 | |
3085 stru6 *v537; // eax@984 | |
3086 int v538; // ecx@985 | |
3087 int v539; // ecx@986 | |
3088 int v540; // eax@988 | |
3089 __int16 v541; // ST18_2@991 | |
3090 stru6 *v542; // eax@991 | |
3091 __int16 v543; // ST18_2@991 | |
3092 stru6 *v544; // eax@991 | |
3093 __int16 v545; // ST18_2@991 | |
3094 stru6 *v546; // eax@991 | |
3095 __int16 v547; // ST18_2@991 | |
3096 stru6 *v548; // eax@991 | |
3097 double v549; // st7@991 | |
3098 unsigned __int16 v550; // di@991 | |
3099 int v551; // ecx@993 | |
3100 int v552; // ecx@994 | |
89 | 3101 Player *v553; // edi@1001 |
0 | 3102 __int16 v554; // ST18_2@1002 |
3103 stru6 *v555; // eax@1002 | |
3104 __int16 v556; // ST18_2@1002 | |
3105 stru6 *v557; // eax@1002 | |
3106 __int16 v558; // ST18_2@1002 | |
3107 stru6 *v559; // eax@1002 | |
3108 __int16 v560; // ST18_2@1002 | |
3109 stru6 *v561; // eax@1002 | |
3110 unsigned __int16 v562; // di@1005 | |
3111 signed int v563; // eax@1010 | |
3112 unsigned int v564; // ecx@1011 | |
3113 signed int v565; // eax@1012 | |
3114 Player **v566; // ecx@1012 | |
3115 int v567; // eax@1012 | |
3116 unsigned __int16 v568; // ST1C_2@1012 | |
3117 __int16 v569; // ST18_2@1012 | |
3118 stru6 *v570; // eax@1012 | |
3119 Player *v571; // eax@1013 | |
3120 char *v572; // ecx@1013 | |
3121 int v573; // ecx@1017 | |
3122 int v574; // ecx@1018 | |
3123 int v575; // eax@1020 | |
3124 signed int v576; // eax@1025 | |
3125 Player *v577; // eax@1026 | |
3126 int v578; // eax@1028 | |
3127 __int16 v579; // ax@1029 | |
3128 int v580; // eax@1031 | |
3129 int v581; // edi@1031 | |
3130 int v582; // eax@1031 | |
3131 __int16 v583; // ST1C_2@1034 | |
3132 __int16 v584; // ST18_2@1034 | |
3133 char *v585; // esi@1034 | |
3134 stru6 *v586; // eax@1034 | |
3135 signed int v587; // eax@1035 | |
3136 int v588; // ecx@1036 | |
3137 int v589; // ecx@1037 | |
3138 int v590; // ecx@1038 | |
3139 char v591; // al@1048 | |
3140 int v592; // esi@1052 | |
3141 int v593; // ecx@1057 | |
3142 int v594; // ecx@1058 | |
3143 int v595; // eax@1064 | |
3144 int v596; // esi@1066 | |
3145 unsigned int v597; // edi@1067 | |
3146 int v598; // eax@1079 | |
3147 signed int v599; // eax@1082 | |
3148 int v600; // edi@1086 | |
3149 int v601; // edx@1086 | |
3150 int v602; // eax@1086 | |
3151 int v603; // ecx@1086 | |
3152 int v604; // eax@1087 | |
3153 char *v605; // eax@1089 | |
3154 int v606; // edx@1091 | |
3155 int v607; // ecx@1100 | |
3156 __int16 v608; // ax@1102 | |
3157 signed int v609; // eax@1104 | |
3158 int v610; // edi@1106 | |
3159 unsigned int v611; // eax@1106 | |
89 | 3160 Player *v612; // edi@1106 |
3161 DDM_DLV_Header *v613; // eax@1108 | |
0 | 3162 int v614; // eax@1116 |
3163 int v615; // edi@1119 | |
3164 __int16 v616; // ST1C_2@1122 | |
3165 __int16 v617; // ST18_2@1122 | |
3166 stru6 *v618; // eax@1122 | |
112 | 3167 Player *v619; // edi@1123 |
0 | 3168 unsigned __int16 v620; // ST1C_2@1124 |
3169 __int16 v621; // ST18_2@1124 | |
3170 stru6 *v622; // eax@1124 | |
3171 signed __int64 v623; // qax@1127 | |
3172 int v624; // eax@1127 | |
3173 int v625; // edi@1129 | |
3174 int v626; // eax@1129 | |
3175 signed int v627; // eax@1129 | |
3176 signed int v628; // edi@1129 | |
3177 int v629; // ecx@1130 | |
3178 Player *v630; // eax@1131 | |
3179 int v631; // eax@1137 | |
3180 int v632; // edi@1140 | |
3181 Player *v633; // eax@1140 | |
3182 signed int v634; // eax@1140 | |
3183 int v635; // edi@1142 | |
3184 unsigned __int16 v636; // ST1C_2@1142 | |
3185 __int16 v637; // ST18_2@1142 | |
3186 stru6 *v638; // eax@1142 | |
3187 stru6 *v639; // eax@1143 | |
3188 int v640; // ecx@1146 | |
3189 int v641; // ecx@1147 | |
3190 int v642; // edi@1156 | |
3191 int v643; // eax@1156 | |
3192 int v644; // eax@1156 | |
3193 signed int v645; // eax@1158 | |
3194 Player *v646; // ebx@1169 | |
3195 int v647; // edi@1169 | |
3196 signed int v648; // ST1C_4@1170 | |
3197 Player *v649; // ecx@1170 | |
3198 unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3199 unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3200 unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3201 unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
3202 int v654; // [sp-4h] [bp-E88h]@124 | |
3203 unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 | |
3204 unsigned int v656; // [sp-4h] [bp-E88h]@639 | |
3205 int v657; // [sp-4h] [bp-E88h]@807 | |
3206 int v658; // [sp+0h] [bp-E84h]@100 | |
3207 int v659; // [sp+0h] [bp-E84h]@123 | |
3208 int v660; // [sp+0h] [bp-E84h]@146 | |
3209 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
3210 int v662; // [sp+0h] [bp-E84h]@304 | |
3211 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 | |
3212 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3213 int v665; // [sp+0h] [bp-E84h]@807 | |
3214 int v666; // [sp+4h] [bp-E80h]@12 | |
3215 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
3216 unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 | |
3217 int v669; // [sp+4h] [bp-E80h]@123 | |
3218 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3219 int v671; // [sp+4h] [bp-E80h]@146 | |
3220 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
3221 unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 | |
3222 __int16 v674; // [sp+4h] [bp-E80h]@684 | |
3223 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3224 int v676; // [sp+4h] [bp-E80h]@807 | |
3225 int v677; // [sp+4h] [bp-E80h]@861 | |
3226 int v678; // [sp+4h] [bp-E80h]@997 | |
3227 int v679; // [sp+14h] [bp-E70h]@515 | |
3228 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3229 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3230 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3231 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3232 int v684; // [sp+D04h] [bp-180h]@416 | |
3233 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3234 int x; // [sp+D20h] [bp-164h]@327 | |
3235 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3236 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3237 int v689; // [sp+D30h] [bp-154h]@943 | |
3238 int v690; // [sp+D34h] [bp-150h]@943 | |
3239 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3240 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3241 int v693; // [sp+D40h] [bp-144h]@137 | |
3242 int v694; // [sp+D44h] [bp-140h]@982 | |
3243 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3244 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3245 int v697; // [sp+D50h] [bp-134h]@129 | |
3246 int v698; // [sp+D54h] [bp-130h]@129 | |
3247 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3248 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3249 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3250 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3251 int v703; // [sp+D70h] [bp-114h]@286 | |
3252 int v704; // [sp+D74h] [bp-110h]@132 | |
3253 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3254 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3255 int v707; // [sp+D80h] [bp-104h]@1127 | |
3256 int v708; // [sp+D84h] [bp-100h]@1127 | |
3257 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3258 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3259 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3260 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3261 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3262 int n; // [sp+DA0h] [bp-E4h]@1 | |
3263 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3264 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3265 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3266 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3267 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3268 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3269 int v721; // [sp+DD8h] [bp-ACh]@163 | |
3270 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3271 int v723; // [sp+E4Ch] [bp-38h]@1 | |
3272 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3273 float v725; // [sp+E54h] [bp-30h]@23 | |
3274 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3275 int v726b; |
0 | 3276 float v727; // [sp+E5Ch] [bp-28h]@1 |
3277 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3278 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3279 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3280 Player *v730b; |
3281 ItemGen *v730c; | |
0 | 3282 int v731; // [sp+E6Ch] [bp-18h]@48 |
3283 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3284 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3285 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3286 int amount; // [sp+E80h] [bp-4h]@1 | |
3287 | |
3288 auto ecx0 = this; | |
3289 | |
3290 v711 = ecx0; | |
3291 | |
3292 LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3293 //LayingItem::LayingItem(&a1); | |
3294 | |
3295 v1 = 0; | |
3296 v2 = 0; | |
3297 amount = 0; | |
3298 LODWORD(v733) = 0; | |
3299 v723 = 0; | |
3300 v727 = 0.0; | |
3301 n = 0; | |
3302 while ( 1 ) | |
3303 { | |
3304 v3 = &v711[n]; | |
3305 HIDWORD(v733) = (int)v3; | |
3306 if ( v3->spellnum == (short)v1 ) | |
3307 goto LABEL_1166; | |
3308 if ( pParty->pPartyBuffs[11].NotExpired() ) | |
3309 pParty->pPartyBuffs[11].Reset(); | |
3310 if ( v3->field_8 & 0x3CA ) | |
3311 { | |
3312 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3313 v711->_427D48(1u); | |
3314 goto LABEL_1166; | |
3315 } | |
3316 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
3317 v4 = *(int *)&v3->field_C; | |
3318 if ( v4 != v1 ) | |
3319 goto LABEL_18; | |
3320 v5 = v3->spellnum; | |
3321 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) | |
3322 v666 = 1; | |
3323 else | |
3324 v666 = v1; | |
3325 a2 = stru_50C198.FindClosesActor(5120, 1, v666); | |
3326 v6 = pMouse->uPointingObjectID; | |
141 | 3327 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) |
0 | 3328 { |
3329 v4 = pMouse->uPointingObjectID; | |
3330 LABEL_18: | |
3331 a2 = v4; | |
3332 } | |
3333 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; | |
3334 if ( (short)a1.uItemType != (short)v1 ) | |
3335 { | |
141 | 3336 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3337 { |
141 | 3338 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3339 v2 = v723; |
3340 v1 = 0; | |
3341 } | |
3342 else | |
3343 { | |
3344 v715.uYawAngle = pParty->sRotationY; | |
3345 v715.uPitchAngle = pParty->sRotationX; | |
3346 } | |
3347 } | |
3348 v7 = v3->field_A; | |
3349 LODWORD(v725) = v1; | |
3350 _this = (ItemGen *)v1; | |
3351 if ( v7 == (short)v1 ) | |
3352 { | |
3353 v8 = v3->spellnum; | |
3354 if ( v3->spellnum >= 12 ) | |
3355 { | |
3356 if ( v8 >= 23 ) | |
3357 { | |
3358 if ( v8 >= 34 ) | |
3359 { | |
3360 if ( v8 >= 45 ) | |
3361 { | |
3362 if ( v8 >= 56 ) | |
3363 { | |
3364 if ( v8 >= 67 ) | |
3365 { | |
3366 if ( v8 >= 78 ) | |
3367 { | |
3368 if ( v8 >= 89 ) | |
3369 { | |
3370 if ( v8 >= 100 ) | |
3371 { | |
3372 if ( v8 != 100 ) | |
3373 { | |
3374 LABEL_45: | |
3375 HIWORD(v10) = HIWORD(pPlayer); | |
3376 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
3377 goto LABEL_47; | |
3378 } | |
3379 v667 = (PLAYER_SKILL_TYPE)5; | |
3380 } | |
3381 else | |
3382 { | |
3383 v667 = (PLAYER_SKILL_TYPE)20; | |
3384 } | |
3385 } | |
3386 else | |
3387 { | |
3388 v667 = (PLAYER_SKILL_TYPE)19; | |
3389 } | |
3390 } | |
3391 else | |
3392 { | |
3393 v667 = (PLAYER_SKILL_TYPE)18; | |
3394 } | |
3395 } | |
3396 else | |
3397 { | |
3398 v667 = (PLAYER_SKILL_TYPE)17; | |
3399 } | |
3400 } | |
3401 else | |
3402 { | |
3403 v667 = (PLAYER_SKILL_TYPE)16; | |
3404 } | |
3405 } | |
3406 else | |
3407 { | |
3408 v667 = (PLAYER_SKILL_TYPE)15; | |
3409 } | |
3410 } | |
3411 else | |
3412 { | |
3413 v667 = (PLAYER_SKILL_TYPE)14; | |
3414 } | |
3415 } | |
3416 else | |
3417 { | |
3418 v667 = (PLAYER_SKILL_TYPE)13; | |
3419 } | |
3420 } | |
3421 else | |
3422 { | |
3423 v667 = (PLAYER_SKILL_TYPE)12; | |
3424 } | |
3425 LODWORD(v725) = v667; | |
3426 v9 = pPlayer->GetActualSkillLevel(v667); | |
3427 v723 = v9 & 0x3F; | |
3428 v2 = v9 & 0x3F; | |
3429 goto LABEL_45; | |
3430 } | |
3431 v11 = v7; | |
3432 v10 = v7 & 0x3F; | |
3433 v723 = v10; | |
3434 v2 = v10; | |
3435 LABEL_47: | |
3436 if ( HIBYTE(v11) & 1 ) | |
3437 { | |
3438 v12 = 4; | |
3439 v731 = 4; | |
3440 } | |
3441 else | |
3442 { | |
3443 if ( (v11 & 0x80u) == 0 ) | |
3444 { | |
3445 v10 = ((v11 & 0x40) != 0) + 1; | |
3446 v731 = ((v11 & 0x40) != 0) + 1; | |
3447 } | |
3448 else | |
3449 { | |
3450 v731 = 3; | |
3451 } | |
3452 v12 = v731; | |
3453 } | |
3454 LOWORD(v10) = v3->spellnum; | |
3455 v730 = v10; | |
3456 v13 = v12 + 10 * (signed __int16)v10; | |
3457 v14 = v3->field_A == (short)v1; | |
3458 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing | |
3459 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); | |
3460 uRequiredMana = v15; | |
3461 sRecoveryTime = v16; | |
3462 if ( !v14 ) | |
3463 uRequiredMana = v1; | |
3464 if ( pParty->uCurrentHour == v1 ) | |
3465 { | |
3466 if ( pParty->uCurrentMinute != v1 ) | |
3467 goto LABEL_62; | |
3468 if ( LODWORD(v725) == 20 ) | |
3469 goto LABEL_61; | |
3470 } | |
3471 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == v1 && LODWORD(v725) == 19 ) | |
3472 LABEL_61: | |
3473 uRequiredMana = v1; | |
3474 LABEL_62: | |
3475 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) | |
3476 break; | |
3477 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); | |
3478 LABEL_203: | |
3479 v3->spellnum = v1; | |
3480 LABEL_1166: | |
3481 ++n; | |
3482 if ( n >= 10 ) | |
3483 return; | |
3484 } | |
3485 if ( !pPlayer->pConditions[0] || (signed __int16)v730 >= 100 ) | |
3486 goto LABEL_69; | |
3487 if ( rand() % 100 >= 50 ) | |
3488 { | |
3489 v12 = v731; | |
3490 LABEL_69: | |
3491 switch ( v3->spellnum ) | |
3492 { | |
3493 case 100: | |
3494 case 101: | |
3495 v17 = pPlayer; | |
3496 _this = (ItemGen *)1; | |
3497 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[5]) >= 3 ) | |
3498 _this = (ItemGen *)2; | |
3499 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3500 a1.stru_24.Reset(); | |
3501 v18 = v3->spellnum; | |
3502 a1.field_4C = v2; | |
3503 a1.field_48 = v18; | |
3504 a1.field_50 = v731; | |
3505 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3506 if ( v17->WearsItem(510, 2) ) | |
3507 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3508 a1.vPosition.x = pParty->vPosition.x; | |
3509 a1.vPosition.y = pParty->vPosition.y; | |
3510 a1.uAttributes = 0; | |
3511 a1.uSpriteFrameID = 0; | |
3512 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3513 v19 = 8 * v3->uPlayerID; | |
3514 LOBYTE(v19) = v19 | 4; | |
3515 a1.field_58 = v19; | |
3516 a1.field_5C = a2; | |
3517 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3518 a1.uFacing = LOWORD(v715.uYawAngle); | |
3519 a1.uSoundID = LOWORD(v3->field_10); | |
3520 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3521 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3522 a1.uAttributes = 256; | |
3523 if ( pParty->bTurnBasedModeOn == 1 ) | |
3524 a1.uAttributes = 260; | |
3525 for ( i = 0; i < (signed int)this; ++i ) | |
3526 { | |
3527 if ( i ) | |
3528 a1.vPosition.z += 32; | |
3529 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3530 if ( a1.Create( | |
3531 v715.uYawAngle, | |
3532 v715.uPitchAngle, | |
3533 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3534 v3->uPlayerID + 1) != -1 | |
3535 && pParty->bTurnBasedModeOn == 1 ) | |
3536 ++pTurnEngine->field_1C; | |
3537 } | |
3538 goto LABEL_83; | |
3539 case 102: | |
3540 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); | |
3541 a1.stru_24.Reset(); | |
3542 a1.field_48 = v3->spellnum; | |
3543 a1.field_4C = v723; | |
3544 a1.field_50 = v731; | |
3545 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3546 a1.vPosition.x = pParty->vPosition.x; | |
3547 a1.vPosition.y = pParty->vPosition.y; | |
3548 a1.uAttributes = 0; | |
3549 a1.uSpriteFrameID = 0; | |
3550 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3551 v22 = 8 * v3->uPlayerID; | |
3552 LOBYTE(v22) = v22 | 4; | |
3553 a1.field_58 = v22; | |
3554 a1.field_5C = a2; | |
3555 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3556 a1.uFacing = LOWORD(v715.uYawAngle); | |
3557 a1.uSoundID = LOWORD(v3->field_10); | |
3558 memcpy( | |
3559 &a1.stru_24, | |
3560 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3561 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3562 + 5], | |
3563 sizeof(a1.stru_24)); | |
3564 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3565 HIBYTE(a1.uAttributes) |= 1u; | |
3566 a1.uSectorID = v23; | |
3567 if ( pParty->bTurnBasedModeOn == 1 ) | |
3568 LOBYTE(a1.uAttributes) |= 4u; | |
3569 if ( a1.Create( | |
3570 v715.uYawAngle, | |
3571 v715.uPitchAngle, | |
3572 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3573 v3->uPlayerID + 1) != -1 | |
3574 && pParty->bTurnBasedModeOn == 1 ) | |
3575 ++pTurnEngine->field_1C; | |
3576 goto LABEL_83; | |
3577 case 1: | |
3578 LODWORD(v733) = 3600 * v2; | |
3579 v24 = v12 - 2; | |
3580 if ( v24 ) | |
3581 { | |
3582 v25 = v24 - 1; | |
3583 if ( v25 && v25 != 1 ) | |
3584 amount = 2; | |
3585 else | |
3586 amount = 4; | |
3587 } | |
3588 else | |
3589 { | |
3590 amount = 3; | |
3591 } | |
3592 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3593 goto LABEL_83; | |
3594 v668 = v1; | |
3595 v658 = v1; | |
3596 v653 = amount; | |
3597 v651 = v731; | |
3598 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); | |
3599 v27 = (char *)&pParty->pPartyBuffs[16]; | |
3600 goto LABEL_101; | |
3601 case 7: | |
3602 v29 = v12 - 2; | |
3603 if ( v29 ) | |
3604 { | |
3605 v30 = v29 - 1; | |
3606 if ( v30 ) | |
3607 { | |
3608 if ( v30 == 1 ) | |
3609 amount = 9; | |
3610 else | |
3611 amount = 3; | |
3612 } | |
3613 else | |
3614 { | |
3615 amount = 7; | |
3616 } | |
3617 } | |
3618 else | |
3619 { | |
3620 amount = 5; | |
3621 } | |
3622 v31 = v3->uPlayerID; | |
3623 HIDWORD(v733) = v1; | |
3624 v32 = 8 * v31; | |
3625 LOBYTE(v32) = v32 | 4; | |
3626 if ( (signed int)uNumLayingItems > v1 ) | |
3627 { | |
3628 v33 = (char *)&pLayingItems[0].field_48; | |
3629 v730 = uNumLayingItems; | |
3630 do | |
3631 { | |
3632 if ( *((short *)v33 - 36) != (short)v1 && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) | |
3633 ++HIDWORD(v733); | |
3634 v33 += 112; | |
3635 --v730; | |
3636 } | |
3637 while ( v730 ); | |
3638 } | |
3639 if ( SHIDWORD(v733) > amount ) | |
3640 goto LABEL_200; | |
3641 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3642 goto LABEL_83; | |
3643 a1.stru_24.Reset(); | |
3644 a1.field_48 = v3->spellnum; | |
3645 a1.field_4C = v2; | |
3646 a1.field_50 = v731; | |
3647 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3648 a1.vPosition.y = pParty->vPosition.y; | |
3649 a1.vPosition.x = pParty->vPosition.x; | |
3650 a1.uAttributes = v1; | |
3651 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3652 a1.uSectorID = pIndoor->GetSector( | |
3653 pParty->vPosition.x, | |
3654 pParty->vPosition.y, | |
3655 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3656 a1.uSpriteFrameID = v1; | |
3657 v34 = 8 * v3->uPlayerID; | |
3658 LOBYTE(v34) = v34 | 4; | |
3659 a1.field_58 = v34; | |
3660 a1.field_5C = a2; | |
3661 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3662 a1.uFacing = LOWORD(v715.uYawAngle); | |
3663 a1.uSoundID = LOWORD(v3->field_10); | |
3664 if ( pParty->bTurnBasedModeOn == 1 ) | |
3665 LOBYTE(a1.uAttributes) |= 4u; | |
3666 v669 = v3->uPlayerID + 1; | |
3667 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3668 v35 = pParty->sRotationX + 10; | |
3669 goto LABEL_124; | |
3670 case 20: | |
3671 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3672 goto LABEL_83; | |
3673 if ( a2 == v1 ) | |
3674 goto LABEL_200; | |
141 | 3675 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3676 goto LABEL_1056; |
3677 v699 = v1; | |
3678 v698 = v1; | |
3679 v697 = v1; | |
3680 a1.stru_24.Reset(); | |
3681 a1.field_48 = v3->spellnum; | |
3682 a1.field_4C = v2; | |
3683 a1.field_50 = v731; | |
3684 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3685 a1.uAttributes = v1; | |
3686 a1.uSectorID = v1; | |
3687 a1.uSpriteFrameID = v1; | |
3688 v37 = v3->uPlayerID; | |
3689 a1.field_60_distance_related_prolly_lod = 0; | |
3690 v37 *= 8; | |
3691 LOBYTE(v37) = v37 | 4; | |
3692 a1.uFacing = v1; | |
3693 a1.field_58 = v37; | |
3694 v38 = a2 >> 3; | |
3695 a1.uSoundID = LOWORD(v3->field_10); | |
3696 v39 = a2 >> 3; | |
3697 a1.vPosition.x = pActors[v39].vPosition.x; | |
3698 v40 = pActors[v39].vPosition.y; | |
3699 a1.vPosition.z = pActors[v39].vPosition.z; | |
3700 v41 = 8 * (a2 >> 3); | |
3701 a1.vPosition.y = v40; | |
3702 LOBYTE(v41) = v41 | 3; | |
3703 a1.field_5C = v41; | |
3704 v42 = a1.Create(0, v1, v1, v1); | |
3705 v43 = &v697; | |
3706 goto LABEL_133; | |
3707 case 44: | |
3708 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3709 goto LABEL_83; | |
3710 v726 = (Player *)(a2 >> 3); | |
3711 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3712 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3713 goto LABEL_1056; |
90 | 3714 pActors[a2 >> 3].pActorBuffs[10].Apply( |
0 | 3715 pMiscTimer->uTotalGameTimeElapsed + 128, |
3716 v1, | |
3717 v1, | |
3718 v1, | |
3719 v1); | |
3720 v706 = v1; | |
3721 v705 = v1; | |
3722 v704 = v1; | |
3723 a1.stru_24.Reset(); | |
3724 a1.field_48 = v3->spellnum; | |
3725 a1.field_4C = v2; | |
3726 a1.field_50 = v731; | |
3727 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3728 a1.uAttributes = v1; | |
3729 a1.uSectorID = v1; | |
3730 a1.uSpriteFrameID = v1; | |
3731 v44 = v3->uPlayerID; | |
3732 a1.field_60_distance_related_prolly_lod = 0; | |
3733 a1.uFacing = v1; | |
3734 v44 *= 8; | |
3735 LOBYTE(v44) = v44 | 4; | |
3736 v38 = (signed int)v726; | |
3737 a1.field_58 = v44; | |
3738 a1.uSoundID = LOWORD(v3->field_10); | |
3739 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3740 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3741 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3742 v46 = 8 * (int)v726; | |
3743 a1.vPosition.y = v45; | |
3744 LOBYTE(v46) = 8 * (char)v726 | 3; | |
3745 a1.field_5C = v46; | |
3746 v42 = a1.Create(0, v1, v1, v1); | |
3747 v43 = &v704; | |
3748 LABEL_133: | |
3749 v670 = (Vec3_int_ *)v43; | |
3750 v47 = v38; | |
3751 goto LABEL_139; | |
3752 case 79: | |
141 | 3753 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 3754 goto LABEL_83; |
3755 v730 = a2 >> 3; | |
3756 v693 = v1; | |
3757 HIDWORD(v733) = (int)&pActors[a2 >> 3]; | |
3758 v692 = v1; | |
3759 v691 = v1; | |
3760 a1.stru_24.Reset(); | |
3761 a1.field_48 = v3->spellnum; | |
3762 a1.field_4C = v2; | |
3763 a1.field_50 = v731; | |
3764 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3765 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | |
3766 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3767 v48 = *(short *)(HIDWORD(v733) + 138); | |
3768 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
3769 a1.uAttributes = v1; | |
3770 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); | |
3771 a1.uSpriteFrameID = v1; | |
3772 v49 = 8 * v3->uPlayerID; | |
3773 LOBYTE(v49) = v49 | 4; | |
3774 a1.field_58 = v49; | |
3775 a1.field_5C = a2; | |
3776 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3777 a1.uFacing = LOWORD(v715.uYawAngle); | |
3778 LOWORD(v49) = LOWORD(v3->field_10); | |
3779 LOBYTE(a1.uAttributes) |= 0x80u; | |
3780 a1.uSoundID = v49; | |
3781 v726 = (Player *)a1.Create(0, v1, v1, v1); | |
3782 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) | |
3783 goto LABEL_200; | |
3784 v47 = v730; | |
3785 v670 = (Vec3_int_ *)&v691; | |
3786 v42 = (signed int)v726; | |
3787 LABEL_139: | |
3788 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3789 goto LABEL_1056; | |
3790 case 2: | |
3791 case 6: | |
3792 case 11: | |
3793 case 18: | |
3794 case 26: | |
3795 case 32: | |
3796 case 34: | |
3797 case 37: | |
3798 case 57: | |
3799 case 65: | |
3800 case 70: | |
3801 case 78: | |
3802 case 97: | |
3803 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3804 goto LABEL_83; | |
3805 a1.stru_24.Reset(); | |
3806 a1.field_48 = v3->spellnum; | |
3807 a1.field_4C = v2; | |
3808 a1.field_50 = v731; | |
3809 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3810 a1.vPosition.y = pParty->vPosition.y; | |
3811 a1.vPosition.x = pParty->vPosition.x; | |
3812 a1.uAttributes = v1; | |
3813 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3814 a1.uSectorID = pIndoor->GetSector( | |
3815 pParty->vPosition.x, | |
3816 pParty->vPosition.y, | |
3817 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3818 a1.uSpriteFrameID = v1; | |
3819 v50 = 8 * v3->uPlayerID; | |
3820 LOBYTE(v50) = v50 | 4; | |
3821 a1.field_58 = v50; | |
3822 a1.field_5C = a2; | |
3823 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3824 a1.uFacing = LOWORD(v715.uYawAngle); | |
3825 a1.uSoundID = LOWORD(v3->field_10); | |
3826 if ( pParty->bTurnBasedModeOn == 1 ) | |
3827 LOBYTE(a1.uAttributes) |= 4u; | |
3828 if ( v3->spellnum == 18 ) | |
3829 LOBYTE(a1.uAttributes) |= 0x40u; | |
3830 goto LABEL_156; | |
3831 case 29: | |
3832 case 39: | |
3833 case 76: | |
3834 case 90: | |
3835 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3836 goto LABEL_83; | |
3837 a1.stru_24.Reset(); | |
3838 a1.field_48 = v3->spellnum; | |
3839 a1.field_4C = v2; | |
3840 a1.field_50 = v731; | |
3841 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3842 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3843 a1.vPosition.y = pParty->vPosition.y; | |
3844 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3845 v660 = pParty->vPosition.y; | |
3846 goto LABEL_153; | |
3847 case 87: | |
3848 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3849 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3850 goto LABEL_200; | |
3851 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3852 goto LABEL_152; | |
3853 goto LABEL_83; | |
3854 case 81: | |
3855 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3856 goto LABEL_83; | |
3857 if ( a2 == v1 | |
141 | 3858 || (a2 & 7) != OBJECT_Actor |
0 | 3859 || (v730 = a2 >> 3, |
3860 v721 = (int)&pActors[a2 >> 3], | |
3861 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3862 goto LABEL_1056; | |
3863 Actor::_403EB6(v730, 4u, 0x80u, (AIDirection *)v1); | |
3864 v726 = (Player *)(23040 * v2); | |
3865 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3866 v55 = v721; | |
3867 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, v1, v1, v1); | |
3868 *(char *)(v55 + 38) |= 8u; | |
3869 *(short *)(v55 + 148) = v1; | |
3870 v672 = v1; | |
3871 *(short *)(v55 + 150) = v1; | |
3872 v661 = (Actor *)v55; | |
3873 goto LABEL_165; | |
3874 case 35: | |
3875 if ( v12 == 2 ) | |
3876 { | |
3877 v57 = 300 * v2; | |
3878 } | |
3879 else | |
3880 { | |
3881 if ( v12 == 3 ) | |
3882 { | |
3883 amount = 4; | |
3884 v57 = 300 * v2; | |
3885 goto LABEL_174; | |
3886 } | |
3887 if ( v12 == 4 ) | |
3888 { | |
3889 v57 = 300 * v2; | |
3890 amount = 8; | |
3891 goto LABEL_174; | |
3892 } | |
3893 v57 = 180 * v2; | |
3894 } | |
3895 amount = 2; | |
3896 LABEL_174: | |
3897 LODWORD(v733) = v57; | |
3898 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3899 goto LABEL_83; | |
141 | 3900 if ( (a2 & 7) != OBJECT_Actor |
0 | 3901 || (v721 = 836 * (a2 >> 3), |
90 | 3902 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3903 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3904 goto LABEL_1056; |
3905 v726 = (Player *)(23040 * v2); | |
3906 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3907 v59 = v721; | |
112 | 3908 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3909 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3910 pParty->uTimePlayed + (signed int)v58, | |
0 | 3911 v731, |
3912 amount, | |
3913 v1, | |
3914 v1); | |
3915 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; | |
3916 v672 = v1; | |
3917 v661 = (Actor *)LODWORD(v718); | |
3918 goto LABEL_165; | |
3919 case 60: | |
3920 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3921 goto LABEL_83; | |
3922 v730 = 836 * (a2 >> 3); | |
90 | 3923 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3924 goto LABEL_1056; |
3925 LODWORD(v733) = 300 * v2; | |
3926 if ( v731 == 2 ) | |
3927 { | |
3928 LODWORD(v733) = 600 * v2; | |
3929 } | |
3930 else | |
3931 { | |
3932 if ( v731 == 3 ) | |
3933 LODWORD(v733) = 29030400; | |
3934 } | |
112 | 3935 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3936 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3937 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3938 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3939 v726 = (Player *)((int)v733 << 7); | |
3940 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3941 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3942 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
3943 v731, | |
3944 v1, | |
3945 v1, | |
3946 v1); | |
3947 a1.stru_24.Reset(); | |
3948 a1.field_48 = v3->spellnum; | |
3949 a1.field_4C = v2; | |
3950 a1.field_50 = v731; | |
3951 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 3952 v61 = a2 >> 3; |
0 | 3953 goto LABEL_1086; |
3954 case 92: | |
3955 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3956 goto LABEL_83; | |
3957 a1.stru_24.Reset(); | |
3958 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3959 a1.vPosition.x = pParty->vPosition.x; | |
3960 a1.vPosition.y = pParty->vPosition.y; | |
3961 a1.uAttributes = v1; | |
3962 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3963 a1.uSectorID = pIndoor->GetSector( | |
3964 pParty->vPosition.x, | |
3965 pParty->vPosition.y, | |
3966 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3967 a1.uSpriteFrameID = v1; | |
3968 v62 = 8 * v3->uPlayerID; | |
3969 LOBYTE(v62) = v62 | 4; | |
3970 a1.field_58 = v62; | |
3971 a1.field_5C = a2; | |
3972 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3973 a1.uFacing = LOWORD(v715.uYawAngle); | |
3974 a1.uSoundID = LOWORD(v3->field_10); | |
3975 a1.field_50 = v731; | |
3976 a1.field_48 = 3; | |
3977 a1.field_4C = 300 * v2; | |
3978 goto LABEL_154; | |
3979 case 4: | |
3980 v63 = v12 - 1; | |
3981 if ( !v63 ) | |
3982 { | |
3983 amount = 10; | |
3984 goto LABEL_195; | |
3985 } | |
3986 v64 = v63 - 1; | |
3987 if ( !v64 ) | |
3988 { | |
3989 amount = 11; | |
3990 goto LABEL_195; | |
3991 } | |
3992 v65 = v64 - 1; | |
3993 if ( !v65 ) | |
3994 { | |
3995 amount = 12; | |
3996 LABEL_195: | |
3997 LODWORD(v733) = 3600 * v2; | |
3998 goto LABEL_196; | |
3999 } | |
4000 if ( v65 == 1 ) | |
4001 { | |
4002 LODWORD(v733) = v1; | |
4003 amount = 12; | |
4004 } | |
4005 LABEL_196: | |
4006 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4007 goto LABEL_83; | |
89 | 4008 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
4009 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
4010 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
4011 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
4012 { | |
4013 if ( !(v730c->uAttributes & 2) ) | |
0 | 4014 { |
89 | 4015 if ( v730c->uAdditionalValue == v1 ) |
0 | 4016 { |
89 | 4017 if ( v730c->_bonus_type == v1 ) |
0 | 4018 { |
4019 v68 = BYTE4(v726->pConditions[3]); | |
4020 if ( !v68 || v68 == 1 || v68 == 2 ) | |
4021 { | |
89 | 4022 if ( !pItemsTable->_456D5E_is_some_material(v730c) ) |
0 | 4023 { |
89 | 4024 v69 = v730c; |
0 | 4025 v14 = v731 == 4; |
4026 *(int *)(v730 + 12) = amount; | |
4027 if ( !v14 ) | |
4028 { | |
4029 v726 = (Player *)((int)v733 << 7); | |
4030 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
4031 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
4032 * 0.033333335); | |
4033 *(int *)(v69 + 20) |= 8u; | |
4034 } | |
4035 *(int *)(v69 + 20) |= 0x10u; | |
4036 LABEL_1055: | |
4037 dword_50C9A8 = 256; | |
4038 LABEL_1056: | |
4039 LODWORD(v727) = 1; | |
4040 LABEL_83: | |
4041 if ( v3->field_8 & 0x20 ) | |
4042 { | |
4043 LABEL_1162: | |
4044 if ( v727 != 0.0 ) | |
4045 pAudioPlayer->PlaySound( | |
4046 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4047 0, | |
4048 0, | |
4049 -1, | |
4050 0, | |
4051 v3->field_10, | |
4052 0, | |
4053 0); | |
4054 } | |
4055 else | |
4056 { | |
4057 if ( sRecoveryTime < 0 ) | |
4058 sRecoveryTime = 0; | |
4059 if ( pParty->bTurnBasedModeOn ) | |
4060 { | |
4061 v645 = sRecoveryTime; | |
4062 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4063 pPlayer->SetRecoveryTime(v645); | |
4064 if ( !some_active_character ) | |
4065 pTurnEngine->_40471C(); | |
4066 } | |
4067 else | |
4068 { | |
4069 pPlayer->SetRecoveryTime( | |
4070 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4071 } | |
4072 if ( v727 != 0.0 ) | |
4073 { | |
4074 pPlayer->PlaySound(49, 0); | |
4075 goto LABEL_1162; | |
4076 } | |
4077 } | |
4078 v3->spellnum = 0; | |
4079 v1 = 0; | |
4080 LABEL_1165: | |
4081 v2 = v723; | |
4082 goto LABEL_1166; | |
4083 } | |
4084 } | |
4085 } | |
4086 } | |
4087 } | |
4088 } | |
4089 LABEL_199: | |
4090 dword_50C9D0 = 113; | |
4091 dword_50C9D4 = v1; | |
4092 dword_50C9D8 = 1; | |
4093 LABEL_200: | |
4094 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4095 LABEL_201: | |
4096 v67 = 2; | |
4097 LABEL_202: | |
4098 ShowStatusBarString(v66, v67); | |
4099 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4100 goto LABEL_203; | |
4101 case 71: | |
4102 v70 = v12 - 1; | |
4103 LODWORD(v733) = 3600 * v2; | |
4104 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4105 { | |
4106 v72 = v71 - 1; | |
4107 if ( v72 ) | |
4108 { | |
4109 if ( v72 == 1 ) | |
4110 amount = 10; | |
4111 } | |
4112 else | |
4113 { | |
4114 amount = 3; | |
4115 } | |
4116 } | |
4117 else | |
4118 { | |
4119 amount = 1; | |
4120 } | |
4121 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4122 goto LABEL_83; | |
4123 v73 = v3->uPlayerID_2; | |
4124 v74 = v3->spellnum; | |
4125 v75 = pGame->GetStru6(); | |
4126 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); | |
4127 v668 = v1; | |
4128 v658 = v1; | |
4129 v653 = amount; | |
4130 v651 = v731; | |
4131 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); | |
4132 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; | |
4133 goto LABEL_103; | |
4134 case 3: | |
4135 case 14: | |
4136 case 25: | |
4137 case 36: | |
4138 case 58: | |
4139 case 69: | |
4140 v76 = v12 - 1; | |
4141 LODWORD(v733) = 3600 * v2; | |
4142 if ( v76 ) | |
4143 { | |
4144 v77 = v76 - 1; | |
4145 if ( v77 ) | |
4146 { | |
4147 v78 = v77 - 1; | |
4148 if ( v78 ) | |
4149 { | |
4150 if ( v78 != 1 ) | |
4151 goto LABEL_232; | |
4152 v79 = 4 * v2; | |
4153 } | |
4154 else | |
4155 { | |
4156 v79 = 3 * v2; | |
4157 } | |
4158 } | |
4159 else | |
4160 { | |
4161 v79 = 2 * v2; | |
4162 } | |
4163 amount = v79; | |
4164 } | |
4165 else | |
4166 { | |
4167 amount = v2; | |
4168 } | |
4169 LABEL_232: | |
4170 v80 = v3->spellnum; | |
4171 switch ( v80 ) | |
4172 { | |
4173 case 3: | |
4174 LODWORD(v725) = 6; | |
4175 break; | |
4176 case 14: | |
4177 LODWORD(v725) = v1; | |
4178 break; | |
4179 case 25: | |
4180 LODWORD(v725) = 17; | |
4181 break; | |
4182 case 36: | |
4183 LODWORD(v725) = 4; | |
4184 break; | |
4185 case 58: | |
4186 LODWORD(v725) = 12; | |
4187 break; | |
4188 default: | |
4189 if ( v80 != 69 ) | |
4190 goto LABEL_1166; | |
4191 LODWORD(v725) = 1; | |
4192 break; | |
4193 } | |
4194 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4195 goto LABEL_83; | |
4196 v81 = v3->spellnum; | |
4197 v82 = pGame->GetStru6(); | |
4198 pGame->GetStru6()->SetPlayerBuffAnim(v81, v1); | |
4199 v83 = 1; | |
4200 v84 = v3->spellnum; | |
4201 v85 = pGame->GetStru6(); | |
4202 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1u); | |
4203 v86 = v3->spellnum; | |
4204 v87 = pGame->GetStru6(); | |
4205 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2u); | |
4206 v88 = v3->spellnum; | |
4207 v89 = pGame->GetStru6(); | |
4208 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3u); | |
4209 v90 = (double)(signed int)v733 * 4.2666669; | |
4210 goto LABEL_304; | |
4211 case 5: | |
4212 if ( v12 <= v1 ) | |
4213 goto LABEL_254; | |
4214 if ( v12 <= 2 ) | |
4215 { | |
4216 v91 = 60 * (v2 + 60); | |
4217 } | |
4218 else | |
4219 { | |
4220 if ( v12 == 3 ) | |
4221 { | |
4222 v91 = 180 * (v2 + 20); | |
4223 } | |
4224 else | |
4225 { | |
4226 if ( v12 != 4 ) | |
4227 goto LABEL_254; | |
4228 v91 = 240 * (v2 + 15); | |
4229 } | |
4230 } | |
4231 LODWORD(v733) = v91; | |
4232 LABEL_254: | |
4233 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4234 { | |
89 | 4235 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4236 LODWORD(v727) = 1; |
4237 do | |
4238 { | |
89 | 4239 if ( v92->pConditions ) |
0 | 4240 LODWORD(v727) = v1; |
89 | 4241 ++v92; |
0 | 4242 } |
89 | 4243 while ( v92 <= &pParty->pPlayers[3] ); |
0 | 4244 if ( LODWORD(v727) != v1 ) |
4245 { | |
4246 v726 = (Player *)((int)v733 << 7); | |
4247 pParty->pPartyBuffs[8].Apply( | |
4248 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
4249 v731, | |
4250 v1, | |
4251 v1, | |
4252 v1); | |
4253 v93 = v3->spellnum; | |
4254 v94 = pGame->GetStru6(); | |
4255 pGame->GetStru6()->SetPlayerBuffAnim(v93, v1); | |
4256 v95 = v3->spellnum; | |
4257 v96 = pGame->GetStru6(); | |
4258 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1u); | |
4259 v97 = v3->spellnum; | |
4260 v98 = pGame->GetStru6(); | |
4261 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2u); | |
4262 v99 = v3->spellnum; | |
4263 v100 = pGame->GetStru6(); | |
4264 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3u); | |
4265 } | |
4266 } | |
4267 goto LABEL_83; | |
4268 case 46: | |
4269 v101 = v12 - 1; | |
4270 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4271 { | |
4272 v103 = v102 - 1; | |
4273 if ( v103 ) | |
4274 { | |
4275 if ( v103 != 1 ) | |
4276 goto LABEL_269; | |
4277 v104 = 3600 * (v2 + 1); | |
4278 } | |
4279 else | |
4280 { | |
4281 v104 = 900 * (v2 + 4); | |
4282 } | |
4283 } | |
4284 else | |
4285 { | |
4286 v104 = 300 * (v2 + 12); | |
4287 } | |
4288 LODWORD(v733) = v104; | |
4289 LABEL_269: | |
4290 amount = v2 + 5; | |
4291 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4292 goto LABEL_83; | |
4293 if ( v731 == 1 ) | |
4294 { | |
4295 v108 = v3->uPlayerID_2; | |
4296 v109 = v3->spellnum; | |
4297 v110 = pGame->GetStru6(); | |
4298 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
4299 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, v1, 65536); | |
4300 v668 = v1; | |
4301 v716 = v111; | |
4302 v658 = v111; | |
4303 v653 = amount; | |
4304 v726 = (Player *)((int)v733 << 7); | |
4305 v651 = 1; | |
4306 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4307 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[1]; | |
4308 goto LABEL_103; | |
4309 } | |
4310 v105 = 0; | |
4311 v726 = (Player *)((int)v733 << 7); | |
4312 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4313 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4314 do |
4315 { | |
4316 v106 = v3->spellnum; | |
4317 v107 = pGame->GetStru6(); | |
4318 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); | |
4319 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, v1, 65536); | |
89 | 4320 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
4321 ++v730b; | |
0 | 4322 ++v105; |
4323 } | |
89 | 4324 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4325 goto LABEL_1056; |
4326 case 52: | |
141 | 4327 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == OBJECT_Actor) |
0 | 4328 { |
4329 v730 = a2 >> 3; | |
4330 v112 = &pActors[a2 >> 3]; | |
4331 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4332 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4333 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4334 _this = (ItemGen *)v113; | |
4335 v114 = v721; | |
4336 v115 = (unsigned int)v726; | |
4337 if ( v113 < v721 ) | |
4338 { | |
4339 v116 = v113; | |
4340 v113 = v721; | |
4341 v114 = v116; | |
4342 } | |
4343 if ( v113 < (signed int)v726 ) | |
4344 { | |
4345 v117 = v113; | |
4346 v113 = (int)v726; | |
4347 v115 = v117; | |
4348 } | |
4349 if ( v114 < (signed int)v115 ) | |
4350 { | |
4351 v118 = v115; | |
4352 v115 = v114; | |
4353 v114 = v118; | |
4354 } | |
4355 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4356 if ( (double)(signed int)this <= 307.2 ) | |
4357 { | |
4358 v703 = 0; | |
4359 v702 = 0; | |
4360 v701 = 0; | |
4361 a1.stru_24.Reset(); | |
4362 v119 = HIDWORD(v733); | |
4363 a1.field_48 = *(int *)HIDWORD(v733); | |
4364 a1.field_4C = v723; | |
4365 a1.field_50 = v731; | |
4366 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4367 a1.uAttributes = 0; | |
4368 a1.uSectorID = 0; | |
4369 a1.uSpriteFrameID = 0; | |
4370 v120 = 8 * *(short *)(v119 + 2); | |
4371 LOBYTE(v120) = v120 | 4; | |
4372 a1.field_60_distance_related_prolly_lod = 0; | |
4373 a1.field_58 = v120; | |
4374 a1.uFacing = 0; | |
4375 a1.uSoundID = *(short *)(v119 + 16); | |
4376 a1.vPosition.x = v112->vPosition.x; | |
4377 a1.vPosition.y = v112->vPosition.y; | |
4378 v726 = (Player *)v112->uActorHeight; | |
4379 v121 = 8 * a2; | |
4380 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4381 LOBYTE(v121) = 8 * a2 | 3; | |
4382 a1.field_5C = v121; | |
4383 v122 = a1.Create(0, 0, 0, 0); | |
4384 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4385 LODWORD(v727) = 1; | |
4386 } | |
4387 else | |
4388 { | |
4389 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4390 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4391 *(int *)HIDWORD(v733) = 0; | |
4392 } | |
4393 v3 = (stru277 *)HIDWORD(v733); | |
4394 } | |
4395 goto LABEL_83; | |
4396 case 17: | |
4397 case 38: | |
4398 case 51: | |
4399 v123 = v12 - 1; | |
4400 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4401 { | |
4402 v125 = v124 - 1; | |
4403 if ( v125 ) | |
4404 { | |
4405 if ( v125 != 1 ) | |
4406 goto LABEL_296; | |
4407 v126 = 3600 * (v2 + 1); | |
4408 } | |
4409 else | |
4410 { | |
4411 v126 = 900 * (v2 + 4); | |
4412 } | |
4413 } | |
4414 else | |
4415 { | |
4416 v126 = 300 * (v2 + 12); | |
4417 } | |
4418 LODWORD(v733) = v126; | |
4419 LABEL_296: | |
4420 v127 = v3->spellnum; | |
4421 if ( v127 == 17 ) | |
4422 { | |
4423 amount = v1; | |
4424 LODWORD(v725) = 14; | |
4425 } | |
4426 else | |
4427 { | |
4428 if ( v127 == 38 ) | |
4429 { | |
4430 LODWORD(v725) = 15; | |
4431 amount = v2 + 5; | |
4432 } | |
4433 else | |
4434 { | |
4435 if ( v127 != 51 ) | |
4436 goto LABEL_1166; | |
4437 LODWORD(v725) = 9; | |
4438 amount = v2 + 5; | |
4439 } | |
4440 } | |
4441 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4442 goto LABEL_83; | |
4443 v128 = v3->spellnum; | |
4444 v129 = pGame->GetStru6(); | |
4445 pGame->GetStru6()->SetPlayerBuffAnim(v128, v1); | |
4446 v83 = 1; | |
4447 v130 = v3->spellnum; | |
4448 v131 = pGame->GetStru6(); | |
4449 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1u); | |
4450 v132 = v3->spellnum; | |
4451 v133 = pGame->GetStru6(); | |
4452 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2u); | |
4453 v134 = v3->spellnum; | |
4454 v135 = pGame->GetStru6(); | |
4455 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3u); | |
4456 v726 = (Player *)((int)v733 << 7); | |
4457 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
4458 LABEL_304: | |
4459 v673 = v1; | |
4460 v662 = v1; | |
4461 v655 = amount; | |
4462 v652 = v731; | |
4463 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; | |
4464 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; | |
4465 goto LABEL_977; | |
4466 case 8: | |
4467 v138 = v12 - 2; | |
4468 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4469 v140 = 600 * v2; | |
4470 else | |
4471 v140 = 60 * v2; | |
4472 LODWORD(v733) = v140; | |
4473 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4474 goto LABEL_83; | |
4475 v141 = v3->spellnum; | |
4476 v142 = pGame->GetStru6(); | |
4477 pGame->GetStru6()->SetPlayerBuffAnim(v141, v1); | |
4478 v143 = v3->spellnum; | |
4479 v144 = pGame->GetStru6(); | |
4480 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1u); | |
4481 v145 = v3->spellnum; | |
4482 v146 = pGame->GetStru6(); | |
4483 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2u); | |
4484 v147 = v3->spellnum; | |
4485 v148 = pGame->GetStru6(); | |
4486 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3u); | |
4487 v668 = v1; | |
4488 v726 = (Player *)((int)v733 << 7); | |
4489 v658 = v1; | |
4490 v653 = v2; | |
4491 v651 = v731; | |
4492 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4493 v27 = (char *)&pParty->pPartyBuffs[10]; | |
4494 goto LABEL_102; | |
4495 case 9: | |
4496 v149 = v12 - 1; | |
4497 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4498 { | |
4499 if ( v151 == 1 ) | |
4500 _this = (ItemGen *)20; | |
4501 } | |
4502 else | |
4503 { | |
4504 _this = (ItemGen *)16; | |
4505 } | |
4506 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4507 { | |
4508 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4509 goto LABEL_201; | |
4510 } | |
4511 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4512 goto LABEL_83; | |
4513 LODWORD(v725) = a2 & 7; | |
141 | 4514 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4515 { |
4516 v152 = a2 >> 3; | |
4517 uRequiredMana = pActors[v152].vPosition.x; | |
4518 v153 = pActors[v152].vPosition.y; | |
4519 v154 = pActors[v152].vPosition.z; | |
4520 LODWORD(v727) = v153; | |
4521 } | |
4522 else | |
4523 { | |
4524 v155 = stru_5C6E00->SinCos(pParty->sRotationY); | |
4525 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); | |
4526 v156 = stru_5C6E00->_42EBDB(pParty->sRotationY); | |
4527 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); | |
4528 v154 = pParty->vPosition.z; | |
4529 } | |
4530 HIDWORD(v733) = v154; | |
4531 v713 = v154 + 2500; | |
4532 v721 = v1; | |
4533 LODWORD(v718) = v1; | |
4534 if ( (signed int)this > v1 ) | |
4535 { | |
4536 *(float *)&y = (double)SHIDWORD(v733); | |
4537 *(float *)&v732 = (double)v713; | |
4538 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4539 v726 = (Player *)this; | |
4540 do | |
4541 { | |
4542 v157 = rand(); | |
4543 v158 = (double)SLODWORD(v718); | |
4544 v718 = v158; | |
4545 v159 = (double)v721; | |
4546 *(float *)&v721 = v159; | |
4547 a2 = v157 % 1000; | |
4548 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4549 v725 = v159 * v159; | |
4550 *(float *)&_this = v158 * v158; | |
4551 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4552 { | |
4553 LODWORD(v687) = v1; | |
4554 HIDWORD(v687) = v1; | |
4555 } | |
4556 else | |
4557 { | |
4558 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4559 v687 = __PAIR__( | |
4560 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4561 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4562 } | |
4563 a1.stru_24.Reset(); | |
4564 a1.field_48 = v3->spellnum; | |
4565 a1.field_4C = v2; | |
4566 a1.field_50 = v731; | |
4567 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4568 a1.uAttributes = v1; | |
4569 a1.vPosition.x = uRequiredMana; | |
4570 a1.vPosition.y = LODWORD(v727); | |
4571 a1.uSectorID = v1; | |
4572 a1.vPosition.z = a2 + v713; | |
4573 a1.uSpriteFrameID = v1; | |
4574 a1.field_58 = 8 * v3->uPlayerID | 4; | |
4575 a1.field_5C = v730; | |
4576 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4577 a1.uFacing = v687; | |
4578 a1.uSoundID = LOWORD(v3->field_10); | |
4579 if ( pParty->bTurnBasedModeOn == 1 ) | |
4580 a1.uAttributes = 4; | |
4581 if ( a1.Create( | |
4582 v687, | |
4583 SHIDWORD(v687), | |
4584 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4585 v1) != -1 | |
4586 && pParty->bTurnBasedModeOn == 1 ) | |
4587 ++pTurnEngine->field_1C; | |
4588 LODWORD(v718) = rand() % 1024 - 512; | |
4589 v160 = rand(); | |
4590 v14 = v726 == (Player *)1; | |
4591 v726 = (Player *)((char *)v726 - 1); | |
4592 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4593 } | |
4594 while ( !v14 ); | |
4595 } | |
4596 goto LABEL_1056; | |
4597 case 10: | |
4598 v67 = 2; | |
4599 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4600 { | |
4601 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4602 goto LABEL_202; | |
4603 } | |
4604 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4605 goto LABEL_83; | |
4606 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
4607 v700.z = v1; | |
4608 v700.y = v1; | |
4609 v700.x = v1; | |
4610 a1.stru_24.Reset(); | |
4611 a1.field_48 = v3->spellnum; | |
4612 a1.field_4C = v2; | |
4613 a1.field_50 = v731; | |
4614 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4615 a1.uAttributes = v1; | |
4616 a1.uSectorID = v1; | |
4617 a1.uSpriteFrameID = v1; | |
4618 v161 = v3->uPlayerID; | |
4619 a1.field_60_distance_related_prolly_lod = 0; | |
4620 a1.uFacing = v1; | |
4621 v161 *= 8; | |
4622 LOBYTE(v161) = v161 | 4; | |
4623 a1.field_58 = v161; | |
4624 a1.uSoundID = LOWORD(v3->field_10); | |
4625 a2 = v1; | |
4626 if ( (signed int)v726 > v1 ) | |
4627 { | |
4628 do | |
4629 { | |
4630 v162 = dword_50BF30[a2]; | |
4631 a1.vPosition.x = pActors[v162].vPosition.x; | |
4632 a1.vPosition.y = pActors[v162].vPosition.y; | |
4633 v732 = pActors[v162].uActorHeight; | |
4634 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4635 v163 = 8 * dword_50BF30[a2]; | |
4636 LOBYTE(v163) = v163 | 3; | |
4637 a1.field_5C = v163; | |
4638 v164 = a1.Create(0, v1, v1, v1); | |
4639 v165 = a2; | |
4640 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
4641 v166 = pGame->GetStru6(); | |
4642 v166->_4A81CA(&a1); | |
4643 v167 = pGame->GetStru6(); | |
4644 v167->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
4645 a2 = v165 + 1; | |
4646 } | |
4647 while ( v165 + 1 < (signed int)v726 ); | |
4648 } | |
4649 goto LABEL_1056; | |
4650 case 12: | |
4651 LODWORD(v733) = 3600 * v2; | |
4652 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4653 goto LABEL_83; | |
4654 v168 = 0; | |
4655 do | |
4656 { | |
4657 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, v1, 65536); | |
4658 v716 = v169; | |
4659 } | |
4660 while ( v168 < 4 ); | |
4661 v668 = v1; | |
4662 v732 = (int)v733 << 7; | |
4663 v658 = v1; | |
4664 v653 = v1; | |
4665 v651 = v731; | |
4666 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4667 goto LABEL_992; | |
4668 case 13: | |
4669 v170 = v12 - 1; | |
4670 if ( !v170 ) | |
4671 { | |
4672 v173 = 300 * v2; | |
4673 goto LABEL_353; | |
4674 } | |
4675 v171 = v170 - 1; | |
4676 if ( !v171 ) | |
4677 { | |
4678 v173 = 600 * v2; | |
4679 goto LABEL_353; | |
4680 } | |
4681 v172 = v171 - 1; | |
4682 if ( !v172 || v172 == 1 ) | |
4683 { | |
4684 v173 = 3600 * v2; | |
4685 LABEL_353: | |
4686 LODWORD(v733) = v173; | |
4687 } | |
4688 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4689 goto LABEL_83; | |
4690 v174 = 0; | |
4691 do | |
4692 pOtherOverlayList->_4418B1(2010, v174++ + 100, v1, 65536); | |
4693 while ( v174 < 4 ); | |
4694 v175 = v3->spellnum; | |
4695 v176 = pGame->GetStru6(); | |
4696 pGame->GetStru6()->SetPlayerBuffAnim(v175, v1); | |
4697 v83 = 1; | |
4698 v177 = v3->spellnum; | |
4699 v178 = pGame->GetStru6(); | |
4700 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1u); | |
4701 v179 = v3->spellnum; | |
4702 v180 = pGame->GetStru6(); | |
4703 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2u); | |
4704 v181 = v3->spellnum; | |
4705 v182 = pGame->GetStru6(); | |
4706 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3u); | |
4707 v673 = v1; | |
4708 v732 = (int)v733 << 7; | |
4709 v662 = v1; | |
4710 v655 = v1; | |
4711 v652 = v731; | |
4712 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4713 v137 = (char *)&pParty->pPartyBuffs[5]; | |
4714 goto LABEL_976; | |
4715 case 15: | |
4716 v184 = v12 - 1; | |
4717 if ( v184 ) | |
4718 { | |
4719 v185 = v184 - 1; | |
4720 if ( v185 ) | |
4721 { | |
4722 v186 = v185 - 1; | |
4723 if ( v186 ) | |
4724 { | |
4725 if ( v186 == 1 ) | |
4726 amount = 9; | |
4727 } | |
4728 else | |
4729 { | |
4730 amount = 7; | |
4731 } | |
4732 } | |
4733 else | |
4734 { | |
4735 amount = 5; | |
4736 } | |
4737 } | |
4738 else | |
4739 { | |
4740 amount = 3; | |
4741 } | |
4742 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4743 goto LABEL_83; | |
4744 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
4745 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4746 a1.stru_24.Reset(); | |
4747 a1.field_48 = v3->spellnum; | |
4748 a1.field_4C = v2; | |
4749 a1.field_50 = v731; | |
4750 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4751 a1.vPosition.y = pParty->vPosition.y; | |
4752 a1.vPosition.x = pParty->vPosition.x; | |
4753 a1.uAttributes = v1; | |
4754 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4755 a1.uSectorID = pIndoor->GetSector( | |
4756 pParty->vPosition.x, | |
4757 pParty->vPosition.y, | |
4758 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
4759 a1.uSpriteFrameID = v1; | |
4760 v187 = 8 * v3->uPlayerID; | |
4761 LOBYTE(v187) = v187 | 4; | |
4762 a1.field_58 = v187; | |
4763 a1.field_5C = a2; | |
4764 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4765 a1.uSoundID = LOWORD(v3->field_10); | |
4766 if ( pParty->bTurnBasedModeOn == 1 ) | |
4767 LOBYTE(a1.uAttributes) |= 4u; | |
4768 v188 = (signed int)v726 / -2; | |
4769 v189 = (signed int)v726 / 2; | |
4770 while ( v188 <= v189 ) | |
4771 { | |
4772 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4773 if ( a1.Create( | |
4774 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4775 v715.uPitchAngle, | |
4776 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4777 v3->uPlayerID + 1) != -1 | |
4778 && pParty->bTurnBasedModeOn == 1 ) | |
4779 ++pTurnEngine->field_1C; | |
4780 v188 += v732; | |
4781 } | |
4782 goto LABEL_1056; | |
4783 case 16: | |
4784 if ( pParty->uFlags & 8 ) | |
4785 { | |
4786 v190 = pGlobalTXT_LocalizationStrings[493]; | |
4787 goto LABEL_462; | |
4788 } | |
4789 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4790 goto LABEL_83; | |
4791 v191 = 0; | |
4792 do | |
4793 pOtherOverlayList->_4418B1(2040, v191++ + 100, v1, 65536); | |
4794 while ( v191 < 4 ); | |
4795 BYTE1(pParty->uFlags) |= 1u; | |
4796 pParty->uFallSpeed = 1000; | |
4797 goto LABEL_1056; | |
4798 case 19: | |
4799 v192 = v12 - 1; | |
4800 if ( !v192 ) | |
4801 { | |
4802 amount = v2; | |
4803 goto LABEL_391; | |
4804 } | |
4805 v193 = v192 - 1; | |
4806 if ( !v193 ) | |
4807 { | |
4808 v196 = 2 * v2; | |
4809 LABEL_389: | |
4810 amount = v196; | |
4811 LABEL_391: | |
4812 v195 = 600 * v2; | |
4813 goto LABEL_392; | |
4814 } | |
4815 v194 = v193 - 1; | |
4816 if ( !v194 ) | |
4817 { | |
4818 v196 = 3 * v2; | |
4819 goto LABEL_389; | |
4820 } | |
4821 if ( v194 != 1 ) | |
4822 goto LABEL_393; | |
4823 amount = 4 * v2; | |
4824 v195 = 3600 * v2; | |
4825 LABEL_392: | |
4826 LODWORD(v733) = v195; | |
4827 LABEL_393: | |
4828 if ( pParty->uFlags & 0x30 ) | |
4829 { | |
4830 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4831 goto LABEL_201; | |
4832 } | |
4833 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4834 { | |
4835 v197 = v3->spellnum; | |
4836 v198 = pGame->GetStru6(); | |
4837 pGame->GetStru6()->SetPlayerBuffAnim(v197, v1); | |
4838 v83 = 1; | |
4839 v199 = v3->spellnum; | |
4840 v200 = pGame->GetStru6(); | |
4841 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1u); | |
4842 v201 = v3->spellnum; | |
4843 v202 = pGame->GetStru6(); | |
4844 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2u); | |
4845 v203 = v3->spellnum; | |
4846 v204 = pGame->GetStru6(); | |
4847 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3u); | |
4848 v673 = v1; | |
4849 v732 = (int)v733 << 7; | |
4850 v662 = v1; | |
4851 v655 = amount; | |
4852 v652 = v731; | |
4853 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4854 v137 = (char *)&pParty->pPartyBuffs[11]; | |
4855 LABEL_976: | |
4856 v136 = pParty->uTimePlayed + v183; | |
4857 LABEL_977: | |
4858 ((SpellBuff *)v137)->Apply(v136, v652, v655, v662, v673); | |
4859 LABEL_978: | |
4860 LODWORD(v727) = v83; | |
4861 } | |
4862 goto LABEL_83; | |
4863 case 21: | |
4864 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4865 { | |
4866 v190 = pGlobalTXT_LocalizationStrings[494]; | |
4867 LABEL_462: | |
4868 ShowStatusBarString(v190, 2u); | |
4869 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4870 goto LABEL_83; | |
4871 } | |
4872 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4873 { | |
4874 LABEL_461: | |
4875 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4876 goto LABEL_462; | |
4877 } | |
4878 LODWORD(v733) = 3600 * v2; | |
4879 if ( v731 == 2 || v731 == 3 || (amount = v1, v731 != 4) ) | |
4880 amount = 1; | |
4881 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4882 goto LABEL_83; | |
4883 v205 = 0; | |
4884 do | |
4885 pOtherOverlayList->_4418B1(2090, v205++ + 100, v1, 65536); | |
4886 while ( v205 < 4 ); | |
4887 v206 = pOtherOverlayList->_4418B1(10008, 203, v1, 65536); | |
4888 v207 = v3->uPlayerID + 1; | |
4889 v716 = v206; | |
4890 v668 = v207; | |
4891 v658 = v206; | |
4892 v653 = amount; | |
4893 v732 = (int)v733 << 7; | |
4894 v651 = v731; | |
4895 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4896 v27 = (char *)&pParty->pPartyBuffs[7]; | |
4897 LABEL_101: | |
4898 v26 = (signed int)v26; | |
4899 LABEL_102: | |
4900 v28 = pParty->uTimePlayed + v26; | |
4901 LABEL_103: | |
4902 HIDWORD(v650) = HIDWORD(v28); | |
4903 LABEL_104: | |
4904 LODWORD(v650) = v28; | |
4905 ((SpellBuff *)v27)->Apply(v650, v651, v653, v658, v668); | |
4906 goto LABEL_1056; | |
4907 case 22: | |
4908 v67 = 2; | |
4909 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4910 { | |
4911 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4912 goto LABEL_202; | |
4913 } | |
4914 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4915 goto LABEL_83; | |
4916 v208 = a2 & 7; | |
4917 LODWORD(v725) = a2 & 7; | |
4918 if ( v208 == 3 ) | |
4919 { | |
4920 v209 = a2 >> 3; | |
4921 LODWORD(v718) = pActors[v209].vPosition.x; | |
4922 v210 = pActors[v209].vPosition.y; | |
4923 v211 = pActors[v209].vPosition.z; | |
4924 v713 = v210; | |
4925 } | |
4926 else | |
4927 { | |
4928 v212 = stru_5C6E00->SinCos(pParty->sRotationY); | |
4929 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); | |
4930 v213 = stru_5C6E00->_42EBDB(pParty->sRotationY); | |
4931 v214 = sub_42EBBE(2048, v213); | |
4932 v211 = pParty->vPosition.z; | |
4933 v713 = pParty->vPosition.y + v214; | |
4934 v208 = LODWORD(v725); | |
4935 } | |
4936 v726 = (Player *)v211; | |
4937 HIDWORD(v733) = v1; | |
4938 *(float *)&v732 = (double)v211; | |
4939 LODWORD(v725) = v211 + 2500; | |
4940 v721 = v1; | |
4941 *(float *)&y = (double)(v211 + 2500); | |
4942 v730 = v208 == 3 ? a2 : 0; | |
4943 a2 = 20; | |
4944 do | |
4945 { | |
4946 v215 = rand(); | |
4947 v216 = (double)v721; | |
4948 v727 = v216; | |
4949 v217 = (double)SHIDWORD(v733); | |
4950 *(float *)&uRequiredMana = v217; | |
4951 _this = (ItemGen *)(v215 % 1000); | |
4952 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4953 *(float *)&v721 = v217 * v217; | |
4954 *(float *)&v726 = v216 * v216; | |
4955 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4956 { | |
4957 LODWORD(v685) = v1; | |
4958 HIDWORD(v685) = v1; | |
4959 } | |
4960 else | |
4961 { | |
4962 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4963 v685 = __PAIR__( | |
4964 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4965 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4966 } | |
4967 a1.stru_24.Reset(); | |
4968 a1.field_48 = v3->spellnum; | |
4969 a1.field_4C = v2; | |
4970 a1.field_50 = v731; | |
4971 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4972 a1.uAttributes = v1; | |
4973 a1.vPosition.x = LODWORD(v718); | |
4974 a1.vPosition.y = v713; | |
4975 a1.uSectorID = v1; | |
4976 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); | |
4977 a1.uSpriteFrameID = v1; | |
4978 a1.field_58 = 8 * v3->uPlayerID | 4; | |
4979 a1.field_5C = v730; | |
4980 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4981 a1.uFacing = v685; | |
4982 a1.uSoundID = LOWORD(v3->field_10); | |
4983 if ( pParty->bTurnBasedModeOn == 1 ) | |
4984 a1.uAttributes = 4; | |
4985 if ( a1.Create( | |
4986 v685, | |
4987 SHIDWORD(v685), | |
4988 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4989 v1) != -1 | |
4990 && pParty->bTurnBasedModeOn == 1 ) | |
4991 ++pTurnEngine->field_1C; | |
4992 v721 = rand() % 1024 - 512; | |
4993 v218 = rand(); | |
4994 v14 = a2-- == 1; | |
4995 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4996 } | |
4997 while ( !v14 ); | |
4998 goto LABEL_1056; | |
4999 case 23: | |
5000 v219 = v12 - 2; | |
5001 if ( v219 ) | |
5002 { | |
5003 v220 = v219 - 1; | |
5004 if ( v220 ) | |
5005 { | |
5006 if ( v220 == 1 ) | |
5007 { | |
5008 amount = v1; | |
5009 goto LABEL_433; | |
5010 } | |
5011 v221 = 180 * v2; | |
5012 } | |
5013 else | |
5014 { | |
5015 v221 = 86400 * v2; | |
5016 } | |
5017 } | |
5018 else | |
5019 { | |
5020 v221 = 3600 * v2; | |
5021 } | |
5022 amount = v221; | |
5023 LABEL_433: | |
5024 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5025 goto LABEL_83; | |
5026 v222 = (char *)pParty->pPlayers; | |
5027 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
5028 break; | |
5029 case 24: | |
5030 v224 = v12 - 2; | |
5031 if ( v224 ) | |
5032 { | |
5033 v225 = v224 - 1; | |
5034 if ( v225 ) | |
5035 { | |
5036 if ( v225 == 1 ) | |
5037 amount = 7; | |
5038 else | |
5039 amount = 1; | |
5040 } | |
5041 else | |
5042 { | |
5043 amount = 5; | |
5044 } | |
5045 } | |
5046 else | |
5047 { | |
5048 amount = 3; | |
5049 } | |
5050 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5051 goto LABEL_83; | |
5052 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
5053 if ( amount == 1 ) | |
5054 { | |
5055 LABEL_152: | |
5056 a1.stru_24.Reset(); | |
5057 a1.field_48 = v3->spellnum; | |
5058 a1.field_50 = v731; | |
5059 a1.field_4C = v2; | |
5060 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5061 a1.vPosition.y = pParty->vPosition.y; | |
5062 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5063 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5064 v660 = pParty->vPosition.y; | |
5065 LABEL_153: | |
5066 a1.uAttributes = v1; | |
5067 a1.vPosition.x = pParty->vPosition.x; | |
5068 a1.vPosition.z = v51; | |
5069 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
5070 a1.uSpriteFrameID = v1; | |
5071 a1.uSectorID = v52; | |
5072 v53 = 8 * v3->uPlayerID; | |
5073 LOBYTE(v53) = v53 | 4; | |
5074 a1.field_58 = v53; | |
5075 a1.field_5C = a2; | |
5076 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5077 a1.uFacing = LOWORD(v715.uYawAngle); | |
5078 a1.uSoundID = LOWORD(v3->field_10); | |
5079 LABEL_154: | |
5080 if ( pParty->bTurnBasedModeOn == 1 ) | |
5081 LOBYTE(a1.uAttributes) |= 4u; | |
5082 LABEL_156: | |
5083 v669 = v3->uPlayerID + 1; | |
5084 v36 = v715.uYawAngle; | |
5085 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5086 v654 = v715.uPitchAngle; | |
5087 LABEL_157: | |
5088 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
5089 ++pTurnEngine->field_1C; | |
5090 } | |
5091 else | |
5092 { | |
5093 v732 = SHIDWORD(v733) / (amount - 1); | |
5094 a1.stru_24.Reset(); | |
5095 a1.field_48 = v3->spellnum; | |
5096 a1.field_4C = v2; | |
5097 a1.field_50 = v731; | |
5098 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5099 a1.vPosition.y = pParty->vPosition.y; | |
5100 a1.vPosition.x = pParty->vPosition.x; | |
5101 a1.uAttributes = v1; | |
5102 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5103 a1.uSectorID = pIndoor->GetSector( | |
5104 pParty->vPosition.x, | |
5105 pParty->vPosition.y, | |
5106 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5107 a1.uSpriteFrameID = v1; | |
5108 v226 = 8 * v3->uPlayerID; | |
5109 LOBYTE(v226) = v226 | 4; | |
5110 a1.field_58 = v226; | |
5111 a1.field_5C = a2; | |
5112 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5113 a1.uSoundID = LOWORD(v3->field_10); | |
5114 if ( pParty->bTurnBasedModeOn == 1 ) | |
5115 LOBYTE(a1.uAttributes) |= 4u; | |
5116 v227 = SHIDWORD(v733) / -2; | |
5117 y = (char *)(SHIDWORD(v733) / 2); | |
5118 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5119 { | |
5120 v228 = v715.uYawAngle; | |
5121 do | |
5122 { | |
5123 a1.uFacing = v227 + v228; | |
5124 if ( a1.Create( | |
5125 v227 + v228, | |
5126 v715.uPitchAngle, | |
5127 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5128 v3->uPlayerID + 1) != -1 | |
5129 && pParty->bTurnBasedModeOn == 1 ) | |
5130 ++pTurnEngine->field_1C; | |
5131 v227 += v732; | |
5132 } | |
5133 while ( v227 <= (signed int)y ); | |
5134 } | |
5135 } | |
5136 goto LABEL_1056; | |
5137 case 27: | |
5138 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5139 goto LABEL_461; | |
5140 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5141 v229 = 600 * v2; | |
5142 else | |
5143 v229 = 3600 * v2; | |
5144 LODWORD(v733) = v229; | |
5145 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5146 goto LABEL_83; | |
5147 v716 = pOtherOverlayList->_4418B1(10005, 201, v1, 65536); | |
5148 v230 = v3->spellnum; | |
5149 v231 = pGame->GetStru6(); | |
5150 pGame->GetStru6()->SetPlayerBuffAnim(v230, v1); | |
5151 v232 = 1; | |
5152 v233 = v3->spellnum; | |
5153 v234 = pGame->GetStru6(); | |
5154 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1u); | |
5155 v235 = v3->spellnum; | |
5156 v236 = pGame->GetStru6(); | |
5157 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2u); | |
5158 v237 = v3->spellnum; | |
5159 v238 = pGame->GetStru6(); | |
5160 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3u); | |
5161 v239 = v3->uPlayerID + 1; | |
5162 v732 = v229 << 7; | |
5163 pParty->pPartyBuffs[18].Apply( | |
5164 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5165 v731, | |
5166 amount, | |
5167 v716, | |
5168 v239); | |
5169 if ( v731 == 4 ) | |
5170 pParty->pPartyBuffs[18].uFlags = 1; | |
89 | 5171 LODWORD(v727) = v232; |
5172 goto LABEL_83; | |
0 | 5173 case 28: |
5174 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5175 goto LABEL_83; | |
5176 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; | |
5177 y = v240; | |
5178 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5179 goto LABEL_199; | |
5180 if ( v731 == 1 || v731 == 2 ) | |
5181 { | |
5182 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5183 } | |
5184 else | |
5185 { | |
5186 if ( v731 == 3 ) | |
5187 { | |
5188 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5189 } | |
5190 else | |
5191 { | |
5192 if ( v731 != 4 ) | |
5193 { | |
5194 v241 = 0.0; | |
5195 goto LABEL_484; | |
5196 } | |
5197 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5198 } | |
5199 } | |
5200 if ( v241 > 1.0 ) | |
5201 v241 = 1.0; | |
5202 LABEL_484: | |
5203 v732 = (unsigned __int8)v240[25]; | |
5204 v242 = (signed __int64)((double)v732 * v241); | |
5205 v243 = y; | |
5206 y[25] = v242; | |
5207 *((int *)v243 + 4) = (unsigned __int8)v242; | |
5208 if ( (unsigned __int8)v242 <= v1 ) | |
5209 { | |
5210 *(int *)v243 = v1; | |
5211 dword_50C9D0 = 113; | |
5212 dword_50C9D4 = v1; | |
5213 dword_50C9D8 = 1; | |
5214 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
5215 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5216 v3->spellnum = v1; | |
5217 goto LABEL_1165; | |
5218 } | |
5219 *((int *)v243 + 5) |= 0x40u; | |
5220 goto LABEL_1055; | |
5221 case 30: | |
5222 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5223 goto LABEL_83; | |
5224 uRequiredMana = v1; | |
5225 HIDWORD(v733) = 10 * v2; | |
5226 v730 = 1; | |
5227 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5228 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5229 if ( v731 == 1 ) | |
5230 { | |
5231 v245 = (int)&v244[36 * a2 + 532]; | |
5232 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5233 v311 = __OFSUB__(*(int *)v245, 134); | |
5234 v14 = *(int *)v245 == 134; | |
5235 v310 = *(int *)v245 - 134 < 0; | |
5236 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5237 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5238 { | |
5239 if ( *(int *)&v244[36 * a2 + 544] == v1 ) | |
5240 { | |
5241 if ( *(int *)&v244[36 * a2 + 536] == v1 ) | |
5242 { | |
5243 if ( *(int *)&v244[36 * a2 + 540] == v1 ) | |
5244 { | |
5245 v312 = v309[28]; | |
5246 if ( v312 ) | |
5247 { | |
5248 if ( v312 != 1 ) | |
5249 { | |
5250 if ( v312 != 2 ) | |
5251 { | |
5252 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5253 if ( !(v244[36 * a2 + 552] & 2) ) | |
5254 { | |
5255 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5256 { | |
5257 uRequiredMana = 1; | |
5258 v730 = v1; | |
5259 } | |
5260 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5261 uRequiredMana = 1; | |
5262 if ( uRequiredMana == v1 ) | |
5263 { | |
5264 v313 = *(char *)(LODWORD(v725) + 28); | |
5265 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5266 { | |
5267 v314 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | |
5268 *(int *)(v245 + 4) = 0; | |
5269 for ( j = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5270 + 1]; | |
5271 ; | |
5272 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5273 + 1] ) | |
5274 { | |
5275 ++*(int *)(v245 + 4); | |
5276 if ( j >= v314 ) | |
5277 break; | |
5278 } | |
5279 v254 = rand(); | |
5280 v255 = pItemsTable->field_116D8[17]; | |
5281 v256 = pItemsTable->field_116D8[16]; | |
5282 LABEL_611: | |
5283 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5284 LABEL_612: | |
5285 _this->uItemID |= 0x20u; | |
5286 goto LABEL_1055; | |
5287 } | |
5288 goto LABEL_615; | |
5289 } | |
5290 LABEL_613: | |
5291 v316 = _this->uItemID; | |
5292 if ( !(BYTE1(v316) & 2) ) | |
5293 { | |
5294 LOBYTE(v316) = v316 | 2; | |
5295 _this->uItemID = v316; | |
5296 } | |
5297 } | |
5298 } | |
5299 } | |
5300 } | |
5301 } | |
5302 } | |
5303 } | |
5304 } | |
5305 LABEL_616: | |
5306 if ( LODWORD(v727) == v1 ) | |
5307 { | |
5308 v317 = pGlobalTXT_LocalizationStrings[428]; | |
5309 if ( v730 == v1 ) | |
5310 v317 = pGlobalTXT_LocalizationStrings[585]; | |
5311 ShowStatusBarString(v317, 2u); | |
5312 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5313 v318 = v726; | |
5314 v3->spellnum = v1; | |
5315 v318->PlaySound(43, v1); | |
5316 } | |
5317 goto LABEL_83; | |
5318 } | |
5319 if ( v731 != 2 ) | |
5320 { | |
5321 if ( v731 == 3 ) | |
5322 { | |
5323 v245 = (int)&v244[36 * a2 + 532]; | |
5324 v269 = *(int *)v245; | |
5325 if ( *(int *)v245 > 134 | |
5326 || *(int *)(v245 + 12) != v1 | |
5327 || *(int *)(v245 + 4) != v1 | |
5328 || *(int *)(v245 + 8) != v1 | |
5329 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) | |
5330 goto LABEL_616; | |
5331 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5332 LODWORD(v725) = (int)v270; | |
5333 v271 = v270[28]; | |
5334 if ( v271 && v271 != 1 && v271 != 2 ) | |
5335 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5336 else | |
5337 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5338 if ( v272 ) | |
5339 { | |
5340 uRequiredMana = 1; | |
5341 v730 = v1; | |
5342 } | |
5343 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5344 uRequiredMana = 1; | |
5345 if ( uRequiredMana != v1 ) | |
5346 goto LABEL_613; | |
5347 v273 = v725; | |
5348 v274 = *(char *)(LODWORD(v725) + 28); | |
5349 if ( v274 == 0 | v274 == 1 | v274 == 2 | v274 == 3 | v274 == 4 | v274 == 5 | v274 == 6 | v274 == 7 | v274 == 8 | v274 == 9 | v274 == 10 | v274 == 11 ) | |
5350 { | |
5351 if ( rand() % 100 < 80 | |
5352 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5353 { | |
5354 v275 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | |
5355 *(int *)(v245 + 4) = 0; | |
5356 for ( k = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; | |
5357 ; | |
5358 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5359 + 1] ) | |
5360 { | |
5361 ++*(int *)(v245 + 4); | |
5362 if ( k >= v275 ) | |
5363 break; | |
5364 } | |
5365 v254 = rand(); | |
5366 v255 = pItemsTable->field_116D8[19]; | |
5367 v256 = pItemsTable->field_116D8[18]; | |
5368 goto LABEL_611; | |
5369 } | |
5370 v277 = pItemsTable->field_11798; | |
5371 v278 = 0; | |
5372 v725 = 0.0; | |
5373 HIDWORD(v733) = 0; | |
5374 if ( pItemsTable->field_11798 > 0 ) | |
5375 { | |
5376 v730 = (int)&v679; | |
5377 do | |
5378 { | |
5379 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pName); | |
5380 if ( !v279 || v279 == 1 ) | |
5381 { | |
5382 v280 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5383 + 4] | |
5384 + v278 * 28); | |
5385 LODWORD(v725) += v280; | |
5386 if ( v280 ) | |
5387 { | |
5388 v281 = v730; | |
5389 v730 += 4; | |
5390 *(int *)v281 = HIDWORD(v733); | |
5391 } | |
5392 } | |
5393 ++HIDWORD(v733); | |
5394 ++v278; | |
5395 } | |
5396 while ( SHIDWORD(v733) < v277 ); | |
5397 } | |
5398 v282 = rand() % SLODWORD(v725); | |
5399 v283 = v679; | |
5400 *(int *)(v245 + 12) = v679; | |
5401 v284 = pItemsTable->pSpecialEnchantments[v283].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; | |
5402 v285 = v282 + 1; | |
5403 if ( v284 < v285 ) | |
5404 { | |
5405 for ( l = &v679; ; l = (int *)v732 ) | |
5406 { | |
5407 v287 = (int)(l + 1); | |
5408 v732 = v287; | |
5409 v288 = *(int *)v287; | |
5410 *(int *)(v245 + 12) = v288; | |
5411 v284 += pItemsTable->pSpecialEnchantments[v288].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5412 + 4]; | |
5413 if ( v284 >= v285 ) | |
5414 break; | |
5415 } | |
5416 } | |
5417 goto LABEL_525; | |
5418 } | |
5419 } | |
5420 else | |
5421 { | |
5422 if ( v731 != 4 | |
5423 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
5424 || v726->pInventoryItems[a2].uAdditionalValue != v1 | |
5425 || v726->pInventoryItems[a2]._bonus_type != v1 | |
5426 || v726->pInventoryItems[a2]._bonus_strength != v1 | |
5427 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].uAttributes & 2) ) | |
5428 goto LABEL_616; | |
5429 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5430 LODWORD(v725) = (int)v247; | |
5431 v248 = v247[28]; | |
5432 if ( v248 && v248 != 1 && v248 != 2 ) | |
5433 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5434 else | |
5435 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5436 if ( v249 ) | |
5437 { | |
5438 uRequiredMana = 1; | |
5439 v730 = v1; | |
5440 } | |
5441 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5442 uRequiredMana = 1; | |
5443 if ( uRequiredMana != v1 ) | |
5444 goto LABEL_613; | |
5445 v250 = v725; | |
5446 v251 = *(char *)(LODWORD(v725) + 28); | |
5447 if ( v251 == 0 | v251 == 1 | v251 == 2 | v251 == 3 | v251 == 4 | v251 == 5 | v251 == 6 | v251 == 7 | v251 == 8 | v251 == 9 | v251 == 10 | v251 == 11 ) | |
5448 { | |
5449 if ( rand() % 100 < 80 | |
5450 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5451 { | |
5452 v252 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | |
5453 *(int *)(v245 + 4) = 0; | |
5454 for ( m = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; | |
5455 ; | |
5456 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5457 + 1] ) | |
5458 { | |
5459 ++*(int *)(v245 + 4); | |
5460 if ( m >= v252 ) | |
5461 break; | |
5462 } | |
5463 v254 = rand(); | |
5464 v255 = pItemsTable->field_116D8[21]; | |
5465 v256 = pItemsTable->field_116D8[20]; | |
5466 goto LABEL_611; | |
5467 } | |
5468 v257 = pItemsTable->field_11798; | |
5469 v258 = 0; | |
5470 v725 = 0.0; | |
5471 HIDWORD(v733) = 0; | |
5472 if ( pItemsTable->field_11798 > 0 ) | |
5473 { | |
5474 v730 = (int)&v679; | |
5475 do | |
5476 { | |
5477 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pName); | |
5478 if ( !v259 || v259 == 1 ) | |
5479 { | |
5480 v260 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5481 + 4] | |
5482 + v258 * 28); | |
5483 LODWORD(v725) += v260; | |
5484 if ( v260 ) | |
5485 { | |
5486 v261 = v730; | |
5487 v730 += 4; | |
5488 *(int *)v261 = HIDWORD(v733); | |
5489 } | |
5490 } | |
5491 ++HIDWORD(v733); | |
5492 ++v258; | |
5493 } | |
5494 while ( SHIDWORD(v733) < v257 ); | |
5495 } | |
5496 v262 = rand() % SLODWORD(v725); | |
5497 v263 = v679; | |
5498 *(int *)(v245 + 12) = v679; | |
5499 v264 = pItemsTable->pSpecialEnchantments[v263].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; | |
5500 v265 = v262 + 1; | |
5501 if ( v264 < v265 ) | |
5502 { | |
5503 for ( ii = &v679; ; ii = (int *)v732 ) | |
5504 { | |
5505 v267 = (int)(ii + 1); | |
5506 v732 = v267; | |
5507 v268 = *(int *)v267; | |
5508 *(int *)(v245 + 12) = v268; | |
5509 v264 += pItemsTable->pSpecialEnchantments[v268].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5510 + 4]; | |
5511 if ( v264 >= v265 ) | |
5512 break; | |
5513 } | |
5514 } | |
5515 LABEL_525: | |
5516 ++*(int *)(v245 + 12); | |
5517 goto LABEL_612; | |
5518 } | |
5519 } | |
5520 LABEL_615: | |
5521 v1 = 0; | |
5522 goto LABEL_616; | |
5523 } | |
5524 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5525 _this = v289; | |
5526 v290 = v289->uItemID; | |
5527 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5528 if ( v290 > 134 | |
5529 || _this->uAdditionalValue != v1 | |
5530 || _this->_bonus_type != v1 | |
5531 || _this->_bonus_strength != v1 | |
5532 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 | |
5533 || v291 == 1 | |
5534 || v291 == 2 | |
5535 || _this->uAttributes & 2 ) | |
5536 goto LABEL_616; | |
5537 if ( _this->GetValue() < 0x1C2 ) | |
5538 uRequiredMana = 1; | |
5539 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5540 uRequiredMana = 1; | |
5541 if ( uRequiredMana != v1 ) | |
5542 goto LABEL_199; | |
5543 v292 = *(char *)(LODWORD(v725) + 28); | |
5544 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5545 { | |
5546 v2 = v723; | |
5547 v1 = 0; | |
5548 goto LABEL_199; | |
5549 } | |
5550 if ( rand() % 100 >= 80 ) | |
5551 { | |
5552 v297 = pItemsTable->field_11798; | |
5553 v294 = _this; | |
5554 v298 = 0; | |
5555 v725 = 0.0; | |
5556 HIDWORD(v733) = 0; | |
5557 if ( pItemsTable->field_11798 > 0 ) | |
5558 { | |
5559 v730 = (int)&v679; | |
5560 do | |
5561 { | |
5562 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pName); | |
5563 if ( !v299 || v299 == 1 ) | |
5564 { | |
5565 v300 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4] | |
5566 + v298 * 28); | |
5567 LODWORD(v725) += v300; | |
5568 if ( v300 ) | |
5569 { | |
5570 v301 = v730; | |
5571 v730 += 4; | |
5572 *(int *)v301 = HIDWORD(v733); | |
5573 } | |
5574 } | |
5575 ++HIDWORD(v733); | |
5576 ++v298; | |
5577 } | |
5578 while ( SHIDWORD(v733) < v297 ); | |
5579 } | |
5580 v302 = rand() % SLODWORD(v725); | |
5581 v303 = v679; | |
5582 v294->uAdditionalValue = v679; | |
5583 v304 = pItemsTable->pSpecialEnchantments[v303].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; | |
5584 v305 = v302 + 1; | |
5585 if ( v304 < v305 ) | |
5586 { | |
5587 for ( jj = &v679; ; jj = (int *)v732 ) | |
5588 { | |
5589 v307 = (int)(jj + 1); | |
5590 v732 = v307; | |
5591 v308 = *(int *)v307; | |
5592 v294->uAdditionalValue = v308; | |
5593 v304 += pItemsTable->pSpecialEnchantments[v308].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; | |
5594 if ( v304 >= v305 ) | |
5595 break; | |
5596 } | |
5597 } | |
5598 ++v294->uAdditionalValue; | |
5599 } | |
5600 else | |
5601 { | |
5602 v293 = rand(); | |
5603 v294 = _this; | |
5604 v295 = v293 % pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; | |
5605 _this->_bonus_type = 0; | |
5606 for ( kk = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; | |
5607 ; | |
5608 kk += pItemsTable->pEnchantments[v294->_bonus_type].field_8[pItemsTable->pItems[v294->uItemID].uEquipType | |
5609 + 1] ) | |
5610 { | |
5611 ++v294->_bonus_type; | |
5612 if ( kk >= v295 ) | |
5613 break; | |
5614 } | |
5615 v294->_bonus_strength = pItemsTable->field_116D8[18] | |
5616 + rand() % (pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
5617 } | |
5618 v294->uAttributes |= 0x20u; | |
5619 goto LABEL_1055; | |
5620 case 31: | |
5621 amount = 10 * v2; | |
5622 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
5623 goto LABEL_83; | |
5624 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) | |
5625 goto LABEL_200; | |
5626 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
5627 pMessageQueue_50CBD0->SendMessage((UIMessageType)195, v1, v1); | |
5628 goto LABEL_1056; | |
5629 case 33: | |
5630 LODWORD(v733) = 604800 * v2; | |
5631 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5632 goto LABEL_200; | |
5633 v319 = uRequiredMana; | |
5634 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5635 { | |
5636 pEventTimer->Pause(); | |
5637 pMessageQueue_50CBD0->SendMessage((UIMessageType)177, v1, v1); | |
5638 qword_506350 = (signed int)v733; | |
5639 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5640 ::uRequiredMana = v319; | |
5641 ::sRecoveryTime = sRecoveryTime; | |
5642 dword_50633C = v3->field_10; | |
5643 dword_506338 = v3->spellnum; | |
5644 LOBYTE(v3->field_8) |= 0x20u; | |
5645 } | |
5646 goto LABEL_83; | |
5647 case 40: | |
5648 v320 = v12 - 2; | |
5649 if ( !v320 ) | |
5650 goto LABEL_632; | |
5651 v321 = v320 - 1; | |
5652 if ( v321 ) | |
5653 { | |
5654 if ( v321 == 1 ) | |
5655 goto LABEL_634; | |
5656 LABEL_632: | |
5657 v322 = 3600 * v2; | |
5658 } | |
5659 else | |
5660 { | |
5661 v322 = 86400 * v2; | |
5662 } | |
5663 amount = v322; | |
5664 LABEL_634: | |
5665 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5666 goto LABEL_83; | |
5667 v323 = v3->uPlayerID_2; | |
5668 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5669 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5670 goto LABEL_1056; | |
5671 if ( v731 == 4 ) | |
5672 goto LABEL_637; | |
5673 v732 = amount << 7; | |
5674 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5675 v656 = 15; | |
5676 goto LABEL_640; | |
5677 case 41: | |
5678 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5679 goto LABEL_83; | |
5680 a1.stru_24.Reset(); | |
5681 a1.field_48 = v3->spellnum; | |
5682 a1.field_4C = v2; | |
5683 a1.field_50 = v731; | |
5684 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5685 a1.vPosition.y = pParty->vPosition.y; | |
5686 a1.vPosition.x = pParty->vPosition.x; | |
5687 a1.uAttributes = v1; | |
5688 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5689 a1.uSectorID = pIndoor->GetSector( | |
5690 pParty->vPosition.x, | |
5691 pParty->vPosition.y, | |
5692 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5693 a1.uSpriteFrameID = v1; | |
5694 v326 = 8 * v3->uPlayerID; | |
5695 LOBYTE(v326) = v326 | 4; | |
5696 a1.field_58 = v326; | |
5697 a1.field_5C = a2; | |
5698 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5699 a1.uFacing = LOWORD(pParty->sRotationY); | |
5700 a1.uSoundID = LOWORD(v3->field_10); | |
5701 if ( pParty->bTurnBasedModeOn == 1 ) | |
5702 LOBYTE(a1.uAttributes) |= 4u; | |
5703 v669 = v3->uPlayerID + 1; | |
5704 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5705 v654 = pParty->sRotationX; | |
5706 goto LABEL_125; | |
5707 case 43: | |
5708 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5709 goto LABEL_200; | |
5710 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5711 goto LABEL_83; | |
5712 a1.uItemType = 4090; | |
5713 a1.stru_24.Reset(); | |
5714 a1.field_48 = v3->spellnum; | |
5715 a1.field_4C = v2; | |
5716 a1.field_50 = v731; | |
5717 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5718 a1.vPosition.x = pParty->vPosition.x; | |
5719 a1.vPosition.y = pParty->vPosition.y; | |
5720 a1.uAttributes = v1; | |
5721 a1.uSectorID = v1; | |
5722 a1.uSpriteFrameID = v1; | |
5723 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5724 v327 = 8 * v3->uPlayerID; | |
5725 LOBYTE(v327) = v327 | 4; | |
5726 a1.field_60_distance_related_prolly_lod = 0; | |
5727 a1.field_58 = v327; | |
5728 a1.field_5C = a2; | |
5729 a1.uFacing = LOWORD(pParty->sRotationY); | |
5730 a1.uSoundID = LOWORD(v3->field_10); | |
5731 if ( pParty->bTurnBasedModeOn == 1 ) | |
5732 a1.uAttributes = 4; | |
5733 v669 = v1; | |
5734 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5735 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5736 LABEL_124: | |
5737 v654 = v35; | |
5738 LABEL_125: | |
5739 v36 = pParty->sRotationY; | |
5740 goto LABEL_157; | |
5741 case 45: | |
5742 v328 = v12 - 2; | |
5743 if ( v328 ) | |
5744 { | |
5745 v329 = v328 - 1; | |
5746 if ( v329 && v329 != 1 ) | |
5747 v330 = 600 * v2; | |
5748 else | |
5749 v330 = 3600 * v2; | |
5750 } | |
5751 else | |
5752 { | |
5753 v330 = 1800 * v2; | |
5754 } | |
5755 LODWORD(v733) = v330; | |
5756 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5757 goto LABEL_83; | |
5758 v331 = v3->spellnum; | |
5759 v332 = pGame->GetStru6(); | |
5760 pGame->GetStru6()->SetPlayerBuffAnim(v331, v1); | |
5761 v83 = 1; | |
5762 v333 = v3->spellnum; | |
5763 v334 = pGame->GetStru6(); | |
5764 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1u); | |
5765 v335 = v3->spellnum; | |
5766 v336 = pGame->GetStru6(); | |
5767 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2u); | |
5768 v337 = v3->spellnum; | |
5769 v338 = pGame->GetStru6(); | |
5770 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3u); | |
5771 v673 = v1; | |
5772 v732 = (int)v733 << 7; | |
5773 v662 = v1; | |
5774 v655 = v1; | |
5775 v652 = v731; | |
5776 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5777 v137 = (char *)&pParty->pPartyBuffs[3]; | |
5778 goto LABEL_976; | |
5779 case 47: | |
5780 LODWORD(v733) = 300; | |
5781 v339 = v12 - 2; | |
5782 if ( v339 ) | |
5783 { | |
5784 v340 = v339 - 1; | |
5785 if ( v340 ) | |
5786 { | |
5787 if ( v340 != 1 ) | |
5788 { | |
5789 amount = v2; | |
5790 goto LABEL_667; | |
5791 } | |
5792 v341 = 6 * v2; | |
5793 } | |
5794 else | |
5795 { | |
5796 v341 = 4 * v2; | |
5797 } | |
5798 } | |
5799 else | |
5800 { | |
5801 v341 = 2 * v2; | |
5802 } | |
5803 amount = v341; | |
5804 LABEL_667: | |
5805 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5806 goto LABEL_83; | |
5807 v342 = *(int *)&v3->field_C; | |
5808 if ( v342 == v1 ) | |
5809 { | |
5810 v345 = v3->uPlayerID_2; | |
5811 v346 = v3->spellnum; | |
5812 v347 = pGame->GetStru6(); | |
5813 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); | |
5814 v668 = v1; | |
5815 v658 = v1; | |
5816 v653 = amount; | |
5817 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; | |
5818 v651 = v731; | |
5819 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5820 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; | |
5821 goto LABEL_104; | |
5822 } | |
141 | 5823 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5824 { |
5825 v343 = v342 >> 3; | |
5826 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5827 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; | |
5828 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); | |
5829 BYTE2(pActors[v343].uAttributes) |= 8u; | |
5830 v672 = v1; | |
5831 v661 = &pActors[v343]; | |
5832 LABEL_165: | |
5833 v56 = pGame->GetStru6(); | |
5834 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5835 } | |
5836 goto LABEL_1056; | |
5837 case 49: | |
5838 v348 = v12 - 2; | |
5839 if ( !v348 ) | |
5840 goto LABEL_677; | |
5841 v349 = v348 - 1; | |
5842 if ( v349 ) | |
5843 { | |
5844 if ( v349 == 1 ) | |
5845 { | |
5846 amount = v1; | |
5847 goto LABEL_679; | |
5848 } | |
5849 LABEL_677: | |
5850 v350 = 3600 * v2; | |
5851 } | |
5852 else | |
5853 { | |
5854 v350 = 86400 * v2; | |
5855 } | |
5856 amount = v350; | |
5857 LABEL_679: | |
5858 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5859 goto LABEL_83; | |
5860 v351 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5861 if ( !v351->pConditions[0] ) | |
5862 goto LABEL_1056; | |
5863 if ( v731 == 4 ) | |
5864 { | |
5865 LODWORD(v351->pConditions[0]) = v1; | |
5866 HIDWORD(v351->pConditions[0]) = v1; | |
5867 goto LABEL_904; | |
5868 } | |
5869 v732 = amount << 7; | |
5870 v351->DiscardConditionIfLastsLongerThan( | |
5871 v1, | |
5872 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
5873 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5874 goto LABEL_1056; | |
5875 v674 = v3->uPlayerID_2; | |
5876 goto LABEL_685; | |
5877 case 50: | |
5878 v354 = v12 - 2; | |
5879 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5880 v356 = 900 * (v2 + 4); | |
5881 else | |
5882 v356 = 300 * (v2 + 12); | |
5883 LODWORD(v733) = v356; | |
5884 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5885 goto LABEL_83; | |
5886 if ( v731 == 1 || v731 == 2 ) | |
5887 { | |
5888 v361 = v3->uPlayerID_2; | |
5889 v362 = v3->spellnum; | |
5890 v363 = pGame->GetStru6(); | |
5891 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); | |
5892 v668 = v1; | |
5893 v732 = (int)v733 << 7; | |
5894 v658 = v1; | |
5895 v653 = v1; | |
5896 v651 = v731; | |
5897 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5898 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; | |
5899 goto LABEL_103; | |
5900 } | |
5901 a2 = v1; | |
5902 v732 = (int)v733 << 7; | |
5903 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5904 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5905 do |
5906 { | |
5907 v358 = a2; | |
5908 v359 = v3->spellnum; | |
5909 v360 = pGame->GetStru6(); | |
5910 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); | |
112 | 5911 v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, v1, v1, v1); |
0 | 5912 ++a2; |
112 | 5913 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5914 } | |
5915 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5916 goto LABEL_1056; |
5917 case 48: | |
5918 v364 = v12 - 2; | |
5919 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5920 v366 = 60 * (v2 + 3); | |
5921 else | |
5922 v366 = 300 * v2 + 180; | |
5923 LODWORD(v733) = v366; | |
5924 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5925 goto LABEL_83; | |
5926 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
5927 v367 = pGame->GetStru6(); | |
5928 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | |
5929 ++a1.uItemType; | |
5930 a1.stru_24.Reset(); | |
5931 a1.field_48 = v3->spellnum; | |
5932 a1.field_4C = v2; | |
5933 a1.field_50 = v731; | |
5934 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5935 a1.uAttributes = v1; | |
5936 a1.uSectorID = v1; | |
5937 a1.uSpriteFrameID = v1; | |
5938 v368 = v3->uPlayerID; | |
5939 a1.field_60_distance_related_prolly_lod = 0; | |
5940 a1.uFacing = v1; | |
5941 v368 *= 8; | |
5942 LOBYTE(v368) = v368 | 4; | |
5943 a1.field_58 = v368; | |
5944 a1.uSoundID = LOWORD(v3->field_10); | |
5945 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
5946 { | |
5947 v369 = &pActors[dword_50BF30[a2]]; | |
5948 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5949 { | |
5950 a1.vPosition.x = v369->vPosition.x; | |
5951 a1.vPosition.y = v369->vPosition.y; | |
5952 v732 = v369->uActorHeight; | |
5953 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5954 v370 = 8 * dword_50BF30[a2]; | |
5955 LOBYTE(v370) = v370 | 3; | |
5956 a1.field_5C = v370; | |
5957 a1.Create(0, v1, v1, v1); | |
5958 v732 = (int)v733 << 7; | |
5959 v369->pActorBuffs[4].Apply( | |
5960 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
5961 v731, | |
5962 v1, | |
5963 v1, | |
5964 v1); | |
5965 } | |
5966 } | |
5967 goto LABEL_1056; | |
5968 case 53: | |
5969 v371 = v12 - 2; | |
5970 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
5971 amount = v1; | |
5972 else | |
5973 amount = 86400 * v2; | |
5974 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5975 goto LABEL_83; | |
5976 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, v1, 65536); | |
5977 v373 = v3->uPlayerID_2; | |
5978 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5979 goto LABEL_1056; | |
5980 v14 = v731 == 4; | |
5981 pParty->pPlayers[v373].sHealth = 1; | |
5982 if ( v14 ) | |
5983 { | |
5984 v374 = v3->uPlayerID_2; | |
5985 LODWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5986 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5987 v376 = v3->uPlayerID_2; | |
5988 LODWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5989 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5990 } | |
5991 else | |
5992 { | |
5993 v732 = amount << 7; | |
5994 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5995 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5996 0xEu, | |
5997 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5998 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5999 0xDu, | |
6000 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6001 } | |
112 | 6002 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6003 goto LABEL_720; |
6004 case 54: | |
6005 v378 = v12 - 2; | |
6006 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
6007 v380 = 4 * v2; | |
6008 else | |
6009 v380 = 3 * v2; | |
6010 amount = v380; | |
6011 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6012 goto LABEL_83; | |
6013 v381 = 0; | |
6014 HIDWORD(v733) = amount; | |
6015 v730 = 0; | |
6016 v382 = 1; | |
6017 do | |
6018 { | |
6019 v383 = pPlayers[v382]; | |
6020 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
6021 v682[v381++] = v382; | |
6022 ++v382; | |
6023 } | |
6024 while ( v382 <= 4 ); | |
6025 v384 = 0; | |
6026 v730 = v381; | |
6027 if ( v381 > v1 ) | |
6028 { | |
6029 do | |
6030 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
6031 while ( v384 < v381 ); | |
6032 } | |
6033 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
6034 HIDWORD(v733) = v1; | |
6035 if ( v381 > v1 ) | |
6036 { | |
6037 do | |
6038 { | |
6039 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
6040 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
6041 v726 = *(Player **)v385; | |
6042 v386 = v726->GetMaxHealth(); | |
6043 if ( v726->sHealth > v386 ) | |
6044 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
6045 v387 = *(Player **)v385; | |
6046 if ( v387->sHealth > v1 ) | |
6047 { | |
6048 LODWORD(v387->pConditions[13]) = v1; | |
6049 HIDWORD(v387->pConditions[13]) = v1; | |
6050 } | |
6051 v388 = HIDWORD(v733); | |
6052 v389 = LOWORD(v682[HIDWORD(v733)]) - 1; | |
6053 v390 = v3->spellnum; | |
6054 v391 = pGame->GetStru6(); | |
6055 pGame->GetStru6()->SetPlayerBuffAnim(v390, v389); | |
6056 HIDWORD(v733) = v388 + 1; | |
6057 } | |
6058 while ( v388 + 1 < v730 ); | |
6059 } | |
6060 goto LABEL_1056; | |
6061 case 55: | |
6062 v392 = v12 - 1; | |
6063 if ( !v392 ) | |
6064 { | |
6065 v395 = 180 * v2; | |
6066 goto LABEL_750; | |
6067 } | |
6068 v393 = v392 - 1; | |
6069 if ( !v393 ) | |
6070 { | |
6071 v395 = 10800 * v2; | |
6072 goto LABEL_750; | |
6073 } | |
6074 v394 = v393 - 1; | |
6075 if ( !v394 ) | |
6076 { | |
6077 v395 = 259200 * v2; | |
6078 LABEL_750: | |
6079 amount = v395; | |
6080 goto LABEL_751; | |
6081 } | |
6082 if ( v394 == 1 ) | |
6083 amount = v1; | |
6084 LABEL_751: | |
6085 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6086 goto LABEL_83; | |
6087 v396 = v3->uPlayerID_2; | |
6088 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
6089 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
6090 { | |
6091 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
6092 pParty->pPlayers[v396].PlaySound(25, v1); | |
6093 if ( v731 == 4 ) | |
6094 { | |
6095 v397 = v3->uPlayerID_2; | |
6096 LODWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6097 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6098 v398 = v3->uPlayerID_2; | |
6099 LODWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6100 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6101 v399 = v3->uPlayerID_2; | |
6102 LODWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6103 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6104 } | |
6105 else | |
6106 { | |
6107 v732 = amount << 7; | |
6108 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6109 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6110 0x10u, | |
6111 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6112 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6113 0xEu, | |
6114 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6115 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6116 0xDu, | |
6117 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6118 } | |
6119 v83 = 1; | |
112 | 6120 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
0 | 6121 v401 = pGame; |
6122 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; | |
6123 v402 = v3->uPlayerID_2; | |
6124 v403 = v3->spellnum; | |
6125 v404 = pGame->GetStru6(); | |
6126 pGame->GetStru6()->SetPlayerBuffAnim(v403, v402); | |
6127 } | |
6128 else | |
6129 { | |
6130 v83 = 1; | |
6131 } | |
6132 goto LABEL_978; | |
6133 case 61: | |
6134 v405 = v12 - 2; | |
6135 if ( !v405 ) | |
6136 goto LABEL_766; | |
6137 v406 = v405 - 1; | |
6138 if ( v406 ) | |
6139 { | |
6140 if ( v406 == 1 ) | |
6141 { | |
6142 amount = v1; | |
6143 goto LABEL_768; | |
6144 } | |
6145 LABEL_766: | |
6146 v407 = 3600 * v2; | |
6147 } | |
6148 else | |
6149 { | |
6150 v407 = 86400 * v2; | |
6151 } | |
6152 amount = v407; | |
6153 LABEL_768: | |
6154 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6155 goto LABEL_83; | |
6156 v408 = v3->uPlayerID_2; | |
6157 v409 = v3->spellnum; | |
6158 v410 = pGame->GetStru6(); | |
6159 pGame->GetStru6()->SetPlayerBuffAnim(v409, v408); | |
6160 v323 = v3->uPlayerID_2; | |
6161 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6162 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6163 goto LABEL_1056; | |
6164 if ( v731 == 4 ) | |
6165 goto LABEL_637; | |
6166 v732 = amount << 7; | |
6167 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6168 v656 = 12; | |
6169 goto LABEL_640; | |
6170 case 56: | |
6171 v411 = v12 - 2; | |
6172 if ( v411 ) | |
6173 { | |
6174 v412 = v411 - 1; | |
6175 if ( v412 ) | |
6176 { | |
6177 if ( v412 == 1 ) | |
6178 { | |
6179 amount = v1; | |
6180 goto LABEL_780; | |
6181 } | |
6182 v413 = 180 * v2; | |
6183 } | |
6184 else | |
6185 { | |
6186 v413 = 86400 * v2; | |
6187 } | |
6188 } | |
6189 else | |
6190 { | |
6191 v413 = 3600 * v2; | |
6192 } | |
6193 amount = v413; | |
6194 LABEL_780: | |
6195 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6196 goto LABEL_83; | |
6197 v414 = v3->uPlayerID_2; | |
6198 v415 = v3->spellnum; | |
6199 v416 = pGame->GetStru6(); | |
6200 pGame->GetStru6()->SetPlayerBuffAnim(v415, v414); | |
6201 v323 = v3->uPlayerID_2; | |
6202 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6203 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6204 goto LABEL_1056; | |
6205 if ( v731 == 4 ) | |
6206 goto LABEL_637; | |
6207 v732 = amount << 7; | |
6208 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6209 v656 = 3; | |
6210 goto LABEL_640; | |
6211 case 59: | |
6212 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6213 goto LABEL_83; | |
141 | 6214 if ( a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 6215 goto LABEL_1056; |
6216 v417 = (int)&pActors[a2 >> 3]; | |
6217 v730 = v417; | |
6218 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6219 { | |
6220 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6221 v417 = v730; | |
6222 } | |
6223 v418 = *(int *)(v417 + 672); | |
6224 HIDWORD(v733) = v1; | |
6225 if ( pItemsTable->pItems[v418].uEquipType == 18 ) | |
6226 HIDWORD(v733) = *(int *)(v417 + 684); | |
6227 | |
6228 //ItemGen::ItemGen(&v683); | |
6229 v683.Reset(); | |
6230 | |
6231 v419 = *(short *)(v730 + 180); | |
6232 if ( v419 != (short)v1 ) | |
6233 { | |
6234 v683.uItemID = v419; | |
6235 goto LABEL_799; | |
6236 } | |
6237 v420 = 0; | |
6238 v421 = v730 + 564; | |
6239 while ( *(int *)v421 == v1 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) | |
6240 { | |
6241 ++v420; | |
6242 v421 += 36; | |
6243 if ( v420 >= 4 ) | |
6244 goto LABEL_799; | |
6245 } | |
6246 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6247 v2 = v723; | |
6248 v1 = 0; | |
6249 LABEL_799: | |
6250 if ( HIDWORD(v733) != v1 ) | |
6251 { | |
6252 v675 = (const char *)HIDWORD(v733); | |
6253 if ( v683.uItemID != v1 ) | |
6254 { | |
6255 v422 = v683.GetDisplayName(); | |
6256 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6257 goto LABEL_807; | |
6258 } | |
6259 v664 = "%d gold"; | |
6260 goto LABEL_803; | |
6261 } | |
6262 if ( v683.uItemID != v1 ) | |
6263 { | |
6264 v675 = v683.GetDisplayName(); | |
6265 v664 = "(%s)"; | |
6266 LABEL_803: | |
6267 sprintf(pTmpBuf2, v664, v675); | |
6268 goto LABEL_807; | |
6269 } | |
6270 strcpy(pTmpBuf2, "nothing"); | |
6271 LABEL_807: | |
6272 ShowStatusBarString(pTmpBuf2, 2u); | |
6273 a1.stru_24.Reset(); | |
6274 a1.field_48 = v3->spellnum; | |
6275 a1.field_4C = v2; | |
6276 a1.field_50 = v731; | |
6277 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6278 a1.vPosition.x = *(short *)(v730 + 142); | |
6279 a1.vPosition.y = *(short *)(v730 + 144); | |
6280 v676 = *(short *)(v730 + 138); | |
6281 v665 = a1.vPosition.y; | |
6282 a1.vPosition.z = *(short *)(v730 + 138); | |
6283 v657 = a1.vPosition.x; | |
6284 goto LABEL_1087; | |
6285 case 62: | |
6286 v423 = v12 - 2; | |
6287 if ( !v423 ) | |
6288 goto LABEL_813; | |
6289 v424 = v423 - 1; | |
6290 if ( v424 ) | |
6291 { | |
6292 if ( v424 == 1 ) | |
6293 v425 = 3600 * v2; | |
6294 else | |
6295 LABEL_813: | |
6296 v425 = 300 * v2; | |
6297 } | |
6298 else | |
6299 { | |
6300 v425 = 600 * v2; | |
6301 } | |
6302 amount = v425; | |
6303 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6304 goto LABEL_83; | |
6305 v426 = a2 >> 3; | |
141 | 6306 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6307 goto LABEL_1056; |
6308 v730 = 836 * v426; | |
6309 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6310 { | |
90 | 6311 pActors[v426].pActorBuffs[1].Reset(); |
6312 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6313 v732 = amount << 7; |
90 | 6314 pActors[v426].pActorBuffs[9].Apply( |
0 | 6315 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6316 v731, | |
6317 v1, | |
6318 v1, | |
6319 v1); | |
90 | 6320 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6321 } |
6322 a1.stru_24.Reset(); | |
6323 a1.field_48 = v3->spellnum; | |
6324 a1.field_4C = v2; | |
6325 a1.field_50 = v731; | |
6326 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6327 v61 = v426; |
0 | 6328 goto LABEL_1086; |
6329 case 66: | |
6330 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6331 goto LABEL_83; | |
6332 amount = 600 * v2; | |
6333 v427 = a2 >> 3; | |
141 | 6334 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6335 goto LABEL_1056; |
6336 v730 = 836 * v427; | |
6337 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6338 goto LABEL_83; | |
90 | 6339 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6340 { | |
6341 pActors[v427].pActorBuffs[9].Reset(); | |
6342 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6343 v732 = amount << 7; |
90 | 6344 pActors[v427].pActorBuffs[12].Apply( |
0 | 6345 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6346 v731, | |
6347 v1, | |
6348 v1, | |
6349 v1); | |
6350 } | |
6351 a1.stru_24.Reset(); | |
6352 a1.field_48 = v3->spellnum; | |
6353 a1.field_4C = v2; | |
6354 a1.field_50 = v731; | |
6355 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6356 v61 = v427; |
0 | 6357 goto LABEL_1086; |
6358 case 63: | |
6359 v428 = v12 - 2; | |
6360 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6361 v430 = 300 * v2; | |
6362 else | |
6363 v430 = 180 * v2; | |
6364 amount = v430; | |
6365 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6366 goto LABEL_83; | |
6367 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6368 v431 = pGame->GetStru6(); | |
6369 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | |
6370 ++a1.uItemType; | |
6371 a1.stru_24.Reset(); | |
6372 a1.field_48 = v3->spellnum; | |
6373 a1.field_4C = v2; | |
6374 a1.field_50 = v731; | |
6375 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6376 a1.uAttributes = v1; | |
6377 a1.uSectorID = v1; | |
6378 a1.uSpriteFrameID = v1; | |
6379 v432 = v3->uPlayerID; | |
6380 a1.field_60_distance_related_prolly_lod = 0; | |
6381 a1.uFacing = v1; | |
6382 v432 *= 8; | |
6383 LOBYTE(v432) = v432 | 4; | |
6384 a1.field_58 = v432; | |
6385 a1.uSoundID = LOWORD(v3->field_10); | |
6386 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
6387 { | |
6388 v433 = &pActors[dword_50BF30[a2]]; | |
6389 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6390 break; | |
6391 a1.vPosition.x = v433->vPosition.x; | |
6392 a1.vPosition.y = v433->vPosition.y; | |
6393 v732 = v433->uActorHeight; | |
6394 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6395 v434 = 8 * dword_50BF30[a2]; | |
6396 LOBYTE(v434) = v434 | 3; | |
6397 a1.field_5C = v434; | |
6398 a1.Create(0, v1, v1, v1); | |
6399 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) | |
6400 { | |
6401 v732 = amount << 7; | |
6402 v433->pActorBuffs[4].Apply( | |
6403 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
6404 v731, | |
6405 v1, | |
6406 v1, | |
6407 v1); | |
6408 } | |
6409 } | |
6410 goto LABEL_1056; | |
6411 case 64: | |
6412 v435 = v12 - 2; | |
6413 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
6414 amount = v1; | |
6415 else | |
6416 amount = 86400 * v2; | |
6417 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6418 goto LABEL_83; | |
6419 v437 = v3->uPlayerID_2; | |
6420 v438 = v3->spellnum; | |
6421 v439 = pGame->GetStru6(); | |
6422 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); | |
6423 v440 = v3->uPlayerID_2; | |
6424 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6425 { | |
6426 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
6427 pParty->pPlayers[v440].PlaySound(25, v1); | |
6428 if ( v731 == 4 ) | |
6429 { | |
6430 v441 = v3->uPlayerID_2; | |
6431 LODWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6432 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6433 } | |
6434 else | |
6435 { | |
6436 v732 = amount << 7; | |
6437 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6438 5u, | |
6439 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6440 } | |
6441 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6442 LABEL_720: | |
6443 v377->SetCondition(1u, v1); | |
6444 } | |
6445 goto LABEL_1056; | |
6446 case 42: | |
6447 v442 = v12 - 2; | |
6448 if ( !v442 ) | |
6449 goto LABEL_855; | |
6450 v443 = v442 - 1; | |
6451 if ( v443 ) | |
6452 { | |
6453 if ( v443 == 1 ) | |
6454 v444 = 4 * v2; | |
6455 else | |
6456 LABEL_855: | |
6457 v444 = 2 * v2; | |
6458 } | |
6459 else | |
6460 { | |
6461 v444 = 3 * v2; | |
6462 } | |
6463 amount = v444; | |
6464 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6465 goto LABEL_83; | |
6466 v445 = a2 >> 3; | |
141 | 6467 if ( (a2 & 7) == OBJECT_Item) |
0 | 6468 { |
6469 v449 = (char *)&pLayingItems[v445].stru_24; | |
6470 v450 = *(int *)v449; | |
6471 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6472 { | |
6473 party_finds_gold(*((int *)v449 + 3), 0); | |
6474 viewparams->bRedrawGameUI = 1; | |
6475 } | |
6476 else | |
6477 { | |
6478 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); | |
6479 ShowStatusBarString(pTmpBuf2, 2u); | |
6480 if ( !pParty->AddItem(&pLayingItems[v445].stru_24) ) | |
6481 pParty->SetHoldingItem(&pLayingItems[v445].stru_24); | |
6482 } | |
6483 LayingItem::_42F933(v445); | |
6484 } | |
6485 else | |
6486 { | |
141 | 6487 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6488 { |
6489 stru_50C198.LootActor(&pActors[v445]); | |
6490 } | |
6491 else | |
6492 { | |
141 | 6493 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6494 { |
141 | 6495 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6496 goto LABEL_1056; |
6497 dword_507CD8 = 1; | |
6498 v677 = 1; | |
6499 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6500 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6501 else | |
6502 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6503 goto LABEL_866; | |
6504 } | |
6505 v447 = &pLevelDecorations[v445]; | |
6506 dword_507CD8 = 1; | |
6507 v448 = v447->field_16_event_id; | |
6508 if ( v448 != (short)v1 ) | |
6509 { | |
6510 v677 = 1; | |
6511 v446 = v448; | |
6512 LABEL_866: | |
6513 EventProcessor(v446, a2, v677); | |
6514 goto LABEL_1056; | |
6515 } | |
6516 if ( v447->IsInteractive() ) | |
6517 { | |
6518 _5C3420_pDecoration = v447; | |
6519 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); | |
6520 _5C3420_pDecoration = (LevelDecoration *)v1; | |
6521 } | |
6522 } | |
6523 } | |
6524 goto LABEL_1056; | |
6525 case 67: | |
6526 v451 = v12 - 2; | |
6527 if ( v451 ) | |
6528 { | |
6529 v452 = v451 - 1; | |
6530 if ( v452 ) | |
6531 { | |
6532 if ( v452 == 1 ) | |
6533 { | |
6534 amount = v1; | |
6535 goto LABEL_883; | |
6536 } | |
6537 v453 = 180 * v2; | |
6538 } | |
6539 else | |
6540 { | |
6541 v453 = 86400 * v2; | |
6542 } | |
6543 } | |
6544 else | |
6545 { | |
6546 v453 = 3600 * v2; | |
6547 } | |
6548 amount = v453; | |
6549 LABEL_883: | |
6550 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6551 goto LABEL_83; | |
6552 v454 = v3->uPlayerID_2; | |
6553 v455 = v3->spellnum; | |
6554 v456 = pGame->GetStru6(); | |
6555 pGame->GetStru6()->SetPlayerBuffAnim(v455, v454); | |
6556 v323 = v3->uPlayerID_2; | |
6557 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6558 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6559 goto LABEL_1056; | |
6560 if ( v731 == 4 ) | |
6561 { | |
6562 LABEL_637: | |
6563 *(int *)v324 = v1; | |
6564 *((int *)v324 + 1) = v1; | |
6565 goto LABEL_1056; | |
6566 } | |
6567 v732 = amount << 7; | |
6568 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6569 v656 = 1; | |
6570 LABEL_640: | |
6571 v325 = &pParty->pPlayers[v323]; | |
6572 goto LABEL_641; | |
6573 case 68: | |
6574 v457 = v12 - 2; | |
6575 if ( v457 ) | |
6576 { | |
6577 v458 = v457 - 1; | |
6578 if ( v458 ) | |
6579 { | |
6580 if ( v458 == 1 ) | |
6581 v459 = 5 * v2 + 5; | |
6582 else | |
6583 v459 = 2 * v2 + 5; | |
6584 } | |
6585 else | |
6586 { | |
6587 v459 = 4 * v2 + 5; | |
6588 } | |
6589 } | |
6590 else | |
6591 { | |
6592 v459 = 3 * v2 + 5; | |
6593 } | |
6594 amount = v459; | |
6595 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6596 goto LABEL_83; | |
6597 v460 = *(int *)&v3->field_C; | |
6598 if ( v460 == v1 ) | |
6599 { | |
6600 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6601 LABEL_904: | |
6602 v674 = v3->uPlayerID_2; | |
6603 LABEL_685: | |
6604 v352 = v3->spellnum; | |
6605 v353 = pGame->GetStru6(); | |
6606 pGame->GetStru6()->SetPlayerBuffAnim(v352, v674); | |
6607 } | |
6608 else | |
6609 { | |
141 | 6610 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6611 { |
6612 v461 = &pActors[v460 >> 3]; | |
6613 v462 = v461->uAIState; | |
6614 v463 = v461->pMonsterInfo.uHP; | |
6615 if ( v462 != 5 ) | |
6616 { | |
6617 if ( v462 != 4 ) | |
6618 { | |
6619 if ( v462 != 19 ) | |
6620 { | |
6621 if ( v462 != 11 ) | |
6622 { | |
6623 v461->sCurrentHP += amount; | |
6624 if ( v461->sCurrentHP > v463 ) | |
6625 v461->sCurrentHP = v463; | |
6626 } | |
6627 } | |
6628 } | |
6629 } | |
6630 } | |
6631 } | |
6632 goto LABEL_1056; | |
6633 case 72: | |
6634 v464 = v12 - 2; | |
6635 if ( !v464 ) | |
6636 goto LABEL_910; | |
6637 v465 = v464 - 1; | |
6638 if ( v465 ) | |
6639 { | |
6640 if ( v465 == 1 ) | |
6641 { | |
6642 amount = v1; | |
6643 goto LABEL_912; | |
6644 } | |
6645 LABEL_910: | |
6646 v466 = 3600 * v2; | |
6647 } | |
6648 else | |
6649 { | |
6650 v466 = 86400 * v2; | |
6651 } | |
6652 amount = v466; | |
6653 LABEL_912: | |
6654 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6655 goto LABEL_83; | |
6656 v467 = v3->uPlayerID_2; | |
6657 v468 = v3->spellnum; | |
6658 v469 = pGame->GetStru6(); | |
6659 pGame->GetStru6()->SetPlayerBuffAnim(v468, v467); | |
6660 v470 = v3->uPlayerID_2; | |
6661 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6662 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6663 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6664 goto LABEL_1056; | |
6665 if ( v731 == 4 ) | |
6666 { | |
6667 LODWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6668 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6669 v471 = v3->uPlayerID_2; | |
6670 LODWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6671 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6672 v472 = v3->uPlayerID_2; | |
6673 LODWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6674 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6675 goto LABEL_1056; | |
6676 } | |
6677 v732 = amount << 7; | |
6678 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6679 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6680 6u, | |
6681 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6682 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6683 8u, | |
6684 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6685 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6686 v656 = 10; | |
6687 goto LABEL_937; | |
6688 case 75: | |
6689 amount = v2; | |
6690 LODWORD(v733) = 3600 * v2; | |
6691 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6692 goto LABEL_83; | |
6693 v474 = v3->spellnum; | |
6694 v475 = pGame->GetStru6(); | |
6695 pGame->GetStru6()->SetPlayerBuffAnim(v474, v1); | |
6696 v476 = v3->spellnum; | |
6697 v477 = pGame->GetStru6(); | |
6698 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1u); | |
6699 v478 = v3->spellnum; | |
6700 v479 = pGame->GetStru6(); | |
6701 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2u); | |
6702 v480 = v3->spellnum; | |
6703 v481 = pGame->GetStru6(); | |
6704 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3u); | |
6705 v668 = v1; | |
6706 v732 = (int)v733 << 7; | |
6707 v658 = v1; | |
6708 v653 = v2; | |
6709 v651 = v731; | |
6710 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6711 v27 = (char *)&pParty->pPartyBuffs[13]; | |
6712 goto LABEL_101; | |
6713 case 73: | |
6714 LODWORD(v733) = 3600 * v2; | |
6715 amount = v2; | |
6716 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6717 goto LABEL_83; | |
6718 if ( v731 == 4 ) | |
6719 { | |
6720 v482 = v3->spellnum; | |
6721 v483 = pGame->GetStru6(); | |
6722 pGame->GetStru6()->SetPlayerBuffAnim(v482, v1); | |
6723 v484 = v3->spellnum; | |
6724 v485 = pGame->GetStru6(); | |
6725 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1u); | |
6726 v486 = v3->spellnum; | |
6727 v487 = pGame->GetStru6(); | |
6728 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2u); | |
6729 v488 = v3->spellnum; | |
6730 v489 = pGame->GetStru6(); | |
6731 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3u); | |
6732 v732 = (int)v733 << 7; | |
6733 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6734 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6735 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6736 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6737 v668 = v1; | |
6738 v658 = v2; | |
6739 v653 = v2; | |
6740 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; | |
6741 v651 = 4; | |
6742 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; | |
6743 v27 = (char *)&pParty->pPlayers[3].pPlayerBuffs[6]; | |
6744 goto LABEL_104; | |
6745 } | |
6746 v490 = v3->uPlayerID_2; | |
6747 v491 = v3->spellnum; | |
6748 v492 = pGame->GetStru6(); | |
6749 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); | |
6750 v668 = v1; | |
6751 v732 = (int)v733 << 7; | |
6752 v658 = v2; | |
6753 v653 = v2; | |
6754 v651 = v731; | |
6755 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6756 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; | |
6757 goto LABEL_103; | |
6758 case 74: | |
6759 v493 = v12 - 2; | |
6760 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
6761 amount = v1; | |
6762 else | |
6763 amount = 86400 * v2; | |
6764 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6765 goto LABEL_83; | |
6766 v495 = v3->uPlayerID_2; | |
6767 v496 = v3->spellnum; | |
6768 v497 = pGame->GetStru6(); | |
6769 pGame->GetStru6()->SetPlayerBuffAnim(v496, v495); | |
6770 v498 = v3->uPlayerID_2; | |
6771 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6772 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6773 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6774 goto LABEL_1056; | |
6775 if ( v731 == 4 ) | |
6776 { | |
6777 LODWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6778 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6779 v499 = v3->uPlayerID_2; | |
6780 LODWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6781 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6782 v500 = v3->uPlayerID_2; | |
6783 LODWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6784 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6785 } | |
6786 else | |
6787 { | |
6788 v732 = amount << 7; | |
6789 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6790 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6791 7u, | |
6792 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6793 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6794 9u, | |
6795 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6796 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6797 v656 = 11; | |
6798 LABEL_937: | |
112 | 6799 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6800 LABEL_641: |
6801 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6802 } | |
6803 goto LABEL_1056; | |
6804 case 77: | |
6805 amount = 5 * v2 + 10; | |
6806 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6807 goto LABEL_83; | |
6808 v501 = pParty->pPlayers; | |
6809 do | |
6810 { | |
6811 v502 = v3->spellnum; | |
6812 v503 = pGame->GetStru6(); | |
6813 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); | |
6814 v501->Heal(amount); | |
6815 ++v501; | |
6816 ++v1; | |
6817 } | |
6818 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6819 goto LABEL_1056; | |
6820 case 80: | |
6821 sRecoveryTime -= v2; | |
6822 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6823 goto LABEL_83; | |
6824 v504 = pGame->GetStru6(); | |
6825 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); | |
6826 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6827 ++a1.uItemType; | |
6828 HIDWORD(v733) = v505; | |
6829 v690 = v1; | |
6830 v689 = v1; | |
6831 v688 = v1; | |
6832 a1.stru_24.Reset(); | |
6833 a1.field_48 = v3->spellnum; | |
6834 a1.field_4C = v2; | |
6835 a1.field_50 = v731; | |
6836 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6837 a1.uAttributes = v1; | |
6838 a1.uSectorID = v1; | |
6839 a1.uSpriteFrameID = v1; | |
6840 v506 = v3->uPlayerID; | |
6841 a1.field_60_distance_related_prolly_lod = 0; | |
6842 a1.uFacing = v1; | |
6843 v506 *= 8; | |
6844 LOBYTE(v506) = v506 | 4; | |
6845 a1.field_58 = v506; | |
6846 a1.uSoundID = LOWORD(v3->field_10); | |
6847 a2 = v1; | |
6848 if ( SHIDWORD(v733) > v1 ) | |
6849 { | |
6850 do | |
6851 { | |
6852 v507 = dword_50BF30[a2]; | |
6853 a1.vPosition.x = pActors[v507].vPosition.x; | |
6854 a1.vPosition.y = pActors[v507].vPosition.y; | |
6855 v732 = pActors[v507].uActorHeight; | |
6856 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6857 v508 = 8 * dword_50BF30[a2]; | |
6858 LOBYTE(v508) = v508 | 3; | |
6859 a1.field_5C = v508; | |
6860 v509 = a1.Create(0, v1, v1, v1); | |
6861 v510 = a2; | |
6862 DamageMonsterFromParty(8 * v509 | 2, dword_50BF30[a2], (Vec3_int_ *)&v688); | |
6863 a2 = v510 + 1; | |
6864 } | |
6865 while ( v510 + 1 < SHIDWORD(v733) ); | |
6866 } | |
6867 for ( a2 = v1; a2 < SHIDWORD(v733); ++a2 ) | |
6868 { | |
6869 v511 = &pActors[dword_50BF30[a2]]; | |
6870 a1.vPosition.x = v511->vPosition.x; | |
6871 a1.vPosition.y = v511->vPosition.y; | |
6872 v732 = v511->uActorHeight; | |
6873 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6874 v512 = 8 * dword_50BF30[a2]; | |
6875 LOBYTE(v512) = v512 | 3; | |
6876 a1.field_5C = v512; | |
6877 a1.Create(0, v1, v1, v1); | |
6878 v513 = v511->pActorBuffs; | |
6879 v726 = (Player *)22; | |
6880 do | |
6881 { | |
6882 v513->Reset(); | |
6883 ++v513; | |
6884 v726 = (Player *)((char *)v726 - 1); | |
6885 } | |
6886 while ( *(float *)&v726 != 0.0 ); | |
6887 } | |
6888 goto LABEL_1056; | |
6889 case 82: | |
6890 v514 = v12 - 2; | |
6891 if ( !v514 ) | |
6892 goto LABEL_955; | |
6893 v515 = v514 - 1; | |
6894 if ( v515 ) | |
6895 { | |
6896 if ( v515 == 1 ) | |
6897 { | |
6898 v516 = 900 * v2; | |
6899 amount = 5; | |
6900 } | |
6901 else | |
6902 { | |
6903 LABEL_955: | |
6904 v516 = 300 * v2; | |
6905 amount = 1; | |
6906 } | |
6907 } | |
6908 else | |
6909 { | |
6910 v516 = 900 * v2; | |
6911 amount = 3; | |
6912 } | |
6913 v733 = __PAIR__(v1, v516); | |
6914 v517 = 8 * v3->uPlayerID; | |
6915 LOBYTE(v517) = v517 | 4; | |
6916 if ( (signed int)uNumActors > v1 ) | |
6917 { | |
90 | 6918 v518 = pActors;//[0].uAIState; |
6919 v726b = uNumActors; | |
0 | 6920 do |
6921 { | |
90 | 6922 v519 = v518->uAIState; |
6923 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6924 ++HIDWORD(v733); |
90 | 6925 ++v518; |
6926 --v726; | |
0 | 6927 } |
90 | 6928 while ( v726 != 0 ); |
0 | 6929 } |
6930 if ( SHIDWORD(v733) >= amount ) | |
6931 { | |
6932 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6933 goto LABEL_201; | |
6934 } | |
6935 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6936 goto LABEL_83; | |
6937 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); | |
6938 goto LABEL_1056; | |
6939 case 83: | |
6940 v520 = v12 - 2; | |
6941 if ( !v520 ) | |
6942 goto LABEL_973; | |
6943 v521 = v520 - 1; | |
6944 if ( v521 ) | |
6945 { | |
6946 if ( v521 == 1 ) | |
6947 { | |
6948 LODWORD(v733) = 18000 * v2; | |
6949 v522 = 5 * v2 + 10; | |
6950 } | |
6951 else | |
6952 { | |
6953 LABEL_973: | |
6954 LODWORD(v733) = 10800 * v2; | |
6955 v522 = 3 * v2 + 10; | |
6956 } | |
6957 } | |
6958 else | |
6959 { | |
6960 LODWORD(v733) = 14400 * v2; | |
6961 v522 = 4 * v2 + 10; | |
6962 } | |
6963 amount = v522; | |
6964 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6965 goto LABEL_83; | |
6966 v523 = v3->spellnum; | |
6967 v524 = pGame->GetStru6(); | |
6968 pGame->GetStru6()->SetPlayerBuffAnim(v523, v1); | |
6969 v83 = 1; | |
6970 v525 = v3->spellnum; | |
6971 v526 = pGame->GetStru6(); | |
6972 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1u); | |
6973 v527 = v3->spellnum; | |
6974 v528 = pGame->GetStru6(); | |
6975 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2u); | |
6976 v529 = v3->spellnum; | |
6977 v530 = pGame->GetStru6(); | |
6978 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3u); | |
6979 v673 = v1; | |
6980 v732 = (int)v733 << 7; | |
6981 v662 = v1; | |
6982 v655 = amount; | |
6983 v652 = v731; | |
6984 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6985 v137 = (char *)&pParty->pPartyBuffs[2]; | |
6986 goto LABEL_976; | |
6987 case 84: | |
6988 v67 = 2; | |
6989 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6990 { | |
6991 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6992 goto LABEL_202; | |
6993 } | |
6994 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6995 goto LABEL_83; | |
6996 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6997 ++a1.uItemType; | |
6998 v726 = (Player *)v531; | |
6999 v696 = v1; | |
7000 v695 = v1; | |
7001 v694 = v1; | |
7002 a1.stru_24.Reset(); | |
7003 a1.field_48 = v3->spellnum; | |
7004 a1.field_4C = v2; | |
7005 a1.field_50 = v731; | |
7006 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7007 a1.uAttributes = v1; | |
7008 a1.uSectorID = v1; | |
7009 a1.uSpriteFrameID = v1; | |
7010 v532 = v3->uPlayerID; | |
7011 a1.field_60_distance_related_prolly_lod = 0; | |
7012 a1.uFacing = v1; | |
7013 v532 *= 8; | |
7014 LOBYTE(v532) = v532 | 4; | |
7015 a1.field_58 = v532; | |
7016 a1.uSoundID = LOWORD(v3->field_10); | |
7017 a2 = v1; | |
7018 if ( (signed int)v726 > v1 ) | |
7019 { | |
7020 do | |
7021 { | |
7022 v533 = dword_50BF30[a2]; | |
7023 a1.vPosition.x = pActors[v533].vPosition.x; | |
7024 a1.vPosition.y = pActors[v533].vPosition.y; | |
7025 v732 = pActors[v533].uActorHeight; | |
7026 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7027 v534 = 8 * dword_50BF30[a2]; | |
7028 LOBYTE(v534) = v534 | 3; | |
7029 a1.field_5C = v534; | |
7030 v535 = a1.Create(0, v1, v1, v1); | |
7031 v536 = a2; | |
7032 DamageMonsterFromParty(8 * v535 | 2, dword_50BF30[a2], (Vec3_int_ *)&v694); | |
7033 a2 = v536 + 1; | |
7034 } | |
7035 while ( v536 + 1 < (signed int)v726 ); | |
7036 } | |
7037 v537 = pGame->GetStru6(); | |
7038 pGame->GetStru6()->_4A8BFC(); | |
7039 goto LABEL_1056; | |
7040 case 85: | |
7041 v538 = v12 - 2; | |
7042 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
7043 { | |
7044 amount = 5 * v2; | |
7045 v540 = 18000 * v2; | |
7046 } | |
7047 else | |
7048 { | |
7049 amount = 4 * v2; | |
7050 v540 = 14400 * v2; | |
7051 } | |
7052 v730 = v540; | |
7053 LODWORD(v733) = v540; | |
7054 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7055 goto LABEL_83; | |
7056 v541 = v3->spellnum; | |
7057 v542 = pGame->GetStru6(); | |
7058 pGame->GetStru6()->SetPlayerBuffAnim(v541, v1); | |
7059 v543 = v3->spellnum; | |
7060 v544 = pGame->GetStru6(); | |
7061 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1u); | |
7062 v545 = v3->spellnum; | |
7063 v546 = pGame->GetStru6(); | |
7064 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2u); | |
7065 v547 = v3->spellnum; | |
7066 v548 = pGame->GetStru6(); | |
7067 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3u); | |
7068 v732 = v730 << 7; | |
7069 v549 = (double)(v730 << 7) * 0.033333335; | |
7070 *((float *)&v733 + 1) = v549; | |
7071 v712 = (signed __int64)v549; | |
7072 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, v1, v1); | |
7073 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7074 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7075 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7076 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7077 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7078 v550 = v2 + 5; | |
7079 pParty->pPartyBuffs[ 5].Apply( | |
7080 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7081 v731, | |
7082 v550, | |
7083 v1, | |
7084 v1); | |
7085 v668 = v1; | |
7086 v658 = v1; | |
7087 v653 = v550; | |
7088 v651 = v731; | |
7089 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); | |
7090 LABEL_992: | |
7091 v27 = (char *)&pParty->pPartyBuffs[19]; | |
7092 goto LABEL_103; | |
7093 case 86: | |
7094 v551 = v12 - 2; | |
7095 if ( !v551 ) | |
7096 goto LABEL_998; | |
7097 v552 = v551 - 1; | |
7098 if ( v552 ) | |
7099 { | |
7100 if ( v552 == 1 ) | |
7101 { | |
7102 amount = 15; | |
7103 HIDWORD(v733) = 20; | |
7104 goto LABEL_1000; | |
7105 } | |
7106 LABEL_998: | |
7107 v678 = 4; | |
7108 } | |
7109 else | |
7110 { | |
7111 v678 = 12; | |
7112 } | |
7113 amount = v678; | |
7114 HIDWORD(v733) = v678; | |
7115 LABEL_1000: | |
7116 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7117 goto LABEL_83; | |
7118 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); | |
7119 v732 = (300 * amount * v2 + 60) << 7; | |
7120 v730 = v2 + 5; | |
7121 v726 = (Player *)v1; | |
89 | 7122 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 7123 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
7124 do | |
7125 { | |
7126 v554 = v3->spellnum; | |
7127 v555 = pGame->GetStru6(); | |
7128 pGame->GetStru6()->SetPlayerBuffAnim(v554, v1); | |
7129 v556 = v3->spellnum; | |
7130 v557 = pGame->GetStru6(); | |
7131 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1u); | |
7132 v558 = v3->spellnum; | |
7133 v559 = pGame->GetStru6(); | |
7134 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2u); | |
7135 v560 = v3->spellnum; | |
7136 v561 = pGame->GetStru6(); | |
7137 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3u); | |
89 | 7138 //((SpellBuff *)(v553 + 6056))->Apply( |
7139 v553->pPlayerBuffs[4].Apply( | |
0 | 7140 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7141 v731, | |
7142 v730, | |
7143 v1, | |
7144 v1); | |
7145 if ( *(_QWORD *)v553 ) | |
7146 v726 = (Player *)1; | |
89 | 7147 ++v553; |
7148 } | |
7149 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 7150 v562 = v731; |
7151 pParty->pPartyBuffs[9].Apply( | |
7152 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7153 v731, | |
7154 v730, | |
7155 v1, | |
7156 v1); | |
7157 pParty->pPartyBuffs[14].Apply( | |
7158 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7159 v562, | |
7160 v1, | |
7161 v1, | |
7162 v1); | |
7163 pParty->pPartyBuffs[15].Apply( | |
7164 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7165 v562, | |
7166 v730, | |
7167 v1, | |
7168 v1); | |
7169 if ( v726 != (Player *)v1 ) | |
7170 goto LABEL_1056; | |
7171 v668 = v1; | |
7172 v732 = (int)y << 7; | |
7173 v658 = v1; | |
7174 v653 = v730; | |
7175 v651 = v562; | |
7176 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 | |
7177 + (double)(signed __int64)pParty->uTimePlayed); | |
7178 v27 = (char *)&pParty->pPartyBuffs[8]; | |
7179 goto LABEL_103; | |
7180 case 88: | |
7181 amount = 3; | |
7182 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
7183 goto LABEL_200; | |
7184 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7185 goto LABEL_83; | |
7186 a2 = v1; | |
7187 _this = (ItemGen *)&pPlayers[1]; | |
7188 do | |
7189 { | |
7190 v563 = 0; | |
7191 do | |
7192 { | |
7193 v564 = _this->uItemID; | |
7194 *(int *)(v563 + _this->uItemID) = v1; | |
7195 v563 += 8; | |
7196 *(int *)(v563 + v564 - 4) = v1; | |
7197 } | |
7198 while ( v563 <= 128 ); | |
7199 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
7200 v566 = (Player **)_this; | |
7201 *(int *)(_this->uItemID + 6460) = v565; | |
7202 v567 = (*v566)->GetMaxMana(); | |
7203 v568 = a2; | |
7204 *(int *)(_this->uItemID + 6464) = v567; | |
7205 v569 = v3->spellnum; | |
7206 v570 = pGame->GetStru6(); | |
7207 pGame->GetStru6()->SetPlayerBuffAnim(v569, v568); | |
7208 ++a2; | |
7209 _this = (ItemGen *)((char *)_this + 4); | |
7210 } | |
7211 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
7212 v571 = pPlayer; | |
7213 v572 = (char *)&pPlayer->sAgeModifier; | |
7214 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
7215 *(short *)v572 = 120; | |
7216 else | |
7217 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
7218 sRecoveryTime += -5 * v2; | |
7219 ++v571->uNumDivineInterventionCastsThisDay; | |
7220 goto LABEL_1056; | |
7221 case 89: | |
7222 v573 = v12 - 2; | |
7223 if ( v573 ) | |
7224 { | |
7225 v574 = v573 - 1; | |
7226 if ( v574 ) | |
7227 { | |
7228 if ( v574 == 1 ) | |
7229 v575 = 5 * v2; | |
7230 else | |
7231 v575 = 2 * v2; | |
7232 } | |
7233 else | |
7234 { | |
7235 v575 = 4 * v2; | |
7236 } | |
7237 } | |
7238 else | |
7239 { | |
7240 v575 = 3 * v2; | |
7241 } | |
7242 amount = v575; | |
7243 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7244 goto LABEL_83; | |
7245 v576 = *(int *)&v3->field_C; | |
7246 if ( v576 == v1 ) | |
7247 { | |
7248 v583 = v3->uPlayerID_2; | |
7249 v584 = v3->spellnum; | |
7250 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
7251 v586 = pGame->GetStru6(); | |
7252 pGame->GetStru6()->SetPlayerBuffAnim(v584, v583); | |
7253 if ( *((_QWORD *)v585 + 14) ) | |
7254 { | |
7255 ((Player *)v585)->SetCondition(0x11u, 1); | |
7256 v587 = ((Player *)v585)->GetSexByVoice(); | |
7257 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7258 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7259 } | |
7260 goto LABEL_83; | |
7261 } | |
7262 v577 = (Player *)(v576 >> 3); | |
7263 v726 = v577; | |
7264 if ( v577 == (Player *)-1 ) | |
7265 { | |
7266 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7267 goto LABEL_201; | |
7268 } | |
7269 v578 = (int)&pActors[(int)v577]; | |
7270 v721 = v578; | |
7271 if ( *(short *)(v578 + 40) > (signed __int16)v1 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) | |
7272 goto LABEL_200; | |
7273 ++a1.uItemType; | |
7274 a1.stru_24.Reset(); | |
7275 a1.field_48 = v3->spellnum; | |
7276 a1.field_4C = v2; | |
7277 a1.field_50 = v731; | |
7278 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7279 a1.uAttributes = v1; | |
7280 a1.uSectorID = v1; | |
7281 a1.uSpriteFrameID = v1; | |
7282 v580 = v3->uPlayerID; | |
7283 a1.field_60_distance_related_prolly_lod = 0; | |
7284 v581 = v721; | |
7285 v580 *= 8; | |
7286 LOBYTE(v580) = v580 | 4; | |
7287 a1.uFacing = v1; | |
7288 a1.field_58 = v580; | |
7289 a1.uSoundID = LOWORD(v3->field_10); | |
7290 a1.vPosition.x = *(short *)(v721 + 142); | |
7291 a1.vPosition.y = *(short *)(v721 + 144); | |
7292 v732 = *(short *)(v721 + 138); | |
7293 v582 = 8 * (int)v726; | |
7294 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7295 LOBYTE(v582) = 8 * (char)v726 | 3; | |
7296 a1.field_5C = v582; | |
7297 a1.Create(0, v1, v1, v1); | |
7298 if ( *(char *)(v581 + 52) > amount ) | |
7299 goto LABEL_83; | |
7300 Actor::Resurrect((unsigned int)v726); | |
7301 *(char *)(v581 + 61) = 0; | |
7302 *(char *)(v581 + 53) = 0; | |
7303 *(char *)(v581 + 54) = 0; | |
7304 *(char *)(v581 + 55) = 0; | |
7305 *(char *)(v581 + 56) = 0; | |
7306 *(char *)(v581 + 57) = 0; | |
7307 *(int *)(v581 + 712) = 9999; | |
7308 *(char *)(v581 + 38) &= 0xF7u; | |
7309 *(int *)(v581 + 708) = v1; | |
7310 ((SpellBuff *)(v581 + 356))->Reset(); | |
7311 ((SpellBuff *)(v581 + 228))->Reset(); | |
7312 ((SpellBuff *)(v581 + 404))->Reset(); | |
7313 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7314 *(short *)(v581 + 40) = 10 * amount; | |
7315 goto LABEL_1056; | |
7316 case 91: | |
7317 v588 = v12 - 1; | |
7318 amount = 16; | |
7319 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7320 { | |
7321 if ( v590 == 1 ) | |
7322 LODWORD(v733) = v1; | |
7323 } | |
7324 else | |
7325 { | |
7326 LODWORD(v733) = 3600 * v2; | |
7327 } | |
7328 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7329 goto LABEL_83; | |
7330 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; | |
7331 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7332 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7333 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7334 || *(char *)(HIDWORD(v733) + 20) & 2 | |
7335 || *(int *)(HIDWORD(v733) + 12) != v1 | |
7336 || *(int *)(HIDWORD(v733) + 4) != v1 | |
7337 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 | |
7338 || pItemsTable->_456D5E_is_some_material((ItemGen *)HIDWORD(v733)) ) | |
7339 goto LABEL_199; | |
7340 v592 = HIDWORD(v733); | |
7341 v14 = v731 == 4; | |
7342 *(int *)(HIDWORD(v733) + 12) = 16; | |
7343 if ( !v14 ) | |
7344 { | |
7345 v732 = (int)v733 << 7; | |
7346 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7347 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7348 *(int *)(v592 + 20) |= 8u; | |
7349 } | |
7350 *(char *)(v592 + 20) |= 0x80u; | |
7351 goto LABEL_1055; | |
7352 case 93: | |
7353 v593 = v12 - 2; | |
7354 if ( !v593 ) | |
7355 goto LABEL_1062; | |
7356 v594 = v593 - 1; | |
7357 if ( v594 ) | |
7358 { | |
7359 if ( v594 == 1 ) | |
7360 amount = 9; | |
7361 else | |
7362 LABEL_1062: | |
7363 amount = 5; | |
7364 } | |
7365 else | |
7366 { | |
7367 amount = 7; | |
7368 } | |
7369 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7370 goto LABEL_83; | |
7371 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
7372 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7373 a1.stru_24.Reset(); | |
7374 a1.field_48 = v3->spellnum; | |
7375 a1.field_4C = v2; | |
7376 a1.field_50 = v731; | |
7377 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7378 a1.vPosition.x = pParty->vPosition.x; | |
7379 a1.vPosition.y = pParty->vPosition.y; | |
7380 a1.uAttributes = v1; | |
7381 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
7382 a1.uSectorID = pIndoor->GetSector( | |
7383 pParty->vPosition.x, | |
7384 pParty->vPosition.y, | |
7385 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
7386 a1.uSpriteFrameID = v1; | |
7387 v595 = 8 * v3->uPlayerID; | |
7388 LOBYTE(v595) = v595 | 4; | |
7389 a1.field_58 = v595; | |
7390 a1.field_5C = a2; | |
7391 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7392 a1.uSoundID = LOWORD(v3->field_10); | |
7393 if ( pParty->bTurnBasedModeOn == 1 ) | |
7394 LOBYTE(a1.uAttributes) |= 4u; | |
7395 v596 = (signed int)v726 / -2; | |
7396 y = (char *)((signed int)v726 / 2); | |
7397 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7398 { | |
7399 v597 = v715.uYawAngle; | |
7400 do | |
7401 { | |
7402 a1.uFacing = v596 + v597; | |
7403 if ( a1.Create( | |
7404 v596 + v597, | |
7405 v715.uPitchAngle, | |
7406 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7407 v3->uPlayerID + 1) != -1 | |
7408 && pParty->bTurnBasedModeOn == 1 ) | |
7409 ++pTurnEngine->field_1C; | |
7410 v596 += v732; | |
7411 } | |
7412 while ( v596 <= (signed int)y ); | |
7413 } | |
7414 goto LABEL_1056; | |
7415 case 94: | |
7416 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7417 goto LABEL_83; | |
7418 if ( v731 == 1 || v731 == 2 ) | |
7419 { | |
7420 v598 = 180 * v2; | |
7421 goto LABEL_1081; | |
7422 } | |
7423 if ( v731 == 3 ) | |
7424 { | |
7425 v598 = 300 * v2; | |
7426 LABEL_1081: | |
7427 LODWORD(v733) = v598; | |
7428 goto LABEL_1082; | |
7429 } | |
7430 if ( v731 == 4 ) | |
7431 LODWORD(v733) = 29030400; | |
7432 LABEL_1082: | |
7433 v599 = a2 >> 3; | |
141 | 7434 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7435 goto LABEL_1056; |
7436 v730 = 836 * v599; | |
7437 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
7438 goto LABEL_83; | |
90 | 7439 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7440 goto LABEL_200; |
90 | 7441 pActors[v599].pActorBuffs[9].Reset(); |
7442 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7443 v732 = (int)v733 << 7; |
90 | 7444 pActors[v599].pActorBuffs[12].Apply( |
0 | 7445 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
7446 v731, | |
7447 v1, | |
7448 v1, | |
7449 v1); | |
7450 a1.stru_24.Reset(); | |
7451 a1.field_48 = v3->spellnum; | |
7452 a1.field_4C = v2; | |
7453 a1.field_50 = v731; | |
7454 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 7455 v61 = v599; |
0 | 7456 LABEL_1086: |
90 | 7457 v600 = pActors[v61].vPosition.y; |
7458 v601 = pActors[v61].vPosition.x; | |
0 | 7459 a1.uObjectDescID = v60; |
7460 a1.vPosition.x = v601; | |
90 | 7461 v602 = pActors[v61].uActorHeight; |
7462 v603 = pActors[v61].vPosition.z; | |
0 | 7463 a1.vPosition.y = v600; |
7464 v676 = v603 + v602; | |
7465 v665 = v600; | |
7466 a1.vPosition.z = v603 + v602; | |
7467 v657 = v601; | |
7468 LABEL_1087: | |
7469 a1.uAttributes = v1; | |
7470 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); | |
7471 a1.uSpriteFrameID = v1; | |
7472 v604 = 8 * v3->uPlayerID; | |
7473 LOBYTE(v604) = v604 | 4; | |
7474 a1.field_58 = v604; | |
7475 a1.field_5C = a2; | |
7476 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7477 a1.uFacing = LOWORD(v715.uYawAngle); | |
7478 LOWORD(v604) = LOWORD(v3->field_10); | |
7479 LOBYTE(a1.uAttributes) |= 0x80u; | |
7480 a1.uSoundID = v604; | |
7481 a1.Create(0, v1, v1, v3->uPlayerID + 1); | |
7482 goto LABEL_1056; | |
7483 case 96: | |
7484 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7485 goto LABEL_83; | |
7486 HIDWORD(v733) = v1; | |
7487 memset(&pStru179, v1, 0xFA0u); | |
7488 _this = (ItemGen *)v1; | |
7489 v605 = (char *)pParty->pHirelings; | |
7490 do | |
7491 { | |
7492 if ( *(int *)v605 != v1 ) | |
7493 { | |
7494 v606 = HIDWORD(v733)++; | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
79
diff
changeset
|
7495 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7496 } |
7497 _this = (ItemGen *)((char *)_this + 1); | |
7498 v605 += 76; | |
7499 } | |
7500 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
7501 _this = (ItemGen *)v1; | |
7502 if ( (signed int)pNPCStats->uNumNewNPCs > v1 ) | |
7503 { | |
7504 v730 = (int)pNPCStats->pNewNPCData; | |
7505 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7506 do | |
7507 { | |
7508 if ( *(char *)(v730 + 8) & 0x80 | |
7509 && (pParty->pHirelings[0].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) | |
7510 && (pParty->pHirelings[1].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
7511 { | |
7512 v607 = HIDWORD(v733); | |
7513 HIDWORD(v733) += 4; | |
7514 *(int *)v607 = (int)_this + 3; | |
7515 } | |
7516 _this = (ItemGen *)((char *)_this + 1); | |
7517 v730 += 76; | |
7518 } | |
7519 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7520 } | |
7521 v608 = v3->uPlayerID_2; | |
7522 if ( v608 != 4 && v608 != 5 | |
7523 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= v1) | |
7524 || v609 >= 3 ) | |
7525 goto LABEL_200; | |
7526 v610 = 76 * v609; | |
7527 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = v1; | |
7528 v611 = pIconsFrameTable->FindIcon("spell96"); | |
7529 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( | |
7530 v611); | |
7531 v232 = 1; | |
7532 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; | |
89 | 7533 v612 = pParty->pPlayers; |
0 | 7534 do |
7535 { | |
89 | 7536 v612->sHealth = v612->GetMaxHealth(); |
7537 v612->sMana = v612->GetMaxMana(); | |
7538 ++v612; | |
7539 } | |
7540 while ( v612 <= &pParty->pPlayers[3] ); | |
7541 v613 = &pOutdoor->ddm; | |
0 | 7542 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7543 v613 = &pIndoor->dlv; |
7544 v613->uReputation += 15; | |
7545 if ( v613->uReputation > 10000 ) | |
7546 v613->uReputation = 10000; | |
0 | 7547 LODWORD(v727) = v232; |
7548 goto LABEL_83; | |
7549 case 95: | |
7550 if ( v12 <= v1 ) | |
7551 goto LABEL_1119; | |
7552 if ( v12 <= 3 ) | |
7553 { | |
7554 v614 = 300 * (v2 + 12); | |
7555 } | |
7556 else | |
7557 { | |
7558 if ( v12 != 4 ) | |
7559 goto LABEL_1119; | |
7560 v614 = 900 * (v2 + 4); | |
7561 } | |
7562 LODWORD(v733) = v614; | |
7563 LABEL_1119: | |
7564 v615 = v2 + 5; | |
7565 amount = v615; | |
7566 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7567 goto LABEL_83; | |
7568 if ( v731 != 3 && v731 != 4 ) | |
7569 { | |
7570 v616 = v3->uPlayerID_2; | |
7571 v617 = v3->spellnum; | |
7572 v618 = pGame->GetStru6(); | |
7573 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); | |
7574 v668 = v1; | |
7575 v658 = v716; | |
7576 v732 = (int)v733 << 7; | |
7577 v653 = v615; | |
7578 v651 = v731; | |
7579 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7580 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; | |
7581 goto LABEL_103; | |
7582 } | |
7583 a2 = v1; | |
7584 v732 = (int)v733 << 7; | |
7585 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7586 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7587 do |
7588 { | |
7589 v620 = a2; | |
7590 v621 = v3->spellnum; | |
7591 v622 = pGame->GetStru6(); | |
7592 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); | |
112 | 7593 v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
0 | 7594 ++a2; |
112 | 7595 ++v619; |
7596 } | |
7597 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7598 goto LABEL_1056; |
7599 case 99: | |
7600 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7601 goto LABEL_83; | |
7602 v726 = (Player *)v1; | |
7603 pGame->GetIndoorCamera(); | |
7604 v623 = (signed __int64)GetPickDepth(); | |
7605 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
7606 v709 = v1; | |
7607 v708 = v1; | |
7608 v707 = v1; | |
7609 a1.stru_24.Reset(); | |
7610 a1.field_48 = v3->spellnum; | |
7611 a1.field_4C = v2; | |
7612 a1.field_50 = v731; | |
7613 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7614 a1.uAttributes = v1; | |
7615 a1.uSectorID = v1; | |
7616 a1.uSpriteFrameID = v1; | |
7617 v624 = v3->uPlayerID; | |
7618 a1.field_60_distance_related_prolly_lod = 0; | |
7619 a1.uFacing = v1; | |
7620 v624 *= 8; | |
7621 LOBYTE(v624) = v624 | 4; | |
7622 a1.field_58 = v624; | |
7623 a1.uSoundID = LOWORD(v3->field_10); | |
7624 a2 = v1; | |
7625 if ( SHIDWORD(v733) > v1 ) | |
7626 { | |
7627 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7628 do | |
7629 { | |
7630 v625 = dword_50BF30[a2]; | |
7631 a1.vPosition.x = pActors[v625].vPosition.x; | |
7632 a1.vPosition.y = pActors[v625].vPosition.y; | |
7633 v732 = pActors[v625].uActorHeight; | |
7634 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7635 v626 = 8 * dword_50BF30[a2]; | |
7636 LOBYTE(v626) = v626 | 3; | |
7637 a1.field_5C = v626; | |
7638 v627 = a1.Create(0, v1, v1, v1); | |
7639 v628 = a2; | |
7640 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7641 a2 = v628 + 1; | |
7642 } | |
7643 while ( v628 + 1 < SHIDWORD(v733) ); | |
7644 } | |
7645 v730 = v1; | |
7646 v629 = 1; | |
7647 do | |
7648 { | |
7649 v630 = pPlayers[v629]; | |
7650 if ( !v630->pConditions[2] | |
7651 && !v630->pConditions[12] | |
7652 && !v630->pConditions[13] | |
7653 && !v630->pConditions[14] | |
7654 && !v630->pConditions[15] | |
7655 && !v630->pConditions[16] ) | |
7656 { | |
7657 v631 = v730++; | |
7658 v681[v631] = v629; | |
7659 } | |
7660 ++v629; | |
7661 } | |
7662 while ( v629 <= 4 ); | |
7663 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
7664 HIDWORD(v733) = v1; | |
7665 if ( v730 > v1 ) | |
7666 { | |
7667 do | |
7668 { | |
7669 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7670 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7671 v633->sHealth += v732; | |
7672 v726 = *(Player **)v632; | |
7673 v634 = v726->GetMaxHealth(); | |
7674 if ( v726->sHealth > v634 ) | |
7675 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7676 v635 = HIDWORD(v733); | |
7677 v636 = WORD2(v733); | |
7678 v637 = v3->spellnum; | |
7679 v638 = pGame->GetStru6(); | |
7680 pGame->GetStru6()->SetPlayerBuffAnim(v637, v636); | |
7681 HIDWORD(v733) = v635 + 1; | |
7682 } | |
7683 while ( v635 + 1 < v730 ); | |
7684 } | |
7685 v639 = pGame->GetStru6(); | |
7686 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(v1, 0x40u); | |
7687 goto LABEL_1056; | |
7688 case 98: | |
7689 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7690 { | |
7691 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7692 goto LABEL_201; | |
7693 } | |
7694 v640 = v12 - 2; | |
7695 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7696 amount = 3; | |
7697 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->field_1613C > v1 ) | |
7698 goto LABEL_200; | |
7699 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7700 goto LABEL_83; | |
7701 pParty->field_1613C = 256; | |
7702 pParty->field_16140 = v2; | |
7703 ++pPlayer->uNumArmageddonCasts; | |
7704 if ( pParty->bTurnBasedModeOn == 1 ) | |
7705 ++pTurnEngine->field_1C; | |
7706 v726 = (Player *)50; | |
7707 do | |
7708 { | |
7709 v642 = rand() % 4096 - 2048; | |
7710 v643 = rand(); | |
7711 v721 = v642 + pParty->vPosition.x; | |
7712 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
7713 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1); | |
7714 v644 = rand(); | |
7715 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1); | |
7716 v726 = (Player *)((char *)v726 - 1); | |
7717 } | |
7718 while ( *(float *)&v726 != 0.0 ); | |
7719 goto LABEL_1056; | |
7720 default: | |
7721 goto LABEL_83; | |
7722 } | |
7723 while ( 2 ) | |
7724 { | |
7725 if ( v731 == 4 ) | |
7726 { | |
7727 if ( *((_QWORD *)v222 + 2) ) | |
7728 { | |
7729 *((int *)v222 + 4) = v1; | |
7730 *((int *)v222 + 5) = v1; | |
7731 goto LABEL_439; | |
7732 } | |
7733 } | |
7734 else | |
7735 { | |
7736 v732 = amount << 7; | |
7737 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7738 2u, | |
7739 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7740 v222 = (char *)HIDWORD(v733); | |
7741 if ( v223 ) | |
7742 LABEL_439: | |
7743 ((Player *)v222)->PlaySound(103, v1); | |
7744 } | |
7745 v222 += 6972; | |
7746 HIDWORD(v733) = (int)v222; | |
7747 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7748 goto LABEL_1056; | |
7749 continue; | |
7750 } | |
7751 } | |
7752 if ( pParty->bTurnBasedModeOn == v1 ) | |
7753 { | |
7754 v646 = pPlayer; | |
7755 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
7756 v647 = n; | |
7757 } | |
7758 else | |
7759 { | |
7760 v647 = n; | |
7761 v646 = pPlayer; | |
7762 v648 = sRecoveryTime; | |
7763 v649 = pPlayer; | |
7764 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
7765 v649->SetRecoveryTime(v648); | |
7766 pTurnEngine->_40471C(); | |
7767 } | |
7768 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
7769 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
7770 v711[v647].spellnum = v1; | |
7771 v646->sMana -= uRequiredMana; | |
7772 } | |
7773 //----- (0042EB42) -------------------------------------------------------- | |
7774 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7775 { | |
7776 unsigned int v2; // edx@1 | |
7777 signed int v3; // eax@1 | |
7778 char *v4; // ecx@2 | |
7779 | |
7780 v2 = this->uNumObjects; | |
7781 v3 = 0; | |
7782 if ( (signed int)this->uNumObjects <= 0 ) | |
7783 { | |
7784 LABEL_5: | |
7785 LOWORD(v3) = 0; | |
7786 } | |
7787 else | |
7788 { | |
7789 v4 = (char *)&this->pObjects->uObjectID; | |
7790 while ( uItemID != *(short *)v4 ) | |
7791 { | |
7792 ++v3; | |
7793 v4 += 56; | |
7794 if ( v3 >= (signed int)v2 ) | |
7795 goto LABEL_5; | |
7796 } | |
7797 } | |
7798 return v3; | |
7799 } | |
7800 | |
7801 | |
7802 | |
7803 //----- (0042EB78) -------------------------------------------------------- | |
7804 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7805 { | |
7806 return 8 * this->pIcons[uIconID].uAnimLength; | |
7807 } | |
7808 | |
7809 //----- (0042EB8D) -------------------------------------------------------- | |
7810 void GUIMessageQueue::SendMessage(UIMessageType msg, int param, unsigned int a4) | |
7811 { | |
7812 if (uNumMessages < 40) | |
7813 { | |
7814 pMessages[uNumMessages].eType = msg; | |
7815 pMessages[uNumMessages].param = param; | |
7816 pMessages[uNumMessages++].field_8 = a4; | |
7817 } | |
7818 } | |
7819 | |
7820 //----- (0042EBBE) -------------------------------------------------------- | |
7821 int __fastcall sub_42EBBE(int a1, int a2) | |
7822 { | |
7823 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7824 } | |
7825 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7826 | |
7827 //----- (0042EBDB) -------------------------------------------------------- | |
7828 int stru193_math::_42EBDB(int angle) | |
7829 { | |
7830 return SinCos(angle - this->uIntegerHalfPi); | |
7831 } | |
7832 | |
7833 //----- (0042ECB5) -------------------------------------------------------- | |
7834 bool __cdecl _42ECB5_PlayerAttacksActor() | |
7835 { | |
7836 unsigned int v0; // ebx@1 | |
7837 Player *v1; // esi@1 | |
7838 bool result; // eax@1 | |
7839 int v3; // edi@2 | |
7840 unsigned int v4; // eax@7 | |
7841 char *v5; // eax@8 | |
7842 int v6; // ecx@9 | |
7843 signed int v7; // eax@16 | |
7844 Actor *v8; // edi@20 | |
7845 unsigned int v9; // ecx@21 | |
7846 char *v10; // eax@26 | |
7847 char *v11; // eax@26 | |
7848 unsigned int v12; // eax@47 | |
7849 char *v13; // eax@47 | |
7850 char *v14; // eax@47 | |
7851 unsigned int v15; // ebx@54 | |
7852 int v16; // [sp-10h] [bp-4Ch]@24 | |
7853 int v17; // [sp-10h] [bp-4Ch]@44 | |
7854 unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7855 unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7856 __int16 v20; // [sp-8h] [bp-44h]@24 | |
7857 __int16 v21; // [sp-8h] [bp-44h]@44 | |
7858 int v22; // [sp-4h] [bp-40h]@24 | |
7859 int v23; // [sp-4h] [bp-40h]@44 | |
7860 SoundID v24; // [sp-4h] [bp-40h]@58 | |
7861 Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 | |
7862 unsigned int a2; // [sp+18h] [bp-24h]@20 | |
7863 unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
112 | 7864 int v28; // [sp+20h] [bp-1Ch]@9 |
7865 unsigned int *v28b; | |
0 | 7866 int v29; // [sp+24h] [bp-18h]@16 |
7867 int v30; // [sp+28h] [bp-14h]@16 | |
7868 int v31; // [sp+2Ch] [bp-10h]@4 | |
7869 int v32; // [sp+30h] [bp-Ch]@7 | |
7870 int v33; // [sp+34h] [bp-8h]@7 | |
7871 int v34; // [sp+38h] [bp-4h]@17 | |
7872 | |
7873 v0 = uActiveCharacter; | |
7874 v27 = 6972 * uActiveCharacter; | |
42 | 7875 v1 = &pParty->pPlayers[uActiveCharacter-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552]; |
7876 result = pParty->pPlayers[uActiveCharacter-1].CanAct();//((Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552])->CanAct(); | |
0 | 7877 if ( result ) |
7878 { | |
7879 pStru277->_427D48(v0); | |
7880 v3 = 0; | |
7881 if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime > 0 ) | |
7882 pParty->pPartyBuffs[11].Reset(); | |
7883 v31 = v1->pEquipment.uBow; | |
7884 if ( v31 && v1->field_1F5[36 * v31 + 15] & 2 ) | |
7885 v31 = 0; | |
7886 v4 = v1->pEquipment.uMainHand; | |
7887 v32 = 0; | |
7888 v33 = 0; | |
7889 if ( v4 ) | |
7890 { | |
112 | 7891 //v5 = (char *)v1 + 36 * v4; |
7892 if ( !(v1->pInventoryItems[v4].field_1A & 2) )//v5[516] & 2) ) | |
0 | 7893 { |
112 | 7894 v28b = &v1->pInventoryItems[v4].uItemID; |
7895 v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
0 | 7896 if ( pItemsTable->pItems[v6].uEquipType == 12 ) |
7897 { | |
112 | 7898 if ( v1->pInventoryItems[v4]._bonus_type <= 0 ) |
0 | 7899 { |
112 | 7900 *v28b = 0; |
0 | 7901 v1->pEquipment.uMainHand = 0; |
7902 } | |
7903 else | |
7904 { | |
112 | 7905 v32 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); |
0 | 7906 } |
7907 } | |
7908 else | |
7909 { | |
7910 if ( v6 == 64 || v6 == 65 ) | |
112 | 7911 v33 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); |
0 | 7912 } |
7913 } | |
7914 } | |
7915 v30 = 0; | |
7916 v29 = 0; | |
7917 v28 = 0; | |
7918 v7 = pMouse->uPointingObjectID; | |
141 | 7919 if ( (pMouse->uPointingObjectID & 7) != OBJECT_Actor || (v34 = pMouse->uPointingObjectID, !pActors[v7 >> 3].CanAct()) ) |
0 | 7920 v34 = stru_50C198.FindClosesActor(5120, 0, 0); |
7921 a3.z = 0; | |
7922 a3.y = 0; | |
7923 a3.x = 0; | |
141 | 7924 if ( (v34 & 7) == OBJECT_Actor) |
0 | 7925 { |
7926 a2 = v34 >> 3; | |
7927 v8 = &pActors[v34 >> 3]; | |
7928 v34 = sub_452A9E((v8->vPosition.x - pParty->vPosition.x) * (v8->vPosition.x - pParty->vPosition.x) + (v8->vPosition.y - pParty->vPosition.y) * (v8->vPosition.y - pParty->vPosition.y) + (v8->vPosition.z - pParty->vPosition.z) * (v8->vPosition.z - pParty->vPosition.z)) | |
7929 - v8->uActorRadius; | |
7930 if ( v34 >= 0 ) | |
7931 { | |
7932 v9 = 0; | |
7933 } | |
7934 else | |
7935 { | |
7936 v9 = 0; | |
7937 v34 = 0; | |
7938 } | |
7939 if ( v33 != v9 ) | |
7940 { | |
112 | 7941 v28 = 1; |
0 | 7942 v22 = v0 + 8; |
7943 v20 = v9; | |
7944 v18 = v9; | |
7945 v16 = 102; | |
7946 LABEL_34: | |
7947 _42777D_CastSpell_UseWand_ShootArrow(v16, v0 - 1, v18, v20, v22); | |
7948 LABEL_28: | |
7949 v3 = 0; | |
7950 goto LABEL_29; | |
7951 } | |
7952 if ( v32 != v9 ) | |
7953 { | |
7954 v29 = 1; | |
7955 _42777D_CastSpell_UseWand_ShootArrow( | |
7956 *((int *)&pSpellDatas[66].field_8 | |
7957 + *(int *)(&stru_AA1058[3].pSounds[36 * *(int *)&pParty->pArtifactsFound[v27 + 22] + 41048] + v27)), | |
7958 v0 - 1, | |
7959 8u, | |
7960 v9, | |
7961 v0 + 8); | |
7962 v10 = &v1->field_1F5[36 * v1->pEquipment.uMainHand + 11]; | |
7963 --*(int *)v10; | |
7964 v11 = (char *)v1 + 36 * v1->pEquipment.uMainHand; | |
7965 if ( *((int *)v11 + 128) <= 0 ) | |
7966 { | |
7967 *((int *)v11 + 124) = 0; | |
7968 v1->pEquipment.uMainHand = 0; | |
7969 } | |
7970 goto LABEL_28; | |
7971 } | |
7972 if ( (double)v34 <= 407.2 ) | |
7973 { | |
7974 a3.x = v8->vPosition.x - pParty->vPosition.x; | |
7975 a3.y = v8->vPosition.y - pParty->vPosition.y; | |
7976 a3.z = v8->vPosition.z - pParty->vPosition.z; | |
7977 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
7978 DamageMonsterFromParty((8 * v0 - 8) | 4, a2, &a3); | |
7979 if ( v1->WearsItem(506, 1) || v1->WearsItem(506, 0) ) | |
7980 _42FA66_do_explosive_impact( | |
7981 v8->vPosition.x, | |
7982 v8->vPosition.y, | |
7983 v8->vPosition.z + v8->uActorHeight / 2, | |
7984 0, | |
7985 512, | |
7986 v0); | |
7987 } | |
7988 else | |
7989 { | |
7990 if ( v31 != v9 ) | |
7991 { | |
7992 v30 = 1; | |
7993 v22 = 0; | |
7994 v20 = 0; | |
7995 v18 = 0; | |
7996 v16 = 100; | |
7997 goto LABEL_34; | |
7998 } | |
7999 } | |
8000 v3 = 0; | |
8001 goto LABEL_39; | |
8002 } | |
8003 if ( v33 ) | |
8004 { | |
112 | 8005 v28 = 1; |
0 | 8006 v23 = v0 + 8; |
8007 v21 = 0; | |
8008 v19 = 0; | |
8009 v17 = 102; | |
8010 } | |
8011 else | |
8012 { | |
8013 if ( v32 ) | |
8014 { | |
8015 v12 = v1->pEquipment.uMainHand; | |
8016 v29 = 1; | |
8017 _42777D_CastSpell_UseWand_ShootArrow( | |
8018 *((int *)&pSpellDatas[66].field_8 + *(int *)&v1->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v12 + 5]), | |
8019 v0 - 1, | |
8020 8u, | |
8021 0, | |
8022 v0 + 8); | |
8023 v13 = &v1->field_1F5[36 * v1->pEquipment.uMainHand + 11]; | |
8024 --*(int *)v13; | |
8025 v14 = (char *)v1 + 36 * v1->pEquipment.uMainHand; | |
8026 if ( *((int *)v14 + 128) <= 0 ) | |
8027 { | |
8028 *((int *)v14 + 124) = 0; | |
8029 v1->pEquipment.uMainHand = 0; | |
8030 } | |
8031 LABEL_29: | |
8032 v34 = v3; | |
8033 if ( v30 == v3 ) | |
8034 { | |
8035 if ( v29 != v3 ) | |
8036 return 1; | |
112 | 8037 if ( v28 == v3 ) |
0 | 8038 { |
8039 v15 = v1->pEquipment.uMainHand; | |
8040 if ( v1->HasItemEquipped(EQUIP_TWO_HANDED) ) | |
8041 v34 = pItemsTable->pItems[*(int *)&v1->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v15 + 5]].uSkillType; | |
8042 pTurnEngine->_40471C(); | |
8043 } | |
8044 else | |
8045 { | |
8046 v34 = 7; | |
8047 } | |
8048 } | |
8049 else | |
8050 { | |
8051 v34 = 5; | |
8052 v1->PlaySound(50, v3); | |
8053 } | |
8054 switch ( v34 ) | |
8055 { | |
8056 case 0: | |
8057 v24 = (SoundID)81; | |
8058 goto LABEL_66; | |
8059 case 1: | |
8060 v24 = (SoundID)84; | |
8061 goto LABEL_66; | |
8062 case 2: | |
8063 v24 = (SoundID)85; | |
8064 goto LABEL_66; | |
8065 case 3: | |
8066 v24 = (SoundID)78; | |
8067 goto LABEL_66; | |
8068 case 4: | |
8069 v24 = (SoundID)80; | |
8070 goto LABEL_66; | |
8071 case 5: | |
8072 v24 = (SoundID)71; | |
8073 goto LABEL_66; | |
8074 case 6: | |
8075 v24 = (SoundID)83; | |
8076 goto LABEL_66; | |
8077 case 7: | |
8078 v24 = (SoundID)67; | |
8079 LABEL_66: | |
8080 pAudioPlayer->PlaySound(v24, v3, v3, -1, v3, v3, v3, v3); | |
8081 break; | |
8082 default: | |
8083 return 1; | |
8084 } | |
8085 return 1; | |
8086 } | |
8087 if ( !v31 ) | |
8088 { | |
8089 LABEL_39: | |
8090 v31 = v1->GetAttackRecoveryTime(v3); | |
8091 if ( v31 < 30 ) | |
8092 v31 = 30; | |
8093 if ( pParty->bTurnBasedModeOn == v3 ) | |
8094 v1->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v31 * 2.133333333333333)); | |
8095 goto LABEL_29; | |
8096 } | |
8097 v23 = 0; | |
8098 v21 = 0; | |
8099 v19 = 0; | |
8100 v30 = 1; | |
8101 v17 = 100; | |
8102 } | |
8103 _42777D_CastSpell_UseWand_ShootArrow(v17, v0 - 1, v19, v21, v23); | |
8104 goto LABEL_29; | |
8105 } | |
8106 return result; | |
8107 } | |
8108 | |
8109 //----- (0042F184) -------------------------------------------------------- | |
8110 int stru319::FindClosesActor(int a2, int a3, int a4) | |
8111 { | |
8112 int v4; // edi@1 | |
8113 stru319 *v5; // esi@1 | |
8114 int v6; // eax@2 | |
8115 int v7; // eax@4 | |
8116 int result; // eax@5 | |
8117 int *v9; // edx@8 | |
8118 signed int v10; // ebx@10 | |
8119 int v11; // edi@11 | |
8120 Actor *v12; // esi@12 | |
8121 unsigned __int16 v13; // ax@12 | |
8122 int v14; // eax@22 | |
8123 char v15; // zf@30 | |
8124 int v16; // esi@32 | |
8125 int v17; // ecx@34 | |
8126 stru319 *v18; // eax@39 | |
8127 int v19; // edx@39 | |
8128 int v20; // ecx@41 | |
8129 unsigned __int16 v21; // ax@42 | |
8130 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
8131 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
8132 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
8133 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
8134 int *v26; // [sp+18h] [bp-14h]@8 | |
8135 int v27; // [sp+1Ch] [bp-10h]@10 | |
8136 int *v28; // [sp+20h] [bp-Ch]@10 | |
8137 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
8138 int v30; // [sp+28h] [bp-4h]@6 | |
8139 int i; // [sp+38h] [bp+Ch]@33 | |
8140 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
8141 | |
8142 v4 = 0; | |
8143 v5 = this; | |
8144 v24 = this; | |
8145 if ( pRenderer->pRenderD3D ) | |
8146 { | |
8147 v6 = a3 != 0; | |
8148 if ( a4 ) | |
8149 LOBYTE(v6) = v6 | 8; | |
8150 v7 = pGame->pVisInstance->_4C1944(3, a2, v6, 657456, -1); | |
8151 if ( v7 != -1 ) | |
8152 return (unsigned __int16)v7; | |
8153 } | |
8154 else | |
8155 { | |
8156 v30 = 0; | |
8157 if ( pRenderer->pActiveZBuffer ) | |
8158 { | |
8159 v29 = viewparams->uScreenX; | |
8160 v23 = viewparams->uScreenZ; | |
8161 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
8162 { | |
8163 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
8164 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8165 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8166 do | |
8167 { | |
8168 if ( (signed int)v29 < (signed int)v23 ) | |
8169 { | |
8170 v28 = v9; | |
8171 v10 = v4; | |
8172 v27 = v23 - v29; | |
8173 do | |
8174 { | |
8175 v22 = *v28; | |
8176 v11 = *v28 & 0xFFFF; | |
141 | 8177 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 8178 { |
8179 v12 = &pActors[(unsigned int)v11 >> 3]; | |
8180 v13 = v12->uAIState; | |
8181 if ( v13 != 5 ) | |
8182 { | |
8183 if ( v13 != 4 | |
8184 && v13 != 11 | |
8185 && v13 != 19 | |
8186 && v13 != 17 | |
8187 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
8188 { | |
8189 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
8190 && v22 <= a2 << 16 ) | |
8191 { | |
8192 v14 = 0; | |
8193 if ( v10 > 0 ) | |
8194 { | |
8195 do | |
8196 { | |
8197 if ( dword_50BDA0[v14] == v11 ) | |
8198 break; | |
8199 ++v14; | |
8200 } | |
8201 while ( v14 < v30 ); | |
8202 } | |
8203 if ( v14 == v30 && v10 < 100 ) | |
8204 { | |
8205 ++v30; | |
8206 dword_50BC10[v10] = v22; | |
8207 dword_50BDA0[v10] = v11; | |
8208 ++v10; | |
8209 } | |
8210 } | |
8211 } | |
8212 } | |
8213 } | |
8214 ++v28; | |
8215 --v27; | |
8216 } | |
8217 while ( v27 ); | |
8218 v4 = v30; | |
8219 v5 = v24; | |
8220 } | |
8221 v9 = v26 + 640; | |
8222 v15 = v25-- == 1; | |
8223 v26 += 640; | |
8224 } | |
8225 while ( !v15 ); | |
8226 } | |
8227 if ( v4 > 0 ) | |
8228 { | |
8229 v32 = 1; | |
8230 v16 = (int)dword_50BC10; | |
8231 do | |
8232 { | |
8233 for ( i = v32; i < v4; ++i ) | |
8234 { | |
8235 v17 = dword_50BC10[i]; | |
8236 if ( v17 < *(int *)v16 ) | |
8237 { | |
8238 dword_50BC10[i] = *(int *)v16; | |
8239 *(int *)v16 = v17; | |
8240 } | |
8241 } | |
8242 ++v32; | |
8243 v16 += 4; | |
8244 } | |
8245 while ( v32 - 1 < v4 ); | |
8246 v5 = v24; | |
8247 if ( v4 > 0 ) | |
8248 { | |
8249 v18 = v24; | |
8250 v19 = v4; | |
8251 do | |
8252 { | |
8253 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
8254 v18 += 4; | |
8255 --v19; | |
8256 } | |
8257 while ( v19 ); | |
8258 } | |
8259 } | |
8260 v20 = 0; | |
8261 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
8262 { | |
8263 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8264 if ( v21 != 4 && v21 != 5 ) | |
8265 break; | |
8266 } | |
8267 if ( v20 != v4 ) | |
8268 { | |
8269 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8270 LOBYTE(result) = result | 3; | |
8271 return result; | |
8272 } | |
8273 } | |
8274 } | |
8275 return 0; | |
8276 } | |
8277 | |
8278 | |
8279 //----- (0042F3D6) -------------------------------------------------------- | |
8280 void InitializeTurnBasedAnimations(void *_this) | |
8281 { | |
8282 unsigned int *v1; // edi@1 | |
8283 | |
8284 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8285 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8286 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8287 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8288 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8289 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8290 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8291 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8292 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8293 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8294 v1 = pIconIDs_Turn; | |
8295 do | |
8296 { | |
8297 pIconsFrameTable->InitializeAnimation(*v1); | |
8298 ++v1; | |
8299 } | |
8300 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8301 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8302 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8303 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8304 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8305 } | |
8306 | |
8307 //----- (0042F4DA) -------------------------------------------------------- | |
8308 signed int __cdecl sub_42F4DA() | |
8309 { | |
8310 signed int v0; // edi@1 | |
82 | 8311 Actor *v1; // esi@4 |
0 | 8312 int v2; // ebx@5 |
8313 int v3; // eax@5 | |
8314 int v4; // ebx@5 | |
8315 unsigned int v5; // ecx@5 | |
8316 int v6; // edx@6 | |
8317 unsigned int v7; // edx@8 | |
8318 unsigned int v8; // edx@10 | |
8319 __int16 v9; // ax@12 | |
8320 signed int result; // eax@20 | |
8321 int v11; // [sp+Ch] [bp-10h]@5 | |
8322 int v12; // [sp+10h] [bp-Ch]@5 | |
8323 signed int v13; // [sp+14h] [bp-8h]@3 | |
8324 | |
8325 v0 = 5120; | |
8326 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8327 v0 = 2560; | |
8328 v13 = 0; | |
8329 if ( (signed int)uNumActors <= 0 ) | |
8330 { | |
8331 LABEL_20: | |
8332 result = 0; | |
8333 } | |
8334 else | |
8335 { | |
82 | 8336 v1 = pActors; |
0 | 8337 while ( 1 ) |
8338 { | |
82 | 8339 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8340 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8341 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8342 v3 = v2; |
8343 v4 = v11; | |
8344 v5 = v12; | |
8345 if ( v3 < v11 ) | |
8346 { | |
8347 v6 = v3; | |
8348 v3 = v11; | |
8349 v4 = v6; | |
8350 } | |
8351 if ( v3 < v12 ) | |
8352 { | |
8353 v7 = v3; | |
8354 v3 = v12; | |
8355 v5 = v7; | |
8356 } | |
8357 if ( v4 < (signed int)v5 ) | |
8358 { | |
8359 v8 = v5; | |
8360 v5 = v4; | |
8361 v4 = v8; | |
8362 } | |
8363 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8364 { | |
82 | 8365 v9 = v1->uAIState; |
8366 if ( v1->uAIState != 5 ) | |
0 | 8367 { |
8368 if ( v9 != 4 | |
8369 && v9 != 11 | |
8370 && v9 != 19 | |
8371 && v9 != 17 | |
82 | 8372 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8373 break; |
8374 } | |
8375 } | |
8376 ++v13; | |
82 | 8377 ++v1; |
0 | 8378 if ( v13 >= (signed int)uNumActors ) |
8379 goto LABEL_20; | |
8380 } | |
8381 result = 1; | |
8382 } | |
8383 return result; | |
8384 } | |
8385 | |
8386 //----- (0042F5ED) -------------------------------------------------------- | |
8387 int LayingItem::Create(int yaw, int pitch, int a4, int a5) | |
8388 { | |
8389 LayingItem *v5; // eax@1 | |
8390 signed int v6; // ebx@2 | |
8391 char *v7; // ecx@2 | |
8392 signed int result; // eax@6 | |
8393 LayingItem *v9; // ebx@7 | |
8394 int v10; // edx@11 | |
8395 int v11; // edi@18 | |
8396 __int16 v12; // ax@18 | |
8397 int v13; // ST2C_4@20 | |
8398 int v14; // eax@20 | |
8399 int v15; // [sp-28h] [bp-38h]@14 | |
8400 int v16; // [sp-24h] [bp-34h]@11 | |
8401 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 | |
8402 int *v18; // [sp-14h] [bp-24h]@11 | |
8403 int *v19; // [sp-10h] [bp-20h]@11 | |
8404 int *v20; // [sp-Ch] [bp-1Ch]@11 | |
8405 signed int v21; // [sp+8h] [bp-8h]@2 | |
8406 int angle; // [sp+Ch] [bp-4h]@1 | |
8407 int a4a; // [sp+1Ch] [bp+Ch]@20 | |
8408 int a4b; // [sp+1Ch] [bp+Ch]@20 | |
8409 int a5a; // [sp+20h] [bp+10h]@20 | |
8410 | |
8411 auto a1 = this; | |
8412 angle = yaw; | |
8413 v5 = a1; | |
8414 if ( !a1->uObjectDescID ) | |
8415 return -1; | |
8416 v6 = 0; | |
8417 v7 = (char *)&pLayingItems[0].uObjectDescID; | |
8418 v21 = 0; | |
8419 do | |
8420 { | |
8421 if ( !*(short *)v7 ) | |
8422 break; | |
8423 v7 += 112; | |
8424 ++v6; | |
8425 v21 = v6; | |
8426 } | |
8427 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) ); | |
8428 if ( v6 >= 1000 ) | |
8429 return -1; | |
8430 *(int *)&v5->field_62[2] = v5->vPosition.x; | |
8431 *(int *)&v5->field_62[6] = v5->vPosition.y; | |
8432 v9 = &pLayingItems[v6]; | |
8433 *(int *)&v5->field_62[10] = v5->vPosition.z; | |
8434 memcpy(v9, v5, 0x70u); | |
8435 if ( a5 == 1 ) | |
8436 { | |
8437 v20 = &v9->vPosition.z; | |
8438 v19 = &v9->vPosition.y; | |
8439 v18 = (int *)&v9->vPosition; | |
8440 v17.z = v5->vPosition.z; | |
8441 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8442 v16 = 0; | |
8443 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8444 goto LABEL_16; | |
8445 } | |
8446 if ( a5 == 2 ) | |
8447 { | |
8448 v20 = &v9->vPosition.z; | |
8449 v19 = &v9->vPosition.y; | |
8450 v18 = (int *)&v9->vPosition; | |
8451 v17.z = v5->vPosition.z; | |
8452 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8453 v16 = 0; | |
8454 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8455 goto LABEL_14; | |
8456 } | |
8457 if ( a5 == 3 ) | |
8458 { | |
8459 v20 = &v9->vPosition.z; | |
8460 v19 = &v9->vPosition.y; | |
8461 v18 = (int *)&v9->vPosition; | |
8462 v17.z = v5->vPosition.z; | |
8463 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8464 v16 = 0; | |
8465 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8466 LABEL_14: | |
8467 v15 = 8; | |
8468 LABEL_17: | |
8469 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20); | |
8470 goto LABEL_18; | |
8471 } | |
8472 if ( a5 == 4 ) | |
8473 { | |
8474 v20 = &v9->vPosition.z; | |
8475 v19 = &v9->vPosition.y; | |
8476 v18 = (int *)&v9->vPosition; | |
8477 v17.z = v5->vPosition.z; | |
8478 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8479 v16 = 0; | |
8480 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8481 LABEL_16: | |
8482 v15 = 24; | |
8483 goto LABEL_17; | |
8484 } | |
8485 LABEL_18: | |
8486 v11 = a4; | |
8487 v12 = 0; | |
8488 if ( a4 ) | |
8489 { | |
8490 a4a = stru_5C6E00->SinCos(angle); | |
8491 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->SinCos(pitch)) >> 16; | |
8492 a4b = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | |
8493 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->SinCos(pitch)) >> 16; | |
8494 v14 = stru_5C6E00->SinCos(pitch - stru_5C6E00->uIntegerHalfPi); | |
8495 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16; | |
8496 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16; | |
8497 v12 = (unsigned int)(v14 * v11) >> 16; | |
8498 } | |
8499 else | |
8500 { | |
8501 v9->vVelocity.y = 0; | |
8502 v9->vVelocity.x = 0; | |
8503 } | |
8504 v9->vVelocity.z = v12; | |
8505 result = v21; | |
8506 if ( v21 >= (signed int)uNumLayingItems ) | |
8507 uNumLayingItems = v21 + 1; | |
8508 return result; | |
8509 } | |
8510 | |
8511 //----- (0042F7EB) -------------------------------------------------------- | |
8512 bool __fastcall sub_42F7EB_DropItemAt(unsigned int uSpriteID, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9) | |
8513 { | |
8514 unsigned int v9; // edi@1 | |
8515 signed int v10; // edx@3 | |
8516 char *v11; // ecx@4 | |
8517 unsigned __int16 v12; // ax@7 | |
8518 unsigned int v13; // edx@9 | |
8519 char *v14; // ecx@10 | |
8520 int v15; // esi@17 | |
8521 int v16; // eax@18 | |
8522 int v17; // edi@20 | |
8523 int v18; // esi@20 | |
8524 //LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8525 int v21; // [sp+7Ch] [bp-8h]@1 | |
8526 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8527 | |
8528 v9 = uSpriteID; | |
8529 v21 = x; | |
8530 v22 = uSpriteID; | |
8531 | |
8532 LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8533 //LayingItem::LayingItem(&a1a); | |
8534 a1a.stru_24.Reset(); | |
8535 | |
8536 if ( a9 ) | |
8537 { | |
8538 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8539 v9 = v22; | |
8540 } | |
8541 v10 = 0; | |
8542 a1a.field_50 = 0; | |
8543 a1a.field_4C = 0; | |
8544 a1a.field_48 = 0; | |
8545 a1a.field_54 = 0; | |
8546 a1a.uItemType = v9; | |
8547 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8548 { | |
8549 LABEL_7: | |
8550 v12 = 0; | |
8551 } | |
8552 else | |
8553 { | |
8554 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8555 while ( (short)v9 != *(short *)v11 ) | |
8556 { | |
8557 ++v10; | |
8558 v11 += 56; | |
8559 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8560 goto LABEL_7; | |
8561 } | |
8562 v12 = v10; | |
8563 } | |
8564 a1a.uObjectDescID = v12; | |
8565 a1a.vPosition.z = z; | |
8566 a1a.vPosition.x = v21; | |
8567 a1a.vPosition.y = y; | |
8568 a1a.uSoundID = 0; | |
8569 a1a.uAttributes = attributes; | |
8570 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8571 a1a.uSpriteFrameID = 0; | |
8572 a1a.field_58 = 0; | |
8573 a1a.field_5C = 0; | |
8574 if ( !(a1a.uAttributes & 0x10) ) | |
8575 { | |
8576 v13 = 0; | |
8577 if ( (signed int)pItemsTable->pItems[0].uItemID > 0 ) | |
8578 { | |
8579 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8580 while ( *(short *)v14 != v9 ) | |
8581 { | |
8582 ++v13; | |
8583 v14 += 48; | |
8584 if ( (signed int)v13 >= (signed int)pItemsTable->pItems[0].uItemID ) | |
8585 goto LABEL_16; | |
8586 } | |
8587 a1a.stru_24.uItemID = v13; | |
8588 } | |
8589 } | |
8590 LABEL_16: | |
8591 if ( a7 ) | |
8592 { | |
8593 v15 = count; | |
8594 if ( count > 0 ) | |
8595 { | |
8596 do | |
8597 { | |
8598 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8599 v16 = rand(); | |
8600 a1a.Create( | |
8601 (signed __int16)a1a.uFacing, | |
8602 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8603 a4, | |
8604 0); | |
8605 --v15; | |
8606 } | |
8607 while ( v15 ); | |
8608 } | |
8609 } | |
8610 else | |
8611 { | |
8612 v17 = count; | |
8613 v18 = stru_5C6E00->uIntegerHalfPi; | |
8614 a1a.uFacing = 0; | |
8615 if ( count > 0 ) | |
8616 { | |
8617 do | |
8618 { | |
8619 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8620 --v17; | |
8621 } | |
8622 while ( v17 ); | |
8623 } | |
8624 } | |
8625 return 1; | |
8626 } | |
8627 | |
8628 //----- (0042F960) -------------------------------------------------------- | |
8629 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8630 { | |
8631 int v3; // ebx@1 | |
8632 int v4; // edi@1 | |
8633 signed int v5; // edx@1 | |
8634 char *v6; // ecx@2 | |
8635 unsigned __int16 v7; // ax@5 | |
8636 signed int v8; // eax@6 | |
8637 signed int v9; // eax@7 | |
8638 //LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8639 | |
8640 v3 = x; | |
8641 v4 = y; | |
8642 | |
8643 LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8644 //LayingItem::LayingItem(&a1); | |
8645 a1.stru_24.Reset(); | |
8646 | |
8647 v5 = 0; | |
8648 a1.field_50 = 0; | |
8649 a1.field_4C = 0; | |
8650 a1.field_48 = 0; | |
8651 a1.field_54 = 0; | |
8652 a1.uItemType = 800; | |
8653 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8654 { | |
8655 LABEL_5: | |
8656 v7 = 0; | |
8657 } | |
8658 else | |
8659 { | |
8660 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8661 while ( *(short *)v6 != 800 ) | |
8662 { | |
8663 ++v5; | |
8664 v6 += 56; | |
8665 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8666 goto LABEL_5; | |
8667 } | |
8668 v7 = v5; | |
8669 } | |
8670 a1.uObjectDescID = v7; | |
8671 a1.vPosition.x = v3; | |
8672 a1.vPosition.y = v4; | |
8673 a1.vPosition.z = z; | |
8674 a1.uSoundID = 0; | |
8675 a1.uAttributes = 0; | |
8676 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8677 a1.uSpriteFrameID = 0; | |
8678 a1.field_58 = 0; | |
8679 a1.field_5C = 0; | |
8680 v8 = a1.Create(0, 0, 0, 0); | |
8681 if ( v8 != -1 ) | |
8682 { | |
8683 v9 = 8 * v8; | |
8684 LOBYTE(v9) = v9 | 2; | |
8685 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8686 } | |
8687 } | |
8688 | |
8689 //----- (0042FA22) -------------------------------------------------------- | |
79 | 8690 LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8691 { |
8692 size_t v0; // edx@1 | |
8693 int v1; // ebp@1 | |
79 | 8694 LayingItem *result; // eax@1 |
8695 LayingItem *v3; // ebx@1 | |
0 | 8696 |
8697 v0 = 0; | |
8698 v1 = 0; | |
79 | 8699 //result = (char *)&pLayingItems[0].uObjectDescID; |
8700 result = pLayingItems; | |
0 | 8701 v3 = pLayingItems; |
8702 do | |
8703 { | |
79 | 8704 if ( result->uObjectDescID ) |
0 | 8705 { |
8706 if ( v1 != v0 ) | |
8707 { | |
79 | 8708 memcpy(v3, result, 0x70u); |
8709 result->uObjectDescID = 0; | |
0 | 8710 } |
8711 ++v0; | |
79 | 8712 ++v3;// = (char *)v3 + 112; |
0 | 8713 } |
79 | 8714 ++result;// += 112; |
0 | 8715 ++v1; |
8716 } | |
79 | 8717 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); |
8718 while( result <= &pLayingItems[999] ); | |
0 | 8719 uNumLayingItems = v0; |
8720 return result; | |
8721 } | |
8722 | |
8723 //----- (0042FA66) -------------------------------------------------------- | |
8724 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8725 { | |
8726 int v6; // edi@1 | |
8727 int v7; // esi@1 | |
8728 char *v8; // ecx@2 | |
8729 unsigned __int16 v9; // ax@5 | |
8730 int v10; // eax@10 | |
8731 signed int result; // eax@11 | |
8732 __int16 v12; // ax@12 | |
8733 //LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8734 int v14; // [sp+7Ch] [bp-4h]@1 | |
8735 | |
8736 v6 = a1; | |
8737 v7 = a2; | |
8738 LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8739 //LayingItem::LayingItem(&a1a); | |
8740 a1a.uItemType = 600; | |
8741 a1a.stru_24.Reset(); | |
8742 | |
8743 a1a.field_48 = 6; | |
8744 a1a.field_4C = 8; | |
8745 a1a.field_50 = 3; | |
8746 v14 = 0; | |
8747 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8748 { | |
8749 LABEL_5: | |
8750 v9 = 0; | |
8751 } | |
8752 else | |
8753 { | |
8754 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
8755 while ( (short)a1a.uItemType != *(short *)v8 ) | |
8756 { | |
8757 ++v14; | |
8758 v8 += 56; | |
8759 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8760 goto LABEL_5; | |
8761 } | |
8762 v9 = v14; | |
8763 } | |
8764 a1a.uObjectDescID = v9; | |
8765 a1a.vPosition.x = v6; | |
8766 a1a.vPosition.y = v7; | |
8767 a1a.vPosition.z = a3; | |
8768 a1a.uAttributes = 0; | |
8769 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8770 a1a.uSpriteFrameID = 0; | |
8771 a1a.field_5C = 0; | |
8772 a1a.field_60_distance_related_prolly_lod = 0; | |
8773 a1a.uFacing = 0; | |
8774 a1a.uSoundID = 0; | |
8775 if ( a6 >= 1 || a6 <= 4 ) | |
8776 { | |
8777 v10 = 8 * a6 - 8; | |
8778 LOBYTE(v10) = v10 | 4; | |
8779 a1a.field_58 = v10; | |
8780 } | |
8781 else | |
8782 { | |
8783 a1a.field_58 = 0; | |
8784 } | |
8785 result = a1a.Create(0, 0, 0, 0); | |
8786 if ( result != -1 ) | |
8787 { | |
8788 v12 = 8 * result; | |
8789 LOBYTE(v12) = v12 | 2; | |
8790 result = stru_50FE08.Add( | |
8791 v12, | |
8792 a5, | |
8793 SLOWORD(a1a.vPosition.x), | |
8794 SLOWORD(a1a.vPosition.y), | |
8795 SLOWORD(a1a.vPosition.z), | |
8796 0, | |
8797 0); | |
8798 } | |
8799 return result; | |
8800 } | |
8801 | |
8802 | |
8803 | |
8804 //----- (0042FB5C) -------------------------------------------------------- | |
8805 bool __fastcall sub_42FB5C(signed int a1) | |
8806 { | |
8807 int v1; // ecx@3 | |
8808 int v2; // ecx@4 | |
8809 int v3; // ecx@5 | |
8810 int v4; // ecx@6 | |
8811 int v5; // ecx@7 | |
8812 int v6; // ecx@8 | |
8813 char v7; // zf@9 | |
8814 | |
8815 if ( a1 > 39 ) | |
8816 { | |
8817 if ( a1 > 77 ) | |
8818 { | |
8819 if ( a1 == 80 ) | |
8820 return 0; | |
8821 if ( a1 > 84 ) | |
8822 { | |
8823 if ( a1 <= 86 ) | |
8824 return 0; | |
8825 v7 = a1 == 95; | |
8826 goto LABEL_20; | |
8827 } | |
8828 } | |
8829 else | |
8830 { | |
8831 if ( a1 == 77 ) | |
8832 return 0; | |
8833 if ( a1 >= 46 ) | |
8834 { | |
8835 if ( a1 <= 47 || a1 == 51 ) | |
8836 return 0; | |
8837 v7 = a1 == 73; | |
8838 goto LABEL_20; | |
8839 } | |
8840 } | |
8841 return 1; | |
8842 } | |
8843 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8844 return 1; | |
8845 v2 = v1 - 3; | |
8846 if ( !v2 ) | |
8847 return 0; | |
8848 v3 = v2 - 1; | |
8849 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8850 return 1; | |
8851 v5 = v4 - 8; | |
8852 if ( !v5 ) | |
8853 return 0; | |
8854 v6 = v5 - 1; | |
8855 if ( !v6 ) | |
8856 return 1; | |
8857 v7 = v6 == 20; | |
8858 LABEL_20: | |
8859 if ( !v7 ) | |
8860 return 1; | |
8861 return 0; | |
8862 } | |
8863 | |
8864 //----- (0042FBDD) -------------------------------------------------------- | |
8865 void __cdecl sub_42FBDD() | |
8866 { | |
8867 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
8868 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); | |
8869 pRenderer->Present(); | |
8870 } | |
8871 | |
8872 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8873 void __cdecl CloseWindowBackground() |
0 | 8874 { |
8875 pAudioPlayer->PlaySound((SoundID)75, -2, 0, -1, 0, 0, 0, 0); | |
8876 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); | |
8877 pRenderer->Present(); | |
8878 } | |
8879 | |
8880 //----- (0042FC4E) -------------------------------------------------------- | |
8881 void __cdecl ProcessInputActions() | |
8882 { | |
8883 ActionQueue *pActionQueue; // esi@7 | |
8884 Keyboard *v3; // ecx@8 | |
8885 char v4; // al@9 | |
8886 ActionQueue *v5; // ecx@19 | |
8887 Player *v6; // ecx@86 | |
8888 Player *v7; // esi@100 | |
8889 char v8; // bl@100 | |
8890 unsigned __int16 v9; // ax@102 | |
8891 int v10; // eax@103 | |
8892 unsigned int v11; // eax@127 | |
8893 signed int v12; // esi@157 | |
8894 Keyboard *v13; // ecx@158 | |
8895 char v14; // al@159 | |
8896 unsigned int v15; // eax@168 | |
8897 void *v16; // esi@177 | |
8898 int v17; // [sp-14h] [bp-1Ch]@8 | |
8899 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8900 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
8901 __int16 v20; // [sp-14h] [bp-1Ch]@60 | |
8902 int v21; // [sp-14h] [bp-1Ch]@68 | |
8903 int v22; // [sp-Ch] [bp-14h]@158 | |
8904 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8905 int v24; // [sp+4h] [bp-4h]@87 | |
8906 | |
8907 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8908 auto pKeyboard = pGame->pKeyboardInstance; | |
8909 if (!bAlwaysRun) | |
8910 { | |
8911 if (pKeyboard->IsShiftHeld()) | |
8912 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8913 else | |
8914 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8915 } | |
8916 else | |
8917 { | |
8918 if (pKeyboard->IsShiftHeld()) | |
8919 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8920 else | |
8921 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8922 } | |
8923 | |
140 | 8924 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
0 | 8925 LABEL_6: |
8926 if ( !pEventTimer->bPaused ) | |
8927 { | |
8928 inputAction = (InputAction)0; | |
8929 pActionQueue = pPartyActionQueue; | |
8930 while ( 1 ) | |
8931 { | |
8932 v3 = pGame->pKeyboardInstance; | |
8933 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8934 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8935 v4 = v3->WasKeyPressed(v17); | |
8936 else | |
8937 v4 = v3->IsKeyBeingHeld(v17); | |
8938 if ( v4 ) | |
8939 { | |
8940 switch ( inputAction ) | |
8941 { | |
8942 case INPUT_MoveForward: | |
8943 if ( pCurrentScreen ) | |
8944 break; | |
8945 if (!pParty->bTurnBasedModeOn) | |
163 | 8946 //goto _do_move_forward; |
0 | 8947 { |
8948 v5 = pActionQueue; | |
140 | 8949 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8950 partyAction = PARTY_RunForward; |
8951 else | |
8952 partyAction = PARTY_WalkForward; | |
163 | 8953 //goto _add_action_and_continue; |
8954 v5->Add(partyAction); | |
8955 break; | |
8956 } | |
8957 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8958 { | |
8959 pTurnEngine->uActionPointsLeft -= 26; | |
8960 //_do_move_forward: | |
8961 v5 = pActionQueue; | |
8962 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8963 partyAction = PARTY_RunForward; | |
8964 else | |
8965 partyAction = PARTY_WalkForward; | |
8966 //goto _add_action_and_continue; | |
8967 v5->Add(partyAction); | |
8968 break; | |
0 | 8969 } |
8970 break; | |
8971 case INPUT_MoveBackwards: | |
17 | 8972 //__debugbreak(); |
0 | 8973 if ( pCurrentScreen ) |
8974 break; | |
8975 if (!pParty->bTurnBasedModeOn) | |
17 | 8976 //goto _do_move_backwards; |
8977 { | |
8978 v5 = pActionQueue; | |
8979 if ( pParty->uFlags2 & 2 ) | |
8980 partyAction = PARTY_RunBackward; | |
8981 else | |
8982 partyAction = PARTY_WalkBackward; | |
163 | 8983 //goto _add_action_and_continue; |
8984 v5->Add(partyAction); | |
8985 break; | |
17 | 8986 } |
0 | 8987 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8988 { | |
8989 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8990 //_do_move_backwards: |
0 | 8991 v5 = pActionQueue; |
8992 if ( pParty->uFlags2 & 2 ) | |
8993 partyAction = PARTY_RunBackward; | |
8994 else | |
8995 partyAction = PARTY_WalkBackward; | |
163 | 8996 //goto _add_action_and_continue; |
8997 v5->Add(partyAction); | |
8998 break; | |
0 | 8999 } |
9000 break; | |
9001 case INPUT_StrafeLeft: | |
17 | 9002 //__debugbreak(); |
0 | 9003 if ( pCurrentScreen ) |
9004 break; | |
9005 if (!pParty->bTurnBasedModeOn) | |
17 | 9006 //goto _do_strafe_left; |
9007 { | |
9008 partyAction = PARTY_StrafeLeft; | |
163 | 9009 //goto _add_action_and_continue_; |
9010 v5 = pActionQueue; | |
9011 v5->Add(partyAction); | |
9012 break; | |
17 | 9013 } |
0 | 9014 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
9015 break; | |
9016 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9017 //_do_strafe_left: |
0 | 9018 partyAction = PARTY_StrafeLeft; |
163 | 9019 //goto _add_action_and_continue_; |
9020 v5 = pActionQueue; | |
9021 v5->Add(partyAction); | |
9022 break; | |
0 | 9023 case INPUT_StrafeRight: |
17 | 9024 //__debugbreak(); |
0 | 9025 if ( pCurrentScreen ) |
9026 break; | |
9027 if (!pParty->bTurnBasedModeOn) | |
17 | 9028 //goto _do_strafe_right; |
9029 { | |
9030 partyAction = PARTY_StrafeRight; | |
163 | 9031 //goto _add_action_and_continue_; |
9032 v5 = pActionQueue; | |
9033 v5->Add(partyAction); | |
9034 break; | |
17 | 9035 } |
0 | 9036 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
9037 break; | |
9038 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9039 //_do_strafe_right: |
0 | 9040 partyAction = PARTY_StrafeRight; |
163 | 9041 //goto _add_action_and_continue_; |
9042 v5 = pActionQueue; | |
9043 v5->Add(partyAction); | |
9044 break; | |
0 | 9045 case INPUT_TurnLeft: |
9046 if ( pCurrentScreen ) | |
9047 break; | |
9048 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
9049 { | |
9050 if (pParty->bTurnBasedModeOn) | |
9051 { | |
9052 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9053 break; | |
9054 pTurnEngine->uActionPointsLeft -= 26; | |
9055 } | |
9056 partyAction_ = PARTY_StrafeLeft; | |
9057 } | |
9058 else | |
9059 { | |
9060 if ( pParty->uFlags2 & 2 ) | |
9061 partyAction_ = PARTY_FastTurnLeft; | |
9062 else | |
9063 partyAction_ = PARTY_TurnLeft; | |
9064 } | |
9065 pActionQueue->Add(partyAction_); | |
9066 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9067 { | |
9068 v20 = 10; | |
163 | 9069 //goto LABEL_75; |
9070 pWeather->_4C2F0B(v20); | |
9071 break; | |
0 | 9072 } |
9073 break; | |
9074 case INPUT_TurnRight: | |
9075 if ( pCurrentScreen ) | |
9076 break; | |
9077 if ( GetAsyncKeyState(17) ) // strafing | |
9078 { | |
9079 if (pParty->bTurnBasedModeOn) | |
9080 { | |
9081 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9082 break; | |
9083 pTurnEngine->uActionPointsLeft -= 26; | |
9084 } | |
9085 v21 = 4; | |
9086 } | |
9087 else | |
9088 { | |
9089 if ( pParty->uFlags2 & 2 ) | |
9090 v21 = 19; | |
9091 else | |
9092 v21 = 2; | |
9093 } | |
9094 pActionQueue->Add((PartyAction)v21); | |
9095 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9096 { | |
9097 v20 = -10; | |
163 | 9098 //LABEL_75: |
0 | 9099 pWeather->_4C2F0B(v20); |
9100 } | |
9101 break; | |
9102 case INPUT_Jump: | |
17 | 9103 //__debugbreak(); |
0 | 9104 if ( pCurrentScreen |
9105 || pParty->bTurnBasedModeOn) | |
9106 break; | |
9107 partyAction = (PartyAction)12; | |
163 | 9108 //goto _add_action_and_continue_; |
9109 v5 = pActionQueue; | |
9110 v5->Add(partyAction); | |
9111 break; | |
0 | 9112 case INPUT_Yell: |
17 | 9113 //__debugbreak(); |
0 | 9114 if ( !pCurrentScreen |
9115 && uActiveCharacter ) | |
9116 { | |
9117 pParty->Yell(); | |
9118 pPlayers[uActiveCharacter]->PlaySound(65, 0); | |
9119 } | |
9120 break; | |
9121 case INPUT_Pass: | |
17 | 9122 //__debugbreak(); |
0 | 9123 if ( pCurrentScreen ) |
9124 break; | |
9125 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9126 //goto LABEL_118; |
9127 { | |
9128 pTurnEngine->field_18 |= 8u; | |
9129 break; | |
9130 } | |
0 | 9131 if ( uActiveCharacter ) |
9132 { | |
9133 v6 = pPlayers[uActiveCharacter]; | |
9134 if ( !v6->uTimeToRecovery ) | |
9135 { | |
9136 v24 = v6->GetAttackRecoveryTime(0); | |
9137 if ( !pParty->bTurnBasedModeOn ) | |
9138 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
9139 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
9140 pStru277->_427D48(uActiveCharacter); | |
9141 pTurnEngine->_40471C(); | |
9142 } | |
9143 } | |
9144 break; | |
9145 case INPUT_Combat: | |
17 | 9146 //__debugbreak(); |
0 | 9147 if ( !pCurrentScreen ) |
9148 { | |
9149 if (pParty->bTurnBasedModeOn) | |
9150 { | |
141 | 9151 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 9152 { |
9153 pParty->bTurnBasedModeOn = 0; | |
9154 pTurnEngine->End(true); | |
9155 } | |
9156 } | |
9157 else | |
9158 { | |
9159 pTurnEngine->Start(); | |
9160 pParty->bTurnBasedModeOn = true; | |
9161 } | |
9162 } | |
9163 break; | |
9164 case INPUT_CastReady: | |
17 | 9165 //__debugbreak(); |
0 | 9166 if ( pCurrentScreen ) |
9167 break; | |
9168 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9169 //goto LABEL_118; |
9170 { | |
9171 pTurnEngine->field_18 |= 8u; | |
9172 break; | |
9173 } | |
0 | 9174 if ( !uActiveCharacter ) |
9175 break; | |
9176 v7 = pPlayers[uActiveCharacter]; | |
9177 v8 = v7->uQuickSpell; | |
9178 if ( !v8 | |
9179 || bUnderwater | |
9180 || ((v9 = v7->pActiveSkills[(unsigned __int8)v8 / 11 + 12], !(HIBYTE(v9) & 1)) ? ((v9 & 0x80u) == 0 ? (!(v9 & 0x40) ? (v10 = *(&pSpellDatas[0].uNormalLevelMana + 10 * (unsigned __int8)v8)) : (v10 = *(&pSpellDatas[0].uExpertLevelMana + 10 * (unsigned __int8)v8))) : (v10 = *(&pSpellDatas[0].uMasterLevelMana + 10 * (unsigned __int8)v8))) : (v10 = *(&pSpellDatas[0].uMagisterLevelMana + 10 * (unsigned __int8)v8)), | |
9181 v10 > v7->sMana) ) | |
9182 { | |
9183 pActionQueue = pPartyActionQueue; | |
9184 LABEL_120: | |
9185 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
9186 { | |
9187 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23; | |
163 | 9188 //goto _send_message; |
9189 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9190 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9191 ++pMessageQueue_50CBD0->uNumMessages; | |
9192 break; | |
0 | 9193 } |
9194 } | |
9195 else | |
9196 { | |
9197 pActionQueue = pPartyActionQueue; | |
9198 if ( dword_50C9E8 < 40 ) | |
9199 { | |
9200 dword_50C9EC[3 * dword_50C9E8] = 25; | |
9201 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9202 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9203 ++dword_50C9E8; | |
9204 } | |
9205 } | |
9206 break; | |
9207 case INPUT_Attack: | |
17 | 9208 //__debugbreak(); |
0 | 9209 if ( pCurrentScreen ) |
9210 break; | |
9211 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
9212 goto LABEL_120; | |
17 | 9213 //LABEL_118: |
0 | 9214 pTurnEngine->field_18 |= 8u; |
9215 break; | |
9216 case INPUT_EventTrigger: | |
9217 if ( !pCurrentScreen ) | |
9218 { | |
9219 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9220 break; | |
9221 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
163 | 9222 //goto _send_message; |
9223 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9224 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9225 ++pMessageQueue_50CBD0->uNumMessages; | |
9226 break; | |
0 | 9227 } |
151 | 9228 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 9229 { |
9230 v11 = pMessageQueue_50CBD0->uNumMessages; | |
9231 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9232 { | |
9233 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9234 { | |
9235 v11 = 1; | |
9236 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 9237 //LABEL_132: |
0 | 9238 pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113; |
163 | 9239 //_send_message: |
0 | 9240 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9241 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9242 ++pMessageQueue_50CBD0->uNumMessages; | |
9243 break; | |
9244 } | |
9245 v11 = 0; | |
9246 pMessageQueue_50CBD0->uNumMessages = 0; | |
9247 } | |
9248 if ( (signed int)v11 < 40 ) | |
163 | 9249 //goto LABEL_132; |
9250 { | |
9251 pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113; | |
9252 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9253 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9254 ++pMessageQueue_50CBD0->uNumMessages; | |
9255 break; | |
9256 } | |
0 | 9257 } |
9258 break; | |
9259 case INPUT_CharCycle: | |
17 | 9260 //__debugbreak(); |
151 | 9261 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 9262 || dword_50C9E8 >= 40 ) |
9263 break; | |
9264 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 9265 //goto LABEL_155; |
9266 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9267 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9268 ++dword_50C9E8; | |
9269 break; | |
0 | 9270 case INPUT_LookUp: |
17 | 9271 //__debugbreak(); |
0 | 9272 if ( pEventTimer->bPaused ) |
9273 break; | |
9274 partyAction = (PartyAction)7; | |
163 | 9275 //goto _add_action_and_continue_; |
9276 v5 = pActionQueue; | |
9277 v5->Add(partyAction); | |
9278 break; | |
0 | 9279 case INPUT_CenterView: |
17 | 9280 //__debugbreak(); |
0 | 9281 if ( pEventTimer->bPaused ) |
9282 break; | |
9283 partyAction = (PartyAction)9; | |
163 | 9284 //goto _add_action_and_continue_; |
9285 v5 = pActionQueue; | |
9286 v5->Add(partyAction); | |
9287 break; | |
0 | 9288 case INPUT_LookDown: |
17 | 9289 //__debugbreak(); |
0 | 9290 if ( pEventTimer->bPaused ) |
9291 break; | |
9292 partyAction = (PartyAction)8; | |
163 | 9293 //goto _add_action_and_continue_; |
9294 v5 = pActionQueue; | |
9295 v5->Add(partyAction); | |
9296 break; | |
0 | 9297 case INPUT_FlyUp: |
17 | 9298 //__debugbreak(); |
0 | 9299 if ( pCurrentScreen |
9300 || pEventTimer->bPaused ) | |
9301 break; | |
9302 partyAction = (PartyAction)13; | |
163 | 9303 //goto _add_action_and_continue_; |
9304 v5 = pActionQueue; | |
9305 v5->Add(partyAction); | |
9306 break; | |
0 | 9307 case INPUT_Land: |
17 | 9308 //__debugbreak(); |
0 | 9309 if ( pCurrentScreen |
9310 || pEventTimer->bPaused ) | |
9311 break; | |
9312 partyAction = (PartyAction)15; | |
163 | 9313 //goto _add_action_and_continue_; |
9314 v5 = pActionQueue; | |
9315 v5->Add(partyAction); | |
9316 break; | |
0 | 9317 case INPUT_FlyDown: |
17 | 9318 //__debugbreak(); |
0 | 9319 if ( !pCurrentScreen |
9320 && !pEventTimer->bPaused ) | |
9321 { | |
9322 partyAction = (PartyAction)14; | |
163 | 9323 //_add_action_and_continue_: |
0 | 9324 v5 = pActionQueue; |
163 | 9325 //_add_action_and_continue: |
0 | 9326 v5->Add(partyAction); |
9327 } | |
9328 break; | |
9329 case INPUT_ZoomIn: | |
17 | 9330 //__debugbreak(); |
0 | 9331 if ( dword_50C9E8 >= 40 ) |
9332 break; | |
9333 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 9334 //goto LABEL_155; |
9335 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9336 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9337 ++dword_50C9E8; | |
9338 break; | |
0 | 9339 case INPUT_ZoomOut: |
17 | 9340 //__debugbreak(); |
0 | 9341 if ( dword_50C9E8 < 40 ) |
9342 { | |
9343 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 9344 //LABEL_155: |
0 | 9345 dword_50C9F0[3 * dword_50C9E8] = 0; |
9346 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9347 ++dword_50C9E8; | |
9348 } | |
9349 break; | |
9350 case INPUT_AlwaysRun: | |
9351 bAlwaysRun = bAlwaysRun == 0; | |
9352 break; | |
17 | 9353 default: |
9354 //__debugbreak(); | |
9355 break; | |
0 | 9356 } |
9357 } | |
9358 inputAction = (InputAction)((int)inputAction + 1); | |
9359 if ( (signed int)inputAction >= 30 ) | |
9360 goto LABEL_176; | |
9361 } | |
9362 } | |
9363 v12 = 0; | |
9364 do | |
9365 { | |
9366 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
9367 v13 = pGame->pKeyboardInstance; | |
9368 if ( pKeyActionMap->pToggleTypes[v12] ) | |
9369 v14 = v13->WasKeyPressed(v22); | |
9370 else | |
9371 v14 = v13->IsKeyBeingHeld(v22); | |
9372 if ( v14 && v12 == 9 ) | |
9373 { | |
9374 if ( !pCurrentScreen ) | |
9375 { | |
9376 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9377 goto LABEL_175; | |
9378 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 9379 //goto LABEL_174; |
9380 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9381 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9382 ++pMessageQueue_50CBD0->uNumMessages; | |
9383 goto LABEL_175; | |
0 | 9384 } |
151 | 9385 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
9386 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 9387 { |
9388 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9389 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9390 { | |
9391 v15 = 0; | |
9392 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9393 { | |
9394 v15 = 1; | |
9395 pMessageQueue_50CBD0->uNumMessages = 1; | |
17 | 9396 //goto LABEL_173; |
9397 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; | |
9398 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9399 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9400 ++pMessageQueue_50CBD0->uNumMessages; | |
9401 goto LABEL_175; | |
0 | 9402 } |
9403 pMessageQueue_50CBD0->uNumMessages = 0; | |
9404 } | |
9405 if ( (signed int)v15 >= 40 ) | |
9406 goto LABEL_175; | |
17 | 9407 //LABEL_173: |
0 | 9408 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9409 //LABEL_174: |
0 | 9410 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9411 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9412 ++pMessageQueue_50CBD0->uNumMessages; | |
9413 goto LABEL_175; | |
9414 } | |
9415 } | |
9416 LABEL_175: | |
9417 ++v12; | |
9418 } | |
9419 while ( v12 < 30 ); | |
9420 LABEL_176: | |
9421 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9422 { | |
9423 AsyncKeyboard::LeaveCriticalSection(); | |
9424 v16 = pAsyncKeyboard; | |
9425 AsyncKeyboard::EnterCriticalSection(); | |
9426 memset((char *)v16 + 521, 0, 0x100u); | |
9427 AsyncKeyboard::LeaveCriticalSection(); | |
9428 } | |
9429 } | |
9430 |