Mercurial > mm7
annotate mm7_6.cpp @ 388:d95a91011d57
AudioPlayer::PlaySound
author | Nomad |
---|---|
date | Sat, 23 Feb 2013 04:01:09 +0200 |
parents | 243418228760 |
children | 111f25d1cc04 |
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" | |
370 | 45 #include "Log.h" |
0 | 46 |
47 #include "mm7_data.h" | |
48 | |
49 | |
50 | |
51 //----- (00424EE0) -------------------------------------------------------- | |
52 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
53 { | |
54 unsigned int v1; // edx@1 | |
55 double v2; // st7@1 | |
56 signed int v3; // edi@1 | |
57 char *v4; // esi@4 | |
58 char *v5; // ecx@4 | |
59 unsigned int v6; // eax@4 | |
60 char *v7; // edx@4 | |
61 double v8; // st6@10 | |
62 double v9; // st5@10 | |
63 double v10; // st6@11 | |
64 unsigned __int8 v11; // c2@15 | |
65 unsigned __int8 v12; // c3@15 | |
66 void *v13; // edi@22 | |
67 char *v14; // eax@22 | |
68 double v15; // st6@22 | |
69 char *v16; // ecx@22 | |
70 signed int result; // eax@24 | |
71 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
72 bool v19; // [sp+Ch] [bp-28h]@6 | |
73 char *v20; // [sp+10h] [bp-24h]@4 | |
74 char *v21; // [sp+14h] [bp-20h]@4 | |
75 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
76 char *v23; // [sp+1Ch] [bp-18h]@4 | |
77 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
78 char *v25; // [sp+24h] [bp-10h]@4 | |
79 char *v26; // [sp+28h] [bp-Ch]@4 | |
80 char *v27; // [sp+2Ch] [bp-8h]@4 | |
81 char *v28; // [sp+30h] [bp-4h]@4 | |
82 | |
83 v1 = uVertexID; | |
84 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
85 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
86 v3 = 0; | |
87 v22 = 0; | |
88 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | |
89 v3 = 1; | |
90 if ( (signed int)(uVertexID + 1) <= 1 ) | |
91 return 0; | |
92 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
93 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
94 v6 = v1; | |
95 v23 = (char *)&array_507D30[0].flt_2C; | |
168 | 96 v26 = (char *)&array_507D30[0]._rhw; |
0 | 97 v24 = array_507D30; |
98 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
99 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
100 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
101 v27 = (char *)&array_507D30[0].v; | |
102 v28 = (char *)&array_507D30[0].u; | |
103 v7 = (char *)&array_50AC10[0].v; | |
104 v18 = v6; | |
105 do | |
106 { | |
107 v19 = v2 >= *((float *)v7 + 5); | |
108 if ( v3 != v19 ) | |
109 { | |
110 if ( v19 ) | |
111 { | |
112 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | |
113 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | |
114 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | |
115 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | |
116 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | |
117 } | |
118 else | |
119 { | |
120 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | |
121 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | |
122 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | |
123 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | |
124 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | |
125 } | |
126 *(float *)v27 = v9; | |
127 *(float *)v25 = v2; | |
128 *(float *)v26 = 1.0 / v2; | |
129 if ( v3 ) | |
130 { | |
131 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
132 { | |
133 v11 = 0; | |
134 v12 = *(float *)v4 == *((float *)v7 - 5); | |
135 goto LABEL_19; | |
136 } | |
137 } | |
138 else | |
139 { | |
140 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
141 { | |
142 v11 = 0; | |
143 v12 = *(float *)v4 == *((float *)v7 + 7); | |
144 LABEL_19: | |
145 if ( v12 | v11 ) | |
146 goto LABEL_21; | |
147 goto LABEL_20; | |
148 } | |
149 } | |
150 LABEL_20: | |
151 v26 += 48; | |
152 ++v24; | |
153 v25 += 48; | |
154 v27 += 48; | |
155 v28 += 48; | |
156 v5 += 48; | |
157 v4 += 48; | |
158 ++v22; | |
159 v23 += 48; | |
160 v21 = v5; | |
161 v20 = v4; | |
162 } | |
163 LABEL_21: | |
164 if ( v19 ) | |
165 { | |
166 v13 = v24; | |
167 v14 = v26; | |
168 v21 += 48; | |
169 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
170 v20 += 48; | |
171 ++v22; | |
172 v28 += 48; | |
173 v27 += 48; | |
174 v25 += 48; | |
175 ++v24; | |
176 v26 += 48; | |
177 memcpy(v13, v7 + 8, 0x30u); | |
178 v16 = v23; | |
179 v23 += 48; | |
180 v4 = v20; | |
181 *(float *)v14 = v15; | |
182 *(int *)v16 = *((int *)v7 + 13); | |
183 v5 = v21; | |
184 } | |
185 v3 = v19; | |
186 v7 += 48; | |
187 --v18; | |
188 } | |
189 while ( v18 ); | |
190 result = v22; | |
191 if ( v22 < 3 ) | |
192 return 0; | |
193 return result; | |
194 } | |
195 | |
196 //----- (004250FE) -------------------------------------------------------- | |
197 signed int __fastcall sr_4250FE(unsigned int uVertexID) | |
198 { | |
199 unsigned int v1; // edx@1 | |
200 char *v2; // edi@5 | |
201 char *v3; // esi@5 | |
202 char *v4; // ecx@5 | |
203 int v5; // ebx@6 | |
204 double v6; // st6@11 | |
205 double v7; // st5@11 | |
206 double v8; // st6@12 | |
207 unsigned __int8 v9; // c2@16 | |
208 unsigned __int8 v10; // c3@16 | |
209 void *v11; // edi@23 | |
210 double v12; // st6@23 | |
211 char *v13; // ecx@23 | |
212 char v14; // zf@24 | |
213 signed int result; // eax@25 | |
214 unsigned int v16; // [sp+8h] [bp-28h]@5 | |
215 bool v17; // [sp+Ch] [bp-24h]@2 | |
216 bool v18; // [sp+10h] [bp-20h]@7 | |
217 char *v19; // [sp+14h] [bp-1Ch]@5 | |
218 char *v20; // [sp+18h] [bp-18h]@5 | |
219 signed int v21; // [sp+1Ch] [bp-14h]@1 | |
220 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5 | |
221 char *v23; // [sp+24h] [bp-Ch]@5 | |
222 char *v24; // [sp+28h] [bp-8h]@5 | |
223 char *v25; // [sp+2Ch] [bp-4h]@5 | |
224 | |
225 v1 = uVertexID; | |
226 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
227 v21 = 0; | |
228 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0; | |
229 if ( (signed int)(uVertexID + 1) <= 1 ) | |
230 return 0; | |
231 v2 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
232 v3 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 233 v24 = (char *)&array_507D30[0]._rhw; |
0 | 234 v22 = array_507D30; |
235 v19 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
236 v20 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
237 v23 = (char *)&array_507D30[0].vWorldViewPosition; | |
238 v25 = (char *)&array_507D30[0].flt_2C; | |
239 v4 = (char *)&array_50AC10[0].vWorldViewPosition; | |
240 v16 = v1; | |
241 do | |
242 { | |
243 v5 = (int)(v4 + 48); | |
244 v18 = *((float *)v4 + 12) >= 8.0; | |
245 if ( v17 != v18 ) | |
246 { | |
247 if ( v18 ) | |
248 { | |
249 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4); | |
250 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1); | |
251 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2); | |
252 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8); | |
253 } | |
254 else | |
255 { | |
256 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5); | |
257 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13); | |
258 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14); | |
259 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20); | |
260 } | |
261 *(float *)v25 = v7; | |
262 *(float *)v23 = 8.0; | |
263 *(int *)v24 = 0x3E000000u; | |
264 if ( v17 ) | |
265 { | |
266 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) ) | |
267 { | |
268 v9 = 0; | |
269 v10 = *(float *)v2 == *((float *)v4 + 2); | |
270 goto LABEL_20; | |
271 } | |
272 } | |
273 else | |
274 { | |
275 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) ) | |
276 { | |
277 v9 = 0; | |
278 v10 = *(float *)v2 == *((float *)v4 + 14); | |
279 LABEL_20: | |
280 if ( v10 | v9 ) | |
281 goto LABEL_22; | |
282 goto LABEL_21; | |
283 } | |
284 } | |
285 LABEL_21: | |
286 ++v22; | |
287 v23 += 48; | |
288 v25 += 48; | |
289 v3 += 48; | |
290 v2 += 48; | |
291 ++v21; | |
292 v24 += 48; | |
293 v20 = v3; | |
294 v19 = v2; | |
295 } | |
296 LABEL_22: | |
297 if ( v18 ) | |
298 { | |
299 v11 = v22; | |
300 v20 += 48; | |
301 v19 += 48; | |
302 v12 = 1.0 / (*(float *)v5 + 0.0000001); | |
303 ++v21; | |
304 v25 += 48; | |
305 v23 += 48; | |
306 ++v22; | |
307 memcpy(v11, v4 + 36, 0x30u); | |
308 v13 = v24; | |
309 v24 += 48; | |
310 v3 = v20; | |
311 v2 = v19; | |
312 *(float *)v13 = v12; | |
313 } | |
314 v14 = v16-- == 1; | |
315 v17 = v18; | |
316 v4 = (char *)v5; | |
317 } | |
318 while ( !v14 ); | |
319 result = v21; | |
320 if ( v21 < 3 ) | |
321 return 0; | |
322 return result; | |
323 } | |
324 | |
325 //----- (004252E8) -------------------------------------------------------- | |
326 signed int __fastcall sr_4252E8(unsigned int uVertexID) | |
327 { | |
328 unsigned int v1; // edx@1 | |
329 double v2; // st7@1 | |
330 char *v3; // edi@5 | |
331 char *v4; // esi@5 | |
332 char *v5; // ecx@5 | |
333 int v6; // ebx@6 | |
334 double v7; // st6@11 | |
335 double v8; // st5@11 | |
336 double v9; // st6@12 | |
337 unsigned __int8 v10; // c2@16 | |
338 unsigned __int8 v11; // c3@16 | |
339 void *v12; // edi@23 | |
340 double v13; // st6@23 | |
341 char *v14; // ecx@23 | |
342 char v15; // zf@24 | |
343 signed int result; // eax@25 | |
344 unsigned int v17; // [sp+8h] [bp-28h]@5 | |
345 bool v18; // [sp+Ch] [bp-24h]@2 | |
346 bool v19; // [sp+10h] [bp-20h]@7 | |
347 char *v20; // [sp+14h] [bp-1Ch]@5 | |
348 char *v21; // [sp+18h] [bp-18h]@5 | |
349 signed int v22; // [sp+1Ch] [bp-14h]@1 | |
350 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5 | |
351 char *v24; // [sp+24h] [bp-Ch]@5 | |
352 char *v25; // [sp+28h] [bp-8h]@5 | |
353 char *v26; // [sp+2Ch] [bp-4h]@5 | |
354 | |
355 v1 = uVertexID; | |
356 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
357 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
358 v22 = 0; | |
359 v18 = array_50AC10[0].vWorldViewPosition.x <= v2; | |
360 if ( (signed int)(uVertexID + 1) <= 1 ) | |
361 return 0; | |
362 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
363 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 364 v25 = (char *)&array_507D30[0]._rhw; |
0 | 365 v23 = array_507D30; |
366 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
367 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
368 v24 = (char *)&array_507D30[0].vWorldViewPosition; | |
369 v26 = (char *)&array_507D30[0].flt_2C; | |
370 v5 = (char *)&array_50AC10[0].vWorldViewPosition; | |
371 v17 = v1; | |
372 do | |
373 { | |
374 v6 = (int)(v5 + 48); | |
375 v19 = v2 >= *((float *)v5 + 12); | |
376 if ( v18 != v19 ) | |
377 { | |
378 if ( v19 ) | |
379 { | |
380 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5); | |
381 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1); | |
382 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2); | |
383 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8); | |
384 } | |
385 else | |
386 { | |
387 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6); | |
388 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13); | |
389 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14); | |
390 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20); | |
391 } | |
392 *(float *)v26 = v8; | |
393 *(float *)v24 = v2; | |
394 *(float *)v25 = 1.0 / v2; | |
395 if ( v18 ) | |
396 { | |
397 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) ) | |
398 { | |
399 v10 = 0; | |
400 v11 = *(float *)v3 == *((float *)v5 + 2); | |
401 goto LABEL_20; | |
402 } | |
403 } | |
404 else | |
405 { | |
406 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) ) | |
407 { | |
408 v10 = 0; | |
409 v11 = *(float *)v3 == *((float *)v5 + 14); | |
410 LABEL_20: | |
411 if ( v11 | v10 ) | |
412 goto LABEL_22; | |
413 goto LABEL_21; | |
414 } | |
415 } | |
416 LABEL_21: | |
417 ++v23; | |
418 v24 += 48; | |
419 v26 += 48; | |
420 v4 += 48; | |
421 v3 += 48; | |
422 ++v22; | |
423 v25 += 48; | |
424 v21 = v4; | |
425 v20 = v3; | |
426 } | |
427 LABEL_22: | |
428 if ( v19 ) | |
429 { | |
430 v12 = v23; | |
431 v21 += 48; | |
432 v20 += 48; | |
433 v13 = 1.0 / (*(float *)v6 + 0.0000001); | |
434 ++v22; | |
435 v26 += 48; | |
436 v24 += 48; | |
437 ++v23; | |
438 memcpy(v12, v5 + 36, 0x30u); | |
439 v14 = v25; | |
440 v25 += 48; | |
441 v4 = v21; | |
442 v3 = v20; | |
443 *(float *)v14 = v13; | |
444 } | |
445 v15 = v17-- == 1; | |
446 v18 = v19; | |
447 v5 = (char *)v6; | |
448 } | |
449 while ( !v15 ); | |
450 result = v22; | |
451 if ( v22 < 3 ) | |
452 return 0; | |
453 return result; | |
454 } | |
455 | |
456 | |
457 | |
458 //----- (004361EF) -------------------------------------------------------- | |
459 IndoorCameraD3D::IndoorCameraD3D() | |
460 { | |
461 IndoorCameraD3D *v1; // esi@1 | |
462 double v2; // st7@1 | |
463 double v3; // st6@1 | |
464 double v4; // st5@1 | |
465 double v5; // st7@1 | |
466 double v6; // st6@1 | |
467 double v7; // st5@1 | |
468 | |
469 v1 = this; | |
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4); | |
471 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14); | |
472 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24); | |
473 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, | |
474 24, | |
475 6, | |
476 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
477 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ | |
478 v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
479 v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
480 v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; | |
481 v1->field_108 = 0.0; | |
482 v1->field_DC = v4; | |
483 v1->field_E0 = v3; | |
484 v1->field_E4 = v2; | |
485 v5 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
486 v6 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
487 v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300); | |
488 v1->field_138 = 0.0; | |
489 v1->field_10C = v7; | |
490 v1->field_110 = v6; | |
491 v1->field_114 = v5; | |
492 v1->field_168 = 0.0; | |
493 v1->field_198 = 0.0; | |
494 v1->field_1C8 = 0.0; | |
495 v1->field_1F8 = 0.0; | |
496 v1->field_228 = 0.0; | |
497 v1->field_258 = 0.0; | |
498 v1->field_288 = 0.0; | |
499 v1->field_2B8 = 0.0; | |
500 v1->field_2E8 = 0.0; | |
501 v1->field_2BC = 0.0; | |
502 v1->field_2C0 = 0.0; | |
503 v1->field_2C4 = 0.0; | |
504 v1->field_318 = 0.0; | |
505 v1->field_2EC = 0.0; | |
506 v1->field_2F0 = 0.0; | |
507 v1->field_2F4 = 0.0; | |
508 v1->field_348 = 0.0; | |
509 v1->field_31C = 0.0; | |
510 v1->field_320 = 0.0; | |
511 v1->field_324 = 0.0; | |
512 v1->field_378 = 0.0; | |
513 v1->field_34C = 0.0; | |
514 v1->field_350 = 0.0; | |
515 v1->field_354 = 0.0; | |
516 for (uint i = 0; i < 16384; ++i) | |
517 { | |
518 list_0037C[i].field_0 = 0; | |
519 list_0037C[i].flt_30 = 0.0f; | |
520 } | |
521 | |
522 list_0037C_size = 0; | |
523 for (uint i = 0; i < 256; ++i) | |
524 list_E0380[i].mm7__vector_000004_size = 0; | |
525 /*v10 = v1->list_E0380; | |
526 v12 = 256; | |
527 do | |
528 { | |
529 v10->mm7__vector_000004_size = 0; | |
530 //mm7__vector_constructor( | |
531 // v10->mm7__vector_000004, | |
532 // 48, | |
533 // 64, | |
534 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); | |
535 //++v10; | |
536 --v12; | |
537 } | |
538 while ( v12 );*/ | |
539 list_E0380_size = 0; | |
540 //v1->vdestructor_ptr = &stru8_pvdtor; | |
541 } | |
542 | |
543 | |
544 //----- (004254D2) -------------------------------------------------------- | |
545 int __fastcall sr_4254D2(signed int a1) | |
546 { | |
547 signed int v1; // ebx@2 | |
548 int v2; // ecx@2 | |
549 int result; // eax@11 | |
550 double v4; // ST74_8@12 | |
551 bool v5; // edi@12 | |
552 char *v6; // esi@13 | |
553 char *v7; // ebx@13 | |
554 double v8; // st7@15 | |
555 double v9; // st7@16 | |
556 double v10; // st6@16 | |
557 double v11; // st7@17 | |
558 float v12; // eax@18 | |
559 double v13; // ST4C_8@19 | |
560 double v14; // ST10_8@19 | |
561 double v15; // ST28_8@20 | |
562 double v16; // ST34_8@20 | |
563 char v17; // zf@20 | |
564 double v18; // ST18_8@21 | |
565 double v19; // ST3C_8@21 | |
566 double v20; // ST44_8@22 | |
567 double v21; // ST54_8@22 | |
568 void *v22; // edi@26 | |
569 double v23; // ST54_8@29 | |
570 bool v24; // esi@29 | |
571 char *v25; // edi@30 | |
572 char *v26; // ebx@30 | |
573 bool v27; // ecx@32 | |
574 double v28; // st7@33 | |
575 double v29; // st7@34 | |
576 double v30; // st6@34 | |
577 double v31; // st7@35 | |
578 double v32; // ST44_8@37 | |
579 double v33; // ST3C_8@37 | |
580 double v34; // ST18_8@38 | |
581 double v35; // ST34_8@38 | |
582 char v36; // zf@38 | |
583 double v37; // ST28_8@39 | |
584 double v38; // ST10_8@39 | |
585 double v39; // ST20_8@40 | |
586 double v40; // ST5C_8@40 | |
587 void *v41; // edi@44 | |
588 double v42; // ST5C_8@47 | |
589 bool v43; // edi@47 | |
590 char *v44; // esi@48 | |
591 char *v45; // ebx@48 | |
592 bool v46; // ecx@49 | |
593 double v47; // st6@50 | |
594 double v48; // st6@51 | |
595 double v49; // st5@51 | |
596 double v50; // st6@52 | |
597 double v51; // ST20_8@54 | |
598 double v52; // ST54_8@54 | |
599 double v53; // ST44_8@55 | |
600 double v54; // ST3C_8@55 | |
601 char v55; // zf@55 | |
602 double v56; // ST18_8@56 | |
603 double v57; // ST34_8@56 | |
604 double v58; // ST28_8@57 | |
605 double v59; // ST10_8@57 | |
606 void *v60; // edi@61 | |
607 double v61; // ST5C_8@64 | |
608 bool v62; // edi@64 | |
609 char *v63; // esi@65 | |
610 char *v64; // ebx@65 | |
611 bool v65; // ecx@66 | |
612 double v66; // st6@67 | |
613 double v67; // st6@68 | |
614 double v68; // st5@68 | |
615 double v69; // st6@69 | |
616 double v70; // ST20_8@71 | |
617 double v71; // ST54_8@71 | |
618 double v72; // ST44_8@72 | |
619 double v73; // ST3C_8@72 | |
620 char v74; // zf@72 | |
621 double v75; // ST18_8@73 | |
622 double v76; // ST34_8@73 | |
623 double v77; // ST28_8@74 | |
624 double v78; // ST10_8@74 | |
625 void *v79; // edi@78 | |
626 int v80; // ebx@81 | |
627 char *v81; // ecx@82 | |
628 signed int v82; // esi@82 | |
629 float v83; // ST78_4@83 | |
630 double v84; // ST5C_8@83 | |
631 float v85; // eax@84 | |
632 double v86; // ST20_8@85 | |
633 double v87; // ST54_8@88 | |
634 float v88; // eax@89 | |
635 double v89; // ST44_8@90 | |
636 unsigned __int8 v90; // sf@94 | |
637 unsigned __int8 v91; // of@94 | |
638 int v92; // edx@97 | |
639 int v93; // esi@97 | |
640 int v94; // edi@97 | |
641 int v95; // eax@97 | |
642 int v96; // eax@104 | |
643 double v97; // [sp+4Ch] [bp-8Ch]@32 | |
644 double v98; // [sp+54h] [bp-84h]@49 | |
645 double v99; // [sp+54h] [bp-84h]@66 | |
646 float v100; // [sp+5Ch] [bp-7Ch]@1 | |
647 float v101; // [sp+60h] [bp-78h]@1 | |
648 float v102; // [sp+64h] [bp-74h]@1 | |
649 double v103; // [sp+6Ch] [bp-6Ch]@14 | |
650 float v104; // [sp+A8h] [bp-30h]@1 | |
651 signed int v105; // [sp+A8h] [bp-30h]@96 | |
652 bool v106; // [sp+ACh] [bp-2Ch]@14 | |
653 bool v107; // [sp+ACh] [bp-2Ch]@32 | |
654 bool v108; // [sp+ACh] [bp-2Ch]@49 | |
655 bool v109; // [sp+ACh] [bp-2Ch]@66 | |
656 signed int v110; // [sp+B0h] [bp-28h]@12 | |
657 char *v111; // [sp+B8h] [bp-20h]@30 | |
658 signed int v112; // [sp+B8h] [bp-20h]@48 | |
659 signed int v113; // [sp+B8h] [bp-20h]@65 | |
660 char *v114; // [sp+BCh] [bp-1Ch]@13 | |
661 signed int v115; // [sp+BCh] [bp-1Ch]@29 | |
662 signed int v116; // [sp+BCh] [bp-1Ch]@64 | |
663 signed int v117; // [sp+C0h] [bp-18h]@1 | |
664 char *v118; // [sp+C0h] [bp-18h]@30 | |
665 char *v119; // [sp+C0h] [bp-18h]@48 | |
666 char *v120; // [sp+C0h] [bp-18h]@65 | |
667 char *v121; // [sp+C4h] [bp-14h]@13 | |
668 char *v122; // [sp+C4h] [bp-14h]@30 | |
669 signed int v123; // [sp+C4h] [bp-14h]@47 | |
670 char *v124; // [sp+C8h] [bp-10h]@30 | |
671 char *v125; // [sp+C8h] [bp-10h]@48 | |
672 char *v126; // [sp+C8h] [bp-10h]@65 | |
673 signed int v127; // [sp+CCh] [bp-Ch]@2 | |
674 char *v128; // [sp+CCh] [bp-Ch]@13 | |
675 char *v129; // [sp+CCh] [bp-Ch]@30 | |
676 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48 | |
677 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65 | |
678 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13 | |
679 char *v133; // [sp+D0h] [bp-8h]@30 | |
680 char *v134; // [sp+D0h] [bp-8h]@48 | |
681 char *v135; // [sp+D0h] [bp-8h]@65 | |
682 signed int v136; // [sp+D4h] [bp-4h]@1 | |
683 char *v137; // [sp+D4h] [bp-4h]@13 | |
684 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30 | |
685 char *v139; // [sp+D4h] [bp-4h]@48 | |
686 char *v140; // [sp+D4h] [bp-4h]@65 | |
687 | |
688 v101 = (double)(signed int)pViewport->uViewportX; | |
689 v100 = (double)(signed int)pViewport->uViewportZ; | |
690 v117 = a1; | |
691 v136 = 1; | |
692 v104 = (double)(signed int)pViewport->uViewportY; | |
693 v102 = (double)(pViewport->uViewportW + 1); | |
694 if ( a1 <= 0 ) | |
695 return v117; | |
696 v127 = a1; | |
697 v1 = a1; | |
698 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2)); | |
699 v2 = 0; | |
700 do | |
701 { | |
702 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 ) | |
703 v136 = 0; | |
704 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 ) | |
705 v136 = 0; | |
706 ++v2; | |
707 --v127; | |
708 } | |
709 while ( v127 ); | |
710 if ( v136 ) | |
711 return v117; | |
712 v110 = 0; | |
713 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1])); | |
714 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15; | |
715 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportX; | |
716 if ( v117 < 1 ) | |
717 goto LABEL_112; | |
718 v6 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
719 v132 = array_50A2B0; | |
720 v137 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
721 v128 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
722 v121 = (char *)&array_50A2B0[0].flt_2C; | |
168 | 723 v114 = (char *)&array_50A2B0[0]._rhw; |
0 | 724 v7 = (char *)&array_50AC10[0].flt_2C; |
725 do | |
726 { | |
727 v103 = *((float *)v7 + 7) + 6.7553994e15; | |
728 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportX; | |
729 if ( !(v5 ^ v106) ) | |
730 goto LABEL_25; | |
731 v8 = v101; | |
732 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportX ) | |
733 { | |
734 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5)); | |
735 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4); | |
736 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3); | |
737 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7; | |
738 } | |
739 else | |
740 { | |
741 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7)); | |
742 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8); | |
743 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9); | |
744 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12); | |
745 } | |
746 *(float *)v121 = v10; | |
747 *(int *)v137 = LODWORD(v101); | |
748 LODWORD(v12) = *(int *)v6; | |
749 if ( v5 ) | |
750 { | |
751 v13 = v12 + 6.7553994e15; | |
752 v14 = *((float *)v7 - 4) + 6.7553994e15; | |
753 if ( LODWORD(v13) == LODWORD(v14) ) | |
754 { | |
755 v15 = *(float *)v137 + 6.7553994e15; | |
756 v16 = *((float *)v7 - 5) + 6.7553994e15; | |
757 v17 = LODWORD(v15) == LODWORD(v16); | |
758 goto LABEL_23; | |
759 } | |
760 } | |
761 else | |
762 { | |
763 v18 = v12 + 6.7553994e15; | |
764 v19 = *((float *)v7 + 8) + 6.7553994e15; | |
765 if ( LODWORD(v18) == LODWORD(v19) ) | |
766 { | |
767 v20 = *(float *)v137 + 6.7553994e15; | |
768 v21 = *((float *)v7 + 7) + 6.7553994e15; | |
769 v17 = LODWORD(v20) == LODWORD(v21); | |
770 LABEL_23: | |
771 if ( v17 ) | |
772 goto LABEL_25; | |
773 goto LABEL_24; | |
774 } | |
775 } | |
776 LABEL_24: | |
777 v121 += 48; | |
778 v114 += 48; | |
779 v6 += 48; | |
780 ++v110; | |
781 ++v132; | |
782 v128 = v6; | |
783 v137 += 48; | |
784 LABEL_25: | |
785 if ( v106 ) | |
786 { | |
787 v22 = v132; | |
788 v128 += 48; | |
789 ++v110; | |
790 v114 += 48; | |
791 v121 += 48; | |
792 v137 += 48; | |
793 ++v132; | |
794 memcpy(v22, v7 + 4, 0x30u); | |
795 v6 = v128; | |
796 } | |
797 v5 = v106; | |
798 v7 += 48; | |
799 --v117; | |
800 } | |
801 while ( v117 ); | |
802 if ( v110 < 3 | |
803 || (v115 = 0, | |
804 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])), | |
805 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15, | |
806 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportZ, | |
807 v110 < 1) ) | |
808 goto LABEL_112; | |
168 | 809 v25 = (char *)&array_509950[0]._rhw; |
0 | 810 v138 = array_509950; |
811 v129 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
812 v118 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
813 v133 = (char *)&array_509950[0].vWorldViewProjX; | |
814 v122 = (char *)&array_509950[0].vWorldViewProjY; | |
815 v124 = (char *)&array_509950[0].flt_2C; | |
168 | 816 v111 = (char *)&array_509950[0]._rhw; |
0 | 817 v26 = (char *)&array_50A2B0[0].flt_2C; |
818 while ( 2 ) | |
819 { | |
820 v97 = *((float *)v26 + 7) + 6.7553994e15; | |
821 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
822 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
823 if ( v24 != v27 ) | |
824 { | |
825 v28 = v100; | |
826 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportZ ) | |
827 { | |
828 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5)); | |
829 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4); | |
830 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3); | |
831 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26; | |
832 } | |
833 else | |
834 { | |
835 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7)); | |
836 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8); | |
837 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9); | |
838 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12); | |
839 } | |
840 *(float *)v124 = v30; | |
841 *(int *)v133 = LODWORD(v100); | |
842 if ( v24 ) | |
843 { | |
844 v32 = *(float *)v122 + 6.7553994e15; | |
845 v33 = *((float *)v26 - 4) + 6.7553994e15; | |
846 if ( LODWORD(v32) == LODWORD(v33) ) | |
847 { | |
848 v34 = *(float *)v133 + 6.7553994e15; | |
849 v35 = *((float *)v26 - 5) + 6.7553994e15; | |
850 v36 = LODWORD(v34) == LODWORD(v35); | |
851 goto LABEL_41; | |
852 } | |
853 goto LABEL_42; | |
854 } | |
855 v37 = *(float *)v118 + 6.7553994e15; | |
856 v38 = *((float *)v26 + 8) + 6.7553994e15; | |
857 if ( LODWORD(v37) != LODWORD(v38) ) | |
858 goto LABEL_42; | |
859 v39 = *(float *)v129 + 6.7553994e15; | |
860 v40 = *((float *)v26 + 7) + 6.7553994e15; | |
861 v36 = LODWORD(v39) == LODWORD(v40); | |
862 LABEL_41: | |
863 if ( !v36 ) | |
864 { | |
865 LABEL_42: | |
866 v129 += 48; | |
867 v118 += 48; | |
868 v133 += 48; | |
869 v122 += 48; | |
870 v124 += 48; | |
871 v111 += 48; | |
872 ++v115; | |
873 ++v138; | |
874 } | |
875 } | |
876 if ( v27 ) | |
877 { | |
878 v41 = v138; | |
879 ++v115; | |
880 v111 += 48; | |
881 v124 += 48; | |
882 v122 += 48; | |
883 v133 += 48; | |
884 v118 += 48; | |
885 v129 += 48; | |
886 ++v138; | |
887 memcpy(v41, v26 + 4, 0x30u); | |
888 } | |
889 v24 = v107; | |
890 v26 += 48; | |
891 --v110; | |
892 if ( v110 ) | |
893 { | |
894 v25 = v111; | |
895 continue; | |
896 } | |
897 break; | |
898 } | |
899 if ( v115 < 3 | |
900 || (v123 = 0, | |
901 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])), | |
902 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15, | |
903 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportY, | |
904 v115 < 1) ) | |
905 goto LABEL_112; | |
906 v44 = (char *)&array_508FF0[0].vWorldViewProjX; | |
907 v130 = array_508FF0; | |
908 v119 = (char *)&array_508FF0[0].vWorldViewProjX; | |
909 v139 = (char *)&array_508FF0[0].vWorldViewProjY; | |
910 v125 = (char *)&array_508FF0[0].flt_2C; | |
168 | 911 v134 = (char *)&array_508FF0[0]._rhw; |
0 | 912 v45 = (char *)&array_509950[0].flt_2C; |
913 v112 = v115; | |
914 while ( 2 ) | |
915 { | |
916 v98 = *((float *)v45 + 8) + 6.7553994e15; | |
917 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
918 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
919 if ( v43 != v46 ) | |
920 { | |
921 v47 = v104; | |
922 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportY ) | |
923 { | |
924 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4)); | |
925 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5); | |
926 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3); | |
927 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45; | |
928 } | |
929 else | |
930 { | |
931 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8)); | |
932 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7); | |
933 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9); | |
934 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12); | |
935 } | |
936 *(float *)v125 = v49; | |
937 *(float *)v139 = v104; | |
938 if ( v43 ) | |
939 { | |
940 v51 = v104 + 6.7553994e15; | |
941 v52 = *((float *)v45 - 4) + 6.7553994e15; | |
942 if ( LODWORD(v51) == LODWORD(v52) ) | |
943 { | |
944 v53 = *(float *)v44 + 6.7553994e15; | |
945 v54 = *((float *)v45 - 5) + 6.7553994e15; | |
946 v55 = LODWORD(v53) == LODWORD(v54); | |
947 goto LABEL_58; | |
948 } | |
949 goto LABEL_59; | |
950 } | |
951 v56 = v104 + 6.7553994e15; | |
952 v57 = *((float *)v45 + 8) + 6.7553994e15; | |
953 if ( LODWORD(v56) != LODWORD(v57) ) | |
954 goto LABEL_59; | |
955 v58 = *(float *)v44 + 6.7553994e15; | |
956 v59 = *((float *)v45 + 7) + 6.7553994e15; | |
957 v55 = LODWORD(v58) == LODWORD(v59); | |
958 LABEL_58: | |
959 if ( !v55 ) | |
960 { | |
961 LABEL_59: | |
962 v139 += 48; | |
963 v125 += 48; | |
964 v134 += 48; | |
965 v44 += 48; | |
966 ++v123; | |
967 ++v130; | |
968 v119 = v44; | |
969 } | |
970 } | |
971 if ( v46 ) | |
972 { | |
973 v60 = v130; | |
974 v119 += 48; | |
975 ++v123; | |
976 v134 += 48; | |
977 v125 += 48; | |
978 v139 += 48; | |
979 ++v130; | |
980 memcpy(v60, v45 + 4, 0x30u); | |
981 v44 = v119; | |
982 } | |
983 v43 = v108; | |
984 v45 += 48; | |
985 --v112; | |
986 if ( v112 ) | |
987 continue; | |
988 break; | |
989 } | |
990 if ( v123 < 3 | |
991 || (v116 = 0, | |
992 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])), | |
993 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15, | |
994 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportW, | |
995 v123 < 1) ) | |
996 goto LABEL_112; | |
997 v63 = (char *)&array_508690[0].vWorldViewProjX; | |
998 v131 = array_508690; | |
999 v120 = (char *)&array_508690[0].vWorldViewProjX; | |
1000 v140 = (char *)&array_508690[0].vWorldViewProjY; | |
1001 v126 = (char *)&array_508690[0].flt_2C; | |
168 | 1002 v135 = (char *)&array_508690[0]._rhw; |
0 | 1003 v64 = (char *)&array_508FF0[0].flt_2C; |
1004 v113 = v123; | |
1005 while ( 2 ) | |
1006 { | |
1007 v99 = *((float *)v64 + 8) + 6.7553994e15; | |
1008 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1009 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1010 if ( v62 != v65 ) | |
1011 { | |
1012 v66 = v102; | |
1013 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportW ) | |
1014 { | |
1015 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4)); | |
1016 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5); | |
1017 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3); | |
1018 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64; | |
1019 } | |
1020 else | |
1021 { | |
1022 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8)); | |
1023 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7); | |
1024 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9); | |
1025 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12); | |
1026 } | |
1027 *(float *)v126 = v68; | |
1028 *(float *)v140 = v102; | |
1029 if ( v62 ) | |
1030 { | |
1031 v70 = v102 + 6.7553994e15; | |
1032 v71 = *((float *)v64 - 4) + 6.7553994e15; | |
1033 if ( LODWORD(v70) == LODWORD(v71) ) | |
1034 { | |
1035 v72 = *(float *)v63 + 6.7553994e15; | |
1036 v73 = *((float *)v64 - 5) + 6.7553994e15; | |
1037 v74 = LODWORD(v72) == LODWORD(v73); | |
1038 goto LABEL_75; | |
1039 } | |
1040 goto LABEL_76; | |
1041 } | |
1042 v75 = v102 + 6.7553994e15; | |
1043 v76 = *((float *)v64 + 8) + 6.7553994e15; | |
1044 if ( LODWORD(v75) != LODWORD(v76) ) | |
1045 goto LABEL_76; | |
1046 v77 = *(float *)v63 + 6.7553994e15; | |
1047 v78 = *((float *)v64 + 7) + 6.7553994e15; | |
1048 v74 = LODWORD(v77) == LODWORD(v78); | |
1049 LABEL_75: | |
1050 if ( !v74 ) | |
1051 { | |
1052 LABEL_76: | |
1053 v140 += 48; | |
1054 v126 += 48; | |
1055 v135 += 48; | |
1056 v63 += 48; | |
1057 ++v116; | |
1058 ++v131; | |
1059 v120 = v63; | |
1060 } | |
1061 } | |
1062 if ( v65 ) | |
1063 { | |
1064 v79 = v131; | |
1065 v120 += 48; | |
1066 ++v116; | |
1067 v135 += 48; | |
1068 v126 += 48; | |
1069 v140 += 48; | |
1070 ++v131; | |
1071 memcpy(v79, v64 + 4, 0x30u); | |
1072 v63 = v120; | |
1073 } | |
1074 v62 = v109; | |
1075 v64 += 48; | |
1076 --v113; | |
1077 if ( v113 ) | |
1078 continue; | |
1079 break; | |
1080 } | |
1081 if ( v116 < 3 ) | |
1082 goto LABEL_112; | |
1083 v80 = v116; | |
1084 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116])); | |
1085 if ( v116 > 0 ) | |
1086 { | |
1087 v81 = (char *)&array_508690[0].vWorldViewProjX; | |
1088 v82 = v116; | |
1089 do | |
1090 { | |
1091 LODWORD(v83) = *(int *)v81; | |
1092 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2); | |
1093 v84 = v83 + 6.7553994e15; | |
1094 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportZ ) | |
1095 { | |
1096 v86 = *(float *)v81 + 6.7553994e15; | |
1097 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportX ) | |
1098 goto LABEL_88; | |
1099 v85 = v101; | |
1100 } | |
1101 else | |
1102 { | |
1103 v85 = v100; | |
1104 } | |
1105 *(int *)v81 = LODWORD(v85); | |
1106 LABEL_88: | |
1107 v87 = *((float *)v81 + 1) + 6.7553994e15; | |
1108 if ( SLODWORD(v87) > (signed int)pViewport->uViewportW ) | |
1109 { | |
1110 v88 = v102; | |
1111 LABEL_92: | |
1112 *((int *)v81 + 1) = LODWORD(v88); | |
1113 goto LABEL_93; | |
1114 } | |
1115 v89 = *((float *)v81 + 1) + 6.7553994e15; | |
1116 if ( SLODWORD(v89) < (signed int)pViewport->uViewportY ) | |
1117 { | |
1118 v88 = v104; | |
1119 goto LABEL_92; | |
1120 } | |
1121 LABEL_93: | |
1122 v81 += 48; | |
1123 --v82; | |
1124 } | |
1125 while ( v82 ); | |
1126 } | |
1127 v91 = __OFSUB__(v116, 3); | |
1128 v90 = v116 - 3 < 0; | |
1129 if ( v116 > 3 ) | |
1130 { | |
1131 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1])); | |
1132 if ( v116 > 0 ) | |
1133 { | |
1134 v105 = 1; | |
1135 do | |
1136 { | |
1137 v92 = v105; | |
1138 v93 = v105 - 1; | |
1139 v94 = v105 + 1; | |
1140 v95 = v105 + 1; | |
1141 if ( v105 - 1 >= v80 ) | |
1142 v93 -= v80; | |
1143 if ( v105 >= v80 ) | |
1144 v92 = v105 - v80; | |
1145 if ( v94 >= v80 ) | |
1146 v95 = v94 - v80; | |
1147 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1148 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY) | |
1149 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1150 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 ) | |
1151 { | |
1152 ++v105; | |
1153 } | |
1154 else | |
1155 { | |
1156 v96 = v105; | |
1157 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) ) | |
1158 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2)); | |
1159 --v80; | |
1160 } | |
1161 } | |
1162 while ( v105 - 1 < v80 ); | |
1163 } | |
1164 v91 = __OFSUB__(v80, 3); | |
1165 v90 = v80 - 3 < 0; | |
1166 } | |
1167 if ( v90 ^ v91 ) | |
1168 LABEL_112: | |
1169 result = 0; | |
1170 else | |
1171 result = v80; | |
1172 return result; | |
1173 } | |
1174 | |
1175 //----- (0042620A) -------------------------------------------------------- | |
1176 bool __thiscall sr_42620A(RenderVertexSoft *p) | |
1177 { | |
1178 __int16 v1; // fps@1 | |
1179 unsigned __int8 v2; // c0@2 | |
1180 char v3; // c2@2 | |
1181 unsigned __int8 v4; // c3@2 | |
1182 bool result; // eax@2 | |
1183 unsigned __int8 v6; // c0@4 | |
1184 char v7; // c2@4 | |
1185 unsigned __int8 v8; // c3@4 | |
1186 unsigned __int8 v9; // c0@6 | |
1187 char v10; // c2@6 | |
1188 unsigned __int8 v11; // c3@6 | |
1189 double v12; // st6@7 | |
1190 float v13; // ST04_4@7 | |
1191 float v14; // ST00_4@7 | |
1192 double v15; // st7@7 | |
1193 double v16; // st6@8 | |
1194 float v17; // ST04_4@8 | |
1195 float v18; // ST00_4@8 | |
1196 double v19; // st7@8 | |
1197 | |
1198 //UNDEF(v1); | |
1199 if ( p->vWorldViewPosition.x < 300.0 | |
1200 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
1201 v3 = 0, | |
1202 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
1203 BYTE1(result) = HIBYTE(v1), | |
1204 !(v2 | v4)) ) | |
1205 { | |
1206 if ( p->vWorldViewPosition.x < 300.0 ) | |
1207 { | |
1208 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
1209 v7 = 0; | |
1210 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
1211 BYTE1(result) = HIBYTE(v1); | |
1212 if ( !(v6 | v8) ) | |
1213 { | |
1214 LOBYTE(result) = 0; | |
1215 return result; | |
1216 } | |
1217 } | |
1218 v9 = 300.0 < p->vWorldViewPosition.x; | |
1219 v10 = 0; | |
1220 v11 = 300.0 == p->vWorldViewPosition.x; | |
1221 BYTE1(result) = HIBYTE(v1); | |
1222 if ( v9 | v11 ) | |
1223 { | |
1224 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
1225 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
1226 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
1227 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
1228 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
1229 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
1230 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
1231 } | |
1232 else | |
1233 { | |
1234 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
1235 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
1236 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
1237 v15 = 300.0 - p->vWorldViewPosition.x; | |
1238 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
1239 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
1240 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
1241 } | |
1242 } | |
1243 LOBYTE(result) = 1; | |
1244 return result; | |
1245 } | |
1246 | |
1247 | |
1248 | |
1249 | |
1250 //----- (004268E3) -------------------------------------------------------- | |
1251 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) | |
1252 { | |
1253 unsigned int v1; // eax@1 | |
1254 unsigned int v2; // edx@1 | |
1255 int v3; // eax@1 | |
1256 int v4; // edx@1 | |
1257 unsigned int v5; // ecx@1 | |
1258 | |
1259 v1 = uColor >> 9; | |
1260 v2 = uColor >> 6; | |
1261 LOWORD(v1) = (uColor >> 9) & 0x7C00; | |
1262 LOWORD(v2) = (uColor >> 6) & 0x3E0; | |
1263 v3 = v2 | v1; | |
1264 v4 = (unsigned __int8)uColor >> 3; | |
1265 v5 = uColor >> 16; | |
1266 LOWORD(v5) = v5 & 0x8000; | |
1267 return v5 | v4 | v3; | |
1268 } | |
1269 | |
1270 //----- (0042690D) -------------------------------------------------------- | |
1271 int __fastcall _42690D_colors_cvt(unsigned int a1) | |
1272 { | |
1273 unsigned int v1; // eax@1 | |
1274 unsigned int v2; // edx@1 | |
1275 | |
1276 v1 = a1 >> 8; | |
1277 v2 = a1 >> 5; | |
1278 LOWORD(v1) = (a1 >> 8) & 0xF800; | |
1279 LOWORD(v2) = (a1 >> 5) & 0x7E0; | |
1280 return ((unsigned __int8)a1 >> 3) | v2 | v1; | |
1281 } | |
1282 | |
1283 //----- (00426947) -------------------------------------------------------- | |
1284 void __cdecl sub_426947() | |
1285 { | |
1286 dword_50C968 = 0; | |
1287 dword_50C994 = 0; | |
1288 dword_50C998_turnbased_icon_1A = 0; | |
1289 } | |
1290 // 50C968: using guessed type int dword_50C968; | |
1291 // 50C994: using guessed type int dword_50C994; | |
1292 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A; | |
1293 | |
1294 | |
1295 | |
1296 //----- (004269A2) -------------------------------------------------------- | |
1297 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1) | |
1298 { | |
89 | 1299 //unsigned __int64 v1; // qax@1 |
1300 Player *v1; | |
1301 int v1b; | |
0 | 1302 signed int v2; // ecx@1 |
82 | 1303 int *v3; // esi@1 |
0 | 1304 bool v4; // edi@6 |
82 | 1305 int *v5; // edi@10 |
1306 Player *v6; // esi@10 | |
0 | 1307 int v7; // eax@13 |
1308 unsigned __int8 v8; // cf@13 | |
89 | 1309 int v10[4]; // [sp+Ch] [bp-14h]@1 |
0 | 1310 int v11; // [sp+1Ch] [bp-4h]@10 |
1311 | |
89 | 1312 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1); |
1313 v1 = pParty->pPlayers; | |
1314 v1b = a1; | |
0 | 1315 v2 = 0; |
89 | 1316 v3 = v10; |
0 | 1317 do |
1318 { | |
89 | 1319 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8)) |
0 | 1320 && !*(int *)HIDWORD(v1) |
1321 && !*(_QWORD *)(HIDWORD(v1) + 8) | |
89 | 1322 && !*(_QWORD *)(HIDWORD(v1) + 16);*/ |
1323 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13])) | |
1324 && !v1->pConditions[14] | |
1325 && !v1->pConditions[15] | |
1326 && !v1->pConditions[16]; | |
82 | 1327 *v3 = v4; |
89 | 1328 //HIDWORD(v1) += 6972; |
1329 ++v1; | |
0 | 1330 v2 += v4; |
82 | 1331 ++v3; |
0 | 1332 } |
89 | 1333 while ( v1 <= &pParty->pPlayers[3] ); |
0 | 1334 if ( v2 ) |
1335 { | |
89 | 1336 v1b = v1b / v2; |
1337 v5 = v10; | |
82 | 1338 v6 = pParty->pPlayers;//[0].uExperience; |
89 | 1339 v11 = v1b; |
0 | 1340 do |
1341 { | |
82 | 1342 if ( *v5 ) |
0 | 1343 { |
1344 if ( v11 ) | |
1345 { | |
82 | 1346 LOBYTE(v7) = v6->GetLearningPercent(); |
89 | 1347 v1b = v11 + v11 * v7 / 100; |
1348 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience)); | |
1349 //need review | |
1350 LODWORD(v6->uExperience) += v1b; | |
1351 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8; | |
82 | 1352 if ( v6->uExperience > 4000000000i64 ) |
0 | 1353 { |
82 | 1354 HIDWORD(v6->uExperience) = 0; |
1355 LODWORD(v6->uExperience) = -294967296; | |
0 | 1356 } |
1357 } | |
1358 } | |
82 | 1359 ++v6; |
1360 ++v5; | |
0 | 1361 } |
82 | 1362 while ( v6 <= &pParty->pPlayers[3] ); |
0 | 1363 } |
89 | 1364 return v1b; |
0 | 1365 } |
1366 | |
1367 //----- (00426A5A) -------------------------------------------------------- | |
1368 void stru319::LootActor(Actor *pActor) | |
1369 { | |
1370 signed int v2; // edi@1 | |
1371 char v3; // zf@1 | |
1372 unsigned int v4; // eax@13 | |
1373 unsigned int v5; // esi@13 | |
1374 int v6; // eax@14 | |
1375 unsigned __int8 v7; // al@30 | |
1376 Party *v8; // esi@34 | |
1377 char *v9; // [sp-4h] [bp-3Ch]@10 | |
1378 char *v10; // [sp-4h] [bp-3Ch]@31 | |
1379 char *v11; // [sp-4h] [bp-3Ch]@38 | |
1380 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 | |
1381 int v13; // [sp+30h] [bp-8h]@1 | |
1382 int v14; // [sp+34h] [bp-4h]@1 | |
1383 | |
1384 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1385 Dst.Reset(); | |
1386 v2 = 0; | |
1387 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; | |
1388 v13 = 0; | |
1389 v14 = 0; | |
1390 if ( v3 ) | |
1391 { | |
1392 if ( !pActor->pMonsterInfo.uTreasureDiceRolls ) | |
1393 goto LABEL_9; | |
1394 do | |
1395 { | |
1396 ++v2; | |
1397 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | |
1398 } | |
1399 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); | |
1400 } | |
1401 else | |
1402 { | |
1403 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 ) | |
1404 goto LABEL_9; | |
377 | 1405 v14 = pActor->array_000234[3].uSpecEnchantmentType; |
0 | 1406 pActor->array_000234[3].Reset(); |
1407 } | |
1408 if ( v14 ) | |
1409 { | |
1410 party_finds_gold(v14, 0); | |
1411 viewparams->bRedrawGameUI = 1; | |
1412 } | |
1413 LABEL_9: | |
1414 if ( pActor->uCarriedItemID ) | |
1415 { | |
1416 Dst.Reset(); | |
1417 Dst.uItemID = pActor->uCarriedItemID; | |
1418 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1419 if ( v14 ) | |
189 | 1420 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9); |
0 | 1421 else |
189 | 1422 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9); |
0 | 1423 ShowStatusBarString(pTmpBuf2, 2u); |
1424 v4 = Dst.uItemID; | |
1425 v5 = Dst.uItemID; | |
1426 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) | |
1427 { | |
1428 v5 = Dst.uItemID; | |
1429 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1; | |
1430 Dst.uNumCharges = v6; | |
1431 Dst.uMaxCharges = v6; | |
1432 v4 = Dst.uItemID; | |
1433 } | |
1434 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) | |
377 | 1435 Dst.uEncantmentType = 2 * rand() % 4 + 2; |
0 | 1436 pItemsTable->SetSpecialBonus(&Dst); |
1437 if ( !pParty->AddItem(&Dst) ) | |
1438 pParty->SetHoldingItem(&Dst); | |
1439 pActor->uCarriedItemID = 0; | |
1440 if ( pActor->array_000234[0].uItemID ) | |
1441 { | |
1442 if ( !pParty->AddItem(pActor->array_000234) ) | |
1443 { | |
1444 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1445 pParty->SetHoldingItem(pActor->array_000234); | |
1446 } | |
1447 pActor->array_000234[0].Reset(); | |
1448 } | |
1449 if ( pActor->array_000234[1].uItemID ) | |
1450 { | |
1451 if ( !pParty->AddItem(&pActor->array_000234[1]) ) | |
1452 { | |
1453 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1454 pParty->SetHoldingItem(&pActor->array_000234[1]); | |
1455 } | |
1456 pActor->array_000234[1].Reset(); | |
1457 } | |
1458 LABEL_55: | |
1459 pActor->Remove(); | |
1460 return; | |
1461 } | |
1462 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) | |
1463 { | |
1464 if ( pActor->array_000234[3].uItemID ) | |
1465 { | |
1466 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); | |
1467 pActor->array_000234[3].Reset(); | |
1468 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1469 if ( v14 ) | |
1470 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); | |
1471 else | |
1472 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); | |
1473 ShowStatusBarString(pTmpBuf2, 2u); | |
1474 if ( !pParty->AddItem(&Dst) ) | |
1475 pParty->SetHoldingItem(&Dst); | |
1476 v13 = 1; | |
1477 } | |
1478 goto LABEL_44; | |
1479 } | |
1480 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | |
1481 { | |
1482 LABEL_44: | |
1483 v8 = pParty; | |
1484 goto LABEL_45; | |
1485 } | |
1486 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | |
1487 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1488 if ( v14 ) | |
1489 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); | |
1490 else | |
1491 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); | |
1492 ShowStatusBarString(pTmpBuf2, 2u); | |
1493 v8 = pParty; | |
1494 if ( !pParty->AddItem(&Dst) ) | |
1495 pParty->SetHoldingItem(&Dst); | |
1496 v13 = 1; | |
1497 LABEL_45: | |
1498 if ( pActor->array_000234[0].uItemID ) | |
1499 { | |
1500 if ( !v8->AddItem(pActor->array_000234) ) | |
1501 { | |
1502 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1503 v8->SetHoldingItem(pActor->array_000234); | |
1504 v13 = 1; | |
1505 } | |
1506 pActor->array_000234[0].Reset(); | |
1507 } | |
1508 if ( pActor->array_000234[1].uItemID ) | |
1509 { | |
1510 if ( !v8->AddItem(&pActor->array_000234[1]) ) | |
1511 { | |
1512 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1513 v8->SetHoldingItem(&pActor->array_000234[1]); | |
1514 v13 = 1; | |
1515 } | |
1516 pActor->array_000234[1].Reset(); | |
1517 } | |
1518 if ( !v13 || rand() % 100 < 90 ) | |
1519 goto LABEL_55; | |
1520 } | |
1521 | |
1522 //----- (00426E10) -------------------------------------------------------- | |
1523 int stru319::which_player_would_attack(Actor *pActor) | |
1524 { | |
1525 signed int v2; // ebx@1 | |
1526 int v3; // ecx@2 | |
1527 signed int v4; // edx@3 | |
1528 char v5; // zf@3 | |
1529 unsigned int v6; // eax@3 | |
1530 int v7; // eax@6 | |
1531 int v8; // eax@7 | |
1532 int v9; // eax@8 | |
1533 int v10; // eax@9 | |
1534 int v11; // eax@10 | |
1535 int v12; // eax@11 | |
1536 int v13; // esi@35 | |
1537 signed int v14; // edi@37 | |
1538 enum CHARACTER_RACE v15; // eax@44 | |
1539 Player *v16; // ecx@47 | |
1540 unsigned __int8 v17; // sf@50 | |
1541 unsigned __int8 v18; // of@50 | |
1542 int v19; // esi@52 | |
1543 Player *v20; // ecx@53 | |
1544 int result; // eax@57 | |
1545 int v22[16]; // [sp+8h] [bp-140h]@3 | |
1546 int v23[60]; // [sp+48h] [bp-100h]@48 | |
1547 int v24; // [sp+138h] [bp-10h]@2 | |
1548 int v25; // [sp+13Ch] [bp-Ch]@1 | |
1549 int v26; // [sp+140h] [bp-8h]@1 | |
1550 int v27; // [sp+144h] [bp-4h]@1 | |
1551 | |
1552 v27 = -1; | |
1553 v26 = -1; | |
1554 v25 = -1; | |
1555 v2 = 0; | |
1556 if ( pActor->pMonsterInfo.uAttackPreference ) | |
1557 { | |
1558 v3 = 0; | |
1559 v24 = 0; | |
1560 do | |
1561 { | |
1562 v4 = 1; | |
1563 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); | |
1564 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; | |
1565 v22[v3] = v6; | |
1566 if ( !v5 ) | |
1567 { | |
1568 if ( (signed int)v6 > 128 ) | |
1569 { | |
1570 switch ( v6 ) | |
1571 { | |
1572 case 0x100u: | |
1573 v27 = 8; | |
1574 break; | |
1575 case 0x200u: | |
1576 v25 = 0; | |
1577 break; | |
1578 case 0x400u: | |
1579 v25 = 1; | |
1580 break; | |
1581 case 0x800u: | |
1582 v26 = 0; | |
1583 break; | |
1584 case 0x1000u: | |
1585 v26 = 1; | |
1586 break; | |
1587 case 0x2000u: | |
1588 v26 = 3; | |
1589 break; | |
1590 case 0x4000u: | |
1591 v26 = 2; | |
1592 break; | |
1593 } | |
1594 } | |
1595 else | |
1596 { | |
1597 if ( v6 == 128 ) | |
1598 { | |
1599 v27 = 4; | |
1600 } | |
1601 else | |
1602 { | |
1603 v7 = v6 - 1; | |
1604 if ( v7 ) | |
1605 { | |
1606 v8 = v7 - 1; | |
1607 if ( v8 ) | |
1608 { | |
1609 v9 = v8 - 2; | |
1610 if ( v9 ) | |
1611 { | |
1612 v10 = v9 - 4; | |
1613 if ( v10 ) | |
1614 { | |
1615 v11 = v10 - 8; | |
1616 if ( v11 ) | |
1617 { | |
1618 v12 = v11 - 16; | |
1619 if ( v12 ) | |
1620 { | |
1621 if ( v12 == 32 ) | |
1622 v27 = 20; | |
1623 } | |
1624 else | |
1625 { | |
1626 v27 = 32; | |
1627 } | |
1628 } | |
1629 else | |
1630 { | |
1631 v27 = 24; | |
1632 } | |
1633 } | |
1634 else | |
1635 { | |
1636 v27 = 28; | |
1637 } | |
1638 } | |
1639 else | |
1640 { | |
1641 v27 = 16; | |
1642 } | |
1643 } | |
1644 else | |
1645 { | |
1646 v27 = 12; | |
1647 } | |
1648 } | |
1649 else | |
1650 { | |
1651 v27 = 0; | |
1652 } | |
1653 } | |
1654 } | |
1655 v2 = 0; | |
1656 v13 = 0; | |
1657 while ( 1 ) | |
1658 { | |
1659 v14 = 0; | |
135 | 1660 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType ) |
0 | 1661 v14 = v4; |
1662 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) | |
1663 v14 = v4; | |
1664 if ( v26 != -1 ) | |
1665 { | |
1666 v15 = pPlayers[v13 + 1]->GetRace(); | |
1667 if ( v26 == v15 ) | |
1668 v14 = 1; | |
1669 } | |
1670 if ( v14 == 1 ) | |
1671 { | |
1672 v16 = pPlayers[v13 + 1]; | |
1673 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) | |
1674 v23[v2++] = v13; | |
1675 } | |
1676 ++v13; | |
1677 if ( v13 >= 4 ) | |
1678 break; | |
1679 v4 = 1; | |
1680 } | |
1681 } | |
1682 v3 = v24 + 1; | |
1683 v18 = __OFSUB__(v24 + 1, 15); | |
1684 v17 = v24++ - 14 < 0; | |
1685 } | |
1686 while ( v17 ^ v18 ); | |
1687 if ( v2 ) | |
1688 goto LABEL_61; | |
1689 } | |
1690 v19 = 0; | |
1691 do | |
1692 { | |
1693 v20 = pPlayers[v19 + 1]; | |
1694 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) | |
1695 v23[v2++] = v19; | |
1696 ++v19; | |
1697 } | |
1698 while ( v19 < 4 ); | |
1699 if ( v2 ) | |
1700 LABEL_61: | |
1701 result = v23[rand() % v2]; | |
1702 else | |
1703 result = 0; | |
1704 return result; | |
1705 } | |
1706 | |
1707 | |
1708 //----- (0042704B) -------------------------------------------------------- | |
1709 bool stru319::special_ability_use_check(Actor *pActor, int a2) | |
1710 { | |
1711 stru319 *v3; // edi@1 | |
1712 signed int v4; // ebx@5 | |
1713 signed int v5; // edi@5 | |
1714 | |
1715 v3 = this; | |
1716 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
1717 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
1718 && rand() % 100 < 5 ) | |
1719 pActor->_44FD29(a2); | |
1720 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); | |
1721 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); | |
1722 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
1723 return 2; | |
1724 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
1725 return 3; | |
1726 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance; | |
1727 } | |
1728 | |
1729 //----- (00427102) -------------------------------------------------------- | |
1730 int stru319::_427102(Actor *pActor, signed int a2) | |
1731 { | |
1732 unsigned __int8 v3; // cf@11 | |
1733 unsigned __int8 v4; // zf@11 | |
1734 SpellBuff *v6; // ecx@46 | |
89 | 1735 Player *v7; // esi@49 |
0 | 1736 signed int v8; // edx@50 |
89 | 1737 SpellBuff *v9; // ecx@50 |
0 | 1738 |
1739 if ( a2 > 73 ) | |
1740 { | |
1741 if ( a2 == 77 ) | |
1742 { | |
1743 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP ) | |
1744 return 0; | |
1745 return 1; | |
1746 } | |
1747 if ( a2 == 80 ) | |
1748 { | |
1749 v6 = pParty->pPartyBuffs; | |
1750 while ( (signed __int64)v6->uExpireTime <= 0 ) | |
1751 { | |
1752 ++v6; | |
89 | 1753 if ( v6 > &pParty->pPartyBuffs[19] ) |
1754 { | |
1755 v7 = pParty->pPlayers;//[0].pPlayerBuffs; | |
0 | 1756 v8 = 0; |
89 | 1757 v9 = v7->pPlayerBuffs; |
1758 while ( v9->uExpireTime <= 0i64 ) | |
0 | 1759 { |
1760 ++v8; | |
89 | 1761 ++v9; |
0 | 1762 if ( v8 >= 24 ) |
1763 { | |
89 | 1764 ++v7; |
1765 if ( v7 <= &pParty->pPlayers[3] ) | |
1766 { | |
1767 v8 = 0; | |
1768 v9 = v7->pPlayerBuffs; | |
1769 } | |
1770 else | |
1771 return 0; | |
0 | 1772 } |
1773 } | |
1774 return 1; | |
1775 } | |
1776 } | |
1777 return 1; | |
1778 } | |
1779 if ( a2 == 85 ) | |
1780 { | |
1781 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 ) | |
1782 return 1; | |
1783 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 ) | |
1784 return 0; | |
1785 v3 = 0; | |
1786 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0; | |
1787 } | |
1788 else | |
1789 { | |
1790 if ( a2 == 86 ) | |
1791 { | |
1792 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 ) | |
1793 return 1; | |
1794 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 ) | |
1795 return 0; | |
1796 v3 = 0; | |
1797 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0; | |
1798 } | |
1799 else | |
1800 { | |
1801 if ( a2 != 95 || SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 ) | |
1802 return 1; | |
1803 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 ) | |
1804 return 0; | |
1805 v3 = 0; | |
1806 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0; | |
1807 } | |
1808 } | |
1809 } | |
1810 else | |
1811 { | |
1812 if ( a2 == 73 ) | |
1813 { | |
1814 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 ) | |
1815 return 1; | |
1816 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 ) | |
1817 return 0; | |
1818 v3 = 0; | |
1819 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0; | |
1820 } | |
89 | 1821 else if ( a2 == 5 ) |
0 | 1822 { |
1823 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 ) | |
1824 return 1; | |
1825 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 ) | |
1826 return 0; | |
1827 v3 = 0; | |
1828 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0; | |
1829 } | |
89 | 1830 else if ( a2 == 17 ) |
0 | 1831 { |
1832 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 ) | |
1833 return 1; | |
1834 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 ) | |
1835 return 0; | |
1836 v3 = 0; | |
1837 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0; | |
1838 } | |
89 | 1839 else if ( a2 == 38 ) |
0 | 1840 { |
1841 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 ) | |
1842 return 1; | |
1843 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 ) | |
1844 return 0; | |
1845 v3 = 0; | |
1846 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0; | |
1847 } | |
89 | 1848 else if ( a2 == 46 ) |
0 | 1849 { |
1850 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 ) | |
1851 return 1; | |
1852 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 ) | |
1853 return 0; | |
1854 v3 = 0; | |
1855 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0; | |
1856 } | |
89 | 1857 else |
1858 { | |
1859 if ( a2 != 47 ) | |
1860 { | |
1861 if ( a2 != 51 || SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 ) | |
1862 return 1; | |
1863 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 ) | |
1864 { | |
1865 v3 = 0; | |
1866 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0; | |
1867 } | |
1868 else | |
1869 return 0; | |
1870 } | |
1871 else | |
1872 { | |
1873 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 ) | |
1874 return 1; | |
1875 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 ) | |
1876 return 0; | |
1877 v3 = 0; | |
1878 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0; | |
1879 } | |
1880 } | |
0 | 1881 } |
1882 if ( !(v3 | v4) ) | |
1883 return 0; | |
1884 return 1; | |
1885 } | |
1886 | |
1887 //----- (004272F5) -------------------------------------------------------- | |
1888 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
1889 { | |
1890 signed int v5; // esi@1 | |
1891 signed int v6; // edi@1 | |
1892 int v7; // esi@8 | |
1893 int v8; // eax@9 | |
1894 int v9; // edx@11 | |
1895 int v10; // edx@13 | |
1896 int v11; // esi@13 | |
1897 unsigned __int8 v12; // sf@13 | |
1898 unsigned __int8 v13; // of@13 | |
1899 int v14; // edx@14 | |
1900 int v15; // eax@14 | |
1901 signed int result; // eax@17 | |
1902 | |
1903 v5 = pActor->pMonsterInfo.uAC; | |
1904 v6 = 0; | |
1905 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 ) | |
1906 v5 /= 2; | |
1907 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1908 v6 = pActor->pActorBuffs[15].uPower; | |
1909 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 ) | |
1910 v6 = pActor->pActorBuffs[16].uPower; | |
1911 v7 = v6 + v5; | |
1912 if ( a3 ) | |
1913 v8 = pPlayer->GetRangedAttack(); | |
1914 else | |
1915 v8 = pPlayer->GetActualAttack(0); | |
1916 v9 = rand() % (v7 + 2 * v8 + 30); | |
1917 if ( a3 == 2 ) | |
1918 { | |
1919 v14 = a4 + v9; | |
1920 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1921 } | |
1922 else | |
1923 { | |
1924 if ( a3 != 3 ) | |
1925 { | |
1926 v10 = a4 + v9; | |
1927 v11 = v7 + 15; | |
1928 v13 = __OFSUB__(v10, v11); | |
1929 v12 = v10 - v11 < 0; | |
1930 goto LABEL_16; | |
1931 } | |
1932 v14 = a4 + v9; | |
1933 v15 = 2 * v7 + 30; | |
1934 } | |
1935 v13 = __OFSUB__(v14, v15); | |
1936 v12 = v14 - v15 < 0; | |
1937 LABEL_16: | |
1938 if ( v12 ^ v13 ) | |
1939 result = 0; | |
1940 else | |
1941 result = 1; | |
1942 return result; | |
1943 } | |
1944 | |
1945 //----- (004273BB) -------------------------------------------------------- | |
1946 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
1947 { | |
1948 Actor *v5; // ecx@1 | |
1949 signed int v6; // ebx@1 | |
1950 signed int v7; // esi@1 | |
1951 unsigned __int8 v8; // zf@1 | |
1952 unsigned __int8 v9; // sf@1 | |
1953 int v10; // ebx@10 | |
1954 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
1955 | |
1956 v5 = a2; | |
1957 v6 = a2->pMonsterInfo.uAC; | |
1958 v7 = 0; | |
1959 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0; | |
1960 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0; | |
1961 a2a = 0; | |
1962 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) ) | |
1963 v6 /= 2; | |
1964 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 ) | |
1965 v7 = v5->pActorBuffs[14].uPower; | |
1966 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 ) | |
1967 v7 = v5->pActorBuffs[16].uPower; | |
1968 v10 = v7 + v6; | |
1969 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1970 a2a = pActor->pActorBuffs[14].uPower; | |
1971 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a ) | |
1972 a2a = pActor->pActorBuffs[17].uPower; | |
1973 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1974 { | |
1975 a2a += pActor->pActorBuffs[11].uPower; | |
1976 pActor->pActorBuffs[11].Reset(); | |
1977 } | |
1978 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
1979 } | |
1980 | |
1981 //----- (004274AD) -------------------------------------------------------- | |
1982 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
1983 { | |
1984 signed int v3; // edi@1 | |
1985 signed int v4; // esi@8 | |
1986 int v5; // esi@8 | |
1987 | |
1988 v3 = 0; | |
1989 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1990 v3 = pActor->pActorBuffs[14].uPower; | |
1991 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 ) | |
1992 v3 = pActor->pActorBuffs[17].uPower; | |
1993 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1994 { | |
1995 v3 += pActor->pActorBuffs[11].uPower; | |
1996 pActor->pActorBuffs[11].Reset(); | |
1997 } | |
1998 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
1999 v5 = rand() % v4 + 1; | |
2000 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
2001 } | |
2002 | |
2003 //----- (00427546) -------------------------------------------------------- | |
2004 int stru319::_427546(int a2) | |
2005 { | |
2006 int result; // eax@2 | |
2007 | |
2008 if ( a2 >= 0 ) | |
2009 { | |
2010 if ( a2 >= 1 ) | |
2011 result = (a2 >= 2) + 2; | |
2012 else | |
2013 result = 1; | |
2014 } | |
2015 else | |
2016 { | |
2017 result = 0; | |
2018 } | |
2019 return result; | |
2020 } | |
2021 | |
2022 //----- (0042756B) -------------------------------------------------------- | |
2023 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
2024 { | |
2025 int v4; // edx@1 | |
2026 int v5; // ecx@1 | |
2027 signed int v6; // eax@4 | |
2028 signed int result; // eax@17 | |
2029 signed int v8; // esi@18 | |
2030 | |
2031 v4 = 0; | |
2032 v5 = 0; | |
2033 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
2034 v5 = pActor->pActorBuffs[14].uPower; | |
2035 switch ( a2 ) | |
2036 { | |
2037 case 4: | |
2038 v6 = pActor->pMonsterInfo.uResPhysical; | |
2039 break; | |
2040 case 0: | |
2041 v6 = pActor->pMonsterInfo.uResFire; | |
2042 goto LABEL_12; | |
2043 case 1: | |
2044 v6 = pActor->pMonsterInfo.uResAir; | |
2045 goto LABEL_12; | |
2046 case 2: | |
2047 v6 = pActor->pMonsterInfo.uResWater; | |
2048 goto LABEL_12; | |
2049 case 3: | |
2050 v6 = pActor->pMonsterInfo.uResEarth; | |
2051 goto LABEL_12; | |
2052 case 6: | |
2053 v6 = pActor->pMonsterInfo.uResSpirit; | |
2054 break; | |
2055 case 7: | |
2056 v6 = pActor->pMonsterInfo.uResMind; | |
2057 goto LABEL_12; | |
2058 case 8: | |
2059 v6 = pActor->pMonsterInfo.uResBody; | |
2060 LABEL_12: | |
2061 v4 = v5; | |
2062 break; | |
2063 case 9: | |
2064 v6 = pActor->pMonsterInfo.uResLight; | |
2065 break; | |
2066 case 10: | |
2067 v6 = pActor->pMonsterInfo.uResDark; | |
2068 break; | |
2069 default: | |
2070 v6 = 0; | |
2071 break; | |
2072 } | |
2073 if ( v6 < 200 ) | |
2074 { | |
2075 v8 = v4 + v6 + 30; | |
2076 if ( rand() % v8 >= 30 ) | |
2077 { | |
2078 a3 >>= 1; | |
2079 if ( rand() % v8 >= 30 ) | |
2080 { | |
2081 a3 >>= 1; | |
2082 if ( rand() % v8 >= 30 ) | |
2083 { | |
2084 a3 >>= 1; | |
2085 if ( rand() % v8 >= 30 ) | |
2086 a3 >>= 1; | |
2087 } | |
2088 } | |
2089 } | |
2090 result = a3; | |
2091 } | |
2092 else | |
2093 { | |
2094 result = 0; | |
2095 } | |
2096 return result; | |
2097 } | |
2098 | |
2099 //----- (00427662) -------------------------------------------------------- | |
2100 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
2101 { | |
2102 Actor *v3; // edi@2 | |
2103 signed int v4; // esi@2 | |
2104 bool result; // eax@13 | |
2105 | |
2106 switch ( uType ) | |
2107 { | |
2108 case 0u: | |
2109 v3 = pActor; | |
2110 v4 = pActor->pMonsterInfo.uResFire; | |
2111 goto LABEL_12; | |
2112 case 1u: | |
2113 v3 = pActor; | |
2114 v4 = pActor->pMonsterInfo.uResAir; | |
2115 goto LABEL_12; | |
2116 case 2u: | |
2117 v3 = pActor; | |
2118 v4 = pActor->pMonsterInfo.uResWater; | |
2119 goto LABEL_12; | |
2120 case 3u: | |
2121 v3 = pActor; | |
2122 v4 = pActor->pMonsterInfo.uResEarth; | |
2123 goto LABEL_12; | |
2124 case 7u: | |
2125 v3 = pActor; | |
2126 v4 = pActor->pMonsterInfo.uResMind; | |
2127 goto LABEL_12; | |
2128 case 6u: | |
2129 v3 = pActor; | |
2130 v4 = pActor->pMonsterInfo.uResSpirit; | |
2131 goto LABEL_12; | |
2132 case 8u: | |
2133 v3 = pActor; | |
2134 v4 = pActor->pMonsterInfo.uResBody; | |
2135 goto LABEL_12; | |
2136 case 9u: | |
2137 v3 = pActor; | |
2138 v4 = pActor->pMonsterInfo.uResLight; | |
2139 goto LABEL_12; | |
2140 case 0xAu: | |
2141 v3 = pActor; | |
2142 v4 = pActor->pMonsterInfo.uResDark; | |
2143 goto LABEL_12; | |
2144 case 4u: | |
2145 v3 = pActor; | |
2146 v4 = pActor->pMonsterInfo.uResPhysical; | |
2147 LABEL_12: | |
2148 if ( v4 < 200 ) | |
2149 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | |
2150 else | |
2151 result = 0; | |
2152 break; | |
2153 default: | |
2154 result = 1; | |
2155 break; | |
2156 } | |
2157 return result; | |
2158 } | |
2159 | |
2160 | |
2161 //----- (00427769) -------------------------------------------------------- | |
2162 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
2163 { | |
2164 bool result; // eax@2 | |
2165 | |
2166 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) | |
2167 result = 1; | |
2168 else | |
2169 result = 0; | |
2170 return result; | |
2171 } | |
2172 | |
2173 //----- (0042777D) -------------------------------------------------------- | |
319 | 2174 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) |
0 | 2175 { |
370 | 2176 //bool result; // eax@2 |
0 | 2177 __int16 v6; // bx@4 |
2178 Player *v7; // eax@4 | |
2179 char v8; // zf@12 | |
2180 unsigned __int16 v9; // cx@16 | |
2181 unsigned int v10; // eax@18 | |
2182 unsigned __int8 v11; // sf@18 | |
2183 unsigned __int8 v12; // of@18 | |
2184 unsigned __int16 v13; // cx@21 | |
2185 unsigned int v14; // eax@23 | |
2186 stru277 *v15; // esi@27 | |
2187 stru277 *v16; // eax@28 | |
2188 GUIWindow *v17; // eax@43 | |
2189 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | |
2190 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | |
2191 unsigned int v20; // [sp-28h] [bp-40h]@44 | |
2192 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | |
2193 unsigned int v22; // [sp-20h] [bp-38h]@44 | |
2194 int v23; // [sp-1Ch] [bp-34h]@44 | |
2195 int v24; // [sp-18h] [bp-30h]@44 | |
2196 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | |
2197 unsigned int v26; // [sp-10h] [bp-28h]@43 | |
2198 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | |
2199 char *v28; // [sp-8h] [bp-20h]@43 | |
2200 Texture *v29; // [sp-4h] [bp-1Ch]@43 | |
2201 __int16 a3a; // [sp+10h] [bp-8h]@1 | |
2202 __int16 a2a; // [sp+14h] [bp-4h]@1 | |
2203 | |
2204 a3a = uPlayerID; | |
2205 a2a = a1; | |
370 | 2206 |
2207 //if ( pParty->bTurnBasedModeOn != 1 | |
2208 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | |
2209 if (pParty->bTurnBasedModeOn) | |
0 | 2210 { |
370 | 2211 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) |
2212 return; | |
2213 } | |
2214 | |
2215 | |
0 | 2216 v6 = a5; |
2217 v7 = &pParty->pPlayers[uPlayerID]; | |
2218 if ( !(a5 & 0x10) ) | |
2219 { | |
2220 switch ( a1 ) | |
2221 { | |
2222 case 47: | |
2223 case 68: | |
2224 case 89: | |
2225 HIBYTE(v6) = HIBYTE(a5) | 1; | |
2226 break; | |
2227 case 4: | |
2228 case 28: | |
2229 case 30: | |
2230 case 91: | |
2231 LOBYTE(v6) = a5 | 0x80; | |
2232 break; | |
2233 case 2: | |
2234 case 6: | |
2235 case 11: | |
2236 case 18: | |
2237 case 20: | |
2238 case 24: | |
2239 case 26: | |
2240 case 29: | |
2241 case 32: | |
2242 case 34: | |
2243 case 35: | |
2244 case 37: | |
2245 case 39: | |
2246 case 44: | |
2247 case 52: | |
2248 case 57: | |
2249 case 60: | |
2250 case 65: | |
2251 case 70: | |
2252 case 76: | |
2253 case 78: | |
2254 case 79: | |
2255 case 87: | |
2256 case 90: | |
2257 case 92: | |
2258 case 93: | |
2259 case 97: | |
2260 if ( !a6 ) | |
2261 goto LABEL_9; | |
2262 break; | |
2263 case 59: | |
2264 case 62: | |
2265 case 66: | |
2266 case 81: | |
2267 case 94: | |
2268 LABEL_9: | |
2269 v6 = a5 | 8; | |
2270 break; | |
2271 case 42: | |
2272 v6 = a5 | 0x40; | |
2273 break; | |
2274 case 46: | |
2275 if ( a4 ) | |
2276 v8 = (a4 & 0x1C0) == 0; | |
2277 else | |
2278 v8 = (v7->pActiveSkills[16] & 0x1C0) == 0; | |
2279 if ( v8 ) | |
2280 goto LABEL_25; | |
2281 break; | |
2282 case 50: | |
2283 v9 = a4; | |
2284 if ( !a4 ) | |
2285 v9 = v7->pActiveSkills[16]; | |
2286 goto LABEL_18; | |
2287 case 95: | |
2288 v9 = a4; | |
2289 if ( !a4 ) | |
2290 v9 = v7->pActiveSkills[20]; | |
2291 LABEL_18: | |
2292 v10 = SkillToMastery(v9); | |
2293 v12 = __OFSUB__(v10, 3); | |
2294 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2295 goto LABEL_24; | |
2296 case 73: | |
2297 v13 = a4; | |
2298 if ( !a4 ) | |
2299 v13 = v7->pActiveSkills[18]; | |
2300 v14 = SkillToMastery(v13); | |
2301 v12 = __OFSUB__(v14, 4); | |
2302 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2303 LABEL_24: | |
2304 if ( v11 ^ v12 ) | |
2305 goto LABEL_25; | |
2306 break; | |
2307 case 40: | |
2308 case 49: | |
2309 case 53: | |
2310 case 55: | |
2311 case 56: | |
2312 case 61: | |
2313 case 64: | |
2314 case 67: | |
2315 case 71: | |
2316 case 72: | |
2317 case 74: | |
2318 LABEL_25: | |
2319 v6 = a5 | 2; | |
2320 break; | |
2321 case 96: | |
2322 HIBYTE(v6) = HIBYTE(a5) | 2; | |
2323 break; | |
2324 default: | |
2325 break; | |
2326 } | |
2327 } | |
370 | 2328 |
0 | 2329 v15 = pStru277; |
2330 if ( v6 & 0x3CA ) | |
2331 { | |
2332 v16 = pStru277; | |
2333 while ( !(v16->field_8 & 0x3CA) ) | |
2334 { | |
2335 ++v16; | |
2336 if ( (signed int)v16 >= (signed int)&unk_50C190 ) | |
2337 goto LABEL_33; | |
2338 } | |
2339 v16->spellnum = 0; | |
2340 } | |
2341 do | |
2342 { | |
2343 LABEL_33: | |
2344 if ( v15->spellnum ) | |
2345 { | |
2346 v8 = (v15->field_8 & 0x3CA) == 0; | |
2347 v15->spellnum = 0; | |
2348 if ( !v8 ) | |
2349 { | |
2350 pGUIWindow_Settings->Release(); | |
2351 pGUIWindow_Settings = 0; | |
2352 pMouse->SetCursorBitmap("MICON1"); | |
2353 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2354 unk_50C9A0 = 0; | |
2355 back_to_game(); | |
2356 } | |
2357 } | |
2358 ++v15; | |
2359 } | |
2360 while ( (signed int)v15 < (signed int)&unk_50C190 ); | |
370 | 2361 int result = pStru277->PushStru277(a2a, a3a, a4, v6, a6); |
0 | 2362 if ( result != -1 ) |
2363 { | |
2364 if ( v6 & 2 ) | |
2365 { | |
2366 if ( pGUIWindow_Settings ) | |
319 | 2367 return; |
0 | 2368 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2369 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2370 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2371 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2372 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
319 | 2373 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2374 return; | |
0 | 2375 } |
2376 if ( v6 & 8 ) | |
2377 { | |
2378 if ( pGUIWindow_Settings ) | |
319 | 2379 return; |
0 | 2380 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2381 v29 = 0; | |
2382 v28 = ""; | |
2383 v27 = 0; | |
2384 v26 = 0; | |
2385 v25 = 70; | |
2386 LABEL_44: | |
2387 v24 = 0; | |
2388 v23 = 1; | |
2389 v22 = 344; | |
2390 v21 = 460; | |
2391 v20 = 8; | |
2392 v19 = 8; | |
2393 pGUIWindow_Settings = v17; | |
2394 v18 = v17; | |
2395 LABEL_56: | |
2396 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
319 | 2397 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2398 return; | |
0 | 2399 } |
2400 if ( v6 & 0x40 ) | |
2401 { | |
2402 if ( pGUIWindow_Settings ) | |
319 | 2403 return; |
0 | 2404 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2405 v29 = 0; | |
2406 v28 = ""; | |
2407 v27 = 0; | |
2408 v26 = 0; | |
2409 v25 = 190; | |
2410 goto LABEL_44; | |
2411 } | |
2412 if ( (char)v6 < 0 ) | |
2413 { | |
2414 if ( pGUIWindow_Settings ) | |
319 | 2415 return; |
0 | 2416 ++pIcons_LOD->uTexturePacksCount; |
2417 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2418 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2419 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2420 unk_50C9A0 = 1; | |
2421 some_active_character = uActiveCharacter; | |
319 | 2422 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2423 return; | |
0 | 2424 } |
2425 if ( HIBYTE(v6) & 1 ) | |
2426 { | |
2427 if ( pGUIWindow_Settings ) | |
319 | 2428 return; |
2429 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
0 | 2430 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); |
2431 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2432 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2433 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
2434 v29 = 0; | |
2435 v28 = ""; | |
2436 v27 = 0; | |
2437 v26 = 0; | |
2438 v25 = 140; | |
2439 v24 = 0; | |
2440 v23 = 1; | |
2441 v22 = 344; | |
2442 v21 = 460; | |
2443 v20 = 8; | |
2444 v19 = 8; | |
2445 v18 = pGUIWindow_Settings; | |
2446 goto LABEL_56; | |
2447 } | |
2448 if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings ) | |
2449 { | |
319 | 2450 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
0 | 2451 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( |
2452 0x1D5u, | |
2453 0xB2u, | |
319 | 2454 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), |
2455 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
0 | 2456 1, |
2457 0, | |
2458 0xBCu, | |
2459 0, | |
2460 0, | |
2461 "", | |
319 | 2462 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), |
0 | 2463 0); |
2464 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2465 0x272u, | |
2466 0xB2u, | |
319 | 2467 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), |
2468 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
0 | 2469 1, |
2470 0, | |
2471 0xBCu, | |
2472 1u, | |
2473 0, | |
2474 "", | |
319 | 2475 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), |
0 | 2476 0); |
2477 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
319 | 2478 pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0); |
0 | 2479 } |
2480 } | |
2481 } | |
2482 | |
2483 | |
2484 | |
2485 //----- (00427D48) -------------------------------------------------------- | |
2486 void stru277::_427D48(unsigned int uPlayerID) | |
2487 { | |
2488 stru277 *v2; // esi@1 | |
2489 signed int v3; // ebx@1 | |
2490 | |
2491 v2 = this; | |
2492 v3 = 10; | |
2493 do | |
2494 { | |
2495 if ( v2->spellnum ) | |
2496 { | |
2497 if ( v2->field_8 & 0x3CA ) | |
2498 { | |
2499 v2->spellnum = 0; | |
2500 pGUIWindow_Settings->Release(); | |
2501 pGUIWindow_Settings = 0; | |
2502 pMouse->SetCursorBitmap("MICON1"); | |
2503 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2504 unk_50C9A0 = 0; | |
2505 back_to_game(); | |
2506 } | |
2507 } | |
2508 ++v2; | |
2509 --v3; | |
2510 } | |
2511 while ( v3 ); | |
2512 } | |
2513 | |
2514 //----- (00427DA0) -------------------------------------------------------- | |
2515 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6) | |
2516 { | |
2517 unsigned int result; // eax@1 | |
2518 stru277 *v7; // edx@1 | |
2519 stru277 *v8; // ecx@5 | |
2520 | |
2521 result = 0; | |
2522 v7 = this; | |
2523 while ( v7->spellnum ) | |
2524 { | |
2525 ++result; | |
2526 ++v7; | |
2527 if ( (signed int)result >= 10 ) | |
2528 goto LABEL_8; | |
2529 } | |
2530 v8 = &this[result]; | |
2531 v8->spellnum = a2; | |
2532 v8->uPlayerID = uPlayerID; | |
2533 if ( a5 & 0x10 ) | |
2534 v8->uPlayerID_2 = uPlayerID; | |
2535 v8->field_6 = 0; | |
2536 *(int *)&v8->field_C = 0; | |
2537 v8->field_8 = a5; | |
2538 v8->field_A = a4; | |
2539 v8->field_10 = a6; | |
2540 LABEL_8: | |
2541 if ( result == 10 ) | |
2542 result = -1; | |
2543 return result; | |
2544 } | |
2545 | |
2546 //----- (00427E01) -------------------------------------------------------- | |
2547 void stru277::_427E01_cast_spell() | |
2548 { | |
2549 int v1; // esi@1 | |
2550 int v2; // edi@1 | |
2551 stru277 *v3; // ebx@2 | |
2552 signed int v4; // eax@8 | |
2553 __int16 v5; // ax@9 | |
2554 signed int v6; // eax@14 | |
2555 __int16 v7; // ax@23 | |
2556 __int16 v8; // ax@24 | |
2557 char v9; // al@44 | |
2558 int v10; // eax@45 | |
2559 unsigned __int16 v11; // cx@45 | |
2560 signed int v12; // ecx@48 | |
2561 int v13; // eax@53 | |
2562 unsigned __int8 v14; // zf@53 | |
2563 unsigned int v15; // edx@53 | |
2564 signed int v16; // eax@53 | |
2565 Player *v17; // esi@70 | |
2566 int v18; // eax@72 | |
2567 int v19; // eax@74 | |
2568 char *v20; // eax@74 | |
2569 signed int i; // esi@76 | |
2570 int v22; // eax@88 | |
2571 __int16 v23; // ax@88 | |
2572 int v24; // ecx@93 | |
2573 int v25; // ecx@94 | |
2574 signed __int64 v26; // qax@100 | |
2575 char *v27; // ecx@100 | |
2576 unsigned __int64 v28; // qax@102 | |
2577 int v29; // ecx@105 | |
2578 int v30; // ecx@106 | |
2579 int v31; // eax@112 | |
2580 int v32; // eax@112 | |
2581 char *v33; // edx@113 | |
2582 int v34; // eax@121 | |
2583 int v35; // eax@123 | |
2584 int v36; // edx@125 | |
2585 int v37; // eax@129 | |
2586 signed int v38; // edi@129 | |
2587 signed int v39; // eax@129 | |
2588 int v40; // ecx@129 | |
2589 int v41; // eax@129 | |
2590 signed int v42; // eax@129 | |
2591 int *v43; // ecx@129 | |
2592 int v44; // eax@132 | |
2593 int v45; // ecx@132 | |
2594 int v46; // eax@132 | |
2595 unsigned int v47; // edx@133 | |
2596 int v48; // eax@137 | |
2597 int v49; // eax@137 | |
2598 int v50; // eax@141 | |
2599 int v51; // eax@146 | |
2600 __int16 v52; // ax@153 | |
2601 int v53; // eax@153 | |
2602 signed __int64 v54; // qax@164 | |
2603 int v55; // edi@164 | |
2604 stru6 *v56; // eax@165 | |
2605 int v57; // eax@169 | |
2606 signed __int64 v58; // qax@177 | |
2607 int v59; // edi@177 | |
2608 unsigned __int16 v60; // ax@184 | |
2609 int v61; // ecx@184 | |
2610 int v62; // eax@186 | |
2611 int v63; // ecx@187 | |
2612 int v64; // ecx@188 | |
2613 int v65; // ecx@189 | |
2614 const char *v66; // ecx@200 | |
2615 unsigned int v67; // edx@201 | |
2616 char v68; // al@207 | |
89 | 2617 ItemGen *v69; // esi@211 |
0 | 2618 int v70; // ecx@214 |
2619 int v71; // ecx@215 | |
2620 int v72; // ecx@216 | |
2621 __int16 v73; // ST1C_2@222 | |
2622 __int16 v74; // ST18_2@222 | |
2623 stru6 *v75; // eax@222 | |
2624 int v76; // ecx@223 | |
2625 int v77; // ecx@224 | |
2626 int v78; // ecx@225 | |
2627 int v79; // eax@227 | |
2628 int v80; // eax@232 | |
2629 __int16 v81; // ST18_2@245 | |
2630 stru6 *v82; // eax@245 | |
2631 signed int v83; // edi@245 | |
2632 __int16 v84; // ST18_2@245 | |
2633 stru6 *v85; // eax@245 | |
2634 __int16 v86; // ST18_2@245 | |
2635 stru6 *v87; // eax@245 | |
2636 __int16 v88; // ST18_2@245 | |
2637 stru6 *v89; // eax@245 | |
2638 double v90; // st7@245 | |
2639 int v91; // eax@250 | |
89 | 2640 Player *v92; // eax@255 |
0 | 2641 __int16 v93; // ST18_2@260 |
2642 stru6 *v94; // eax@260 | |
2643 __int16 v95; // ST18_2@260 | |
2644 stru6 *v96; // eax@260 | |
2645 __int16 v97; // ST18_2@260 | |
2646 stru6 *v98; // eax@260 | |
2647 __int16 v99; // ST18_2@260 | |
2648 stru6 *v100; // eax@260 | |
2649 int v101; // ecx@261 | |
2650 int v102; // ecx@262 | |
2651 int v103; // ecx@263 | |
2652 int v104; // eax@265 | |
2653 int v105; // edi@271 | |
2654 __int16 v106; // ST18_2@272 | |
2655 stru6 *v107; // eax@272 | |
2656 __int16 v108; // ST1C_2@274 | |
2657 __int16 v109; // ST18_2@274 | |
2658 stru6 *v110; // eax@274 | |
2659 int v111; // eax@274 | |
2660 Actor *v112; // esi@278 | |
2661 int v113; // eax@278 | |
2662 int v114; // ebx@278 | |
2663 unsigned int v115; // ecx@278 | |
2664 int v116; // edx@279 | |
2665 int v117; // edx@281 | |
2666 int v118; // edx@283 | |
2667 int v119; // edi@286 | |
2668 int v120; // eax@286 | |
2669 int v121; // eax@286 | |
2670 signed int v122; // eax@286 | |
2671 int v123; // ecx@288 | |
2672 int v124; // ecx@289 | |
2673 int v125; // ecx@290 | |
2674 int v126; // eax@292 | |
2675 int v127; // eax@296 | |
2676 __int16 v128; // ST18_2@303 | |
2677 stru6 *v129; // eax@303 | |
2678 __int16 v130; // ST18_2@303 | |
2679 stru6 *v131; // eax@303 | |
2680 __int16 v132; // ST18_2@303 | |
2681 stru6 *v133; // eax@303 | |
2682 __int16 v134; // ST18_2@303 | |
2683 stru6 *v135; // eax@303 | |
2684 unsigned __int64 v136; // qax@304 | |
2685 char *v137; // ecx@304 | |
2686 int v138; // ecx@305 | |
2687 int v139; // ecx@306 | |
2688 int v140; // eax@308 | |
2689 __int16 v141; // ST18_2@311 | |
2690 stru6 *v142; // eax@311 | |
2691 __int16 v143; // ST18_2@311 | |
2692 stru6 *v144; // eax@311 | |
2693 __int16 v145; // ST18_2@311 | |
2694 stru6 *v146; // eax@311 | |
2695 __int16 v147; // ST18_2@311 | |
2696 stru6 *v148; // eax@311 | |
2697 int v149; // ecx@312 | |
2698 int v150; // ecx@313 | |
2699 int v151; // ecx@314 | |
2700 signed int v152; // eax@322 | |
2701 int v153; // ecx@322 | |
2702 int v154; // eax@322 | |
2703 int v155; // eax@323 | |
2704 int v156; // eax@323 | |
2705 int v157; // eax@326 | |
2706 double v158; // st7@326 | |
2707 double v159; // st6@326 | |
2708 signed __int64 v160; // qtt@334 | |
2709 int v161; // eax@339 | |
2710 int v162; // edi@340 | |
2711 int v163; // eax@340 | |
2712 signed int v164; // eax@340 | |
2713 signed int v165; // edi@340 | |
2714 stru6 *v166; // eax@340 | |
2715 stru6 *v167; // eax@340 | |
2716 signed int v168; // edi@343 | |
2717 int v169; // eax@344 | |
2718 int v170; // ecx@346 | |
2719 int v171; // ecx@347 | |
2720 int v172; // ecx@348 | |
2721 int v173; // edi@350 | |
2722 signed int v174; // edi@355 | |
2723 __int16 v175; // ST18_2@357 | |
2724 stru6 *v176; // eax@357 | |
2725 __int16 v177; // ST18_2@357 | |
2726 stru6 *v178; // eax@357 | |
2727 __int16 v179; // ST18_2@357 | |
2728 stru6 *v180; // eax@357 | |
2729 __int16 v181; // ST18_2@357 | |
2730 stru6 *v182; // eax@357 | |
2731 signed __int64 v183; // qax@357 | |
2732 int v184; // ecx@358 | |
2733 int v185; // ecx@359 | |
2734 int v186; // ecx@360 | |
2735 int v187; // eax@367 | |
2736 int v188; // esi@369 | |
2737 int v189; // edi@369 | |
2738 const char *v190; // ecx@377 | |
2739 signed int v191; // edi@379 | |
2740 int v192; // ecx@382 | |
2741 int v193; // ecx@383 | |
2742 int v194; // ecx@384 | |
2743 int v195; // eax@386 | |
2744 int v196; // eax@387 | |
2745 __int16 v197; // ST18_2@395 | |
2746 stru6 *v198; // eax@395 | |
2747 __int16 v199; // ST18_2@395 | |
2748 stru6 *v200; // eax@395 | |
2749 __int16 v201; // ST18_2@395 | |
2750 stru6 *v202; // eax@395 | |
2751 __int16 v203; // ST18_2@395 | |
2752 stru6 *v204; // eax@395 | |
2753 signed int v205; // edi@405 | |
2754 int v206; // eax@407 | |
2755 __int16 v207; // cx@407 | |
2756 int v208; // eax@411 | |
2757 signed int v209; // ecx@412 | |
2758 int v210; // edx@412 | |
2759 signed int v211; // ecx@412 | |
2760 int v212; // eax@413 | |
2761 int v213; // eax@413 | |
2762 int v214; // eax@413 | |
2763 int v215; // eax@415 | |
2764 double v216; // st7@415 | |
2765 double v217; // st6@415 | |
2766 signed __int64 v218; // qtt@423 | |
2767 int v219; // ecx@425 | |
2768 int v220; // ecx@426 | |
2769 int v221; // edi@428 | |
2770 char *v222; // edi@434 | |
2771 char v223; // al@438 | |
2772 int v224; // ecx@442 | |
2773 int v225; // ecx@443 | |
2774 int v226; // eax@451 | |
2775 int v227; // esi@453 | |
2776 unsigned int v228; // edi@454 | |
2777 int v229; // edi@466 | |
2778 __int16 v230; // ST18_2@469 | |
2779 stru6 *v231; // eax@469 | |
2780 signed int v232; // esi@469 | |
2781 __int16 v233; // ST18_2@469 | |
2782 stru6 *v234; // eax@469 | |
2783 __int16 v235; // ST18_2@469 | |
2784 stru6 *v236; // eax@469 | |
2785 __int16 v237; // ST18_2@469 | |
2786 stru6 *v238; // eax@469 | |
2787 __int16 v239; // ST1C_2@469 | |
2788 char *v240; // ecx@472 | |
2789 double v241; // st7@478 | |
2790 signed __int64 v242; // qax@484 | |
2791 char *v243; // ecx@484 | |
2792 char *v244; // eax@488 | |
2793 int v245; // edi@492 | |
2794 int v246; // eax@492 | |
2795 char *v247; // eax@497 | |
2796 char v248; // al@497 | |
2797 char v249; // cf@500 | |
2798 float v250; // esi@507 | |
2799 char v251; // al@507 | |
2800 int v252; // edx@510 | |
2801 int m; // esi@510 | |
2802 int v254; // eax@513 | |
2803 int v255; // esi@513 | |
2804 int v256; // ecx@513 | |
2805 int v257; // edx@514 | |
2806 int v258; // ecx@514 | |
2807 char v259; // al@516 | |
2808 int v260; // eax@518 | |
2809 int v261; // esi@519 | |
2810 int v262; // edx@521 | |
2811 int v263; // ecx@521 | |
2812 int v264; // esi@521 | |
2813 int v265; // edx@521 | |
2814 int *ii; // eax@522 | |
2815 int v267; // eax@524 | |
2816 int v268; // eax@524 | |
2817 int v269; // eax@526 | |
2818 char *v270; // eax@531 | |
2819 char v271; // al@531 | |
2820 char v272; // cf@534 | |
2821 float v273; // esi@541 | |
2822 char v274; // al@541 | |
2823 int v275; // edx@544 | |
2824 int k; // esi@544 | |
2825 int v277; // edx@548 | |
2826 int v278; // ecx@548 | |
2827 char v279; // al@550 | |
2828 int v280; // eax@552 | |
2829 int v281; // esi@553 | |
2830 int v282; // edx@555 | |
2831 int v283; // ecx@555 | |
2832 int v284; // esi@555 | |
2833 int v285; // edx@555 | |
2834 int *l; // eax@556 | |
2835 int v287; // eax@558 | |
2836 int v288; // eax@558 | |
2837 ItemGen *v289; // eax@560 | |
2838 signed int v290; // eax@560 | |
2839 unsigned __int8 v291; // al@564 | |
2840 char v292; // al@573 | |
2841 int v293; // eax@575 | |
2842 ItemGen *v294; // esi@575 | |
2843 int v295; // edx@575 | |
2844 int kk; // edi@575 | |
2845 int v297; // edx@579 | |
2846 int v298; // ecx@579 | |
2847 char v299; // al@581 | |
2848 int v300; // eax@583 | |
2849 int v301; // edi@584 | |
2850 int v302; // edx@586 | |
2851 int v303; // ecx@586 | |
2852 int v304; // edi@586 | |
2853 int v305; // edx@586 | |
2854 int *jj; // eax@587 | |
2855 int v307; // eax@589 | |
2856 int v308; // eax@589 | |
2857 char *v309; // ecx@593 | |
2858 char v310; // sf@593 | |
2859 unsigned __int8 v311; // of@593 | |
2860 char v312; // cl@597 | |
2861 char v313; // al@606 | |
2862 int v314; // edx@607 | |
2863 int j; // esi@607 | |
2864 unsigned int v316; // eax@613 | |
2865 const char *v317; // ecx@617 | |
2866 Player *v318; // ecx@619 | |
2867 unsigned int v319; // edi@627 | |
2868 int v320; // ecx@629 | |
2869 int v321; // ecx@630 | |
2870 int v322; // edi@632 | |
2871 int v323; // edi@635 | |
2872 char *v324; // eax@635 | |
2873 Player *v325; // ecx@640 | |
2874 int v326; // eax@643 | |
2875 int v327; // eax@648 | |
2876 int v328; // ecx@651 | |
2877 int v329; // ecx@652 | |
2878 int v330; // edi@654 | |
2879 __int16 v331; // ST18_2@658 | |
2880 stru6 *v332; // eax@658 | |
2881 __int16 v333; // ST18_2@658 | |
2882 stru6 *v334; // eax@658 | |
2883 __int16 v335; // ST18_2@658 | |
2884 stru6 *v336; // eax@658 | |
2885 __int16 v337; // ST18_2@658 | |
2886 stru6 *v338; // eax@658 | |
2887 int v339; // ecx@659 | |
2888 int v340; // ecx@660 | |
2889 int v341; // eax@663 | |
2890 signed int v342; // edi@668 | |
2891 signed int v343; // edi@670 | |
2892 unsigned __int64 v344; // ST08_8@670 | |
2893 __int16 v345; // ST1C_2@671 | |
2894 __int16 v346; // ST18_2@671 | |
2895 stru6 *v347; // eax@671 | |
2896 int v348; // ecx@672 | |
2897 int v349; // ecx@673 | |
2898 int v350; // edi@676 | |
2899 Player *v351; // edi@680 | |
2900 __int16 v352; // ST18_2@685 | |
2901 stru6 *v353; // eax@685 | |
2902 int v354; // ecx@686 | |
2903 int v355; // ecx@687 | |
2904 int v356; // eax@689 | |
112 | 2905 Player *v357; // edi@694 |
0 | 2906 unsigned __int16 v358; // ST1C_2@695 |
2907 __int16 v359; // ST18_2@695 | |
2908 stru6 *v360; // eax@695 | |
2909 __int16 v361; // ST1C_2@697 | |
2910 __int16 v362; // ST18_2@697 | |
2911 stru6 *v363; // eax@697 | |
2912 int v364; // ecx@698 | |
2913 int v365; // ecx@699 | |
2914 int v366; // eax@701 | |
2915 stru6 *v367; // eax@704 | |
2916 int v368; // eax@704 | |
2917 Actor *v369; // edi@705 | |
2918 int v370; // eax@706 | |
2919 int v371; // ecx@709 | |
2920 int v372; // ecx@710 | |
2921 int v373; // eax@715 | |
2922 int v374; // eax@717 | |
112 | 2923 Player *v375; // edi@717 |
0 | 2924 int v376; // eax@717 |
2925 Player *v377; // ecx@719 | |
2926 int v378; // ecx@721 | |
2927 int v379; // ecx@722 | |
2928 int v380; // eax@724 | |
2929 int v381; // edi@727 | |
2930 int v382; // ecx@727 | |
2931 Player *v383; // eax@728 | |
2932 int v384; // eax@733 | |
2933 int v385; // edi@736 | |
2934 signed int v386; // eax@736 | |
2935 Player *v387; // edi@738 | |
2936 int v388; // edi@740 | |
2937 unsigned __int16 v389; // ST1C_2@740 | |
2938 __int16 v390; // ST18_2@740 | |
2939 stru6 *v391; // eax@740 | |
2940 int v392; // ecx@742 | |
2941 int v393; // ecx@743 | |
2942 int v394; // ecx@744 | |
2943 int v395; // edi@747 | |
2944 int v396; // eax@752 | |
2945 int v397; // eax@757 | |
2946 int v398; // eax@757 | |
2947 int v399; // eax@757 | |
2948 char *v400; // esi@757 | |
2949 Game *v401; // ecx@759 | |
2950 __int16 v402; // ST1C_2@759 | |
2951 __int16 v403; // ST18_2@759 | |
2952 stru6 *v404; // eax@759 | |
2953 int v405; // ecx@761 | |
2954 int v406; // ecx@762 | |
2955 int v407; // edi@765 | |
2956 __int16 v408; // ST1C_2@769 | |
2957 __int16 v409; // ST18_2@769 | |
2958 stru6 *v410; // eax@769 | |
2959 int v411; // ecx@772 | |
2960 int v412; // ecx@773 | |
2961 int v413; // edi@775 | |
2962 __int16 v414; // ST1C_2@781 | |
2963 __int16 v415; // ST18_2@781 | |
2964 stru6 *v416; // eax@781 | |
2965 int v417; // eax@787 | |
2966 int v418; // ecx@789 | |
2967 __int16 v419; // ax@791 | |
2968 signed int v420; // eax@793 | |
2969 int v421; // edx@793 | |
2970 const char *v422; // eax@801 | |
2971 int v423; // ecx@808 | |
2972 int v424; // ecx@809 | |
2973 int v425; // eax@811 | |
2974 signed int v426; // eax@815 | |
2975 signed int v427; // eax@820 | |
2976 int v428; // ecx@825 | |
2977 int v429; // ecx@826 | |
2978 int v430; // eax@828 | |
2979 stru6 *v431; // eax@831 | |
2980 int v432; // eax@831 | |
2981 Actor *v433; // edi@832 | |
2982 int v434; // eax@833 | |
2983 int v435; // ecx@837 | |
2984 int v436; // ecx@838 | |
2985 __int16 v437; // ST1C_2@843 | |
2986 __int16 v438; // ST18_2@843 | |
2987 stru6 *v439; // eax@843 | |
2988 int v440; // eax@843 | |
2989 int v441; // eax@847 | |
2990 int v442; // ecx@850 | |
2991 int v443; // ecx@851 | |
2992 int v444; // eax@853 | |
2993 signed int v445; // edi@857 | |
2994 int v446; // ecx@862 | |
2995 LevelDecoration *v447; // edi@864 | |
2996 __int16 v448; // ax@864 | |
2997 char *v449; // esi@870 | |
2998 int v450; // eax@870 | |
2999 int v451; // ecx@875 | |
3000 int v452; // ecx@876 | |
3001 int v453; // edi@878 | |
3002 __int16 v454; // ST1C_2@884 | |
3003 __int16 v455; // ST18_2@884 | |
3004 stru6 *v456; // eax@884 | |
3005 int v457; // ecx@887 | |
3006 int v458; // ecx@888 | |
3007 int v459; // eax@890 | |
3008 signed int v460; // eax@895 | |
3009 Actor *v461; // eax@897 | |
3010 unsigned __int16 v462; // cx@897 | |
3011 signed int v463; // edx@897 | |
3012 int v464; // ecx@905 | |
3013 int v465; // ecx@906 | |
3014 int v466; // edi@909 | |
3015 __int16 v467; // ST1C_2@913 | |
3016 __int16 v468; // ST18_2@913 | |
3017 stru6 *v469; // eax@913 | |
3018 int v470; // edi@913 | |
3019 int v471; // eax@917 | |
3020 int v472; // eax@917 | |
3021 char *v473; // esi@918 | |
3022 __int16 v474; // ST18_2@920 | |
3023 stru6 *v475; // eax@920 | |
3024 __int16 v476; // ST18_2@920 | |
3025 stru6 *v477; // eax@920 | |
3026 __int16 v478; // ST18_2@920 | |
3027 stru6 *v479; // eax@920 | |
3028 __int16 v480; // ST18_2@920 | |
3029 stru6 *v481; // eax@920 | |
3030 __int16 v482; // ST18_2@923 | |
3031 stru6 *v483; // eax@923 | |
3032 __int16 v484; // ST18_2@923 | |
3033 stru6 *v485; // eax@923 | |
3034 __int16 v486; // ST18_2@923 | |
3035 stru6 *v487; // eax@923 | |
3036 __int16 v488; // ST18_2@923 | |
3037 stru6 *v489; // eax@923 | |
3038 __int16 v490; // ST1C_2@924 | |
3039 __int16 v491; // ST18_2@924 | |
3040 stru6 *v492; // eax@924 | |
3041 int v493; // ecx@925 | |
3042 int v494; // ecx@926 | |
3043 __int16 v495; // ST1C_2@931 | |
3044 __int16 v496; // ST18_2@931 | |
3045 stru6 *v497; // eax@931 | |
3046 int v498; // edi@931 | |
3047 int v499; // eax@935 | |
3048 int v500; // eax@935 | |
3049 Player *v501; // edi@939 | |
3050 __int16 v502; // ST18_2@940 | |
3051 stru6 *v503; // eax@940 | |
3052 stru6 *v504; // eax@943 | |
3053 int v505; // eax@943 | |
3054 int v506; // eax@943 | |
3055 int v507; // edi@944 | |
3056 int v508; // eax@944 | |
3057 signed int v509; // eax@944 | |
3058 signed int v510; // edi@944 | |
3059 Actor *v511; // edi@946 | |
3060 int v512; // eax@946 | |
3061 SpellBuff *v513; // edi@946 | |
3062 int v514; // ecx@950 | |
3063 int v515; // ecx@951 | |
3064 int v516; // eax@953 | |
3065 int v517; // eax@956 | |
90 | 3066 Actor *v518; // edx@957 |
0 | 3067 __int16 v519; // cx@958 |
3068 int v520; // ecx@968 | |
3069 int v521; // ecx@969 | |
3070 int v522; // eax@971 | |
3071 __int16 v523; // ST18_2@975 | |
3072 stru6 *v524; // eax@975 | |
3073 __int16 v525; // ST18_2@975 | |
3074 stru6 *v526; // eax@975 | |
3075 __int16 v527; // ST18_2@975 | |
3076 stru6 *v528; // eax@975 | |
3077 __int16 v529; // ST18_2@975 | |
3078 stru6 *v530; // eax@975 | |
3079 int v531; // eax@982 | |
3080 int v532; // eax@982 | |
3081 int v533; // edi@983 | |
3082 int v534; // eax@983 | |
3083 signed int v535; // eax@983 | |
3084 signed int v536; // edi@983 | |
3085 stru6 *v537; // eax@984 | |
3086 int v538; // ecx@985 | |
3087 int v539; // ecx@986 | |
3088 int v540; // eax@988 | |
3089 __int16 v541; // ST18_2@991 | |
3090 stru6 *v542; // eax@991 | |
3091 __int16 v543; // ST18_2@991 | |
3092 stru6 *v544; // eax@991 | |
3093 __int16 v545; // ST18_2@991 | |
3094 stru6 *v546; // eax@991 | |
3095 __int16 v547; // ST18_2@991 | |
3096 stru6 *v548; // eax@991 | |
3097 double v549; // st7@991 | |
3098 unsigned __int16 v550; // di@991 | |
3099 int v551; // ecx@993 | |
3100 int v552; // ecx@994 | |
89 | 3101 Player *v553; // edi@1001 |
0 | 3102 __int16 v554; // ST18_2@1002 |
3103 stru6 *v555; // eax@1002 | |
3104 __int16 v556; // ST18_2@1002 | |
3105 stru6 *v557; // eax@1002 | |
3106 __int16 v558; // ST18_2@1002 | |
3107 stru6 *v559; // eax@1002 | |
3108 __int16 v560; // ST18_2@1002 | |
3109 stru6 *v561; // eax@1002 | |
3110 unsigned __int16 v562; // di@1005 | |
3111 signed int v563; // eax@1010 | |
3112 unsigned int v564; // ecx@1011 | |
3113 signed int v565; // eax@1012 | |
3114 Player **v566; // ecx@1012 | |
3115 int v567; // eax@1012 | |
3116 unsigned __int16 v568; // ST1C_2@1012 | |
3117 __int16 v569; // ST18_2@1012 | |
3118 stru6 *v570; // eax@1012 | |
3119 Player *v571; // eax@1013 | |
3120 char *v572; // ecx@1013 | |
3121 int v573; // ecx@1017 | |
3122 int v574; // ecx@1018 | |
3123 int v575; // eax@1020 | |
3124 signed int v576; // eax@1025 | |
3125 Player *v577; // eax@1026 | |
3126 int v578; // eax@1028 | |
3127 __int16 v579; // ax@1029 | |
3128 int v580; // eax@1031 | |
3129 int v581; // edi@1031 | |
3130 int v582; // eax@1031 | |
3131 __int16 v583; // ST1C_2@1034 | |
3132 __int16 v584; // ST18_2@1034 | |
3133 char *v585; // esi@1034 | |
3134 stru6 *v586; // eax@1034 | |
3135 signed int v587; // eax@1035 | |
3136 int v588; // ecx@1036 | |
3137 int v589; // ecx@1037 | |
3138 int v590; // ecx@1038 | |
3139 char v591; // al@1048 | |
3140 int v592; // esi@1052 | |
3141 int v593; // ecx@1057 | |
3142 int v594; // ecx@1058 | |
3143 int v595; // eax@1064 | |
3144 int v596; // esi@1066 | |
3145 unsigned int v597; // edi@1067 | |
3146 int v598; // eax@1079 | |
3147 signed int v599; // eax@1082 | |
3148 int v600; // edi@1086 | |
3149 int v601; // edx@1086 | |
3150 int v602; // eax@1086 | |
3151 int v603; // ecx@1086 | |
3152 int v604; // eax@1087 | |
3153 char *v605; // eax@1089 | |
3154 int v606; // edx@1091 | |
3155 int v607; // ecx@1100 | |
3156 __int16 v608; // ax@1102 | |
3157 signed int v609; // eax@1104 | |
3158 int v610; // edi@1106 | |
3159 unsigned int v611; // eax@1106 | |
89 | 3160 Player *v612; // edi@1106 |
3161 DDM_DLV_Header *v613; // eax@1108 | |
0 | 3162 int v614; // eax@1116 |
3163 int v615; // edi@1119 | |
3164 __int16 v616; // ST1C_2@1122 | |
3165 __int16 v617; // ST18_2@1122 | |
3166 stru6 *v618; // eax@1122 | |
112 | 3167 Player *v619; // edi@1123 |
0 | 3168 unsigned __int16 v620; // ST1C_2@1124 |
3169 __int16 v621; // ST18_2@1124 | |
3170 stru6 *v622; // eax@1124 | |
3171 signed __int64 v623; // qax@1127 | |
3172 int v624; // eax@1127 | |
3173 int v625; // edi@1129 | |
3174 int v626; // eax@1129 | |
3175 signed int v627; // eax@1129 | |
3176 signed int v628; // edi@1129 | |
3177 int v629; // ecx@1130 | |
3178 Player *v630; // eax@1131 | |
3179 int v631; // eax@1137 | |
3180 int v632; // edi@1140 | |
3181 Player *v633; // eax@1140 | |
3182 signed int v634; // eax@1140 | |
3183 int v635; // edi@1142 | |
3184 unsigned __int16 v636; // ST1C_2@1142 | |
3185 __int16 v637; // ST18_2@1142 | |
3186 stru6 *v638; // eax@1142 | |
3187 stru6 *v639; // eax@1143 | |
3188 int v640; // ecx@1146 | |
3189 int v641; // ecx@1147 | |
3190 int v642; // edi@1156 | |
3191 int v643; // eax@1156 | |
3192 int v644; // eax@1156 | |
3193 signed int v645; // eax@1158 | |
3194 Player *v646; // ebx@1169 | |
3195 int v647; // edi@1169 | |
3196 signed int v648; // ST1C_4@1170 | |
3197 Player *v649; // ecx@1170 | |
3198 unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3199 unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3200 unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3201 unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
3202 int v654; // [sp-4h] [bp-E88h]@124 | |
3203 unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 | |
3204 unsigned int v656; // [sp-4h] [bp-E88h]@639 | |
3205 int v657; // [sp-4h] [bp-E88h]@807 | |
3206 int v658; // [sp+0h] [bp-E84h]@100 | |
3207 int v659; // [sp+0h] [bp-E84h]@123 | |
3208 int v660; // [sp+0h] [bp-E84h]@146 | |
3209 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
3210 int v662; // [sp+0h] [bp-E84h]@304 | |
3211 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 | |
3212 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3213 int v665; // [sp+0h] [bp-E84h]@807 | |
3214 int v666; // [sp+4h] [bp-E80h]@12 | |
3215 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
3216 unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 | |
3217 int v669; // [sp+4h] [bp-E80h]@123 | |
3218 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3219 int v671; // [sp+4h] [bp-E80h]@146 | |
3220 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
3221 unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 | |
3222 __int16 v674; // [sp+4h] [bp-E80h]@684 | |
3223 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3224 int v676; // [sp+4h] [bp-E80h]@807 | |
3225 int v677; // [sp+4h] [bp-E80h]@861 | |
3226 int v678; // [sp+4h] [bp-E80h]@997 | |
3227 int v679; // [sp+14h] [bp-E70h]@515 | |
3228 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3229 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3230 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3231 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3232 int v684; // [sp+D04h] [bp-180h]@416 | |
3233 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3234 int x; // [sp+D20h] [bp-164h]@327 | |
3235 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3236 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3237 int v689; // [sp+D30h] [bp-154h]@943 | |
3238 int v690; // [sp+D34h] [bp-150h]@943 | |
3239 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3240 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3241 int v693; // [sp+D40h] [bp-144h]@137 | |
3242 int v694; // [sp+D44h] [bp-140h]@982 | |
3243 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3244 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3245 int v697; // [sp+D50h] [bp-134h]@129 | |
3246 int v698; // [sp+D54h] [bp-130h]@129 | |
3247 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3248 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3249 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3250 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3251 int v703; // [sp+D70h] [bp-114h]@286 | |
3252 int v704; // [sp+D74h] [bp-110h]@132 | |
3253 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3254 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3255 int v707; // [sp+D80h] [bp-104h]@1127 | |
3256 int v708; // [sp+D84h] [bp-100h]@1127 | |
3257 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3258 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3259 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3260 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3261 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3262 int n; // [sp+DA0h] [bp-E4h]@1 | |
3263 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3264 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3265 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3266 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3267 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3268 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3269 int v721; // [sp+DD8h] [bp-ACh]@163 | |
3270 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3271 int v723; // [sp+E4Ch] [bp-38h]@1 | |
3272 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3273 float v725; // [sp+E54h] [bp-30h]@23 | |
3274 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3275 int v726b; |
0 | 3276 float v727; // [sp+E5Ch] [bp-28h]@1 |
3277 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3278 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3279 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3280 Player *v730b; |
3281 ItemGen *v730c; | |
0 | 3282 int v731; // [sp+E6Ch] [bp-18h]@48 |
3283 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3284 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3285 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3286 int amount; // [sp+E80h] [bp-4h]@1 | |
3287 | |
3288 auto ecx0 = this; | |
3289 | |
3290 v711 = ecx0; | |
3291 | |
3292 LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3293 //LayingItem::LayingItem(&a1); | |
3294 | |
3295 v1 = 0; | |
3296 v2 = 0; | |
3297 amount = 0; | |
3298 LODWORD(v733) = 0; | |
3299 v723 = 0; | |
3300 v727 = 0.0; | |
3301 n = 0; | |
3302 while ( 1 ) | |
3303 { | |
3304 v3 = &v711[n]; | |
3305 HIDWORD(v733) = (int)v3; | |
3306 if ( v3->spellnum == (short)v1 ) | |
3307 goto LABEL_1166; | |
3308 if ( pParty->pPartyBuffs[11].NotExpired() ) | |
3309 pParty->pPartyBuffs[11].Reset(); | |
3310 if ( v3->field_8 & 0x3CA ) | |
3311 { | |
3312 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3313 v711->_427D48(1u); | |
3314 goto LABEL_1166; | |
3315 } | |
3316 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
3317 v4 = *(int *)&v3->field_C; | |
3318 if ( v4 != v1 ) | |
3319 goto LABEL_18; | |
3320 v5 = v3->spellnum; | |
3321 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) | |
3322 v666 = 1; | |
3323 else | |
3324 v666 = v1; | |
271 | 3325 a2 = stru_50C198.FindClosestActor(5120, 1, v666); |
0 | 3326 v6 = pMouse->uPointingObjectID; |
141 | 3327 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) |
0 | 3328 { |
3329 v4 = pMouse->uPointingObjectID; | |
3330 LABEL_18: | |
3331 a2 = v4; | |
3332 } | |
3333 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; | |
3334 if ( (short)a1.uItemType != (short)v1 ) | |
3335 { | |
141 | 3336 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3337 { |
141 | 3338 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3339 v2 = v723; |
3340 v1 = 0; | |
3341 } | |
3342 else | |
3343 { | |
3344 v715.uYawAngle = pParty->sRotationY; | |
3345 v715.uPitchAngle = pParty->sRotationX; | |
3346 } | |
3347 } | |
3348 v7 = v3->field_A; | |
3349 LODWORD(v725) = v1; | |
3350 _this = (ItemGen *)v1; | |
3351 if ( v7 == (short)v1 ) | |
3352 { | |
3353 v8 = v3->spellnum; | |
3354 if ( v3->spellnum >= 12 ) | |
3355 { | |
3356 if ( v8 >= 23 ) | |
3357 { | |
3358 if ( v8 >= 34 ) | |
3359 { | |
3360 if ( v8 >= 45 ) | |
3361 { | |
3362 if ( v8 >= 56 ) | |
3363 { | |
3364 if ( v8 >= 67 ) | |
3365 { | |
3366 if ( v8 >= 78 ) | |
3367 { | |
3368 if ( v8 >= 89 ) | |
3369 { | |
3370 if ( v8 >= 100 ) | |
3371 { | |
3372 if ( v8 != 100 ) | |
3373 { | |
3374 LABEL_45: | |
3375 HIWORD(v10) = HIWORD(pPlayer); | |
3376 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
3377 goto LABEL_47; | |
3378 } | |
3379 v667 = (PLAYER_SKILL_TYPE)5; | |
3380 } | |
3381 else | |
3382 { | |
3383 v667 = (PLAYER_SKILL_TYPE)20; | |
3384 } | |
3385 } | |
3386 else | |
3387 { | |
3388 v667 = (PLAYER_SKILL_TYPE)19; | |
3389 } | |
3390 } | |
3391 else | |
3392 { | |
3393 v667 = (PLAYER_SKILL_TYPE)18; | |
3394 } | |
3395 } | |
3396 else | |
3397 { | |
3398 v667 = (PLAYER_SKILL_TYPE)17; | |
3399 } | |
3400 } | |
3401 else | |
3402 { | |
3403 v667 = (PLAYER_SKILL_TYPE)16; | |
3404 } | |
3405 } | |
3406 else | |
3407 { | |
3408 v667 = (PLAYER_SKILL_TYPE)15; | |
3409 } | |
3410 } | |
3411 else | |
3412 { | |
3413 v667 = (PLAYER_SKILL_TYPE)14; | |
3414 } | |
3415 } | |
3416 else | |
3417 { | |
3418 v667 = (PLAYER_SKILL_TYPE)13; | |
3419 } | |
3420 } | |
3421 else | |
3422 { | |
3423 v667 = (PLAYER_SKILL_TYPE)12; | |
3424 } | |
3425 LODWORD(v725) = v667; | |
3426 v9 = pPlayer->GetActualSkillLevel(v667); | |
3427 v723 = v9 & 0x3F; | |
3428 v2 = v9 & 0x3F; | |
3429 goto LABEL_45; | |
3430 } | |
3431 v11 = v7; | |
3432 v10 = v7 & 0x3F; | |
3433 v723 = v10; | |
3434 v2 = v10; | |
3435 LABEL_47: | |
3436 if ( HIBYTE(v11) & 1 ) | |
3437 { | |
3438 v12 = 4; | |
3439 v731 = 4; | |
3440 } | |
3441 else | |
3442 { | |
3443 if ( (v11 & 0x80u) == 0 ) | |
3444 { | |
3445 v10 = ((v11 & 0x40) != 0) + 1; | |
3446 v731 = ((v11 & 0x40) != 0) + 1; | |
3447 } | |
3448 else | |
3449 { | |
3450 v731 = 3; | |
3451 } | |
3452 v12 = v731; | |
3453 } | |
3454 LOWORD(v10) = v3->spellnum; | |
3455 v730 = v10; | |
3456 v13 = v12 + 10 * (signed __int16)v10; | |
3457 v14 = v3->field_A == (short)v1; | |
3458 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing | |
3459 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); | |
3460 uRequiredMana = v15; | |
3461 sRecoveryTime = v16; | |
3462 if ( !v14 ) | |
3463 uRequiredMana = v1; | |
3464 if ( pParty->uCurrentHour == v1 ) | |
3465 { | |
3466 if ( pParty->uCurrentMinute != v1 ) | |
3467 goto LABEL_62; | |
3468 if ( LODWORD(v725) == 20 ) | |
3469 goto LABEL_61; | |
3470 } | |
3471 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == v1 && LODWORD(v725) == 19 ) | |
3472 LABEL_61: | |
3473 uRequiredMana = v1; | |
3474 LABEL_62: | |
3475 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) | |
3476 break; | |
3477 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); | |
3478 LABEL_203: | |
3479 v3->spellnum = v1; | |
3480 LABEL_1166: | |
3481 ++n; | |
3482 if ( n >= 10 ) | |
3483 return; | |
3484 } | |
3485 if ( !pPlayer->pConditions[0] || (signed __int16)v730 >= 100 ) | |
3486 goto LABEL_69; | |
3487 if ( rand() % 100 >= 50 ) | |
3488 { | |
3489 v12 = v731; | |
3490 LABEL_69: | |
3491 switch ( v3->spellnum ) | |
3492 { | |
3493 case 100: | |
3494 case 101: | |
3495 v17 = pPlayer; | |
3496 _this = (ItemGen *)1; | |
3497 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[5]) >= 3 ) | |
3498 _this = (ItemGen *)2; | |
3499 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3500 a1.stru_24.Reset(); | |
3501 v18 = v3->spellnum; | |
3502 a1.field_4C = v2; | |
3503 a1.field_48 = v18; | |
3504 a1.field_50 = v731; | |
3505 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3506 if ( v17->WearsItem(510, 2) ) | |
3507 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3508 a1.vPosition.x = pParty->vPosition.x; | |
3509 a1.vPosition.y = pParty->vPosition.y; | |
3510 a1.uAttributes = 0; | |
3511 a1.uSpriteFrameID = 0; | |
3512 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3513 v19 = 8 * v3->uPlayerID; | |
303 | 3514 LOBYTE(v19) = v19 | OBJECT_Player; |
3515 a1.field_58_pid = v19; | |
0 | 3516 a1.field_5C = a2; |
3517 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3518 a1.uFacing = LOWORD(v715.uYawAngle); | |
3519 a1.uSoundID = LOWORD(v3->field_10); | |
3520 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3521 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3522 a1.uAttributes = 256; | |
3523 if ( pParty->bTurnBasedModeOn == 1 ) | |
3524 a1.uAttributes = 260; | |
3525 for ( i = 0; i < (signed int)this; ++i ) | |
3526 { | |
3527 if ( i ) | |
3528 a1.vPosition.z += 32; | |
3529 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3530 if ( a1.Create( | |
3531 v715.uYawAngle, | |
3532 v715.uPitchAngle, | |
3533 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3534 v3->uPlayerID + 1) != -1 | |
3535 && pParty->bTurnBasedModeOn == 1 ) | |
3536 ++pTurnEngine->field_1C; | |
3537 } | |
3538 goto LABEL_83; | |
3539 case 102: | |
3540 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); | |
3541 a1.stru_24.Reset(); | |
3542 a1.field_48 = v3->spellnum; | |
3543 a1.field_4C = v723; | |
3544 a1.field_50 = v731; | |
3545 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3546 a1.vPosition.x = pParty->vPosition.x; | |
3547 a1.vPosition.y = pParty->vPosition.y; | |
3548 a1.uAttributes = 0; | |
3549 a1.uSpriteFrameID = 0; | |
3550 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3551 v22 = 8 * v3->uPlayerID; | |
303 | 3552 LOBYTE(v22) = v22 | OBJECT_Player; |
3553 a1.field_58_pid = v22; | |
0 | 3554 a1.field_5C = a2; |
3555 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3556 a1.uFacing = LOWORD(v715.uYawAngle); | |
3557 a1.uSoundID = LOWORD(v3->field_10); | |
3558 memcpy( | |
3559 &a1.stru_24, | |
3560 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3561 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3562 + 5], | |
3563 sizeof(a1.stru_24)); | |
3564 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3565 HIBYTE(a1.uAttributes) |= 1u; | |
3566 a1.uSectorID = v23; | |
3567 if ( pParty->bTurnBasedModeOn == 1 ) | |
3568 LOBYTE(a1.uAttributes) |= 4u; | |
3569 if ( a1.Create( | |
3570 v715.uYawAngle, | |
3571 v715.uPitchAngle, | |
3572 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3573 v3->uPlayerID + 1) != -1 | |
3574 && pParty->bTurnBasedModeOn == 1 ) | |
3575 ++pTurnEngine->field_1C; | |
3576 goto LABEL_83; | |
3577 case 1: | |
3578 LODWORD(v733) = 3600 * v2; | |
3579 v24 = v12 - 2; | |
3580 if ( v24 ) | |
3581 { | |
3582 v25 = v24 - 1; | |
3583 if ( v25 && v25 != 1 ) | |
3584 amount = 2; | |
3585 else | |
3586 amount = 4; | |
3587 } | |
3588 else | |
3589 { | |
3590 amount = 3; | |
3591 } | |
3592 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3593 goto LABEL_83; | |
3594 v668 = v1; | |
3595 v658 = v1; | |
3596 v653 = amount; | |
3597 v651 = v731; | |
3598 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); | |
3599 v27 = (char *)&pParty->pPartyBuffs[16]; | |
3600 goto LABEL_101; | |
3601 case 7: | |
3602 v29 = v12 - 2; | |
3603 if ( v29 ) | |
3604 { | |
3605 v30 = v29 - 1; | |
3606 if ( v30 ) | |
3607 { | |
3608 if ( v30 == 1 ) | |
3609 amount = 9; | |
3610 else | |
3611 amount = 3; | |
3612 } | |
3613 else | |
3614 { | |
3615 amount = 7; | |
3616 } | |
3617 } | |
3618 else | |
3619 { | |
3620 amount = 5; | |
3621 } | |
3622 v31 = v3->uPlayerID; | |
3623 HIDWORD(v733) = v1; | |
3624 v32 = 8 * v31; | |
3625 LOBYTE(v32) = v32 | 4; | |
3626 if ( (signed int)uNumLayingItems > v1 ) | |
3627 { | |
3628 v33 = (char *)&pLayingItems[0].field_48; | |
3629 v730 = uNumLayingItems; | |
3630 do | |
3631 { | |
3632 if ( *((short *)v33 - 36) != (short)v1 && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) | |
3633 ++HIDWORD(v733); | |
3634 v33 += 112; | |
3635 --v730; | |
3636 } | |
3637 while ( v730 ); | |
3638 } | |
3639 if ( SHIDWORD(v733) > amount ) | |
3640 goto LABEL_200; | |
3641 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3642 goto LABEL_83; | |
3643 a1.stru_24.Reset(); | |
3644 a1.field_48 = v3->spellnum; | |
3645 a1.field_4C = v2; | |
3646 a1.field_50 = v731; | |
3647 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3648 a1.vPosition.y = pParty->vPosition.y; | |
3649 a1.vPosition.x = pParty->vPosition.x; | |
3650 a1.uAttributes = v1; | |
3651 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3652 a1.uSectorID = pIndoor->GetSector( | |
3653 pParty->vPosition.x, | |
3654 pParty->vPosition.y, | |
3655 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3656 a1.uSpriteFrameID = v1; | |
3657 v34 = 8 * v3->uPlayerID; | |
303 | 3658 LOBYTE(v34) = v34 | OBJECT_Player; |
3659 a1.field_58_pid = v34; | |
0 | 3660 a1.field_5C = a2; |
3661 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3662 a1.uFacing = LOWORD(v715.uYawAngle); | |
3663 a1.uSoundID = LOWORD(v3->field_10); | |
3664 if ( pParty->bTurnBasedModeOn == 1 ) | |
3665 LOBYTE(a1.uAttributes) |= 4u; | |
3666 v669 = v3->uPlayerID + 1; | |
3667 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3668 v35 = pParty->sRotationX + 10; | |
3669 goto LABEL_124; | |
3670 case 20: | |
3671 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3672 goto LABEL_83; | |
3673 if ( a2 == v1 ) | |
3674 goto LABEL_200; | |
141 | 3675 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3676 goto LABEL_1056; |
3677 v699 = v1; | |
3678 v698 = v1; | |
3679 v697 = v1; | |
3680 a1.stru_24.Reset(); | |
3681 a1.field_48 = v3->spellnum; | |
3682 a1.field_4C = v2; | |
3683 a1.field_50 = v731; | |
3684 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3685 a1.uAttributes = v1; | |
3686 a1.uSectorID = v1; | |
3687 a1.uSpriteFrameID = v1; | |
3688 v37 = v3->uPlayerID; | |
3689 a1.field_60_distance_related_prolly_lod = 0; | |
3690 v37 *= 8; | |
303 | 3691 LOBYTE(v37) = v37 | OBJECT_Player; |
0 | 3692 a1.uFacing = v1; |
303 | 3693 a1.field_58_pid = v37; |
0 | 3694 v38 = a2 >> 3; |
3695 a1.uSoundID = LOWORD(v3->field_10); | |
3696 v39 = a2 >> 3; | |
3697 a1.vPosition.x = pActors[v39].vPosition.x; | |
3698 v40 = pActors[v39].vPosition.y; | |
3699 a1.vPosition.z = pActors[v39].vPosition.z; | |
3700 v41 = 8 * (a2 >> 3); | |
3701 a1.vPosition.y = v40; | |
3702 LOBYTE(v41) = v41 | 3; | |
3703 a1.field_5C = v41; | |
3704 v42 = a1.Create(0, v1, v1, v1); | |
3705 v43 = &v697; | |
3706 goto LABEL_133; | |
3707 case 44: | |
3708 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3709 goto LABEL_83; | |
3710 v726 = (Player *)(a2 >> 3); | |
3711 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3712 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3713 goto LABEL_1056; |
90 | 3714 pActors[a2 >> 3].pActorBuffs[10].Apply( |
0 | 3715 pMiscTimer->uTotalGameTimeElapsed + 128, |
3716 v1, | |
3717 v1, | |
3718 v1, | |
3719 v1); | |
3720 v706 = v1; | |
3721 v705 = v1; | |
3722 v704 = v1; | |
3723 a1.stru_24.Reset(); | |
3724 a1.field_48 = v3->spellnum; | |
3725 a1.field_4C = v2; | |
3726 a1.field_50 = v731; | |
3727 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3728 a1.uAttributes = v1; | |
3729 a1.uSectorID = v1; | |
3730 a1.uSpriteFrameID = v1; | |
3731 v44 = v3->uPlayerID; | |
3732 a1.field_60_distance_related_prolly_lod = 0; | |
3733 a1.uFacing = v1; | |
3734 v44 *= 8; | |
303 | 3735 LOBYTE(v44) = v44 | OBJECT_Player; |
0 | 3736 v38 = (signed int)v726; |
303 | 3737 a1.field_58_pid = v44; |
0 | 3738 a1.uSoundID = LOWORD(v3->field_10); |
3739 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3740 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3741 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3742 v46 = 8 * (int)v726; | |
3743 a1.vPosition.y = v45; | |
3744 LOBYTE(v46) = 8 * (char)v726 | 3; | |
3745 a1.field_5C = v46; | |
3746 v42 = a1.Create(0, v1, v1, v1); | |
3747 v43 = &v704; | |
3748 LABEL_133: | |
3749 v670 = (Vec3_int_ *)v43; | |
3750 v47 = v38; | |
3751 goto LABEL_139; | |
3752 case 79: | |
141 | 3753 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 3754 goto LABEL_83; |
3755 v730 = a2 >> 3; | |
3756 v693 = v1; | |
3757 HIDWORD(v733) = (int)&pActors[a2 >> 3]; | |
3758 v692 = v1; | |
3759 v691 = v1; | |
3760 a1.stru_24.Reset(); | |
3761 a1.field_48 = v3->spellnum; | |
3762 a1.field_4C = v2; | |
3763 a1.field_50 = v731; | |
3764 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3765 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | |
3766 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3767 v48 = *(short *)(HIDWORD(v733) + 138); | |
3768 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
3769 a1.uAttributes = v1; | |
3770 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); | |
3771 a1.uSpriteFrameID = v1; | |
3772 v49 = 8 * v3->uPlayerID; | |
303 | 3773 LOBYTE(v49) = v49 | OBJECT_Player; |
3774 a1.field_58_pid = v49; | |
0 | 3775 a1.field_5C = a2; |
3776 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3777 a1.uFacing = LOWORD(v715.uYawAngle); | |
3778 LOWORD(v49) = LOWORD(v3->field_10); | |
3779 LOBYTE(a1.uAttributes) |= 0x80u; | |
3780 a1.uSoundID = v49; | |
3781 v726 = (Player *)a1.Create(0, v1, v1, v1); | |
3782 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) | |
3783 goto LABEL_200; | |
3784 v47 = v730; | |
3785 v670 = (Vec3_int_ *)&v691; | |
3786 v42 = (signed int)v726; | |
3787 LABEL_139: | |
3788 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3789 goto LABEL_1056; | |
3790 case 2: | |
3791 case 6: | |
3792 case 11: | |
3793 case 18: | |
3794 case 26: | |
3795 case 32: | |
3796 case 34: | |
3797 case 37: | |
3798 case 57: | |
3799 case 65: | |
3800 case 70: | |
3801 case 78: | |
3802 case 97: | |
3803 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3804 goto LABEL_83; | |
3805 a1.stru_24.Reset(); | |
3806 a1.field_48 = v3->spellnum; | |
3807 a1.field_4C = v2; | |
3808 a1.field_50 = v731; | |
3809 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3810 a1.vPosition.y = pParty->vPosition.y; | |
3811 a1.vPosition.x = pParty->vPosition.x; | |
3812 a1.uAttributes = v1; | |
3813 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3814 a1.uSectorID = pIndoor->GetSector( | |
3815 pParty->vPosition.x, | |
3816 pParty->vPosition.y, | |
3817 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3818 a1.uSpriteFrameID = v1; | |
3819 v50 = 8 * v3->uPlayerID; | |
303 | 3820 LOBYTE(v50) = v50 | OBJECT_Player; |
3821 a1.field_58_pid = v50; | |
0 | 3822 a1.field_5C = a2; |
3823 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3824 a1.uFacing = LOWORD(v715.uYawAngle); | |
3825 a1.uSoundID = LOWORD(v3->field_10); | |
3826 if ( pParty->bTurnBasedModeOn == 1 ) | |
3827 LOBYTE(a1.uAttributes) |= 4u; | |
3828 if ( v3->spellnum == 18 ) | |
3829 LOBYTE(a1.uAttributes) |= 0x40u; | |
3830 goto LABEL_156; | |
3831 case 29: | |
3832 case 39: | |
3833 case 76: | |
3834 case 90: | |
3835 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3836 goto LABEL_83; | |
3837 a1.stru_24.Reset(); | |
3838 a1.field_48 = v3->spellnum; | |
3839 a1.field_4C = v2; | |
3840 a1.field_50 = v731; | |
3841 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3842 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3843 a1.vPosition.y = pParty->vPosition.y; | |
3844 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3845 v660 = pParty->vPosition.y; | |
3846 goto LABEL_153; | |
3847 case 87: | |
3848 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3849 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3850 goto LABEL_200; | |
3851 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3852 goto LABEL_152; | |
3853 goto LABEL_83; | |
3854 case 81: | |
3855 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3856 goto LABEL_83; | |
3857 if ( a2 == v1 | |
141 | 3858 || (a2 & 7) != OBJECT_Actor |
0 | 3859 || (v730 = a2 >> 3, |
3860 v721 = (int)&pActors[a2 >> 3], | |
3861 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3862 goto LABEL_1056; | |
3863 Actor::_403EB6(v730, 4u, 0x80u, (AIDirection *)v1); | |
3864 v726 = (Player *)(23040 * v2); | |
3865 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3866 v55 = v721; | |
3867 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, v1, v1, v1); | |
3868 *(char *)(v55 + 38) |= 8u; | |
3869 *(short *)(v55 + 148) = v1; | |
3870 v672 = v1; | |
3871 *(short *)(v55 + 150) = v1; | |
3872 v661 = (Actor *)v55; | |
3873 goto LABEL_165; | |
3874 case 35: | |
3875 if ( v12 == 2 ) | |
3876 { | |
3877 v57 = 300 * v2; | |
3878 } | |
3879 else | |
3880 { | |
3881 if ( v12 == 3 ) | |
3882 { | |
3883 amount = 4; | |
3884 v57 = 300 * v2; | |
3885 goto LABEL_174; | |
3886 } | |
3887 if ( v12 == 4 ) | |
3888 { | |
3889 v57 = 300 * v2; | |
3890 amount = 8; | |
3891 goto LABEL_174; | |
3892 } | |
3893 v57 = 180 * v2; | |
3894 } | |
3895 amount = 2; | |
3896 LABEL_174: | |
3897 LODWORD(v733) = v57; | |
3898 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3899 goto LABEL_83; | |
141 | 3900 if ( (a2 & 7) != OBJECT_Actor |
0 | 3901 || (v721 = 836 * (a2 >> 3), |
90 | 3902 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3903 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3904 goto LABEL_1056; |
3905 v726 = (Player *)(23040 * v2); | |
3906 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3907 v59 = v721; | |
112 | 3908 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3909 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3910 pParty->uTimePlayed + (signed int)v58, | |
0 | 3911 v731, |
3912 amount, | |
3913 v1, | |
3914 v1); | |
3915 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; | |
3916 v672 = v1; | |
3917 v661 = (Actor *)LODWORD(v718); | |
3918 goto LABEL_165; | |
3919 case 60: | |
3920 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3921 goto LABEL_83; | |
3922 v730 = 836 * (a2 >> 3); | |
90 | 3923 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3924 goto LABEL_1056; |
3925 LODWORD(v733) = 300 * v2; | |
3926 if ( v731 == 2 ) | |
3927 { | |
3928 LODWORD(v733) = 600 * v2; | |
3929 } | |
3930 else | |
3931 { | |
3932 if ( v731 == 3 ) | |
3933 LODWORD(v733) = 29030400; | |
3934 } | |
112 | 3935 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3936 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3937 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3938 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3939 v726 = (Player *)((int)v733 << 7); | |
3940 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3941 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3942 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
3943 v731, | |
3944 v1, | |
3945 v1, | |
3946 v1); | |
3947 a1.stru_24.Reset(); | |
3948 a1.field_48 = v3->spellnum; | |
3949 a1.field_4C = v2; | |
3950 a1.field_50 = v731; | |
3951 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 3952 v61 = a2 >> 3; |
0 | 3953 goto LABEL_1086; |
3954 case 92: | |
3955 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3956 goto LABEL_83; | |
3957 a1.stru_24.Reset(); | |
3958 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3959 a1.vPosition.x = pParty->vPosition.x; | |
3960 a1.vPosition.y = pParty->vPosition.y; | |
3961 a1.uAttributes = v1; | |
3962 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3963 a1.uSectorID = pIndoor->GetSector( | |
3964 pParty->vPosition.x, | |
3965 pParty->vPosition.y, | |
3966 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3967 a1.uSpriteFrameID = v1; | |
3968 v62 = 8 * v3->uPlayerID; | |
303 | 3969 LOBYTE(v62) = v62 | OBJECT_Player; |
3970 a1.field_58_pid = v62; | |
0 | 3971 a1.field_5C = a2; |
3972 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3973 a1.uFacing = LOWORD(v715.uYawAngle); | |
3974 a1.uSoundID = LOWORD(v3->field_10); | |
3975 a1.field_50 = v731; | |
3976 a1.field_48 = 3; | |
3977 a1.field_4C = 300 * v2; | |
3978 goto LABEL_154; | |
3979 case 4: | |
3980 v63 = v12 - 1; | |
3981 if ( !v63 ) | |
3982 { | |
3983 amount = 10; | |
3984 goto LABEL_195; | |
3985 } | |
3986 v64 = v63 - 1; | |
3987 if ( !v64 ) | |
3988 { | |
3989 amount = 11; | |
3990 goto LABEL_195; | |
3991 } | |
3992 v65 = v64 - 1; | |
3993 if ( !v65 ) | |
3994 { | |
3995 amount = 12; | |
3996 LABEL_195: | |
3997 LODWORD(v733) = 3600 * v2; | |
3998 goto LABEL_196; | |
3999 } | |
4000 if ( v65 == 1 ) | |
4001 { | |
4002 LODWORD(v733) = v1; | |
4003 amount = 12; | |
4004 } | |
4005 LABEL_196: | |
4006 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4007 goto LABEL_83; | |
89 | 4008 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
4009 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
4010 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
4011 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
4012 { | |
315 | 4013 if (!v730c->Broken()) |
0 | 4014 { |
377 | 4015 if ( v730c->uSpecEnchantmentType == v1 ) |
0 | 4016 { |
377 | 4017 if ( v730c->uEncantmentType == v1 ) |
0 | 4018 { |
4019 v68 = BYTE4(v726->pConditions[3]); | |
4020 if ( !v68 || v68 == 1 || v68 == 2 ) | |
4021 { | |
377 | 4022 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
0 | 4023 { |
89 | 4024 v69 = v730c; |
0 | 4025 v14 = v731 == 4; |
4026 *(int *)(v730 + 12) = amount; | |
4027 if ( !v14 ) | |
4028 { | |
4029 v726 = (Player *)((int)v733 << 7); | |
4030 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
4031 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
4032 * 0.033333335); | |
4033 *(int *)(v69 + 20) |= 8u; | |
4034 } | |
4035 *(int *)(v69 + 20) |= 0x10u; | |
4036 LABEL_1055: | |
4037 dword_50C9A8 = 256; | |
4038 LABEL_1056: | |
4039 LODWORD(v727) = 1; | |
4040 LABEL_83: | |
4041 if ( v3->field_8 & 0x20 ) | |
4042 { | |
4043 LABEL_1162: | |
4044 if ( v727 != 0.0 ) | |
4045 pAudioPlayer->PlaySound( | |
4046 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4047 0, | |
4048 0, | |
4049 -1, | |
4050 0, | |
4051 v3->field_10, | |
4052 0, | |
4053 0); | |
4054 } | |
4055 else | |
4056 { | |
4057 if ( sRecoveryTime < 0 ) | |
4058 sRecoveryTime = 0; | |
4059 if ( pParty->bTurnBasedModeOn ) | |
4060 { | |
4061 v645 = sRecoveryTime; | |
4062 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4063 pPlayer->SetRecoveryTime(v645); | |
4064 if ( !some_active_character ) | |
4065 pTurnEngine->_40471C(); | |
4066 } | |
4067 else | |
4068 { | |
4069 pPlayer->SetRecoveryTime( | |
4070 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4071 } | |
4072 if ( v727 != 0.0 ) | |
4073 { | |
187 | 4074 pPlayer->PlaySound(SPEECH_49, 0); |
0 | 4075 goto LABEL_1162; |
4076 } | |
4077 } | |
4078 v3->spellnum = 0; | |
4079 v1 = 0; | |
4080 LABEL_1165: | |
4081 v2 = v723; | |
4082 goto LABEL_1166; | |
4083 } | |
4084 } | |
4085 } | |
4086 } | |
4087 } | |
4088 } | |
4089 LABEL_199: | |
4090 dword_50C9D0 = 113; | |
4091 dword_50C9D4 = v1; | |
4092 dword_50C9D8 = 1; | |
4093 LABEL_200: | |
4094 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4095 LABEL_201: | |
4096 v67 = 2; | |
4097 LABEL_202: | |
4098 ShowStatusBarString(v66, v67); | |
4099 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4100 goto LABEL_203; | |
4101 case 71: | |
4102 v70 = v12 - 1; | |
4103 LODWORD(v733) = 3600 * v2; | |
4104 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4105 { | |
4106 v72 = v71 - 1; | |
4107 if ( v72 ) | |
4108 { | |
4109 if ( v72 == 1 ) | |
4110 amount = 10; | |
4111 } | |
4112 else | |
4113 { | |
4114 amount = 3; | |
4115 } | |
4116 } | |
4117 else | |
4118 { | |
4119 amount = 1; | |
4120 } | |
4121 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4122 goto LABEL_83; | |
4123 v73 = v3->uPlayerID_2; | |
4124 v74 = v3->spellnum; | |
4125 v75 = pGame->GetStru6(); | |
4126 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); | |
4127 v668 = v1; | |
4128 v658 = v1; | |
4129 v653 = amount; | |
4130 v651 = v731; | |
4131 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); | |
4132 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; | |
4133 goto LABEL_103; | |
4134 case 3: | |
4135 case 14: | |
4136 case 25: | |
4137 case 36: | |
4138 case 58: | |
4139 case 69: | |
4140 v76 = v12 - 1; | |
4141 LODWORD(v733) = 3600 * v2; | |
4142 if ( v76 ) | |
4143 { | |
4144 v77 = v76 - 1; | |
4145 if ( v77 ) | |
4146 { | |
4147 v78 = v77 - 1; | |
4148 if ( v78 ) | |
4149 { | |
4150 if ( v78 != 1 ) | |
4151 goto LABEL_232; | |
4152 v79 = 4 * v2; | |
4153 } | |
4154 else | |
4155 { | |
4156 v79 = 3 * v2; | |
4157 } | |
4158 } | |
4159 else | |
4160 { | |
4161 v79 = 2 * v2; | |
4162 } | |
4163 amount = v79; | |
4164 } | |
4165 else | |
4166 { | |
4167 amount = v2; | |
4168 } | |
4169 LABEL_232: | |
4170 v80 = v3->spellnum; | |
4171 switch ( v80 ) | |
4172 { | |
4173 case 3: | |
4174 LODWORD(v725) = 6; | |
4175 break; | |
4176 case 14: | |
4177 LODWORD(v725) = v1; | |
4178 break; | |
4179 case 25: | |
4180 LODWORD(v725) = 17; | |
4181 break; | |
4182 case 36: | |
4183 LODWORD(v725) = 4; | |
4184 break; | |
4185 case 58: | |
4186 LODWORD(v725) = 12; | |
4187 break; | |
4188 default: | |
4189 if ( v80 != 69 ) | |
4190 goto LABEL_1166; | |
4191 LODWORD(v725) = 1; | |
4192 break; | |
4193 } | |
4194 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4195 goto LABEL_83; | |
4196 v81 = v3->spellnum; | |
4197 v82 = pGame->GetStru6(); | |
4198 pGame->GetStru6()->SetPlayerBuffAnim(v81, v1); | |
4199 v83 = 1; | |
4200 v84 = v3->spellnum; | |
4201 v85 = pGame->GetStru6(); | |
4202 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1u); | |
4203 v86 = v3->spellnum; | |
4204 v87 = pGame->GetStru6(); | |
4205 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2u); | |
4206 v88 = v3->spellnum; | |
4207 v89 = pGame->GetStru6(); | |
4208 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3u); | |
4209 v90 = (double)(signed int)v733 * 4.2666669; | |
4210 goto LABEL_304; | |
4211 case 5: | |
4212 if ( v12 <= v1 ) | |
4213 goto LABEL_254; | |
4214 if ( v12 <= 2 ) | |
4215 { | |
4216 v91 = 60 * (v2 + 60); | |
4217 } | |
4218 else | |
4219 { | |
4220 if ( v12 == 3 ) | |
4221 { | |
4222 v91 = 180 * (v2 + 20); | |
4223 } | |
4224 else | |
4225 { | |
4226 if ( v12 != 4 ) | |
4227 goto LABEL_254; | |
4228 v91 = 240 * (v2 + 15); | |
4229 } | |
4230 } | |
4231 LODWORD(v733) = v91; | |
4232 LABEL_254: | |
4233 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4234 { | |
89 | 4235 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4236 LODWORD(v727) = 1; |
4237 do | |
4238 { | |
89 | 4239 if ( v92->pConditions ) |
0 | 4240 LODWORD(v727) = v1; |
89 | 4241 ++v92; |
0 | 4242 } |
89 | 4243 while ( v92 <= &pParty->pPlayers[3] ); |
0 | 4244 if ( LODWORD(v727) != v1 ) |
4245 { | |
4246 v726 = (Player *)((int)v733 << 7); | |
4247 pParty->pPartyBuffs[8].Apply( | |
4248 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
4249 v731, | |
4250 v1, | |
4251 v1, | |
4252 v1); | |
4253 v93 = v3->spellnum; | |
4254 v94 = pGame->GetStru6(); | |
4255 pGame->GetStru6()->SetPlayerBuffAnim(v93, v1); | |
4256 v95 = v3->spellnum; | |
4257 v96 = pGame->GetStru6(); | |
4258 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1u); | |
4259 v97 = v3->spellnum; | |
4260 v98 = pGame->GetStru6(); | |
4261 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2u); | |
4262 v99 = v3->spellnum; | |
4263 v100 = pGame->GetStru6(); | |
4264 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3u); | |
4265 } | |
4266 } | |
4267 goto LABEL_83; | |
4268 case 46: | |
4269 v101 = v12 - 1; | |
4270 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4271 { | |
4272 v103 = v102 - 1; | |
4273 if ( v103 ) | |
4274 { | |
4275 if ( v103 != 1 ) | |
4276 goto LABEL_269; | |
4277 v104 = 3600 * (v2 + 1); | |
4278 } | |
4279 else | |
4280 { | |
4281 v104 = 900 * (v2 + 4); | |
4282 } | |
4283 } | |
4284 else | |
4285 { | |
4286 v104 = 300 * (v2 + 12); | |
4287 } | |
4288 LODWORD(v733) = v104; | |
4289 LABEL_269: | |
4290 amount = v2 + 5; | |
4291 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4292 goto LABEL_83; | |
4293 if ( v731 == 1 ) | |
4294 { | |
4295 v108 = v3->uPlayerID_2; | |
4296 v109 = v3->spellnum; | |
4297 v110 = pGame->GetStru6(); | |
4298 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
4299 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, v1, 65536); | |
4300 v668 = v1; | |
4301 v716 = v111; | |
4302 v658 = v111; | |
4303 v653 = amount; | |
4304 v726 = (Player *)((int)v733 << 7); | |
4305 v651 = 1; | |
4306 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4307 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[1]; | |
4308 goto LABEL_103; | |
4309 } | |
4310 v105 = 0; | |
4311 v726 = (Player *)((int)v733 << 7); | |
4312 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4313 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4314 do |
4315 { | |
4316 v106 = v3->spellnum; | |
4317 v107 = pGame->GetStru6(); | |
4318 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); | |
4319 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, v1, 65536); | |
89 | 4320 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
4321 ++v730b; | |
0 | 4322 ++v105; |
4323 } | |
89 | 4324 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4325 goto LABEL_1056; |
4326 case 52: | |
141 | 4327 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == OBJECT_Actor) |
0 | 4328 { |
4329 v730 = a2 >> 3; | |
4330 v112 = &pActors[a2 >> 3]; | |
4331 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4332 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4333 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4334 _this = (ItemGen *)v113; | |
4335 v114 = v721; | |
4336 v115 = (unsigned int)v726; | |
4337 if ( v113 < v721 ) | |
4338 { | |
4339 v116 = v113; | |
4340 v113 = v721; | |
4341 v114 = v116; | |
4342 } | |
4343 if ( v113 < (signed int)v726 ) | |
4344 { | |
4345 v117 = v113; | |
4346 v113 = (int)v726; | |
4347 v115 = v117; | |
4348 } | |
4349 if ( v114 < (signed int)v115 ) | |
4350 { | |
4351 v118 = v115; | |
4352 v115 = v114; | |
4353 v114 = v118; | |
4354 } | |
4355 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4356 if ( (double)(signed int)this <= 307.2 ) | |
4357 { | |
4358 v703 = 0; | |
4359 v702 = 0; | |
4360 v701 = 0; | |
4361 a1.stru_24.Reset(); | |
4362 v119 = HIDWORD(v733); | |
4363 a1.field_48 = *(int *)HIDWORD(v733); | |
4364 a1.field_4C = v723; | |
4365 a1.field_50 = v731; | |
4366 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4367 a1.uAttributes = 0; | |
4368 a1.uSectorID = 0; | |
4369 a1.uSpriteFrameID = 0; | |
4370 v120 = 8 * *(short *)(v119 + 2); | |
303 | 4371 LOBYTE(v120) = v120 | OBJECT_Player; |
0 | 4372 a1.field_60_distance_related_prolly_lod = 0; |
303 | 4373 a1.field_58_pid = v120; |
0 | 4374 a1.uFacing = 0; |
4375 a1.uSoundID = *(short *)(v119 + 16); | |
4376 a1.vPosition.x = v112->vPosition.x; | |
4377 a1.vPosition.y = v112->vPosition.y; | |
4378 v726 = (Player *)v112->uActorHeight; | |
4379 v121 = 8 * a2; | |
4380 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4381 LOBYTE(v121) = 8 * a2 | 3; | |
4382 a1.field_5C = v121; | |
4383 v122 = a1.Create(0, 0, 0, 0); | |
4384 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4385 LODWORD(v727) = 1; | |
4386 } | |
4387 else | |
4388 { | |
4389 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4390 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4391 *(int *)HIDWORD(v733) = 0; | |
4392 } | |
4393 v3 = (stru277 *)HIDWORD(v733); | |
4394 } | |
4395 goto LABEL_83; | |
4396 case 17: | |
4397 case 38: | |
4398 case 51: | |
4399 v123 = v12 - 1; | |
4400 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4401 { | |
4402 v125 = v124 - 1; | |
4403 if ( v125 ) | |
4404 { | |
4405 if ( v125 != 1 ) | |
4406 goto LABEL_296; | |
4407 v126 = 3600 * (v2 + 1); | |
4408 } | |
4409 else | |
4410 { | |
4411 v126 = 900 * (v2 + 4); | |
4412 } | |
4413 } | |
4414 else | |
4415 { | |
4416 v126 = 300 * (v2 + 12); | |
4417 } | |
4418 LODWORD(v733) = v126; | |
4419 LABEL_296: | |
4420 v127 = v3->spellnum; | |
4421 if ( v127 == 17 ) | |
4422 { | |
4423 amount = v1; | |
4424 LODWORD(v725) = 14; | |
4425 } | |
4426 else | |
4427 { | |
4428 if ( v127 == 38 ) | |
4429 { | |
4430 LODWORD(v725) = 15; | |
4431 amount = v2 + 5; | |
4432 } | |
4433 else | |
4434 { | |
4435 if ( v127 != 51 ) | |
4436 goto LABEL_1166; | |
4437 LODWORD(v725) = 9; | |
4438 amount = v2 + 5; | |
4439 } | |
4440 } | |
4441 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4442 goto LABEL_83; | |
4443 v128 = v3->spellnum; | |
4444 v129 = pGame->GetStru6(); | |
4445 pGame->GetStru6()->SetPlayerBuffAnim(v128, v1); | |
4446 v83 = 1; | |
4447 v130 = v3->spellnum; | |
4448 v131 = pGame->GetStru6(); | |
4449 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1u); | |
4450 v132 = v3->spellnum; | |
4451 v133 = pGame->GetStru6(); | |
4452 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2u); | |
4453 v134 = v3->spellnum; | |
4454 v135 = pGame->GetStru6(); | |
4455 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3u); | |
4456 v726 = (Player *)((int)v733 << 7); | |
4457 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
4458 LABEL_304: | |
4459 v673 = v1; | |
4460 v662 = v1; | |
4461 v655 = amount; | |
4462 v652 = v731; | |
4463 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; | |
4464 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; | |
4465 goto LABEL_977; | |
4466 case 8: | |
4467 v138 = v12 - 2; | |
4468 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4469 v140 = 600 * v2; | |
4470 else | |
4471 v140 = 60 * v2; | |
4472 LODWORD(v733) = v140; | |
4473 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4474 goto LABEL_83; | |
4475 v141 = v3->spellnum; | |
4476 v142 = pGame->GetStru6(); | |
4477 pGame->GetStru6()->SetPlayerBuffAnim(v141, v1); | |
4478 v143 = v3->spellnum; | |
4479 v144 = pGame->GetStru6(); | |
4480 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1u); | |
4481 v145 = v3->spellnum; | |
4482 v146 = pGame->GetStru6(); | |
4483 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2u); | |
4484 v147 = v3->spellnum; | |
4485 v148 = pGame->GetStru6(); | |
4486 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3u); | |
4487 v668 = v1; | |
4488 v726 = (Player *)((int)v733 << 7); | |
4489 v658 = v1; | |
4490 v653 = v2; | |
4491 v651 = v731; | |
4492 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4493 v27 = (char *)&pParty->pPartyBuffs[10]; | |
4494 goto LABEL_102; | |
4495 case 9: | |
4496 v149 = v12 - 1; | |
4497 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4498 { | |
4499 if ( v151 == 1 ) | |
4500 _this = (ItemGen *)20; | |
4501 } | |
4502 else | |
4503 { | |
4504 _this = (ItemGen *)16; | |
4505 } | |
4506 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4507 { | |
4508 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4509 goto LABEL_201; | |
4510 } | |
4511 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4512 goto LABEL_83; | |
4513 LODWORD(v725) = a2 & 7; | |
141 | 4514 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4515 { |
4516 v152 = a2 >> 3; | |
4517 uRequiredMana = pActors[v152].vPosition.x; | |
4518 v153 = pActors[v152].vPosition.y; | |
4519 v154 = pActors[v152].vPosition.z; | |
4520 LODWORD(v727) = v153; | |
4521 } | |
4522 else | |
4523 { | |
323 | 4524 v155 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4525 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); |
323 | 4526 v156 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4527 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); |
4528 v154 = pParty->vPosition.z; | |
4529 } | |
4530 HIDWORD(v733) = v154; | |
4531 v713 = v154 + 2500; | |
4532 v721 = v1; | |
4533 LODWORD(v718) = v1; | |
4534 if ( (signed int)this > v1 ) | |
4535 { | |
4536 *(float *)&y = (double)SHIDWORD(v733); | |
4537 *(float *)&v732 = (double)v713; | |
4538 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4539 v726 = (Player *)this; | |
4540 do | |
4541 { | |
4542 v157 = rand(); | |
4543 v158 = (double)SLODWORD(v718); | |
4544 v718 = v158; | |
4545 v159 = (double)v721; | |
4546 *(float *)&v721 = v159; | |
4547 a2 = v157 % 1000; | |
4548 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4549 v725 = v159 * v159; | |
4550 *(float *)&_this = v158 * v158; | |
4551 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4552 { | |
4553 LODWORD(v687) = v1; | |
4554 HIDWORD(v687) = v1; | |
4555 } | |
4556 else | |
4557 { | |
4558 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4559 v687 = __PAIR__( | |
4560 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4561 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4562 } | |
4563 a1.stru_24.Reset(); | |
4564 a1.field_48 = v3->spellnum; | |
4565 a1.field_4C = v2; | |
4566 a1.field_50 = v731; | |
4567 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4568 a1.uAttributes = v1; | |
4569 a1.vPosition.x = uRequiredMana; | |
4570 a1.vPosition.y = LODWORD(v727); | |
4571 a1.uSectorID = v1; | |
4572 a1.vPosition.z = a2 + v713; | |
4573 a1.uSpriteFrameID = v1; | |
303 | 4574 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4575 a1.field_5C = v730; |
4576 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4577 a1.uFacing = v687; | |
4578 a1.uSoundID = LOWORD(v3->field_10); | |
4579 if ( pParty->bTurnBasedModeOn == 1 ) | |
4580 a1.uAttributes = 4; | |
4581 if ( a1.Create( | |
4582 v687, | |
4583 SHIDWORD(v687), | |
4584 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4585 v1) != -1 | |
4586 && pParty->bTurnBasedModeOn == 1 ) | |
4587 ++pTurnEngine->field_1C; | |
4588 LODWORD(v718) = rand() % 1024 - 512; | |
4589 v160 = rand(); | |
4590 v14 = v726 == (Player *)1; | |
4591 v726 = (Player *)((char *)v726 - 1); | |
4592 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4593 } | |
4594 while ( !v14 ); | |
4595 } | |
4596 goto LABEL_1056; | |
4597 case 10: | |
4598 v67 = 2; | |
4599 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4600 { | |
4601 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4602 goto LABEL_202; | |
4603 } | |
4604 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4605 goto LABEL_83; | |
4606 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
4607 v700.z = v1; | |
4608 v700.y = v1; | |
4609 v700.x = v1; | |
4610 a1.stru_24.Reset(); | |
4611 a1.field_48 = v3->spellnum; | |
4612 a1.field_4C = v2; | |
4613 a1.field_50 = v731; | |
4614 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4615 a1.uAttributes = v1; | |
4616 a1.uSectorID = v1; | |
4617 a1.uSpriteFrameID = v1; | |
4618 v161 = v3->uPlayerID; | |
4619 a1.field_60_distance_related_prolly_lod = 0; | |
4620 a1.uFacing = v1; | |
4621 v161 *= 8; | |
303 | 4622 LOBYTE(v161) = v161 | OBJECT_Player; |
4623 a1.field_58_pid = v161; | |
0 | 4624 a1.uSoundID = LOWORD(v3->field_10); |
4625 a2 = v1; | |
4626 if ( (signed int)v726 > v1 ) | |
4627 { | |
4628 do | |
4629 { | |
4630 v162 = dword_50BF30[a2]; | |
4631 a1.vPosition.x = pActors[v162].vPosition.x; | |
4632 a1.vPosition.y = pActors[v162].vPosition.y; | |
4633 v732 = pActors[v162].uActorHeight; | |
4634 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4635 v163 = 8 * dword_50BF30[a2]; | |
4636 LOBYTE(v163) = v163 | 3; | |
4637 a1.field_5C = v163; | |
4638 v164 = a1.Create(0, v1, v1, v1); | |
4639 v165 = a2; | |
4640 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
4641 v166 = pGame->GetStru6(); | |
4642 v166->_4A81CA(&a1); | |
4643 v167 = pGame->GetStru6(); | |
4644 v167->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
4645 a2 = v165 + 1; | |
4646 } | |
4647 while ( v165 + 1 < (signed int)v726 ); | |
4648 } | |
4649 goto LABEL_1056; | |
4650 case 12: | |
4651 LODWORD(v733) = 3600 * v2; | |
4652 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4653 goto LABEL_83; | |
4654 v168 = 0; | |
4655 do | |
4656 { | |
4657 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, v1, 65536); | |
4658 v716 = v169; | |
4659 } | |
4660 while ( v168 < 4 ); | |
4661 v668 = v1; | |
4662 v732 = (int)v733 << 7; | |
4663 v658 = v1; | |
4664 v653 = v1; | |
4665 v651 = v731; | |
4666 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4667 goto LABEL_992; | |
4668 case 13: | |
4669 v170 = v12 - 1; | |
4670 if ( !v170 ) | |
4671 { | |
4672 v173 = 300 * v2; | |
4673 goto LABEL_353; | |
4674 } | |
4675 v171 = v170 - 1; | |
4676 if ( !v171 ) | |
4677 { | |
4678 v173 = 600 * v2; | |
4679 goto LABEL_353; | |
4680 } | |
4681 v172 = v171 - 1; | |
4682 if ( !v172 || v172 == 1 ) | |
4683 { | |
4684 v173 = 3600 * v2; | |
4685 LABEL_353: | |
4686 LODWORD(v733) = v173; | |
4687 } | |
4688 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4689 goto LABEL_83; | |
4690 v174 = 0; | |
4691 do | |
4692 pOtherOverlayList->_4418B1(2010, v174++ + 100, v1, 65536); | |
4693 while ( v174 < 4 ); | |
4694 v175 = v3->spellnum; | |
4695 v176 = pGame->GetStru6(); | |
4696 pGame->GetStru6()->SetPlayerBuffAnim(v175, v1); | |
4697 v83 = 1; | |
4698 v177 = v3->spellnum; | |
4699 v178 = pGame->GetStru6(); | |
4700 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1u); | |
4701 v179 = v3->spellnum; | |
4702 v180 = pGame->GetStru6(); | |
4703 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2u); | |
4704 v181 = v3->spellnum; | |
4705 v182 = pGame->GetStru6(); | |
4706 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3u); | |
4707 v673 = v1; | |
4708 v732 = (int)v733 << 7; | |
4709 v662 = v1; | |
4710 v655 = v1; | |
4711 v652 = v731; | |
4712 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4713 v137 = (char *)&pParty->pPartyBuffs[5]; | |
4714 goto LABEL_976; | |
4715 case 15: | |
4716 v184 = v12 - 1; | |
4717 if ( v184 ) | |
4718 { | |
4719 v185 = v184 - 1; | |
4720 if ( v185 ) | |
4721 { | |
4722 v186 = v185 - 1; | |
4723 if ( v186 ) | |
4724 { | |
4725 if ( v186 == 1 ) | |
4726 amount = 9; | |
4727 } | |
4728 else | |
4729 { | |
4730 amount = 7; | |
4731 } | |
4732 } | |
4733 else | |
4734 { | |
4735 amount = 5; | |
4736 } | |
4737 } | |
4738 else | |
4739 { | |
4740 amount = 3; | |
4741 } | |
4742 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4743 goto LABEL_83; | |
4744 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
4745 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4746 a1.stru_24.Reset(); | |
4747 a1.field_48 = v3->spellnum; | |
4748 a1.field_4C = v2; | |
4749 a1.field_50 = v731; | |
4750 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4751 a1.vPosition.y = pParty->vPosition.y; | |
4752 a1.vPosition.x = pParty->vPosition.x; | |
4753 a1.uAttributes = v1; | |
4754 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4755 a1.uSectorID = pIndoor->GetSector( | |
4756 pParty->vPosition.x, | |
4757 pParty->vPosition.y, | |
4758 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
4759 a1.uSpriteFrameID = v1; | |
4760 v187 = 8 * v3->uPlayerID; | |
303 | 4761 LOBYTE(v187) = v187 | OBJECT_Player; |
4762 a1.field_58_pid = v187; | |
0 | 4763 a1.field_5C = a2; |
4764 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4765 a1.uSoundID = LOWORD(v3->field_10); | |
4766 if ( pParty->bTurnBasedModeOn == 1 ) | |
4767 LOBYTE(a1.uAttributes) |= 4u; | |
4768 v188 = (signed int)v726 / -2; | |
4769 v189 = (signed int)v726 / 2; | |
4770 while ( v188 <= v189 ) | |
4771 { | |
4772 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4773 if ( a1.Create( | |
4774 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4775 v715.uPitchAngle, | |
4776 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4777 v3->uPlayerID + 1) != -1 | |
4778 && pParty->bTurnBasedModeOn == 1 ) | |
4779 ++pTurnEngine->field_1C; | |
4780 v188 += v732; | |
4781 } | |
4782 goto LABEL_1056; | |
4783 case 16: | |
4784 if ( pParty->uFlags & 8 ) | |
4785 { | |
4786 v190 = pGlobalTXT_LocalizationStrings[493]; | |
4787 goto LABEL_462; | |
4788 } | |
4789 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4790 goto LABEL_83; | |
4791 v191 = 0; | |
4792 do | |
4793 pOtherOverlayList->_4418B1(2040, v191++ + 100, v1, 65536); | |
4794 while ( v191 < 4 ); | |
4795 BYTE1(pParty->uFlags) |= 1u; | |
4796 pParty->uFallSpeed = 1000; | |
4797 goto LABEL_1056; | |
4798 case 19: | |
4799 v192 = v12 - 1; | |
4800 if ( !v192 ) | |
4801 { | |
4802 amount = v2; | |
4803 goto LABEL_391; | |
4804 } | |
4805 v193 = v192 - 1; | |
4806 if ( !v193 ) | |
4807 { | |
4808 v196 = 2 * v2; | |
4809 LABEL_389: | |
4810 amount = v196; | |
4811 LABEL_391: | |
4812 v195 = 600 * v2; | |
4813 goto LABEL_392; | |
4814 } | |
4815 v194 = v193 - 1; | |
4816 if ( !v194 ) | |
4817 { | |
4818 v196 = 3 * v2; | |
4819 goto LABEL_389; | |
4820 } | |
4821 if ( v194 != 1 ) | |
4822 goto LABEL_393; | |
4823 amount = 4 * v2; | |
4824 v195 = 3600 * v2; | |
4825 LABEL_392: | |
4826 LODWORD(v733) = v195; | |
4827 LABEL_393: | |
4828 if ( pParty->uFlags & 0x30 ) | |
4829 { | |
4830 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4831 goto LABEL_201; | |
4832 } | |
4833 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4834 { | |
4835 v197 = v3->spellnum; | |
4836 v198 = pGame->GetStru6(); | |
4837 pGame->GetStru6()->SetPlayerBuffAnim(v197, v1); | |
4838 v83 = 1; | |
4839 v199 = v3->spellnum; | |
4840 v200 = pGame->GetStru6(); | |
4841 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1u); | |
4842 v201 = v3->spellnum; | |
4843 v202 = pGame->GetStru6(); | |
4844 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2u); | |
4845 v203 = v3->spellnum; | |
4846 v204 = pGame->GetStru6(); | |
4847 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3u); | |
4848 v673 = v1; | |
4849 v732 = (int)v733 << 7; | |
4850 v662 = v1; | |
4851 v655 = amount; | |
4852 v652 = v731; | |
4853 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4854 v137 = (char *)&pParty->pPartyBuffs[11]; | |
4855 LABEL_976: | |
4856 v136 = pParty->uTimePlayed + v183; | |
4857 LABEL_977: | |
4858 ((SpellBuff *)v137)->Apply(v136, v652, v655, v662, v673); | |
4859 LABEL_978: | |
4860 LODWORD(v727) = v83; | |
4861 } | |
4862 goto LABEL_83; | |
4863 case 21: | |
4864 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4865 { | |
4866 v190 = pGlobalTXT_LocalizationStrings[494]; | |
4867 LABEL_462: | |
4868 ShowStatusBarString(v190, 2u); | |
4869 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4870 goto LABEL_83; | |
4871 } | |
4872 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4873 { | |
4874 LABEL_461: | |
4875 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4876 goto LABEL_462; | |
4877 } | |
4878 LODWORD(v733) = 3600 * v2; | |
4879 if ( v731 == 2 || v731 == 3 || (amount = v1, v731 != 4) ) | |
4880 amount = 1; | |
4881 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4882 goto LABEL_83; | |
4883 v205 = 0; | |
4884 do | |
4885 pOtherOverlayList->_4418B1(2090, v205++ + 100, v1, 65536); | |
4886 while ( v205 < 4 ); | |
4887 v206 = pOtherOverlayList->_4418B1(10008, 203, v1, 65536); | |
4888 v207 = v3->uPlayerID + 1; | |
4889 v716 = v206; | |
4890 v668 = v207; | |
4891 v658 = v206; | |
4892 v653 = amount; | |
4893 v732 = (int)v733 << 7; | |
4894 v651 = v731; | |
4895 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4896 v27 = (char *)&pParty->pPartyBuffs[7]; | |
4897 LABEL_101: | |
4898 v26 = (signed int)v26; | |
4899 LABEL_102: | |
4900 v28 = pParty->uTimePlayed + v26; | |
4901 LABEL_103: | |
4902 HIDWORD(v650) = HIDWORD(v28); | |
4903 LABEL_104: | |
4904 LODWORD(v650) = v28; | |
4905 ((SpellBuff *)v27)->Apply(v650, v651, v653, v658, v668); | |
4906 goto LABEL_1056; | |
4907 case 22: | |
4908 v67 = 2; | |
4909 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4910 { | |
4911 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4912 goto LABEL_202; | |
4913 } | |
4914 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4915 goto LABEL_83; | |
4916 v208 = a2 & 7; | |
4917 LODWORD(v725) = a2 & 7; | |
4918 if ( v208 == 3 ) | |
4919 { | |
4920 v209 = a2 >> 3; | |
4921 LODWORD(v718) = pActors[v209].vPosition.x; | |
4922 v210 = pActors[v209].vPosition.y; | |
4923 v211 = pActors[v209].vPosition.z; | |
4924 v713 = v210; | |
4925 } | |
4926 else | |
4927 { | |
323 | 4928 v212 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4929 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); |
323 | 4930 v213 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4931 v214 = sub_42EBBE(2048, v213); |
4932 v211 = pParty->vPosition.z; | |
4933 v713 = pParty->vPosition.y + v214; | |
4934 v208 = LODWORD(v725); | |
4935 } | |
4936 v726 = (Player *)v211; | |
4937 HIDWORD(v733) = v1; | |
4938 *(float *)&v732 = (double)v211; | |
4939 LODWORD(v725) = v211 + 2500; | |
4940 v721 = v1; | |
4941 *(float *)&y = (double)(v211 + 2500); | |
4942 v730 = v208 == 3 ? a2 : 0; | |
4943 a2 = 20; | |
4944 do | |
4945 { | |
4946 v215 = rand(); | |
4947 v216 = (double)v721; | |
4948 v727 = v216; | |
4949 v217 = (double)SHIDWORD(v733); | |
4950 *(float *)&uRequiredMana = v217; | |
4951 _this = (ItemGen *)(v215 % 1000); | |
4952 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4953 *(float *)&v721 = v217 * v217; | |
4954 *(float *)&v726 = v216 * v216; | |
4955 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4956 { | |
4957 LODWORD(v685) = v1; | |
4958 HIDWORD(v685) = v1; | |
4959 } | |
4960 else | |
4961 { | |
4962 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4963 v685 = __PAIR__( | |
4964 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4965 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4966 } | |
4967 a1.stru_24.Reset(); | |
4968 a1.field_48 = v3->spellnum; | |
4969 a1.field_4C = v2; | |
4970 a1.field_50 = v731; | |
4971 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4972 a1.uAttributes = v1; | |
4973 a1.vPosition.x = LODWORD(v718); | |
4974 a1.vPosition.y = v713; | |
4975 a1.uSectorID = v1; | |
4976 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); | |
4977 a1.uSpriteFrameID = v1; | |
303 | 4978 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4979 a1.field_5C = v730; |
4980 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4981 a1.uFacing = v685; | |
4982 a1.uSoundID = LOWORD(v3->field_10); | |
4983 if ( pParty->bTurnBasedModeOn == 1 ) | |
4984 a1.uAttributes = 4; | |
4985 if ( a1.Create( | |
4986 v685, | |
4987 SHIDWORD(v685), | |
4988 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4989 v1) != -1 | |
4990 && pParty->bTurnBasedModeOn == 1 ) | |
4991 ++pTurnEngine->field_1C; | |
4992 v721 = rand() % 1024 - 512; | |
4993 v218 = rand(); | |
4994 v14 = a2-- == 1; | |
4995 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4996 } | |
4997 while ( !v14 ); | |
4998 goto LABEL_1056; | |
4999 case 23: | |
5000 v219 = v12 - 2; | |
5001 if ( v219 ) | |
5002 { | |
5003 v220 = v219 - 1; | |
5004 if ( v220 ) | |
5005 { | |
5006 if ( v220 == 1 ) | |
5007 { | |
5008 amount = v1; | |
5009 goto LABEL_433; | |
5010 } | |
5011 v221 = 180 * v2; | |
5012 } | |
5013 else | |
5014 { | |
5015 v221 = 86400 * v2; | |
5016 } | |
5017 } | |
5018 else | |
5019 { | |
5020 v221 = 3600 * v2; | |
5021 } | |
5022 amount = v221; | |
5023 LABEL_433: | |
5024 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5025 goto LABEL_83; | |
5026 v222 = (char *)pParty->pPlayers; | |
5027 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
5028 break; | |
5029 case 24: | |
5030 v224 = v12 - 2; | |
5031 if ( v224 ) | |
5032 { | |
5033 v225 = v224 - 1; | |
5034 if ( v225 ) | |
5035 { | |
5036 if ( v225 == 1 ) | |
5037 amount = 7; | |
5038 else | |
5039 amount = 1; | |
5040 } | |
5041 else | |
5042 { | |
5043 amount = 5; | |
5044 } | |
5045 } | |
5046 else | |
5047 { | |
5048 amount = 3; | |
5049 } | |
5050 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5051 goto LABEL_83; | |
5052 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
5053 if ( amount == 1 ) | |
5054 { | |
5055 LABEL_152: | |
5056 a1.stru_24.Reset(); | |
5057 a1.field_48 = v3->spellnum; | |
5058 a1.field_50 = v731; | |
5059 a1.field_4C = v2; | |
5060 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5061 a1.vPosition.y = pParty->vPosition.y; | |
5062 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5063 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5064 v660 = pParty->vPosition.y; | |
5065 LABEL_153: | |
5066 a1.uAttributes = v1; | |
5067 a1.vPosition.x = pParty->vPosition.x; | |
5068 a1.vPosition.z = v51; | |
5069 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
5070 a1.uSpriteFrameID = v1; | |
5071 a1.uSectorID = v52; | |
5072 v53 = 8 * v3->uPlayerID; | |
303 | 5073 LOBYTE(v53) = v53 | OBJECT_Player; |
5074 a1.field_58_pid = v53; | |
0 | 5075 a1.field_5C = a2; |
5076 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5077 a1.uFacing = LOWORD(v715.uYawAngle); | |
5078 a1.uSoundID = LOWORD(v3->field_10); | |
5079 LABEL_154: | |
5080 if ( pParty->bTurnBasedModeOn == 1 ) | |
5081 LOBYTE(a1.uAttributes) |= 4u; | |
5082 LABEL_156: | |
5083 v669 = v3->uPlayerID + 1; | |
5084 v36 = v715.uYawAngle; | |
5085 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5086 v654 = v715.uPitchAngle; | |
5087 LABEL_157: | |
5088 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
5089 ++pTurnEngine->field_1C; | |
5090 } | |
5091 else | |
5092 { | |
5093 v732 = SHIDWORD(v733) / (amount - 1); | |
5094 a1.stru_24.Reset(); | |
5095 a1.field_48 = v3->spellnum; | |
5096 a1.field_4C = v2; | |
5097 a1.field_50 = v731; | |
5098 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5099 a1.vPosition.y = pParty->vPosition.y; | |
5100 a1.vPosition.x = pParty->vPosition.x; | |
5101 a1.uAttributes = v1; | |
5102 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5103 a1.uSectorID = pIndoor->GetSector( | |
5104 pParty->vPosition.x, | |
5105 pParty->vPosition.y, | |
5106 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5107 a1.uSpriteFrameID = v1; | |
5108 v226 = 8 * v3->uPlayerID; | |
303 | 5109 LOBYTE(v226) = v226 | OBJECT_Player; |
5110 a1.field_58_pid = v226; | |
0 | 5111 a1.field_5C = a2; |
5112 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5113 a1.uSoundID = LOWORD(v3->field_10); | |
5114 if ( pParty->bTurnBasedModeOn == 1 ) | |
5115 LOBYTE(a1.uAttributes) |= 4u; | |
5116 v227 = SHIDWORD(v733) / -2; | |
5117 y = (char *)(SHIDWORD(v733) / 2); | |
5118 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5119 { | |
5120 v228 = v715.uYawAngle; | |
5121 do | |
5122 { | |
5123 a1.uFacing = v227 + v228; | |
5124 if ( a1.Create( | |
5125 v227 + v228, | |
5126 v715.uPitchAngle, | |
5127 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5128 v3->uPlayerID + 1) != -1 | |
5129 && pParty->bTurnBasedModeOn == 1 ) | |
5130 ++pTurnEngine->field_1C; | |
5131 v227 += v732; | |
5132 } | |
5133 while ( v227 <= (signed int)y ); | |
5134 } | |
5135 } | |
5136 goto LABEL_1056; | |
5137 case 27: | |
5138 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5139 goto LABEL_461; | |
5140 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5141 v229 = 600 * v2; | |
5142 else | |
5143 v229 = 3600 * v2; | |
5144 LODWORD(v733) = v229; | |
5145 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5146 goto LABEL_83; | |
5147 v716 = pOtherOverlayList->_4418B1(10005, 201, v1, 65536); | |
5148 v230 = v3->spellnum; | |
5149 v231 = pGame->GetStru6(); | |
5150 pGame->GetStru6()->SetPlayerBuffAnim(v230, v1); | |
5151 v232 = 1; | |
5152 v233 = v3->spellnum; | |
5153 v234 = pGame->GetStru6(); | |
5154 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1u); | |
5155 v235 = v3->spellnum; | |
5156 v236 = pGame->GetStru6(); | |
5157 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2u); | |
5158 v237 = v3->spellnum; | |
5159 v238 = pGame->GetStru6(); | |
5160 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3u); | |
5161 v239 = v3->uPlayerID + 1; | |
5162 v732 = v229 << 7; | |
5163 pParty->pPartyBuffs[18].Apply( | |
5164 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5165 v731, | |
5166 amount, | |
5167 v716, | |
5168 v239); | |
5169 if ( v731 == 4 ) | |
5170 pParty->pPartyBuffs[18].uFlags = 1; | |
89 | 5171 LODWORD(v727) = v232; |
5172 goto LABEL_83; | |
0 | 5173 case 28: |
5174 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5175 goto LABEL_83; | |
5176 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; | |
5177 y = v240; | |
5178 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5179 goto LABEL_199; | |
5180 if ( v731 == 1 || v731 == 2 ) | |
5181 { | |
5182 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5183 } | |
5184 else | |
5185 { | |
5186 if ( v731 == 3 ) | |
5187 { | |
5188 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5189 } | |
5190 else | |
5191 { | |
5192 if ( v731 != 4 ) | |
5193 { | |
5194 v241 = 0.0; | |
5195 goto LABEL_484; | |
5196 } | |
5197 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5198 } | |
5199 } | |
5200 if ( v241 > 1.0 ) | |
5201 v241 = 1.0; | |
5202 LABEL_484: | |
5203 v732 = (unsigned __int8)v240[25]; | |
5204 v242 = (signed __int64)((double)v732 * v241); | |
5205 v243 = y; | |
5206 y[25] = v242; | |
5207 *((int *)v243 + 4) = (unsigned __int8)v242; | |
5208 if ( (unsigned __int8)v242 <= v1 ) | |
5209 { | |
5210 *(int *)v243 = v1; | |
5211 dword_50C9D0 = 113; | |
5212 dword_50C9D4 = v1; | |
5213 dword_50C9D8 = 1; | |
5214 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
5215 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5216 v3->spellnum = v1; | |
5217 goto LABEL_1165; | |
5218 } | |
5219 *((int *)v243 + 5) |= 0x40u; | |
5220 goto LABEL_1055; | |
5221 case 30: | |
5222 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5223 goto LABEL_83; | |
5224 uRequiredMana = v1; | |
5225 HIDWORD(v733) = 10 * v2; | |
5226 v730 = 1; | |
5227 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5228 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5229 if ( v731 == 1 ) | |
5230 { | |
5231 v245 = (int)&v244[36 * a2 + 532]; | |
5232 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5233 v311 = __OFSUB__(*(int *)v245, 134); | |
5234 v14 = *(int *)v245 == 134; | |
5235 v310 = *(int *)v245 - 134 < 0; | |
5236 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5237 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5238 { | |
5239 if ( *(int *)&v244[36 * a2 + 544] == v1 ) | |
5240 { | |
5241 if ( *(int *)&v244[36 * a2 + 536] == v1 ) | |
5242 { | |
5243 if ( *(int *)&v244[36 * a2 + 540] == v1 ) | |
5244 { | |
5245 v312 = v309[28]; | |
5246 if ( v312 ) | |
5247 { | |
5248 if ( v312 != 1 ) | |
5249 { | |
5250 if ( v312 != 2 ) | |
5251 { | |
5252 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5253 if ( !(v244[36 * a2 + 552] & 2) ) | |
5254 { | |
5255 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5256 { | |
5257 uRequiredMana = 1; | |
5258 v730 = v1; | |
5259 } | |
5260 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5261 uRequiredMana = 1; | |
5262 if ( uRequiredMana == v1 ) | |
5263 { | |
5264 v313 = *(char *)(LODWORD(v725) + 28); | |
5265 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5266 { | |
224 | 5267 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5268 *(int *)(v245 + 4) = 0; |
222 | 5269 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5270 + 1]; |
5271 ; | |
222 | 5272 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5273 + 1] ) |
5274 { | |
5275 ++*(int *)(v245 + 4); | |
5276 if ( j >= v314 ) | |
5277 break; | |
5278 } | |
5279 v254 = rand(); | |
224 | 5280 v255 = 10;//pItemsTable->field_116D8[17]; |
5281 v256 = 10;//pItemsTable->field_116D8[16]; | |
0 | 5282 LABEL_611: |
5283 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5284 LABEL_612: | |
5285 _this->uItemID |= 0x20u; | |
5286 goto LABEL_1055; | |
5287 } | |
5288 goto LABEL_615; | |
5289 } | |
5290 LABEL_613: | |
5291 v316 = _this->uItemID; | |
5292 if ( !(BYTE1(v316) & 2) ) | |
5293 { | |
5294 LOBYTE(v316) = v316 | 2; | |
5295 _this->uItemID = v316; | |
5296 } | |
5297 } | |
5298 } | |
5299 } | |
5300 } | |
5301 } | |
5302 } | |
5303 } | |
5304 } | |
5305 LABEL_616: | |
5306 if ( LODWORD(v727) == v1 ) | |
5307 { | |
5308 v317 = pGlobalTXT_LocalizationStrings[428]; | |
5309 if ( v730 == v1 ) | |
5310 v317 = pGlobalTXT_LocalizationStrings[585]; | |
5311 ShowStatusBarString(v317, 2u); | |
5312 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5313 v318 = v726; | |
5314 v3->spellnum = v1; | |
187 | 5315 v318->PlaySound(SPEECH_43, v1); |
0 | 5316 } |
5317 goto LABEL_83; | |
5318 } | |
5319 if ( v731 != 2 ) | |
5320 { | |
5321 if ( v731 == 3 ) | |
5322 { | |
5323 v245 = (int)&v244[36 * a2 + 532]; | |
5324 v269 = *(int *)v245; | |
5325 if ( *(int *)v245 > 134 | |
5326 || *(int *)(v245 + 12) != v1 | |
5327 || *(int *)(v245 + 4) != v1 | |
5328 || *(int *)(v245 + 8) != v1 | |
5329 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) | |
5330 goto LABEL_616; | |
5331 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5332 LODWORD(v725) = (int)v270; | |
5333 v271 = v270[28]; | |
5334 if ( v271 && v271 != 1 && v271 != 2 ) | |
5335 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5336 else | |
5337 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5338 if ( v272 ) | |
5339 { | |
5340 uRequiredMana = 1; | |
5341 v730 = v1; | |
5342 } | |
5343 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5344 uRequiredMana = 1; | |
5345 if ( uRequiredMana != v1 ) | |
5346 goto LABEL_613; | |
5347 v273 = v725; | |
5348 v274 = *(char *)(LODWORD(v725) + 28); | |
5349 if ( v274 == 0 | v274 == 1 | v274 == 2 | v274 == 3 | v274 == 4 | v274 == 5 | v274 == 6 | v274 == 7 | v274 == 8 | v274 == 9 | v274 == 10 | v274 == 11 ) | |
5350 { | |
5351 if ( rand() % 100 < 80 | |
5352 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5353 { | |
224 | 5354 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5355 *(int *)(v245 + 4) = 0; |
222 | 5356 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5357 ; |
222 | 5358 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5359 + 1] ) |
5360 { | |
5361 ++*(int *)(v245 + 4); | |
5362 if ( k >= v275 ) | |
5363 break; | |
5364 } | |
5365 v254 = rand(); | |
224 | 5366 v255 = 10;//pItemsTable->field_116D8[19]; |
5367 v256 = 10;//pItemsTable->field_116D8[18]; | |
0 | 5368 goto LABEL_611; |
5369 } | |
222 | 5370 v277 = pItemsTable->pSpecialEnchantments_count; |
0 | 5371 v278 = 0; |
5372 v725 = 0.0; | |
5373 HIDWORD(v733) = 0; | |
222 | 5374 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5375 { |
5376 v730 = (int)&v679; | |
5377 do | |
5378 { | |
222 | 5379 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement); |
0 | 5380 if ( !v279 || v279 == 1 ) |
5381 { | |
222 | 5382 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5383 + 4] |
5384 + v278 * 28); | |
5385 LODWORD(v725) += v280; | |
5386 if ( v280 ) | |
5387 { | |
5388 v281 = v730; | |
5389 v730 += 4; | |
5390 *(int *)v281 = HIDWORD(v733); | |
5391 } | |
5392 } | |
5393 ++HIDWORD(v733); | |
5394 ++v278; | |
5395 } | |
5396 while ( SHIDWORD(v733) < v277 ); | |
5397 } | |
5398 v282 = rand() % SLODWORD(v725); | |
5399 v283 = v679; | |
5400 *(int *)(v245 + 12) = v679; | |
222 | 5401 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5402 v285 = v282 + 1; |
5403 if ( v284 < v285 ) | |
5404 { | |
5405 for ( l = &v679; ; l = (int *)v732 ) | |
5406 { | |
5407 v287 = (int)(l + 1); | |
5408 v732 = v287; | |
5409 v288 = *(int *)v287; | |
5410 *(int *)(v245 + 12) = v288; | |
222 | 5411 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5412 + 4]; |
5413 if ( v284 >= v285 ) | |
5414 break; | |
5415 } | |
5416 } | |
5417 goto LABEL_525; | |
5418 } | |
5419 } | |
5420 else | |
5421 { | |
5422 if ( v731 != 4 | |
5423 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
377 | 5424 || v726->pInventoryItems[a2].uSpecEnchantmentType != v1 |
5425 || v726->pInventoryItems[a2].uEncantmentType != v1 | |
0 | 5426 || v726->pInventoryItems[a2]._bonus_strength != v1 |
315 | 5427 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) |
0 | 5428 goto LABEL_616; |
5429 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5430 LODWORD(v725) = (int)v247; | |
5431 v248 = v247[28]; | |
5432 if ( v248 && v248 != 1 && v248 != 2 ) | |
5433 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5434 else | |
5435 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5436 if ( v249 ) | |
5437 { | |
5438 uRequiredMana = 1; | |
5439 v730 = v1; | |
5440 } | |
5441 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5442 uRequiredMana = 1; | |
5443 if ( uRequiredMana != v1 ) | |
5444 goto LABEL_613; | |
5445 v250 = v725; | |
5446 v251 = *(char *)(LODWORD(v725) + 28); | |
5447 if ( v251 == 0 | v251 == 1 | v251 == 2 | v251 == 3 | v251 == 4 | v251 == 5 | v251 == 6 | v251 == 7 | v251 == 8 | v251 == 9 | v251 == 10 | v251 == 11 ) | |
5448 { | |
5449 if ( rand() % 100 < 80 | |
5450 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5451 { | |
224 | 5452 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5453 *(int *)(v245 + 4) = 0; |
222 | 5454 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5455 ; |
222 | 5456 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5457 + 1] ) |
5458 { | |
5459 ++*(int *)(v245 + 4); | |
5460 if ( m >= v252 ) | |
5461 break; | |
5462 } | |
5463 v254 = rand(); | |
224 | 5464 v255 = 10;// pItemsTable->field_116D8[21]; |
5465 v256 = 10;//pItemsTable->field_116D8[20]; | |
0 | 5466 goto LABEL_611; |
5467 } | |
222 | 5468 v257 = pItemsTable->pSpecialEnchantments_count; |
0 | 5469 v258 = 0; |
5470 v725 = 0.0; | |
5471 HIDWORD(v733) = 0; | |
222 | 5472 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5473 { |
5474 v730 = (int)&v679; | |
5475 do | |
5476 { | |
222 | 5477 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
0 | 5478 if ( !v259 || v259 == 1 ) |
5479 { | |
222 | 5480 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5481 + 4] |
5482 + v258 * 28); | |
5483 LODWORD(v725) += v260; | |
5484 if ( v260 ) | |
5485 { | |
5486 v261 = v730; | |
5487 v730 += 4; | |
5488 *(int *)v261 = HIDWORD(v733); | |
5489 } | |
5490 } | |
5491 ++HIDWORD(v733); | |
5492 ++v258; | |
5493 } | |
5494 while ( SHIDWORD(v733) < v257 ); | |
5495 } | |
5496 v262 = rand() % SLODWORD(v725); | |
5497 v263 = v679; | |
5498 *(int *)(v245 + 12) = v679; | |
222 | 5499 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5500 v265 = v262 + 1; |
5501 if ( v264 < v265 ) | |
5502 { | |
5503 for ( ii = &v679; ; ii = (int *)v732 ) | |
5504 { | |
5505 v267 = (int)(ii + 1); | |
5506 v732 = v267; | |
5507 v268 = *(int *)v267; | |
5508 *(int *)(v245 + 12) = v268; | |
222 | 5509 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5510 + 4]; |
5511 if ( v264 >= v265 ) | |
5512 break; | |
5513 } | |
5514 } | |
5515 LABEL_525: | |
5516 ++*(int *)(v245 + 12); | |
5517 goto LABEL_612; | |
5518 } | |
5519 } | |
5520 LABEL_615: | |
5521 v1 = 0; | |
5522 goto LABEL_616; | |
5523 } | |
5524 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5525 _this = v289; | |
5526 v290 = v289->uItemID; | |
5527 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5528 if ( v290 > 134 | |
377 | 5529 || _this->uSpecEnchantmentType != v1 |
5530 || _this->uEncantmentType != v1 | |
0 | 5531 || _this->_bonus_strength != v1 |
5532 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 | |
5533 || v291 == 1 | |
5534 || v291 == 2 | |
315 | 5535 || _this->Broken()) |
0 | 5536 goto LABEL_616; |
5537 if ( _this->GetValue() < 0x1C2 ) | |
5538 uRequiredMana = 1; | |
5539 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5540 uRequiredMana = 1; | |
5541 if ( uRequiredMana != v1 ) | |
5542 goto LABEL_199; | |
5543 v292 = *(char *)(LODWORD(v725) + 28); | |
5544 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5545 { | |
5546 v2 = v723; | |
5547 v1 = 0; | |
5548 goto LABEL_199; | |
5549 } | |
5550 if ( rand() % 100 >= 80 ) | |
5551 { | |
222 | 5552 v297 = pItemsTable->pSpecialEnchantments_count; |
0 | 5553 v294 = _this; |
5554 v298 = 0; | |
5555 v725 = 0.0; | |
5556 HIDWORD(v733) = 0; | |
222 | 5557 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5558 { |
5559 v730 = (int)&v679; | |
5560 do | |
5561 { | |
222 | 5562 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement); |
0 | 5563 if ( !v299 || v299 == 1 ) |
5564 { | |
222 | 5565 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4] |
0 | 5566 + v298 * 28); |
5567 LODWORD(v725) += v300; | |
5568 if ( v300 ) | |
5569 { | |
5570 v301 = v730; | |
5571 v730 += 4; | |
5572 *(int *)v301 = HIDWORD(v733); | |
5573 } | |
5574 } | |
5575 ++HIDWORD(v733); | |
5576 ++v298; | |
5577 } | |
5578 while ( SHIDWORD(v733) < v297 ); | |
5579 } | |
5580 v302 = rand() % SLODWORD(v725); | |
5581 v303 = v679; | |
377 | 5582 v294->uSpecEnchantmentType = v679; |
222 | 5583 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5584 v305 = v302 + 1; |
5585 if ( v304 < v305 ) | |
5586 { | |
5587 for ( jj = &v679; ; jj = (int *)v732 ) | |
5588 { | |
5589 v307 = (int)(jj + 1); | |
5590 v732 = v307; | |
5591 v308 = *(int *)v307; | |
377 | 5592 v294->uSpecEnchantmentType = v308; |
222 | 5593 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5594 if ( v304 >= v305 ) |
5595 break; | |
5596 } | |
5597 } | |
377 | 5598 ++v294->uSpecEnchantmentType; |
0 | 5599 } |
5600 else | |
5601 { | |
5602 v293 = rand(); | |
5603 v294 = _this; | |
224 | 5604 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
377 | 5605 _this->uEncantmentType = 0; |
222 | 5606 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; |
0 | 5607 ; |
377 | 5608 kk += pItemsTable->pEnchantments[v294->uEncantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType |
0 | 5609 + 1] ) |
5610 { | |
377 | 5611 ++v294->uEncantmentType; |
0 | 5612 if ( kk >= v295 ) |
5613 break; | |
5614 } | |
224 | 5615 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5616 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
0 | 5617 } |
5618 v294->uAttributes |= 0x20u; | |
5619 goto LABEL_1055; | |
5620 case 31: | |
5621 amount = 10 * v2; | |
5622 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
5623 goto LABEL_83; | |
5624 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) | |
5625 goto LABEL_200; | |
5626 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
5627 pMessageQueue_50CBD0->SendMessage((UIMessageType)195, v1, v1); | |
5628 goto LABEL_1056; | |
5629 case 33: | |
5630 LODWORD(v733) = 604800 * v2; | |
5631 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5632 goto LABEL_200; | |
5633 v319 = uRequiredMana; | |
5634 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5635 { | |
5636 pEventTimer->Pause(); | |
5637 pMessageQueue_50CBD0->SendMessage((UIMessageType)177, v1, v1); | |
5638 qword_506350 = (signed int)v733; | |
5639 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5640 ::uRequiredMana = v319; | |
5641 ::sRecoveryTime = sRecoveryTime; | |
5642 dword_50633C = v3->field_10; | |
5643 dword_506338 = v3->spellnum; | |
5644 LOBYTE(v3->field_8) |= 0x20u; | |
5645 } | |
5646 goto LABEL_83; | |
5647 case 40: | |
5648 v320 = v12 - 2; | |
5649 if ( !v320 ) | |
5650 goto LABEL_632; | |
5651 v321 = v320 - 1; | |
5652 if ( v321 ) | |
5653 { | |
5654 if ( v321 == 1 ) | |
5655 goto LABEL_634; | |
5656 LABEL_632: | |
5657 v322 = 3600 * v2; | |
5658 } | |
5659 else | |
5660 { | |
5661 v322 = 86400 * v2; | |
5662 } | |
5663 amount = v322; | |
5664 LABEL_634: | |
5665 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5666 goto LABEL_83; | |
5667 v323 = v3->uPlayerID_2; | |
5668 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5669 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5670 goto LABEL_1056; | |
5671 if ( v731 == 4 ) | |
5672 goto LABEL_637; | |
5673 v732 = amount << 7; | |
5674 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5675 v656 = 15; | |
5676 goto LABEL_640; | |
5677 case 41: | |
5678 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5679 goto LABEL_83; | |
5680 a1.stru_24.Reset(); | |
5681 a1.field_48 = v3->spellnum; | |
5682 a1.field_4C = v2; | |
5683 a1.field_50 = v731; | |
5684 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5685 a1.vPosition.y = pParty->vPosition.y; | |
5686 a1.vPosition.x = pParty->vPosition.x; | |
5687 a1.uAttributes = v1; | |
5688 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5689 a1.uSectorID = pIndoor->GetSector( | |
5690 pParty->vPosition.x, | |
5691 pParty->vPosition.y, | |
5692 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5693 a1.uSpriteFrameID = v1; | |
5694 v326 = 8 * v3->uPlayerID; | |
303 | 5695 LOBYTE(v326) = v326 | OBJECT_Player; |
5696 a1.field_58_pid = v326; | |
0 | 5697 a1.field_5C = a2; |
5698 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5699 a1.uFacing = LOWORD(pParty->sRotationY); | |
5700 a1.uSoundID = LOWORD(v3->field_10); | |
5701 if ( pParty->bTurnBasedModeOn == 1 ) | |
5702 LOBYTE(a1.uAttributes) |= 4u; | |
5703 v669 = v3->uPlayerID + 1; | |
5704 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5705 v654 = pParty->sRotationX; | |
5706 goto LABEL_125; | |
5707 case 43: | |
5708 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5709 goto LABEL_200; | |
5710 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5711 goto LABEL_83; | |
5712 a1.uItemType = 4090; | |
5713 a1.stru_24.Reset(); | |
5714 a1.field_48 = v3->spellnum; | |
5715 a1.field_4C = v2; | |
5716 a1.field_50 = v731; | |
5717 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5718 a1.vPosition.x = pParty->vPosition.x; | |
5719 a1.vPosition.y = pParty->vPosition.y; | |
5720 a1.uAttributes = v1; | |
5721 a1.uSectorID = v1; | |
5722 a1.uSpriteFrameID = v1; | |
5723 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5724 v327 = 8 * v3->uPlayerID; | |
303 | 5725 LOBYTE(v327) = v327 | OBJECT_Player; |
0 | 5726 a1.field_60_distance_related_prolly_lod = 0; |
303 | 5727 a1.field_58_pid = v327; |
0 | 5728 a1.field_5C = a2; |
5729 a1.uFacing = LOWORD(pParty->sRotationY); | |
5730 a1.uSoundID = LOWORD(v3->field_10); | |
5731 if ( pParty->bTurnBasedModeOn == 1 ) | |
5732 a1.uAttributes = 4; | |
5733 v669 = v1; | |
5734 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5735 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5736 LABEL_124: | |
5737 v654 = v35; | |
5738 LABEL_125: | |
5739 v36 = pParty->sRotationY; | |
5740 goto LABEL_157; | |
5741 case 45: | |
5742 v328 = v12 - 2; | |
5743 if ( v328 ) | |
5744 { | |
5745 v329 = v328 - 1; | |
5746 if ( v329 && v329 != 1 ) | |
5747 v330 = 600 * v2; | |
5748 else | |
5749 v330 = 3600 * v2; | |
5750 } | |
5751 else | |
5752 { | |
5753 v330 = 1800 * v2; | |
5754 } | |
5755 LODWORD(v733) = v330; | |
5756 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5757 goto LABEL_83; | |
5758 v331 = v3->spellnum; | |
5759 v332 = pGame->GetStru6(); | |
5760 pGame->GetStru6()->SetPlayerBuffAnim(v331, v1); | |
5761 v83 = 1; | |
5762 v333 = v3->spellnum; | |
5763 v334 = pGame->GetStru6(); | |
5764 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1u); | |
5765 v335 = v3->spellnum; | |
5766 v336 = pGame->GetStru6(); | |
5767 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2u); | |
5768 v337 = v3->spellnum; | |
5769 v338 = pGame->GetStru6(); | |
5770 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3u); | |
5771 v673 = v1; | |
5772 v732 = (int)v733 << 7; | |
5773 v662 = v1; | |
5774 v655 = v1; | |
5775 v652 = v731; | |
5776 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5777 v137 = (char *)&pParty->pPartyBuffs[3]; | |
5778 goto LABEL_976; | |
5779 case 47: | |
5780 LODWORD(v733) = 300; | |
5781 v339 = v12 - 2; | |
5782 if ( v339 ) | |
5783 { | |
5784 v340 = v339 - 1; | |
5785 if ( v340 ) | |
5786 { | |
5787 if ( v340 != 1 ) | |
5788 { | |
5789 amount = v2; | |
5790 goto LABEL_667; | |
5791 } | |
5792 v341 = 6 * v2; | |
5793 } | |
5794 else | |
5795 { | |
5796 v341 = 4 * v2; | |
5797 } | |
5798 } | |
5799 else | |
5800 { | |
5801 v341 = 2 * v2; | |
5802 } | |
5803 amount = v341; | |
5804 LABEL_667: | |
5805 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5806 goto LABEL_83; | |
5807 v342 = *(int *)&v3->field_C; | |
5808 if ( v342 == v1 ) | |
5809 { | |
5810 v345 = v3->uPlayerID_2; | |
5811 v346 = v3->spellnum; | |
5812 v347 = pGame->GetStru6(); | |
5813 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); | |
5814 v668 = v1; | |
5815 v658 = v1; | |
5816 v653 = amount; | |
5817 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; | |
5818 v651 = v731; | |
5819 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5820 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; | |
5821 goto LABEL_104; | |
5822 } | |
141 | 5823 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5824 { |
5825 v343 = v342 >> 3; | |
5826 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5827 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; | |
5828 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); | |
5829 BYTE2(pActors[v343].uAttributes) |= 8u; | |
5830 v672 = v1; | |
5831 v661 = &pActors[v343]; | |
5832 LABEL_165: | |
5833 v56 = pGame->GetStru6(); | |
5834 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5835 } | |
5836 goto LABEL_1056; | |
5837 case 49: | |
5838 v348 = v12 - 2; | |
5839 if ( !v348 ) | |
5840 goto LABEL_677; | |
5841 v349 = v348 - 1; | |
5842 if ( v349 ) | |
5843 { | |
5844 if ( v349 == 1 ) | |
5845 { | |
5846 amount = v1; | |
5847 goto LABEL_679; | |
5848 } | |
5849 LABEL_677: | |
5850 v350 = 3600 * v2; | |
5851 } | |
5852 else | |
5853 { | |
5854 v350 = 86400 * v2; | |
5855 } | |
5856 amount = v350; | |
5857 LABEL_679: | |
5858 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5859 goto LABEL_83; | |
5860 v351 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5861 if ( !v351->pConditions[0] ) | |
5862 goto LABEL_1056; | |
5863 if ( v731 == 4 ) | |
5864 { | |
5865 LODWORD(v351->pConditions[0]) = v1; | |
5866 HIDWORD(v351->pConditions[0]) = v1; | |
5867 goto LABEL_904; | |
5868 } | |
5869 v732 = amount << 7; | |
5870 v351->DiscardConditionIfLastsLongerThan( | |
5871 v1, | |
5872 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
5873 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5874 goto LABEL_1056; | |
5875 v674 = v3->uPlayerID_2; | |
5876 goto LABEL_685; | |
5877 case 50: | |
5878 v354 = v12 - 2; | |
5879 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5880 v356 = 900 * (v2 + 4); | |
5881 else | |
5882 v356 = 300 * (v2 + 12); | |
5883 LODWORD(v733) = v356; | |
5884 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5885 goto LABEL_83; | |
5886 if ( v731 == 1 || v731 == 2 ) | |
5887 { | |
5888 v361 = v3->uPlayerID_2; | |
5889 v362 = v3->spellnum; | |
5890 v363 = pGame->GetStru6(); | |
5891 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); | |
5892 v668 = v1; | |
5893 v732 = (int)v733 << 7; | |
5894 v658 = v1; | |
5895 v653 = v1; | |
5896 v651 = v731; | |
5897 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5898 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; | |
5899 goto LABEL_103; | |
5900 } | |
5901 a2 = v1; | |
5902 v732 = (int)v733 << 7; | |
5903 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5904 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5905 do |
5906 { | |
5907 v358 = a2; | |
5908 v359 = v3->spellnum; | |
5909 v360 = pGame->GetStru6(); | |
5910 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); | |
112 | 5911 v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, v1, v1, v1); |
0 | 5912 ++a2; |
112 | 5913 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5914 } | |
5915 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5916 goto LABEL_1056; |
5917 case 48: | |
5918 v364 = v12 - 2; | |
5919 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5920 v366 = 60 * (v2 + 3); | |
5921 else | |
5922 v366 = 300 * v2 + 180; | |
5923 LODWORD(v733) = v366; | |
5924 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5925 goto LABEL_83; | |
5926 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
5927 v367 = pGame->GetStru6(); | |
5928 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | |
5929 ++a1.uItemType; | |
5930 a1.stru_24.Reset(); | |
5931 a1.field_48 = v3->spellnum; | |
5932 a1.field_4C = v2; | |
5933 a1.field_50 = v731; | |
5934 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5935 a1.uAttributes = v1; | |
5936 a1.uSectorID = v1; | |
5937 a1.uSpriteFrameID = v1; | |
5938 v368 = v3->uPlayerID; | |
5939 a1.field_60_distance_related_prolly_lod = 0; | |
5940 a1.uFacing = v1; | |
5941 v368 *= 8; | |
303 | 5942 LOBYTE(v368) = v368 | OBJECT_Player; |
5943 a1.field_58_pid = v368; | |
0 | 5944 a1.uSoundID = LOWORD(v3->field_10); |
5945 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
5946 { | |
5947 v369 = &pActors[dword_50BF30[a2]]; | |
5948 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5949 { | |
5950 a1.vPosition.x = v369->vPosition.x; | |
5951 a1.vPosition.y = v369->vPosition.y; | |
5952 v732 = v369->uActorHeight; | |
5953 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5954 v370 = 8 * dword_50BF30[a2]; | |
5955 LOBYTE(v370) = v370 | 3; | |
5956 a1.field_5C = v370; | |
5957 a1.Create(0, v1, v1, v1); | |
5958 v732 = (int)v733 << 7; | |
5959 v369->pActorBuffs[4].Apply( | |
5960 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
5961 v731, | |
5962 v1, | |
5963 v1, | |
5964 v1); | |
5965 } | |
5966 } | |
5967 goto LABEL_1056; | |
5968 case 53: | |
5969 v371 = v12 - 2; | |
5970 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
5971 amount = v1; | |
5972 else | |
5973 amount = 86400 * v2; | |
5974 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5975 goto LABEL_83; | |
5976 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, v1, 65536); | |
5977 v373 = v3->uPlayerID_2; | |
5978 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5979 goto LABEL_1056; | |
5980 v14 = v731 == 4; | |
5981 pParty->pPlayers[v373].sHealth = 1; | |
5982 if ( v14 ) | |
5983 { | |
5984 v374 = v3->uPlayerID_2; | |
5985 LODWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5986 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5987 v376 = v3->uPlayerID_2; | |
5988 LODWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5989 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5990 } | |
5991 else | |
5992 { | |
5993 v732 = amount << 7; | |
5994 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5995 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5996 0xEu, | |
5997 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5998 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5999 0xDu, | |
6000 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6001 } | |
112 | 6002 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6003 goto LABEL_720; |
6004 case 54: | |
6005 v378 = v12 - 2; | |
6006 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
6007 v380 = 4 * v2; | |
6008 else | |
6009 v380 = 3 * v2; | |
6010 amount = v380; | |
6011 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6012 goto LABEL_83; | |
6013 v381 = 0; | |
6014 HIDWORD(v733) = amount; | |
6015 v730 = 0; | |
6016 v382 = 1; | |
6017 do | |
6018 { | |
6019 v383 = pPlayers[v382]; | |
6020 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
6021 v682[v381++] = v382; | |
6022 ++v382; | |
6023 } | |
6024 while ( v382 <= 4 ); | |
6025 v384 = 0; | |
6026 v730 = v381; | |
6027 if ( v381 > v1 ) | |
6028 { | |
6029 do | |
6030 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
6031 while ( v384 < v381 ); | |
6032 } | |
6033 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
6034 HIDWORD(v733) = v1; | |
6035 if ( v381 > v1 ) | |
6036 { | |
6037 do | |
6038 { | |
6039 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
6040 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
6041 v726 = *(Player **)v385; | |
6042 v386 = v726->GetMaxHealth(); | |
6043 if ( v726->sHealth > v386 ) | |
6044 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
6045 v387 = *(Player **)v385; | |
6046 if ( v387->sHealth > v1 ) | |
6047 { | |
6048 LODWORD(v387->pConditions[13]) = v1; | |
6049 HIDWORD(v387->pConditions[13]) = v1; | |
6050 } | |
6051 v388 = HIDWORD(v733); | |
6052 v389 = LOWORD(v682[HIDWORD(v733)]) - 1; | |
6053 v390 = v3->spellnum; | |
6054 v391 = pGame->GetStru6(); | |
6055 pGame->GetStru6()->SetPlayerBuffAnim(v390, v389); | |
6056 HIDWORD(v733) = v388 + 1; | |
6057 } | |
6058 while ( v388 + 1 < v730 ); | |
6059 } | |
6060 goto LABEL_1056; | |
6061 case 55: | |
6062 v392 = v12 - 1; | |
6063 if ( !v392 ) | |
6064 { | |
6065 v395 = 180 * v2; | |
6066 goto LABEL_750; | |
6067 } | |
6068 v393 = v392 - 1; | |
6069 if ( !v393 ) | |
6070 { | |
6071 v395 = 10800 * v2; | |
6072 goto LABEL_750; | |
6073 } | |
6074 v394 = v393 - 1; | |
6075 if ( !v394 ) | |
6076 { | |
6077 v395 = 259200 * v2; | |
6078 LABEL_750: | |
6079 amount = v395; | |
6080 goto LABEL_751; | |
6081 } | |
6082 if ( v394 == 1 ) | |
6083 amount = v1; | |
6084 LABEL_751: | |
6085 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6086 goto LABEL_83; | |
6087 v396 = v3->uPlayerID_2; | |
6088 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
6089 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
6090 { | |
6091 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
187 | 6092 pParty->pPlayers[v396].PlaySound(SPEECH_25, v1); |
0 | 6093 if ( v731 == 4 ) |
6094 { | |
6095 v397 = v3->uPlayerID_2; | |
6096 LODWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6097 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6098 v398 = v3->uPlayerID_2; | |
6099 LODWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6100 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6101 v399 = v3->uPlayerID_2; | |
6102 LODWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6103 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6104 } | |
6105 else | |
6106 { | |
6107 v732 = amount << 7; | |
6108 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6109 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6110 0x10u, | |
6111 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6112 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6113 0xEu, | |
6114 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6115 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6116 0xDu, | |
6117 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6118 } | |
6119 v83 = 1; | |
112 | 6120 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
0 | 6121 v401 = pGame; |
6122 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; | |
6123 v402 = v3->uPlayerID_2; | |
6124 v403 = v3->spellnum; | |
6125 v404 = pGame->GetStru6(); | |
6126 pGame->GetStru6()->SetPlayerBuffAnim(v403, v402); | |
6127 } | |
6128 else | |
6129 { | |
6130 v83 = 1; | |
6131 } | |
6132 goto LABEL_978; | |
6133 case 61: | |
6134 v405 = v12 - 2; | |
6135 if ( !v405 ) | |
6136 goto LABEL_766; | |
6137 v406 = v405 - 1; | |
6138 if ( v406 ) | |
6139 { | |
6140 if ( v406 == 1 ) | |
6141 { | |
6142 amount = v1; | |
6143 goto LABEL_768; | |
6144 } | |
6145 LABEL_766: | |
6146 v407 = 3600 * v2; | |
6147 } | |
6148 else | |
6149 { | |
6150 v407 = 86400 * v2; | |
6151 } | |
6152 amount = v407; | |
6153 LABEL_768: | |
6154 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6155 goto LABEL_83; | |
6156 v408 = v3->uPlayerID_2; | |
6157 v409 = v3->spellnum; | |
6158 v410 = pGame->GetStru6(); | |
6159 pGame->GetStru6()->SetPlayerBuffAnim(v409, v408); | |
6160 v323 = v3->uPlayerID_2; | |
6161 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6162 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6163 goto LABEL_1056; | |
6164 if ( v731 == 4 ) | |
6165 goto LABEL_637; | |
6166 v732 = amount << 7; | |
6167 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6168 v656 = 12; | |
6169 goto LABEL_640; | |
6170 case 56: | |
6171 v411 = v12 - 2; | |
6172 if ( v411 ) | |
6173 { | |
6174 v412 = v411 - 1; | |
6175 if ( v412 ) | |
6176 { | |
6177 if ( v412 == 1 ) | |
6178 { | |
6179 amount = v1; | |
6180 goto LABEL_780; | |
6181 } | |
6182 v413 = 180 * v2; | |
6183 } | |
6184 else | |
6185 { | |
6186 v413 = 86400 * v2; | |
6187 } | |
6188 } | |
6189 else | |
6190 { | |
6191 v413 = 3600 * v2; | |
6192 } | |
6193 amount = v413; | |
6194 LABEL_780: | |
6195 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6196 goto LABEL_83; | |
6197 v414 = v3->uPlayerID_2; | |
6198 v415 = v3->spellnum; | |
6199 v416 = pGame->GetStru6(); | |
6200 pGame->GetStru6()->SetPlayerBuffAnim(v415, v414); | |
6201 v323 = v3->uPlayerID_2; | |
6202 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6203 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6204 goto LABEL_1056; | |
6205 if ( v731 == 4 ) | |
6206 goto LABEL_637; | |
6207 v732 = amount << 7; | |
6208 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6209 v656 = 3; | |
6210 goto LABEL_640; | |
6211 case 59: | |
6212 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6213 goto LABEL_83; | |
141 | 6214 if ( a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 6215 goto LABEL_1056; |
6216 v417 = (int)&pActors[a2 >> 3]; | |
6217 v730 = v417; | |
6218 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6219 { | |
6220 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6221 v417 = v730; | |
6222 } | |
6223 v418 = *(int *)(v417 + 672); | |
6224 HIDWORD(v733) = v1; | |
6225 if ( pItemsTable->pItems[v418].uEquipType == 18 ) | |
6226 HIDWORD(v733) = *(int *)(v417 + 684); | |
6227 | |
6228 //ItemGen::ItemGen(&v683); | |
6229 v683.Reset(); | |
6230 | |
6231 v419 = *(short *)(v730 + 180); | |
6232 if ( v419 != (short)v1 ) | |
6233 { | |
6234 v683.uItemID = v419; | |
6235 goto LABEL_799; | |
6236 } | |
6237 v420 = 0; | |
6238 v421 = v730 + 564; | |
6239 while ( *(int *)v421 == v1 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) | |
6240 { | |
6241 ++v420; | |
6242 v421 += 36; | |
6243 if ( v420 >= 4 ) | |
6244 goto LABEL_799; | |
6245 } | |
6246 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6247 v2 = v723; | |
6248 v1 = 0; | |
6249 LABEL_799: | |
6250 if ( HIDWORD(v733) != v1 ) | |
6251 { | |
6252 v675 = (const char *)HIDWORD(v733); | |
6253 if ( v683.uItemID != v1 ) | |
6254 { | |
6255 v422 = v683.GetDisplayName(); | |
6256 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6257 goto LABEL_807; | |
6258 } | |
6259 v664 = "%d gold"; | |
6260 goto LABEL_803; | |
6261 } | |
6262 if ( v683.uItemID != v1 ) | |
6263 { | |
6264 v675 = v683.GetDisplayName(); | |
6265 v664 = "(%s)"; | |
6266 LABEL_803: | |
6267 sprintf(pTmpBuf2, v664, v675); | |
6268 goto LABEL_807; | |
6269 } | |
6270 strcpy(pTmpBuf2, "nothing"); | |
6271 LABEL_807: | |
6272 ShowStatusBarString(pTmpBuf2, 2u); | |
6273 a1.stru_24.Reset(); | |
6274 a1.field_48 = v3->spellnum; | |
6275 a1.field_4C = v2; | |
6276 a1.field_50 = v731; | |
6277 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6278 a1.vPosition.x = *(short *)(v730 + 142); | |
6279 a1.vPosition.y = *(short *)(v730 + 144); | |
6280 v676 = *(short *)(v730 + 138); | |
6281 v665 = a1.vPosition.y; | |
6282 a1.vPosition.z = *(short *)(v730 + 138); | |
6283 v657 = a1.vPosition.x; | |
6284 goto LABEL_1087; | |
6285 case 62: | |
6286 v423 = v12 - 2; | |
6287 if ( !v423 ) | |
6288 goto LABEL_813; | |
6289 v424 = v423 - 1; | |
6290 if ( v424 ) | |
6291 { | |
6292 if ( v424 == 1 ) | |
6293 v425 = 3600 * v2; | |
6294 else | |
6295 LABEL_813: | |
6296 v425 = 300 * v2; | |
6297 } | |
6298 else | |
6299 { | |
6300 v425 = 600 * v2; | |
6301 } | |
6302 amount = v425; | |
6303 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6304 goto LABEL_83; | |
6305 v426 = a2 >> 3; | |
141 | 6306 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6307 goto LABEL_1056; |
6308 v730 = 836 * v426; | |
6309 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6310 { | |
90 | 6311 pActors[v426].pActorBuffs[1].Reset(); |
6312 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6313 v732 = amount << 7; |
90 | 6314 pActors[v426].pActorBuffs[9].Apply( |
0 | 6315 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6316 v731, | |
6317 v1, | |
6318 v1, | |
6319 v1); | |
90 | 6320 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6321 } |
6322 a1.stru_24.Reset(); | |
6323 a1.field_48 = v3->spellnum; | |
6324 a1.field_4C = v2; | |
6325 a1.field_50 = v731; | |
6326 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6327 v61 = v426; |
0 | 6328 goto LABEL_1086; |
6329 case 66: | |
6330 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6331 goto LABEL_83; | |
6332 amount = 600 * v2; | |
6333 v427 = a2 >> 3; | |
141 | 6334 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6335 goto LABEL_1056; |
6336 v730 = 836 * v427; | |
6337 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6338 goto LABEL_83; | |
90 | 6339 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6340 { | |
6341 pActors[v427].pActorBuffs[9].Reset(); | |
6342 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6343 v732 = amount << 7; |
90 | 6344 pActors[v427].pActorBuffs[12].Apply( |
0 | 6345 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6346 v731, | |
6347 v1, | |
6348 v1, | |
6349 v1); | |
6350 } | |
6351 a1.stru_24.Reset(); | |
6352 a1.field_48 = v3->spellnum; | |
6353 a1.field_4C = v2; | |
6354 a1.field_50 = v731; | |
6355 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6356 v61 = v427; |
0 | 6357 goto LABEL_1086; |
6358 case 63: | |
6359 v428 = v12 - 2; | |
6360 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6361 v430 = 300 * v2; | |
6362 else | |
6363 v430 = 180 * v2; | |
6364 amount = v430; | |
6365 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6366 goto LABEL_83; | |
6367 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6368 v431 = pGame->GetStru6(); | |
6369 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | |
6370 ++a1.uItemType; | |
6371 a1.stru_24.Reset(); | |
6372 a1.field_48 = v3->spellnum; | |
6373 a1.field_4C = v2; | |
6374 a1.field_50 = v731; | |
6375 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6376 a1.uAttributes = v1; | |
6377 a1.uSectorID = v1; | |
6378 a1.uSpriteFrameID = v1; | |
6379 v432 = v3->uPlayerID; | |
6380 a1.field_60_distance_related_prolly_lod = 0; | |
6381 a1.uFacing = v1; | |
6382 v432 *= 8; | |
303 | 6383 LOBYTE(v432) = v432 | OBJECT_Player; |
6384 a1.field_58_pid = v432; | |
0 | 6385 a1.uSoundID = LOWORD(v3->field_10); |
6386 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
6387 { | |
6388 v433 = &pActors[dword_50BF30[a2]]; | |
6389 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6390 break; | |
6391 a1.vPosition.x = v433->vPosition.x; | |
6392 a1.vPosition.y = v433->vPosition.y; | |
6393 v732 = v433->uActorHeight; | |
6394 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6395 v434 = 8 * dword_50BF30[a2]; | |
6396 LOBYTE(v434) = v434 | 3; | |
6397 a1.field_5C = v434; | |
6398 a1.Create(0, v1, v1, v1); | |
6399 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) | |
6400 { | |
6401 v732 = amount << 7; | |
6402 v433->pActorBuffs[4].Apply( | |
6403 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
6404 v731, | |
6405 v1, | |
6406 v1, | |
6407 v1); | |
6408 } | |
6409 } | |
6410 goto LABEL_1056; | |
6411 case 64: | |
6412 v435 = v12 - 2; | |
6413 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
6414 amount = v1; | |
6415 else | |
6416 amount = 86400 * v2; | |
6417 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6418 goto LABEL_83; | |
6419 v437 = v3->uPlayerID_2; | |
6420 v438 = v3->spellnum; | |
6421 v439 = pGame->GetStru6(); | |
6422 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); | |
6423 v440 = v3->uPlayerID_2; | |
6424 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6425 { | |
6426 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
187 | 6427 pParty->pPlayers[v440].PlaySound(SPEECH_25, v1); |
0 | 6428 if ( v731 == 4 ) |
6429 { | |
6430 v441 = v3->uPlayerID_2; | |
6431 LODWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6432 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6433 } | |
6434 else | |
6435 { | |
6436 v732 = amount << 7; | |
6437 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6438 5u, | |
6439 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6440 } | |
6441 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6442 LABEL_720: | |
6443 v377->SetCondition(1u, v1); | |
6444 } | |
6445 goto LABEL_1056; | |
6446 case 42: | |
6447 v442 = v12 - 2; | |
6448 if ( !v442 ) | |
6449 goto LABEL_855; | |
6450 v443 = v442 - 1; | |
6451 if ( v443 ) | |
6452 { | |
6453 if ( v443 == 1 ) | |
6454 v444 = 4 * v2; | |
6455 else | |
6456 LABEL_855: | |
6457 v444 = 2 * v2; | |
6458 } | |
6459 else | |
6460 { | |
6461 v444 = 3 * v2; | |
6462 } | |
6463 amount = v444; | |
6464 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6465 goto LABEL_83; | |
6466 v445 = a2 >> 3; | |
141 | 6467 if ( (a2 & 7) == OBJECT_Item) |
0 | 6468 { |
6469 v449 = (char *)&pLayingItems[v445].stru_24; | |
6470 v450 = *(int *)v449; | |
6471 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6472 { | |
6473 party_finds_gold(*((int *)v449 + 3), 0); | |
6474 viewparams->bRedrawGameUI = 1; | |
6475 } | |
6476 else | |
6477 { | |
189 | 6478 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
0 | 6479 ShowStatusBarString(pTmpBuf2, 2u); |
6480 if ( !pParty->AddItem(&pLayingItems[v445].stru_24) ) | |
6481 pParty->SetHoldingItem(&pLayingItems[v445].stru_24); | |
6482 } | |
6483 LayingItem::_42F933(v445); | |
6484 } | |
6485 else | |
6486 { | |
141 | 6487 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6488 { |
6489 stru_50C198.LootActor(&pActors[v445]); | |
6490 } | |
6491 else | |
6492 { | |
141 | 6493 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6494 { |
141 | 6495 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6496 goto LABEL_1056; |
6497 dword_507CD8 = 1; | |
6498 v677 = 1; | |
6499 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6500 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6501 else | |
6502 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6503 goto LABEL_866; | |
6504 } | |
6505 v447 = &pLevelDecorations[v445]; | |
6506 dword_507CD8 = 1; | |
6507 v448 = v447->field_16_event_id; | |
6508 if ( v448 != (short)v1 ) | |
6509 { | |
6510 v677 = 1; | |
6511 v446 = v448; | |
6512 LABEL_866: | |
6513 EventProcessor(v446, a2, v677); | |
6514 goto LABEL_1056; | |
6515 } | |
6516 if ( v447->IsInteractive() ) | |
6517 { | |
6518 _5C3420_pDecoration = v447; | |
6519 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); | |
6520 _5C3420_pDecoration = (LevelDecoration *)v1; | |
6521 } | |
6522 } | |
6523 } | |
6524 goto LABEL_1056; | |
6525 case 67: | |
6526 v451 = v12 - 2; | |
6527 if ( v451 ) | |
6528 { | |
6529 v452 = v451 - 1; | |
6530 if ( v452 ) | |
6531 { | |
6532 if ( v452 == 1 ) | |
6533 { | |
6534 amount = v1; | |
6535 goto LABEL_883; | |
6536 } | |
6537 v453 = 180 * v2; | |
6538 } | |
6539 else | |
6540 { | |
6541 v453 = 86400 * v2; | |
6542 } | |
6543 } | |
6544 else | |
6545 { | |
6546 v453 = 3600 * v2; | |
6547 } | |
6548 amount = v453; | |
6549 LABEL_883: | |
6550 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6551 goto LABEL_83; | |
6552 v454 = v3->uPlayerID_2; | |
6553 v455 = v3->spellnum; | |
6554 v456 = pGame->GetStru6(); | |
6555 pGame->GetStru6()->SetPlayerBuffAnim(v455, v454); | |
6556 v323 = v3->uPlayerID_2; | |
6557 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6558 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6559 goto LABEL_1056; | |
6560 if ( v731 == 4 ) | |
6561 { | |
6562 LABEL_637: | |
6563 *(int *)v324 = v1; | |
6564 *((int *)v324 + 1) = v1; | |
6565 goto LABEL_1056; | |
6566 } | |
6567 v732 = amount << 7; | |
6568 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6569 v656 = 1; | |
6570 LABEL_640: | |
6571 v325 = &pParty->pPlayers[v323]; | |
6572 goto LABEL_641; | |
6573 case 68: | |
6574 v457 = v12 - 2; | |
6575 if ( v457 ) | |
6576 { | |
6577 v458 = v457 - 1; | |
6578 if ( v458 ) | |
6579 { | |
6580 if ( v458 == 1 ) | |
6581 v459 = 5 * v2 + 5; | |
6582 else | |
6583 v459 = 2 * v2 + 5; | |
6584 } | |
6585 else | |
6586 { | |
6587 v459 = 4 * v2 + 5; | |
6588 } | |
6589 } | |
6590 else | |
6591 { | |
6592 v459 = 3 * v2 + 5; | |
6593 } | |
6594 amount = v459; | |
6595 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6596 goto LABEL_83; | |
6597 v460 = *(int *)&v3->field_C; | |
6598 if ( v460 == v1 ) | |
6599 { | |
6600 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6601 LABEL_904: | |
6602 v674 = v3->uPlayerID_2; | |
6603 LABEL_685: | |
6604 v352 = v3->spellnum; | |
6605 v353 = pGame->GetStru6(); | |
6606 pGame->GetStru6()->SetPlayerBuffAnim(v352, v674); | |
6607 } | |
6608 else | |
6609 { | |
141 | 6610 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6611 { |
6612 v461 = &pActors[v460 >> 3]; | |
6613 v462 = v461->uAIState; | |
6614 v463 = v461->pMonsterInfo.uHP; | |
6615 if ( v462 != 5 ) | |
6616 { | |
6617 if ( v462 != 4 ) | |
6618 { | |
6619 if ( v462 != 19 ) | |
6620 { | |
6621 if ( v462 != 11 ) | |
6622 { | |
6623 v461->sCurrentHP += amount; | |
6624 if ( v461->sCurrentHP > v463 ) | |
6625 v461->sCurrentHP = v463; | |
6626 } | |
6627 } | |
6628 } | |
6629 } | |
6630 } | |
6631 } | |
6632 goto LABEL_1056; | |
6633 case 72: | |
6634 v464 = v12 - 2; | |
6635 if ( !v464 ) | |
6636 goto LABEL_910; | |
6637 v465 = v464 - 1; | |
6638 if ( v465 ) | |
6639 { | |
6640 if ( v465 == 1 ) | |
6641 { | |
6642 amount = v1; | |
6643 goto LABEL_912; | |
6644 } | |
6645 LABEL_910: | |
6646 v466 = 3600 * v2; | |
6647 } | |
6648 else | |
6649 { | |
6650 v466 = 86400 * v2; | |
6651 } | |
6652 amount = v466; | |
6653 LABEL_912: | |
6654 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6655 goto LABEL_83; | |
6656 v467 = v3->uPlayerID_2; | |
6657 v468 = v3->spellnum; | |
6658 v469 = pGame->GetStru6(); | |
6659 pGame->GetStru6()->SetPlayerBuffAnim(v468, v467); | |
6660 v470 = v3->uPlayerID_2; | |
6661 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6662 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6663 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6664 goto LABEL_1056; | |
6665 if ( v731 == 4 ) | |
6666 { | |
6667 LODWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6668 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6669 v471 = v3->uPlayerID_2; | |
6670 LODWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6671 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6672 v472 = v3->uPlayerID_2; | |
6673 LODWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6674 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6675 goto LABEL_1056; | |
6676 } | |
6677 v732 = amount << 7; | |
6678 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6679 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6680 6u, | |
6681 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6682 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6683 8u, | |
6684 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6685 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6686 v656 = 10; | |
6687 goto LABEL_937; | |
6688 case 75: | |
6689 amount = v2; | |
6690 LODWORD(v733) = 3600 * v2; | |
6691 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6692 goto LABEL_83; | |
6693 v474 = v3->spellnum; | |
6694 v475 = pGame->GetStru6(); | |
6695 pGame->GetStru6()->SetPlayerBuffAnim(v474, v1); | |
6696 v476 = v3->spellnum; | |
6697 v477 = pGame->GetStru6(); | |
6698 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1u); | |
6699 v478 = v3->spellnum; | |
6700 v479 = pGame->GetStru6(); | |
6701 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2u); | |
6702 v480 = v3->spellnum; | |
6703 v481 = pGame->GetStru6(); | |
6704 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3u); | |
6705 v668 = v1; | |
6706 v732 = (int)v733 << 7; | |
6707 v658 = v1; | |
6708 v653 = v2; | |
6709 v651 = v731; | |
6710 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6711 v27 = (char *)&pParty->pPartyBuffs[13]; | |
6712 goto LABEL_101; | |
6713 case 73: | |
6714 LODWORD(v733) = 3600 * v2; | |
6715 amount = v2; | |
6716 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6717 goto LABEL_83; | |
6718 if ( v731 == 4 ) | |
6719 { | |
6720 v482 = v3->spellnum; | |
6721 v483 = pGame->GetStru6(); | |
6722 pGame->GetStru6()->SetPlayerBuffAnim(v482, v1); | |
6723 v484 = v3->spellnum; | |
6724 v485 = pGame->GetStru6(); | |
6725 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1u); | |
6726 v486 = v3->spellnum; | |
6727 v487 = pGame->GetStru6(); | |
6728 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2u); | |
6729 v488 = v3->spellnum; | |
6730 v489 = pGame->GetStru6(); | |
6731 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3u); | |
6732 v732 = (int)v733 << 7; | |
6733 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6734 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6735 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6736 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6737 v668 = v1; | |
6738 v658 = v2; | |
6739 v653 = v2; | |
6740 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; | |
6741 v651 = 4; | |
6742 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; | |
6743 v27 = (char *)&pParty->pPlayers[3].pPlayerBuffs[6]; | |
6744 goto LABEL_104; | |
6745 } | |
6746 v490 = v3->uPlayerID_2; | |
6747 v491 = v3->spellnum; | |
6748 v492 = pGame->GetStru6(); | |
6749 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); | |
6750 v668 = v1; | |
6751 v732 = (int)v733 << 7; | |
6752 v658 = v2; | |
6753 v653 = v2; | |
6754 v651 = v731; | |
6755 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6756 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; | |
6757 goto LABEL_103; | |
6758 case 74: | |
6759 v493 = v12 - 2; | |
6760 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
6761 amount = v1; | |
6762 else | |
6763 amount = 86400 * v2; | |
6764 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6765 goto LABEL_83; | |
6766 v495 = v3->uPlayerID_2; | |
6767 v496 = v3->spellnum; | |
6768 v497 = pGame->GetStru6(); | |
6769 pGame->GetStru6()->SetPlayerBuffAnim(v496, v495); | |
6770 v498 = v3->uPlayerID_2; | |
6771 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6772 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6773 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6774 goto LABEL_1056; | |
6775 if ( v731 == 4 ) | |
6776 { | |
6777 LODWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6778 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6779 v499 = v3->uPlayerID_2; | |
6780 LODWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6781 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6782 v500 = v3->uPlayerID_2; | |
6783 LODWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6784 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6785 } | |
6786 else | |
6787 { | |
6788 v732 = amount << 7; | |
6789 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6790 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6791 7u, | |
6792 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6793 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6794 9u, | |
6795 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6796 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6797 v656 = 11; | |
6798 LABEL_937: | |
112 | 6799 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6800 LABEL_641: |
6801 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6802 } | |
6803 goto LABEL_1056; | |
6804 case 77: | |
6805 amount = 5 * v2 + 10; | |
6806 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6807 goto LABEL_83; | |
6808 v501 = pParty->pPlayers; | |
6809 do | |
6810 { | |
6811 v502 = v3->spellnum; | |
6812 v503 = pGame->GetStru6(); | |
6813 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); | |
6814 v501->Heal(amount); | |
6815 ++v501; | |
6816 ++v1; | |
6817 } | |
6818 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6819 goto LABEL_1056; | |
6820 case 80: | |
6821 sRecoveryTime -= v2; | |
6822 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6823 goto LABEL_83; | |
6824 v504 = pGame->GetStru6(); | |
6825 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); | |
6826 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6827 ++a1.uItemType; | |
6828 HIDWORD(v733) = v505; | |
6829 v690 = v1; | |
6830 v689 = v1; | |
6831 v688 = v1; | |
6832 a1.stru_24.Reset(); | |
6833 a1.field_48 = v3->spellnum; | |
6834 a1.field_4C = v2; | |
6835 a1.field_50 = v731; | |
6836 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6837 a1.uAttributes = v1; | |
6838 a1.uSectorID = v1; | |
6839 a1.uSpriteFrameID = v1; | |
6840 v506 = v3->uPlayerID; | |
6841 a1.field_60_distance_related_prolly_lod = 0; | |
6842 a1.uFacing = v1; | |
6843 v506 *= 8; | |
303 | 6844 LOBYTE(v506) = v506 | OBJECT_Player; |
6845 a1.field_58_pid = v506; | |
0 | 6846 a1.uSoundID = LOWORD(v3->field_10); |
6847 a2 = v1; | |
6848 if ( SHIDWORD(v733) > v1 ) | |
6849 { | |
6850 do | |
6851 { | |
6852 v507 = dword_50BF30[a2]; | |
6853 a1.vPosition.x = pActors[v507].vPosition.x; | |
6854 a1.vPosition.y = pActors[v507].vPosition.y; | |
6855 v732 = pActors[v507].uActorHeight; | |
6856 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6857 v508 = 8 * dword_50BF30[a2]; | |
6858 LOBYTE(v508) = v508 | 3; | |
6859 a1.field_5C = v508; | |
6860 v509 = a1.Create(0, v1, v1, v1); | |
6861 v510 = a2; | |
6862 DamageMonsterFromParty(8 * v509 | 2, dword_50BF30[a2], (Vec3_int_ *)&v688); | |
6863 a2 = v510 + 1; | |
6864 } | |
6865 while ( v510 + 1 < SHIDWORD(v733) ); | |
6866 } | |
6867 for ( a2 = v1; a2 < SHIDWORD(v733); ++a2 ) | |
6868 { | |
6869 v511 = &pActors[dword_50BF30[a2]]; | |
6870 a1.vPosition.x = v511->vPosition.x; | |
6871 a1.vPosition.y = v511->vPosition.y; | |
6872 v732 = v511->uActorHeight; | |
6873 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6874 v512 = 8 * dword_50BF30[a2]; | |
6875 LOBYTE(v512) = v512 | 3; | |
6876 a1.field_5C = v512; | |
6877 a1.Create(0, v1, v1, v1); | |
6878 v513 = v511->pActorBuffs; | |
6879 v726 = (Player *)22; | |
6880 do | |
6881 { | |
6882 v513->Reset(); | |
6883 ++v513; | |
6884 v726 = (Player *)((char *)v726 - 1); | |
6885 } | |
6886 while ( *(float *)&v726 != 0.0 ); | |
6887 } | |
6888 goto LABEL_1056; | |
6889 case 82: | |
6890 v514 = v12 - 2; | |
6891 if ( !v514 ) | |
6892 goto LABEL_955; | |
6893 v515 = v514 - 1; | |
6894 if ( v515 ) | |
6895 { | |
6896 if ( v515 == 1 ) | |
6897 { | |
6898 v516 = 900 * v2; | |
6899 amount = 5; | |
6900 } | |
6901 else | |
6902 { | |
6903 LABEL_955: | |
6904 v516 = 300 * v2; | |
6905 amount = 1; | |
6906 } | |
6907 } | |
6908 else | |
6909 { | |
6910 v516 = 900 * v2; | |
6911 amount = 3; | |
6912 } | |
6913 v733 = __PAIR__(v1, v516); | |
6914 v517 = 8 * v3->uPlayerID; | |
6915 LOBYTE(v517) = v517 | 4; | |
6916 if ( (signed int)uNumActors > v1 ) | |
6917 { | |
90 | 6918 v518 = pActors;//[0].uAIState; |
6919 v726b = uNumActors; | |
0 | 6920 do |
6921 { | |
90 | 6922 v519 = v518->uAIState; |
6923 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6924 ++HIDWORD(v733); |
90 | 6925 ++v518; |
6926 --v726; | |
0 | 6927 } |
90 | 6928 while ( v726 != 0 ); |
0 | 6929 } |
6930 if ( SHIDWORD(v733) >= amount ) | |
6931 { | |
6932 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6933 goto LABEL_201; | |
6934 } | |
6935 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6936 goto LABEL_83; | |
6937 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); | |
6938 goto LABEL_1056; | |
6939 case 83: | |
6940 v520 = v12 - 2; | |
6941 if ( !v520 ) | |
6942 goto LABEL_973; | |
6943 v521 = v520 - 1; | |
6944 if ( v521 ) | |
6945 { | |
6946 if ( v521 == 1 ) | |
6947 { | |
6948 LODWORD(v733) = 18000 * v2; | |
6949 v522 = 5 * v2 + 10; | |
6950 } | |
6951 else | |
6952 { | |
6953 LABEL_973: | |
6954 LODWORD(v733) = 10800 * v2; | |
6955 v522 = 3 * v2 + 10; | |
6956 } | |
6957 } | |
6958 else | |
6959 { | |
6960 LODWORD(v733) = 14400 * v2; | |
6961 v522 = 4 * v2 + 10; | |
6962 } | |
6963 amount = v522; | |
6964 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6965 goto LABEL_83; | |
6966 v523 = v3->spellnum; | |
6967 v524 = pGame->GetStru6(); | |
6968 pGame->GetStru6()->SetPlayerBuffAnim(v523, v1); | |
6969 v83 = 1; | |
6970 v525 = v3->spellnum; | |
6971 v526 = pGame->GetStru6(); | |
6972 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1u); | |
6973 v527 = v3->spellnum; | |
6974 v528 = pGame->GetStru6(); | |
6975 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2u); | |
6976 v529 = v3->spellnum; | |
6977 v530 = pGame->GetStru6(); | |
6978 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3u); | |
6979 v673 = v1; | |
6980 v732 = (int)v733 << 7; | |
6981 v662 = v1; | |
6982 v655 = amount; | |
6983 v652 = v731; | |
6984 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6985 v137 = (char *)&pParty->pPartyBuffs[2]; | |
6986 goto LABEL_976; | |
6987 case 84: | |
6988 v67 = 2; | |
6989 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6990 { | |
6991 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6992 goto LABEL_202; | |
6993 } | |
6994 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6995 goto LABEL_83; | |
6996 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6997 ++a1.uItemType; | |
6998 v726 = (Player *)v531; | |
6999 v696 = v1; | |
7000 v695 = v1; | |
7001 v694 = v1; | |
7002 a1.stru_24.Reset(); | |
7003 a1.field_48 = v3->spellnum; | |
7004 a1.field_4C = v2; | |
7005 a1.field_50 = v731; | |
7006 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7007 a1.uAttributes = v1; | |
7008 a1.uSectorID = v1; | |
7009 a1.uSpriteFrameID = v1; | |
7010 v532 = v3->uPlayerID; | |
7011 a1.field_60_distance_related_prolly_lod = 0; | |
7012 a1.uFacing = v1; | |
7013 v532 *= 8; | |
303 | 7014 LOBYTE(v532) = v532 | OBJECT_Player; |
7015 a1.field_58_pid = v532; | |
0 | 7016 a1.uSoundID = LOWORD(v3->field_10); |
7017 a2 = v1; | |
7018 if ( (signed int)v726 > v1 ) | |
7019 { | |
7020 do | |
7021 { | |
7022 v533 = dword_50BF30[a2]; | |
7023 a1.vPosition.x = pActors[v533].vPosition.x; | |
7024 a1.vPosition.y = pActors[v533].vPosition.y; | |
7025 v732 = pActors[v533].uActorHeight; | |
7026 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7027 v534 = 8 * dword_50BF30[a2]; | |
7028 LOBYTE(v534) = v534 | 3; | |
7029 a1.field_5C = v534; | |
7030 v535 = a1.Create(0, v1, v1, v1); | |
7031 v536 = a2; | |
7032 DamageMonsterFromParty(8 * v535 | 2, dword_50BF30[a2], (Vec3_int_ *)&v694); | |
7033 a2 = v536 + 1; | |
7034 } | |
7035 while ( v536 + 1 < (signed int)v726 ); | |
7036 } | |
7037 v537 = pGame->GetStru6(); | |
7038 pGame->GetStru6()->_4A8BFC(); | |
7039 goto LABEL_1056; | |
7040 case 85: | |
7041 v538 = v12 - 2; | |
7042 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
7043 { | |
7044 amount = 5 * v2; | |
7045 v540 = 18000 * v2; | |
7046 } | |
7047 else | |
7048 { | |
7049 amount = 4 * v2; | |
7050 v540 = 14400 * v2; | |
7051 } | |
7052 v730 = v540; | |
7053 LODWORD(v733) = v540; | |
7054 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7055 goto LABEL_83; | |
7056 v541 = v3->spellnum; | |
7057 v542 = pGame->GetStru6(); | |
7058 pGame->GetStru6()->SetPlayerBuffAnim(v541, v1); | |
7059 v543 = v3->spellnum; | |
7060 v544 = pGame->GetStru6(); | |
7061 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1u); | |
7062 v545 = v3->spellnum; | |
7063 v546 = pGame->GetStru6(); | |
7064 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2u); | |
7065 v547 = v3->spellnum; | |
7066 v548 = pGame->GetStru6(); | |
7067 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3u); | |
7068 v732 = v730 << 7; | |
7069 v549 = (double)(v730 << 7) * 0.033333335; | |
7070 *((float *)&v733 + 1) = v549; | |
7071 v712 = (signed __int64)v549; | |
7072 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, v1, v1); | |
7073 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7074 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7075 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7076 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7077 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7078 v550 = v2 + 5; | |
7079 pParty->pPartyBuffs[ 5].Apply( | |
7080 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7081 v731, | |
7082 v550, | |
7083 v1, | |
7084 v1); | |
7085 v668 = v1; | |
7086 v658 = v1; | |
7087 v653 = v550; | |
7088 v651 = v731; | |
7089 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); | |
7090 LABEL_992: | |
7091 v27 = (char *)&pParty->pPartyBuffs[19]; | |
7092 goto LABEL_103; | |
7093 case 86: | |
7094 v551 = v12 - 2; | |
7095 if ( !v551 ) | |
7096 goto LABEL_998; | |
7097 v552 = v551 - 1; | |
7098 if ( v552 ) | |
7099 { | |
7100 if ( v552 == 1 ) | |
7101 { | |
7102 amount = 15; | |
7103 HIDWORD(v733) = 20; | |
7104 goto LABEL_1000; | |
7105 } | |
7106 LABEL_998: | |
7107 v678 = 4; | |
7108 } | |
7109 else | |
7110 { | |
7111 v678 = 12; | |
7112 } | |
7113 amount = v678; | |
7114 HIDWORD(v733) = v678; | |
7115 LABEL_1000: | |
7116 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7117 goto LABEL_83; | |
7118 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); | |
7119 v732 = (300 * amount * v2 + 60) << 7; | |
7120 v730 = v2 + 5; | |
7121 v726 = (Player *)v1; | |
89 | 7122 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 7123 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
7124 do | |
7125 { | |
7126 v554 = v3->spellnum; | |
7127 v555 = pGame->GetStru6(); | |
7128 pGame->GetStru6()->SetPlayerBuffAnim(v554, v1); | |
7129 v556 = v3->spellnum; | |
7130 v557 = pGame->GetStru6(); | |
7131 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1u); | |
7132 v558 = v3->spellnum; | |
7133 v559 = pGame->GetStru6(); | |
7134 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2u); | |
7135 v560 = v3->spellnum; | |
7136 v561 = pGame->GetStru6(); | |
7137 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3u); | |
89 | 7138 //((SpellBuff *)(v553 + 6056))->Apply( |
7139 v553->pPlayerBuffs[4].Apply( | |
0 | 7140 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7141 v731, | |
7142 v730, | |
7143 v1, | |
7144 v1); | |
7145 if ( *(_QWORD *)v553 ) | |
7146 v726 = (Player *)1; | |
89 | 7147 ++v553; |
7148 } | |
7149 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 7150 v562 = v731; |
7151 pParty->pPartyBuffs[9].Apply( | |
7152 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7153 v731, | |
7154 v730, | |
7155 v1, | |
7156 v1); | |
7157 pParty->pPartyBuffs[14].Apply( | |
7158 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7159 v562, | |
7160 v1, | |
7161 v1, | |
7162 v1); | |
7163 pParty->pPartyBuffs[15].Apply( | |
7164 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7165 v562, | |
7166 v730, | |
7167 v1, | |
7168 v1); | |
7169 if ( v726 != (Player *)v1 ) | |
7170 goto LABEL_1056; | |
7171 v668 = v1; | |
7172 v732 = (int)y << 7; | |
7173 v658 = v1; | |
7174 v653 = v730; | |
7175 v651 = v562; | |
7176 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 | |
7177 + (double)(signed __int64)pParty->uTimePlayed); | |
7178 v27 = (char *)&pParty->pPartyBuffs[8]; | |
7179 goto LABEL_103; | |
7180 case 88: | |
7181 amount = 3; | |
7182 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
7183 goto LABEL_200; | |
7184 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7185 goto LABEL_83; | |
7186 a2 = v1; | |
7187 _this = (ItemGen *)&pPlayers[1]; | |
7188 do | |
7189 { | |
7190 v563 = 0; | |
7191 do | |
7192 { | |
7193 v564 = _this->uItemID; | |
7194 *(int *)(v563 + _this->uItemID) = v1; | |
7195 v563 += 8; | |
7196 *(int *)(v563 + v564 - 4) = v1; | |
7197 } | |
7198 while ( v563 <= 128 ); | |
7199 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
7200 v566 = (Player **)_this; | |
7201 *(int *)(_this->uItemID + 6460) = v565; | |
7202 v567 = (*v566)->GetMaxMana(); | |
7203 v568 = a2; | |
7204 *(int *)(_this->uItemID + 6464) = v567; | |
7205 v569 = v3->spellnum; | |
7206 v570 = pGame->GetStru6(); | |
7207 pGame->GetStru6()->SetPlayerBuffAnim(v569, v568); | |
7208 ++a2; | |
7209 _this = (ItemGen *)((char *)_this + 4); | |
7210 } | |
7211 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
7212 v571 = pPlayer; | |
7213 v572 = (char *)&pPlayer->sAgeModifier; | |
7214 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
7215 *(short *)v572 = 120; | |
7216 else | |
7217 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
7218 sRecoveryTime += -5 * v2; | |
7219 ++v571->uNumDivineInterventionCastsThisDay; | |
7220 goto LABEL_1056; | |
7221 case 89: | |
7222 v573 = v12 - 2; | |
7223 if ( v573 ) | |
7224 { | |
7225 v574 = v573 - 1; | |
7226 if ( v574 ) | |
7227 { | |
7228 if ( v574 == 1 ) | |
7229 v575 = 5 * v2; | |
7230 else | |
7231 v575 = 2 * v2; | |
7232 } | |
7233 else | |
7234 { | |
7235 v575 = 4 * v2; | |
7236 } | |
7237 } | |
7238 else | |
7239 { | |
7240 v575 = 3 * v2; | |
7241 } | |
7242 amount = v575; | |
7243 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7244 goto LABEL_83; | |
7245 v576 = *(int *)&v3->field_C; | |
7246 if ( v576 == v1 ) | |
7247 { | |
7248 v583 = v3->uPlayerID_2; | |
7249 v584 = v3->spellnum; | |
7250 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
7251 v586 = pGame->GetStru6(); | |
7252 pGame->GetStru6()->SetPlayerBuffAnim(v584, v583); | |
7253 if ( *((_QWORD *)v585 + 14) ) | |
7254 { | |
7255 ((Player *)v585)->SetCondition(0x11u, 1); | |
7256 v587 = ((Player *)v585)->GetSexByVoice(); | |
7257 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7258 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7259 } | |
7260 goto LABEL_83; | |
7261 } | |
7262 v577 = (Player *)(v576 >> 3); | |
7263 v726 = v577; | |
7264 if ( v577 == (Player *)-1 ) | |
7265 { | |
7266 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7267 goto LABEL_201; | |
7268 } | |
7269 v578 = (int)&pActors[(int)v577]; | |
7270 v721 = v578; | |
7271 if ( *(short *)(v578 + 40) > (signed __int16)v1 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) | |
7272 goto LABEL_200; | |
7273 ++a1.uItemType; | |
7274 a1.stru_24.Reset(); | |
7275 a1.field_48 = v3->spellnum; | |
7276 a1.field_4C = v2; | |
7277 a1.field_50 = v731; | |
7278 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7279 a1.uAttributes = v1; | |
7280 a1.uSectorID = v1; | |
7281 a1.uSpriteFrameID = v1; | |
7282 v580 = v3->uPlayerID; | |
7283 a1.field_60_distance_related_prolly_lod = 0; | |
7284 v581 = v721; | |
7285 v580 *= 8; | |
303 | 7286 LOBYTE(v580) = v580 | OBJECT_Player; |
0 | 7287 a1.uFacing = v1; |
303 | 7288 a1.field_58_pid = v580; |
0 | 7289 a1.uSoundID = LOWORD(v3->field_10); |
7290 a1.vPosition.x = *(short *)(v721 + 142); | |
7291 a1.vPosition.y = *(short *)(v721 + 144); | |
7292 v732 = *(short *)(v721 + 138); | |
7293 v582 = 8 * (int)v726; | |
7294 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7295 LOBYTE(v582) = 8 * (char)v726 | 3; | |
7296 a1.field_5C = v582; | |
7297 a1.Create(0, v1, v1, v1); | |
7298 if ( *(char *)(v581 + 52) > amount ) | |
7299 goto LABEL_83; | |
7300 Actor::Resurrect((unsigned int)v726); | |
7301 *(char *)(v581 + 61) = 0; | |
7302 *(char *)(v581 + 53) = 0; | |
7303 *(char *)(v581 + 54) = 0; | |
7304 *(char *)(v581 + 55) = 0; | |
7305 *(char *)(v581 + 56) = 0; | |
7306 *(char *)(v581 + 57) = 0; | |
7307 *(int *)(v581 + 712) = 9999; | |
7308 *(char *)(v581 + 38) &= 0xF7u; | |
7309 *(int *)(v581 + 708) = v1; | |
7310 ((SpellBuff *)(v581 + 356))->Reset(); | |
7311 ((SpellBuff *)(v581 + 228))->Reset(); | |
7312 ((SpellBuff *)(v581 + 404))->Reset(); | |
7313 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7314 *(short *)(v581 + 40) = 10 * amount; | |
7315 goto LABEL_1056; | |
7316 case 91: | |
7317 v588 = v12 - 1; | |
7318 amount = 16; | |
7319 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7320 { | |
7321 if ( v590 == 1 ) | |
7322 LODWORD(v733) = v1; | |
7323 } | |
7324 else | |
7325 { | |
7326 LODWORD(v733) = 3600 * v2; | |
7327 } | |
7328 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7329 goto LABEL_83; | |
7330 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; | |
7331 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7332 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7333 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7334 || *(char *)(HIDWORD(v733) + 20) & 2 | |
7335 || *(int *)(HIDWORD(v733) + 12) != v1 | |
7336 || *(int *)(HIDWORD(v733) + 4) != v1 | |
7337 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 | |
377 | 7338 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) |
0 | 7339 goto LABEL_199; |
7340 v592 = HIDWORD(v733); | |
7341 v14 = v731 == 4; | |
7342 *(int *)(HIDWORD(v733) + 12) = 16; | |
7343 if ( !v14 ) | |
7344 { | |
7345 v732 = (int)v733 << 7; | |
7346 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7347 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7348 *(int *)(v592 + 20) |= 8u; | |
7349 } | |
7350 *(char *)(v592 + 20) |= 0x80u; | |
7351 goto LABEL_1055; | |
7352 case 93: | |
7353 v593 = v12 - 2; | |
7354 if ( !v593 ) | |
7355 goto LABEL_1062; | |
7356 v594 = v593 - 1; | |
7357 if ( v594 ) | |
7358 { | |
7359 if ( v594 == 1 ) | |
7360 amount = 9; | |
7361 else | |
7362 LABEL_1062: | |
7363 amount = 5; | |
7364 } | |
7365 else | |
7366 { | |
7367 amount = 7; | |
7368 } | |
7369 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7370 goto LABEL_83; | |
7371 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
7372 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7373 a1.stru_24.Reset(); | |
7374 a1.field_48 = v3->spellnum; | |
7375 a1.field_4C = v2; | |
7376 a1.field_50 = v731; | |
7377 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7378 a1.vPosition.x = pParty->vPosition.x; | |
7379 a1.vPosition.y = pParty->vPosition.y; | |
7380 a1.uAttributes = v1; | |
7381 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
7382 a1.uSectorID = pIndoor->GetSector( | |
7383 pParty->vPosition.x, | |
7384 pParty->vPosition.y, | |
7385 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
7386 a1.uSpriteFrameID = v1; | |
7387 v595 = 8 * v3->uPlayerID; | |
303 | 7388 LOBYTE(v595) = v595 | OBJECT_Player; |
7389 a1.field_58_pid = v595; | |
0 | 7390 a1.field_5C = a2; |
7391 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7392 a1.uSoundID = LOWORD(v3->field_10); | |
7393 if ( pParty->bTurnBasedModeOn == 1 ) | |
7394 LOBYTE(a1.uAttributes) |= 4u; | |
7395 v596 = (signed int)v726 / -2; | |
7396 y = (char *)((signed int)v726 / 2); | |
7397 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7398 { | |
7399 v597 = v715.uYawAngle; | |
7400 do | |
7401 { | |
7402 a1.uFacing = v596 + v597; | |
7403 if ( a1.Create( | |
7404 v596 + v597, | |
7405 v715.uPitchAngle, | |
7406 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7407 v3->uPlayerID + 1) != -1 | |
7408 && pParty->bTurnBasedModeOn == 1 ) | |
7409 ++pTurnEngine->field_1C; | |
7410 v596 += v732; | |
7411 } | |
7412 while ( v596 <= (signed int)y ); | |
7413 } | |
7414 goto LABEL_1056; | |
7415 case 94: | |
7416 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7417 goto LABEL_83; | |
7418 if ( v731 == 1 || v731 == 2 ) | |
7419 { | |
7420 v598 = 180 * v2; | |
7421 goto LABEL_1081; | |
7422 } | |
7423 if ( v731 == 3 ) | |
7424 { | |
7425 v598 = 300 * v2; | |
7426 LABEL_1081: | |
7427 LODWORD(v733) = v598; | |
7428 goto LABEL_1082; | |
7429 } | |
7430 if ( v731 == 4 ) | |
7431 LODWORD(v733) = 29030400; | |
7432 LABEL_1082: | |
7433 v599 = a2 >> 3; | |
141 | 7434 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7435 goto LABEL_1056; |
7436 v730 = 836 * v599; | |
7437 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
7438 goto LABEL_83; | |
90 | 7439 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7440 goto LABEL_200; |
90 | 7441 pActors[v599].pActorBuffs[9].Reset(); |
7442 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7443 v732 = (int)v733 << 7; |
90 | 7444 pActors[v599].pActorBuffs[12].Apply( |
0 | 7445 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
7446 v731, | |
7447 v1, | |
7448 v1, | |
7449 v1); | |
7450 a1.stru_24.Reset(); | |
7451 a1.field_48 = v3->spellnum; | |
7452 a1.field_4C = v2; | |
7453 a1.field_50 = v731; | |
7454 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 7455 v61 = v599; |
0 | 7456 LABEL_1086: |
90 | 7457 v600 = pActors[v61].vPosition.y; |
7458 v601 = pActors[v61].vPosition.x; | |
0 | 7459 a1.uObjectDescID = v60; |
7460 a1.vPosition.x = v601; | |
90 | 7461 v602 = pActors[v61].uActorHeight; |
7462 v603 = pActors[v61].vPosition.z; | |
0 | 7463 a1.vPosition.y = v600; |
7464 v676 = v603 + v602; | |
7465 v665 = v600; | |
7466 a1.vPosition.z = v603 + v602; | |
7467 v657 = v601; | |
7468 LABEL_1087: | |
7469 a1.uAttributes = v1; | |
7470 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); | |
7471 a1.uSpriteFrameID = v1; | |
7472 v604 = 8 * v3->uPlayerID; | |
303 | 7473 LOBYTE(v604) = v604 | OBJECT_Player; |
7474 a1.field_58_pid = v604; | |
0 | 7475 a1.field_5C = a2; |
7476 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7477 a1.uFacing = LOWORD(v715.uYawAngle); | |
7478 LOWORD(v604) = LOWORD(v3->field_10); | |
7479 LOBYTE(a1.uAttributes) |= 0x80u; | |
7480 a1.uSoundID = v604; | |
7481 a1.Create(0, v1, v1, v3->uPlayerID + 1); | |
7482 goto LABEL_1056; | |
7483 case 96: | |
7484 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7485 goto LABEL_83; | |
7486 HIDWORD(v733) = v1; | |
7487 memset(&pStru179, v1, 0xFA0u); | |
7488 _this = (ItemGen *)v1; | |
7489 v605 = (char *)pParty->pHirelings; | |
7490 do | |
7491 { | |
7492 if ( *(int *)v605 != v1 ) | |
7493 { | |
7494 v606 = HIDWORD(v733)++; | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
79
diff
changeset
|
7495 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7496 } |
7497 _this = (ItemGen *)((char *)_this + 1); | |
7498 v605 += 76; | |
7499 } | |
7500 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
7501 _this = (ItemGen *)v1; | |
7502 if ( (signed int)pNPCStats->uNumNewNPCs > v1 ) | |
7503 { | |
7504 v730 = (int)pNPCStats->pNewNPCData; | |
7505 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7506 do | |
7507 { | |
7508 if ( *(char *)(v730 + 8) & 0x80 | |
7509 && (pParty->pHirelings[0].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) | |
7510 && (pParty->pHirelings[1].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
7511 { | |
7512 v607 = HIDWORD(v733); | |
7513 HIDWORD(v733) += 4; | |
7514 *(int *)v607 = (int)_this + 3; | |
7515 } | |
7516 _this = (ItemGen *)((char *)_this + 1); | |
7517 v730 += 76; | |
7518 } | |
7519 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7520 } | |
7521 v608 = v3->uPlayerID_2; | |
7522 if ( v608 != 4 && v608 != 5 | |
7523 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= v1) | |
7524 || v609 >= 3 ) | |
7525 goto LABEL_200; | |
7526 v610 = 76 * v609; | |
7527 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = v1; | |
7528 v611 = pIconsFrameTable->FindIcon("spell96"); | |
7529 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( | |
7530 v611); | |
7531 v232 = 1; | |
7532 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; | |
89 | 7533 v612 = pParty->pPlayers; |
0 | 7534 do |
7535 { | |
89 | 7536 v612->sHealth = v612->GetMaxHealth(); |
7537 v612->sMana = v612->GetMaxMana(); | |
7538 ++v612; | |
7539 } | |
7540 while ( v612 <= &pParty->pPlayers[3] ); | |
7541 v613 = &pOutdoor->ddm; | |
0 | 7542 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7543 v613 = &pIndoor->dlv; |
7544 v613->uReputation += 15; | |
7545 if ( v613->uReputation > 10000 ) | |
7546 v613->uReputation = 10000; | |
0 | 7547 LODWORD(v727) = v232; |
7548 goto LABEL_83; | |
7549 case 95: | |
7550 if ( v12 <= v1 ) | |
7551 goto LABEL_1119; | |
7552 if ( v12 <= 3 ) | |
7553 { | |
7554 v614 = 300 * (v2 + 12); | |
7555 } | |
7556 else | |
7557 { | |
7558 if ( v12 != 4 ) | |
7559 goto LABEL_1119; | |
7560 v614 = 900 * (v2 + 4); | |
7561 } | |
7562 LODWORD(v733) = v614; | |
7563 LABEL_1119: | |
7564 v615 = v2 + 5; | |
7565 amount = v615; | |
7566 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7567 goto LABEL_83; | |
7568 if ( v731 != 3 && v731 != 4 ) | |
7569 { | |
7570 v616 = v3->uPlayerID_2; | |
7571 v617 = v3->spellnum; | |
7572 v618 = pGame->GetStru6(); | |
7573 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); | |
7574 v668 = v1; | |
7575 v658 = v716; | |
7576 v732 = (int)v733 << 7; | |
7577 v653 = v615; | |
7578 v651 = v731; | |
7579 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7580 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; | |
7581 goto LABEL_103; | |
7582 } | |
7583 a2 = v1; | |
7584 v732 = (int)v733 << 7; | |
7585 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7586 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7587 do |
7588 { | |
7589 v620 = a2; | |
7590 v621 = v3->spellnum; | |
7591 v622 = pGame->GetStru6(); | |
7592 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); | |
112 | 7593 v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
0 | 7594 ++a2; |
112 | 7595 ++v619; |
7596 } | |
7597 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7598 goto LABEL_1056; |
7599 case 99: | |
7600 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7601 goto LABEL_83; | |
7602 v726 = (Player *)v1; | |
7603 pGame->GetIndoorCamera(); | |
7604 v623 = (signed __int64)GetPickDepth(); | |
7605 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
7606 v709 = v1; | |
7607 v708 = v1; | |
7608 v707 = v1; | |
7609 a1.stru_24.Reset(); | |
7610 a1.field_48 = v3->spellnum; | |
7611 a1.field_4C = v2; | |
7612 a1.field_50 = v731; | |
7613 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7614 a1.uAttributes = v1; | |
7615 a1.uSectorID = v1; | |
7616 a1.uSpriteFrameID = v1; | |
7617 v624 = v3->uPlayerID; | |
7618 a1.field_60_distance_related_prolly_lod = 0; | |
7619 a1.uFacing = v1; | |
7620 v624 *= 8; | |
303 | 7621 LOBYTE(v624) = v624 | OBJECT_Player; |
7622 a1.field_58_pid = v624; | |
0 | 7623 a1.uSoundID = LOWORD(v3->field_10); |
7624 a2 = v1; | |
7625 if ( SHIDWORD(v733) > v1 ) | |
7626 { | |
7627 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7628 do | |
7629 { | |
7630 v625 = dword_50BF30[a2]; | |
7631 a1.vPosition.x = pActors[v625].vPosition.x; | |
7632 a1.vPosition.y = pActors[v625].vPosition.y; | |
7633 v732 = pActors[v625].uActorHeight; | |
7634 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7635 v626 = 8 * dword_50BF30[a2]; | |
7636 LOBYTE(v626) = v626 | 3; | |
7637 a1.field_5C = v626; | |
7638 v627 = a1.Create(0, v1, v1, v1); | |
7639 v628 = a2; | |
7640 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7641 a2 = v628 + 1; | |
7642 } | |
7643 while ( v628 + 1 < SHIDWORD(v733) ); | |
7644 } | |
7645 v730 = v1; | |
7646 v629 = 1; | |
7647 do | |
7648 { | |
7649 v630 = pPlayers[v629]; | |
7650 if ( !v630->pConditions[2] | |
7651 && !v630->pConditions[12] | |
7652 && !v630->pConditions[13] | |
7653 && !v630->pConditions[14] | |
7654 && !v630->pConditions[15] | |
7655 && !v630->pConditions[16] ) | |
7656 { | |
7657 v631 = v730++; | |
7658 v681[v631] = v629; | |
7659 } | |
7660 ++v629; | |
7661 } | |
7662 while ( v629 <= 4 ); | |
7663 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
7664 HIDWORD(v733) = v1; | |
7665 if ( v730 > v1 ) | |
7666 { | |
7667 do | |
7668 { | |
7669 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7670 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7671 v633->sHealth += v732; | |
7672 v726 = *(Player **)v632; | |
7673 v634 = v726->GetMaxHealth(); | |
7674 if ( v726->sHealth > v634 ) | |
7675 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7676 v635 = HIDWORD(v733); | |
7677 v636 = WORD2(v733); | |
7678 v637 = v3->spellnum; | |
7679 v638 = pGame->GetStru6(); | |
7680 pGame->GetStru6()->SetPlayerBuffAnim(v637, v636); | |
7681 HIDWORD(v733) = v635 + 1; | |
7682 } | |
7683 while ( v635 + 1 < v730 ); | |
7684 } | |
7685 v639 = pGame->GetStru6(); | |
7686 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(v1, 0x40u); | |
7687 goto LABEL_1056; | |
7688 case 98: | |
7689 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7690 { | |
7691 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7692 goto LABEL_201; | |
7693 } | |
7694 v640 = v12 - 2; | |
7695 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7696 amount = 3; | |
349 | 7697 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > v1 ) |
0 | 7698 goto LABEL_200; |
7699 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7700 goto LABEL_83; | |
349 | 7701 pParty->armageddon_timer = 256; |
0 | 7702 pParty->field_16140 = v2; |
7703 ++pPlayer->uNumArmageddonCasts; | |
7704 if ( pParty->bTurnBasedModeOn == 1 ) | |
7705 ++pTurnEngine->field_1C; | |
7706 v726 = (Player *)50; | |
7707 do | |
7708 { | |
7709 v642 = rand() % 4096 - 2048; | |
7710 v643 = rand(); | |
7711 v721 = v642 + pParty->vPosition.x; | |
7712 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
7713 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1); | |
7714 v644 = rand(); | |
7715 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1); | |
7716 v726 = (Player *)((char *)v726 - 1); | |
7717 } | |
7718 while ( *(float *)&v726 != 0.0 ); | |
7719 goto LABEL_1056; | |
7720 default: | |
7721 goto LABEL_83; | |
7722 } | |
7723 while ( 2 ) | |
7724 { | |
7725 if ( v731 == 4 ) | |
7726 { | |
7727 if ( *((_QWORD *)v222 + 2) ) | |
7728 { | |
7729 *((int *)v222 + 4) = v1; | |
7730 *((int *)v222 + 5) = v1; | |
7731 goto LABEL_439; | |
7732 } | |
7733 } | |
7734 else | |
7735 { | |
7736 v732 = amount << 7; | |
7737 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7738 2u, | |
7739 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7740 v222 = (char *)HIDWORD(v733); | |
7741 if ( v223 ) | |
7742 LABEL_439: | |
187 | 7743 ((Player *)v222)->PlaySound(SPEECH_103, v1); |
0 | 7744 } |
7745 v222 += 6972; | |
7746 HIDWORD(v733) = (int)v222; | |
7747 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7748 goto LABEL_1056; | |
7749 continue; | |
7750 } | |
7751 } | |
7752 if ( pParty->bTurnBasedModeOn == v1 ) | |
7753 { | |
7754 v646 = pPlayer; | |
7755 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
7756 v647 = n; | |
7757 } | |
7758 else | |
7759 { | |
7760 v647 = n; | |
7761 v646 = pPlayer; | |
7762 v648 = sRecoveryTime; | |
7763 v649 = pPlayer; | |
7764 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
7765 v649->SetRecoveryTime(v648); | |
7766 pTurnEngine->_40471C(); | |
7767 } | |
7768 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
7769 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
7770 v711[v647].spellnum = v1; | |
7771 v646->sMana -= uRequiredMana; | |
7772 } | |
7773 //----- (0042EB42) -------------------------------------------------------- | |
7774 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7775 { | |
7776 unsigned int v2; // edx@1 | |
7777 signed int v3; // eax@1 | |
7778 char *v4; // ecx@2 | |
7779 | |
7780 v2 = this->uNumObjects; | |
7781 v3 = 0; | |
7782 if ( (signed int)this->uNumObjects <= 0 ) | |
7783 { | |
7784 LABEL_5: | |
7785 LOWORD(v3) = 0; | |
7786 } | |
7787 else | |
7788 { | |
7789 v4 = (char *)&this->pObjects->uObjectID; | |
7790 while ( uItemID != *(short *)v4 ) | |
7791 { | |
7792 ++v3; | |
7793 v4 += 56; | |
7794 if ( v3 >= (signed int)v2 ) | |
7795 goto LABEL_5; | |
7796 } | |
7797 } | |
7798 return v3; | |
7799 } | |
7800 | |
7801 | |
7802 | |
7803 //----- (0042EB78) -------------------------------------------------------- | |
7804 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7805 { | |
7806 return 8 * this->pIcons[uIconID].uAnimLength; | |
7807 } | |
7808 | |
7809 //----- (0042EB8D) -------------------------------------------------------- | |
7810 void GUIMessageQueue::SendMessage(UIMessageType msg, int param, unsigned int a4) | |
7811 { | |
7812 if (uNumMessages < 40) | |
7813 { | |
7814 pMessages[uNumMessages].eType = msg; | |
7815 pMessages[uNumMessages].param = param; | |
7816 pMessages[uNumMessages++].field_8 = a4; | |
7817 } | |
7818 } | |
7819 | |
7820 //----- (0042EBBE) -------------------------------------------------------- | |
7821 int __fastcall sub_42EBBE(int a1, int a2) | |
7822 { | |
7823 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7824 } | |
7825 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7826 | |
7827 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 7828 int stru193_math::Sin(int angle) |
0 | 7829 { |
323 | 7830 return Cos(angle - this->uIntegerHalfPi); |
0 | 7831 } |
7832 | |
7833 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 7834 void _42ECB5_PlayerAttacksActor() |
0 | 7835 { |
271 | 7836 //unsigned int v0; // ebx@1 |
7837 //Player *v1; // esi@1 | |
7838 //bool result; // eax@1 | |
295 | 7839 //int v3; // edi@2 |
271 | 7840 //unsigned int v4; // eax@7 |
0 | 7841 char *v5; // eax@8 |
271 | 7842 //int v6; // ecx@9 |
7843 //signed int v7; // eax@16 | |
295 | 7844 //Actor *v8; // edi@20 |
0 | 7845 unsigned int v9; // ecx@21 |
295 | 7846 //char *v10; // eax@26 |
0 | 7847 char *v11; // eax@26 |
7848 unsigned int v12; // eax@47 | |
295 | 7849 //char *v13; // eax@47 |
7850 //char *v14; // eax@47 | |
7851 //unsigned int v15; // ebx@54 | |
7852 //int v16; // [sp-10h] [bp-4Ch]@24 | |
7853 //int v17; // [sp-10h] [bp-4Ch]@44 | |
7854 //unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7855 //unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7856 //__int16 v20; // [sp-8h] [bp-44h]@24 | |
7857 //__int16 v21; // [sp-8h] [bp-44h]@44 | |
7858 //int v22; // [sp-4h] [bp-40h]@24 | |
7859 //int v23; // [sp-4h] [bp-40h]@44 | |
0 | 7860 SoundID v24; // [sp-4h] [bp-40h]@58 |
295 | 7861 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 |
271 | 7862 //unsigned int a2; // [sp+18h] [bp-24h]@20 |
7863 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
295 | 7864 //int v28; // [sp+20h] [bp-1Ch]@9 |
271 | 7865 //unsigned int *v28b; |
295 | 7866 //int v29; // [sp+24h] [bp-18h]@16 |
7867 //int v30; // [sp+28h] [bp-14h]@16 | |
271 | 7868 //int v31; // [sp+2Ch] [bp-10h]@4 |
295 | 7869 //int v32; // [sp+30h] [bp-Ch]@7 |
271 | 7870 //int v33; // [sp+34h] [bp-8h]@7 |
295 | 7871 //int v34; // [sp+38h] [bp-4h]@17 |
0 | 7872 |
271 | 7873 //v0 = uActiveCharacter; |
7874 //v27 = 6972 * uActiveCharacter; | |
7875 //v1 = &pParty->pPlayers[uActiveCharacter-1]; | |
7876 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); | |
7877 auto player = &pParty->pPlayers[uActiveCharacter - 1]; | |
7878 if (!player->CanAct()) | |
7879 return; | |
7880 | |
7881 pStru277->_427D48(uActiveCharacter); | |
295 | 7882 //v3 = 0; |
271 | 7883 if (pParty->Invisible()) |
7884 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
7885 | |
7886 //v31 = player->pEquipment.uBow; | |
7887 int bow_idx = player->pEquipment.uBow; | |
7888 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) | |
7889 bow_idx = 0; | |
7890 | |
295 | 7891 //v32 = 0; |
7892 int wand_item_id = 0; | |
271 | 7893 //v33 = 0; |
7894 //v4 = v1->pEquipment.uMainHand; | |
7895 int laser_weapon_item_id = 0; | |
7896 | |
7897 int main_hand_idx = player->pEquipment.uMainHand; | |
7898 if (main_hand_idx) | |
0 | 7899 { |
271 | 7900 auto item = &player->pInventoryItems[main_hand_idx - 1]; |
112 | 7901 //v5 = (char *)v1 + 36 * v4; |
271 | 7902 if (!item->Broken()) |
7903 { | |
7904 //v28b = &v1->pInventoryItems[v4].uItemID; | |
7905 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
295 | 7906 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND) |
0 | 7907 { |
295 | 7908 if (item->uNumCharges <= 0) |
7909 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 7910 else |
295 | 7911 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 7912 } |
271 | 7913 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
7914 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 7915 } |
271 | 7916 } |
7917 | |
295 | 7918 //v30 = 0; |
7919 //v29 = 0; | |
7920 //v28 = 0; | |
271 | 7921 //v7 = pMouse->uPointingObjectID; |
7922 | |
7923 int target_pid = pMouse->uPointingObjectID; | |
7924 int target_type = target_pid & 7, | |
7925 target_id = target_pid >> 3; | |
7926 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) | |
7927 { | |
7928 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
7929 target_type = target_pid & 7; | |
7930 target_id = target_pid >> 3; | |
7931 } | |
295 | 7932 |
7933 auto actor = &pActors[target_id]; | |
7934 int actor_distance = 0; | |
271 | 7935 if (target_type == OBJECT_Actor) |
7936 { | |
295 | 7937 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
7938 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
7939 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
7940 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
7941 if (actor_distance < 0) | |
7942 actor_distance = 0; | |
7943 } | |
7944 | |
7945 bool shooting_bow = false, | |
7946 shotting_laser = false, | |
7947 shooting_wand = false; | |
7948 if (laser_weapon_item_id) | |
7949 { | |
7950 shotting_laser = true; | |
7951 _42777D_CastSpell_UseWand_ShootArrow(102, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); | |
7952 } | |
7953 else if (wand_item_id) | |
7954 { | |
7955 shooting_wand = true; | |
7956 | |
7957 int main_hand_idx = player->pEquipment.uMainHand; | |
7958 _42777D_CastSpell_UseWand_ShootArrow(*((int *)&pSpellDatas[66].field_8 + player->pInventoryItems[main_hand_idx - 1].uItemID), uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); | |
7959 | |
7960 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | |
7961 player->pEquipment.uMainHand = 0; | |
7962 } | |
303 | 7963 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 7964 { |
303 | 7965 Vec3_int_ a3; |
7966 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
7967 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
7968 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
7969 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
7970 | |
7971 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); | |
305 | 7972 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) |
295 | 7973 _42FA66_do_explosive_impact( |
7974 actor->vPosition.x, | |
7975 actor->vPosition.y, | |
7976 actor->vPosition.z + actor->uActorHeight / 2, | |
7977 0, 512, uActiveCharacter); | |
303 | 7978 } |
7979 else if (bow_idx) | |
7980 { | |
7981 shooting_bow = true; | |
7982 _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); | |
295 | 7983 } |
7984 else | |
7985 { | |
303 | 7986 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
7987 } | |
7988 | |
7989 if (!pParty->bTurnBasedModeOn) | |
7990 { | |
7991 int recovery = player->GetAttackRecoveryTime(0); | |
7992 if (recovery < 30 ) | |
7993 recovery = 30; | |
7994 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); | |
295 | 7995 } |
7996 | |
7997 | |
7998 int v34 = 0; | |
7999 if (shooting_wand) | |
8000 return; | |
8001 else if (shooting_bow) | |
8002 { | |
8003 v34 = 5; | |
8004 player->PlaySound(SPEECH_50, 0); | |
8005 } | |
8006 if (shotting_laser) | |
8007 v34 = 7; | |
8008 else | |
8009 { | |
8010 int main_hand_idx = player->pEquipment.uMainHand; | |
8011 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) | |
8012 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType; | |
8013 pTurnEngine->_40471C(); | |
8014 } | |
8015 | |
8016 switch (v34) | |
8017 { | |
8018 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
8019 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
8020 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
8021 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
8022 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
8023 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
8024 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
8025 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
8026 } | |
0 | 8027 } |
8028 | |
8029 //----- (0042F184) -------------------------------------------------------- | |
295 | 8030 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 8031 { |
8032 int v4; // edi@1 | |
8033 stru319 *v5; // esi@1 | |
8034 int v6; // eax@2 | |
8035 int v7; // eax@4 | |
8036 int result; // eax@5 | |
8037 int *v9; // edx@8 | |
8038 signed int v10; // ebx@10 | |
8039 int v11; // edi@11 | |
8040 Actor *v12; // esi@12 | |
8041 unsigned __int16 v13; // ax@12 | |
8042 int v14; // eax@22 | |
8043 char v15; // zf@30 | |
8044 int v16; // esi@32 | |
8045 int v17; // ecx@34 | |
8046 stru319 *v18; // eax@39 | |
8047 int v19; // edx@39 | |
8048 int v20; // ecx@41 | |
8049 unsigned __int16 v21; // ax@42 | |
8050 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
8051 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
8052 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
8053 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
8054 int *v26; // [sp+18h] [bp-14h]@8 | |
8055 int v27; // [sp+1Ch] [bp-10h]@10 | |
8056 int *v28; // [sp+20h] [bp-Ch]@10 | |
8057 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
8058 int v30; // [sp+28h] [bp-4h]@6 | |
8059 int i; // [sp+38h] [bp+Ch]@33 | |
8060 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
8061 | |
8062 v4 = 0; | |
8063 v5 = this; | |
8064 v24 = this; | |
8065 if ( pRenderer->pRenderD3D ) | |
8066 { | |
8067 v6 = a3 != 0; | |
8068 if ( a4 ) | |
8069 LOBYTE(v6) = v6 | 8; | |
295 | 8070 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 8071 if ( v7 != -1 ) |
8072 return (unsigned __int16)v7; | |
295 | 8073 else return 0; |
0 | 8074 } |
8075 else | |
8076 { | |
8077 v30 = 0; | |
8078 if ( pRenderer->pActiveZBuffer ) | |
8079 { | |
8080 v29 = viewparams->uScreenX; | |
8081 v23 = viewparams->uScreenZ; | |
8082 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
8083 { | |
8084 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
8085 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8086 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8087 do | |
8088 { | |
8089 if ( (signed int)v29 < (signed int)v23 ) | |
8090 { | |
8091 v28 = v9; | |
8092 v10 = v4; | |
8093 v27 = v23 - v29; | |
8094 do | |
8095 { | |
8096 v22 = *v28; | |
8097 v11 = *v28 & 0xFFFF; | |
141 | 8098 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 8099 { |
8100 v12 = &pActors[(unsigned int)v11 >> 3]; | |
8101 v13 = v12->uAIState; | |
8102 if ( v13 != 5 ) | |
8103 { | |
8104 if ( v13 != 4 | |
8105 && v13 != 11 | |
8106 && v13 != 19 | |
8107 && v13 != 17 | |
8108 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
8109 { | |
8110 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
295 | 8111 && v22 <= pick_depth << 16 ) |
0 | 8112 { |
8113 v14 = 0; | |
8114 if ( v10 > 0 ) | |
8115 { | |
8116 do | |
8117 { | |
8118 if ( dword_50BDA0[v14] == v11 ) | |
8119 break; | |
8120 ++v14; | |
8121 } | |
8122 while ( v14 < v30 ); | |
8123 } | |
8124 if ( v14 == v30 && v10 < 100 ) | |
8125 { | |
8126 ++v30; | |
8127 dword_50BC10[v10] = v22; | |
8128 dword_50BDA0[v10] = v11; | |
8129 ++v10; | |
8130 } | |
8131 } | |
8132 } | |
8133 } | |
8134 } | |
8135 ++v28; | |
8136 --v27; | |
8137 } | |
8138 while ( v27 ); | |
8139 v4 = v30; | |
8140 v5 = v24; | |
8141 } | |
8142 v9 = v26 + 640; | |
8143 v15 = v25-- == 1; | |
8144 v26 += 640; | |
8145 } | |
8146 while ( !v15 ); | |
8147 } | |
8148 if ( v4 > 0 ) | |
8149 { | |
8150 v32 = 1; | |
8151 v16 = (int)dword_50BC10; | |
8152 do | |
8153 { | |
8154 for ( i = v32; i < v4; ++i ) | |
8155 { | |
8156 v17 = dword_50BC10[i]; | |
8157 if ( v17 < *(int *)v16 ) | |
8158 { | |
8159 dword_50BC10[i] = *(int *)v16; | |
8160 *(int *)v16 = v17; | |
8161 } | |
8162 } | |
8163 ++v32; | |
8164 v16 += 4; | |
8165 } | |
8166 while ( v32 - 1 < v4 ); | |
8167 v5 = v24; | |
8168 if ( v4 > 0 ) | |
8169 { | |
8170 v18 = v24; | |
8171 v19 = v4; | |
8172 do | |
8173 { | |
8174 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
8175 v18 += 4; | |
8176 --v19; | |
8177 } | |
8178 while ( v19 ); | |
8179 } | |
8180 } | |
8181 v20 = 0; | |
8182 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
8183 { | |
8184 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8185 if ( v21 != 4 && v21 != 5 ) | |
8186 break; | |
8187 } | |
8188 if ( v20 != v4 ) | |
8189 { | |
8190 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8191 LOBYTE(result) = result | 3; | |
8192 return result; | |
8193 } | |
8194 } | |
8195 } | |
8196 return 0; | |
8197 } | |
8198 | |
8199 | |
8200 //----- (0042F3D6) -------------------------------------------------------- | |
8201 void InitializeTurnBasedAnimations(void *_this) | |
8202 { | |
8203 unsigned int *v1; // edi@1 | |
8204 | |
8205 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8206 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8207 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8208 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8209 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8210 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8211 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8212 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8213 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8214 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8215 v1 = pIconIDs_Turn; | |
8216 do | |
8217 { | |
8218 pIconsFrameTable->InitializeAnimation(*v1); | |
8219 ++v1; | |
8220 } | |
8221 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8222 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8223 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8224 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8225 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8226 } | |
8227 | |
8228 //----- (0042F4DA) -------------------------------------------------------- | |
8229 signed int __cdecl sub_42F4DA() | |
8230 { | |
8231 signed int v0; // edi@1 | |
82 | 8232 Actor *v1; // esi@4 |
0 | 8233 int v2; // ebx@5 |
8234 int v3; // eax@5 | |
8235 int v4; // ebx@5 | |
8236 unsigned int v5; // ecx@5 | |
8237 int v6; // edx@6 | |
8238 unsigned int v7; // edx@8 | |
8239 unsigned int v8; // edx@10 | |
8240 __int16 v9; // ax@12 | |
8241 signed int result; // eax@20 | |
8242 int v11; // [sp+Ch] [bp-10h]@5 | |
8243 int v12; // [sp+10h] [bp-Ch]@5 | |
8244 signed int v13; // [sp+14h] [bp-8h]@3 | |
8245 | |
8246 v0 = 5120; | |
8247 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8248 v0 = 2560; | |
8249 v13 = 0; | |
8250 if ( (signed int)uNumActors <= 0 ) | |
8251 { | |
8252 LABEL_20: | |
8253 result = 0; | |
8254 } | |
8255 else | |
8256 { | |
82 | 8257 v1 = pActors; |
0 | 8258 while ( 1 ) |
8259 { | |
82 | 8260 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8261 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8262 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8263 v3 = v2; |
8264 v4 = v11; | |
8265 v5 = v12; | |
8266 if ( v3 < v11 ) | |
8267 { | |
8268 v6 = v3; | |
8269 v3 = v11; | |
8270 v4 = v6; | |
8271 } | |
8272 if ( v3 < v12 ) | |
8273 { | |
8274 v7 = v3; | |
8275 v3 = v12; | |
8276 v5 = v7; | |
8277 } | |
8278 if ( v4 < (signed int)v5 ) | |
8279 { | |
8280 v8 = v5; | |
8281 v5 = v4; | |
8282 v4 = v8; | |
8283 } | |
8284 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8285 { | |
82 | 8286 v9 = v1->uAIState; |
8287 if ( v1->uAIState != 5 ) | |
0 | 8288 { |
8289 if ( v9 != 4 | |
8290 && v9 != 11 | |
8291 && v9 != 19 | |
8292 && v9 != 17 | |
82 | 8293 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8294 break; |
8295 } | |
8296 } | |
8297 ++v13; | |
82 | 8298 ++v1; |
0 | 8299 if ( v13 >= (signed int)uNumActors ) |
8300 goto LABEL_20; | |
8301 } | |
8302 result = 1; | |
8303 } | |
8304 return result; | |
8305 } | |
8306 | |
8307 //----- (0042F5ED) -------------------------------------------------------- | |
8308 int LayingItem::Create(int yaw, int pitch, int a4, int a5) | |
8309 { | |
8310 LayingItem *v5; // eax@1 | |
8311 signed int v6; // ebx@2 | |
8312 char *v7; // ecx@2 | |
8313 signed int result; // eax@6 | |
8314 LayingItem *v9; // ebx@7 | |
8315 int v10; // edx@11 | |
8316 int v11; // edi@18 | |
8317 __int16 v12; // ax@18 | |
8318 int v13; // ST2C_4@20 | |
8319 int v14; // eax@20 | |
8320 int v15; // [sp-28h] [bp-38h]@14 | |
8321 int v16; // [sp-24h] [bp-34h]@11 | |
8322 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 | |
8323 int *v18; // [sp-14h] [bp-24h]@11 | |
8324 int *v19; // [sp-10h] [bp-20h]@11 | |
8325 int *v20; // [sp-Ch] [bp-1Ch]@11 | |
8326 signed int v21; // [sp+8h] [bp-8h]@2 | |
8327 int angle; // [sp+Ch] [bp-4h]@1 | |
8328 int a4a; // [sp+1Ch] [bp+Ch]@20 | |
8329 int a4b; // [sp+1Ch] [bp+Ch]@20 | |
8330 int a5a; // [sp+20h] [bp+10h]@20 | |
8331 | |
8332 auto a1 = this; | |
8333 angle = yaw; | |
8334 v5 = a1; | |
8335 if ( !a1->uObjectDescID ) | |
8336 return -1; | |
8337 v6 = 0; | |
8338 v7 = (char *)&pLayingItems[0].uObjectDescID; | |
8339 v21 = 0; | |
8340 do | |
8341 { | |
8342 if ( !*(short *)v7 ) | |
8343 break; | |
8344 v7 += 112; | |
8345 ++v6; | |
8346 v21 = v6; | |
8347 } | |
8348 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) ); | |
8349 if ( v6 >= 1000 ) | |
8350 return -1; | |
8351 *(int *)&v5->field_62[2] = v5->vPosition.x; | |
8352 *(int *)&v5->field_62[6] = v5->vPosition.y; | |
8353 v9 = &pLayingItems[v6]; | |
8354 *(int *)&v5->field_62[10] = v5->vPosition.z; | |
8355 memcpy(v9, v5, 0x70u); | |
8356 if ( a5 == 1 ) | |
8357 { | |
8358 v20 = &v9->vPosition.z; | |
8359 v19 = &v9->vPosition.y; | |
8360 v18 = (int *)&v9->vPosition; | |
8361 v17.z = v5->vPosition.z; | |
8362 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8363 v16 = 0; | |
8364 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8365 goto LABEL_16; | |
8366 } | |
8367 if ( a5 == 2 ) | |
8368 { | |
8369 v20 = &v9->vPosition.z; | |
8370 v19 = &v9->vPosition.y; | |
8371 v18 = (int *)&v9->vPosition; | |
8372 v17.z = v5->vPosition.z; | |
8373 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8374 v16 = 0; | |
8375 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8376 goto LABEL_14; | |
8377 } | |
8378 if ( a5 == 3 ) | |
8379 { | |
8380 v20 = &v9->vPosition.z; | |
8381 v19 = &v9->vPosition.y; | |
8382 v18 = (int *)&v9->vPosition; | |
8383 v17.z = v5->vPosition.z; | |
8384 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8385 v16 = 0; | |
8386 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8387 LABEL_14: | |
8388 v15 = 8; | |
8389 LABEL_17: | |
8390 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20); | |
8391 goto LABEL_18; | |
8392 } | |
8393 if ( a5 == 4 ) | |
8394 { | |
8395 v20 = &v9->vPosition.z; | |
8396 v19 = &v9->vPosition.y; | |
8397 v18 = (int *)&v9->vPosition; | |
8398 v17.z = v5->vPosition.z; | |
8399 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8400 v16 = 0; | |
8401 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8402 LABEL_16: | |
8403 v15 = 24; | |
8404 goto LABEL_17; | |
8405 } | |
8406 LABEL_18: | |
8407 v11 = a4; | |
8408 v12 = 0; | |
8409 if ( a4 ) | |
8410 { | |
323 | 8411 a4a = stru_5C6E00->Cos(angle); |
8412 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8413 a4b = stru_5C6E00->Sin(angle); | |
8414 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8415 v14 = stru_5C6E00->Sin(pitch); | |
0 | 8416 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16; |
8417 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16; | |
8418 v12 = (unsigned int)(v14 * v11) >> 16; | |
8419 } | |
8420 else | |
8421 { | |
8422 v9->vVelocity.y = 0; | |
8423 v9->vVelocity.x = 0; | |
8424 } | |
8425 v9->vVelocity.z = v12; | |
8426 result = v21; | |
8427 if ( v21 >= (signed int)uNumLayingItems ) | |
8428 uNumLayingItems = v21 + 1; | |
8429 return result; | |
8430 } | |
8431 | |
8432 //----- (0042F7EB) -------------------------------------------------------- | |
8433 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) | |
8434 { | |
8435 unsigned int v9; // edi@1 | |
8436 signed int v10; // edx@3 | |
8437 char *v11; // ecx@4 | |
8438 unsigned __int16 v12; // ax@7 | |
8439 unsigned int v13; // edx@9 | |
8440 char *v14; // ecx@10 | |
8441 int v15; // esi@17 | |
8442 int v16; // eax@18 | |
8443 int v17; // edi@20 | |
8444 int v18; // esi@20 | |
8445 //LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8446 int v21; // [sp+7Ch] [bp-8h]@1 | |
8447 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8448 | |
8449 v9 = uSpriteID; | |
8450 v21 = x; | |
8451 v22 = uSpriteID; | |
8452 | |
8453 LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8454 //LayingItem::LayingItem(&a1a); | |
8455 a1a.stru_24.Reset(); | |
8456 | |
8457 if ( a9 ) | |
8458 { | |
8459 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8460 v9 = v22; | |
8461 } | |
8462 v10 = 0; | |
8463 a1a.field_50 = 0; | |
8464 a1a.field_4C = 0; | |
8465 a1a.field_48 = 0; | |
8466 a1a.field_54 = 0; | |
8467 a1a.uItemType = v9; | |
8468 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8469 { | |
8470 LABEL_7: | |
8471 v12 = 0; | |
8472 } | |
8473 else | |
8474 { | |
8475 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8476 while ( (short)v9 != *(short *)v11 ) | |
8477 { | |
8478 ++v10; | |
8479 v11 += 56; | |
8480 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8481 goto LABEL_7; | |
8482 } | |
8483 v12 = v10; | |
8484 } | |
8485 a1a.uObjectDescID = v12; | |
8486 a1a.vPosition.z = z; | |
8487 a1a.vPosition.x = v21; | |
8488 a1a.vPosition.y = y; | |
8489 a1a.uSoundID = 0; | |
8490 a1a.uAttributes = attributes; | |
8491 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8492 a1a.uSpriteFrameID = 0; | |
303 | 8493 a1a.field_58_pid = 0; |
0 | 8494 a1a.field_5C = 0; |
8495 if ( !(a1a.uAttributes & 0x10) ) | |
8496 { | |
8497 v13 = 0; | |
222 | 8498 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
0 | 8499 { |
8500 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8501 while ( *(short *)v14 != v9 ) | |
8502 { | |
8503 ++v13; | |
8504 v14 += 48; | |
222 | 8505 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount ) |
0 | 8506 goto LABEL_16; |
8507 } | |
8508 a1a.stru_24.uItemID = v13; | |
8509 } | |
8510 } | |
8511 LABEL_16: | |
8512 if ( a7 ) | |
8513 { | |
8514 v15 = count; | |
8515 if ( count > 0 ) | |
8516 { | |
8517 do | |
8518 { | |
8519 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8520 v16 = rand(); | |
8521 a1a.Create( | |
8522 (signed __int16)a1a.uFacing, | |
8523 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8524 a4, | |
8525 0); | |
8526 --v15; | |
8527 } | |
8528 while ( v15 ); | |
8529 } | |
8530 } | |
8531 else | |
8532 { | |
8533 v17 = count; | |
8534 v18 = stru_5C6E00->uIntegerHalfPi; | |
8535 a1a.uFacing = 0; | |
8536 if ( count > 0 ) | |
8537 { | |
8538 do | |
8539 { | |
8540 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8541 --v17; | |
8542 } | |
8543 while ( v17 ); | |
8544 } | |
8545 } | |
8546 return 1; | |
8547 } | |
8548 | |
8549 //----- (0042F960) -------------------------------------------------------- | |
8550 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8551 { | |
8552 int v3; // ebx@1 | |
8553 int v4; // edi@1 | |
8554 signed int v5; // edx@1 | |
8555 char *v6; // ecx@2 | |
8556 unsigned __int16 v7; // ax@5 | |
8557 signed int v8; // eax@6 | |
8558 signed int v9; // eax@7 | |
8559 //LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8560 | |
8561 v3 = x; | |
8562 v4 = y; | |
8563 | |
8564 LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8565 //LayingItem::LayingItem(&a1); | |
8566 a1.stru_24.Reset(); | |
8567 | |
8568 v5 = 0; | |
8569 a1.field_50 = 0; | |
8570 a1.field_4C = 0; | |
8571 a1.field_48 = 0; | |
8572 a1.field_54 = 0; | |
8573 a1.uItemType = 800; | |
8574 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8575 { | |
8576 LABEL_5: | |
8577 v7 = 0; | |
8578 } | |
8579 else | |
8580 { | |
8581 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8582 while ( *(short *)v6 != 800 ) | |
8583 { | |
8584 ++v5; | |
8585 v6 += 56; | |
8586 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8587 goto LABEL_5; | |
8588 } | |
8589 v7 = v5; | |
8590 } | |
8591 a1.uObjectDescID = v7; | |
8592 a1.vPosition.x = v3; | |
8593 a1.vPosition.y = v4; | |
8594 a1.vPosition.z = z; | |
8595 a1.uSoundID = 0; | |
8596 a1.uAttributes = 0; | |
8597 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8598 a1.uSpriteFrameID = 0; | |
303 | 8599 a1.field_58_pid = 0; |
0 | 8600 a1.field_5C = 0; |
8601 v8 = a1.Create(0, 0, 0, 0); | |
8602 if ( v8 != -1 ) | |
8603 { | |
8604 v9 = 8 * v8; | |
8605 LOBYTE(v9) = v9 | 2; | |
8606 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8607 } | |
8608 } | |
8609 | |
8610 //----- (0042FA22) -------------------------------------------------------- | |
79 | 8611 LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8612 { |
8613 size_t v0; // edx@1 | |
8614 int v1; // ebp@1 | |
79 | 8615 LayingItem *result; // eax@1 |
8616 LayingItem *v3; // ebx@1 | |
0 | 8617 |
8618 v0 = 0; | |
8619 v1 = 0; | |
79 | 8620 //result = (char *)&pLayingItems[0].uObjectDescID; |
8621 result = pLayingItems; | |
0 | 8622 v3 = pLayingItems; |
8623 do | |
8624 { | |
79 | 8625 if ( result->uObjectDescID ) |
0 | 8626 { |
8627 if ( v1 != v0 ) | |
8628 { | |
79 | 8629 memcpy(v3, result, 0x70u); |
8630 result->uObjectDescID = 0; | |
0 | 8631 } |
8632 ++v0; | |
79 | 8633 ++v3;// = (char *)v3 + 112; |
0 | 8634 } |
79 | 8635 ++result;// += 112; |
0 | 8636 ++v1; |
8637 } | |
79 | 8638 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); |
8639 while( result <= &pLayingItems[999] ); | |
0 | 8640 uNumLayingItems = v0; |
8641 return result; | |
8642 } | |
8643 | |
8644 //----- (0042FA66) -------------------------------------------------------- | |
8645 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8646 { | |
8647 int v6; // edi@1 | |
8648 int v7; // esi@1 | |
8649 char *v8; // ecx@2 | |
8650 unsigned __int16 v9; // ax@5 | |
8651 int v10; // eax@10 | |
8652 signed int result; // eax@11 | |
8653 __int16 v12; // ax@12 | |
8654 //LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8655 int v14; // [sp+7Ch] [bp-4h]@1 | |
8656 | |
8657 v6 = a1; | |
8658 v7 = a2; | |
8659 LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8660 //LayingItem::LayingItem(&a1a); | |
8661 a1a.uItemType = 600; | |
8662 a1a.stru_24.Reset(); | |
8663 | |
8664 a1a.field_48 = 6; | |
8665 a1a.field_4C = 8; | |
8666 a1a.field_50 = 3; | |
8667 v14 = 0; | |
8668 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8669 { | |
8670 LABEL_5: | |
8671 v9 = 0; | |
8672 } | |
8673 else | |
8674 { | |
8675 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
8676 while ( (short)a1a.uItemType != *(short *)v8 ) | |
8677 { | |
8678 ++v14; | |
8679 v8 += 56; | |
8680 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8681 goto LABEL_5; | |
8682 } | |
8683 v9 = v14; | |
8684 } | |
8685 a1a.uObjectDescID = v9; | |
8686 a1a.vPosition.x = v6; | |
8687 a1a.vPosition.y = v7; | |
8688 a1a.vPosition.z = a3; | |
8689 a1a.uAttributes = 0; | |
8690 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8691 a1a.uSpriteFrameID = 0; | |
8692 a1a.field_5C = 0; | |
8693 a1a.field_60_distance_related_prolly_lod = 0; | |
8694 a1a.uFacing = 0; | |
8695 a1a.uSoundID = 0; | |
8696 if ( a6 >= 1 || a6 <= 4 ) | |
8697 { | |
8698 v10 = 8 * a6 - 8; | |
303 | 8699 LOBYTE(v10) = v10 | OBJECT_Player; |
8700 a1a.field_58_pid = v10; | |
0 | 8701 } |
8702 else | |
8703 { | |
303 | 8704 a1a.field_58_pid = 0; |
0 | 8705 } |
8706 result = a1a.Create(0, 0, 0, 0); | |
8707 if ( result != -1 ) | |
8708 { | |
8709 v12 = 8 * result; | |
8710 LOBYTE(v12) = v12 | 2; | |
8711 result = stru_50FE08.Add( | |
8712 v12, | |
8713 a5, | |
8714 SLOWORD(a1a.vPosition.x), | |
8715 SLOWORD(a1a.vPosition.y), | |
8716 SLOWORD(a1a.vPosition.z), | |
8717 0, | |
8718 0); | |
8719 } | |
8720 return result; | |
8721 } | |
8722 | |
8723 | |
8724 | |
8725 //----- (0042FB5C) -------------------------------------------------------- | |
8726 bool __fastcall sub_42FB5C(signed int a1) | |
8727 { | |
8728 int v1; // ecx@3 | |
8729 int v2; // ecx@4 | |
8730 int v3; // ecx@5 | |
8731 int v4; // ecx@6 | |
8732 int v5; // ecx@7 | |
8733 int v6; // ecx@8 | |
8734 char v7; // zf@9 | |
8735 | |
8736 if ( a1 > 39 ) | |
8737 { | |
8738 if ( a1 > 77 ) | |
8739 { | |
8740 if ( a1 == 80 ) | |
8741 return 0; | |
8742 if ( a1 > 84 ) | |
8743 { | |
8744 if ( a1 <= 86 ) | |
8745 return 0; | |
8746 v7 = a1 == 95; | |
8747 goto LABEL_20; | |
8748 } | |
8749 } | |
8750 else | |
8751 { | |
8752 if ( a1 == 77 ) | |
8753 return 0; | |
8754 if ( a1 >= 46 ) | |
8755 { | |
8756 if ( a1 <= 47 || a1 == 51 ) | |
8757 return 0; | |
8758 v7 = a1 == 73; | |
8759 goto LABEL_20; | |
8760 } | |
8761 } | |
8762 return 1; | |
8763 } | |
8764 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8765 return 1; | |
8766 v2 = v1 - 3; | |
8767 if ( !v2 ) | |
8768 return 0; | |
8769 v3 = v2 - 1; | |
8770 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8771 return 1; | |
8772 v5 = v4 - 8; | |
8773 if ( !v5 ) | |
8774 return 0; | |
8775 v6 = v5 - 1; | |
8776 if ( !v6 ) | |
8777 return 1; | |
8778 v7 = v6 == 20; | |
8779 LABEL_20: | |
8780 if ( !v7 ) | |
8781 return 1; | |
8782 return 0; | |
8783 } | |
8784 | |
8785 //----- (0042FBDD) -------------------------------------------------------- | |
8786 void __cdecl sub_42FBDD() | |
8787 { | |
388 | 8788 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 8789 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
8790 pRenderer->Present(); | |
8791 } | |
8792 | |
8793 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8794 void __cdecl CloseWindowBackground() |
0 | 8795 { |
388 | 8796 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 8797 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
8798 pRenderer->Present(); | |
8799 } | |
8800 | |
8801 //----- (0042FC4E) -------------------------------------------------------- | |
8802 void __cdecl ProcessInputActions() | |
8803 { | |
8804 ActionQueue *pActionQueue; // esi@7 | |
8805 Keyboard *v3; // ecx@8 | |
8806 char v4; // al@9 | |
8807 ActionQueue *v5; // ecx@19 | |
8808 Player *v6; // ecx@86 | |
8809 Player *v7; // esi@100 | |
8810 char v8; // bl@100 | |
8811 unsigned __int16 v9; // ax@102 | |
8812 int v10; // eax@103 | |
8813 unsigned int v11; // eax@127 | |
8814 signed int v12; // esi@157 | |
8815 Keyboard *v13; // ecx@158 | |
8816 char v14; // al@159 | |
8817 unsigned int v15; // eax@168 | |
8818 void *v16; // esi@177 | |
8819 int v17; // [sp-14h] [bp-1Ch]@8 | |
8820 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8821 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
271 | 8822 //__int16 v20; // [sp-14h] [bp-1Ch]@60 |
0 | 8823 int v21; // [sp-14h] [bp-1Ch]@68 |
8824 int v22; // [sp-Ch] [bp-14h]@158 | |
8825 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8826 int v24; // [sp+4h] [bp-4h]@87 | |
8827 | |
8828 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8829 auto pKeyboard = pGame->pKeyboardInstance; | |
8830 if (!bAlwaysRun) | |
8831 { | |
8832 if (pKeyboard->IsShiftHeld()) | |
8833 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8834 else | |
8835 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8836 } | |
8837 else | |
8838 { | |
8839 if (pKeyboard->IsShiftHeld()) | |
8840 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8841 else | |
8842 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8843 } | |
8844 | |
140 | 8845 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
0 | 8846 LABEL_6: |
8847 if ( !pEventTimer->bPaused ) | |
8848 { | |
8849 inputAction = (InputAction)0; | |
8850 pActionQueue = pPartyActionQueue; | |
8851 while ( 1 ) | |
8852 { | |
8853 v3 = pGame->pKeyboardInstance; | |
8854 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8855 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8856 v4 = v3->WasKeyPressed(v17); | |
8857 else | |
8858 v4 = v3->IsKeyBeingHeld(v17); | |
8859 if ( v4 ) | |
8860 { | |
8861 switch ( inputAction ) | |
8862 { | |
8863 case INPUT_MoveForward: | |
271 | 8864 if (pCurrentScreen != SCREEN_GAME) |
0 | 8865 break; |
8866 if (!pParty->bTurnBasedModeOn) | |
163 | 8867 //goto _do_move_forward; |
0 | 8868 { |
8869 v5 = pActionQueue; | |
140 | 8870 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8871 partyAction = PARTY_RunForward; |
8872 else | |
8873 partyAction = PARTY_WalkForward; | |
163 | 8874 //goto _add_action_and_continue; |
8875 v5->Add(partyAction); | |
8876 break; | |
8877 } | |
8878 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8879 { | |
8880 pTurnEngine->uActionPointsLeft -= 26; | |
8881 //_do_move_forward: | |
8882 v5 = pActionQueue; | |
8883 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8884 partyAction = PARTY_RunForward; | |
8885 else | |
8886 partyAction = PARTY_WalkForward; | |
8887 //goto _add_action_and_continue; | |
8888 v5->Add(partyAction); | |
8889 break; | |
0 | 8890 } |
8891 break; | |
8892 case INPUT_MoveBackwards: | |
17 | 8893 //__debugbreak(); |
271 | 8894 if (pCurrentScreen != SCREEN_GAME) |
0 | 8895 break; |
8896 if (!pParty->bTurnBasedModeOn) | |
17 | 8897 //goto _do_move_backwards; |
8898 { | |
8899 v5 = pActionQueue; | |
8900 if ( pParty->uFlags2 & 2 ) | |
8901 partyAction = PARTY_RunBackward; | |
8902 else | |
8903 partyAction = PARTY_WalkBackward; | |
163 | 8904 //goto _add_action_and_continue; |
8905 v5->Add(partyAction); | |
8906 break; | |
17 | 8907 } |
0 | 8908 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8909 { | |
8910 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8911 //_do_move_backwards: |
0 | 8912 v5 = pActionQueue; |
8913 if ( pParty->uFlags2 & 2 ) | |
8914 partyAction = PARTY_RunBackward; | |
8915 else | |
8916 partyAction = PARTY_WalkBackward; | |
163 | 8917 //goto _add_action_and_continue; |
8918 v5->Add(partyAction); | |
8919 break; | |
0 | 8920 } |
8921 break; | |
8922 case INPUT_StrafeLeft: | |
17 | 8923 //__debugbreak(); |
271 | 8924 if (pCurrentScreen != SCREEN_GAME) |
0 | 8925 break; |
8926 if (!pParty->bTurnBasedModeOn) | |
17 | 8927 //goto _do_strafe_left; |
8928 { | |
8929 partyAction = PARTY_StrafeLeft; | |
163 | 8930 //goto _add_action_and_continue_; |
8931 v5 = pActionQueue; | |
8932 v5->Add(partyAction); | |
8933 break; | |
17 | 8934 } |
0 | 8935 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8936 break; | |
8937 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8938 //_do_strafe_left: |
0 | 8939 partyAction = PARTY_StrafeLeft; |
163 | 8940 //goto _add_action_and_continue_; |
8941 v5 = pActionQueue; | |
8942 v5->Add(partyAction); | |
8943 break; | |
0 | 8944 case INPUT_StrafeRight: |
17 | 8945 //__debugbreak(); |
271 | 8946 if (pCurrentScreen != SCREEN_GAME) |
0 | 8947 break; |
8948 if (!pParty->bTurnBasedModeOn) | |
17 | 8949 //goto _do_strafe_right; |
8950 { | |
8951 partyAction = PARTY_StrafeRight; | |
163 | 8952 //goto _add_action_and_continue_; |
8953 v5 = pActionQueue; | |
8954 v5->Add(partyAction); | |
8955 break; | |
17 | 8956 } |
0 | 8957 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8958 break; | |
8959 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8960 //_do_strafe_right: |
0 | 8961 partyAction = PARTY_StrafeRight; |
163 | 8962 //goto _add_action_and_continue_; |
8963 v5 = pActionQueue; | |
8964 v5->Add(partyAction); | |
8965 break; | |
0 | 8966 case INPUT_TurnLeft: |
271 | 8967 if (pCurrentScreen != SCREEN_GAME) |
0 | 8968 break; |
8969 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
8970 { | |
8971 if (pParty->bTurnBasedModeOn) | |
8972 { | |
8973 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8974 break; | |
8975 pTurnEngine->uActionPointsLeft -= 26; | |
8976 } | |
8977 partyAction_ = PARTY_StrafeLeft; | |
8978 } | |
8979 else | |
8980 { | |
8981 if ( pParty->uFlags2 & 2 ) | |
8982 partyAction_ = PARTY_FastTurnLeft; | |
8983 else | |
8984 partyAction_ = PARTY_TurnLeft; | |
8985 } | |
8986 pActionQueue->Add(partyAction_); | |
8987 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8988 { | |
271 | 8989 pWeather->OnPlayerTurn(10); |
0 | 8990 } |
8991 break; | |
8992 case INPUT_TurnRight: | |
271 | 8993 if (pCurrentScreen != SCREEN_GAME) |
0 | 8994 break; |
8995 if ( GetAsyncKeyState(17) ) // strafing | |
8996 { | |
8997 if (pParty->bTurnBasedModeOn) | |
8998 { | |
8999 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9000 break; | |
9001 pTurnEngine->uActionPointsLeft -= 26; | |
9002 } | |
271 | 9003 v21 = PARTY_StrafeRight; |
0 | 9004 } |
9005 else | |
9006 { | |
9007 if ( pParty->uFlags2 & 2 ) | |
271 | 9008 v21 = PARTY_FastTurnRight; |
0 | 9009 else |
271 | 9010 v21 = PARTY_TurnRight; |
0 | 9011 } |
9012 pActionQueue->Add((PartyAction)v21); | |
9013 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9014 { | |
271 | 9015 pWeather->OnPlayerTurn(-10); |
0 | 9016 } |
9017 break; | |
9018 case INPUT_Jump: | |
17 | 9019 //__debugbreak(); |
271 | 9020 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 9021 break; |
9022 partyAction = (PartyAction)12; | |
163 | 9023 //goto _add_action_and_continue_; |
9024 v5 = pActionQueue; | |
9025 v5->Add(partyAction); | |
9026 break; | |
0 | 9027 case INPUT_Yell: |
187 | 9028 if (!pCurrentScreen && uActiveCharacter) |
0 | 9029 { |
9030 pParty->Yell(); | |
187 | 9031 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 9032 } |
187 | 9033 break; |
0 | 9034 case INPUT_Pass: |
17 | 9035 //__debugbreak(); |
0 | 9036 if ( pCurrentScreen ) |
9037 break; | |
9038 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9039 //goto LABEL_118; |
9040 { | |
9041 pTurnEngine->field_18 |= 8u; | |
9042 break; | |
9043 } | |
0 | 9044 if ( uActiveCharacter ) |
9045 { | |
9046 v6 = pPlayers[uActiveCharacter]; | |
9047 if ( !v6->uTimeToRecovery ) | |
9048 { | |
9049 v24 = v6->GetAttackRecoveryTime(0); | |
9050 if ( !pParty->bTurnBasedModeOn ) | |
9051 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
9052 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
9053 pStru277->_427D48(uActiveCharacter); | |
9054 pTurnEngine->_40471C(); | |
9055 } | |
9056 } | |
9057 break; | |
9058 case INPUT_Combat: | |
17 | 9059 //__debugbreak(); |
271 | 9060 if (pCurrentScreen == SCREEN_GAME) |
0 | 9061 { |
9062 if (pParty->bTurnBasedModeOn) | |
9063 { | |
141 | 9064 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 9065 { |
9066 pParty->bTurnBasedModeOn = 0; | |
9067 pTurnEngine->End(true); | |
9068 } | |
9069 } | |
9070 else | |
9071 { | |
9072 pTurnEngine->Start(); | |
9073 pParty->bTurnBasedModeOn = true; | |
9074 } | |
9075 } | |
9076 break; | |
9077 case INPUT_CastReady: | |
17 | 9078 //__debugbreak(); |
271 | 9079 if (pCurrentScreen != SCREEN_GAME) |
0 | 9080 break; |
9081 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9082 //goto LABEL_118; |
9083 { | |
9084 pTurnEngine->field_18 |= 8u; | |
9085 break; | |
9086 } | |
0 | 9087 if ( !uActiveCharacter ) |
9088 break; | |
9089 v7 = pPlayers[uActiveCharacter]; | |
9090 v8 = v7->uQuickSpell; | |
9091 if ( !v8 | |
9092 || bUnderwater | |
9093 || ((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)), | |
9094 v10 > v7->sMana) ) | |
9095 { | |
9096 pActionQueue = pPartyActionQueue; | |
9097 LABEL_120: | |
271 | 9098 |
0 | 9099 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
9100 { | |
271 | 9101 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; |
163 | 9102 //goto _send_message; |
9103 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9104 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9105 ++pMessageQueue_50CBD0->uNumMessages; | |
9106 break; | |
0 | 9107 } |
9108 } | |
9109 else | |
9110 { | |
9111 pActionQueue = pPartyActionQueue; | |
9112 if ( dword_50C9E8 < 40 ) | |
9113 { | |
9114 dword_50C9EC[3 * dword_50C9E8] = 25; | |
9115 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9116 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9117 ++dword_50C9E8; | |
9118 } | |
9119 } | |
9120 break; | |
9121 case INPUT_Attack: | |
17 | 9122 //__debugbreak(); |
271 | 9123 if (pCurrentScreen != SCREEN_GAME) |
0 | 9124 break; |
9125 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
9126 goto LABEL_120; | |
17 | 9127 //LABEL_118: |
0 | 9128 pTurnEngine->field_18 |= 8u; |
9129 break; | |
9130 case INPUT_EventTrigger: | |
271 | 9131 if (pCurrentScreen == SCREEN_GAME) |
0 | 9132 { |
9133 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9134 break; | |
271 | 9135 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action; |
163 | 9136 //goto _send_message; |
9137 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9138 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9139 ++pMessageQueue_50CBD0->uNumMessages; | |
9140 break; | |
0 | 9141 } |
151 | 9142 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 9143 { |
9144 v11 = pMessageQueue_50CBD0->uNumMessages; | |
9145 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9146 { | |
9147 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9148 { | |
9149 v11 = 1; | |
9150 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 9151 //LABEL_132: |
271 | 9152 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 9153 //_send_message: |
0 | 9154 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9155 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9156 ++pMessageQueue_50CBD0->uNumMessages; | |
9157 break; | |
9158 } | |
9159 v11 = 0; | |
9160 pMessageQueue_50CBD0->uNumMessages = 0; | |
9161 } | |
9162 if ( (signed int)v11 < 40 ) | |
163 | 9163 //goto LABEL_132; |
9164 { | |
271 | 9165 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 9166 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9167 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9168 ++pMessageQueue_50CBD0->uNumMessages; | |
9169 break; | |
9170 } | |
0 | 9171 } |
9172 break; | |
9173 case INPUT_CharCycle: | |
17 | 9174 //__debugbreak(); |
151 | 9175 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 9176 || dword_50C9E8 >= 40 ) |
9177 break; | |
9178 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 9179 //goto LABEL_155; |
9180 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9181 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9182 ++dword_50C9E8; | |
9183 break; | |
0 | 9184 case INPUT_LookUp: |
17 | 9185 //__debugbreak(); |
0 | 9186 if ( pEventTimer->bPaused ) |
9187 break; | |
9188 partyAction = (PartyAction)7; | |
163 | 9189 //goto _add_action_and_continue_; |
9190 v5 = pActionQueue; | |
9191 v5->Add(partyAction); | |
9192 break; | |
0 | 9193 case INPUT_CenterView: |
17 | 9194 //__debugbreak(); |
0 | 9195 if ( pEventTimer->bPaused ) |
9196 break; | |
9197 partyAction = (PartyAction)9; | |
163 | 9198 //goto _add_action_and_continue_; |
9199 v5 = pActionQueue; | |
9200 v5->Add(partyAction); | |
9201 break; | |
0 | 9202 case INPUT_LookDown: |
17 | 9203 //__debugbreak(); |
0 | 9204 if ( pEventTimer->bPaused ) |
9205 break; | |
9206 partyAction = (PartyAction)8; | |
163 | 9207 //goto _add_action_and_continue_; |
9208 v5 = pActionQueue; | |
9209 v5->Add(partyAction); | |
9210 break; | |
0 | 9211 case INPUT_FlyUp: |
17 | 9212 //__debugbreak(); |
0 | 9213 if ( pCurrentScreen |
9214 || pEventTimer->bPaused ) | |
9215 break; | |
9216 partyAction = (PartyAction)13; | |
163 | 9217 //goto _add_action_and_continue_; |
9218 v5 = pActionQueue; | |
9219 v5->Add(partyAction); | |
9220 break; | |
0 | 9221 case INPUT_Land: |
17 | 9222 //__debugbreak(); |
0 | 9223 if ( pCurrentScreen |
9224 || pEventTimer->bPaused ) | |
9225 break; | |
9226 partyAction = (PartyAction)15; | |
163 | 9227 //goto _add_action_and_continue_; |
9228 v5 = pActionQueue; | |
9229 v5->Add(partyAction); | |
9230 break; | |
0 | 9231 case INPUT_FlyDown: |
17 | 9232 //__debugbreak(); |
0 | 9233 if ( !pCurrentScreen |
9234 && !pEventTimer->bPaused ) | |
9235 { | |
9236 partyAction = (PartyAction)14; | |
163 | 9237 //_add_action_and_continue_: |
0 | 9238 v5 = pActionQueue; |
163 | 9239 //_add_action_and_continue: |
0 | 9240 v5->Add(partyAction); |
9241 } | |
9242 break; | |
9243 case INPUT_ZoomIn: | |
17 | 9244 //__debugbreak(); |
0 | 9245 if ( dword_50C9E8 >= 40 ) |
9246 break; | |
9247 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 9248 //goto LABEL_155; |
9249 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9250 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9251 ++dword_50C9E8; | |
9252 break; | |
0 | 9253 case INPUT_ZoomOut: |
17 | 9254 //__debugbreak(); |
0 | 9255 if ( dword_50C9E8 < 40 ) |
9256 { | |
9257 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 9258 //LABEL_155: |
0 | 9259 dword_50C9F0[3 * dword_50C9E8] = 0; |
9260 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9261 ++dword_50C9E8; | |
9262 } | |
9263 break; | |
9264 case INPUT_AlwaysRun: | |
9265 bAlwaysRun = bAlwaysRun == 0; | |
9266 break; | |
17 | 9267 default: |
9268 //__debugbreak(); | |
9269 break; | |
0 | 9270 } |
9271 } | |
9272 inputAction = (InputAction)((int)inputAction + 1); | |
9273 if ( (signed int)inputAction >= 30 ) | |
9274 goto LABEL_176; | |
9275 } | |
9276 } | |
9277 v12 = 0; | |
9278 do | |
9279 { | |
9280 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
9281 v13 = pGame->pKeyboardInstance; | |
9282 if ( pKeyActionMap->pToggleTypes[v12] ) | |
9283 v14 = v13->WasKeyPressed(v22); | |
9284 else | |
9285 v14 = v13->IsKeyBeingHeld(v22); | |
9286 if ( v14 && v12 == 9 ) | |
9287 { | |
9288 if ( !pCurrentScreen ) | |
9289 { | |
9290 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9291 goto LABEL_175; | |
9292 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 9293 //goto LABEL_174; |
9294 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9295 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9296 ++pMessageQueue_50CBD0->uNumMessages; | |
9297 goto LABEL_175; | |
0 | 9298 } |
151 | 9299 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
9300 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 9301 { |
9302 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9303 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9304 { | |
9305 v15 = 0; | |
9306 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9307 { | |
9308 v15 = 1; | |
9309 pMessageQueue_50CBD0->uNumMessages = 1; | |
17 | 9310 //goto LABEL_173; |
9311 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; | |
9312 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9313 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9314 ++pMessageQueue_50CBD0->uNumMessages; | |
9315 goto LABEL_175; | |
0 | 9316 } |
9317 pMessageQueue_50CBD0->uNumMessages = 0; | |
9318 } | |
9319 if ( (signed int)v15 >= 40 ) | |
9320 goto LABEL_175; | |
17 | 9321 //LABEL_173: |
0 | 9322 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9323 //LABEL_174: |
0 | 9324 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9325 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9326 ++pMessageQueue_50CBD0->uNumMessages; | |
9327 goto LABEL_175; | |
9328 } | |
9329 } | |
9330 LABEL_175: | |
9331 ++v12; | |
9332 } | |
9333 while ( v12 < 30 ); | |
9334 LABEL_176: | |
9335 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9336 { | |
9337 AsyncKeyboard::LeaveCriticalSection(); | |
9338 v16 = pAsyncKeyboard; | |
9339 AsyncKeyboard::EnterCriticalSection(); | |
9340 memset((char *)v16 + 521, 0, 0x100u); | |
9341 AsyncKeyboard::LeaveCriticalSection(); | |
9342 } | |
9343 } | |
9344 |