Mercurial > mm7
annotate mm7_6.cpp @ 90:d61f6bc04bf2
more pointer fixes
author | zipi |
---|---|
date | Wed, 06 Feb 2013 22:32:43 +0000 |
parents | 98cd93e14777 |
children | 909822c91d47 |
rev | line source |
---|---|
0 | 1 #include "MM7.h" |
2 | |
3 #include "MapInfo.h" | |
4 #include "Game.h" | |
5 #include "GUIWindow.h" | |
6 #include "GUIFont.h" | |
7 #include "GUIButton.h" | |
8 #include "GUIProgressBar.h" | |
9 #include "Party.h" | |
10 #include "AudioPlayer.h" | |
11 #include "Outdoor.h" | |
12 #include "IndoorCamera.h" | |
13 #include "Overlays.h" | |
14 #include "Monsters.h" | |
15 #include "Arcomage.h" | |
16 #include "LOD.h" | |
17 #include "Actor.h" | |
18 #include "Allocator.h" | |
19 #include "Events.h" | |
20 #include "Viewport.h" | |
21 #include "FrameTableInc.h" | |
22 #include "Math.h" | |
23 #include "LayingItem.h" | |
24 #include "ObjectList.h" | |
25 #include "Chest.h" | |
26 #include "PaletteManager.h" | |
27 #include "DecorationList.h" | |
28 #include "SaveLoad.h" | |
29 #include "stru123.h" | |
30 #include "Time.h" | |
31 #include "IconFrameTable.h" | |
32 #include "stru179.h" | |
33 #include "Awards.h" | |
34 #include "Autonotes.h" | |
35 #include "stru160.h" | |
36 #include "stru279.h" | |
37 #include "TurnEngine.h" | |
38 #include "stru277.h" | |
39 #include "Weather.h" | |
40 #include "stru272.h" | |
41 #include "stru298.h" | |
42 #include "StorylineTextTable.h" | |
43 #include "Events2D.h" | |
44 | |
45 #include "mm7_data.h" | |
46 | |
47 | |
48 | |
49 //----- (00424EE0) -------------------------------------------------------- | |
50 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
51 { | |
52 unsigned int v1; // edx@1 | |
53 double v2; // st7@1 | |
54 signed int v3; // edi@1 | |
55 char *v4; // esi@4 | |
56 char *v5; // ecx@4 | |
57 unsigned int v6; // eax@4 | |
58 char *v7; // edx@4 | |
59 double v8; // st6@10 | |
60 double v9; // st5@10 | |
61 double v10; // st6@11 | |
62 unsigned __int8 v11; // c2@15 | |
63 unsigned __int8 v12; // c3@15 | |
64 void *v13; // edi@22 | |
65 char *v14; // eax@22 | |
66 double v15; // st6@22 | |
67 char *v16; // ecx@22 | |
68 signed int result; // eax@24 | |
69 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
70 bool v19; // [sp+Ch] [bp-28h]@6 | |
71 char *v20; // [sp+10h] [bp-24h]@4 | |
72 char *v21; // [sp+14h] [bp-20h]@4 | |
73 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
74 char *v23; // [sp+1Ch] [bp-18h]@4 | |
75 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
76 char *v25; // [sp+24h] [bp-10h]@4 | |
77 char *v26; // [sp+28h] [bp-Ch]@4 | |
78 char *v27; // [sp+2Ch] [bp-8h]@4 | |
79 char *v28; // [sp+30h] [bp-4h]@4 | |
80 | |
81 v1 = uVertexID; | |
82 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
83 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
84 v3 = 0; | |
85 v22 = 0; | |
86 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | |
87 v3 = 1; | |
88 if ( (signed int)(uVertexID + 1) <= 1 ) | |
89 return 0; | |
90 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
91 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
92 v6 = v1; | |
93 v23 = (char *)&array_507D30[0].flt_2C; | |
94 v26 = (char *)&array_507D30[0].flt_20; | |
95 v24 = array_507D30; | |
96 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
97 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
98 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
99 v27 = (char *)&array_507D30[0].v; | |
100 v28 = (char *)&array_507D30[0].u; | |
101 v7 = (char *)&array_50AC10[0].v; | |
102 v18 = v6; | |
103 do | |
104 { | |
105 v19 = v2 >= *((float *)v7 + 5); | |
106 if ( v3 != v19 ) | |
107 { | |
108 if ( v19 ) | |
109 { | |
110 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | |
111 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | |
112 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | |
113 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | |
114 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | |
115 } | |
116 else | |
117 { | |
118 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | |
119 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | |
120 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | |
121 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | |
122 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | |
123 } | |
124 *(float *)v27 = v9; | |
125 *(float *)v25 = v2; | |
126 *(float *)v26 = 1.0 / v2; | |
127 if ( v3 ) | |
128 { | |
129 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
130 { | |
131 v11 = 0; | |
132 v12 = *(float *)v4 == *((float *)v7 - 5); | |
133 goto LABEL_19; | |
134 } | |
135 } | |
136 else | |
137 { | |
138 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
139 { | |
140 v11 = 0; | |
141 v12 = *(float *)v4 == *((float *)v7 + 7); | |
142 LABEL_19: | |
143 if ( v12 | v11 ) | |
144 goto LABEL_21; | |
145 goto LABEL_20; | |
146 } | |
147 } | |
148 LABEL_20: | |
149 v26 += 48; | |
150 ++v24; | |
151 v25 += 48; | |
152 v27 += 48; | |
153 v28 += 48; | |
154 v5 += 48; | |
155 v4 += 48; | |
156 ++v22; | |
157 v23 += 48; | |
158 v21 = v5; | |
159 v20 = v4; | |
160 } | |
161 LABEL_21: | |
162 if ( v19 ) | |
163 { | |
164 v13 = v24; | |
165 v14 = v26; | |
166 v21 += 48; | |
167 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
168 v20 += 48; | |
169 ++v22; | |
170 v28 += 48; | |
171 v27 += 48; | |
172 v25 += 48; | |
173 ++v24; | |
174 v26 += 48; | |
175 memcpy(v13, v7 + 8, 0x30u); | |
176 v16 = v23; | |
177 v23 += 48; | |
178 v4 = v20; | |
179 *(float *)v14 = v15; | |
180 *(int *)v16 = *((int *)v7 + 13); | |
181 v5 = v21; | |
182 } | |
183 v3 = v19; | |
184 v7 += 48; | |
185 --v18; | |
186 } | |
187 while ( v18 ); | |
188 result = v22; | |
189 if ( v22 < 3 ) | |
190 return 0; | |
191 return result; | |
192 } | |
193 | |
194 //----- (004250FE) -------------------------------------------------------- | |
195 signed int __fastcall sr_4250FE(unsigned int uVertexID) | |
196 { | |
197 unsigned int v1; // edx@1 | |
198 char *v2; // edi@5 | |
199 char *v3; // esi@5 | |
200 char *v4; // ecx@5 | |
201 int v5; // ebx@6 | |
202 double v6; // st6@11 | |
203 double v7; // st5@11 | |
204 double v8; // st6@12 | |
205 unsigned __int8 v9; // c2@16 | |
206 unsigned __int8 v10; // c3@16 | |
207 void *v11; // edi@23 | |
208 double v12; // st6@23 | |
209 char *v13; // ecx@23 | |
210 char v14; // zf@24 | |
211 signed int result; // eax@25 | |
212 unsigned int v16; // [sp+8h] [bp-28h]@5 | |
213 bool v17; // [sp+Ch] [bp-24h]@2 | |
214 bool v18; // [sp+10h] [bp-20h]@7 | |
215 char *v19; // [sp+14h] [bp-1Ch]@5 | |
216 char *v20; // [sp+18h] [bp-18h]@5 | |
217 signed int v21; // [sp+1Ch] [bp-14h]@1 | |
218 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5 | |
219 char *v23; // [sp+24h] [bp-Ch]@5 | |
220 char *v24; // [sp+28h] [bp-8h]@5 | |
221 char *v25; // [sp+2Ch] [bp-4h]@5 | |
222 | |
223 v1 = uVertexID; | |
224 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
225 v21 = 0; | |
226 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0; | |
227 if ( (signed int)(uVertexID + 1) <= 1 ) | |
228 return 0; | |
229 v2 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
230 v3 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
231 v24 = (char *)&array_507D30[0].flt_20; | |
232 v22 = array_507D30; | |
233 v19 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
234 v20 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
235 v23 = (char *)&array_507D30[0].vWorldViewPosition; | |
236 v25 = (char *)&array_507D30[0].flt_2C; | |
237 v4 = (char *)&array_50AC10[0].vWorldViewPosition; | |
238 v16 = v1; | |
239 do | |
240 { | |
241 v5 = (int)(v4 + 48); | |
242 v18 = *((float *)v4 + 12) >= 8.0; | |
243 if ( v17 != v18 ) | |
244 { | |
245 if ( v18 ) | |
246 { | |
247 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4); | |
248 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1); | |
249 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2); | |
250 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8); | |
251 } | |
252 else | |
253 { | |
254 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5); | |
255 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13); | |
256 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14); | |
257 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20); | |
258 } | |
259 *(float *)v25 = v7; | |
260 *(float *)v23 = 8.0; | |
261 *(int *)v24 = 0x3E000000u; | |
262 if ( v17 ) | |
263 { | |
264 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) ) | |
265 { | |
266 v9 = 0; | |
267 v10 = *(float *)v2 == *((float *)v4 + 2); | |
268 goto LABEL_20; | |
269 } | |
270 } | |
271 else | |
272 { | |
273 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) ) | |
274 { | |
275 v9 = 0; | |
276 v10 = *(float *)v2 == *((float *)v4 + 14); | |
277 LABEL_20: | |
278 if ( v10 | v9 ) | |
279 goto LABEL_22; | |
280 goto LABEL_21; | |
281 } | |
282 } | |
283 LABEL_21: | |
284 ++v22; | |
285 v23 += 48; | |
286 v25 += 48; | |
287 v3 += 48; | |
288 v2 += 48; | |
289 ++v21; | |
290 v24 += 48; | |
291 v20 = v3; | |
292 v19 = v2; | |
293 } | |
294 LABEL_22: | |
295 if ( v18 ) | |
296 { | |
297 v11 = v22; | |
298 v20 += 48; | |
299 v19 += 48; | |
300 v12 = 1.0 / (*(float *)v5 + 0.0000001); | |
301 ++v21; | |
302 v25 += 48; | |
303 v23 += 48; | |
304 ++v22; | |
305 memcpy(v11, v4 + 36, 0x30u); | |
306 v13 = v24; | |
307 v24 += 48; | |
308 v3 = v20; | |
309 v2 = v19; | |
310 *(float *)v13 = v12; | |
311 } | |
312 v14 = v16-- == 1; | |
313 v17 = v18; | |
314 v4 = (char *)v5; | |
315 } | |
316 while ( !v14 ); | |
317 result = v21; | |
318 if ( v21 < 3 ) | |
319 return 0; | |
320 return result; | |
321 } | |
322 | |
323 //----- (004252E8) -------------------------------------------------------- | |
324 signed int __fastcall sr_4252E8(unsigned int uVertexID) | |
325 { | |
326 unsigned int v1; // edx@1 | |
327 double v2; // st7@1 | |
328 char *v3; // edi@5 | |
329 char *v4; // esi@5 | |
330 char *v5; // ecx@5 | |
331 int v6; // ebx@6 | |
332 double v7; // st6@11 | |
333 double v8; // st5@11 | |
334 double v9; // st6@12 | |
335 unsigned __int8 v10; // c2@16 | |
336 unsigned __int8 v11; // c3@16 | |
337 void *v12; // edi@23 | |
338 double v13; // st6@23 | |
339 char *v14; // ecx@23 | |
340 char v15; // zf@24 | |
341 signed int result; // eax@25 | |
342 unsigned int v17; // [sp+8h] [bp-28h]@5 | |
343 bool v18; // [sp+Ch] [bp-24h]@2 | |
344 bool v19; // [sp+10h] [bp-20h]@7 | |
345 char *v20; // [sp+14h] [bp-1Ch]@5 | |
346 char *v21; // [sp+18h] [bp-18h]@5 | |
347 signed int v22; // [sp+1Ch] [bp-14h]@1 | |
348 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5 | |
349 char *v24; // [sp+24h] [bp-Ch]@5 | |
350 char *v25; // [sp+28h] [bp-8h]@5 | |
351 char *v26; // [sp+2Ch] [bp-4h]@5 | |
352 | |
353 v1 = uVertexID; | |
354 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
355 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
356 v22 = 0; | |
357 v18 = array_50AC10[0].vWorldViewPosition.x <= v2; | |
358 if ( (signed int)(uVertexID + 1) <= 1 ) | |
359 return 0; | |
360 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
361 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
362 v25 = (char *)&array_507D30[0].flt_20; | |
363 v23 = array_507D30; | |
364 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
365 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
366 v24 = (char *)&array_507D30[0].vWorldViewPosition; | |
367 v26 = (char *)&array_507D30[0].flt_2C; | |
368 v5 = (char *)&array_50AC10[0].vWorldViewPosition; | |
369 v17 = v1; | |
370 do | |
371 { | |
372 v6 = (int)(v5 + 48); | |
373 v19 = v2 >= *((float *)v5 + 12); | |
374 if ( v18 != v19 ) | |
375 { | |
376 if ( v19 ) | |
377 { | |
378 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5); | |
379 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1); | |
380 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2); | |
381 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8); | |
382 } | |
383 else | |
384 { | |
385 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6); | |
386 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13); | |
387 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14); | |
388 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20); | |
389 } | |
390 *(float *)v26 = v8; | |
391 *(float *)v24 = v2; | |
392 *(float *)v25 = 1.0 / v2; | |
393 if ( v18 ) | |
394 { | |
395 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) ) | |
396 { | |
397 v10 = 0; | |
398 v11 = *(float *)v3 == *((float *)v5 + 2); | |
399 goto LABEL_20; | |
400 } | |
401 } | |
402 else | |
403 { | |
404 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) ) | |
405 { | |
406 v10 = 0; | |
407 v11 = *(float *)v3 == *((float *)v5 + 14); | |
408 LABEL_20: | |
409 if ( v11 | v10 ) | |
410 goto LABEL_22; | |
411 goto LABEL_21; | |
412 } | |
413 } | |
414 LABEL_21: | |
415 ++v23; | |
416 v24 += 48; | |
417 v26 += 48; | |
418 v4 += 48; | |
419 v3 += 48; | |
420 ++v22; | |
421 v25 += 48; | |
422 v21 = v4; | |
423 v20 = v3; | |
424 } | |
425 LABEL_22: | |
426 if ( v19 ) | |
427 { | |
428 v12 = v23; | |
429 v21 += 48; | |
430 v20 += 48; | |
431 v13 = 1.0 / (*(float *)v6 + 0.0000001); | |
432 ++v22; | |
433 v26 += 48; | |
434 v24 += 48; | |
435 ++v23; | |
436 memcpy(v12, v5 + 36, 0x30u); | |
437 v14 = v25; | |
438 v25 += 48; | |
439 v4 = v21; | |
440 v3 = v20; | |
441 *(float *)v14 = v13; | |
442 } | |
443 v15 = v17-- == 1; | |
444 v18 = v19; | |
445 v5 = (char *)v6; | |
446 } | |
447 while ( !v15 ); | |
448 result = v22; | |
449 if ( v22 < 3 ) | |
450 return 0; | |
451 return result; | |
452 } | |
453 | |
454 | |
455 | |
456 //----- (004361EF) -------------------------------------------------------- | |
457 IndoorCameraD3D::IndoorCameraD3D() | |
458 { | |
459 IndoorCameraD3D *v1; // esi@1 | |
460 double v2; // st7@1 | |
461 double v3; // st6@1 | |
462 double v4; // st5@1 | |
463 double v5; // st7@1 | |
464 double v6; // st6@1 | |
465 double v7; // st5@1 | |
466 | |
467 v1 = this; | |
468 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4); | |
469 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14); | |
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24); | |
471 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, | |
472 24, | |
473 6, | |
474 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
475 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ | |
476 v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
477 v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
478 v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; | |
479 v1->field_108 = 0.0; | |
480 v1->field_DC = v4; | |
481 v1->field_E0 = v3; | |
482 v1->field_E4 = v2; | |
483 v5 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
484 v6 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
485 v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300); | |
486 v1->field_138 = 0.0; | |
487 v1->field_10C = v7; | |
488 v1->field_110 = v6; | |
489 v1->field_114 = v5; | |
490 v1->field_168 = 0.0; | |
491 v1->field_198 = 0.0; | |
492 v1->field_1C8 = 0.0; | |
493 v1->field_1F8 = 0.0; | |
494 v1->field_228 = 0.0; | |
495 v1->field_258 = 0.0; | |
496 v1->field_288 = 0.0; | |
497 v1->field_2B8 = 0.0; | |
498 v1->field_2E8 = 0.0; | |
499 v1->field_2BC = 0.0; | |
500 v1->field_2C0 = 0.0; | |
501 v1->field_2C4 = 0.0; | |
502 v1->field_318 = 0.0; | |
503 v1->field_2EC = 0.0; | |
504 v1->field_2F0 = 0.0; | |
505 v1->field_2F4 = 0.0; | |
506 v1->field_348 = 0.0; | |
507 v1->field_31C = 0.0; | |
508 v1->field_320 = 0.0; | |
509 v1->field_324 = 0.0; | |
510 v1->field_378 = 0.0; | |
511 v1->field_34C = 0.0; | |
512 v1->field_350 = 0.0; | |
513 v1->field_354 = 0.0; | |
514 for (uint i = 0; i < 16384; ++i) | |
515 { | |
516 list_0037C[i].field_0 = 0; | |
517 list_0037C[i].flt_30 = 0.0f; | |
518 } | |
519 | |
520 list_0037C_size = 0; | |
521 for (uint i = 0; i < 256; ++i) | |
522 list_E0380[i].mm7__vector_000004_size = 0; | |
523 /*v10 = v1->list_E0380; | |
524 v12 = 256; | |
525 do | |
526 { | |
527 v10->mm7__vector_000004_size = 0; | |
528 //mm7__vector_constructor( | |
529 // v10->mm7__vector_000004, | |
530 // 48, | |
531 // 64, | |
532 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); | |
533 //++v10; | |
534 --v12; | |
535 } | |
536 while ( v12 );*/ | |
537 list_E0380_size = 0; | |
538 //v1->vdestructor_ptr = &stru8_pvdtor; | |
539 } | |
540 | |
541 | |
542 //----- (004254D2) -------------------------------------------------------- | |
543 int __fastcall sr_4254D2(signed int a1) | |
544 { | |
545 signed int v1; // ebx@2 | |
546 int v2; // ecx@2 | |
547 int result; // eax@11 | |
548 double v4; // ST74_8@12 | |
549 bool v5; // edi@12 | |
550 char *v6; // esi@13 | |
551 char *v7; // ebx@13 | |
552 double v8; // st7@15 | |
553 double v9; // st7@16 | |
554 double v10; // st6@16 | |
555 double v11; // st7@17 | |
556 float v12; // eax@18 | |
557 double v13; // ST4C_8@19 | |
558 double v14; // ST10_8@19 | |
559 double v15; // ST28_8@20 | |
560 double v16; // ST34_8@20 | |
561 char v17; // zf@20 | |
562 double v18; // ST18_8@21 | |
563 double v19; // ST3C_8@21 | |
564 double v20; // ST44_8@22 | |
565 double v21; // ST54_8@22 | |
566 void *v22; // edi@26 | |
567 double v23; // ST54_8@29 | |
568 bool v24; // esi@29 | |
569 char *v25; // edi@30 | |
570 char *v26; // ebx@30 | |
571 bool v27; // ecx@32 | |
572 double v28; // st7@33 | |
573 double v29; // st7@34 | |
574 double v30; // st6@34 | |
575 double v31; // st7@35 | |
576 double v32; // ST44_8@37 | |
577 double v33; // ST3C_8@37 | |
578 double v34; // ST18_8@38 | |
579 double v35; // ST34_8@38 | |
580 char v36; // zf@38 | |
581 double v37; // ST28_8@39 | |
582 double v38; // ST10_8@39 | |
583 double v39; // ST20_8@40 | |
584 double v40; // ST5C_8@40 | |
585 void *v41; // edi@44 | |
586 double v42; // ST5C_8@47 | |
587 bool v43; // edi@47 | |
588 char *v44; // esi@48 | |
589 char *v45; // ebx@48 | |
590 bool v46; // ecx@49 | |
591 double v47; // st6@50 | |
592 double v48; // st6@51 | |
593 double v49; // st5@51 | |
594 double v50; // st6@52 | |
595 double v51; // ST20_8@54 | |
596 double v52; // ST54_8@54 | |
597 double v53; // ST44_8@55 | |
598 double v54; // ST3C_8@55 | |
599 char v55; // zf@55 | |
600 double v56; // ST18_8@56 | |
601 double v57; // ST34_8@56 | |
602 double v58; // ST28_8@57 | |
603 double v59; // ST10_8@57 | |
604 void *v60; // edi@61 | |
605 double v61; // ST5C_8@64 | |
606 bool v62; // edi@64 | |
607 char *v63; // esi@65 | |
608 char *v64; // ebx@65 | |
609 bool v65; // ecx@66 | |
610 double v66; // st6@67 | |
611 double v67; // st6@68 | |
612 double v68; // st5@68 | |
613 double v69; // st6@69 | |
614 double v70; // ST20_8@71 | |
615 double v71; // ST54_8@71 | |
616 double v72; // ST44_8@72 | |
617 double v73; // ST3C_8@72 | |
618 char v74; // zf@72 | |
619 double v75; // ST18_8@73 | |
620 double v76; // ST34_8@73 | |
621 double v77; // ST28_8@74 | |
622 double v78; // ST10_8@74 | |
623 void *v79; // edi@78 | |
624 int v80; // ebx@81 | |
625 char *v81; // ecx@82 | |
626 signed int v82; // esi@82 | |
627 float v83; // ST78_4@83 | |
628 double v84; // ST5C_8@83 | |
629 float v85; // eax@84 | |
630 double v86; // ST20_8@85 | |
631 double v87; // ST54_8@88 | |
632 float v88; // eax@89 | |
633 double v89; // ST44_8@90 | |
634 unsigned __int8 v90; // sf@94 | |
635 unsigned __int8 v91; // of@94 | |
636 int v92; // edx@97 | |
637 int v93; // esi@97 | |
638 int v94; // edi@97 | |
639 int v95; // eax@97 | |
640 int v96; // eax@104 | |
641 double v97; // [sp+4Ch] [bp-8Ch]@32 | |
642 double v98; // [sp+54h] [bp-84h]@49 | |
643 double v99; // [sp+54h] [bp-84h]@66 | |
644 float v100; // [sp+5Ch] [bp-7Ch]@1 | |
645 float v101; // [sp+60h] [bp-78h]@1 | |
646 float v102; // [sp+64h] [bp-74h]@1 | |
647 double v103; // [sp+6Ch] [bp-6Ch]@14 | |
648 float v104; // [sp+A8h] [bp-30h]@1 | |
649 signed int v105; // [sp+A8h] [bp-30h]@96 | |
650 bool v106; // [sp+ACh] [bp-2Ch]@14 | |
651 bool v107; // [sp+ACh] [bp-2Ch]@32 | |
652 bool v108; // [sp+ACh] [bp-2Ch]@49 | |
653 bool v109; // [sp+ACh] [bp-2Ch]@66 | |
654 signed int v110; // [sp+B0h] [bp-28h]@12 | |
655 char *v111; // [sp+B8h] [bp-20h]@30 | |
656 signed int v112; // [sp+B8h] [bp-20h]@48 | |
657 signed int v113; // [sp+B8h] [bp-20h]@65 | |
658 char *v114; // [sp+BCh] [bp-1Ch]@13 | |
659 signed int v115; // [sp+BCh] [bp-1Ch]@29 | |
660 signed int v116; // [sp+BCh] [bp-1Ch]@64 | |
661 signed int v117; // [sp+C0h] [bp-18h]@1 | |
662 char *v118; // [sp+C0h] [bp-18h]@30 | |
663 char *v119; // [sp+C0h] [bp-18h]@48 | |
664 char *v120; // [sp+C0h] [bp-18h]@65 | |
665 char *v121; // [sp+C4h] [bp-14h]@13 | |
666 char *v122; // [sp+C4h] [bp-14h]@30 | |
667 signed int v123; // [sp+C4h] [bp-14h]@47 | |
668 char *v124; // [sp+C8h] [bp-10h]@30 | |
669 char *v125; // [sp+C8h] [bp-10h]@48 | |
670 char *v126; // [sp+C8h] [bp-10h]@65 | |
671 signed int v127; // [sp+CCh] [bp-Ch]@2 | |
672 char *v128; // [sp+CCh] [bp-Ch]@13 | |
673 char *v129; // [sp+CCh] [bp-Ch]@30 | |
674 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48 | |
675 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65 | |
676 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13 | |
677 char *v133; // [sp+D0h] [bp-8h]@30 | |
678 char *v134; // [sp+D0h] [bp-8h]@48 | |
679 char *v135; // [sp+D0h] [bp-8h]@65 | |
680 signed int v136; // [sp+D4h] [bp-4h]@1 | |
681 char *v137; // [sp+D4h] [bp-4h]@13 | |
682 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30 | |
683 char *v139; // [sp+D4h] [bp-4h]@48 | |
684 char *v140; // [sp+D4h] [bp-4h]@65 | |
685 | |
686 v101 = (double)(signed int)pViewport->uViewportX; | |
687 v100 = (double)(signed int)pViewport->uViewportZ; | |
688 v117 = a1; | |
689 v136 = 1; | |
690 v104 = (double)(signed int)pViewport->uViewportY; | |
691 v102 = (double)(pViewport->uViewportW + 1); | |
692 if ( a1 <= 0 ) | |
693 return v117; | |
694 v127 = a1; | |
695 v1 = a1; | |
696 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2)); | |
697 v2 = 0; | |
698 do | |
699 { | |
700 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 ) | |
701 v136 = 0; | |
702 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 ) | |
703 v136 = 0; | |
704 ++v2; | |
705 --v127; | |
706 } | |
707 while ( v127 ); | |
708 if ( v136 ) | |
709 return v117; | |
710 v110 = 0; | |
711 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1])); | |
712 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15; | |
713 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportX; | |
714 if ( v117 < 1 ) | |
715 goto LABEL_112; | |
716 v6 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
717 v132 = array_50A2B0; | |
718 v137 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
719 v128 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
720 v121 = (char *)&array_50A2B0[0].flt_2C; | |
721 v114 = (char *)&array_50A2B0[0].flt_20; | |
722 v7 = (char *)&array_50AC10[0].flt_2C; | |
723 do | |
724 { | |
725 v103 = *((float *)v7 + 7) + 6.7553994e15; | |
726 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportX; | |
727 if ( !(v5 ^ v106) ) | |
728 goto LABEL_25; | |
729 v8 = v101; | |
730 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportX ) | |
731 { | |
732 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5)); | |
733 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4); | |
734 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3); | |
735 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7; | |
736 } | |
737 else | |
738 { | |
739 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7)); | |
740 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8); | |
741 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9); | |
742 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12); | |
743 } | |
744 *(float *)v121 = v10; | |
745 *(int *)v137 = LODWORD(v101); | |
746 LODWORD(v12) = *(int *)v6; | |
747 if ( v5 ) | |
748 { | |
749 v13 = v12 + 6.7553994e15; | |
750 v14 = *((float *)v7 - 4) + 6.7553994e15; | |
751 if ( LODWORD(v13) == LODWORD(v14) ) | |
752 { | |
753 v15 = *(float *)v137 + 6.7553994e15; | |
754 v16 = *((float *)v7 - 5) + 6.7553994e15; | |
755 v17 = LODWORD(v15) == LODWORD(v16); | |
756 goto LABEL_23; | |
757 } | |
758 } | |
759 else | |
760 { | |
761 v18 = v12 + 6.7553994e15; | |
762 v19 = *((float *)v7 + 8) + 6.7553994e15; | |
763 if ( LODWORD(v18) == LODWORD(v19) ) | |
764 { | |
765 v20 = *(float *)v137 + 6.7553994e15; | |
766 v21 = *((float *)v7 + 7) + 6.7553994e15; | |
767 v17 = LODWORD(v20) == LODWORD(v21); | |
768 LABEL_23: | |
769 if ( v17 ) | |
770 goto LABEL_25; | |
771 goto LABEL_24; | |
772 } | |
773 } | |
774 LABEL_24: | |
775 v121 += 48; | |
776 v114 += 48; | |
777 v6 += 48; | |
778 ++v110; | |
779 ++v132; | |
780 v128 = v6; | |
781 v137 += 48; | |
782 LABEL_25: | |
783 if ( v106 ) | |
784 { | |
785 v22 = v132; | |
786 v128 += 48; | |
787 ++v110; | |
788 v114 += 48; | |
789 v121 += 48; | |
790 v137 += 48; | |
791 ++v132; | |
792 memcpy(v22, v7 + 4, 0x30u); | |
793 v6 = v128; | |
794 } | |
795 v5 = v106; | |
796 v7 += 48; | |
797 --v117; | |
798 } | |
799 while ( v117 ); | |
800 if ( v110 < 3 | |
801 || (v115 = 0, | |
802 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])), | |
803 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15, | |
804 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportZ, | |
805 v110 < 1) ) | |
806 goto LABEL_112; | |
807 v25 = (char *)&array_509950[0].flt_20; | |
808 v138 = array_509950; | |
809 v129 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
810 v118 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
811 v133 = (char *)&array_509950[0].vWorldViewProjX; | |
812 v122 = (char *)&array_509950[0].vWorldViewProjY; | |
813 v124 = (char *)&array_509950[0].flt_2C; | |
814 v111 = (char *)&array_509950[0].flt_20; | |
815 v26 = (char *)&array_50A2B0[0].flt_2C; | |
816 while ( 2 ) | |
817 { | |
818 v97 = *((float *)v26 + 7) + 6.7553994e15; | |
819 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
820 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
821 if ( v24 != v27 ) | |
822 { | |
823 v28 = v100; | |
824 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportZ ) | |
825 { | |
826 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5)); | |
827 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4); | |
828 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3); | |
829 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26; | |
830 } | |
831 else | |
832 { | |
833 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7)); | |
834 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8); | |
835 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9); | |
836 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12); | |
837 } | |
838 *(float *)v124 = v30; | |
839 *(int *)v133 = LODWORD(v100); | |
840 if ( v24 ) | |
841 { | |
842 v32 = *(float *)v122 + 6.7553994e15; | |
843 v33 = *((float *)v26 - 4) + 6.7553994e15; | |
844 if ( LODWORD(v32) == LODWORD(v33) ) | |
845 { | |
846 v34 = *(float *)v133 + 6.7553994e15; | |
847 v35 = *((float *)v26 - 5) + 6.7553994e15; | |
848 v36 = LODWORD(v34) == LODWORD(v35); | |
849 goto LABEL_41; | |
850 } | |
851 goto LABEL_42; | |
852 } | |
853 v37 = *(float *)v118 + 6.7553994e15; | |
854 v38 = *((float *)v26 + 8) + 6.7553994e15; | |
855 if ( LODWORD(v37) != LODWORD(v38) ) | |
856 goto LABEL_42; | |
857 v39 = *(float *)v129 + 6.7553994e15; | |
858 v40 = *((float *)v26 + 7) + 6.7553994e15; | |
859 v36 = LODWORD(v39) == LODWORD(v40); | |
860 LABEL_41: | |
861 if ( !v36 ) | |
862 { | |
863 LABEL_42: | |
864 v129 += 48; | |
865 v118 += 48; | |
866 v133 += 48; | |
867 v122 += 48; | |
868 v124 += 48; | |
869 v111 += 48; | |
870 ++v115; | |
871 ++v138; | |
872 } | |
873 } | |
874 if ( v27 ) | |
875 { | |
876 v41 = v138; | |
877 ++v115; | |
878 v111 += 48; | |
879 v124 += 48; | |
880 v122 += 48; | |
881 v133 += 48; | |
882 v118 += 48; | |
883 v129 += 48; | |
884 ++v138; | |
885 memcpy(v41, v26 + 4, 0x30u); | |
886 } | |
887 v24 = v107; | |
888 v26 += 48; | |
889 --v110; | |
890 if ( v110 ) | |
891 { | |
892 v25 = v111; | |
893 continue; | |
894 } | |
895 break; | |
896 } | |
897 if ( v115 < 3 | |
898 || (v123 = 0, | |
899 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])), | |
900 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15, | |
901 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportY, | |
902 v115 < 1) ) | |
903 goto LABEL_112; | |
904 v44 = (char *)&array_508FF0[0].vWorldViewProjX; | |
905 v130 = array_508FF0; | |
906 v119 = (char *)&array_508FF0[0].vWorldViewProjX; | |
907 v139 = (char *)&array_508FF0[0].vWorldViewProjY; | |
908 v125 = (char *)&array_508FF0[0].flt_2C; | |
909 v134 = (char *)&array_508FF0[0].flt_20; | |
910 v45 = (char *)&array_509950[0].flt_2C; | |
911 v112 = v115; | |
912 while ( 2 ) | |
913 { | |
914 v98 = *((float *)v45 + 8) + 6.7553994e15; | |
915 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
916 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
917 if ( v43 != v46 ) | |
918 { | |
919 v47 = v104; | |
920 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportY ) | |
921 { | |
922 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4)); | |
923 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5); | |
924 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3); | |
925 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45; | |
926 } | |
927 else | |
928 { | |
929 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8)); | |
930 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7); | |
931 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9); | |
932 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12); | |
933 } | |
934 *(float *)v125 = v49; | |
935 *(float *)v139 = v104; | |
936 if ( v43 ) | |
937 { | |
938 v51 = v104 + 6.7553994e15; | |
939 v52 = *((float *)v45 - 4) + 6.7553994e15; | |
940 if ( LODWORD(v51) == LODWORD(v52) ) | |
941 { | |
942 v53 = *(float *)v44 + 6.7553994e15; | |
943 v54 = *((float *)v45 - 5) + 6.7553994e15; | |
944 v55 = LODWORD(v53) == LODWORD(v54); | |
945 goto LABEL_58; | |
946 } | |
947 goto LABEL_59; | |
948 } | |
949 v56 = v104 + 6.7553994e15; | |
950 v57 = *((float *)v45 + 8) + 6.7553994e15; | |
951 if ( LODWORD(v56) != LODWORD(v57) ) | |
952 goto LABEL_59; | |
953 v58 = *(float *)v44 + 6.7553994e15; | |
954 v59 = *((float *)v45 + 7) + 6.7553994e15; | |
955 v55 = LODWORD(v58) == LODWORD(v59); | |
956 LABEL_58: | |
957 if ( !v55 ) | |
958 { | |
959 LABEL_59: | |
960 v139 += 48; | |
961 v125 += 48; | |
962 v134 += 48; | |
963 v44 += 48; | |
964 ++v123; | |
965 ++v130; | |
966 v119 = v44; | |
967 } | |
968 } | |
969 if ( v46 ) | |
970 { | |
971 v60 = v130; | |
972 v119 += 48; | |
973 ++v123; | |
974 v134 += 48; | |
975 v125 += 48; | |
976 v139 += 48; | |
977 ++v130; | |
978 memcpy(v60, v45 + 4, 0x30u); | |
979 v44 = v119; | |
980 } | |
981 v43 = v108; | |
982 v45 += 48; | |
983 --v112; | |
984 if ( v112 ) | |
985 continue; | |
986 break; | |
987 } | |
988 if ( v123 < 3 | |
989 || (v116 = 0, | |
990 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])), | |
991 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15, | |
992 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportW, | |
993 v123 < 1) ) | |
994 goto LABEL_112; | |
995 v63 = (char *)&array_508690[0].vWorldViewProjX; | |
996 v131 = array_508690; | |
997 v120 = (char *)&array_508690[0].vWorldViewProjX; | |
998 v140 = (char *)&array_508690[0].vWorldViewProjY; | |
999 v126 = (char *)&array_508690[0].flt_2C; | |
1000 v135 = (char *)&array_508690[0].flt_20; | |
1001 v64 = (char *)&array_508FF0[0].flt_2C; | |
1002 v113 = v123; | |
1003 while ( 2 ) | |
1004 { | |
1005 v99 = *((float *)v64 + 8) + 6.7553994e15; | |
1006 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1007 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1008 if ( v62 != v65 ) | |
1009 { | |
1010 v66 = v102; | |
1011 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportW ) | |
1012 { | |
1013 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4)); | |
1014 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5); | |
1015 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3); | |
1016 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64; | |
1017 } | |
1018 else | |
1019 { | |
1020 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8)); | |
1021 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7); | |
1022 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9); | |
1023 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12); | |
1024 } | |
1025 *(float *)v126 = v68; | |
1026 *(float *)v140 = v102; | |
1027 if ( v62 ) | |
1028 { | |
1029 v70 = v102 + 6.7553994e15; | |
1030 v71 = *((float *)v64 - 4) + 6.7553994e15; | |
1031 if ( LODWORD(v70) == LODWORD(v71) ) | |
1032 { | |
1033 v72 = *(float *)v63 + 6.7553994e15; | |
1034 v73 = *((float *)v64 - 5) + 6.7553994e15; | |
1035 v74 = LODWORD(v72) == LODWORD(v73); | |
1036 goto LABEL_75; | |
1037 } | |
1038 goto LABEL_76; | |
1039 } | |
1040 v75 = v102 + 6.7553994e15; | |
1041 v76 = *((float *)v64 + 8) + 6.7553994e15; | |
1042 if ( LODWORD(v75) != LODWORD(v76) ) | |
1043 goto LABEL_76; | |
1044 v77 = *(float *)v63 + 6.7553994e15; | |
1045 v78 = *((float *)v64 + 7) + 6.7553994e15; | |
1046 v74 = LODWORD(v77) == LODWORD(v78); | |
1047 LABEL_75: | |
1048 if ( !v74 ) | |
1049 { | |
1050 LABEL_76: | |
1051 v140 += 48; | |
1052 v126 += 48; | |
1053 v135 += 48; | |
1054 v63 += 48; | |
1055 ++v116; | |
1056 ++v131; | |
1057 v120 = v63; | |
1058 } | |
1059 } | |
1060 if ( v65 ) | |
1061 { | |
1062 v79 = v131; | |
1063 v120 += 48; | |
1064 ++v116; | |
1065 v135 += 48; | |
1066 v126 += 48; | |
1067 v140 += 48; | |
1068 ++v131; | |
1069 memcpy(v79, v64 + 4, 0x30u); | |
1070 v63 = v120; | |
1071 } | |
1072 v62 = v109; | |
1073 v64 += 48; | |
1074 --v113; | |
1075 if ( v113 ) | |
1076 continue; | |
1077 break; | |
1078 } | |
1079 if ( v116 < 3 ) | |
1080 goto LABEL_112; | |
1081 v80 = v116; | |
1082 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116])); | |
1083 if ( v116 > 0 ) | |
1084 { | |
1085 v81 = (char *)&array_508690[0].vWorldViewProjX; | |
1086 v82 = v116; | |
1087 do | |
1088 { | |
1089 LODWORD(v83) = *(int *)v81; | |
1090 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2); | |
1091 v84 = v83 + 6.7553994e15; | |
1092 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportZ ) | |
1093 { | |
1094 v86 = *(float *)v81 + 6.7553994e15; | |
1095 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportX ) | |
1096 goto LABEL_88; | |
1097 v85 = v101; | |
1098 } | |
1099 else | |
1100 { | |
1101 v85 = v100; | |
1102 } | |
1103 *(int *)v81 = LODWORD(v85); | |
1104 LABEL_88: | |
1105 v87 = *((float *)v81 + 1) + 6.7553994e15; | |
1106 if ( SLODWORD(v87) > (signed int)pViewport->uViewportW ) | |
1107 { | |
1108 v88 = v102; | |
1109 LABEL_92: | |
1110 *((int *)v81 + 1) = LODWORD(v88); | |
1111 goto LABEL_93; | |
1112 } | |
1113 v89 = *((float *)v81 + 1) + 6.7553994e15; | |
1114 if ( SLODWORD(v89) < (signed int)pViewport->uViewportY ) | |
1115 { | |
1116 v88 = v104; | |
1117 goto LABEL_92; | |
1118 } | |
1119 LABEL_93: | |
1120 v81 += 48; | |
1121 --v82; | |
1122 } | |
1123 while ( v82 ); | |
1124 } | |
1125 v91 = __OFSUB__(v116, 3); | |
1126 v90 = v116 - 3 < 0; | |
1127 if ( v116 > 3 ) | |
1128 { | |
1129 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1])); | |
1130 if ( v116 > 0 ) | |
1131 { | |
1132 v105 = 1; | |
1133 do | |
1134 { | |
1135 v92 = v105; | |
1136 v93 = v105 - 1; | |
1137 v94 = v105 + 1; | |
1138 v95 = v105 + 1; | |
1139 if ( v105 - 1 >= v80 ) | |
1140 v93 -= v80; | |
1141 if ( v105 >= v80 ) | |
1142 v92 = v105 - v80; | |
1143 if ( v94 >= v80 ) | |
1144 v95 = v94 - v80; | |
1145 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1146 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY) | |
1147 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1148 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 ) | |
1149 { | |
1150 ++v105; | |
1151 } | |
1152 else | |
1153 { | |
1154 v96 = v105; | |
1155 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) ) | |
1156 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2)); | |
1157 --v80; | |
1158 } | |
1159 } | |
1160 while ( v105 - 1 < v80 ); | |
1161 } | |
1162 v91 = __OFSUB__(v80, 3); | |
1163 v90 = v80 - 3 < 0; | |
1164 } | |
1165 if ( v90 ^ v91 ) | |
1166 LABEL_112: | |
1167 result = 0; | |
1168 else | |
1169 result = v80; | |
1170 return result; | |
1171 } | |
1172 | |
1173 //----- (0042620A) -------------------------------------------------------- | |
1174 bool __thiscall sr_42620A(RenderVertexSoft *p) | |
1175 { | |
1176 __int16 v1; // fps@1 | |
1177 unsigned __int8 v2; // c0@2 | |
1178 char v3; // c2@2 | |
1179 unsigned __int8 v4; // c3@2 | |
1180 bool result; // eax@2 | |
1181 unsigned __int8 v6; // c0@4 | |
1182 char v7; // c2@4 | |
1183 unsigned __int8 v8; // c3@4 | |
1184 unsigned __int8 v9; // c0@6 | |
1185 char v10; // c2@6 | |
1186 unsigned __int8 v11; // c3@6 | |
1187 double v12; // st6@7 | |
1188 float v13; // ST04_4@7 | |
1189 float v14; // ST00_4@7 | |
1190 double v15; // st7@7 | |
1191 double v16; // st6@8 | |
1192 float v17; // ST04_4@8 | |
1193 float v18; // ST00_4@8 | |
1194 double v19; // st7@8 | |
1195 | |
1196 //UNDEF(v1); | |
1197 if ( p->vWorldViewPosition.x < 300.0 | |
1198 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
1199 v3 = 0, | |
1200 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
1201 BYTE1(result) = HIBYTE(v1), | |
1202 !(v2 | v4)) ) | |
1203 { | |
1204 if ( p->vWorldViewPosition.x < 300.0 ) | |
1205 { | |
1206 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
1207 v7 = 0; | |
1208 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
1209 BYTE1(result) = HIBYTE(v1); | |
1210 if ( !(v6 | v8) ) | |
1211 { | |
1212 LOBYTE(result) = 0; | |
1213 return result; | |
1214 } | |
1215 } | |
1216 v9 = 300.0 < p->vWorldViewPosition.x; | |
1217 v10 = 0; | |
1218 v11 = 300.0 == p->vWorldViewPosition.x; | |
1219 BYTE1(result) = HIBYTE(v1); | |
1220 if ( v9 | v11 ) | |
1221 { | |
1222 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
1223 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
1224 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
1225 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
1226 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
1227 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
1228 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
1229 } | |
1230 else | |
1231 { | |
1232 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
1233 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
1234 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
1235 v15 = 300.0 - p->vWorldViewPosition.x; | |
1236 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
1237 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
1238 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
1239 } | |
1240 } | |
1241 LOBYTE(result) = 1; | |
1242 return result; | |
1243 } | |
1244 | |
1245 | |
1246 | |
1247 | |
1248 //----- (004268E3) -------------------------------------------------------- | |
1249 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) | |
1250 { | |
1251 unsigned int v1; // eax@1 | |
1252 unsigned int v2; // edx@1 | |
1253 int v3; // eax@1 | |
1254 int v4; // edx@1 | |
1255 unsigned int v5; // ecx@1 | |
1256 | |
1257 v1 = uColor >> 9; | |
1258 v2 = uColor >> 6; | |
1259 LOWORD(v1) = (uColor >> 9) & 0x7C00; | |
1260 LOWORD(v2) = (uColor >> 6) & 0x3E0; | |
1261 v3 = v2 | v1; | |
1262 v4 = (unsigned __int8)uColor >> 3; | |
1263 v5 = uColor >> 16; | |
1264 LOWORD(v5) = v5 & 0x8000; | |
1265 return v5 | v4 | v3; | |
1266 } | |
1267 | |
1268 //----- (0042690D) -------------------------------------------------------- | |
1269 int __fastcall _42690D_colors_cvt(unsigned int a1) | |
1270 { | |
1271 unsigned int v1; // eax@1 | |
1272 unsigned int v2; // edx@1 | |
1273 | |
1274 v1 = a1 >> 8; | |
1275 v2 = a1 >> 5; | |
1276 LOWORD(v1) = (a1 >> 8) & 0xF800; | |
1277 LOWORD(v2) = (a1 >> 5) & 0x7E0; | |
1278 return ((unsigned __int8)a1 >> 3) | v2 | v1; | |
1279 } | |
1280 | |
1281 //----- (00426947) -------------------------------------------------------- | |
1282 void __cdecl sub_426947() | |
1283 { | |
1284 dword_50C968 = 0; | |
1285 dword_50C994 = 0; | |
1286 dword_50C998_turnbased_icon_1A = 0; | |
1287 } | |
1288 // 50C968: using guessed type int dword_50C968; | |
1289 // 50C994: using guessed type int dword_50C994; | |
1290 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A; | |
1291 | |
1292 | |
1293 | |
1294 //----- (004269A2) -------------------------------------------------------- | |
1295 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1) | |
1296 { | |
89 | 1297 //unsigned __int64 v1; // qax@1 |
1298 Player *v1; | |
1299 int v1b; | |
0 | 1300 signed int v2; // ecx@1 |
82 | 1301 int *v3; // esi@1 |
0 | 1302 bool v4; // edi@6 |
82 | 1303 int *v5; // edi@10 |
1304 Player *v6; // esi@10 | |
0 | 1305 int v7; // eax@13 |
1306 unsigned __int8 v8; // cf@13 | |
89 | 1307 int v10[4]; // [sp+Ch] [bp-14h]@1 |
0 | 1308 int v11; // [sp+1Ch] [bp-4h]@10 |
1309 | |
89 | 1310 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1); |
1311 v1 = pParty->pPlayers; | |
1312 v1b = a1; | |
0 | 1313 v2 = 0; |
89 | 1314 v3 = v10; |
0 | 1315 do |
1316 { | |
89 | 1317 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8)) |
0 | 1318 && !*(int *)HIDWORD(v1) |
1319 && !*(_QWORD *)(HIDWORD(v1) + 8) | |
89 | 1320 && !*(_QWORD *)(HIDWORD(v1) + 16);*/ |
1321 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13])) | |
1322 && !v1->pConditions[14] | |
1323 && !v1->pConditions[15] | |
1324 && !v1->pConditions[16]; | |
82 | 1325 *v3 = v4; |
89 | 1326 //HIDWORD(v1) += 6972; |
1327 ++v1; | |
0 | 1328 v2 += v4; |
82 | 1329 ++v3; |
0 | 1330 } |
89 | 1331 while ( v1 <= &pParty->pPlayers[3] ); |
0 | 1332 if ( v2 ) |
1333 { | |
89 | 1334 v1b = v1b / v2; |
1335 v5 = v10; | |
82 | 1336 v6 = pParty->pPlayers;//[0].uExperience; |
89 | 1337 v11 = v1b; |
0 | 1338 do |
1339 { | |
82 | 1340 if ( *v5 ) |
0 | 1341 { |
1342 if ( v11 ) | |
1343 { | |
82 | 1344 LOBYTE(v7) = v6->GetLearningPercent(); |
89 | 1345 v1b = v11 + v11 * v7 / 100; |
1346 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience)); | |
1347 //need review | |
1348 LODWORD(v6->uExperience) += v1b; | |
1349 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8; | |
82 | 1350 if ( v6->uExperience > 4000000000i64 ) |
0 | 1351 { |
82 | 1352 HIDWORD(v6->uExperience) = 0; |
1353 LODWORD(v6->uExperience) = -294967296; | |
0 | 1354 } |
1355 } | |
1356 } | |
82 | 1357 ++v6; |
1358 ++v5; | |
0 | 1359 } |
82 | 1360 while ( v6 <= &pParty->pPlayers[3] ); |
0 | 1361 } |
89 | 1362 return v1b; |
0 | 1363 } |
1364 | |
1365 //----- (00426A5A) -------------------------------------------------------- | |
1366 void stru319::LootActor(Actor *pActor) | |
1367 { | |
1368 signed int v2; // edi@1 | |
1369 char v3; // zf@1 | |
1370 unsigned int v4; // eax@13 | |
1371 unsigned int v5; // esi@13 | |
1372 int v6; // eax@14 | |
1373 unsigned __int8 v7; // al@30 | |
1374 Party *v8; // esi@34 | |
1375 char *v9; // [sp-4h] [bp-3Ch]@10 | |
1376 char *v10; // [sp-4h] [bp-3Ch]@31 | |
1377 char *v11; // [sp-4h] [bp-3Ch]@38 | |
1378 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 | |
1379 int v13; // [sp+30h] [bp-8h]@1 | |
1380 int v14; // [sp+34h] [bp-4h]@1 | |
1381 | |
1382 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1383 Dst.Reset(); | |
1384 v2 = 0; | |
1385 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; | |
1386 v13 = 0; | |
1387 v14 = 0; | |
1388 if ( v3 ) | |
1389 { | |
1390 if ( !pActor->pMonsterInfo.uTreasureDiceRolls ) | |
1391 goto LABEL_9; | |
1392 do | |
1393 { | |
1394 ++v2; | |
1395 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | |
1396 } | |
1397 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); | |
1398 } | |
1399 else | |
1400 { | |
1401 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 ) | |
1402 goto LABEL_9; | |
1403 v14 = pActor->array_000234[3].uAdditionalValue; | |
1404 pActor->array_000234[3].Reset(); | |
1405 } | |
1406 if ( v14 ) | |
1407 { | |
1408 party_finds_gold(v14, 0); | |
1409 viewparams->bRedrawGameUI = 1; | |
1410 } | |
1411 LABEL_9: | |
1412 if ( pActor->uCarriedItemID ) | |
1413 { | |
1414 Dst.Reset(); | |
1415 Dst.uItemID = pActor->uCarriedItemID; | |
1416 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1417 if ( v14 ) | |
1418 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v9); | |
1419 else | |
1420 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v9); | |
1421 ShowStatusBarString(pTmpBuf2, 2u); | |
1422 v4 = Dst.uItemID; | |
1423 v5 = Dst.uItemID; | |
1424 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) | |
1425 { | |
1426 v5 = Dst.uItemID; | |
1427 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1; | |
1428 Dst.uNumCharges = v6; | |
1429 Dst.uMaxCharges = v6; | |
1430 v4 = Dst.uItemID; | |
1431 } | |
1432 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) | |
1433 Dst._bonus_type = 2 * rand() % 4 + 2; | |
1434 pItemsTable->SetSpecialBonus(&Dst); | |
1435 if ( !pParty->AddItem(&Dst) ) | |
1436 pParty->SetHoldingItem(&Dst); | |
1437 pActor->uCarriedItemID = 0; | |
1438 if ( pActor->array_000234[0].uItemID ) | |
1439 { | |
1440 if ( !pParty->AddItem(pActor->array_000234) ) | |
1441 { | |
1442 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1443 pParty->SetHoldingItem(pActor->array_000234); | |
1444 } | |
1445 pActor->array_000234[0].Reset(); | |
1446 } | |
1447 if ( pActor->array_000234[1].uItemID ) | |
1448 { | |
1449 if ( !pParty->AddItem(&pActor->array_000234[1]) ) | |
1450 { | |
1451 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1452 pParty->SetHoldingItem(&pActor->array_000234[1]); | |
1453 } | |
1454 pActor->array_000234[1].Reset(); | |
1455 } | |
1456 LABEL_55: | |
1457 pActor->Remove(); | |
1458 return; | |
1459 } | |
1460 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) | |
1461 { | |
1462 if ( pActor->array_000234[3].uItemID ) | |
1463 { | |
1464 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); | |
1465 pActor->array_000234[3].Reset(); | |
1466 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1467 if ( v14 ) | |
1468 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); | |
1469 else | |
1470 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); | |
1471 ShowStatusBarString(pTmpBuf2, 2u); | |
1472 if ( !pParty->AddItem(&Dst) ) | |
1473 pParty->SetHoldingItem(&Dst); | |
1474 v13 = 1; | |
1475 } | |
1476 goto LABEL_44; | |
1477 } | |
1478 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | |
1479 { | |
1480 LABEL_44: | |
1481 v8 = pParty; | |
1482 goto LABEL_45; | |
1483 } | |
1484 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | |
1485 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1486 if ( v14 ) | |
1487 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); | |
1488 else | |
1489 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); | |
1490 ShowStatusBarString(pTmpBuf2, 2u); | |
1491 v8 = pParty; | |
1492 if ( !pParty->AddItem(&Dst) ) | |
1493 pParty->SetHoldingItem(&Dst); | |
1494 v13 = 1; | |
1495 LABEL_45: | |
1496 if ( pActor->array_000234[0].uItemID ) | |
1497 { | |
1498 if ( !v8->AddItem(pActor->array_000234) ) | |
1499 { | |
1500 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1501 v8->SetHoldingItem(pActor->array_000234); | |
1502 v13 = 1; | |
1503 } | |
1504 pActor->array_000234[0].Reset(); | |
1505 } | |
1506 if ( pActor->array_000234[1].uItemID ) | |
1507 { | |
1508 if ( !v8->AddItem(&pActor->array_000234[1]) ) | |
1509 { | |
1510 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1511 v8->SetHoldingItem(&pActor->array_000234[1]); | |
1512 v13 = 1; | |
1513 } | |
1514 pActor->array_000234[1].Reset(); | |
1515 } | |
1516 if ( !v13 || rand() % 100 < 90 ) | |
1517 goto LABEL_55; | |
1518 } | |
1519 | |
1520 //----- (00426E10) -------------------------------------------------------- | |
1521 int stru319::which_player_would_attack(Actor *pActor) | |
1522 { | |
1523 signed int v2; // ebx@1 | |
1524 int v3; // ecx@2 | |
1525 signed int v4; // edx@3 | |
1526 char v5; // zf@3 | |
1527 unsigned int v6; // eax@3 | |
1528 int v7; // eax@6 | |
1529 int v8; // eax@7 | |
1530 int v9; // eax@8 | |
1531 int v10; // eax@9 | |
1532 int v11; // eax@10 | |
1533 int v12; // eax@11 | |
1534 int v13; // esi@35 | |
1535 signed int v14; // edi@37 | |
1536 enum CHARACTER_RACE v15; // eax@44 | |
1537 Player *v16; // ecx@47 | |
1538 unsigned __int8 v17; // sf@50 | |
1539 unsigned __int8 v18; // of@50 | |
1540 int v19; // esi@52 | |
1541 Player *v20; // ecx@53 | |
1542 int result; // eax@57 | |
1543 int v22[16]; // [sp+8h] [bp-140h]@3 | |
1544 int v23[60]; // [sp+48h] [bp-100h]@48 | |
1545 int v24; // [sp+138h] [bp-10h]@2 | |
1546 int v25; // [sp+13Ch] [bp-Ch]@1 | |
1547 int v26; // [sp+140h] [bp-8h]@1 | |
1548 int v27; // [sp+144h] [bp-4h]@1 | |
1549 | |
1550 v27 = -1; | |
1551 v26 = -1; | |
1552 v25 = -1; | |
1553 v2 = 0; | |
1554 if ( pActor->pMonsterInfo.uAttackPreference ) | |
1555 { | |
1556 v3 = 0; | |
1557 v24 = 0; | |
1558 do | |
1559 { | |
1560 v4 = 1; | |
1561 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); | |
1562 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; | |
1563 v22[v3] = v6; | |
1564 if ( !v5 ) | |
1565 { | |
1566 if ( (signed int)v6 > 128 ) | |
1567 { | |
1568 switch ( v6 ) | |
1569 { | |
1570 case 0x100u: | |
1571 v27 = 8; | |
1572 break; | |
1573 case 0x200u: | |
1574 v25 = 0; | |
1575 break; | |
1576 case 0x400u: | |
1577 v25 = 1; | |
1578 break; | |
1579 case 0x800u: | |
1580 v26 = 0; | |
1581 break; | |
1582 case 0x1000u: | |
1583 v26 = 1; | |
1584 break; | |
1585 case 0x2000u: | |
1586 v26 = 3; | |
1587 break; | |
1588 case 0x4000u: | |
1589 v26 = 2; | |
1590 break; | |
1591 } | |
1592 } | |
1593 else | |
1594 { | |
1595 if ( v6 == 128 ) | |
1596 { | |
1597 v27 = 4; | |
1598 } | |
1599 else | |
1600 { | |
1601 v7 = v6 - 1; | |
1602 if ( v7 ) | |
1603 { | |
1604 v8 = v7 - 1; | |
1605 if ( v8 ) | |
1606 { | |
1607 v9 = v8 - 2; | |
1608 if ( v9 ) | |
1609 { | |
1610 v10 = v9 - 4; | |
1611 if ( v10 ) | |
1612 { | |
1613 v11 = v10 - 8; | |
1614 if ( v11 ) | |
1615 { | |
1616 v12 = v11 - 16; | |
1617 if ( v12 ) | |
1618 { | |
1619 if ( v12 == 32 ) | |
1620 v27 = 20; | |
1621 } | |
1622 else | |
1623 { | |
1624 v27 = 32; | |
1625 } | |
1626 } | |
1627 else | |
1628 { | |
1629 v27 = 24; | |
1630 } | |
1631 } | |
1632 else | |
1633 { | |
1634 v27 = 28; | |
1635 } | |
1636 } | |
1637 else | |
1638 { | |
1639 v27 = 16; | |
1640 } | |
1641 } | |
1642 else | |
1643 { | |
1644 v27 = 12; | |
1645 } | |
1646 } | |
1647 else | |
1648 { | |
1649 v27 = 0; | |
1650 } | |
1651 } | |
1652 } | |
1653 v2 = 0; | |
1654 v13 = 0; | |
1655 while ( 1 ) | |
1656 { | |
1657 v14 = 0; | |
1658 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->uClass ) | |
1659 v14 = v4; | |
1660 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) | |
1661 v14 = v4; | |
1662 if ( v26 != -1 ) | |
1663 { | |
1664 v15 = pPlayers[v13 + 1]->GetRace(); | |
1665 if ( v26 == v15 ) | |
1666 v14 = 1; | |
1667 } | |
1668 if ( v14 == 1 ) | |
1669 { | |
1670 v16 = pPlayers[v13 + 1]; | |
1671 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) | |
1672 v23[v2++] = v13; | |
1673 } | |
1674 ++v13; | |
1675 if ( v13 >= 4 ) | |
1676 break; | |
1677 v4 = 1; | |
1678 } | |
1679 } | |
1680 v3 = v24 + 1; | |
1681 v18 = __OFSUB__(v24 + 1, 15); | |
1682 v17 = v24++ - 14 < 0; | |
1683 } | |
1684 while ( v17 ^ v18 ); | |
1685 if ( v2 ) | |
1686 goto LABEL_61; | |
1687 } | |
1688 v19 = 0; | |
1689 do | |
1690 { | |
1691 v20 = pPlayers[v19 + 1]; | |
1692 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) | |
1693 v23[v2++] = v19; | |
1694 ++v19; | |
1695 } | |
1696 while ( v19 < 4 ); | |
1697 if ( v2 ) | |
1698 LABEL_61: | |
1699 result = v23[rand() % v2]; | |
1700 else | |
1701 result = 0; | |
1702 return result; | |
1703 } | |
1704 | |
1705 | |
1706 //----- (0042704B) -------------------------------------------------------- | |
1707 bool stru319::special_ability_use_check(Actor *pActor, int a2) | |
1708 { | |
1709 stru319 *v3; // edi@1 | |
1710 signed int v4; // ebx@5 | |
1711 signed int v5; // edi@5 | |
1712 | |
1713 v3 = this; | |
1714 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
1715 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
1716 && rand() % 100 < 5 ) | |
1717 pActor->_44FD29(a2); | |
1718 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); | |
1719 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); | |
1720 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
1721 return 2; | |
1722 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
1723 return 3; | |
1724 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance; | |
1725 } | |
1726 | |
1727 //----- (00427102) -------------------------------------------------------- | |
1728 int stru319::_427102(Actor *pActor, signed int a2) | |
1729 { | |
1730 unsigned __int8 v3; // cf@11 | |
1731 unsigned __int8 v4; // zf@11 | |
1732 SpellBuff *v6; // ecx@46 | |
89 | 1733 Player *v7; // esi@49 |
0 | 1734 signed int v8; // edx@50 |
89 | 1735 SpellBuff *v9; // ecx@50 |
0 | 1736 |
1737 if ( a2 > 73 ) | |
1738 { | |
1739 if ( a2 == 77 ) | |
1740 { | |
1741 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP ) | |
1742 return 0; | |
1743 return 1; | |
1744 } | |
1745 if ( a2 == 80 ) | |
1746 { | |
1747 v6 = pParty->pPartyBuffs; | |
1748 while ( (signed __int64)v6->uExpireTime <= 0 ) | |
1749 { | |
1750 ++v6; | |
89 | 1751 if ( v6 > &pParty->pPartyBuffs[19] ) |
1752 { | |
1753 v7 = pParty->pPlayers;//[0].pPlayerBuffs; | |
0 | 1754 v8 = 0; |
89 | 1755 v9 = v7->pPlayerBuffs; |
1756 while ( v9->uExpireTime <= 0i64 ) | |
0 | 1757 { |
1758 ++v8; | |
89 | 1759 ++v9; |
0 | 1760 if ( v8 >= 24 ) |
1761 { | |
89 | 1762 ++v7; |
1763 if ( v7 <= &pParty->pPlayers[3] ) | |
1764 { | |
1765 v8 = 0; | |
1766 v9 = v7->pPlayerBuffs; | |
1767 } | |
1768 else | |
1769 return 0; | |
0 | 1770 } |
1771 } | |
1772 return 1; | |
1773 } | |
1774 } | |
1775 return 1; | |
1776 } | |
1777 if ( a2 == 85 ) | |
1778 { | |
1779 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 ) | |
1780 return 1; | |
1781 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 ) | |
1782 return 0; | |
1783 v3 = 0; | |
1784 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0; | |
1785 } | |
1786 else | |
1787 { | |
1788 if ( a2 == 86 ) | |
1789 { | |
1790 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 ) | |
1791 return 1; | |
1792 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 ) | |
1793 return 0; | |
1794 v3 = 0; | |
1795 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0; | |
1796 } | |
1797 else | |
1798 { | |
1799 if ( a2 != 95 || SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 ) | |
1800 return 1; | |
1801 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 ) | |
1802 return 0; | |
1803 v3 = 0; | |
1804 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0; | |
1805 } | |
1806 } | |
1807 } | |
1808 else | |
1809 { | |
1810 if ( a2 == 73 ) | |
1811 { | |
1812 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 ) | |
1813 return 1; | |
1814 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 ) | |
1815 return 0; | |
1816 v3 = 0; | |
1817 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0; | |
1818 } | |
89 | 1819 else if ( a2 == 5 ) |
0 | 1820 { |
1821 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 ) | |
1822 return 1; | |
1823 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 ) | |
1824 return 0; | |
1825 v3 = 0; | |
1826 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0; | |
1827 } | |
89 | 1828 else if ( a2 == 17 ) |
0 | 1829 { |
1830 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 ) | |
1831 return 1; | |
1832 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 ) | |
1833 return 0; | |
1834 v3 = 0; | |
1835 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0; | |
1836 } | |
89 | 1837 else if ( a2 == 38 ) |
0 | 1838 { |
1839 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 ) | |
1840 return 1; | |
1841 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 ) | |
1842 return 0; | |
1843 v3 = 0; | |
1844 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0; | |
1845 } | |
89 | 1846 else if ( a2 == 46 ) |
0 | 1847 { |
1848 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 ) | |
1849 return 1; | |
1850 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 ) | |
1851 return 0; | |
1852 v3 = 0; | |
1853 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0; | |
1854 } | |
89 | 1855 else |
1856 { | |
1857 if ( a2 != 47 ) | |
1858 { | |
1859 if ( a2 != 51 || SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 ) | |
1860 return 1; | |
1861 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 ) | |
1862 { | |
1863 v3 = 0; | |
1864 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0; | |
1865 } | |
1866 else | |
1867 return 0; | |
1868 } | |
1869 else | |
1870 { | |
1871 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 ) | |
1872 return 1; | |
1873 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 ) | |
1874 return 0; | |
1875 v3 = 0; | |
1876 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0; | |
1877 } | |
1878 } | |
0 | 1879 } |
1880 if ( !(v3 | v4) ) | |
1881 return 0; | |
1882 return 1; | |
1883 } | |
1884 | |
1885 //----- (004272F5) -------------------------------------------------------- | |
1886 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
1887 { | |
1888 signed int v5; // esi@1 | |
1889 signed int v6; // edi@1 | |
1890 int v7; // esi@8 | |
1891 int v8; // eax@9 | |
1892 int v9; // edx@11 | |
1893 int v10; // edx@13 | |
1894 int v11; // esi@13 | |
1895 unsigned __int8 v12; // sf@13 | |
1896 unsigned __int8 v13; // of@13 | |
1897 int v14; // edx@14 | |
1898 int v15; // eax@14 | |
1899 signed int result; // eax@17 | |
1900 | |
1901 v5 = pActor->pMonsterInfo.uAC; | |
1902 v6 = 0; | |
1903 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 ) | |
1904 v5 /= 2; | |
1905 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1906 v6 = pActor->pActorBuffs[15].uPower; | |
1907 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 ) | |
1908 v6 = pActor->pActorBuffs[16].uPower; | |
1909 v7 = v6 + v5; | |
1910 if ( a3 ) | |
1911 v8 = pPlayer->GetRangedAttack(); | |
1912 else | |
1913 v8 = pPlayer->GetActualAttack(0); | |
1914 v9 = rand() % (v7 + 2 * v8 + 30); | |
1915 if ( a3 == 2 ) | |
1916 { | |
1917 v14 = a4 + v9; | |
1918 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1919 } | |
1920 else | |
1921 { | |
1922 if ( a3 != 3 ) | |
1923 { | |
1924 v10 = a4 + v9; | |
1925 v11 = v7 + 15; | |
1926 v13 = __OFSUB__(v10, v11); | |
1927 v12 = v10 - v11 < 0; | |
1928 goto LABEL_16; | |
1929 } | |
1930 v14 = a4 + v9; | |
1931 v15 = 2 * v7 + 30; | |
1932 } | |
1933 v13 = __OFSUB__(v14, v15); | |
1934 v12 = v14 - v15 < 0; | |
1935 LABEL_16: | |
1936 if ( v12 ^ v13 ) | |
1937 result = 0; | |
1938 else | |
1939 result = 1; | |
1940 return result; | |
1941 } | |
1942 | |
1943 //----- (004273BB) -------------------------------------------------------- | |
1944 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
1945 { | |
1946 Actor *v5; // ecx@1 | |
1947 signed int v6; // ebx@1 | |
1948 signed int v7; // esi@1 | |
1949 unsigned __int8 v8; // zf@1 | |
1950 unsigned __int8 v9; // sf@1 | |
1951 int v10; // ebx@10 | |
1952 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
1953 | |
1954 v5 = a2; | |
1955 v6 = a2->pMonsterInfo.uAC; | |
1956 v7 = 0; | |
1957 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0; | |
1958 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0; | |
1959 a2a = 0; | |
1960 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) ) | |
1961 v6 /= 2; | |
1962 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 ) | |
1963 v7 = v5->pActorBuffs[14].uPower; | |
1964 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 ) | |
1965 v7 = v5->pActorBuffs[16].uPower; | |
1966 v10 = v7 + v6; | |
1967 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1968 a2a = pActor->pActorBuffs[14].uPower; | |
1969 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a ) | |
1970 a2a = pActor->pActorBuffs[17].uPower; | |
1971 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1972 { | |
1973 a2a += pActor->pActorBuffs[11].uPower; | |
1974 pActor->pActorBuffs[11].Reset(); | |
1975 } | |
1976 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
1977 } | |
1978 | |
1979 //----- (004274AD) -------------------------------------------------------- | |
1980 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
1981 { | |
1982 signed int v3; // edi@1 | |
1983 signed int v4; // esi@8 | |
1984 int v5; // esi@8 | |
1985 | |
1986 v3 = 0; | |
1987 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1988 v3 = pActor->pActorBuffs[14].uPower; | |
1989 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 ) | |
1990 v3 = pActor->pActorBuffs[17].uPower; | |
1991 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1992 { | |
1993 v3 += pActor->pActorBuffs[11].uPower; | |
1994 pActor->pActorBuffs[11].Reset(); | |
1995 } | |
1996 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
1997 v5 = rand() % v4 + 1; | |
1998 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
1999 } | |
2000 | |
2001 //----- (00427546) -------------------------------------------------------- | |
2002 int stru319::_427546(int a2) | |
2003 { | |
2004 int result; // eax@2 | |
2005 | |
2006 if ( a2 >= 0 ) | |
2007 { | |
2008 if ( a2 >= 1 ) | |
2009 result = (a2 >= 2) + 2; | |
2010 else | |
2011 result = 1; | |
2012 } | |
2013 else | |
2014 { | |
2015 result = 0; | |
2016 } | |
2017 return result; | |
2018 } | |
2019 | |
2020 //----- (0042756B) -------------------------------------------------------- | |
2021 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
2022 { | |
2023 int v4; // edx@1 | |
2024 int v5; // ecx@1 | |
2025 signed int v6; // eax@4 | |
2026 signed int result; // eax@17 | |
2027 signed int v8; // esi@18 | |
2028 | |
2029 v4 = 0; | |
2030 v5 = 0; | |
2031 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
2032 v5 = pActor->pActorBuffs[14].uPower; | |
2033 switch ( a2 ) | |
2034 { | |
2035 case 4: | |
2036 v6 = pActor->pMonsterInfo.uResPhysical; | |
2037 break; | |
2038 case 0: | |
2039 v6 = pActor->pMonsterInfo.uResFire; | |
2040 goto LABEL_12; | |
2041 case 1: | |
2042 v6 = pActor->pMonsterInfo.uResAir; | |
2043 goto LABEL_12; | |
2044 case 2: | |
2045 v6 = pActor->pMonsterInfo.uResWater; | |
2046 goto LABEL_12; | |
2047 case 3: | |
2048 v6 = pActor->pMonsterInfo.uResEarth; | |
2049 goto LABEL_12; | |
2050 case 6: | |
2051 v6 = pActor->pMonsterInfo.uResSpirit; | |
2052 break; | |
2053 case 7: | |
2054 v6 = pActor->pMonsterInfo.uResMind; | |
2055 goto LABEL_12; | |
2056 case 8: | |
2057 v6 = pActor->pMonsterInfo.uResBody; | |
2058 LABEL_12: | |
2059 v4 = v5; | |
2060 break; | |
2061 case 9: | |
2062 v6 = pActor->pMonsterInfo.uResLight; | |
2063 break; | |
2064 case 10: | |
2065 v6 = pActor->pMonsterInfo.uResDark; | |
2066 break; | |
2067 default: | |
2068 v6 = 0; | |
2069 break; | |
2070 } | |
2071 if ( v6 < 200 ) | |
2072 { | |
2073 v8 = v4 + v6 + 30; | |
2074 if ( rand() % v8 >= 30 ) | |
2075 { | |
2076 a3 >>= 1; | |
2077 if ( rand() % v8 >= 30 ) | |
2078 { | |
2079 a3 >>= 1; | |
2080 if ( rand() % v8 >= 30 ) | |
2081 { | |
2082 a3 >>= 1; | |
2083 if ( rand() % v8 >= 30 ) | |
2084 a3 >>= 1; | |
2085 } | |
2086 } | |
2087 } | |
2088 result = a3; | |
2089 } | |
2090 else | |
2091 { | |
2092 result = 0; | |
2093 } | |
2094 return result; | |
2095 } | |
2096 | |
2097 //----- (00427662) -------------------------------------------------------- | |
2098 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
2099 { | |
2100 Actor *v3; // edi@2 | |
2101 signed int v4; // esi@2 | |
2102 bool result; // eax@13 | |
2103 | |
2104 switch ( uType ) | |
2105 { | |
2106 case 0u: | |
2107 v3 = pActor; | |
2108 v4 = pActor->pMonsterInfo.uResFire; | |
2109 goto LABEL_12; | |
2110 case 1u: | |
2111 v3 = pActor; | |
2112 v4 = pActor->pMonsterInfo.uResAir; | |
2113 goto LABEL_12; | |
2114 case 2u: | |
2115 v3 = pActor; | |
2116 v4 = pActor->pMonsterInfo.uResWater; | |
2117 goto LABEL_12; | |
2118 case 3u: | |
2119 v3 = pActor; | |
2120 v4 = pActor->pMonsterInfo.uResEarth; | |
2121 goto LABEL_12; | |
2122 case 7u: | |
2123 v3 = pActor; | |
2124 v4 = pActor->pMonsterInfo.uResMind; | |
2125 goto LABEL_12; | |
2126 case 6u: | |
2127 v3 = pActor; | |
2128 v4 = pActor->pMonsterInfo.uResSpirit; | |
2129 goto LABEL_12; | |
2130 case 8u: | |
2131 v3 = pActor; | |
2132 v4 = pActor->pMonsterInfo.uResBody; | |
2133 goto LABEL_12; | |
2134 case 9u: | |
2135 v3 = pActor; | |
2136 v4 = pActor->pMonsterInfo.uResLight; | |
2137 goto LABEL_12; | |
2138 case 0xAu: | |
2139 v3 = pActor; | |
2140 v4 = pActor->pMonsterInfo.uResDark; | |
2141 goto LABEL_12; | |
2142 case 4u: | |
2143 v3 = pActor; | |
2144 v4 = pActor->pMonsterInfo.uResPhysical; | |
2145 LABEL_12: | |
2146 if ( v4 < 200 ) | |
2147 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | |
2148 else | |
2149 result = 0; | |
2150 break; | |
2151 default: | |
2152 result = 1; | |
2153 break; | |
2154 } | |
2155 return result; | |
2156 } | |
2157 | |
2158 | |
2159 //----- (00427769) -------------------------------------------------------- | |
2160 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
2161 { | |
2162 bool result; // eax@2 | |
2163 | |
2164 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) | |
2165 result = 1; | |
2166 else | |
2167 result = 0; | |
2168 return result; | |
2169 } | |
2170 | |
2171 //----- (0042777D) -------------------------------------------------------- | |
2172 bool __fastcall _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) | |
2173 { | |
2174 bool result; // eax@2 | |
2175 __int16 v6; // bx@4 | |
2176 Player *v7; // eax@4 | |
2177 char v8; // zf@12 | |
2178 unsigned __int16 v9; // cx@16 | |
2179 unsigned int v10; // eax@18 | |
2180 unsigned __int8 v11; // sf@18 | |
2181 unsigned __int8 v12; // of@18 | |
2182 unsigned __int16 v13; // cx@21 | |
2183 unsigned int v14; // eax@23 | |
2184 stru277 *v15; // esi@27 | |
2185 stru277 *v16; // eax@28 | |
2186 GUIWindow *v17; // eax@43 | |
2187 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | |
2188 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | |
2189 unsigned int v20; // [sp-28h] [bp-40h]@44 | |
2190 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | |
2191 unsigned int v22; // [sp-20h] [bp-38h]@44 | |
2192 int v23; // [sp-1Ch] [bp-34h]@44 | |
2193 int v24; // [sp-18h] [bp-30h]@44 | |
2194 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | |
2195 unsigned int v26; // [sp-10h] [bp-28h]@43 | |
2196 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | |
2197 char *v28; // [sp-8h] [bp-20h]@43 | |
2198 Texture *v29; // [sp-4h] [bp-1Ch]@43 | |
2199 __int16 a3a; // [sp+10h] [bp-8h]@1 | |
2200 __int16 a2a; // [sp+14h] [bp-4h]@1 | |
2201 | |
2202 a3a = uPlayerID; | |
2203 a2a = a1; | |
2204 if ( pParty->bTurnBasedModeOn != 1 | |
2205 || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | |
2206 { | |
2207 v6 = a5; | |
2208 v7 = &pParty->pPlayers[uPlayerID]; | |
2209 if ( !(a5 & 0x10) ) | |
2210 { | |
2211 switch ( a1 ) | |
2212 { | |
2213 case 47: | |
2214 case 68: | |
2215 case 89: | |
2216 HIBYTE(v6) = HIBYTE(a5) | 1; | |
2217 break; | |
2218 case 4: | |
2219 case 28: | |
2220 case 30: | |
2221 case 91: | |
2222 LOBYTE(v6) = a5 | 0x80; | |
2223 break; | |
2224 case 2: | |
2225 case 6: | |
2226 case 11: | |
2227 case 18: | |
2228 case 20: | |
2229 case 24: | |
2230 case 26: | |
2231 case 29: | |
2232 case 32: | |
2233 case 34: | |
2234 case 35: | |
2235 case 37: | |
2236 case 39: | |
2237 case 44: | |
2238 case 52: | |
2239 case 57: | |
2240 case 60: | |
2241 case 65: | |
2242 case 70: | |
2243 case 76: | |
2244 case 78: | |
2245 case 79: | |
2246 case 87: | |
2247 case 90: | |
2248 case 92: | |
2249 case 93: | |
2250 case 97: | |
2251 if ( !a6 ) | |
2252 goto LABEL_9; | |
2253 break; | |
2254 case 59: | |
2255 case 62: | |
2256 case 66: | |
2257 case 81: | |
2258 case 94: | |
2259 LABEL_9: | |
2260 v6 = a5 | 8; | |
2261 break; | |
2262 case 42: | |
2263 v6 = a5 | 0x40; | |
2264 break; | |
2265 case 46: | |
2266 if ( a4 ) | |
2267 v8 = (a4 & 0x1C0) == 0; | |
2268 else | |
2269 v8 = (v7->pActiveSkills[16] & 0x1C0) == 0; | |
2270 if ( v8 ) | |
2271 goto LABEL_25; | |
2272 break; | |
2273 case 50: | |
2274 v9 = a4; | |
2275 if ( !a4 ) | |
2276 v9 = v7->pActiveSkills[16]; | |
2277 goto LABEL_18; | |
2278 case 95: | |
2279 v9 = a4; | |
2280 if ( !a4 ) | |
2281 v9 = v7->pActiveSkills[20]; | |
2282 LABEL_18: | |
2283 v10 = SkillToMastery(v9); | |
2284 v12 = __OFSUB__(v10, 3); | |
2285 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2286 goto LABEL_24; | |
2287 case 73: | |
2288 v13 = a4; | |
2289 if ( !a4 ) | |
2290 v13 = v7->pActiveSkills[18]; | |
2291 v14 = SkillToMastery(v13); | |
2292 v12 = __OFSUB__(v14, 4); | |
2293 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2294 LABEL_24: | |
2295 if ( v11 ^ v12 ) | |
2296 goto LABEL_25; | |
2297 break; | |
2298 case 40: | |
2299 case 49: | |
2300 case 53: | |
2301 case 55: | |
2302 case 56: | |
2303 case 61: | |
2304 case 64: | |
2305 case 67: | |
2306 case 71: | |
2307 case 72: | |
2308 case 74: | |
2309 LABEL_25: | |
2310 v6 = a5 | 2; | |
2311 break; | |
2312 case 96: | |
2313 HIBYTE(v6) = HIBYTE(a5) | 2; | |
2314 break; | |
2315 default: | |
2316 break; | |
2317 } | |
2318 } | |
2319 v15 = pStru277; | |
2320 if ( v6 & 0x3CA ) | |
2321 { | |
2322 v16 = pStru277; | |
2323 while ( !(v16->field_8 & 0x3CA) ) | |
2324 { | |
2325 ++v16; | |
2326 if ( (signed int)v16 >= (signed int)&unk_50C190 ) | |
2327 goto LABEL_33; | |
2328 } | |
2329 v16->spellnum = 0; | |
2330 } | |
2331 do | |
2332 { | |
2333 LABEL_33: | |
2334 if ( v15->spellnum ) | |
2335 { | |
2336 v8 = (v15->field_8 & 0x3CA) == 0; | |
2337 v15->spellnum = 0; | |
2338 if ( !v8 ) | |
2339 { | |
2340 pGUIWindow_Settings->Release(); | |
2341 pGUIWindow_Settings = 0; | |
2342 pMouse->SetCursorBitmap("MICON1"); | |
2343 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2344 unk_50C9A0 = 0; | |
2345 back_to_game(); | |
2346 } | |
2347 } | |
2348 ++v15; | |
2349 } | |
2350 while ( (signed int)v15 < (signed int)&unk_50C190 ); | |
2351 result = pStru277->PushStru277(a2a, a3a, a4, v6, a6); | |
2352 if ( result != -1 ) | |
2353 { | |
2354 if ( v6 & 2 ) | |
2355 { | |
2356 if ( pGUIWindow_Settings ) | |
2357 return result; | |
2358 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
2359 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2360 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2361 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2362 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
2363 return sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2364 } | |
2365 if ( v6 & 8 ) | |
2366 { | |
2367 if ( pGUIWindow_Settings ) | |
2368 return result; | |
2369 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
2370 v29 = 0; | |
2371 v28 = ""; | |
2372 v27 = 0; | |
2373 v26 = 0; | |
2374 v25 = 70; | |
2375 LABEL_44: | |
2376 v24 = 0; | |
2377 v23 = 1; | |
2378 v22 = 344; | |
2379 v21 = 460; | |
2380 v20 = 8; | |
2381 v19 = 8; | |
2382 pGUIWindow_Settings = v17; | |
2383 v18 = v17; | |
2384 LABEL_56: | |
2385 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
2386 return sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2387 } | |
2388 if ( v6 & 0x40 ) | |
2389 { | |
2390 if ( pGUIWindow_Settings ) | |
2391 return result; | |
2392 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
2393 v29 = 0; | |
2394 v28 = ""; | |
2395 v27 = 0; | |
2396 v26 = 0; | |
2397 v25 = 190; | |
2398 goto LABEL_44; | |
2399 } | |
2400 if ( (char)v6 < 0 ) | |
2401 { | |
2402 if ( pGUIWindow_Settings ) | |
2403 return result; | |
2404 ++pIcons_LOD->uTexturePacksCount; | |
2405 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2406 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2407 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2408 unk_50C9A0 = 1; | |
2409 some_active_character = uActiveCharacter; | |
2410 return sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2411 } | |
2412 if ( HIBYTE(v6) & 1 ) | |
2413 { | |
2414 if ( pGUIWindow_Settings ) | |
2415 return result; | |
2416 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0); | |
2417 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); | |
2418 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2419 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2420 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
2421 v29 = 0; | |
2422 v28 = ""; | |
2423 v27 = 0; | |
2424 v26 = 0; | |
2425 v25 = 140; | |
2426 v24 = 0; | |
2427 v23 = 1; | |
2428 v22 = 344; | |
2429 v21 = 460; | |
2430 v20 = 8; | |
2431 v19 = 8; | |
2432 v18 = pGUIWindow_Settings; | |
2433 goto LABEL_56; | |
2434 } | |
2435 if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings ) | |
2436 { | |
2437 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), 20 * result + 5292232, 0); | |
2438 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( | |
2439 0x1D5u, | |
2440 0xB2u, | |
2441 (uTextureID_507990 != -1 ? pIcons_LOD->pTextures[uTextureID_507990].uTextureWidth : 24), | |
2442 (uTextureID_507990 != -1 ? pIcons_LOD->pTextures[uTextureID_507990].uTextureHeight : 26), | |
2443 1, | |
2444 0, | |
2445 0xBCu, | |
2446 0, | |
2447 0, | |
2448 "", | |
2449 (Texture *)(uTextureID_507990 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507990] : 0), | |
2450 0); | |
2451 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2452 0x272u, | |
2453 0xB2u, | |
2454 (uTextureID_50798C != -1 ? pIcons_LOD->pTextures[uTextureID_50798C].uTextureWidth : 24), | |
2455 (uTextureID_50798C != -1 ? pIcons_LOD->pTextures[uTextureID_50798C].uTextureHeight : 26), | |
2456 1, | |
2457 0, | |
2458 0xBCu, | |
2459 1u, | |
2460 0, | |
2461 "", | |
2462 (Texture *)(uTextureID_50798C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50798C] : 0), | |
2463 0); | |
2464 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
2465 result = (bool)pGUIWindow_Settings->CreateButton( | |
2466 0x231u, | |
2467 0x95u, | |
2468 0x40u, | |
2469 0x4Au, | |
2470 1, | |
2471 0, | |
2472 0x8Fu, | |
2473 5u, | |
2474 0x36u, | |
2475 "", | |
2476 0); | |
2477 } | |
2478 } | |
2479 } | |
2480 return result; | |
2481 } | |
2482 | |
2483 | |
2484 | |
2485 //----- (00427D48) -------------------------------------------------------- | |
2486 void stru277::_427D48(unsigned int uPlayerID) | |
2487 { | |
2488 stru277 *v2; // esi@1 | |
2489 signed int v3; // ebx@1 | |
2490 | |
2491 v2 = this; | |
2492 v3 = 10; | |
2493 do | |
2494 { | |
2495 if ( v2->spellnum ) | |
2496 { | |
2497 if ( v2->field_8 & 0x3CA ) | |
2498 { | |
2499 v2->spellnum = 0; | |
2500 pGUIWindow_Settings->Release(); | |
2501 pGUIWindow_Settings = 0; | |
2502 pMouse->SetCursorBitmap("MICON1"); | |
2503 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2504 unk_50C9A0 = 0; | |
2505 back_to_game(); | |
2506 } | |
2507 } | |
2508 ++v2; | |
2509 --v3; | |
2510 } | |
2511 while ( v3 ); | |
2512 } | |
2513 | |
2514 //----- (00427DA0) -------------------------------------------------------- | |
2515 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6) | |
2516 { | |
2517 unsigned int result; // eax@1 | |
2518 stru277 *v7; // edx@1 | |
2519 stru277 *v8; // ecx@5 | |
2520 | |
2521 result = 0; | |
2522 v7 = this; | |
2523 while ( v7->spellnum ) | |
2524 { | |
2525 ++result; | |
2526 ++v7; | |
2527 if ( (signed int)result >= 10 ) | |
2528 goto LABEL_8; | |
2529 } | |
2530 v8 = &this[result]; | |
2531 v8->spellnum = a2; | |
2532 v8->uPlayerID = uPlayerID; | |
2533 if ( a5 & 0x10 ) | |
2534 v8->uPlayerID_2 = uPlayerID; | |
2535 v8->field_6 = 0; | |
2536 *(int *)&v8->field_C = 0; | |
2537 v8->field_8 = a5; | |
2538 v8->field_A = a4; | |
2539 v8->field_10 = a6; | |
2540 LABEL_8: | |
2541 if ( result == 10 ) | |
2542 result = -1; | |
2543 return result; | |
2544 } | |
2545 | |
2546 //----- (00427E01) -------------------------------------------------------- | |
2547 void stru277::_427E01_cast_spell() | |
2548 { | |
2549 int v1; // esi@1 | |
2550 int v2; // edi@1 | |
2551 stru277 *v3; // ebx@2 | |
2552 signed int v4; // eax@8 | |
2553 __int16 v5; // ax@9 | |
2554 signed int v6; // eax@14 | |
2555 __int16 v7; // ax@23 | |
2556 __int16 v8; // ax@24 | |
2557 char v9; // al@44 | |
2558 int v10; // eax@45 | |
2559 unsigned __int16 v11; // cx@45 | |
2560 signed int v12; // ecx@48 | |
2561 int v13; // eax@53 | |
2562 unsigned __int8 v14; // zf@53 | |
2563 unsigned int v15; // edx@53 | |
2564 signed int v16; // eax@53 | |
2565 Player *v17; // esi@70 | |
2566 int v18; // eax@72 | |
2567 int v19; // eax@74 | |
2568 char *v20; // eax@74 | |
2569 signed int i; // esi@76 | |
2570 int v22; // eax@88 | |
2571 __int16 v23; // ax@88 | |
2572 int v24; // ecx@93 | |
2573 int v25; // ecx@94 | |
2574 signed __int64 v26; // qax@100 | |
2575 char *v27; // ecx@100 | |
2576 unsigned __int64 v28; // qax@102 | |
2577 int v29; // ecx@105 | |
2578 int v30; // ecx@106 | |
2579 int v31; // eax@112 | |
2580 int v32; // eax@112 | |
2581 char *v33; // edx@113 | |
2582 int v34; // eax@121 | |
2583 int v35; // eax@123 | |
2584 int v36; // edx@125 | |
2585 int v37; // eax@129 | |
2586 signed int v38; // edi@129 | |
2587 signed int v39; // eax@129 | |
2588 int v40; // ecx@129 | |
2589 int v41; // eax@129 | |
2590 signed int v42; // eax@129 | |
2591 int *v43; // ecx@129 | |
2592 int v44; // eax@132 | |
2593 int v45; // ecx@132 | |
2594 int v46; // eax@132 | |
2595 unsigned int v47; // edx@133 | |
2596 int v48; // eax@137 | |
2597 int v49; // eax@137 | |
2598 int v50; // eax@141 | |
2599 int v51; // eax@146 | |
2600 __int16 v52; // ax@153 | |
2601 int v53; // eax@153 | |
2602 signed __int64 v54; // qax@164 | |
2603 int v55; // edi@164 | |
2604 stru6 *v56; // eax@165 | |
2605 int v57; // eax@169 | |
2606 signed __int64 v58; // qax@177 | |
2607 int v59; // edi@177 | |
2608 unsigned __int16 v60; // ax@184 | |
2609 int v61; // ecx@184 | |
2610 int v62; // eax@186 | |
2611 int v63; // ecx@187 | |
2612 int v64; // ecx@188 | |
2613 int v65; // ecx@189 | |
2614 const char *v66; // ecx@200 | |
2615 unsigned int v67; // edx@201 | |
2616 char v68; // al@207 | |
89 | 2617 ItemGen *v69; // esi@211 |
0 | 2618 int v70; // ecx@214 |
2619 int v71; // ecx@215 | |
2620 int v72; // ecx@216 | |
2621 __int16 v73; // ST1C_2@222 | |
2622 __int16 v74; // ST18_2@222 | |
2623 stru6 *v75; // eax@222 | |
2624 int v76; // ecx@223 | |
2625 int v77; // ecx@224 | |
2626 int v78; // ecx@225 | |
2627 int v79; // eax@227 | |
2628 int v80; // eax@232 | |
2629 __int16 v81; // ST18_2@245 | |
2630 stru6 *v82; // eax@245 | |
2631 signed int v83; // edi@245 | |
2632 __int16 v84; // ST18_2@245 | |
2633 stru6 *v85; // eax@245 | |
2634 __int16 v86; // ST18_2@245 | |
2635 stru6 *v87; // eax@245 | |
2636 __int16 v88; // ST18_2@245 | |
2637 stru6 *v89; // eax@245 | |
2638 double v90; // st7@245 | |
2639 int v91; // eax@250 | |
89 | 2640 Player *v92; // eax@255 |
0 | 2641 __int16 v93; // ST18_2@260 |
2642 stru6 *v94; // eax@260 | |
2643 __int16 v95; // ST18_2@260 | |
2644 stru6 *v96; // eax@260 | |
2645 __int16 v97; // ST18_2@260 | |
2646 stru6 *v98; // eax@260 | |
2647 __int16 v99; // ST18_2@260 | |
2648 stru6 *v100; // eax@260 | |
2649 int v101; // ecx@261 | |
2650 int v102; // ecx@262 | |
2651 int v103; // ecx@263 | |
2652 int v104; // eax@265 | |
2653 int v105; // edi@271 | |
2654 __int16 v106; // ST18_2@272 | |
2655 stru6 *v107; // eax@272 | |
2656 __int16 v108; // ST1C_2@274 | |
2657 __int16 v109; // ST18_2@274 | |
2658 stru6 *v110; // eax@274 | |
2659 int v111; // eax@274 | |
2660 Actor *v112; // esi@278 | |
2661 int v113; // eax@278 | |
2662 int v114; // ebx@278 | |
2663 unsigned int v115; // ecx@278 | |
2664 int v116; // edx@279 | |
2665 int v117; // edx@281 | |
2666 int v118; // edx@283 | |
2667 int v119; // edi@286 | |
2668 int v120; // eax@286 | |
2669 int v121; // eax@286 | |
2670 signed int v122; // eax@286 | |
2671 int v123; // ecx@288 | |
2672 int v124; // ecx@289 | |
2673 int v125; // ecx@290 | |
2674 int v126; // eax@292 | |
2675 int v127; // eax@296 | |
2676 __int16 v128; // ST18_2@303 | |
2677 stru6 *v129; // eax@303 | |
2678 __int16 v130; // ST18_2@303 | |
2679 stru6 *v131; // eax@303 | |
2680 __int16 v132; // ST18_2@303 | |
2681 stru6 *v133; // eax@303 | |
2682 __int16 v134; // ST18_2@303 | |
2683 stru6 *v135; // eax@303 | |
2684 unsigned __int64 v136; // qax@304 | |
2685 char *v137; // ecx@304 | |
2686 int v138; // ecx@305 | |
2687 int v139; // ecx@306 | |
2688 int v140; // eax@308 | |
2689 __int16 v141; // ST18_2@311 | |
2690 stru6 *v142; // eax@311 | |
2691 __int16 v143; // ST18_2@311 | |
2692 stru6 *v144; // eax@311 | |
2693 __int16 v145; // ST18_2@311 | |
2694 stru6 *v146; // eax@311 | |
2695 __int16 v147; // ST18_2@311 | |
2696 stru6 *v148; // eax@311 | |
2697 int v149; // ecx@312 | |
2698 int v150; // ecx@313 | |
2699 int v151; // ecx@314 | |
2700 signed int v152; // eax@322 | |
2701 int v153; // ecx@322 | |
2702 int v154; // eax@322 | |
2703 int v155; // eax@323 | |
2704 int v156; // eax@323 | |
2705 int v157; // eax@326 | |
2706 double v158; // st7@326 | |
2707 double v159; // st6@326 | |
2708 signed __int64 v160; // qtt@334 | |
2709 int v161; // eax@339 | |
2710 int v162; // edi@340 | |
2711 int v163; // eax@340 | |
2712 signed int v164; // eax@340 | |
2713 signed int v165; // edi@340 | |
2714 stru6 *v166; // eax@340 | |
2715 stru6 *v167; // eax@340 | |
2716 signed int v168; // edi@343 | |
2717 int v169; // eax@344 | |
2718 int v170; // ecx@346 | |
2719 int v171; // ecx@347 | |
2720 int v172; // ecx@348 | |
2721 int v173; // edi@350 | |
2722 signed int v174; // edi@355 | |
2723 __int16 v175; // ST18_2@357 | |
2724 stru6 *v176; // eax@357 | |
2725 __int16 v177; // ST18_2@357 | |
2726 stru6 *v178; // eax@357 | |
2727 __int16 v179; // ST18_2@357 | |
2728 stru6 *v180; // eax@357 | |
2729 __int16 v181; // ST18_2@357 | |
2730 stru6 *v182; // eax@357 | |
2731 signed __int64 v183; // qax@357 | |
2732 int v184; // ecx@358 | |
2733 int v185; // ecx@359 | |
2734 int v186; // ecx@360 | |
2735 int v187; // eax@367 | |
2736 int v188; // esi@369 | |
2737 int v189; // edi@369 | |
2738 const char *v190; // ecx@377 | |
2739 signed int v191; // edi@379 | |
2740 int v192; // ecx@382 | |
2741 int v193; // ecx@383 | |
2742 int v194; // ecx@384 | |
2743 int v195; // eax@386 | |
2744 int v196; // eax@387 | |
2745 __int16 v197; // ST18_2@395 | |
2746 stru6 *v198; // eax@395 | |
2747 __int16 v199; // ST18_2@395 | |
2748 stru6 *v200; // eax@395 | |
2749 __int16 v201; // ST18_2@395 | |
2750 stru6 *v202; // eax@395 | |
2751 __int16 v203; // ST18_2@395 | |
2752 stru6 *v204; // eax@395 | |
2753 signed int v205; // edi@405 | |
2754 int v206; // eax@407 | |
2755 __int16 v207; // cx@407 | |
2756 int v208; // eax@411 | |
2757 signed int v209; // ecx@412 | |
2758 int v210; // edx@412 | |
2759 signed int v211; // ecx@412 | |
2760 int v212; // eax@413 | |
2761 int v213; // eax@413 | |
2762 int v214; // eax@413 | |
2763 int v215; // eax@415 | |
2764 double v216; // st7@415 | |
2765 double v217; // st6@415 | |
2766 signed __int64 v218; // qtt@423 | |
2767 int v219; // ecx@425 | |
2768 int v220; // ecx@426 | |
2769 int v221; // edi@428 | |
2770 char *v222; // edi@434 | |
2771 char v223; // al@438 | |
2772 int v224; // ecx@442 | |
2773 int v225; // ecx@443 | |
2774 int v226; // eax@451 | |
2775 int v227; // esi@453 | |
2776 unsigned int v228; // edi@454 | |
2777 int v229; // edi@466 | |
2778 __int16 v230; // ST18_2@469 | |
2779 stru6 *v231; // eax@469 | |
2780 signed int v232; // esi@469 | |
2781 __int16 v233; // ST18_2@469 | |
2782 stru6 *v234; // eax@469 | |
2783 __int16 v235; // ST18_2@469 | |
2784 stru6 *v236; // eax@469 | |
2785 __int16 v237; // ST18_2@469 | |
2786 stru6 *v238; // eax@469 | |
2787 __int16 v239; // ST1C_2@469 | |
2788 char *v240; // ecx@472 | |
2789 double v241; // st7@478 | |
2790 signed __int64 v242; // qax@484 | |
2791 char *v243; // ecx@484 | |
2792 char *v244; // eax@488 | |
2793 int v245; // edi@492 | |
2794 int v246; // eax@492 | |
2795 char *v247; // eax@497 | |
2796 char v248; // al@497 | |
2797 char v249; // cf@500 | |
2798 float v250; // esi@507 | |
2799 char v251; // al@507 | |
2800 int v252; // edx@510 | |
2801 int m; // esi@510 | |
2802 int v254; // eax@513 | |
2803 int v255; // esi@513 | |
2804 int v256; // ecx@513 | |
2805 int v257; // edx@514 | |
2806 int v258; // ecx@514 | |
2807 char v259; // al@516 | |
2808 int v260; // eax@518 | |
2809 int v261; // esi@519 | |
2810 int v262; // edx@521 | |
2811 int v263; // ecx@521 | |
2812 int v264; // esi@521 | |
2813 int v265; // edx@521 | |
2814 int *ii; // eax@522 | |
2815 int v267; // eax@524 | |
2816 int v268; // eax@524 | |
2817 int v269; // eax@526 | |
2818 char *v270; // eax@531 | |
2819 char v271; // al@531 | |
2820 char v272; // cf@534 | |
2821 float v273; // esi@541 | |
2822 char v274; // al@541 | |
2823 int v275; // edx@544 | |
2824 int k; // esi@544 | |
2825 int v277; // edx@548 | |
2826 int v278; // ecx@548 | |
2827 char v279; // al@550 | |
2828 int v280; // eax@552 | |
2829 int v281; // esi@553 | |
2830 int v282; // edx@555 | |
2831 int v283; // ecx@555 | |
2832 int v284; // esi@555 | |
2833 int v285; // edx@555 | |
2834 int *l; // eax@556 | |
2835 int v287; // eax@558 | |
2836 int v288; // eax@558 | |
2837 ItemGen *v289; // eax@560 | |
2838 signed int v290; // eax@560 | |
2839 unsigned __int8 v291; // al@564 | |
2840 char v292; // al@573 | |
2841 int v293; // eax@575 | |
2842 ItemGen *v294; // esi@575 | |
2843 int v295; // edx@575 | |
2844 int kk; // edi@575 | |
2845 int v297; // edx@579 | |
2846 int v298; // ecx@579 | |
2847 char v299; // al@581 | |
2848 int v300; // eax@583 | |
2849 int v301; // edi@584 | |
2850 int v302; // edx@586 | |
2851 int v303; // ecx@586 | |
2852 int v304; // edi@586 | |
2853 int v305; // edx@586 | |
2854 int *jj; // eax@587 | |
2855 int v307; // eax@589 | |
2856 int v308; // eax@589 | |
2857 char *v309; // ecx@593 | |
2858 char v310; // sf@593 | |
2859 unsigned __int8 v311; // of@593 | |
2860 char v312; // cl@597 | |
2861 char v313; // al@606 | |
2862 int v314; // edx@607 | |
2863 int j; // esi@607 | |
2864 unsigned int v316; // eax@613 | |
2865 const char *v317; // ecx@617 | |
2866 Player *v318; // ecx@619 | |
2867 unsigned int v319; // edi@627 | |
2868 int v320; // ecx@629 | |
2869 int v321; // ecx@630 | |
2870 int v322; // edi@632 | |
2871 int v323; // edi@635 | |
2872 char *v324; // eax@635 | |
2873 Player *v325; // ecx@640 | |
2874 int v326; // eax@643 | |
2875 int v327; // eax@648 | |
2876 int v328; // ecx@651 | |
2877 int v329; // ecx@652 | |
2878 int v330; // edi@654 | |
2879 __int16 v331; // ST18_2@658 | |
2880 stru6 *v332; // eax@658 | |
2881 __int16 v333; // ST18_2@658 | |
2882 stru6 *v334; // eax@658 | |
2883 __int16 v335; // ST18_2@658 | |
2884 stru6 *v336; // eax@658 | |
2885 __int16 v337; // ST18_2@658 | |
2886 stru6 *v338; // eax@658 | |
2887 int v339; // ecx@659 | |
2888 int v340; // ecx@660 | |
2889 int v341; // eax@663 | |
2890 signed int v342; // edi@668 | |
2891 signed int v343; // edi@670 | |
2892 unsigned __int64 v344; // ST08_8@670 | |
2893 __int16 v345; // ST1C_2@671 | |
2894 __int16 v346; // ST18_2@671 | |
2895 stru6 *v347; // eax@671 | |
2896 int v348; // ecx@672 | |
2897 int v349; // ecx@673 | |
2898 int v350; // edi@676 | |
2899 Player *v351; // edi@680 | |
2900 __int16 v352; // ST18_2@685 | |
2901 stru6 *v353; // eax@685 | |
2902 int v354; // ecx@686 | |
2903 int v355; // ecx@687 | |
2904 int v356; // eax@689 | |
2905 SpellBuff *v357; // edi@694 | |
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 | |
2923 char *v375; // edi@717 | |
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 | |
3167 SpellBuff *v619; // edi@1123 | |
3168 unsigned __int16 v620; // ST1C_2@1124 | |
3169 __int16 v621; // ST18_2@1124 | |
3170 stru6 *v622; // eax@1124 | |
3171 signed __int64 v623; // qax@1127 | |
3172 int v624; // eax@1127 | |
3173 int v625; // edi@1129 | |
3174 int v626; // eax@1129 | |
3175 signed int v627; // eax@1129 | |
3176 signed int v628; // edi@1129 | |
3177 int v629; // ecx@1130 | |
3178 Player *v630; // eax@1131 | |
3179 int v631; // eax@1137 | |
3180 int v632; // edi@1140 | |
3181 Player *v633; // eax@1140 | |
3182 signed int v634; // eax@1140 | |
3183 int v635; // edi@1142 | |
3184 unsigned __int16 v636; // ST1C_2@1142 | |
3185 __int16 v637; // ST18_2@1142 | |
3186 stru6 *v638; // eax@1142 | |
3187 stru6 *v639; // eax@1143 | |
3188 int v640; // ecx@1146 | |
3189 int v641; // ecx@1147 | |
3190 int v642; // edi@1156 | |
3191 int v643; // eax@1156 | |
3192 int v644; // eax@1156 | |
3193 signed int v645; // eax@1158 | |
3194 Player *v646; // ebx@1169 | |
3195 int v647; // edi@1169 | |
3196 signed int v648; // ST1C_4@1170 | |
3197 Player *v649; // ecx@1170 | |
3198 unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3199 unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3200 unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3201 unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
3202 int v654; // [sp-4h] [bp-E88h]@124 | |
3203 unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 | |
3204 unsigned int v656; // [sp-4h] [bp-E88h]@639 | |
3205 int v657; // [sp-4h] [bp-E88h]@807 | |
3206 int v658; // [sp+0h] [bp-E84h]@100 | |
3207 int v659; // [sp+0h] [bp-E84h]@123 | |
3208 int v660; // [sp+0h] [bp-E84h]@146 | |
3209 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
3210 int v662; // [sp+0h] [bp-E84h]@304 | |
3211 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 | |
3212 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3213 int v665; // [sp+0h] [bp-E84h]@807 | |
3214 int v666; // [sp+4h] [bp-E80h]@12 | |
3215 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
3216 unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 | |
3217 int v669; // [sp+4h] [bp-E80h]@123 | |
3218 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3219 int v671; // [sp+4h] [bp-E80h]@146 | |
3220 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
3221 unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 | |
3222 __int16 v674; // [sp+4h] [bp-E80h]@684 | |
3223 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3224 int v676; // [sp+4h] [bp-E80h]@807 | |
3225 int v677; // [sp+4h] [bp-E80h]@861 | |
3226 int v678; // [sp+4h] [bp-E80h]@997 | |
3227 int v679; // [sp+14h] [bp-E70h]@515 | |
3228 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3229 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3230 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3231 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3232 int v684; // [sp+D04h] [bp-180h]@416 | |
3233 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3234 int x; // [sp+D20h] [bp-164h]@327 | |
3235 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3236 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3237 int v689; // [sp+D30h] [bp-154h]@943 | |
3238 int v690; // [sp+D34h] [bp-150h]@943 | |
3239 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3240 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3241 int v693; // [sp+D40h] [bp-144h]@137 | |
3242 int v694; // [sp+D44h] [bp-140h]@982 | |
3243 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3244 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3245 int v697; // [sp+D50h] [bp-134h]@129 | |
3246 int v698; // [sp+D54h] [bp-130h]@129 | |
3247 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3248 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3249 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3250 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3251 int v703; // [sp+D70h] [bp-114h]@286 | |
3252 int v704; // [sp+D74h] [bp-110h]@132 | |
3253 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3254 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3255 int v707; // [sp+D80h] [bp-104h]@1127 | |
3256 int v708; // [sp+D84h] [bp-100h]@1127 | |
3257 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3258 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3259 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3260 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3261 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3262 int n; // [sp+DA0h] [bp-E4h]@1 | |
3263 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3264 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3265 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3266 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3267 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3268 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3269 int v721; // [sp+DD8h] [bp-ACh]@163 | |
3270 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3271 int v723; // [sp+E4Ch] [bp-38h]@1 | |
3272 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3273 float v725; // [sp+E54h] [bp-30h]@23 | |
3274 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3275 int v726b; |
0 | 3276 float v727; // [sp+E5Ch] [bp-28h]@1 |
3277 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3278 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3279 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3280 Player *v730b; |
3281 ItemGen *v730c; | |
0 | 3282 int v731; // [sp+E6Ch] [bp-18h]@48 |
3283 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3284 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3285 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3286 int amount; // [sp+E80h] [bp-4h]@1 | |
3287 | |
3288 auto ecx0 = this; | |
3289 | |
3290 v711 = ecx0; | |
3291 | |
3292 LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3293 //LayingItem::LayingItem(&a1); | |
3294 | |
3295 v1 = 0; | |
3296 v2 = 0; | |
3297 amount = 0; | |
3298 LODWORD(v733) = 0; | |
3299 v723 = 0; | |
3300 v727 = 0.0; | |
3301 n = 0; | |
3302 while ( 1 ) | |
3303 { | |
3304 v3 = &v711[n]; | |
3305 HIDWORD(v733) = (int)v3; | |
3306 if ( v3->spellnum == (short)v1 ) | |
3307 goto LABEL_1166; | |
3308 if ( pParty->pPartyBuffs[11].NotExpired() ) | |
3309 pParty->pPartyBuffs[11].Reset(); | |
3310 if ( v3->field_8 & 0x3CA ) | |
3311 { | |
3312 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3313 v711->_427D48(1u); | |
3314 goto LABEL_1166; | |
3315 } | |
3316 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
3317 v4 = *(int *)&v3->field_C; | |
3318 if ( v4 != v1 ) | |
3319 goto LABEL_18; | |
3320 v5 = v3->spellnum; | |
3321 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) | |
3322 v666 = 1; | |
3323 else | |
3324 v666 = v1; | |
3325 a2 = stru_50C198.FindClosesActor(5120, 1, v666); | |
3326 v6 = pMouse->uPointingObjectID; | |
3327 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == 3 && pActors[v6 >> 3].CanAct() ) | |
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 { | |
3336 if ( (a2 & 7) == 3 ) | |
3337 { | |
3338 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | 4, a2, &a3, 0), sizeof(v715)); | |
3339 v2 = v723; | |
3340 v1 = 0; | |
3341 } | |
3342 else | |
3343 { | |
3344 v715.uYawAngle = pParty->sRotationY; | |
3345 v715.uPitchAngle = pParty->sRotationX; | |
3346 } | |
3347 } | |
3348 v7 = v3->field_A; | |
3349 LODWORD(v725) = v1; | |
3350 _this = (ItemGen *)v1; | |
3351 if ( v7 == (short)v1 ) | |
3352 { | |
3353 v8 = v3->spellnum; | |
3354 if ( v3->spellnum >= 12 ) | |
3355 { | |
3356 if ( v8 >= 23 ) | |
3357 { | |
3358 if ( v8 >= 34 ) | |
3359 { | |
3360 if ( v8 >= 45 ) | |
3361 { | |
3362 if ( v8 >= 56 ) | |
3363 { | |
3364 if ( v8 >= 67 ) | |
3365 { | |
3366 if ( v8 >= 78 ) | |
3367 { | |
3368 if ( v8 >= 89 ) | |
3369 { | |
3370 if ( v8 >= 100 ) | |
3371 { | |
3372 if ( v8 != 100 ) | |
3373 { | |
3374 LABEL_45: | |
3375 HIWORD(v10) = HIWORD(pPlayer); | |
3376 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
3377 goto LABEL_47; | |
3378 } | |
3379 v667 = (PLAYER_SKILL_TYPE)5; | |
3380 } | |
3381 else | |
3382 { | |
3383 v667 = (PLAYER_SKILL_TYPE)20; | |
3384 } | |
3385 } | |
3386 else | |
3387 { | |
3388 v667 = (PLAYER_SKILL_TYPE)19; | |
3389 } | |
3390 } | |
3391 else | |
3392 { | |
3393 v667 = (PLAYER_SKILL_TYPE)18; | |
3394 } | |
3395 } | |
3396 else | |
3397 { | |
3398 v667 = (PLAYER_SKILL_TYPE)17; | |
3399 } | |
3400 } | |
3401 else | |
3402 { | |
3403 v667 = (PLAYER_SKILL_TYPE)16; | |
3404 } | |
3405 } | |
3406 else | |
3407 { | |
3408 v667 = (PLAYER_SKILL_TYPE)15; | |
3409 } | |
3410 } | |
3411 else | |
3412 { | |
3413 v667 = (PLAYER_SKILL_TYPE)14; | |
3414 } | |
3415 } | |
3416 else | |
3417 { | |
3418 v667 = (PLAYER_SKILL_TYPE)13; | |
3419 } | |
3420 } | |
3421 else | |
3422 { | |
3423 v667 = (PLAYER_SKILL_TYPE)12; | |
3424 } | |
3425 LODWORD(v725) = v667; | |
3426 v9 = pPlayer->GetActualSkillLevel(v667); | |
3427 v723 = v9 & 0x3F; | |
3428 v2 = v9 & 0x3F; | |
3429 goto LABEL_45; | |
3430 } | |
3431 v11 = v7; | |
3432 v10 = v7 & 0x3F; | |
3433 v723 = v10; | |
3434 v2 = v10; | |
3435 LABEL_47: | |
3436 if ( HIBYTE(v11) & 1 ) | |
3437 { | |
3438 v12 = 4; | |
3439 v731 = 4; | |
3440 } | |
3441 else | |
3442 { | |
3443 if ( (v11 & 0x80u) == 0 ) | |
3444 { | |
3445 v10 = ((v11 & 0x40) != 0) + 1; | |
3446 v731 = ((v11 & 0x40) != 0) + 1; | |
3447 } | |
3448 else | |
3449 { | |
3450 v731 = 3; | |
3451 } | |
3452 v12 = v731; | |
3453 } | |
3454 LOWORD(v10) = v3->spellnum; | |
3455 v730 = v10; | |
3456 v13 = v12 + 10 * (signed __int16)v10; | |
3457 v14 = v3->field_A == (short)v1; | |
3458 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing | |
3459 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); | |
3460 uRequiredMana = v15; | |
3461 sRecoveryTime = v16; | |
3462 if ( !v14 ) | |
3463 uRequiredMana = v1; | |
3464 if ( pParty->uCurrentHour == v1 ) | |
3465 { | |
3466 if ( pParty->uCurrentMinute != v1 ) | |
3467 goto LABEL_62; | |
3468 if ( LODWORD(v725) == 20 ) | |
3469 goto LABEL_61; | |
3470 } | |
3471 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == v1 && LODWORD(v725) == 19 ) | |
3472 LABEL_61: | |
3473 uRequiredMana = v1; | |
3474 LABEL_62: | |
3475 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) | |
3476 break; | |
3477 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); | |
3478 LABEL_203: | |
3479 v3->spellnum = v1; | |
3480 LABEL_1166: | |
3481 ++n; | |
3482 if ( n >= 10 ) | |
3483 return; | |
3484 } | |
3485 if ( !pPlayer->pConditions[0] || (signed __int16)v730 >= 100 ) | |
3486 goto LABEL_69; | |
3487 if ( rand() % 100 >= 50 ) | |
3488 { | |
3489 v12 = v731; | |
3490 LABEL_69: | |
3491 switch ( v3->spellnum ) | |
3492 { | |
3493 case 100: | |
3494 case 101: | |
3495 v17 = pPlayer; | |
3496 _this = (ItemGen *)1; | |
3497 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[5]) >= 3 ) | |
3498 _this = (ItemGen *)2; | |
3499 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3500 a1.stru_24.Reset(); | |
3501 v18 = v3->spellnum; | |
3502 a1.field_4C = v2; | |
3503 a1.field_48 = v18; | |
3504 a1.field_50 = v731; | |
3505 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3506 if ( v17->WearsItem(510, 2) ) | |
3507 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3508 a1.vPosition.x = pParty->vPosition.x; | |
3509 a1.vPosition.y = pParty->vPosition.y; | |
3510 a1.uAttributes = 0; | |
3511 a1.uSpriteFrameID = 0; | |
3512 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3513 v19 = 8 * v3->uPlayerID; | |
3514 LOBYTE(v19) = v19 | 4; | |
3515 a1.field_58 = v19; | |
3516 a1.field_5C = a2; | |
3517 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3518 a1.uFacing = LOWORD(v715.uYawAngle); | |
3519 a1.uSoundID = LOWORD(v3->field_10); | |
3520 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3521 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3522 a1.uAttributes = 256; | |
3523 if ( pParty->bTurnBasedModeOn == 1 ) | |
3524 a1.uAttributes = 260; | |
3525 for ( i = 0; i < (signed int)this; ++i ) | |
3526 { | |
3527 if ( i ) | |
3528 a1.vPosition.z += 32; | |
3529 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3530 if ( a1.Create( | |
3531 v715.uYawAngle, | |
3532 v715.uPitchAngle, | |
3533 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3534 v3->uPlayerID + 1) != -1 | |
3535 && pParty->bTurnBasedModeOn == 1 ) | |
3536 ++pTurnEngine->field_1C; | |
3537 } | |
3538 goto LABEL_83; | |
3539 case 102: | |
3540 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); | |
3541 a1.stru_24.Reset(); | |
3542 a1.field_48 = v3->spellnum; | |
3543 a1.field_4C = v723; | |
3544 a1.field_50 = v731; | |
3545 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3546 a1.vPosition.x = pParty->vPosition.x; | |
3547 a1.vPosition.y = pParty->vPosition.y; | |
3548 a1.uAttributes = 0; | |
3549 a1.uSpriteFrameID = 0; | |
3550 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3551 v22 = 8 * v3->uPlayerID; | |
3552 LOBYTE(v22) = v22 | 4; | |
3553 a1.field_58 = v22; | |
3554 a1.field_5C = a2; | |
3555 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3556 a1.uFacing = LOWORD(v715.uYawAngle); | |
3557 a1.uSoundID = LOWORD(v3->field_10); | |
3558 memcpy( | |
3559 &a1.stru_24, | |
3560 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3561 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3562 + 5], | |
3563 sizeof(a1.stru_24)); | |
3564 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3565 HIBYTE(a1.uAttributes) |= 1u; | |
3566 a1.uSectorID = v23; | |
3567 if ( pParty->bTurnBasedModeOn == 1 ) | |
3568 LOBYTE(a1.uAttributes) |= 4u; | |
3569 if ( a1.Create( | |
3570 v715.uYawAngle, | |
3571 v715.uPitchAngle, | |
3572 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3573 v3->uPlayerID + 1) != -1 | |
3574 && pParty->bTurnBasedModeOn == 1 ) | |
3575 ++pTurnEngine->field_1C; | |
3576 goto LABEL_83; | |
3577 case 1: | |
3578 LODWORD(v733) = 3600 * v2; | |
3579 v24 = v12 - 2; | |
3580 if ( v24 ) | |
3581 { | |
3582 v25 = v24 - 1; | |
3583 if ( v25 && v25 != 1 ) | |
3584 amount = 2; | |
3585 else | |
3586 amount = 4; | |
3587 } | |
3588 else | |
3589 { | |
3590 amount = 3; | |
3591 } | |
3592 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3593 goto LABEL_83; | |
3594 v668 = v1; | |
3595 v658 = v1; | |
3596 v653 = amount; | |
3597 v651 = v731; | |
3598 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); | |
3599 v27 = (char *)&pParty->pPartyBuffs[16]; | |
3600 goto LABEL_101; | |
3601 case 7: | |
3602 v29 = v12 - 2; | |
3603 if ( v29 ) | |
3604 { | |
3605 v30 = v29 - 1; | |
3606 if ( v30 ) | |
3607 { | |
3608 if ( v30 == 1 ) | |
3609 amount = 9; | |
3610 else | |
3611 amount = 3; | |
3612 } | |
3613 else | |
3614 { | |
3615 amount = 7; | |
3616 } | |
3617 } | |
3618 else | |
3619 { | |
3620 amount = 5; | |
3621 } | |
3622 v31 = v3->uPlayerID; | |
3623 HIDWORD(v733) = v1; | |
3624 v32 = 8 * v31; | |
3625 LOBYTE(v32) = v32 | 4; | |
3626 if ( (signed int)uNumLayingItems > v1 ) | |
3627 { | |
3628 v33 = (char *)&pLayingItems[0].field_48; | |
3629 v730 = uNumLayingItems; | |
3630 do | |
3631 { | |
3632 if ( *((short *)v33 - 36) != (short)v1 && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) | |
3633 ++HIDWORD(v733); | |
3634 v33 += 112; | |
3635 --v730; | |
3636 } | |
3637 while ( v730 ); | |
3638 } | |
3639 if ( SHIDWORD(v733) > amount ) | |
3640 goto LABEL_200; | |
3641 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3642 goto LABEL_83; | |
3643 a1.stru_24.Reset(); | |
3644 a1.field_48 = v3->spellnum; | |
3645 a1.field_4C = v2; | |
3646 a1.field_50 = v731; | |
3647 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3648 a1.vPosition.y = pParty->vPosition.y; | |
3649 a1.vPosition.x = pParty->vPosition.x; | |
3650 a1.uAttributes = v1; | |
3651 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3652 a1.uSectorID = pIndoor->GetSector( | |
3653 pParty->vPosition.x, | |
3654 pParty->vPosition.y, | |
3655 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3656 a1.uSpriteFrameID = v1; | |
3657 v34 = 8 * v3->uPlayerID; | |
3658 LOBYTE(v34) = v34 | 4; | |
3659 a1.field_58 = v34; | |
3660 a1.field_5C = a2; | |
3661 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3662 a1.uFacing = LOWORD(v715.uYawAngle); | |
3663 a1.uSoundID = LOWORD(v3->field_10); | |
3664 if ( pParty->bTurnBasedModeOn == 1 ) | |
3665 LOBYTE(a1.uAttributes) |= 4u; | |
3666 v669 = v3->uPlayerID + 1; | |
3667 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3668 v35 = pParty->sRotationX + 10; | |
3669 goto LABEL_124; | |
3670 case 20: | |
3671 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3672 goto LABEL_83; | |
3673 if ( a2 == v1 ) | |
3674 goto LABEL_200; | |
3675 if ( (a2 & 7) != 3 ) | |
3676 goto LABEL_1056; | |
3677 v699 = v1; | |
3678 v698 = v1; | |
3679 v697 = v1; | |
3680 a1.stru_24.Reset(); | |
3681 a1.field_48 = v3->spellnum; | |
3682 a1.field_4C = v2; | |
3683 a1.field_50 = v731; | |
3684 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3685 a1.uAttributes = v1; | |
3686 a1.uSectorID = v1; | |
3687 a1.uSpriteFrameID = v1; | |
3688 v37 = v3->uPlayerID; | |
3689 a1.field_60_distance_related_prolly_lod = 0; | |
3690 v37 *= 8; | |
3691 LOBYTE(v37) = v37 | 4; | |
3692 a1.uFacing = v1; | |
3693 a1.field_58 = v37; | |
3694 v38 = a2 >> 3; | |
3695 a1.uSoundID = LOWORD(v3->field_10); | |
3696 v39 = a2 >> 3; | |
3697 a1.vPosition.x = pActors[v39].vPosition.x; | |
3698 v40 = pActors[v39].vPosition.y; | |
3699 a1.vPosition.z = pActors[v39].vPosition.z; | |
3700 v41 = 8 * (a2 >> 3); | |
3701 a1.vPosition.y = v40; | |
3702 LOBYTE(v41) = v41 | 3; | |
3703 a1.field_5C = v41; | |
3704 v42 = a1.Create(0, v1, v1, v1); | |
3705 v43 = &v697; | |
3706 goto LABEL_133; | |
3707 case 44: | |
3708 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3709 goto LABEL_83; | |
3710 v726 = (Player *)(a2 >> 3); | |
3711 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3712 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3713 goto LABEL_1056; |
90 | 3714 pActors[a2 >> 3].pActorBuffs[10].Apply( |
0 | 3715 pMiscTimer->uTotalGameTimeElapsed + 128, |
3716 v1, | |
3717 v1, | |
3718 v1, | |
3719 v1); | |
3720 v706 = v1; | |
3721 v705 = v1; | |
3722 v704 = v1; | |
3723 a1.stru_24.Reset(); | |
3724 a1.field_48 = v3->spellnum; | |
3725 a1.field_4C = v2; | |
3726 a1.field_50 = v731; | |
3727 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3728 a1.uAttributes = v1; | |
3729 a1.uSectorID = v1; | |
3730 a1.uSpriteFrameID = v1; | |
3731 v44 = v3->uPlayerID; | |
3732 a1.field_60_distance_related_prolly_lod = 0; | |
3733 a1.uFacing = v1; | |
3734 v44 *= 8; | |
3735 LOBYTE(v44) = v44 | 4; | |
3736 v38 = (signed int)v726; | |
3737 a1.field_58 = v44; | |
3738 a1.uSoundID = LOWORD(v3->field_10); | |
3739 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3740 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3741 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3742 v46 = 8 * (int)v726; | |
3743 a1.vPosition.y = v45; | |
3744 LOBYTE(v46) = 8 * (char)v726 | 3; | |
3745 a1.field_5C = v46; | |
3746 v42 = a1.Create(0, v1, v1, v1); | |
3747 v43 = &v704; | |
3748 LABEL_133: | |
3749 v670 = (Vec3_int_ *)v43; | |
3750 v47 = v38; | |
3751 goto LABEL_139; | |
3752 case 79: | |
3753 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != 3 ) | |
3754 goto LABEL_83; | |
3755 v730 = a2 >> 3; | |
3756 v693 = v1; | |
3757 HIDWORD(v733) = (int)&pActors[a2 >> 3]; | |
3758 v692 = v1; | |
3759 v691 = v1; | |
3760 a1.stru_24.Reset(); | |
3761 a1.field_48 = v3->spellnum; | |
3762 a1.field_4C = v2; | |
3763 a1.field_50 = v731; | |
3764 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3765 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | |
3766 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3767 v48 = *(short *)(HIDWORD(v733) + 138); | |
3768 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
3769 a1.uAttributes = v1; | |
3770 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); | |
3771 a1.uSpriteFrameID = v1; | |
3772 v49 = 8 * v3->uPlayerID; | |
3773 LOBYTE(v49) = v49 | 4; | |
3774 a1.field_58 = v49; | |
3775 a1.field_5C = a2; | |
3776 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3777 a1.uFacing = LOWORD(v715.uYawAngle); | |
3778 LOWORD(v49) = LOWORD(v3->field_10); | |
3779 LOBYTE(a1.uAttributes) |= 0x80u; | |
3780 a1.uSoundID = v49; | |
3781 v726 = (Player *)a1.Create(0, v1, v1, v1); | |
3782 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) | |
3783 goto LABEL_200; | |
3784 v47 = v730; | |
3785 v670 = (Vec3_int_ *)&v691; | |
3786 v42 = (signed int)v726; | |
3787 LABEL_139: | |
3788 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3789 goto LABEL_1056; | |
3790 case 2: | |
3791 case 6: | |
3792 case 11: | |
3793 case 18: | |
3794 case 26: | |
3795 case 32: | |
3796 case 34: | |
3797 case 37: | |
3798 case 57: | |
3799 case 65: | |
3800 case 70: | |
3801 case 78: | |
3802 case 97: | |
3803 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3804 goto LABEL_83; | |
3805 a1.stru_24.Reset(); | |
3806 a1.field_48 = v3->spellnum; | |
3807 a1.field_4C = v2; | |
3808 a1.field_50 = v731; | |
3809 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3810 a1.vPosition.y = pParty->vPosition.y; | |
3811 a1.vPosition.x = pParty->vPosition.x; | |
3812 a1.uAttributes = v1; | |
3813 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3814 a1.uSectorID = pIndoor->GetSector( | |
3815 pParty->vPosition.x, | |
3816 pParty->vPosition.y, | |
3817 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3818 a1.uSpriteFrameID = v1; | |
3819 v50 = 8 * v3->uPlayerID; | |
3820 LOBYTE(v50) = v50 | 4; | |
3821 a1.field_58 = v50; | |
3822 a1.field_5C = a2; | |
3823 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3824 a1.uFacing = LOWORD(v715.uYawAngle); | |
3825 a1.uSoundID = LOWORD(v3->field_10); | |
3826 if ( pParty->bTurnBasedModeOn == 1 ) | |
3827 LOBYTE(a1.uAttributes) |= 4u; | |
3828 if ( v3->spellnum == 18 ) | |
3829 LOBYTE(a1.uAttributes) |= 0x40u; | |
3830 goto LABEL_156; | |
3831 case 29: | |
3832 case 39: | |
3833 case 76: | |
3834 case 90: | |
3835 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3836 goto LABEL_83; | |
3837 a1.stru_24.Reset(); | |
3838 a1.field_48 = v3->spellnum; | |
3839 a1.field_4C = v2; | |
3840 a1.field_50 = v731; | |
3841 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3842 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3843 a1.vPosition.y = pParty->vPosition.y; | |
3844 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3845 v660 = pParty->vPosition.y; | |
3846 goto LABEL_153; | |
3847 case 87: | |
3848 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3849 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3850 goto LABEL_200; | |
3851 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3852 goto LABEL_152; | |
3853 goto LABEL_83; | |
3854 case 81: | |
3855 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3856 goto LABEL_83; | |
3857 if ( a2 == v1 | |
3858 || (a2 & 7) != 3 | |
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; | |
3900 if ( (a2 & 7) != 3 | |
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; | |
3908 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( | |
3909 pParty->uTimePlayed + (signed int)v58, | |
3910 v731, | |
3911 amount, | |
3912 v1, | |
3913 v1); | |
3914 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; | |
3915 v672 = v1; | |
3916 v661 = (Actor *)LODWORD(v718); | |
3917 goto LABEL_165; | |
3918 case 60: | |
3919 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3920 goto LABEL_83; | |
3921 v730 = 836 * (a2 >> 3); | |
90 | 3922 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3923 goto LABEL_1056; |
3924 LODWORD(v733) = 300 * v2; | |
3925 if ( v731 == 2 ) | |
3926 { | |
3927 LODWORD(v733) = 600 * v2; | |
3928 } | |
3929 else | |
3930 { | |
3931 if ( v731 == 3 ) | |
3932 LODWORD(v733) = 29030400; | |
3933 } | |
3934 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); | |
3935 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3936 v726 = (Player *)((int)v733 << 7); | |
3937 ((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3938 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
3939 v731, | |
3940 v1, | |
3941 v1, | |
3942 v1); | |
3943 a1.stru_24.Reset(); | |
3944 a1.field_48 = v3->spellnum; | |
3945 a1.field_4C = v2; | |
3946 a1.field_50 = v731; | |
3947 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 3948 v61 = a2 >> 3; |
0 | 3949 goto LABEL_1086; |
3950 case 92: | |
3951 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3952 goto LABEL_83; | |
3953 a1.stru_24.Reset(); | |
3954 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3955 a1.vPosition.x = pParty->vPosition.x; | |
3956 a1.vPosition.y = pParty->vPosition.y; | |
3957 a1.uAttributes = v1; | |
3958 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3959 a1.uSectorID = pIndoor->GetSector( | |
3960 pParty->vPosition.x, | |
3961 pParty->vPosition.y, | |
3962 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3963 a1.uSpriteFrameID = v1; | |
3964 v62 = 8 * v3->uPlayerID; | |
3965 LOBYTE(v62) = v62 | 4; | |
3966 a1.field_58 = v62; | |
3967 a1.field_5C = a2; | |
3968 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3969 a1.uFacing = LOWORD(v715.uYawAngle); | |
3970 a1.uSoundID = LOWORD(v3->field_10); | |
3971 a1.field_50 = v731; | |
3972 a1.field_48 = 3; | |
3973 a1.field_4C = 300 * v2; | |
3974 goto LABEL_154; | |
3975 case 4: | |
3976 v63 = v12 - 1; | |
3977 if ( !v63 ) | |
3978 { | |
3979 amount = 10; | |
3980 goto LABEL_195; | |
3981 } | |
3982 v64 = v63 - 1; | |
3983 if ( !v64 ) | |
3984 { | |
3985 amount = 11; | |
3986 goto LABEL_195; | |
3987 } | |
3988 v65 = v64 - 1; | |
3989 if ( !v65 ) | |
3990 { | |
3991 amount = 12; | |
3992 LABEL_195: | |
3993 LODWORD(v733) = 3600 * v2; | |
3994 goto LABEL_196; | |
3995 } | |
3996 if ( v65 == 1 ) | |
3997 { | |
3998 LODWORD(v733) = v1; | |
3999 amount = 12; | |
4000 } | |
4001 LABEL_196: | |
4002 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4003 goto LABEL_83; | |
89 | 4004 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
4005 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
4006 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
4007 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
4008 { | |
4009 if ( !(v730c->uAttributes & 2) ) | |
0 | 4010 { |
89 | 4011 if ( v730c->uAdditionalValue == v1 ) |
0 | 4012 { |
89 | 4013 if ( v730c->_bonus_type == v1 ) |
0 | 4014 { |
4015 v68 = BYTE4(v726->pConditions[3]); | |
4016 if ( !v68 || v68 == 1 || v68 == 2 ) | |
4017 { | |
89 | 4018 if ( !pItemsTable->_456D5E_is_some_material(v730c) ) |
0 | 4019 { |
89 | 4020 v69 = v730c; |
0 | 4021 v14 = v731 == 4; |
4022 *(int *)(v730 + 12) = amount; | |
4023 if ( !v14 ) | |
4024 { | |
4025 v726 = (Player *)((int)v733 << 7); | |
4026 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
4027 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
4028 * 0.033333335); | |
4029 *(int *)(v69 + 20) |= 8u; | |
4030 } | |
4031 *(int *)(v69 + 20) |= 0x10u; | |
4032 LABEL_1055: | |
4033 dword_50C9A8 = 256; | |
4034 LABEL_1056: | |
4035 LODWORD(v727) = 1; | |
4036 LABEL_83: | |
4037 if ( v3->field_8 & 0x20 ) | |
4038 { | |
4039 LABEL_1162: | |
4040 if ( v727 != 0.0 ) | |
4041 pAudioPlayer->PlaySound( | |
4042 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4043 0, | |
4044 0, | |
4045 -1, | |
4046 0, | |
4047 v3->field_10, | |
4048 0, | |
4049 0); | |
4050 } | |
4051 else | |
4052 { | |
4053 if ( sRecoveryTime < 0 ) | |
4054 sRecoveryTime = 0; | |
4055 if ( pParty->bTurnBasedModeOn ) | |
4056 { | |
4057 v645 = sRecoveryTime; | |
4058 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4059 pPlayer->SetRecoveryTime(v645); | |
4060 if ( !some_active_character ) | |
4061 pTurnEngine->_40471C(); | |
4062 } | |
4063 else | |
4064 { | |
4065 pPlayer->SetRecoveryTime( | |
4066 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4067 } | |
4068 if ( v727 != 0.0 ) | |
4069 { | |
4070 pPlayer->PlaySound(49, 0); | |
4071 goto LABEL_1162; | |
4072 } | |
4073 } | |
4074 v3->spellnum = 0; | |
4075 v1 = 0; | |
4076 LABEL_1165: | |
4077 v2 = v723; | |
4078 goto LABEL_1166; | |
4079 } | |
4080 } | |
4081 } | |
4082 } | |
4083 } | |
4084 } | |
4085 LABEL_199: | |
4086 dword_50C9D0 = 113; | |
4087 dword_50C9D4 = v1; | |
4088 dword_50C9D8 = 1; | |
4089 LABEL_200: | |
4090 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4091 LABEL_201: | |
4092 v67 = 2; | |
4093 LABEL_202: | |
4094 ShowStatusBarString(v66, v67); | |
4095 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4096 goto LABEL_203; | |
4097 case 71: | |
4098 v70 = v12 - 1; | |
4099 LODWORD(v733) = 3600 * v2; | |
4100 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4101 { | |
4102 v72 = v71 - 1; | |
4103 if ( v72 ) | |
4104 { | |
4105 if ( v72 == 1 ) | |
4106 amount = 10; | |
4107 } | |
4108 else | |
4109 { | |
4110 amount = 3; | |
4111 } | |
4112 } | |
4113 else | |
4114 { | |
4115 amount = 1; | |
4116 } | |
4117 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4118 goto LABEL_83; | |
4119 v73 = v3->uPlayerID_2; | |
4120 v74 = v3->spellnum; | |
4121 v75 = pGame->GetStru6(); | |
4122 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); | |
4123 v668 = v1; | |
4124 v658 = v1; | |
4125 v653 = amount; | |
4126 v651 = v731; | |
4127 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); | |
4128 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; | |
4129 goto LABEL_103; | |
4130 case 3: | |
4131 case 14: | |
4132 case 25: | |
4133 case 36: | |
4134 case 58: | |
4135 case 69: | |
4136 v76 = v12 - 1; | |
4137 LODWORD(v733) = 3600 * v2; | |
4138 if ( v76 ) | |
4139 { | |
4140 v77 = v76 - 1; | |
4141 if ( v77 ) | |
4142 { | |
4143 v78 = v77 - 1; | |
4144 if ( v78 ) | |
4145 { | |
4146 if ( v78 != 1 ) | |
4147 goto LABEL_232; | |
4148 v79 = 4 * v2; | |
4149 } | |
4150 else | |
4151 { | |
4152 v79 = 3 * v2; | |
4153 } | |
4154 } | |
4155 else | |
4156 { | |
4157 v79 = 2 * v2; | |
4158 } | |
4159 amount = v79; | |
4160 } | |
4161 else | |
4162 { | |
4163 amount = v2; | |
4164 } | |
4165 LABEL_232: | |
4166 v80 = v3->spellnum; | |
4167 switch ( v80 ) | |
4168 { | |
4169 case 3: | |
4170 LODWORD(v725) = 6; | |
4171 break; | |
4172 case 14: | |
4173 LODWORD(v725) = v1; | |
4174 break; | |
4175 case 25: | |
4176 LODWORD(v725) = 17; | |
4177 break; | |
4178 case 36: | |
4179 LODWORD(v725) = 4; | |
4180 break; | |
4181 case 58: | |
4182 LODWORD(v725) = 12; | |
4183 break; | |
4184 default: | |
4185 if ( v80 != 69 ) | |
4186 goto LABEL_1166; | |
4187 LODWORD(v725) = 1; | |
4188 break; | |
4189 } | |
4190 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4191 goto LABEL_83; | |
4192 v81 = v3->spellnum; | |
4193 v82 = pGame->GetStru6(); | |
4194 pGame->GetStru6()->SetPlayerBuffAnim(v81, v1); | |
4195 v83 = 1; | |
4196 v84 = v3->spellnum; | |
4197 v85 = pGame->GetStru6(); | |
4198 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1u); | |
4199 v86 = v3->spellnum; | |
4200 v87 = pGame->GetStru6(); | |
4201 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2u); | |
4202 v88 = v3->spellnum; | |
4203 v89 = pGame->GetStru6(); | |
4204 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3u); | |
4205 v90 = (double)(signed int)v733 * 4.2666669; | |
4206 goto LABEL_304; | |
4207 case 5: | |
4208 if ( v12 <= v1 ) | |
4209 goto LABEL_254; | |
4210 if ( v12 <= 2 ) | |
4211 { | |
4212 v91 = 60 * (v2 + 60); | |
4213 } | |
4214 else | |
4215 { | |
4216 if ( v12 == 3 ) | |
4217 { | |
4218 v91 = 180 * (v2 + 20); | |
4219 } | |
4220 else | |
4221 { | |
4222 if ( v12 != 4 ) | |
4223 goto LABEL_254; | |
4224 v91 = 240 * (v2 + 15); | |
4225 } | |
4226 } | |
4227 LODWORD(v733) = v91; | |
4228 LABEL_254: | |
4229 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4230 { | |
89 | 4231 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4232 LODWORD(v727) = 1; |
4233 do | |
4234 { | |
89 | 4235 if ( v92->pConditions ) |
0 | 4236 LODWORD(v727) = v1; |
89 | 4237 ++v92; |
0 | 4238 } |
89 | 4239 while ( v92 <= &pParty->pPlayers[3] ); |
0 | 4240 if ( LODWORD(v727) != v1 ) |
4241 { | |
4242 v726 = (Player *)((int)v733 << 7); | |
4243 pParty->pPartyBuffs[8].Apply( | |
4244 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
4245 v731, | |
4246 v1, | |
4247 v1, | |
4248 v1); | |
4249 v93 = v3->spellnum; | |
4250 v94 = pGame->GetStru6(); | |
4251 pGame->GetStru6()->SetPlayerBuffAnim(v93, v1); | |
4252 v95 = v3->spellnum; | |
4253 v96 = pGame->GetStru6(); | |
4254 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1u); | |
4255 v97 = v3->spellnum; | |
4256 v98 = pGame->GetStru6(); | |
4257 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2u); | |
4258 v99 = v3->spellnum; | |
4259 v100 = pGame->GetStru6(); | |
4260 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3u); | |
4261 } | |
4262 } | |
4263 goto LABEL_83; | |
4264 case 46: | |
4265 v101 = v12 - 1; | |
4266 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4267 { | |
4268 v103 = v102 - 1; | |
4269 if ( v103 ) | |
4270 { | |
4271 if ( v103 != 1 ) | |
4272 goto LABEL_269; | |
4273 v104 = 3600 * (v2 + 1); | |
4274 } | |
4275 else | |
4276 { | |
4277 v104 = 900 * (v2 + 4); | |
4278 } | |
4279 } | |
4280 else | |
4281 { | |
4282 v104 = 300 * (v2 + 12); | |
4283 } | |
4284 LODWORD(v733) = v104; | |
4285 LABEL_269: | |
4286 amount = v2 + 5; | |
4287 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4288 goto LABEL_83; | |
4289 if ( v731 == 1 ) | |
4290 { | |
4291 v108 = v3->uPlayerID_2; | |
4292 v109 = v3->spellnum; | |
4293 v110 = pGame->GetStru6(); | |
4294 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
4295 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, v1, 65536); | |
4296 v668 = v1; | |
4297 v716 = v111; | |
4298 v658 = v111; | |
4299 v653 = amount; | |
4300 v726 = (Player *)((int)v733 << 7); | |
4301 v651 = 1; | |
4302 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4303 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[1]; | |
4304 goto LABEL_103; | |
4305 } | |
4306 v105 = 0; | |
4307 v726 = (Player *)((int)v733 << 7); | |
4308 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4309 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4310 do |
4311 { | |
4312 v106 = v3->spellnum; | |
4313 v107 = pGame->GetStru6(); | |
4314 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); | |
4315 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, v1, 65536); | |
89 | 4316 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
4317 ++v730b; | |
0 | 4318 ++v105; |
4319 } | |
89 | 4320 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4321 goto LABEL_1056; |
4322 case 52: | |
4323 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == 3 ) | |
4324 { | |
4325 v730 = a2 >> 3; | |
4326 v112 = &pActors[a2 >> 3]; | |
4327 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4328 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4329 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4330 _this = (ItemGen *)v113; | |
4331 v114 = v721; | |
4332 v115 = (unsigned int)v726; | |
4333 if ( v113 < v721 ) | |
4334 { | |
4335 v116 = v113; | |
4336 v113 = v721; | |
4337 v114 = v116; | |
4338 } | |
4339 if ( v113 < (signed int)v726 ) | |
4340 { | |
4341 v117 = v113; | |
4342 v113 = (int)v726; | |
4343 v115 = v117; | |
4344 } | |
4345 if ( v114 < (signed int)v115 ) | |
4346 { | |
4347 v118 = v115; | |
4348 v115 = v114; | |
4349 v114 = v118; | |
4350 } | |
4351 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4352 if ( (double)(signed int)this <= 307.2 ) | |
4353 { | |
4354 v703 = 0; | |
4355 v702 = 0; | |
4356 v701 = 0; | |
4357 a1.stru_24.Reset(); | |
4358 v119 = HIDWORD(v733); | |
4359 a1.field_48 = *(int *)HIDWORD(v733); | |
4360 a1.field_4C = v723; | |
4361 a1.field_50 = v731; | |
4362 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4363 a1.uAttributes = 0; | |
4364 a1.uSectorID = 0; | |
4365 a1.uSpriteFrameID = 0; | |
4366 v120 = 8 * *(short *)(v119 + 2); | |
4367 LOBYTE(v120) = v120 | 4; | |
4368 a1.field_60_distance_related_prolly_lod = 0; | |
4369 a1.field_58 = v120; | |
4370 a1.uFacing = 0; | |
4371 a1.uSoundID = *(short *)(v119 + 16); | |
4372 a1.vPosition.x = v112->vPosition.x; | |
4373 a1.vPosition.y = v112->vPosition.y; | |
4374 v726 = (Player *)v112->uActorHeight; | |
4375 v121 = 8 * a2; | |
4376 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4377 LOBYTE(v121) = 8 * a2 | 3; | |
4378 a1.field_5C = v121; | |
4379 v122 = a1.Create(0, 0, 0, 0); | |
4380 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4381 LODWORD(v727) = 1; | |
4382 } | |
4383 else | |
4384 { | |
4385 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4386 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4387 *(int *)HIDWORD(v733) = 0; | |
4388 } | |
4389 v3 = (stru277 *)HIDWORD(v733); | |
4390 } | |
4391 goto LABEL_83; | |
4392 case 17: | |
4393 case 38: | |
4394 case 51: | |
4395 v123 = v12 - 1; | |
4396 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4397 { | |
4398 v125 = v124 - 1; | |
4399 if ( v125 ) | |
4400 { | |
4401 if ( v125 != 1 ) | |
4402 goto LABEL_296; | |
4403 v126 = 3600 * (v2 + 1); | |
4404 } | |
4405 else | |
4406 { | |
4407 v126 = 900 * (v2 + 4); | |
4408 } | |
4409 } | |
4410 else | |
4411 { | |
4412 v126 = 300 * (v2 + 12); | |
4413 } | |
4414 LODWORD(v733) = v126; | |
4415 LABEL_296: | |
4416 v127 = v3->spellnum; | |
4417 if ( v127 == 17 ) | |
4418 { | |
4419 amount = v1; | |
4420 LODWORD(v725) = 14; | |
4421 } | |
4422 else | |
4423 { | |
4424 if ( v127 == 38 ) | |
4425 { | |
4426 LODWORD(v725) = 15; | |
4427 amount = v2 + 5; | |
4428 } | |
4429 else | |
4430 { | |
4431 if ( v127 != 51 ) | |
4432 goto LABEL_1166; | |
4433 LODWORD(v725) = 9; | |
4434 amount = v2 + 5; | |
4435 } | |
4436 } | |
4437 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4438 goto LABEL_83; | |
4439 v128 = v3->spellnum; | |
4440 v129 = pGame->GetStru6(); | |
4441 pGame->GetStru6()->SetPlayerBuffAnim(v128, v1); | |
4442 v83 = 1; | |
4443 v130 = v3->spellnum; | |
4444 v131 = pGame->GetStru6(); | |
4445 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1u); | |
4446 v132 = v3->spellnum; | |
4447 v133 = pGame->GetStru6(); | |
4448 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2u); | |
4449 v134 = v3->spellnum; | |
4450 v135 = pGame->GetStru6(); | |
4451 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3u); | |
4452 v726 = (Player *)((int)v733 << 7); | |
4453 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
4454 LABEL_304: | |
4455 v673 = v1; | |
4456 v662 = v1; | |
4457 v655 = amount; | |
4458 v652 = v731; | |
4459 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; | |
4460 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; | |
4461 goto LABEL_977; | |
4462 case 8: | |
4463 v138 = v12 - 2; | |
4464 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4465 v140 = 600 * v2; | |
4466 else | |
4467 v140 = 60 * v2; | |
4468 LODWORD(v733) = v140; | |
4469 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4470 goto LABEL_83; | |
4471 v141 = v3->spellnum; | |
4472 v142 = pGame->GetStru6(); | |
4473 pGame->GetStru6()->SetPlayerBuffAnim(v141, v1); | |
4474 v143 = v3->spellnum; | |
4475 v144 = pGame->GetStru6(); | |
4476 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1u); | |
4477 v145 = v3->spellnum; | |
4478 v146 = pGame->GetStru6(); | |
4479 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2u); | |
4480 v147 = v3->spellnum; | |
4481 v148 = pGame->GetStru6(); | |
4482 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3u); | |
4483 v668 = v1; | |
4484 v726 = (Player *)((int)v733 << 7); | |
4485 v658 = v1; | |
4486 v653 = v2; | |
4487 v651 = v731; | |
4488 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4489 v27 = (char *)&pParty->pPartyBuffs[10]; | |
4490 goto LABEL_102; | |
4491 case 9: | |
4492 v149 = v12 - 1; | |
4493 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4494 { | |
4495 if ( v151 == 1 ) | |
4496 _this = (ItemGen *)20; | |
4497 } | |
4498 else | |
4499 { | |
4500 _this = (ItemGen *)16; | |
4501 } | |
4502 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4503 { | |
4504 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4505 goto LABEL_201; | |
4506 } | |
4507 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4508 goto LABEL_83; | |
4509 LODWORD(v725) = a2 & 7; | |
4510 if ( (a2 & 7) == 3 ) | |
4511 { | |
4512 v152 = a2 >> 3; | |
4513 uRequiredMana = pActors[v152].vPosition.x; | |
4514 v153 = pActors[v152].vPosition.y; | |
4515 v154 = pActors[v152].vPosition.z; | |
4516 LODWORD(v727) = v153; | |
4517 } | |
4518 else | |
4519 { | |
4520 v155 = stru_5C6E00->SinCos(pParty->sRotationY); | |
4521 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); | |
4522 v156 = stru_5C6E00->_42EBDB(pParty->sRotationY); | |
4523 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); | |
4524 v154 = pParty->vPosition.z; | |
4525 } | |
4526 HIDWORD(v733) = v154; | |
4527 v713 = v154 + 2500; | |
4528 v721 = v1; | |
4529 LODWORD(v718) = v1; | |
4530 if ( (signed int)this > v1 ) | |
4531 { | |
4532 *(float *)&y = (double)SHIDWORD(v733); | |
4533 *(float *)&v732 = (double)v713; | |
4534 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4535 v726 = (Player *)this; | |
4536 do | |
4537 { | |
4538 v157 = rand(); | |
4539 v158 = (double)SLODWORD(v718); | |
4540 v718 = v158; | |
4541 v159 = (double)v721; | |
4542 *(float *)&v721 = v159; | |
4543 a2 = v157 % 1000; | |
4544 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4545 v725 = v159 * v159; | |
4546 *(float *)&_this = v158 * v158; | |
4547 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4548 { | |
4549 LODWORD(v687) = v1; | |
4550 HIDWORD(v687) = v1; | |
4551 } | |
4552 else | |
4553 { | |
4554 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4555 v687 = __PAIR__( | |
4556 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4557 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4558 } | |
4559 a1.stru_24.Reset(); | |
4560 a1.field_48 = v3->spellnum; | |
4561 a1.field_4C = v2; | |
4562 a1.field_50 = v731; | |
4563 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4564 a1.uAttributes = v1; | |
4565 a1.vPosition.x = uRequiredMana; | |
4566 a1.vPosition.y = LODWORD(v727); | |
4567 a1.uSectorID = v1; | |
4568 a1.vPosition.z = a2 + v713; | |
4569 a1.uSpriteFrameID = v1; | |
4570 a1.field_58 = 8 * v3->uPlayerID | 4; | |
4571 a1.field_5C = v730; | |
4572 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4573 a1.uFacing = v687; | |
4574 a1.uSoundID = LOWORD(v3->field_10); | |
4575 if ( pParty->bTurnBasedModeOn == 1 ) | |
4576 a1.uAttributes = 4; | |
4577 if ( a1.Create( | |
4578 v687, | |
4579 SHIDWORD(v687), | |
4580 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4581 v1) != -1 | |
4582 && pParty->bTurnBasedModeOn == 1 ) | |
4583 ++pTurnEngine->field_1C; | |
4584 LODWORD(v718) = rand() % 1024 - 512; | |
4585 v160 = rand(); | |
4586 v14 = v726 == (Player *)1; | |
4587 v726 = (Player *)((char *)v726 - 1); | |
4588 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4589 } | |
4590 while ( !v14 ); | |
4591 } | |
4592 goto LABEL_1056; | |
4593 case 10: | |
4594 v67 = 2; | |
4595 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4596 { | |
4597 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4598 goto LABEL_202; | |
4599 } | |
4600 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4601 goto LABEL_83; | |
4602 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
4603 v700.z = v1; | |
4604 v700.y = v1; | |
4605 v700.x = v1; | |
4606 a1.stru_24.Reset(); | |
4607 a1.field_48 = v3->spellnum; | |
4608 a1.field_4C = v2; | |
4609 a1.field_50 = v731; | |
4610 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4611 a1.uAttributes = v1; | |
4612 a1.uSectorID = v1; | |
4613 a1.uSpriteFrameID = v1; | |
4614 v161 = v3->uPlayerID; | |
4615 a1.field_60_distance_related_prolly_lod = 0; | |
4616 a1.uFacing = v1; | |
4617 v161 *= 8; | |
4618 LOBYTE(v161) = v161 | 4; | |
4619 a1.field_58 = v161; | |
4620 a1.uSoundID = LOWORD(v3->field_10); | |
4621 a2 = v1; | |
4622 if ( (signed int)v726 > v1 ) | |
4623 { | |
4624 do | |
4625 { | |
4626 v162 = dword_50BF30[a2]; | |
4627 a1.vPosition.x = pActors[v162].vPosition.x; | |
4628 a1.vPosition.y = pActors[v162].vPosition.y; | |
4629 v732 = pActors[v162].uActorHeight; | |
4630 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4631 v163 = 8 * dword_50BF30[a2]; | |
4632 LOBYTE(v163) = v163 | 3; | |
4633 a1.field_5C = v163; | |
4634 v164 = a1.Create(0, v1, v1, v1); | |
4635 v165 = a2; | |
4636 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
4637 v166 = pGame->GetStru6(); | |
4638 v166->_4A81CA(&a1); | |
4639 v167 = pGame->GetStru6(); | |
4640 v167->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
4641 a2 = v165 + 1; | |
4642 } | |
4643 while ( v165 + 1 < (signed int)v726 ); | |
4644 } | |
4645 goto LABEL_1056; | |
4646 case 12: | |
4647 LODWORD(v733) = 3600 * v2; | |
4648 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4649 goto LABEL_83; | |
4650 v168 = 0; | |
4651 do | |
4652 { | |
4653 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, v1, 65536); | |
4654 v716 = v169; | |
4655 } | |
4656 while ( v168 < 4 ); | |
4657 v668 = v1; | |
4658 v732 = (int)v733 << 7; | |
4659 v658 = v1; | |
4660 v653 = v1; | |
4661 v651 = v731; | |
4662 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4663 goto LABEL_992; | |
4664 case 13: | |
4665 v170 = v12 - 1; | |
4666 if ( !v170 ) | |
4667 { | |
4668 v173 = 300 * v2; | |
4669 goto LABEL_353; | |
4670 } | |
4671 v171 = v170 - 1; | |
4672 if ( !v171 ) | |
4673 { | |
4674 v173 = 600 * v2; | |
4675 goto LABEL_353; | |
4676 } | |
4677 v172 = v171 - 1; | |
4678 if ( !v172 || v172 == 1 ) | |
4679 { | |
4680 v173 = 3600 * v2; | |
4681 LABEL_353: | |
4682 LODWORD(v733) = v173; | |
4683 } | |
4684 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4685 goto LABEL_83; | |
4686 v174 = 0; | |
4687 do | |
4688 pOtherOverlayList->_4418B1(2010, v174++ + 100, v1, 65536); | |
4689 while ( v174 < 4 ); | |
4690 v175 = v3->spellnum; | |
4691 v176 = pGame->GetStru6(); | |
4692 pGame->GetStru6()->SetPlayerBuffAnim(v175, v1); | |
4693 v83 = 1; | |
4694 v177 = v3->spellnum; | |
4695 v178 = pGame->GetStru6(); | |
4696 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1u); | |
4697 v179 = v3->spellnum; | |
4698 v180 = pGame->GetStru6(); | |
4699 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2u); | |
4700 v181 = v3->spellnum; | |
4701 v182 = pGame->GetStru6(); | |
4702 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3u); | |
4703 v673 = v1; | |
4704 v732 = (int)v733 << 7; | |
4705 v662 = v1; | |
4706 v655 = v1; | |
4707 v652 = v731; | |
4708 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4709 v137 = (char *)&pParty->pPartyBuffs[5]; | |
4710 goto LABEL_976; | |
4711 case 15: | |
4712 v184 = v12 - 1; | |
4713 if ( v184 ) | |
4714 { | |
4715 v185 = v184 - 1; | |
4716 if ( v185 ) | |
4717 { | |
4718 v186 = v185 - 1; | |
4719 if ( v186 ) | |
4720 { | |
4721 if ( v186 == 1 ) | |
4722 amount = 9; | |
4723 } | |
4724 else | |
4725 { | |
4726 amount = 7; | |
4727 } | |
4728 } | |
4729 else | |
4730 { | |
4731 amount = 5; | |
4732 } | |
4733 } | |
4734 else | |
4735 { | |
4736 amount = 3; | |
4737 } | |
4738 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4739 goto LABEL_83; | |
4740 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
4741 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4742 a1.stru_24.Reset(); | |
4743 a1.field_48 = v3->spellnum; | |
4744 a1.field_4C = v2; | |
4745 a1.field_50 = v731; | |
4746 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4747 a1.vPosition.y = pParty->vPosition.y; | |
4748 a1.vPosition.x = pParty->vPosition.x; | |
4749 a1.uAttributes = v1; | |
4750 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4751 a1.uSectorID = pIndoor->GetSector( | |
4752 pParty->vPosition.x, | |
4753 pParty->vPosition.y, | |
4754 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
4755 a1.uSpriteFrameID = v1; | |
4756 v187 = 8 * v3->uPlayerID; | |
4757 LOBYTE(v187) = v187 | 4; | |
4758 a1.field_58 = v187; | |
4759 a1.field_5C = a2; | |
4760 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4761 a1.uSoundID = LOWORD(v3->field_10); | |
4762 if ( pParty->bTurnBasedModeOn == 1 ) | |
4763 LOBYTE(a1.uAttributes) |= 4u; | |
4764 v188 = (signed int)v726 / -2; | |
4765 v189 = (signed int)v726 / 2; | |
4766 while ( v188 <= v189 ) | |
4767 { | |
4768 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4769 if ( a1.Create( | |
4770 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4771 v715.uPitchAngle, | |
4772 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4773 v3->uPlayerID + 1) != -1 | |
4774 && pParty->bTurnBasedModeOn == 1 ) | |
4775 ++pTurnEngine->field_1C; | |
4776 v188 += v732; | |
4777 } | |
4778 goto LABEL_1056; | |
4779 case 16: | |
4780 if ( pParty->uFlags & 8 ) | |
4781 { | |
4782 v190 = pGlobalTXT_LocalizationStrings[493]; | |
4783 goto LABEL_462; | |
4784 } | |
4785 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4786 goto LABEL_83; | |
4787 v191 = 0; | |
4788 do | |
4789 pOtherOverlayList->_4418B1(2040, v191++ + 100, v1, 65536); | |
4790 while ( v191 < 4 ); | |
4791 BYTE1(pParty->uFlags) |= 1u; | |
4792 pParty->uFallSpeed = 1000; | |
4793 goto LABEL_1056; | |
4794 case 19: | |
4795 v192 = v12 - 1; | |
4796 if ( !v192 ) | |
4797 { | |
4798 amount = v2; | |
4799 goto LABEL_391; | |
4800 } | |
4801 v193 = v192 - 1; | |
4802 if ( !v193 ) | |
4803 { | |
4804 v196 = 2 * v2; | |
4805 LABEL_389: | |
4806 amount = v196; | |
4807 LABEL_391: | |
4808 v195 = 600 * v2; | |
4809 goto LABEL_392; | |
4810 } | |
4811 v194 = v193 - 1; | |
4812 if ( !v194 ) | |
4813 { | |
4814 v196 = 3 * v2; | |
4815 goto LABEL_389; | |
4816 } | |
4817 if ( v194 != 1 ) | |
4818 goto LABEL_393; | |
4819 amount = 4 * v2; | |
4820 v195 = 3600 * v2; | |
4821 LABEL_392: | |
4822 LODWORD(v733) = v195; | |
4823 LABEL_393: | |
4824 if ( pParty->uFlags & 0x30 ) | |
4825 { | |
4826 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4827 goto LABEL_201; | |
4828 } | |
4829 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4830 { | |
4831 v197 = v3->spellnum; | |
4832 v198 = pGame->GetStru6(); | |
4833 pGame->GetStru6()->SetPlayerBuffAnim(v197, v1); | |
4834 v83 = 1; | |
4835 v199 = v3->spellnum; | |
4836 v200 = pGame->GetStru6(); | |
4837 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1u); | |
4838 v201 = v3->spellnum; | |
4839 v202 = pGame->GetStru6(); | |
4840 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2u); | |
4841 v203 = v3->spellnum; | |
4842 v204 = pGame->GetStru6(); | |
4843 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3u); | |
4844 v673 = v1; | |
4845 v732 = (int)v733 << 7; | |
4846 v662 = v1; | |
4847 v655 = amount; | |
4848 v652 = v731; | |
4849 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4850 v137 = (char *)&pParty->pPartyBuffs[11]; | |
4851 LABEL_976: | |
4852 v136 = pParty->uTimePlayed + v183; | |
4853 LABEL_977: | |
4854 ((SpellBuff *)v137)->Apply(v136, v652, v655, v662, v673); | |
4855 LABEL_978: | |
4856 LODWORD(v727) = v83; | |
4857 } | |
4858 goto LABEL_83; | |
4859 case 21: | |
4860 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4861 { | |
4862 v190 = pGlobalTXT_LocalizationStrings[494]; | |
4863 LABEL_462: | |
4864 ShowStatusBarString(v190, 2u); | |
4865 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4866 goto LABEL_83; | |
4867 } | |
4868 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4869 { | |
4870 LABEL_461: | |
4871 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4872 goto LABEL_462; | |
4873 } | |
4874 LODWORD(v733) = 3600 * v2; | |
4875 if ( v731 == 2 || v731 == 3 || (amount = v1, v731 != 4) ) | |
4876 amount = 1; | |
4877 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4878 goto LABEL_83; | |
4879 v205 = 0; | |
4880 do | |
4881 pOtherOverlayList->_4418B1(2090, v205++ + 100, v1, 65536); | |
4882 while ( v205 < 4 ); | |
4883 v206 = pOtherOverlayList->_4418B1(10008, 203, v1, 65536); | |
4884 v207 = v3->uPlayerID + 1; | |
4885 v716 = v206; | |
4886 v668 = v207; | |
4887 v658 = v206; | |
4888 v653 = amount; | |
4889 v732 = (int)v733 << 7; | |
4890 v651 = v731; | |
4891 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4892 v27 = (char *)&pParty->pPartyBuffs[7]; | |
4893 LABEL_101: | |
4894 v26 = (signed int)v26; | |
4895 LABEL_102: | |
4896 v28 = pParty->uTimePlayed + v26; | |
4897 LABEL_103: | |
4898 HIDWORD(v650) = HIDWORD(v28); | |
4899 LABEL_104: | |
4900 LODWORD(v650) = v28; | |
4901 ((SpellBuff *)v27)->Apply(v650, v651, v653, v658, v668); | |
4902 goto LABEL_1056; | |
4903 case 22: | |
4904 v67 = 2; | |
4905 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4906 { | |
4907 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4908 goto LABEL_202; | |
4909 } | |
4910 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4911 goto LABEL_83; | |
4912 v208 = a2 & 7; | |
4913 LODWORD(v725) = a2 & 7; | |
4914 if ( v208 == 3 ) | |
4915 { | |
4916 v209 = a2 >> 3; | |
4917 LODWORD(v718) = pActors[v209].vPosition.x; | |
4918 v210 = pActors[v209].vPosition.y; | |
4919 v211 = pActors[v209].vPosition.z; | |
4920 v713 = v210; | |
4921 } | |
4922 else | |
4923 { | |
4924 v212 = stru_5C6E00->SinCos(pParty->sRotationY); | |
4925 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); | |
4926 v213 = stru_5C6E00->_42EBDB(pParty->sRotationY); | |
4927 v214 = sub_42EBBE(2048, v213); | |
4928 v211 = pParty->vPosition.z; | |
4929 v713 = pParty->vPosition.y + v214; | |
4930 v208 = LODWORD(v725); | |
4931 } | |
4932 v726 = (Player *)v211; | |
4933 HIDWORD(v733) = v1; | |
4934 *(float *)&v732 = (double)v211; | |
4935 LODWORD(v725) = v211 + 2500; | |
4936 v721 = v1; | |
4937 *(float *)&y = (double)(v211 + 2500); | |
4938 v730 = v208 == 3 ? a2 : 0; | |
4939 a2 = 20; | |
4940 do | |
4941 { | |
4942 v215 = rand(); | |
4943 v216 = (double)v721; | |
4944 v727 = v216; | |
4945 v217 = (double)SHIDWORD(v733); | |
4946 *(float *)&uRequiredMana = v217; | |
4947 _this = (ItemGen *)(v215 % 1000); | |
4948 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4949 *(float *)&v721 = v217 * v217; | |
4950 *(float *)&v726 = v216 * v216; | |
4951 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4952 { | |
4953 LODWORD(v685) = v1; | |
4954 HIDWORD(v685) = v1; | |
4955 } | |
4956 else | |
4957 { | |
4958 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4959 v685 = __PAIR__( | |
4960 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4961 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4962 } | |
4963 a1.stru_24.Reset(); | |
4964 a1.field_48 = v3->spellnum; | |
4965 a1.field_4C = v2; | |
4966 a1.field_50 = v731; | |
4967 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4968 a1.uAttributes = v1; | |
4969 a1.vPosition.x = LODWORD(v718); | |
4970 a1.vPosition.y = v713; | |
4971 a1.uSectorID = v1; | |
4972 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); | |
4973 a1.uSpriteFrameID = v1; | |
4974 a1.field_58 = 8 * v3->uPlayerID | 4; | |
4975 a1.field_5C = v730; | |
4976 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4977 a1.uFacing = v685; | |
4978 a1.uSoundID = LOWORD(v3->field_10); | |
4979 if ( pParty->bTurnBasedModeOn == 1 ) | |
4980 a1.uAttributes = 4; | |
4981 if ( a1.Create( | |
4982 v685, | |
4983 SHIDWORD(v685), | |
4984 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4985 v1) != -1 | |
4986 && pParty->bTurnBasedModeOn == 1 ) | |
4987 ++pTurnEngine->field_1C; | |
4988 v721 = rand() % 1024 - 512; | |
4989 v218 = rand(); | |
4990 v14 = a2-- == 1; | |
4991 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4992 } | |
4993 while ( !v14 ); | |
4994 goto LABEL_1056; | |
4995 case 23: | |
4996 v219 = v12 - 2; | |
4997 if ( v219 ) | |
4998 { | |
4999 v220 = v219 - 1; | |
5000 if ( v220 ) | |
5001 { | |
5002 if ( v220 == 1 ) | |
5003 { | |
5004 amount = v1; | |
5005 goto LABEL_433; | |
5006 } | |
5007 v221 = 180 * v2; | |
5008 } | |
5009 else | |
5010 { | |
5011 v221 = 86400 * v2; | |
5012 } | |
5013 } | |
5014 else | |
5015 { | |
5016 v221 = 3600 * v2; | |
5017 } | |
5018 amount = v221; | |
5019 LABEL_433: | |
5020 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5021 goto LABEL_83; | |
5022 v222 = (char *)pParty->pPlayers; | |
5023 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
5024 break; | |
5025 case 24: | |
5026 v224 = v12 - 2; | |
5027 if ( v224 ) | |
5028 { | |
5029 v225 = v224 - 1; | |
5030 if ( v225 ) | |
5031 { | |
5032 if ( v225 == 1 ) | |
5033 amount = 7; | |
5034 else | |
5035 amount = 1; | |
5036 } | |
5037 else | |
5038 { | |
5039 amount = 5; | |
5040 } | |
5041 } | |
5042 else | |
5043 { | |
5044 amount = 3; | |
5045 } | |
5046 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5047 goto LABEL_83; | |
5048 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
5049 if ( amount == 1 ) | |
5050 { | |
5051 LABEL_152: | |
5052 a1.stru_24.Reset(); | |
5053 a1.field_48 = v3->spellnum; | |
5054 a1.field_50 = v731; | |
5055 a1.field_4C = v2; | |
5056 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5057 a1.vPosition.y = pParty->vPosition.y; | |
5058 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5059 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5060 v660 = pParty->vPosition.y; | |
5061 LABEL_153: | |
5062 a1.uAttributes = v1; | |
5063 a1.vPosition.x = pParty->vPosition.x; | |
5064 a1.vPosition.z = v51; | |
5065 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
5066 a1.uSpriteFrameID = v1; | |
5067 a1.uSectorID = v52; | |
5068 v53 = 8 * v3->uPlayerID; | |
5069 LOBYTE(v53) = v53 | 4; | |
5070 a1.field_58 = v53; | |
5071 a1.field_5C = a2; | |
5072 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5073 a1.uFacing = LOWORD(v715.uYawAngle); | |
5074 a1.uSoundID = LOWORD(v3->field_10); | |
5075 LABEL_154: | |
5076 if ( pParty->bTurnBasedModeOn == 1 ) | |
5077 LOBYTE(a1.uAttributes) |= 4u; | |
5078 LABEL_156: | |
5079 v669 = v3->uPlayerID + 1; | |
5080 v36 = v715.uYawAngle; | |
5081 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5082 v654 = v715.uPitchAngle; | |
5083 LABEL_157: | |
5084 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
5085 ++pTurnEngine->field_1C; | |
5086 } | |
5087 else | |
5088 { | |
5089 v732 = SHIDWORD(v733) / (amount - 1); | |
5090 a1.stru_24.Reset(); | |
5091 a1.field_48 = v3->spellnum; | |
5092 a1.field_4C = v2; | |
5093 a1.field_50 = v731; | |
5094 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5095 a1.vPosition.y = pParty->vPosition.y; | |
5096 a1.vPosition.x = pParty->vPosition.x; | |
5097 a1.uAttributes = v1; | |
5098 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5099 a1.uSectorID = pIndoor->GetSector( | |
5100 pParty->vPosition.x, | |
5101 pParty->vPosition.y, | |
5102 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5103 a1.uSpriteFrameID = v1; | |
5104 v226 = 8 * v3->uPlayerID; | |
5105 LOBYTE(v226) = v226 | 4; | |
5106 a1.field_58 = v226; | |
5107 a1.field_5C = a2; | |
5108 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5109 a1.uSoundID = LOWORD(v3->field_10); | |
5110 if ( pParty->bTurnBasedModeOn == 1 ) | |
5111 LOBYTE(a1.uAttributes) |= 4u; | |
5112 v227 = SHIDWORD(v733) / -2; | |
5113 y = (char *)(SHIDWORD(v733) / 2); | |
5114 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5115 { | |
5116 v228 = v715.uYawAngle; | |
5117 do | |
5118 { | |
5119 a1.uFacing = v227 + v228; | |
5120 if ( a1.Create( | |
5121 v227 + v228, | |
5122 v715.uPitchAngle, | |
5123 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5124 v3->uPlayerID + 1) != -1 | |
5125 && pParty->bTurnBasedModeOn == 1 ) | |
5126 ++pTurnEngine->field_1C; | |
5127 v227 += v732; | |
5128 } | |
5129 while ( v227 <= (signed int)y ); | |
5130 } | |
5131 } | |
5132 goto LABEL_1056; | |
5133 case 27: | |
5134 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5135 goto LABEL_461; | |
5136 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5137 v229 = 600 * v2; | |
5138 else | |
5139 v229 = 3600 * v2; | |
5140 LODWORD(v733) = v229; | |
5141 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5142 goto LABEL_83; | |
5143 v716 = pOtherOverlayList->_4418B1(10005, 201, v1, 65536); | |
5144 v230 = v3->spellnum; | |
5145 v231 = pGame->GetStru6(); | |
5146 pGame->GetStru6()->SetPlayerBuffAnim(v230, v1); | |
5147 v232 = 1; | |
5148 v233 = v3->spellnum; | |
5149 v234 = pGame->GetStru6(); | |
5150 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1u); | |
5151 v235 = v3->spellnum; | |
5152 v236 = pGame->GetStru6(); | |
5153 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2u); | |
5154 v237 = v3->spellnum; | |
5155 v238 = pGame->GetStru6(); | |
5156 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3u); | |
5157 v239 = v3->uPlayerID + 1; | |
5158 v732 = v229 << 7; | |
5159 pParty->pPartyBuffs[18].Apply( | |
5160 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5161 v731, | |
5162 amount, | |
5163 v716, | |
5164 v239); | |
5165 if ( v731 == 4 ) | |
5166 pParty->pPartyBuffs[18].uFlags = 1; | |
89 | 5167 LODWORD(v727) = v232; |
5168 goto LABEL_83; | |
0 | 5169 case 28: |
5170 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5171 goto LABEL_83; | |
5172 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; | |
5173 y = v240; | |
5174 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5175 goto LABEL_199; | |
5176 if ( v731 == 1 || v731 == 2 ) | |
5177 { | |
5178 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5179 } | |
5180 else | |
5181 { | |
5182 if ( v731 == 3 ) | |
5183 { | |
5184 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5185 } | |
5186 else | |
5187 { | |
5188 if ( v731 != 4 ) | |
5189 { | |
5190 v241 = 0.0; | |
5191 goto LABEL_484; | |
5192 } | |
5193 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5194 } | |
5195 } | |
5196 if ( v241 > 1.0 ) | |
5197 v241 = 1.0; | |
5198 LABEL_484: | |
5199 v732 = (unsigned __int8)v240[25]; | |
5200 v242 = (signed __int64)((double)v732 * v241); | |
5201 v243 = y; | |
5202 y[25] = v242; | |
5203 *((int *)v243 + 4) = (unsigned __int8)v242; | |
5204 if ( (unsigned __int8)v242 <= v1 ) | |
5205 { | |
5206 *(int *)v243 = v1; | |
5207 dword_50C9D0 = 113; | |
5208 dword_50C9D4 = v1; | |
5209 dword_50C9D8 = 1; | |
5210 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
5211 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5212 v3->spellnum = v1; | |
5213 goto LABEL_1165; | |
5214 } | |
5215 *((int *)v243 + 5) |= 0x40u; | |
5216 goto LABEL_1055; | |
5217 case 30: | |
5218 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5219 goto LABEL_83; | |
5220 uRequiredMana = v1; | |
5221 HIDWORD(v733) = 10 * v2; | |
5222 v730 = 1; | |
5223 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5224 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5225 if ( v731 == 1 ) | |
5226 { | |
5227 v245 = (int)&v244[36 * a2 + 532]; | |
5228 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5229 v311 = __OFSUB__(*(int *)v245, 134); | |
5230 v14 = *(int *)v245 == 134; | |
5231 v310 = *(int *)v245 - 134 < 0; | |
5232 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5233 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5234 { | |
5235 if ( *(int *)&v244[36 * a2 + 544] == v1 ) | |
5236 { | |
5237 if ( *(int *)&v244[36 * a2 + 536] == v1 ) | |
5238 { | |
5239 if ( *(int *)&v244[36 * a2 + 540] == v1 ) | |
5240 { | |
5241 v312 = v309[28]; | |
5242 if ( v312 ) | |
5243 { | |
5244 if ( v312 != 1 ) | |
5245 { | |
5246 if ( v312 != 2 ) | |
5247 { | |
5248 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5249 if ( !(v244[36 * a2 + 552] & 2) ) | |
5250 { | |
5251 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5252 { | |
5253 uRequiredMana = 1; | |
5254 v730 = v1; | |
5255 } | |
5256 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5257 uRequiredMana = 1; | |
5258 if ( uRequiredMana == v1 ) | |
5259 { | |
5260 v313 = *(char *)(LODWORD(v725) + 28); | |
5261 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5262 { | |
5263 v314 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | |
5264 *(int *)(v245 + 4) = 0; | |
5265 for ( j = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5266 + 1]; | |
5267 ; | |
5268 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5269 + 1] ) | |
5270 { | |
5271 ++*(int *)(v245 + 4); | |
5272 if ( j >= v314 ) | |
5273 break; | |
5274 } | |
5275 v254 = rand(); | |
5276 v255 = pItemsTable->field_116D8[17]; | |
5277 v256 = pItemsTable->field_116D8[16]; | |
5278 LABEL_611: | |
5279 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5280 LABEL_612: | |
5281 _this->uItemID |= 0x20u; | |
5282 goto LABEL_1055; | |
5283 } | |
5284 goto LABEL_615; | |
5285 } | |
5286 LABEL_613: | |
5287 v316 = _this->uItemID; | |
5288 if ( !(BYTE1(v316) & 2) ) | |
5289 { | |
5290 LOBYTE(v316) = v316 | 2; | |
5291 _this->uItemID = v316; | |
5292 } | |
5293 } | |
5294 } | |
5295 } | |
5296 } | |
5297 } | |
5298 } | |
5299 } | |
5300 } | |
5301 LABEL_616: | |
5302 if ( LODWORD(v727) == v1 ) | |
5303 { | |
5304 v317 = pGlobalTXT_LocalizationStrings[428]; | |
5305 if ( v730 == v1 ) | |
5306 v317 = pGlobalTXT_LocalizationStrings[585]; | |
5307 ShowStatusBarString(v317, 2u); | |
5308 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5309 v318 = v726; | |
5310 v3->spellnum = v1; | |
5311 v318->PlaySound(43, v1); | |
5312 } | |
5313 goto LABEL_83; | |
5314 } | |
5315 if ( v731 != 2 ) | |
5316 { | |
5317 if ( v731 == 3 ) | |
5318 { | |
5319 v245 = (int)&v244[36 * a2 + 532]; | |
5320 v269 = *(int *)v245; | |
5321 if ( *(int *)v245 > 134 | |
5322 || *(int *)(v245 + 12) != v1 | |
5323 || *(int *)(v245 + 4) != v1 | |
5324 || *(int *)(v245 + 8) != v1 | |
5325 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) | |
5326 goto LABEL_616; | |
5327 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5328 LODWORD(v725) = (int)v270; | |
5329 v271 = v270[28]; | |
5330 if ( v271 && v271 != 1 && v271 != 2 ) | |
5331 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5332 else | |
5333 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5334 if ( v272 ) | |
5335 { | |
5336 uRequiredMana = 1; | |
5337 v730 = v1; | |
5338 } | |
5339 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5340 uRequiredMana = 1; | |
5341 if ( uRequiredMana != v1 ) | |
5342 goto LABEL_613; | |
5343 v273 = v725; | |
5344 v274 = *(char *)(LODWORD(v725) + 28); | |
5345 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 ) | |
5346 { | |
5347 if ( rand() % 100 < 80 | |
5348 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5349 { | |
5350 v275 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | |
5351 *(int *)(v245 + 4) = 0; | |
5352 for ( k = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; | |
5353 ; | |
5354 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5355 + 1] ) | |
5356 { | |
5357 ++*(int *)(v245 + 4); | |
5358 if ( k >= v275 ) | |
5359 break; | |
5360 } | |
5361 v254 = rand(); | |
5362 v255 = pItemsTable->field_116D8[19]; | |
5363 v256 = pItemsTable->field_116D8[18]; | |
5364 goto LABEL_611; | |
5365 } | |
5366 v277 = pItemsTable->field_11798; | |
5367 v278 = 0; | |
5368 v725 = 0.0; | |
5369 HIDWORD(v733) = 0; | |
5370 if ( pItemsTable->field_11798 > 0 ) | |
5371 { | |
5372 v730 = (int)&v679; | |
5373 do | |
5374 { | |
5375 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pName); | |
5376 if ( !v279 || v279 == 1 ) | |
5377 { | |
5378 v280 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5379 + 4] | |
5380 + v278 * 28); | |
5381 LODWORD(v725) += v280; | |
5382 if ( v280 ) | |
5383 { | |
5384 v281 = v730; | |
5385 v730 += 4; | |
5386 *(int *)v281 = HIDWORD(v733); | |
5387 } | |
5388 } | |
5389 ++HIDWORD(v733); | |
5390 ++v278; | |
5391 } | |
5392 while ( SHIDWORD(v733) < v277 ); | |
5393 } | |
5394 v282 = rand() % SLODWORD(v725); | |
5395 v283 = v679; | |
5396 *(int *)(v245 + 12) = v679; | |
5397 v284 = pItemsTable->pSpecialEnchantments[v283].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; | |
5398 v285 = v282 + 1; | |
5399 if ( v284 < v285 ) | |
5400 { | |
5401 for ( l = &v679; ; l = (int *)v732 ) | |
5402 { | |
5403 v287 = (int)(l + 1); | |
5404 v732 = v287; | |
5405 v288 = *(int *)v287; | |
5406 *(int *)(v245 + 12) = v288; | |
5407 v284 += pItemsTable->pSpecialEnchantments[v288].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5408 + 4]; | |
5409 if ( v284 >= v285 ) | |
5410 break; | |
5411 } | |
5412 } | |
5413 goto LABEL_525; | |
5414 } | |
5415 } | |
5416 else | |
5417 { | |
5418 if ( v731 != 4 | |
5419 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
5420 || v726->pInventoryItems[a2].uAdditionalValue != v1 | |
5421 || v726->pInventoryItems[a2]._bonus_type != v1 | |
5422 || v726->pInventoryItems[a2]._bonus_strength != v1 | |
5423 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].uAttributes & 2) ) | |
5424 goto LABEL_616; | |
5425 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5426 LODWORD(v725) = (int)v247; | |
5427 v248 = v247[28]; | |
5428 if ( v248 && v248 != 1 && v248 != 2 ) | |
5429 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5430 else | |
5431 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5432 if ( v249 ) | |
5433 { | |
5434 uRequiredMana = 1; | |
5435 v730 = v1; | |
5436 } | |
5437 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5438 uRequiredMana = 1; | |
5439 if ( uRequiredMana != v1 ) | |
5440 goto LABEL_613; | |
5441 v250 = v725; | |
5442 v251 = *(char *)(LODWORD(v725) + 28); | |
5443 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 ) | |
5444 { | |
5445 if ( rand() % 100 < 80 | |
5446 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5447 { | |
5448 v252 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | |
5449 *(int *)(v245 + 4) = 0; | |
5450 for ( m = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; | |
5451 ; | |
5452 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5453 + 1] ) | |
5454 { | |
5455 ++*(int *)(v245 + 4); | |
5456 if ( m >= v252 ) | |
5457 break; | |
5458 } | |
5459 v254 = rand(); | |
5460 v255 = pItemsTable->field_116D8[21]; | |
5461 v256 = pItemsTable->field_116D8[20]; | |
5462 goto LABEL_611; | |
5463 } | |
5464 v257 = pItemsTable->field_11798; | |
5465 v258 = 0; | |
5466 v725 = 0.0; | |
5467 HIDWORD(v733) = 0; | |
5468 if ( pItemsTable->field_11798 > 0 ) | |
5469 { | |
5470 v730 = (int)&v679; | |
5471 do | |
5472 { | |
5473 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pName); | |
5474 if ( !v259 || v259 == 1 ) | |
5475 { | |
5476 v260 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5477 + 4] | |
5478 + v258 * 28); | |
5479 LODWORD(v725) += v260; | |
5480 if ( v260 ) | |
5481 { | |
5482 v261 = v730; | |
5483 v730 += 4; | |
5484 *(int *)v261 = HIDWORD(v733); | |
5485 } | |
5486 } | |
5487 ++HIDWORD(v733); | |
5488 ++v258; | |
5489 } | |
5490 while ( SHIDWORD(v733) < v257 ); | |
5491 } | |
5492 v262 = rand() % SLODWORD(v725); | |
5493 v263 = v679; | |
5494 *(int *)(v245 + 12) = v679; | |
5495 v264 = pItemsTable->pSpecialEnchantments[v263].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; | |
5496 v265 = v262 + 1; | |
5497 if ( v264 < v265 ) | |
5498 { | |
5499 for ( ii = &v679; ; ii = (int *)v732 ) | |
5500 { | |
5501 v267 = (int)(ii + 1); | |
5502 v732 = v267; | |
5503 v268 = *(int *)v267; | |
5504 *(int *)(v245 + 12) = v268; | |
5505 v264 += pItemsTable->pSpecialEnchantments[v268].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | |
5506 + 4]; | |
5507 if ( v264 >= v265 ) | |
5508 break; | |
5509 } | |
5510 } | |
5511 LABEL_525: | |
5512 ++*(int *)(v245 + 12); | |
5513 goto LABEL_612; | |
5514 } | |
5515 } | |
5516 LABEL_615: | |
5517 v1 = 0; | |
5518 goto LABEL_616; | |
5519 } | |
5520 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5521 _this = v289; | |
5522 v290 = v289->uItemID; | |
5523 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5524 if ( v290 > 134 | |
5525 || _this->uAdditionalValue != v1 | |
5526 || _this->_bonus_type != v1 | |
5527 || _this->_bonus_strength != v1 | |
5528 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 | |
5529 || v291 == 1 | |
5530 || v291 == 2 | |
5531 || _this->uAttributes & 2 ) | |
5532 goto LABEL_616; | |
5533 if ( _this->GetValue() < 0x1C2 ) | |
5534 uRequiredMana = 1; | |
5535 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5536 uRequiredMana = 1; | |
5537 if ( uRequiredMana != v1 ) | |
5538 goto LABEL_199; | |
5539 v292 = *(char *)(LODWORD(v725) + 28); | |
5540 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5541 { | |
5542 v2 = v723; | |
5543 v1 = 0; | |
5544 goto LABEL_199; | |
5545 } | |
5546 if ( rand() % 100 >= 80 ) | |
5547 { | |
5548 v297 = pItemsTable->field_11798; | |
5549 v294 = _this; | |
5550 v298 = 0; | |
5551 v725 = 0.0; | |
5552 HIDWORD(v733) = 0; | |
5553 if ( pItemsTable->field_11798 > 0 ) | |
5554 { | |
5555 v730 = (int)&v679; | |
5556 do | |
5557 { | |
5558 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pName); | |
5559 if ( !v299 || v299 == 1 ) | |
5560 { | |
5561 v300 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4] | |
5562 + v298 * 28); | |
5563 LODWORD(v725) += v300; | |
5564 if ( v300 ) | |
5565 { | |
5566 v301 = v730; | |
5567 v730 += 4; | |
5568 *(int *)v301 = HIDWORD(v733); | |
5569 } | |
5570 } | |
5571 ++HIDWORD(v733); | |
5572 ++v298; | |
5573 } | |
5574 while ( SHIDWORD(v733) < v297 ); | |
5575 } | |
5576 v302 = rand() % SLODWORD(v725); | |
5577 v303 = v679; | |
5578 v294->uAdditionalValue = v679; | |
5579 v304 = pItemsTable->pSpecialEnchantments[v303].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; | |
5580 v305 = v302 + 1; | |
5581 if ( v304 < v305 ) | |
5582 { | |
5583 for ( jj = &v679; ; jj = (int *)v732 ) | |
5584 { | |
5585 v307 = (int)(jj + 1); | |
5586 v732 = v307; | |
5587 v308 = *(int *)v307; | |
5588 v294->uAdditionalValue = v308; | |
5589 v304 += pItemsTable->pSpecialEnchantments[v308].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; | |
5590 if ( v304 >= v305 ) | |
5591 break; | |
5592 } | |
5593 } | |
5594 ++v294->uAdditionalValue; | |
5595 } | |
5596 else | |
5597 { | |
5598 v293 = rand(); | |
5599 v294 = _this; | |
5600 v295 = v293 % pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; | |
5601 _this->_bonus_type = 0; | |
5602 for ( kk = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; | |
5603 ; | |
5604 kk += pItemsTable->pEnchantments[v294->_bonus_type].field_8[pItemsTable->pItems[v294->uItemID].uEquipType | |
5605 + 1] ) | |
5606 { | |
5607 ++v294->_bonus_type; | |
5608 if ( kk >= v295 ) | |
5609 break; | |
5610 } | |
5611 v294->_bonus_strength = pItemsTable->field_116D8[18] | |
5612 + rand() % (pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
5613 } | |
5614 v294->uAttributes |= 0x20u; | |
5615 goto LABEL_1055; | |
5616 case 31: | |
5617 amount = 10 * v2; | |
5618 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
5619 goto LABEL_83; | |
5620 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) | |
5621 goto LABEL_200; | |
5622 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
5623 pMessageQueue_50CBD0->SendMessage((UIMessageType)195, v1, v1); | |
5624 goto LABEL_1056; | |
5625 case 33: | |
5626 LODWORD(v733) = 604800 * v2; | |
5627 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5628 goto LABEL_200; | |
5629 v319 = uRequiredMana; | |
5630 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5631 { | |
5632 pEventTimer->Pause(); | |
5633 pMessageQueue_50CBD0->SendMessage((UIMessageType)177, v1, v1); | |
5634 qword_506350 = (signed int)v733; | |
5635 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5636 ::uRequiredMana = v319; | |
5637 ::sRecoveryTime = sRecoveryTime; | |
5638 dword_50633C = v3->field_10; | |
5639 dword_506338 = v3->spellnum; | |
5640 LOBYTE(v3->field_8) |= 0x20u; | |
5641 } | |
5642 goto LABEL_83; | |
5643 case 40: | |
5644 v320 = v12 - 2; | |
5645 if ( !v320 ) | |
5646 goto LABEL_632; | |
5647 v321 = v320 - 1; | |
5648 if ( v321 ) | |
5649 { | |
5650 if ( v321 == 1 ) | |
5651 goto LABEL_634; | |
5652 LABEL_632: | |
5653 v322 = 3600 * v2; | |
5654 } | |
5655 else | |
5656 { | |
5657 v322 = 86400 * v2; | |
5658 } | |
5659 amount = v322; | |
5660 LABEL_634: | |
5661 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5662 goto LABEL_83; | |
5663 v323 = v3->uPlayerID_2; | |
5664 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5665 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5666 goto LABEL_1056; | |
5667 if ( v731 == 4 ) | |
5668 goto LABEL_637; | |
5669 v732 = amount << 7; | |
5670 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5671 v656 = 15; | |
5672 goto LABEL_640; | |
5673 case 41: | |
5674 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5675 goto LABEL_83; | |
5676 a1.stru_24.Reset(); | |
5677 a1.field_48 = v3->spellnum; | |
5678 a1.field_4C = v2; | |
5679 a1.field_50 = v731; | |
5680 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5681 a1.vPosition.y = pParty->vPosition.y; | |
5682 a1.vPosition.x = pParty->vPosition.x; | |
5683 a1.uAttributes = v1; | |
5684 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5685 a1.uSectorID = pIndoor->GetSector( | |
5686 pParty->vPosition.x, | |
5687 pParty->vPosition.y, | |
5688 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5689 a1.uSpriteFrameID = v1; | |
5690 v326 = 8 * v3->uPlayerID; | |
5691 LOBYTE(v326) = v326 | 4; | |
5692 a1.field_58 = v326; | |
5693 a1.field_5C = a2; | |
5694 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5695 a1.uFacing = LOWORD(pParty->sRotationY); | |
5696 a1.uSoundID = LOWORD(v3->field_10); | |
5697 if ( pParty->bTurnBasedModeOn == 1 ) | |
5698 LOBYTE(a1.uAttributes) |= 4u; | |
5699 v669 = v3->uPlayerID + 1; | |
5700 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5701 v654 = pParty->sRotationX; | |
5702 goto LABEL_125; | |
5703 case 43: | |
5704 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5705 goto LABEL_200; | |
5706 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5707 goto LABEL_83; | |
5708 a1.uItemType = 4090; | |
5709 a1.stru_24.Reset(); | |
5710 a1.field_48 = v3->spellnum; | |
5711 a1.field_4C = v2; | |
5712 a1.field_50 = v731; | |
5713 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5714 a1.vPosition.x = pParty->vPosition.x; | |
5715 a1.vPosition.y = pParty->vPosition.y; | |
5716 a1.uAttributes = v1; | |
5717 a1.uSectorID = v1; | |
5718 a1.uSpriteFrameID = v1; | |
5719 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5720 v327 = 8 * v3->uPlayerID; | |
5721 LOBYTE(v327) = v327 | 4; | |
5722 a1.field_60_distance_related_prolly_lod = 0; | |
5723 a1.field_58 = v327; | |
5724 a1.field_5C = a2; | |
5725 a1.uFacing = LOWORD(pParty->sRotationY); | |
5726 a1.uSoundID = LOWORD(v3->field_10); | |
5727 if ( pParty->bTurnBasedModeOn == 1 ) | |
5728 a1.uAttributes = 4; | |
5729 v669 = v1; | |
5730 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5731 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5732 LABEL_124: | |
5733 v654 = v35; | |
5734 LABEL_125: | |
5735 v36 = pParty->sRotationY; | |
5736 goto LABEL_157; | |
5737 case 45: | |
5738 v328 = v12 - 2; | |
5739 if ( v328 ) | |
5740 { | |
5741 v329 = v328 - 1; | |
5742 if ( v329 && v329 != 1 ) | |
5743 v330 = 600 * v2; | |
5744 else | |
5745 v330 = 3600 * v2; | |
5746 } | |
5747 else | |
5748 { | |
5749 v330 = 1800 * v2; | |
5750 } | |
5751 LODWORD(v733) = v330; | |
5752 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5753 goto LABEL_83; | |
5754 v331 = v3->spellnum; | |
5755 v332 = pGame->GetStru6(); | |
5756 pGame->GetStru6()->SetPlayerBuffAnim(v331, v1); | |
5757 v83 = 1; | |
5758 v333 = v3->spellnum; | |
5759 v334 = pGame->GetStru6(); | |
5760 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1u); | |
5761 v335 = v3->spellnum; | |
5762 v336 = pGame->GetStru6(); | |
5763 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2u); | |
5764 v337 = v3->spellnum; | |
5765 v338 = pGame->GetStru6(); | |
5766 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3u); | |
5767 v673 = v1; | |
5768 v732 = (int)v733 << 7; | |
5769 v662 = v1; | |
5770 v655 = v1; | |
5771 v652 = v731; | |
5772 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5773 v137 = (char *)&pParty->pPartyBuffs[3]; | |
5774 goto LABEL_976; | |
5775 case 47: | |
5776 LODWORD(v733) = 300; | |
5777 v339 = v12 - 2; | |
5778 if ( v339 ) | |
5779 { | |
5780 v340 = v339 - 1; | |
5781 if ( v340 ) | |
5782 { | |
5783 if ( v340 != 1 ) | |
5784 { | |
5785 amount = v2; | |
5786 goto LABEL_667; | |
5787 } | |
5788 v341 = 6 * v2; | |
5789 } | |
5790 else | |
5791 { | |
5792 v341 = 4 * v2; | |
5793 } | |
5794 } | |
5795 else | |
5796 { | |
5797 v341 = 2 * v2; | |
5798 } | |
5799 amount = v341; | |
5800 LABEL_667: | |
5801 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5802 goto LABEL_83; | |
5803 v342 = *(int *)&v3->field_C; | |
5804 if ( v342 == v1 ) | |
5805 { | |
5806 v345 = v3->uPlayerID_2; | |
5807 v346 = v3->spellnum; | |
5808 v347 = pGame->GetStru6(); | |
5809 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); | |
5810 v668 = v1; | |
5811 v658 = v1; | |
5812 v653 = amount; | |
5813 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; | |
5814 v651 = v731; | |
5815 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5816 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; | |
5817 goto LABEL_104; | |
5818 } | |
5819 if ( (v342 & 7) == 3 ) | |
5820 { | |
5821 v343 = v342 >> 3; | |
5822 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5823 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; | |
5824 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); | |
5825 BYTE2(pActors[v343].uAttributes) |= 8u; | |
5826 v672 = v1; | |
5827 v661 = &pActors[v343]; | |
5828 LABEL_165: | |
5829 v56 = pGame->GetStru6(); | |
5830 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5831 } | |
5832 goto LABEL_1056; | |
5833 case 49: | |
5834 v348 = v12 - 2; | |
5835 if ( !v348 ) | |
5836 goto LABEL_677; | |
5837 v349 = v348 - 1; | |
5838 if ( v349 ) | |
5839 { | |
5840 if ( v349 == 1 ) | |
5841 { | |
5842 amount = v1; | |
5843 goto LABEL_679; | |
5844 } | |
5845 LABEL_677: | |
5846 v350 = 3600 * v2; | |
5847 } | |
5848 else | |
5849 { | |
5850 v350 = 86400 * v2; | |
5851 } | |
5852 amount = v350; | |
5853 LABEL_679: | |
5854 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5855 goto LABEL_83; | |
5856 v351 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5857 if ( !v351->pConditions[0] ) | |
5858 goto LABEL_1056; | |
5859 if ( v731 == 4 ) | |
5860 { | |
5861 LODWORD(v351->pConditions[0]) = v1; | |
5862 HIDWORD(v351->pConditions[0]) = v1; | |
5863 goto LABEL_904; | |
5864 } | |
5865 v732 = amount << 7; | |
5866 v351->DiscardConditionIfLastsLongerThan( | |
5867 v1, | |
5868 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
5869 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5870 goto LABEL_1056; | |
5871 v674 = v3->uPlayerID_2; | |
5872 goto LABEL_685; | |
5873 case 50: | |
5874 v354 = v12 - 2; | |
5875 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5876 v356 = 900 * (v2 + 4); | |
5877 else | |
5878 v356 = 300 * (v2 + 12); | |
5879 LODWORD(v733) = v356; | |
5880 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5881 goto LABEL_83; | |
5882 if ( v731 == 1 || v731 == 2 ) | |
5883 { | |
5884 v361 = v3->uPlayerID_2; | |
5885 v362 = v3->spellnum; | |
5886 v363 = pGame->GetStru6(); | |
5887 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); | |
5888 v668 = v1; | |
5889 v732 = (int)v733 << 7; | |
5890 v658 = v1; | |
5891 v653 = v1; | |
5892 v651 = v731; | |
5893 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5894 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; | |
5895 goto LABEL_103; | |
5896 } | |
5897 a2 = v1; | |
5898 v732 = (int)v733 << 7; | |
5899 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5900 v357 = &pParty->pPlayers[0].pPlayerBuffs[11]; | |
5901 do | |
5902 { | |
5903 v358 = a2; | |
5904 v359 = v3->spellnum; | |
5905 v360 = pGame->GetStru6(); | |
5906 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); | |
5907 v357->Apply(pParty->uTimePlayed + v717, v731, v1, v1, v1); | |
5908 ++a2; | |
5909 v357 = (SpellBuff *)((char *)v357 + 6972); | |
5910 } | |
5911 while ( (signed int)v357 < (signed int)&pParty->field_871C[508] ); | |
5912 goto LABEL_1056; | |
5913 case 48: | |
5914 v364 = v12 - 2; | |
5915 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5916 v366 = 60 * (v2 + 3); | |
5917 else | |
5918 v366 = 300 * v2 + 180; | |
5919 LODWORD(v733) = v366; | |
5920 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5921 goto LABEL_83; | |
5922 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
5923 v367 = pGame->GetStru6(); | |
5924 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | |
5925 ++a1.uItemType; | |
5926 a1.stru_24.Reset(); | |
5927 a1.field_48 = v3->spellnum; | |
5928 a1.field_4C = v2; | |
5929 a1.field_50 = v731; | |
5930 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5931 a1.uAttributes = v1; | |
5932 a1.uSectorID = v1; | |
5933 a1.uSpriteFrameID = v1; | |
5934 v368 = v3->uPlayerID; | |
5935 a1.field_60_distance_related_prolly_lod = 0; | |
5936 a1.uFacing = v1; | |
5937 v368 *= 8; | |
5938 LOBYTE(v368) = v368 | 4; | |
5939 a1.field_58 = v368; | |
5940 a1.uSoundID = LOWORD(v3->field_10); | |
5941 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
5942 { | |
5943 v369 = &pActors[dword_50BF30[a2]]; | |
5944 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5945 { | |
5946 a1.vPosition.x = v369->vPosition.x; | |
5947 a1.vPosition.y = v369->vPosition.y; | |
5948 v732 = v369->uActorHeight; | |
5949 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5950 v370 = 8 * dword_50BF30[a2]; | |
5951 LOBYTE(v370) = v370 | 3; | |
5952 a1.field_5C = v370; | |
5953 a1.Create(0, v1, v1, v1); | |
5954 v732 = (int)v733 << 7; | |
5955 v369->pActorBuffs[4].Apply( | |
5956 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
5957 v731, | |
5958 v1, | |
5959 v1, | |
5960 v1); | |
5961 } | |
5962 } | |
5963 goto LABEL_1056; | |
5964 case 53: | |
5965 v371 = v12 - 2; | |
5966 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
5967 amount = v1; | |
5968 else | |
5969 amount = 86400 * v2; | |
5970 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5971 goto LABEL_83; | |
5972 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, v1, 65536); | |
5973 v373 = v3->uPlayerID_2; | |
5974 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5975 goto LABEL_1056; | |
5976 v14 = v731 == 4; | |
5977 pParty->pPlayers[v373].sHealth = 1; | |
5978 if ( v14 ) | |
5979 { | |
5980 v374 = v3->uPlayerID_2; | |
5981 v375 = (char *)pParty->pPlayers; | |
5982 LODWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5983 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5984 v376 = v3->uPlayerID_2; | |
5985 LODWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5986 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5987 } | |
5988 else | |
5989 { | |
5990 v732 = amount << 7; | |
5991 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5992 v375 = (char *)pParty->pPlayers; | |
5993 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5994 0xEu, | |
5995 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5996 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5997 0xDu, | |
5998 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5999 } | |
6000 v377 = (Player *)&v375[6972 * v3->uPlayerID_2]; | |
6001 goto LABEL_720; | |
6002 case 54: | |
6003 v378 = v12 - 2; | |
6004 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
6005 v380 = 4 * v2; | |
6006 else | |
6007 v380 = 3 * v2; | |
6008 amount = v380; | |
6009 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6010 goto LABEL_83; | |
6011 v381 = 0; | |
6012 HIDWORD(v733) = amount; | |
6013 v730 = 0; | |
6014 v382 = 1; | |
6015 do | |
6016 { | |
6017 v383 = pPlayers[v382]; | |
6018 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
6019 v682[v381++] = v382; | |
6020 ++v382; | |
6021 } | |
6022 while ( v382 <= 4 ); | |
6023 v384 = 0; | |
6024 v730 = v381; | |
6025 if ( v381 > v1 ) | |
6026 { | |
6027 do | |
6028 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
6029 while ( v384 < v381 ); | |
6030 } | |
6031 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
6032 HIDWORD(v733) = v1; | |
6033 if ( v381 > v1 ) | |
6034 { | |
6035 do | |
6036 { | |
6037 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
6038 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
6039 v726 = *(Player **)v385; | |
6040 v386 = v726->GetMaxHealth(); | |
6041 if ( v726->sHealth > v386 ) | |
6042 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
6043 v387 = *(Player **)v385; | |
6044 if ( v387->sHealth > v1 ) | |
6045 { | |
6046 LODWORD(v387->pConditions[13]) = v1; | |
6047 HIDWORD(v387->pConditions[13]) = v1; | |
6048 } | |
6049 v388 = HIDWORD(v733); | |
6050 v389 = LOWORD(v682[HIDWORD(v733)]) - 1; | |
6051 v390 = v3->spellnum; | |
6052 v391 = pGame->GetStru6(); | |
6053 pGame->GetStru6()->SetPlayerBuffAnim(v390, v389); | |
6054 HIDWORD(v733) = v388 + 1; | |
6055 } | |
6056 while ( v388 + 1 < v730 ); | |
6057 } | |
6058 goto LABEL_1056; | |
6059 case 55: | |
6060 v392 = v12 - 1; | |
6061 if ( !v392 ) | |
6062 { | |
6063 v395 = 180 * v2; | |
6064 goto LABEL_750; | |
6065 } | |
6066 v393 = v392 - 1; | |
6067 if ( !v393 ) | |
6068 { | |
6069 v395 = 10800 * v2; | |
6070 goto LABEL_750; | |
6071 } | |
6072 v394 = v393 - 1; | |
6073 if ( !v394 ) | |
6074 { | |
6075 v395 = 259200 * v2; | |
6076 LABEL_750: | |
6077 amount = v395; | |
6078 goto LABEL_751; | |
6079 } | |
6080 if ( v394 == 1 ) | |
6081 amount = v1; | |
6082 LABEL_751: | |
6083 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6084 goto LABEL_83; | |
6085 v396 = v3->uPlayerID_2; | |
6086 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
6087 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
6088 { | |
6089 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
6090 pParty->pPlayers[v396].PlaySound(25, v1); | |
6091 if ( v731 == 4 ) | |
6092 { | |
6093 v397 = v3->uPlayerID_2; | |
6094 LODWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6095 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6096 v398 = v3->uPlayerID_2; | |
6097 LODWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6098 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6099 v399 = v3->uPlayerID_2; | |
6100 LODWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6101 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6102 v400 = (char *)pParty->pPlayers; | |
6103 } | |
6104 else | |
6105 { | |
6106 v732 = amount << 7; | |
6107 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6108 v400 = (char *)pParty->pPlayers; | |
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; | |
6120 ((Player *)&v400[6972 * v3->uPlayerID_2])->SetCondition(1u, 1); | |
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; | |
6214 if ( a2 == v1 || (a2 & 7) != 3 ) | |
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; | |
6306 if ( (a2 & 7) != 3 ) | |
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; | |
6334 if ( (a2 & 7) != 3 ) | |
6335 goto LABEL_1056; | |
6336 v730 = 836 * v427; | |
6337 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6338 goto LABEL_83; | |
90 | 6339 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6340 { | |
6341 pActors[v427].pActorBuffs[9].Reset(); | |
6342 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6343 v732 = amount << 7; |
90 | 6344 pActors[v427].pActorBuffs[12].Apply( |
0 | 6345 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6346 v731, | |
6347 v1, | |
6348 v1, | |
6349 v1); | |
6350 } | |
6351 a1.stru_24.Reset(); | |
6352 a1.field_48 = v3->spellnum; | |
6353 a1.field_4C = v2; | |
6354 a1.field_50 = v731; | |
6355 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6356 v61 = v427; |
0 | 6357 goto LABEL_1086; |
6358 case 63: | |
6359 v428 = v12 - 2; | |
6360 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6361 v430 = 300 * v2; | |
6362 else | |
6363 v430 = 180 * v2; | |
6364 amount = v430; | |
6365 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6366 goto LABEL_83; | |
6367 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6368 v431 = pGame->GetStru6(); | |
6369 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | |
6370 ++a1.uItemType; | |
6371 a1.stru_24.Reset(); | |
6372 a1.field_48 = v3->spellnum; | |
6373 a1.field_4C = v2; | |
6374 a1.field_50 = v731; | |
6375 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6376 a1.uAttributes = v1; | |
6377 a1.uSectorID = v1; | |
6378 a1.uSpriteFrameID = v1; | |
6379 v432 = v3->uPlayerID; | |
6380 a1.field_60_distance_related_prolly_lod = 0; | |
6381 a1.uFacing = v1; | |
6382 v432 *= 8; | |
6383 LOBYTE(v432) = v432 | 4; | |
6384 a1.field_58 = v432; | |
6385 a1.uSoundID = LOWORD(v3->field_10); | |
6386 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
6387 { | |
6388 v433 = &pActors[dword_50BF30[a2]]; | |
6389 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6390 break; | |
6391 a1.vPosition.x = v433->vPosition.x; | |
6392 a1.vPosition.y = v433->vPosition.y; | |
6393 v732 = v433->uActorHeight; | |
6394 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6395 v434 = 8 * dword_50BF30[a2]; | |
6396 LOBYTE(v434) = v434 | 3; | |
6397 a1.field_5C = v434; | |
6398 a1.Create(0, v1, v1, v1); | |
6399 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) | |
6400 { | |
6401 v732 = amount << 7; | |
6402 v433->pActorBuffs[4].Apply( | |
6403 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
6404 v731, | |
6405 v1, | |
6406 v1, | |
6407 v1); | |
6408 } | |
6409 } | |
6410 goto LABEL_1056; | |
6411 case 64: | |
6412 v435 = v12 - 2; | |
6413 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
6414 amount = v1; | |
6415 else | |
6416 amount = 86400 * v2; | |
6417 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6418 goto LABEL_83; | |
6419 v437 = v3->uPlayerID_2; | |
6420 v438 = v3->spellnum; | |
6421 v439 = pGame->GetStru6(); | |
6422 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); | |
6423 v440 = v3->uPlayerID_2; | |
6424 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6425 { | |
6426 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
6427 pParty->pPlayers[v440].PlaySound(25, v1); | |
6428 if ( v731 == 4 ) | |
6429 { | |
6430 v441 = v3->uPlayerID_2; | |
6431 LODWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6432 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6433 } | |
6434 else | |
6435 { | |
6436 v732 = amount << 7; | |
6437 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6438 5u, | |
6439 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6440 } | |
6441 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6442 LABEL_720: | |
6443 v377->SetCondition(1u, v1); | |
6444 } | |
6445 goto LABEL_1056; | |
6446 case 42: | |
6447 v442 = v12 - 2; | |
6448 if ( !v442 ) | |
6449 goto LABEL_855; | |
6450 v443 = v442 - 1; | |
6451 if ( v443 ) | |
6452 { | |
6453 if ( v443 == 1 ) | |
6454 v444 = 4 * v2; | |
6455 else | |
6456 LABEL_855: | |
6457 v444 = 2 * v2; | |
6458 } | |
6459 else | |
6460 { | |
6461 v444 = 3 * v2; | |
6462 } | |
6463 amount = v444; | |
6464 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6465 goto LABEL_83; | |
6466 v445 = a2 >> 3; | |
6467 if ( (a2 & 7) == 2 ) | |
6468 { | |
6469 v449 = (char *)&pLayingItems[v445].stru_24; | |
6470 v450 = *(int *)v449; | |
6471 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6472 { | |
6473 party_finds_gold(*((int *)v449 + 3), 0); | |
6474 viewparams->bRedrawGameUI = 1; | |
6475 } | |
6476 else | |
6477 { | |
6478 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); | |
6479 ShowStatusBarString(pTmpBuf2, 2u); | |
6480 if ( !pParty->AddItem(&pLayingItems[v445].stru_24) ) | |
6481 pParty->SetHoldingItem(&pLayingItems[v445].stru_24); | |
6482 } | |
6483 LayingItem::_42F933(v445); | |
6484 } | |
6485 else | |
6486 { | |
6487 if ( (a2 & 7) == 3 ) | |
6488 { | |
6489 stru_50C198.LootActor(&pActors[v445]); | |
6490 } | |
6491 else | |
6492 { | |
6493 if ( (a2 & 7) != 5 ) | |
6494 { | |
6495 if ( (a2 & 7) != 6 ) | |
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 { | |
6610 if ( (v460 & 7) == 3 ) | |
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 v473 = (char *)pParty->pPlayers; | |
6683 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6684 8u, | |
6685 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6686 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6687 v656 = 10; | |
6688 goto LABEL_937; | |
6689 case 75: | |
6690 amount = v2; | |
6691 LODWORD(v733) = 3600 * v2; | |
6692 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6693 goto LABEL_83; | |
6694 v474 = v3->spellnum; | |
6695 v475 = pGame->GetStru6(); | |
6696 pGame->GetStru6()->SetPlayerBuffAnim(v474, v1); | |
6697 v476 = v3->spellnum; | |
6698 v477 = pGame->GetStru6(); | |
6699 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1u); | |
6700 v478 = v3->spellnum; | |
6701 v479 = pGame->GetStru6(); | |
6702 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2u); | |
6703 v480 = v3->spellnum; | |
6704 v481 = pGame->GetStru6(); | |
6705 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3u); | |
6706 v668 = v1; | |
6707 v732 = (int)v733 << 7; | |
6708 v658 = v1; | |
6709 v653 = v2; | |
6710 v651 = v731; | |
6711 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6712 v27 = (char *)&pParty->pPartyBuffs[13]; | |
6713 goto LABEL_101; | |
6714 case 73: | |
6715 LODWORD(v733) = 3600 * v2; | |
6716 amount = v2; | |
6717 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6718 goto LABEL_83; | |
6719 if ( v731 == 4 ) | |
6720 { | |
6721 v482 = v3->spellnum; | |
6722 v483 = pGame->GetStru6(); | |
6723 pGame->GetStru6()->SetPlayerBuffAnim(v482, v1); | |
6724 v484 = v3->spellnum; | |
6725 v485 = pGame->GetStru6(); | |
6726 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1u); | |
6727 v486 = v3->spellnum; | |
6728 v487 = pGame->GetStru6(); | |
6729 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2u); | |
6730 v488 = v3->spellnum; | |
6731 v489 = pGame->GetStru6(); | |
6732 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3u); | |
6733 v732 = (int)v733 << 7; | |
6734 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6735 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6736 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6737 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6738 v668 = v1; | |
6739 v658 = v2; | |
6740 v653 = v2; | |
6741 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; | |
6742 v651 = 4; | |
6743 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; | |
6744 v27 = (char *)&pParty->pPlayers[3].pPlayerBuffs[6]; | |
6745 goto LABEL_104; | |
6746 } | |
6747 v490 = v3->uPlayerID_2; | |
6748 v491 = v3->spellnum; | |
6749 v492 = pGame->GetStru6(); | |
6750 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); | |
6751 v668 = v1; | |
6752 v732 = (int)v733 << 7; | |
6753 v658 = v2; | |
6754 v653 = v2; | |
6755 v651 = v731; | |
6756 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6757 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; | |
6758 goto LABEL_103; | |
6759 case 74: | |
6760 v493 = v12 - 2; | |
6761 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
6762 amount = v1; | |
6763 else | |
6764 amount = 86400 * v2; | |
6765 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6766 goto LABEL_83; | |
6767 v495 = v3->uPlayerID_2; | |
6768 v496 = v3->spellnum; | |
6769 v497 = pGame->GetStru6(); | |
6770 pGame->GetStru6()->SetPlayerBuffAnim(v496, v495); | |
6771 v498 = v3->uPlayerID_2; | |
6772 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6773 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6774 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6775 goto LABEL_1056; | |
6776 if ( v731 == 4 ) | |
6777 { | |
6778 LODWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6779 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6780 v499 = v3->uPlayerID_2; | |
6781 LODWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6782 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6783 v500 = v3->uPlayerID_2; | |
6784 LODWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6785 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6786 } | |
6787 else | |
6788 { | |
6789 v732 = amount << 7; | |
6790 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6791 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6792 7u, | |
6793 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6794 v473 = (char *)pParty->pPlayers; | |
6795 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6796 9u, | |
6797 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6798 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6799 v656 = 11; | |
6800 LABEL_937: | |
6801 v325 = (Player *)&v473[6972 * v3->uPlayerID_2]; | |
6802 LABEL_641: | |
6803 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6804 } | |
6805 goto LABEL_1056; | |
6806 case 77: | |
6807 amount = 5 * v2 + 10; | |
6808 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6809 goto LABEL_83; | |
6810 v501 = pParty->pPlayers; | |
6811 do | |
6812 { | |
6813 v502 = v3->spellnum; | |
6814 v503 = pGame->GetStru6(); | |
6815 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); | |
6816 v501->Heal(amount); | |
6817 ++v501; | |
6818 ++v1; | |
6819 } | |
6820 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6821 goto LABEL_1056; | |
6822 case 80: | |
6823 sRecoveryTime -= v2; | |
6824 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6825 goto LABEL_83; | |
6826 v504 = pGame->GetStru6(); | |
6827 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); | |
6828 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6829 ++a1.uItemType; | |
6830 HIDWORD(v733) = v505; | |
6831 v690 = v1; | |
6832 v689 = v1; | |
6833 v688 = v1; | |
6834 a1.stru_24.Reset(); | |
6835 a1.field_48 = v3->spellnum; | |
6836 a1.field_4C = v2; | |
6837 a1.field_50 = v731; | |
6838 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6839 a1.uAttributes = v1; | |
6840 a1.uSectorID = v1; | |
6841 a1.uSpriteFrameID = v1; | |
6842 v506 = v3->uPlayerID; | |
6843 a1.field_60_distance_related_prolly_lod = 0; | |
6844 a1.uFacing = v1; | |
6845 v506 *= 8; | |
6846 LOBYTE(v506) = v506 | 4; | |
6847 a1.field_58 = v506; | |
6848 a1.uSoundID = LOWORD(v3->field_10); | |
6849 a2 = v1; | |
6850 if ( SHIDWORD(v733) > v1 ) | |
6851 { | |
6852 do | |
6853 { | |
6854 v507 = dword_50BF30[a2]; | |
6855 a1.vPosition.x = pActors[v507].vPosition.x; | |
6856 a1.vPosition.y = pActors[v507].vPosition.y; | |
6857 v732 = pActors[v507].uActorHeight; | |
6858 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6859 v508 = 8 * dword_50BF30[a2]; | |
6860 LOBYTE(v508) = v508 | 3; | |
6861 a1.field_5C = v508; | |
6862 v509 = a1.Create(0, v1, v1, v1); | |
6863 v510 = a2; | |
6864 DamageMonsterFromParty(8 * v509 | 2, dword_50BF30[a2], (Vec3_int_ *)&v688); | |
6865 a2 = v510 + 1; | |
6866 } | |
6867 while ( v510 + 1 < SHIDWORD(v733) ); | |
6868 } | |
6869 for ( a2 = v1; a2 < SHIDWORD(v733); ++a2 ) | |
6870 { | |
6871 v511 = &pActors[dword_50BF30[a2]]; | |
6872 a1.vPosition.x = v511->vPosition.x; | |
6873 a1.vPosition.y = v511->vPosition.y; | |
6874 v732 = v511->uActorHeight; | |
6875 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6876 v512 = 8 * dword_50BF30[a2]; | |
6877 LOBYTE(v512) = v512 | 3; | |
6878 a1.field_5C = v512; | |
6879 a1.Create(0, v1, v1, v1); | |
6880 v513 = v511->pActorBuffs; | |
6881 v726 = (Player *)22; | |
6882 do | |
6883 { | |
6884 v513->Reset(); | |
6885 ++v513; | |
6886 v726 = (Player *)((char *)v726 - 1); | |
6887 } | |
6888 while ( *(float *)&v726 != 0.0 ); | |
6889 } | |
6890 goto LABEL_1056; | |
6891 case 82: | |
6892 v514 = v12 - 2; | |
6893 if ( !v514 ) | |
6894 goto LABEL_955; | |
6895 v515 = v514 - 1; | |
6896 if ( v515 ) | |
6897 { | |
6898 if ( v515 == 1 ) | |
6899 { | |
6900 v516 = 900 * v2; | |
6901 amount = 5; | |
6902 } | |
6903 else | |
6904 { | |
6905 LABEL_955: | |
6906 v516 = 300 * v2; | |
6907 amount = 1; | |
6908 } | |
6909 } | |
6910 else | |
6911 { | |
6912 v516 = 900 * v2; | |
6913 amount = 3; | |
6914 } | |
6915 v733 = __PAIR__(v1, v516); | |
6916 v517 = 8 * v3->uPlayerID; | |
6917 LOBYTE(v517) = v517 | 4; | |
6918 if ( (signed int)uNumActors > v1 ) | |
6919 { | |
90 | 6920 v518 = pActors;//[0].uAIState; |
6921 v726b = uNumActors; | |
0 | 6922 do |
6923 { | |
90 | 6924 v519 = v518->uAIState; |
6925 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6926 ++HIDWORD(v733); |
90 | 6927 ++v518; |
6928 --v726; | |
0 | 6929 } |
90 | 6930 while ( v726 != 0 ); |
0 | 6931 } |
6932 if ( SHIDWORD(v733) >= amount ) | |
6933 { | |
6934 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6935 goto LABEL_201; | |
6936 } | |
6937 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6938 goto LABEL_83; | |
6939 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); | |
6940 goto LABEL_1056; | |
6941 case 83: | |
6942 v520 = v12 - 2; | |
6943 if ( !v520 ) | |
6944 goto LABEL_973; | |
6945 v521 = v520 - 1; | |
6946 if ( v521 ) | |
6947 { | |
6948 if ( v521 == 1 ) | |
6949 { | |
6950 LODWORD(v733) = 18000 * v2; | |
6951 v522 = 5 * v2 + 10; | |
6952 } | |
6953 else | |
6954 { | |
6955 LABEL_973: | |
6956 LODWORD(v733) = 10800 * v2; | |
6957 v522 = 3 * v2 + 10; | |
6958 } | |
6959 } | |
6960 else | |
6961 { | |
6962 LODWORD(v733) = 14400 * v2; | |
6963 v522 = 4 * v2 + 10; | |
6964 } | |
6965 amount = v522; | |
6966 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6967 goto LABEL_83; | |
6968 v523 = v3->spellnum; | |
6969 v524 = pGame->GetStru6(); | |
6970 pGame->GetStru6()->SetPlayerBuffAnim(v523, v1); | |
6971 v83 = 1; | |
6972 v525 = v3->spellnum; | |
6973 v526 = pGame->GetStru6(); | |
6974 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1u); | |
6975 v527 = v3->spellnum; | |
6976 v528 = pGame->GetStru6(); | |
6977 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2u); | |
6978 v529 = v3->spellnum; | |
6979 v530 = pGame->GetStru6(); | |
6980 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3u); | |
6981 v673 = v1; | |
6982 v732 = (int)v733 << 7; | |
6983 v662 = v1; | |
6984 v655 = amount; | |
6985 v652 = v731; | |
6986 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6987 v137 = (char *)&pParty->pPartyBuffs[2]; | |
6988 goto LABEL_976; | |
6989 case 84: | |
6990 v67 = 2; | |
6991 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6992 { | |
6993 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6994 goto LABEL_202; | |
6995 } | |
6996 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6997 goto LABEL_83; | |
6998 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6999 ++a1.uItemType; | |
7000 v726 = (Player *)v531; | |
7001 v696 = v1; | |
7002 v695 = v1; | |
7003 v694 = v1; | |
7004 a1.stru_24.Reset(); | |
7005 a1.field_48 = v3->spellnum; | |
7006 a1.field_4C = v2; | |
7007 a1.field_50 = v731; | |
7008 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7009 a1.uAttributes = v1; | |
7010 a1.uSectorID = v1; | |
7011 a1.uSpriteFrameID = v1; | |
7012 v532 = v3->uPlayerID; | |
7013 a1.field_60_distance_related_prolly_lod = 0; | |
7014 a1.uFacing = v1; | |
7015 v532 *= 8; | |
7016 LOBYTE(v532) = v532 | 4; | |
7017 a1.field_58 = v532; | |
7018 a1.uSoundID = LOWORD(v3->field_10); | |
7019 a2 = v1; | |
7020 if ( (signed int)v726 > v1 ) | |
7021 { | |
7022 do | |
7023 { | |
7024 v533 = dword_50BF30[a2]; | |
7025 a1.vPosition.x = pActors[v533].vPosition.x; | |
7026 a1.vPosition.y = pActors[v533].vPosition.y; | |
7027 v732 = pActors[v533].uActorHeight; | |
7028 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7029 v534 = 8 * dword_50BF30[a2]; | |
7030 LOBYTE(v534) = v534 | 3; | |
7031 a1.field_5C = v534; | |
7032 v535 = a1.Create(0, v1, v1, v1); | |
7033 v536 = a2; | |
7034 DamageMonsterFromParty(8 * v535 | 2, dword_50BF30[a2], (Vec3_int_ *)&v694); | |
7035 a2 = v536 + 1; | |
7036 } | |
7037 while ( v536 + 1 < (signed int)v726 ); | |
7038 } | |
7039 v537 = pGame->GetStru6(); | |
7040 pGame->GetStru6()->_4A8BFC(); | |
7041 goto LABEL_1056; | |
7042 case 85: | |
7043 v538 = v12 - 2; | |
7044 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
7045 { | |
7046 amount = 5 * v2; | |
7047 v540 = 18000 * v2; | |
7048 } | |
7049 else | |
7050 { | |
7051 amount = 4 * v2; | |
7052 v540 = 14400 * v2; | |
7053 } | |
7054 v730 = v540; | |
7055 LODWORD(v733) = v540; | |
7056 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7057 goto LABEL_83; | |
7058 v541 = v3->spellnum; | |
7059 v542 = pGame->GetStru6(); | |
7060 pGame->GetStru6()->SetPlayerBuffAnim(v541, v1); | |
7061 v543 = v3->spellnum; | |
7062 v544 = pGame->GetStru6(); | |
7063 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1u); | |
7064 v545 = v3->spellnum; | |
7065 v546 = pGame->GetStru6(); | |
7066 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2u); | |
7067 v547 = v3->spellnum; | |
7068 v548 = pGame->GetStru6(); | |
7069 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3u); | |
7070 v732 = v730 << 7; | |
7071 v549 = (double)(v730 << 7) * 0.033333335; | |
7072 *((float *)&v733 + 1) = v549; | |
7073 v712 = (signed __int64)v549; | |
7074 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, v1, v1); | |
7075 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7076 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7077 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7078 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7079 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7080 v550 = v2 + 5; | |
7081 pParty->pPartyBuffs[ 5].Apply( | |
7082 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7083 v731, | |
7084 v550, | |
7085 v1, | |
7086 v1); | |
7087 v668 = v1; | |
7088 v658 = v1; | |
7089 v653 = v550; | |
7090 v651 = v731; | |
7091 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); | |
7092 LABEL_992: | |
7093 v27 = (char *)&pParty->pPartyBuffs[19]; | |
7094 goto LABEL_103; | |
7095 case 86: | |
7096 v551 = v12 - 2; | |
7097 if ( !v551 ) | |
7098 goto LABEL_998; | |
7099 v552 = v551 - 1; | |
7100 if ( v552 ) | |
7101 { | |
7102 if ( v552 == 1 ) | |
7103 { | |
7104 amount = 15; | |
7105 HIDWORD(v733) = 20; | |
7106 goto LABEL_1000; | |
7107 } | |
7108 LABEL_998: | |
7109 v678 = 4; | |
7110 } | |
7111 else | |
7112 { | |
7113 v678 = 12; | |
7114 } | |
7115 amount = v678; | |
7116 HIDWORD(v733) = v678; | |
7117 LABEL_1000: | |
7118 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7119 goto LABEL_83; | |
7120 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); | |
7121 v732 = (300 * amount * v2 + 60) << 7; | |
7122 v730 = v2 + 5; | |
7123 v726 = (Player *)v1; | |
89 | 7124 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 7125 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
7126 do | |
7127 { | |
7128 v554 = v3->spellnum; | |
7129 v555 = pGame->GetStru6(); | |
7130 pGame->GetStru6()->SetPlayerBuffAnim(v554, v1); | |
7131 v556 = v3->spellnum; | |
7132 v557 = pGame->GetStru6(); | |
7133 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1u); | |
7134 v558 = v3->spellnum; | |
7135 v559 = pGame->GetStru6(); | |
7136 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2u); | |
7137 v560 = v3->spellnum; | |
7138 v561 = pGame->GetStru6(); | |
7139 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3u); | |
89 | 7140 //((SpellBuff *)(v553 + 6056))->Apply( |
7141 v553->pPlayerBuffs[4].Apply( | |
0 | 7142 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7143 v731, | |
7144 v730, | |
7145 v1, | |
7146 v1); | |
7147 if ( *(_QWORD *)v553 ) | |
7148 v726 = (Player *)1; | |
89 | 7149 ++v553; |
7150 } | |
7151 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 7152 v562 = v731; |
7153 pParty->pPartyBuffs[9].Apply( | |
7154 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7155 v731, | |
7156 v730, | |
7157 v1, | |
7158 v1); | |
7159 pParty->pPartyBuffs[14].Apply( | |
7160 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7161 v562, | |
7162 v1, | |
7163 v1, | |
7164 v1); | |
7165 pParty->pPartyBuffs[15].Apply( | |
7166 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7167 v562, | |
7168 v730, | |
7169 v1, | |
7170 v1); | |
7171 if ( v726 != (Player *)v1 ) | |
7172 goto LABEL_1056; | |
7173 v668 = v1; | |
7174 v732 = (int)y << 7; | |
7175 v658 = v1; | |
7176 v653 = v730; | |
7177 v651 = v562; | |
7178 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 | |
7179 + (double)(signed __int64)pParty->uTimePlayed); | |
7180 v27 = (char *)&pParty->pPartyBuffs[8]; | |
7181 goto LABEL_103; | |
7182 case 88: | |
7183 amount = 3; | |
7184 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
7185 goto LABEL_200; | |
7186 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7187 goto LABEL_83; | |
7188 a2 = v1; | |
7189 _this = (ItemGen *)&pPlayers[1]; | |
7190 do | |
7191 { | |
7192 v563 = 0; | |
7193 do | |
7194 { | |
7195 v564 = _this->uItemID; | |
7196 *(int *)(v563 + _this->uItemID) = v1; | |
7197 v563 += 8; | |
7198 *(int *)(v563 + v564 - 4) = v1; | |
7199 } | |
7200 while ( v563 <= 128 ); | |
7201 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
7202 v566 = (Player **)_this; | |
7203 *(int *)(_this->uItemID + 6460) = v565; | |
7204 v567 = (*v566)->GetMaxMana(); | |
7205 v568 = a2; | |
7206 *(int *)(_this->uItemID + 6464) = v567; | |
7207 v569 = v3->spellnum; | |
7208 v570 = pGame->GetStru6(); | |
7209 pGame->GetStru6()->SetPlayerBuffAnim(v569, v568); | |
7210 ++a2; | |
7211 _this = (ItemGen *)((char *)_this + 4); | |
7212 } | |
7213 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
7214 v571 = pPlayer; | |
7215 v572 = (char *)&pPlayer->sAgeModifier; | |
7216 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
7217 *(short *)v572 = 120; | |
7218 else | |
7219 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
7220 sRecoveryTime += -5 * v2; | |
7221 ++v571->uNumDivineInterventionCastsThisDay; | |
7222 goto LABEL_1056; | |
7223 case 89: | |
7224 v573 = v12 - 2; | |
7225 if ( v573 ) | |
7226 { | |
7227 v574 = v573 - 1; | |
7228 if ( v574 ) | |
7229 { | |
7230 if ( v574 == 1 ) | |
7231 v575 = 5 * v2; | |
7232 else | |
7233 v575 = 2 * v2; | |
7234 } | |
7235 else | |
7236 { | |
7237 v575 = 4 * v2; | |
7238 } | |
7239 } | |
7240 else | |
7241 { | |
7242 v575 = 3 * v2; | |
7243 } | |
7244 amount = v575; | |
7245 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7246 goto LABEL_83; | |
7247 v576 = *(int *)&v3->field_C; | |
7248 if ( v576 == v1 ) | |
7249 { | |
7250 v583 = v3->uPlayerID_2; | |
7251 v584 = v3->spellnum; | |
7252 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
7253 v586 = pGame->GetStru6(); | |
7254 pGame->GetStru6()->SetPlayerBuffAnim(v584, v583); | |
7255 if ( *((_QWORD *)v585 + 14) ) | |
7256 { | |
7257 ((Player *)v585)->SetCondition(0x11u, 1); | |
7258 v587 = ((Player *)v585)->GetSexByVoice(); | |
7259 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7260 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7261 } | |
7262 goto LABEL_83; | |
7263 } | |
7264 v577 = (Player *)(v576 >> 3); | |
7265 v726 = v577; | |
7266 if ( v577 == (Player *)-1 ) | |
7267 { | |
7268 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7269 goto LABEL_201; | |
7270 } | |
7271 v578 = (int)&pActors[(int)v577]; | |
7272 v721 = v578; | |
7273 if ( *(short *)(v578 + 40) > (signed __int16)v1 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) | |
7274 goto LABEL_200; | |
7275 ++a1.uItemType; | |
7276 a1.stru_24.Reset(); | |
7277 a1.field_48 = v3->spellnum; | |
7278 a1.field_4C = v2; | |
7279 a1.field_50 = v731; | |
7280 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7281 a1.uAttributes = v1; | |
7282 a1.uSectorID = v1; | |
7283 a1.uSpriteFrameID = v1; | |
7284 v580 = v3->uPlayerID; | |
7285 a1.field_60_distance_related_prolly_lod = 0; | |
7286 v581 = v721; | |
7287 v580 *= 8; | |
7288 LOBYTE(v580) = v580 | 4; | |
7289 a1.uFacing = v1; | |
7290 a1.field_58 = v580; | |
7291 a1.uSoundID = LOWORD(v3->field_10); | |
7292 a1.vPosition.x = *(short *)(v721 + 142); | |
7293 a1.vPosition.y = *(short *)(v721 + 144); | |
7294 v732 = *(short *)(v721 + 138); | |
7295 v582 = 8 * (int)v726; | |
7296 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7297 LOBYTE(v582) = 8 * (char)v726 | 3; | |
7298 a1.field_5C = v582; | |
7299 a1.Create(0, v1, v1, v1); | |
7300 if ( *(char *)(v581 + 52) > amount ) | |
7301 goto LABEL_83; | |
7302 Actor::Resurrect((unsigned int)v726); | |
7303 *(char *)(v581 + 61) = 0; | |
7304 *(char *)(v581 + 53) = 0; | |
7305 *(char *)(v581 + 54) = 0; | |
7306 *(char *)(v581 + 55) = 0; | |
7307 *(char *)(v581 + 56) = 0; | |
7308 *(char *)(v581 + 57) = 0; | |
7309 *(int *)(v581 + 712) = 9999; | |
7310 *(char *)(v581 + 38) &= 0xF7u; | |
7311 *(int *)(v581 + 708) = v1; | |
7312 ((SpellBuff *)(v581 + 356))->Reset(); | |
7313 ((SpellBuff *)(v581 + 228))->Reset(); | |
7314 ((SpellBuff *)(v581 + 404))->Reset(); | |
7315 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7316 *(short *)(v581 + 40) = 10 * amount; | |
7317 goto LABEL_1056; | |
7318 case 91: | |
7319 v588 = v12 - 1; | |
7320 amount = 16; | |
7321 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7322 { | |
7323 if ( v590 == 1 ) | |
7324 LODWORD(v733) = v1; | |
7325 } | |
7326 else | |
7327 { | |
7328 LODWORD(v733) = 3600 * v2; | |
7329 } | |
7330 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7331 goto LABEL_83; | |
7332 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; | |
7333 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7334 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7335 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7336 || *(char *)(HIDWORD(v733) + 20) & 2 | |
7337 || *(int *)(HIDWORD(v733) + 12) != v1 | |
7338 || *(int *)(HIDWORD(v733) + 4) != v1 | |
7339 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 | |
7340 || pItemsTable->_456D5E_is_some_material((ItemGen *)HIDWORD(v733)) ) | |
7341 goto LABEL_199; | |
7342 v592 = HIDWORD(v733); | |
7343 v14 = v731 == 4; | |
7344 *(int *)(HIDWORD(v733) + 12) = 16; | |
7345 if ( !v14 ) | |
7346 { | |
7347 v732 = (int)v733 << 7; | |
7348 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7349 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7350 *(int *)(v592 + 20) |= 8u; | |
7351 } | |
7352 *(char *)(v592 + 20) |= 0x80u; | |
7353 goto LABEL_1055; | |
7354 case 93: | |
7355 v593 = v12 - 2; | |
7356 if ( !v593 ) | |
7357 goto LABEL_1062; | |
7358 v594 = v593 - 1; | |
7359 if ( v594 ) | |
7360 { | |
7361 if ( v594 == 1 ) | |
7362 amount = 9; | |
7363 else | |
7364 LABEL_1062: | |
7365 amount = 5; | |
7366 } | |
7367 else | |
7368 { | |
7369 amount = 7; | |
7370 } | |
7371 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7372 goto LABEL_83; | |
7373 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
7374 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7375 a1.stru_24.Reset(); | |
7376 a1.field_48 = v3->spellnum; | |
7377 a1.field_4C = v2; | |
7378 a1.field_50 = v731; | |
7379 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7380 a1.vPosition.x = pParty->vPosition.x; | |
7381 a1.vPosition.y = pParty->vPosition.y; | |
7382 a1.uAttributes = v1; | |
7383 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
7384 a1.uSectorID = pIndoor->GetSector( | |
7385 pParty->vPosition.x, | |
7386 pParty->vPosition.y, | |
7387 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
7388 a1.uSpriteFrameID = v1; | |
7389 v595 = 8 * v3->uPlayerID; | |
7390 LOBYTE(v595) = v595 | 4; | |
7391 a1.field_58 = v595; | |
7392 a1.field_5C = a2; | |
7393 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7394 a1.uSoundID = LOWORD(v3->field_10); | |
7395 if ( pParty->bTurnBasedModeOn == 1 ) | |
7396 LOBYTE(a1.uAttributes) |= 4u; | |
7397 v596 = (signed int)v726 / -2; | |
7398 y = (char *)((signed int)v726 / 2); | |
7399 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7400 { | |
7401 v597 = v715.uYawAngle; | |
7402 do | |
7403 { | |
7404 a1.uFacing = v596 + v597; | |
7405 if ( a1.Create( | |
7406 v596 + v597, | |
7407 v715.uPitchAngle, | |
7408 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7409 v3->uPlayerID + 1) != -1 | |
7410 && pParty->bTurnBasedModeOn == 1 ) | |
7411 ++pTurnEngine->field_1C; | |
7412 v596 += v732; | |
7413 } | |
7414 while ( v596 <= (signed int)y ); | |
7415 } | |
7416 goto LABEL_1056; | |
7417 case 94: | |
7418 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7419 goto LABEL_83; | |
7420 if ( v731 == 1 || v731 == 2 ) | |
7421 { | |
7422 v598 = 180 * v2; | |
7423 goto LABEL_1081; | |
7424 } | |
7425 if ( v731 == 3 ) | |
7426 { | |
7427 v598 = 300 * v2; | |
7428 LABEL_1081: | |
7429 LODWORD(v733) = v598; | |
7430 goto LABEL_1082; | |
7431 } | |
7432 if ( v731 == 4 ) | |
7433 LODWORD(v733) = 29030400; | |
7434 LABEL_1082: | |
7435 v599 = a2 >> 3; | |
7436 if ( (a2 & 7) != 3 ) | |
7437 goto LABEL_1056; | |
7438 v730 = 836 * v599; | |
7439 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
7440 goto LABEL_83; | |
90 | 7441 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7442 goto LABEL_200; |
90 | 7443 pActors[v599].pActorBuffs[9].Reset(); |
7444 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7445 v732 = (int)v733 << 7; |
90 | 7446 pActors[v599].pActorBuffs[12].Apply( |
0 | 7447 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
7448 v731, | |
7449 v1, | |
7450 v1, | |
7451 v1); | |
7452 a1.stru_24.Reset(); | |
7453 a1.field_48 = v3->spellnum; | |
7454 a1.field_4C = v2; | |
7455 a1.field_50 = v731; | |
7456 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 7457 v61 = v599; |
0 | 7458 LABEL_1086: |
90 | 7459 v600 = pActors[v61].vPosition.y; |
7460 v601 = pActors[v61].vPosition.x; | |
0 | 7461 a1.uObjectDescID = v60; |
7462 a1.vPosition.x = v601; | |
90 | 7463 v602 = pActors[v61].uActorHeight; |
7464 v603 = pActors[v61].vPosition.z; | |
0 | 7465 a1.vPosition.y = v600; |
7466 v676 = v603 + v602; | |
7467 v665 = v600; | |
7468 a1.vPosition.z = v603 + v602; | |
7469 v657 = v601; | |
7470 LABEL_1087: | |
7471 a1.uAttributes = v1; | |
7472 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); | |
7473 a1.uSpriteFrameID = v1; | |
7474 v604 = 8 * v3->uPlayerID; | |
7475 LOBYTE(v604) = v604 | 4; | |
7476 a1.field_58 = v604; | |
7477 a1.field_5C = a2; | |
7478 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7479 a1.uFacing = LOWORD(v715.uYawAngle); | |
7480 LOWORD(v604) = LOWORD(v3->field_10); | |
7481 LOBYTE(a1.uAttributes) |= 0x80u; | |
7482 a1.uSoundID = v604; | |
7483 a1.Create(0, v1, v1, v3->uPlayerID + 1); | |
7484 goto LABEL_1056; | |
7485 case 96: | |
7486 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7487 goto LABEL_83; | |
7488 HIDWORD(v733) = v1; | |
7489 memset(&pStru179, v1, 0xFA0u); | |
7490 _this = (ItemGen *)v1; | |
7491 v605 = (char *)pParty->pHirelings; | |
7492 do | |
7493 { | |
7494 if ( *(int *)v605 != v1 ) | |
7495 { | |
7496 v606 = HIDWORD(v733)++; | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
79
diff
changeset
|
7497 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7498 } |
7499 _this = (ItemGen *)((char *)_this + 1); | |
7500 v605 += 76; | |
7501 } | |
7502 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
7503 _this = (ItemGen *)v1; | |
7504 if ( (signed int)pNPCStats->uNumNewNPCs > v1 ) | |
7505 { | |
7506 v730 = (int)pNPCStats->pNewNPCData; | |
7507 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7508 do | |
7509 { | |
7510 if ( *(char *)(v730 + 8) & 0x80 | |
7511 && (pParty->pHirelings[0].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) | |
7512 && (pParty->pHirelings[1].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
7513 { | |
7514 v607 = HIDWORD(v733); | |
7515 HIDWORD(v733) += 4; | |
7516 *(int *)v607 = (int)_this + 3; | |
7517 } | |
7518 _this = (ItemGen *)((char *)_this + 1); | |
7519 v730 += 76; | |
7520 } | |
7521 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7522 } | |
7523 v608 = v3->uPlayerID_2; | |
7524 if ( v608 != 4 && v608 != 5 | |
7525 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= v1) | |
7526 || v609 >= 3 ) | |
7527 goto LABEL_200; | |
7528 v610 = 76 * v609; | |
7529 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = v1; | |
7530 v611 = pIconsFrameTable->FindIcon("spell96"); | |
7531 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( | |
7532 v611); | |
7533 v232 = 1; | |
7534 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; | |
89 | 7535 v612 = pParty->pPlayers; |
0 | 7536 do |
7537 { | |
89 | 7538 v612->sHealth = v612->GetMaxHealth(); |
7539 v612->sMana = v612->GetMaxMana(); | |
7540 ++v612; | |
7541 } | |
7542 while ( v612 <= &pParty->pPlayers[3] ); | |
7543 v613 = &pOutdoor->ddm; | |
0 | 7544 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7545 v613 = &pIndoor->dlv; |
7546 v613->uReputation += 15; | |
7547 if ( v613->uReputation > 10000 ) | |
7548 v613->uReputation = 10000; | |
0 | 7549 LODWORD(v727) = v232; |
7550 goto LABEL_83; | |
7551 case 95: | |
7552 if ( v12 <= v1 ) | |
7553 goto LABEL_1119; | |
7554 if ( v12 <= 3 ) | |
7555 { | |
7556 v614 = 300 * (v2 + 12); | |
7557 } | |
7558 else | |
7559 { | |
7560 if ( v12 != 4 ) | |
7561 goto LABEL_1119; | |
7562 v614 = 900 * (v2 + 4); | |
7563 } | |
7564 LODWORD(v733) = v614; | |
7565 LABEL_1119: | |
7566 v615 = v2 + 5; | |
7567 amount = v615; | |
7568 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7569 goto LABEL_83; | |
7570 if ( v731 != 3 && v731 != 4 ) | |
7571 { | |
7572 v616 = v3->uPlayerID_2; | |
7573 v617 = v3->spellnum; | |
7574 v618 = pGame->GetStru6(); | |
7575 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); | |
7576 v668 = v1; | |
7577 v658 = v716; | |
7578 v732 = (int)v733 << 7; | |
7579 v653 = v615; | |
7580 v651 = v731; | |
7581 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7582 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; | |
7583 goto LABEL_103; | |
7584 } | |
7585 a2 = v1; | |
7586 v732 = (int)v733 << 7; | |
7587 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7588 v619 = &pParty->pPlayers[0].pPlayerBuffs[10]; | |
7589 do | |
7590 { | |
7591 v620 = a2; | |
7592 v621 = v3->spellnum; | |
7593 v622 = pGame->GetStru6(); | |
7594 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); | |
7595 v619->Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); | |
7596 ++a2; | |
7597 v619 = (SpellBuff *)((char *)v619 + 6972); | |
7598 } | |
7599 while ( (signed int)v619 < (signed int)&pParty->field_871C[504] ); | |
7600 goto LABEL_1056; | |
7601 case 99: | |
7602 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7603 goto LABEL_83; | |
7604 v726 = (Player *)v1; | |
7605 pGame->GetIndoorCamera(); | |
7606 v623 = (signed __int64)GetPickDepth(); | |
7607 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
7608 v709 = v1; | |
7609 v708 = v1; | |
7610 v707 = v1; | |
7611 a1.stru_24.Reset(); | |
7612 a1.field_48 = v3->spellnum; | |
7613 a1.field_4C = v2; | |
7614 a1.field_50 = v731; | |
7615 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7616 a1.uAttributes = v1; | |
7617 a1.uSectorID = v1; | |
7618 a1.uSpriteFrameID = v1; | |
7619 v624 = v3->uPlayerID; | |
7620 a1.field_60_distance_related_prolly_lod = 0; | |
7621 a1.uFacing = v1; | |
7622 v624 *= 8; | |
7623 LOBYTE(v624) = v624 | 4; | |
7624 a1.field_58 = v624; | |
7625 a1.uSoundID = LOWORD(v3->field_10); | |
7626 a2 = v1; | |
7627 if ( SHIDWORD(v733) > v1 ) | |
7628 { | |
7629 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7630 do | |
7631 { | |
7632 v625 = dword_50BF30[a2]; | |
7633 a1.vPosition.x = pActors[v625].vPosition.x; | |
7634 a1.vPosition.y = pActors[v625].vPosition.y; | |
7635 v732 = pActors[v625].uActorHeight; | |
7636 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7637 v626 = 8 * dword_50BF30[a2]; | |
7638 LOBYTE(v626) = v626 | 3; | |
7639 a1.field_5C = v626; | |
7640 v627 = a1.Create(0, v1, v1, v1); | |
7641 v628 = a2; | |
7642 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7643 a2 = v628 + 1; | |
7644 } | |
7645 while ( v628 + 1 < SHIDWORD(v733) ); | |
7646 } | |
7647 v730 = v1; | |
7648 v629 = 1; | |
7649 do | |
7650 { | |
7651 v630 = pPlayers[v629]; | |
7652 if ( !v630->pConditions[2] | |
7653 && !v630->pConditions[12] | |
7654 && !v630->pConditions[13] | |
7655 && !v630->pConditions[14] | |
7656 && !v630->pConditions[15] | |
7657 && !v630->pConditions[16] ) | |
7658 { | |
7659 v631 = v730++; | |
7660 v681[v631] = v629; | |
7661 } | |
7662 ++v629; | |
7663 } | |
7664 while ( v629 <= 4 ); | |
7665 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
7666 HIDWORD(v733) = v1; | |
7667 if ( v730 > v1 ) | |
7668 { | |
7669 do | |
7670 { | |
7671 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7672 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7673 v633->sHealth += v732; | |
7674 v726 = *(Player **)v632; | |
7675 v634 = v726->GetMaxHealth(); | |
7676 if ( v726->sHealth > v634 ) | |
7677 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7678 v635 = HIDWORD(v733); | |
7679 v636 = WORD2(v733); | |
7680 v637 = v3->spellnum; | |
7681 v638 = pGame->GetStru6(); | |
7682 pGame->GetStru6()->SetPlayerBuffAnim(v637, v636); | |
7683 HIDWORD(v733) = v635 + 1; | |
7684 } | |
7685 while ( v635 + 1 < v730 ); | |
7686 } | |
7687 v639 = pGame->GetStru6(); | |
7688 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(v1, 0x40u); | |
7689 goto LABEL_1056; | |
7690 case 98: | |
7691 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7692 { | |
7693 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7694 goto LABEL_201; | |
7695 } | |
7696 v640 = v12 - 2; | |
7697 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7698 amount = 3; | |
7699 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->field_1613C > v1 ) | |
7700 goto LABEL_200; | |
7701 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7702 goto LABEL_83; | |
7703 pParty->field_1613C = 256; | |
7704 pParty->field_16140 = v2; | |
7705 ++pPlayer->uNumArmageddonCasts; | |
7706 if ( pParty->bTurnBasedModeOn == 1 ) | |
7707 ++pTurnEngine->field_1C; | |
7708 v726 = (Player *)50; | |
7709 do | |
7710 { | |
7711 v642 = rand() % 4096 - 2048; | |
7712 v643 = rand(); | |
7713 v721 = v642 + pParty->vPosition.x; | |
7714 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
7715 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1); | |
7716 v644 = rand(); | |
7717 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1); | |
7718 v726 = (Player *)((char *)v726 - 1); | |
7719 } | |
7720 while ( *(float *)&v726 != 0.0 ); | |
7721 goto LABEL_1056; | |
7722 default: | |
7723 goto LABEL_83; | |
7724 } | |
7725 while ( 2 ) | |
7726 { | |
7727 if ( v731 == 4 ) | |
7728 { | |
7729 if ( *((_QWORD *)v222 + 2) ) | |
7730 { | |
7731 *((int *)v222 + 4) = v1; | |
7732 *((int *)v222 + 5) = v1; | |
7733 goto LABEL_439; | |
7734 } | |
7735 } | |
7736 else | |
7737 { | |
7738 v732 = amount << 7; | |
7739 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7740 2u, | |
7741 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7742 v222 = (char *)HIDWORD(v733); | |
7743 if ( v223 ) | |
7744 LABEL_439: | |
7745 ((Player *)v222)->PlaySound(103, v1); | |
7746 } | |
7747 v222 += 6972; | |
7748 HIDWORD(v733) = (int)v222; | |
7749 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7750 goto LABEL_1056; | |
7751 continue; | |
7752 } | |
7753 } | |
7754 if ( pParty->bTurnBasedModeOn == v1 ) | |
7755 { | |
7756 v646 = pPlayer; | |
7757 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
7758 v647 = n; | |
7759 } | |
7760 else | |
7761 { | |
7762 v647 = n; | |
7763 v646 = pPlayer; | |
7764 v648 = sRecoveryTime; | |
7765 v649 = pPlayer; | |
7766 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
7767 v649->SetRecoveryTime(v648); | |
7768 pTurnEngine->_40471C(); | |
7769 } | |
7770 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
7771 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
7772 v711[v647].spellnum = v1; | |
7773 v646->sMana -= uRequiredMana; | |
7774 } | |
7775 //----- (0042EB42) -------------------------------------------------------- | |
7776 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7777 { | |
7778 unsigned int v2; // edx@1 | |
7779 signed int v3; // eax@1 | |
7780 char *v4; // ecx@2 | |
7781 | |
7782 v2 = this->uNumObjects; | |
7783 v3 = 0; | |
7784 if ( (signed int)this->uNumObjects <= 0 ) | |
7785 { | |
7786 LABEL_5: | |
7787 LOWORD(v3) = 0; | |
7788 } | |
7789 else | |
7790 { | |
7791 v4 = (char *)&this->pObjects->uObjectID; | |
7792 while ( uItemID != *(short *)v4 ) | |
7793 { | |
7794 ++v3; | |
7795 v4 += 56; | |
7796 if ( v3 >= (signed int)v2 ) | |
7797 goto LABEL_5; | |
7798 } | |
7799 } | |
7800 return v3; | |
7801 } | |
7802 | |
7803 | |
7804 | |
7805 //----- (0042EB78) -------------------------------------------------------- | |
7806 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7807 { | |
7808 return 8 * this->pIcons[uIconID].uAnimLength; | |
7809 } | |
7810 | |
7811 //----- (0042EB8D) -------------------------------------------------------- | |
7812 void GUIMessageQueue::SendMessage(UIMessageType msg, int param, unsigned int a4) | |
7813 { | |
7814 if (uNumMessages < 40) | |
7815 { | |
7816 pMessages[uNumMessages].eType = msg; | |
7817 pMessages[uNumMessages].param = param; | |
7818 pMessages[uNumMessages++].field_8 = a4; | |
7819 } | |
7820 } | |
7821 | |
7822 //----- (0042EBBE) -------------------------------------------------------- | |
7823 int __fastcall sub_42EBBE(int a1, int a2) | |
7824 { | |
7825 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7826 } | |
7827 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7828 | |
7829 //----- (0042EBDB) -------------------------------------------------------- | |
7830 int stru193_math::_42EBDB(int angle) | |
7831 { | |
7832 return SinCos(angle - this->uIntegerHalfPi); | |
7833 } | |
7834 | |
7835 //----- (0042ECB5) -------------------------------------------------------- | |
7836 bool __cdecl _42ECB5_PlayerAttacksActor() | |
7837 { | |
7838 unsigned int v0; // ebx@1 | |
7839 Player *v1; // esi@1 | |
7840 bool result; // eax@1 | |
7841 int v3; // edi@2 | |
7842 unsigned int v4; // eax@7 | |
7843 char *v5; // eax@8 | |
7844 int v6; // ecx@9 | |
7845 signed int v7; // eax@16 | |
7846 Actor *v8; // edi@20 | |
7847 unsigned int v9; // ecx@21 | |
7848 char *v10; // eax@26 | |
7849 char *v11; // eax@26 | |
7850 unsigned int v12; // eax@47 | |
7851 char *v13; // eax@47 | |
7852 char *v14; // eax@47 | |
7853 unsigned int v15; // ebx@54 | |
7854 int v16; // [sp-10h] [bp-4Ch]@24 | |
7855 int v17; // [sp-10h] [bp-4Ch]@44 | |
7856 unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7857 unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7858 __int16 v20; // [sp-8h] [bp-44h]@24 | |
7859 __int16 v21; // [sp-8h] [bp-44h]@44 | |
7860 int v22; // [sp-4h] [bp-40h]@24 | |
7861 int v23; // [sp-4h] [bp-40h]@44 | |
7862 SoundID v24; // [sp-4h] [bp-40h]@58 | |
7863 Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 | |
7864 unsigned int a2; // [sp+18h] [bp-24h]@20 | |
7865 unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
7866 char *v28; // [sp+20h] [bp-1Ch]@9 | |
7867 int v29; // [sp+24h] [bp-18h]@16 | |
7868 int v30; // [sp+28h] [bp-14h]@16 | |
7869 int v31; // [sp+2Ch] [bp-10h]@4 | |
7870 int v32; // [sp+30h] [bp-Ch]@7 | |
7871 int v33; // [sp+34h] [bp-8h]@7 | |
7872 int v34; // [sp+38h] [bp-4h]@17 | |
7873 | |
7874 v0 = uActiveCharacter; | |
7875 v27 = 6972 * uActiveCharacter; | |
42 | 7876 v1 = &pParty->pPlayers[uActiveCharacter-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552]; |
7877 result = pParty->pPlayers[uActiveCharacter-1].CanAct();//((Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552])->CanAct(); | |
0 | 7878 if ( result ) |
7879 { | |
7880 pStru277->_427D48(v0); | |
7881 v3 = 0; | |
7882 if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime > 0 ) | |
7883 pParty->pPartyBuffs[11].Reset(); | |
7884 v31 = v1->pEquipment.uBow; | |
7885 if ( v31 && v1->field_1F5[36 * v31 + 15] & 2 ) | |
7886 v31 = 0; | |
7887 v4 = v1->pEquipment.uMainHand; | |
7888 v32 = 0; | |
7889 v33 = 0; | |
7890 if ( v4 ) | |
7891 { | |
7892 v5 = (char *)v1 + 36 * v4; | |
7893 if ( !(v5[516] & 2) ) | |
7894 { | |
7895 v28 = v5 + 496; | |
7896 v6 = *((int *)v5 + 124); | |
7897 if ( pItemsTable->pItems[v6].uEquipType == 12 ) | |
7898 { | |
7899 if ( *((int *)v5 + 128) <= 0 ) | |
7900 { | |
7901 *(int *)v28 = 0; | |
7902 v1->pEquipment.uMainHand = 0; | |
7903 } | |
7904 else | |
7905 { | |
7906 v32 = *((int *)v5 + 124); | |
7907 } | |
7908 } | |
7909 else | |
7910 { | |
7911 if ( v6 == 64 || v6 == 65 ) | |
7912 v33 = *((int *)v5 + 124); | |
7913 } | |
7914 } | |
7915 } | |
7916 v30 = 0; | |
7917 v29 = 0; | |
7918 v28 = 0; | |
7919 v7 = pMouse->uPointingObjectID; | |
7920 if ( (pMouse->uPointingObjectID & 7) != 3 || (v34 = pMouse->uPointingObjectID, !pActors[v7 >> 3].CanAct()) ) | |
7921 v34 = stru_50C198.FindClosesActor(5120, 0, 0); | |
7922 a3.z = 0; | |
7923 a3.y = 0; | |
7924 a3.x = 0; | |
7925 if ( (v34 & 7) == 3 ) | |
7926 { | |
7927 a2 = v34 >> 3; | |
7928 v8 = &pActors[v34 >> 3]; | |
7929 v34 = sub_452A9E((v8->vPosition.x - pParty->vPosition.x) * (v8->vPosition.x - pParty->vPosition.x) + (v8->vPosition.y - pParty->vPosition.y) * (v8->vPosition.y - pParty->vPosition.y) + (v8->vPosition.z - pParty->vPosition.z) * (v8->vPosition.z - pParty->vPosition.z)) | |
7930 - v8->uActorRadius; | |
7931 if ( v34 >= 0 ) | |
7932 { | |
7933 v9 = 0; | |
7934 } | |
7935 else | |
7936 { | |
7937 v9 = 0; | |
7938 v34 = 0; | |
7939 } | |
7940 if ( v33 != v9 ) | |
7941 { | |
7942 v28 = (char *)1; | |
7943 v22 = v0 + 8; | |
7944 v20 = v9; | |
7945 v18 = v9; | |
7946 v16 = 102; | |
7947 LABEL_34: | |
7948 _42777D_CastSpell_UseWand_ShootArrow(v16, v0 - 1, v18, v20, v22); | |
7949 LABEL_28: | |
7950 v3 = 0; | |
7951 goto LABEL_29; | |
7952 } | |
7953 if ( v32 != v9 ) | |
7954 { | |
7955 v29 = 1; | |
7956 _42777D_CastSpell_UseWand_ShootArrow( | |
7957 *((int *)&pSpellDatas[66].field_8 | |
7958 + *(int *)(&stru_AA1058[3].pSounds[36 * *(int *)&pParty->pArtifactsFound[v27 + 22] + 41048] + v27)), | |
7959 v0 - 1, | |
7960 8u, | |
7961 v9, | |
7962 v0 + 8); | |
7963 v10 = &v1->field_1F5[36 * v1->pEquipment.uMainHand + 11]; | |
7964 --*(int *)v10; | |
7965 v11 = (char *)v1 + 36 * v1->pEquipment.uMainHand; | |
7966 if ( *((int *)v11 + 128) <= 0 ) | |
7967 { | |
7968 *((int *)v11 + 124) = 0; | |
7969 v1->pEquipment.uMainHand = 0; | |
7970 } | |
7971 goto LABEL_28; | |
7972 } | |
7973 if ( (double)v34 <= 407.2 ) | |
7974 { | |
7975 a3.x = v8->vPosition.x - pParty->vPosition.x; | |
7976 a3.y = v8->vPosition.y - pParty->vPosition.y; | |
7977 a3.z = v8->vPosition.z - pParty->vPosition.z; | |
7978 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
7979 DamageMonsterFromParty((8 * v0 - 8) | 4, a2, &a3); | |
7980 if ( v1->WearsItem(506, 1) || v1->WearsItem(506, 0) ) | |
7981 _42FA66_do_explosive_impact( | |
7982 v8->vPosition.x, | |
7983 v8->vPosition.y, | |
7984 v8->vPosition.z + v8->uActorHeight / 2, | |
7985 0, | |
7986 512, | |
7987 v0); | |
7988 } | |
7989 else | |
7990 { | |
7991 if ( v31 != v9 ) | |
7992 { | |
7993 v30 = 1; | |
7994 v22 = 0; | |
7995 v20 = 0; | |
7996 v18 = 0; | |
7997 v16 = 100; | |
7998 goto LABEL_34; | |
7999 } | |
8000 } | |
8001 v3 = 0; | |
8002 goto LABEL_39; | |
8003 } | |
8004 if ( v33 ) | |
8005 { | |
8006 v28 = (char *)1; | |
8007 v23 = v0 + 8; | |
8008 v21 = 0; | |
8009 v19 = 0; | |
8010 v17 = 102; | |
8011 } | |
8012 else | |
8013 { | |
8014 if ( v32 ) | |
8015 { | |
8016 v12 = v1->pEquipment.uMainHand; | |
8017 v29 = 1; | |
8018 _42777D_CastSpell_UseWand_ShootArrow( | |
8019 *((int *)&pSpellDatas[66].field_8 + *(int *)&v1->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v12 + 5]), | |
8020 v0 - 1, | |
8021 8u, | |
8022 0, | |
8023 v0 + 8); | |
8024 v13 = &v1->field_1F5[36 * v1->pEquipment.uMainHand + 11]; | |
8025 --*(int *)v13; | |
8026 v14 = (char *)v1 + 36 * v1->pEquipment.uMainHand; | |
8027 if ( *((int *)v14 + 128) <= 0 ) | |
8028 { | |
8029 *((int *)v14 + 124) = 0; | |
8030 v1->pEquipment.uMainHand = 0; | |
8031 } | |
8032 LABEL_29: | |
8033 v34 = v3; | |
8034 if ( v30 == v3 ) | |
8035 { | |
8036 if ( v29 != v3 ) | |
8037 return 1; | |
8038 if ( v28 == (char *)v3 ) | |
8039 { | |
8040 v15 = v1->pEquipment.uMainHand; | |
8041 if ( v1->HasItemEquipped(EQUIP_TWO_HANDED) ) | |
8042 v34 = pItemsTable->pItems[*(int *)&v1->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v15 + 5]].uSkillType; | |
8043 pTurnEngine->_40471C(); | |
8044 } | |
8045 else | |
8046 { | |
8047 v34 = 7; | |
8048 } | |
8049 } | |
8050 else | |
8051 { | |
8052 v34 = 5; | |
8053 v1->PlaySound(50, v3); | |
8054 } | |
8055 switch ( v34 ) | |
8056 { | |
8057 case 0: | |
8058 v24 = (SoundID)81; | |
8059 goto LABEL_66; | |
8060 case 1: | |
8061 v24 = (SoundID)84; | |
8062 goto LABEL_66; | |
8063 case 2: | |
8064 v24 = (SoundID)85; | |
8065 goto LABEL_66; | |
8066 case 3: | |
8067 v24 = (SoundID)78; | |
8068 goto LABEL_66; | |
8069 case 4: | |
8070 v24 = (SoundID)80; | |
8071 goto LABEL_66; | |
8072 case 5: | |
8073 v24 = (SoundID)71; | |
8074 goto LABEL_66; | |
8075 case 6: | |
8076 v24 = (SoundID)83; | |
8077 goto LABEL_66; | |
8078 case 7: | |
8079 v24 = (SoundID)67; | |
8080 LABEL_66: | |
8081 pAudioPlayer->PlaySound(v24, v3, v3, -1, v3, v3, v3, v3); | |
8082 break; | |
8083 default: | |
8084 return 1; | |
8085 } | |
8086 return 1; | |
8087 } | |
8088 if ( !v31 ) | |
8089 { | |
8090 LABEL_39: | |
8091 v31 = v1->GetAttackRecoveryTime(v3); | |
8092 if ( v31 < 30 ) | |
8093 v31 = 30; | |
8094 if ( pParty->bTurnBasedModeOn == v3 ) | |
8095 v1->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v31 * 2.133333333333333)); | |
8096 goto LABEL_29; | |
8097 } | |
8098 v23 = 0; | |
8099 v21 = 0; | |
8100 v19 = 0; | |
8101 v30 = 1; | |
8102 v17 = 100; | |
8103 } | |
8104 _42777D_CastSpell_UseWand_ShootArrow(v17, v0 - 1, v19, v21, v23); | |
8105 goto LABEL_29; | |
8106 } | |
8107 return result; | |
8108 } | |
8109 | |
8110 //----- (0042F184) -------------------------------------------------------- | |
8111 int stru319::FindClosesActor(int a2, int a3, int a4) | |
8112 { | |
8113 int v4; // edi@1 | |
8114 stru319 *v5; // esi@1 | |
8115 int v6; // eax@2 | |
8116 int v7; // eax@4 | |
8117 int result; // eax@5 | |
8118 int *v9; // edx@8 | |
8119 signed int v10; // ebx@10 | |
8120 int v11; // edi@11 | |
8121 Actor *v12; // esi@12 | |
8122 unsigned __int16 v13; // ax@12 | |
8123 int v14; // eax@22 | |
8124 char v15; // zf@30 | |
8125 int v16; // esi@32 | |
8126 int v17; // ecx@34 | |
8127 stru319 *v18; // eax@39 | |
8128 int v19; // edx@39 | |
8129 int v20; // ecx@41 | |
8130 unsigned __int16 v21; // ax@42 | |
8131 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
8132 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
8133 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
8134 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
8135 int *v26; // [sp+18h] [bp-14h]@8 | |
8136 int v27; // [sp+1Ch] [bp-10h]@10 | |
8137 int *v28; // [sp+20h] [bp-Ch]@10 | |
8138 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
8139 int v30; // [sp+28h] [bp-4h]@6 | |
8140 int i; // [sp+38h] [bp+Ch]@33 | |
8141 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
8142 | |
8143 v4 = 0; | |
8144 v5 = this; | |
8145 v24 = this; | |
8146 if ( pRenderer->pRenderD3D ) | |
8147 { | |
8148 v6 = a3 != 0; | |
8149 if ( a4 ) | |
8150 LOBYTE(v6) = v6 | 8; | |
8151 v7 = pGame->pVisInstance->_4C1944(3, a2, v6, 657456, -1); | |
8152 if ( v7 != -1 ) | |
8153 return (unsigned __int16)v7; | |
8154 } | |
8155 else | |
8156 { | |
8157 v30 = 0; | |
8158 if ( pRenderer->pActiveZBuffer ) | |
8159 { | |
8160 v29 = viewparams->uScreenX; | |
8161 v23 = viewparams->uScreenZ; | |
8162 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
8163 { | |
8164 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
8165 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8166 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8167 do | |
8168 { | |
8169 if ( (signed int)v29 < (signed int)v23 ) | |
8170 { | |
8171 v28 = v9; | |
8172 v10 = v4; | |
8173 v27 = v23 - v29; | |
8174 do | |
8175 { | |
8176 v22 = *v28; | |
8177 v11 = *v28 & 0xFFFF; | |
8178 if ( (*(char *)v28 & 7) == 3 ) | |
8179 { | |
8180 v12 = &pActors[(unsigned int)v11 >> 3]; | |
8181 v13 = v12->uAIState; | |
8182 if ( v13 != 5 ) | |
8183 { | |
8184 if ( v13 != 4 | |
8185 && v13 != 11 | |
8186 && v13 != 19 | |
8187 && v13 != 17 | |
8188 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
8189 { | |
8190 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
8191 && v22 <= a2 << 16 ) | |
8192 { | |
8193 v14 = 0; | |
8194 if ( v10 > 0 ) | |
8195 { | |
8196 do | |
8197 { | |
8198 if ( dword_50BDA0[v14] == v11 ) | |
8199 break; | |
8200 ++v14; | |
8201 } | |
8202 while ( v14 < v30 ); | |
8203 } | |
8204 if ( v14 == v30 && v10 < 100 ) | |
8205 { | |
8206 ++v30; | |
8207 dword_50BC10[v10] = v22; | |
8208 dword_50BDA0[v10] = v11; | |
8209 ++v10; | |
8210 } | |
8211 } | |
8212 } | |
8213 } | |
8214 } | |
8215 ++v28; | |
8216 --v27; | |
8217 } | |
8218 while ( v27 ); | |
8219 v4 = v30; | |
8220 v5 = v24; | |
8221 } | |
8222 v9 = v26 + 640; | |
8223 v15 = v25-- == 1; | |
8224 v26 += 640; | |
8225 } | |
8226 while ( !v15 ); | |
8227 } | |
8228 if ( v4 > 0 ) | |
8229 { | |
8230 v32 = 1; | |
8231 v16 = (int)dword_50BC10; | |
8232 do | |
8233 { | |
8234 for ( i = v32; i < v4; ++i ) | |
8235 { | |
8236 v17 = dword_50BC10[i]; | |
8237 if ( v17 < *(int *)v16 ) | |
8238 { | |
8239 dword_50BC10[i] = *(int *)v16; | |
8240 *(int *)v16 = v17; | |
8241 } | |
8242 } | |
8243 ++v32; | |
8244 v16 += 4; | |
8245 } | |
8246 while ( v32 - 1 < v4 ); | |
8247 v5 = v24; | |
8248 if ( v4 > 0 ) | |
8249 { | |
8250 v18 = v24; | |
8251 v19 = v4; | |
8252 do | |
8253 { | |
8254 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
8255 v18 += 4; | |
8256 --v19; | |
8257 } | |
8258 while ( v19 ); | |
8259 } | |
8260 } | |
8261 v20 = 0; | |
8262 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
8263 { | |
8264 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8265 if ( v21 != 4 && v21 != 5 ) | |
8266 break; | |
8267 } | |
8268 if ( v20 != v4 ) | |
8269 { | |
8270 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8271 LOBYTE(result) = result | 3; | |
8272 return result; | |
8273 } | |
8274 } | |
8275 } | |
8276 return 0; | |
8277 } | |
8278 | |
8279 | |
8280 //----- (0042F3D6) -------------------------------------------------------- | |
8281 void InitializeTurnBasedAnimations(void *_this) | |
8282 { | |
8283 unsigned int *v1; // edi@1 | |
8284 | |
8285 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8286 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8287 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8288 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8289 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8290 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8291 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8292 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8293 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8294 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8295 v1 = pIconIDs_Turn; | |
8296 do | |
8297 { | |
8298 pIconsFrameTable->InitializeAnimation(*v1); | |
8299 ++v1; | |
8300 } | |
8301 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8302 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8303 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8304 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8305 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8306 } | |
8307 | |
8308 //----- (0042F4DA) -------------------------------------------------------- | |
8309 signed int __cdecl sub_42F4DA() | |
8310 { | |
8311 signed int v0; // edi@1 | |
82 | 8312 Actor *v1; // esi@4 |
0 | 8313 int v2; // ebx@5 |
8314 int v3; // eax@5 | |
8315 int v4; // ebx@5 | |
8316 unsigned int v5; // ecx@5 | |
8317 int v6; // edx@6 | |
8318 unsigned int v7; // edx@8 | |
8319 unsigned int v8; // edx@10 | |
8320 __int16 v9; // ax@12 | |
8321 signed int result; // eax@20 | |
8322 int v11; // [sp+Ch] [bp-10h]@5 | |
8323 int v12; // [sp+10h] [bp-Ch]@5 | |
8324 signed int v13; // [sp+14h] [bp-8h]@3 | |
8325 | |
8326 v0 = 5120; | |
8327 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8328 v0 = 2560; | |
8329 v13 = 0; | |
8330 if ( (signed int)uNumActors <= 0 ) | |
8331 { | |
8332 LABEL_20: | |
8333 result = 0; | |
8334 } | |
8335 else | |
8336 { | |
82 | 8337 v1 = pActors; |
0 | 8338 while ( 1 ) |
8339 { | |
82 | 8340 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8341 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8342 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8343 v3 = v2; |
8344 v4 = v11; | |
8345 v5 = v12; | |
8346 if ( v3 < v11 ) | |
8347 { | |
8348 v6 = v3; | |
8349 v3 = v11; | |
8350 v4 = v6; | |
8351 } | |
8352 if ( v3 < v12 ) | |
8353 { | |
8354 v7 = v3; | |
8355 v3 = v12; | |
8356 v5 = v7; | |
8357 } | |
8358 if ( v4 < (signed int)v5 ) | |
8359 { | |
8360 v8 = v5; | |
8361 v5 = v4; | |
8362 v4 = v8; | |
8363 } | |
8364 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8365 { | |
82 | 8366 v9 = v1->uAIState; |
8367 if ( v1->uAIState != 5 ) | |
0 | 8368 { |
8369 if ( v9 != 4 | |
8370 && v9 != 11 | |
8371 && v9 != 19 | |
8372 && v9 != 17 | |
82 | 8373 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8374 break; |
8375 } | |
8376 } | |
8377 ++v13; | |
82 | 8378 ++v1; |
0 | 8379 if ( v13 >= (signed int)uNumActors ) |
8380 goto LABEL_20; | |
8381 } | |
8382 result = 1; | |
8383 } | |
8384 return result; | |
8385 } | |
8386 | |
8387 //----- (0042F5ED) -------------------------------------------------------- | |
8388 int LayingItem::Create(int yaw, int pitch, int a4, int a5) | |
8389 { | |
8390 LayingItem *v5; // eax@1 | |
8391 signed int v6; // ebx@2 | |
8392 char *v7; // ecx@2 | |
8393 signed int result; // eax@6 | |
8394 LayingItem *v9; // ebx@7 | |
8395 int v10; // edx@11 | |
8396 int v11; // edi@18 | |
8397 __int16 v12; // ax@18 | |
8398 int v13; // ST2C_4@20 | |
8399 int v14; // eax@20 | |
8400 int v15; // [sp-28h] [bp-38h]@14 | |
8401 int v16; // [sp-24h] [bp-34h]@11 | |
8402 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 | |
8403 int *v18; // [sp-14h] [bp-24h]@11 | |
8404 int *v19; // [sp-10h] [bp-20h]@11 | |
8405 int *v20; // [sp-Ch] [bp-1Ch]@11 | |
8406 signed int v21; // [sp+8h] [bp-8h]@2 | |
8407 int angle; // [sp+Ch] [bp-4h]@1 | |
8408 int a4a; // [sp+1Ch] [bp+Ch]@20 | |
8409 int a4b; // [sp+1Ch] [bp+Ch]@20 | |
8410 int a5a; // [sp+20h] [bp+10h]@20 | |
8411 | |
8412 auto a1 = this; | |
8413 angle = yaw; | |
8414 v5 = a1; | |
8415 if ( !a1->uObjectDescID ) | |
8416 return -1; | |
8417 v6 = 0; | |
8418 v7 = (char *)&pLayingItems[0].uObjectDescID; | |
8419 v21 = 0; | |
8420 do | |
8421 { | |
8422 if ( !*(short *)v7 ) | |
8423 break; | |
8424 v7 += 112; | |
8425 ++v6; | |
8426 v21 = v6; | |
8427 } | |
8428 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) ); | |
8429 if ( v6 >= 1000 ) | |
8430 return -1; | |
8431 *(int *)&v5->field_62[2] = v5->vPosition.x; | |
8432 *(int *)&v5->field_62[6] = v5->vPosition.y; | |
8433 v9 = &pLayingItems[v6]; | |
8434 *(int *)&v5->field_62[10] = v5->vPosition.z; | |
8435 memcpy(v9, v5, 0x70u); | |
8436 if ( a5 == 1 ) | |
8437 { | |
8438 v20 = &v9->vPosition.z; | |
8439 v19 = &v9->vPosition.y; | |
8440 v18 = (int *)&v9->vPosition; | |
8441 v17.z = v5->vPosition.z; | |
8442 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8443 v16 = 0; | |
8444 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8445 goto LABEL_16; | |
8446 } | |
8447 if ( a5 == 2 ) | |
8448 { | |
8449 v20 = &v9->vPosition.z; | |
8450 v19 = &v9->vPosition.y; | |
8451 v18 = (int *)&v9->vPosition; | |
8452 v17.z = v5->vPosition.z; | |
8453 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8454 v16 = 0; | |
8455 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8456 goto LABEL_14; | |
8457 } | |
8458 if ( a5 == 3 ) | |
8459 { | |
8460 v20 = &v9->vPosition.z; | |
8461 v19 = &v9->vPosition.y; | |
8462 v18 = (int *)&v9->vPosition; | |
8463 v17.z = v5->vPosition.z; | |
8464 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8465 v16 = 0; | |
8466 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8467 LABEL_14: | |
8468 v15 = 8; | |
8469 LABEL_17: | |
8470 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20); | |
8471 goto LABEL_18; | |
8472 } | |
8473 if ( a5 == 4 ) | |
8474 { | |
8475 v20 = &v9->vPosition.z; | |
8476 v19 = &v9->vPosition.y; | |
8477 v18 = (int *)&v9->vPosition; | |
8478 v17.z = v5->vPosition.z; | |
8479 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8480 v16 = 0; | |
8481 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8482 LABEL_16: | |
8483 v15 = 24; | |
8484 goto LABEL_17; | |
8485 } | |
8486 LABEL_18: | |
8487 v11 = a4; | |
8488 v12 = 0; | |
8489 if ( a4 ) | |
8490 { | |
8491 a4a = stru_5C6E00->SinCos(angle); | |
8492 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->SinCos(pitch)) >> 16; | |
8493 a4b = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | |
8494 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->SinCos(pitch)) >> 16; | |
8495 v14 = stru_5C6E00->SinCos(pitch - stru_5C6E00->uIntegerHalfPi); | |
8496 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16; | |
8497 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16; | |
8498 v12 = (unsigned int)(v14 * v11) >> 16; | |
8499 } | |
8500 else | |
8501 { | |
8502 v9->vVelocity.y = 0; | |
8503 v9->vVelocity.x = 0; | |
8504 } | |
8505 v9->vVelocity.z = v12; | |
8506 result = v21; | |
8507 if ( v21 >= (signed int)uNumLayingItems ) | |
8508 uNumLayingItems = v21 + 1; | |
8509 return result; | |
8510 } | |
8511 | |
8512 //----- (0042F7EB) -------------------------------------------------------- | |
8513 bool __fastcall sub_42F7EB_DropItemAt(unsigned int uSpriteID, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9) | |
8514 { | |
8515 unsigned int v9; // edi@1 | |
8516 signed int v10; // edx@3 | |
8517 char *v11; // ecx@4 | |
8518 unsigned __int16 v12; // ax@7 | |
8519 unsigned int v13; // edx@9 | |
8520 char *v14; // ecx@10 | |
8521 int v15; // esi@17 | |
8522 int v16; // eax@18 | |
8523 int v17; // edi@20 | |
8524 int v18; // esi@20 | |
8525 //LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8526 int v21; // [sp+7Ch] [bp-8h]@1 | |
8527 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8528 | |
8529 v9 = uSpriteID; | |
8530 v21 = x; | |
8531 v22 = uSpriteID; | |
8532 | |
8533 LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8534 //LayingItem::LayingItem(&a1a); | |
8535 a1a.stru_24.Reset(); | |
8536 | |
8537 if ( a9 ) | |
8538 { | |
8539 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8540 v9 = v22; | |
8541 } | |
8542 v10 = 0; | |
8543 a1a.field_50 = 0; | |
8544 a1a.field_4C = 0; | |
8545 a1a.field_48 = 0; | |
8546 a1a.field_54 = 0; | |
8547 a1a.uItemType = v9; | |
8548 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8549 { | |
8550 LABEL_7: | |
8551 v12 = 0; | |
8552 } | |
8553 else | |
8554 { | |
8555 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8556 while ( (short)v9 != *(short *)v11 ) | |
8557 { | |
8558 ++v10; | |
8559 v11 += 56; | |
8560 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8561 goto LABEL_7; | |
8562 } | |
8563 v12 = v10; | |
8564 } | |
8565 a1a.uObjectDescID = v12; | |
8566 a1a.vPosition.z = z; | |
8567 a1a.vPosition.x = v21; | |
8568 a1a.vPosition.y = y; | |
8569 a1a.uSoundID = 0; | |
8570 a1a.uAttributes = attributes; | |
8571 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8572 a1a.uSpriteFrameID = 0; | |
8573 a1a.field_58 = 0; | |
8574 a1a.field_5C = 0; | |
8575 if ( !(a1a.uAttributes & 0x10) ) | |
8576 { | |
8577 v13 = 0; | |
8578 if ( (signed int)pItemsTable->pItems[0].uItemID > 0 ) | |
8579 { | |
8580 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8581 while ( *(short *)v14 != v9 ) | |
8582 { | |
8583 ++v13; | |
8584 v14 += 48; | |
8585 if ( (signed int)v13 >= (signed int)pItemsTable->pItems[0].uItemID ) | |
8586 goto LABEL_16; | |
8587 } | |
8588 a1a.stru_24.uItemID = v13; | |
8589 } | |
8590 } | |
8591 LABEL_16: | |
8592 if ( a7 ) | |
8593 { | |
8594 v15 = count; | |
8595 if ( count > 0 ) | |
8596 { | |
8597 do | |
8598 { | |
8599 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8600 v16 = rand(); | |
8601 a1a.Create( | |
8602 (signed __int16)a1a.uFacing, | |
8603 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8604 a4, | |
8605 0); | |
8606 --v15; | |
8607 } | |
8608 while ( v15 ); | |
8609 } | |
8610 } | |
8611 else | |
8612 { | |
8613 v17 = count; | |
8614 v18 = stru_5C6E00->uIntegerHalfPi; | |
8615 a1a.uFacing = 0; | |
8616 if ( count > 0 ) | |
8617 { | |
8618 do | |
8619 { | |
8620 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8621 --v17; | |
8622 } | |
8623 while ( v17 ); | |
8624 } | |
8625 } | |
8626 return 1; | |
8627 } | |
8628 | |
8629 //----- (0042F960) -------------------------------------------------------- | |
8630 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8631 { | |
8632 int v3; // ebx@1 | |
8633 int v4; // edi@1 | |
8634 signed int v5; // edx@1 | |
8635 char *v6; // ecx@2 | |
8636 unsigned __int16 v7; // ax@5 | |
8637 signed int v8; // eax@6 | |
8638 signed int v9; // eax@7 | |
8639 //LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8640 | |
8641 v3 = x; | |
8642 v4 = y; | |
8643 | |
8644 LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8645 //LayingItem::LayingItem(&a1); | |
8646 a1.stru_24.Reset(); | |
8647 | |
8648 v5 = 0; | |
8649 a1.field_50 = 0; | |
8650 a1.field_4C = 0; | |
8651 a1.field_48 = 0; | |
8652 a1.field_54 = 0; | |
8653 a1.uItemType = 800; | |
8654 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8655 { | |
8656 LABEL_5: | |
8657 v7 = 0; | |
8658 } | |
8659 else | |
8660 { | |
8661 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8662 while ( *(short *)v6 != 800 ) | |
8663 { | |
8664 ++v5; | |
8665 v6 += 56; | |
8666 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8667 goto LABEL_5; | |
8668 } | |
8669 v7 = v5; | |
8670 } | |
8671 a1.uObjectDescID = v7; | |
8672 a1.vPosition.x = v3; | |
8673 a1.vPosition.y = v4; | |
8674 a1.vPosition.z = z; | |
8675 a1.uSoundID = 0; | |
8676 a1.uAttributes = 0; | |
8677 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8678 a1.uSpriteFrameID = 0; | |
8679 a1.field_58 = 0; | |
8680 a1.field_5C = 0; | |
8681 v8 = a1.Create(0, 0, 0, 0); | |
8682 if ( v8 != -1 ) | |
8683 { | |
8684 v9 = 8 * v8; | |
8685 LOBYTE(v9) = v9 | 2; | |
8686 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8687 } | |
8688 } | |
8689 | |
8690 //----- (0042FA22) -------------------------------------------------------- | |
79 | 8691 LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8692 { |
8693 size_t v0; // edx@1 | |
8694 int v1; // ebp@1 | |
79 | 8695 LayingItem *result; // eax@1 |
8696 LayingItem *v3; // ebx@1 | |
0 | 8697 |
8698 v0 = 0; | |
8699 v1 = 0; | |
79 | 8700 //result = (char *)&pLayingItems[0].uObjectDescID; |
8701 result = pLayingItems; | |
0 | 8702 v3 = pLayingItems; |
8703 do | |
8704 { | |
79 | 8705 if ( result->uObjectDescID ) |
0 | 8706 { |
8707 if ( v1 != v0 ) | |
8708 { | |
79 | 8709 memcpy(v3, result, 0x70u); |
8710 result->uObjectDescID = 0; | |
0 | 8711 } |
8712 ++v0; | |
79 | 8713 ++v3;// = (char *)v3 + 112; |
0 | 8714 } |
79 | 8715 ++result;// += 112; |
0 | 8716 ++v1; |
8717 } | |
79 | 8718 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); |
8719 while( result <= &pLayingItems[999] ); | |
0 | 8720 uNumLayingItems = v0; |
8721 return result; | |
8722 } | |
8723 | |
8724 //----- (0042FA66) -------------------------------------------------------- | |
8725 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8726 { | |
8727 int v6; // edi@1 | |
8728 int v7; // esi@1 | |
8729 char *v8; // ecx@2 | |
8730 unsigned __int16 v9; // ax@5 | |
8731 int v10; // eax@10 | |
8732 signed int result; // eax@11 | |
8733 __int16 v12; // ax@12 | |
8734 //LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8735 int v14; // [sp+7Ch] [bp-4h]@1 | |
8736 | |
8737 v6 = a1; | |
8738 v7 = a2; | |
8739 LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8740 //LayingItem::LayingItem(&a1a); | |
8741 a1a.uItemType = 600; | |
8742 a1a.stru_24.Reset(); | |
8743 | |
8744 a1a.field_48 = 6; | |
8745 a1a.field_4C = 8; | |
8746 a1a.field_50 = 3; | |
8747 v14 = 0; | |
8748 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8749 { | |
8750 LABEL_5: | |
8751 v9 = 0; | |
8752 } | |
8753 else | |
8754 { | |
8755 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
8756 while ( (short)a1a.uItemType != *(short *)v8 ) | |
8757 { | |
8758 ++v14; | |
8759 v8 += 56; | |
8760 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8761 goto LABEL_5; | |
8762 } | |
8763 v9 = v14; | |
8764 } | |
8765 a1a.uObjectDescID = v9; | |
8766 a1a.vPosition.x = v6; | |
8767 a1a.vPosition.y = v7; | |
8768 a1a.vPosition.z = a3; | |
8769 a1a.uAttributes = 0; | |
8770 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8771 a1a.uSpriteFrameID = 0; | |
8772 a1a.field_5C = 0; | |
8773 a1a.field_60_distance_related_prolly_lod = 0; | |
8774 a1a.uFacing = 0; | |
8775 a1a.uSoundID = 0; | |
8776 if ( a6 >= 1 || a6 <= 4 ) | |
8777 { | |
8778 v10 = 8 * a6 - 8; | |
8779 LOBYTE(v10) = v10 | 4; | |
8780 a1a.field_58 = v10; | |
8781 } | |
8782 else | |
8783 { | |
8784 a1a.field_58 = 0; | |
8785 } | |
8786 result = a1a.Create(0, 0, 0, 0); | |
8787 if ( result != -1 ) | |
8788 { | |
8789 v12 = 8 * result; | |
8790 LOBYTE(v12) = v12 | 2; | |
8791 result = stru_50FE08.Add( | |
8792 v12, | |
8793 a5, | |
8794 SLOWORD(a1a.vPosition.x), | |
8795 SLOWORD(a1a.vPosition.y), | |
8796 SLOWORD(a1a.vPosition.z), | |
8797 0, | |
8798 0); | |
8799 } | |
8800 return result; | |
8801 } | |
8802 | |
8803 | |
8804 | |
8805 //----- (0042FB5C) -------------------------------------------------------- | |
8806 bool __fastcall sub_42FB5C(signed int a1) | |
8807 { | |
8808 int v1; // ecx@3 | |
8809 int v2; // ecx@4 | |
8810 int v3; // ecx@5 | |
8811 int v4; // ecx@6 | |
8812 int v5; // ecx@7 | |
8813 int v6; // ecx@8 | |
8814 char v7; // zf@9 | |
8815 | |
8816 if ( a1 > 39 ) | |
8817 { | |
8818 if ( a1 > 77 ) | |
8819 { | |
8820 if ( a1 == 80 ) | |
8821 return 0; | |
8822 if ( a1 > 84 ) | |
8823 { | |
8824 if ( a1 <= 86 ) | |
8825 return 0; | |
8826 v7 = a1 == 95; | |
8827 goto LABEL_20; | |
8828 } | |
8829 } | |
8830 else | |
8831 { | |
8832 if ( a1 == 77 ) | |
8833 return 0; | |
8834 if ( a1 >= 46 ) | |
8835 { | |
8836 if ( a1 <= 47 || a1 == 51 ) | |
8837 return 0; | |
8838 v7 = a1 == 73; | |
8839 goto LABEL_20; | |
8840 } | |
8841 } | |
8842 return 1; | |
8843 } | |
8844 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8845 return 1; | |
8846 v2 = v1 - 3; | |
8847 if ( !v2 ) | |
8848 return 0; | |
8849 v3 = v2 - 1; | |
8850 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8851 return 1; | |
8852 v5 = v4 - 8; | |
8853 if ( !v5 ) | |
8854 return 0; | |
8855 v6 = v5 - 1; | |
8856 if ( !v6 ) | |
8857 return 1; | |
8858 v7 = v6 == 20; | |
8859 LABEL_20: | |
8860 if ( !v7 ) | |
8861 return 1; | |
8862 return 0; | |
8863 } | |
8864 | |
8865 //----- (0042FBDD) -------------------------------------------------------- | |
8866 void __cdecl sub_42FBDD() | |
8867 { | |
8868 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
8869 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); | |
8870 pRenderer->Present(); | |
8871 } | |
8872 | |
8873 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8874 void __cdecl CloseWindowBackground() |
0 | 8875 { |
8876 pAudioPlayer->PlaySound((SoundID)75, -2, 0, -1, 0, 0, 0, 0); | |
8877 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); | |
8878 pRenderer->Present(); | |
8879 } | |
8880 | |
8881 //----- (0042FC4E) -------------------------------------------------------- | |
8882 void __cdecl ProcessInputActions() | |
8883 { | |
8884 ActionQueue *pActionQueue; // esi@7 | |
8885 Keyboard *v3; // ecx@8 | |
8886 char v4; // al@9 | |
8887 ActionQueue *v5; // ecx@19 | |
8888 Player *v6; // ecx@86 | |
8889 Player *v7; // esi@100 | |
8890 char v8; // bl@100 | |
8891 unsigned __int16 v9; // ax@102 | |
8892 int v10; // eax@103 | |
8893 unsigned int v11; // eax@127 | |
8894 signed int v12; // esi@157 | |
8895 Keyboard *v13; // ecx@158 | |
8896 char v14; // al@159 | |
8897 unsigned int v15; // eax@168 | |
8898 void *v16; // esi@177 | |
8899 int v17; // [sp-14h] [bp-1Ch]@8 | |
8900 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8901 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
8902 __int16 v20; // [sp-14h] [bp-1Ch]@60 | |
8903 int v21; // [sp-14h] [bp-1Ch]@68 | |
8904 int v22; // [sp-Ch] [bp-14h]@158 | |
8905 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8906 int v24; // [sp+4h] [bp-4h]@87 | |
8907 | |
8908 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8909 auto pKeyboard = pGame->pKeyboardInstance; | |
8910 if (!bAlwaysRun) | |
8911 { | |
8912 if (pKeyboard->IsShiftHeld()) | |
8913 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8914 else | |
8915 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8916 } | |
8917 else | |
8918 { | |
8919 if (pKeyboard->IsShiftHeld()) | |
8920 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8921 else | |
8922 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8923 } | |
8924 | |
8925 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8926 LABEL_6: | |
8927 if ( !pEventTimer->bPaused ) | |
8928 { | |
8929 inputAction = (InputAction)0; | |
8930 pActionQueue = pPartyActionQueue; | |
8931 while ( 1 ) | |
8932 { | |
8933 v3 = pGame->pKeyboardInstance; | |
8934 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8935 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8936 v4 = v3->WasKeyPressed(v17); | |
8937 else | |
8938 v4 = v3->IsKeyBeingHeld(v17); | |
8939 if ( v4 ) | |
8940 { | |
8941 switch ( inputAction ) | |
8942 { | |
8943 case INPUT_MoveForward: | |
8944 if ( pCurrentScreen ) | |
8945 break; | |
8946 if (!pParty->bTurnBasedModeOn) | |
8947 goto _do_move_forward; | |
8948 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8949 { | |
8950 pTurnEngine->uActionPointsLeft -= 26; | |
8951 _do_move_forward: | |
8952 v5 = pActionQueue; | |
8953 if ( pParty->uFlags2 & 2 ) | |
8954 partyAction = PARTY_RunForward; | |
8955 else | |
8956 partyAction = PARTY_WalkForward; | |
8957 goto _add_action_and_continue; | |
8958 } | |
8959 break; | |
8960 case INPUT_MoveBackwards: | |
17 | 8961 //__debugbreak(); |
0 | 8962 if ( pCurrentScreen ) |
8963 break; | |
8964 if (!pParty->bTurnBasedModeOn) | |
17 | 8965 //goto _do_move_backwards; |
8966 { | |
8967 v5 = pActionQueue; | |
8968 if ( pParty->uFlags2 & 2 ) | |
8969 partyAction = PARTY_RunBackward; | |
8970 else | |
8971 partyAction = PARTY_WalkBackward; | |
8972 goto _add_action_and_continue; | |
8973 } | |
0 | 8974 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8975 { | |
8976 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8977 //_do_move_backwards: |
0 | 8978 v5 = pActionQueue; |
8979 if ( pParty->uFlags2 & 2 ) | |
8980 partyAction = PARTY_RunBackward; | |
8981 else | |
8982 partyAction = PARTY_WalkBackward; | |
8983 goto _add_action_and_continue; | |
8984 } | |
8985 break; | |
8986 case INPUT_StrafeLeft: | |
17 | 8987 //__debugbreak(); |
0 | 8988 if ( pCurrentScreen ) |
8989 break; | |
8990 if (!pParty->bTurnBasedModeOn) | |
17 | 8991 //goto _do_strafe_left; |
8992 { | |
8993 partyAction = PARTY_StrafeLeft; | |
8994 goto _add_action_and_continue_; | |
8995 } | |
0 | 8996 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8997 break; | |
8998 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8999 //_do_strafe_left: |
0 | 9000 partyAction = PARTY_StrafeLeft; |
9001 goto _add_action_and_continue_; | |
9002 case INPUT_StrafeRight: | |
17 | 9003 //__debugbreak(); |
0 | 9004 if ( pCurrentScreen ) |
9005 break; | |
9006 if (!pParty->bTurnBasedModeOn) | |
17 | 9007 //goto _do_strafe_right; |
9008 { | |
9009 partyAction = PARTY_StrafeRight; | |
9010 goto _add_action_and_continue_; | |
9011 } | |
0 | 9012 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
9013 break; | |
9014 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9015 //_do_strafe_right: |
0 | 9016 partyAction = PARTY_StrafeRight; |
9017 goto _add_action_and_continue_; | |
9018 case INPUT_TurnLeft: | |
9019 if ( pCurrentScreen ) | |
9020 break; | |
9021 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
9022 { | |
9023 if (pParty->bTurnBasedModeOn) | |
9024 { | |
9025 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9026 break; | |
9027 pTurnEngine->uActionPointsLeft -= 26; | |
9028 } | |
9029 partyAction_ = PARTY_StrafeLeft; | |
9030 } | |
9031 else | |
9032 { | |
9033 if ( pParty->uFlags2 & 2 ) | |
9034 partyAction_ = PARTY_FastTurnLeft; | |
9035 else | |
9036 partyAction_ = PARTY_TurnLeft; | |
9037 } | |
9038 pActionQueue->Add(partyAction_); | |
9039 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9040 { | |
9041 v20 = 10; | |
9042 goto LABEL_75; | |
9043 } | |
9044 break; | |
9045 case INPUT_TurnRight: | |
9046 if ( pCurrentScreen ) | |
9047 break; | |
9048 if ( GetAsyncKeyState(17) ) // strafing | |
9049 { | |
9050 if (pParty->bTurnBasedModeOn) | |
9051 { | |
9052 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9053 break; | |
9054 pTurnEngine->uActionPointsLeft -= 26; | |
9055 } | |
9056 v21 = 4; | |
9057 } | |
9058 else | |
9059 { | |
9060 if ( pParty->uFlags2 & 2 ) | |
9061 v21 = 19; | |
9062 else | |
9063 v21 = 2; | |
9064 } | |
9065 pActionQueue->Add((PartyAction)v21); | |
9066 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9067 { | |
9068 v20 = -10; | |
9069 LABEL_75: | |
9070 pWeather->_4C2F0B(v20); | |
9071 } | |
9072 break; | |
9073 case INPUT_Jump: | |
17 | 9074 //__debugbreak(); |
0 | 9075 if ( pCurrentScreen |
9076 || pParty->bTurnBasedModeOn) | |
9077 break; | |
9078 partyAction = (PartyAction)12; | |
9079 goto _add_action_and_continue_; | |
9080 case INPUT_Yell: | |
17 | 9081 //__debugbreak(); |
0 | 9082 if ( !pCurrentScreen |
9083 && uActiveCharacter ) | |
9084 { | |
9085 pParty->Yell(); | |
9086 pPlayers[uActiveCharacter]->PlaySound(65, 0); | |
9087 } | |
9088 break; | |
9089 case INPUT_Pass: | |
17 | 9090 //__debugbreak(); |
0 | 9091 if ( pCurrentScreen ) |
9092 break; | |
9093 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9094 //goto LABEL_118; |
9095 { | |
9096 pTurnEngine->field_18 |= 8u; | |
9097 break; | |
9098 } | |
0 | 9099 if ( uActiveCharacter ) |
9100 { | |
9101 v6 = pPlayers[uActiveCharacter]; | |
9102 if ( !v6->uTimeToRecovery ) | |
9103 { | |
9104 v24 = v6->GetAttackRecoveryTime(0); | |
9105 if ( !pParty->bTurnBasedModeOn ) | |
9106 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
9107 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
9108 pStru277->_427D48(uActiveCharacter); | |
9109 pTurnEngine->_40471C(); | |
9110 } | |
9111 } | |
9112 break; | |
9113 case INPUT_Combat: | |
17 | 9114 //__debugbreak(); |
0 | 9115 if ( !pCurrentScreen ) |
9116 { | |
9117 if (pParty->bTurnBasedModeOn) | |
9118 { | |
9119 if ( pTurnEngine->field_4 == 3 || (pTurnEngine->pQueue[0].uPackedID & 7) == 4 ) | |
9120 { | |
9121 pParty->bTurnBasedModeOn = 0; | |
9122 pTurnEngine->End(true); | |
9123 } | |
9124 } | |
9125 else | |
9126 { | |
9127 pTurnEngine->Start(); | |
9128 pParty->bTurnBasedModeOn = true; | |
9129 } | |
9130 } | |
9131 break; | |
9132 case INPUT_CastReady: | |
17 | 9133 //__debugbreak(); |
0 | 9134 if ( pCurrentScreen ) |
9135 break; | |
9136 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9137 //goto LABEL_118; |
9138 { | |
9139 pTurnEngine->field_18 |= 8u; | |
9140 break; | |
9141 } | |
0 | 9142 if ( !uActiveCharacter ) |
9143 break; | |
9144 v7 = pPlayers[uActiveCharacter]; | |
9145 v8 = v7->uQuickSpell; | |
9146 if ( !v8 | |
9147 || bUnderwater | |
9148 || ((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)), | |
9149 v10 > v7->sMana) ) | |
9150 { | |
9151 pActionQueue = pPartyActionQueue; | |
9152 LABEL_120: | |
9153 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
9154 { | |
9155 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23; | |
9156 goto _send_message; | |
9157 } | |
9158 } | |
9159 else | |
9160 { | |
9161 pActionQueue = pPartyActionQueue; | |
9162 if ( dword_50C9E8 < 40 ) | |
9163 { | |
9164 dword_50C9EC[3 * dword_50C9E8] = 25; | |
9165 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9166 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9167 ++dword_50C9E8; | |
9168 } | |
9169 } | |
9170 break; | |
9171 case INPUT_Attack: | |
17 | 9172 //__debugbreak(); |
0 | 9173 if ( pCurrentScreen ) |
9174 break; | |
9175 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
9176 goto LABEL_120; | |
17 | 9177 //LABEL_118: |
0 | 9178 pTurnEngine->field_18 |= 8u; |
9179 break; | |
9180 case INPUT_EventTrigger: | |
9181 if ( !pCurrentScreen ) | |
9182 { | |
9183 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9184 break; | |
9185 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
9186 goto _send_message; | |
9187 } | |
9188 if ( pCurrentScreen == 4 ) | |
9189 { | |
9190 v11 = pMessageQueue_50CBD0->uNumMessages; | |
9191 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9192 { | |
9193 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9194 { | |
9195 v11 = 1; | |
9196 pMessageQueue_50CBD0->uNumMessages = 1; | |
9197 LABEL_132: | |
9198 pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113; | |
9199 _send_message: | |
9200 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9201 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9202 ++pMessageQueue_50CBD0->uNumMessages; | |
9203 break; | |
9204 } | |
9205 v11 = 0; | |
9206 pMessageQueue_50CBD0->uNumMessages = 0; | |
9207 } | |
9208 if ( (signed int)v11 < 40 ) | |
9209 goto LABEL_132; | |
9210 } | |
9211 break; | |
9212 case INPUT_CharCycle: | |
17 | 9213 //__debugbreak(); |
0 | 9214 if ( pCurrentScreen == 8 |
9215 || dword_50C9E8 >= 40 ) | |
9216 break; | |
9217 dword_50C9EC[3 * dword_50C9E8] = 176; | |
9218 goto LABEL_155; | |
9219 case INPUT_LookUp: | |
17 | 9220 //__debugbreak(); |
0 | 9221 if ( pEventTimer->bPaused ) |
9222 break; | |
9223 partyAction = (PartyAction)7; | |
9224 goto _add_action_and_continue_; | |
9225 case INPUT_CenterView: | |
17 | 9226 //__debugbreak(); |
0 | 9227 if ( pEventTimer->bPaused ) |
9228 break; | |
9229 partyAction = (PartyAction)9; | |
9230 goto _add_action_and_continue_; | |
9231 case INPUT_LookDown: | |
17 | 9232 //__debugbreak(); |
0 | 9233 if ( pEventTimer->bPaused ) |
9234 break; | |
9235 partyAction = (PartyAction)8; | |
9236 goto _add_action_and_continue_; | |
9237 case INPUT_FlyUp: | |
17 | 9238 //__debugbreak(); |
0 | 9239 if ( pCurrentScreen |
9240 || pEventTimer->bPaused ) | |
9241 break; | |
9242 partyAction = (PartyAction)13; | |
9243 goto _add_action_and_continue_; | |
9244 case INPUT_Land: | |
17 | 9245 //__debugbreak(); |
0 | 9246 if ( pCurrentScreen |
9247 || pEventTimer->bPaused ) | |
9248 break; | |
9249 partyAction = (PartyAction)15; | |
9250 goto _add_action_and_continue_; | |
9251 case INPUT_FlyDown: | |
17 | 9252 //__debugbreak(); |
0 | 9253 if ( !pCurrentScreen |
9254 && !pEventTimer->bPaused ) | |
9255 { | |
9256 partyAction = (PartyAction)14; | |
9257 _add_action_and_continue_: | |
9258 v5 = pActionQueue; | |
9259 _add_action_and_continue: | |
9260 v5->Add(partyAction); | |
9261 } | |
9262 break; | |
9263 case INPUT_ZoomIn: | |
17 | 9264 //__debugbreak(); |
0 | 9265 if ( dword_50C9E8 >= 40 ) |
9266 break; | |
9267 dword_50C9EC[3 * dword_50C9E8] = 367; | |
9268 goto LABEL_155; | |
9269 case INPUT_ZoomOut: | |
17 | 9270 //__debugbreak(); |
0 | 9271 if ( dword_50C9E8 < 40 ) |
9272 { | |
9273 dword_50C9EC[3 * dword_50C9E8] = 368; | |
9274 LABEL_155: | |
9275 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9276 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9277 ++dword_50C9E8; | |
9278 } | |
9279 break; | |
9280 case INPUT_AlwaysRun: | |
9281 bAlwaysRun = bAlwaysRun == 0; | |
9282 break; | |
17 | 9283 default: |
9284 //__debugbreak(); | |
9285 break; | |
0 | 9286 } |
9287 } | |
9288 inputAction = (InputAction)((int)inputAction + 1); | |
9289 if ( (signed int)inputAction >= 30 ) | |
9290 goto LABEL_176; | |
9291 } | |
9292 } | |
9293 v12 = 0; | |
9294 do | |
9295 { | |
9296 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
9297 v13 = pGame->pKeyboardInstance; | |
9298 if ( pKeyActionMap->pToggleTypes[v12] ) | |
9299 v14 = v13->WasKeyPressed(v22); | |
9300 else | |
9301 v14 = v13->IsKeyBeingHeld(v22); | |
9302 if ( v14 && v12 == 9 ) | |
9303 { | |
9304 if ( !pCurrentScreen ) | |
9305 { | |
9306 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9307 goto LABEL_175; | |
9308 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 9309 //goto LABEL_174; |
9310 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9311 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9312 ++pMessageQueue_50CBD0->uNumMessages; | |
9313 goto LABEL_175; | |
0 | 9314 } |
9315 if ( pCurrentScreen == 4 | |
9316 || pCurrentScreen == 19 ) | |
9317 { | |
9318 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9319 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9320 { | |
9321 v15 = 0; | |
9322 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9323 { | |
9324 v15 = 1; | |
9325 pMessageQueue_50CBD0->uNumMessages = 1; | |
17 | 9326 //goto LABEL_173; |
9327 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; | |
9328 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9329 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9330 ++pMessageQueue_50CBD0->uNumMessages; | |
9331 goto LABEL_175; | |
0 | 9332 } |
9333 pMessageQueue_50CBD0->uNumMessages = 0; | |
9334 } | |
9335 if ( (signed int)v15 >= 40 ) | |
9336 goto LABEL_175; | |
17 | 9337 //LABEL_173: |
0 | 9338 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9339 //LABEL_174: |
0 | 9340 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9341 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9342 ++pMessageQueue_50CBD0->uNumMessages; | |
9343 goto LABEL_175; | |
9344 } | |
9345 } | |
9346 LABEL_175: | |
9347 ++v12; | |
9348 } | |
9349 while ( v12 < 30 ); | |
9350 LABEL_176: | |
9351 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9352 { | |
9353 AsyncKeyboard::LeaveCriticalSection(); | |
9354 v16 = pAsyncKeyboard; | |
9355 AsyncKeyboard::EnterCriticalSection(); | |
9356 memset((char *)v16 + 521, 0, 0x100u); | |
9357 AsyncKeyboard::LeaveCriticalSection(); | |
9358 } | |
9359 } | |
9360 |