Mercurial > mm7
annotate mm7_6.cpp @ 276:f809f0465769
m
author | Ritor1 |
---|---|
date | Sun, 17 Feb 2013 17:41:15 +0600 |
parents | 650d96af8855 |
children | 1bd823f52e3a |
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" | |
189 | 42 #include "texts.h" |
0 | 43 #include "StorylineTextTable.h" |
44 #include "Events2D.h" | |
45 | |
46 #include "mm7_data.h" | |
47 | |
48 | |
49 | |
50 //----- (00424EE0) -------------------------------------------------------- | |
51 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
52 { | |
53 unsigned int v1; // edx@1 | |
54 double v2; // st7@1 | |
55 signed int v3; // edi@1 | |
56 char *v4; // esi@4 | |
57 char *v5; // ecx@4 | |
58 unsigned int v6; // eax@4 | |
59 char *v7; // edx@4 | |
60 double v8; // st6@10 | |
61 double v9; // st5@10 | |
62 double v10; // st6@11 | |
63 unsigned __int8 v11; // c2@15 | |
64 unsigned __int8 v12; // c3@15 | |
65 void *v13; // edi@22 | |
66 char *v14; // eax@22 | |
67 double v15; // st6@22 | |
68 char *v16; // ecx@22 | |
69 signed int result; // eax@24 | |
70 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
71 bool v19; // [sp+Ch] [bp-28h]@6 | |
72 char *v20; // [sp+10h] [bp-24h]@4 | |
73 char *v21; // [sp+14h] [bp-20h]@4 | |
74 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
75 char *v23; // [sp+1Ch] [bp-18h]@4 | |
76 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
77 char *v25; // [sp+24h] [bp-10h]@4 | |
78 char *v26; // [sp+28h] [bp-Ch]@4 | |
79 char *v27; // [sp+2Ch] [bp-8h]@4 | |
80 char *v28; // [sp+30h] [bp-4h]@4 | |
81 | |
82 v1 = uVertexID; | |
83 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
84 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
85 v3 = 0; | |
86 v22 = 0; | |
87 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | |
88 v3 = 1; | |
89 if ( (signed int)(uVertexID + 1) <= 1 ) | |
90 return 0; | |
91 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
92 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
93 v6 = v1; | |
94 v23 = (char *)&array_507D30[0].flt_2C; | |
168 | 95 v26 = (char *)&array_507D30[0]._rhw; |
0 | 96 v24 = array_507D30; |
97 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
98 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
99 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
100 v27 = (char *)&array_507D30[0].v; | |
101 v28 = (char *)&array_507D30[0].u; | |
102 v7 = (char *)&array_50AC10[0].v; | |
103 v18 = v6; | |
104 do | |
105 { | |
106 v19 = v2 >= *((float *)v7 + 5); | |
107 if ( v3 != v19 ) | |
108 { | |
109 if ( v19 ) | |
110 { | |
111 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | |
112 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | |
113 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | |
114 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | |
115 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | |
116 } | |
117 else | |
118 { | |
119 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | |
120 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | |
121 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | |
122 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | |
123 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | |
124 } | |
125 *(float *)v27 = v9; | |
126 *(float *)v25 = v2; | |
127 *(float *)v26 = 1.0 / v2; | |
128 if ( v3 ) | |
129 { | |
130 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
131 { | |
132 v11 = 0; | |
133 v12 = *(float *)v4 == *((float *)v7 - 5); | |
134 goto LABEL_19; | |
135 } | |
136 } | |
137 else | |
138 { | |
139 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
140 { | |
141 v11 = 0; | |
142 v12 = *(float *)v4 == *((float *)v7 + 7); | |
143 LABEL_19: | |
144 if ( v12 | v11 ) | |
145 goto LABEL_21; | |
146 goto LABEL_20; | |
147 } | |
148 } | |
149 LABEL_20: | |
150 v26 += 48; | |
151 ++v24; | |
152 v25 += 48; | |
153 v27 += 48; | |
154 v28 += 48; | |
155 v5 += 48; | |
156 v4 += 48; | |
157 ++v22; | |
158 v23 += 48; | |
159 v21 = v5; | |
160 v20 = v4; | |
161 } | |
162 LABEL_21: | |
163 if ( v19 ) | |
164 { | |
165 v13 = v24; | |
166 v14 = v26; | |
167 v21 += 48; | |
168 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
169 v20 += 48; | |
170 ++v22; | |
171 v28 += 48; | |
172 v27 += 48; | |
173 v25 += 48; | |
174 ++v24; | |
175 v26 += 48; | |
176 memcpy(v13, v7 + 8, 0x30u); | |
177 v16 = v23; | |
178 v23 += 48; | |
179 v4 = v20; | |
180 *(float *)v14 = v15; | |
181 *(int *)v16 = *((int *)v7 + 13); | |
182 v5 = v21; | |
183 } | |
184 v3 = v19; | |
185 v7 += 48; | |
186 --v18; | |
187 } | |
188 while ( v18 ); | |
189 result = v22; | |
190 if ( v22 < 3 ) | |
191 return 0; | |
192 return result; | |
193 } | |
194 | |
195 //----- (004250FE) -------------------------------------------------------- | |
196 signed int __fastcall sr_4250FE(unsigned int uVertexID) | |
197 { | |
198 unsigned int v1; // edx@1 | |
199 char *v2; // edi@5 | |
200 char *v3; // esi@5 | |
201 char *v4; // ecx@5 | |
202 int v5; // ebx@6 | |
203 double v6; // st6@11 | |
204 double v7; // st5@11 | |
205 double v8; // st6@12 | |
206 unsigned __int8 v9; // c2@16 | |
207 unsigned __int8 v10; // c3@16 | |
208 void *v11; // edi@23 | |
209 double v12; // st6@23 | |
210 char *v13; // ecx@23 | |
211 char v14; // zf@24 | |
212 signed int result; // eax@25 | |
213 unsigned int v16; // [sp+8h] [bp-28h]@5 | |
214 bool v17; // [sp+Ch] [bp-24h]@2 | |
215 bool v18; // [sp+10h] [bp-20h]@7 | |
216 char *v19; // [sp+14h] [bp-1Ch]@5 | |
217 char *v20; // [sp+18h] [bp-18h]@5 | |
218 signed int v21; // [sp+1Ch] [bp-14h]@1 | |
219 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5 | |
220 char *v23; // [sp+24h] [bp-Ch]@5 | |
221 char *v24; // [sp+28h] [bp-8h]@5 | |
222 char *v25; // [sp+2Ch] [bp-4h]@5 | |
223 | |
224 v1 = uVertexID; | |
225 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
226 v21 = 0; | |
227 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0; | |
228 if ( (signed int)(uVertexID + 1) <= 1 ) | |
229 return 0; | |
230 v2 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
231 v3 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 232 v24 = (char *)&array_507D30[0]._rhw; |
0 | 233 v22 = array_507D30; |
234 v19 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
235 v20 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
236 v23 = (char *)&array_507D30[0].vWorldViewPosition; | |
237 v25 = (char *)&array_507D30[0].flt_2C; | |
238 v4 = (char *)&array_50AC10[0].vWorldViewPosition; | |
239 v16 = v1; | |
240 do | |
241 { | |
242 v5 = (int)(v4 + 48); | |
243 v18 = *((float *)v4 + 12) >= 8.0; | |
244 if ( v17 != v18 ) | |
245 { | |
246 if ( v18 ) | |
247 { | |
248 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4); | |
249 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1); | |
250 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2); | |
251 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8); | |
252 } | |
253 else | |
254 { | |
255 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5); | |
256 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13); | |
257 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14); | |
258 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20); | |
259 } | |
260 *(float *)v25 = v7; | |
261 *(float *)v23 = 8.0; | |
262 *(int *)v24 = 0x3E000000u; | |
263 if ( v17 ) | |
264 { | |
265 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) ) | |
266 { | |
267 v9 = 0; | |
268 v10 = *(float *)v2 == *((float *)v4 + 2); | |
269 goto LABEL_20; | |
270 } | |
271 } | |
272 else | |
273 { | |
274 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) ) | |
275 { | |
276 v9 = 0; | |
277 v10 = *(float *)v2 == *((float *)v4 + 14); | |
278 LABEL_20: | |
279 if ( v10 | v9 ) | |
280 goto LABEL_22; | |
281 goto LABEL_21; | |
282 } | |
283 } | |
284 LABEL_21: | |
285 ++v22; | |
286 v23 += 48; | |
287 v25 += 48; | |
288 v3 += 48; | |
289 v2 += 48; | |
290 ++v21; | |
291 v24 += 48; | |
292 v20 = v3; | |
293 v19 = v2; | |
294 } | |
295 LABEL_22: | |
296 if ( v18 ) | |
297 { | |
298 v11 = v22; | |
299 v20 += 48; | |
300 v19 += 48; | |
301 v12 = 1.0 / (*(float *)v5 + 0.0000001); | |
302 ++v21; | |
303 v25 += 48; | |
304 v23 += 48; | |
305 ++v22; | |
306 memcpy(v11, v4 + 36, 0x30u); | |
307 v13 = v24; | |
308 v24 += 48; | |
309 v3 = v20; | |
310 v2 = v19; | |
311 *(float *)v13 = v12; | |
312 } | |
313 v14 = v16-- == 1; | |
314 v17 = v18; | |
315 v4 = (char *)v5; | |
316 } | |
317 while ( !v14 ); | |
318 result = v21; | |
319 if ( v21 < 3 ) | |
320 return 0; | |
321 return result; | |
322 } | |
323 | |
324 //----- (004252E8) -------------------------------------------------------- | |
325 signed int __fastcall sr_4252E8(unsigned int uVertexID) | |
326 { | |
327 unsigned int v1; // edx@1 | |
328 double v2; // st7@1 | |
329 char *v3; // edi@5 | |
330 char *v4; // esi@5 | |
331 char *v5; // ecx@5 | |
332 int v6; // ebx@6 | |
333 double v7; // st6@11 | |
334 double v8; // st5@11 | |
335 double v9; // st6@12 | |
336 unsigned __int8 v10; // c2@16 | |
337 unsigned __int8 v11; // c3@16 | |
338 void *v12; // edi@23 | |
339 double v13; // st6@23 | |
340 char *v14; // ecx@23 | |
341 char v15; // zf@24 | |
342 signed int result; // eax@25 | |
343 unsigned int v17; // [sp+8h] [bp-28h]@5 | |
344 bool v18; // [sp+Ch] [bp-24h]@2 | |
345 bool v19; // [sp+10h] [bp-20h]@7 | |
346 char *v20; // [sp+14h] [bp-1Ch]@5 | |
347 char *v21; // [sp+18h] [bp-18h]@5 | |
348 signed int v22; // [sp+1Ch] [bp-14h]@1 | |
349 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5 | |
350 char *v24; // [sp+24h] [bp-Ch]@5 | |
351 char *v25; // [sp+28h] [bp-8h]@5 | |
352 char *v26; // [sp+2Ch] [bp-4h]@5 | |
353 | |
354 v1 = uVertexID; | |
355 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
356 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
357 v22 = 0; | |
358 v18 = array_50AC10[0].vWorldViewPosition.x <= v2; | |
359 if ( (signed int)(uVertexID + 1) <= 1 ) | |
360 return 0; | |
361 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
362 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 363 v25 = (char *)&array_507D30[0]._rhw; |
0 | 364 v23 = array_507D30; |
365 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
366 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
367 v24 = (char *)&array_507D30[0].vWorldViewPosition; | |
368 v26 = (char *)&array_507D30[0].flt_2C; | |
369 v5 = (char *)&array_50AC10[0].vWorldViewPosition; | |
370 v17 = v1; | |
371 do | |
372 { | |
373 v6 = (int)(v5 + 48); | |
374 v19 = v2 >= *((float *)v5 + 12); | |
375 if ( v18 != v19 ) | |
376 { | |
377 if ( v19 ) | |
378 { | |
379 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5); | |
380 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1); | |
381 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2); | |
382 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8); | |
383 } | |
384 else | |
385 { | |
386 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6); | |
387 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13); | |
388 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14); | |
389 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20); | |
390 } | |
391 *(float *)v26 = v8; | |
392 *(float *)v24 = v2; | |
393 *(float *)v25 = 1.0 / v2; | |
394 if ( v18 ) | |
395 { | |
396 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) ) | |
397 { | |
398 v10 = 0; | |
399 v11 = *(float *)v3 == *((float *)v5 + 2); | |
400 goto LABEL_20; | |
401 } | |
402 } | |
403 else | |
404 { | |
405 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) ) | |
406 { | |
407 v10 = 0; | |
408 v11 = *(float *)v3 == *((float *)v5 + 14); | |
409 LABEL_20: | |
410 if ( v11 | v10 ) | |
411 goto LABEL_22; | |
412 goto LABEL_21; | |
413 } | |
414 } | |
415 LABEL_21: | |
416 ++v23; | |
417 v24 += 48; | |
418 v26 += 48; | |
419 v4 += 48; | |
420 v3 += 48; | |
421 ++v22; | |
422 v25 += 48; | |
423 v21 = v4; | |
424 v20 = v3; | |
425 } | |
426 LABEL_22: | |
427 if ( v19 ) | |
428 { | |
429 v12 = v23; | |
430 v21 += 48; | |
431 v20 += 48; | |
432 v13 = 1.0 / (*(float *)v6 + 0.0000001); | |
433 ++v22; | |
434 v26 += 48; | |
435 v24 += 48; | |
436 ++v23; | |
437 memcpy(v12, v5 + 36, 0x30u); | |
438 v14 = v25; | |
439 v25 += 48; | |
440 v4 = v21; | |
441 v3 = v20; | |
442 *(float *)v14 = v13; | |
443 } | |
444 v15 = v17-- == 1; | |
445 v18 = v19; | |
446 v5 = (char *)v6; | |
447 } | |
448 while ( !v15 ); | |
449 result = v22; | |
450 if ( v22 < 3 ) | |
451 return 0; | |
452 return result; | |
453 } | |
454 | |
455 | |
456 | |
457 //----- (004361EF) -------------------------------------------------------- | |
458 IndoorCameraD3D::IndoorCameraD3D() | |
459 { | |
460 IndoorCameraD3D *v1; // esi@1 | |
461 double v2; // st7@1 | |
462 double v3; // st6@1 | |
463 double v4; // st5@1 | |
464 double v5; // st7@1 | |
465 double v6; // st6@1 | |
466 double v7; // st5@1 | |
467 | |
468 v1 = this; | |
469 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4); | |
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14); | |
471 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24); | |
472 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, | |
473 24, | |
474 6, | |
475 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
476 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ | |
477 v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
478 v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
479 v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; | |
480 v1->field_108 = 0.0; | |
481 v1->field_DC = v4; | |
482 v1->field_E0 = v3; | |
483 v1->field_E4 = v2; | |
484 v5 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
485 v6 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
486 v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300); | |
487 v1->field_138 = 0.0; | |
488 v1->field_10C = v7; | |
489 v1->field_110 = v6; | |
490 v1->field_114 = v5; | |
491 v1->field_168 = 0.0; | |
492 v1->field_198 = 0.0; | |
493 v1->field_1C8 = 0.0; | |
494 v1->field_1F8 = 0.0; | |
495 v1->field_228 = 0.0; | |
496 v1->field_258 = 0.0; | |
497 v1->field_288 = 0.0; | |
498 v1->field_2B8 = 0.0; | |
499 v1->field_2E8 = 0.0; | |
500 v1->field_2BC = 0.0; | |
501 v1->field_2C0 = 0.0; | |
502 v1->field_2C4 = 0.0; | |
503 v1->field_318 = 0.0; | |
504 v1->field_2EC = 0.0; | |
505 v1->field_2F0 = 0.0; | |
506 v1->field_2F4 = 0.0; | |
507 v1->field_348 = 0.0; | |
508 v1->field_31C = 0.0; | |
509 v1->field_320 = 0.0; | |
510 v1->field_324 = 0.0; | |
511 v1->field_378 = 0.0; | |
512 v1->field_34C = 0.0; | |
513 v1->field_350 = 0.0; | |
514 v1->field_354 = 0.0; | |
515 for (uint i = 0; i < 16384; ++i) | |
516 { | |
517 list_0037C[i].field_0 = 0; | |
518 list_0037C[i].flt_30 = 0.0f; | |
519 } | |
520 | |
521 list_0037C_size = 0; | |
522 for (uint i = 0; i < 256; ++i) | |
523 list_E0380[i].mm7__vector_000004_size = 0; | |
524 /*v10 = v1->list_E0380; | |
525 v12 = 256; | |
526 do | |
527 { | |
528 v10->mm7__vector_000004_size = 0; | |
529 //mm7__vector_constructor( | |
530 // v10->mm7__vector_000004, | |
531 // 48, | |
532 // 64, | |
533 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); | |
534 //++v10; | |
535 --v12; | |
536 } | |
537 while ( v12 );*/ | |
538 list_E0380_size = 0; | |
539 //v1->vdestructor_ptr = &stru8_pvdtor; | |
540 } | |
541 | |
542 | |
543 //----- (004254D2) -------------------------------------------------------- | |
544 int __fastcall sr_4254D2(signed int a1) | |
545 { | |
546 signed int v1; // ebx@2 | |
547 int v2; // ecx@2 | |
548 int result; // eax@11 | |
549 double v4; // ST74_8@12 | |
550 bool v5; // edi@12 | |
551 char *v6; // esi@13 | |
552 char *v7; // ebx@13 | |
553 double v8; // st7@15 | |
554 double v9; // st7@16 | |
555 double v10; // st6@16 | |
556 double v11; // st7@17 | |
557 float v12; // eax@18 | |
558 double v13; // ST4C_8@19 | |
559 double v14; // ST10_8@19 | |
560 double v15; // ST28_8@20 | |
561 double v16; // ST34_8@20 | |
562 char v17; // zf@20 | |
563 double v18; // ST18_8@21 | |
564 double v19; // ST3C_8@21 | |
565 double v20; // ST44_8@22 | |
566 double v21; // ST54_8@22 | |
567 void *v22; // edi@26 | |
568 double v23; // ST54_8@29 | |
569 bool v24; // esi@29 | |
570 char *v25; // edi@30 | |
571 char *v26; // ebx@30 | |
572 bool v27; // ecx@32 | |
573 double v28; // st7@33 | |
574 double v29; // st7@34 | |
575 double v30; // st6@34 | |
576 double v31; // st7@35 | |
577 double v32; // ST44_8@37 | |
578 double v33; // ST3C_8@37 | |
579 double v34; // ST18_8@38 | |
580 double v35; // ST34_8@38 | |
581 char v36; // zf@38 | |
582 double v37; // ST28_8@39 | |
583 double v38; // ST10_8@39 | |
584 double v39; // ST20_8@40 | |
585 double v40; // ST5C_8@40 | |
586 void *v41; // edi@44 | |
587 double v42; // ST5C_8@47 | |
588 bool v43; // edi@47 | |
589 char *v44; // esi@48 | |
590 char *v45; // ebx@48 | |
591 bool v46; // ecx@49 | |
592 double v47; // st6@50 | |
593 double v48; // st6@51 | |
594 double v49; // st5@51 | |
595 double v50; // st6@52 | |
596 double v51; // ST20_8@54 | |
597 double v52; // ST54_8@54 | |
598 double v53; // ST44_8@55 | |
599 double v54; // ST3C_8@55 | |
600 char v55; // zf@55 | |
601 double v56; // ST18_8@56 | |
602 double v57; // ST34_8@56 | |
603 double v58; // ST28_8@57 | |
604 double v59; // ST10_8@57 | |
605 void *v60; // edi@61 | |
606 double v61; // ST5C_8@64 | |
607 bool v62; // edi@64 | |
608 char *v63; // esi@65 | |
609 char *v64; // ebx@65 | |
610 bool v65; // ecx@66 | |
611 double v66; // st6@67 | |
612 double v67; // st6@68 | |
613 double v68; // st5@68 | |
614 double v69; // st6@69 | |
615 double v70; // ST20_8@71 | |
616 double v71; // ST54_8@71 | |
617 double v72; // ST44_8@72 | |
618 double v73; // ST3C_8@72 | |
619 char v74; // zf@72 | |
620 double v75; // ST18_8@73 | |
621 double v76; // ST34_8@73 | |
622 double v77; // ST28_8@74 | |
623 double v78; // ST10_8@74 | |
624 void *v79; // edi@78 | |
625 int v80; // ebx@81 | |
626 char *v81; // ecx@82 | |
627 signed int v82; // esi@82 | |
628 float v83; // ST78_4@83 | |
629 double v84; // ST5C_8@83 | |
630 float v85; // eax@84 | |
631 double v86; // ST20_8@85 | |
632 double v87; // ST54_8@88 | |
633 float v88; // eax@89 | |
634 double v89; // ST44_8@90 | |
635 unsigned __int8 v90; // sf@94 | |
636 unsigned __int8 v91; // of@94 | |
637 int v92; // edx@97 | |
638 int v93; // esi@97 | |
639 int v94; // edi@97 | |
640 int v95; // eax@97 | |
641 int v96; // eax@104 | |
642 double v97; // [sp+4Ch] [bp-8Ch]@32 | |
643 double v98; // [sp+54h] [bp-84h]@49 | |
644 double v99; // [sp+54h] [bp-84h]@66 | |
645 float v100; // [sp+5Ch] [bp-7Ch]@1 | |
646 float v101; // [sp+60h] [bp-78h]@1 | |
647 float v102; // [sp+64h] [bp-74h]@1 | |
648 double v103; // [sp+6Ch] [bp-6Ch]@14 | |
649 float v104; // [sp+A8h] [bp-30h]@1 | |
650 signed int v105; // [sp+A8h] [bp-30h]@96 | |
651 bool v106; // [sp+ACh] [bp-2Ch]@14 | |
652 bool v107; // [sp+ACh] [bp-2Ch]@32 | |
653 bool v108; // [sp+ACh] [bp-2Ch]@49 | |
654 bool v109; // [sp+ACh] [bp-2Ch]@66 | |
655 signed int v110; // [sp+B0h] [bp-28h]@12 | |
656 char *v111; // [sp+B8h] [bp-20h]@30 | |
657 signed int v112; // [sp+B8h] [bp-20h]@48 | |
658 signed int v113; // [sp+B8h] [bp-20h]@65 | |
659 char *v114; // [sp+BCh] [bp-1Ch]@13 | |
660 signed int v115; // [sp+BCh] [bp-1Ch]@29 | |
661 signed int v116; // [sp+BCh] [bp-1Ch]@64 | |
662 signed int v117; // [sp+C0h] [bp-18h]@1 | |
663 char *v118; // [sp+C0h] [bp-18h]@30 | |
664 char *v119; // [sp+C0h] [bp-18h]@48 | |
665 char *v120; // [sp+C0h] [bp-18h]@65 | |
666 char *v121; // [sp+C4h] [bp-14h]@13 | |
667 char *v122; // [sp+C4h] [bp-14h]@30 | |
668 signed int v123; // [sp+C4h] [bp-14h]@47 | |
669 char *v124; // [sp+C8h] [bp-10h]@30 | |
670 char *v125; // [sp+C8h] [bp-10h]@48 | |
671 char *v126; // [sp+C8h] [bp-10h]@65 | |
672 signed int v127; // [sp+CCh] [bp-Ch]@2 | |
673 char *v128; // [sp+CCh] [bp-Ch]@13 | |
674 char *v129; // [sp+CCh] [bp-Ch]@30 | |
675 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48 | |
676 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65 | |
677 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13 | |
678 char *v133; // [sp+D0h] [bp-8h]@30 | |
679 char *v134; // [sp+D0h] [bp-8h]@48 | |
680 char *v135; // [sp+D0h] [bp-8h]@65 | |
681 signed int v136; // [sp+D4h] [bp-4h]@1 | |
682 char *v137; // [sp+D4h] [bp-4h]@13 | |
683 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30 | |
684 char *v139; // [sp+D4h] [bp-4h]@48 | |
685 char *v140; // [sp+D4h] [bp-4h]@65 | |
686 | |
687 v101 = (double)(signed int)pViewport->uViewportX; | |
688 v100 = (double)(signed int)pViewport->uViewportZ; | |
689 v117 = a1; | |
690 v136 = 1; | |
691 v104 = (double)(signed int)pViewport->uViewportY; | |
692 v102 = (double)(pViewport->uViewportW + 1); | |
693 if ( a1 <= 0 ) | |
694 return v117; | |
695 v127 = a1; | |
696 v1 = a1; | |
697 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2)); | |
698 v2 = 0; | |
699 do | |
700 { | |
701 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 ) | |
702 v136 = 0; | |
703 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 ) | |
704 v136 = 0; | |
705 ++v2; | |
706 --v127; | |
707 } | |
708 while ( v127 ); | |
709 if ( v136 ) | |
710 return v117; | |
711 v110 = 0; | |
712 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1])); | |
713 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15; | |
714 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportX; | |
715 if ( v117 < 1 ) | |
716 goto LABEL_112; | |
717 v6 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
718 v132 = array_50A2B0; | |
719 v137 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
720 v128 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
721 v121 = (char *)&array_50A2B0[0].flt_2C; | |
168 | 722 v114 = (char *)&array_50A2B0[0]._rhw; |
0 | 723 v7 = (char *)&array_50AC10[0].flt_2C; |
724 do | |
725 { | |
726 v103 = *((float *)v7 + 7) + 6.7553994e15; | |
727 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportX; | |
728 if ( !(v5 ^ v106) ) | |
729 goto LABEL_25; | |
730 v8 = v101; | |
731 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportX ) | |
732 { | |
733 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5)); | |
734 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4); | |
735 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3); | |
736 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7; | |
737 } | |
738 else | |
739 { | |
740 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7)); | |
741 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8); | |
742 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9); | |
743 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12); | |
744 } | |
745 *(float *)v121 = v10; | |
746 *(int *)v137 = LODWORD(v101); | |
747 LODWORD(v12) = *(int *)v6; | |
748 if ( v5 ) | |
749 { | |
750 v13 = v12 + 6.7553994e15; | |
751 v14 = *((float *)v7 - 4) + 6.7553994e15; | |
752 if ( LODWORD(v13) == LODWORD(v14) ) | |
753 { | |
754 v15 = *(float *)v137 + 6.7553994e15; | |
755 v16 = *((float *)v7 - 5) + 6.7553994e15; | |
756 v17 = LODWORD(v15) == LODWORD(v16); | |
757 goto LABEL_23; | |
758 } | |
759 } | |
760 else | |
761 { | |
762 v18 = v12 + 6.7553994e15; | |
763 v19 = *((float *)v7 + 8) + 6.7553994e15; | |
764 if ( LODWORD(v18) == LODWORD(v19) ) | |
765 { | |
766 v20 = *(float *)v137 + 6.7553994e15; | |
767 v21 = *((float *)v7 + 7) + 6.7553994e15; | |
768 v17 = LODWORD(v20) == LODWORD(v21); | |
769 LABEL_23: | |
770 if ( v17 ) | |
771 goto LABEL_25; | |
772 goto LABEL_24; | |
773 } | |
774 } | |
775 LABEL_24: | |
776 v121 += 48; | |
777 v114 += 48; | |
778 v6 += 48; | |
779 ++v110; | |
780 ++v132; | |
781 v128 = v6; | |
782 v137 += 48; | |
783 LABEL_25: | |
784 if ( v106 ) | |
785 { | |
786 v22 = v132; | |
787 v128 += 48; | |
788 ++v110; | |
789 v114 += 48; | |
790 v121 += 48; | |
791 v137 += 48; | |
792 ++v132; | |
793 memcpy(v22, v7 + 4, 0x30u); | |
794 v6 = v128; | |
795 } | |
796 v5 = v106; | |
797 v7 += 48; | |
798 --v117; | |
799 } | |
800 while ( v117 ); | |
801 if ( v110 < 3 | |
802 || (v115 = 0, | |
803 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])), | |
804 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15, | |
805 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportZ, | |
806 v110 < 1) ) | |
807 goto LABEL_112; | |
168 | 808 v25 = (char *)&array_509950[0]._rhw; |
0 | 809 v138 = array_509950; |
810 v129 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
811 v118 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
812 v133 = (char *)&array_509950[0].vWorldViewProjX; | |
813 v122 = (char *)&array_509950[0].vWorldViewProjY; | |
814 v124 = (char *)&array_509950[0].flt_2C; | |
168 | 815 v111 = (char *)&array_509950[0]._rhw; |
0 | 816 v26 = (char *)&array_50A2B0[0].flt_2C; |
817 while ( 2 ) | |
818 { | |
819 v97 = *((float *)v26 + 7) + 6.7553994e15; | |
820 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
821 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
822 if ( v24 != v27 ) | |
823 { | |
824 v28 = v100; | |
825 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportZ ) | |
826 { | |
827 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5)); | |
828 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4); | |
829 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3); | |
830 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26; | |
831 } | |
832 else | |
833 { | |
834 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7)); | |
835 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8); | |
836 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9); | |
837 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12); | |
838 } | |
839 *(float *)v124 = v30; | |
840 *(int *)v133 = LODWORD(v100); | |
841 if ( v24 ) | |
842 { | |
843 v32 = *(float *)v122 + 6.7553994e15; | |
844 v33 = *((float *)v26 - 4) + 6.7553994e15; | |
845 if ( LODWORD(v32) == LODWORD(v33) ) | |
846 { | |
847 v34 = *(float *)v133 + 6.7553994e15; | |
848 v35 = *((float *)v26 - 5) + 6.7553994e15; | |
849 v36 = LODWORD(v34) == LODWORD(v35); | |
850 goto LABEL_41; | |
851 } | |
852 goto LABEL_42; | |
853 } | |
854 v37 = *(float *)v118 + 6.7553994e15; | |
855 v38 = *((float *)v26 + 8) + 6.7553994e15; | |
856 if ( LODWORD(v37) != LODWORD(v38) ) | |
857 goto LABEL_42; | |
858 v39 = *(float *)v129 + 6.7553994e15; | |
859 v40 = *((float *)v26 + 7) + 6.7553994e15; | |
860 v36 = LODWORD(v39) == LODWORD(v40); | |
861 LABEL_41: | |
862 if ( !v36 ) | |
863 { | |
864 LABEL_42: | |
865 v129 += 48; | |
866 v118 += 48; | |
867 v133 += 48; | |
868 v122 += 48; | |
869 v124 += 48; | |
870 v111 += 48; | |
871 ++v115; | |
872 ++v138; | |
873 } | |
874 } | |
875 if ( v27 ) | |
876 { | |
877 v41 = v138; | |
878 ++v115; | |
879 v111 += 48; | |
880 v124 += 48; | |
881 v122 += 48; | |
882 v133 += 48; | |
883 v118 += 48; | |
884 v129 += 48; | |
885 ++v138; | |
886 memcpy(v41, v26 + 4, 0x30u); | |
887 } | |
888 v24 = v107; | |
889 v26 += 48; | |
890 --v110; | |
891 if ( v110 ) | |
892 { | |
893 v25 = v111; | |
894 continue; | |
895 } | |
896 break; | |
897 } | |
898 if ( v115 < 3 | |
899 || (v123 = 0, | |
900 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])), | |
901 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15, | |
902 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportY, | |
903 v115 < 1) ) | |
904 goto LABEL_112; | |
905 v44 = (char *)&array_508FF0[0].vWorldViewProjX; | |
906 v130 = array_508FF0; | |
907 v119 = (char *)&array_508FF0[0].vWorldViewProjX; | |
908 v139 = (char *)&array_508FF0[0].vWorldViewProjY; | |
909 v125 = (char *)&array_508FF0[0].flt_2C; | |
168 | 910 v134 = (char *)&array_508FF0[0]._rhw; |
0 | 911 v45 = (char *)&array_509950[0].flt_2C; |
912 v112 = v115; | |
913 while ( 2 ) | |
914 { | |
915 v98 = *((float *)v45 + 8) + 6.7553994e15; | |
916 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
917 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
918 if ( v43 != v46 ) | |
919 { | |
920 v47 = v104; | |
921 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportY ) | |
922 { | |
923 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4)); | |
924 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5); | |
925 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3); | |
926 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45; | |
927 } | |
928 else | |
929 { | |
930 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8)); | |
931 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7); | |
932 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9); | |
933 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12); | |
934 } | |
935 *(float *)v125 = v49; | |
936 *(float *)v139 = v104; | |
937 if ( v43 ) | |
938 { | |
939 v51 = v104 + 6.7553994e15; | |
940 v52 = *((float *)v45 - 4) + 6.7553994e15; | |
941 if ( LODWORD(v51) == LODWORD(v52) ) | |
942 { | |
943 v53 = *(float *)v44 + 6.7553994e15; | |
944 v54 = *((float *)v45 - 5) + 6.7553994e15; | |
945 v55 = LODWORD(v53) == LODWORD(v54); | |
946 goto LABEL_58; | |
947 } | |
948 goto LABEL_59; | |
949 } | |
950 v56 = v104 + 6.7553994e15; | |
951 v57 = *((float *)v45 + 8) + 6.7553994e15; | |
952 if ( LODWORD(v56) != LODWORD(v57) ) | |
953 goto LABEL_59; | |
954 v58 = *(float *)v44 + 6.7553994e15; | |
955 v59 = *((float *)v45 + 7) + 6.7553994e15; | |
956 v55 = LODWORD(v58) == LODWORD(v59); | |
957 LABEL_58: | |
958 if ( !v55 ) | |
959 { | |
960 LABEL_59: | |
961 v139 += 48; | |
962 v125 += 48; | |
963 v134 += 48; | |
964 v44 += 48; | |
965 ++v123; | |
966 ++v130; | |
967 v119 = v44; | |
968 } | |
969 } | |
970 if ( v46 ) | |
971 { | |
972 v60 = v130; | |
973 v119 += 48; | |
974 ++v123; | |
975 v134 += 48; | |
976 v125 += 48; | |
977 v139 += 48; | |
978 ++v130; | |
979 memcpy(v60, v45 + 4, 0x30u); | |
980 v44 = v119; | |
981 } | |
982 v43 = v108; | |
983 v45 += 48; | |
984 --v112; | |
985 if ( v112 ) | |
986 continue; | |
987 break; | |
988 } | |
989 if ( v123 < 3 | |
990 || (v116 = 0, | |
991 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])), | |
992 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15, | |
993 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportW, | |
994 v123 < 1) ) | |
995 goto LABEL_112; | |
996 v63 = (char *)&array_508690[0].vWorldViewProjX; | |
997 v131 = array_508690; | |
998 v120 = (char *)&array_508690[0].vWorldViewProjX; | |
999 v140 = (char *)&array_508690[0].vWorldViewProjY; | |
1000 v126 = (char *)&array_508690[0].flt_2C; | |
168 | 1001 v135 = (char *)&array_508690[0]._rhw; |
0 | 1002 v64 = (char *)&array_508FF0[0].flt_2C; |
1003 v113 = v123; | |
1004 while ( 2 ) | |
1005 { | |
1006 v99 = *((float *)v64 + 8) + 6.7553994e15; | |
1007 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1008 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1009 if ( v62 != v65 ) | |
1010 { | |
1011 v66 = v102; | |
1012 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportW ) | |
1013 { | |
1014 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4)); | |
1015 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5); | |
1016 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3); | |
1017 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64; | |
1018 } | |
1019 else | |
1020 { | |
1021 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8)); | |
1022 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7); | |
1023 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9); | |
1024 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12); | |
1025 } | |
1026 *(float *)v126 = v68; | |
1027 *(float *)v140 = v102; | |
1028 if ( v62 ) | |
1029 { | |
1030 v70 = v102 + 6.7553994e15; | |
1031 v71 = *((float *)v64 - 4) + 6.7553994e15; | |
1032 if ( LODWORD(v70) == LODWORD(v71) ) | |
1033 { | |
1034 v72 = *(float *)v63 + 6.7553994e15; | |
1035 v73 = *((float *)v64 - 5) + 6.7553994e15; | |
1036 v74 = LODWORD(v72) == LODWORD(v73); | |
1037 goto LABEL_75; | |
1038 } | |
1039 goto LABEL_76; | |
1040 } | |
1041 v75 = v102 + 6.7553994e15; | |
1042 v76 = *((float *)v64 + 8) + 6.7553994e15; | |
1043 if ( LODWORD(v75) != LODWORD(v76) ) | |
1044 goto LABEL_76; | |
1045 v77 = *(float *)v63 + 6.7553994e15; | |
1046 v78 = *((float *)v64 + 7) + 6.7553994e15; | |
1047 v74 = LODWORD(v77) == LODWORD(v78); | |
1048 LABEL_75: | |
1049 if ( !v74 ) | |
1050 { | |
1051 LABEL_76: | |
1052 v140 += 48; | |
1053 v126 += 48; | |
1054 v135 += 48; | |
1055 v63 += 48; | |
1056 ++v116; | |
1057 ++v131; | |
1058 v120 = v63; | |
1059 } | |
1060 } | |
1061 if ( v65 ) | |
1062 { | |
1063 v79 = v131; | |
1064 v120 += 48; | |
1065 ++v116; | |
1066 v135 += 48; | |
1067 v126 += 48; | |
1068 v140 += 48; | |
1069 ++v131; | |
1070 memcpy(v79, v64 + 4, 0x30u); | |
1071 v63 = v120; | |
1072 } | |
1073 v62 = v109; | |
1074 v64 += 48; | |
1075 --v113; | |
1076 if ( v113 ) | |
1077 continue; | |
1078 break; | |
1079 } | |
1080 if ( v116 < 3 ) | |
1081 goto LABEL_112; | |
1082 v80 = v116; | |
1083 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116])); | |
1084 if ( v116 > 0 ) | |
1085 { | |
1086 v81 = (char *)&array_508690[0].vWorldViewProjX; | |
1087 v82 = v116; | |
1088 do | |
1089 { | |
1090 LODWORD(v83) = *(int *)v81; | |
1091 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2); | |
1092 v84 = v83 + 6.7553994e15; | |
1093 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportZ ) | |
1094 { | |
1095 v86 = *(float *)v81 + 6.7553994e15; | |
1096 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportX ) | |
1097 goto LABEL_88; | |
1098 v85 = v101; | |
1099 } | |
1100 else | |
1101 { | |
1102 v85 = v100; | |
1103 } | |
1104 *(int *)v81 = LODWORD(v85); | |
1105 LABEL_88: | |
1106 v87 = *((float *)v81 + 1) + 6.7553994e15; | |
1107 if ( SLODWORD(v87) > (signed int)pViewport->uViewportW ) | |
1108 { | |
1109 v88 = v102; | |
1110 LABEL_92: | |
1111 *((int *)v81 + 1) = LODWORD(v88); | |
1112 goto LABEL_93; | |
1113 } | |
1114 v89 = *((float *)v81 + 1) + 6.7553994e15; | |
1115 if ( SLODWORD(v89) < (signed int)pViewport->uViewportY ) | |
1116 { | |
1117 v88 = v104; | |
1118 goto LABEL_92; | |
1119 } | |
1120 LABEL_93: | |
1121 v81 += 48; | |
1122 --v82; | |
1123 } | |
1124 while ( v82 ); | |
1125 } | |
1126 v91 = __OFSUB__(v116, 3); | |
1127 v90 = v116 - 3 < 0; | |
1128 if ( v116 > 3 ) | |
1129 { | |
1130 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1])); | |
1131 if ( v116 > 0 ) | |
1132 { | |
1133 v105 = 1; | |
1134 do | |
1135 { | |
1136 v92 = v105; | |
1137 v93 = v105 - 1; | |
1138 v94 = v105 + 1; | |
1139 v95 = v105 + 1; | |
1140 if ( v105 - 1 >= v80 ) | |
1141 v93 -= v80; | |
1142 if ( v105 >= v80 ) | |
1143 v92 = v105 - v80; | |
1144 if ( v94 >= v80 ) | |
1145 v95 = v94 - v80; | |
1146 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1147 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY) | |
1148 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1149 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 ) | |
1150 { | |
1151 ++v105; | |
1152 } | |
1153 else | |
1154 { | |
1155 v96 = v105; | |
1156 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) ) | |
1157 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2)); | |
1158 --v80; | |
1159 } | |
1160 } | |
1161 while ( v105 - 1 < v80 ); | |
1162 } | |
1163 v91 = __OFSUB__(v80, 3); | |
1164 v90 = v80 - 3 < 0; | |
1165 } | |
1166 if ( v90 ^ v91 ) | |
1167 LABEL_112: | |
1168 result = 0; | |
1169 else | |
1170 result = v80; | |
1171 return result; | |
1172 } | |
1173 | |
1174 //----- (0042620A) -------------------------------------------------------- | |
1175 bool __thiscall sr_42620A(RenderVertexSoft *p) | |
1176 { | |
1177 __int16 v1; // fps@1 | |
1178 unsigned __int8 v2; // c0@2 | |
1179 char v3; // c2@2 | |
1180 unsigned __int8 v4; // c3@2 | |
1181 bool result; // eax@2 | |
1182 unsigned __int8 v6; // c0@4 | |
1183 char v7; // c2@4 | |
1184 unsigned __int8 v8; // c3@4 | |
1185 unsigned __int8 v9; // c0@6 | |
1186 char v10; // c2@6 | |
1187 unsigned __int8 v11; // c3@6 | |
1188 double v12; // st6@7 | |
1189 float v13; // ST04_4@7 | |
1190 float v14; // ST00_4@7 | |
1191 double v15; // st7@7 | |
1192 double v16; // st6@8 | |
1193 float v17; // ST04_4@8 | |
1194 float v18; // ST00_4@8 | |
1195 double v19; // st7@8 | |
1196 | |
1197 //UNDEF(v1); | |
1198 if ( p->vWorldViewPosition.x < 300.0 | |
1199 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
1200 v3 = 0, | |
1201 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
1202 BYTE1(result) = HIBYTE(v1), | |
1203 !(v2 | v4)) ) | |
1204 { | |
1205 if ( p->vWorldViewPosition.x < 300.0 ) | |
1206 { | |
1207 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
1208 v7 = 0; | |
1209 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
1210 BYTE1(result) = HIBYTE(v1); | |
1211 if ( !(v6 | v8) ) | |
1212 { | |
1213 LOBYTE(result) = 0; | |
1214 return result; | |
1215 } | |
1216 } | |
1217 v9 = 300.0 < p->vWorldViewPosition.x; | |
1218 v10 = 0; | |
1219 v11 = 300.0 == p->vWorldViewPosition.x; | |
1220 BYTE1(result) = HIBYTE(v1); | |
1221 if ( v9 | v11 ) | |
1222 { | |
1223 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
1224 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
1225 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
1226 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
1227 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
1228 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
1229 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
1230 } | |
1231 else | |
1232 { | |
1233 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
1234 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
1235 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
1236 v15 = 300.0 - p->vWorldViewPosition.x; | |
1237 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
1238 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
1239 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
1240 } | |
1241 } | |
1242 LOBYTE(result) = 1; | |
1243 return result; | |
1244 } | |
1245 | |
1246 | |
1247 | |
1248 | |
1249 //----- (004268E3) -------------------------------------------------------- | |
1250 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) | |
1251 { | |
1252 unsigned int v1; // eax@1 | |
1253 unsigned int v2; // edx@1 | |
1254 int v3; // eax@1 | |
1255 int v4; // edx@1 | |
1256 unsigned int v5; // ecx@1 | |
1257 | |
1258 v1 = uColor >> 9; | |
1259 v2 = uColor >> 6; | |
1260 LOWORD(v1) = (uColor >> 9) & 0x7C00; | |
1261 LOWORD(v2) = (uColor >> 6) & 0x3E0; | |
1262 v3 = v2 | v1; | |
1263 v4 = (unsigned __int8)uColor >> 3; | |
1264 v5 = uColor >> 16; | |
1265 LOWORD(v5) = v5 & 0x8000; | |
1266 return v5 | v4 | v3; | |
1267 } | |
1268 | |
1269 //----- (0042690D) -------------------------------------------------------- | |
1270 int __fastcall _42690D_colors_cvt(unsigned int a1) | |
1271 { | |
1272 unsigned int v1; // eax@1 | |
1273 unsigned int v2; // edx@1 | |
1274 | |
1275 v1 = a1 >> 8; | |
1276 v2 = a1 >> 5; | |
1277 LOWORD(v1) = (a1 >> 8) & 0xF800; | |
1278 LOWORD(v2) = (a1 >> 5) & 0x7E0; | |
1279 return ((unsigned __int8)a1 >> 3) | v2 | v1; | |
1280 } | |
1281 | |
1282 //----- (00426947) -------------------------------------------------------- | |
1283 void __cdecl sub_426947() | |
1284 { | |
1285 dword_50C968 = 0; | |
1286 dword_50C994 = 0; | |
1287 dword_50C998_turnbased_icon_1A = 0; | |
1288 } | |
1289 // 50C968: using guessed type int dword_50C968; | |
1290 // 50C994: using guessed type int dword_50C994; | |
1291 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A; | |
1292 | |
1293 | |
1294 | |
1295 //----- (004269A2) -------------------------------------------------------- | |
1296 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1) | |
1297 { | |
89 | 1298 //unsigned __int64 v1; // qax@1 |
1299 Player *v1; | |
1300 int v1b; | |
0 | 1301 signed int v2; // ecx@1 |
82 | 1302 int *v3; // esi@1 |
0 | 1303 bool v4; // edi@6 |
82 | 1304 int *v5; // edi@10 |
1305 Player *v6; // esi@10 | |
0 | 1306 int v7; // eax@13 |
1307 unsigned __int8 v8; // cf@13 | |
89 | 1308 int v10[4]; // [sp+Ch] [bp-14h]@1 |
0 | 1309 int v11; // [sp+1Ch] [bp-4h]@10 |
1310 | |
89 | 1311 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1); |
1312 v1 = pParty->pPlayers; | |
1313 v1b = a1; | |
0 | 1314 v2 = 0; |
89 | 1315 v3 = v10; |
0 | 1316 do |
1317 { | |
89 | 1318 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8)) |
0 | 1319 && !*(int *)HIDWORD(v1) |
1320 && !*(_QWORD *)(HIDWORD(v1) + 8) | |
89 | 1321 && !*(_QWORD *)(HIDWORD(v1) + 16);*/ |
1322 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13])) | |
1323 && !v1->pConditions[14] | |
1324 && !v1->pConditions[15] | |
1325 && !v1->pConditions[16]; | |
82 | 1326 *v3 = v4; |
89 | 1327 //HIDWORD(v1) += 6972; |
1328 ++v1; | |
0 | 1329 v2 += v4; |
82 | 1330 ++v3; |
0 | 1331 } |
89 | 1332 while ( v1 <= &pParty->pPlayers[3] ); |
0 | 1333 if ( v2 ) |
1334 { | |
89 | 1335 v1b = v1b / v2; |
1336 v5 = v10; | |
82 | 1337 v6 = pParty->pPlayers;//[0].uExperience; |
89 | 1338 v11 = v1b; |
0 | 1339 do |
1340 { | |
82 | 1341 if ( *v5 ) |
0 | 1342 { |
1343 if ( v11 ) | |
1344 { | |
82 | 1345 LOBYTE(v7) = v6->GetLearningPercent(); |
89 | 1346 v1b = v11 + v11 * v7 / 100; |
1347 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience)); | |
1348 //need review | |
1349 LODWORD(v6->uExperience) += v1b; | |
1350 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8; | |
82 | 1351 if ( v6->uExperience > 4000000000i64 ) |
0 | 1352 { |
82 | 1353 HIDWORD(v6->uExperience) = 0; |
1354 LODWORD(v6->uExperience) = -294967296; | |
0 | 1355 } |
1356 } | |
1357 } | |
82 | 1358 ++v6; |
1359 ++v5; | |
0 | 1360 } |
82 | 1361 while ( v6 <= &pParty->pPlayers[3] ); |
0 | 1362 } |
89 | 1363 return v1b; |
0 | 1364 } |
1365 | |
1366 //----- (00426A5A) -------------------------------------------------------- | |
1367 void stru319::LootActor(Actor *pActor) | |
1368 { | |
1369 signed int v2; // edi@1 | |
1370 char v3; // zf@1 | |
1371 unsigned int v4; // eax@13 | |
1372 unsigned int v5; // esi@13 | |
1373 int v6; // eax@14 | |
1374 unsigned __int8 v7; // al@30 | |
1375 Party *v8; // esi@34 | |
1376 char *v9; // [sp-4h] [bp-3Ch]@10 | |
1377 char *v10; // [sp-4h] [bp-3Ch]@31 | |
1378 char *v11; // [sp-4h] [bp-3Ch]@38 | |
1379 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 | |
1380 int v13; // [sp+30h] [bp-8h]@1 | |
1381 int v14; // [sp+34h] [bp-4h]@1 | |
1382 | |
1383 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1384 Dst.Reset(); | |
1385 v2 = 0; | |
1386 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; | |
1387 v13 = 0; | |
1388 v14 = 0; | |
1389 if ( v3 ) | |
1390 { | |
1391 if ( !pActor->pMonsterInfo.uTreasureDiceRolls ) | |
1392 goto LABEL_9; | |
1393 do | |
1394 { | |
1395 ++v2; | |
1396 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | |
1397 } | |
1398 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); | |
1399 } | |
1400 else | |
1401 { | |
1402 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 ) | |
1403 goto LABEL_9; | |
1404 v14 = pActor->array_000234[3].uAdditionalValue; | |
1405 pActor->array_000234[3].Reset(); | |
1406 } | |
1407 if ( v14 ) | |
1408 { | |
1409 party_finds_gold(v14, 0); | |
1410 viewparams->bRedrawGameUI = 1; | |
1411 } | |
1412 LABEL_9: | |
1413 if ( pActor->uCarriedItemID ) | |
1414 { | |
1415 Dst.Reset(); | |
1416 Dst.uItemID = pActor->uCarriedItemID; | |
1417 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1418 if ( v14 ) | |
189 | 1419 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9); |
0 | 1420 else |
189 | 1421 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9); |
0 | 1422 ShowStatusBarString(pTmpBuf2, 2u); |
1423 v4 = Dst.uItemID; | |
1424 v5 = Dst.uItemID; | |
1425 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) | |
1426 { | |
1427 v5 = Dst.uItemID; | |
1428 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1; | |
1429 Dst.uNumCharges = v6; | |
1430 Dst.uMaxCharges = v6; | |
1431 v4 = Dst.uItemID; | |
1432 } | |
1433 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) | |
1434 Dst._bonus_type = 2 * rand() % 4 + 2; | |
1435 pItemsTable->SetSpecialBonus(&Dst); | |
1436 if ( !pParty->AddItem(&Dst) ) | |
1437 pParty->SetHoldingItem(&Dst); | |
1438 pActor->uCarriedItemID = 0; | |
1439 if ( pActor->array_000234[0].uItemID ) | |
1440 { | |
1441 if ( !pParty->AddItem(pActor->array_000234) ) | |
1442 { | |
1443 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1444 pParty->SetHoldingItem(pActor->array_000234); | |
1445 } | |
1446 pActor->array_000234[0].Reset(); | |
1447 } | |
1448 if ( pActor->array_000234[1].uItemID ) | |
1449 { | |
1450 if ( !pParty->AddItem(&pActor->array_000234[1]) ) | |
1451 { | |
1452 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1453 pParty->SetHoldingItem(&pActor->array_000234[1]); | |
1454 } | |
1455 pActor->array_000234[1].Reset(); | |
1456 } | |
1457 LABEL_55: | |
1458 pActor->Remove(); | |
1459 return; | |
1460 } | |
1461 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) | |
1462 { | |
1463 if ( pActor->array_000234[3].uItemID ) | |
1464 { | |
1465 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); | |
1466 pActor->array_000234[3].Reset(); | |
1467 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1468 if ( v14 ) | |
1469 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); | |
1470 else | |
1471 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); | |
1472 ShowStatusBarString(pTmpBuf2, 2u); | |
1473 if ( !pParty->AddItem(&Dst) ) | |
1474 pParty->SetHoldingItem(&Dst); | |
1475 v13 = 1; | |
1476 } | |
1477 goto LABEL_44; | |
1478 } | |
1479 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | |
1480 { | |
1481 LABEL_44: | |
1482 v8 = pParty; | |
1483 goto LABEL_45; | |
1484 } | |
1485 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | |
1486 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1487 if ( v14 ) | |
1488 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); | |
1489 else | |
1490 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); | |
1491 ShowStatusBarString(pTmpBuf2, 2u); | |
1492 v8 = pParty; | |
1493 if ( !pParty->AddItem(&Dst) ) | |
1494 pParty->SetHoldingItem(&Dst); | |
1495 v13 = 1; | |
1496 LABEL_45: | |
1497 if ( pActor->array_000234[0].uItemID ) | |
1498 { | |
1499 if ( !v8->AddItem(pActor->array_000234) ) | |
1500 { | |
1501 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1502 v8->SetHoldingItem(pActor->array_000234); | |
1503 v13 = 1; | |
1504 } | |
1505 pActor->array_000234[0].Reset(); | |
1506 } | |
1507 if ( pActor->array_000234[1].uItemID ) | |
1508 { | |
1509 if ( !v8->AddItem(&pActor->array_000234[1]) ) | |
1510 { | |
1511 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1512 v8->SetHoldingItem(&pActor->array_000234[1]); | |
1513 v13 = 1; | |
1514 } | |
1515 pActor->array_000234[1].Reset(); | |
1516 } | |
1517 if ( !v13 || rand() % 100 < 90 ) | |
1518 goto LABEL_55; | |
1519 } | |
1520 | |
1521 //----- (00426E10) -------------------------------------------------------- | |
1522 int stru319::which_player_would_attack(Actor *pActor) | |
1523 { | |
1524 signed int v2; // ebx@1 | |
1525 int v3; // ecx@2 | |
1526 signed int v4; // edx@3 | |
1527 char v5; // zf@3 | |
1528 unsigned int v6; // eax@3 | |
1529 int v7; // eax@6 | |
1530 int v8; // eax@7 | |
1531 int v9; // eax@8 | |
1532 int v10; // eax@9 | |
1533 int v11; // eax@10 | |
1534 int v12; // eax@11 | |
1535 int v13; // esi@35 | |
1536 signed int v14; // edi@37 | |
1537 enum CHARACTER_RACE v15; // eax@44 | |
1538 Player *v16; // ecx@47 | |
1539 unsigned __int8 v17; // sf@50 | |
1540 unsigned __int8 v18; // of@50 | |
1541 int v19; // esi@52 | |
1542 Player *v20; // ecx@53 | |
1543 int result; // eax@57 | |
1544 int v22[16]; // [sp+8h] [bp-140h]@3 | |
1545 int v23[60]; // [sp+48h] [bp-100h]@48 | |
1546 int v24; // [sp+138h] [bp-10h]@2 | |
1547 int v25; // [sp+13Ch] [bp-Ch]@1 | |
1548 int v26; // [sp+140h] [bp-8h]@1 | |
1549 int v27; // [sp+144h] [bp-4h]@1 | |
1550 | |
1551 v27 = -1; | |
1552 v26 = -1; | |
1553 v25 = -1; | |
1554 v2 = 0; | |
1555 if ( pActor->pMonsterInfo.uAttackPreference ) | |
1556 { | |
1557 v3 = 0; | |
1558 v24 = 0; | |
1559 do | |
1560 { | |
1561 v4 = 1; | |
1562 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); | |
1563 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; | |
1564 v22[v3] = v6; | |
1565 if ( !v5 ) | |
1566 { | |
1567 if ( (signed int)v6 > 128 ) | |
1568 { | |
1569 switch ( v6 ) | |
1570 { | |
1571 case 0x100u: | |
1572 v27 = 8; | |
1573 break; | |
1574 case 0x200u: | |
1575 v25 = 0; | |
1576 break; | |
1577 case 0x400u: | |
1578 v25 = 1; | |
1579 break; | |
1580 case 0x800u: | |
1581 v26 = 0; | |
1582 break; | |
1583 case 0x1000u: | |
1584 v26 = 1; | |
1585 break; | |
1586 case 0x2000u: | |
1587 v26 = 3; | |
1588 break; | |
1589 case 0x4000u: | |
1590 v26 = 2; | |
1591 break; | |
1592 } | |
1593 } | |
1594 else | |
1595 { | |
1596 if ( v6 == 128 ) | |
1597 { | |
1598 v27 = 4; | |
1599 } | |
1600 else | |
1601 { | |
1602 v7 = v6 - 1; | |
1603 if ( v7 ) | |
1604 { | |
1605 v8 = v7 - 1; | |
1606 if ( v8 ) | |
1607 { | |
1608 v9 = v8 - 2; | |
1609 if ( v9 ) | |
1610 { | |
1611 v10 = v9 - 4; | |
1612 if ( v10 ) | |
1613 { | |
1614 v11 = v10 - 8; | |
1615 if ( v11 ) | |
1616 { | |
1617 v12 = v11 - 16; | |
1618 if ( v12 ) | |
1619 { | |
1620 if ( v12 == 32 ) | |
1621 v27 = 20; | |
1622 } | |
1623 else | |
1624 { | |
1625 v27 = 32; | |
1626 } | |
1627 } | |
1628 else | |
1629 { | |
1630 v27 = 24; | |
1631 } | |
1632 } | |
1633 else | |
1634 { | |
1635 v27 = 28; | |
1636 } | |
1637 } | |
1638 else | |
1639 { | |
1640 v27 = 16; | |
1641 } | |
1642 } | |
1643 else | |
1644 { | |
1645 v27 = 12; | |
1646 } | |
1647 } | |
1648 else | |
1649 { | |
1650 v27 = 0; | |
1651 } | |
1652 } | |
1653 } | |
1654 v2 = 0; | |
1655 v13 = 0; | |
1656 while ( 1 ) | |
1657 { | |
1658 v14 = 0; | |
135 | 1659 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType ) |
0 | 1660 v14 = v4; |
1661 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) | |
1662 v14 = v4; | |
1663 if ( v26 != -1 ) | |
1664 { | |
1665 v15 = pPlayers[v13 + 1]->GetRace(); | |
1666 if ( v26 == v15 ) | |
1667 v14 = 1; | |
1668 } | |
1669 if ( v14 == 1 ) | |
1670 { | |
1671 v16 = pPlayers[v13 + 1]; | |
1672 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) | |
1673 v23[v2++] = v13; | |
1674 } | |
1675 ++v13; | |
1676 if ( v13 >= 4 ) | |
1677 break; | |
1678 v4 = 1; | |
1679 } | |
1680 } | |
1681 v3 = v24 + 1; | |
1682 v18 = __OFSUB__(v24 + 1, 15); | |
1683 v17 = v24++ - 14 < 0; | |
1684 } | |
1685 while ( v17 ^ v18 ); | |
1686 if ( v2 ) | |
1687 goto LABEL_61; | |
1688 } | |
1689 v19 = 0; | |
1690 do | |
1691 { | |
1692 v20 = pPlayers[v19 + 1]; | |
1693 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) | |
1694 v23[v2++] = v19; | |
1695 ++v19; | |
1696 } | |
1697 while ( v19 < 4 ); | |
1698 if ( v2 ) | |
1699 LABEL_61: | |
1700 result = v23[rand() % v2]; | |
1701 else | |
1702 result = 0; | |
1703 return result; | |
1704 } | |
1705 | |
1706 | |
1707 //----- (0042704B) -------------------------------------------------------- | |
1708 bool stru319::special_ability_use_check(Actor *pActor, int a2) | |
1709 { | |
1710 stru319 *v3; // edi@1 | |
1711 signed int v4; // ebx@5 | |
1712 signed int v5; // edi@5 | |
1713 | |
1714 v3 = this; | |
1715 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
1716 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
1717 && rand() % 100 < 5 ) | |
1718 pActor->_44FD29(a2); | |
1719 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); | |
1720 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); | |
1721 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
1722 return 2; | |
1723 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
1724 return 3; | |
1725 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance; | |
1726 } | |
1727 | |
1728 //----- (00427102) -------------------------------------------------------- | |
1729 int stru319::_427102(Actor *pActor, signed int a2) | |
1730 { | |
1731 unsigned __int8 v3; // cf@11 | |
1732 unsigned __int8 v4; // zf@11 | |
1733 SpellBuff *v6; // ecx@46 | |
89 | 1734 Player *v7; // esi@49 |
0 | 1735 signed int v8; // edx@50 |
89 | 1736 SpellBuff *v9; // ecx@50 |
0 | 1737 |
1738 if ( a2 > 73 ) | |
1739 { | |
1740 if ( a2 == 77 ) | |
1741 { | |
1742 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP ) | |
1743 return 0; | |
1744 return 1; | |
1745 } | |
1746 if ( a2 == 80 ) | |
1747 { | |
1748 v6 = pParty->pPartyBuffs; | |
1749 while ( (signed __int64)v6->uExpireTime <= 0 ) | |
1750 { | |
1751 ++v6; | |
89 | 1752 if ( v6 > &pParty->pPartyBuffs[19] ) |
1753 { | |
1754 v7 = pParty->pPlayers;//[0].pPlayerBuffs; | |
0 | 1755 v8 = 0; |
89 | 1756 v9 = v7->pPlayerBuffs; |
1757 while ( v9->uExpireTime <= 0i64 ) | |
0 | 1758 { |
1759 ++v8; | |
89 | 1760 ++v9; |
0 | 1761 if ( v8 >= 24 ) |
1762 { | |
89 | 1763 ++v7; |
1764 if ( v7 <= &pParty->pPlayers[3] ) | |
1765 { | |
1766 v8 = 0; | |
1767 v9 = v7->pPlayerBuffs; | |
1768 } | |
1769 else | |
1770 return 0; | |
0 | 1771 } |
1772 } | |
1773 return 1; | |
1774 } | |
1775 } | |
1776 return 1; | |
1777 } | |
1778 if ( a2 == 85 ) | |
1779 { | |
1780 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 ) | |
1781 return 1; | |
1782 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 ) | |
1783 return 0; | |
1784 v3 = 0; | |
1785 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0; | |
1786 } | |
1787 else | |
1788 { | |
1789 if ( a2 == 86 ) | |
1790 { | |
1791 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 ) | |
1792 return 1; | |
1793 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 ) | |
1794 return 0; | |
1795 v3 = 0; | |
1796 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0; | |
1797 } | |
1798 else | |
1799 { | |
1800 if ( a2 != 95 || SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 ) | |
1801 return 1; | |
1802 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 ) | |
1803 return 0; | |
1804 v3 = 0; | |
1805 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0; | |
1806 } | |
1807 } | |
1808 } | |
1809 else | |
1810 { | |
1811 if ( a2 == 73 ) | |
1812 { | |
1813 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 ) | |
1814 return 1; | |
1815 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 ) | |
1816 return 0; | |
1817 v3 = 0; | |
1818 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0; | |
1819 } | |
89 | 1820 else if ( a2 == 5 ) |
0 | 1821 { |
1822 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 ) | |
1823 return 1; | |
1824 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 ) | |
1825 return 0; | |
1826 v3 = 0; | |
1827 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0; | |
1828 } | |
89 | 1829 else if ( a2 == 17 ) |
0 | 1830 { |
1831 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 ) | |
1832 return 1; | |
1833 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 ) | |
1834 return 0; | |
1835 v3 = 0; | |
1836 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0; | |
1837 } | |
89 | 1838 else if ( a2 == 38 ) |
0 | 1839 { |
1840 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 ) | |
1841 return 1; | |
1842 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 ) | |
1843 return 0; | |
1844 v3 = 0; | |
1845 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0; | |
1846 } | |
89 | 1847 else if ( a2 == 46 ) |
0 | 1848 { |
1849 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 ) | |
1850 return 1; | |
1851 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 ) | |
1852 return 0; | |
1853 v3 = 0; | |
1854 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0; | |
1855 } | |
89 | 1856 else |
1857 { | |
1858 if ( a2 != 47 ) | |
1859 { | |
1860 if ( a2 != 51 || SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 ) | |
1861 return 1; | |
1862 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 ) | |
1863 { | |
1864 v3 = 0; | |
1865 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0; | |
1866 } | |
1867 else | |
1868 return 0; | |
1869 } | |
1870 else | |
1871 { | |
1872 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 ) | |
1873 return 1; | |
1874 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 ) | |
1875 return 0; | |
1876 v3 = 0; | |
1877 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0; | |
1878 } | |
1879 } | |
0 | 1880 } |
1881 if ( !(v3 | v4) ) | |
1882 return 0; | |
1883 return 1; | |
1884 } | |
1885 | |
1886 //----- (004272F5) -------------------------------------------------------- | |
1887 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
1888 { | |
1889 signed int v5; // esi@1 | |
1890 signed int v6; // edi@1 | |
1891 int v7; // esi@8 | |
1892 int v8; // eax@9 | |
1893 int v9; // edx@11 | |
1894 int v10; // edx@13 | |
1895 int v11; // esi@13 | |
1896 unsigned __int8 v12; // sf@13 | |
1897 unsigned __int8 v13; // of@13 | |
1898 int v14; // edx@14 | |
1899 int v15; // eax@14 | |
1900 signed int result; // eax@17 | |
1901 | |
1902 v5 = pActor->pMonsterInfo.uAC; | |
1903 v6 = 0; | |
1904 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 ) | |
1905 v5 /= 2; | |
1906 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1907 v6 = pActor->pActorBuffs[15].uPower; | |
1908 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 ) | |
1909 v6 = pActor->pActorBuffs[16].uPower; | |
1910 v7 = v6 + v5; | |
1911 if ( a3 ) | |
1912 v8 = pPlayer->GetRangedAttack(); | |
1913 else | |
1914 v8 = pPlayer->GetActualAttack(0); | |
1915 v9 = rand() % (v7 + 2 * v8 + 30); | |
1916 if ( a3 == 2 ) | |
1917 { | |
1918 v14 = a4 + v9; | |
1919 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1920 } | |
1921 else | |
1922 { | |
1923 if ( a3 != 3 ) | |
1924 { | |
1925 v10 = a4 + v9; | |
1926 v11 = v7 + 15; | |
1927 v13 = __OFSUB__(v10, v11); | |
1928 v12 = v10 - v11 < 0; | |
1929 goto LABEL_16; | |
1930 } | |
1931 v14 = a4 + v9; | |
1932 v15 = 2 * v7 + 30; | |
1933 } | |
1934 v13 = __OFSUB__(v14, v15); | |
1935 v12 = v14 - v15 < 0; | |
1936 LABEL_16: | |
1937 if ( v12 ^ v13 ) | |
1938 result = 0; | |
1939 else | |
1940 result = 1; | |
1941 return result; | |
1942 } | |
1943 | |
1944 //----- (004273BB) -------------------------------------------------------- | |
1945 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
1946 { | |
1947 Actor *v5; // ecx@1 | |
1948 signed int v6; // ebx@1 | |
1949 signed int v7; // esi@1 | |
1950 unsigned __int8 v8; // zf@1 | |
1951 unsigned __int8 v9; // sf@1 | |
1952 int v10; // ebx@10 | |
1953 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
1954 | |
1955 v5 = a2; | |
1956 v6 = a2->pMonsterInfo.uAC; | |
1957 v7 = 0; | |
1958 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0; | |
1959 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0; | |
1960 a2a = 0; | |
1961 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) ) | |
1962 v6 /= 2; | |
1963 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 ) | |
1964 v7 = v5->pActorBuffs[14].uPower; | |
1965 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 ) | |
1966 v7 = v5->pActorBuffs[16].uPower; | |
1967 v10 = v7 + v6; | |
1968 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1969 a2a = pActor->pActorBuffs[14].uPower; | |
1970 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a ) | |
1971 a2a = pActor->pActorBuffs[17].uPower; | |
1972 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1973 { | |
1974 a2a += pActor->pActorBuffs[11].uPower; | |
1975 pActor->pActorBuffs[11].Reset(); | |
1976 } | |
1977 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
1978 } | |
1979 | |
1980 //----- (004274AD) -------------------------------------------------------- | |
1981 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
1982 { | |
1983 signed int v3; // edi@1 | |
1984 signed int v4; // esi@8 | |
1985 int v5; // esi@8 | |
1986 | |
1987 v3 = 0; | |
1988 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1989 v3 = pActor->pActorBuffs[14].uPower; | |
1990 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 ) | |
1991 v3 = pActor->pActorBuffs[17].uPower; | |
1992 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1993 { | |
1994 v3 += pActor->pActorBuffs[11].uPower; | |
1995 pActor->pActorBuffs[11].Reset(); | |
1996 } | |
1997 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
1998 v5 = rand() % v4 + 1; | |
1999 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
2000 } | |
2001 | |
2002 //----- (00427546) -------------------------------------------------------- | |
2003 int stru319::_427546(int a2) | |
2004 { | |
2005 int result; // eax@2 | |
2006 | |
2007 if ( a2 >= 0 ) | |
2008 { | |
2009 if ( a2 >= 1 ) | |
2010 result = (a2 >= 2) + 2; | |
2011 else | |
2012 result = 1; | |
2013 } | |
2014 else | |
2015 { | |
2016 result = 0; | |
2017 } | |
2018 return result; | |
2019 } | |
2020 | |
2021 //----- (0042756B) -------------------------------------------------------- | |
2022 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
2023 { | |
2024 int v4; // edx@1 | |
2025 int v5; // ecx@1 | |
2026 signed int v6; // eax@4 | |
2027 signed int result; // eax@17 | |
2028 signed int v8; // esi@18 | |
2029 | |
2030 v4 = 0; | |
2031 v5 = 0; | |
2032 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
2033 v5 = pActor->pActorBuffs[14].uPower; | |
2034 switch ( a2 ) | |
2035 { | |
2036 case 4: | |
2037 v6 = pActor->pMonsterInfo.uResPhysical; | |
2038 break; | |
2039 case 0: | |
2040 v6 = pActor->pMonsterInfo.uResFire; | |
2041 goto LABEL_12; | |
2042 case 1: | |
2043 v6 = pActor->pMonsterInfo.uResAir; | |
2044 goto LABEL_12; | |
2045 case 2: | |
2046 v6 = pActor->pMonsterInfo.uResWater; | |
2047 goto LABEL_12; | |
2048 case 3: | |
2049 v6 = pActor->pMonsterInfo.uResEarth; | |
2050 goto LABEL_12; | |
2051 case 6: | |
2052 v6 = pActor->pMonsterInfo.uResSpirit; | |
2053 break; | |
2054 case 7: | |
2055 v6 = pActor->pMonsterInfo.uResMind; | |
2056 goto LABEL_12; | |
2057 case 8: | |
2058 v6 = pActor->pMonsterInfo.uResBody; | |
2059 LABEL_12: | |
2060 v4 = v5; | |
2061 break; | |
2062 case 9: | |
2063 v6 = pActor->pMonsterInfo.uResLight; | |
2064 break; | |
2065 case 10: | |
2066 v6 = pActor->pMonsterInfo.uResDark; | |
2067 break; | |
2068 default: | |
2069 v6 = 0; | |
2070 break; | |
2071 } | |
2072 if ( v6 < 200 ) | |
2073 { | |
2074 v8 = v4 + v6 + 30; | |
2075 if ( rand() % v8 >= 30 ) | |
2076 { | |
2077 a3 >>= 1; | |
2078 if ( rand() % v8 >= 30 ) | |
2079 { | |
2080 a3 >>= 1; | |
2081 if ( rand() % v8 >= 30 ) | |
2082 { | |
2083 a3 >>= 1; | |
2084 if ( rand() % v8 >= 30 ) | |
2085 a3 >>= 1; | |
2086 } | |
2087 } | |
2088 } | |
2089 result = a3; | |
2090 } | |
2091 else | |
2092 { | |
2093 result = 0; | |
2094 } | |
2095 return result; | |
2096 } | |
2097 | |
2098 //----- (00427662) -------------------------------------------------------- | |
2099 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
2100 { | |
2101 Actor *v3; // edi@2 | |
2102 signed int v4; // esi@2 | |
2103 bool result; // eax@13 | |
2104 | |
2105 switch ( uType ) | |
2106 { | |
2107 case 0u: | |
2108 v3 = pActor; | |
2109 v4 = pActor->pMonsterInfo.uResFire; | |
2110 goto LABEL_12; | |
2111 case 1u: | |
2112 v3 = pActor; | |
2113 v4 = pActor->pMonsterInfo.uResAir; | |
2114 goto LABEL_12; | |
2115 case 2u: | |
2116 v3 = pActor; | |
2117 v4 = pActor->pMonsterInfo.uResWater; | |
2118 goto LABEL_12; | |
2119 case 3u: | |
2120 v3 = pActor; | |
2121 v4 = pActor->pMonsterInfo.uResEarth; | |
2122 goto LABEL_12; | |
2123 case 7u: | |
2124 v3 = pActor; | |
2125 v4 = pActor->pMonsterInfo.uResMind; | |
2126 goto LABEL_12; | |
2127 case 6u: | |
2128 v3 = pActor; | |
2129 v4 = pActor->pMonsterInfo.uResSpirit; | |
2130 goto LABEL_12; | |
2131 case 8u: | |
2132 v3 = pActor; | |
2133 v4 = pActor->pMonsterInfo.uResBody; | |
2134 goto LABEL_12; | |
2135 case 9u: | |
2136 v3 = pActor; | |
2137 v4 = pActor->pMonsterInfo.uResLight; | |
2138 goto LABEL_12; | |
2139 case 0xAu: | |
2140 v3 = pActor; | |
2141 v4 = pActor->pMonsterInfo.uResDark; | |
2142 goto LABEL_12; | |
2143 case 4u: | |
2144 v3 = pActor; | |
2145 v4 = pActor->pMonsterInfo.uResPhysical; | |
2146 LABEL_12: | |
2147 if ( v4 < 200 ) | |
2148 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | |
2149 else | |
2150 result = 0; | |
2151 break; | |
2152 default: | |
2153 result = 1; | |
2154 break; | |
2155 } | |
2156 return result; | |
2157 } | |
2158 | |
2159 | |
2160 //----- (00427769) -------------------------------------------------------- | |
2161 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
2162 { | |
2163 bool result; // eax@2 | |
2164 | |
2165 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) | |
2166 result = 1; | |
2167 else | |
2168 result = 0; | |
2169 return result; | |
2170 } | |
2171 | |
2172 //----- (0042777D) -------------------------------------------------------- | |
2173 bool __fastcall _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) | |
2174 { | |
2175 bool result; // eax@2 | |
2176 __int16 v6; // bx@4 | |
2177 Player *v7; // eax@4 | |
2178 char v8; // zf@12 | |
2179 unsigned __int16 v9; // cx@16 | |
2180 unsigned int v10; // eax@18 | |
2181 unsigned __int8 v11; // sf@18 | |
2182 unsigned __int8 v12; // of@18 | |
2183 unsigned __int16 v13; // cx@21 | |
2184 unsigned int v14; // eax@23 | |
2185 stru277 *v15; // esi@27 | |
2186 stru277 *v16; // eax@28 | |
2187 GUIWindow *v17; // eax@43 | |
2188 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | |
2189 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | |
2190 unsigned int v20; // [sp-28h] [bp-40h]@44 | |
2191 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | |
2192 unsigned int v22; // [sp-20h] [bp-38h]@44 | |
2193 int v23; // [sp-1Ch] [bp-34h]@44 | |
2194 int v24; // [sp-18h] [bp-30h]@44 | |
2195 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | |
2196 unsigned int v26; // [sp-10h] [bp-28h]@43 | |
2197 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | |
2198 char *v28; // [sp-8h] [bp-20h]@43 | |
2199 Texture *v29; // [sp-4h] [bp-1Ch]@43 | |
2200 __int16 a3a; // [sp+10h] [bp-8h]@1 | |
2201 __int16 a2a; // [sp+14h] [bp-4h]@1 | |
2202 | |
2203 a3a = uPlayerID; | |
2204 a2a = a1; | |
2205 if ( pParty->bTurnBasedModeOn != 1 | |
2206 || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | |
2207 { | |
2208 v6 = a5; | |
2209 v7 = &pParty->pPlayers[uPlayerID]; | |
2210 if ( !(a5 & 0x10) ) | |
2211 { | |
2212 switch ( a1 ) | |
2213 { | |
2214 case 47: | |
2215 case 68: | |
2216 case 89: | |
2217 HIBYTE(v6) = HIBYTE(a5) | 1; | |
2218 break; | |
2219 case 4: | |
2220 case 28: | |
2221 case 30: | |
2222 case 91: | |
2223 LOBYTE(v6) = a5 | 0x80; | |
2224 break; | |
2225 case 2: | |
2226 case 6: | |
2227 case 11: | |
2228 case 18: | |
2229 case 20: | |
2230 case 24: | |
2231 case 26: | |
2232 case 29: | |
2233 case 32: | |
2234 case 34: | |
2235 case 35: | |
2236 case 37: | |
2237 case 39: | |
2238 case 44: | |
2239 case 52: | |
2240 case 57: | |
2241 case 60: | |
2242 case 65: | |
2243 case 70: | |
2244 case 76: | |
2245 case 78: | |
2246 case 79: | |
2247 case 87: | |
2248 case 90: | |
2249 case 92: | |
2250 case 93: | |
2251 case 97: | |
2252 if ( !a6 ) | |
2253 goto LABEL_9; | |
2254 break; | |
2255 case 59: | |
2256 case 62: | |
2257 case 66: | |
2258 case 81: | |
2259 case 94: | |
2260 LABEL_9: | |
2261 v6 = a5 | 8; | |
2262 break; | |
2263 case 42: | |
2264 v6 = a5 | 0x40; | |
2265 break; | |
2266 case 46: | |
2267 if ( a4 ) | |
2268 v8 = (a4 & 0x1C0) == 0; | |
2269 else | |
2270 v8 = (v7->pActiveSkills[16] & 0x1C0) == 0; | |
2271 if ( v8 ) | |
2272 goto LABEL_25; | |
2273 break; | |
2274 case 50: | |
2275 v9 = a4; | |
2276 if ( !a4 ) | |
2277 v9 = v7->pActiveSkills[16]; | |
2278 goto LABEL_18; | |
2279 case 95: | |
2280 v9 = a4; | |
2281 if ( !a4 ) | |
2282 v9 = v7->pActiveSkills[20]; | |
2283 LABEL_18: | |
2284 v10 = SkillToMastery(v9); | |
2285 v12 = __OFSUB__(v10, 3); | |
2286 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2287 goto LABEL_24; | |
2288 case 73: | |
2289 v13 = a4; | |
2290 if ( !a4 ) | |
2291 v13 = v7->pActiveSkills[18]; | |
2292 v14 = SkillToMastery(v13); | |
2293 v12 = __OFSUB__(v14, 4); | |
2294 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2295 LABEL_24: | |
2296 if ( v11 ^ v12 ) | |
2297 goto LABEL_25; | |
2298 break; | |
2299 case 40: | |
2300 case 49: | |
2301 case 53: | |
2302 case 55: | |
2303 case 56: | |
2304 case 61: | |
2305 case 64: | |
2306 case 67: | |
2307 case 71: | |
2308 case 72: | |
2309 case 74: | |
2310 LABEL_25: | |
2311 v6 = a5 | 2; | |
2312 break; | |
2313 case 96: | |
2314 HIBYTE(v6) = HIBYTE(a5) | 2; | |
2315 break; | |
2316 default: | |
2317 break; | |
2318 } | |
2319 } | |
2320 v15 = pStru277; | |
2321 if ( v6 & 0x3CA ) | |
2322 { | |
2323 v16 = pStru277; | |
2324 while ( !(v16->field_8 & 0x3CA) ) | |
2325 { | |
2326 ++v16; | |
2327 if ( (signed int)v16 >= (signed int)&unk_50C190 ) | |
2328 goto LABEL_33; | |
2329 } | |
2330 v16->spellnum = 0; | |
2331 } | |
2332 do | |
2333 { | |
2334 LABEL_33: | |
2335 if ( v15->spellnum ) | |
2336 { | |
2337 v8 = (v15->field_8 & 0x3CA) == 0; | |
2338 v15->spellnum = 0; | |
2339 if ( !v8 ) | |
2340 { | |
2341 pGUIWindow_Settings->Release(); | |
2342 pGUIWindow_Settings = 0; | |
2343 pMouse->SetCursorBitmap("MICON1"); | |
2344 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2345 unk_50C9A0 = 0; | |
2346 back_to_game(); | |
2347 } | |
2348 } | |
2349 ++v15; | |
2350 } | |
2351 while ( (signed int)v15 < (signed int)&unk_50C190 ); | |
2352 result = pStru277->PushStru277(a2a, a3a, a4, v6, a6); | |
2353 if ( result != -1 ) | |
2354 { | |
2355 if ( v6 & 2 ) | |
2356 { | |
2357 if ( pGUIWindow_Settings ) | |
2358 return result; | |
2359 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
2360 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2361 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2362 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2363 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
2364 return sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2365 } | |
2366 if ( v6 & 8 ) | |
2367 { | |
2368 if ( pGUIWindow_Settings ) | |
2369 return result; | |
2370 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
2371 v29 = 0; | |
2372 v28 = ""; | |
2373 v27 = 0; | |
2374 v26 = 0; | |
2375 v25 = 70; | |
2376 LABEL_44: | |
2377 v24 = 0; | |
2378 v23 = 1; | |
2379 v22 = 344; | |
2380 v21 = 460; | |
2381 v20 = 8; | |
2382 v19 = 8; | |
2383 pGUIWindow_Settings = v17; | |
2384 v18 = v17; | |
2385 LABEL_56: | |
2386 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
2387 return sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2388 } | |
2389 if ( v6 & 0x40 ) | |
2390 { | |
2391 if ( pGUIWindow_Settings ) | |
2392 return result; | |
2393 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
2394 v29 = 0; | |
2395 v28 = ""; | |
2396 v27 = 0; | |
2397 v26 = 0; | |
2398 v25 = 190; | |
2399 goto LABEL_44; | |
2400 } | |
2401 if ( (char)v6 < 0 ) | |
2402 { | |
2403 if ( pGUIWindow_Settings ) | |
2404 return result; | |
2405 ++pIcons_LOD->uTexturePacksCount; | |
2406 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2407 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2408 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2409 unk_50C9A0 = 1; | |
2410 some_active_character = uActiveCharacter; | |
2411 return sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2412 } | |
2413 if ( HIBYTE(v6) & 1 ) | |
2414 { | |
2415 if ( pGUIWindow_Settings ) | |
2416 return result; | |
2417 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0); | |
2418 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); | |
2419 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2420 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2421 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
2422 v29 = 0; | |
2423 v28 = ""; | |
2424 v27 = 0; | |
2425 v26 = 0; | |
2426 v25 = 140; | |
2427 v24 = 0; | |
2428 v23 = 1; | |
2429 v22 = 344; | |
2430 v21 = 460; | |
2431 v20 = 8; | |
2432 v19 = 8; | |
2433 v18 = pGUIWindow_Settings; | |
2434 goto LABEL_56; | |
2435 } | |
2436 if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings ) | |
2437 { | |
2438 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0); | |
2439 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( | |
2440 0x1D5u, | |
2441 0xB2u, | |
2442 (uTextureID_507990 != -1 ? pIcons_LOD->pTextures[uTextureID_507990].uTextureWidth : 24), | |
2443 (uTextureID_507990 != -1 ? pIcons_LOD->pTextures[uTextureID_507990].uTextureHeight : 26), | |
2444 1, | |
2445 0, | |
2446 0xBCu, | |
2447 0, | |
2448 0, | |
2449 "", | |
2450 (Texture *)(uTextureID_507990 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507990] : 0), | |
2451 0); | |
2452 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2453 0x272u, | |
2454 0xB2u, | |
2455 (uTextureID_50798C != -1 ? pIcons_LOD->pTextures[uTextureID_50798C].uTextureWidth : 24), | |
2456 (uTextureID_50798C != -1 ? pIcons_LOD->pTextures[uTextureID_50798C].uTextureHeight : 26), | |
2457 1, | |
2458 0, | |
2459 0xBCu, | |
2460 1u, | |
2461 0, | |
2462 "", | |
2463 (Texture *)(uTextureID_50798C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50798C] : 0), | |
2464 0); | |
2465 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
2466 result = (bool)pGUIWindow_Settings->CreateButton( | |
2467 0x231u, | |
2468 0x95u, | |
2469 0x40u, | |
2470 0x4Au, | |
2471 1, | |
2472 0, | |
2473 0x8Fu, | |
2474 5u, | |
2475 0x36u, | |
2476 "", | |
2477 0); | |
2478 } | |
2479 } | |
2480 } | |
2481 return result; | |
2482 } | |
2483 | |
2484 | |
2485 | |
2486 //----- (00427D48) -------------------------------------------------------- | |
2487 void stru277::_427D48(unsigned int uPlayerID) | |
2488 { | |
2489 stru277 *v2; // esi@1 | |
2490 signed int v3; // ebx@1 | |
2491 | |
2492 v2 = this; | |
2493 v3 = 10; | |
2494 do | |
2495 { | |
2496 if ( v2->spellnum ) | |
2497 { | |
2498 if ( v2->field_8 & 0x3CA ) | |
2499 { | |
2500 v2->spellnum = 0; | |
2501 pGUIWindow_Settings->Release(); | |
2502 pGUIWindow_Settings = 0; | |
2503 pMouse->SetCursorBitmap("MICON1"); | |
2504 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2505 unk_50C9A0 = 0; | |
2506 back_to_game(); | |
2507 } | |
2508 } | |
2509 ++v2; | |
2510 --v3; | |
2511 } | |
2512 while ( v3 ); | |
2513 } | |
2514 | |
2515 //----- (00427DA0) -------------------------------------------------------- | |
2516 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6) | |
2517 { | |
2518 unsigned int result; // eax@1 | |
2519 stru277 *v7; // edx@1 | |
2520 stru277 *v8; // ecx@5 | |
2521 | |
2522 result = 0; | |
2523 v7 = this; | |
2524 while ( v7->spellnum ) | |
2525 { | |
2526 ++result; | |
2527 ++v7; | |
2528 if ( (signed int)result >= 10 ) | |
2529 goto LABEL_8; | |
2530 } | |
2531 v8 = &this[result]; | |
2532 v8->spellnum = a2; | |
2533 v8->uPlayerID = uPlayerID; | |
2534 if ( a5 & 0x10 ) | |
2535 v8->uPlayerID_2 = uPlayerID; | |
2536 v8->field_6 = 0; | |
2537 *(int *)&v8->field_C = 0; | |
2538 v8->field_8 = a5; | |
2539 v8->field_A = a4; | |
2540 v8->field_10 = a6; | |
2541 LABEL_8: | |
2542 if ( result == 10 ) | |
2543 result = -1; | |
2544 return result; | |
2545 } | |
2546 | |
2547 //----- (00427E01) -------------------------------------------------------- | |
2548 void stru277::_427E01_cast_spell() | |
2549 { | |
2550 int v1; // esi@1 | |
2551 int v2; // edi@1 | |
2552 stru277 *v3; // ebx@2 | |
2553 signed int v4; // eax@8 | |
2554 __int16 v5; // ax@9 | |
2555 signed int v6; // eax@14 | |
2556 __int16 v7; // ax@23 | |
2557 __int16 v8; // ax@24 | |
2558 char v9; // al@44 | |
2559 int v10; // eax@45 | |
2560 unsigned __int16 v11; // cx@45 | |
2561 signed int v12; // ecx@48 | |
2562 int v13; // eax@53 | |
2563 unsigned __int8 v14; // zf@53 | |
2564 unsigned int v15; // edx@53 | |
2565 signed int v16; // eax@53 | |
2566 Player *v17; // esi@70 | |
2567 int v18; // eax@72 | |
2568 int v19; // eax@74 | |
2569 char *v20; // eax@74 | |
2570 signed int i; // esi@76 | |
2571 int v22; // eax@88 | |
2572 __int16 v23; // ax@88 | |
2573 int v24; // ecx@93 | |
2574 int v25; // ecx@94 | |
2575 signed __int64 v26; // qax@100 | |
2576 char *v27; // ecx@100 | |
2577 unsigned __int64 v28; // qax@102 | |
2578 int v29; // ecx@105 | |
2579 int v30; // ecx@106 | |
2580 int v31; // eax@112 | |
2581 int v32; // eax@112 | |
2582 char *v33; // edx@113 | |
2583 int v34; // eax@121 | |
2584 int v35; // eax@123 | |
2585 int v36; // edx@125 | |
2586 int v37; // eax@129 | |
2587 signed int v38; // edi@129 | |
2588 signed int v39; // eax@129 | |
2589 int v40; // ecx@129 | |
2590 int v41; // eax@129 | |
2591 signed int v42; // eax@129 | |
2592 int *v43; // ecx@129 | |
2593 int v44; // eax@132 | |
2594 int v45; // ecx@132 | |
2595 int v46; // eax@132 | |
2596 unsigned int v47; // edx@133 | |
2597 int v48; // eax@137 | |
2598 int v49; // eax@137 | |
2599 int v50; // eax@141 | |
2600 int v51; // eax@146 | |
2601 __int16 v52; // ax@153 | |
2602 int v53; // eax@153 | |
2603 signed __int64 v54; // qax@164 | |
2604 int v55; // edi@164 | |
2605 stru6 *v56; // eax@165 | |
2606 int v57; // eax@169 | |
2607 signed __int64 v58; // qax@177 | |
2608 int v59; // edi@177 | |
2609 unsigned __int16 v60; // ax@184 | |
2610 int v61; // ecx@184 | |
2611 int v62; // eax@186 | |
2612 int v63; // ecx@187 | |
2613 int v64; // ecx@188 | |
2614 int v65; // ecx@189 | |
2615 const char *v66; // ecx@200 | |
2616 unsigned int v67; // edx@201 | |
2617 char v68; // al@207 | |
89 | 2618 ItemGen *v69; // esi@211 |
0 | 2619 int v70; // ecx@214 |
2620 int v71; // ecx@215 | |
2621 int v72; // ecx@216 | |
2622 __int16 v73; // ST1C_2@222 | |
2623 __int16 v74; // ST18_2@222 | |
2624 stru6 *v75; // eax@222 | |
2625 int v76; // ecx@223 | |
2626 int v77; // ecx@224 | |
2627 int v78; // ecx@225 | |
2628 int v79; // eax@227 | |
2629 int v80; // eax@232 | |
2630 __int16 v81; // ST18_2@245 | |
2631 stru6 *v82; // eax@245 | |
2632 signed int v83; // edi@245 | |
2633 __int16 v84; // ST18_2@245 | |
2634 stru6 *v85; // eax@245 | |
2635 __int16 v86; // ST18_2@245 | |
2636 stru6 *v87; // eax@245 | |
2637 __int16 v88; // ST18_2@245 | |
2638 stru6 *v89; // eax@245 | |
2639 double v90; // st7@245 | |
2640 int v91; // eax@250 | |
89 | 2641 Player *v92; // eax@255 |
0 | 2642 __int16 v93; // ST18_2@260 |
2643 stru6 *v94; // eax@260 | |
2644 __int16 v95; // ST18_2@260 | |
2645 stru6 *v96; // eax@260 | |
2646 __int16 v97; // ST18_2@260 | |
2647 stru6 *v98; // eax@260 | |
2648 __int16 v99; // ST18_2@260 | |
2649 stru6 *v100; // eax@260 | |
2650 int v101; // ecx@261 | |
2651 int v102; // ecx@262 | |
2652 int v103; // ecx@263 | |
2653 int v104; // eax@265 | |
2654 int v105; // edi@271 | |
2655 __int16 v106; // ST18_2@272 | |
2656 stru6 *v107; // eax@272 | |
2657 __int16 v108; // ST1C_2@274 | |
2658 __int16 v109; // ST18_2@274 | |
2659 stru6 *v110; // eax@274 | |
2660 int v111; // eax@274 | |
2661 Actor *v112; // esi@278 | |
2662 int v113; // eax@278 | |
2663 int v114; // ebx@278 | |
2664 unsigned int v115; // ecx@278 | |
2665 int v116; // edx@279 | |
2666 int v117; // edx@281 | |
2667 int v118; // edx@283 | |
2668 int v119; // edi@286 | |
2669 int v120; // eax@286 | |
2670 int v121; // eax@286 | |
2671 signed int v122; // eax@286 | |
2672 int v123; // ecx@288 | |
2673 int v124; // ecx@289 | |
2674 int v125; // ecx@290 | |
2675 int v126; // eax@292 | |
2676 int v127; // eax@296 | |
2677 __int16 v128; // ST18_2@303 | |
2678 stru6 *v129; // eax@303 | |
2679 __int16 v130; // ST18_2@303 | |
2680 stru6 *v131; // eax@303 | |
2681 __int16 v132; // ST18_2@303 | |
2682 stru6 *v133; // eax@303 | |
2683 __int16 v134; // ST18_2@303 | |
2684 stru6 *v135; // eax@303 | |
2685 unsigned __int64 v136; // qax@304 | |
2686 char *v137; // ecx@304 | |
2687 int v138; // ecx@305 | |
2688 int v139; // ecx@306 | |
2689 int v140; // eax@308 | |
2690 __int16 v141; // ST18_2@311 | |
2691 stru6 *v142; // eax@311 | |
2692 __int16 v143; // ST18_2@311 | |
2693 stru6 *v144; // eax@311 | |
2694 __int16 v145; // ST18_2@311 | |
2695 stru6 *v146; // eax@311 | |
2696 __int16 v147; // ST18_2@311 | |
2697 stru6 *v148; // eax@311 | |
2698 int v149; // ecx@312 | |
2699 int v150; // ecx@313 | |
2700 int v151; // ecx@314 | |
2701 signed int v152; // eax@322 | |
2702 int v153; // ecx@322 | |
2703 int v154; // eax@322 | |
2704 int v155; // eax@323 | |
2705 int v156; // eax@323 | |
2706 int v157; // eax@326 | |
2707 double v158; // st7@326 | |
2708 double v159; // st6@326 | |
2709 signed __int64 v160; // qtt@334 | |
2710 int v161; // eax@339 | |
2711 int v162; // edi@340 | |
2712 int v163; // eax@340 | |
2713 signed int v164; // eax@340 | |
2714 signed int v165; // edi@340 | |
2715 stru6 *v166; // eax@340 | |
2716 stru6 *v167; // eax@340 | |
2717 signed int v168; // edi@343 | |
2718 int v169; // eax@344 | |
2719 int v170; // ecx@346 | |
2720 int v171; // ecx@347 | |
2721 int v172; // ecx@348 | |
2722 int v173; // edi@350 | |
2723 signed int v174; // edi@355 | |
2724 __int16 v175; // ST18_2@357 | |
2725 stru6 *v176; // eax@357 | |
2726 __int16 v177; // ST18_2@357 | |
2727 stru6 *v178; // eax@357 | |
2728 __int16 v179; // ST18_2@357 | |
2729 stru6 *v180; // eax@357 | |
2730 __int16 v181; // ST18_2@357 | |
2731 stru6 *v182; // eax@357 | |
2732 signed __int64 v183; // qax@357 | |
2733 int v184; // ecx@358 | |
2734 int v185; // ecx@359 | |
2735 int v186; // ecx@360 | |
2736 int v187; // eax@367 | |
2737 int v188; // esi@369 | |
2738 int v189; // edi@369 | |
2739 const char *v190; // ecx@377 | |
2740 signed int v191; // edi@379 | |
2741 int v192; // ecx@382 | |
2742 int v193; // ecx@383 | |
2743 int v194; // ecx@384 | |
2744 int v195; // eax@386 | |
2745 int v196; // eax@387 | |
2746 __int16 v197; // ST18_2@395 | |
2747 stru6 *v198; // eax@395 | |
2748 __int16 v199; // ST18_2@395 | |
2749 stru6 *v200; // eax@395 | |
2750 __int16 v201; // ST18_2@395 | |
2751 stru6 *v202; // eax@395 | |
2752 __int16 v203; // ST18_2@395 | |
2753 stru6 *v204; // eax@395 | |
2754 signed int v205; // edi@405 | |
2755 int v206; // eax@407 | |
2756 __int16 v207; // cx@407 | |
2757 int v208; // eax@411 | |
2758 signed int v209; // ecx@412 | |
2759 int v210; // edx@412 | |
2760 signed int v211; // ecx@412 | |
2761 int v212; // eax@413 | |
2762 int v213; // eax@413 | |
2763 int v214; // eax@413 | |
2764 int v215; // eax@415 | |
2765 double v216; // st7@415 | |
2766 double v217; // st6@415 | |
2767 signed __int64 v218; // qtt@423 | |
2768 int v219; // ecx@425 | |
2769 int v220; // ecx@426 | |
2770 int v221; // edi@428 | |
2771 char *v222; // edi@434 | |
2772 char v223; // al@438 | |
2773 int v224; // ecx@442 | |
2774 int v225; // ecx@443 | |
2775 int v226; // eax@451 | |
2776 int v227; // esi@453 | |
2777 unsigned int v228; // edi@454 | |
2778 int v229; // edi@466 | |
2779 __int16 v230; // ST18_2@469 | |
2780 stru6 *v231; // eax@469 | |
2781 signed int v232; // esi@469 | |
2782 __int16 v233; // ST18_2@469 | |
2783 stru6 *v234; // eax@469 | |
2784 __int16 v235; // ST18_2@469 | |
2785 stru6 *v236; // eax@469 | |
2786 __int16 v237; // ST18_2@469 | |
2787 stru6 *v238; // eax@469 | |
2788 __int16 v239; // ST1C_2@469 | |
2789 char *v240; // ecx@472 | |
2790 double v241; // st7@478 | |
2791 signed __int64 v242; // qax@484 | |
2792 char *v243; // ecx@484 | |
2793 char *v244; // eax@488 | |
2794 int v245; // edi@492 | |
2795 int v246; // eax@492 | |
2796 char *v247; // eax@497 | |
2797 char v248; // al@497 | |
2798 char v249; // cf@500 | |
2799 float v250; // esi@507 | |
2800 char v251; // al@507 | |
2801 int v252; // edx@510 | |
2802 int m; // esi@510 | |
2803 int v254; // eax@513 | |
2804 int v255; // esi@513 | |
2805 int v256; // ecx@513 | |
2806 int v257; // edx@514 | |
2807 int v258; // ecx@514 | |
2808 char v259; // al@516 | |
2809 int v260; // eax@518 | |
2810 int v261; // esi@519 | |
2811 int v262; // edx@521 | |
2812 int v263; // ecx@521 | |
2813 int v264; // esi@521 | |
2814 int v265; // edx@521 | |
2815 int *ii; // eax@522 | |
2816 int v267; // eax@524 | |
2817 int v268; // eax@524 | |
2818 int v269; // eax@526 | |
2819 char *v270; // eax@531 | |
2820 char v271; // al@531 | |
2821 char v272; // cf@534 | |
2822 float v273; // esi@541 | |
2823 char v274; // al@541 | |
2824 int v275; // edx@544 | |
2825 int k; // esi@544 | |
2826 int v277; // edx@548 | |
2827 int v278; // ecx@548 | |
2828 char v279; // al@550 | |
2829 int v280; // eax@552 | |
2830 int v281; // esi@553 | |
2831 int v282; // edx@555 | |
2832 int v283; // ecx@555 | |
2833 int v284; // esi@555 | |
2834 int v285; // edx@555 | |
2835 int *l; // eax@556 | |
2836 int v287; // eax@558 | |
2837 int v288; // eax@558 | |
2838 ItemGen *v289; // eax@560 | |
2839 signed int v290; // eax@560 | |
2840 unsigned __int8 v291; // al@564 | |
2841 char v292; // al@573 | |
2842 int v293; // eax@575 | |
2843 ItemGen *v294; // esi@575 | |
2844 int v295; // edx@575 | |
2845 int kk; // edi@575 | |
2846 int v297; // edx@579 | |
2847 int v298; // ecx@579 | |
2848 char v299; // al@581 | |
2849 int v300; // eax@583 | |
2850 int v301; // edi@584 | |
2851 int v302; // edx@586 | |
2852 int v303; // ecx@586 | |
2853 int v304; // edi@586 | |
2854 int v305; // edx@586 | |
2855 int *jj; // eax@587 | |
2856 int v307; // eax@589 | |
2857 int v308; // eax@589 | |
2858 char *v309; // ecx@593 | |
2859 char v310; // sf@593 | |
2860 unsigned __int8 v311; // of@593 | |
2861 char v312; // cl@597 | |
2862 char v313; // al@606 | |
2863 int v314; // edx@607 | |
2864 int j; // esi@607 | |
2865 unsigned int v316; // eax@613 | |
2866 const char *v317; // ecx@617 | |
2867 Player *v318; // ecx@619 | |
2868 unsigned int v319; // edi@627 | |
2869 int v320; // ecx@629 | |
2870 int v321; // ecx@630 | |
2871 int v322; // edi@632 | |
2872 int v323; // edi@635 | |
2873 char *v324; // eax@635 | |
2874 Player *v325; // ecx@640 | |
2875 int v326; // eax@643 | |
2876 int v327; // eax@648 | |
2877 int v328; // ecx@651 | |
2878 int v329; // ecx@652 | |
2879 int v330; // edi@654 | |
2880 __int16 v331; // ST18_2@658 | |
2881 stru6 *v332; // eax@658 | |
2882 __int16 v333; // ST18_2@658 | |
2883 stru6 *v334; // eax@658 | |
2884 __int16 v335; // ST18_2@658 | |
2885 stru6 *v336; // eax@658 | |
2886 __int16 v337; // ST18_2@658 | |
2887 stru6 *v338; // eax@658 | |
2888 int v339; // ecx@659 | |
2889 int v340; // ecx@660 | |
2890 int v341; // eax@663 | |
2891 signed int v342; // edi@668 | |
2892 signed int v343; // edi@670 | |
2893 unsigned __int64 v344; // ST08_8@670 | |
2894 __int16 v345; // ST1C_2@671 | |
2895 __int16 v346; // ST18_2@671 | |
2896 stru6 *v347; // eax@671 | |
2897 int v348; // ecx@672 | |
2898 int v349; // ecx@673 | |
2899 int v350; // edi@676 | |
2900 Player *v351; // edi@680 | |
2901 __int16 v352; // ST18_2@685 | |
2902 stru6 *v353; // eax@685 | |
2903 int v354; // ecx@686 | |
2904 int v355; // ecx@687 | |
2905 int v356; // eax@689 | |
112 | 2906 Player *v357; // edi@694 |
0 | 2907 unsigned __int16 v358; // ST1C_2@695 |
2908 __int16 v359; // ST18_2@695 | |
2909 stru6 *v360; // eax@695 | |
2910 __int16 v361; // ST1C_2@697 | |
2911 __int16 v362; // ST18_2@697 | |
2912 stru6 *v363; // eax@697 | |
2913 int v364; // ecx@698 | |
2914 int v365; // ecx@699 | |
2915 int v366; // eax@701 | |
2916 stru6 *v367; // eax@704 | |
2917 int v368; // eax@704 | |
2918 Actor *v369; // edi@705 | |
2919 int v370; // eax@706 | |
2920 int v371; // ecx@709 | |
2921 int v372; // ecx@710 | |
2922 int v373; // eax@715 | |
2923 int v374; // eax@717 | |
112 | 2924 Player *v375; // edi@717 |
0 | 2925 int v376; // eax@717 |
2926 Player *v377; // ecx@719 | |
2927 int v378; // ecx@721 | |
2928 int v379; // ecx@722 | |
2929 int v380; // eax@724 | |
2930 int v381; // edi@727 | |
2931 int v382; // ecx@727 | |
2932 Player *v383; // eax@728 | |
2933 int v384; // eax@733 | |
2934 int v385; // edi@736 | |
2935 signed int v386; // eax@736 | |
2936 Player *v387; // edi@738 | |
2937 int v388; // edi@740 | |
2938 unsigned __int16 v389; // ST1C_2@740 | |
2939 __int16 v390; // ST18_2@740 | |
2940 stru6 *v391; // eax@740 | |
2941 int v392; // ecx@742 | |
2942 int v393; // ecx@743 | |
2943 int v394; // ecx@744 | |
2944 int v395; // edi@747 | |
2945 int v396; // eax@752 | |
2946 int v397; // eax@757 | |
2947 int v398; // eax@757 | |
2948 int v399; // eax@757 | |
2949 char *v400; // esi@757 | |
2950 Game *v401; // ecx@759 | |
2951 __int16 v402; // ST1C_2@759 | |
2952 __int16 v403; // ST18_2@759 | |
2953 stru6 *v404; // eax@759 | |
2954 int v405; // ecx@761 | |
2955 int v406; // ecx@762 | |
2956 int v407; // edi@765 | |
2957 __int16 v408; // ST1C_2@769 | |
2958 __int16 v409; // ST18_2@769 | |
2959 stru6 *v410; // eax@769 | |
2960 int v411; // ecx@772 | |
2961 int v412; // ecx@773 | |
2962 int v413; // edi@775 | |
2963 __int16 v414; // ST1C_2@781 | |
2964 __int16 v415; // ST18_2@781 | |
2965 stru6 *v416; // eax@781 | |
2966 int v417; // eax@787 | |
2967 int v418; // ecx@789 | |
2968 __int16 v419; // ax@791 | |
2969 signed int v420; // eax@793 | |
2970 int v421; // edx@793 | |
2971 const char *v422; // eax@801 | |
2972 int v423; // ecx@808 | |
2973 int v424; // ecx@809 | |
2974 int v425; // eax@811 | |
2975 signed int v426; // eax@815 | |
2976 signed int v427; // eax@820 | |
2977 int v428; // ecx@825 | |
2978 int v429; // ecx@826 | |
2979 int v430; // eax@828 | |
2980 stru6 *v431; // eax@831 | |
2981 int v432; // eax@831 | |
2982 Actor *v433; // edi@832 | |
2983 int v434; // eax@833 | |
2984 int v435; // ecx@837 | |
2985 int v436; // ecx@838 | |
2986 __int16 v437; // ST1C_2@843 | |
2987 __int16 v438; // ST18_2@843 | |
2988 stru6 *v439; // eax@843 | |
2989 int v440; // eax@843 | |
2990 int v441; // eax@847 | |
2991 int v442; // ecx@850 | |
2992 int v443; // ecx@851 | |
2993 int v444; // eax@853 | |
2994 signed int v445; // edi@857 | |
2995 int v446; // ecx@862 | |
2996 LevelDecoration *v447; // edi@864 | |
2997 __int16 v448; // ax@864 | |
2998 char *v449; // esi@870 | |
2999 int v450; // eax@870 | |
3000 int v451; // ecx@875 | |
3001 int v452; // ecx@876 | |
3002 int v453; // edi@878 | |
3003 __int16 v454; // ST1C_2@884 | |
3004 __int16 v455; // ST18_2@884 | |
3005 stru6 *v456; // eax@884 | |
3006 int v457; // ecx@887 | |
3007 int v458; // ecx@888 | |
3008 int v459; // eax@890 | |
3009 signed int v460; // eax@895 | |
3010 Actor *v461; // eax@897 | |
3011 unsigned __int16 v462; // cx@897 | |
3012 signed int v463; // edx@897 | |
3013 int v464; // ecx@905 | |
3014 int v465; // ecx@906 | |
3015 int v466; // edi@909 | |
3016 __int16 v467; // ST1C_2@913 | |
3017 __int16 v468; // ST18_2@913 | |
3018 stru6 *v469; // eax@913 | |
3019 int v470; // edi@913 | |
3020 int v471; // eax@917 | |
3021 int v472; // eax@917 | |
3022 char *v473; // esi@918 | |
3023 __int16 v474; // ST18_2@920 | |
3024 stru6 *v475; // eax@920 | |
3025 __int16 v476; // ST18_2@920 | |
3026 stru6 *v477; // eax@920 | |
3027 __int16 v478; // ST18_2@920 | |
3028 stru6 *v479; // eax@920 | |
3029 __int16 v480; // ST18_2@920 | |
3030 stru6 *v481; // eax@920 | |
3031 __int16 v482; // ST18_2@923 | |
3032 stru6 *v483; // eax@923 | |
3033 __int16 v484; // ST18_2@923 | |
3034 stru6 *v485; // eax@923 | |
3035 __int16 v486; // ST18_2@923 | |
3036 stru6 *v487; // eax@923 | |
3037 __int16 v488; // ST18_2@923 | |
3038 stru6 *v489; // eax@923 | |
3039 __int16 v490; // ST1C_2@924 | |
3040 __int16 v491; // ST18_2@924 | |
3041 stru6 *v492; // eax@924 | |
3042 int v493; // ecx@925 | |
3043 int v494; // ecx@926 | |
3044 __int16 v495; // ST1C_2@931 | |
3045 __int16 v496; // ST18_2@931 | |
3046 stru6 *v497; // eax@931 | |
3047 int v498; // edi@931 | |
3048 int v499; // eax@935 | |
3049 int v500; // eax@935 | |
3050 Player *v501; // edi@939 | |
3051 __int16 v502; // ST18_2@940 | |
3052 stru6 *v503; // eax@940 | |
3053 stru6 *v504; // eax@943 | |
3054 int v505; // eax@943 | |
3055 int v506; // eax@943 | |
3056 int v507; // edi@944 | |
3057 int v508; // eax@944 | |
3058 signed int v509; // eax@944 | |
3059 signed int v510; // edi@944 | |
3060 Actor *v511; // edi@946 | |
3061 int v512; // eax@946 | |
3062 SpellBuff *v513; // edi@946 | |
3063 int v514; // ecx@950 | |
3064 int v515; // ecx@951 | |
3065 int v516; // eax@953 | |
3066 int v517; // eax@956 | |
90 | 3067 Actor *v518; // edx@957 |
0 | 3068 __int16 v519; // cx@958 |
3069 int v520; // ecx@968 | |
3070 int v521; // ecx@969 | |
3071 int v522; // eax@971 | |
3072 __int16 v523; // ST18_2@975 | |
3073 stru6 *v524; // eax@975 | |
3074 __int16 v525; // ST18_2@975 | |
3075 stru6 *v526; // eax@975 | |
3076 __int16 v527; // ST18_2@975 | |
3077 stru6 *v528; // eax@975 | |
3078 __int16 v529; // ST18_2@975 | |
3079 stru6 *v530; // eax@975 | |
3080 int v531; // eax@982 | |
3081 int v532; // eax@982 | |
3082 int v533; // edi@983 | |
3083 int v534; // eax@983 | |
3084 signed int v535; // eax@983 | |
3085 signed int v536; // edi@983 | |
3086 stru6 *v537; // eax@984 | |
3087 int v538; // ecx@985 | |
3088 int v539; // ecx@986 | |
3089 int v540; // eax@988 | |
3090 __int16 v541; // ST18_2@991 | |
3091 stru6 *v542; // eax@991 | |
3092 __int16 v543; // ST18_2@991 | |
3093 stru6 *v544; // eax@991 | |
3094 __int16 v545; // ST18_2@991 | |
3095 stru6 *v546; // eax@991 | |
3096 __int16 v547; // ST18_2@991 | |
3097 stru6 *v548; // eax@991 | |
3098 double v549; // st7@991 | |
3099 unsigned __int16 v550; // di@991 | |
3100 int v551; // ecx@993 | |
3101 int v552; // ecx@994 | |
89 | 3102 Player *v553; // edi@1001 |
0 | 3103 __int16 v554; // ST18_2@1002 |
3104 stru6 *v555; // eax@1002 | |
3105 __int16 v556; // ST18_2@1002 | |
3106 stru6 *v557; // eax@1002 | |
3107 __int16 v558; // ST18_2@1002 | |
3108 stru6 *v559; // eax@1002 | |
3109 __int16 v560; // ST18_2@1002 | |
3110 stru6 *v561; // eax@1002 | |
3111 unsigned __int16 v562; // di@1005 | |
3112 signed int v563; // eax@1010 | |
3113 unsigned int v564; // ecx@1011 | |
3114 signed int v565; // eax@1012 | |
3115 Player **v566; // ecx@1012 | |
3116 int v567; // eax@1012 | |
3117 unsigned __int16 v568; // ST1C_2@1012 | |
3118 __int16 v569; // ST18_2@1012 | |
3119 stru6 *v570; // eax@1012 | |
3120 Player *v571; // eax@1013 | |
3121 char *v572; // ecx@1013 | |
3122 int v573; // ecx@1017 | |
3123 int v574; // ecx@1018 | |
3124 int v575; // eax@1020 | |
3125 signed int v576; // eax@1025 | |
3126 Player *v577; // eax@1026 | |
3127 int v578; // eax@1028 | |
3128 __int16 v579; // ax@1029 | |
3129 int v580; // eax@1031 | |
3130 int v581; // edi@1031 | |
3131 int v582; // eax@1031 | |
3132 __int16 v583; // ST1C_2@1034 | |
3133 __int16 v584; // ST18_2@1034 | |
3134 char *v585; // esi@1034 | |
3135 stru6 *v586; // eax@1034 | |
3136 signed int v587; // eax@1035 | |
3137 int v588; // ecx@1036 | |
3138 int v589; // ecx@1037 | |
3139 int v590; // ecx@1038 | |
3140 char v591; // al@1048 | |
3141 int v592; // esi@1052 | |
3142 int v593; // ecx@1057 | |
3143 int v594; // ecx@1058 | |
3144 int v595; // eax@1064 | |
3145 int v596; // esi@1066 | |
3146 unsigned int v597; // edi@1067 | |
3147 int v598; // eax@1079 | |
3148 signed int v599; // eax@1082 | |
3149 int v600; // edi@1086 | |
3150 int v601; // edx@1086 | |
3151 int v602; // eax@1086 | |
3152 int v603; // ecx@1086 | |
3153 int v604; // eax@1087 | |
3154 char *v605; // eax@1089 | |
3155 int v606; // edx@1091 | |
3156 int v607; // ecx@1100 | |
3157 __int16 v608; // ax@1102 | |
3158 signed int v609; // eax@1104 | |
3159 int v610; // edi@1106 | |
3160 unsigned int v611; // eax@1106 | |
89 | 3161 Player *v612; // edi@1106 |
3162 DDM_DLV_Header *v613; // eax@1108 | |
0 | 3163 int v614; // eax@1116 |
3164 int v615; // edi@1119 | |
3165 __int16 v616; // ST1C_2@1122 | |
3166 __int16 v617; // ST18_2@1122 | |
3167 stru6 *v618; // eax@1122 | |
112 | 3168 Player *v619; // edi@1123 |
0 | 3169 unsigned __int16 v620; // ST1C_2@1124 |
3170 __int16 v621; // ST18_2@1124 | |
3171 stru6 *v622; // eax@1124 | |
3172 signed __int64 v623; // qax@1127 | |
3173 int v624; // eax@1127 | |
3174 int v625; // edi@1129 | |
3175 int v626; // eax@1129 | |
3176 signed int v627; // eax@1129 | |
3177 signed int v628; // edi@1129 | |
3178 int v629; // ecx@1130 | |
3179 Player *v630; // eax@1131 | |
3180 int v631; // eax@1137 | |
3181 int v632; // edi@1140 | |
3182 Player *v633; // eax@1140 | |
3183 signed int v634; // eax@1140 | |
3184 int v635; // edi@1142 | |
3185 unsigned __int16 v636; // ST1C_2@1142 | |
3186 __int16 v637; // ST18_2@1142 | |
3187 stru6 *v638; // eax@1142 | |
3188 stru6 *v639; // eax@1143 | |
3189 int v640; // ecx@1146 | |
3190 int v641; // ecx@1147 | |
3191 int v642; // edi@1156 | |
3192 int v643; // eax@1156 | |
3193 int v644; // eax@1156 | |
3194 signed int v645; // eax@1158 | |
3195 Player *v646; // ebx@1169 | |
3196 int v647; // edi@1169 | |
3197 signed int v648; // ST1C_4@1170 | |
3198 Player *v649; // ecx@1170 | |
3199 unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3200 unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3201 unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3202 unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
3203 int v654; // [sp-4h] [bp-E88h]@124 | |
3204 unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 | |
3205 unsigned int v656; // [sp-4h] [bp-E88h]@639 | |
3206 int v657; // [sp-4h] [bp-E88h]@807 | |
3207 int v658; // [sp+0h] [bp-E84h]@100 | |
3208 int v659; // [sp+0h] [bp-E84h]@123 | |
3209 int v660; // [sp+0h] [bp-E84h]@146 | |
3210 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
3211 int v662; // [sp+0h] [bp-E84h]@304 | |
3212 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 | |
3213 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3214 int v665; // [sp+0h] [bp-E84h]@807 | |
3215 int v666; // [sp+4h] [bp-E80h]@12 | |
3216 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
3217 unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 | |
3218 int v669; // [sp+4h] [bp-E80h]@123 | |
3219 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3220 int v671; // [sp+4h] [bp-E80h]@146 | |
3221 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
3222 unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 | |
3223 __int16 v674; // [sp+4h] [bp-E80h]@684 | |
3224 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3225 int v676; // [sp+4h] [bp-E80h]@807 | |
3226 int v677; // [sp+4h] [bp-E80h]@861 | |
3227 int v678; // [sp+4h] [bp-E80h]@997 | |
3228 int v679; // [sp+14h] [bp-E70h]@515 | |
3229 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3230 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3231 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3232 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3233 int v684; // [sp+D04h] [bp-180h]@416 | |
3234 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3235 int x; // [sp+D20h] [bp-164h]@327 | |
3236 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3237 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3238 int v689; // [sp+D30h] [bp-154h]@943 | |
3239 int v690; // [sp+D34h] [bp-150h]@943 | |
3240 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3241 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3242 int v693; // [sp+D40h] [bp-144h]@137 | |
3243 int v694; // [sp+D44h] [bp-140h]@982 | |
3244 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3245 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3246 int v697; // [sp+D50h] [bp-134h]@129 | |
3247 int v698; // [sp+D54h] [bp-130h]@129 | |
3248 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3249 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3250 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3251 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3252 int v703; // [sp+D70h] [bp-114h]@286 | |
3253 int v704; // [sp+D74h] [bp-110h]@132 | |
3254 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3255 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3256 int v707; // [sp+D80h] [bp-104h]@1127 | |
3257 int v708; // [sp+D84h] [bp-100h]@1127 | |
3258 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3259 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3260 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3261 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3262 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3263 int n; // [sp+DA0h] [bp-E4h]@1 | |
3264 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3265 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3266 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3267 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3268 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3269 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3270 int v721; // [sp+DD8h] [bp-ACh]@163 | |
3271 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3272 int v723; // [sp+E4Ch] [bp-38h]@1 | |
3273 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3274 float v725; // [sp+E54h] [bp-30h]@23 | |
3275 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3276 int v726b; |
0 | 3277 float v727; // [sp+E5Ch] [bp-28h]@1 |
3278 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3279 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3280 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3281 Player *v730b; |
3282 ItemGen *v730c; | |
0 | 3283 int v731; // [sp+E6Ch] [bp-18h]@48 |
3284 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3285 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3286 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3287 int amount; // [sp+E80h] [bp-4h]@1 | |
3288 | |
3289 auto ecx0 = this; | |
3290 | |
3291 v711 = ecx0; | |
3292 | |
3293 LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3294 //LayingItem::LayingItem(&a1); | |
3295 | |
3296 v1 = 0; | |
3297 v2 = 0; | |
3298 amount = 0; | |
3299 LODWORD(v733) = 0; | |
3300 v723 = 0; | |
3301 v727 = 0.0; | |
3302 n = 0; | |
3303 while ( 1 ) | |
3304 { | |
3305 v3 = &v711[n]; | |
3306 HIDWORD(v733) = (int)v3; | |
3307 if ( v3->spellnum == (short)v1 ) | |
3308 goto LABEL_1166; | |
3309 if ( pParty->pPartyBuffs[11].NotExpired() ) | |
3310 pParty->pPartyBuffs[11].Reset(); | |
3311 if ( v3->field_8 & 0x3CA ) | |
3312 { | |
3313 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3314 v711->_427D48(1u); | |
3315 goto LABEL_1166; | |
3316 } | |
3317 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
3318 v4 = *(int *)&v3->field_C; | |
3319 if ( v4 != v1 ) | |
3320 goto LABEL_18; | |
3321 v5 = v3->spellnum; | |
3322 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) | |
3323 v666 = 1; | |
3324 else | |
3325 v666 = v1; | |
3326 a2 = stru_50C198.FindClosesActor(5120, 1, v666); | |
3327 v6 = pMouse->uPointingObjectID; | |
141 | 3328 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) |
0 | 3329 { |
3330 v4 = pMouse->uPointingObjectID; | |
3331 LABEL_18: | |
3332 a2 = v4; | |
3333 } | |
3334 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; | |
3335 if ( (short)a1.uItemType != (short)v1 ) | |
3336 { | |
141 | 3337 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3338 { |
141 | 3339 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3340 v2 = v723; |
3341 v1 = 0; | |
3342 } | |
3343 else | |
3344 { | |
3345 v715.uYawAngle = pParty->sRotationY; | |
3346 v715.uPitchAngle = pParty->sRotationX; | |
3347 } | |
3348 } | |
3349 v7 = v3->field_A; | |
3350 LODWORD(v725) = v1; | |
3351 _this = (ItemGen *)v1; | |
3352 if ( v7 == (short)v1 ) | |
3353 { | |
3354 v8 = v3->spellnum; | |
3355 if ( v3->spellnum >= 12 ) | |
3356 { | |
3357 if ( v8 >= 23 ) | |
3358 { | |
3359 if ( v8 >= 34 ) | |
3360 { | |
3361 if ( v8 >= 45 ) | |
3362 { | |
3363 if ( v8 >= 56 ) | |
3364 { | |
3365 if ( v8 >= 67 ) | |
3366 { | |
3367 if ( v8 >= 78 ) | |
3368 { | |
3369 if ( v8 >= 89 ) | |
3370 { | |
3371 if ( v8 >= 100 ) | |
3372 { | |
3373 if ( v8 != 100 ) | |
3374 { | |
3375 LABEL_45: | |
3376 HIWORD(v10) = HIWORD(pPlayer); | |
3377 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
3378 goto LABEL_47; | |
3379 } | |
3380 v667 = (PLAYER_SKILL_TYPE)5; | |
3381 } | |
3382 else | |
3383 { | |
3384 v667 = (PLAYER_SKILL_TYPE)20; | |
3385 } | |
3386 } | |
3387 else | |
3388 { | |
3389 v667 = (PLAYER_SKILL_TYPE)19; | |
3390 } | |
3391 } | |
3392 else | |
3393 { | |
3394 v667 = (PLAYER_SKILL_TYPE)18; | |
3395 } | |
3396 } | |
3397 else | |
3398 { | |
3399 v667 = (PLAYER_SKILL_TYPE)17; | |
3400 } | |
3401 } | |
3402 else | |
3403 { | |
3404 v667 = (PLAYER_SKILL_TYPE)16; | |
3405 } | |
3406 } | |
3407 else | |
3408 { | |
3409 v667 = (PLAYER_SKILL_TYPE)15; | |
3410 } | |
3411 } | |
3412 else | |
3413 { | |
3414 v667 = (PLAYER_SKILL_TYPE)14; | |
3415 } | |
3416 } | |
3417 else | |
3418 { | |
3419 v667 = (PLAYER_SKILL_TYPE)13; | |
3420 } | |
3421 } | |
3422 else | |
3423 { | |
3424 v667 = (PLAYER_SKILL_TYPE)12; | |
3425 } | |
3426 LODWORD(v725) = v667; | |
3427 v9 = pPlayer->GetActualSkillLevel(v667); | |
3428 v723 = v9 & 0x3F; | |
3429 v2 = v9 & 0x3F; | |
3430 goto LABEL_45; | |
3431 } | |
3432 v11 = v7; | |
3433 v10 = v7 & 0x3F; | |
3434 v723 = v10; | |
3435 v2 = v10; | |
3436 LABEL_47: | |
3437 if ( HIBYTE(v11) & 1 ) | |
3438 { | |
3439 v12 = 4; | |
3440 v731 = 4; | |
3441 } | |
3442 else | |
3443 { | |
3444 if ( (v11 & 0x80u) == 0 ) | |
3445 { | |
3446 v10 = ((v11 & 0x40) != 0) + 1; | |
3447 v731 = ((v11 & 0x40) != 0) + 1; | |
3448 } | |
3449 else | |
3450 { | |
3451 v731 = 3; | |
3452 } | |
3453 v12 = v731; | |
3454 } | |
3455 LOWORD(v10) = v3->spellnum; | |
3456 v730 = v10; | |
3457 v13 = v12 + 10 * (signed __int16)v10; | |
3458 v14 = v3->field_A == (short)v1; | |
3459 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing | |
3460 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); | |
3461 uRequiredMana = v15; | |
3462 sRecoveryTime = v16; | |
3463 if ( !v14 ) | |
3464 uRequiredMana = v1; | |
3465 if ( pParty->uCurrentHour == v1 ) | |
3466 { | |
3467 if ( pParty->uCurrentMinute != v1 ) | |
3468 goto LABEL_62; | |
3469 if ( LODWORD(v725) == 20 ) | |
3470 goto LABEL_61; | |
3471 } | |
3472 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == v1 && LODWORD(v725) == 19 ) | |
3473 LABEL_61: | |
3474 uRequiredMana = v1; | |
3475 LABEL_62: | |
3476 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) | |
3477 break; | |
3478 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); | |
3479 LABEL_203: | |
3480 v3->spellnum = v1; | |
3481 LABEL_1166: | |
3482 ++n; | |
3483 if ( n >= 10 ) | |
3484 return; | |
3485 } | |
3486 if ( !pPlayer->pConditions[0] || (signed __int16)v730 >= 100 ) | |
3487 goto LABEL_69; | |
3488 if ( rand() % 100 >= 50 ) | |
3489 { | |
3490 v12 = v731; | |
3491 LABEL_69: | |
3492 switch ( v3->spellnum ) | |
3493 { | |
3494 case 100: | |
3495 case 101: | |
3496 v17 = pPlayer; | |
3497 _this = (ItemGen *)1; | |
3498 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[5]) >= 3 ) | |
3499 _this = (ItemGen *)2; | |
3500 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3501 a1.stru_24.Reset(); | |
3502 v18 = v3->spellnum; | |
3503 a1.field_4C = v2; | |
3504 a1.field_48 = v18; | |
3505 a1.field_50 = v731; | |
3506 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3507 if ( v17->WearsItem(510, 2) ) | |
3508 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3509 a1.vPosition.x = pParty->vPosition.x; | |
3510 a1.vPosition.y = pParty->vPosition.y; | |
3511 a1.uAttributes = 0; | |
3512 a1.uSpriteFrameID = 0; | |
3513 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3514 v19 = 8 * v3->uPlayerID; | |
3515 LOBYTE(v19) = v19 | 4; | |
3516 a1.field_58 = v19; | |
3517 a1.field_5C = a2; | |
3518 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3519 a1.uFacing = LOWORD(v715.uYawAngle); | |
3520 a1.uSoundID = LOWORD(v3->field_10); | |
3521 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3522 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3523 a1.uAttributes = 256; | |
3524 if ( pParty->bTurnBasedModeOn == 1 ) | |
3525 a1.uAttributes = 260; | |
3526 for ( i = 0; i < (signed int)this; ++i ) | |
3527 { | |
3528 if ( i ) | |
3529 a1.vPosition.z += 32; | |
3530 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3531 if ( a1.Create( | |
3532 v715.uYawAngle, | |
3533 v715.uPitchAngle, | |
3534 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3535 v3->uPlayerID + 1) != -1 | |
3536 && pParty->bTurnBasedModeOn == 1 ) | |
3537 ++pTurnEngine->field_1C; | |
3538 } | |
3539 goto LABEL_83; | |
3540 case 102: | |
3541 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); | |
3542 a1.stru_24.Reset(); | |
3543 a1.field_48 = v3->spellnum; | |
3544 a1.field_4C = v723; | |
3545 a1.field_50 = v731; | |
3546 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3547 a1.vPosition.x = pParty->vPosition.x; | |
3548 a1.vPosition.y = pParty->vPosition.y; | |
3549 a1.uAttributes = 0; | |
3550 a1.uSpriteFrameID = 0; | |
3551 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3552 v22 = 8 * v3->uPlayerID; | |
3553 LOBYTE(v22) = v22 | 4; | |
3554 a1.field_58 = v22; | |
3555 a1.field_5C = a2; | |
3556 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3557 a1.uFacing = LOWORD(v715.uYawAngle); | |
3558 a1.uSoundID = LOWORD(v3->field_10); | |
3559 memcpy( | |
3560 &a1.stru_24, | |
3561 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3562 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3563 + 5], | |
3564 sizeof(a1.stru_24)); | |
3565 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3566 HIBYTE(a1.uAttributes) |= 1u; | |
3567 a1.uSectorID = v23; | |
3568 if ( pParty->bTurnBasedModeOn == 1 ) | |
3569 LOBYTE(a1.uAttributes) |= 4u; | |
3570 if ( a1.Create( | |
3571 v715.uYawAngle, | |
3572 v715.uPitchAngle, | |
3573 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3574 v3->uPlayerID + 1) != -1 | |
3575 && pParty->bTurnBasedModeOn == 1 ) | |
3576 ++pTurnEngine->field_1C; | |
3577 goto LABEL_83; | |
3578 case 1: | |
3579 LODWORD(v733) = 3600 * v2; | |
3580 v24 = v12 - 2; | |
3581 if ( v24 ) | |
3582 { | |
3583 v25 = v24 - 1; | |
3584 if ( v25 && v25 != 1 ) | |
3585 amount = 2; | |
3586 else | |
3587 amount = 4; | |
3588 } | |
3589 else | |
3590 { | |
3591 amount = 3; | |
3592 } | |
3593 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3594 goto LABEL_83; | |
3595 v668 = v1; | |
3596 v658 = v1; | |
3597 v653 = amount; | |
3598 v651 = v731; | |
3599 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); | |
3600 v27 = (char *)&pParty->pPartyBuffs[16]; | |
3601 goto LABEL_101; | |
3602 case 7: | |
3603 v29 = v12 - 2; | |
3604 if ( v29 ) | |
3605 { | |
3606 v30 = v29 - 1; | |
3607 if ( v30 ) | |
3608 { | |
3609 if ( v30 == 1 ) | |
3610 amount = 9; | |
3611 else | |
3612 amount = 3; | |
3613 } | |
3614 else | |
3615 { | |
3616 amount = 7; | |
3617 } | |
3618 } | |
3619 else | |
3620 { | |
3621 amount = 5; | |
3622 } | |
3623 v31 = v3->uPlayerID; | |
3624 HIDWORD(v733) = v1; | |
3625 v32 = 8 * v31; | |
3626 LOBYTE(v32) = v32 | 4; | |
3627 if ( (signed int)uNumLayingItems > v1 ) | |
3628 { | |
3629 v33 = (char *)&pLayingItems[0].field_48; | |
3630 v730 = uNumLayingItems; | |
3631 do | |
3632 { | |
3633 if ( *((short *)v33 - 36) != (short)v1 && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) | |
3634 ++HIDWORD(v733); | |
3635 v33 += 112; | |
3636 --v730; | |
3637 } | |
3638 while ( v730 ); | |
3639 } | |
3640 if ( SHIDWORD(v733) > amount ) | |
3641 goto LABEL_200; | |
3642 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3643 goto LABEL_83; | |
3644 a1.stru_24.Reset(); | |
3645 a1.field_48 = v3->spellnum; | |
3646 a1.field_4C = v2; | |
3647 a1.field_50 = v731; | |
3648 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3649 a1.vPosition.y = pParty->vPosition.y; | |
3650 a1.vPosition.x = pParty->vPosition.x; | |
3651 a1.uAttributes = v1; | |
3652 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3653 a1.uSectorID = pIndoor->GetSector( | |
3654 pParty->vPosition.x, | |
3655 pParty->vPosition.y, | |
3656 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3657 a1.uSpriteFrameID = v1; | |
3658 v34 = 8 * v3->uPlayerID; | |
3659 LOBYTE(v34) = v34 | 4; | |
3660 a1.field_58 = v34; | |
3661 a1.field_5C = a2; | |
3662 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3663 a1.uFacing = LOWORD(v715.uYawAngle); | |
3664 a1.uSoundID = LOWORD(v3->field_10); | |
3665 if ( pParty->bTurnBasedModeOn == 1 ) | |
3666 LOBYTE(a1.uAttributes) |= 4u; | |
3667 v669 = v3->uPlayerID + 1; | |
3668 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3669 v35 = pParty->sRotationX + 10; | |
3670 goto LABEL_124; | |
3671 case 20: | |
3672 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3673 goto LABEL_83; | |
3674 if ( a2 == v1 ) | |
3675 goto LABEL_200; | |
141 | 3676 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3677 goto LABEL_1056; |
3678 v699 = v1; | |
3679 v698 = v1; | |
3680 v697 = v1; | |
3681 a1.stru_24.Reset(); | |
3682 a1.field_48 = v3->spellnum; | |
3683 a1.field_4C = v2; | |
3684 a1.field_50 = v731; | |
3685 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3686 a1.uAttributes = v1; | |
3687 a1.uSectorID = v1; | |
3688 a1.uSpriteFrameID = v1; | |
3689 v37 = v3->uPlayerID; | |
3690 a1.field_60_distance_related_prolly_lod = 0; | |
3691 v37 *= 8; | |
3692 LOBYTE(v37) = v37 | 4; | |
3693 a1.uFacing = v1; | |
3694 a1.field_58 = v37; | |
3695 v38 = a2 >> 3; | |
3696 a1.uSoundID = LOWORD(v3->field_10); | |
3697 v39 = a2 >> 3; | |
3698 a1.vPosition.x = pActors[v39].vPosition.x; | |
3699 v40 = pActors[v39].vPosition.y; | |
3700 a1.vPosition.z = pActors[v39].vPosition.z; | |
3701 v41 = 8 * (a2 >> 3); | |
3702 a1.vPosition.y = v40; | |
3703 LOBYTE(v41) = v41 | 3; | |
3704 a1.field_5C = v41; | |
3705 v42 = a1.Create(0, v1, v1, v1); | |
3706 v43 = &v697; | |
3707 goto LABEL_133; | |
3708 case 44: | |
3709 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3710 goto LABEL_83; | |
3711 v726 = (Player *)(a2 >> 3); | |
3712 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3713 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3714 goto LABEL_1056; |
90 | 3715 pActors[a2 >> 3].pActorBuffs[10].Apply( |
0 | 3716 pMiscTimer->uTotalGameTimeElapsed + 128, |
3717 v1, | |
3718 v1, | |
3719 v1, | |
3720 v1); | |
3721 v706 = v1; | |
3722 v705 = v1; | |
3723 v704 = v1; | |
3724 a1.stru_24.Reset(); | |
3725 a1.field_48 = v3->spellnum; | |
3726 a1.field_4C = v2; | |
3727 a1.field_50 = v731; | |
3728 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3729 a1.uAttributes = v1; | |
3730 a1.uSectorID = v1; | |
3731 a1.uSpriteFrameID = v1; | |
3732 v44 = v3->uPlayerID; | |
3733 a1.field_60_distance_related_prolly_lod = 0; | |
3734 a1.uFacing = v1; | |
3735 v44 *= 8; | |
3736 LOBYTE(v44) = v44 | 4; | |
3737 v38 = (signed int)v726; | |
3738 a1.field_58 = v44; | |
3739 a1.uSoundID = LOWORD(v3->field_10); | |
3740 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3741 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3742 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3743 v46 = 8 * (int)v726; | |
3744 a1.vPosition.y = v45; | |
3745 LOBYTE(v46) = 8 * (char)v726 | 3; | |
3746 a1.field_5C = v46; | |
3747 v42 = a1.Create(0, v1, v1, v1); | |
3748 v43 = &v704; | |
3749 LABEL_133: | |
3750 v670 = (Vec3_int_ *)v43; | |
3751 v47 = v38; | |
3752 goto LABEL_139; | |
3753 case 79: | |
141 | 3754 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 3755 goto LABEL_83; |
3756 v730 = a2 >> 3; | |
3757 v693 = v1; | |
3758 HIDWORD(v733) = (int)&pActors[a2 >> 3]; | |
3759 v692 = v1; | |
3760 v691 = v1; | |
3761 a1.stru_24.Reset(); | |
3762 a1.field_48 = v3->spellnum; | |
3763 a1.field_4C = v2; | |
3764 a1.field_50 = v731; | |
3765 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3766 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | |
3767 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3768 v48 = *(short *)(HIDWORD(v733) + 138); | |
3769 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
3770 a1.uAttributes = v1; | |
3771 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); | |
3772 a1.uSpriteFrameID = v1; | |
3773 v49 = 8 * v3->uPlayerID; | |
3774 LOBYTE(v49) = v49 | 4; | |
3775 a1.field_58 = v49; | |
3776 a1.field_5C = a2; | |
3777 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3778 a1.uFacing = LOWORD(v715.uYawAngle); | |
3779 LOWORD(v49) = LOWORD(v3->field_10); | |
3780 LOBYTE(a1.uAttributes) |= 0x80u; | |
3781 a1.uSoundID = v49; | |
3782 v726 = (Player *)a1.Create(0, v1, v1, v1); | |
3783 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) | |
3784 goto LABEL_200; | |
3785 v47 = v730; | |
3786 v670 = (Vec3_int_ *)&v691; | |
3787 v42 = (signed int)v726; | |
3788 LABEL_139: | |
3789 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3790 goto LABEL_1056; | |
3791 case 2: | |
3792 case 6: | |
3793 case 11: | |
3794 case 18: | |
3795 case 26: | |
3796 case 32: | |
3797 case 34: | |
3798 case 37: | |
3799 case 57: | |
3800 case 65: | |
3801 case 70: | |
3802 case 78: | |
3803 case 97: | |
3804 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3805 goto LABEL_83; | |
3806 a1.stru_24.Reset(); | |
3807 a1.field_48 = v3->spellnum; | |
3808 a1.field_4C = v2; | |
3809 a1.field_50 = v731; | |
3810 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3811 a1.vPosition.y = pParty->vPosition.y; | |
3812 a1.vPosition.x = pParty->vPosition.x; | |
3813 a1.uAttributes = v1; | |
3814 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3815 a1.uSectorID = pIndoor->GetSector( | |
3816 pParty->vPosition.x, | |
3817 pParty->vPosition.y, | |
3818 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3819 a1.uSpriteFrameID = v1; | |
3820 v50 = 8 * v3->uPlayerID; | |
3821 LOBYTE(v50) = v50 | 4; | |
3822 a1.field_58 = v50; | |
3823 a1.field_5C = a2; | |
3824 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3825 a1.uFacing = LOWORD(v715.uYawAngle); | |
3826 a1.uSoundID = LOWORD(v3->field_10); | |
3827 if ( pParty->bTurnBasedModeOn == 1 ) | |
3828 LOBYTE(a1.uAttributes) |= 4u; | |
3829 if ( v3->spellnum == 18 ) | |
3830 LOBYTE(a1.uAttributes) |= 0x40u; | |
3831 goto LABEL_156; | |
3832 case 29: | |
3833 case 39: | |
3834 case 76: | |
3835 case 90: | |
3836 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3837 goto LABEL_83; | |
3838 a1.stru_24.Reset(); | |
3839 a1.field_48 = v3->spellnum; | |
3840 a1.field_4C = v2; | |
3841 a1.field_50 = v731; | |
3842 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3843 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3844 a1.vPosition.y = pParty->vPosition.y; | |
3845 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3846 v660 = pParty->vPosition.y; | |
3847 goto LABEL_153; | |
3848 case 87: | |
3849 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3850 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3851 goto LABEL_200; | |
3852 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3853 goto LABEL_152; | |
3854 goto LABEL_83; | |
3855 case 81: | |
3856 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3857 goto LABEL_83; | |
3858 if ( a2 == v1 | |
141 | 3859 || (a2 & 7) != OBJECT_Actor |
0 | 3860 || (v730 = a2 >> 3, |
3861 v721 = (int)&pActors[a2 >> 3], | |
3862 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3863 goto LABEL_1056; | |
3864 Actor::_403EB6(v730, 4u, 0x80u, (AIDirection *)v1); | |
3865 v726 = (Player *)(23040 * v2); | |
3866 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3867 v55 = v721; | |
3868 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, v1, v1, v1); | |
3869 *(char *)(v55 + 38) |= 8u; | |
3870 *(short *)(v55 + 148) = v1; | |
3871 v672 = v1; | |
3872 *(short *)(v55 + 150) = v1; | |
3873 v661 = (Actor *)v55; | |
3874 goto LABEL_165; | |
3875 case 35: | |
3876 if ( v12 == 2 ) | |
3877 { | |
3878 v57 = 300 * v2; | |
3879 } | |
3880 else | |
3881 { | |
3882 if ( v12 == 3 ) | |
3883 { | |
3884 amount = 4; | |
3885 v57 = 300 * v2; | |
3886 goto LABEL_174; | |
3887 } | |
3888 if ( v12 == 4 ) | |
3889 { | |
3890 v57 = 300 * v2; | |
3891 amount = 8; | |
3892 goto LABEL_174; | |
3893 } | |
3894 v57 = 180 * v2; | |
3895 } | |
3896 amount = 2; | |
3897 LABEL_174: | |
3898 LODWORD(v733) = v57; | |
3899 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3900 goto LABEL_83; | |
141 | 3901 if ( (a2 & 7) != OBJECT_Actor |
0 | 3902 || (v721 = 836 * (a2 >> 3), |
90 | 3903 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3904 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3905 goto LABEL_1056; |
3906 v726 = (Player *)(23040 * v2); | |
3907 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3908 v59 = v721; | |
112 | 3909 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3910 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3911 pParty->uTimePlayed + (signed int)v58, | |
0 | 3912 v731, |
3913 amount, | |
3914 v1, | |
3915 v1); | |
3916 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; | |
3917 v672 = v1; | |
3918 v661 = (Actor *)LODWORD(v718); | |
3919 goto LABEL_165; | |
3920 case 60: | |
3921 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3922 goto LABEL_83; | |
3923 v730 = 836 * (a2 >> 3); | |
90 | 3924 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3925 goto LABEL_1056; |
3926 LODWORD(v733) = 300 * v2; | |
3927 if ( v731 == 2 ) | |
3928 { | |
3929 LODWORD(v733) = 600 * v2; | |
3930 } | |
3931 else | |
3932 { | |
3933 if ( v731 == 3 ) | |
3934 LODWORD(v733) = 29030400; | |
3935 } | |
112 | 3936 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3937 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3938 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3939 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3940 v726 = (Player *)((int)v733 << 7); | |
3941 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3942 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3943 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
3944 v731, | |
3945 v1, | |
3946 v1, | |
3947 v1); | |
3948 a1.stru_24.Reset(); | |
3949 a1.field_48 = v3->spellnum; | |
3950 a1.field_4C = v2; | |
3951 a1.field_50 = v731; | |
3952 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 3953 v61 = a2 >> 3; |
0 | 3954 goto LABEL_1086; |
3955 case 92: | |
3956 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3957 goto LABEL_83; | |
3958 a1.stru_24.Reset(); | |
3959 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3960 a1.vPosition.x = pParty->vPosition.x; | |
3961 a1.vPosition.y = pParty->vPosition.y; | |
3962 a1.uAttributes = v1; | |
3963 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3964 a1.uSectorID = pIndoor->GetSector( | |
3965 pParty->vPosition.x, | |
3966 pParty->vPosition.y, | |
3967 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3968 a1.uSpriteFrameID = v1; | |
3969 v62 = 8 * v3->uPlayerID; | |
3970 LOBYTE(v62) = v62 | 4; | |
3971 a1.field_58 = v62; | |
3972 a1.field_5C = a2; | |
3973 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3974 a1.uFacing = LOWORD(v715.uYawAngle); | |
3975 a1.uSoundID = LOWORD(v3->field_10); | |
3976 a1.field_50 = v731; | |
3977 a1.field_48 = 3; | |
3978 a1.field_4C = 300 * v2; | |
3979 goto LABEL_154; | |
3980 case 4: | |
3981 v63 = v12 - 1; | |
3982 if ( !v63 ) | |
3983 { | |
3984 amount = 10; | |
3985 goto LABEL_195; | |
3986 } | |
3987 v64 = v63 - 1; | |
3988 if ( !v64 ) | |
3989 { | |
3990 amount = 11; | |
3991 goto LABEL_195; | |
3992 } | |
3993 v65 = v64 - 1; | |
3994 if ( !v65 ) | |
3995 { | |
3996 amount = 12; | |
3997 LABEL_195: | |
3998 LODWORD(v733) = 3600 * v2; | |
3999 goto LABEL_196; | |
4000 } | |
4001 if ( v65 == 1 ) | |
4002 { | |
4003 LODWORD(v733) = v1; | |
4004 amount = 12; | |
4005 } | |
4006 LABEL_196: | |
4007 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4008 goto LABEL_83; | |
89 | 4009 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
4010 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
4011 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
4012 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
4013 { | |
4014 if ( !(v730c->uAttributes & 2) ) | |
0 | 4015 { |
89 | 4016 if ( v730c->uAdditionalValue == v1 ) |
0 | 4017 { |
89 | 4018 if ( v730c->_bonus_type == v1 ) |
0 | 4019 { |
4020 v68 = BYTE4(v726->pConditions[3]); | |
4021 if ( !v68 || v68 == 1 || v68 == 2 ) | |
4022 { | |
89 | 4023 if ( !pItemsTable->_456D5E_is_some_material(v730c) ) |
0 | 4024 { |
89 | 4025 v69 = v730c; |
0 | 4026 v14 = v731 == 4; |
4027 *(int *)(v730 + 12) = amount; | |
4028 if ( !v14 ) | |
4029 { | |
4030 v726 = (Player *)((int)v733 << 7); | |
4031 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
4032 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
4033 * 0.033333335); | |
4034 *(int *)(v69 + 20) |= 8u; | |
4035 } | |
4036 *(int *)(v69 + 20) |= 0x10u; | |
4037 LABEL_1055: | |
4038 dword_50C9A8 = 256; | |
4039 LABEL_1056: | |
4040 LODWORD(v727) = 1; | |
4041 LABEL_83: | |
4042 if ( v3->field_8 & 0x20 ) | |
4043 { | |
4044 LABEL_1162: | |
4045 if ( v727 != 0.0 ) | |
4046 pAudioPlayer->PlaySound( | |
4047 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4048 0, | |
4049 0, | |
4050 -1, | |
4051 0, | |
4052 v3->field_10, | |
4053 0, | |
4054 0); | |
4055 } | |
4056 else | |
4057 { | |
4058 if ( sRecoveryTime < 0 ) | |
4059 sRecoveryTime = 0; | |
4060 if ( pParty->bTurnBasedModeOn ) | |
4061 { | |
4062 v645 = sRecoveryTime; | |
4063 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4064 pPlayer->SetRecoveryTime(v645); | |
4065 if ( !some_active_character ) | |
4066 pTurnEngine->_40471C(); | |
4067 } | |
4068 else | |
4069 { | |
4070 pPlayer->SetRecoveryTime( | |
4071 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4072 } | |
4073 if ( v727 != 0.0 ) | |
4074 { | |
187 | 4075 pPlayer->PlaySound(SPEECH_49, 0); |
0 | 4076 goto LABEL_1162; |
4077 } | |
4078 } | |
4079 v3->spellnum = 0; | |
4080 v1 = 0; | |
4081 LABEL_1165: | |
4082 v2 = v723; | |
4083 goto LABEL_1166; | |
4084 } | |
4085 } | |
4086 } | |
4087 } | |
4088 } | |
4089 } | |
4090 LABEL_199: | |
4091 dword_50C9D0 = 113; | |
4092 dword_50C9D4 = v1; | |
4093 dword_50C9D8 = 1; | |
4094 LABEL_200: | |
4095 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4096 LABEL_201: | |
4097 v67 = 2; | |
4098 LABEL_202: | |
4099 ShowStatusBarString(v66, v67); | |
4100 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4101 goto LABEL_203; | |
4102 case 71: | |
4103 v70 = v12 - 1; | |
4104 LODWORD(v733) = 3600 * v2; | |
4105 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4106 { | |
4107 v72 = v71 - 1; | |
4108 if ( v72 ) | |
4109 { | |
4110 if ( v72 == 1 ) | |
4111 amount = 10; | |
4112 } | |
4113 else | |
4114 { | |
4115 amount = 3; | |
4116 } | |
4117 } | |
4118 else | |
4119 { | |
4120 amount = 1; | |
4121 } | |
4122 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4123 goto LABEL_83; | |
4124 v73 = v3->uPlayerID_2; | |
4125 v74 = v3->spellnum; | |
4126 v75 = pGame->GetStru6(); | |
4127 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); | |
4128 v668 = v1; | |
4129 v658 = v1; | |
4130 v653 = amount; | |
4131 v651 = v731; | |
4132 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); | |
4133 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; | |
4134 goto LABEL_103; | |
4135 case 3: | |
4136 case 14: | |
4137 case 25: | |
4138 case 36: | |
4139 case 58: | |
4140 case 69: | |
4141 v76 = v12 - 1; | |
4142 LODWORD(v733) = 3600 * v2; | |
4143 if ( v76 ) | |
4144 { | |
4145 v77 = v76 - 1; | |
4146 if ( v77 ) | |
4147 { | |
4148 v78 = v77 - 1; | |
4149 if ( v78 ) | |
4150 { | |
4151 if ( v78 != 1 ) | |
4152 goto LABEL_232; | |
4153 v79 = 4 * v2; | |
4154 } | |
4155 else | |
4156 { | |
4157 v79 = 3 * v2; | |
4158 } | |
4159 } | |
4160 else | |
4161 { | |
4162 v79 = 2 * v2; | |
4163 } | |
4164 amount = v79; | |
4165 } | |
4166 else | |
4167 { | |
4168 amount = v2; | |
4169 } | |
4170 LABEL_232: | |
4171 v80 = v3->spellnum; | |
4172 switch ( v80 ) | |
4173 { | |
4174 case 3: | |
4175 LODWORD(v725) = 6; | |
4176 break; | |
4177 case 14: | |
4178 LODWORD(v725) = v1; | |
4179 break; | |
4180 case 25: | |
4181 LODWORD(v725) = 17; | |
4182 break; | |
4183 case 36: | |
4184 LODWORD(v725) = 4; | |
4185 break; | |
4186 case 58: | |
4187 LODWORD(v725) = 12; | |
4188 break; | |
4189 default: | |
4190 if ( v80 != 69 ) | |
4191 goto LABEL_1166; | |
4192 LODWORD(v725) = 1; | |
4193 break; | |
4194 } | |
4195 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4196 goto LABEL_83; | |
4197 v81 = v3->spellnum; | |
4198 v82 = pGame->GetStru6(); | |
4199 pGame->GetStru6()->SetPlayerBuffAnim(v81, v1); | |
4200 v83 = 1; | |
4201 v84 = v3->spellnum; | |
4202 v85 = pGame->GetStru6(); | |
4203 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1u); | |
4204 v86 = v3->spellnum; | |
4205 v87 = pGame->GetStru6(); | |
4206 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2u); | |
4207 v88 = v3->spellnum; | |
4208 v89 = pGame->GetStru6(); | |
4209 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3u); | |
4210 v90 = (double)(signed int)v733 * 4.2666669; | |
4211 goto LABEL_304; | |
4212 case 5: | |
4213 if ( v12 <= v1 ) | |
4214 goto LABEL_254; | |
4215 if ( v12 <= 2 ) | |
4216 { | |
4217 v91 = 60 * (v2 + 60); | |
4218 } | |
4219 else | |
4220 { | |
4221 if ( v12 == 3 ) | |
4222 { | |
4223 v91 = 180 * (v2 + 20); | |
4224 } | |
4225 else | |
4226 { | |
4227 if ( v12 != 4 ) | |
4228 goto LABEL_254; | |
4229 v91 = 240 * (v2 + 15); | |
4230 } | |
4231 } | |
4232 LODWORD(v733) = v91; | |
4233 LABEL_254: | |
4234 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4235 { | |
89 | 4236 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4237 LODWORD(v727) = 1; |
4238 do | |
4239 { | |
89 | 4240 if ( v92->pConditions ) |
0 | 4241 LODWORD(v727) = v1; |
89 | 4242 ++v92; |
0 | 4243 } |
89 | 4244 while ( v92 <= &pParty->pPlayers[3] ); |
0 | 4245 if ( LODWORD(v727) != v1 ) |
4246 { | |
4247 v726 = (Player *)((int)v733 << 7); | |
4248 pParty->pPartyBuffs[8].Apply( | |
4249 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
4250 v731, | |
4251 v1, | |
4252 v1, | |
4253 v1); | |
4254 v93 = v3->spellnum; | |
4255 v94 = pGame->GetStru6(); | |
4256 pGame->GetStru6()->SetPlayerBuffAnim(v93, v1); | |
4257 v95 = v3->spellnum; | |
4258 v96 = pGame->GetStru6(); | |
4259 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1u); | |
4260 v97 = v3->spellnum; | |
4261 v98 = pGame->GetStru6(); | |
4262 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2u); | |
4263 v99 = v3->spellnum; | |
4264 v100 = pGame->GetStru6(); | |
4265 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3u); | |
4266 } | |
4267 } | |
4268 goto LABEL_83; | |
4269 case 46: | |
4270 v101 = v12 - 1; | |
4271 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4272 { | |
4273 v103 = v102 - 1; | |
4274 if ( v103 ) | |
4275 { | |
4276 if ( v103 != 1 ) | |
4277 goto LABEL_269; | |
4278 v104 = 3600 * (v2 + 1); | |
4279 } | |
4280 else | |
4281 { | |
4282 v104 = 900 * (v2 + 4); | |
4283 } | |
4284 } | |
4285 else | |
4286 { | |
4287 v104 = 300 * (v2 + 12); | |
4288 } | |
4289 LODWORD(v733) = v104; | |
4290 LABEL_269: | |
4291 amount = v2 + 5; | |
4292 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4293 goto LABEL_83; | |
4294 if ( v731 == 1 ) | |
4295 { | |
4296 v108 = v3->uPlayerID_2; | |
4297 v109 = v3->spellnum; | |
4298 v110 = pGame->GetStru6(); | |
4299 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
4300 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, v1, 65536); | |
4301 v668 = v1; | |
4302 v716 = v111; | |
4303 v658 = v111; | |
4304 v653 = amount; | |
4305 v726 = (Player *)((int)v733 << 7); | |
4306 v651 = 1; | |
4307 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4308 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[1]; | |
4309 goto LABEL_103; | |
4310 } | |
4311 v105 = 0; | |
4312 v726 = (Player *)((int)v733 << 7); | |
4313 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4314 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4315 do |
4316 { | |
4317 v106 = v3->spellnum; | |
4318 v107 = pGame->GetStru6(); | |
4319 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); | |
4320 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, v1, 65536); | |
89 | 4321 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
4322 ++v730b; | |
0 | 4323 ++v105; |
4324 } | |
89 | 4325 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4326 goto LABEL_1056; |
4327 case 52: | |
141 | 4328 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == OBJECT_Actor) |
0 | 4329 { |
4330 v730 = a2 >> 3; | |
4331 v112 = &pActors[a2 >> 3]; | |
4332 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4333 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4334 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4335 _this = (ItemGen *)v113; | |
4336 v114 = v721; | |
4337 v115 = (unsigned int)v726; | |
4338 if ( v113 < v721 ) | |
4339 { | |
4340 v116 = v113; | |
4341 v113 = v721; | |
4342 v114 = v116; | |
4343 } | |
4344 if ( v113 < (signed int)v726 ) | |
4345 { | |
4346 v117 = v113; | |
4347 v113 = (int)v726; | |
4348 v115 = v117; | |
4349 } | |
4350 if ( v114 < (signed int)v115 ) | |
4351 { | |
4352 v118 = v115; | |
4353 v115 = v114; | |
4354 v114 = v118; | |
4355 } | |
4356 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4357 if ( (double)(signed int)this <= 307.2 ) | |
4358 { | |
4359 v703 = 0; | |
4360 v702 = 0; | |
4361 v701 = 0; | |
4362 a1.stru_24.Reset(); | |
4363 v119 = HIDWORD(v733); | |
4364 a1.field_48 = *(int *)HIDWORD(v733); | |
4365 a1.field_4C = v723; | |
4366 a1.field_50 = v731; | |
4367 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4368 a1.uAttributes = 0; | |
4369 a1.uSectorID = 0; | |
4370 a1.uSpriteFrameID = 0; | |
4371 v120 = 8 * *(short *)(v119 + 2); | |
4372 LOBYTE(v120) = v120 | 4; | |
4373 a1.field_60_distance_related_prolly_lod = 0; | |
4374 a1.field_58 = v120; | |
4375 a1.uFacing = 0; | |
4376 a1.uSoundID = *(short *)(v119 + 16); | |
4377 a1.vPosition.x = v112->vPosition.x; | |
4378 a1.vPosition.y = v112->vPosition.y; | |
4379 v726 = (Player *)v112->uActorHeight; | |
4380 v121 = 8 * a2; | |
4381 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4382 LOBYTE(v121) = 8 * a2 | 3; | |
4383 a1.field_5C = v121; | |
4384 v122 = a1.Create(0, 0, 0, 0); | |
4385 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4386 LODWORD(v727) = 1; | |
4387 } | |
4388 else | |
4389 { | |
4390 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4391 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4392 *(int *)HIDWORD(v733) = 0; | |
4393 } | |
4394 v3 = (stru277 *)HIDWORD(v733); | |
4395 } | |
4396 goto LABEL_83; | |
4397 case 17: | |
4398 case 38: | |
4399 case 51: | |
4400 v123 = v12 - 1; | |
4401 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4402 { | |
4403 v125 = v124 - 1; | |
4404 if ( v125 ) | |
4405 { | |
4406 if ( v125 != 1 ) | |
4407 goto LABEL_296; | |
4408 v126 = 3600 * (v2 + 1); | |
4409 } | |
4410 else | |
4411 { | |
4412 v126 = 900 * (v2 + 4); | |
4413 } | |
4414 } | |
4415 else | |
4416 { | |
4417 v126 = 300 * (v2 + 12); | |
4418 } | |
4419 LODWORD(v733) = v126; | |
4420 LABEL_296: | |
4421 v127 = v3->spellnum; | |
4422 if ( v127 == 17 ) | |
4423 { | |
4424 amount = v1; | |
4425 LODWORD(v725) = 14; | |
4426 } | |
4427 else | |
4428 { | |
4429 if ( v127 == 38 ) | |
4430 { | |
4431 LODWORD(v725) = 15; | |
4432 amount = v2 + 5; | |
4433 } | |
4434 else | |
4435 { | |
4436 if ( v127 != 51 ) | |
4437 goto LABEL_1166; | |
4438 LODWORD(v725) = 9; | |
4439 amount = v2 + 5; | |
4440 } | |
4441 } | |
4442 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4443 goto LABEL_83; | |
4444 v128 = v3->spellnum; | |
4445 v129 = pGame->GetStru6(); | |
4446 pGame->GetStru6()->SetPlayerBuffAnim(v128, v1); | |
4447 v83 = 1; | |
4448 v130 = v3->spellnum; | |
4449 v131 = pGame->GetStru6(); | |
4450 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1u); | |
4451 v132 = v3->spellnum; | |
4452 v133 = pGame->GetStru6(); | |
4453 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2u); | |
4454 v134 = v3->spellnum; | |
4455 v135 = pGame->GetStru6(); | |
4456 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3u); | |
4457 v726 = (Player *)((int)v733 << 7); | |
4458 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
4459 LABEL_304: | |
4460 v673 = v1; | |
4461 v662 = v1; | |
4462 v655 = amount; | |
4463 v652 = v731; | |
4464 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; | |
4465 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; | |
4466 goto LABEL_977; | |
4467 case 8: | |
4468 v138 = v12 - 2; | |
4469 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4470 v140 = 600 * v2; | |
4471 else | |
4472 v140 = 60 * v2; | |
4473 LODWORD(v733) = v140; | |
4474 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4475 goto LABEL_83; | |
4476 v141 = v3->spellnum; | |
4477 v142 = pGame->GetStru6(); | |
4478 pGame->GetStru6()->SetPlayerBuffAnim(v141, v1); | |
4479 v143 = v3->spellnum; | |
4480 v144 = pGame->GetStru6(); | |
4481 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1u); | |
4482 v145 = v3->spellnum; | |
4483 v146 = pGame->GetStru6(); | |
4484 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2u); | |
4485 v147 = v3->spellnum; | |
4486 v148 = pGame->GetStru6(); | |
4487 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3u); | |
4488 v668 = v1; | |
4489 v726 = (Player *)((int)v733 << 7); | |
4490 v658 = v1; | |
4491 v653 = v2; | |
4492 v651 = v731; | |
4493 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4494 v27 = (char *)&pParty->pPartyBuffs[10]; | |
4495 goto LABEL_102; | |
4496 case 9: | |
4497 v149 = v12 - 1; | |
4498 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4499 { | |
4500 if ( v151 == 1 ) | |
4501 _this = (ItemGen *)20; | |
4502 } | |
4503 else | |
4504 { | |
4505 _this = (ItemGen *)16; | |
4506 } | |
4507 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4508 { | |
4509 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4510 goto LABEL_201; | |
4511 } | |
4512 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4513 goto LABEL_83; | |
4514 LODWORD(v725) = a2 & 7; | |
141 | 4515 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4516 { |
4517 v152 = a2 >> 3; | |
4518 uRequiredMana = pActors[v152].vPosition.x; | |
4519 v153 = pActors[v152].vPosition.y; | |
4520 v154 = pActors[v152].vPosition.z; | |
4521 LODWORD(v727) = v153; | |
4522 } | |
4523 else | |
4524 { | |
4525 v155 = stru_5C6E00->SinCos(pParty->sRotationY); | |
4526 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); | |
4527 v156 = stru_5C6E00->_42EBDB(pParty->sRotationY); | |
4528 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); | |
4529 v154 = pParty->vPosition.z; | |
4530 } | |
4531 HIDWORD(v733) = v154; | |
4532 v713 = v154 + 2500; | |
4533 v721 = v1; | |
4534 LODWORD(v718) = v1; | |
4535 if ( (signed int)this > v1 ) | |
4536 { | |
4537 *(float *)&y = (double)SHIDWORD(v733); | |
4538 *(float *)&v732 = (double)v713; | |
4539 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4540 v726 = (Player *)this; | |
4541 do | |
4542 { | |
4543 v157 = rand(); | |
4544 v158 = (double)SLODWORD(v718); | |
4545 v718 = v158; | |
4546 v159 = (double)v721; | |
4547 *(float *)&v721 = v159; | |
4548 a2 = v157 % 1000; | |
4549 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4550 v725 = v159 * v159; | |
4551 *(float *)&_this = v158 * v158; | |
4552 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4553 { | |
4554 LODWORD(v687) = v1; | |
4555 HIDWORD(v687) = v1; | |
4556 } | |
4557 else | |
4558 { | |
4559 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4560 v687 = __PAIR__( | |
4561 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4562 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4563 } | |
4564 a1.stru_24.Reset(); | |
4565 a1.field_48 = v3->spellnum; | |
4566 a1.field_4C = v2; | |
4567 a1.field_50 = v731; | |
4568 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4569 a1.uAttributes = v1; | |
4570 a1.vPosition.x = uRequiredMana; | |
4571 a1.vPosition.y = LODWORD(v727); | |
4572 a1.uSectorID = v1; | |
4573 a1.vPosition.z = a2 + v713; | |
4574 a1.uSpriteFrameID = v1; | |
4575 a1.field_58 = 8 * v3->uPlayerID | 4; | |
4576 a1.field_5C = v730; | |
4577 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4578 a1.uFacing = v687; | |
4579 a1.uSoundID = LOWORD(v3->field_10); | |
4580 if ( pParty->bTurnBasedModeOn == 1 ) | |
4581 a1.uAttributes = 4; | |
4582 if ( a1.Create( | |
4583 v687, | |
4584 SHIDWORD(v687), | |
4585 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4586 v1) != -1 | |
4587 && pParty->bTurnBasedModeOn == 1 ) | |
4588 ++pTurnEngine->field_1C; | |
4589 LODWORD(v718) = rand() % 1024 - 512; | |
4590 v160 = rand(); | |
4591 v14 = v726 == (Player *)1; | |
4592 v726 = (Player *)((char *)v726 - 1); | |
4593 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4594 } | |
4595 while ( !v14 ); | |
4596 } | |
4597 goto LABEL_1056; | |
4598 case 10: | |
4599 v67 = 2; | |
4600 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4601 { | |
4602 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4603 goto LABEL_202; | |
4604 } | |
4605 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4606 goto LABEL_83; | |
4607 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
4608 v700.z = v1; | |
4609 v700.y = v1; | |
4610 v700.x = v1; | |
4611 a1.stru_24.Reset(); | |
4612 a1.field_48 = v3->spellnum; | |
4613 a1.field_4C = v2; | |
4614 a1.field_50 = v731; | |
4615 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4616 a1.uAttributes = v1; | |
4617 a1.uSectorID = v1; | |
4618 a1.uSpriteFrameID = v1; | |
4619 v161 = v3->uPlayerID; | |
4620 a1.field_60_distance_related_prolly_lod = 0; | |
4621 a1.uFacing = v1; | |
4622 v161 *= 8; | |
4623 LOBYTE(v161) = v161 | 4; | |
4624 a1.field_58 = v161; | |
4625 a1.uSoundID = LOWORD(v3->field_10); | |
4626 a2 = v1; | |
4627 if ( (signed int)v726 > v1 ) | |
4628 { | |
4629 do | |
4630 { | |
4631 v162 = dword_50BF30[a2]; | |
4632 a1.vPosition.x = pActors[v162].vPosition.x; | |
4633 a1.vPosition.y = pActors[v162].vPosition.y; | |
4634 v732 = pActors[v162].uActorHeight; | |
4635 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4636 v163 = 8 * dword_50BF30[a2]; | |
4637 LOBYTE(v163) = v163 | 3; | |
4638 a1.field_5C = v163; | |
4639 v164 = a1.Create(0, v1, v1, v1); | |
4640 v165 = a2; | |
4641 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
4642 v166 = pGame->GetStru6(); | |
4643 v166->_4A81CA(&a1); | |
4644 v167 = pGame->GetStru6(); | |
4645 v167->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
4646 a2 = v165 + 1; | |
4647 } | |
4648 while ( v165 + 1 < (signed int)v726 ); | |
4649 } | |
4650 goto LABEL_1056; | |
4651 case 12: | |
4652 LODWORD(v733) = 3600 * v2; | |
4653 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4654 goto LABEL_83; | |
4655 v168 = 0; | |
4656 do | |
4657 { | |
4658 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, v1, 65536); | |
4659 v716 = v169; | |
4660 } | |
4661 while ( v168 < 4 ); | |
4662 v668 = v1; | |
4663 v732 = (int)v733 << 7; | |
4664 v658 = v1; | |
4665 v653 = v1; | |
4666 v651 = v731; | |
4667 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4668 goto LABEL_992; | |
4669 case 13: | |
4670 v170 = v12 - 1; | |
4671 if ( !v170 ) | |
4672 { | |
4673 v173 = 300 * v2; | |
4674 goto LABEL_353; | |
4675 } | |
4676 v171 = v170 - 1; | |
4677 if ( !v171 ) | |
4678 { | |
4679 v173 = 600 * v2; | |
4680 goto LABEL_353; | |
4681 } | |
4682 v172 = v171 - 1; | |
4683 if ( !v172 || v172 == 1 ) | |
4684 { | |
4685 v173 = 3600 * v2; | |
4686 LABEL_353: | |
4687 LODWORD(v733) = v173; | |
4688 } | |
4689 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4690 goto LABEL_83; | |
4691 v174 = 0; | |
4692 do | |
4693 pOtherOverlayList->_4418B1(2010, v174++ + 100, v1, 65536); | |
4694 while ( v174 < 4 ); | |
4695 v175 = v3->spellnum; | |
4696 v176 = pGame->GetStru6(); | |
4697 pGame->GetStru6()->SetPlayerBuffAnim(v175, v1); | |
4698 v83 = 1; | |
4699 v177 = v3->spellnum; | |
4700 v178 = pGame->GetStru6(); | |
4701 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1u); | |
4702 v179 = v3->spellnum; | |
4703 v180 = pGame->GetStru6(); | |
4704 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2u); | |
4705 v181 = v3->spellnum; | |
4706 v182 = pGame->GetStru6(); | |
4707 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3u); | |
4708 v673 = v1; | |
4709 v732 = (int)v733 << 7; | |
4710 v662 = v1; | |
4711 v655 = v1; | |
4712 v652 = v731; | |
4713 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4714 v137 = (char *)&pParty->pPartyBuffs[5]; | |
4715 goto LABEL_976; | |
4716 case 15: | |
4717 v184 = v12 - 1; | |
4718 if ( v184 ) | |
4719 { | |
4720 v185 = v184 - 1; | |
4721 if ( v185 ) | |
4722 { | |
4723 v186 = v185 - 1; | |
4724 if ( v186 ) | |
4725 { | |
4726 if ( v186 == 1 ) | |
4727 amount = 9; | |
4728 } | |
4729 else | |
4730 { | |
4731 amount = 7; | |
4732 } | |
4733 } | |
4734 else | |
4735 { | |
4736 amount = 5; | |
4737 } | |
4738 } | |
4739 else | |
4740 { | |
4741 amount = 3; | |
4742 } | |
4743 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4744 goto LABEL_83; | |
4745 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
4746 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4747 a1.stru_24.Reset(); | |
4748 a1.field_48 = v3->spellnum; | |
4749 a1.field_4C = v2; | |
4750 a1.field_50 = v731; | |
4751 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4752 a1.vPosition.y = pParty->vPosition.y; | |
4753 a1.vPosition.x = pParty->vPosition.x; | |
4754 a1.uAttributes = v1; | |
4755 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4756 a1.uSectorID = pIndoor->GetSector( | |
4757 pParty->vPosition.x, | |
4758 pParty->vPosition.y, | |
4759 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
4760 a1.uSpriteFrameID = v1; | |
4761 v187 = 8 * v3->uPlayerID; | |
4762 LOBYTE(v187) = v187 | 4; | |
4763 a1.field_58 = v187; | |
4764 a1.field_5C = a2; | |
4765 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4766 a1.uSoundID = LOWORD(v3->field_10); | |
4767 if ( pParty->bTurnBasedModeOn == 1 ) | |
4768 LOBYTE(a1.uAttributes) |= 4u; | |
4769 v188 = (signed int)v726 / -2; | |
4770 v189 = (signed int)v726 / 2; | |
4771 while ( v188 <= v189 ) | |
4772 { | |
4773 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4774 if ( a1.Create( | |
4775 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4776 v715.uPitchAngle, | |
4777 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4778 v3->uPlayerID + 1) != -1 | |
4779 && pParty->bTurnBasedModeOn == 1 ) | |
4780 ++pTurnEngine->field_1C; | |
4781 v188 += v732; | |
4782 } | |
4783 goto LABEL_1056; | |
4784 case 16: | |
4785 if ( pParty->uFlags & 8 ) | |
4786 { | |
4787 v190 = pGlobalTXT_LocalizationStrings[493]; | |
4788 goto LABEL_462; | |
4789 } | |
4790 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4791 goto LABEL_83; | |
4792 v191 = 0; | |
4793 do | |
4794 pOtherOverlayList->_4418B1(2040, v191++ + 100, v1, 65536); | |
4795 while ( v191 < 4 ); | |
4796 BYTE1(pParty->uFlags) |= 1u; | |
4797 pParty->uFallSpeed = 1000; | |
4798 goto LABEL_1056; | |
4799 case 19: | |
4800 v192 = v12 - 1; | |
4801 if ( !v192 ) | |
4802 { | |
4803 amount = v2; | |
4804 goto LABEL_391; | |
4805 } | |
4806 v193 = v192 - 1; | |
4807 if ( !v193 ) | |
4808 { | |
4809 v196 = 2 * v2; | |
4810 LABEL_389: | |
4811 amount = v196; | |
4812 LABEL_391: | |
4813 v195 = 600 * v2; | |
4814 goto LABEL_392; | |
4815 } | |
4816 v194 = v193 - 1; | |
4817 if ( !v194 ) | |
4818 { | |
4819 v196 = 3 * v2; | |
4820 goto LABEL_389; | |
4821 } | |
4822 if ( v194 != 1 ) | |
4823 goto LABEL_393; | |
4824 amount = 4 * v2; | |
4825 v195 = 3600 * v2; | |
4826 LABEL_392: | |
4827 LODWORD(v733) = v195; | |
4828 LABEL_393: | |
4829 if ( pParty->uFlags & 0x30 ) | |
4830 { | |
4831 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4832 goto LABEL_201; | |
4833 } | |
4834 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4835 { | |
4836 v197 = v3->spellnum; | |
4837 v198 = pGame->GetStru6(); | |
4838 pGame->GetStru6()->SetPlayerBuffAnim(v197, v1); | |
4839 v83 = 1; | |
4840 v199 = v3->spellnum; | |
4841 v200 = pGame->GetStru6(); | |
4842 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1u); | |
4843 v201 = v3->spellnum; | |
4844 v202 = pGame->GetStru6(); | |
4845 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2u); | |
4846 v203 = v3->spellnum; | |
4847 v204 = pGame->GetStru6(); | |
4848 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3u); | |
4849 v673 = v1; | |
4850 v732 = (int)v733 << 7; | |
4851 v662 = v1; | |
4852 v655 = amount; | |
4853 v652 = v731; | |
4854 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4855 v137 = (char *)&pParty->pPartyBuffs[11]; | |
4856 LABEL_976: | |
4857 v136 = pParty->uTimePlayed + v183; | |
4858 LABEL_977: | |
4859 ((SpellBuff *)v137)->Apply(v136, v652, v655, v662, v673); | |
4860 LABEL_978: | |
4861 LODWORD(v727) = v83; | |
4862 } | |
4863 goto LABEL_83; | |
4864 case 21: | |
4865 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4866 { | |
4867 v190 = pGlobalTXT_LocalizationStrings[494]; | |
4868 LABEL_462: | |
4869 ShowStatusBarString(v190, 2u); | |
4870 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4871 goto LABEL_83; | |
4872 } | |
4873 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4874 { | |
4875 LABEL_461: | |
4876 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4877 goto LABEL_462; | |
4878 } | |
4879 LODWORD(v733) = 3600 * v2; | |
4880 if ( v731 == 2 || v731 == 3 || (amount = v1, v731 != 4) ) | |
4881 amount = 1; | |
4882 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4883 goto LABEL_83; | |
4884 v205 = 0; | |
4885 do | |
4886 pOtherOverlayList->_4418B1(2090, v205++ + 100, v1, 65536); | |
4887 while ( v205 < 4 ); | |
4888 v206 = pOtherOverlayList->_4418B1(10008, 203, v1, 65536); | |
4889 v207 = v3->uPlayerID + 1; | |
4890 v716 = v206; | |
4891 v668 = v207; | |
4892 v658 = v206; | |
4893 v653 = amount; | |
4894 v732 = (int)v733 << 7; | |
4895 v651 = v731; | |
4896 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4897 v27 = (char *)&pParty->pPartyBuffs[7]; | |
4898 LABEL_101: | |
4899 v26 = (signed int)v26; | |
4900 LABEL_102: | |
4901 v28 = pParty->uTimePlayed + v26; | |
4902 LABEL_103: | |
4903 HIDWORD(v650) = HIDWORD(v28); | |
4904 LABEL_104: | |
4905 LODWORD(v650) = v28; | |
4906 ((SpellBuff *)v27)->Apply(v650, v651, v653, v658, v668); | |
4907 goto LABEL_1056; | |
4908 case 22: | |
4909 v67 = 2; | |
4910 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4911 { | |
4912 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4913 goto LABEL_202; | |
4914 } | |
4915 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4916 goto LABEL_83; | |
4917 v208 = a2 & 7; | |
4918 LODWORD(v725) = a2 & 7; | |
4919 if ( v208 == 3 ) | |
4920 { | |
4921 v209 = a2 >> 3; | |
4922 LODWORD(v718) = pActors[v209].vPosition.x; | |
4923 v210 = pActors[v209].vPosition.y; | |
4924 v211 = pActors[v209].vPosition.z; | |
4925 v713 = v210; | |
4926 } | |
4927 else | |
4928 { | |
4929 v212 = stru_5C6E00->SinCos(pParty->sRotationY); | |
4930 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); | |
4931 v213 = stru_5C6E00->_42EBDB(pParty->sRotationY); | |
4932 v214 = sub_42EBBE(2048, v213); | |
4933 v211 = pParty->vPosition.z; | |
4934 v713 = pParty->vPosition.y + v214; | |
4935 v208 = LODWORD(v725); | |
4936 } | |
4937 v726 = (Player *)v211; | |
4938 HIDWORD(v733) = v1; | |
4939 *(float *)&v732 = (double)v211; | |
4940 LODWORD(v725) = v211 + 2500; | |
4941 v721 = v1; | |
4942 *(float *)&y = (double)(v211 + 2500); | |
4943 v730 = v208 == 3 ? a2 : 0; | |
4944 a2 = 20; | |
4945 do | |
4946 { | |
4947 v215 = rand(); | |
4948 v216 = (double)v721; | |
4949 v727 = v216; | |
4950 v217 = (double)SHIDWORD(v733); | |
4951 *(float *)&uRequiredMana = v217; | |
4952 _this = (ItemGen *)(v215 % 1000); | |
4953 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4954 *(float *)&v721 = v217 * v217; | |
4955 *(float *)&v726 = v216 * v216; | |
4956 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4957 { | |
4958 LODWORD(v685) = v1; | |
4959 HIDWORD(v685) = v1; | |
4960 } | |
4961 else | |
4962 { | |
4963 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4964 v685 = __PAIR__( | |
4965 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4966 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4967 } | |
4968 a1.stru_24.Reset(); | |
4969 a1.field_48 = v3->spellnum; | |
4970 a1.field_4C = v2; | |
4971 a1.field_50 = v731; | |
4972 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4973 a1.uAttributes = v1; | |
4974 a1.vPosition.x = LODWORD(v718); | |
4975 a1.vPosition.y = v713; | |
4976 a1.uSectorID = v1; | |
4977 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); | |
4978 a1.uSpriteFrameID = v1; | |
4979 a1.field_58 = 8 * v3->uPlayerID | 4; | |
4980 a1.field_5C = v730; | |
4981 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4982 a1.uFacing = v685; | |
4983 a1.uSoundID = LOWORD(v3->field_10); | |
4984 if ( pParty->bTurnBasedModeOn == 1 ) | |
4985 a1.uAttributes = 4; | |
4986 if ( a1.Create( | |
4987 v685, | |
4988 SHIDWORD(v685), | |
4989 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4990 v1) != -1 | |
4991 && pParty->bTurnBasedModeOn == 1 ) | |
4992 ++pTurnEngine->field_1C; | |
4993 v721 = rand() % 1024 - 512; | |
4994 v218 = rand(); | |
4995 v14 = a2-- == 1; | |
4996 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4997 } | |
4998 while ( !v14 ); | |
4999 goto LABEL_1056; | |
5000 case 23: | |
5001 v219 = v12 - 2; | |
5002 if ( v219 ) | |
5003 { | |
5004 v220 = v219 - 1; | |
5005 if ( v220 ) | |
5006 { | |
5007 if ( v220 == 1 ) | |
5008 { | |
5009 amount = v1; | |
5010 goto LABEL_433; | |
5011 } | |
5012 v221 = 180 * v2; | |
5013 } | |
5014 else | |
5015 { | |
5016 v221 = 86400 * v2; | |
5017 } | |
5018 } | |
5019 else | |
5020 { | |
5021 v221 = 3600 * v2; | |
5022 } | |
5023 amount = v221; | |
5024 LABEL_433: | |
5025 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5026 goto LABEL_83; | |
5027 v222 = (char *)pParty->pPlayers; | |
5028 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
5029 break; | |
5030 case 24: | |
5031 v224 = v12 - 2; | |
5032 if ( v224 ) | |
5033 { | |
5034 v225 = v224 - 1; | |
5035 if ( v225 ) | |
5036 { | |
5037 if ( v225 == 1 ) | |
5038 amount = 7; | |
5039 else | |
5040 amount = 1; | |
5041 } | |
5042 else | |
5043 { | |
5044 amount = 5; | |
5045 } | |
5046 } | |
5047 else | |
5048 { | |
5049 amount = 3; | |
5050 } | |
5051 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5052 goto LABEL_83; | |
5053 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
5054 if ( amount == 1 ) | |
5055 { | |
5056 LABEL_152: | |
5057 a1.stru_24.Reset(); | |
5058 a1.field_48 = v3->spellnum; | |
5059 a1.field_50 = v731; | |
5060 a1.field_4C = v2; | |
5061 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5062 a1.vPosition.y = pParty->vPosition.y; | |
5063 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5064 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5065 v660 = pParty->vPosition.y; | |
5066 LABEL_153: | |
5067 a1.uAttributes = v1; | |
5068 a1.vPosition.x = pParty->vPosition.x; | |
5069 a1.vPosition.z = v51; | |
5070 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
5071 a1.uSpriteFrameID = v1; | |
5072 a1.uSectorID = v52; | |
5073 v53 = 8 * v3->uPlayerID; | |
5074 LOBYTE(v53) = v53 | 4; | |
5075 a1.field_58 = v53; | |
5076 a1.field_5C = a2; | |
5077 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5078 a1.uFacing = LOWORD(v715.uYawAngle); | |
5079 a1.uSoundID = LOWORD(v3->field_10); | |
5080 LABEL_154: | |
5081 if ( pParty->bTurnBasedModeOn == 1 ) | |
5082 LOBYTE(a1.uAttributes) |= 4u; | |
5083 LABEL_156: | |
5084 v669 = v3->uPlayerID + 1; | |
5085 v36 = v715.uYawAngle; | |
5086 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5087 v654 = v715.uPitchAngle; | |
5088 LABEL_157: | |
5089 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
5090 ++pTurnEngine->field_1C; | |
5091 } | |
5092 else | |
5093 { | |
5094 v732 = SHIDWORD(v733) / (amount - 1); | |
5095 a1.stru_24.Reset(); | |
5096 a1.field_48 = v3->spellnum; | |
5097 a1.field_4C = v2; | |
5098 a1.field_50 = v731; | |
5099 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5100 a1.vPosition.y = pParty->vPosition.y; | |
5101 a1.vPosition.x = pParty->vPosition.x; | |
5102 a1.uAttributes = v1; | |
5103 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5104 a1.uSectorID = pIndoor->GetSector( | |
5105 pParty->vPosition.x, | |
5106 pParty->vPosition.y, | |
5107 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5108 a1.uSpriteFrameID = v1; | |
5109 v226 = 8 * v3->uPlayerID; | |
5110 LOBYTE(v226) = v226 | 4; | |
5111 a1.field_58 = v226; | |
5112 a1.field_5C = a2; | |
5113 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5114 a1.uSoundID = LOWORD(v3->field_10); | |
5115 if ( pParty->bTurnBasedModeOn == 1 ) | |
5116 LOBYTE(a1.uAttributes) |= 4u; | |
5117 v227 = SHIDWORD(v733) / -2; | |
5118 y = (char *)(SHIDWORD(v733) / 2); | |
5119 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5120 { | |
5121 v228 = v715.uYawAngle; | |
5122 do | |
5123 { | |
5124 a1.uFacing = v227 + v228; | |
5125 if ( a1.Create( | |
5126 v227 + v228, | |
5127 v715.uPitchAngle, | |
5128 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5129 v3->uPlayerID + 1) != -1 | |
5130 && pParty->bTurnBasedModeOn == 1 ) | |
5131 ++pTurnEngine->field_1C; | |
5132 v227 += v732; | |
5133 } | |
5134 while ( v227 <= (signed int)y ); | |
5135 } | |
5136 } | |
5137 goto LABEL_1056; | |
5138 case 27: | |
5139 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5140 goto LABEL_461; | |
5141 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5142 v229 = 600 * v2; | |
5143 else | |
5144 v229 = 3600 * v2; | |
5145 LODWORD(v733) = v229; | |
5146 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5147 goto LABEL_83; | |
5148 v716 = pOtherOverlayList->_4418B1(10005, 201, v1, 65536); | |
5149 v230 = v3->spellnum; | |
5150 v231 = pGame->GetStru6(); | |
5151 pGame->GetStru6()->SetPlayerBuffAnim(v230, v1); | |
5152 v232 = 1; | |
5153 v233 = v3->spellnum; | |
5154 v234 = pGame->GetStru6(); | |
5155 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1u); | |
5156 v235 = v3->spellnum; | |
5157 v236 = pGame->GetStru6(); | |
5158 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2u); | |
5159 v237 = v3->spellnum; | |
5160 v238 = pGame->GetStru6(); | |
5161 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3u); | |
5162 v239 = v3->uPlayerID + 1; | |
5163 v732 = v229 << 7; | |
5164 pParty->pPartyBuffs[18].Apply( | |
5165 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5166 v731, | |
5167 amount, | |
5168 v716, | |
5169 v239); | |
5170 if ( v731 == 4 ) | |
5171 pParty->pPartyBuffs[18].uFlags = 1; | |
89 | 5172 LODWORD(v727) = v232; |
5173 goto LABEL_83; | |
0 | 5174 case 28: |
5175 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5176 goto LABEL_83; | |
5177 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; | |
5178 y = v240; | |
5179 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5180 goto LABEL_199; | |
5181 if ( v731 == 1 || v731 == 2 ) | |
5182 { | |
5183 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5184 } | |
5185 else | |
5186 { | |
5187 if ( v731 == 3 ) | |
5188 { | |
5189 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5190 } | |
5191 else | |
5192 { | |
5193 if ( v731 != 4 ) | |
5194 { | |
5195 v241 = 0.0; | |
5196 goto LABEL_484; | |
5197 } | |
5198 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5199 } | |
5200 } | |
5201 if ( v241 > 1.0 ) | |
5202 v241 = 1.0; | |
5203 LABEL_484: | |
5204 v732 = (unsigned __int8)v240[25]; | |
5205 v242 = (signed __int64)((double)v732 * v241); | |
5206 v243 = y; | |
5207 y[25] = v242; | |
5208 *((int *)v243 + 4) = (unsigned __int8)v242; | |
5209 if ( (unsigned __int8)v242 <= v1 ) | |
5210 { | |
5211 *(int *)v243 = v1; | |
5212 dword_50C9D0 = 113; | |
5213 dword_50C9D4 = v1; | |
5214 dword_50C9D8 = 1; | |
5215 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
5216 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5217 v3->spellnum = v1; | |
5218 goto LABEL_1165; | |
5219 } | |
5220 *((int *)v243 + 5) |= 0x40u; | |
5221 goto LABEL_1055; | |
5222 case 30: | |
5223 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5224 goto LABEL_83; | |
5225 uRequiredMana = v1; | |
5226 HIDWORD(v733) = 10 * v2; | |
5227 v730 = 1; | |
5228 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5229 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5230 if ( v731 == 1 ) | |
5231 { | |
5232 v245 = (int)&v244[36 * a2 + 532]; | |
5233 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5234 v311 = __OFSUB__(*(int *)v245, 134); | |
5235 v14 = *(int *)v245 == 134; | |
5236 v310 = *(int *)v245 - 134 < 0; | |
5237 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5238 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5239 { | |
5240 if ( *(int *)&v244[36 * a2 + 544] == v1 ) | |
5241 { | |
5242 if ( *(int *)&v244[36 * a2 + 536] == v1 ) | |
5243 { | |
5244 if ( *(int *)&v244[36 * a2 + 540] == v1 ) | |
5245 { | |
5246 v312 = v309[28]; | |
5247 if ( v312 ) | |
5248 { | |
5249 if ( v312 != 1 ) | |
5250 { | |
5251 if ( v312 != 2 ) | |
5252 { | |
5253 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5254 if ( !(v244[36 * a2 + 552] & 2) ) | |
5255 { | |
5256 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5257 { | |
5258 uRequiredMana = 1; | |
5259 v730 = v1; | |
5260 } | |
5261 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5262 uRequiredMana = 1; | |
5263 if ( uRequiredMana == v1 ) | |
5264 { | |
5265 v313 = *(char *)(LODWORD(v725) + 28); | |
5266 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5267 { | |
5268 v314 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | |
5269 *(int *)(v245 + 4) = 0; | |
5270 for ( j = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5271 + 1]; | |
5272 ; | |
5273 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5274 + 1] ) | |
5275 { | |
5276 ++*(int *)(v245 + 4); | |
5277 if ( j >= v314 ) | |
5278 break; | |
5279 } | |
5280 v254 = rand(); | |
5281 v255 = pItemsTable->field_116D8[17]; | |
5282 v256 = pItemsTable->field_116D8[16]; | |
5283 LABEL_611: | |
5284 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5285 LABEL_612: | |
5286 _this->uItemID |= 0x20u; | |
5287 goto LABEL_1055; | |
5288 } | |
5289 goto LABEL_615; | |
5290 } | |
5291 LABEL_613: | |
5292 v316 = _this->uItemID; | |
5293 if ( !(BYTE1(v316) & 2) ) | |
5294 { | |
5295 LOBYTE(v316) = v316 | 2; | |
5296 _this->uItemID = v316; | |
5297 } | |
5298 } | |
5299 } | |
5300 } | |
5301 } | |
5302 } | |
5303 } | |
5304 } | |
5305 } | |
5306 LABEL_616: | |
5307 if ( LODWORD(v727) == v1 ) | |
5308 { | |
5309 v317 = pGlobalTXT_LocalizationStrings[428]; | |
5310 if ( v730 == v1 ) | |
5311 v317 = pGlobalTXT_LocalizationStrings[585]; | |
5312 ShowStatusBarString(v317, 2u); | |
5313 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5314 v318 = v726; | |
5315 v3->spellnum = v1; | |
187 | 5316 v318->PlaySound(SPEECH_43, v1); |
0 | 5317 } |
5318 goto LABEL_83; | |
5319 } | |
5320 if ( v731 != 2 ) | |
5321 { | |
5322 if ( v731 == 3 ) | |
5323 { | |
5324 v245 = (int)&v244[36 * a2 + 532]; | |
5325 v269 = *(int *)v245; | |
5326 if ( *(int *)v245 > 134 | |
5327 || *(int *)(v245 + 12) != v1 | |
5328 || *(int *)(v245 + 4) != v1 | |
5329 || *(int *)(v245 + 8) != v1 | |
5330 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) | |
5331 goto LABEL_616; | |
5332 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5333 LODWORD(v725) = (int)v270; | |
5334 v271 = v270[28]; | |
5335 if ( v271 && v271 != 1 && v271 != 2 ) | |
5336 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5337 else | |
5338 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5339 if ( v272 ) | |
5340 { | |
5341 uRequiredMana = 1; | |
5342 v730 = v1; | |
5343 } | |
5344 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5345 uRequiredMana = 1; | |
5346 if ( uRequiredMana != v1 ) | |
5347 goto LABEL_613; | |
5348 v273 = v725; | |
5349 v274 = *(char *)(LODWORD(v725) + 28); | |
5350 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 ) | |
5351 { | |
5352 if ( rand() % 100 < 80 | |
5353 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5354 { | |
5355 v275 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | |
5356 *(int *)(v245 + 4) = 0; | |
5357 for ( k = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; | |
5358 ; | |
5359 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5360 + 1] ) | |
5361 { | |
5362 ++*(int *)(v245 + 4); | |
5363 if ( k >= v275 ) | |
5364 break; | |
5365 } | |
5366 v254 = rand(); | |
5367 v255 = pItemsTable->field_116D8[19]; | |
5368 v256 = pItemsTable->field_116D8[18]; | |
5369 goto LABEL_611; | |
5370 } | |
5371 v277 = pItemsTable->field_11798; | |
5372 v278 = 0; | |
5373 v725 = 0.0; | |
5374 HIDWORD(v733) = 0; | |
5375 if ( pItemsTable->field_11798 > 0 ) | |
5376 { | |
5377 v730 = (int)&v679; | |
5378 do | |
5379 { | |
5380 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pName); | |
5381 if ( !v279 || v279 == 1 ) | |
5382 { | |
5383 v280 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5384 + 4] | |
5385 + v278 * 28); | |
5386 LODWORD(v725) += v280; | |
5387 if ( v280 ) | |
5388 { | |
5389 v281 = v730; | |
5390 v730 += 4; | |
5391 *(int *)v281 = HIDWORD(v733); | |
5392 } | |
5393 } | |
5394 ++HIDWORD(v733); | |
5395 ++v278; | |
5396 } | |
5397 while ( SHIDWORD(v733) < v277 ); | |
5398 } | |
5399 v282 = rand() % SLODWORD(v725); | |
5400 v283 = v679; | |
5401 *(int *)(v245 + 12) = v679; | |
5402 v284 = pItemsTable->pSpecialEnchantments[v283].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; | |
5403 v285 = v282 + 1; | |
5404 if ( v284 < v285 ) | |
5405 { | |
5406 for ( l = &v679; ; l = (int *)v732 ) | |
5407 { | |
5408 v287 = (int)(l + 1); | |
5409 v732 = v287; | |
5410 v288 = *(int *)v287; | |
5411 *(int *)(v245 + 12) = v288; | |
5412 v284 += pItemsTable->pSpecialEnchantments[v288].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5413 + 4]; | |
5414 if ( v284 >= v285 ) | |
5415 break; | |
5416 } | |
5417 } | |
5418 goto LABEL_525; | |
5419 } | |
5420 } | |
5421 else | |
5422 { | |
5423 if ( v731 != 4 | |
5424 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
5425 || v726->pInventoryItems[a2].uAdditionalValue != v1 | |
5426 || v726->pInventoryItems[a2]._bonus_type != v1 | |
5427 || v726->pInventoryItems[a2]._bonus_strength != v1 | |
5428 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].uAttributes & 2) ) | |
5429 goto LABEL_616; | |
5430 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5431 LODWORD(v725) = (int)v247; | |
5432 v248 = v247[28]; | |
5433 if ( v248 && v248 != 1 && v248 != 2 ) | |
5434 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5435 else | |
5436 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5437 if ( v249 ) | |
5438 { | |
5439 uRequiredMana = 1; | |
5440 v730 = v1; | |
5441 } | |
5442 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5443 uRequiredMana = 1; | |
5444 if ( uRequiredMana != v1 ) | |
5445 goto LABEL_613; | |
5446 v250 = v725; | |
5447 v251 = *(char *)(LODWORD(v725) + 28); | |
5448 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 ) | |
5449 { | |
5450 if ( rand() % 100 < 80 | |
5451 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5452 { | |
5453 v252 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | |
5454 *(int *)(v245 + 4) = 0; | |
5455 for ( m = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; | |
5456 ; | |
5457 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5458 + 1] ) | |
5459 { | |
5460 ++*(int *)(v245 + 4); | |
5461 if ( m >= v252 ) | |
5462 break; | |
5463 } | |
5464 v254 = rand(); | |
5465 v255 = pItemsTable->field_116D8[21]; | |
5466 v256 = pItemsTable->field_116D8[20]; | |
5467 goto LABEL_611; | |
5468 } | |
5469 v257 = pItemsTable->field_11798; | |
5470 v258 = 0; | |
5471 v725 = 0.0; | |
5472 HIDWORD(v733) = 0; | |
5473 if ( pItemsTable->field_11798 > 0 ) | |
5474 { | |
5475 v730 = (int)&v679; | |
5476 do | |
5477 { | |
5478 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pName); | |
5479 if ( !v259 || v259 == 1 ) | |
5480 { | |
5481 v260 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5482 + 4] | |
5483 + v258 * 28); | |
5484 LODWORD(v725) += v260; | |
5485 if ( v260 ) | |
5486 { | |
5487 v261 = v730; | |
5488 v730 += 4; | |
5489 *(int *)v261 = HIDWORD(v733); | |
5490 } | |
5491 } | |
5492 ++HIDWORD(v733); | |
5493 ++v258; | |
5494 } | |
5495 while ( SHIDWORD(v733) < v257 ); | |
5496 } | |
5497 v262 = rand() % SLODWORD(v725); | |
5498 v263 = v679; | |
5499 *(int *)(v245 + 12) = v679; | |
5500 v264 = pItemsTable->pSpecialEnchantments[v263].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; | |
5501 v265 = v262 + 1; | |
5502 if ( v264 < v265 ) | |
5503 { | |
5504 for ( ii = &v679; ; ii = (int *)v732 ) | |
5505 { | |
5506 v267 = (int)(ii + 1); | |
5507 v732 = v267; | |
5508 v268 = *(int *)v267; | |
5509 *(int *)(v245 + 12) = v268; | |
5510 v264 += pItemsTable->pSpecialEnchantments[v268].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5511 + 4]; | |
5512 if ( v264 >= v265 ) | |
5513 break; | |
5514 } | |
5515 } | |
5516 LABEL_525: | |
5517 ++*(int *)(v245 + 12); | |
5518 goto LABEL_612; | |
5519 } | |
5520 } | |
5521 LABEL_615: | |
5522 v1 = 0; | |
5523 goto LABEL_616; | |
5524 } | |
5525 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5526 _this = v289; | |
5527 v290 = v289->uItemID; | |
5528 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5529 if ( v290 > 134 | |
5530 || _this->uAdditionalValue != v1 | |
5531 || _this->_bonus_type != v1 | |
5532 || _this->_bonus_strength != v1 | |
5533 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 | |
5534 || v291 == 1 | |
5535 || v291 == 2 | |
5536 || _this->uAttributes & 2 ) | |
5537 goto LABEL_616; | |
5538 if ( _this->GetValue() < 0x1C2 ) | |
5539 uRequiredMana = 1; | |
5540 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5541 uRequiredMana = 1; | |
5542 if ( uRequiredMana != v1 ) | |
5543 goto LABEL_199; | |
5544 v292 = *(char *)(LODWORD(v725) + 28); | |
5545 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5546 { | |
5547 v2 = v723; | |
5548 v1 = 0; | |
5549 goto LABEL_199; | |
5550 } | |
5551 if ( rand() % 100 >= 80 ) | |
5552 { | |
5553 v297 = pItemsTable->field_11798; | |
5554 v294 = _this; | |
5555 v298 = 0; | |
5556 v725 = 0.0; | |
5557 HIDWORD(v733) = 0; | |
5558 if ( pItemsTable->field_11798 > 0 ) | |
5559 { | |
5560 v730 = (int)&v679; | |
5561 do | |
5562 { | |
5563 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pName); | |
5564 if ( !v299 || v299 == 1 ) | |
5565 { | |
5566 v300 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4] | |
5567 + v298 * 28); | |
5568 LODWORD(v725) += v300; | |
5569 if ( v300 ) | |
5570 { | |
5571 v301 = v730; | |
5572 v730 += 4; | |
5573 *(int *)v301 = HIDWORD(v733); | |
5574 } | |
5575 } | |
5576 ++HIDWORD(v733); | |
5577 ++v298; | |
5578 } | |
5579 while ( SHIDWORD(v733) < v297 ); | |
5580 } | |
5581 v302 = rand() % SLODWORD(v725); | |
5582 v303 = v679; | |
5583 v294->uAdditionalValue = v679; | |
5584 v304 = pItemsTable->pSpecialEnchantments[v303].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; | |
5585 v305 = v302 + 1; | |
5586 if ( v304 < v305 ) | |
5587 { | |
5588 for ( jj = &v679; ; jj = (int *)v732 ) | |
5589 { | |
5590 v307 = (int)(jj + 1); | |
5591 v732 = v307; | |
5592 v308 = *(int *)v307; | |
5593 v294->uAdditionalValue = v308; | |
5594 v304 += pItemsTable->pSpecialEnchantments[v308].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; | |
5595 if ( v304 >= v305 ) | |
5596 break; | |
5597 } | |
5598 } | |
5599 ++v294->uAdditionalValue; | |
5600 } | |
5601 else | |
5602 { | |
5603 v293 = rand(); | |
5604 v294 = _this; | |
5605 v295 = v293 % pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; | |
5606 _this->_bonus_type = 0; | |
5607 for ( kk = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; | |
5608 ; | |
5609 kk += pItemsTable->pEnchantments[v294->_bonus_type].field_8[pItemsTable->pItems[v294->uItemID].uEquipType | |
5610 + 1] ) | |
5611 { | |
5612 ++v294->_bonus_type; | |
5613 if ( kk >= v295 ) | |
5614 break; | |
5615 } | |
5616 v294->_bonus_strength = pItemsTable->field_116D8[18] | |
5617 + rand() % (pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
5618 } | |
5619 v294->uAttributes |= 0x20u; | |
5620 goto LABEL_1055; | |
5621 case 31: | |
5622 amount = 10 * v2; | |
5623 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
5624 goto LABEL_83; | |
5625 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) | |
5626 goto LABEL_200; | |
5627 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
5628 pMessageQueue_50CBD0->SendMessage((UIMessageType)195, v1, v1); | |
5629 goto LABEL_1056; | |
5630 case 33: | |
5631 LODWORD(v733) = 604800 * v2; | |
5632 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5633 goto LABEL_200; | |
5634 v319 = uRequiredMana; | |
5635 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5636 { | |
5637 pEventTimer->Pause(); | |
5638 pMessageQueue_50CBD0->SendMessage((UIMessageType)177, v1, v1); | |
5639 qword_506350 = (signed int)v733; | |
5640 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5641 ::uRequiredMana = v319; | |
5642 ::sRecoveryTime = sRecoveryTime; | |
5643 dword_50633C = v3->field_10; | |
5644 dword_506338 = v3->spellnum; | |
5645 LOBYTE(v3->field_8) |= 0x20u; | |
5646 } | |
5647 goto LABEL_83; | |
5648 case 40: | |
5649 v320 = v12 - 2; | |
5650 if ( !v320 ) | |
5651 goto LABEL_632; | |
5652 v321 = v320 - 1; | |
5653 if ( v321 ) | |
5654 { | |
5655 if ( v321 == 1 ) | |
5656 goto LABEL_634; | |
5657 LABEL_632: | |
5658 v322 = 3600 * v2; | |
5659 } | |
5660 else | |
5661 { | |
5662 v322 = 86400 * v2; | |
5663 } | |
5664 amount = v322; | |
5665 LABEL_634: | |
5666 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5667 goto LABEL_83; | |
5668 v323 = v3->uPlayerID_2; | |
5669 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5670 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5671 goto LABEL_1056; | |
5672 if ( v731 == 4 ) | |
5673 goto LABEL_637; | |
5674 v732 = amount << 7; | |
5675 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5676 v656 = 15; | |
5677 goto LABEL_640; | |
5678 case 41: | |
5679 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5680 goto LABEL_83; | |
5681 a1.stru_24.Reset(); | |
5682 a1.field_48 = v3->spellnum; | |
5683 a1.field_4C = v2; | |
5684 a1.field_50 = v731; | |
5685 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5686 a1.vPosition.y = pParty->vPosition.y; | |
5687 a1.vPosition.x = pParty->vPosition.x; | |
5688 a1.uAttributes = v1; | |
5689 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5690 a1.uSectorID = pIndoor->GetSector( | |
5691 pParty->vPosition.x, | |
5692 pParty->vPosition.y, | |
5693 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5694 a1.uSpriteFrameID = v1; | |
5695 v326 = 8 * v3->uPlayerID; | |
5696 LOBYTE(v326) = v326 | 4; | |
5697 a1.field_58 = v326; | |
5698 a1.field_5C = a2; | |
5699 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5700 a1.uFacing = LOWORD(pParty->sRotationY); | |
5701 a1.uSoundID = LOWORD(v3->field_10); | |
5702 if ( pParty->bTurnBasedModeOn == 1 ) | |
5703 LOBYTE(a1.uAttributes) |= 4u; | |
5704 v669 = v3->uPlayerID + 1; | |
5705 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5706 v654 = pParty->sRotationX; | |
5707 goto LABEL_125; | |
5708 case 43: | |
5709 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5710 goto LABEL_200; | |
5711 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5712 goto LABEL_83; | |
5713 a1.uItemType = 4090; | |
5714 a1.stru_24.Reset(); | |
5715 a1.field_48 = v3->spellnum; | |
5716 a1.field_4C = v2; | |
5717 a1.field_50 = v731; | |
5718 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5719 a1.vPosition.x = pParty->vPosition.x; | |
5720 a1.vPosition.y = pParty->vPosition.y; | |
5721 a1.uAttributes = v1; | |
5722 a1.uSectorID = v1; | |
5723 a1.uSpriteFrameID = v1; | |
5724 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5725 v327 = 8 * v3->uPlayerID; | |
5726 LOBYTE(v327) = v327 | 4; | |
5727 a1.field_60_distance_related_prolly_lod = 0; | |
5728 a1.field_58 = v327; | |
5729 a1.field_5C = a2; | |
5730 a1.uFacing = LOWORD(pParty->sRotationY); | |
5731 a1.uSoundID = LOWORD(v3->field_10); | |
5732 if ( pParty->bTurnBasedModeOn == 1 ) | |
5733 a1.uAttributes = 4; | |
5734 v669 = v1; | |
5735 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5736 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5737 LABEL_124: | |
5738 v654 = v35; | |
5739 LABEL_125: | |
5740 v36 = pParty->sRotationY; | |
5741 goto LABEL_157; | |
5742 case 45: | |
5743 v328 = v12 - 2; | |
5744 if ( v328 ) | |
5745 { | |
5746 v329 = v328 - 1; | |
5747 if ( v329 && v329 != 1 ) | |
5748 v330 = 600 * v2; | |
5749 else | |
5750 v330 = 3600 * v2; | |
5751 } | |
5752 else | |
5753 { | |
5754 v330 = 1800 * v2; | |
5755 } | |
5756 LODWORD(v733) = v330; | |
5757 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5758 goto LABEL_83; | |
5759 v331 = v3->spellnum; | |
5760 v332 = pGame->GetStru6(); | |
5761 pGame->GetStru6()->SetPlayerBuffAnim(v331, v1); | |
5762 v83 = 1; | |
5763 v333 = v3->spellnum; | |
5764 v334 = pGame->GetStru6(); | |
5765 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1u); | |
5766 v335 = v3->spellnum; | |
5767 v336 = pGame->GetStru6(); | |
5768 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2u); | |
5769 v337 = v3->spellnum; | |
5770 v338 = pGame->GetStru6(); | |
5771 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3u); | |
5772 v673 = v1; | |
5773 v732 = (int)v733 << 7; | |
5774 v662 = v1; | |
5775 v655 = v1; | |
5776 v652 = v731; | |
5777 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5778 v137 = (char *)&pParty->pPartyBuffs[3]; | |
5779 goto LABEL_976; | |
5780 case 47: | |
5781 LODWORD(v733) = 300; | |
5782 v339 = v12 - 2; | |
5783 if ( v339 ) | |
5784 { | |
5785 v340 = v339 - 1; | |
5786 if ( v340 ) | |
5787 { | |
5788 if ( v340 != 1 ) | |
5789 { | |
5790 amount = v2; | |
5791 goto LABEL_667; | |
5792 } | |
5793 v341 = 6 * v2; | |
5794 } | |
5795 else | |
5796 { | |
5797 v341 = 4 * v2; | |
5798 } | |
5799 } | |
5800 else | |
5801 { | |
5802 v341 = 2 * v2; | |
5803 } | |
5804 amount = v341; | |
5805 LABEL_667: | |
5806 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5807 goto LABEL_83; | |
5808 v342 = *(int *)&v3->field_C; | |
5809 if ( v342 == v1 ) | |
5810 { | |
5811 v345 = v3->uPlayerID_2; | |
5812 v346 = v3->spellnum; | |
5813 v347 = pGame->GetStru6(); | |
5814 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); | |
5815 v668 = v1; | |
5816 v658 = v1; | |
5817 v653 = amount; | |
5818 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; | |
5819 v651 = v731; | |
5820 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5821 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; | |
5822 goto LABEL_104; | |
5823 } | |
141 | 5824 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5825 { |
5826 v343 = v342 >> 3; | |
5827 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5828 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; | |
5829 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); | |
5830 BYTE2(pActors[v343].uAttributes) |= 8u; | |
5831 v672 = v1; | |
5832 v661 = &pActors[v343]; | |
5833 LABEL_165: | |
5834 v56 = pGame->GetStru6(); | |
5835 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5836 } | |
5837 goto LABEL_1056; | |
5838 case 49: | |
5839 v348 = v12 - 2; | |
5840 if ( !v348 ) | |
5841 goto LABEL_677; | |
5842 v349 = v348 - 1; | |
5843 if ( v349 ) | |
5844 { | |
5845 if ( v349 == 1 ) | |
5846 { | |
5847 amount = v1; | |
5848 goto LABEL_679; | |
5849 } | |
5850 LABEL_677: | |
5851 v350 = 3600 * v2; | |
5852 } | |
5853 else | |
5854 { | |
5855 v350 = 86400 * v2; | |
5856 } | |
5857 amount = v350; | |
5858 LABEL_679: | |
5859 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5860 goto LABEL_83; | |
5861 v351 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5862 if ( !v351->pConditions[0] ) | |
5863 goto LABEL_1056; | |
5864 if ( v731 == 4 ) | |
5865 { | |
5866 LODWORD(v351->pConditions[0]) = v1; | |
5867 HIDWORD(v351->pConditions[0]) = v1; | |
5868 goto LABEL_904; | |
5869 } | |
5870 v732 = amount << 7; | |
5871 v351->DiscardConditionIfLastsLongerThan( | |
5872 v1, | |
5873 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
5874 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5875 goto LABEL_1056; | |
5876 v674 = v3->uPlayerID_2; | |
5877 goto LABEL_685; | |
5878 case 50: | |
5879 v354 = v12 - 2; | |
5880 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5881 v356 = 900 * (v2 + 4); | |
5882 else | |
5883 v356 = 300 * (v2 + 12); | |
5884 LODWORD(v733) = v356; | |
5885 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5886 goto LABEL_83; | |
5887 if ( v731 == 1 || v731 == 2 ) | |
5888 { | |
5889 v361 = v3->uPlayerID_2; | |
5890 v362 = v3->spellnum; | |
5891 v363 = pGame->GetStru6(); | |
5892 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); | |
5893 v668 = v1; | |
5894 v732 = (int)v733 << 7; | |
5895 v658 = v1; | |
5896 v653 = v1; | |
5897 v651 = v731; | |
5898 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5899 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; | |
5900 goto LABEL_103; | |
5901 } | |
5902 a2 = v1; | |
5903 v732 = (int)v733 << 7; | |
5904 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5905 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5906 do |
5907 { | |
5908 v358 = a2; | |
5909 v359 = v3->spellnum; | |
5910 v360 = pGame->GetStru6(); | |
5911 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); | |
112 | 5912 v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, v1, v1, v1); |
0 | 5913 ++a2; |
112 | 5914 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5915 } | |
5916 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5917 goto LABEL_1056; |
5918 case 48: | |
5919 v364 = v12 - 2; | |
5920 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5921 v366 = 60 * (v2 + 3); | |
5922 else | |
5923 v366 = 300 * v2 + 180; | |
5924 LODWORD(v733) = v366; | |
5925 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5926 goto LABEL_83; | |
5927 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
5928 v367 = pGame->GetStru6(); | |
5929 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | |
5930 ++a1.uItemType; | |
5931 a1.stru_24.Reset(); | |
5932 a1.field_48 = v3->spellnum; | |
5933 a1.field_4C = v2; | |
5934 a1.field_50 = v731; | |
5935 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5936 a1.uAttributes = v1; | |
5937 a1.uSectorID = v1; | |
5938 a1.uSpriteFrameID = v1; | |
5939 v368 = v3->uPlayerID; | |
5940 a1.field_60_distance_related_prolly_lod = 0; | |
5941 a1.uFacing = v1; | |
5942 v368 *= 8; | |
5943 LOBYTE(v368) = v368 | 4; | |
5944 a1.field_58 = v368; | |
5945 a1.uSoundID = LOWORD(v3->field_10); | |
5946 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
5947 { | |
5948 v369 = &pActors[dword_50BF30[a2]]; | |
5949 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5950 { | |
5951 a1.vPosition.x = v369->vPosition.x; | |
5952 a1.vPosition.y = v369->vPosition.y; | |
5953 v732 = v369->uActorHeight; | |
5954 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5955 v370 = 8 * dword_50BF30[a2]; | |
5956 LOBYTE(v370) = v370 | 3; | |
5957 a1.field_5C = v370; | |
5958 a1.Create(0, v1, v1, v1); | |
5959 v732 = (int)v733 << 7; | |
5960 v369->pActorBuffs[4].Apply( | |
5961 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
5962 v731, | |
5963 v1, | |
5964 v1, | |
5965 v1); | |
5966 } | |
5967 } | |
5968 goto LABEL_1056; | |
5969 case 53: | |
5970 v371 = v12 - 2; | |
5971 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
5972 amount = v1; | |
5973 else | |
5974 amount = 86400 * v2; | |
5975 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5976 goto LABEL_83; | |
5977 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, v1, 65536); | |
5978 v373 = v3->uPlayerID_2; | |
5979 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5980 goto LABEL_1056; | |
5981 v14 = v731 == 4; | |
5982 pParty->pPlayers[v373].sHealth = 1; | |
5983 if ( v14 ) | |
5984 { | |
5985 v374 = v3->uPlayerID_2; | |
5986 LODWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5987 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5988 v376 = v3->uPlayerID_2; | |
5989 LODWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5990 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5991 } | |
5992 else | |
5993 { | |
5994 v732 = amount << 7; | |
5995 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5996 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5997 0xEu, | |
5998 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5999 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6000 0xDu, | |
6001 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6002 } | |
112 | 6003 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6004 goto LABEL_720; |
6005 case 54: | |
6006 v378 = v12 - 2; | |
6007 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
6008 v380 = 4 * v2; | |
6009 else | |
6010 v380 = 3 * v2; | |
6011 amount = v380; | |
6012 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6013 goto LABEL_83; | |
6014 v381 = 0; | |
6015 HIDWORD(v733) = amount; | |
6016 v730 = 0; | |
6017 v382 = 1; | |
6018 do | |
6019 { | |
6020 v383 = pPlayers[v382]; | |
6021 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
6022 v682[v381++] = v382; | |
6023 ++v382; | |
6024 } | |
6025 while ( v382 <= 4 ); | |
6026 v384 = 0; | |
6027 v730 = v381; | |
6028 if ( v381 > v1 ) | |
6029 { | |
6030 do | |
6031 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
6032 while ( v384 < v381 ); | |
6033 } | |
6034 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
6035 HIDWORD(v733) = v1; | |
6036 if ( v381 > v1 ) | |
6037 { | |
6038 do | |
6039 { | |
6040 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
6041 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
6042 v726 = *(Player **)v385; | |
6043 v386 = v726->GetMaxHealth(); | |
6044 if ( v726->sHealth > v386 ) | |
6045 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
6046 v387 = *(Player **)v385; | |
6047 if ( v387->sHealth > v1 ) | |
6048 { | |
6049 LODWORD(v387->pConditions[13]) = v1; | |
6050 HIDWORD(v387->pConditions[13]) = v1; | |
6051 } | |
6052 v388 = HIDWORD(v733); | |
6053 v389 = LOWORD(v682[HIDWORD(v733)]) - 1; | |
6054 v390 = v3->spellnum; | |
6055 v391 = pGame->GetStru6(); | |
6056 pGame->GetStru6()->SetPlayerBuffAnim(v390, v389); | |
6057 HIDWORD(v733) = v388 + 1; | |
6058 } | |
6059 while ( v388 + 1 < v730 ); | |
6060 } | |
6061 goto LABEL_1056; | |
6062 case 55: | |
6063 v392 = v12 - 1; | |
6064 if ( !v392 ) | |
6065 { | |
6066 v395 = 180 * v2; | |
6067 goto LABEL_750; | |
6068 } | |
6069 v393 = v392 - 1; | |
6070 if ( !v393 ) | |
6071 { | |
6072 v395 = 10800 * v2; | |
6073 goto LABEL_750; | |
6074 } | |
6075 v394 = v393 - 1; | |
6076 if ( !v394 ) | |
6077 { | |
6078 v395 = 259200 * v2; | |
6079 LABEL_750: | |
6080 amount = v395; | |
6081 goto LABEL_751; | |
6082 } | |
6083 if ( v394 == 1 ) | |
6084 amount = v1; | |
6085 LABEL_751: | |
6086 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6087 goto LABEL_83; | |
6088 v396 = v3->uPlayerID_2; | |
6089 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
6090 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
6091 { | |
6092 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
187 | 6093 pParty->pPlayers[v396].PlaySound(SPEECH_25, v1); |
0 | 6094 if ( v731 == 4 ) |
6095 { | |
6096 v397 = v3->uPlayerID_2; | |
6097 LODWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6098 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6099 v398 = v3->uPlayerID_2; | |
6100 LODWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6101 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6102 v399 = v3->uPlayerID_2; | |
6103 LODWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6104 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6105 } | |
6106 else | |
6107 { | |
6108 v732 = amount << 7; | |
6109 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6110 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6111 0x10u, | |
6112 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6113 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6114 0xEu, | |
6115 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6116 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6117 0xDu, | |
6118 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6119 } | |
6120 v83 = 1; | |
112 | 6121 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
0 | 6122 v401 = pGame; |
6123 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; | |
6124 v402 = v3->uPlayerID_2; | |
6125 v403 = v3->spellnum; | |
6126 v404 = pGame->GetStru6(); | |
6127 pGame->GetStru6()->SetPlayerBuffAnim(v403, v402); | |
6128 } | |
6129 else | |
6130 { | |
6131 v83 = 1; | |
6132 } | |
6133 goto LABEL_978; | |
6134 case 61: | |
6135 v405 = v12 - 2; | |
6136 if ( !v405 ) | |
6137 goto LABEL_766; | |
6138 v406 = v405 - 1; | |
6139 if ( v406 ) | |
6140 { | |
6141 if ( v406 == 1 ) | |
6142 { | |
6143 amount = v1; | |
6144 goto LABEL_768; | |
6145 } | |
6146 LABEL_766: | |
6147 v407 = 3600 * v2; | |
6148 } | |
6149 else | |
6150 { | |
6151 v407 = 86400 * v2; | |
6152 } | |
6153 amount = v407; | |
6154 LABEL_768: | |
6155 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6156 goto LABEL_83; | |
6157 v408 = v3->uPlayerID_2; | |
6158 v409 = v3->spellnum; | |
6159 v410 = pGame->GetStru6(); | |
6160 pGame->GetStru6()->SetPlayerBuffAnim(v409, v408); | |
6161 v323 = v3->uPlayerID_2; | |
6162 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6163 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6164 goto LABEL_1056; | |
6165 if ( v731 == 4 ) | |
6166 goto LABEL_637; | |
6167 v732 = amount << 7; | |
6168 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6169 v656 = 12; | |
6170 goto LABEL_640; | |
6171 case 56: | |
6172 v411 = v12 - 2; | |
6173 if ( v411 ) | |
6174 { | |
6175 v412 = v411 - 1; | |
6176 if ( v412 ) | |
6177 { | |
6178 if ( v412 == 1 ) | |
6179 { | |
6180 amount = v1; | |
6181 goto LABEL_780; | |
6182 } | |
6183 v413 = 180 * v2; | |
6184 } | |
6185 else | |
6186 { | |
6187 v413 = 86400 * v2; | |
6188 } | |
6189 } | |
6190 else | |
6191 { | |
6192 v413 = 3600 * v2; | |
6193 } | |
6194 amount = v413; | |
6195 LABEL_780: | |
6196 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6197 goto LABEL_83; | |
6198 v414 = v3->uPlayerID_2; | |
6199 v415 = v3->spellnum; | |
6200 v416 = pGame->GetStru6(); | |
6201 pGame->GetStru6()->SetPlayerBuffAnim(v415, v414); | |
6202 v323 = v3->uPlayerID_2; | |
6203 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6204 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6205 goto LABEL_1056; | |
6206 if ( v731 == 4 ) | |
6207 goto LABEL_637; | |
6208 v732 = amount << 7; | |
6209 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6210 v656 = 3; | |
6211 goto LABEL_640; | |
6212 case 59: | |
6213 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6214 goto LABEL_83; | |
141 | 6215 if ( a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 6216 goto LABEL_1056; |
6217 v417 = (int)&pActors[a2 >> 3]; | |
6218 v730 = v417; | |
6219 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6220 { | |
6221 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6222 v417 = v730; | |
6223 } | |
6224 v418 = *(int *)(v417 + 672); | |
6225 HIDWORD(v733) = v1; | |
6226 if ( pItemsTable->pItems[v418].uEquipType == 18 ) | |
6227 HIDWORD(v733) = *(int *)(v417 + 684); | |
6228 | |
6229 //ItemGen::ItemGen(&v683); | |
6230 v683.Reset(); | |
6231 | |
6232 v419 = *(short *)(v730 + 180); | |
6233 if ( v419 != (short)v1 ) | |
6234 { | |
6235 v683.uItemID = v419; | |
6236 goto LABEL_799; | |
6237 } | |
6238 v420 = 0; | |
6239 v421 = v730 + 564; | |
6240 while ( *(int *)v421 == v1 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) | |
6241 { | |
6242 ++v420; | |
6243 v421 += 36; | |
6244 if ( v420 >= 4 ) | |
6245 goto LABEL_799; | |
6246 } | |
6247 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6248 v2 = v723; | |
6249 v1 = 0; | |
6250 LABEL_799: | |
6251 if ( HIDWORD(v733) != v1 ) | |
6252 { | |
6253 v675 = (const char *)HIDWORD(v733); | |
6254 if ( v683.uItemID != v1 ) | |
6255 { | |
6256 v422 = v683.GetDisplayName(); | |
6257 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6258 goto LABEL_807; | |
6259 } | |
6260 v664 = "%d gold"; | |
6261 goto LABEL_803; | |
6262 } | |
6263 if ( v683.uItemID != v1 ) | |
6264 { | |
6265 v675 = v683.GetDisplayName(); | |
6266 v664 = "(%s)"; | |
6267 LABEL_803: | |
6268 sprintf(pTmpBuf2, v664, v675); | |
6269 goto LABEL_807; | |
6270 } | |
6271 strcpy(pTmpBuf2, "nothing"); | |
6272 LABEL_807: | |
6273 ShowStatusBarString(pTmpBuf2, 2u); | |
6274 a1.stru_24.Reset(); | |
6275 a1.field_48 = v3->spellnum; | |
6276 a1.field_4C = v2; | |
6277 a1.field_50 = v731; | |
6278 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6279 a1.vPosition.x = *(short *)(v730 + 142); | |
6280 a1.vPosition.y = *(short *)(v730 + 144); | |
6281 v676 = *(short *)(v730 + 138); | |
6282 v665 = a1.vPosition.y; | |
6283 a1.vPosition.z = *(short *)(v730 + 138); | |
6284 v657 = a1.vPosition.x; | |
6285 goto LABEL_1087; | |
6286 case 62: | |
6287 v423 = v12 - 2; | |
6288 if ( !v423 ) | |
6289 goto LABEL_813; | |
6290 v424 = v423 - 1; | |
6291 if ( v424 ) | |
6292 { | |
6293 if ( v424 == 1 ) | |
6294 v425 = 3600 * v2; | |
6295 else | |
6296 LABEL_813: | |
6297 v425 = 300 * v2; | |
6298 } | |
6299 else | |
6300 { | |
6301 v425 = 600 * v2; | |
6302 } | |
6303 amount = v425; | |
6304 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6305 goto LABEL_83; | |
6306 v426 = a2 >> 3; | |
141 | 6307 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6308 goto LABEL_1056; |
6309 v730 = 836 * v426; | |
6310 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6311 { | |
90 | 6312 pActors[v426].pActorBuffs[1].Reset(); |
6313 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6314 v732 = amount << 7; |
90 | 6315 pActors[v426].pActorBuffs[9].Apply( |
0 | 6316 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6317 v731, | |
6318 v1, | |
6319 v1, | |
6320 v1); | |
90 | 6321 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6322 } |
6323 a1.stru_24.Reset(); | |
6324 a1.field_48 = v3->spellnum; | |
6325 a1.field_4C = v2; | |
6326 a1.field_50 = v731; | |
6327 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6328 v61 = v426; |
0 | 6329 goto LABEL_1086; |
6330 case 66: | |
6331 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6332 goto LABEL_83; | |
6333 amount = 600 * v2; | |
6334 v427 = a2 >> 3; | |
141 | 6335 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6336 goto LABEL_1056; |
6337 v730 = 836 * v427; | |
6338 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6339 goto LABEL_83; | |
90 | 6340 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6341 { | |
6342 pActors[v427].pActorBuffs[9].Reset(); | |
6343 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6344 v732 = amount << 7; |
90 | 6345 pActors[v427].pActorBuffs[12].Apply( |
0 | 6346 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6347 v731, | |
6348 v1, | |
6349 v1, | |
6350 v1); | |
6351 } | |
6352 a1.stru_24.Reset(); | |
6353 a1.field_48 = v3->spellnum; | |
6354 a1.field_4C = v2; | |
6355 a1.field_50 = v731; | |
6356 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6357 v61 = v427; |
0 | 6358 goto LABEL_1086; |
6359 case 63: | |
6360 v428 = v12 - 2; | |
6361 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6362 v430 = 300 * v2; | |
6363 else | |
6364 v430 = 180 * v2; | |
6365 amount = v430; | |
6366 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6367 goto LABEL_83; | |
6368 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6369 v431 = pGame->GetStru6(); | |
6370 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | |
6371 ++a1.uItemType; | |
6372 a1.stru_24.Reset(); | |
6373 a1.field_48 = v3->spellnum; | |
6374 a1.field_4C = v2; | |
6375 a1.field_50 = v731; | |
6376 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6377 a1.uAttributes = v1; | |
6378 a1.uSectorID = v1; | |
6379 a1.uSpriteFrameID = v1; | |
6380 v432 = v3->uPlayerID; | |
6381 a1.field_60_distance_related_prolly_lod = 0; | |
6382 a1.uFacing = v1; | |
6383 v432 *= 8; | |
6384 LOBYTE(v432) = v432 | 4; | |
6385 a1.field_58 = v432; | |
6386 a1.uSoundID = LOWORD(v3->field_10); | |
6387 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
6388 { | |
6389 v433 = &pActors[dword_50BF30[a2]]; | |
6390 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6391 break; | |
6392 a1.vPosition.x = v433->vPosition.x; | |
6393 a1.vPosition.y = v433->vPosition.y; | |
6394 v732 = v433->uActorHeight; | |
6395 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6396 v434 = 8 * dword_50BF30[a2]; | |
6397 LOBYTE(v434) = v434 | 3; | |
6398 a1.field_5C = v434; | |
6399 a1.Create(0, v1, v1, v1); | |
6400 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) | |
6401 { | |
6402 v732 = amount << 7; | |
6403 v433->pActorBuffs[4].Apply( | |
6404 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
6405 v731, | |
6406 v1, | |
6407 v1, | |
6408 v1); | |
6409 } | |
6410 } | |
6411 goto LABEL_1056; | |
6412 case 64: | |
6413 v435 = v12 - 2; | |
6414 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
6415 amount = v1; | |
6416 else | |
6417 amount = 86400 * v2; | |
6418 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6419 goto LABEL_83; | |
6420 v437 = v3->uPlayerID_2; | |
6421 v438 = v3->spellnum; | |
6422 v439 = pGame->GetStru6(); | |
6423 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); | |
6424 v440 = v3->uPlayerID_2; | |
6425 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6426 { | |
6427 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
187 | 6428 pParty->pPlayers[v440].PlaySound(SPEECH_25, v1); |
0 | 6429 if ( v731 == 4 ) |
6430 { | |
6431 v441 = v3->uPlayerID_2; | |
6432 LODWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6433 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6434 } | |
6435 else | |
6436 { | |
6437 v732 = amount << 7; | |
6438 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6439 5u, | |
6440 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6441 } | |
6442 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6443 LABEL_720: | |
6444 v377->SetCondition(1u, v1); | |
6445 } | |
6446 goto LABEL_1056; | |
6447 case 42: | |
6448 v442 = v12 - 2; | |
6449 if ( !v442 ) | |
6450 goto LABEL_855; | |
6451 v443 = v442 - 1; | |
6452 if ( v443 ) | |
6453 { | |
6454 if ( v443 == 1 ) | |
6455 v444 = 4 * v2; | |
6456 else | |
6457 LABEL_855: | |
6458 v444 = 2 * v2; | |
6459 } | |
6460 else | |
6461 { | |
6462 v444 = 3 * v2; | |
6463 } | |
6464 amount = v444; | |
6465 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6466 goto LABEL_83; | |
6467 v445 = a2 >> 3; | |
141 | 6468 if ( (a2 & 7) == OBJECT_Item) |
0 | 6469 { |
6470 v449 = (char *)&pLayingItems[v445].stru_24; | |
6471 v450 = *(int *)v449; | |
6472 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6473 { | |
6474 party_finds_gold(*((int *)v449 + 3), 0); | |
6475 viewparams->bRedrawGameUI = 1; | |
6476 } | |
6477 else | |
6478 { | |
189 | 6479 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
0 | 6480 ShowStatusBarString(pTmpBuf2, 2u); |
6481 if ( !pParty->AddItem(&pLayingItems[v445].stru_24) ) | |
6482 pParty->SetHoldingItem(&pLayingItems[v445].stru_24); | |
6483 } | |
6484 LayingItem::_42F933(v445); | |
6485 } | |
6486 else | |
6487 { | |
141 | 6488 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6489 { |
6490 stru_50C198.LootActor(&pActors[v445]); | |
6491 } | |
6492 else | |
6493 { | |
141 | 6494 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6495 { |
141 | 6496 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6497 goto LABEL_1056; |
6498 dword_507CD8 = 1; | |
6499 v677 = 1; | |
6500 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6501 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6502 else | |
6503 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6504 goto LABEL_866; | |
6505 } | |
6506 v447 = &pLevelDecorations[v445]; | |
6507 dword_507CD8 = 1; | |
6508 v448 = v447->field_16_event_id; | |
6509 if ( v448 != (short)v1 ) | |
6510 { | |
6511 v677 = 1; | |
6512 v446 = v448; | |
6513 LABEL_866: | |
6514 EventProcessor(v446, a2, v677); | |
6515 goto LABEL_1056; | |
6516 } | |
6517 if ( v447->IsInteractive() ) | |
6518 { | |
6519 _5C3420_pDecoration = v447; | |
6520 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); | |
6521 _5C3420_pDecoration = (LevelDecoration *)v1; | |
6522 } | |
6523 } | |
6524 } | |
6525 goto LABEL_1056; | |
6526 case 67: | |
6527 v451 = v12 - 2; | |
6528 if ( v451 ) | |
6529 { | |
6530 v452 = v451 - 1; | |
6531 if ( v452 ) | |
6532 { | |
6533 if ( v452 == 1 ) | |
6534 { | |
6535 amount = v1; | |
6536 goto LABEL_883; | |
6537 } | |
6538 v453 = 180 * v2; | |
6539 } | |
6540 else | |
6541 { | |
6542 v453 = 86400 * v2; | |
6543 } | |
6544 } | |
6545 else | |
6546 { | |
6547 v453 = 3600 * v2; | |
6548 } | |
6549 amount = v453; | |
6550 LABEL_883: | |
6551 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6552 goto LABEL_83; | |
6553 v454 = v3->uPlayerID_2; | |
6554 v455 = v3->spellnum; | |
6555 v456 = pGame->GetStru6(); | |
6556 pGame->GetStru6()->SetPlayerBuffAnim(v455, v454); | |
6557 v323 = v3->uPlayerID_2; | |
6558 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6559 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6560 goto LABEL_1056; | |
6561 if ( v731 == 4 ) | |
6562 { | |
6563 LABEL_637: | |
6564 *(int *)v324 = v1; | |
6565 *((int *)v324 + 1) = v1; | |
6566 goto LABEL_1056; | |
6567 } | |
6568 v732 = amount << 7; | |
6569 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6570 v656 = 1; | |
6571 LABEL_640: | |
6572 v325 = &pParty->pPlayers[v323]; | |
6573 goto LABEL_641; | |
6574 case 68: | |
6575 v457 = v12 - 2; | |
6576 if ( v457 ) | |
6577 { | |
6578 v458 = v457 - 1; | |
6579 if ( v458 ) | |
6580 { | |
6581 if ( v458 == 1 ) | |
6582 v459 = 5 * v2 + 5; | |
6583 else | |
6584 v459 = 2 * v2 + 5; | |
6585 } | |
6586 else | |
6587 { | |
6588 v459 = 4 * v2 + 5; | |
6589 } | |
6590 } | |
6591 else | |
6592 { | |
6593 v459 = 3 * v2 + 5; | |
6594 } | |
6595 amount = v459; | |
6596 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6597 goto LABEL_83; | |
6598 v460 = *(int *)&v3->field_C; | |
6599 if ( v460 == v1 ) | |
6600 { | |
6601 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6602 LABEL_904: | |
6603 v674 = v3->uPlayerID_2; | |
6604 LABEL_685: | |
6605 v352 = v3->spellnum; | |
6606 v353 = pGame->GetStru6(); | |
6607 pGame->GetStru6()->SetPlayerBuffAnim(v352, v674); | |
6608 } | |
6609 else | |
6610 { | |
141 | 6611 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6612 { |
6613 v461 = &pActors[v460 >> 3]; | |
6614 v462 = v461->uAIState; | |
6615 v463 = v461->pMonsterInfo.uHP; | |
6616 if ( v462 != 5 ) | |
6617 { | |
6618 if ( v462 != 4 ) | |
6619 { | |
6620 if ( v462 != 19 ) | |
6621 { | |
6622 if ( v462 != 11 ) | |
6623 { | |
6624 v461->sCurrentHP += amount; | |
6625 if ( v461->sCurrentHP > v463 ) | |
6626 v461->sCurrentHP = v463; | |
6627 } | |
6628 } | |
6629 } | |
6630 } | |
6631 } | |
6632 } | |
6633 goto LABEL_1056; | |
6634 case 72: | |
6635 v464 = v12 - 2; | |
6636 if ( !v464 ) | |
6637 goto LABEL_910; | |
6638 v465 = v464 - 1; | |
6639 if ( v465 ) | |
6640 { | |
6641 if ( v465 == 1 ) | |
6642 { | |
6643 amount = v1; | |
6644 goto LABEL_912; | |
6645 } | |
6646 LABEL_910: | |
6647 v466 = 3600 * v2; | |
6648 } | |
6649 else | |
6650 { | |
6651 v466 = 86400 * v2; | |
6652 } | |
6653 amount = v466; | |
6654 LABEL_912: | |
6655 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6656 goto LABEL_83; | |
6657 v467 = v3->uPlayerID_2; | |
6658 v468 = v3->spellnum; | |
6659 v469 = pGame->GetStru6(); | |
6660 pGame->GetStru6()->SetPlayerBuffAnim(v468, v467); | |
6661 v470 = v3->uPlayerID_2; | |
6662 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6663 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6664 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6665 goto LABEL_1056; | |
6666 if ( v731 == 4 ) | |
6667 { | |
6668 LODWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6669 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6670 v471 = v3->uPlayerID_2; | |
6671 LODWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6672 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6673 v472 = v3->uPlayerID_2; | |
6674 LODWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6675 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6676 goto LABEL_1056; | |
6677 } | |
6678 v732 = amount << 7; | |
6679 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6680 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6681 6u, | |
6682 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6683 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6684 8u, | |
6685 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6686 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6687 v656 = 10; | |
6688 goto LABEL_937; | |
6689 case 75: | |
6690 amount = v2; | |
6691 LODWORD(v733) = 3600 * v2; | |
6692 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6693 goto LABEL_83; | |
6694 v474 = v3->spellnum; | |
6695 v475 = pGame->GetStru6(); | |
6696 pGame->GetStru6()->SetPlayerBuffAnim(v474, v1); | |
6697 v476 = v3->spellnum; | |
6698 v477 = pGame->GetStru6(); | |
6699 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1u); | |
6700 v478 = v3->spellnum; | |
6701 v479 = pGame->GetStru6(); | |
6702 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2u); | |
6703 v480 = v3->spellnum; | |
6704 v481 = pGame->GetStru6(); | |
6705 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3u); | |
6706 v668 = v1; | |
6707 v732 = (int)v733 << 7; | |
6708 v658 = v1; | |
6709 v653 = v2; | |
6710 v651 = v731; | |
6711 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6712 v27 = (char *)&pParty->pPartyBuffs[13]; | |
6713 goto LABEL_101; | |
6714 case 73: | |
6715 LODWORD(v733) = 3600 * v2; | |
6716 amount = v2; | |
6717 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6718 goto LABEL_83; | |
6719 if ( v731 == 4 ) | |
6720 { | |
6721 v482 = v3->spellnum; | |
6722 v483 = pGame->GetStru6(); | |
6723 pGame->GetStru6()->SetPlayerBuffAnim(v482, v1); | |
6724 v484 = v3->spellnum; | |
6725 v485 = pGame->GetStru6(); | |
6726 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1u); | |
6727 v486 = v3->spellnum; | |
6728 v487 = pGame->GetStru6(); | |
6729 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2u); | |
6730 v488 = v3->spellnum; | |
6731 v489 = pGame->GetStru6(); | |
6732 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3u); | |
6733 v732 = (int)v733 << 7; | |
6734 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6735 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6736 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6737 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6738 v668 = v1; | |
6739 v658 = v2; | |
6740 v653 = v2; | |
6741 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; | |
6742 v651 = 4; | |
6743 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; | |
6744 v27 = (char *)&pParty->pPlayers[3].pPlayerBuffs[6]; | |
6745 goto LABEL_104; | |
6746 } | |
6747 v490 = v3->uPlayerID_2; | |
6748 v491 = v3->spellnum; | |
6749 v492 = pGame->GetStru6(); | |
6750 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); | |
6751 v668 = v1; | |
6752 v732 = (int)v733 << 7; | |
6753 v658 = v2; | |
6754 v653 = v2; | |
6755 v651 = v731; | |
6756 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6757 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; | |
6758 goto LABEL_103; | |
6759 case 74: | |
6760 v493 = v12 - 2; | |
6761 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
6762 amount = v1; | |
6763 else | |
6764 amount = 86400 * v2; | |
6765 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6766 goto LABEL_83; | |
6767 v495 = v3->uPlayerID_2; | |
6768 v496 = v3->spellnum; | |
6769 v497 = pGame->GetStru6(); | |
6770 pGame->GetStru6()->SetPlayerBuffAnim(v496, v495); | |
6771 v498 = v3->uPlayerID_2; | |
6772 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6773 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6774 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6775 goto LABEL_1056; | |
6776 if ( v731 == 4 ) | |
6777 { | |
6778 LODWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6779 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6780 v499 = v3->uPlayerID_2; | |
6781 LODWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6782 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6783 v500 = v3->uPlayerID_2; | |
6784 LODWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6785 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6786 } | |
6787 else | |
6788 { | |
6789 v732 = amount << 7; | |
6790 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6791 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6792 7u, | |
6793 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6794 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6795 9u, | |
6796 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6797 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6798 v656 = 11; | |
6799 LABEL_937: | |
112 | 6800 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6801 LABEL_641: |
6802 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6803 } | |
6804 goto LABEL_1056; | |
6805 case 77: | |
6806 amount = 5 * v2 + 10; | |
6807 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6808 goto LABEL_83; | |
6809 v501 = pParty->pPlayers; | |
6810 do | |
6811 { | |
6812 v502 = v3->spellnum; | |
6813 v503 = pGame->GetStru6(); | |
6814 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); | |
6815 v501->Heal(amount); | |
6816 ++v501; | |
6817 ++v1; | |
6818 } | |
6819 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6820 goto LABEL_1056; | |
6821 case 80: | |
6822 sRecoveryTime -= v2; | |
6823 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6824 goto LABEL_83; | |
6825 v504 = pGame->GetStru6(); | |
6826 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); | |
6827 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6828 ++a1.uItemType; | |
6829 HIDWORD(v733) = v505; | |
6830 v690 = v1; | |
6831 v689 = v1; | |
6832 v688 = v1; | |
6833 a1.stru_24.Reset(); | |
6834 a1.field_48 = v3->spellnum; | |
6835 a1.field_4C = v2; | |
6836 a1.field_50 = v731; | |
6837 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6838 a1.uAttributes = v1; | |
6839 a1.uSectorID = v1; | |
6840 a1.uSpriteFrameID = v1; | |
6841 v506 = v3->uPlayerID; | |
6842 a1.field_60_distance_related_prolly_lod = 0; | |
6843 a1.uFacing = v1; | |
6844 v506 *= 8; | |
6845 LOBYTE(v506) = v506 | 4; | |
6846 a1.field_58 = v506; | |
6847 a1.uSoundID = LOWORD(v3->field_10); | |
6848 a2 = v1; | |
6849 if ( SHIDWORD(v733) > v1 ) | |
6850 { | |
6851 do | |
6852 { | |
6853 v507 = dword_50BF30[a2]; | |
6854 a1.vPosition.x = pActors[v507].vPosition.x; | |
6855 a1.vPosition.y = pActors[v507].vPosition.y; | |
6856 v732 = pActors[v507].uActorHeight; | |
6857 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6858 v508 = 8 * dword_50BF30[a2]; | |
6859 LOBYTE(v508) = v508 | 3; | |
6860 a1.field_5C = v508; | |
6861 v509 = a1.Create(0, v1, v1, v1); | |
6862 v510 = a2; | |
6863 DamageMonsterFromParty(8 * v509 | 2, dword_50BF30[a2], (Vec3_int_ *)&v688); | |
6864 a2 = v510 + 1; | |
6865 } | |
6866 while ( v510 + 1 < SHIDWORD(v733) ); | |
6867 } | |
6868 for ( a2 = v1; a2 < SHIDWORD(v733); ++a2 ) | |
6869 { | |
6870 v511 = &pActors[dword_50BF30[a2]]; | |
6871 a1.vPosition.x = v511->vPosition.x; | |
6872 a1.vPosition.y = v511->vPosition.y; | |
6873 v732 = v511->uActorHeight; | |
6874 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6875 v512 = 8 * dword_50BF30[a2]; | |
6876 LOBYTE(v512) = v512 | 3; | |
6877 a1.field_5C = v512; | |
6878 a1.Create(0, v1, v1, v1); | |
6879 v513 = v511->pActorBuffs; | |
6880 v726 = (Player *)22; | |
6881 do | |
6882 { | |
6883 v513->Reset(); | |
6884 ++v513; | |
6885 v726 = (Player *)((char *)v726 - 1); | |
6886 } | |
6887 while ( *(float *)&v726 != 0.0 ); | |
6888 } | |
6889 goto LABEL_1056; | |
6890 case 82: | |
6891 v514 = v12 - 2; | |
6892 if ( !v514 ) | |
6893 goto LABEL_955; | |
6894 v515 = v514 - 1; | |
6895 if ( v515 ) | |
6896 { | |
6897 if ( v515 == 1 ) | |
6898 { | |
6899 v516 = 900 * v2; | |
6900 amount = 5; | |
6901 } | |
6902 else | |
6903 { | |
6904 LABEL_955: | |
6905 v516 = 300 * v2; | |
6906 amount = 1; | |
6907 } | |
6908 } | |
6909 else | |
6910 { | |
6911 v516 = 900 * v2; | |
6912 amount = 3; | |
6913 } | |
6914 v733 = __PAIR__(v1, v516); | |
6915 v517 = 8 * v3->uPlayerID; | |
6916 LOBYTE(v517) = v517 | 4; | |
6917 if ( (signed int)uNumActors > v1 ) | |
6918 { | |
90 | 6919 v518 = pActors;//[0].uAIState; |
6920 v726b = uNumActors; | |
0 | 6921 do |
6922 { | |
90 | 6923 v519 = v518->uAIState; |
6924 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6925 ++HIDWORD(v733); |
90 | 6926 ++v518; |
6927 --v726; | |
0 | 6928 } |
90 | 6929 while ( v726 != 0 ); |
0 | 6930 } |
6931 if ( SHIDWORD(v733) >= amount ) | |
6932 { | |
6933 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6934 goto LABEL_201; | |
6935 } | |
6936 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6937 goto LABEL_83; | |
6938 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); | |
6939 goto LABEL_1056; | |
6940 case 83: | |
6941 v520 = v12 - 2; | |
6942 if ( !v520 ) | |
6943 goto LABEL_973; | |
6944 v521 = v520 - 1; | |
6945 if ( v521 ) | |
6946 { | |
6947 if ( v521 == 1 ) | |
6948 { | |
6949 LODWORD(v733) = 18000 * v2; | |
6950 v522 = 5 * v2 + 10; | |
6951 } | |
6952 else | |
6953 { | |
6954 LABEL_973: | |
6955 LODWORD(v733) = 10800 * v2; | |
6956 v522 = 3 * v2 + 10; | |
6957 } | |
6958 } | |
6959 else | |
6960 { | |
6961 LODWORD(v733) = 14400 * v2; | |
6962 v522 = 4 * v2 + 10; | |
6963 } | |
6964 amount = v522; | |
6965 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6966 goto LABEL_83; | |
6967 v523 = v3->spellnum; | |
6968 v524 = pGame->GetStru6(); | |
6969 pGame->GetStru6()->SetPlayerBuffAnim(v523, v1); | |
6970 v83 = 1; | |
6971 v525 = v3->spellnum; | |
6972 v526 = pGame->GetStru6(); | |
6973 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1u); | |
6974 v527 = v3->spellnum; | |
6975 v528 = pGame->GetStru6(); | |
6976 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2u); | |
6977 v529 = v3->spellnum; | |
6978 v530 = pGame->GetStru6(); | |
6979 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3u); | |
6980 v673 = v1; | |
6981 v732 = (int)v733 << 7; | |
6982 v662 = v1; | |
6983 v655 = amount; | |
6984 v652 = v731; | |
6985 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6986 v137 = (char *)&pParty->pPartyBuffs[2]; | |
6987 goto LABEL_976; | |
6988 case 84: | |
6989 v67 = 2; | |
6990 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6991 { | |
6992 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6993 goto LABEL_202; | |
6994 } | |
6995 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6996 goto LABEL_83; | |
6997 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6998 ++a1.uItemType; | |
6999 v726 = (Player *)v531; | |
7000 v696 = v1; | |
7001 v695 = v1; | |
7002 v694 = v1; | |
7003 a1.stru_24.Reset(); | |
7004 a1.field_48 = v3->spellnum; | |
7005 a1.field_4C = v2; | |
7006 a1.field_50 = v731; | |
7007 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7008 a1.uAttributes = v1; | |
7009 a1.uSectorID = v1; | |
7010 a1.uSpriteFrameID = v1; | |
7011 v532 = v3->uPlayerID; | |
7012 a1.field_60_distance_related_prolly_lod = 0; | |
7013 a1.uFacing = v1; | |
7014 v532 *= 8; | |
7015 LOBYTE(v532) = v532 | 4; | |
7016 a1.field_58 = v532; | |
7017 a1.uSoundID = LOWORD(v3->field_10); | |
7018 a2 = v1; | |
7019 if ( (signed int)v726 > v1 ) | |
7020 { | |
7021 do | |
7022 { | |
7023 v533 = dword_50BF30[a2]; | |
7024 a1.vPosition.x = pActors[v533].vPosition.x; | |
7025 a1.vPosition.y = pActors[v533].vPosition.y; | |
7026 v732 = pActors[v533].uActorHeight; | |
7027 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7028 v534 = 8 * dword_50BF30[a2]; | |
7029 LOBYTE(v534) = v534 | 3; | |
7030 a1.field_5C = v534; | |
7031 v535 = a1.Create(0, v1, v1, v1); | |
7032 v536 = a2; | |
7033 DamageMonsterFromParty(8 * v535 | 2, dword_50BF30[a2], (Vec3_int_ *)&v694); | |
7034 a2 = v536 + 1; | |
7035 } | |
7036 while ( v536 + 1 < (signed int)v726 ); | |
7037 } | |
7038 v537 = pGame->GetStru6(); | |
7039 pGame->GetStru6()->_4A8BFC(); | |
7040 goto LABEL_1056; | |
7041 case 85: | |
7042 v538 = v12 - 2; | |
7043 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
7044 { | |
7045 amount = 5 * v2; | |
7046 v540 = 18000 * v2; | |
7047 } | |
7048 else | |
7049 { | |
7050 amount = 4 * v2; | |
7051 v540 = 14400 * v2; | |
7052 } | |
7053 v730 = v540; | |
7054 LODWORD(v733) = v540; | |
7055 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7056 goto LABEL_83; | |
7057 v541 = v3->spellnum; | |
7058 v542 = pGame->GetStru6(); | |
7059 pGame->GetStru6()->SetPlayerBuffAnim(v541, v1); | |
7060 v543 = v3->spellnum; | |
7061 v544 = pGame->GetStru6(); | |
7062 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1u); | |
7063 v545 = v3->spellnum; | |
7064 v546 = pGame->GetStru6(); | |
7065 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2u); | |
7066 v547 = v3->spellnum; | |
7067 v548 = pGame->GetStru6(); | |
7068 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3u); | |
7069 v732 = v730 << 7; | |
7070 v549 = (double)(v730 << 7) * 0.033333335; | |
7071 *((float *)&v733 + 1) = v549; | |
7072 v712 = (signed __int64)v549; | |
7073 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, v1, v1); | |
7074 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7075 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7076 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7077 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7078 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7079 v550 = v2 + 5; | |
7080 pParty->pPartyBuffs[ 5].Apply( | |
7081 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7082 v731, | |
7083 v550, | |
7084 v1, | |
7085 v1); | |
7086 v668 = v1; | |
7087 v658 = v1; | |
7088 v653 = v550; | |
7089 v651 = v731; | |
7090 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); | |
7091 LABEL_992: | |
7092 v27 = (char *)&pParty->pPartyBuffs[19]; | |
7093 goto LABEL_103; | |
7094 case 86: | |
7095 v551 = v12 - 2; | |
7096 if ( !v551 ) | |
7097 goto LABEL_998; | |
7098 v552 = v551 - 1; | |
7099 if ( v552 ) | |
7100 { | |
7101 if ( v552 == 1 ) | |
7102 { | |
7103 amount = 15; | |
7104 HIDWORD(v733) = 20; | |
7105 goto LABEL_1000; | |
7106 } | |
7107 LABEL_998: | |
7108 v678 = 4; | |
7109 } | |
7110 else | |
7111 { | |
7112 v678 = 12; | |
7113 } | |
7114 amount = v678; | |
7115 HIDWORD(v733) = v678; | |
7116 LABEL_1000: | |
7117 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7118 goto LABEL_83; | |
7119 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); | |
7120 v732 = (300 * amount * v2 + 60) << 7; | |
7121 v730 = v2 + 5; | |
7122 v726 = (Player *)v1; | |
89 | 7123 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 7124 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
7125 do | |
7126 { | |
7127 v554 = v3->spellnum; | |
7128 v555 = pGame->GetStru6(); | |
7129 pGame->GetStru6()->SetPlayerBuffAnim(v554, v1); | |
7130 v556 = v3->spellnum; | |
7131 v557 = pGame->GetStru6(); | |
7132 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1u); | |
7133 v558 = v3->spellnum; | |
7134 v559 = pGame->GetStru6(); | |
7135 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2u); | |
7136 v560 = v3->spellnum; | |
7137 v561 = pGame->GetStru6(); | |
7138 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3u); | |
89 | 7139 //((SpellBuff *)(v553 + 6056))->Apply( |
7140 v553->pPlayerBuffs[4].Apply( | |
0 | 7141 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7142 v731, | |
7143 v730, | |
7144 v1, | |
7145 v1); | |
7146 if ( *(_QWORD *)v553 ) | |
7147 v726 = (Player *)1; | |
89 | 7148 ++v553; |
7149 } | |
7150 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 7151 v562 = v731; |
7152 pParty->pPartyBuffs[9].Apply( | |
7153 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7154 v731, | |
7155 v730, | |
7156 v1, | |
7157 v1); | |
7158 pParty->pPartyBuffs[14].Apply( | |
7159 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7160 v562, | |
7161 v1, | |
7162 v1, | |
7163 v1); | |
7164 pParty->pPartyBuffs[15].Apply( | |
7165 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7166 v562, | |
7167 v730, | |
7168 v1, | |
7169 v1); | |
7170 if ( v726 != (Player *)v1 ) | |
7171 goto LABEL_1056; | |
7172 v668 = v1; | |
7173 v732 = (int)y << 7; | |
7174 v658 = v1; | |
7175 v653 = v730; | |
7176 v651 = v562; | |
7177 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 | |
7178 + (double)(signed __int64)pParty->uTimePlayed); | |
7179 v27 = (char *)&pParty->pPartyBuffs[8]; | |
7180 goto LABEL_103; | |
7181 case 88: | |
7182 amount = 3; | |
7183 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
7184 goto LABEL_200; | |
7185 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7186 goto LABEL_83; | |
7187 a2 = v1; | |
7188 _this = (ItemGen *)&pPlayers[1]; | |
7189 do | |
7190 { | |
7191 v563 = 0; | |
7192 do | |
7193 { | |
7194 v564 = _this->uItemID; | |
7195 *(int *)(v563 + _this->uItemID) = v1; | |
7196 v563 += 8; | |
7197 *(int *)(v563 + v564 - 4) = v1; | |
7198 } | |
7199 while ( v563 <= 128 ); | |
7200 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
7201 v566 = (Player **)_this; | |
7202 *(int *)(_this->uItemID + 6460) = v565; | |
7203 v567 = (*v566)->GetMaxMana(); | |
7204 v568 = a2; | |
7205 *(int *)(_this->uItemID + 6464) = v567; | |
7206 v569 = v3->spellnum; | |
7207 v570 = pGame->GetStru6(); | |
7208 pGame->GetStru6()->SetPlayerBuffAnim(v569, v568); | |
7209 ++a2; | |
7210 _this = (ItemGen *)((char *)_this + 4); | |
7211 } | |
7212 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
7213 v571 = pPlayer; | |
7214 v572 = (char *)&pPlayer->sAgeModifier; | |
7215 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
7216 *(short *)v572 = 120; | |
7217 else | |
7218 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
7219 sRecoveryTime += -5 * v2; | |
7220 ++v571->uNumDivineInterventionCastsThisDay; | |
7221 goto LABEL_1056; | |
7222 case 89: | |
7223 v573 = v12 - 2; | |
7224 if ( v573 ) | |
7225 { | |
7226 v574 = v573 - 1; | |
7227 if ( v574 ) | |
7228 { | |
7229 if ( v574 == 1 ) | |
7230 v575 = 5 * v2; | |
7231 else | |
7232 v575 = 2 * v2; | |
7233 } | |
7234 else | |
7235 { | |
7236 v575 = 4 * v2; | |
7237 } | |
7238 } | |
7239 else | |
7240 { | |
7241 v575 = 3 * v2; | |
7242 } | |
7243 amount = v575; | |
7244 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7245 goto LABEL_83; | |
7246 v576 = *(int *)&v3->field_C; | |
7247 if ( v576 == v1 ) | |
7248 { | |
7249 v583 = v3->uPlayerID_2; | |
7250 v584 = v3->spellnum; | |
7251 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
7252 v586 = pGame->GetStru6(); | |
7253 pGame->GetStru6()->SetPlayerBuffAnim(v584, v583); | |
7254 if ( *((_QWORD *)v585 + 14) ) | |
7255 { | |
7256 ((Player *)v585)->SetCondition(0x11u, 1); | |
7257 v587 = ((Player *)v585)->GetSexByVoice(); | |
7258 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7259 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7260 } | |
7261 goto LABEL_83; | |
7262 } | |
7263 v577 = (Player *)(v576 >> 3); | |
7264 v726 = v577; | |
7265 if ( v577 == (Player *)-1 ) | |
7266 { | |
7267 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7268 goto LABEL_201; | |
7269 } | |
7270 v578 = (int)&pActors[(int)v577]; | |
7271 v721 = v578; | |
7272 if ( *(short *)(v578 + 40) > (signed __int16)v1 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) | |
7273 goto LABEL_200; | |
7274 ++a1.uItemType; | |
7275 a1.stru_24.Reset(); | |
7276 a1.field_48 = v3->spellnum; | |
7277 a1.field_4C = v2; | |
7278 a1.field_50 = v731; | |
7279 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7280 a1.uAttributes = v1; | |
7281 a1.uSectorID = v1; | |
7282 a1.uSpriteFrameID = v1; | |
7283 v580 = v3->uPlayerID; | |
7284 a1.field_60_distance_related_prolly_lod = 0; | |
7285 v581 = v721; | |
7286 v580 *= 8; | |
7287 LOBYTE(v580) = v580 | 4; | |
7288 a1.uFacing = v1; | |
7289 a1.field_58 = v580; | |
7290 a1.uSoundID = LOWORD(v3->field_10); | |
7291 a1.vPosition.x = *(short *)(v721 + 142); | |
7292 a1.vPosition.y = *(short *)(v721 + 144); | |
7293 v732 = *(short *)(v721 + 138); | |
7294 v582 = 8 * (int)v726; | |
7295 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7296 LOBYTE(v582) = 8 * (char)v726 | 3; | |
7297 a1.field_5C = v582; | |
7298 a1.Create(0, v1, v1, v1); | |
7299 if ( *(char *)(v581 + 52) > amount ) | |
7300 goto LABEL_83; | |
7301 Actor::Resurrect((unsigned int)v726); | |
7302 *(char *)(v581 + 61) = 0; | |
7303 *(char *)(v581 + 53) = 0; | |
7304 *(char *)(v581 + 54) = 0; | |
7305 *(char *)(v581 + 55) = 0; | |
7306 *(char *)(v581 + 56) = 0; | |
7307 *(char *)(v581 + 57) = 0; | |
7308 *(int *)(v581 + 712) = 9999; | |
7309 *(char *)(v581 + 38) &= 0xF7u; | |
7310 *(int *)(v581 + 708) = v1; | |
7311 ((SpellBuff *)(v581 + 356))->Reset(); | |
7312 ((SpellBuff *)(v581 + 228))->Reset(); | |
7313 ((SpellBuff *)(v581 + 404))->Reset(); | |
7314 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7315 *(short *)(v581 + 40) = 10 * amount; | |
7316 goto LABEL_1056; | |
7317 case 91: | |
7318 v588 = v12 - 1; | |
7319 amount = 16; | |
7320 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7321 { | |
7322 if ( v590 == 1 ) | |
7323 LODWORD(v733) = v1; | |
7324 } | |
7325 else | |
7326 { | |
7327 LODWORD(v733) = 3600 * v2; | |
7328 } | |
7329 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7330 goto LABEL_83; | |
7331 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; | |
7332 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7333 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7334 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7335 || *(char *)(HIDWORD(v733) + 20) & 2 | |
7336 || *(int *)(HIDWORD(v733) + 12) != v1 | |
7337 || *(int *)(HIDWORD(v733) + 4) != v1 | |
7338 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 | |
7339 || pItemsTable->_456D5E_is_some_material((ItemGen *)HIDWORD(v733)) ) | |
7340 goto LABEL_199; | |
7341 v592 = HIDWORD(v733); | |
7342 v14 = v731 == 4; | |
7343 *(int *)(HIDWORD(v733) + 12) = 16; | |
7344 if ( !v14 ) | |
7345 { | |
7346 v732 = (int)v733 << 7; | |
7347 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7348 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7349 *(int *)(v592 + 20) |= 8u; | |
7350 } | |
7351 *(char *)(v592 + 20) |= 0x80u; | |
7352 goto LABEL_1055; | |
7353 case 93: | |
7354 v593 = v12 - 2; | |
7355 if ( !v593 ) | |
7356 goto LABEL_1062; | |
7357 v594 = v593 - 1; | |
7358 if ( v594 ) | |
7359 { | |
7360 if ( v594 == 1 ) | |
7361 amount = 9; | |
7362 else | |
7363 LABEL_1062: | |
7364 amount = 5; | |
7365 } | |
7366 else | |
7367 { | |
7368 amount = 7; | |
7369 } | |
7370 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7371 goto LABEL_83; | |
7372 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
7373 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7374 a1.stru_24.Reset(); | |
7375 a1.field_48 = v3->spellnum; | |
7376 a1.field_4C = v2; | |
7377 a1.field_50 = v731; | |
7378 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7379 a1.vPosition.x = pParty->vPosition.x; | |
7380 a1.vPosition.y = pParty->vPosition.y; | |
7381 a1.uAttributes = v1; | |
7382 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
7383 a1.uSectorID = pIndoor->GetSector( | |
7384 pParty->vPosition.x, | |
7385 pParty->vPosition.y, | |
7386 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
7387 a1.uSpriteFrameID = v1; | |
7388 v595 = 8 * v3->uPlayerID; | |
7389 LOBYTE(v595) = v595 | 4; | |
7390 a1.field_58 = v595; | |
7391 a1.field_5C = a2; | |
7392 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7393 a1.uSoundID = LOWORD(v3->field_10); | |
7394 if ( pParty->bTurnBasedModeOn == 1 ) | |
7395 LOBYTE(a1.uAttributes) |= 4u; | |
7396 v596 = (signed int)v726 / -2; | |
7397 y = (char *)((signed int)v726 / 2); | |
7398 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7399 { | |
7400 v597 = v715.uYawAngle; | |
7401 do | |
7402 { | |
7403 a1.uFacing = v596 + v597; | |
7404 if ( a1.Create( | |
7405 v596 + v597, | |
7406 v715.uPitchAngle, | |
7407 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7408 v3->uPlayerID + 1) != -1 | |
7409 && pParty->bTurnBasedModeOn == 1 ) | |
7410 ++pTurnEngine->field_1C; | |
7411 v596 += v732; | |
7412 } | |
7413 while ( v596 <= (signed int)y ); | |
7414 } | |
7415 goto LABEL_1056; | |
7416 case 94: | |
7417 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7418 goto LABEL_83; | |
7419 if ( v731 == 1 || v731 == 2 ) | |
7420 { | |
7421 v598 = 180 * v2; | |
7422 goto LABEL_1081; | |
7423 } | |
7424 if ( v731 == 3 ) | |
7425 { | |
7426 v598 = 300 * v2; | |
7427 LABEL_1081: | |
7428 LODWORD(v733) = v598; | |
7429 goto LABEL_1082; | |
7430 } | |
7431 if ( v731 == 4 ) | |
7432 LODWORD(v733) = 29030400; | |
7433 LABEL_1082: | |
7434 v599 = a2 >> 3; | |
141 | 7435 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7436 goto LABEL_1056; |
7437 v730 = 836 * v599; | |
7438 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
7439 goto LABEL_83; | |
90 | 7440 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7441 goto LABEL_200; |
90 | 7442 pActors[v599].pActorBuffs[9].Reset(); |
7443 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7444 v732 = (int)v733 << 7; |
90 | 7445 pActors[v599].pActorBuffs[12].Apply( |
0 | 7446 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
7447 v731, | |
7448 v1, | |
7449 v1, | |
7450 v1); | |
7451 a1.stru_24.Reset(); | |
7452 a1.field_48 = v3->spellnum; | |
7453 a1.field_4C = v2; | |
7454 a1.field_50 = v731; | |
7455 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 7456 v61 = v599; |
0 | 7457 LABEL_1086: |
90 | 7458 v600 = pActors[v61].vPosition.y; |
7459 v601 = pActors[v61].vPosition.x; | |
0 | 7460 a1.uObjectDescID = v60; |
7461 a1.vPosition.x = v601; | |
90 | 7462 v602 = pActors[v61].uActorHeight; |
7463 v603 = pActors[v61].vPosition.z; | |
0 | 7464 a1.vPosition.y = v600; |
7465 v676 = v603 + v602; | |
7466 v665 = v600; | |
7467 a1.vPosition.z = v603 + v602; | |
7468 v657 = v601; | |
7469 LABEL_1087: | |
7470 a1.uAttributes = v1; | |
7471 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); | |
7472 a1.uSpriteFrameID = v1; | |
7473 v604 = 8 * v3->uPlayerID; | |
7474 LOBYTE(v604) = v604 | 4; | |
7475 a1.field_58 = v604; | |
7476 a1.field_5C = a2; | |
7477 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7478 a1.uFacing = LOWORD(v715.uYawAngle); | |
7479 LOWORD(v604) = LOWORD(v3->field_10); | |
7480 LOBYTE(a1.uAttributes) |= 0x80u; | |
7481 a1.uSoundID = v604; | |
7482 a1.Create(0, v1, v1, v3->uPlayerID + 1); | |
7483 goto LABEL_1056; | |
7484 case 96: | |
7485 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7486 goto LABEL_83; | |
7487 HIDWORD(v733) = v1; | |
7488 memset(&pStru179, v1, 0xFA0u); | |
7489 _this = (ItemGen *)v1; | |
7490 v605 = (char *)pParty->pHirelings; | |
7491 do | |
7492 { | |
7493 if ( *(int *)v605 != v1 ) | |
7494 { | |
7495 v606 = HIDWORD(v733)++; | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
79
diff
changeset
|
7496 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7497 } |
7498 _this = (ItemGen *)((char *)_this + 1); | |
7499 v605 += 76; | |
7500 } | |
7501 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
7502 _this = (ItemGen *)v1; | |
7503 if ( (signed int)pNPCStats->uNumNewNPCs > v1 ) | |
7504 { | |
7505 v730 = (int)pNPCStats->pNewNPCData; | |
7506 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7507 do | |
7508 { | |
7509 if ( *(char *)(v730 + 8) & 0x80 | |
7510 && (pParty->pHirelings[0].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) | |
7511 && (pParty->pHirelings[1].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
7512 { | |
7513 v607 = HIDWORD(v733); | |
7514 HIDWORD(v733) += 4; | |
7515 *(int *)v607 = (int)_this + 3; | |
7516 } | |
7517 _this = (ItemGen *)((char *)_this + 1); | |
7518 v730 += 76; | |
7519 } | |
7520 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7521 } | |
7522 v608 = v3->uPlayerID_2; | |
7523 if ( v608 != 4 && v608 != 5 | |
7524 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= v1) | |
7525 || v609 >= 3 ) | |
7526 goto LABEL_200; | |
7527 v610 = 76 * v609; | |
7528 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = v1; | |
7529 v611 = pIconsFrameTable->FindIcon("spell96"); | |
7530 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( | |
7531 v611); | |
7532 v232 = 1; | |
7533 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; | |
89 | 7534 v612 = pParty->pPlayers; |
0 | 7535 do |
7536 { | |
89 | 7537 v612->sHealth = v612->GetMaxHealth(); |
7538 v612->sMana = v612->GetMaxMana(); | |
7539 ++v612; | |
7540 } | |
7541 while ( v612 <= &pParty->pPlayers[3] ); | |
7542 v613 = &pOutdoor->ddm; | |
0 | 7543 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7544 v613 = &pIndoor->dlv; |
7545 v613->uReputation += 15; | |
7546 if ( v613->uReputation > 10000 ) | |
7547 v613->uReputation = 10000; | |
0 | 7548 LODWORD(v727) = v232; |
7549 goto LABEL_83; | |
7550 case 95: | |
7551 if ( v12 <= v1 ) | |
7552 goto LABEL_1119; | |
7553 if ( v12 <= 3 ) | |
7554 { | |
7555 v614 = 300 * (v2 + 12); | |
7556 } | |
7557 else | |
7558 { | |
7559 if ( v12 != 4 ) | |
7560 goto LABEL_1119; | |
7561 v614 = 900 * (v2 + 4); | |
7562 } | |
7563 LODWORD(v733) = v614; | |
7564 LABEL_1119: | |
7565 v615 = v2 + 5; | |
7566 amount = v615; | |
7567 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7568 goto LABEL_83; | |
7569 if ( v731 != 3 && v731 != 4 ) | |
7570 { | |
7571 v616 = v3->uPlayerID_2; | |
7572 v617 = v3->spellnum; | |
7573 v618 = pGame->GetStru6(); | |
7574 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); | |
7575 v668 = v1; | |
7576 v658 = v716; | |
7577 v732 = (int)v733 << 7; | |
7578 v653 = v615; | |
7579 v651 = v731; | |
7580 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7581 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; | |
7582 goto LABEL_103; | |
7583 } | |
7584 a2 = v1; | |
7585 v732 = (int)v733 << 7; | |
7586 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7587 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7588 do |
7589 { | |
7590 v620 = a2; | |
7591 v621 = v3->spellnum; | |
7592 v622 = pGame->GetStru6(); | |
7593 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); | |
112 | 7594 v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
0 | 7595 ++a2; |
112 | 7596 ++v619; |
7597 } | |
7598 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7599 goto LABEL_1056; |
7600 case 99: | |
7601 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7602 goto LABEL_83; | |
7603 v726 = (Player *)v1; | |
7604 pGame->GetIndoorCamera(); | |
7605 v623 = (signed __int64)GetPickDepth(); | |
7606 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
7607 v709 = v1; | |
7608 v708 = v1; | |
7609 v707 = v1; | |
7610 a1.stru_24.Reset(); | |
7611 a1.field_48 = v3->spellnum; | |
7612 a1.field_4C = v2; | |
7613 a1.field_50 = v731; | |
7614 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7615 a1.uAttributes = v1; | |
7616 a1.uSectorID = v1; | |
7617 a1.uSpriteFrameID = v1; | |
7618 v624 = v3->uPlayerID; | |
7619 a1.field_60_distance_related_prolly_lod = 0; | |
7620 a1.uFacing = v1; | |
7621 v624 *= 8; | |
7622 LOBYTE(v624) = v624 | 4; | |
7623 a1.field_58 = v624; | |
7624 a1.uSoundID = LOWORD(v3->field_10); | |
7625 a2 = v1; | |
7626 if ( SHIDWORD(v733) > v1 ) | |
7627 { | |
7628 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7629 do | |
7630 { | |
7631 v625 = dword_50BF30[a2]; | |
7632 a1.vPosition.x = pActors[v625].vPosition.x; | |
7633 a1.vPosition.y = pActors[v625].vPosition.y; | |
7634 v732 = pActors[v625].uActorHeight; | |
7635 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7636 v626 = 8 * dword_50BF30[a2]; | |
7637 LOBYTE(v626) = v626 | 3; | |
7638 a1.field_5C = v626; | |
7639 v627 = a1.Create(0, v1, v1, v1); | |
7640 v628 = a2; | |
7641 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7642 a2 = v628 + 1; | |
7643 } | |
7644 while ( v628 + 1 < SHIDWORD(v733) ); | |
7645 } | |
7646 v730 = v1; | |
7647 v629 = 1; | |
7648 do | |
7649 { | |
7650 v630 = pPlayers[v629]; | |
7651 if ( !v630->pConditions[2] | |
7652 && !v630->pConditions[12] | |
7653 && !v630->pConditions[13] | |
7654 && !v630->pConditions[14] | |
7655 && !v630->pConditions[15] | |
7656 && !v630->pConditions[16] ) | |
7657 { | |
7658 v631 = v730++; | |
7659 v681[v631] = v629; | |
7660 } | |
7661 ++v629; | |
7662 } | |
7663 while ( v629 <= 4 ); | |
7664 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
7665 HIDWORD(v733) = v1; | |
7666 if ( v730 > v1 ) | |
7667 { | |
7668 do | |
7669 { | |
7670 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7671 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7672 v633->sHealth += v732; | |
7673 v726 = *(Player **)v632; | |
7674 v634 = v726->GetMaxHealth(); | |
7675 if ( v726->sHealth > v634 ) | |
7676 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7677 v635 = HIDWORD(v733); | |
7678 v636 = WORD2(v733); | |
7679 v637 = v3->spellnum; | |
7680 v638 = pGame->GetStru6(); | |
7681 pGame->GetStru6()->SetPlayerBuffAnim(v637, v636); | |
7682 HIDWORD(v733) = v635 + 1; | |
7683 } | |
7684 while ( v635 + 1 < v730 ); | |
7685 } | |
7686 v639 = pGame->GetStru6(); | |
7687 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(v1, 0x40u); | |
7688 goto LABEL_1056; | |
7689 case 98: | |
7690 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7691 { | |
7692 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7693 goto LABEL_201; | |
7694 } | |
7695 v640 = v12 - 2; | |
7696 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7697 amount = 3; | |
7698 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->field_1613C > v1 ) | |
7699 goto LABEL_200; | |
7700 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7701 goto LABEL_83; | |
7702 pParty->field_1613C = 256; | |
7703 pParty->field_16140 = v2; | |
7704 ++pPlayer->uNumArmageddonCasts; | |
7705 if ( pParty->bTurnBasedModeOn == 1 ) | |
7706 ++pTurnEngine->field_1C; | |
7707 v726 = (Player *)50; | |
7708 do | |
7709 { | |
7710 v642 = rand() % 4096 - 2048; | |
7711 v643 = rand(); | |
7712 v721 = v642 + pParty->vPosition.x; | |
7713 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
7714 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1); | |
7715 v644 = rand(); | |
7716 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1); | |
7717 v726 = (Player *)((char *)v726 - 1); | |
7718 } | |
7719 while ( *(float *)&v726 != 0.0 ); | |
7720 goto LABEL_1056; | |
7721 default: | |
7722 goto LABEL_83; | |
7723 } | |
7724 while ( 2 ) | |
7725 { | |
7726 if ( v731 == 4 ) | |
7727 { | |
7728 if ( *((_QWORD *)v222 + 2) ) | |
7729 { | |
7730 *((int *)v222 + 4) = v1; | |
7731 *((int *)v222 + 5) = v1; | |
7732 goto LABEL_439; | |
7733 } | |
7734 } | |
7735 else | |
7736 { | |
7737 v732 = amount << 7; | |
7738 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7739 2u, | |
7740 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7741 v222 = (char *)HIDWORD(v733); | |
7742 if ( v223 ) | |
7743 LABEL_439: | |
187 | 7744 ((Player *)v222)->PlaySound(SPEECH_103, v1); |
0 | 7745 } |
7746 v222 += 6972; | |
7747 HIDWORD(v733) = (int)v222; | |
7748 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7749 goto LABEL_1056; | |
7750 continue; | |
7751 } | |
7752 } | |
7753 if ( pParty->bTurnBasedModeOn == v1 ) | |
7754 { | |
7755 v646 = pPlayer; | |
7756 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
7757 v647 = n; | |
7758 } | |
7759 else | |
7760 { | |
7761 v647 = n; | |
7762 v646 = pPlayer; | |
7763 v648 = sRecoveryTime; | |
7764 v649 = pPlayer; | |
7765 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
7766 v649->SetRecoveryTime(v648); | |
7767 pTurnEngine->_40471C(); | |
7768 } | |
7769 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
7770 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
7771 v711[v647].spellnum = v1; | |
7772 v646->sMana -= uRequiredMana; | |
7773 } | |
7774 //----- (0042EB42) -------------------------------------------------------- | |
7775 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7776 { | |
7777 unsigned int v2; // edx@1 | |
7778 signed int v3; // eax@1 | |
7779 char *v4; // ecx@2 | |
7780 | |
7781 v2 = this->uNumObjects; | |
7782 v3 = 0; | |
7783 if ( (signed int)this->uNumObjects <= 0 ) | |
7784 { | |
7785 LABEL_5: | |
7786 LOWORD(v3) = 0; | |
7787 } | |
7788 else | |
7789 { | |
7790 v4 = (char *)&this->pObjects->uObjectID; | |
7791 while ( uItemID != *(short *)v4 ) | |
7792 { | |
7793 ++v3; | |
7794 v4 += 56; | |
7795 if ( v3 >= (signed int)v2 ) | |
7796 goto LABEL_5; | |
7797 } | |
7798 } | |
7799 return v3; | |
7800 } | |
7801 | |
7802 | |
7803 | |
7804 //----- (0042EB78) -------------------------------------------------------- | |
7805 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7806 { | |
7807 return 8 * this->pIcons[uIconID].uAnimLength; | |
7808 } | |
7809 | |
7810 //----- (0042EB8D) -------------------------------------------------------- | |
7811 void GUIMessageQueue::SendMessage(UIMessageType msg, int param, unsigned int a4) | |
7812 { | |
7813 if (uNumMessages < 40) | |
7814 { | |
7815 pMessages[uNumMessages].eType = msg; | |
7816 pMessages[uNumMessages].param = param; | |
7817 pMessages[uNumMessages++].field_8 = a4; | |
7818 } | |
7819 } | |
7820 | |
7821 //----- (0042EBBE) -------------------------------------------------------- | |
7822 int __fastcall sub_42EBBE(int a1, int a2) | |
7823 { | |
7824 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7825 } | |
7826 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7827 | |
7828 //----- (0042EBDB) -------------------------------------------------------- | |
7829 int stru193_math::_42EBDB(int angle) | |
7830 { | |
7831 return SinCos(angle - this->uIntegerHalfPi); | |
7832 } | |
7833 | |
7834 //----- (0042ECB5) -------------------------------------------------------- | |
7835 bool __cdecl _42ECB5_PlayerAttacksActor() | |
7836 { | |
7837 unsigned int v0; // ebx@1 | |
7838 Player *v1; // esi@1 | |
7839 bool result; // eax@1 | |
7840 int v3; // edi@2 | |
7841 unsigned int v4; // eax@7 | |
7842 char *v5; // eax@8 | |
7843 int v6; // ecx@9 | |
7844 signed int v7; // eax@16 | |
7845 Actor *v8; // edi@20 | |
7846 unsigned int v9; // ecx@21 | |
7847 char *v10; // eax@26 | |
7848 char *v11; // eax@26 | |
7849 unsigned int v12; // eax@47 | |
7850 char *v13; // eax@47 | |
7851 char *v14; // eax@47 | |
7852 unsigned int v15; // ebx@54 | |
7853 int v16; // [sp-10h] [bp-4Ch]@24 | |
7854 int v17; // [sp-10h] [bp-4Ch]@44 | |
7855 unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7856 unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7857 __int16 v20; // [sp-8h] [bp-44h]@24 | |
7858 __int16 v21; // [sp-8h] [bp-44h]@44 | |
7859 int v22; // [sp-4h] [bp-40h]@24 | |
7860 int v23; // [sp-4h] [bp-40h]@44 | |
7861 SoundID v24; // [sp-4h] [bp-40h]@58 | |
7862 Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 | |
7863 unsigned int a2; // [sp+18h] [bp-24h]@20 | |
7864 unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
112 | 7865 int v28; // [sp+20h] [bp-1Ch]@9 |
7866 unsigned int *v28b; | |
0 | 7867 int v29; // [sp+24h] [bp-18h]@16 |
7868 int v30; // [sp+28h] [bp-14h]@16 | |
7869 int v31; // [sp+2Ch] [bp-10h]@4 | |
7870 int v32; // [sp+30h] [bp-Ch]@7 | |
7871 int v33; // [sp+34h] [bp-8h]@7 | |
7872 int v34; // [sp+38h] [bp-4h]@17 | |
7873 | |
7874 v0 = uActiveCharacter; | |
7875 v27 = 6972 * uActiveCharacter; | |
42 | 7876 v1 = &pParty->pPlayers[uActiveCharacter-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552]; |
7877 result = pParty->pPlayers[uActiveCharacter-1].CanAct();//((Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552])->CanAct(); | |
0 | 7878 if ( result ) |
7879 { | |
7880 pStru277->_427D48(v0); | |
7881 v3 = 0; | |
7882 if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime > 0 ) | |
7883 pParty->pPartyBuffs[11].Reset(); | |
7884 v31 = v1->pEquipment.uBow; | |
7885 if ( v31 && v1->field_1F5[36 * v31 + 15] & 2 ) | |
7886 v31 = 0; | |
7887 v4 = v1->pEquipment.uMainHand; | |
7888 v32 = 0; | |
7889 v33 = 0; | |
7890 if ( v4 ) | |
7891 { | |
112 | 7892 //v5 = (char *)v1 + 36 * v4; |
7893 if ( !(v1->pInventoryItems[v4].field_1A & 2) )//v5[516] & 2) ) | |
0 | 7894 { |
112 | 7895 v28b = &v1->pInventoryItems[v4].uItemID; |
7896 v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
0 | 7897 if ( pItemsTable->pItems[v6].uEquipType == 12 ) |
7898 { | |
112 | 7899 if ( v1->pInventoryItems[v4]._bonus_type <= 0 ) |
0 | 7900 { |
112 | 7901 *v28b = 0; |
0 | 7902 v1->pEquipment.uMainHand = 0; |
7903 } | |
7904 else | |
7905 { | |
112 | 7906 v32 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); |
0 | 7907 } |
7908 } | |
7909 else | |
7910 { | |
7911 if ( v6 == 64 || v6 == 65 ) | |
112 | 7912 v33 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); |
0 | 7913 } |
7914 } | |
7915 } | |
7916 v30 = 0; | |
7917 v29 = 0; | |
7918 v28 = 0; | |
7919 v7 = pMouse->uPointingObjectID; | |
141 | 7920 if ( (pMouse->uPointingObjectID & 7) != OBJECT_Actor || (v34 = pMouse->uPointingObjectID, !pActors[v7 >> 3].CanAct()) ) |
0 | 7921 v34 = stru_50C198.FindClosesActor(5120, 0, 0); |
7922 a3.z = 0; | |
7923 a3.y = 0; | |
7924 a3.x = 0; | |
141 | 7925 if ( (v34 & 7) == OBJECT_Actor) |
0 | 7926 { |
7927 a2 = v34 >> 3; | |
7928 v8 = &pActors[v34 >> 3]; | |
7929 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)) | |
7930 - v8->uActorRadius; | |
7931 if ( v34 >= 0 ) | |
7932 { | |
7933 v9 = 0; | |
7934 } | |
7935 else | |
7936 { | |
7937 v9 = 0; | |
7938 v34 = 0; | |
7939 } | |
7940 if ( v33 != v9 ) | |
7941 { | |
112 | 7942 v28 = 1; |
0 | 7943 v22 = v0 + 8; |
7944 v20 = v9; | |
7945 v18 = v9; | |
7946 v16 = 102; | |
7947 LABEL_34: | |
7948 _42777D_CastSpell_UseWand_ShootArrow(v16, v0 - 1, v18, v20, v22); | |
7949 LABEL_28: | |
7950 v3 = 0; | |
7951 goto LABEL_29; | |
7952 } | |
7953 if ( v32 != v9 ) | |
7954 { | |
7955 v29 = 1; | |
7956 _42777D_CastSpell_UseWand_ShootArrow( | |
7957 *((int *)&pSpellDatas[66].field_8 | |
7958 + *(int *)(&stru_AA1058[3].pSounds[36 * *(int *)&pParty->pArtifactsFound[v27 + 22] + 41048] + v27)), | |
7959 v0 - 1, | |
7960 8u, | |
7961 v9, | |
7962 v0 + 8); | |
7963 v10 = &v1->field_1F5[36 * v1->pEquipment.uMainHand + 11]; | |
7964 --*(int *)v10; | |
7965 v11 = (char *)v1 + 36 * v1->pEquipment.uMainHand; | |
7966 if ( *((int *)v11 + 128) <= 0 ) | |
7967 { | |
7968 *((int *)v11 + 124) = 0; | |
7969 v1->pEquipment.uMainHand = 0; | |
7970 } | |
7971 goto LABEL_28; | |
7972 } | |
7973 if ( (double)v34 <= 407.2 ) | |
7974 { | |
7975 a3.x = v8->vPosition.x - pParty->vPosition.x; | |
7976 a3.y = v8->vPosition.y - pParty->vPosition.y; | |
7977 a3.z = v8->vPosition.z - pParty->vPosition.z; | |
7978 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
7979 DamageMonsterFromParty((8 * v0 - 8) | 4, a2, &a3); | |
7980 if ( v1->WearsItem(506, 1) || v1->WearsItem(506, 0) ) | |
7981 _42FA66_do_explosive_impact( | |
7982 v8->vPosition.x, | |
7983 v8->vPosition.y, | |
7984 v8->vPosition.z + v8->uActorHeight / 2, | |
7985 0, | |
7986 512, | |
7987 v0); | |
7988 } | |
7989 else | |
7990 { | |
7991 if ( v31 != v9 ) | |
7992 { | |
7993 v30 = 1; | |
7994 v22 = 0; | |
7995 v20 = 0; | |
7996 v18 = 0; | |
7997 v16 = 100; | |
7998 goto LABEL_34; | |
7999 } | |
8000 } | |
8001 v3 = 0; | |
8002 goto LABEL_39; | |
8003 } | |
8004 if ( v33 ) | |
8005 { | |
112 | 8006 v28 = 1; |
0 | 8007 v23 = v0 + 8; |
8008 v21 = 0; | |
8009 v19 = 0; | |
8010 v17 = 102; | |
8011 } | |
8012 else | |
8013 { | |
8014 if ( v32 ) | |
8015 { | |
8016 v12 = v1->pEquipment.uMainHand; | |
8017 v29 = 1; | |
8018 _42777D_CastSpell_UseWand_ShootArrow( | |
8019 *((int *)&pSpellDatas[66].field_8 + *(int *)&v1->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v12 + 5]), | |
8020 v0 - 1, | |
8021 8u, | |
8022 0, | |
8023 v0 + 8); | |
8024 v13 = &v1->field_1F5[36 * v1->pEquipment.uMainHand + 11]; | |
8025 --*(int *)v13; | |
8026 v14 = (char *)v1 + 36 * v1->pEquipment.uMainHand; | |
8027 if ( *((int *)v14 + 128) <= 0 ) | |
8028 { | |
8029 *((int *)v14 + 124) = 0; | |
8030 v1->pEquipment.uMainHand = 0; | |
8031 } | |
8032 LABEL_29: | |
8033 v34 = v3; | |
8034 if ( v30 == v3 ) | |
8035 { | |
8036 if ( v29 != v3 ) | |
8037 return 1; | |
112 | 8038 if ( v28 == v3 ) |
0 | 8039 { |
8040 v15 = v1->pEquipment.uMainHand; | |
8041 if ( v1->HasItemEquipped(EQUIP_TWO_HANDED) ) | |
8042 v34 = pItemsTable->pItems[*(int *)&v1->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v15 + 5]].uSkillType; | |
8043 pTurnEngine->_40471C(); | |
8044 } | |
8045 else | |
8046 { | |
8047 v34 = 7; | |
8048 } | |
8049 } | |
8050 else | |
8051 { | |
8052 v34 = 5; | |
187 | 8053 v1->PlaySound(SPEECH_50, v3); |
0 | 8054 } |
8055 switch ( v34 ) | |
8056 { | |
8057 case 0: | |
8058 v24 = (SoundID)81; | |
8059 goto LABEL_66; | |
8060 case 1: | |
8061 v24 = (SoundID)84; | |
8062 goto LABEL_66; | |
8063 case 2: | |
8064 v24 = (SoundID)85; | |
8065 goto LABEL_66; | |
8066 case 3: | |
8067 v24 = (SoundID)78; | |
8068 goto LABEL_66; | |
8069 case 4: | |
8070 v24 = (SoundID)80; | |
8071 goto LABEL_66; | |
8072 case 5: | |
8073 v24 = (SoundID)71; | |
8074 goto LABEL_66; | |
8075 case 6: | |
8076 v24 = (SoundID)83; | |
8077 goto LABEL_66; | |
8078 case 7: | |
8079 v24 = (SoundID)67; | |
8080 LABEL_66: | |
8081 pAudioPlayer->PlaySound(v24, v3, v3, -1, v3, v3, v3, v3); | |
8082 break; | |
8083 default: | |
8084 return 1; | |
8085 } | |
8086 return 1; | |
8087 } | |
8088 if ( !v31 ) | |
8089 { | |
8090 LABEL_39: | |
8091 v31 = v1->GetAttackRecoveryTime(v3); | |
8092 if ( v31 < 30 ) | |
8093 v31 = 30; | |
8094 if ( pParty->bTurnBasedModeOn == v3 ) | |
8095 v1->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v31 * 2.133333333333333)); | |
8096 goto LABEL_29; | |
8097 } | |
8098 v23 = 0; | |
8099 v21 = 0; | |
8100 v19 = 0; | |
8101 v30 = 1; | |
8102 v17 = 100; | |
8103 } | |
8104 _42777D_CastSpell_UseWand_ShootArrow(v17, v0 - 1, v19, v21, v23); | |
8105 goto LABEL_29; | |
8106 } | |
8107 return result; | |
8108 } | |
8109 | |
8110 //----- (0042F184) -------------------------------------------------------- | |
8111 int stru319::FindClosesActor(int a2, int a3, int a4) | |
8112 { | |
8113 int v4; // edi@1 | |
8114 stru319 *v5; // esi@1 | |
8115 int v6; // eax@2 | |
8116 int v7; // eax@4 | |
8117 int result; // eax@5 | |
8118 int *v9; // edx@8 | |
8119 signed int v10; // ebx@10 | |
8120 int v11; // edi@11 | |
8121 Actor *v12; // esi@12 | |
8122 unsigned __int16 v13; // ax@12 | |
8123 int v14; // eax@22 | |
8124 char v15; // zf@30 | |
8125 int v16; // esi@32 | |
8126 int v17; // ecx@34 | |
8127 stru319 *v18; // eax@39 | |
8128 int v19; // edx@39 | |
8129 int v20; // ecx@41 | |
8130 unsigned __int16 v21; // ax@42 | |
8131 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
8132 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
8133 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
8134 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
8135 int *v26; // [sp+18h] [bp-14h]@8 | |
8136 int v27; // [sp+1Ch] [bp-10h]@10 | |
8137 int *v28; // [sp+20h] [bp-Ch]@10 | |
8138 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
8139 int v30; // [sp+28h] [bp-4h]@6 | |
8140 int i; // [sp+38h] [bp+Ch]@33 | |
8141 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
8142 | |
8143 v4 = 0; | |
8144 v5 = this; | |
8145 v24 = this; | |
8146 if ( pRenderer->pRenderD3D ) | |
8147 { | |
8148 v6 = a3 != 0; | |
8149 if ( a4 ) | |
8150 LOBYTE(v6) = v6 | 8; | |
194 | 8151 v7 = pGame->pVisInstance->_4C1944(OBJECT_Actor, a2, v6, 657456, -1); |
0 | 8152 if ( v7 != -1 ) |
8153 return (unsigned __int16)v7; | |
8154 } | |
8155 else | |
8156 { | |
8157 v30 = 0; | |
8158 if ( pRenderer->pActiveZBuffer ) | |
8159 { | |
8160 v29 = viewparams->uScreenX; | |
8161 v23 = viewparams->uScreenZ; | |
8162 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
8163 { | |
8164 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
8165 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8166 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8167 do | |
8168 { | |
8169 if ( (signed int)v29 < (signed int)v23 ) | |
8170 { | |
8171 v28 = v9; | |
8172 v10 = v4; | |
8173 v27 = v23 - v29; | |
8174 do | |
8175 { | |
8176 v22 = *v28; | |
8177 v11 = *v28 & 0xFFFF; | |
141 | 8178 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 8179 { |
8180 v12 = &pActors[(unsigned int)v11 >> 3]; | |
8181 v13 = v12->uAIState; | |
8182 if ( v13 != 5 ) | |
8183 { | |
8184 if ( v13 != 4 | |
8185 && v13 != 11 | |
8186 && v13 != 19 | |
8187 && v13 != 17 | |
8188 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
8189 { | |
8190 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
8191 && v22 <= a2 << 16 ) | |
8192 { | |
8193 v14 = 0; | |
8194 if ( v10 > 0 ) | |
8195 { | |
8196 do | |
8197 { | |
8198 if ( dword_50BDA0[v14] == v11 ) | |
8199 break; | |
8200 ++v14; | |
8201 } | |
8202 while ( v14 < v30 ); | |
8203 } | |
8204 if ( v14 == v30 && v10 < 100 ) | |
8205 { | |
8206 ++v30; | |
8207 dword_50BC10[v10] = v22; | |
8208 dword_50BDA0[v10] = v11; | |
8209 ++v10; | |
8210 } | |
8211 } | |
8212 } | |
8213 } | |
8214 } | |
8215 ++v28; | |
8216 --v27; | |
8217 } | |
8218 while ( v27 ); | |
8219 v4 = v30; | |
8220 v5 = v24; | |
8221 } | |
8222 v9 = v26 + 640; | |
8223 v15 = v25-- == 1; | |
8224 v26 += 640; | |
8225 } | |
8226 while ( !v15 ); | |
8227 } | |
8228 if ( v4 > 0 ) | |
8229 { | |
8230 v32 = 1; | |
8231 v16 = (int)dword_50BC10; | |
8232 do | |
8233 { | |
8234 for ( i = v32; i < v4; ++i ) | |
8235 { | |
8236 v17 = dword_50BC10[i]; | |
8237 if ( v17 < *(int *)v16 ) | |
8238 { | |
8239 dword_50BC10[i] = *(int *)v16; | |
8240 *(int *)v16 = v17; | |
8241 } | |
8242 } | |
8243 ++v32; | |
8244 v16 += 4; | |
8245 } | |
8246 while ( v32 - 1 < v4 ); | |
8247 v5 = v24; | |
8248 if ( v4 > 0 ) | |
8249 { | |
8250 v18 = v24; | |
8251 v19 = v4; | |
8252 do | |
8253 { | |
8254 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
8255 v18 += 4; | |
8256 --v19; | |
8257 } | |
8258 while ( v19 ); | |
8259 } | |
8260 } | |
8261 v20 = 0; | |
8262 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
8263 { | |
8264 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8265 if ( v21 != 4 && v21 != 5 ) | |
8266 break; | |
8267 } | |
8268 if ( v20 != v4 ) | |
8269 { | |
8270 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8271 LOBYTE(result) = result | 3; | |
8272 return result; | |
8273 } | |
8274 } | |
8275 } | |
8276 return 0; | |
8277 } | |
8278 | |
8279 | |
8280 //----- (0042F3D6) -------------------------------------------------------- | |
8281 void InitializeTurnBasedAnimations(void *_this) | |
8282 { | |
8283 unsigned int *v1; // edi@1 | |
8284 | |
8285 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8286 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8287 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8288 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8289 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8290 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8291 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8292 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8293 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8294 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8295 v1 = pIconIDs_Turn; | |
8296 do | |
8297 { | |
8298 pIconsFrameTable->InitializeAnimation(*v1); | |
8299 ++v1; | |
8300 } | |
8301 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8302 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8303 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8304 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8305 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8306 } | |
8307 | |
8308 //----- (0042F4DA) -------------------------------------------------------- | |
8309 signed int __cdecl sub_42F4DA() | |
8310 { | |
8311 signed int v0; // edi@1 | |
82 | 8312 Actor *v1; // esi@4 |
0 | 8313 int v2; // ebx@5 |
8314 int v3; // eax@5 | |
8315 int v4; // ebx@5 | |
8316 unsigned int v5; // ecx@5 | |
8317 int v6; // edx@6 | |
8318 unsigned int v7; // edx@8 | |
8319 unsigned int v8; // edx@10 | |
8320 __int16 v9; // ax@12 | |
8321 signed int result; // eax@20 | |
8322 int v11; // [sp+Ch] [bp-10h]@5 | |
8323 int v12; // [sp+10h] [bp-Ch]@5 | |
8324 signed int v13; // [sp+14h] [bp-8h]@3 | |
8325 | |
8326 v0 = 5120; | |
8327 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8328 v0 = 2560; | |
8329 v13 = 0; | |
8330 if ( (signed int)uNumActors <= 0 ) | |
8331 { | |
8332 LABEL_20: | |
8333 result = 0; | |
8334 } | |
8335 else | |
8336 { | |
82 | 8337 v1 = pActors; |
0 | 8338 while ( 1 ) |
8339 { | |
82 | 8340 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8341 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8342 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8343 v3 = v2; |
8344 v4 = v11; | |
8345 v5 = v12; | |
8346 if ( v3 < v11 ) | |
8347 { | |
8348 v6 = v3; | |
8349 v3 = v11; | |
8350 v4 = v6; | |
8351 } | |
8352 if ( v3 < v12 ) | |
8353 { | |
8354 v7 = v3; | |
8355 v3 = v12; | |
8356 v5 = v7; | |
8357 } | |
8358 if ( v4 < (signed int)v5 ) | |
8359 { | |
8360 v8 = v5; | |
8361 v5 = v4; | |
8362 v4 = v8; | |
8363 } | |
8364 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8365 { | |
82 | 8366 v9 = v1->uAIState; |
8367 if ( v1->uAIState != 5 ) | |
0 | 8368 { |
8369 if ( v9 != 4 | |
8370 && v9 != 11 | |
8371 && v9 != 19 | |
8372 && v9 != 17 | |
82 | 8373 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8374 break; |
8375 } | |
8376 } | |
8377 ++v13; | |
82 | 8378 ++v1; |
0 | 8379 if ( v13 >= (signed int)uNumActors ) |
8380 goto LABEL_20; | |
8381 } | |
8382 result = 1; | |
8383 } | |
8384 return result; | |
8385 } | |
8386 | |
8387 //----- (0042F5ED) -------------------------------------------------------- | |
8388 int LayingItem::Create(int yaw, int pitch, int a4, int a5) | |
8389 { | |
8390 LayingItem *v5; // eax@1 | |
8391 signed int v6; // ebx@2 | |
8392 char *v7; // ecx@2 | |
8393 signed int result; // eax@6 | |
8394 LayingItem *v9; // ebx@7 | |
8395 int v10; // edx@11 | |
8396 int v11; // edi@18 | |
8397 __int16 v12; // ax@18 | |
8398 int v13; // ST2C_4@20 | |
8399 int v14; // eax@20 | |
8400 int v15; // [sp-28h] [bp-38h]@14 | |
8401 int v16; // [sp-24h] [bp-34h]@11 | |
8402 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 | |
8403 int *v18; // [sp-14h] [bp-24h]@11 | |
8404 int *v19; // [sp-10h] [bp-20h]@11 | |
8405 int *v20; // [sp-Ch] [bp-1Ch]@11 | |
8406 signed int v21; // [sp+8h] [bp-8h]@2 | |
8407 int angle; // [sp+Ch] [bp-4h]@1 | |
8408 int a4a; // [sp+1Ch] [bp+Ch]@20 | |
8409 int a4b; // [sp+1Ch] [bp+Ch]@20 | |
8410 int a5a; // [sp+20h] [bp+10h]@20 | |
8411 | |
8412 auto a1 = this; | |
8413 angle = yaw; | |
8414 v5 = a1; | |
8415 if ( !a1->uObjectDescID ) | |
8416 return -1; | |
8417 v6 = 0; | |
8418 v7 = (char *)&pLayingItems[0].uObjectDescID; | |
8419 v21 = 0; | |
8420 do | |
8421 { | |
8422 if ( !*(short *)v7 ) | |
8423 break; | |
8424 v7 += 112; | |
8425 ++v6; | |
8426 v21 = v6; | |
8427 } | |
8428 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) ); | |
8429 if ( v6 >= 1000 ) | |
8430 return -1; | |
8431 *(int *)&v5->field_62[2] = v5->vPosition.x; | |
8432 *(int *)&v5->field_62[6] = v5->vPosition.y; | |
8433 v9 = &pLayingItems[v6]; | |
8434 *(int *)&v5->field_62[10] = v5->vPosition.z; | |
8435 memcpy(v9, v5, 0x70u); | |
8436 if ( a5 == 1 ) | |
8437 { | |
8438 v20 = &v9->vPosition.z; | |
8439 v19 = &v9->vPosition.y; | |
8440 v18 = (int *)&v9->vPosition; | |
8441 v17.z = v5->vPosition.z; | |
8442 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8443 v16 = 0; | |
8444 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8445 goto LABEL_16; | |
8446 } | |
8447 if ( a5 == 2 ) | |
8448 { | |
8449 v20 = &v9->vPosition.z; | |
8450 v19 = &v9->vPosition.y; | |
8451 v18 = (int *)&v9->vPosition; | |
8452 v17.z = v5->vPosition.z; | |
8453 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8454 v16 = 0; | |
8455 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8456 goto LABEL_14; | |
8457 } | |
8458 if ( a5 == 3 ) | |
8459 { | |
8460 v20 = &v9->vPosition.z; | |
8461 v19 = &v9->vPosition.y; | |
8462 v18 = (int *)&v9->vPosition; | |
8463 v17.z = v5->vPosition.z; | |
8464 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8465 v16 = 0; | |
8466 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8467 LABEL_14: | |
8468 v15 = 8; | |
8469 LABEL_17: | |
8470 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20); | |
8471 goto LABEL_18; | |
8472 } | |
8473 if ( a5 == 4 ) | |
8474 { | |
8475 v20 = &v9->vPosition.z; | |
8476 v19 = &v9->vPosition.y; | |
8477 v18 = (int *)&v9->vPosition; | |
8478 v17.z = v5->vPosition.z; | |
8479 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8480 v16 = 0; | |
8481 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8482 LABEL_16: | |
8483 v15 = 24; | |
8484 goto LABEL_17; | |
8485 } | |
8486 LABEL_18: | |
8487 v11 = a4; | |
8488 v12 = 0; | |
8489 if ( a4 ) | |
8490 { | |
8491 a4a = stru_5C6E00->SinCos(angle); | |
8492 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->SinCos(pitch)) >> 16; | |
8493 a4b = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | |
8494 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->SinCos(pitch)) >> 16; | |
8495 v14 = stru_5C6E00->SinCos(pitch - stru_5C6E00->uIntegerHalfPi); | |
8496 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16; | |
8497 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16; | |
8498 v12 = (unsigned int)(v14 * v11) >> 16; | |
8499 } | |
8500 else | |
8501 { | |
8502 v9->vVelocity.y = 0; | |
8503 v9->vVelocity.x = 0; | |
8504 } | |
8505 v9->vVelocity.z = v12; | |
8506 result = v21; | |
8507 if ( v21 >= (signed int)uNumLayingItems ) | |
8508 uNumLayingItems = v21 + 1; | |
8509 return result; | |
8510 } | |
8511 | |
8512 //----- (0042F7EB) -------------------------------------------------------- | |
8513 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) | |
8514 { | |
8515 unsigned int v9; // edi@1 | |
8516 signed int v10; // edx@3 | |
8517 char *v11; // ecx@4 | |
8518 unsigned __int16 v12; // ax@7 | |
8519 unsigned int v13; // edx@9 | |
8520 char *v14; // ecx@10 | |
8521 int v15; // esi@17 | |
8522 int v16; // eax@18 | |
8523 int v17; // edi@20 | |
8524 int v18; // esi@20 | |
8525 //LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8526 int v21; // [sp+7Ch] [bp-8h]@1 | |
8527 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8528 | |
8529 v9 = uSpriteID; | |
8530 v21 = x; | |
8531 v22 = uSpriteID; | |
8532 | |
8533 LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8534 //LayingItem::LayingItem(&a1a); | |
8535 a1a.stru_24.Reset(); | |
8536 | |
8537 if ( a9 ) | |
8538 { | |
8539 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8540 v9 = v22; | |
8541 } | |
8542 v10 = 0; | |
8543 a1a.field_50 = 0; | |
8544 a1a.field_4C = 0; | |
8545 a1a.field_48 = 0; | |
8546 a1a.field_54 = 0; | |
8547 a1a.uItemType = v9; | |
8548 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8549 { | |
8550 LABEL_7: | |
8551 v12 = 0; | |
8552 } | |
8553 else | |
8554 { | |
8555 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8556 while ( (short)v9 != *(short *)v11 ) | |
8557 { | |
8558 ++v10; | |
8559 v11 += 56; | |
8560 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8561 goto LABEL_7; | |
8562 } | |
8563 v12 = v10; | |
8564 } | |
8565 a1a.uObjectDescID = v12; | |
8566 a1a.vPosition.z = z; | |
8567 a1a.vPosition.x = v21; | |
8568 a1a.vPosition.y = y; | |
8569 a1a.uSoundID = 0; | |
8570 a1a.uAttributes = attributes; | |
8571 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8572 a1a.uSpriteFrameID = 0; | |
8573 a1a.field_58 = 0; | |
8574 a1a.field_5C = 0; | |
8575 if ( !(a1a.uAttributes & 0x10) ) | |
8576 { | |
8577 v13 = 0; | |
8578 if ( (signed int)pItemsTable->pItems[0].uItemID > 0 ) | |
8579 { | |
8580 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8581 while ( *(short *)v14 != v9 ) | |
8582 { | |
8583 ++v13; | |
8584 v14 += 48; | |
8585 if ( (signed int)v13 >= (signed int)pItemsTable->pItems[0].uItemID ) | |
8586 goto LABEL_16; | |
8587 } | |
8588 a1a.stru_24.uItemID = v13; | |
8589 } | |
8590 } | |
8591 LABEL_16: | |
8592 if ( a7 ) | |
8593 { | |
8594 v15 = count; | |
8595 if ( count > 0 ) | |
8596 { | |
8597 do | |
8598 { | |
8599 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8600 v16 = rand(); | |
8601 a1a.Create( | |
8602 (signed __int16)a1a.uFacing, | |
8603 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8604 a4, | |
8605 0); | |
8606 --v15; | |
8607 } | |
8608 while ( v15 ); | |
8609 } | |
8610 } | |
8611 else | |
8612 { | |
8613 v17 = count; | |
8614 v18 = stru_5C6E00->uIntegerHalfPi; | |
8615 a1a.uFacing = 0; | |
8616 if ( count > 0 ) | |
8617 { | |
8618 do | |
8619 { | |
8620 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8621 --v17; | |
8622 } | |
8623 while ( v17 ); | |
8624 } | |
8625 } | |
8626 return 1; | |
8627 } | |
8628 | |
8629 //----- (0042F960) -------------------------------------------------------- | |
8630 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8631 { | |
8632 int v3; // ebx@1 | |
8633 int v4; // edi@1 | |
8634 signed int v5; // edx@1 | |
8635 char *v6; // ecx@2 | |
8636 unsigned __int16 v7; // ax@5 | |
8637 signed int v8; // eax@6 | |
8638 signed int v9; // eax@7 | |
8639 //LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8640 | |
8641 v3 = x; | |
8642 v4 = y; | |
8643 | |
8644 LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8645 //LayingItem::LayingItem(&a1); | |
8646 a1.stru_24.Reset(); | |
8647 | |
8648 v5 = 0; | |
8649 a1.field_50 = 0; | |
8650 a1.field_4C = 0; | |
8651 a1.field_48 = 0; | |
8652 a1.field_54 = 0; | |
8653 a1.uItemType = 800; | |
8654 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8655 { | |
8656 LABEL_5: | |
8657 v7 = 0; | |
8658 } | |
8659 else | |
8660 { | |
8661 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8662 while ( *(short *)v6 != 800 ) | |
8663 { | |
8664 ++v5; | |
8665 v6 += 56; | |
8666 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8667 goto LABEL_5; | |
8668 } | |
8669 v7 = v5; | |
8670 } | |
8671 a1.uObjectDescID = v7; | |
8672 a1.vPosition.x = v3; | |
8673 a1.vPosition.y = v4; | |
8674 a1.vPosition.z = z; | |
8675 a1.uSoundID = 0; | |
8676 a1.uAttributes = 0; | |
8677 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8678 a1.uSpriteFrameID = 0; | |
8679 a1.field_58 = 0; | |
8680 a1.field_5C = 0; | |
8681 v8 = a1.Create(0, 0, 0, 0); | |
8682 if ( v8 != -1 ) | |
8683 { | |
8684 v9 = 8 * v8; | |
8685 LOBYTE(v9) = v9 | 2; | |
8686 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8687 } | |
8688 } | |
8689 | |
8690 //----- (0042FA22) -------------------------------------------------------- | |
79 | 8691 LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8692 { |
8693 size_t v0; // edx@1 | |
8694 int v1; // ebp@1 | |
79 | 8695 LayingItem *result; // eax@1 |
8696 LayingItem *v3; // ebx@1 | |
0 | 8697 |
8698 v0 = 0; | |
8699 v1 = 0; | |
79 | 8700 //result = (char *)&pLayingItems[0].uObjectDescID; |
8701 result = pLayingItems; | |
0 | 8702 v3 = pLayingItems; |
8703 do | |
8704 { | |
79 | 8705 if ( result->uObjectDescID ) |
0 | 8706 { |
8707 if ( v1 != v0 ) | |
8708 { | |
79 | 8709 memcpy(v3, result, 0x70u); |
8710 result->uObjectDescID = 0; | |
0 | 8711 } |
8712 ++v0; | |
79 | 8713 ++v3;// = (char *)v3 + 112; |
0 | 8714 } |
79 | 8715 ++result;// += 112; |
0 | 8716 ++v1; |
8717 } | |
79 | 8718 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); |
8719 while( result <= &pLayingItems[999] ); | |
0 | 8720 uNumLayingItems = v0; |
8721 return result; | |
8722 } | |
8723 | |
8724 //----- (0042FA66) -------------------------------------------------------- | |
8725 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8726 { | |
8727 int v6; // edi@1 | |
8728 int v7; // esi@1 | |
8729 char *v8; // ecx@2 | |
8730 unsigned __int16 v9; // ax@5 | |
8731 int v10; // eax@10 | |
8732 signed int result; // eax@11 | |
8733 __int16 v12; // ax@12 | |
8734 //LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8735 int v14; // [sp+7Ch] [bp-4h]@1 | |
8736 | |
8737 v6 = a1; | |
8738 v7 = a2; | |
8739 LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8740 //LayingItem::LayingItem(&a1a); | |
8741 a1a.uItemType = 600; | |
8742 a1a.stru_24.Reset(); | |
8743 | |
8744 a1a.field_48 = 6; | |
8745 a1a.field_4C = 8; | |
8746 a1a.field_50 = 3; | |
8747 v14 = 0; | |
8748 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8749 { | |
8750 LABEL_5: | |
8751 v9 = 0; | |
8752 } | |
8753 else | |
8754 { | |
8755 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
8756 while ( (short)a1a.uItemType != *(short *)v8 ) | |
8757 { | |
8758 ++v14; | |
8759 v8 += 56; | |
8760 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8761 goto LABEL_5; | |
8762 } | |
8763 v9 = v14; | |
8764 } | |
8765 a1a.uObjectDescID = v9; | |
8766 a1a.vPosition.x = v6; | |
8767 a1a.vPosition.y = v7; | |
8768 a1a.vPosition.z = a3; | |
8769 a1a.uAttributes = 0; | |
8770 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8771 a1a.uSpriteFrameID = 0; | |
8772 a1a.field_5C = 0; | |
8773 a1a.field_60_distance_related_prolly_lod = 0; | |
8774 a1a.uFacing = 0; | |
8775 a1a.uSoundID = 0; | |
8776 if ( a6 >= 1 || a6 <= 4 ) | |
8777 { | |
8778 v10 = 8 * a6 - 8; | |
8779 LOBYTE(v10) = v10 | 4; | |
8780 a1a.field_58 = v10; | |
8781 } | |
8782 else | |
8783 { | |
8784 a1a.field_58 = 0; | |
8785 } | |
8786 result = a1a.Create(0, 0, 0, 0); | |
8787 if ( result != -1 ) | |
8788 { | |
8789 v12 = 8 * result; | |
8790 LOBYTE(v12) = v12 | 2; | |
8791 result = stru_50FE08.Add( | |
8792 v12, | |
8793 a5, | |
8794 SLOWORD(a1a.vPosition.x), | |
8795 SLOWORD(a1a.vPosition.y), | |
8796 SLOWORD(a1a.vPosition.z), | |
8797 0, | |
8798 0); | |
8799 } | |
8800 return result; | |
8801 } | |
8802 | |
8803 | |
8804 | |
8805 //----- (0042FB5C) -------------------------------------------------------- | |
8806 bool __fastcall sub_42FB5C(signed int a1) | |
8807 { | |
8808 int v1; // ecx@3 | |
8809 int v2; // ecx@4 | |
8810 int v3; // ecx@5 | |
8811 int v4; // ecx@6 | |
8812 int v5; // ecx@7 | |
8813 int v6; // ecx@8 | |
8814 char v7; // zf@9 | |
8815 | |
8816 if ( a1 > 39 ) | |
8817 { | |
8818 if ( a1 > 77 ) | |
8819 { | |
8820 if ( a1 == 80 ) | |
8821 return 0; | |
8822 if ( a1 > 84 ) | |
8823 { | |
8824 if ( a1 <= 86 ) | |
8825 return 0; | |
8826 v7 = a1 == 95; | |
8827 goto LABEL_20; | |
8828 } | |
8829 } | |
8830 else | |
8831 { | |
8832 if ( a1 == 77 ) | |
8833 return 0; | |
8834 if ( a1 >= 46 ) | |
8835 { | |
8836 if ( a1 <= 47 || a1 == 51 ) | |
8837 return 0; | |
8838 v7 = a1 == 73; | |
8839 goto LABEL_20; | |
8840 } | |
8841 } | |
8842 return 1; | |
8843 } | |
8844 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8845 return 1; | |
8846 v2 = v1 - 3; | |
8847 if ( !v2 ) | |
8848 return 0; | |
8849 v3 = v2 - 1; | |
8850 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8851 return 1; | |
8852 v5 = v4 - 8; | |
8853 if ( !v5 ) | |
8854 return 0; | |
8855 v6 = v5 - 1; | |
8856 if ( !v6 ) | |
8857 return 1; | |
8858 v7 = v6 == 20; | |
8859 LABEL_20: | |
8860 if ( !v7 ) | |
8861 return 1; | |
8862 return 0; | |
8863 } | |
8864 | |
8865 //----- (0042FBDD) -------------------------------------------------------- | |
8866 void __cdecl sub_42FBDD() | |
8867 { | |
8868 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
8869 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); | |
8870 pRenderer->Present(); | |
8871 } | |
8872 | |
8873 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8874 void __cdecl CloseWindowBackground() |
0 | 8875 { |
8876 pAudioPlayer->PlaySound((SoundID)75, -2, 0, -1, 0, 0, 0, 0); | |
8877 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); | |
8878 pRenderer->Present(); | |
8879 } | |
8880 | |
8881 //----- (0042FC4E) -------------------------------------------------------- | |
8882 void __cdecl ProcessInputActions() | |
8883 { | |
8884 ActionQueue *pActionQueue; // esi@7 | |
8885 Keyboard *v3; // ecx@8 | |
8886 char v4; // al@9 | |
8887 ActionQueue *v5; // ecx@19 | |
8888 Player *v6; // ecx@86 | |
8889 Player *v7; // esi@100 | |
8890 char v8; // bl@100 | |
8891 unsigned __int16 v9; // ax@102 | |
8892 int v10; // eax@103 | |
8893 unsigned int v11; // eax@127 | |
8894 signed int v12; // esi@157 | |
8895 Keyboard *v13; // ecx@158 | |
8896 char v14; // al@159 | |
8897 unsigned int v15; // eax@168 | |
8898 void *v16; // esi@177 | |
8899 int v17; // [sp-14h] [bp-1Ch]@8 | |
8900 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8901 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
8902 __int16 v20; // [sp-14h] [bp-1Ch]@60 | |
8903 int v21; // [sp-14h] [bp-1Ch]@68 | |
8904 int v22; // [sp-Ch] [bp-14h]@158 | |
8905 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8906 int v24; // [sp+4h] [bp-4h]@87 | |
8907 | |
8908 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8909 auto pKeyboard = pGame->pKeyboardInstance; | |
8910 if (!bAlwaysRun) | |
8911 { | |
8912 if (pKeyboard->IsShiftHeld()) | |
8913 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8914 else | |
8915 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8916 } | |
8917 else | |
8918 { | |
8919 if (pKeyboard->IsShiftHeld()) | |
8920 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8921 else | |
8922 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8923 } | |
8924 | |
140 | 8925 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
0 | 8926 LABEL_6: |
8927 if ( !pEventTimer->bPaused ) | |
8928 { | |
8929 inputAction = (InputAction)0; | |
8930 pActionQueue = pPartyActionQueue; | |
8931 while ( 1 ) | |
8932 { | |
8933 v3 = pGame->pKeyboardInstance; | |
8934 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8935 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8936 v4 = v3->WasKeyPressed(v17); | |
8937 else | |
8938 v4 = v3->IsKeyBeingHeld(v17); | |
8939 if ( v4 ) | |
8940 { | |
8941 switch ( inputAction ) | |
8942 { | |
8943 case INPUT_MoveForward: | |
8944 if ( pCurrentScreen ) | |
8945 break; | |
8946 if (!pParty->bTurnBasedModeOn) | |
163 | 8947 //goto _do_move_forward; |
0 | 8948 { |
8949 v5 = pActionQueue; | |
140 | 8950 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8951 partyAction = PARTY_RunForward; |
8952 else | |
8953 partyAction = PARTY_WalkForward; | |
163 | 8954 //goto _add_action_and_continue; |
8955 v5->Add(partyAction); | |
8956 break; | |
8957 } | |
8958 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8959 { | |
8960 pTurnEngine->uActionPointsLeft -= 26; | |
8961 //_do_move_forward: | |
8962 v5 = pActionQueue; | |
8963 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8964 partyAction = PARTY_RunForward; | |
8965 else | |
8966 partyAction = PARTY_WalkForward; | |
8967 //goto _add_action_and_continue; | |
8968 v5->Add(partyAction); | |
8969 break; | |
0 | 8970 } |
8971 break; | |
8972 case INPUT_MoveBackwards: | |
17 | 8973 //__debugbreak(); |
0 | 8974 if ( pCurrentScreen ) |
8975 break; | |
8976 if (!pParty->bTurnBasedModeOn) | |
17 | 8977 //goto _do_move_backwards; |
8978 { | |
8979 v5 = pActionQueue; | |
8980 if ( pParty->uFlags2 & 2 ) | |
8981 partyAction = PARTY_RunBackward; | |
8982 else | |
8983 partyAction = PARTY_WalkBackward; | |
163 | 8984 //goto _add_action_and_continue; |
8985 v5->Add(partyAction); | |
8986 break; | |
17 | 8987 } |
0 | 8988 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8989 { | |
8990 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8991 //_do_move_backwards: |
0 | 8992 v5 = pActionQueue; |
8993 if ( pParty->uFlags2 & 2 ) | |
8994 partyAction = PARTY_RunBackward; | |
8995 else | |
8996 partyAction = PARTY_WalkBackward; | |
163 | 8997 //goto _add_action_and_continue; |
8998 v5->Add(partyAction); | |
8999 break; | |
0 | 9000 } |
9001 break; | |
9002 case INPUT_StrafeLeft: | |
17 | 9003 //__debugbreak(); |
0 | 9004 if ( pCurrentScreen ) |
9005 break; | |
9006 if (!pParty->bTurnBasedModeOn) | |
17 | 9007 //goto _do_strafe_left; |
9008 { | |
9009 partyAction = PARTY_StrafeLeft; | |
163 | 9010 //goto _add_action_and_continue_; |
9011 v5 = pActionQueue; | |
9012 v5->Add(partyAction); | |
9013 break; | |
17 | 9014 } |
0 | 9015 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
9016 break; | |
9017 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9018 //_do_strafe_left: |
0 | 9019 partyAction = PARTY_StrafeLeft; |
163 | 9020 //goto _add_action_and_continue_; |
9021 v5 = pActionQueue; | |
9022 v5->Add(partyAction); | |
9023 break; | |
0 | 9024 case INPUT_StrafeRight: |
17 | 9025 //__debugbreak(); |
0 | 9026 if ( pCurrentScreen ) |
9027 break; | |
9028 if (!pParty->bTurnBasedModeOn) | |
17 | 9029 //goto _do_strafe_right; |
9030 { | |
9031 partyAction = PARTY_StrafeRight; | |
163 | 9032 //goto _add_action_and_continue_; |
9033 v5 = pActionQueue; | |
9034 v5->Add(partyAction); | |
9035 break; | |
17 | 9036 } |
0 | 9037 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
9038 break; | |
9039 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9040 //_do_strafe_right: |
0 | 9041 partyAction = PARTY_StrafeRight; |
163 | 9042 //goto _add_action_and_continue_; |
9043 v5 = pActionQueue; | |
9044 v5->Add(partyAction); | |
9045 break; | |
0 | 9046 case INPUT_TurnLeft: |
9047 if ( pCurrentScreen ) | |
9048 break; | |
9049 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
9050 { | |
9051 if (pParty->bTurnBasedModeOn) | |
9052 { | |
9053 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9054 break; | |
9055 pTurnEngine->uActionPointsLeft -= 26; | |
9056 } | |
9057 partyAction_ = PARTY_StrafeLeft; | |
9058 } | |
9059 else | |
9060 { | |
9061 if ( pParty->uFlags2 & 2 ) | |
9062 partyAction_ = PARTY_FastTurnLeft; | |
9063 else | |
9064 partyAction_ = PARTY_TurnLeft; | |
9065 } | |
9066 pActionQueue->Add(partyAction_); | |
9067 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9068 { | |
9069 v20 = 10; | |
163 | 9070 //goto LABEL_75; |
9071 pWeather->_4C2F0B(v20); | |
9072 break; | |
0 | 9073 } |
9074 break; | |
9075 case INPUT_TurnRight: | |
9076 if ( pCurrentScreen ) | |
9077 break; | |
9078 if ( GetAsyncKeyState(17) ) // strafing | |
9079 { | |
9080 if (pParty->bTurnBasedModeOn) | |
9081 { | |
9082 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9083 break; | |
9084 pTurnEngine->uActionPointsLeft -= 26; | |
9085 } | |
9086 v21 = 4; | |
9087 } | |
9088 else | |
9089 { | |
9090 if ( pParty->uFlags2 & 2 ) | |
9091 v21 = 19; | |
9092 else | |
9093 v21 = 2; | |
9094 } | |
9095 pActionQueue->Add((PartyAction)v21); | |
9096 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9097 { | |
9098 v20 = -10; | |
163 | 9099 //LABEL_75: |
0 | 9100 pWeather->_4C2F0B(v20); |
9101 } | |
9102 break; | |
9103 case INPUT_Jump: | |
17 | 9104 //__debugbreak(); |
0 | 9105 if ( pCurrentScreen |
9106 || pParty->bTurnBasedModeOn) | |
9107 break; | |
9108 partyAction = (PartyAction)12; | |
163 | 9109 //goto _add_action_and_continue_; |
9110 v5 = pActionQueue; | |
9111 v5->Add(partyAction); | |
9112 break; | |
0 | 9113 case INPUT_Yell: |
187 | 9114 if (!pCurrentScreen && uActiveCharacter) |
0 | 9115 { |
9116 pParty->Yell(); | |
187 | 9117 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 9118 } |
187 | 9119 break; |
0 | 9120 case INPUT_Pass: |
17 | 9121 //__debugbreak(); |
0 | 9122 if ( pCurrentScreen ) |
9123 break; | |
9124 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9125 //goto LABEL_118; |
9126 { | |
9127 pTurnEngine->field_18 |= 8u; | |
9128 break; | |
9129 } | |
0 | 9130 if ( uActiveCharacter ) |
9131 { | |
9132 v6 = pPlayers[uActiveCharacter]; | |
9133 if ( !v6->uTimeToRecovery ) | |
9134 { | |
9135 v24 = v6->GetAttackRecoveryTime(0); | |
9136 if ( !pParty->bTurnBasedModeOn ) | |
9137 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
9138 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
9139 pStru277->_427D48(uActiveCharacter); | |
9140 pTurnEngine->_40471C(); | |
9141 } | |
9142 } | |
9143 break; | |
9144 case INPUT_Combat: | |
17 | 9145 //__debugbreak(); |
0 | 9146 if ( !pCurrentScreen ) |
9147 { | |
9148 if (pParty->bTurnBasedModeOn) | |
9149 { | |
141 | 9150 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 9151 { |
9152 pParty->bTurnBasedModeOn = 0; | |
9153 pTurnEngine->End(true); | |
9154 } | |
9155 } | |
9156 else | |
9157 { | |
9158 pTurnEngine->Start(); | |
9159 pParty->bTurnBasedModeOn = true; | |
9160 } | |
9161 } | |
9162 break; | |
9163 case INPUT_CastReady: | |
17 | 9164 //__debugbreak(); |
0 | 9165 if ( pCurrentScreen ) |
9166 break; | |
9167 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9168 //goto LABEL_118; |
9169 { | |
9170 pTurnEngine->field_18 |= 8u; | |
9171 break; | |
9172 } | |
0 | 9173 if ( !uActiveCharacter ) |
9174 break; | |
9175 v7 = pPlayers[uActiveCharacter]; | |
9176 v8 = v7->uQuickSpell; | |
9177 if ( !v8 | |
9178 || bUnderwater | |
9179 || ((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)), | |
9180 v10 > v7->sMana) ) | |
9181 { | |
9182 pActionQueue = pPartyActionQueue; | |
9183 LABEL_120: | |
9184 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
9185 { | |
9186 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23; | |
163 | 9187 //goto _send_message; |
9188 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9189 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9190 ++pMessageQueue_50CBD0->uNumMessages; | |
9191 break; | |
0 | 9192 } |
9193 } | |
9194 else | |
9195 { | |
9196 pActionQueue = pPartyActionQueue; | |
9197 if ( dword_50C9E8 < 40 ) | |
9198 { | |
9199 dword_50C9EC[3 * dword_50C9E8] = 25; | |
9200 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9201 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9202 ++dword_50C9E8; | |
9203 } | |
9204 } | |
9205 break; | |
9206 case INPUT_Attack: | |
17 | 9207 //__debugbreak(); |
0 | 9208 if ( pCurrentScreen ) |
9209 break; | |
9210 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
9211 goto LABEL_120; | |
17 | 9212 //LABEL_118: |
0 | 9213 pTurnEngine->field_18 |= 8u; |
9214 break; | |
9215 case INPUT_EventTrigger: | |
9216 if ( !pCurrentScreen ) | |
9217 { | |
9218 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9219 break; | |
9220 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
163 | 9221 //goto _send_message; |
9222 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9223 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9224 ++pMessageQueue_50CBD0->uNumMessages; | |
9225 break; | |
0 | 9226 } |
151 | 9227 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 9228 { |
9229 v11 = pMessageQueue_50CBD0->uNumMessages; | |
9230 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9231 { | |
9232 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9233 { | |
9234 v11 = 1; | |
9235 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 9236 //LABEL_132: |
0 | 9237 pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113; |
163 | 9238 //_send_message: |
0 | 9239 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9240 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9241 ++pMessageQueue_50CBD0->uNumMessages; | |
9242 break; | |
9243 } | |
9244 v11 = 0; | |
9245 pMessageQueue_50CBD0->uNumMessages = 0; | |
9246 } | |
9247 if ( (signed int)v11 < 40 ) | |
163 | 9248 //goto LABEL_132; |
9249 { | |
9250 pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113; | |
9251 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9252 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9253 ++pMessageQueue_50CBD0->uNumMessages; | |
9254 break; | |
9255 } | |
0 | 9256 } |
9257 break; | |
9258 case INPUT_CharCycle: | |
17 | 9259 //__debugbreak(); |
151 | 9260 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 9261 || dword_50C9E8 >= 40 ) |
9262 break; | |
9263 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 9264 //goto LABEL_155; |
9265 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9266 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9267 ++dword_50C9E8; | |
9268 break; | |
0 | 9269 case INPUT_LookUp: |
17 | 9270 //__debugbreak(); |
0 | 9271 if ( pEventTimer->bPaused ) |
9272 break; | |
9273 partyAction = (PartyAction)7; | |
163 | 9274 //goto _add_action_and_continue_; |
9275 v5 = pActionQueue; | |
9276 v5->Add(partyAction); | |
9277 break; | |
0 | 9278 case INPUT_CenterView: |
17 | 9279 //__debugbreak(); |
0 | 9280 if ( pEventTimer->bPaused ) |
9281 break; | |
9282 partyAction = (PartyAction)9; | |
163 | 9283 //goto _add_action_and_continue_; |
9284 v5 = pActionQueue; | |
9285 v5->Add(partyAction); | |
9286 break; | |
0 | 9287 case INPUT_LookDown: |
17 | 9288 //__debugbreak(); |
0 | 9289 if ( pEventTimer->bPaused ) |
9290 break; | |
9291 partyAction = (PartyAction)8; | |
163 | 9292 //goto _add_action_and_continue_; |
9293 v5 = pActionQueue; | |
9294 v5->Add(partyAction); | |
9295 break; | |
0 | 9296 case INPUT_FlyUp: |
17 | 9297 //__debugbreak(); |
0 | 9298 if ( pCurrentScreen |
9299 || pEventTimer->bPaused ) | |
9300 break; | |
9301 partyAction = (PartyAction)13; | |
163 | 9302 //goto _add_action_and_continue_; |
9303 v5 = pActionQueue; | |
9304 v5->Add(partyAction); | |
9305 break; | |
0 | 9306 case INPUT_Land: |
17 | 9307 //__debugbreak(); |
0 | 9308 if ( pCurrentScreen |
9309 || pEventTimer->bPaused ) | |
9310 break; | |
9311 partyAction = (PartyAction)15; | |
163 | 9312 //goto _add_action_and_continue_; |
9313 v5 = pActionQueue; | |
9314 v5->Add(partyAction); | |
9315 break; | |
0 | 9316 case INPUT_FlyDown: |
17 | 9317 //__debugbreak(); |
0 | 9318 if ( !pCurrentScreen |
9319 && !pEventTimer->bPaused ) | |
9320 { | |
9321 partyAction = (PartyAction)14; | |
163 | 9322 //_add_action_and_continue_: |
0 | 9323 v5 = pActionQueue; |
163 | 9324 //_add_action_and_continue: |
0 | 9325 v5->Add(partyAction); |
9326 } | |
9327 break; | |
9328 case INPUT_ZoomIn: | |
17 | 9329 //__debugbreak(); |
0 | 9330 if ( dword_50C9E8 >= 40 ) |
9331 break; | |
9332 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 9333 //goto LABEL_155; |
9334 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9335 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9336 ++dword_50C9E8; | |
9337 break; | |
0 | 9338 case INPUT_ZoomOut: |
17 | 9339 //__debugbreak(); |
0 | 9340 if ( dword_50C9E8 < 40 ) |
9341 { | |
9342 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 9343 //LABEL_155: |
0 | 9344 dword_50C9F0[3 * dword_50C9E8] = 0; |
9345 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9346 ++dword_50C9E8; | |
9347 } | |
9348 break; | |
9349 case INPUT_AlwaysRun: | |
9350 bAlwaysRun = bAlwaysRun == 0; | |
9351 break; | |
17 | 9352 default: |
9353 //__debugbreak(); | |
9354 break; | |
0 | 9355 } |
9356 } | |
9357 inputAction = (InputAction)((int)inputAction + 1); | |
9358 if ( (signed int)inputAction >= 30 ) | |
9359 goto LABEL_176; | |
9360 } | |
9361 } | |
9362 v12 = 0; | |
9363 do | |
9364 { | |
9365 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
9366 v13 = pGame->pKeyboardInstance; | |
9367 if ( pKeyActionMap->pToggleTypes[v12] ) | |
9368 v14 = v13->WasKeyPressed(v22); | |
9369 else | |
9370 v14 = v13->IsKeyBeingHeld(v22); | |
9371 if ( v14 && v12 == 9 ) | |
9372 { | |
9373 if ( !pCurrentScreen ) | |
9374 { | |
9375 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9376 goto LABEL_175; | |
9377 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 9378 //goto LABEL_174; |
9379 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9380 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9381 ++pMessageQueue_50CBD0->uNumMessages; | |
9382 goto LABEL_175; | |
0 | 9383 } |
151 | 9384 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
9385 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 9386 { |
9387 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9388 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9389 { | |
9390 v15 = 0; | |
9391 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9392 { | |
9393 v15 = 1; | |
9394 pMessageQueue_50CBD0->uNumMessages = 1; | |
17 | 9395 //goto LABEL_173; |
9396 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; | |
9397 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9398 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9399 ++pMessageQueue_50CBD0->uNumMessages; | |
9400 goto LABEL_175; | |
0 | 9401 } |
9402 pMessageQueue_50CBD0->uNumMessages = 0; | |
9403 } | |
9404 if ( (signed int)v15 >= 40 ) | |
9405 goto LABEL_175; | |
17 | 9406 //LABEL_173: |
0 | 9407 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9408 //LABEL_174: |
0 | 9409 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9410 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9411 ++pMessageQueue_50CBD0->uNumMessages; | |
9412 goto LABEL_175; | |
9413 } | |
9414 } | |
9415 LABEL_175: | |
9416 ++v12; | |
9417 } | |
9418 while ( v12 < 30 ); | |
9419 LABEL_176: | |
9420 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9421 { | |
9422 AsyncKeyboard::LeaveCriticalSection(); | |
9423 v16 = pAsyncKeyboard; | |
9424 AsyncKeyboard::EnterCriticalSection(); | |
9425 memset((char *)v16 + 521, 0, 0x100u); | |
9426 AsyncKeyboard::LeaveCriticalSection(); | |
9427 } | |
9428 } | |
9429 |