Mercurial > mm7
annotate mm7_6.cpp @ 459:a7869569e912
HouseNPCData
author | Ritor1 |
---|---|
date | Sun, 24 Feb 2013 21:23:26 +0600 |
parents | acd8fa960c32 |
children | 0dbf780e247f |
rev | line source |
---|---|
0 | 1 #include "MM7.h" |
2 | |
3 #include "MapInfo.h" | |
4 #include "Game.h" | |
5 #include "GUIWindow.h" | |
6 #include "GUIFont.h" | |
7 #include "GUIButton.h" | |
8 #include "GUIProgressBar.h" | |
9 #include "Party.h" | |
10 #include "AudioPlayer.h" | |
11 #include "Outdoor.h" | |
12 #include "IndoorCamera.h" | |
13 #include "Overlays.h" | |
14 #include "Monsters.h" | |
15 #include "Arcomage.h" | |
16 #include "LOD.h" | |
17 #include "Actor.h" | |
18 #include "Allocator.h" | |
19 #include "Events.h" | |
20 #include "Viewport.h" | |
21 #include "FrameTableInc.h" | |
22 #include "Math.h" | |
23 #include "LayingItem.h" | |
24 #include "ObjectList.h" | |
25 #include "Chest.h" | |
26 #include "PaletteManager.h" | |
27 #include "DecorationList.h" | |
28 #include "SaveLoad.h" | |
29 #include "stru123.h" | |
30 #include "Time.h" | |
31 #include "IconFrameTable.h" | |
32 #include "stru179.h" | |
33 #include "Awards.h" | |
34 #include "Autonotes.h" | |
35 #include "stru160.h" | |
36 #include "stru279.h" | |
37 #include "TurnEngine.h" | |
38 #include "stru277.h" | |
39 #include "Weather.h" | |
40 #include "stru272.h" | |
41 #include "stru298.h" | |
189 | 42 #include "texts.h" |
0 | 43 #include "StorylineTextTable.h" |
44 #include "Events2D.h" | |
370 | 45 #include "Log.h" |
0 | 46 |
47 #include "mm7_data.h" | |
48 | |
49 | |
50 | |
51 //----- (00424EE0) -------------------------------------------------------- | |
52 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
53 { | |
54 unsigned int v1; // edx@1 | |
55 double v2; // st7@1 | |
56 signed int v3; // edi@1 | |
57 char *v4; // esi@4 | |
58 char *v5; // ecx@4 | |
59 unsigned int v6; // eax@4 | |
60 char *v7; // edx@4 | |
61 double v8; // st6@10 | |
62 double v9; // st5@10 | |
63 double v10; // st6@11 | |
64 unsigned __int8 v11; // c2@15 | |
65 unsigned __int8 v12; // c3@15 | |
66 void *v13; // edi@22 | |
67 char *v14; // eax@22 | |
68 double v15; // st6@22 | |
69 char *v16; // ecx@22 | |
70 signed int result; // eax@24 | |
71 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
72 bool v19; // [sp+Ch] [bp-28h]@6 | |
73 char *v20; // [sp+10h] [bp-24h]@4 | |
74 char *v21; // [sp+14h] [bp-20h]@4 | |
75 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
76 char *v23; // [sp+1Ch] [bp-18h]@4 | |
77 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
78 char *v25; // [sp+24h] [bp-10h]@4 | |
79 char *v26; // [sp+28h] [bp-Ch]@4 | |
80 char *v27; // [sp+2Ch] [bp-8h]@4 | |
81 char *v28; // [sp+30h] [bp-4h]@4 | |
82 | |
83 v1 = uVertexID; | |
84 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
85 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
86 v3 = 0; | |
87 v22 = 0; | |
88 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | |
89 v3 = 1; | |
90 if ( (signed int)(uVertexID + 1) <= 1 ) | |
91 return 0; | |
92 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
93 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
94 v6 = v1; | |
95 v23 = (char *)&array_507D30[0].flt_2C; | |
168 | 96 v26 = (char *)&array_507D30[0]._rhw; |
0 | 97 v24 = array_507D30; |
98 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
99 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
100 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
101 v27 = (char *)&array_507D30[0].v; | |
102 v28 = (char *)&array_507D30[0].u; | |
103 v7 = (char *)&array_50AC10[0].v; | |
104 v18 = v6; | |
105 do | |
106 { | |
107 v19 = v2 >= *((float *)v7 + 5); | |
108 if ( v3 != v19 ) | |
109 { | |
110 if ( v19 ) | |
111 { | |
112 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | |
113 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | |
114 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | |
115 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | |
116 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | |
117 } | |
118 else | |
119 { | |
120 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | |
121 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | |
122 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | |
123 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | |
124 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | |
125 } | |
126 *(float *)v27 = v9; | |
127 *(float *)v25 = v2; | |
128 *(float *)v26 = 1.0 / v2; | |
129 if ( v3 ) | |
130 { | |
131 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
132 { | |
133 v11 = 0; | |
134 v12 = *(float *)v4 == *((float *)v7 - 5); | |
135 goto LABEL_19; | |
136 } | |
137 } | |
138 else | |
139 { | |
140 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
141 { | |
142 v11 = 0; | |
143 v12 = *(float *)v4 == *((float *)v7 + 7); | |
144 LABEL_19: | |
145 if ( v12 | v11 ) | |
146 goto LABEL_21; | |
147 goto LABEL_20; | |
148 } | |
149 } | |
150 LABEL_20: | |
151 v26 += 48; | |
152 ++v24; | |
153 v25 += 48; | |
154 v27 += 48; | |
155 v28 += 48; | |
156 v5 += 48; | |
157 v4 += 48; | |
158 ++v22; | |
159 v23 += 48; | |
160 v21 = v5; | |
161 v20 = v4; | |
162 } | |
163 LABEL_21: | |
164 if ( v19 ) | |
165 { | |
166 v13 = v24; | |
167 v14 = v26; | |
168 v21 += 48; | |
169 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
170 v20 += 48; | |
171 ++v22; | |
172 v28 += 48; | |
173 v27 += 48; | |
174 v25 += 48; | |
175 ++v24; | |
176 v26 += 48; | |
177 memcpy(v13, v7 + 8, 0x30u); | |
178 v16 = v23; | |
179 v23 += 48; | |
180 v4 = v20; | |
181 *(float *)v14 = v15; | |
182 *(int *)v16 = *((int *)v7 + 13); | |
183 v5 = v21; | |
184 } | |
185 v3 = v19; | |
186 v7 += 48; | |
187 --v18; | |
188 } | |
189 while ( v18 ); | |
190 result = v22; | |
191 if ( v22 < 3 ) | |
192 return 0; | |
193 return result; | |
194 } | |
195 | |
196 //----- (004250FE) -------------------------------------------------------- | |
197 signed int __fastcall sr_4250FE(unsigned int uVertexID) | |
198 { | |
199 unsigned int v1; // edx@1 | |
200 char *v2; // edi@5 | |
201 char *v3; // esi@5 | |
202 char *v4; // ecx@5 | |
203 int v5; // ebx@6 | |
204 double v6; // st6@11 | |
205 double v7; // st5@11 | |
206 double v8; // st6@12 | |
207 unsigned __int8 v9; // c2@16 | |
208 unsigned __int8 v10; // c3@16 | |
209 void *v11; // edi@23 | |
210 double v12; // st6@23 | |
211 char *v13; // ecx@23 | |
212 char v14; // zf@24 | |
213 signed int result; // eax@25 | |
214 unsigned int v16; // [sp+8h] [bp-28h]@5 | |
215 bool v17; // [sp+Ch] [bp-24h]@2 | |
216 bool v18; // [sp+10h] [bp-20h]@7 | |
217 char *v19; // [sp+14h] [bp-1Ch]@5 | |
218 char *v20; // [sp+18h] [bp-18h]@5 | |
219 signed int v21; // [sp+1Ch] [bp-14h]@1 | |
220 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5 | |
221 char *v23; // [sp+24h] [bp-Ch]@5 | |
222 char *v24; // [sp+28h] [bp-8h]@5 | |
223 char *v25; // [sp+2Ch] [bp-4h]@5 | |
224 | |
225 v1 = uVertexID; | |
226 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
227 v21 = 0; | |
228 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0; | |
229 if ( (signed int)(uVertexID + 1) <= 1 ) | |
230 return 0; | |
231 v2 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
232 v3 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 233 v24 = (char *)&array_507D30[0]._rhw; |
0 | 234 v22 = array_507D30; |
235 v19 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
236 v20 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
237 v23 = (char *)&array_507D30[0].vWorldViewPosition; | |
238 v25 = (char *)&array_507D30[0].flt_2C; | |
239 v4 = (char *)&array_50AC10[0].vWorldViewPosition; | |
240 v16 = v1; | |
241 do | |
242 { | |
243 v5 = (int)(v4 + 48); | |
244 v18 = *((float *)v4 + 12) >= 8.0; | |
245 if ( v17 != v18 ) | |
246 { | |
247 if ( v18 ) | |
248 { | |
249 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4); | |
250 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1); | |
251 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2); | |
252 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8); | |
253 } | |
254 else | |
255 { | |
256 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5); | |
257 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13); | |
258 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14); | |
259 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20); | |
260 } | |
261 *(float *)v25 = v7; | |
262 *(float *)v23 = 8.0; | |
263 *(int *)v24 = 0x3E000000u; | |
264 if ( v17 ) | |
265 { | |
266 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) ) | |
267 { | |
268 v9 = 0; | |
269 v10 = *(float *)v2 == *((float *)v4 + 2); | |
270 goto LABEL_20; | |
271 } | |
272 } | |
273 else | |
274 { | |
275 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) ) | |
276 { | |
277 v9 = 0; | |
278 v10 = *(float *)v2 == *((float *)v4 + 14); | |
279 LABEL_20: | |
280 if ( v10 | v9 ) | |
281 goto LABEL_22; | |
282 goto LABEL_21; | |
283 } | |
284 } | |
285 LABEL_21: | |
286 ++v22; | |
287 v23 += 48; | |
288 v25 += 48; | |
289 v3 += 48; | |
290 v2 += 48; | |
291 ++v21; | |
292 v24 += 48; | |
293 v20 = v3; | |
294 v19 = v2; | |
295 } | |
296 LABEL_22: | |
297 if ( v18 ) | |
298 { | |
299 v11 = v22; | |
300 v20 += 48; | |
301 v19 += 48; | |
302 v12 = 1.0 / (*(float *)v5 + 0.0000001); | |
303 ++v21; | |
304 v25 += 48; | |
305 v23 += 48; | |
306 ++v22; | |
307 memcpy(v11, v4 + 36, 0x30u); | |
308 v13 = v24; | |
309 v24 += 48; | |
310 v3 = v20; | |
311 v2 = v19; | |
312 *(float *)v13 = v12; | |
313 } | |
314 v14 = v16-- == 1; | |
315 v17 = v18; | |
316 v4 = (char *)v5; | |
317 } | |
318 while ( !v14 ); | |
319 result = v21; | |
320 if ( v21 < 3 ) | |
321 return 0; | |
322 return result; | |
323 } | |
324 | |
325 //----- (004252E8) -------------------------------------------------------- | |
326 signed int __fastcall sr_4252E8(unsigned int uVertexID) | |
327 { | |
328 unsigned int v1; // edx@1 | |
329 double v2; // st7@1 | |
330 char *v3; // edi@5 | |
331 char *v4; // esi@5 | |
332 char *v5; // ecx@5 | |
333 int v6; // ebx@6 | |
334 double v7; // st6@11 | |
335 double v8; // st5@11 | |
336 double v9; // st6@12 | |
337 unsigned __int8 v10; // c2@16 | |
338 unsigned __int8 v11; // c3@16 | |
339 void *v12; // edi@23 | |
340 double v13; // st6@23 | |
341 char *v14; // ecx@23 | |
342 char v15; // zf@24 | |
343 signed int result; // eax@25 | |
344 unsigned int v17; // [sp+8h] [bp-28h]@5 | |
345 bool v18; // [sp+Ch] [bp-24h]@2 | |
346 bool v19; // [sp+10h] [bp-20h]@7 | |
347 char *v20; // [sp+14h] [bp-1Ch]@5 | |
348 char *v21; // [sp+18h] [bp-18h]@5 | |
349 signed int v22; // [sp+1Ch] [bp-14h]@1 | |
350 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5 | |
351 char *v24; // [sp+24h] [bp-Ch]@5 | |
352 char *v25; // [sp+28h] [bp-8h]@5 | |
353 char *v26; // [sp+2Ch] [bp-4h]@5 | |
354 | |
355 v1 = uVertexID; | |
356 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
357 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
358 v22 = 0; | |
359 v18 = array_50AC10[0].vWorldViewPosition.x <= v2; | |
360 if ( (signed int)(uVertexID + 1) <= 1 ) | |
361 return 0; | |
362 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
363 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 364 v25 = (char *)&array_507D30[0]._rhw; |
0 | 365 v23 = array_507D30; |
366 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
367 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
368 v24 = (char *)&array_507D30[0].vWorldViewPosition; | |
369 v26 = (char *)&array_507D30[0].flt_2C; | |
370 v5 = (char *)&array_50AC10[0].vWorldViewPosition; | |
371 v17 = v1; | |
372 do | |
373 { | |
374 v6 = (int)(v5 + 48); | |
375 v19 = v2 >= *((float *)v5 + 12); | |
376 if ( v18 != v19 ) | |
377 { | |
378 if ( v19 ) | |
379 { | |
380 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5); | |
381 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1); | |
382 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2); | |
383 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8); | |
384 } | |
385 else | |
386 { | |
387 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6); | |
388 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13); | |
389 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14); | |
390 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20); | |
391 } | |
392 *(float *)v26 = v8; | |
393 *(float *)v24 = v2; | |
394 *(float *)v25 = 1.0 / v2; | |
395 if ( v18 ) | |
396 { | |
397 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) ) | |
398 { | |
399 v10 = 0; | |
400 v11 = *(float *)v3 == *((float *)v5 + 2); | |
401 goto LABEL_20; | |
402 } | |
403 } | |
404 else | |
405 { | |
406 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) ) | |
407 { | |
408 v10 = 0; | |
409 v11 = *(float *)v3 == *((float *)v5 + 14); | |
410 LABEL_20: | |
411 if ( v11 | v10 ) | |
412 goto LABEL_22; | |
413 goto LABEL_21; | |
414 } | |
415 } | |
416 LABEL_21: | |
417 ++v23; | |
418 v24 += 48; | |
419 v26 += 48; | |
420 v4 += 48; | |
421 v3 += 48; | |
422 ++v22; | |
423 v25 += 48; | |
424 v21 = v4; | |
425 v20 = v3; | |
426 } | |
427 LABEL_22: | |
428 if ( v19 ) | |
429 { | |
430 v12 = v23; | |
431 v21 += 48; | |
432 v20 += 48; | |
433 v13 = 1.0 / (*(float *)v6 + 0.0000001); | |
434 ++v22; | |
435 v26 += 48; | |
436 v24 += 48; | |
437 ++v23; | |
438 memcpy(v12, v5 + 36, 0x30u); | |
439 v14 = v25; | |
440 v25 += 48; | |
441 v4 = v21; | |
442 v3 = v20; | |
443 *(float *)v14 = v13; | |
444 } | |
445 v15 = v17-- == 1; | |
446 v18 = v19; | |
447 v5 = (char *)v6; | |
448 } | |
449 while ( !v15 ); | |
450 result = v22; | |
451 if ( v22 < 3 ) | |
452 return 0; | |
453 return result; | |
454 } | |
455 | |
456 | |
457 | |
458 //----- (004361EF) -------------------------------------------------------- | |
459 IndoorCameraD3D::IndoorCameraD3D() | |
460 { | |
461 IndoorCameraD3D *v1; // esi@1 | |
462 double v2; // st7@1 | |
463 double v3; // st6@1 | |
464 double v4; // st5@1 | |
465 double v5; // st7@1 | |
466 double v6; // st6@1 | |
467 double v7; // st5@1 | |
468 | |
469 v1 = this; | |
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4); | |
471 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14); | |
472 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24); | |
473 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, | |
474 24, | |
475 6, | |
476 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
477 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ | |
478 v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
479 v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
480 v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; | |
481 v1->field_108 = 0.0; | |
482 v1->field_DC = v4; | |
483 v1->field_E0 = v3; | |
484 v1->field_E4 = v2; | |
485 v5 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
486 v6 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
487 v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300); | |
488 v1->field_138 = 0.0; | |
489 v1->field_10C = v7; | |
490 v1->field_110 = v6; | |
491 v1->field_114 = v5; | |
492 v1->field_168 = 0.0; | |
493 v1->field_198 = 0.0; | |
494 v1->field_1C8 = 0.0; | |
495 v1->field_1F8 = 0.0; | |
496 v1->field_228 = 0.0; | |
497 v1->field_258 = 0.0; | |
498 v1->field_288 = 0.0; | |
499 v1->field_2B8 = 0.0; | |
500 v1->field_2E8 = 0.0; | |
501 v1->field_2BC = 0.0; | |
502 v1->field_2C0 = 0.0; | |
503 v1->field_2C4 = 0.0; | |
504 v1->field_318 = 0.0; | |
505 v1->field_2EC = 0.0; | |
506 v1->field_2F0 = 0.0; | |
507 v1->field_2F4 = 0.0; | |
508 v1->field_348 = 0.0; | |
509 v1->field_31C = 0.0; | |
510 v1->field_320 = 0.0; | |
511 v1->field_324 = 0.0; | |
512 v1->field_378 = 0.0; | |
513 v1->field_34C = 0.0; | |
514 v1->field_350 = 0.0; | |
515 v1->field_354 = 0.0; | |
516 for (uint i = 0; i < 16384; ++i) | |
517 { | |
518 list_0037C[i].field_0 = 0; | |
519 list_0037C[i].flt_30 = 0.0f; | |
520 } | |
521 | |
522 list_0037C_size = 0; | |
523 for (uint i = 0; i < 256; ++i) | |
524 list_E0380[i].mm7__vector_000004_size = 0; | |
525 /*v10 = v1->list_E0380; | |
526 v12 = 256; | |
527 do | |
528 { | |
529 v10->mm7__vector_000004_size = 0; | |
530 //mm7__vector_constructor( | |
531 // v10->mm7__vector_000004, | |
532 // 48, | |
533 // 64, | |
534 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); | |
535 //++v10; | |
536 --v12; | |
537 } | |
538 while ( v12 );*/ | |
539 list_E0380_size = 0; | |
540 //v1->vdestructor_ptr = &stru8_pvdtor; | |
541 } | |
542 | |
543 | |
544 //----- (004254D2) -------------------------------------------------------- | |
545 int __fastcall sr_4254D2(signed int a1) | |
546 { | |
547 signed int v1; // ebx@2 | |
548 int v2; // ecx@2 | |
549 int result; // eax@11 | |
550 double v4; // ST74_8@12 | |
551 bool v5; // edi@12 | |
552 char *v6; // esi@13 | |
553 char *v7; // ebx@13 | |
554 double v8; // st7@15 | |
555 double v9; // st7@16 | |
556 double v10; // st6@16 | |
557 double v11; // st7@17 | |
558 float v12; // eax@18 | |
559 double v13; // ST4C_8@19 | |
560 double v14; // ST10_8@19 | |
561 double v15; // ST28_8@20 | |
562 double v16; // ST34_8@20 | |
563 char v17; // zf@20 | |
564 double v18; // ST18_8@21 | |
565 double v19; // ST3C_8@21 | |
566 double v20; // ST44_8@22 | |
567 double v21; // ST54_8@22 | |
568 void *v22; // edi@26 | |
569 double v23; // ST54_8@29 | |
570 bool v24; // esi@29 | |
571 char *v25; // edi@30 | |
572 char *v26; // ebx@30 | |
573 bool v27; // ecx@32 | |
574 double v28; // st7@33 | |
575 double v29; // st7@34 | |
576 double v30; // st6@34 | |
577 double v31; // st7@35 | |
578 double v32; // ST44_8@37 | |
579 double v33; // ST3C_8@37 | |
580 double v34; // ST18_8@38 | |
581 double v35; // ST34_8@38 | |
582 char v36; // zf@38 | |
583 double v37; // ST28_8@39 | |
584 double v38; // ST10_8@39 | |
585 double v39; // ST20_8@40 | |
586 double v40; // ST5C_8@40 | |
587 void *v41; // edi@44 | |
588 double v42; // ST5C_8@47 | |
589 bool v43; // edi@47 | |
590 char *v44; // esi@48 | |
591 char *v45; // ebx@48 | |
592 bool v46; // ecx@49 | |
593 double v47; // st6@50 | |
594 double v48; // st6@51 | |
595 double v49; // st5@51 | |
596 double v50; // st6@52 | |
597 double v51; // ST20_8@54 | |
598 double v52; // ST54_8@54 | |
599 double v53; // ST44_8@55 | |
600 double v54; // ST3C_8@55 | |
601 char v55; // zf@55 | |
602 double v56; // ST18_8@56 | |
603 double v57; // ST34_8@56 | |
604 double v58; // ST28_8@57 | |
605 double v59; // ST10_8@57 | |
606 void *v60; // edi@61 | |
607 double v61; // ST5C_8@64 | |
608 bool v62; // edi@64 | |
609 char *v63; // esi@65 | |
610 char *v64; // ebx@65 | |
611 bool v65; // ecx@66 | |
612 double v66; // st6@67 | |
613 double v67; // st6@68 | |
614 double v68; // st5@68 | |
615 double v69; // st6@69 | |
616 double v70; // ST20_8@71 | |
617 double v71; // ST54_8@71 | |
618 double v72; // ST44_8@72 | |
619 double v73; // ST3C_8@72 | |
620 char v74; // zf@72 | |
621 double v75; // ST18_8@73 | |
622 double v76; // ST34_8@73 | |
623 double v77; // ST28_8@74 | |
624 double v78; // ST10_8@74 | |
625 void *v79; // edi@78 | |
626 int v80; // ebx@81 | |
627 char *v81; // ecx@82 | |
628 signed int v82; // esi@82 | |
629 float v83; // ST78_4@83 | |
630 double v84; // ST5C_8@83 | |
631 float v85; // eax@84 | |
632 double v86; // ST20_8@85 | |
633 double v87; // ST54_8@88 | |
634 float v88; // eax@89 | |
635 double v89; // ST44_8@90 | |
636 unsigned __int8 v90; // sf@94 | |
637 unsigned __int8 v91; // of@94 | |
638 int v92; // edx@97 | |
639 int v93; // esi@97 | |
640 int v94; // edi@97 | |
641 int v95; // eax@97 | |
642 int v96; // eax@104 | |
643 double v97; // [sp+4Ch] [bp-8Ch]@32 | |
644 double v98; // [sp+54h] [bp-84h]@49 | |
645 double v99; // [sp+54h] [bp-84h]@66 | |
646 float v100; // [sp+5Ch] [bp-7Ch]@1 | |
647 float v101; // [sp+60h] [bp-78h]@1 | |
648 float v102; // [sp+64h] [bp-74h]@1 | |
649 double v103; // [sp+6Ch] [bp-6Ch]@14 | |
650 float v104; // [sp+A8h] [bp-30h]@1 | |
651 signed int v105; // [sp+A8h] [bp-30h]@96 | |
652 bool v106; // [sp+ACh] [bp-2Ch]@14 | |
653 bool v107; // [sp+ACh] [bp-2Ch]@32 | |
654 bool v108; // [sp+ACh] [bp-2Ch]@49 | |
655 bool v109; // [sp+ACh] [bp-2Ch]@66 | |
656 signed int v110; // [sp+B0h] [bp-28h]@12 | |
657 char *v111; // [sp+B8h] [bp-20h]@30 | |
658 signed int v112; // [sp+B8h] [bp-20h]@48 | |
659 signed int v113; // [sp+B8h] [bp-20h]@65 | |
660 char *v114; // [sp+BCh] [bp-1Ch]@13 | |
661 signed int v115; // [sp+BCh] [bp-1Ch]@29 | |
662 signed int v116; // [sp+BCh] [bp-1Ch]@64 | |
663 signed int v117; // [sp+C0h] [bp-18h]@1 | |
664 char *v118; // [sp+C0h] [bp-18h]@30 | |
665 char *v119; // [sp+C0h] [bp-18h]@48 | |
666 char *v120; // [sp+C0h] [bp-18h]@65 | |
667 char *v121; // [sp+C4h] [bp-14h]@13 | |
668 char *v122; // [sp+C4h] [bp-14h]@30 | |
669 signed int v123; // [sp+C4h] [bp-14h]@47 | |
670 char *v124; // [sp+C8h] [bp-10h]@30 | |
671 char *v125; // [sp+C8h] [bp-10h]@48 | |
672 char *v126; // [sp+C8h] [bp-10h]@65 | |
673 signed int v127; // [sp+CCh] [bp-Ch]@2 | |
674 char *v128; // [sp+CCh] [bp-Ch]@13 | |
675 char *v129; // [sp+CCh] [bp-Ch]@30 | |
676 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48 | |
677 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65 | |
678 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13 | |
679 char *v133; // [sp+D0h] [bp-8h]@30 | |
680 char *v134; // [sp+D0h] [bp-8h]@48 | |
681 char *v135; // [sp+D0h] [bp-8h]@65 | |
682 signed int v136; // [sp+D4h] [bp-4h]@1 | |
683 char *v137; // [sp+D4h] [bp-4h]@13 | |
684 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30 | |
685 char *v139; // [sp+D4h] [bp-4h]@48 | |
686 char *v140; // [sp+D4h] [bp-4h]@65 | |
687 | |
688 v101 = (double)(signed int)pViewport->uViewportX; | |
689 v100 = (double)(signed int)pViewport->uViewportZ; | |
690 v117 = a1; | |
691 v136 = 1; | |
692 v104 = (double)(signed int)pViewport->uViewportY; | |
693 v102 = (double)(pViewport->uViewportW + 1); | |
694 if ( a1 <= 0 ) | |
695 return v117; | |
696 v127 = a1; | |
697 v1 = a1; | |
698 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2)); | |
699 v2 = 0; | |
700 do | |
701 { | |
702 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 ) | |
703 v136 = 0; | |
704 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 ) | |
705 v136 = 0; | |
706 ++v2; | |
707 --v127; | |
708 } | |
709 while ( v127 ); | |
710 if ( v136 ) | |
711 return v117; | |
712 v110 = 0; | |
713 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1])); | |
714 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15; | |
715 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportX; | |
716 if ( v117 < 1 ) | |
717 goto LABEL_112; | |
718 v6 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
719 v132 = array_50A2B0; | |
720 v137 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
721 v128 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
722 v121 = (char *)&array_50A2B0[0].flt_2C; | |
168 | 723 v114 = (char *)&array_50A2B0[0]._rhw; |
0 | 724 v7 = (char *)&array_50AC10[0].flt_2C; |
725 do | |
726 { | |
727 v103 = *((float *)v7 + 7) + 6.7553994e15; | |
728 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportX; | |
729 if ( !(v5 ^ v106) ) | |
730 goto LABEL_25; | |
731 v8 = v101; | |
732 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportX ) | |
733 { | |
734 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5)); | |
735 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4); | |
736 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3); | |
737 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7; | |
738 } | |
739 else | |
740 { | |
741 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7)); | |
742 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8); | |
743 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9); | |
744 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12); | |
745 } | |
746 *(float *)v121 = v10; | |
747 *(int *)v137 = LODWORD(v101); | |
748 LODWORD(v12) = *(int *)v6; | |
749 if ( v5 ) | |
750 { | |
751 v13 = v12 + 6.7553994e15; | |
752 v14 = *((float *)v7 - 4) + 6.7553994e15; | |
753 if ( LODWORD(v13) == LODWORD(v14) ) | |
754 { | |
755 v15 = *(float *)v137 + 6.7553994e15; | |
756 v16 = *((float *)v7 - 5) + 6.7553994e15; | |
757 v17 = LODWORD(v15) == LODWORD(v16); | |
758 goto LABEL_23; | |
759 } | |
760 } | |
761 else | |
762 { | |
763 v18 = v12 + 6.7553994e15; | |
764 v19 = *((float *)v7 + 8) + 6.7553994e15; | |
765 if ( LODWORD(v18) == LODWORD(v19) ) | |
766 { | |
767 v20 = *(float *)v137 + 6.7553994e15; | |
768 v21 = *((float *)v7 + 7) + 6.7553994e15; | |
769 v17 = LODWORD(v20) == LODWORD(v21); | |
770 LABEL_23: | |
771 if ( v17 ) | |
772 goto LABEL_25; | |
773 goto LABEL_24; | |
774 } | |
775 } | |
776 LABEL_24: | |
777 v121 += 48; | |
778 v114 += 48; | |
779 v6 += 48; | |
780 ++v110; | |
781 ++v132; | |
782 v128 = v6; | |
783 v137 += 48; | |
784 LABEL_25: | |
785 if ( v106 ) | |
786 { | |
787 v22 = v132; | |
788 v128 += 48; | |
789 ++v110; | |
790 v114 += 48; | |
791 v121 += 48; | |
792 v137 += 48; | |
793 ++v132; | |
794 memcpy(v22, v7 + 4, 0x30u); | |
795 v6 = v128; | |
796 } | |
797 v5 = v106; | |
798 v7 += 48; | |
799 --v117; | |
800 } | |
801 while ( v117 ); | |
802 if ( v110 < 3 | |
803 || (v115 = 0, | |
804 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])), | |
805 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15, | |
806 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportZ, | |
807 v110 < 1) ) | |
808 goto LABEL_112; | |
168 | 809 v25 = (char *)&array_509950[0]._rhw; |
0 | 810 v138 = array_509950; |
811 v129 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
812 v118 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
813 v133 = (char *)&array_509950[0].vWorldViewProjX; | |
814 v122 = (char *)&array_509950[0].vWorldViewProjY; | |
815 v124 = (char *)&array_509950[0].flt_2C; | |
168 | 816 v111 = (char *)&array_509950[0]._rhw; |
0 | 817 v26 = (char *)&array_50A2B0[0].flt_2C; |
818 while ( 2 ) | |
819 { | |
820 v97 = *((float *)v26 + 7) + 6.7553994e15; | |
821 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
822 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
823 if ( v24 != v27 ) | |
824 { | |
825 v28 = v100; | |
826 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportZ ) | |
827 { | |
828 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5)); | |
829 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4); | |
830 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3); | |
831 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26; | |
832 } | |
833 else | |
834 { | |
835 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7)); | |
836 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8); | |
837 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9); | |
838 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12); | |
839 } | |
840 *(float *)v124 = v30; | |
841 *(int *)v133 = LODWORD(v100); | |
842 if ( v24 ) | |
843 { | |
844 v32 = *(float *)v122 + 6.7553994e15; | |
845 v33 = *((float *)v26 - 4) + 6.7553994e15; | |
846 if ( LODWORD(v32) == LODWORD(v33) ) | |
847 { | |
848 v34 = *(float *)v133 + 6.7553994e15; | |
849 v35 = *((float *)v26 - 5) + 6.7553994e15; | |
850 v36 = LODWORD(v34) == LODWORD(v35); | |
851 goto LABEL_41; | |
852 } | |
853 goto LABEL_42; | |
854 } | |
855 v37 = *(float *)v118 + 6.7553994e15; | |
856 v38 = *((float *)v26 + 8) + 6.7553994e15; | |
857 if ( LODWORD(v37) != LODWORD(v38) ) | |
858 goto LABEL_42; | |
859 v39 = *(float *)v129 + 6.7553994e15; | |
860 v40 = *((float *)v26 + 7) + 6.7553994e15; | |
861 v36 = LODWORD(v39) == LODWORD(v40); | |
862 LABEL_41: | |
863 if ( !v36 ) | |
864 { | |
865 LABEL_42: | |
866 v129 += 48; | |
867 v118 += 48; | |
868 v133 += 48; | |
869 v122 += 48; | |
870 v124 += 48; | |
871 v111 += 48; | |
872 ++v115; | |
873 ++v138; | |
874 } | |
875 } | |
876 if ( v27 ) | |
877 { | |
878 v41 = v138; | |
879 ++v115; | |
880 v111 += 48; | |
881 v124 += 48; | |
882 v122 += 48; | |
883 v133 += 48; | |
884 v118 += 48; | |
885 v129 += 48; | |
886 ++v138; | |
887 memcpy(v41, v26 + 4, 0x30u); | |
888 } | |
889 v24 = v107; | |
890 v26 += 48; | |
891 --v110; | |
892 if ( v110 ) | |
893 { | |
894 v25 = v111; | |
895 continue; | |
896 } | |
897 break; | |
898 } | |
899 if ( v115 < 3 | |
900 || (v123 = 0, | |
901 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])), | |
902 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15, | |
903 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportY, | |
904 v115 < 1) ) | |
905 goto LABEL_112; | |
906 v44 = (char *)&array_508FF0[0].vWorldViewProjX; | |
907 v130 = array_508FF0; | |
908 v119 = (char *)&array_508FF0[0].vWorldViewProjX; | |
909 v139 = (char *)&array_508FF0[0].vWorldViewProjY; | |
910 v125 = (char *)&array_508FF0[0].flt_2C; | |
168 | 911 v134 = (char *)&array_508FF0[0]._rhw; |
0 | 912 v45 = (char *)&array_509950[0].flt_2C; |
913 v112 = v115; | |
914 while ( 2 ) | |
915 { | |
916 v98 = *((float *)v45 + 8) + 6.7553994e15; | |
917 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
918 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
919 if ( v43 != v46 ) | |
920 { | |
921 v47 = v104; | |
922 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportY ) | |
923 { | |
924 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4)); | |
925 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5); | |
926 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3); | |
927 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45; | |
928 } | |
929 else | |
930 { | |
931 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8)); | |
932 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7); | |
933 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9); | |
934 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12); | |
935 } | |
936 *(float *)v125 = v49; | |
937 *(float *)v139 = v104; | |
938 if ( v43 ) | |
939 { | |
940 v51 = v104 + 6.7553994e15; | |
941 v52 = *((float *)v45 - 4) + 6.7553994e15; | |
942 if ( LODWORD(v51) == LODWORD(v52) ) | |
943 { | |
944 v53 = *(float *)v44 + 6.7553994e15; | |
945 v54 = *((float *)v45 - 5) + 6.7553994e15; | |
946 v55 = LODWORD(v53) == LODWORD(v54); | |
947 goto LABEL_58; | |
948 } | |
949 goto LABEL_59; | |
950 } | |
951 v56 = v104 + 6.7553994e15; | |
952 v57 = *((float *)v45 + 8) + 6.7553994e15; | |
953 if ( LODWORD(v56) != LODWORD(v57) ) | |
954 goto LABEL_59; | |
955 v58 = *(float *)v44 + 6.7553994e15; | |
956 v59 = *((float *)v45 + 7) + 6.7553994e15; | |
957 v55 = LODWORD(v58) == LODWORD(v59); | |
958 LABEL_58: | |
959 if ( !v55 ) | |
960 { | |
961 LABEL_59: | |
962 v139 += 48; | |
963 v125 += 48; | |
964 v134 += 48; | |
965 v44 += 48; | |
966 ++v123; | |
967 ++v130; | |
968 v119 = v44; | |
969 } | |
970 } | |
971 if ( v46 ) | |
972 { | |
973 v60 = v130; | |
974 v119 += 48; | |
975 ++v123; | |
976 v134 += 48; | |
977 v125 += 48; | |
978 v139 += 48; | |
979 ++v130; | |
980 memcpy(v60, v45 + 4, 0x30u); | |
981 v44 = v119; | |
982 } | |
983 v43 = v108; | |
984 v45 += 48; | |
985 --v112; | |
986 if ( v112 ) | |
987 continue; | |
988 break; | |
989 } | |
990 if ( v123 < 3 | |
991 || (v116 = 0, | |
992 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])), | |
993 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15, | |
994 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportW, | |
995 v123 < 1) ) | |
996 goto LABEL_112; | |
997 v63 = (char *)&array_508690[0].vWorldViewProjX; | |
998 v131 = array_508690; | |
999 v120 = (char *)&array_508690[0].vWorldViewProjX; | |
1000 v140 = (char *)&array_508690[0].vWorldViewProjY; | |
1001 v126 = (char *)&array_508690[0].flt_2C; | |
168 | 1002 v135 = (char *)&array_508690[0]._rhw; |
0 | 1003 v64 = (char *)&array_508FF0[0].flt_2C; |
1004 v113 = v123; | |
1005 while ( 2 ) | |
1006 { | |
1007 v99 = *((float *)v64 + 8) + 6.7553994e15; | |
1008 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1009 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1010 if ( v62 != v65 ) | |
1011 { | |
1012 v66 = v102; | |
1013 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportW ) | |
1014 { | |
1015 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4)); | |
1016 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5); | |
1017 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3); | |
1018 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64; | |
1019 } | |
1020 else | |
1021 { | |
1022 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8)); | |
1023 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7); | |
1024 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9); | |
1025 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12); | |
1026 } | |
1027 *(float *)v126 = v68; | |
1028 *(float *)v140 = v102; | |
1029 if ( v62 ) | |
1030 { | |
1031 v70 = v102 + 6.7553994e15; | |
1032 v71 = *((float *)v64 - 4) + 6.7553994e15; | |
1033 if ( LODWORD(v70) == LODWORD(v71) ) | |
1034 { | |
1035 v72 = *(float *)v63 + 6.7553994e15; | |
1036 v73 = *((float *)v64 - 5) + 6.7553994e15; | |
1037 v74 = LODWORD(v72) == LODWORD(v73); | |
1038 goto LABEL_75; | |
1039 } | |
1040 goto LABEL_76; | |
1041 } | |
1042 v75 = v102 + 6.7553994e15; | |
1043 v76 = *((float *)v64 + 8) + 6.7553994e15; | |
1044 if ( LODWORD(v75) != LODWORD(v76) ) | |
1045 goto LABEL_76; | |
1046 v77 = *(float *)v63 + 6.7553994e15; | |
1047 v78 = *((float *)v64 + 7) + 6.7553994e15; | |
1048 v74 = LODWORD(v77) == LODWORD(v78); | |
1049 LABEL_75: | |
1050 if ( !v74 ) | |
1051 { | |
1052 LABEL_76: | |
1053 v140 += 48; | |
1054 v126 += 48; | |
1055 v135 += 48; | |
1056 v63 += 48; | |
1057 ++v116; | |
1058 ++v131; | |
1059 v120 = v63; | |
1060 } | |
1061 } | |
1062 if ( v65 ) | |
1063 { | |
1064 v79 = v131; | |
1065 v120 += 48; | |
1066 ++v116; | |
1067 v135 += 48; | |
1068 v126 += 48; | |
1069 v140 += 48; | |
1070 ++v131; | |
1071 memcpy(v79, v64 + 4, 0x30u); | |
1072 v63 = v120; | |
1073 } | |
1074 v62 = v109; | |
1075 v64 += 48; | |
1076 --v113; | |
1077 if ( v113 ) | |
1078 continue; | |
1079 break; | |
1080 } | |
1081 if ( v116 < 3 ) | |
1082 goto LABEL_112; | |
1083 v80 = v116; | |
1084 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116])); | |
1085 if ( v116 > 0 ) | |
1086 { | |
1087 v81 = (char *)&array_508690[0].vWorldViewProjX; | |
1088 v82 = v116; | |
1089 do | |
1090 { | |
1091 LODWORD(v83) = *(int *)v81; | |
1092 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2); | |
1093 v84 = v83 + 6.7553994e15; | |
1094 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportZ ) | |
1095 { | |
1096 v86 = *(float *)v81 + 6.7553994e15; | |
1097 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportX ) | |
1098 goto LABEL_88; | |
1099 v85 = v101; | |
1100 } | |
1101 else | |
1102 { | |
1103 v85 = v100; | |
1104 } | |
1105 *(int *)v81 = LODWORD(v85); | |
1106 LABEL_88: | |
1107 v87 = *((float *)v81 + 1) + 6.7553994e15; | |
1108 if ( SLODWORD(v87) > (signed int)pViewport->uViewportW ) | |
1109 { | |
1110 v88 = v102; | |
1111 LABEL_92: | |
1112 *((int *)v81 + 1) = LODWORD(v88); | |
1113 goto LABEL_93; | |
1114 } | |
1115 v89 = *((float *)v81 + 1) + 6.7553994e15; | |
1116 if ( SLODWORD(v89) < (signed int)pViewport->uViewportY ) | |
1117 { | |
1118 v88 = v104; | |
1119 goto LABEL_92; | |
1120 } | |
1121 LABEL_93: | |
1122 v81 += 48; | |
1123 --v82; | |
1124 } | |
1125 while ( v82 ); | |
1126 } | |
1127 v91 = __OFSUB__(v116, 3); | |
1128 v90 = v116 - 3 < 0; | |
1129 if ( v116 > 3 ) | |
1130 { | |
1131 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1])); | |
1132 if ( v116 > 0 ) | |
1133 { | |
1134 v105 = 1; | |
1135 do | |
1136 { | |
1137 v92 = v105; | |
1138 v93 = v105 - 1; | |
1139 v94 = v105 + 1; | |
1140 v95 = v105 + 1; | |
1141 if ( v105 - 1 >= v80 ) | |
1142 v93 -= v80; | |
1143 if ( v105 >= v80 ) | |
1144 v92 = v105 - v80; | |
1145 if ( v94 >= v80 ) | |
1146 v95 = v94 - v80; | |
1147 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1148 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY) | |
1149 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1150 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 ) | |
1151 { | |
1152 ++v105; | |
1153 } | |
1154 else | |
1155 { | |
1156 v96 = v105; | |
1157 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) ) | |
1158 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2)); | |
1159 --v80; | |
1160 } | |
1161 } | |
1162 while ( v105 - 1 < v80 ); | |
1163 } | |
1164 v91 = __OFSUB__(v80, 3); | |
1165 v90 = v80 - 3 < 0; | |
1166 } | |
1167 if ( v90 ^ v91 ) | |
1168 LABEL_112: | |
1169 result = 0; | |
1170 else | |
1171 result = v80; | |
1172 return result; | |
1173 } | |
1174 | |
1175 //----- (0042620A) -------------------------------------------------------- | |
1176 bool __thiscall sr_42620A(RenderVertexSoft *p) | |
1177 { | |
1178 __int16 v1; // fps@1 | |
1179 unsigned __int8 v2; // c0@2 | |
1180 char v3; // c2@2 | |
1181 unsigned __int8 v4; // c3@2 | |
1182 bool result; // eax@2 | |
1183 unsigned __int8 v6; // c0@4 | |
1184 char v7; // c2@4 | |
1185 unsigned __int8 v8; // c3@4 | |
1186 unsigned __int8 v9; // c0@6 | |
1187 char v10; // c2@6 | |
1188 unsigned __int8 v11; // c3@6 | |
1189 double v12; // st6@7 | |
1190 float v13; // ST04_4@7 | |
1191 float v14; // ST00_4@7 | |
1192 double v15; // st7@7 | |
1193 double v16; // st6@8 | |
1194 float v17; // ST04_4@8 | |
1195 float v18; // ST00_4@8 | |
1196 double v19; // st7@8 | |
1197 | |
1198 //UNDEF(v1); | |
1199 if ( p->vWorldViewPosition.x < 300.0 | |
1200 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
1201 v3 = 0, | |
1202 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
1203 BYTE1(result) = HIBYTE(v1), | |
1204 !(v2 | v4)) ) | |
1205 { | |
1206 if ( p->vWorldViewPosition.x < 300.0 ) | |
1207 { | |
1208 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
1209 v7 = 0; | |
1210 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
1211 BYTE1(result) = HIBYTE(v1); | |
1212 if ( !(v6 | v8) ) | |
1213 { | |
1214 LOBYTE(result) = 0; | |
1215 return result; | |
1216 } | |
1217 } | |
1218 v9 = 300.0 < p->vWorldViewPosition.x; | |
1219 v10 = 0; | |
1220 v11 = 300.0 == p->vWorldViewPosition.x; | |
1221 BYTE1(result) = HIBYTE(v1); | |
1222 if ( v9 | v11 ) | |
1223 { | |
1224 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
1225 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
1226 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
1227 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
1228 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
1229 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
1230 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
1231 } | |
1232 else | |
1233 { | |
1234 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
1235 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
1236 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
1237 v15 = 300.0 - p->vWorldViewPosition.x; | |
1238 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
1239 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
1240 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
1241 } | |
1242 } | |
1243 LOBYTE(result) = 1; | |
1244 return result; | |
1245 } | |
1246 | |
1247 | |
1248 | |
1249 | |
1250 //----- (004268E3) -------------------------------------------------------- | |
1251 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) | |
1252 { | |
1253 unsigned int v1; // eax@1 | |
1254 unsigned int v2; // edx@1 | |
1255 int v3; // eax@1 | |
1256 int v4; // edx@1 | |
1257 unsigned int v5; // ecx@1 | |
1258 | |
1259 v1 = uColor >> 9; | |
1260 v2 = uColor >> 6; | |
1261 LOWORD(v1) = (uColor >> 9) & 0x7C00; | |
1262 LOWORD(v2) = (uColor >> 6) & 0x3E0; | |
1263 v3 = v2 | v1; | |
1264 v4 = (unsigned __int8)uColor >> 3; | |
1265 v5 = uColor >> 16; | |
1266 LOWORD(v5) = v5 & 0x8000; | |
1267 return v5 | v4 | v3; | |
1268 } | |
1269 | |
1270 //----- (0042690D) -------------------------------------------------------- | |
1271 int __fastcall _42690D_colors_cvt(unsigned int a1) | |
1272 { | |
1273 unsigned int v1; // eax@1 | |
1274 unsigned int v2; // edx@1 | |
1275 | |
1276 v1 = a1 >> 8; | |
1277 v2 = a1 >> 5; | |
1278 LOWORD(v1) = (a1 >> 8) & 0xF800; | |
1279 LOWORD(v2) = (a1 >> 5) & 0x7E0; | |
1280 return ((unsigned __int8)a1 >> 3) | v2 | v1; | |
1281 } | |
1282 | |
1283 //----- (00426947) -------------------------------------------------------- | |
1284 void __cdecl sub_426947() | |
1285 { | |
1286 dword_50C968 = 0; | |
1287 dword_50C994 = 0; | |
1288 dword_50C998_turnbased_icon_1A = 0; | |
1289 } | |
1290 // 50C968: using guessed type int dword_50C968; | |
1291 // 50C994: using guessed type int dword_50C994; | |
1292 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A; | |
1293 | |
1294 | |
1295 | |
1296 //----- (004269A2) -------------------------------------------------------- | |
1297 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1) | |
1298 { | |
89 | 1299 //unsigned __int64 v1; // qax@1 |
1300 Player *v1; | |
1301 int v1b; | |
0 | 1302 signed int v2; // ecx@1 |
82 | 1303 int *v3; // esi@1 |
0 | 1304 bool v4; // edi@6 |
82 | 1305 int *v5; // edi@10 |
1306 Player *v6; // esi@10 | |
0 | 1307 int v7; // eax@13 |
1308 unsigned __int8 v8; // cf@13 | |
89 | 1309 int v10[4]; // [sp+Ch] [bp-14h]@1 |
0 | 1310 int v11; // [sp+1Ch] [bp-4h]@10 |
1311 | |
89 | 1312 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1); |
1313 v1 = pParty->pPlayers; | |
1314 v1b = a1; | |
0 | 1315 v2 = 0; |
89 | 1316 v3 = v10; |
0 | 1317 do |
1318 { | |
89 | 1319 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8)) |
0 | 1320 && !*(int *)HIDWORD(v1) |
1321 && !*(_QWORD *)(HIDWORD(v1) + 8) | |
89 | 1322 && !*(_QWORD *)(HIDWORD(v1) + 16);*/ |
1323 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13])) | |
1324 && !v1->pConditions[14] | |
1325 && !v1->pConditions[15] | |
1326 && !v1->pConditions[16]; | |
82 | 1327 *v3 = v4; |
89 | 1328 //HIDWORD(v1) += 6972; |
1329 ++v1; | |
0 | 1330 v2 += v4; |
82 | 1331 ++v3; |
0 | 1332 } |
89 | 1333 while ( v1 <= &pParty->pPlayers[3] ); |
0 | 1334 if ( v2 ) |
1335 { | |
89 | 1336 v1b = v1b / v2; |
1337 v5 = v10; | |
82 | 1338 v6 = pParty->pPlayers;//[0].uExperience; |
89 | 1339 v11 = v1b; |
0 | 1340 do |
1341 { | |
82 | 1342 if ( *v5 ) |
0 | 1343 { |
1344 if ( v11 ) | |
1345 { | |
82 | 1346 LOBYTE(v7) = v6->GetLearningPercent(); |
89 | 1347 v1b = v11 + v11 * v7 / 100; |
1348 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience)); | |
1349 //need review | |
1350 LODWORD(v6->uExperience) += v1b; | |
1351 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8; | |
82 | 1352 if ( v6->uExperience > 4000000000i64 ) |
0 | 1353 { |
82 | 1354 HIDWORD(v6->uExperience) = 0; |
1355 LODWORD(v6->uExperience) = -294967296; | |
0 | 1356 } |
1357 } | |
1358 } | |
82 | 1359 ++v6; |
1360 ++v5; | |
0 | 1361 } |
82 | 1362 while ( v6 <= &pParty->pPlayers[3] ); |
0 | 1363 } |
89 | 1364 return v1b; |
0 | 1365 } |
1366 | |
1367 //----- (00426A5A) -------------------------------------------------------- | |
1368 void stru319::LootActor(Actor *pActor) | |
1369 { | |
1370 signed int v2; // edi@1 | |
1371 char v3; // zf@1 | |
1372 unsigned int v4; // eax@13 | |
1373 unsigned int v5; // esi@13 | |
1374 int v6; // eax@14 | |
1375 unsigned __int8 v7; // al@30 | |
1376 Party *v8; // esi@34 | |
1377 char *v9; // [sp-4h] [bp-3Ch]@10 | |
1378 char *v10; // [sp-4h] [bp-3Ch]@31 | |
1379 char *v11; // [sp-4h] [bp-3Ch]@38 | |
1380 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 | |
1381 int v13; // [sp+30h] [bp-8h]@1 | |
1382 int v14; // [sp+34h] [bp-4h]@1 | |
1383 | |
1384 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1385 Dst.Reset(); | |
1386 v2 = 0; | |
1387 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; | |
1388 v13 = 0; | |
1389 v14 = 0; | |
1390 if ( v3 ) | |
1391 { | |
1392 if ( !pActor->pMonsterInfo.uTreasureDiceRolls ) | |
1393 goto LABEL_9; | |
1394 do | |
1395 { | |
1396 ++v2; | |
1397 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | |
1398 } | |
1399 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); | |
1400 } | |
1401 else | |
1402 { | |
1403 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 ) | |
1404 goto LABEL_9; | |
377 | 1405 v14 = pActor->array_000234[3].uSpecEnchantmentType; |
0 | 1406 pActor->array_000234[3].Reset(); |
1407 } | |
1408 if ( v14 ) | |
1409 { | |
1410 party_finds_gold(v14, 0); | |
1411 viewparams->bRedrawGameUI = 1; | |
1412 } | |
1413 LABEL_9: | |
1414 if ( pActor->uCarriedItemID ) | |
1415 { | |
1416 Dst.Reset(); | |
1417 Dst.uItemID = pActor->uCarriedItemID; | |
1418 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1419 if ( v14 ) | |
189 | 1420 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9); |
0 | 1421 else |
189 | 1422 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9); |
0 | 1423 ShowStatusBarString(pTmpBuf2, 2u); |
1424 v4 = Dst.uItemID; | |
1425 v5 = Dst.uItemID; | |
1426 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) | |
1427 { | |
1428 v5 = Dst.uItemID; | |
1429 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1; | |
1430 Dst.uNumCharges = v6; | |
1431 Dst.uMaxCharges = v6; | |
1432 v4 = Dst.uItemID; | |
1433 } | |
1434 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) | |
377 | 1435 Dst.uEncantmentType = 2 * rand() % 4 + 2; |
0 | 1436 pItemsTable->SetSpecialBonus(&Dst); |
1437 if ( !pParty->AddItem(&Dst) ) | |
1438 pParty->SetHoldingItem(&Dst); | |
1439 pActor->uCarriedItemID = 0; | |
1440 if ( pActor->array_000234[0].uItemID ) | |
1441 { | |
1442 if ( !pParty->AddItem(pActor->array_000234) ) | |
1443 { | |
1444 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1445 pParty->SetHoldingItem(pActor->array_000234); | |
1446 } | |
1447 pActor->array_000234[0].Reset(); | |
1448 } | |
1449 if ( pActor->array_000234[1].uItemID ) | |
1450 { | |
1451 if ( !pParty->AddItem(&pActor->array_000234[1]) ) | |
1452 { | |
1453 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1454 pParty->SetHoldingItem(&pActor->array_000234[1]); | |
1455 } | |
1456 pActor->array_000234[1].Reset(); | |
1457 } | |
1458 LABEL_55: | |
1459 pActor->Remove(); | |
1460 return; | |
1461 } | |
1462 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) | |
1463 { | |
1464 if ( pActor->array_000234[3].uItemID ) | |
1465 { | |
1466 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); | |
1467 pActor->array_000234[3].Reset(); | |
1468 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1469 if ( v14 ) | |
1470 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); | |
1471 else | |
1472 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); | |
1473 ShowStatusBarString(pTmpBuf2, 2u); | |
1474 if ( !pParty->AddItem(&Dst) ) | |
1475 pParty->SetHoldingItem(&Dst); | |
1476 v13 = 1; | |
1477 } | |
1478 goto LABEL_44; | |
1479 } | |
1480 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | |
1481 { | |
1482 LABEL_44: | |
1483 v8 = pParty; | |
1484 goto LABEL_45; | |
1485 } | |
1486 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | |
1487 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1488 if ( v14 ) | |
1489 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); | |
1490 else | |
1491 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); | |
1492 ShowStatusBarString(pTmpBuf2, 2u); | |
1493 v8 = pParty; | |
1494 if ( !pParty->AddItem(&Dst) ) | |
1495 pParty->SetHoldingItem(&Dst); | |
1496 v13 = 1; | |
1497 LABEL_45: | |
1498 if ( pActor->array_000234[0].uItemID ) | |
1499 { | |
1500 if ( !v8->AddItem(pActor->array_000234) ) | |
1501 { | |
1502 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1503 v8->SetHoldingItem(pActor->array_000234); | |
1504 v13 = 1; | |
1505 } | |
1506 pActor->array_000234[0].Reset(); | |
1507 } | |
1508 if ( pActor->array_000234[1].uItemID ) | |
1509 { | |
1510 if ( !v8->AddItem(&pActor->array_000234[1]) ) | |
1511 { | |
1512 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1513 v8->SetHoldingItem(&pActor->array_000234[1]); | |
1514 v13 = 1; | |
1515 } | |
1516 pActor->array_000234[1].Reset(); | |
1517 } | |
1518 if ( !v13 || rand() % 100 < 90 ) | |
1519 goto LABEL_55; | |
1520 } | |
1521 | |
1522 //----- (00426E10) -------------------------------------------------------- | |
1523 int stru319::which_player_would_attack(Actor *pActor) | |
1524 { | |
1525 signed int v2; // ebx@1 | |
1526 int v3; // ecx@2 | |
1527 signed int v4; // edx@3 | |
1528 char v5; // zf@3 | |
1529 unsigned int v6; // eax@3 | |
1530 int v7; // eax@6 | |
1531 int v8; // eax@7 | |
1532 int v9; // eax@8 | |
1533 int v10; // eax@9 | |
1534 int v11; // eax@10 | |
1535 int v12; // eax@11 | |
1536 int v13; // esi@35 | |
1537 signed int v14; // edi@37 | |
1538 enum CHARACTER_RACE v15; // eax@44 | |
1539 Player *v16; // ecx@47 | |
1540 unsigned __int8 v17; // sf@50 | |
1541 unsigned __int8 v18; // of@50 | |
1542 int v19; // esi@52 | |
1543 Player *v20; // ecx@53 | |
1544 int result; // eax@57 | |
1545 int v22[16]; // [sp+8h] [bp-140h]@3 | |
1546 int v23[60]; // [sp+48h] [bp-100h]@48 | |
1547 int v24; // [sp+138h] [bp-10h]@2 | |
1548 int v25; // [sp+13Ch] [bp-Ch]@1 | |
1549 int v26; // [sp+140h] [bp-8h]@1 | |
1550 int v27; // [sp+144h] [bp-4h]@1 | |
1551 | |
1552 v27 = -1; | |
1553 v26 = -1; | |
1554 v25 = -1; | |
1555 v2 = 0; | |
1556 if ( pActor->pMonsterInfo.uAttackPreference ) | |
1557 { | |
1558 v3 = 0; | |
1559 v24 = 0; | |
1560 do | |
1561 { | |
1562 v4 = 1; | |
1563 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); | |
1564 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; | |
1565 v22[v3] = v6; | |
1566 if ( !v5 ) | |
1567 { | |
1568 if ( (signed int)v6 > 128 ) | |
1569 { | |
1570 switch ( v6 ) | |
1571 { | |
1572 case 0x100u: | |
1573 v27 = 8; | |
1574 break; | |
1575 case 0x200u: | |
1576 v25 = 0; | |
1577 break; | |
1578 case 0x400u: | |
1579 v25 = 1; | |
1580 break; | |
1581 case 0x800u: | |
1582 v26 = 0; | |
1583 break; | |
1584 case 0x1000u: | |
1585 v26 = 1; | |
1586 break; | |
1587 case 0x2000u: | |
1588 v26 = 3; | |
1589 break; | |
1590 case 0x4000u: | |
1591 v26 = 2; | |
1592 break; | |
1593 } | |
1594 } | |
1595 else | |
1596 { | |
1597 if ( v6 == 128 ) | |
1598 { | |
1599 v27 = 4; | |
1600 } | |
1601 else | |
1602 { | |
1603 v7 = v6 - 1; | |
1604 if ( v7 ) | |
1605 { | |
1606 v8 = v7 - 1; | |
1607 if ( v8 ) | |
1608 { | |
1609 v9 = v8 - 2; | |
1610 if ( v9 ) | |
1611 { | |
1612 v10 = v9 - 4; | |
1613 if ( v10 ) | |
1614 { | |
1615 v11 = v10 - 8; | |
1616 if ( v11 ) | |
1617 { | |
1618 v12 = v11 - 16; | |
1619 if ( v12 ) | |
1620 { | |
1621 if ( v12 == 32 ) | |
1622 v27 = 20; | |
1623 } | |
1624 else | |
1625 { | |
1626 v27 = 32; | |
1627 } | |
1628 } | |
1629 else | |
1630 { | |
1631 v27 = 24; | |
1632 } | |
1633 } | |
1634 else | |
1635 { | |
1636 v27 = 28; | |
1637 } | |
1638 } | |
1639 else | |
1640 { | |
1641 v27 = 16; | |
1642 } | |
1643 } | |
1644 else | |
1645 { | |
1646 v27 = 12; | |
1647 } | |
1648 } | |
1649 else | |
1650 { | |
1651 v27 = 0; | |
1652 } | |
1653 } | |
1654 } | |
1655 v2 = 0; | |
1656 v13 = 0; | |
1657 while ( 1 ) | |
1658 { | |
1659 v14 = 0; | |
135 | 1660 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType ) |
0 | 1661 v14 = v4; |
1662 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) | |
1663 v14 = v4; | |
1664 if ( v26 != -1 ) | |
1665 { | |
1666 v15 = pPlayers[v13 + 1]->GetRace(); | |
1667 if ( v26 == v15 ) | |
1668 v14 = 1; | |
1669 } | |
1670 if ( v14 == 1 ) | |
1671 { | |
1672 v16 = pPlayers[v13 + 1]; | |
1673 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) | |
1674 v23[v2++] = v13; | |
1675 } | |
1676 ++v13; | |
1677 if ( v13 >= 4 ) | |
1678 break; | |
1679 v4 = 1; | |
1680 } | |
1681 } | |
1682 v3 = v24 + 1; | |
1683 v18 = __OFSUB__(v24 + 1, 15); | |
1684 v17 = v24++ - 14 < 0; | |
1685 } | |
1686 while ( v17 ^ v18 ); | |
1687 if ( v2 ) | |
1688 goto LABEL_61; | |
1689 } | |
1690 v19 = 0; | |
1691 do | |
1692 { | |
1693 v20 = pPlayers[v19 + 1]; | |
1694 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) | |
1695 v23[v2++] = v19; | |
1696 ++v19; | |
1697 } | |
1698 while ( v19 < 4 ); | |
1699 if ( v2 ) | |
1700 LABEL_61: | |
1701 result = v23[rand() % v2]; | |
1702 else | |
1703 result = 0; | |
1704 return result; | |
1705 } | |
1706 | |
1707 | |
1708 //----- (0042704B) -------------------------------------------------------- | |
1709 bool stru319::special_ability_use_check(Actor *pActor, int a2) | |
1710 { | |
1711 stru319 *v3; // edi@1 | |
1712 signed int v4; // ebx@5 | |
1713 signed int v5; // edi@5 | |
1714 | |
1715 v3 = this; | |
1716 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
1717 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
1718 && rand() % 100 < 5 ) | |
1719 pActor->_44FD29(a2); | |
1720 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); | |
1721 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); | |
1722 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
1723 return 2; | |
1724 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
1725 return 3; | |
1726 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance; | |
1727 } | |
1728 | |
1729 //----- (00427102) -------------------------------------------------------- | |
1730 int stru319::_427102(Actor *pActor, signed int a2) | |
1731 { | |
1732 unsigned __int8 v3; // cf@11 | |
1733 unsigned __int8 v4; // zf@11 | |
1734 SpellBuff *v6; // ecx@46 | |
89 | 1735 Player *v7; // esi@49 |
0 | 1736 signed int v8; // edx@50 |
89 | 1737 SpellBuff *v9; // ecx@50 |
0 | 1738 |
1739 if ( a2 > 73 ) | |
1740 { | |
1741 if ( a2 == 77 ) | |
1742 { | |
1743 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP ) | |
1744 return 0; | |
1745 return 1; | |
1746 } | |
1747 if ( a2 == 80 ) | |
1748 { | |
1749 v6 = pParty->pPartyBuffs; | |
1750 while ( (signed __int64)v6->uExpireTime <= 0 ) | |
1751 { | |
1752 ++v6; | |
89 | 1753 if ( v6 > &pParty->pPartyBuffs[19] ) |
1754 { | |
1755 v7 = pParty->pPlayers;//[0].pPlayerBuffs; | |
0 | 1756 v8 = 0; |
89 | 1757 v9 = v7->pPlayerBuffs; |
1758 while ( v9->uExpireTime <= 0i64 ) | |
0 | 1759 { |
1760 ++v8; | |
89 | 1761 ++v9; |
0 | 1762 if ( v8 >= 24 ) |
1763 { | |
89 | 1764 ++v7; |
1765 if ( v7 <= &pParty->pPlayers[3] ) | |
1766 { | |
1767 v8 = 0; | |
1768 v9 = v7->pPlayerBuffs; | |
1769 } | |
1770 else | |
1771 return 0; | |
0 | 1772 } |
1773 } | |
1774 return 1; | |
1775 } | |
1776 } | |
1777 return 1; | |
1778 } | |
1779 if ( a2 == 85 ) | |
1780 { | |
1781 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 ) | |
1782 return 1; | |
1783 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 ) | |
1784 return 0; | |
1785 v3 = 0; | |
1786 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0; | |
1787 } | |
1788 else | |
1789 { | |
1790 if ( a2 == 86 ) | |
1791 { | |
1792 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 ) | |
1793 return 1; | |
1794 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 ) | |
1795 return 0; | |
1796 v3 = 0; | |
1797 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0; | |
1798 } | |
1799 else | |
1800 { | |
1801 if ( a2 != 95 || SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 ) | |
1802 return 1; | |
1803 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 ) | |
1804 return 0; | |
1805 v3 = 0; | |
1806 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0; | |
1807 } | |
1808 } | |
1809 } | |
1810 else | |
1811 { | |
1812 if ( a2 == 73 ) | |
1813 { | |
1814 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 ) | |
1815 return 1; | |
1816 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 ) | |
1817 return 0; | |
1818 v3 = 0; | |
1819 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0; | |
1820 } | |
89 | 1821 else if ( a2 == 5 ) |
0 | 1822 { |
1823 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 ) | |
1824 return 1; | |
1825 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 ) | |
1826 return 0; | |
1827 v3 = 0; | |
1828 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0; | |
1829 } | |
89 | 1830 else if ( a2 == 17 ) |
0 | 1831 { |
1832 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 ) | |
1833 return 1; | |
1834 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 ) | |
1835 return 0; | |
1836 v3 = 0; | |
1837 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0; | |
1838 } | |
89 | 1839 else if ( a2 == 38 ) |
0 | 1840 { |
1841 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 ) | |
1842 return 1; | |
1843 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 ) | |
1844 return 0; | |
1845 v3 = 0; | |
1846 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0; | |
1847 } | |
89 | 1848 else if ( a2 == 46 ) |
0 | 1849 { |
1850 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 ) | |
1851 return 1; | |
1852 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 ) | |
1853 return 0; | |
1854 v3 = 0; | |
1855 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0; | |
1856 } | |
89 | 1857 else |
1858 { | |
1859 if ( a2 != 47 ) | |
1860 { | |
1861 if ( a2 != 51 || SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 ) | |
1862 return 1; | |
1863 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 ) | |
1864 { | |
1865 v3 = 0; | |
1866 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0; | |
1867 } | |
1868 else | |
1869 return 0; | |
1870 } | |
1871 else | |
1872 { | |
1873 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 ) | |
1874 return 1; | |
1875 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 ) | |
1876 return 0; | |
1877 v3 = 0; | |
1878 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0; | |
1879 } | |
1880 } | |
0 | 1881 } |
1882 if ( !(v3 | v4) ) | |
1883 return 0; | |
1884 return 1; | |
1885 } | |
1886 | |
1887 //----- (004272F5) -------------------------------------------------------- | |
1888 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
1889 { | |
1890 signed int v5; // esi@1 | |
1891 signed int v6; // edi@1 | |
1892 int v7; // esi@8 | |
1893 int v8; // eax@9 | |
1894 int v9; // edx@11 | |
1895 int v10; // edx@13 | |
1896 int v11; // esi@13 | |
1897 unsigned __int8 v12; // sf@13 | |
1898 unsigned __int8 v13; // of@13 | |
1899 int v14; // edx@14 | |
1900 int v15; // eax@14 | |
1901 signed int result; // eax@17 | |
1902 | |
1903 v5 = pActor->pMonsterInfo.uAC; | |
1904 v6 = 0; | |
1905 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 ) | |
1906 v5 /= 2; | |
1907 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1908 v6 = pActor->pActorBuffs[15].uPower; | |
1909 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 ) | |
1910 v6 = pActor->pActorBuffs[16].uPower; | |
1911 v7 = v6 + v5; | |
1912 if ( a3 ) | |
1913 v8 = pPlayer->GetRangedAttack(); | |
1914 else | |
1915 v8 = pPlayer->GetActualAttack(0); | |
1916 v9 = rand() % (v7 + 2 * v8 + 30); | |
1917 if ( a3 == 2 ) | |
1918 { | |
1919 v14 = a4 + v9; | |
1920 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1921 } | |
1922 else | |
1923 { | |
1924 if ( a3 != 3 ) | |
1925 { | |
1926 v10 = a4 + v9; | |
1927 v11 = v7 + 15; | |
1928 v13 = __OFSUB__(v10, v11); | |
1929 v12 = v10 - v11 < 0; | |
1930 goto LABEL_16; | |
1931 } | |
1932 v14 = a4 + v9; | |
1933 v15 = 2 * v7 + 30; | |
1934 } | |
1935 v13 = __OFSUB__(v14, v15); | |
1936 v12 = v14 - v15 < 0; | |
1937 LABEL_16: | |
1938 if ( v12 ^ v13 ) | |
1939 result = 0; | |
1940 else | |
1941 result = 1; | |
1942 return result; | |
1943 } | |
1944 | |
1945 //----- (004273BB) -------------------------------------------------------- | |
1946 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
1947 { | |
1948 Actor *v5; // ecx@1 | |
1949 signed int v6; // ebx@1 | |
1950 signed int v7; // esi@1 | |
1951 unsigned __int8 v8; // zf@1 | |
1952 unsigned __int8 v9; // sf@1 | |
1953 int v10; // ebx@10 | |
1954 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
1955 | |
1956 v5 = a2; | |
1957 v6 = a2->pMonsterInfo.uAC; | |
1958 v7 = 0; | |
1959 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0; | |
1960 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0; | |
1961 a2a = 0; | |
1962 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) ) | |
1963 v6 /= 2; | |
1964 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 ) | |
1965 v7 = v5->pActorBuffs[14].uPower; | |
1966 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 ) | |
1967 v7 = v5->pActorBuffs[16].uPower; | |
1968 v10 = v7 + v6; | |
1969 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1970 a2a = pActor->pActorBuffs[14].uPower; | |
1971 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a ) | |
1972 a2a = pActor->pActorBuffs[17].uPower; | |
1973 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1974 { | |
1975 a2a += pActor->pActorBuffs[11].uPower; | |
1976 pActor->pActorBuffs[11].Reset(); | |
1977 } | |
1978 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
1979 } | |
1980 | |
1981 //----- (004274AD) -------------------------------------------------------- | |
1982 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
1983 { | |
1984 signed int v3; // edi@1 | |
1985 signed int v4; // esi@8 | |
1986 int v5; // esi@8 | |
1987 | |
1988 v3 = 0; | |
1989 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1990 v3 = pActor->pActorBuffs[14].uPower; | |
1991 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 ) | |
1992 v3 = pActor->pActorBuffs[17].uPower; | |
1993 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1994 { | |
1995 v3 += pActor->pActorBuffs[11].uPower; | |
1996 pActor->pActorBuffs[11].Reset(); | |
1997 } | |
1998 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
1999 v5 = rand() % v4 + 1; | |
2000 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
2001 } | |
2002 | |
2003 //----- (00427546) -------------------------------------------------------- | |
2004 int stru319::_427546(int a2) | |
2005 { | |
2006 int result; // eax@2 | |
2007 | |
2008 if ( a2 >= 0 ) | |
2009 { | |
2010 if ( a2 >= 1 ) | |
2011 result = (a2 >= 2) + 2; | |
2012 else | |
2013 result = 1; | |
2014 } | |
2015 else | |
2016 { | |
2017 result = 0; | |
2018 } | |
2019 return result; | |
2020 } | |
2021 | |
2022 //----- (0042756B) -------------------------------------------------------- | |
2023 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
2024 { | |
2025 int v4; // edx@1 | |
2026 int v5; // ecx@1 | |
2027 signed int v6; // eax@4 | |
2028 signed int result; // eax@17 | |
2029 signed int v8; // esi@18 | |
2030 | |
2031 v4 = 0; | |
2032 v5 = 0; | |
2033 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
2034 v5 = pActor->pActorBuffs[14].uPower; | |
2035 switch ( a2 ) | |
2036 { | |
2037 case 4: | |
2038 v6 = pActor->pMonsterInfo.uResPhysical; | |
2039 break; | |
2040 case 0: | |
2041 v6 = pActor->pMonsterInfo.uResFire; | |
2042 goto LABEL_12; | |
2043 case 1: | |
2044 v6 = pActor->pMonsterInfo.uResAir; | |
2045 goto LABEL_12; | |
2046 case 2: | |
2047 v6 = pActor->pMonsterInfo.uResWater; | |
2048 goto LABEL_12; | |
2049 case 3: | |
2050 v6 = pActor->pMonsterInfo.uResEarth; | |
2051 goto LABEL_12; | |
2052 case 6: | |
2053 v6 = pActor->pMonsterInfo.uResSpirit; | |
2054 break; | |
2055 case 7: | |
2056 v6 = pActor->pMonsterInfo.uResMind; | |
2057 goto LABEL_12; | |
2058 case 8: | |
2059 v6 = pActor->pMonsterInfo.uResBody; | |
2060 LABEL_12: | |
2061 v4 = v5; | |
2062 break; | |
2063 case 9: | |
2064 v6 = pActor->pMonsterInfo.uResLight; | |
2065 break; | |
2066 case 10: | |
2067 v6 = pActor->pMonsterInfo.uResDark; | |
2068 break; | |
2069 default: | |
2070 v6 = 0; | |
2071 break; | |
2072 } | |
2073 if ( v6 < 200 ) | |
2074 { | |
2075 v8 = v4 + v6 + 30; | |
2076 if ( rand() % v8 >= 30 ) | |
2077 { | |
2078 a3 >>= 1; | |
2079 if ( rand() % v8 >= 30 ) | |
2080 { | |
2081 a3 >>= 1; | |
2082 if ( rand() % v8 >= 30 ) | |
2083 { | |
2084 a3 >>= 1; | |
2085 if ( rand() % v8 >= 30 ) | |
2086 a3 >>= 1; | |
2087 } | |
2088 } | |
2089 } | |
2090 result = a3; | |
2091 } | |
2092 else | |
2093 { | |
2094 result = 0; | |
2095 } | |
2096 return result; | |
2097 } | |
2098 | |
2099 //----- (00427662) -------------------------------------------------------- | |
2100 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
2101 { | |
2102 Actor *v3; // edi@2 | |
2103 signed int v4; // esi@2 | |
2104 bool result; // eax@13 | |
2105 | |
2106 switch ( uType ) | |
2107 { | |
2108 case 0u: | |
2109 v3 = pActor; | |
2110 v4 = pActor->pMonsterInfo.uResFire; | |
2111 goto LABEL_12; | |
2112 case 1u: | |
2113 v3 = pActor; | |
2114 v4 = pActor->pMonsterInfo.uResAir; | |
2115 goto LABEL_12; | |
2116 case 2u: | |
2117 v3 = pActor; | |
2118 v4 = pActor->pMonsterInfo.uResWater; | |
2119 goto LABEL_12; | |
2120 case 3u: | |
2121 v3 = pActor; | |
2122 v4 = pActor->pMonsterInfo.uResEarth; | |
2123 goto LABEL_12; | |
2124 case 7u: | |
2125 v3 = pActor; | |
2126 v4 = pActor->pMonsterInfo.uResMind; | |
2127 goto LABEL_12; | |
2128 case 6u: | |
2129 v3 = pActor; | |
2130 v4 = pActor->pMonsterInfo.uResSpirit; | |
2131 goto LABEL_12; | |
2132 case 8u: | |
2133 v3 = pActor; | |
2134 v4 = pActor->pMonsterInfo.uResBody; | |
2135 goto LABEL_12; | |
2136 case 9u: | |
2137 v3 = pActor; | |
2138 v4 = pActor->pMonsterInfo.uResLight; | |
2139 goto LABEL_12; | |
2140 case 0xAu: | |
2141 v3 = pActor; | |
2142 v4 = pActor->pMonsterInfo.uResDark; | |
2143 goto LABEL_12; | |
2144 case 4u: | |
2145 v3 = pActor; | |
2146 v4 = pActor->pMonsterInfo.uResPhysical; | |
2147 LABEL_12: | |
2148 if ( v4 < 200 ) | |
2149 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | |
2150 else | |
2151 result = 0; | |
2152 break; | |
2153 default: | |
2154 result = 1; | |
2155 break; | |
2156 } | |
2157 return result; | |
2158 } | |
2159 | |
2160 | |
2161 //----- (00427769) -------------------------------------------------------- | |
2162 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
2163 { | |
2164 bool result; // eax@2 | |
2165 | |
2166 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) | |
2167 result = 1; | |
2168 else | |
2169 result = 0; | |
2170 return result; | |
2171 } | |
2172 | |
2173 //----- (0042777D) -------------------------------------------------------- | |
319 | 2174 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) |
0 | 2175 { |
370 | 2176 //bool result; // eax@2 |
0 | 2177 __int16 v6; // bx@4 |
437 | 2178 //Player *v7; // eax@4 |
0 | 2179 char v8; // zf@12 |
2180 unsigned __int16 v9; // cx@16 | |
2181 unsigned int v10; // eax@18 | |
2182 unsigned __int8 v11; // sf@18 | |
2183 unsigned __int8 v12; // of@18 | |
2184 unsigned __int16 v13; // cx@21 | |
2185 unsigned int v14; // eax@23 | |
2186 stru277 *v15; // esi@27 | |
2187 stru277 *v16; // eax@28 | |
2188 GUIWindow *v17; // eax@43 | |
2189 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | |
2190 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | |
2191 unsigned int v20; // [sp-28h] [bp-40h]@44 | |
2192 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | |
2193 unsigned int v22; // [sp-20h] [bp-38h]@44 | |
2194 int v23; // [sp-1Ch] [bp-34h]@44 | |
2195 int v24; // [sp-18h] [bp-30h]@44 | |
2196 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | |
2197 unsigned int v26; // [sp-10h] [bp-28h]@43 | |
2198 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | |
2199 char *v28; // [sp-8h] [bp-20h]@43 | |
2200 Texture *v29; // [sp-4h] [bp-1Ch]@43 | |
2201 __int16 a3a; // [sp+10h] [bp-8h]@1 | |
2202 __int16 a2a; // [sp+14h] [bp-4h]@1 | |
2203 | |
2204 a3a = uPlayerID; | |
2205 a2a = a1; | |
370 | 2206 |
2207 //if ( pParty->bTurnBasedModeOn != 1 | |
2208 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | |
2209 if (pParty->bTurnBasedModeOn) | |
0 | 2210 { |
370 | 2211 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) |
2212 return; | |
2213 } | |
2214 | |
2215 | |
0 | 2216 v6 = a5; |
437 | 2217 //v7 = &pParty->pPlayers[uPlayerID]; |
2218 assert(uPlayerID < 4); | |
2219 auto player = &pParty->pPlayers[uPlayerID]; | |
0 | 2220 if ( !(a5 & 0x10) ) |
2221 { | |
2222 switch ( a1 ) | |
2223 { | |
2224 case 47: | |
2225 case 68: | |
2226 case 89: | |
2227 HIBYTE(v6) = HIBYTE(a5) | 1; | |
2228 break; | |
2229 case 4: | |
2230 case 28: | |
2231 case 30: | |
2232 case 91: | |
2233 LOBYTE(v6) = a5 | 0x80; | |
2234 break; | |
2235 case 2: | |
2236 case 6: | |
2237 case 11: | |
2238 case 18: | |
2239 case 20: | |
2240 case 24: | |
2241 case 26: | |
2242 case 29: | |
2243 case 32: | |
2244 case 34: | |
2245 case 35: | |
2246 case 37: | |
2247 case 39: | |
2248 case 44: | |
2249 case 52: | |
2250 case 57: | |
2251 case 60: | |
2252 case 65: | |
2253 case 70: | |
2254 case 76: | |
2255 case 78: | |
2256 case 79: | |
2257 case 87: | |
2258 case 90: | |
2259 case 92: | |
2260 case 93: | |
2261 case 97: | |
2262 if ( !a6 ) | |
2263 goto LABEL_9; | |
2264 break; | |
2265 case 59: | |
2266 case 62: | |
2267 case 66: | |
2268 case 81: | |
2269 case 94: | |
2270 LABEL_9: | |
2271 v6 = a5 | 8; | |
2272 break; | |
2273 case 42: | |
2274 v6 = a5 | 0x40; | |
2275 break; | |
2276 case 46: | |
2277 if ( a4 ) | |
2278 v8 = (a4 & 0x1C0) == 0; | |
2279 else | |
437 | 2280 v8 = (player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0; |
0 | 2281 if ( v8 ) |
2282 goto LABEL_25; | |
2283 break; | |
2284 case 50: | |
2285 v9 = a4; | |
2286 if ( !a4 ) | |
437 | 2287 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT]; |
0 | 2288 goto LABEL_18; |
2289 case 95: | |
2290 v9 = a4; | |
2291 if ( !a4 ) | |
437 | 2292 v9 = player->pActiveSkills[PLAYER_SKILL_DARK]; |
0 | 2293 LABEL_18: |
2294 v10 = SkillToMastery(v9); | |
2295 v12 = __OFSUB__(v10, 3); | |
2296 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2297 goto LABEL_24; | |
2298 case 73: | |
2299 v13 = a4; | |
2300 if ( !a4 ) | |
437 | 2301 v13 = player->pActiveSkills[PLAYER_SKILL_BODY]; |
0 | 2302 v14 = SkillToMastery(v13); |
2303 v12 = __OFSUB__(v14, 4); | |
2304 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2305 LABEL_24: | |
2306 if ( v11 ^ v12 ) | |
2307 goto LABEL_25; | |
2308 break; | |
2309 case 40: | |
2310 case 49: | |
2311 case 53: | |
2312 case 55: | |
2313 case 56: | |
2314 case 61: | |
2315 case 64: | |
2316 case 67: | |
2317 case 71: | |
2318 case 72: | |
2319 case 74: | |
2320 LABEL_25: | |
2321 v6 = a5 | 2; | |
2322 break; | |
2323 case 96: | |
2324 HIBYTE(v6) = HIBYTE(a5) | 2; | |
2325 break; | |
2326 default: | |
2327 break; | |
2328 } | |
2329 } | |
370 | 2330 |
0 | 2331 v15 = pStru277; |
2332 if ( v6 & 0x3CA ) | |
2333 { | |
2334 v16 = pStru277; | |
2335 while ( !(v16->field_8 & 0x3CA) ) | |
2336 { | |
2337 ++v16; | |
2338 if ( (signed int)v16 >= (signed int)&unk_50C190 ) | |
2339 goto LABEL_33; | |
2340 } | |
2341 v16->spellnum = 0; | |
2342 } | |
2343 do | |
2344 { | |
2345 LABEL_33: | |
2346 if ( v15->spellnum ) | |
2347 { | |
2348 v8 = (v15->field_8 & 0x3CA) == 0; | |
2349 v15->spellnum = 0; | |
2350 if ( !v8 ) | |
2351 { | |
2352 pGUIWindow_Settings->Release(); | |
2353 pGUIWindow_Settings = 0; | |
2354 pMouse->SetCursorBitmap("MICON1"); | |
2355 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2356 unk_50C9A0 = 0; | |
2357 back_to_game(); | |
2358 } | |
2359 } | |
2360 ++v15; | |
2361 } | |
441 | 2362 while (v15 < pStru277 + 10); |
370 | 2363 int result = pStru277->PushStru277(a2a, a3a, a4, v6, a6); |
0 | 2364 if ( result != -1 ) |
2365 { | |
2366 if ( v6 & 2 ) | |
2367 { | |
2368 if ( pGUIWindow_Settings ) | |
319 | 2369 return; |
0 | 2370 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2371 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2372 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2373 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2374 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
319 | 2375 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2376 return; | |
0 | 2377 } |
2378 if ( v6 & 8 ) | |
2379 { | |
2380 if ( pGUIWindow_Settings ) | |
319 | 2381 return; |
0 | 2382 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2383 v29 = 0; | |
2384 v28 = ""; | |
2385 v27 = 0; | |
2386 v26 = 0; | |
2387 v25 = 70; | |
2388 LABEL_44: | |
2389 v24 = 0; | |
2390 v23 = 1; | |
2391 v22 = 344; | |
2392 v21 = 460; | |
2393 v20 = 8; | |
2394 v19 = 8; | |
2395 pGUIWindow_Settings = v17; | |
2396 v18 = v17; | |
2397 LABEL_56: | |
2398 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
319 | 2399 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2400 return; | |
0 | 2401 } |
2402 if ( v6 & 0x40 ) | |
2403 { | |
2404 if ( pGUIWindow_Settings ) | |
319 | 2405 return; |
0 | 2406 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2407 v29 = 0; | |
2408 v28 = ""; | |
2409 v27 = 0; | |
2410 v26 = 0; | |
2411 v25 = 190; | |
2412 goto LABEL_44; | |
2413 } | |
2414 if ( (char)v6 < 0 ) | |
2415 { | |
2416 if ( pGUIWindow_Settings ) | |
319 | 2417 return; |
0 | 2418 ++pIcons_LOD->uTexturePacksCount; |
2419 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2420 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2421 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2422 unk_50C9A0 = 1; | |
2423 some_active_character = uActiveCharacter; | |
319 | 2424 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2425 return; | |
0 | 2426 } |
2427 if ( HIBYTE(v6) & 1 ) | |
2428 { | |
2429 if ( pGUIWindow_Settings ) | |
319 | 2430 return; |
2431 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
0 | 2432 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); |
2433 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2434 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2435 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
423 | 2436 pGUIWindow_Settings->CreateButton(8, 8, 460, 344, 1, 0, 140, 0, 0, "", NULL); |
2437 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
0 | 2438 } |
2439 if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings ) | |
2440 { | |
319 | 2441 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
0 | 2442 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( |
2443 0x1D5u, | |
2444 0xB2u, | |
319 | 2445 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), |
2446 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
0 | 2447 1, |
2448 0, | |
2449 0xBCu, | |
2450 0, | |
2451 0, | |
2452 "", | |
319 | 2453 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), |
0 | 2454 0); |
2455 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2456 0x272u, | |
2457 0xB2u, | |
319 | 2458 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), |
2459 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
0 | 2460 1, |
2461 0, | |
2462 0xBCu, | |
2463 1u, | |
2464 0, | |
2465 "", | |
319 | 2466 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), |
0 | 2467 0); |
2468 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
319 | 2469 pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0); |
0 | 2470 } |
2471 } | |
2472 } | |
2473 | |
2474 | |
2475 | |
2476 //----- (00427D48) -------------------------------------------------------- | |
2477 void stru277::_427D48(unsigned int uPlayerID) | |
2478 { | |
2479 stru277 *v2; // esi@1 | |
2480 signed int v3; // ebx@1 | |
2481 | |
2482 v2 = this; | |
2483 v3 = 10; | |
2484 do | |
2485 { | |
2486 if ( v2->spellnum ) | |
2487 { | |
2488 if ( v2->field_8 & 0x3CA ) | |
2489 { | |
2490 v2->spellnum = 0; | |
2491 pGUIWindow_Settings->Release(); | |
2492 pGUIWindow_Settings = 0; | |
2493 pMouse->SetCursorBitmap("MICON1"); | |
2494 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2495 unk_50C9A0 = 0; | |
2496 back_to_game(); | |
2497 } | |
2498 } | |
2499 ++v2; | |
2500 --v3; | |
2501 } | |
2502 while ( v3 ); | |
2503 } | |
2504 | |
2505 //----- (00427DA0) -------------------------------------------------------- | |
2506 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6) | |
2507 { | |
2508 unsigned int result; // eax@1 | |
2509 stru277 *v7; // edx@1 | |
2510 stru277 *v8; // ecx@5 | |
2511 | |
2512 result = 0; | |
2513 v7 = this; | |
2514 while ( v7->spellnum ) | |
2515 { | |
2516 ++result; | |
2517 ++v7; | |
2518 if ( (signed int)result >= 10 ) | |
2519 goto LABEL_8; | |
2520 } | |
2521 v8 = &this[result]; | |
2522 v8->spellnum = a2; | |
2523 v8->uPlayerID = uPlayerID; | |
2524 if ( a5 & 0x10 ) | |
2525 v8->uPlayerID_2 = uPlayerID; | |
2526 v8->field_6 = 0; | |
2527 *(int *)&v8->field_C = 0; | |
2528 v8->field_8 = a5; | |
2529 v8->field_A = a4; | |
2530 v8->field_10 = a6; | |
2531 LABEL_8: | |
2532 if ( result == 10 ) | |
2533 result = -1; | |
2534 return result; | |
2535 } | |
2536 | |
2537 //----- (00427E01) -------------------------------------------------------- | |
2538 void stru277::_427E01_cast_spell() | |
2539 { | |
2540 int v1; // esi@1 | |
2541 int v2; // edi@1 | |
2542 stru277 *v3; // ebx@2 | |
2543 signed int v4; // eax@8 | |
2544 __int16 v5; // ax@9 | |
2545 signed int v6; // eax@14 | |
2546 __int16 v7; // ax@23 | |
2547 __int16 v8; // ax@24 | |
2548 char v9; // al@44 | |
2549 int v10; // eax@45 | |
2550 unsigned __int16 v11; // cx@45 | |
2551 signed int v12; // ecx@48 | |
2552 int v13; // eax@53 | |
2553 unsigned __int8 v14; // zf@53 | |
2554 unsigned int v15; // edx@53 | |
2555 signed int v16; // eax@53 | |
2556 Player *v17; // esi@70 | |
2557 int v18; // eax@72 | |
2558 int v19; // eax@74 | |
2559 char *v20; // eax@74 | |
2560 signed int i; // esi@76 | |
2561 int v22; // eax@88 | |
2562 __int16 v23; // ax@88 | |
2563 int v24; // ecx@93 | |
2564 int v25; // ecx@94 | |
2565 signed __int64 v26; // qax@100 | |
2566 char *v27; // ecx@100 | |
2567 unsigned __int64 v28; // qax@102 | |
2568 int v29; // ecx@105 | |
2569 int v30; // ecx@106 | |
2570 int v31; // eax@112 | |
2571 int v32; // eax@112 | |
2572 char *v33; // edx@113 | |
2573 int v34; // eax@121 | |
2574 int v35; // eax@123 | |
2575 int v36; // edx@125 | |
2576 int v37; // eax@129 | |
2577 signed int v38; // edi@129 | |
2578 signed int v39; // eax@129 | |
2579 int v40; // ecx@129 | |
2580 int v41; // eax@129 | |
2581 signed int v42; // eax@129 | |
2582 int *v43; // ecx@129 | |
2583 int v44; // eax@132 | |
2584 int v45; // ecx@132 | |
2585 int v46; // eax@132 | |
2586 unsigned int v47; // edx@133 | |
2587 int v48; // eax@137 | |
2588 int v49; // eax@137 | |
2589 int v50; // eax@141 | |
2590 int v51; // eax@146 | |
2591 __int16 v52; // ax@153 | |
2592 int v53; // eax@153 | |
2593 signed __int64 v54; // qax@164 | |
2594 int v55; // edi@164 | |
2595 stru6 *v56; // eax@165 | |
2596 int v57; // eax@169 | |
2597 signed __int64 v58; // qax@177 | |
2598 int v59; // edi@177 | |
2599 unsigned __int16 v60; // ax@184 | |
2600 int v61; // ecx@184 | |
2601 int v62; // eax@186 | |
2602 int v63; // ecx@187 | |
2603 int v64; // ecx@188 | |
2604 int v65; // ecx@189 | |
2605 const char *v66; // ecx@200 | |
2606 unsigned int v67; // edx@201 | |
2607 char v68; // al@207 | |
89 | 2608 ItemGen *v69; // esi@211 |
0 | 2609 int v70; // ecx@214 |
2610 int v71; // ecx@215 | |
2611 int v72; // ecx@216 | |
2612 __int16 v73; // ST1C_2@222 | |
2613 __int16 v74; // ST18_2@222 | |
2614 stru6 *v75; // eax@222 | |
2615 int v76; // ecx@223 | |
2616 int v77; // ecx@224 | |
2617 int v78; // ecx@225 | |
2618 int v79; // eax@227 | |
2619 int v80; // eax@232 | |
2620 __int16 v81; // ST18_2@245 | |
2621 stru6 *v82; // eax@245 | |
2622 signed int v83; // edi@245 | |
2623 __int16 v84; // ST18_2@245 | |
2624 stru6 *v85; // eax@245 | |
2625 __int16 v86; // ST18_2@245 | |
2626 stru6 *v87; // eax@245 | |
2627 __int16 v88; // ST18_2@245 | |
2628 stru6 *v89; // eax@245 | |
2629 double v90; // st7@245 | |
2630 int v91; // eax@250 | |
89 | 2631 Player *v92; // eax@255 |
0 | 2632 __int16 v93; // ST18_2@260 |
2633 stru6 *v94; // eax@260 | |
2634 __int16 v95; // ST18_2@260 | |
2635 stru6 *v96; // eax@260 | |
2636 __int16 v97; // ST18_2@260 | |
2637 stru6 *v98; // eax@260 | |
2638 __int16 v99; // ST18_2@260 | |
2639 stru6 *v100; // eax@260 | |
2640 int v101; // ecx@261 | |
2641 int v102; // ecx@262 | |
2642 int v103; // ecx@263 | |
2643 int v104; // eax@265 | |
2644 int v105; // edi@271 | |
2645 __int16 v106; // ST18_2@272 | |
2646 stru6 *v107; // eax@272 | |
2647 __int16 v108; // ST1C_2@274 | |
2648 __int16 v109; // ST18_2@274 | |
2649 stru6 *v110; // eax@274 | |
2650 int v111; // eax@274 | |
2651 Actor *v112; // esi@278 | |
2652 int v113; // eax@278 | |
2653 int v114; // ebx@278 | |
2654 unsigned int v115; // ecx@278 | |
2655 int v116; // edx@279 | |
2656 int v117; // edx@281 | |
2657 int v118; // edx@283 | |
2658 int v119; // edi@286 | |
2659 int v120; // eax@286 | |
2660 int v121; // eax@286 | |
2661 signed int v122; // eax@286 | |
2662 int v123; // ecx@288 | |
2663 int v124; // ecx@289 | |
2664 int v125; // ecx@290 | |
2665 int v126; // eax@292 | |
2666 int v127; // eax@296 | |
2667 __int16 v128; // ST18_2@303 | |
2668 stru6 *v129; // eax@303 | |
2669 __int16 v130; // ST18_2@303 | |
2670 stru6 *v131; // eax@303 | |
2671 __int16 v132; // ST18_2@303 | |
2672 stru6 *v133; // eax@303 | |
2673 __int16 v134; // ST18_2@303 | |
2674 stru6 *v135; // eax@303 | |
2675 unsigned __int64 v136; // qax@304 | |
2676 char *v137; // ecx@304 | |
2677 int v138; // ecx@305 | |
2678 int v139; // ecx@306 | |
2679 int v140; // eax@308 | |
2680 __int16 v141; // ST18_2@311 | |
2681 stru6 *v142; // eax@311 | |
2682 __int16 v143; // ST18_2@311 | |
2683 stru6 *v144; // eax@311 | |
2684 __int16 v145; // ST18_2@311 | |
2685 stru6 *v146; // eax@311 | |
2686 __int16 v147; // ST18_2@311 | |
2687 stru6 *v148; // eax@311 | |
2688 int v149; // ecx@312 | |
2689 int v150; // ecx@313 | |
2690 int v151; // ecx@314 | |
2691 signed int v152; // eax@322 | |
2692 int v153; // ecx@322 | |
2693 int v154; // eax@322 | |
2694 int v155; // eax@323 | |
2695 int v156; // eax@323 | |
2696 int v157; // eax@326 | |
2697 double v158; // st7@326 | |
2698 double v159; // st6@326 | |
2699 signed __int64 v160; // qtt@334 | |
2700 int v161; // eax@339 | |
2701 int v162; // edi@340 | |
2702 int v163; // eax@340 | |
2703 signed int v164; // eax@340 | |
2704 signed int v165; // edi@340 | |
2705 stru6 *v166; // eax@340 | |
2706 stru6 *v167; // eax@340 | |
2707 signed int v168; // edi@343 | |
2708 int v169; // eax@344 | |
2709 int v170; // ecx@346 | |
2710 int v171; // ecx@347 | |
2711 int v172; // ecx@348 | |
2712 int v173; // edi@350 | |
2713 signed int v174; // edi@355 | |
2714 __int16 v175; // ST18_2@357 | |
2715 stru6 *v176; // eax@357 | |
2716 __int16 v177; // ST18_2@357 | |
2717 stru6 *v178; // eax@357 | |
2718 __int16 v179; // ST18_2@357 | |
2719 stru6 *v180; // eax@357 | |
2720 __int16 v181; // ST18_2@357 | |
2721 stru6 *v182; // eax@357 | |
2722 signed __int64 v183; // qax@357 | |
2723 int v184; // ecx@358 | |
2724 int v185; // ecx@359 | |
2725 int v186; // ecx@360 | |
2726 int v187; // eax@367 | |
2727 int v188; // esi@369 | |
2728 int v189; // edi@369 | |
2729 const char *v190; // ecx@377 | |
2730 signed int v191; // edi@379 | |
2731 int v192; // ecx@382 | |
2732 int v193; // ecx@383 | |
2733 int v194; // ecx@384 | |
2734 int v195; // eax@386 | |
2735 int v196; // eax@387 | |
2736 __int16 v197; // ST18_2@395 | |
2737 stru6 *v198; // eax@395 | |
2738 __int16 v199; // ST18_2@395 | |
2739 stru6 *v200; // eax@395 | |
2740 __int16 v201; // ST18_2@395 | |
2741 stru6 *v202; // eax@395 | |
2742 __int16 v203; // ST18_2@395 | |
2743 stru6 *v204; // eax@395 | |
2744 signed int v205; // edi@405 | |
2745 int v206; // eax@407 | |
2746 __int16 v207; // cx@407 | |
2747 int v208; // eax@411 | |
2748 signed int v209; // ecx@412 | |
2749 int v210; // edx@412 | |
2750 signed int v211; // ecx@412 | |
2751 int v212; // eax@413 | |
2752 int v213; // eax@413 | |
2753 int v214; // eax@413 | |
2754 int v215; // eax@415 | |
2755 double v216; // st7@415 | |
2756 double v217; // st6@415 | |
2757 signed __int64 v218; // qtt@423 | |
2758 int v219; // ecx@425 | |
2759 int v220; // ecx@426 | |
2760 int v221; // edi@428 | |
2761 char *v222; // edi@434 | |
2762 char v223; // al@438 | |
2763 int v224; // ecx@442 | |
2764 int v225; // ecx@443 | |
2765 int v226; // eax@451 | |
2766 int v227; // esi@453 | |
2767 unsigned int v228; // edi@454 | |
2768 int v229; // edi@466 | |
2769 __int16 v230; // ST18_2@469 | |
2770 stru6 *v231; // eax@469 | |
2771 signed int v232; // esi@469 | |
2772 __int16 v233; // ST18_2@469 | |
2773 stru6 *v234; // eax@469 | |
2774 __int16 v235; // ST18_2@469 | |
2775 stru6 *v236; // eax@469 | |
2776 __int16 v237; // ST18_2@469 | |
2777 stru6 *v238; // eax@469 | |
2778 __int16 v239; // ST1C_2@469 | |
2779 char *v240; // ecx@472 | |
2780 double v241; // st7@478 | |
2781 signed __int64 v242; // qax@484 | |
2782 char *v243; // ecx@484 | |
2783 char *v244; // eax@488 | |
2784 int v245; // edi@492 | |
2785 int v246; // eax@492 | |
2786 char *v247; // eax@497 | |
2787 char v248; // al@497 | |
2788 char v249; // cf@500 | |
2789 float v250; // esi@507 | |
2790 char v251; // al@507 | |
2791 int v252; // edx@510 | |
2792 int m; // esi@510 | |
2793 int v254; // eax@513 | |
2794 int v255; // esi@513 | |
2795 int v256; // ecx@513 | |
2796 int v257; // edx@514 | |
2797 int v258; // ecx@514 | |
2798 char v259; // al@516 | |
2799 int v260; // eax@518 | |
2800 int v261; // esi@519 | |
2801 int v262; // edx@521 | |
2802 int v263; // ecx@521 | |
2803 int v264; // esi@521 | |
2804 int v265; // edx@521 | |
2805 int *ii; // eax@522 | |
2806 int v267; // eax@524 | |
2807 int v268; // eax@524 | |
2808 int v269; // eax@526 | |
2809 char *v270; // eax@531 | |
2810 char v271; // al@531 | |
2811 char v272; // cf@534 | |
2812 float v273; // esi@541 | |
2813 char v274; // al@541 | |
2814 int v275; // edx@544 | |
2815 int k; // esi@544 | |
2816 int v277; // edx@548 | |
2817 int v278; // ecx@548 | |
2818 char v279; // al@550 | |
2819 int v280; // eax@552 | |
2820 int v281; // esi@553 | |
2821 int v282; // edx@555 | |
2822 int v283; // ecx@555 | |
2823 int v284; // esi@555 | |
2824 int v285; // edx@555 | |
2825 int *l; // eax@556 | |
2826 int v287; // eax@558 | |
2827 int v288; // eax@558 | |
2828 ItemGen *v289; // eax@560 | |
2829 signed int v290; // eax@560 | |
2830 unsigned __int8 v291; // al@564 | |
2831 char v292; // al@573 | |
2832 int v293; // eax@575 | |
2833 ItemGen *v294; // esi@575 | |
2834 int v295; // edx@575 | |
2835 int kk; // edi@575 | |
2836 int v297; // edx@579 | |
2837 int v298; // ecx@579 | |
2838 char v299; // al@581 | |
2839 int v300; // eax@583 | |
2840 int v301; // edi@584 | |
2841 int v302; // edx@586 | |
2842 int v303; // ecx@586 | |
2843 int v304; // edi@586 | |
2844 int v305; // edx@586 | |
2845 int *jj; // eax@587 | |
2846 int v307; // eax@589 | |
2847 int v308; // eax@589 | |
2848 char *v309; // ecx@593 | |
2849 char v310; // sf@593 | |
2850 unsigned __int8 v311; // of@593 | |
2851 char v312; // cl@597 | |
2852 char v313; // al@606 | |
2853 int v314; // edx@607 | |
2854 int j; // esi@607 | |
2855 unsigned int v316; // eax@613 | |
2856 const char *v317; // ecx@617 | |
2857 Player *v318; // ecx@619 | |
2858 unsigned int v319; // edi@627 | |
2859 int v320; // ecx@629 | |
2860 int v321; // ecx@630 | |
2861 int v322; // edi@632 | |
2862 int v323; // edi@635 | |
2863 char *v324; // eax@635 | |
2864 Player *v325; // ecx@640 | |
2865 int v326; // eax@643 | |
2866 int v327; // eax@648 | |
2867 int v328; // ecx@651 | |
2868 int v329; // ecx@652 | |
2869 int v330; // edi@654 | |
2870 __int16 v331; // ST18_2@658 | |
2871 stru6 *v332; // eax@658 | |
2872 __int16 v333; // ST18_2@658 | |
2873 stru6 *v334; // eax@658 | |
2874 __int16 v335; // ST18_2@658 | |
2875 stru6 *v336; // eax@658 | |
2876 __int16 v337; // ST18_2@658 | |
2877 stru6 *v338; // eax@658 | |
2878 int v339; // ecx@659 | |
2879 int v340; // ecx@660 | |
2880 int v341; // eax@663 | |
2881 signed int v342; // edi@668 | |
2882 signed int v343; // edi@670 | |
2883 unsigned __int64 v344; // ST08_8@670 | |
2884 __int16 v345; // ST1C_2@671 | |
2885 __int16 v346; // ST18_2@671 | |
2886 stru6 *v347; // eax@671 | |
2887 int v348; // ecx@672 | |
2888 int v349; // ecx@673 | |
2889 int v350; // edi@676 | |
2890 Player *v351; // edi@680 | |
2891 __int16 v352; // ST18_2@685 | |
2892 stru6 *v353; // eax@685 | |
2893 int v354; // ecx@686 | |
2894 int v355; // ecx@687 | |
2895 int v356; // eax@689 | |
112 | 2896 Player *v357; // edi@694 |
0 | 2897 unsigned __int16 v358; // ST1C_2@695 |
2898 __int16 v359; // ST18_2@695 | |
2899 stru6 *v360; // eax@695 | |
2900 __int16 v361; // ST1C_2@697 | |
2901 __int16 v362; // ST18_2@697 | |
2902 stru6 *v363; // eax@697 | |
2903 int v364; // ecx@698 | |
2904 int v365; // ecx@699 | |
2905 int v366; // eax@701 | |
2906 stru6 *v367; // eax@704 | |
2907 int v368; // eax@704 | |
2908 Actor *v369; // edi@705 | |
2909 int v370; // eax@706 | |
2910 int v371; // ecx@709 | |
2911 int v372; // ecx@710 | |
2912 int v373; // eax@715 | |
2913 int v374; // eax@717 | |
112 | 2914 Player *v375; // edi@717 |
0 | 2915 int v376; // eax@717 |
2916 Player *v377; // ecx@719 | |
2917 int v378; // ecx@721 | |
2918 int v379; // ecx@722 | |
2919 int v380; // eax@724 | |
2920 int v381; // edi@727 | |
2921 int v382; // ecx@727 | |
2922 Player *v383; // eax@728 | |
2923 int v384; // eax@733 | |
2924 int v385; // edi@736 | |
2925 signed int v386; // eax@736 | |
2926 Player *v387; // edi@738 | |
2927 int v388; // edi@740 | |
2928 unsigned __int16 v389; // ST1C_2@740 | |
2929 __int16 v390; // ST18_2@740 | |
2930 stru6 *v391; // eax@740 | |
2931 int v392; // ecx@742 | |
2932 int v393; // ecx@743 | |
2933 int v394; // ecx@744 | |
2934 int v395; // edi@747 | |
2935 int v396; // eax@752 | |
2936 int v397; // eax@757 | |
2937 int v398; // eax@757 | |
2938 int v399; // eax@757 | |
2939 char *v400; // esi@757 | |
2940 Game *v401; // ecx@759 | |
2941 __int16 v402; // ST1C_2@759 | |
2942 __int16 v403; // ST18_2@759 | |
2943 stru6 *v404; // eax@759 | |
2944 int v405; // ecx@761 | |
2945 int v406; // ecx@762 | |
2946 int v407; // edi@765 | |
2947 __int16 v408; // ST1C_2@769 | |
2948 __int16 v409; // ST18_2@769 | |
2949 stru6 *v410; // eax@769 | |
2950 int v411; // ecx@772 | |
2951 int v412; // ecx@773 | |
2952 int v413; // edi@775 | |
2953 __int16 v414; // ST1C_2@781 | |
2954 __int16 v415; // ST18_2@781 | |
2955 stru6 *v416; // eax@781 | |
2956 int v417; // eax@787 | |
2957 int v418; // ecx@789 | |
2958 __int16 v419; // ax@791 | |
2959 signed int v420; // eax@793 | |
2960 int v421; // edx@793 | |
2961 const char *v422; // eax@801 | |
2962 int v423; // ecx@808 | |
2963 int v424; // ecx@809 | |
2964 int v425; // eax@811 | |
2965 signed int v426; // eax@815 | |
2966 signed int v427; // eax@820 | |
2967 int v428; // ecx@825 | |
2968 int v429; // ecx@826 | |
2969 int v430; // eax@828 | |
2970 stru6 *v431; // eax@831 | |
2971 int v432; // eax@831 | |
2972 Actor *v433; // edi@832 | |
2973 int v434; // eax@833 | |
2974 int v435; // ecx@837 | |
2975 int v436; // ecx@838 | |
2976 __int16 v437; // ST1C_2@843 | |
2977 __int16 v438; // ST18_2@843 | |
2978 stru6 *v439; // eax@843 | |
2979 int v440; // eax@843 | |
2980 int v441; // eax@847 | |
2981 int v442; // ecx@850 | |
2982 int v443; // ecx@851 | |
2983 int v444; // eax@853 | |
2984 signed int v445; // edi@857 | |
2985 int v446; // ecx@862 | |
2986 LevelDecoration *v447; // edi@864 | |
2987 __int16 v448; // ax@864 | |
2988 char *v449; // esi@870 | |
2989 int v450; // eax@870 | |
2990 int v451; // ecx@875 | |
2991 int v452; // ecx@876 | |
2992 int v453; // edi@878 | |
2993 __int16 v454; // ST1C_2@884 | |
2994 __int16 v455; // ST18_2@884 | |
2995 stru6 *v456; // eax@884 | |
2996 int v457; // ecx@887 | |
2997 int v458; // ecx@888 | |
2998 int v459; // eax@890 | |
2999 signed int v460; // eax@895 | |
3000 Actor *v461; // eax@897 | |
3001 unsigned __int16 v462; // cx@897 | |
3002 signed int v463; // edx@897 | |
3003 int v464; // ecx@905 | |
3004 int v465; // ecx@906 | |
3005 int v466; // edi@909 | |
3006 __int16 v467; // ST1C_2@913 | |
3007 __int16 v468; // ST18_2@913 | |
3008 stru6 *v469; // eax@913 | |
3009 int v470; // edi@913 | |
3010 int v471; // eax@917 | |
3011 int v472; // eax@917 | |
3012 char *v473; // esi@918 | |
3013 __int16 v474; // ST18_2@920 | |
3014 stru6 *v475; // eax@920 | |
3015 __int16 v476; // ST18_2@920 | |
3016 stru6 *v477; // eax@920 | |
3017 __int16 v478; // ST18_2@920 | |
3018 stru6 *v479; // eax@920 | |
3019 __int16 v480; // ST18_2@920 | |
3020 stru6 *v481; // eax@920 | |
3021 __int16 v482; // ST18_2@923 | |
3022 stru6 *v483; // eax@923 | |
3023 __int16 v484; // ST18_2@923 | |
3024 stru6 *v485; // eax@923 | |
3025 __int16 v486; // ST18_2@923 | |
3026 stru6 *v487; // eax@923 | |
3027 __int16 v488; // ST18_2@923 | |
3028 stru6 *v489; // eax@923 | |
3029 __int16 v490; // ST1C_2@924 | |
3030 __int16 v491; // ST18_2@924 | |
3031 stru6 *v492; // eax@924 | |
3032 int v493; // ecx@925 | |
3033 int v494; // ecx@926 | |
3034 __int16 v495; // ST1C_2@931 | |
3035 __int16 v496; // ST18_2@931 | |
3036 stru6 *v497; // eax@931 | |
3037 int v498; // edi@931 | |
3038 int v499; // eax@935 | |
3039 int v500; // eax@935 | |
3040 Player *v501; // edi@939 | |
3041 __int16 v502; // ST18_2@940 | |
3042 stru6 *v503; // eax@940 | |
3043 stru6 *v504; // eax@943 | |
3044 int v505; // eax@943 | |
3045 int v506; // eax@943 | |
3046 int v507; // edi@944 | |
3047 int v508; // eax@944 | |
3048 signed int v509; // eax@944 | |
3049 signed int v510; // edi@944 | |
3050 Actor *v511; // edi@946 | |
3051 int v512; // eax@946 | |
3052 SpellBuff *v513; // edi@946 | |
3053 int v514; // ecx@950 | |
3054 int v515; // ecx@951 | |
3055 int v516; // eax@953 | |
3056 int v517; // eax@956 | |
90 | 3057 Actor *v518; // edx@957 |
0 | 3058 __int16 v519; // cx@958 |
3059 int v520; // ecx@968 | |
3060 int v521; // ecx@969 | |
3061 int v522; // eax@971 | |
3062 __int16 v523; // ST18_2@975 | |
3063 stru6 *v524; // eax@975 | |
3064 __int16 v525; // ST18_2@975 | |
3065 stru6 *v526; // eax@975 | |
3066 __int16 v527; // ST18_2@975 | |
3067 stru6 *v528; // eax@975 | |
3068 __int16 v529; // ST18_2@975 | |
3069 stru6 *v530; // eax@975 | |
3070 int v531; // eax@982 | |
3071 int v532; // eax@982 | |
3072 int v533; // edi@983 | |
3073 int v534; // eax@983 | |
3074 signed int v535; // eax@983 | |
3075 signed int v536; // edi@983 | |
3076 stru6 *v537; // eax@984 | |
3077 int v538; // ecx@985 | |
3078 int v539; // ecx@986 | |
3079 int v540; // eax@988 | |
3080 __int16 v541; // ST18_2@991 | |
3081 stru6 *v542; // eax@991 | |
3082 __int16 v543; // ST18_2@991 | |
3083 stru6 *v544; // eax@991 | |
3084 __int16 v545; // ST18_2@991 | |
3085 stru6 *v546; // eax@991 | |
3086 __int16 v547; // ST18_2@991 | |
3087 stru6 *v548; // eax@991 | |
3088 double v549; // st7@991 | |
3089 unsigned __int16 v550; // di@991 | |
3090 int v551; // ecx@993 | |
3091 int v552; // ecx@994 | |
89 | 3092 Player *v553; // edi@1001 |
0 | 3093 __int16 v554; // ST18_2@1002 |
3094 stru6 *v555; // eax@1002 | |
3095 __int16 v556; // ST18_2@1002 | |
3096 stru6 *v557; // eax@1002 | |
3097 __int16 v558; // ST18_2@1002 | |
3098 stru6 *v559; // eax@1002 | |
3099 __int16 v560; // ST18_2@1002 | |
3100 stru6 *v561; // eax@1002 | |
3101 unsigned __int16 v562; // di@1005 | |
3102 signed int v563; // eax@1010 | |
3103 unsigned int v564; // ecx@1011 | |
3104 signed int v565; // eax@1012 | |
3105 Player **v566; // ecx@1012 | |
3106 int v567; // eax@1012 | |
3107 unsigned __int16 v568; // ST1C_2@1012 | |
3108 __int16 v569; // ST18_2@1012 | |
3109 stru6 *v570; // eax@1012 | |
3110 Player *v571; // eax@1013 | |
3111 char *v572; // ecx@1013 | |
3112 int v573; // ecx@1017 | |
3113 int v574; // ecx@1018 | |
3114 int v575; // eax@1020 | |
3115 signed int v576; // eax@1025 | |
3116 Player *v577; // eax@1026 | |
3117 int v578; // eax@1028 | |
3118 __int16 v579; // ax@1029 | |
3119 int v580; // eax@1031 | |
3120 int v581; // edi@1031 | |
3121 int v582; // eax@1031 | |
3122 __int16 v583; // ST1C_2@1034 | |
3123 __int16 v584; // ST18_2@1034 | |
3124 char *v585; // esi@1034 | |
3125 stru6 *v586; // eax@1034 | |
3126 signed int v587; // eax@1035 | |
3127 int v588; // ecx@1036 | |
3128 int v589; // ecx@1037 | |
3129 int v590; // ecx@1038 | |
3130 char v591; // al@1048 | |
3131 int v592; // esi@1052 | |
3132 int v593; // ecx@1057 | |
3133 int v594; // ecx@1058 | |
3134 int v595; // eax@1064 | |
3135 int v596; // esi@1066 | |
3136 unsigned int v597; // edi@1067 | |
3137 int v598; // eax@1079 | |
3138 signed int v599; // eax@1082 | |
3139 int v600; // edi@1086 | |
3140 int v601; // edx@1086 | |
3141 int v602; // eax@1086 | |
3142 int v603; // ecx@1086 | |
3143 int v604; // eax@1087 | |
3144 char *v605; // eax@1089 | |
3145 int v606; // edx@1091 | |
3146 int v607; // ecx@1100 | |
3147 __int16 v608; // ax@1102 | |
3148 signed int v609; // eax@1104 | |
3149 int v610; // edi@1106 | |
3150 unsigned int v611; // eax@1106 | |
89 | 3151 Player *v612; // edi@1106 |
3152 DDM_DLV_Header *v613; // eax@1108 | |
0 | 3153 int v614; // eax@1116 |
3154 int v615; // edi@1119 | |
3155 __int16 v616; // ST1C_2@1122 | |
3156 __int16 v617; // ST18_2@1122 | |
3157 stru6 *v618; // eax@1122 | |
112 | 3158 Player *v619; // edi@1123 |
0 | 3159 unsigned __int16 v620; // ST1C_2@1124 |
3160 __int16 v621; // ST18_2@1124 | |
3161 stru6 *v622; // eax@1124 | |
3162 signed __int64 v623; // qax@1127 | |
3163 int v624; // eax@1127 | |
3164 int v625; // edi@1129 | |
3165 int v626; // eax@1129 | |
3166 signed int v627; // eax@1129 | |
3167 signed int v628; // edi@1129 | |
3168 int v629; // ecx@1130 | |
3169 Player *v630; // eax@1131 | |
3170 int v631; // eax@1137 | |
3171 int v632; // edi@1140 | |
3172 Player *v633; // eax@1140 | |
3173 signed int v634; // eax@1140 | |
3174 int v635; // edi@1142 | |
3175 unsigned __int16 v636; // ST1C_2@1142 | |
3176 __int16 v637; // ST18_2@1142 | |
3177 stru6 *v638; // eax@1142 | |
3178 stru6 *v639; // eax@1143 | |
3179 int v640; // ecx@1146 | |
3180 int v641; // ecx@1147 | |
3181 int v642; // edi@1156 | |
3182 int v643; // eax@1156 | |
3183 int v644; // eax@1156 | |
3184 signed int v645; // eax@1158 | |
3185 Player *v646; // ebx@1169 | |
3186 int v647; // edi@1169 | |
3187 signed int v648; // ST1C_4@1170 | |
3188 Player *v649; // ecx@1170 | |
3189 unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3190 unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3191 unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3192 unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
3193 int v654; // [sp-4h] [bp-E88h]@124 | |
3194 unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 | |
3195 unsigned int v656; // [sp-4h] [bp-E88h]@639 | |
3196 int v657; // [sp-4h] [bp-E88h]@807 | |
3197 int v658; // [sp+0h] [bp-E84h]@100 | |
3198 int v659; // [sp+0h] [bp-E84h]@123 | |
3199 int v660; // [sp+0h] [bp-E84h]@146 | |
3200 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
3201 int v662; // [sp+0h] [bp-E84h]@304 | |
3202 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 | |
3203 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3204 int v665; // [sp+0h] [bp-E84h]@807 | |
3205 int v666; // [sp+4h] [bp-E80h]@12 | |
3206 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
3207 unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 | |
3208 int v669; // [sp+4h] [bp-E80h]@123 | |
3209 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3210 int v671; // [sp+4h] [bp-E80h]@146 | |
3211 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
3212 unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 | |
3213 __int16 v674; // [sp+4h] [bp-E80h]@684 | |
3214 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3215 int v676; // [sp+4h] [bp-E80h]@807 | |
3216 int v677; // [sp+4h] [bp-E80h]@861 | |
3217 int v678; // [sp+4h] [bp-E80h]@997 | |
3218 int v679; // [sp+14h] [bp-E70h]@515 | |
3219 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3220 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3221 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3222 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3223 int v684; // [sp+D04h] [bp-180h]@416 | |
3224 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3225 int x; // [sp+D20h] [bp-164h]@327 | |
3226 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3227 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3228 int v689; // [sp+D30h] [bp-154h]@943 | |
3229 int v690; // [sp+D34h] [bp-150h]@943 | |
3230 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3231 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3232 int v693; // [sp+D40h] [bp-144h]@137 | |
3233 int v694; // [sp+D44h] [bp-140h]@982 | |
3234 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3235 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3236 int v697; // [sp+D50h] [bp-134h]@129 | |
3237 int v698; // [sp+D54h] [bp-130h]@129 | |
3238 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3239 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3240 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3241 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3242 int v703; // [sp+D70h] [bp-114h]@286 | |
3243 int v704; // [sp+D74h] [bp-110h]@132 | |
3244 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3245 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3246 int v707; // [sp+D80h] [bp-104h]@1127 | |
3247 int v708; // [sp+D84h] [bp-100h]@1127 | |
3248 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3249 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3250 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3251 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3252 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3253 int n; // [sp+DA0h] [bp-E4h]@1 | |
3254 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3255 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3256 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3257 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3258 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3259 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3260 int v721; // [sp+DD8h] [bp-ACh]@163 | |
3261 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3262 int v723; // [sp+E4Ch] [bp-38h]@1 | |
3263 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3264 float v725; // [sp+E54h] [bp-30h]@23 | |
3265 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3266 int v726b; |
0 | 3267 float v727; // [sp+E5Ch] [bp-28h]@1 |
3268 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3269 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3270 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3271 Player *v730b; |
3272 ItemGen *v730c; | |
0 | 3273 int v731; // [sp+E6Ch] [bp-18h]@48 |
3274 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3275 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3276 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3277 int amount; // [sp+E80h] [bp-4h]@1 | |
3278 | |
3279 auto ecx0 = this; | |
3280 | |
3281 v711 = ecx0; | |
3282 | |
3283 LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3284 //LayingItem::LayingItem(&a1); | |
3285 | |
3286 v1 = 0; | |
3287 v2 = 0; | |
3288 amount = 0; | |
3289 LODWORD(v733) = 0; | |
3290 v723 = 0; | |
3291 v727 = 0.0; | |
3292 n = 0; | |
3293 while ( 1 ) | |
3294 { | |
3295 v3 = &v711[n]; | |
3296 HIDWORD(v733) = (int)v3; | |
3297 if ( v3->spellnum == (short)v1 ) | |
3298 goto LABEL_1166; | |
3299 if ( pParty->pPartyBuffs[11].NotExpired() ) | |
3300 pParty->pPartyBuffs[11].Reset(); | |
3301 if ( v3->field_8 & 0x3CA ) | |
3302 { | |
3303 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3304 v711->_427D48(1u); | |
3305 goto LABEL_1166; | |
3306 } | |
3307 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
3308 v4 = *(int *)&v3->field_C; | |
3309 if ( v4 != v1 ) | |
3310 goto LABEL_18; | |
3311 v5 = v3->spellnum; | |
3312 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) | |
3313 v666 = 1; | |
3314 else | |
3315 v666 = v1; | |
271 | 3316 a2 = stru_50C198.FindClosestActor(5120, 1, v666); |
0 | 3317 v6 = pMouse->uPointingObjectID; |
141 | 3318 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) |
0 | 3319 { |
3320 v4 = pMouse->uPointingObjectID; | |
3321 LABEL_18: | |
3322 a2 = v4; | |
3323 } | |
3324 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; | |
3325 if ( (short)a1.uItemType != (short)v1 ) | |
3326 { | |
141 | 3327 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3328 { |
141 | 3329 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3330 v2 = v723; |
3331 v1 = 0; | |
3332 } | |
3333 else | |
3334 { | |
3335 v715.uYawAngle = pParty->sRotationY; | |
3336 v715.uPitchAngle = pParty->sRotationX; | |
3337 } | |
3338 } | |
3339 v7 = v3->field_A; | |
3340 LODWORD(v725) = v1; | |
3341 _this = (ItemGen *)v1; | |
3342 if ( v7 == (short)v1 ) | |
3343 { | |
3344 v8 = v3->spellnum; | |
3345 if ( v3->spellnum >= 12 ) | |
3346 { | |
3347 if ( v8 >= 23 ) | |
3348 { | |
3349 if ( v8 >= 34 ) | |
3350 { | |
3351 if ( v8 >= 45 ) | |
3352 { | |
3353 if ( v8 >= 56 ) | |
3354 { | |
3355 if ( v8 >= 67 ) | |
3356 { | |
3357 if ( v8 >= 78 ) | |
3358 { | |
3359 if ( v8 >= 89 ) | |
3360 { | |
3361 if ( v8 >= 100 ) | |
3362 { | |
3363 if ( v8 != 100 ) | |
3364 { | |
3365 LABEL_45: | |
3366 HIWORD(v10) = HIWORD(pPlayer); | |
3367 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
3368 goto LABEL_47; | |
3369 } | |
3370 v667 = (PLAYER_SKILL_TYPE)5; | |
3371 } | |
3372 else | |
3373 { | |
3374 v667 = (PLAYER_SKILL_TYPE)20; | |
3375 } | |
3376 } | |
3377 else | |
3378 { | |
3379 v667 = (PLAYER_SKILL_TYPE)19; | |
3380 } | |
3381 } | |
3382 else | |
3383 { | |
3384 v667 = (PLAYER_SKILL_TYPE)18; | |
3385 } | |
3386 } | |
3387 else | |
3388 { | |
3389 v667 = (PLAYER_SKILL_TYPE)17; | |
3390 } | |
3391 } | |
3392 else | |
3393 { | |
3394 v667 = (PLAYER_SKILL_TYPE)16; | |
3395 } | |
3396 } | |
3397 else | |
3398 { | |
3399 v667 = (PLAYER_SKILL_TYPE)15; | |
3400 } | |
3401 } | |
3402 else | |
3403 { | |
3404 v667 = (PLAYER_SKILL_TYPE)14; | |
3405 } | |
3406 } | |
3407 else | |
3408 { | |
3409 v667 = (PLAYER_SKILL_TYPE)13; | |
3410 } | |
3411 } | |
3412 else | |
3413 { | |
3414 v667 = (PLAYER_SKILL_TYPE)12; | |
3415 } | |
3416 LODWORD(v725) = v667; | |
3417 v9 = pPlayer->GetActualSkillLevel(v667); | |
3418 v723 = v9 & 0x3F; | |
3419 v2 = v9 & 0x3F; | |
3420 goto LABEL_45; | |
3421 } | |
3422 v11 = v7; | |
3423 v10 = v7 & 0x3F; | |
3424 v723 = v10; | |
3425 v2 = v10; | |
3426 LABEL_47: | |
3427 if ( HIBYTE(v11) & 1 ) | |
3428 { | |
3429 v12 = 4; | |
3430 v731 = 4; | |
3431 } | |
3432 else | |
3433 { | |
3434 if ( (v11 & 0x80u) == 0 ) | |
3435 { | |
3436 v10 = ((v11 & 0x40) != 0) + 1; | |
3437 v731 = ((v11 & 0x40) != 0) + 1; | |
3438 } | |
3439 else | |
3440 { | |
3441 v731 = 3; | |
3442 } | |
3443 v12 = v731; | |
3444 } | |
3445 LOWORD(v10) = v3->spellnum; | |
3446 v730 = v10; | |
3447 v13 = v12 + 10 * (signed __int16)v10; | |
3448 v14 = v3->field_A == (short)v1; | |
3449 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing | |
3450 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); | |
3451 uRequiredMana = v15; | |
3452 sRecoveryTime = v16; | |
3453 if ( !v14 ) | |
3454 uRequiredMana = v1; | |
3455 if ( pParty->uCurrentHour == v1 ) | |
3456 { | |
3457 if ( pParty->uCurrentMinute != v1 ) | |
3458 goto LABEL_62; | |
3459 if ( LODWORD(v725) == 20 ) | |
3460 goto LABEL_61; | |
3461 } | |
3462 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == v1 && LODWORD(v725) == 19 ) | |
3463 LABEL_61: | |
3464 uRequiredMana = v1; | |
3465 LABEL_62: | |
3466 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) | |
3467 break; | |
3468 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); | |
3469 LABEL_203: | |
3470 v3->spellnum = v1; | |
3471 LABEL_1166: | |
3472 ++n; | |
3473 if ( n >= 10 ) | |
3474 return; | |
3475 } | |
3476 if ( !pPlayer->pConditions[0] || (signed __int16)v730 >= 100 ) | |
3477 goto LABEL_69; | |
3478 if ( rand() % 100 >= 50 ) | |
3479 { | |
3480 v12 = v731; | |
3481 LABEL_69: | |
3482 switch ( v3->spellnum ) | |
3483 { | |
3484 case 100: | |
3485 case 101: | |
3486 v17 = pPlayer; | |
3487 _this = (ItemGen *)1; | |
3488 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[5]) >= 3 ) | |
3489 _this = (ItemGen *)2; | |
3490 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3491 a1.stru_24.Reset(); | |
3492 v18 = v3->spellnum; | |
3493 a1.field_4C = v2; | |
3494 a1.field_48 = v18; | |
3495 a1.field_50 = v731; | |
3496 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3497 if ( v17->WearsItem(510, 2) ) | |
3498 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3499 a1.vPosition.x = pParty->vPosition.x; | |
3500 a1.vPosition.y = pParty->vPosition.y; | |
3501 a1.uAttributes = 0; | |
3502 a1.uSpriteFrameID = 0; | |
3503 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3504 v19 = 8 * v3->uPlayerID; | |
303 | 3505 LOBYTE(v19) = v19 | OBJECT_Player; |
3506 a1.field_58_pid = v19; | |
0 | 3507 a1.field_5C = a2; |
3508 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3509 a1.uFacing = LOWORD(v715.uYawAngle); | |
3510 a1.uSoundID = LOWORD(v3->field_10); | |
3511 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3512 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3513 a1.uAttributes = 256; | |
3514 if ( pParty->bTurnBasedModeOn == 1 ) | |
3515 a1.uAttributes = 260; | |
3516 for ( i = 0; i < (signed int)this; ++i ) | |
3517 { | |
3518 if ( i ) | |
3519 a1.vPosition.z += 32; | |
3520 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3521 if ( a1.Create( | |
3522 v715.uYawAngle, | |
3523 v715.uPitchAngle, | |
3524 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3525 v3->uPlayerID + 1) != -1 | |
3526 && pParty->bTurnBasedModeOn == 1 ) | |
3527 ++pTurnEngine->field_1C; | |
3528 } | |
3529 goto LABEL_83; | |
3530 case 102: | |
3531 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); | |
3532 a1.stru_24.Reset(); | |
3533 a1.field_48 = v3->spellnum; | |
3534 a1.field_4C = v723; | |
3535 a1.field_50 = v731; | |
3536 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3537 a1.vPosition.x = pParty->vPosition.x; | |
3538 a1.vPosition.y = pParty->vPosition.y; | |
3539 a1.uAttributes = 0; | |
3540 a1.uSpriteFrameID = 0; | |
3541 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3542 v22 = 8 * v3->uPlayerID; | |
303 | 3543 LOBYTE(v22) = v22 | OBJECT_Player; |
3544 a1.field_58_pid = v22; | |
0 | 3545 a1.field_5C = a2; |
3546 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3547 a1.uFacing = LOWORD(v715.uYawAngle); | |
3548 a1.uSoundID = LOWORD(v3->field_10); | |
3549 memcpy( | |
3550 &a1.stru_24, | |
3551 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3552 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3553 + 5], | |
3554 sizeof(a1.stru_24)); | |
3555 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3556 HIBYTE(a1.uAttributes) |= 1u; | |
3557 a1.uSectorID = v23; | |
3558 if ( pParty->bTurnBasedModeOn == 1 ) | |
3559 LOBYTE(a1.uAttributes) |= 4u; | |
3560 if ( a1.Create( | |
3561 v715.uYawAngle, | |
3562 v715.uPitchAngle, | |
3563 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3564 v3->uPlayerID + 1) != -1 | |
3565 && pParty->bTurnBasedModeOn == 1 ) | |
3566 ++pTurnEngine->field_1C; | |
3567 goto LABEL_83; | |
3568 case 1: | |
3569 LODWORD(v733) = 3600 * v2; | |
3570 v24 = v12 - 2; | |
3571 if ( v24 ) | |
3572 { | |
3573 v25 = v24 - 1; | |
3574 if ( v25 && v25 != 1 ) | |
3575 amount = 2; | |
3576 else | |
3577 amount = 4; | |
3578 } | |
3579 else | |
3580 { | |
3581 amount = 3; | |
3582 } | |
3583 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3584 goto LABEL_83; | |
3585 v668 = v1; | |
3586 v658 = v1; | |
3587 v653 = amount; | |
3588 v651 = v731; | |
3589 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); | |
3590 v27 = (char *)&pParty->pPartyBuffs[16]; | |
3591 goto LABEL_101; | |
3592 case 7: | |
3593 v29 = v12 - 2; | |
3594 if ( v29 ) | |
3595 { | |
3596 v30 = v29 - 1; | |
3597 if ( v30 ) | |
3598 { | |
3599 if ( v30 == 1 ) | |
3600 amount = 9; | |
3601 else | |
3602 amount = 3; | |
3603 } | |
3604 else | |
3605 { | |
3606 amount = 7; | |
3607 } | |
3608 } | |
3609 else | |
3610 { | |
3611 amount = 5; | |
3612 } | |
3613 v31 = v3->uPlayerID; | |
3614 HIDWORD(v733) = v1; | |
3615 v32 = 8 * v31; | |
3616 LOBYTE(v32) = v32 | 4; | |
3617 if ( (signed int)uNumLayingItems > v1 ) | |
3618 { | |
3619 v33 = (char *)&pLayingItems[0].field_48; | |
3620 v730 = uNumLayingItems; | |
3621 do | |
3622 { | |
3623 if ( *((short *)v33 - 36) != (short)v1 && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) | |
3624 ++HIDWORD(v733); | |
3625 v33 += 112; | |
3626 --v730; | |
3627 } | |
3628 while ( v730 ); | |
3629 } | |
3630 if ( SHIDWORD(v733) > amount ) | |
3631 goto LABEL_200; | |
3632 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3633 goto LABEL_83; | |
3634 a1.stru_24.Reset(); | |
3635 a1.field_48 = v3->spellnum; | |
3636 a1.field_4C = v2; | |
3637 a1.field_50 = v731; | |
3638 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3639 a1.vPosition.y = pParty->vPosition.y; | |
3640 a1.vPosition.x = pParty->vPosition.x; | |
3641 a1.uAttributes = v1; | |
3642 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3643 a1.uSectorID = pIndoor->GetSector( | |
3644 pParty->vPosition.x, | |
3645 pParty->vPosition.y, | |
3646 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3647 a1.uSpriteFrameID = v1; | |
3648 v34 = 8 * v3->uPlayerID; | |
303 | 3649 LOBYTE(v34) = v34 | OBJECT_Player; |
3650 a1.field_58_pid = v34; | |
0 | 3651 a1.field_5C = a2; |
3652 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3653 a1.uFacing = LOWORD(v715.uYawAngle); | |
3654 a1.uSoundID = LOWORD(v3->field_10); | |
3655 if ( pParty->bTurnBasedModeOn == 1 ) | |
3656 LOBYTE(a1.uAttributes) |= 4u; | |
3657 v669 = v3->uPlayerID + 1; | |
3658 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3659 v35 = pParty->sRotationX + 10; | |
3660 goto LABEL_124; | |
3661 case 20: | |
3662 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3663 goto LABEL_83; | |
3664 if ( a2 == v1 ) | |
3665 goto LABEL_200; | |
141 | 3666 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3667 goto LABEL_1056; |
3668 v699 = v1; | |
3669 v698 = v1; | |
3670 v697 = v1; | |
3671 a1.stru_24.Reset(); | |
3672 a1.field_48 = v3->spellnum; | |
3673 a1.field_4C = v2; | |
3674 a1.field_50 = v731; | |
3675 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3676 a1.uAttributes = v1; | |
3677 a1.uSectorID = v1; | |
3678 a1.uSpriteFrameID = v1; | |
3679 v37 = v3->uPlayerID; | |
3680 a1.field_60_distance_related_prolly_lod = 0; | |
3681 v37 *= 8; | |
303 | 3682 LOBYTE(v37) = v37 | OBJECT_Player; |
0 | 3683 a1.uFacing = v1; |
303 | 3684 a1.field_58_pid = v37; |
0 | 3685 v38 = a2 >> 3; |
3686 a1.uSoundID = LOWORD(v3->field_10); | |
3687 v39 = a2 >> 3; | |
3688 a1.vPosition.x = pActors[v39].vPosition.x; | |
3689 v40 = pActors[v39].vPosition.y; | |
3690 a1.vPosition.z = pActors[v39].vPosition.z; | |
3691 v41 = 8 * (a2 >> 3); | |
3692 a1.vPosition.y = v40; | |
3693 LOBYTE(v41) = v41 | 3; | |
3694 a1.field_5C = v41; | |
3695 v42 = a1.Create(0, v1, v1, v1); | |
3696 v43 = &v697; | |
3697 goto LABEL_133; | |
3698 case 44: | |
3699 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3700 goto LABEL_83; | |
3701 v726 = (Player *)(a2 >> 3); | |
3702 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3703 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3704 goto LABEL_1056; |
90 | 3705 pActors[a2 >> 3].pActorBuffs[10].Apply( |
0 | 3706 pMiscTimer->uTotalGameTimeElapsed + 128, |
3707 v1, | |
3708 v1, | |
3709 v1, | |
3710 v1); | |
3711 v706 = v1; | |
3712 v705 = v1; | |
3713 v704 = v1; | |
3714 a1.stru_24.Reset(); | |
3715 a1.field_48 = v3->spellnum; | |
3716 a1.field_4C = v2; | |
3717 a1.field_50 = v731; | |
3718 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3719 a1.uAttributes = v1; | |
3720 a1.uSectorID = v1; | |
3721 a1.uSpriteFrameID = v1; | |
3722 v44 = v3->uPlayerID; | |
3723 a1.field_60_distance_related_prolly_lod = 0; | |
3724 a1.uFacing = v1; | |
3725 v44 *= 8; | |
303 | 3726 LOBYTE(v44) = v44 | OBJECT_Player; |
0 | 3727 v38 = (signed int)v726; |
303 | 3728 a1.field_58_pid = v44; |
0 | 3729 a1.uSoundID = LOWORD(v3->field_10); |
3730 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3731 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3732 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3733 v46 = 8 * (int)v726; | |
3734 a1.vPosition.y = v45; | |
3735 LOBYTE(v46) = 8 * (char)v726 | 3; | |
3736 a1.field_5C = v46; | |
3737 v42 = a1.Create(0, v1, v1, v1); | |
3738 v43 = &v704; | |
3739 LABEL_133: | |
3740 v670 = (Vec3_int_ *)v43; | |
3741 v47 = v38; | |
3742 goto LABEL_139; | |
3743 case 79: | |
141 | 3744 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 3745 goto LABEL_83; |
3746 v730 = a2 >> 3; | |
3747 v693 = v1; | |
3748 HIDWORD(v733) = (int)&pActors[a2 >> 3]; | |
3749 v692 = v1; | |
3750 v691 = v1; | |
3751 a1.stru_24.Reset(); | |
3752 a1.field_48 = v3->spellnum; | |
3753 a1.field_4C = v2; | |
3754 a1.field_50 = v731; | |
3755 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3756 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | |
3757 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3758 v48 = *(short *)(HIDWORD(v733) + 138); | |
3759 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
3760 a1.uAttributes = v1; | |
3761 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); | |
3762 a1.uSpriteFrameID = v1; | |
3763 v49 = 8 * v3->uPlayerID; | |
303 | 3764 LOBYTE(v49) = v49 | OBJECT_Player; |
3765 a1.field_58_pid = v49; | |
0 | 3766 a1.field_5C = a2; |
3767 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3768 a1.uFacing = LOWORD(v715.uYawAngle); | |
3769 LOWORD(v49) = LOWORD(v3->field_10); | |
3770 LOBYTE(a1.uAttributes) |= 0x80u; | |
3771 a1.uSoundID = v49; | |
3772 v726 = (Player *)a1.Create(0, v1, v1, v1); | |
3773 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) | |
3774 goto LABEL_200; | |
3775 v47 = v730; | |
3776 v670 = (Vec3_int_ *)&v691; | |
3777 v42 = (signed int)v726; | |
3778 LABEL_139: | |
3779 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3780 goto LABEL_1056; | |
3781 case 2: | |
3782 case 6: | |
3783 case 11: | |
3784 case 18: | |
3785 case 26: | |
3786 case 32: | |
3787 case 34: | |
3788 case 37: | |
3789 case 57: | |
3790 case 65: | |
3791 case 70: | |
3792 case 78: | |
3793 case 97: | |
3794 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3795 goto LABEL_83; | |
3796 a1.stru_24.Reset(); | |
3797 a1.field_48 = v3->spellnum; | |
3798 a1.field_4C = v2; | |
3799 a1.field_50 = v731; | |
3800 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3801 a1.vPosition.y = pParty->vPosition.y; | |
3802 a1.vPosition.x = pParty->vPosition.x; | |
3803 a1.uAttributes = v1; | |
3804 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3805 a1.uSectorID = pIndoor->GetSector( | |
3806 pParty->vPosition.x, | |
3807 pParty->vPosition.y, | |
3808 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3809 a1.uSpriteFrameID = v1; | |
3810 v50 = 8 * v3->uPlayerID; | |
303 | 3811 LOBYTE(v50) = v50 | OBJECT_Player; |
3812 a1.field_58_pid = v50; | |
0 | 3813 a1.field_5C = a2; |
3814 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3815 a1.uFacing = LOWORD(v715.uYawAngle); | |
3816 a1.uSoundID = LOWORD(v3->field_10); | |
3817 if ( pParty->bTurnBasedModeOn == 1 ) | |
3818 LOBYTE(a1.uAttributes) |= 4u; | |
3819 if ( v3->spellnum == 18 ) | |
3820 LOBYTE(a1.uAttributes) |= 0x40u; | |
3821 goto LABEL_156; | |
3822 case 29: | |
3823 case 39: | |
3824 case 76: | |
3825 case 90: | |
3826 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3827 goto LABEL_83; | |
3828 a1.stru_24.Reset(); | |
3829 a1.field_48 = v3->spellnum; | |
3830 a1.field_4C = v2; | |
3831 a1.field_50 = v731; | |
3832 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3833 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3834 a1.vPosition.y = pParty->vPosition.y; | |
3835 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3836 v660 = pParty->vPosition.y; | |
3837 goto LABEL_153; | |
3838 case 87: | |
3839 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3840 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3841 goto LABEL_200; | |
3842 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3843 goto LABEL_152; | |
3844 goto LABEL_83; | |
3845 case 81: | |
3846 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3847 goto LABEL_83; | |
3848 if ( a2 == v1 | |
141 | 3849 || (a2 & 7) != OBJECT_Actor |
0 | 3850 || (v730 = a2 >> 3, |
3851 v721 = (int)&pActors[a2 >> 3], | |
3852 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3853 goto LABEL_1056; | |
413 | 3854 Actor::AI_Stand(v730, 4u, 0x80u, (AIDirection *)v1); |
0 | 3855 v726 = (Player *)(23040 * v2); |
3856 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3857 v55 = v721; | |
3858 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, v1, v1, v1); | |
3859 *(char *)(v55 + 38) |= 8u; | |
3860 *(short *)(v55 + 148) = v1; | |
3861 v672 = v1; | |
3862 *(short *)(v55 + 150) = v1; | |
3863 v661 = (Actor *)v55; | |
3864 goto LABEL_165; | |
3865 case 35: | |
3866 if ( v12 == 2 ) | |
3867 { | |
3868 v57 = 300 * v2; | |
3869 } | |
3870 else | |
3871 { | |
3872 if ( v12 == 3 ) | |
3873 { | |
3874 amount = 4; | |
3875 v57 = 300 * v2; | |
3876 goto LABEL_174; | |
3877 } | |
3878 if ( v12 == 4 ) | |
3879 { | |
3880 v57 = 300 * v2; | |
3881 amount = 8; | |
3882 goto LABEL_174; | |
3883 } | |
3884 v57 = 180 * v2; | |
3885 } | |
3886 amount = 2; | |
3887 LABEL_174: | |
3888 LODWORD(v733) = v57; | |
3889 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3890 goto LABEL_83; | |
141 | 3891 if ( (a2 & 7) != OBJECT_Actor |
0 | 3892 || (v721 = 836 * (a2 >> 3), |
90 | 3893 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3894 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3895 goto LABEL_1056; |
3896 v726 = (Player *)(23040 * v2); | |
3897 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3898 v59 = v721; | |
112 | 3899 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3900 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3901 pParty->uTimePlayed + (signed int)v58, | |
0 | 3902 v731, |
3903 amount, | |
3904 v1, | |
3905 v1); | |
3906 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; | |
3907 v672 = v1; | |
3908 v661 = (Actor *)LODWORD(v718); | |
3909 goto LABEL_165; | |
3910 case 60: | |
3911 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3912 goto LABEL_83; | |
3913 v730 = 836 * (a2 >> 3); | |
90 | 3914 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3915 goto LABEL_1056; |
3916 LODWORD(v733) = 300 * v2; | |
3917 if ( v731 == 2 ) | |
3918 { | |
3919 LODWORD(v733) = 600 * v2; | |
3920 } | |
3921 else | |
3922 { | |
3923 if ( v731 == 3 ) | |
3924 LODWORD(v733) = 29030400; | |
3925 } | |
112 | 3926 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3927 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3928 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3929 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3930 v726 = (Player *)((int)v733 << 7); | |
3931 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3932 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3933 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
3934 v731, | |
3935 v1, | |
3936 v1, | |
3937 v1); | |
3938 a1.stru_24.Reset(); | |
3939 a1.field_48 = v3->spellnum; | |
3940 a1.field_4C = v2; | |
3941 a1.field_50 = v731; | |
3942 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 3943 v61 = a2 >> 3; |
0 | 3944 goto LABEL_1086; |
3945 case 92: | |
3946 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3947 goto LABEL_83; | |
3948 a1.stru_24.Reset(); | |
3949 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3950 a1.vPosition.x = pParty->vPosition.x; | |
3951 a1.vPosition.y = pParty->vPosition.y; | |
3952 a1.uAttributes = v1; | |
3953 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3954 a1.uSectorID = pIndoor->GetSector( | |
3955 pParty->vPosition.x, | |
3956 pParty->vPosition.y, | |
3957 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3958 a1.uSpriteFrameID = v1; | |
3959 v62 = 8 * v3->uPlayerID; | |
303 | 3960 LOBYTE(v62) = v62 | OBJECT_Player; |
3961 a1.field_58_pid = v62; | |
0 | 3962 a1.field_5C = a2; |
3963 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3964 a1.uFacing = LOWORD(v715.uYawAngle); | |
3965 a1.uSoundID = LOWORD(v3->field_10); | |
3966 a1.field_50 = v731; | |
3967 a1.field_48 = 3; | |
3968 a1.field_4C = 300 * v2; | |
3969 goto LABEL_154; | |
3970 case 4: | |
3971 v63 = v12 - 1; | |
3972 if ( !v63 ) | |
3973 { | |
3974 amount = 10; | |
3975 goto LABEL_195; | |
3976 } | |
3977 v64 = v63 - 1; | |
3978 if ( !v64 ) | |
3979 { | |
3980 amount = 11; | |
3981 goto LABEL_195; | |
3982 } | |
3983 v65 = v64 - 1; | |
3984 if ( !v65 ) | |
3985 { | |
3986 amount = 12; | |
3987 LABEL_195: | |
3988 LODWORD(v733) = 3600 * v2; | |
3989 goto LABEL_196; | |
3990 } | |
3991 if ( v65 == 1 ) | |
3992 { | |
3993 LODWORD(v733) = v1; | |
3994 amount = 12; | |
3995 } | |
3996 LABEL_196: | |
3997 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3998 goto LABEL_83; | |
89 | 3999 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
4000 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
4001 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
4002 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
4003 { | |
315 | 4004 if (!v730c->Broken()) |
0 | 4005 { |
377 | 4006 if ( v730c->uSpecEnchantmentType == v1 ) |
0 | 4007 { |
377 | 4008 if ( v730c->uEncantmentType == v1 ) |
0 | 4009 { |
4010 v68 = BYTE4(v726->pConditions[3]); | |
4011 if ( !v68 || v68 == 1 || v68 == 2 ) | |
4012 { | |
377 | 4013 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
0 | 4014 { |
89 | 4015 v69 = v730c; |
0 | 4016 v14 = v731 == 4; |
4017 *(int *)(v730 + 12) = amount; | |
4018 if ( !v14 ) | |
4019 { | |
4020 v726 = (Player *)((int)v733 << 7); | |
4021 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
4022 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
4023 * 0.033333335); | |
4024 *(int *)(v69 + 20) |= 8u; | |
4025 } | |
4026 *(int *)(v69 + 20) |= 0x10u; | |
4027 LABEL_1055: | |
4028 dword_50C9A8 = 256; | |
4029 LABEL_1056: | |
4030 LODWORD(v727) = 1; | |
4031 LABEL_83: | |
4032 if ( v3->field_8 & 0x20 ) | |
4033 { | |
4034 LABEL_1162: | |
4035 if ( v727 != 0.0 ) | |
4036 pAudioPlayer->PlaySound( | |
4037 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4038 0, | |
4039 0, | |
4040 -1, | |
4041 0, | |
4042 v3->field_10, | |
4043 0, | |
4044 0); | |
4045 } | |
4046 else | |
4047 { | |
4048 if ( sRecoveryTime < 0 ) | |
4049 sRecoveryTime = 0; | |
4050 if ( pParty->bTurnBasedModeOn ) | |
4051 { | |
4052 v645 = sRecoveryTime; | |
4053 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4054 pPlayer->SetRecoveryTime(v645); | |
4055 if ( !some_active_character ) | |
4056 pTurnEngine->_40471C(); | |
4057 } | |
4058 else | |
4059 { | |
4060 pPlayer->SetRecoveryTime( | |
4061 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4062 } | |
4063 if ( v727 != 0.0 ) | |
4064 { | |
187 | 4065 pPlayer->PlaySound(SPEECH_49, 0); |
0 | 4066 goto LABEL_1162; |
4067 } | |
4068 } | |
4069 v3->spellnum = 0; | |
4070 v1 = 0; | |
4071 LABEL_1165: | |
4072 v2 = v723; | |
4073 goto LABEL_1166; | |
4074 } | |
4075 } | |
4076 } | |
4077 } | |
4078 } | |
4079 } | |
4080 LABEL_199: | |
4081 dword_50C9D0 = 113; | |
4082 dword_50C9D4 = v1; | |
4083 dword_50C9D8 = 1; | |
4084 LABEL_200: | |
4085 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4086 LABEL_201: | |
4087 v67 = 2; | |
4088 LABEL_202: | |
4089 ShowStatusBarString(v66, v67); | |
4090 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4091 goto LABEL_203; | |
4092 case 71: | |
4093 v70 = v12 - 1; | |
4094 LODWORD(v733) = 3600 * v2; | |
4095 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4096 { | |
4097 v72 = v71 - 1; | |
4098 if ( v72 ) | |
4099 { | |
4100 if ( v72 == 1 ) | |
4101 amount = 10; | |
4102 } | |
4103 else | |
4104 { | |
4105 amount = 3; | |
4106 } | |
4107 } | |
4108 else | |
4109 { | |
4110 amount = 1; | |
4111 } | |
4112 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4113 goto LABEL_83; | |
4114 v73 = v3->uPlayerID_2; | |
4115 v74 = v3->spellnum; | |
4116 v75 = pGame->GetStru6(); | |
4117 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); | |
4118 v668 = v1; | |
4119 v658 = v1; | |
4120 v653 = amount; | |
4121 v651 = v731; | |
4122 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); | |
4123 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; | |
4124 goto LABEL_103; | |
4125 case 3: | |
4126 case 14: | |
4127 case 25: | |
4128 case 36: | |
4129 case 58: | |
4130 case 69: | |
4131 v76 = v12 - 1; | |
4132 LODWORD(v733) = 3600 * v2; | |
4133 if ( v76 ) | |
4134 { | |
4135 v77 = v76 - 1; | |
4136 if ( v77 ) | |
4137 { | |
4138 v78 = v77 - 1; | |
4139 if ( v78 ) | |
4140 { | |
4141 if ( v78 != 1 ) | |
4142 goto LABEL_232; | |
4143 v79 = 4 * v2; | |
4144 } | |
4145 else | |
4146 { | |
4147 v79 = 3 * v2; | |
4148 } | |
4149 } | |
4150 else | |
4151 { | |
4152 v79 = 2 * v2; | |
4153 } | |
4154 amount = v79; | |
4155 } | |
4156 else | |
4157 { | |
4158 amount = v2; | |
4159 } | |
4160 LABEL_232: | |
4161 v80 = v3->spellnum; | |
4162 switch ( v80 ) | |
4163 { | |
4164 case 3: | |
4165 LODWORD(v725) = 6; | |
4166 break; | |
4167 case 14: | |
4168 LODWORD(v725) = v1; | |
4169 break; | |
4170 case 25: | |
4171 LODWORD(v725) = 17; | |
4172 break; | |
4173 case 36: | |
4174 LODWORD(v725) = 4; | |
4175 break; | |
4176 case 58: | |
4177 LODWORD(v725) = 12; | |
4178 break; | |
4179 default: | |
4180 if ( v80 != 69 ) | |
4181 goto LABEL_1166; | |
4182 LODWORD(v725) = 1; | |
4183 break; | |
4184 } | |
4185 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4186 goto LABEL_83; | |
4187 v81 = v3->spellnum; | |
4188 v82 = pGame->GetStru6(); | |
4189 pGame->GetStru6()->SetPlayerBuffAnim(v81, v1); | |
4190 v83 = 1; | |
4191 v84 = v3->spellnum; | |
4192 v85 = pGame->GetStru6(); | |
4193 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1u); | |
4194 v86 = v3->spellnum; | |
4195 v87 = pGame->GetStru6(); | |
4196 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2u); | |
4197 v88 = v3->spellnum; | |
4198 v89 = pGame->GetStru6(); | |
4199 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3u); | |
4200 v90 = (double)(signed int)v733 * 4.2666669; | |
4201 goto LABEL_304; | |
4202 case 5: | |
4203 if ( v12 <= v1 ) | |
4204 goto LABEL_254; | |
4205 if ( v12 <= 2 ) | |
4206 { | |
4207 v91 = 60 * (v2 + 60); | |
4208 } | |
4209 else | |
4210 { | |
4211 if ( v12 == 3 ) | |
4212 { | |
4213 v91 = 180 * (v2 + 20); | |
4214 } | |
4215 else | |
4216 { | |
4217 if ( v12 != 4 ) | |
4218 goto LABEL_254; | |
4219 v91 = 240 * (v2 + 15); | |
4220 } | |
4221 } | |
4222 LODWORD(v733) = v91; | |
4223 LABEL_254: | |
4224 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4225 { | |
89 | 4226 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4227 LODWORD(v727) = 1; |
4228 do | |
4229 { | |
89 | 4230 if ( v92->pConditions ) |
0 | 4231 LODWORD(v727) = v1; |
89 | 4232 ++v92; |
0 | 4233 } |
89 | 4234 while ( v92 <= &pParty->pPlayers[3] ); |
0 | 4235 if ( LODWORD(v727) != v1 ) |
4236 { | |
4237 v726 = (Player *)((int)v733 << 7); | |
4238 pParty->pPartyBuffs[8].Apply( | |
4239 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
4240 v731, | |
4241 v1, | |
4242 v1, | |
4243 v1); | |
4244 v93 = v3->spellnum; | |
4245 v94 = pGame->GetStru6(); | |
4246 pGame->GetStru6()->SetPlayerBuffAnim(v93, v1); | |
4247 v95 = v3->spellnum; | |
4248 v96 = pGame->GetStru6(); | |
4249 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1u); | |
4250 v97 = v3->spellnum; | |
4251 v98 = pGame->GetStru6(); | |
4252 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2u); | |
4253 v99 = v3->spellnum; | |
4254 v100 = pGame->GetStru6(); | |
4255 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3u); | |
4256 } | |
4257 } | |
4258 goto LABEL_83; | |
4259 case 46: | |
4260 v101 = v12 - 1; | |
4261 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4262 { | |
4263 v103 = v102 - 1; | |
4264 if ( v103 ) | |
4265 { | |
4266 if ( v103 != 1 ) | |
4267 goto LABEL_269; | |
4268 v104 = 3600 * (v2 + 1); | |
4269 } | |
4270 else | |
4271 { | |
4272 v104 = 900 * (v2 + 4); | |
4273 } | |
4274 } | |
4275 else | |
4276 { | |
4277 v104 = 300 * (v2 + 12); | |
4278 } | |
4279 LODWORD(v733) = v104; | |
4280 LABEL_269: | |
4281 amount = v2 + 5; | |
4282 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4283 goto LABEL_83; | |
4284 if ( v731 == 1 ) | |
4285 { | |
4286 v108 = v3->uPlayerID_2; | |
4287 v109 = v3->spellnum; | |
4288 v110 = pGame->GetStru6(); | |
4289 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
4290 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, v1, 65536); | |
4291 v668 = v1; | |
4292 v716 = v111; | |
4293 v658 = v111; | |
4294 v653 = amount; | |
4295 v726 = (Player *)((int)v733 << 7); | |
4296 v651 = 1; | |
4297 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4298 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[1]; | |
4299 goto LABEL_103; | |
4300 } | |
4301 v105 = 0; | |
4302 v726 = (Player *)((int)v733 << 7); | |
4303 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4304 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4305 do |
4306 { | |
4307 v106 = v3->spellnum; | |
4308 v107 = pGame->GetStru6(); | |
4309 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); | |
4310 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, v1, 65536); | |
89 | 4311 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
4312 ++v730b; | |
0 | 4313 ++v105; |
4314 } | |
89 | 4315 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4316 goto LABEL_1056; |
4317 case 52: | |
141 | 4318 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == OBJECT_Actor) |
0 | 4319 { |
4320 v730 = a2 >> 3; | |
4321 v112 = &pActors[a2 >> 3]; | |
4322 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4323 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4324 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4325 _this = (ItemGen *)v113; | |
4326 v114 = v721; | |
4327 v115 = (unsigned int)v726; | |
4328 if ( v113 < v721 ) | |
4329 { | |
4330 v116 = v113; | |
4331 v113 = v721; | |
4332 v114 = v116; | |
4333 } | |
4334 if ( v113 < (signed int)v726 ) | |
4335 { | |
4336 v117 = v113; | |
4337 v113 = (int)v726; | |
4338 v115 = v117; | |
4339 } | |
4340 if ( v114 < (signed int)v115 ) | |
4341 { | |
4342 v118 = v115; | |
4343 v115 = v114; | |
4344 v114 = v118; | |
4345 } | |
4346 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4347 if ( (double)(signed int)this <= 307.2 ) | |
4348 { | |
4349 v703 = 0; | |
4350 v702 = 0; | |
4351 v701 = 0; | |
4352 a1.stru_24.Reset(); | |
4353 v119 = HIDWORD(v733); | |
4354 a1.field_48 = *(int *)HIDWORD(v733); | |
4355 a1.field_4C = v723; | |
4356 a1.field_50 = v731; | |
4357 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4358 a1.uAttributes = 0; | |
4359 a1.uSectorID = 0; | |
4360 a1.uSpriteFrameID = 0; | |
4361 v120 = 8 * *(short *)(v119 + 2); | |
303 | 4362 LOBYTE(v120) = v120 | OBJECT_Player; |
0 | 4363 a1.field_60_distance_related_prolly_lod = 0; |
303 | 4364 a1.field_58_pid = v120; |
0 | 4365 a1.uFacing = 0; |
4366 a1.uSoundID = *(short *)(v119 + 16); | |
4367 a1.vPosition.x = v112->vPosition.x; | |
4368 a1.vPosition.y = v112->vPosition.y; | |
4369 v726 = (Player *)v112->uActorHeight; | |
4370 v121 = 8 * a2; | |
4371 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4372 LOBYTE(v121) = 8 * a2 | 3; | |
4373 a1.field_5C = v121; | |
4374 v122 = a1.Create(0, 0, 0, 0); | |
4375 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4376 LODWORD(v727) = 1; | |
4377 } | |
4378 else | |
4379 { | |
4380 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4381 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4382 *(int *)HIDWORD(v733) = 0; | |
4383 } | |
4384 v3 = (stru277 *)HIDWORD(v733); | |
4385 } | |
4386 goto LABEL_83; | |
4387 case 17: | |
4388 case 38: | |
4389 case 51: | |
4390 v123 = v12 - 1; | |
4391 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4392 { | |
4393 v125 = v124 - 1; | |
4394 if ( v125 ) | |
4395 { | |
4396 if ( v125 != 1 ) | |
4397 goto LABEL_296; | |
4398 v126 = 3600 * (v2 + 1); | |
4399 } | |
4400 else | |
4401 { | |
4402 v126 = 900 * (v2 + 4); | |
4403 } | |
4404 } | |
4405 else | |
4406 { | |
4407 v126 = 300 * (v2 + 12); | |
4408 } | |
4409 LODWORD(v733) = v126; | |
4410 LABEL_296: | |
4411 v127 = v3->spellnum; | |
4412 if ( v127 == 17 ) | |
4413 { | |
4414 amount = v1; | |
4415 LODWORD(v725) = 14; | |
4416 } | |
4417 else | |
4418 { | |
4419 if ( v127 == 38 ) | |
4420 { | |
4421 LODWORD(v725) = 15; | |
4422 amount = v2 + 5; | |
4423 } | |
4424 else | |
4425 { | |
4426 if ( v127 != 51 ) | |
4427 goto LABEL_1166; | |
4428 LODWORD(v725) = 9; | |
4429 amount = v2 + 5; | |
4430 } | |
4431 } | |
4432 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4433 goto LABEL_83; | |
4434 v128 = v3->spellnum; | |
4435 v129 = pGame->GetStru6(); | |
4436 pGame->GetStru6()->SetPlayerBuffAnim(v128, v1); | |
4437 v83 = 1; | |
4438 v130 = v3->spellnum; | |
4439 v131 = pGame->GetStru6(); | |
4440 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1u); | |
4441 v132 = v3->spellnum; | |
4442 v133 = pGame->GetStru6(); | |
4443 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2u); | |
4444 v134 = v3->spellnum; | |
4445 v135 = pGame->GetStru6(); | |
4446 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3u); | |
4447 v726 = (Player *)((int)v733 << 7); | |
4448 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
4449 LABEL_304: | |
4450 v673 = v1; | |
4451 v662 = v1; | |
4452 v655 = amount; | |
4453 v652 = v731; | |
4454 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; | |
4455 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; | |
4456 goto LABEL_977; | |
4457 case 8: | |
4458 v138 = v12 - 2; | |
4459 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4460 v140 = 600 * v2; | |
4461 else | |
4462 v140 = 60 * v2; | |
4463 LODWORD(v733) = v140; | |
4464 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4465 goto LABEL_83; | |
4466 v141 = v3->spellnum; | |
4467 v142 = pGame->GetStru6(); | |
4468 pGame->GetStru6()->SetPlayerBuffAnim(v141, v1); | |
4469 v143 = v3->spellnum; | |
4470 v144 = pGame->GetStru6(); | |
4471 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1u); | |
4472 v145 = v3->spellnum; | |
4473 v146 = pGame->GetStru6(); | |
4474 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2u); | |
4475 v147 = v3->spellnum; | |
4476 v148 = pGame->GetStru6(); | |
4477 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3u); | |
4478 v668 = v1; | |
4479 v726 = (Player *)((int)v733 << 7); | |
4480 v658 = v1; | |
4481 v653 = v2; | |
4482 v651 = v731; | |
4483 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4484 v27 = (char *)&pParty->pPartyBuffs[10]; | |
4485 goto LABEL_102; | |
4486 case 9: | |
4487 v149 = v12 - 1; | |
4488 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4489 { | |
4490 if ( v151 == 1 ) | |
4491 _this = (ItemGen *)20; | |
4492 } | |
4493 else | |
4494 { | |
4495 _this = (ItemGen *)16; | |
4496 } | |
4497 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4498 { | |
4499 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4500 goto LABEL_201; | |
4501 } | |
4502 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4503 goto LABEL_83; | |
4504 LODWORD(v725) = a2 & 7; | |
141 | 4505 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4506 { |
4507 v152 = a2 >> 3; | |
4508 uRequiredMana = pActors[v152].vPosition.x; | |
4509 v153 = pActors[v152].vPosition.y; | |
4510 v154 = pActors[v152].vPosition.z; | |
4511 LODWORD(v727) = v153; | |
4512 } | |
4513 else | |
4514 { | |
323 | 4515 v155 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4516 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); |
323 | 4517 v156 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4518 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); |
4519 v154 = pParty->vPosition.z; | |
4520 } | |
4521 HIDWORD(v733) = v154; | |
4522 v713 = v154 + 2500; | |
4523 v721 = v1; | |
4524 LODWORD(v718) = v1; | |
4525 if ( (signed int)this > v1 ) | |
4526 { | |
4527 *(float *)&y = (double)SHIDWORD(v733); | |
4528 *(float *)&v732 = (double)v713; | |
4529 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4530 v726 = (Player *)this; | |
4531 do | |
4532 { | |
4533 v157 = rand(); | |
4534 v158 = (double)SLODWORD(v718); | |
4535 v718 = v158; | |
4536 v159 = (double)v721; | |
4537 *(float *)&v721 = v159; | |
4538 a2 = v157 % 1000; | |
4539 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4540 v725 = v159 * v159; | |
4541 *(float *)&_this = v158 * v158; | |
4542 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4543 { | |
4544 LODWORD(v687) = v1; | |
4545 HIDWORD(v687) = v1; | |
4546 } | |
4547 else | |
4548 { | |
4549 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4550 v687 = __PAIR__( | |
4551 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4552 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4553 } | |
4554 a1.stru_24.Reset(); | |
4555 a1.field_48 = v3->spellnum; | |
4556 a1.field_4C = v2; | |
4557 a1.field_50 = v731; | |
4558 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4559 a1.uAttributes = v1; | |
4560 a1.vPosition.x = uRequiredMana; | |
4561 a1.vPosition.y = LODWORD(v727); | |
4562 a1.uSectorID = v1; | |
4563 a1.vPosition.z = a2 + v713; | |
4564 a1.uSpriteFrameID = v1; | |
303 | 4565 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4566 a1.field_5C = v730; |
4567 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4568 a1.uFacing = v687; | |
4569 a1.uSoundID = LOWORD(v3->field_10); | |
4570 if ( pParty->bTurnBasedModeOn == 1 ) | |
4571 a1.uAttributes = 4; | |
4572 if ( a1.Create( | |
4573 v687, | |
4574 SHIDWORD(v687), | |
4575 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4576 v1) != -1 | |
4577 && pParty->bTurnBasedModeOn == 1 ) | |
4578 ++pTurnEngine->field_1C; | |
4579 LODWORD(v718) = rand() % 1024 - 512; | |
4580 v160 = rand(); | |
4581 v14 = v726 == (Player *)1; | |
4582 v726 = (Player *)((char *)v726 - 1); | |
4583 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4584 } | |
4585 while ( !v14 ); | |
4586 } | |
4587 goto LABEL_1056; | |
4588 case 10: | |
4589 v67 = 2; | |
4590 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4591 { | |
4592 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4593 goto LABEL_202; | |
4594 } | |
4595 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4596 goto LABEL_83; | |
4597 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
4598 v700.z = v1; | |
4599 v700.y = v1; | |
4600 v700.x = v1; | |
4601 a1.stru_24.Reset(); | |
4602 a1.field_48 = v3->spellnum; | |
4603 a1.field_4C = v2; | |
4604 a1.field_50 = v731; | |
4605 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4606 a1.uAttributes = v1; | |
4607 a1.uSectorID = v1; | |
4608 a1.uSpriteFrameID = v1; | |
4609 v161 = v3->uPlayerID; | |
4610 a1.field_60_distance_related_prolly_lod = 0; | |
4611 a1.uFacing = v1; | |
4612 v161 *= 8; | |
303 | 4613 LOBYTE(v161) = v161 | OBJECT_Player; |
4614 a1.field_58_pid = v161; | |
0 | 4615 a1.uSoundID = LOWORD(v3->field_10); |
4616 a2 = v1; | |
4617 if ( (signed int)v726 > v1 ) | |
4618 { | |
4619 do | |
4620 { | |
4621 v162 = dword_50BF30[a2]; | |
4622 a1.vPosition.x = pActors[v162].vPosition.x; | |
4623 a1.vPosition.y = pActors[v162].vPosition.y; | |
4624 v732 = pActors[v162].uActorHeight; | |
4625 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4626 v163 = 8 * dword_50BF30[a2]; | |
4627 LOBYTE(v163) = v163 | 3; | |
4628 a1.field_5C = v163; | |
4629 v164 = a1.Create(0, v1, v1, v1); | |
4630 v165 = a2; | |
4631 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
4632 v166 = pGame->GetStru6(); | |
4633 v166->_4A81CA(&a1); | |
4634 v167 = pGame->GetStru6(); | |
4635 v167->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
4636 a2 = v165 + 1; | |
4637 } | |
4638 while ( v165 + 1 < (signed int)v726 ); | |
4639 } | |
4640 goto LABEL_1056; | |
4641 case 12: | |
4642 LODWORD(v733) = 3600 * v2; | |
4643 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4644 goto LABEL_83; | |
4645 v168 = 0; | |
4646 do | |
4647 { | |
4648 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, v1, 65536); | |
4649 v716 = v169; | |
4650 } | |
4651 while ( v168 < 4 ); | |
4652 v668 = v1; | |
4653 v732 = (int)v733 << 7; | |
4654 v658 = v1; | |
4655 v653 = v1; | |
4656 v651 = v731; | |
4657 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4658 goto LABEL_992; | |
4659 case 13: | |
4660 v170 = v12 - 1; | |
4661 if ( !v170 ) | |
4662 { | |
4663 v173 = 300 * v2; | |
4664 goto LABEL_353; | |
4665 } | |
4666 v171 = v170 - 1; | |
4667 if ( !v171 ) | |
4668 { | |
4669 v173 = 600 * v2; | |
4670 goto LABEL_353; | |
4671 } | |
4672 v172 = v171 - 1; | |
4673 if ( !v172 || v172 == 1 ) | |
4674 { | |
4675 v173 = 3600 * v2; | |
4676 LABEL_353: | |
4677 LODWORD(v733) = v173; | |
4678 } | |
4679 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4680 goto LABEL_83; | |
4681 v174 = 0; | |
4682 do | |
4683 pOtherOverlayList->_4418B1(2010, v174++ + 100, v1, 65536); | |
4684 while ( v174 < 4 ); | |
4685 v175 = v3->spellnum; | |
4686 v176 = pGame->GetStru6(); | |
4687 pGame->GetStru6()->SetPlayerBuffAnim(v175, v1); | |
4688 v83 = 1; | |
4689 v177 = v3->spellnum; | |
4690 v178 = pGame->GetStru6(); | |
4691 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1u); | |
4692 v179 = v3->spellnum; | |
4693 v180 = pGame->GetStru6(); | |
4694 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2u); | |
4695 v181 = v3->spellnum; | |
4696 v182 = pGame->GetStru6(); | |
4697 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3u); | |
4698 v673 = v1; | |
4699 v732 = (int)v733 << 7; | |
4700 v662 = v1; | |
4701 v655 = v1; | |
4702 v652 = v731; | |
4703 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4704 v137 = (char *)&pParty->pPartyBuffs[5]; | |
4705 goto LABEL_976; | |
4706 case 15: | |
4707 v184 = v12 - 1; | |
4708 if ( v184 ) | |
4709 { | |
4710 v185 = v184 - 1; | |
4711 if ( v185 ) | |
4712 { | |
4713 v186 = v185 - 1; | |
4714 if ( v186 ) | |
4715 { | |
4716 if ( v186 == 1 ) | |
4717 amount = 9; | |
4718 } | |
4719 else | |
4720 { | |
4721 amount = 7; | |
4722 } | |
4723 } | |
4724 else | |
4725 { | |
4726 amount = 5; | |
4727 } | |
4728 } | |
4729 else | |
4730 { | |
4731 amount = 3; | |
4732 } | |
4733 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4734 goto LABEL_83; | |
4735 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
4736 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4737 a1.stru_24.Reset(); | |
4738 a1.field_48 = v3->spellnum; | |
4739 a1.field_4C = v2; | |
4740 a1.field_50 = v731; | |
4741 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4742 a1.vPosition.y = pParty->vPosition.y; | |
4743 a1.vPosition.x = pParty->vPosition.x; | |
4744 a1.uAttributes = v1; | |
4745 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4746 a1.uSectorID = pIndoor->GetSector( | |
4747 pParty->vPosition.x, | |
4748 pParty->vPosition.y, | |
4749 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
4750 a1.uSpriteFrameID = v1; | |
4751 v187 = 8 * v3->uPlayerID; | |
303 | 4752 LOBYTE(v187) = v187 | OBJECT_Player; |
4753 a1.field_58_pid = v187; | |
0 | 4754 a1.field_5C = a2; |
4755 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4756 a1.uSoundID = LOWORD(v3->field_10); | |
4757 if ( pParty->bTurnBasedModeOn == 1 ) | |
4758 LOBYTE(a1.uAttributes) |= 4u; | |
4759 v188 = (signed int)v726 / -2; | |
4760 v189 = (signed int)v726 / 2; | |
4761 while ( v188 <= v189 ) | |
4762 { | |
4763 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4764 if ( a1.Create( | |
4765 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4766 v715.uPitchAngle, | |
4767 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4768 v3->uPlayerID + 1) != -1 | |
4769 && pParty->bTurnBasedModeOn == 1 ) | |
4770 ++pTurnEngine->field_1C; | |
4771 v188 += v732; | |
4772 } | |
4773 goto LABEL_1056; | |
4774 case 16: | |
4775 if ( pParty->uFlags & 8 ) | |
4776 { | |
4777 v190 = pGlobalTXT_LocalizationStrings[493]; | |
4778 goto LABEL_462; | |
4779 } | |
4780 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4781 goto LABEL_83; | |
4782 v191 = 0; | |
4783 do | |
4784 pOtherOverlayList->_4418B1(2040, v191++ + 100, v1, 65536); | |
4785 while ( v191 < 4 ); | |
4786 BYTE1(pParty->uFlags) |= 1u; | |
4787 pParty->uFallSpeed = 1000; | |
4788 goto LABEL_1056; | |
4789 case 19: | |
4790 v192 = v12 - 1; | |
4791 if ( !v192 ) | |
4792 { | |
4793 amount = v2; | |
4794 goto LABEL_391; | |
4795 } | |
4796 v193 = v192 - 1; | |
4797 if ( !v193 ) | |
4798 { | |
4799 v196 = 2 * v2; | |
4800 LABEL_389: | |
4801 amount = v196; | |
4802 LABEL_391: | |
4803 v195 = 600 * v2; | |
4804 goto LABEL_392; | |
4805 } | |
4806 v194 = v193 - 1; | |
4807 if ( !v194 ) | |
4808 { | |
4809 v196 = 3 * v2; | |
4810 goto LABEL_389; | |
4811 } | |
4812 if ( v194 != 1 ) | |
4813 goto LABEL_393; | |
4814 amount = 4 * v2; | |
4815 v195 = 3600 * v2; | |
4816 LABEL_392: | |
4817 LODWORD(v733) = v195; | |
4818 LABEL_393: | |
4819 if ( pParty->uFlags & 0x30 ) | |
4820 { | |
4821 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4822 goto LABEL_201; | |
4823 } | |
4824 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4825 { | |
4826 v197 = v3->spellnum; | |
4827 v198 = pGame->GetStru6(); | |
4828 pGame->GetStru6()->SetPlayerBuffAnim(v197, v1); | |
4829 v83 = 1; | |
4830 v199 = v3->spellnum; | |
4831 v200 = pGame->GetStru6(); | |
4832 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1u); | |
4833 v201 = v3->spellnum; | |
4834 v202 = pGame->GetStru6(); | |
4835 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2u); | |
4836 v203 = v3->spellnum; | |
4837 v204 = pGame->GetStru6(); | |
4838 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3u); | |
4839 v673 = v1; | |
4840 v732 = (int)v733 << 7; | |
4841 v662 = v1; | |
4842 v655 = amount; | |
4843 v652 = v731; | |
4844 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4845 v137 = (char *)&pParty->pPartyBuffs[11]; | |
4846 LABEL_976: | |
4847 v136 = pParty->uTimePlayed + v183; | |
4848 LABEL_977: | |
4849 ((SpellBuff *)v137)->Apply(v136, v652, v655, v662, v673); | |
4850 LABEL_978: | |
4851 LODWORD(v727) = v83; | |
4852 } | |
4853 goto LABEL_83; | |
4854 case 21: | |
4855 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4856 { | |
4857 v190 = pGlobalTXT_LocalizationStrings[494]; | |
4858 LABEL_462: | |
4859 ShowStatusBarString(v190, 2u); | |
4860 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4861 goto LABEL_83; | |
4862 } | |
4863 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4864 { | |
4865 LABEL_461: | |
4866 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4867 goto LABEL_462; | |
4868 } | |
4869 LODWORD(v733) = 3600 * v2; | |
4870 if ( v731 == 2 || v731 == 3 || (amount = v1, v731 != 4) ) | |
4871 amount = 1; | |
4872 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4873 goto LABEL_83; | |
4874 v205 = 0; | |
4875 do | |
4876 pOtherOverlayList->_4418B1(2090, v205++ + 100, v1, 65536); | |
4877 while ( v205 < 4 ); | |
4878 v206 = pOtherOverlayList->_4418B1(10008, 203, v1, 65536); | |
4879 v207 = v3->uPlayerID + 1; | |
4880 v716 = v206; | |
4881 v668 = v207; | |
4882 v658 = v206; | |
4883 v653 = amount; | |
4884 v732 = (int)v733 << 7; | |
4885 v651 = v731; | |
4886 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4887 v27 = (char *)&pParty->pPartyBuffs[7]; | |
4888 LABEL_101: | |
4889 v26 = (signed int)v26; | |
4890 LABEL_102: | |
4891 v28 = pParty->uTimePlayed + v26; | |
4892 LABEL_103: | |
4893 HIDWORD(v650) = HIDWORD(v28); | |
4894 LABEL_104: | |
4895 LODWORD(v650) = v28; | |
4896 ((SpellBuff *)v27)->Apply(v650, v651, v653, v658, v668); | |
4897 goto LABEL_1056; | |
4898 case 22: | |
4899 v67 = 2; | |
4900 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4901 { | |
4902 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4903 goto LABEL_202; | |
4904 } | |
4905 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4906 goto LABEL_83; | |
4907 v208 = a2 & 7; | |
4908 LODWORD(v725) = a2 & 7; | |
4909 if ( v208 == 3 ) | |
4910 { | |
4911 v209 = a2 >> 3; | |
4912 LODWORD(v718) = pActors[v209].vPosition.x; | |
4913 v210 = pActors[v209].vPosition.y; | |
4914 v211 = pActors[v209].vPosition.z; | |
4915 v713 = v210; | |
4916 } | |
4917 else | |
4918 { | |
323 | 4919 v212 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4920 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); |
323 | 4921 v213 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4922 v214 = sub_42EBBE(2048, v213); |
4923 v211 = pParty->vPosition.z; | |
4924 v713 = pParty->vPosition.y + v214; | |
4925 v208 = LODWORD(v725); | |
4926 } | |
4927 v726 = (Player *)v211; | |
4928 HIDWORD(v733) = v1; | |
4929 *(float *)&v732 = (double)v211; | |
4930 LODWORD(v725) = v211 + 2500; | |
4931 v721 = v1; | |
4932 *(float *)&y = (double)(v211 + 2500); | |
4933 v730 = v208 == 3 ? a2 : 0; | |
4934 a2 = 20; | |
4935 do | |
4936 { | |
4937 v215 = rand(); | |
4938 v216 = (double)v721; | |
4939 v727 = v216; | |
4940 v217 = (double)SHIDWORD(v733); | |
4941 *(float *)&uRequiredMana = v217; | |
4942 _this = (ItemGen *)(v215 % 1000); | |
4943 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4944 *(float *)&v721 = v217 * v217; | |
4945 *(float *)&v726 = v216 * v216; | |
4946 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4947 { | |
4948 LODWORD(v685) = v1; | |
4949 HIDWORD(v685) = v1; | |
4950 } | |
4951 else | |
4952 { | |
4953 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4954 v685 = __PAIR__( | |
4955 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4956 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4957 } | |
4958 a1.stru_24.Reset(); | |
4959 a1.field_48 = v3->spellnum; | |
4960 a1.field_4C = v2; | |
4961 a1.field_50 = v731; | |
4962 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4963 a1.uAttributes = v1; | |
4964 a1.vPosition.x = LODWORD(v718); | |
4965 a1.vPosition.y = v713; | |
4966 a1.uSectorID = v1; | |
4967 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); | |
4968 a1.uSpriteFrameID = v1; | |
303 | 4969 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4970 a1.field_5C = v730; |
4971 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4972 a1.uFacing = v685; | |
4973 a1.uSoundID = LOWORD(v3->field_10); | |
4974 if ( pParty->bTurnBasedModeOn == 1 ) | |
4975 a1.uAttributes = 4; | |
4976 if ( a1.Create( | |
4977 v685, | |
4978 SHIDWORD(v685), | |
4979 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4980 v1) != -1 | |
4981 && pParty->bTurnBasedModeOn == 1 ) | |
4982 ++pTurnEngine->field_1C; | |
4983 v721 = rand() % 1024 - 512; | |
4984 v218 = rand(); | |
4985 v14 = a2-- == 1; | |
4986 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4987 } | |
4988 while ( !v14 ); | |
4989 goto LABEL_1056; | |
4990 case 23: | |
4991 v219 = v12 - 2; | |
4992 if ( v219 ) | |
4993 { | |
4994 v220 = v219 - 1; | |
4995 if ( v220 ) | |
4996 { | |
4997 if ( v220 == 1 ) | |
4998 { | |
4999 amount = v1; | |
5000 goto LABEL_433; | |
5001 } | |
5002 v221 = 180 * v2; | |
5003 } | |
5004 else | |
5005 { | |
5006 v221 = 86400 * v2; | |
5007 } | |
5008 } | |
5009 else | |
5010 { | |
5011 v221 = 3600 * v2; | |
5012 } | |
5013 amount = v221; | |
5014 LABEL_433: | |
5015 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5016 goto LABEL_83; | |
5017 v222 = (char *)pParty->pPlayers; | |
5018 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
5019 break; | |
5020 case 24: | |
5021 v224 = v12 - 2; | |
5022 if ( v224 ) | |
5023 { | |
5024 v225 = v224 - 1; | |
5025 if ( v225 ) | |
5026 { | |
5027 if ( v225 == 1 ) | |
5028 amount = 7; | |
5029 else | |
5030 amount = 1; | |
5031 } | |
5032 else | |
5033 { | |
5034 amount = 5; | |
5035 } | |
5036 } | |
5037 else | |
5038 { | |
5039 amount = 3; | |
5040 } | |
5041 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5042 goto LABEL_83; | |
5043 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
5044 if ( amount == 1 ) | |
5045 { | |
5046 LABEL_152: | |
5047 a1.stru_24.Reset(); | |
5048 a1.field_48 = v3->spellnum; | |
5049 a1.field_50 = v731; | |
5050 a1.field_4C = v2; | |
5051 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5052 a1.vPosition.y = pParty->vPosition.y; | |
5053 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5054 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5055 v660 = pParty->vPosition.y; | |
5056 LABEL_153: | |
5057 a1.uAttributes = v1; | |
5058 a1.vPosition.x = pParty->vPosition.x; | |
5059 a1.vPosition.z = v51; | |
5060 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
5061 a1.uSpriteFrameID = v1; | |
5062 a1.uSectorID = v52; | |
5063 v53 = 8 * v3->uPlayerID; | |
303 | 5064 LOBYTE(v53) = v53 | OBJECT_Player; |
5065 a1.field_58_pid = v53; | |
0 | 5066 a1.field_5C = a2; |
5067 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5068 a1.uFacing = LOWORD(v715.uYawAngle); | |
5069 a1.uSoundID = LOWORD(v3->field_10); | |
5070 LABEL_154: | |
5071 if ( pParty->bTurnBasedModeOn == 1 ) | |
5072 LOBYTE(a1.uAttributes) |= 4u; | |
5073 LABEL_156: | |
5074 v669 = v3->uPlayerID + 1; | |
5075 v36 = v715.uYawAngle; | |
5076 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5077 v654 = v715.uPitchAngle; | |
5078 LABEL_157: | |
5079 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
5080 ++pTurnEngine->field_1C; | |
5081 } | |
5082 else | |
5083 { | |
5084 v732 = SHIDWORD(v733) / (amount - 1); | |
5085 a1.stru_24.Reset(); | |
5086 a1.field_48 = v3->spellnum; | |
5087 a1.field_4C = v2; | |
5088 a1.field_50 = v731; | |
5089 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5090 a1.vPosition.y = pParty->vPosition.y; | |
5091 a1.vPosition.x = pParty->vPosition.x; | |
5092 a1.uAttributes = v1; | |
5093 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5094 a1.uSectorID = pIndoor->GetSector( | |
5095 pParty->vPosition.x, | |
5096 pParty->vPosition.y, | |
5097 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5098 a1.uSpriteFrameID = v1; | |
5099 v226 = 8 * v3->uPlayerID; | |
303 | 5100 LOBYTE(v226) = v226 | OBJECT_Player; |
5101 a1.field_58_pid = v226; | |
0 | 5102 a1.field_5C = a2; |
5103 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5104 a1.uSoundID = LOWORD(v3->field_10); | |
5105 if ( pParty->bTurnBasedModeOn == 1 ) | |
5106 LOBYTE(a1.uAttributes) |= 4u; | |
5107 v227 = SHIDWORD(v733) / -2; | |
5108 y = (char *)(SHIDWORD(v733) / 2); | |
5109 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5110 { | |
5111 v228 = v715.uYawAngle; | |
5112 do | |
5113 { | |
5114 a1.uFacing = v227 + v228; | |
5115 if ( a1.Create( | |
5116 v227 + v228, | |
5117 v715.uPitchAngle, | |
5118 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5119 v3->uPlayerID + 1) != -1 | |
5120 && pParty->bTurnBasedModeOn == 1 ) | |
5121 ++pTurnEngine->field_1C; | |
5122 v227 += v732; | |
5123 } | |
5124 while ( v227 <= (signed int)y ); | |
5125 } | |
5126 } | |
5127 goto LABEL_1056; | |
5128 case 27: | |
5129 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5130 goto LABEL_461; | |
5131 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5132 v229 = 600 * v2; | |
5133 else | |
5134 v229 = 3600 * v2; | |
5135 LODWORD(v733) = v229; | |
5136 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5137 goto LABEL_83; | |
5138 v716 = pOtherOverlayList->_4418B1(10005, 201, v1, 65536); | |
5139 v230 = v3->spellnum; | |
5140 v231 = pGame->GetStru6(); | |
5141 pGame->GetStru6()->SetPlayerBuffAnim(v230, v1); | |
5142 v232 = 1; | |
5143 v233 = v3->spellnum; | |
5144 v234 = pGame->GetStru6(); | |
5145 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1u); | |
5146 v235 = v3->spellnum; | |
5147 v236 = pGame->GetStru6(); | |
5148 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2u); | |
5149 v237 = v3->spellnum; | |
5150 v238 = pGame->GetStru6(); | |
5151 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3u); | |
5152 v239 = v3->uPlayerID + 1; | |
5153 v732 = v229 << 7; | |
5154 pParty->pPartyBuffs[18].Apply( | |
5155 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5156 v731, | |
5157 amount, | |
5158 v716, | |
5159 v239); | |
5160 if ( v731 == 4 ) | |
5161 pParty->pPartyBuffs[18].uFlags = 1; | |
89 | 5162 LODWORD(v727) = v232; |
5163 goto LABEL_83; | |
0 | 5164 case 28: |
5165 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5166 goto LABEL_83; | |
5167 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; | |
5168 y = v240; | |
5169 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5170 goto LABEL_199; | |
5171 if ( v731 == 1 || v731 == 2 ) | |
5172 { | |
5173 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5174 } | |
5175 else | |
5176 { | |
5177 if ( v731 == 3 ) | |
5178 { | |
5179 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5180 } | |
5181 else | |
5182 { | |
5183 if ( v731 != 4 ) | |
5184 { | |
5185 v241 = 0.0; | |
5186 goto LABEL_484; | |
5187 } | |
5188 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5189 } | |
5190 } | |
5191 if ( v241 > 1.0 ) | |
5192 v241 = 1.0; | |
5193 LABEL_484: | |
5194 v732 = (unsigned __int8)v240[25]; | |
5195 v242 = (signed __int64)((double)v732 * v241); | |
5196 v243 = y; | |
5197 y[25] = v242; | |
5198 *((int *)v243 + 4) = (unsigned __int8)v242; | |
5199 if ( (unsigned __int8)v242 <= v1 ) | |
5200 { | |
5201 *(int *)v243 = v1; | |
5202 dword_50C9D0 = 113; | |
5203 dword_50C9D4 = v1; | |
5204 dword_50C9D8 = 1; | |
5205 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
5206 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5207 v3->spellnum = v1; | |
5208 goto LABEL_1165; | |
5209 } | |
5210 *((int *)v243 + 5) |= 0x40u; | |
5211 goto LABEL_1055; | |
5212 case 30: | |
5213 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5214 goto LABEL_83; | |
5215 uRequiredMana = v1; | |
5216 HIDWORD(v733) = 10 * v2; | |
5217 v730 = 1; | |
5218 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5219 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5220 if ( v731 == 1 ) | |
5221 { | |
5222 v245 = (int)&v244[36 * a2 + 532]; | |
5223 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5224 v311 = __OFSUB__(*(int *)v245, 134); | |
5225 v14 = *(int *)v245 == 134; | |
5226 v310 = *(int *)v245 - 134 < 0; | |
5227 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5228 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5229 { | |
5230 if ( *(int *)&v244[36 * a2 + 544] == v1 ) | |
5231 { | |
5232 if ( *(int *)&v244[36 * a2 + 536] == v1 ) | |
5233 { | |
5234 if ( *(int *)&v244[36 * a2 + 540] == v1 ) | |
5235 { | |
5236 v312 = v309[28]; | |
5237 if ( v312 ) | |
5238 { | |
5239 if ( v312 != 1 ) | |
5240 { | |
5241 if ( v312 != 2 ) | |
5242 { | |
5243 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5244 if ( !(v244[36 * a2 + 552] & 2) ) | |
5245 { | |
5246 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5247 { | |
5248 uRequiredMana = 1; | |
5249 v730 = v1; | |
5250 } | |
5251 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5252 uRequiredMana = 1; | |
5253 if ( uRequiredMana == v1 ) | |
5254 { | |
5255 v313 = *(char *)(LODWORD(v725) + 28); | |
5256 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5257 { | |
224 | 5258 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5259 *(int *)(v245 + 4) = 0; |
222 | 5260 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5261 + 1]; |
5262 ; | |
222 | 5263 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5264 + 1] ) |
5265 { | |
5266 ++*(int *)(v245 + 4); | |
5267 if ( j >= v314 ) | |
5268 break; | |
5269 } | |
5270 v254 = rand(); | |
224 | 5271 v255 = 10;//pItemsTable->field_116D8[17]; |
5272 v256 = 10;//pItemsTable->field_116D8[16]; | |
0 | 5273 LABEL_611: |
5274 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5275 LABEL_612: | |
5276 _this->uItemID |= 0x20u; | |
5277 goto LABEL_1055; | |
5278 } | |
5279 goto LABEL_615; | |
5280 } | |
5281 LABEL_613: | |
5282 v316 = _this->uItemID; | |
5283 if ( !(BYTE1(v316) & 2) ) | |
5284 { | |
5285 LOBYTE(v316) = v316 | 2; | |
5286 _this->uItemID = v316; | |
5287 } | |
5288 } | |
5289 } | |
5290 } | |
5291 } | |
5292 } | |
5293 } | |
5294 } | |
5295 } | |
5296 LABEL_616: | |
5297 if ( LODWORD(v727) == v1 ) | |
5298 { | |
5299 v317 = pGlobalTXT_LocalizationStrings[428]; | |
5300 if ( v730 == v1 ) | |
5301 v317 = pGlobalTXT_LocalizationStrings[585]; | |
5302 ShowStatusBarString(v317, 2u); | |
5303 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5304 v318 = v726; | |
5305 v3->spellnum = v1; | |
187 | 5306 v318->PlaySound(SPEECH_43, v1); |
0 | 5307 } |
5308 goto LABEL_83; | |
5309 } | |
5310 if ( v731 != 2 ) | |
5311 { | |
5312 if ( v731 == 3 ) | |
5313 { | |
5314 v245 = (int)&v244[36 * a2 + 532]; | |
5315 v269 = *(int *)v245; | |
5316 if ( *(int *)v245 > 134 | |
5317 || *(int *)(v245 + 12) != v1 | |
5318 || *(int *)(v245 + 4) != v1 | |
5319 || *(int *)(v245 + 8) != v1 | |
5320 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) | |
5321 goto LABEL_616; | |
5322 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5323 LODWORD(v725) = (int)v270; | |
5324 v271 = v270[28]; | |
5325 if ( v271 && v271 != 1 && v271 != 2 ) | |
5326 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5327 else | |
5328 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5329 if ( v272 ) | |
5330 { | |
5331 uRequiredMana = 1; | |
5332 v730 = v1; | |
5333 } | |
5334 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5335 uRequiredMana = 1; | |
5336 if ( uRequiredMana != v1 ) | |
5337 goto LABEL_613; | |
5338 v273 = v725; | |
5339 v274 = *(char *)(LODWORD(v725) + 28); | |
5340 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 ) | |
5341 { | |
5342 if ( rand() % 100 < 80 | |
5343 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5344 { | |
224 | 5345 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5346 *(int *)(v245 + 4) = 0; |
222 | 5347 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5348 ; |
222 | 5349 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5350 + 1] ) |
5351 { | |
5352 ++*(int *)(v245 + 4); | |
5353 if ( k >= v275 ) | |
5354 break; | |
5355 } | |
5356 v254 = rand(); | |
224 | 5357 v255 = 10;//pItemsTable->field_116D8[19]; |
5358 v256 = 10;//pItemsTable->field_116D8[18]; | |
0 | 5359 goto LABEL_611; |
5360 } | |
222 | 5361 v277 = pItemsTable->pSpecialEnchantments_count; |
0 | 5362 v278 = 0; |
5363 v725 = 0.0; | |
5364 HIDWORD(v733) = 0; | |
222 | 5365 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5366 { |
5367 v730 = (int)&v679; | |
5368 do | |
5369 { | |
222 | 5370 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement); |
0 | 5371 if ( !v279 || v279 == 1 ) |
5372 { | |
222 | 5373 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5374 + 4] |
5375 + v278 * 28); | |
5376 LODWORD(v725) += v280; | |
5377 if ( v280 ) | |
5378 { | |
5379 v281 = v730; | |
5380 v730 += 4; | |
5381 *(int *)v281 = HIDWORD(v733); | |
5382 } | |
5383 } | |
5384 ++HIDWORD(v733); | |
5385 ++v278; | |
5386 } | |
5387 while ( SHIDWORD(v733) < v277 ); | |
5388 } | |
5389 v282 = rand() % SLODWORD(v725); | |
5390 v283 = v679; | |
5391 *(int *)(v245 + 12) = v679; | |
222 | 5392 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5393 v285 = v282 + 1; |
5394 if ( v284 < v285 ) | |
5395 { | |
5396 for ( l = &v679; ; l = (int *)v732 ) | |
5397 { | |
5398 v287 = (int)(l + 1); | |
5399 v732 = v287; | |
5400 v288 = *(int *)v287; | |
5401 *(int *)(v245 + 12) = v288; | |
222 | 5402 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5403 + 4]; |
5404 if ( v284 >= v285 ) | |
5405 break; | |
5406 } | |
5407 } | |
5408 goto LABEL_525; | |
5409 } | |
5410 } | |
5411 else | |
5412 { | |
5413 if ( v731 != 4 | |
5414 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
377 | 5415 || v726->pInventoryItems[a2].uSpecEnchantmentType != v1 |
5416 || v726->pInventoryItems[a2].uEncantmentType != v1 | |
0 | 5417 || v726->pInventoryItems[a2]._bonus_strength != v1 |
315 | 5418 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) |
0 | 5419 goto LABEL_616; |
5420 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5421 LODWORD(v725) = (int)v247; | |
5422 v248 = v247[28]; | |
5423 if ( v248 && v248 != 1 && v248 != 2 ) | |
5424 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5425 else | |
5426 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5427 if ( v249 ) | |
5428 { | |
5429 uRequiredMana = 1; | |
5430 v730 = v1; | |
5431 } | |
5432 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5433 uRequiredMana = 1; | |
5434 if ( uRequiredMana != v1 ) | |
5435 goto LABEL_613; | |
5436 v250 = v725; | |
5437 v251 = *(char *)(LODWORD(v725) + 28); | |
5438 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 ) | |
5439 { | |
5440 if ( rand() % 100 < 80 | |
5441 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5442 { | |
224 | 5443 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5444 *(int *)(v245 + 4) = 0; |
222 | 5445 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5446 ; |
222 | 5447 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5448 + 1] ) |
5449 { | |
5450 ++*(int *)(v245 + 4); | |
5451 if ( m >= v252 ) | |
5452 break; | |
5453 } | |
5454 v254 = rand(); | |
224 | 5455 v255 = 10;// pItemsTable->field_116D8[21]; |
5456 v256 = 10;//pItemsTable->field_116D8[20]; | |
0 | 5457 goto LABEL_611; |
5458 } | |
222 | 5459 v257 = pItemsTable->pSpecialEnchantments_count; |
0 | 5460 v258 = 0; |
5461 v725 = 0.0; | |
5462 HIDWORD(v733) = 0; | |
222 | 5463 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5464 { |
5465 v730 = (int)&v679; | |
5466 do | |
5467 { | |
222 | 5468 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
0 | 5469 if ( !v259 || v259 == 1 ) |
5470 { | |
222 | 5471 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5472 + 4] |
5473 + v258 * 28); | |
5474 LODWORD(v725) += v260; | |
5475 if ( v260 ) | |
5476 { | |
5477 v261 = v730; | |
5478 v730 += 4; | |
5479 *(int *)v261 = HIDWORD(v733); | |
5480 } | |
5481 } | |
5482 ++HIDWORD(v733); | |
5483 ++v258; | |
5484 } | |
5485 while ( SHIDWORD(v733) < v257 ); | |
5486 } | |
5487 v262 = rand() % SLODWORD(v725); | |
5488 v263 = v679; | |
5489 *(int *)(v245 + 12) = v679; | |
222 | 5490 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5491 v265 = v262 + 1; |
5492 if ( v264 < v265 ) | |
5493 { | |
5494 for ( ii = &v679; ; ii = (int *)v732 ) | |
5495 { | |
5496 v267 = (int)(ii + 1); | |
5497 v732 = v267; | |
5498 v268 = *(int *)v267; | |
5499 *(int *)(v245 + 12) = v268; | |
222 | 5500 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5501 + 4]; |
5502 if ( v264 >= v265 ) | |
5503 break; | |
5504 } | |
5505 } | |
5506 LABEL_525: | |
5507 ++*(int *)(v245 + 12); | |
5508 goto LABEL_612; | |
5509 } | |
5510 } | |
5511 LABEL_615: | |
5512 v1 = 0; | |
5513 goto LABEL_616; | |
5514 } | |
5515 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5516 _this = v289; | |
5517 v290 = v289->uItemID; | |
5518 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5519 if ( v290 > 134 | |
377 | 5520 || _this->uSpecEnchantmentType != v1 |
5521 || _this->uEncantmentType != v1 | |
0 | 5522 || _this->_bonus_strength != v1 |
5523 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 | |
5524 || v291 == 1 | |
5525 || v291 == 2 | |
315 | 5526 || _this->Broken()) |
0 | 5527 goto LABEL_616; |
5528 if ( _this->GetValue() < 0x1C2 ) | |
5529 uRequiredMana = 1; | |
5530 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5531 uRequiredMana = 1; | |
5532 if ( uRequiredMana != v1 ) | |
5533 goto LABEL_199; | |
5534 v292 = *(char *)(LODWORD(v725) + 28); | |
5535 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5536 { | |
5537 v2 = v723; | |
5538 v1 = 0; | |
5539 goto LABEL_199; | |
5540 } | |
5541 if ( rand() % 100 >= 80 ) | |
5542 { | |
222 | 5543 v297 = pItemsTable->pSpecialEnchantments_count; |
0 | 5544 v294 = _this; |
5545 v298 = 0; | |
5546 v725 = 0.0; | |
5547 HIDWORD(v733) = 0; | |
222 | 5548 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5549 { |
5550 v730 = (int)&v679; | |
5551 do | |
5552 { | |
222 | 5553 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement); |
0 | 5554 if ( !v299 || v299 == 1 ) |
5555 { | |
222 | 5556 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4] |
0 | 5557 + v298 * 28); |
5558 LODWORD(v725) += v300; | |
5559 if ( v300 ) | |
5560 { | |
5561 v301 = v730; | |
5562 v730 += 4; | |
5563 *(int *)v301 = HIDWORD(v733); | |
5564 } | |
5565 } | |
5566 ++HIDWORD(v733); | |
5567 ++v298; | |
5568 } | |
5569 while ( SHIDWORD(v733) < v297 ); | |
5570 } | |
5571 v302 = rand() % SLODWORD(v725); | |
5572 v303 = v679; | |
377 | 5573 v294->uSpecEnchantmentType = v679; |
222 | 5574 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5575 v305 = v302 + 1; |
5576 if ( v304 < v305 ) | |
5577 { | |
5578 for ( jj = &v679; ; jj = (int *)v732 ) | |
5579 { | |
5580 v307 = (int)(jj + 1); | |
5581 v732 = v307; | |
5582 v308 = *(int *)v307; | |
377 | 5583 v294->uSpecEnchantmentType = v308; |
222 | 5584 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5585 if ( v304 >= v305 ) |
5586 break; | |
5587 } | |
5588 } | |
377 | 5589 ++v294->uSpecEnchantmentType; |
0 | 5590 } |
5591 else | |
5592 { | |
5593 v293 = rand(); | |
5594 v294 = _this; | |
224 | 5595 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
377 | 5596 _this->uEncantmentType = 0; |
222 | 5597 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; |
0 | 5598 ; |
377 | 5599 kk += pItemsTable->pEnchantments[v294->uEncantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType |
0 | 5600 + 1] ) |
5601 { | |
377 | 5602 ++v294->uEncantmentType; |
0 | 5603 if ( kk >= v295 ) |
5604 break; | |
5605 } | |
224 | 5606 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5607 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
0 | 5608 } |
5609 v294->uAttributes |= 0x20u; | |
5610 goto LABEL_1055; | |
5611 case 31: | |
5612 amount = 10 * v2; | |
5613 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
5614 goto LABEL_83; | |
5615 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) | |
5616 goto LABEL_200; | |
5617 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
437 | 5618 pMessageQueue_50CBD0->AddMessage(UIMSG_C3, v1, v1); |
0 | 5619 goto LABEL_1056; |
5620 case 33: | |
5621 LODWORD(v733) = 604800 * v2; | |
5622 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5623 goto LABEL_200; | |
5624 v319 = uRequiredMana; | |
5625 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5626 { | |
5627 pEventTimer->Pause(); | |
437 | 5628 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, v1, v1); |
0 | 5629 qword_506350 = (signed int)v733; |
5630 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5631 ::uRequiredMana = v319; | |
5632 ::sRecoveryTime = sRecoveryTime; | |
5633 dword_50633C = v3->field_10; | |
5634 dword_506338 = v3->spellnum; | |
5635 LOBYTE(v3->field_8) |= 0x20u; | |
5636 } | |
5637 goto LABEL_83; | |
5638 case 40: | |
5639 v320 = v12 - 2; | |
5640 if ( !v320 ) | |
5641 goto LABEL_632; | |
5642 v321 = v320 - 1; | |
5643 if ( v321 ) | |
5644 { | |
5645 if ( v321 == 1 ) | |
5646 goto LABEL_634; | |
5647 LABEL_632: | |
5648 v322 = 3600 * v2; | |
5649 } | |
5650 else | |
5651 { | |
5652 v322 = 86400 * v2; | |
5653 } | |
5654 amount = v322; | |
5655 LABEL_634: | |
5656 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5657 goto LABEL_83; | |
5658 v323 = v3->uPlayerID_2; | |
5659 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5660 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5661 goto LABEL_1056; | |
5662 if ( v731 == 4 ) | |
5663 goto LABEL_637; | |
5664 v732 = amount << 7; | |
5665 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5666 v656 = 15; | |
5667 goto LABEL_640; | |
5668 case 41: | |
5669 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5670 goto LABEL_83; | |
5671 a1.stru_24.Reset(); | |
5672 a1.field_48 = v3->spellnum; | |
5673 a1.field_4C = v2; | |
5674 a1.field_50 = v731; | |
5675 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5676 a1.vPosition.y = pParty->vPosition.y; | |
5677 a1.vPosition.x = pParty->vPosition.x; | |
5678 a1.uAttributes = v1; | |
5679 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5680 a1.uSectorID = pIndoor->GetSector( | |
5681 pParty->vPosition.x, | |
5682 pParty->vPosition.y, | |
5683 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5684 a1.uSpriteFrameID = v1; | |
5685 v326 = 8 * v3->uPlayerID; | |
303 | 5686 LOBYTE(v326) = v326 | OBJECT_Player; |
5687 a1.field_58_pid = v326; | |
0 | 5688 a1.field_5C = a2; |
5689 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5690 a1.uFacing = LOWORD(pParty->sRotationY); | |
5691 a1.uSoundID = LOWORD(v3->field_10); | |
5692 if ( pParty->bTurnBasedModeOn == 1 ) | |
5693 LOBYTE(a1.uAttributes) |= 4u; | |
5694 v669 = v3->uPlayerID + 1; | |
5695 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5696 v654 = pParty->sRotationX; | |
5697 goto LABEL_125; | |
5698 case 43: | |
5699 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5700 goto LABEL_200; | |
5701 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5702 goto LABEL_83; | |
5703 a1.uItemType = 4090; | |
5704 a1.stru_24.Reset(); | |
5705 a1.field_48 = v3->spellnum; | |
5706 a1.field_4C = v2; | |
5707 a1.field_50 = v731; | |
5708 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5709 a1.vPosition.x = pParty->vPosition.x; | |
5710 a1.vPosition.y = pParty->vPosition.y; | |
5711 a1.uAttributes = v1; | |
5712 a1.uSectorID = v1; | |
5713 a1.uSpriteFrameID = v1; | |
5714 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5715 v327 = 8 * v3->uPlayerID; | |
303 | 5716 LOBYTE(v327) = v327 | OBJECT_Player; |
0 | 5717 a1.field_60_distance_related_prolly_lod = 0; |
303 | 5718 a1.field_58_pid = v327; |
0 | 5719 a1.field_5C = a2; |
5720 a1.uFacing = LOWORD(pParty->sRotationY); | |
5721 a1.uSoundID = LOWORD(v3->field_10); | |
5722 if ( pParty->bTurnBasedModeOn == 1 ) | |
5723 a1.uAttributes = 4; | |
5724 v669 = v1; | |
5725 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5726 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5727 LABEL_124: | |
5728 v654 = v35; | |
5729 LABEL_125: | |
5730 v36 = pParty->sRotationY; | |
5731 goto LABEL_157; | |
5732 case 45: | |
5733 v328 = v12 - 2; | |
5734 if ( v328 ) | |
5735 { | |
5736 v329 = v328 - 1; | |
5737 if ( v329 && v329 != 1 ) | |
5738 v330 = 600 * v2; | |
5739 else | |
5740 v330 = 3600 * v2; | |
5741 } | |
5742 else | |
5743 { | |
5744 v330 = 1800 * v2; | |
5745 } | |
5746 LODWORD(v733) = v330; | |
5747 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5748 goto LABEL_83; | |
5749 v331 = v3->spellnum; | |
5750 v332 = pGame->GetStru6(); | |
5751 pGame->GetStru6()->SetPlayerBuffAnim(v331, v1); | |
5752 v83 = 1; | |
5753 v333 = v3->spellnum; | |
5754 v334 = pGame->GetStru6(); | |
5755 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1u); | |
5756 v335 = v3->spellnum; | |
5757 v336 = pGame->GetStru6(); | |
5758 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2u); | |
5759 v337 = v3->spellnum; | |
5760 v338 = pGame->GetStru6(); | |
5761 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3u); | |
5762 v673 = v1; | |
5763 v732 = (int)v733 << 7; | |
5764 v662 = v1; | |
5765 v655 = v1; | |
5766 v652 = v731; | |
5767 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5768 v137 = (char *)&pParty->pPartyBuffs[3]; | |
5769 goto LABEL_976; | |
5770 case 47: | |
5771 LODWORD(v733) = 300; | |
5772 v339 = v12 - 2; | |
5773 if ( v339 ) | |
5774 { | |
5775 v340 = v339 - 1; | |
5776 if ( v340 ) | |
5777 { | |
5778 if ( v340 != 1 ) | |
5779 { | |
5780 amount = v2; | |
5781 goto LABEL_667; | |
5782 } | |
5783 v341 = 6 * v2; | |
5784 } | |
5785 else | |
5786 { | |
5787 v341 = 4 * v2; | |
5788 } | |
5789 } | |
5790 else | |
5791 { | |
5792 v341 = 2 * v2; | |
5793 } | |
5794 amount = v341; | |
5795 LABEL_667: | |
5796 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5797 goto LABEL_83; | |
5798 v342 = *(int *)&v3->field_C; | |
5799 if ( v342 == v1 ) | |
5800 { | |
5801 v345 = v3->uPlayerID_2; | |
5802 v346 = v3->spellnum; | |
5803 v347 = pGame->GetStru6(); | |
5804 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); | |
5805 v668 = v1; | |
5806 v658 = v1; | |
5807 v653 = amount; | |
5808 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; | |
5809 v651 = v731; | |
5810 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5811 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; | |
5812 goto LABEL_104; | |
5813 } | |
141 | 5814 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5815 { |
5816 v343 = v342 >> 3; | |
5817 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5818 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; | |
5819 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); | |
5820 BYTE2(pActors[v343].uAttributes) |= 8u; | |
5821 v672 = v1; | |
5822 v661 = &pActors[v343]; | |
5823 LABEL_165: | |
5824 v56 = pGame->GetStru6(); | |
5825 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5826 } | |
5827 goto LABEL_1056; | |
5828 case 49: | |
5829 v348 = v12 - 2; | |
5830 if ( !v348 ) | |
5831 goto LABEL_677; | |
5832 v349 = v348 - 1; | |
5833 if ( v349 ) | |
5834 { | |
5835 if ( v349 == 1 ) | |
5836 { | |
5837 amount = v1; | |
5838 goto LABEL_679; | |
5839 } | |
5840 LABEL_677: | |
5841 v350 = 3600 * v2; | |
5842 } | |
5843 else | |
5844 { | |
5845 v350 = 86400 * v2; | |
5846 } | |
5847 amount = v350; | |
5848 LABEL_679: | |
5849 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5850 goto LABEL_83; | |
5851 v351 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5852 if ( !v351->pConditions[0] ) | |
5853 goto LABEL_1056; | |
5854 if ( v731 == 4 ) | |
5855 { | |
5856 LODWORD(v351->pConditions[0]) = v1; | |
5857 HIDWORD(v351->pConditions[0]) = v1; | |
5858 goto LABEL_904; | |
5859 } | |
5860 v732 = amount << 7; | |
5861 v351->DiscardConditionIfLastsLongerThan( | |
5862 v1, | |
5863 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
5864 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5865 goto LABEL_1056; | |
5866 v674 = v3->uPlayerID_2; | |
5867 goto LABEL_685; | |
5868 case 50: | |
5869 v354 = v12 - 2; | |
5870 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5871 v356 = 900 * (v2 + 4); | |
5872 else | |
5873 v356 = 300 * (v2 + 12); | |
5874 LODWORD(v733) = v356; | |
5875 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5876 goto LABEL_83; | |
5877 if ( v731 == 1 || v731 == 2 ) | |
5878 { | |
5879 v361 = v3->uPlayerID_2; | |
5880 v362 = v3->spellnum; | |
5881 v363 = pGame->GetStru6(); | |
5882 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); | |
5883 v668 = v1; | |
5884 v732 = (int)v733 << 7; | |
5885 v658 = v1; | |
5886 v653 = v1; | |
5887 v651 = v731; | |
5888 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5889 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; | |
5890 goto LABEL_103; | |
5891 } | |
5892 a2 = v1; | |
5893 v732 = (int)v733 << 7; | |
5894 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5895 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5896 do |
5897 { | |
5898 v358 = a2; | |
5899 v359 = v3->spellnum; | |
5900 v360 = pGame->GetStru6(); | |
5901 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); | |
112 | 5902 v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, v1, v1, v1); |
0 | 5903 ++a2; |
112 | 5904 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5905 } | |
5906 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5907 goto LABEL_1056; |
5908 case 48: | |
5909 v364 = v12 - 2; | |
5910 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5911 v366 = 60 * (v2 + 3); | |
5912 else | |
5913 v366 = 300 * v2 + 180; | |
5914 LODWORD(v733) = v366; | |
5915 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5916 goto LABEL_83; | |
5917 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
5918 v367 = pGame->GetStru6(); | |
5919 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | |
5920 ++a1.uItemType; | |
5921 a1.stru_24.Reset(); | |
5922 a1.field_48 = v3->spellnum; | |
5923 a1.field_4C = v2; | |
5924 a1.field_50 = v731; | |
5925 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5926 a1.uAttributes = v1; | |
5927 a1.uSectorID = v1; | |
5928 a1.uSpriteFrameID = v1; | |
5929 v368 = v3->uPlayerID; | |
5930 a1.field_60_distance_related_prolly_lod = 0; | |
5931 a1.uFacing = v1; | |
5932 v368 *= 8; | |
303 | 5933 LOBYTE(v368) = v368 | OBJECT_Player; |
5934 a1.field_58_pid = v368; | |
0 | 5935 a1.uSoundID = LOWORD(v3->field_10); |
5936 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
5937 { | |
5938 v369 = &pActors[dword_50BF30[a2]]; | |
5939 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5940 { | |
5941 a1.vPosition.x = v369->vPosition.x; | |
5942 a1.vPosition.y = v369->vPosition.y; | |
5943 v732 = v369->uActorHeight; | |
5944 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5945 v370 = 8 * dword_50BF30[a2]; | |
5946 LOBYTE(v370) = v370 | 3; | |
5947 a1.field_5C = v370; | |
5948 a1.Create(0, v1, v1, v1); | |
5949 v732 = (int)v733 << 7; | |
5950 v369->pActorBuffs[4].Apply( | |
5951 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
5952 v731, | |
5953 v1, | |
5954 v1, | |
5955 v1); | |
5956 } | |
5957 } | |
5958 goto LABEL_1056; | |
5959 case 53: | |
5960 v371 = v12 - 2; | |
5961 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
5962 amount = v1; | |
5963 else | |
5964 amount = 86400 * v2; | |
5965 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5966 goto LABEL_83; | |
5967 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, v1, 65536); | |
5968 v373 = v3->uPlayerID_2; | |
5969 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5970 goto LABEL_1056; | |
5971 v14 = v731 == 4; | |
5972 pParty->pPlayers[v373].sHealth = 1; | |
5973 if ( v14 ) | |
5974 { | |
5975 v374 = v3->uPlayerID_2; | |
5976 LODWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5977 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5978 v376 = v3->uPlayerID_2; | |
5979 LODWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5980 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5981 } | |
5982 else | |
5983 { | |
5984 v732 = amount << 7; | |
5985 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5986 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5987 0xEu, | |
5988 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5989 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5990 0xDu, | |
5991 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5992 } | |
112 | 5993 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 5994 goto LABEL_720; |
5995 case 54: | |
5996 v378 = v12 - 2; | |
5997 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
5998 v380 = 4 * v2; | |
5999 else | |
6000 v380 = 3 * v2; | |
6001 amount = v380; | |
6002 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6003 goto LABEL_83; | |
6004 v381 = 0; | |
6005 HIDWORD(v733) = amount; | |
6006 v730 = 0; | |
6007 v382 = 1; | |
6008 do | |
6009 { | |
6010 v383 = pPlayers[v382]; | |
6011 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
6012 v682[v381++] = v382; | |
6013 ++v382; | |
6014 } | |
6015 while ( v382 <= 4 ); | |
6016 v384 = 0; | |
6017 v730 = v381; | |
6018 if ( v381 > v1 ) | |
6019 { | |
6020 do | |
6021 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
6022 while ( v384 < v381 ); | |
6023 } | |
6024 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
6025 HIDWORD(v733) = v1; | |
6026 if ( v381 > v1 ) | |
6027 { | |
6028 do | |
6029 { | |
6030 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
6031 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
6032 v726 = *(Player **)v385; | |
6033 v386 = v726->GetMaxHealth(); | |
6034 if ( v726->sHealth > v386 ) | |
6035 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
6036 v387 = *(Player **)v385; | |
6037 if ( v387->sHealth > v1 ) | |
6038 { | |
6039 LODWORD(v387->pConditions[13]) = v1; | |
6040 HIDWORD(v387->pConditions[13]) = v1; | |
6041 } | |
6042 v388 = HIDWORD(v733); | |
6043 v389 = LOWORD(v682[HIDWORD(v733)]) - 1; | |
6044 v390 = v3->spellnum; | |
6045 v391 = pGame->GetStru6(); | |
6046 pGame->GetStru6()->SetPlayerBuffAnim(v390, v389); | |
6047 HIDWORD(v733) = v388 + 1; | |
6048 } | |
6049 while ( v388 + 1 < v730 ); | |
6050 } | |
6051 goto LABEL_1056; | |
6052 case 55: | |
6053 v392 = v12 - 1; | |
6054 if ( !v392 ) | |
6055 { | |
6056 v395 = 180 * v2; | |
6057 goto LABEL_750; | |
6058 } | |
6059 v393 = v392 - 1; | |
6060 if ( !v393 ) | |
6061 { | |
6062 v395 = 10800 * v2; | |
6063 goto LABEL_750; | |
6064 } | |
6065 v394 = v393 - 1; | |
6066 if ( !v394 ) | |
6067 { | |
6068 v395 = 259200 * v2; | |
6069 LABEL_750: | |
6070 amount = v395; | |
6071 goto LABEL_751; | |
6072 } | |
6073 if ( v394 == 1 ) | |
6074 amount = v1; | |
6075 LABEL_751: | |
6076 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6077 goto LABEL_83; | |
6078 v396 = v3->uPlayerID_2; | |
6079 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
6080 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
6081 { | |
6082 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
187 | 6083 pParty->pPlayers[v396].PlaySound(SPEECH_25, v1); |
0 | 6084 if ( v731 == 4 ) |
6085 { | |
6086 v397 = v3->uPlayerID_2; | |
6087 LODWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6088 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6089 v398 = v3->uPlayerID_2; | |
6090 LODWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6091 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6092 v399 = v3->uPlayerID_2; | |
6093 LODWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6094 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6095 } | |
6096 else | |
6097 { | |
6098 v732 = amount << 7; | |
6099 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6100 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6101 0x10u, | |
6102 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6103 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6104 0xEu, | |
6105 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6106 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6107 0xDu, | |
6108 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6109 } | |
6110 v83 = 1; | |
112 | 6111 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
0 | 6112 v401 = pGame; |
6113 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; | |
6114 v402 = v3->uPlayerID_2; | |
6115 v403 = v3->spellnum; | |
6116 v404 = pGame->GetStru6(); | |
6117 pGame->GetStru6()->SetPlayerBuffAnim(v403, v402); | |
6118 } | |
6119 else | |
6120 { | |
6121 v83 = 1; | |
6122 } | |
6123 goto LABEL_978; | |
6124 case 61: | |
6125 v405 = v12 - 2; | |
6126 if ( !v405 ) | |
6127 goto LABEL_766; | |
6128 v406 = v405 - 1; | |
6129 if ( v406 ) | |
6130 { | |
6131 if ( v406 == 1 ) | |
6132 { | |
6133 amount = v1; | |
6134 goto LABEL_768; | |
6135 } | |
6136 LABEL_766: | |
6137 v407 = 3600 * v2; | |
6138 } | |
6139 else | |
6140 { | |
6141 v407 = 86400 * v2; | |
6142 } | |
6143 amount = v407; | |
6144 LABEL_768: | |
6145 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6146 goto LABEL_83; | |
6147 v408 = v3->uPlayerID_2; | |
6148 v409 = v3->spellnum; | |
6149 v410 = pGame->GetStru6(); | |
6150 pGame->GetStru6()->SetPlayerBuffAnim(v409, v408); | |
6151 v323 = v3->uPlayerID_2; | |
6152 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6153 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6154 goto LABEL_1056; | |
6155 if ( v731 == 4 ) | |
6156 goto LABEL_637; | |
6157 v732 = amount << 7; | |
6158 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6159 v656 = 12; | |
6160 goto LABEL_640; | |
6161 case 56: | |
6162 v411 = v12 - 2; | |
6163 if ( v411 ) | |
6164 { | |
6165 v412 = v411 - 1; | |
6166 if ( v412 ) | |
6167 { | |
6168 if ( v412 == 1 ) | |
6169 { | |
6170 amount = v1; | |
6171 goto LABEL_780; | |
6172 } | |
6173 v413 = 180 * v2; | |
6174 } | |
6175 else | |
6176 { | |
6177 v413 = 86400 * v2; | |
6178 } | |
6179 } | |
6180 else | |
6181 { | |
6182 v413 = 3600 * v2; | |
6183 } | |
6184 amount = v413; | |
6185 LABEL_780: | |
6186 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6187 goto LABEL_83; | |
6188 v414 = v3->uPlayerID_2; | |
6189 v415 = v3->spellnum; | |
6190 v416 = pGame->GetStru6(); | |
6191 pGame->GetStru6()->SetPlayerBuffAnim(v415, v414); | |
6192 v323 = v3->uPlayerID_2; | |
6193 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6194 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6195 goto LABEL_1056; | |
6196 if ( v731 == 4 ) | |
6197 goto LABEL_637; | |
6198 v732 = amount << 7; | |
6199 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6200 v656 = 3; | |
6201 goto LABEL_640; | |
6202 case 59: | |
6203 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6204 goto LABEL_83; | |
141 | 6205 if ( a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 6206 goto LABEL_1056; |
6207 v417 = (int)&pActors[a2 >> 3]; | |
6208 v730 = v417; | |
6209 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6210 { | |
6211 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6212 v417 = v730; | |
6213 } | |
6214 v418 = *(int *)(v417 + 672); | |
6215 HIDWORD(v733) = v1; | |
6216 if ( pItemsTable->pItems[v418].uEquipType == 18 ) | |
6217 HIDWORD(v733) = *(int *)(v417 + 684); | |
6218 | |
6219 //ItemGen::ItemGen(&v683); | |
6220 v683.Reset(); | |
6221 | |
6222 v419 = *(short *)(v730 + 180); | |
6223 if ( v419 != (short)v1 ) | |
6224 { | |
6225 v683.uItemID = v419; | |
6226 goto LABEL_799; | |
6227 } | |
6228 v420 = 0; | |
6229 v421 = v730 + 564; | |
6230 while ( *(int *)v421 == v1 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) | |
6231 { | |
6232 ++v420; | |
6233 v421 += 36; | |
6234 if ( v420 >= 4 ) | |
6235 goto LABEL_799; | |
6236 } | |
6237 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6238 v2 = v723; | |
6239 v1 = 0; | |
6240 LABEL_799: | |
6241 if ( HIDWORD(v733) != v1 ) | |
6242 { | |
6243 v675 = (const char *)HIDWORD(v733); | |
6244 if ( v683.uItemID != v1 ) | |
6245 { | |
6246 v422 = v683.GetDisplayName(); | |
6247 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6248 goto LABEL_807; | |
6249 } | |
6250 v664 = "%d gold"; | |
6251 goto LABEL_803; | |
6252 } | |
6253 if ( v683.uItemID != v1 ) | |
6254 { | |
6255 v675 = v683.GetDisplayName(); | |
6256 v664 = "(%s)"; | |
6257 LABEL_803: | |
6258 sprintf(pTmpBuf2, v664, v675); | |
6259 goto LABEL_807; | |
6260 } | |
6261 strcpy(pTmpBuf2, "nothing"); | |
6262 LABEL_807: | |
6263 ShowStatusBarString(pTmpBuf2, 2u); | |
6264 a1.stru_24.Reset(); | |
6265 a1.field_48 = v3->spellnum; | |
6266 a1.field_4C = v2; | |
6267 a1.field_50 = v731; | |
6268 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6269 a1.vPosition.x = *(short *)(v730 + 142); | |
6270 a1.vPosition.y = *(short *)(v730 + 144); | |
6271 v676 = *(short *)(v730 + 138); | |
6272 v665 = a1.vPosition.y; | |
6273 a1.vPosition.z = *(short *)(v730 + 138); | |
6274 v657 = a1.vPosition.x; | |
6275 goto LABEL_1087; | |
6276 case 62: | |
6277 v423 = v12 - 2; | |
6278 if ( !v423 ) | |
6279 goto LABEL_813; | |
6280 v424 = v423 - 1; | |
6281 if ( v424 ) | |
6282 { | |
6283 if ( v424 == 1 ) | |
6284 v425 = 3600 * v2; | |
6285 else | |
6286 LABEL_813: | |
6287 v425 = 300 * v2; | |
6288 } | |
6289 else | |
6290 { | |
6291 v425 = 600 * v2; | |
6292 } | |
6293 amount = v425; | |
6294 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6295 goto LABEL_83; | |
6296 v426 = a2 >> 3; | |
141 | 6297 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6298 goto LABEL_1056; |
6299 v730 = 836 * v426; | |
6300 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6301 { | |
90 | 6302 pActors[v426].pActorBuffs[1].Reset(); |
6303 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6304 v732 = amount << 7; |
90 | 6305 pActors[v426].pActorBuffs[9].Apply( |
0 | 6306 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6307 v731, | |
6308 v1, | |
6309 v1, | |
6310 v1); | |
90 | 6311 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6312 } |
6313 a1.stru_24.Reset(); | |
6314 a1.field_48 = v3->spellnum; | |
6315 a1.field_4C = v2; | |
6316 a1.field_50 = v731; | |
6317 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6318 v61 = v426; |
0 | 6319 goto LABEL_1086; |
6320 case 66: | |
6321 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6322 goto LABEL_83; | |
6323 amount = 600 * v2; | |
6324 v427 = a2 >> 3; | |
141 | 6325 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6326 goto LABEL_1056; |
6327 v730 = 836 * v427; | |
6328 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6329 goto LABEL_83; | |
90 | 6330 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6331 { | |
6332 pActors[v427].pActorBuffs[9].Reset(); | |
6333 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6334 v732 = amount << 7; |
90 | 6335 pActors[v427].pActorBuffs[12].Apply( |
0 | 6336 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6337 v731, | |
6338 v1, | |
6339 v1, | |
6340 v1); | |
6341 } | |
6342 a1.stru_24.Reset(); | |
6343 a1.field_48 = v3->spellnum; | |
6344 a1.field_4C = v2; | |
6345 a1.field_50 = v731; | |
6346 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6347 v61 = v427; |
0 | 6348 goto LABEL_1086; |
6349 case 63: | |
6350 v428 = v12 - 2; | |
6351 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6352 v430 = 300 * v2; | |
6353 else | |
6354 v430 = 180 * v2; | |
6355 amount = v430; | |
6356 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6357 goto LABEL_83; | |
6358 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6359 v431 = pGame->GetStru6(); | |
6360 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | |
6361 ++a1.uItemType; | |
6362 a1.stru_24.Reset(); | |
6363 a1.field_48 = v3->spellnum; | |
6364 a1.field_4C = v2; | |
6365 a1.field_50 = v731; | |
6366 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6367 a1.uAttributes = v1; | |
6368 a1.uSectorID = v1; | |
6369 a1.uSpriteFrameID = v1; | |
6370 v432 = v3->uPlayerID; | |
6371 a1.field_60_distance_related_prolly_lod = 0; | |
6372 a1.uFacing = v1; | |
6373 v432 *= 8; | |
303 | 6374 LOBYTE(v432) = v432 | OBJECT_Player; |
6375 a1.field_58_pid = v432; | |
0 | 6376 a1.uSoundID = LOWORD(v3->field_10); |
6377 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
6378 { | |
6379 v433 = &pActors[dword_50BF30[a2]]; | |
6380 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6381 break; | |
6382 a1.vPosition.x = v433->vPosition.x; | |
6383 a1.vPosition.y = v433->vPosition.y; | |
6384 v732 = v433->uActorHeight; | |
6385 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6386 v434 = 8 * dword_50BF30[a2]; | |
6387 LOBYTE(v434) = v434 | 3; | |
6388 a1.field_5C = v434; | |
6389 a1.Create(0, v1, v1, v1); | |
6390 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) | |
6391 { | |
6392 v732 = amount << 7; | |
6393 v433->pActorBuffs[4].Apply( | |
6394 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
6395 v731, | |
6396 v1, | |
6397 v1, | |
6398 v1); | |
6399 } | |
6400 } | |
6401 goto LABEL_1056; | |
6402 case 64: | |
6403 v435 = v12 - 2; | |
6404 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
6405 amount = v1; | |
6406 else | |
6407 amount = 86400 * v2; | |
6408 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6409 goto LABEL_83; | |
6410 v437 = v3->uPlayerID_2; | |
6411 v438 = v3->spellnum; | |
6412 v439 = pGame->GetStru6(); | |
6413 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); | |
6414 v440 = v3->uPlayerID_2; | |
6415 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6416 { | |
6417 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
187 | 6418 pParty->pPlayers[v440].PlaySound(SPEECH_25, v1); |
0 | 6419 if ( v731 == 4 ) |
6420 { | |
6421 v441 = v3->uPlayerID_2; | |
6422 LODWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6423 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6424 } | |
6425 else | |
6426 { | |
6427 v732 = amount << 7; | |
6428 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6429 5u, | |
6430 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6431 } | |
6432 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6433 LABEL_720: | |
6434 v377->SetCondition(1u, v1); | |
6435 } | |
6436 goto LABEL_1056; | |
6437 case 42: | |
6438 v442 = v12 - 2; | |
6439 if ( !v442 ) | |
6440 goto LABEL_855; | |
6441 v443 = v442 - 1; | |
6442 if ( v443 ) | |
6443 { | |
6444 if ( v443 == 1 ) | |
6445 v444 = 4 * v2; | |
6446 else | |
6447 LABEL_855: | |
6448 v444 = 2 * v2; | |
6449 } | |
6450 else | |
6451 { | |
6452 v444 = 3 * v2; | |
6453 } | |
6454 amount = v444; | |
6455 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6456 goto LABEL_83; | |
6457 v445 = a2 >> 3; | |
141 | 6458 if ( (a2 & 7) == OBJECT_Item) |
0 | 6459 { |
6460 v449 = (char *)&pLayingItems[v445].stru_24; | |
6461 v450 = *(int *)v449; | |
6462 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6463 { | |
6464 party_finds_gold(*((int *)v449 + 3), 0); | |
6465 viewparams->bRedrawGameUI = 1; | |
6466 } | |
6467 else | |
6468 { | |
189 | 6469 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
0 | 6470 ShowStatusBarString(pTmpBuf2, 2u); |
6471 if ( !pParty->AddItem(&pLayingItems[v445].stru_24) ) | |
6472 pParty->SetHoldingItem(&pLayingItems[v445].stru_24); | |
6473 } | |
430 | 6474 LayingItem::OnItemPickup(v445); |
0 | 6475 } |
6476 else | |
6477 { | |
141 | 6478 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6479 { |
6480 stru_50C198.LootActor(&pActors[v445]); | |
6481 } | |
6482 else | |
6483 { | |
141 | 6484 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6485 { |
141 | 6486 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6487 goto LABEL_1056; |
6488 dword_507CD8 = 1; | |
6489 v677 = 1; | |
6490 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6491 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6492 else | |
6493 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6494 goto LABEL_866; | |
6495 } | |
6496 v447 = &pLevelDecorations[v445]; | |
6497 dword_507CD8 = 1; | |
6498 v448 = v447->field_16_event_id; | |
6499 if ( v448 != (short)v1 ) | |
6500 { | |
6501 v677 = 1; | |
6502 v446 = v448; | |
6503 LABEL_866: | |
6504 EventProcessor(v446, a2, v677); | |
6505 goto LABEL_1056; | |
6506 } | |
6507 if ( v447->IsInteractive() ) | |
6508 { | |
6509 _5C3420_pDecoration = v447; | |
6510 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); | |
6511 _5C3420_pDecoration = (LevelDecoration *)v1; | |
6512 } | |
6513 } | |
6514 } | |
6515 goto LABEL_1056; | |
6516 case 67: | |
6517 v451 = v12 - 2; | |
6518 if ( v451 ) | |
6519 { | |
6520 v452 = v451 - 1; | |
6521 if ( v452 ) | |
6522 { | |
6523 if ( v452 == 1 ) | |
6524 { | |
6525 amount = v1; | |
6526 goto LABEL_883; | |
6527 } | |
6528 v453 = 180 * v2; | |
6529 } | |
6530 else | |
6531 { | |
6532 v453 = 86400 * v2; | |
6533 } | |
6534 } | |
6535 else | |
6536 { | |
6537 v453 = 3600 * v2; | |
6538 } | |
6539 amount = v453; | |
6540 LABEL_883: | |
6541 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6542 goto LABEL_83; | |
6543 v454 = v3->uPlayerID_2; | |
6544 v455 = v3->spellnum; | |
6545 v456 = pGame->GetStru6(); | |
6546 pGame->GetStru6()->SetPlayerBuffAnim(v455, v454); | |
6547 v323 = v3->uPlayerID_2; | |
6548 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6549 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6550 goto LABEL_1056; | |
6551 if ( v731 == 4 ) | |
6552 { | |
6553 LABEL_637: | |
6554 *(int *)v324 = v1; | |
6555 *((int *)v324 + 1) = v1; | |
6556 goto LABEL_1056; | |
6557 } | |
6558 v732 = amount << 7; | |
6559 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6560 v656 = 1; | |
6561 LABEL_640: | |
6562 v325 = &pParty->pPlayers[v323]; | |
6563 goto LABEL_641; | |
6564 case 68: | |
6565 v457 = v12 - 2; | |
6566 if ( v457 ) | |
6567 { | |
6568 v458 = v457 - 1; | |
6569 if ( v458 ) | |
6570 { | |
6571 if ( v458 == 1 ) | |
6572 v459 = 5 * v2 + 5; | |
6573 else | |
6574 v459 = 2 * v2 + 5; | |
6575 } | |
6576 else | |
6577 { | |
6578 v459 = 4 * v2 + 5; | |
6579 } | |
6580 } | |
6581 else | |
6582 { | |
6583 v459 = 3 * v2 + 5; | |
6584 } | |
6585 amount = v459; | |
6586 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6587 goto LABEL_83; | |
6588 v460 = *(int *)&v3->field_C; | |
6589 if ( v460 == v1 ) | |
6590 { | |
6591 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6592 LABEL_904: | |
6593 v674 = v3->uPlayerID_2; | |
6594 LABEL_685: | |
6595 v352 = v3->spellnum; | |
6596 v353 = pGame->GetStru6(); | |
6597 pGame->GetStru6()->SetPlayerBuffAnim(v352, v674); | |
6598 } | |
6599 else | |
6600 { | |
141 | 6601 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6602 { |
6603 v461 = &pActors[v460 >> 3]; | |
6604 v462 = v461->uAIState; | |
6605 v463 = v461->pMonsterInfo.uHP; | |
6606 if ( v462 != 5 ) | |
6607 { | |
6608 if ( v462 != 4 ) | |
6609 { | |
6610 if ( v462 != 19 ) | |
6611 { | |
6612 if ( v462 != 11 ) | |
6613 { | |
6614 v461->sCurrentHP += amount; | |
6615 if ( v461->sCurrentHP > v463 ) | |
6616 v461->sCurrentHP = v463; | |
6617 } | |
6618 } | |
6619 } | |
6620 } | |
6621 } | |
6622 } | |
6623 goto LABEL_1056; | |
6624 case 72: | |
6625 v464 = v12 - 2; | |
6626 if ( !v464 ) | |
6627 goto LABEL_910; | |
6628 v465 = v464 - 1; | |
6629 if ( v465 ) | |
6630 { | |
6631 if ( v465 == 1 ) | |
6632 { | |
6633 amount = v1; | |
6634 goto LABEL_912; | |
6635 } | |
6636 LABEL_910: | |
6637 v466 = 3600 * v2; | |
6638 } | |
6639 else | |
6640 { | |
6641 v466 = 86400 * v2; | |
6642 } | |
6643 amount = v466; | |
6644 LABEL_912: | |
6645 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6646 goto LABEL_83; | |
6647 v467 = v3->uPlayerID_2; | |
6648 v468 = v3->spellnum; | |
6649 v469 = pGame->GetStru6(); | |
6650 pGame->GetStru6()->SetPlayerBuffAnim(v468, v467); | |
6651 v470 = v3->uPlayerID_2; | |
6652 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6653 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6654 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6655 goto LABEL_1056; | |
6656 if ( v731 == 4 ) | |
6657 { | |
6658 LODWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6659 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6660 v471 = v3->uPlayerID_2; | |
6661 LODWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6662 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6663 v472 = v3->uPlayerID_2; | |
6664 LODWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6665 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6666 goto LABEL_1056; | |
6667 } | |
6668 v732 = amount << 7; | |
6669 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6670 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6671 6u, | |
6672 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6673 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6674 8u, | |
6675 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6676 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6677 v656 = 10; | |
6678 goto LABEL_937; | |
6679 case 75: | |
6680 amount = v2; | |
6681 LODWORD(v733) = 3600 * v2; | |
6682 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6683 goto LABEL_83; | |
6684 v474 = v3->spellnum; | |
6685 v475 = pGame->GetStru6(); | |
6686 pGame->GetStru6()->SetPlayerBuffAnim(v474, v1); | |
6687 v476 = v3->spellnum; | |
6688 v477 = pGame->GetStru6(); | |
6689 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1u); | |
6690 v478 = v3->spellnum; | |
6691 v479 = pGame->GetStru6(); | |
6692 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2u); | |
6693 v480 = v3->spellnum; | |
6694 v481 = pGame->GetStru6(); | |
6695 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3u); | |
6696 v668 = v1; | |
6697 v732 = (int)v733 << 7; | |
6698 v658 = v1; | |
6699 v653 = v2; | |
6700 v651 = v731; | |
6701 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6702 v27 = (char *)&pParty->pPartyBuffs[13]; | |
6703 goto LABEL_101; | |
6704 case 73: | |
6705 LODWORD(v733) = 3600 * v2; | |
6706 amount = v2; | |
6707 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6708 goto LABEL_83; | |
6709 if ( v731 == 4 ) | |
6710 { | |
6711 v482 = v3->spellnum; | |
6712 v483 = pGame->GetStru6(); | |
6713 pGame->GetStru6()->SetPlayerBuffAnim(v482, v1); | |
6714 v484 = v3->spellnum; | |
6715 v485 = pGame->GetStru6(); | |
6716 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1u); | |
6717 v486 = v3->spellnum; | |
6718 v487 = pGame->GetStru6(); | |
6719 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2u); | |
6720 v488 = v3->spellnum; | |
6721 v489 = pGame->GetStru6(); | |
6722 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3u); | |
6723 v732 = (int)v733 << 7; | |
6724 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6725 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6726 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6727 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6728 v668 = v1; | |
6729 v658 = v2; | |
6730 v653 = v2; | |
6731 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; | |
6732 v651 = 4; | |
6733 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; | |
6734 v27 = (char *)&pParty->pPlayers[3].pPlayerBuffs[6]; | |
6735 goto LABEL_104; | |
6736 } | |
6737 v490 = v3->uPlayerID_2; | |
6738 v491 = v3->spellnum; | |
6739 v492 = pGame->GetStru6(); | |
6740 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); | |
6741 v668 = v1; | |
6742 v732 = (int)v733 << 7; | |
6743 v658 = v2; | |
6744 v653 = v2; | |
6745 v651 = v731; | |
6746 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6747 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; | |
6748 goto LABEL_103; | |
6749 case 74: | |
6750 v493 = v12 - 2; | |
6751 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
6752 amount = v1; | |
6753 else | |
6754 amount = 86400 * v2; | |
6755 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6756 goto LABEL_83; | |
6757 v495 = v3->uPlayerID_2; | |
6758 v496 = v3->spellnum; | |
6759 v497 = pGame->GetStru6(); | |
6760 pGame->GetStru6()->SetPlayerBuffAnim(v496, v495); | |
6761 v498 = v3->uPlayerID_2; | |
6762 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6763 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6764 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6765 goto LABEL_1056; | |
6766 if ( v731 == 4 ) | |
6767 { | |
6768 LODWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6769 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6770 v499 = v3->uPlayerID_2; | |
6771 LODWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6772 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6773 v500 = v3->uPlayerID_2; | |
6774 LODWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6775 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6776 } | |
6777 else | |
6778 { | |
6779 v732 = amount << 7; | |
6780 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6781 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6782 7u, | |
6783 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6784 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6785 9u, | |
6786 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6787 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6788 v656 = 11; | |
6789 LABEL_937: | |
112 | 6790 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6791 LABEL_641: |
6792 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6793 } | |
6794 goto LABEL_1056; | |
6795 case 77: | |
6796 amount = 5 * v2 + 10; | |
6797 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6798 goto LABEL_83; | |
6799 v501 = pParty->pPlayers; | |
6800 do | |
6801 { | |
6802 v502 = v3->spellnum; | |
6803 v503 = pGame->GetStru6(); | |
6804 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); | |
6805 v501->Heal(amount); | |
6806 ++v501; | |
6807 ++v1; | |
6808 } | |
6809 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6810 goto LABEL_1056; | |
6811 case 80: | |
6812 sRecoveryTime -= v2; | |
6813 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6814 goto LABEL_83; | |
6815 v504 = pGame->GetStru6(); | |
6816 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); | |
6817 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6818 ++a1.uItemType; | |
6819 HIDWORD(v733) = v505; | |
6820 v690 = v1; | |
6821 v689 = v1; | |
6822 v688 = v1; | |
6823 a1.stru_24.Reset(); | |
6824 a1.field_48 = v3->spellnum; | |
6825 a1.field_4C = v2; | |
6826 a1.field_50 = v731; | |
6827 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6828 a1.uAttributes = v1; | |
6829 a1.uSectorID = v1; | |
6830 a1.uSpriteFrameID = v1; | |
6831 v506 = v3->uPlayerID; | |
6832 a1.field_60_distance_related_prolly_lod = 0; | |
6833 a1.uFacing = v1; | |
6834 v506 *= 8; | |
303 | 6835 LOBYTE(v506) = v506 | OBJECT_Player; |
6836 a1.field_58_pid = v506; | |
0 | 6837 a1.uSoundID = LOWORD(v3->field_10); |
6838 a2 = v1; | |
6839 if ( SHIDWORD(v733) > v1 ) | |
6840 { | |
6841 do | |
6842 { | |
6843 v507 = dword_50BF30[a2]; | |
6844 a1.vPosition.x = pActors[v507].vPosition.x; | |
6845 a1.vPosition.y = pActors[v507].vPosition.y; | |
6846 v732 = pActors[v507].uActorHeight; | |
6847 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6848 v508 = 8 * dword_50BF30[a2]; | |
6849 LOBYTE(v508) = v508 | 3; | |
6850 a1.field_5C = v508; | |
6851 v509 = a1.Create(0, v1, v1, v1); | |
6852 v510 = a2; | |
6853 DamageMonsterFromParty(8 * v509 | 2, dword_50BF30[a2], (Vec3_int_ *)&v688); | |
6854 a2 = v510 + 1; | |
6855 } | |
6856 while ( v510 + 1 < SHIDWORD(v733) ); | |
6857 } | |
6858 for ( a2 = v1; a2 < SHIDWORD(v733); ++a2 ) | |
6859 { | |
6860 v511 = &pActors[dword_50BF30[a2]]; | |
6861 a1.vPosition.x = v511->vPosition.x; | |
6862 a1.vPosition.y = v511->vPosition.y; | |
6863 v732 = v511->uActorHeight; | |
6864 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6865 v512 = 8 * dword_50BF30[a2]; | |
6866 LOBYTE(v512) = v512 | 3; | |
6867 a1.field_5C = v512; | |
6868 a1.Create(0, v1, v1, v1); | |
6869 v513 = v511->pActorBuffs; | |
6870 v726 = (Player *)22; | |
6871 do | |
6872 { | |
6873 v513->Reset(); | |
6874 ++v513; | |
6875 v726 = (Player *)((char *)v726 - 1); | |
6876 } | |
6877 while ( *(float *)&v726 != 0.0 ); | |
6878 } | |
6879 goto LABEL_1056; | |
6880 case 82: | |
6881 v514 = v12 - 2; | |
6882 if ( !v514 ) | |
6883 goto LABEL_955; | |
6884 v515 = v514 - 1; | |
6885 if ( v515 ) | |
6886 { | |
6887 if ( v515 == 1 ) | |
6888 { | |
6889 v516 = 900 * v2; | |
6890 amount = 5; | |
6891 } | |
6892 else | |
6893 { | |
6894 LABEL_955: | |
6895 v516 = 300 * v2; | |
6896 amount = 1; | |
6897 } | |
6898 } | |
6899 else | |
6900 { | |
6901 v516 = 900 * v2; | |
6902 amount = 3; | |
6903 } | |
6904 v733 = __PAIR__(v1, v516); | |
6905 v517 = 8 * v3->uPlayerID; | |
6906 LOBYTE(v517) = v517 | 4; | |
6907 if ( (signed int)uNumActors > v1 ) | |
6908 { | |
90 | 6909 v518 = pActors;//[0].uAIState; |
6910 v726b = uNumActors; | |
0 | 6911 do |
6912 { | |
90 | 6913 v519 = v518->uAIState; |
6914 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6915 ++HIDWORD(v733); |
90 | 6916 ++v518; |
6917 --v726; | |
0 | 6918 } |
90 | 6919 while ( v726 != 0 ); |
0 | 6920 } |
6921 if ( SHIDWORD(v733) >= amount ) | |
6922 { | |
6923 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6924 goto LABEL_201; | |
6925 } | |
6926 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6927 goto LABEL_83; | |
6928 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); | |
6929 goto LABEL_1056; | |
6930 case 83: | |
6931 v520 = v12 - 2; | |
6932 if ( !v520 ) | |
6933 goto LABEL_973; | |
6934 v521 = v520 - 1; | |
6935 if ( v521 ) | |
6936 { | |
6937 if ( v521 == 1 ) | |
6938 { | |
6939 LODWORD(v733) = 18000 * v2; | |
6940 v522 = 5 * v2 + 10; | |
6941 } | |
6942 else | |
6943 { | |
6944 LABEL_973: | |
6945 LODWORD(v733) = 10800 * v2; | |
6946 v522 = 3 * v2 + 10; | |
6947 } | |
6948 } | |
6949 else | |
6950 { | |
6951 LODWORD(v733) = 14400 * v2; | |
6952 v522 = 4 * v2 + 10; | |
6953 } | |
6954 amount = v522; | |
6955 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6956 goto LABEL_83; | |
6957 v523 = v3->spellnum; | |
6958 v524 = pGame->GetStru6(); | |
6959 pGame->GetStru6()->SetPlayerBuffAnim(v523, v1); | |
6960 v83 = 1; | |
6961 v525 = v3->spellnum; | |
6962 v526 = pGame->GetStru6(); | |
6963 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1u); | |
6964 v527 = v3->spellnum; | |
6965 v528 = pGame->GetStru6(); | |
6966 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2u); | |
6967 v529 = v3->spellnum; | |
6968 v530 = pGame->GetStru6(); | |
6969 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3u); | |
6970 v673 = v1; | |
6971 v732 = (int)v733 << 7; | |
6972 v662 = v1; | |
6973 v655 = amount; | |
6974 v652 = v731; | |
6975 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6976 v137 = (char *)&pParty->pPartyBuffs[2]; | |
6977 goto LABEL_976; | |
6978 case 84: | |
6979 v67 = 2; | |
6980 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6981 { | |
6982 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6983 goto LABEL_202; | |
6984 } | |
6985 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6986 goto LABEL_83; | |
6987 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6988 ++a1.uItemType; | |
6989 v726 = (Player *)v531; | |
6990 v696 = v1; | |
6991 v695 = v1; | |
6992 v694 = v1; | |
6993 a1.stru_24.Reset(); | |
6994 a1.field_48 = v3->spellnum; | |
6995 a1.field_4C = v2; | |
6996 a1.field_50 = v731; | |
6997 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6998 a1.uAttributes = v1; | |
6999 a1.uSectorID = v1; | |
7000 a1.uSpriteFrameID = v1; | |
7001 v532 = v3->uPlayerID; | |
7002 a1.field_60_distance_related_prolly_lod = 0; | |
7003 a1.uFacing = v1; | |
7004 v532 *= 8; | |
303 | 7005 LOBYTE(v532) = v532 | OBJECT_Player; |
7006 a1.field_58_pid = v532; | |
0 | 7007 a1.uSoundID = LOWORD(v3->field_10); |
7008 a2 = v1; | |
7009 if ( (signed int)v726 > v1 ) | |
7010 { | |
7011 do | |
7012 { | |
7013 v533 = dword_50BF30[a2]; | |
7014 a1.vPosition.x = pActors[v533].vPosition.x; | |
7015 a1.vPosition.y = pActors[v533].vPosition.y; | |
7016 v732 = pActors[v533].uActorHeight; | |
7017 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7018 v534 = 8 * dword_50BF30[a2]; | |
7019 LOBYTE(v534) = v534 | 3; | |
7020 a1.field_5C = v534; | |
7021 v535 = a1.Create(0, v1, v1, v1); | |
7022 v536 = a2; | |
7023 DamageMonsterFromParty(8 * v535 | 2, dword_50BF30[a2], (Vec3_int_ *)&v694); | |
7024 a2 = v536 + 1; | |
7025 } | |
7026 while ( v536 + 1 < (signed int)v726 ); | |
7027 } | |
7028 v537 = pGame->GetStru6(); | |
7029 pGame->GetStru6()->_4A8BFC(); | |
7030 goto LABEL_1056; | |
7031 case 85: | |
7032 v538 = v12 - 2; | |
7033 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
7034 { | |
7035 amount = 5 * v2; | |
7036 v540 = 18000 * v2; | |
7037 } | |
7038 else | |
7039 { | |
7040 amount = 4 * v2; | |
7041 v540 = 14400 * v2; | |
7042 } | |
7043 v730 = v540; | |
7044 LODWORD(v733) = v540; | |
7045 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7046 goto LABEL_83; | |
7047 v541 = v3->spellnum; | |
7048 v542 = pGame->GetStru6(); | |
7049 pGame->GetStru6()->SetPlayerBuffAnim(v541, v1); | |
7050 v543 = v3->spellnum; | |
7051 v544 = pGame->GetStru6(); | |
7052 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1u); | |
7053 v545 = v3->spellnum; | |
7054 v546 = pGame->GetStru6(); | |
7055 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2u); | |
7056 v547 = v3->spellnum; | |
7057 v548 = pGame->GetStru6(); | |
7058 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3u); | |
7059 v732 = v730 << 7; | |
7060 v549 = (double)(v730 << 7) * 0.033333335; | |
7061 *((float *)&v733 + 1) = v549; | |
7062 v712 = (signed __int64)v549; | |
7063 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, v1, v1); | |
7064 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7065 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7066 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7067 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7068 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7069 v550 = v2 + 5; | |
7070 pParty->pPartyBuffs[ 5].Apply( | |
7071 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7072 v731, | |
7073 v550, | |
7074 v1, | |
7075 v1); | |
7076 v668 = v1; | |
7077 v658 = v1; | |
7078 v653 = v550; | |
7079 v651 = v731; | |
7080 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); | |
7081 LABEL_992: | |
7082 v27 = (char *)&pParty->pPartyBuffs[19]; | |
7083 goto LABEL_103; | |
7084 case 86: | |
7085 v551 = v12 - 2; | |
7086 if ( !v551 ) | |
7087 goto LABEL_998; | |
7088 v552 = v551 - 1; | |
7089 if ( v552 ) | |
7090 { | |
7091 if ( v552 == 1 ) | |
7092 { | |
7093 amount = 15; | |
7094 HIDWORD(v733) = 20; | |
7095 goto LABEL_1000; | |
7096 } | |
7097 LABEL_998: | |
7098 v678 = 4; | |
7099 } | |
7100 else | |
7101 { | |
7102 v678 = 12; | |
7103 } | |
7104 amount = v678; | |
7105 HIDWORD(v733) = v678; | |
7106 LABEL_1000: | |
7107 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7108 goto LABEL_83; | |
7109 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); | |
7110 v732 = (300 * amount * v2 + 60) << 7; | |
7111 v730 = v2 + 5; | |
7112 v726 = (Player *)v1; | |
89 | 7113 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 7114 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
7115 do | |
7116 { | |
7117 v554 = v3->spellnum; | |
7118 v555 = pGame->GetStru6(); | |
7119 pGame->GetStru6()->SetPlayerBuffAnim(v554, v1); | |
7120 v556 = v3->spellnum; | |
7121 v557 = pGame->GetStru6(); | |
7122 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1u); | |
7123 v558 = v3->spellnum; | |
7124 v559 = pGame->GetStru6(); | |
7125 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2u); | |
7126 v560 = v3->spellnum; | |
7127 v561 = pGame->GetStru6(); | |
7128 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3u); | |
89 | 7129 //((SpellBuff *)(v553 + 6056))->Apply( |
7130 v553->pPlayerBuffs[4].Apply( | |
0 | 7131 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7132 v731, | |
7133 v730, | |
7134 v1, | |
7135 v1); | |
7136 if ( *(_QWORD *)v553 ) | |
7137 v726 = (Player *)1; | |
89 | 7138 ++v553; |
7139 } | |
7140 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 7141 v562 = v731; |
7142 pParty->pPartyBuffs[9].Apply( | |
7143 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7144 v731, | |
7145 v730, | |
7146 v1, | |
7147 v1); | |
7148 pParty->pPartyBuffs[14].Apply( | |
7149 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7150 v562, | |
7151 v1, | |
7152 v1, | |
7153 v1); | |
7154 pParty->pPartyBuffs[15].Apply( | |
7155 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7156 v562, | |
7157 v730, | |
7158 v1, | |
7159 v1); | |
7160 if ( v726 != (Player *)v1 ) | |
7161 goto LABEL_1056; | |
7162 v668 = v1; | |
7163 v732 = (int)y << 7; | |
7164 v658 = v1; | |
7165 v653 = v730; | |
7166 v651 = v562; | |
7167 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 | |
7168 + (double)(signed __int64)pParty->uTimePlayed); | |
7169 v27 = (char *)&pParty->pPartyBuffs[8]; | |
7170 goto LABEL_103; | |
7171 case 88: | |
7172 amount = 3; | |
7173 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
7174 goto LABEL_200; | |
7175 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7176 goto LABEL_83; | |
7177 a2 = v1; | |
7178 _this = (ItemGen *)&pPlayers[1]; | |
7179 do | |
7180 { | |
7181 v563 = 0; | |
7182 do | |
7183 { | |
7184 v564 = _this->uItemID; | |
7185 *(int *)(v563 + _this->uItemID) = v1; | |
7186 v563 += 8; | |
7187 *(int *)(v563 + v564 - 4) = v1; | |
7188 } | |
7189 while ( v563 <= 128 ); | |
7190 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
7191 v566 = (Player **)_this; | |
7192 *(int *)(_this->uItemID + 6460) = v565; | |
7193 v567 = (*v566)->GetMaxMana(); | |
7194 v568 = a2; | |
7195 *(int *)(_this->uItemID + 6464) = v567; | |
7196 v569 = v3->spellnum; | |
7197 v570 = pGame->GetStru6(); | |
7198 pGame->GetStru6()->SetPlayerBuffAnim(v569, v568); | |
7199 ++a2; | |
7200 _this = (ItemGen *)((char *)_this + 4); | |
7201 } | |
7202 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
7203 v571 = pPlayer; | |
7204 v572 = (char *)&pPlayer->sAgeModifier; | |
7205 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
7206 *(short *)v572 = 120; | |
7207 else | |
7208 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
7209 sRecoveryTime += -5 * v2; | |
7210 ++v571->uNumDivineInterventionCastsThisDay; | |
7211 goto LABEL_1056; | |
7212 case 89: | |
7213 v573 = v12 - 2; | |
7214 if ( v573 ) | |
7215 { | |
7216 v574 = v573 - 1; | |
7217 if ( v574 ) | |
7218 { | |
7219 if ( v574 == 1 ) | |
7220 v575 = 5 * v2; | |
7221 else | |
7222 v575 = 2 * v2; | |
7223 } | |
7224 else | |
7225 { | |
7226 v575 = 4 * v2; | |
7227 } | |
7228 } | |
7229 else | |
7230 { | |
7231 v575 = 3 * v2; | |
7232 } | |
7233 amount = v575; | |
7234 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7235 goto LABEL_83; | |
7236 v576 = *(int *)&v3->field_C; | |
7237 if ( v576 == v1 ) | |
7238 { | |
7239 v583 = v3->uPlayerID_2; | |
7240 v584 = v3->spellnum; | |
7241 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
7242 v586 = pGame->GetStru6(); | |
7243 pGame->GetStru6()->SetPlayerBuffAnim(v584, v583); | |
7244 if ( *((_QWORD *)v585 + 14) ) | |
7245 { | |
7246 ((Player *)v585)->SetCondition(0x11u, 1); | |
7247 v587 = ((Player *)v585)->GetSexByVoice(); | |
7248 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7249 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7250 } | |
7251 goto LABEL_83; | |
7252 } | |
7253 v577 = (Player *)(v576 >> 3); | |
7254 v726 = v577; | |
7255 if ( v577 == (Player *)-1 ) | |
7256 { | |
7257 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7258 goto LABEL_201; | |
7259 } | |
7260 v578 = (int)&pActors[(int)v577]; | |
7261 v721 = v578; | |
7262 if ( *(short *)(v578 + 40) > (signed __int16)v1 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) | |
7263 goto LABEL_200; | |
7264 ++a1.uItemType; | |
7265 a1.stru_24.Reset(); | |
7266 a1.field_48 = v3->spellnum; | |
7267 a1.field_4C = v2; | |
7268 a1.field_50 = v731; | |
7269 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7270 a1.uAttributes = v1; | |
7271 a1.uSectorID = v1; | |
7272 a1.uSpriteFrameID = v1; | |
7273 v580 = v3->uPlayerID; | |
7274 a1.field_60_distance_related_prolly_lod = 0; | |
7275 v581 = v721; | |
7276 v580 *= 8; | |
303 | 7277 LOBYTE(v580) = v580 | OBJECT_Player; |
0 | 7278 a1.uFacing = v1; |
303 | 7279 a1.field_58_pid = v580; |
0 | 7280 a1.uSoundID = LOWORD(v3->field_10); |
7281 a1.vPosition.x = *(short *)(v721 + 142); | |
7282 a1.vPosition.y = *(short *)(v721 + 144); | |
7283 v732 = *(short *)(v721 + 138); | |
7284 v582 = 8 * (int)v726; | |
7285 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7286 LOBYTE(v582) = 8 * (char)v726 | 3; | |
7287 a1.field_5C = v582; | |
7288 a1.Create(0, v1, v1, v1); | |
7289 if ( *(char *)(v581 + 52) > amount ) | |
7290 goto LABEL_83; | |
7291 Actor::Resurrect((unsigned int)v726); | |
7292 *(char *)(v581 + 61) = 0; | |
7293 *(char *)(v581 + 53) = 0; | |
7294 *(char *)(v581 + 54) = 0; | |
7295 *(char *)(v581 + 55) = 0; | |
7296 *(char *)(v581 + 56) = 0; | |
7297 *(char *)(v581 + 57) = 0; | |
7298 *(int *)(v581 + 712) = 9999; | |
7299 *(char *)(v581 + 38) &= 0xF7u; | |
7300 *(int *)(v581 + 708) = v1; | |
7301 ((SpellBuff *)(v581 + 356))->Reset(); | |
7302 ((SpellBuff *)(v581 + 228))->Reset(); | |
7303 ((SpellBuff *)(v581 + 404))->Reset(); | |
7304 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7305 *(short *)(v581 + 40) = 10 * amount; | |
7306 goto LABEL_1056; | |
7307 case 91: | |
7308 v588 = v12 - 1; | |
7309 amount = 16; | |
7310 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7311 { | |
7312 if ( v590 == 1 ) | |
7313 LODWORD(v733) = v1; | |
7314 } | |
7315 else | |
7316 { | |
7317 LODWORD(v733) = 3600 * v2; | |
7318 } | |
7319 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7320 goto LABEL_83; | |
7321 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; | |
7322 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7323 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7324 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7325 || *(char *)(HIDWORD(v733) + 20) & 2 | |
7326 || *(int *)(HIDWORD(v733) + 12) != v1 | |
7327 || *(int *)(HIDWORD(v733) + 4) != v1 | |
7328 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 | |
377 | 7329 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) |
0 | 7330 goto LABEL_199; |
7331 v592 = HIDWORD(v733); | |
7332 v14 = v731 == 4; | |
7333 *(int *)(HIDWORD(v733) + 12) = 16; | |
7334 if ( !v14 ) | |
7335 { | |
7336 v732 = (int)v733 << 7; | |
7337 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7338 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7339 *(int *)(v592 + 20) |= 8u; | |
7340 } | |
7341 *(char *)(v592 + 20) |= 0x80u; | |
7342 goto LABEL_1055; | |
7343 case 93: | |
7344 v593 = v12 - 2; | |
7345 if ( !v593 ) | |
7346 goto LABEL_1062; | |
7347 v594 = v593 - 1; | |
7348 if ( v594 ) | |
7349 { | |
7350 if ( v594 == 1 ) | |
7351 amount = 9; | |
7352 else | |
7353 LABEL_1062: | |
7354 amount = 5; | |
7355 } | |
7356 else | |
7357 { | |
7358 amount = 7; | |
7359 } | |
7360 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7361 goto LABEL_83; | |
7362 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
7363 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7364 a1.stru_24.Reset(); | |
7365 a1.field_48 = v3->spellnum; | |
7366 a1.field_4C = v2; | |
7367 a1.field_50 = v731; | |
7368 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7369 a1.vPosition.x = pParty->vPosition.x; | |
7370 a1.vPosition.y = pParty->vPosition.y; | |
7371 a1.uAttributes = v1; | |
7372 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
7373 a1.uSectorID = pIndoor->GetSector( | |
7374 pParty->vPosition.x, | |
7375 pParty->vPosition.y, | |
7376 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
7377 a1.uSpriteFrameID = v1; | |
7378 v595 = 8 * v3->uPlayerID; | |
303 | 7379 LOBYTE(v595) = v595 | OBJECT_Player; |
7380 a1.field_58_pid = v595; | |
0 | 7381 a1.field_5C = a2; |
7382 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7383 a1.uSoundID = LOWORD(v3->field_10); | |
7384 if ( pParty->bTurnBasedModeOn == 1 ) | |
7385 LOBYTE(a1.uAttributes) |= 4u; | |
7386 v596 = (signed int)v726 / -2; | |
7387 y = (char *)((signed int)v726 / 2); | |
7388 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7389 { | |
7390 v597 = v715.uYawAngle; | |
7391 do | |
7392 { | |
7393 a1.uFacing = v596 + v597; | |
7394 if ( a1.Create( | |
7395 v596 + v597, | |
7396 v715.uPitchAngle, | |
7397 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7398 v3->uPlayerID + 1) != -1 | |
7399 && pParty->bTurnBasedModeOn == 1 ) | |
7400 ++pTurnEngine->field_1C; | |
7401 v596 += v732; | |
7402 } | |
7403 while ( v596 <= (signed int)y ); | |
7404 } | |
7405 goto LABEL_1056; | |
7406 case 94: | |
7407 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7408 goto LABEL_83; | |
7409 if ( v731 == 1 || v731 == 2 ) | |
7410 { | |
7411 v598 = 180 * v2; | |
7412 goto LABEL_1081; | |
7413 } | |
7414 if ( v731 == 3 ) | |
7415 { | |
7416 v598 = 300 * v2; | |
7417 LABEL_1081: | |
7418 LODWORD(v733) = v598; | |
7419 goto LABEL_1082; | |
7420 } | |
7421 if ( v731 == 4 ) | |
7422 LODWORD(v733) = 29030400; | |
7423 LABEL_1082: | |
7424 v599 = a2 >> 3; | |
141 | 7425 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7426 goto LABEL_1056; |
7427 v730 = 836 * v599; | |
7428 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
7429 goto LABEL_83; | |
90 | 7430 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7431 goto LABEL_200; |
90 | 7432 pActors[v599].pActorBuffs[9].Reset(); |
7433 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7434 v732 = (int)v733 << 7; |
90 | 7435 pActors[v599].pActorBuffs[12].Apply( |
0 | 7436 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
7437 v731, | |
7438 v1, | |
7439 v1, | |
7440 v1); | |
7441 a1.stru_24.Reset(); | |
7442 a1.field_48 = v3->spellnum; | |
7443 a1.field_4C = v2; | |
7444 a1.field_50 = v731; | |
7445 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 7446 v61 = v599; |
0 | 7447 LABEL_1086: |
90 | 7448 v600 = pActors[v61].vPosition.y; |
7449 v601 = pActors[v61].vPosition.x; | |
0 | 7450 a1.uObjectDescID = v60; |
7451 a1.vPosition.x = v601; | |
90 | 7452 v602 = pActors[v61].uActorHeight; |
7453 v603 = pActors[v61].vPosition.z; | |
0 | 7454 a1.vPosition.y = v600; |
7455 v676 = v603 + v602; | |
7456 v665 = v600; | |
7457 a1.vPosition.z = v603 + v602; | |
7458 v657 = v601; | |
7459 LABEL_1087: | |
7460 a1.uAttributes = v1; | |
7461 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); | |
7462 a1.uSpriteFrameID = v1; | |
7463 v604 = 8 * v3->uPlayerID; | |
303 | 7464 LOBYTE(v604) = v604 | OBJECT_Player; |
7465 a1.field_58_pid = v604; | |
0 | 7466 a1.field_5C = a2; |
7467 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7468 a1.uFacing = LOWORD(v715.uYawAngle); | |
7469 LOWORD(v604) = LOWORD(v3->field_10); | |
7470 LOBYTE(a1.uAttributes) |= 0x80u; | |
7471 a1.uSoundID = v604; | |
7472 a1.Create(0, v1, v1, v3->uPlayerID + 1); | |
7473 goto LABEL_1056; | |
7474 case 96: | |
7475 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7476 goto LABEL_83; | |
7477 HIDWORD(v733) = v1; | |
7478 memset(&pStru179, v1, 0xFA0u); | |
7479 _this = (ItemGen *)v1; | |
7480 v605 = (char *)pParty->pHirelings; | |
7481 do | |
7482 { | |
7483 if ( *(int *)v605 != v1 ) | |
7484 { | |
7485 v606 = HIDWORD(v733)++; | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
79
diff
changeset
|
7486 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7487 } |
7488 _this = (ItemGen *)((char *)_this + 1); | |
7489 v605 += 76; | |
7490 } | |
7491 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
7492 _this = (ItemGen *)v1; | |
7493 if ( (signed int)pNPCStats->uNumNewNPCs > v1 ) | |
7494 { | |
7495 v730 = (int)pNPCStats->pNewNPCData; | |
7496 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7497 do | |
7498 { | |
7499 if ( *(char *)(v730 + 8) & 0x80 | |
7500 && (pParty->pHirelings[0].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) | |
7501 && (pParty->pHirelings[1].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
7502 { | |
7503 v607 = HIDWORD(v733); | |
7504 HIDWORD(v733) += 4; | |
7505 *(int *)v607 = (int)_this + 3; | |
7506 } | |
7507 _this = (ItemGen *)((char *)_this + 1); | |
7508 v730 += 76; | |
7509 } | |
7510 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7511 } | |
7512 v608 = v3->uPlayerID_2; | |
7513 if ( v608 != 4 && v608 != 5 | |
7514 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= v1) | |
7515 || v609 >= 3 ) | |
7516 goto LABEL_200; | |
7517 v610 = 76 * v609; | |
7518 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = v1; | |
7519 v611 = pIconsFrameTable->FindIcon("spell96"); | |
7520 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( | |
7521 v611); | |
7522 v232 = 1; | |
7523 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; | |
89 | 7524 v612 = pParty->pPlayers; |
0 | 7525 do |
7526 { | |
89 | 7527 v612->sHealth = v612->GetMaxHealth(); |
7528 v612->sMana = v612->GetMaxMana(); | |
7529 ++v612; | |
7530 } | |
7531 while ( v612 <= &pParty->pPlayers[3] ); | |
7532 v613 = &pOutdoor->ddm; | |
0 | 7533 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7534 v613 = &pIndoor->dlv; |
7535 v613->uReputation += 15; | |
7536 if ( v613->uReputation > 10000 ) | |
7537 v613->uReputation = 10000; | |
0 | 7538 LODWORD(v727) = v232; |
7539 goto LABEL_83; | |
7540 case 95: | |
7541 if ( v12 <= v1 ) | |
7542 goto LABEL_1119; | |
7543 if ( v12 <= 3 ) | |
7544 { | |
7545 v614 = 300 * (v2 + 12); | |
7546 } | |
7547 else | |
7548 { | |
7549 if ( v12 != 4 ) | |
7550 goto LABEL_1119; | |
7551 v614 = 900 * (v2 + 4); | |
7552 } | |
7553 LODWORD(v733) = v614; | |
7554 LABEL_1119: | |
7555 v615 = v2 + 5; | |
7556 amount = v615; | |
7557 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7558 goto LABEL_83; | |
7559 if ( v731 != 3 && v731 != 4 ) | |
7560 { | |
7561 v616 = v3->uPlayerID_2; | |
7562 v617 = v3->spellnum; | |
7563 v618 = pGame->GetStru6(); | |
7564 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); | |
7565 v668 = v1; | |
7566 v658 = v716; | |
7567 v732 = (int)v733 << 7; | |
7568 v653 = v615; | |
7569 v651 = v731; | |
7570 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7571 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; | |
7572 goto LABEL_103; | |
7573 } | |
7574 a2 = v1; | |
7575 v732 = (int)v733 << 7; | |
7576 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7577 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7578 do |
7579 { | |
7580 v620 = a2; | |
7581 v621 = v3->spellnum; | |
7582 v622 = pGame->GetStru6(); | |
7583 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); | |
112 | 7584 v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
0 | 7585 ++a2; |
112 | 7586 ++v619; |
7587 } | |
7588 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7589 goto LABEL_1056; |
7590 case 99: | |
7591 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7592 goto LABEL_83; | |
7593 v726 = (Player *)v1; | |
7594 pGame->GetIndoorCamera(); | |
7595 v623 = (signed __int64)GetPickDepth(); | |
7596 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
7597 v709 = v1; | |
7598 v708 = v1; | |
7599 v707 = v1; | |
7600 a1.stru_24.Reset(); | |
7601 a1.field_48 = v3->spellnum; | |
7602 a1.field_4C = v2; | |
7603 a1.field_50 = v731; | |
7604 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7605 a1.uAttributes = v1; | |
7606 a1.uSectorID = v1; | |
7607 a1.uSpriteFrameID = v1; | |
7608 v624 = v3->uPlayerID; | |
7609 a1.field_60_distance_related_prolly_lod = 0; | |
7610 a1.uFacing = v1; | |
7611 v624 *= 8; | |
303 | 7612 LOBYTE(v624) = v624 | OBJECT_Player; |
7613 a1.field_58_pid = v624; | |
0 | 7614 a1.uSoundID = LOWORD(v3->field_10); |
7615 a2 = v1; | |
7616 if ( SHIDWORD(v733) > v1 ) | |
7617 { | |
7618 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7619 do | |
7620 { | |
7621 v625 = dword_50BF30[a2]; | |
7622 a1.vPosition.x = pActors[v625].vPosition.x; | |
7623 a1.vPosition.y = pActors[v625].vPosition.y; | |
7624 v732 = pActors[v625].uActorHeight; | |
7625 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7626 v626 = 8 * dword_50BF30[a2]; | |
7627 LOBYTE(v626) = v626 | 3; | |
7628 a1.field_5C = v626; | |
7629 v627 = a1.Create(0, v1, v1, v1); | |
7630 v628 = a2; | |
7631 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7632 a2 = v628 + 1; | |
7633 } | |
7634 while ( v628 + 1 < SHIDWORD(v733) ); | |
7635 } | |
7636 v730 = v1; | |
7637 v629 = 1; | |
7638 do | |
7639 { | |
7640 v630 = pPlayers[v629]; | |
7641 if ( !v630->pConditions[2] | |
7642 && !v630->pConditions[12] | |
7643 && !v630->pConditions[13] | |
7644 && !v630->pConditions[14] | |
7645 && !v630->pConditions[15] | |
7646 && !v630->pConditions[16] ) | |
7647 { | |
7648 v631 = v730++; | |
7649 v681[v631] = v629; | |
7650 } | |
7651 ++v629; | |
7652 } | |
7653 while ( v629 <= 4 ); | |
7654 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
7655 HIDWORD(v733) = v1; | |
7656 if ( v730 > v1 ) | |
7657 { | |
7658 do | |
7659 { | |
7660 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7661 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7662 v633->sHealth += v732; | |
7663 v726 = *(Player **)v632; | |
7664 v634 = v726->GetMaxHealth(); | |
7665 if ( v726->sHealth > v634 ) | |
7666 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7667 v635 = HIDWORD(v733); | |
7668 v636 = WORD2(v733); | |
7669 v637 = v3->spellnum; | |
7670 v638 = pGame->GetStru6(); | |
7671 pGame->GetStru6()->SetPlayerBuffAnim(v637, v636); | |
7672 HIDWORD(v733) = v635 + 1; | |
7673 } | |
7674 while ( v635 + 1 < v730 ); | |
7675 } | |
7676 v639 = pGame->GetStru6(); | |
7677 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(v1, 0x40u); | |
7678 goto LABEL_1056; | |
7679 case 98: | |
7680 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7681 { | |
7682 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7683 goto LABEL_201; | |
7684 } | |
7685 v640 = v12 - 2; | |
7686 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7687 amount = 3; | |
349 | 7688 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > v1 ) |
0 | 7689 goto LABEL_200; |
7690 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7691 goto LABEL_83; | |
349 | 7692 pParty->armageddon_timer = 256; |
0 | 7693 pParty->field_16140 = v2; |
7694 ++pPlayer->uNumArmageddonCasts; | |
7695 if ( pParty->bTurnBasedModeOn == 1 ) | |
7696 ++pTurnEngine->field_1C; | |
7697 v726 = (Player *)50; | |
7698 do | |
7699 { | |
7700 v642 = rand() % 4096 - 2048; | |
7701 v643 = rand(); | |
7702 v721 = v642 + pParty->vPosition.x; | |
7703 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
7704 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1); | |
7705 v644 = rand(); | |
7706 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1); | |
7707 v726 = (Player *)((char *)v726 - 1); | |
7708 } | |
7709 while ( *(float *)&v726 != 0.0 ); | |
7710 goto LABEL_1056; | |
7711 default: | |
7712 goto LABEL_83; | |
7713 } | |
7714 while ( 2 ) | |
7715 { | |
7716 if ( v731 == 4 ) | |
7717 { | |
7718 if ( *((_QWORD *)v222 + 2) ) | |
7719 { | |
7720 *((int *)v222 + 4) = v1; | |
7721 *((int *)v222 + 5) = v1; | |
7722 goto LABEL_439; | |
7723 } | |
7724 } | |
7725 else | |
7726 { | |
7727 v732 = amount << 7; | |
7728 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7729 2u, | |
7730 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7731 v222 = (char *)HIDWORD(v733); | |
7732 if ( v223 ) | |
7733 LABEL_439: | |
187 | 7734 ((Player *)v222)->PlaySound(SPEECH_103, v1); |
0 | 7735 } |
7736 v222 += 6972; | |
7737 HIDWORD(v733) = (int)v222; | |
7738 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7739 goto LABEL_1056; | |
7740 continue; | |
7741 } | |
7742 } | |
7743 if ( pParty->bTurnBasedModeOn == v1 ) | |
7744 { | |
7745 v646 = pPlayer; | |
7746 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
7747 v647 = n; | |
7748 } | |
7749 else | |
7750 { | |
7751 v647 = n; | |
7752 v646 = pPlayer; | |
7753 v648 = sRecoveryTime; | |
7754 v649 = pPlayer; | |
7755 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
7756 v649->SetRecoveryTime(v648); | |
7757 pTurnEngine->_40471C(); | |
7758 } | |
7759 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
7760 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
7761 v711[v647].spellnum = v1; | |
7762 v646->sMana -= uRequiredMana; | |
7763 } | |
7764 //----- (0042EB42) -------------------------------------------------------- | |
7765 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7766 { | |
7767 unsigned int v2; // edx@1 | |
7768 signed int v3; // eax@1 | |
7769 char *v4; // ecx@2 | |
7770 | |
7771 v2 = this->uNumObjects; | |
7772 v3 = 0; | |
7773 if ( (signed int)this->uNumObjects <= 0 ) | |
7774 { | |
7775 LABEL_5: | |
7776 LOWORD(v3) = 0; | |
7777 } | |
7778 else | |
7779 { | |
7780 v4 = (char *)&this->pObjects->uObjectID; | |
7781 while ( uItemID != *(short *)v4 ) | |
7782 { | |
7783 ++v3; | |
7784 v4 += 56; | |
7785 if ( v3 >= (signed int)v2 ) | |
7786 goto LABEL_5; | |
7787 } | |
7788 } | |
7789 return v3; | |
7790 } | |
7791 | |
7792 | |
7793 | |
7794 //----- (0042EB78) -------------------------------------------------------- | |
7795 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7796 { | |
7797 return 8 * this->pIcons[uIconID].uAnimLength; | |
7798 } | |
7799 | |
437 | 7800 |
7801 const wchar_t *UIMessage2String(UIMessageType msg) | |
7802 { | |
7803 #define CASE(xxx) case xxx: _swprintf(b, L"%03X/%s", msg, L#xxx); return b; | |
7804 static wchar_t b[256]; // bad for threads | |
7805 switch (msg) | |
7806 { | |
7807 CASE(UIMSG_SelectSpell) | |
7808 CASE(UIMSG_ChangeGameState) | |
7809 CASE(UIMSG_Attack) | |
7810 CASE(UIMSG_PlayArcomage) | |
7811 CASE(UIMSG_MainMenu_ShowPartyCreationWnd) | |
7812 CASE(UIMSG_MainMenu_ShowLoadWindow) | |
7813 CASE(UIMSG_ShowCredits) | |
7814 CASE(UIMSG_ExitToWindows) | |
7815 CASE(UIMSG_PlayerCreationChangeName) | |
7816 CASE(UIMSG_PlayerCreationClickPlus) | |
7817 CASE(UIMSG_PlayerCreationClickMinus) | |
7818 CASE(UIMSG_PlayerCreationSelectActiveSkill) | |
7819 CASE(UIMSG_PlayerCreationSelectClass) | |
7820 CASE(UIMSG_PlayerCreationClickOK) | |
7821 CASE(UIMSG_PlayerCreationClickReset) | |
7822 CASE(UIMSG_AutonotesBook) | |
7823 CASE(UIMSG_PlayerCreationRemoveUpSkill) | |
7824 CASE(UIMSG_PlayerCreationRemoveDownSkill) | |
7825 CASE(UIMSG_SPellbook_ShowHightlightedSpellInfo) | |
7826 CASE(UIMSG_LoadGame) | |
7827 CASE(UIMSG_SaveGame) | |
7828 CASE(UIMSG_ShowStatus_DateTime) | |
7829 CASE(UIMSG_ShowStatus_ManaHP) | |
7830 CASE(UIMSG_ShowStatus_Player) | |
7831 CASE(UIMSG_Wait5Minutes) | |
7832 CASE(UIMSG_Wait1Hour) | |
7833 CASE(UIMSG_ShowStatus_Food) | |
7834 CASE(UIMSG_ShowStatus_Funds) | |
7835 CASE(UIMSG_QuickReference) | |
7836 CASE(UIMSG_GameMenuButton) | |
7837 CASE(UIMSG_AlreadyResting) | |
7838 CASE(UIMSG_SelectCharacter) | |
7839 CASE(UIMSG_ChangeSoundVolume) | |
7840 CASE(UIMSG_ChangeMusicVolume) | |
7841 CASE(UIMSG_Escape) | |
7842 CASE(UIMSG_PlayerCreation_SelectAttribute) | |
7843 CASE(UIMSG_InventoryLeftClick) | |
7844 CASE(UIMSG_SkillUp) | |
7845 CASE(UIMSG_GameMenu_ReturnToGame) | |
7846 CASE(UIMSG_StartNewGame) | |
7847 CASE(UIMSG_Game_OpenLoadGameDialog) | |
7848 CASE(UIMSG_Game_OpenSaveGameDialog) | |
7849 CASE(UIMSG_Game_OpenOptionsDialog) | |
7850 CASE(UIMSG_SetGraphicsMode) | |
7851 CASE(UIMSG_Quit) | |
7852 CASE(UIMSG_StartHireling1Dialogue) | |
7853 CASE(UIMSG_StartHireling2Dialogue) | |
7854 CASE(UIMSG_SelectDialogueOption) | |
7855 CASE(UIMSG_CastSpellFromBook) | |
7856 CASE(UIMSG_PlayerCreation_VoicePrev) | |
7857 CASE(UIMSG_PlayerCreation_VoiceNext) | |
7858 CASE(UIMSG_StartNPCDialogue) | |
7859 CASE(UIMSG_ArrowUp) | |
7860 CASE(UIMSG_DownArrow) | |
7861 CASE(UIMSG_LoadSlot) | |
7862 CASE(UIMSG_SelectLoadSlot) | |
7863 CASE(UIMSG_Cancel) | |
7864 CASE(UIMSG_ExitRest) | |
7865 CASE(UIMSG_PlayerCreation_FacePrev) | |
7866 CASE(UIMSG_PlayerCreation_FaceNext) | |
7867 CASE(UIMSG_CycleCharacters) | |
7868 CASE(UIMSG_SetTurnSpeed) | |
7869 CASE(UIMSG_ToggleWalkSound) | |
7870 CASE(UIMSG_ChangeVoiceVolume) | |
7871 CASE(UIMSG_ToggleShowDamage) | |
7872 CASE(UIMSG_ScrollNPCPanel) | |
7873 CASE(UIMSG_ShowFinalWindow) | |
7874 CASE(UIMSG_OpenQuestBook) | |
7875 CASE(UIMSG_OpenAutonotes) | |
7876 CASE(UIMSG_OpenMapBook) | |
7877 CASE(UIMSG_OpenCalendar) | |
7878 CASE(UIMSG_OpenHistoryBook) | |
7879 CASE(UIMSG_ToggleAlwaysRun) | |
7880 CASE(UIMSG_ToggleFlipOnExit) | |
7881 CASE(UIMSG_Game_Action) | |
7882 CASE(UIMSG_OpenRestUI) | |
7883 CASE(UIMSG_TransitionUI_Confirm) | |
7884 CASE(UIMSG_OpenKeyMappingOptions) | |
7885 CASE(UIMSG_SelectKeyPage1) | |
7886 CASE(UIMSG_SelectKeyPage2) | |
7887 CASE(UIMSG_ResetKeyMapping) | |
7888 CASE(UIMSG_ChangeKeyButton) | |
7889 CASE(UIMSG_OpenVideoOptions) | |
7890 CASE(UIMSG_ToggleBloodsplats) | |
7891 CASE(UIMSG_ToggleColoredLights) | |
7892 CASE(UIMSG_ToggleTint) | |
7893 default: | |
7894 _swprintf(b, L"UIMSG_%03X", msg); return b; | |
7895 }; | |
7896 #undef CASE | |
7897 } | |
7898 | |
7899 | |
0 | 7900 //----- (0042EB8D) -------------------------------------------------------- |
437 | 7901 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |
0 | 7902 { |
437 | 7903 Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); |
0 | 7904 if (uNumMessages < 40) |
7905 { | |
437 | 7906 files[uNumMessages] = file; |
7907 lines[uNumMessages] = line; | |
7908 | |
0 | 7909 pMessages[uNumMessages].eType = msg; |
7910 pMessages[uNumMessages].param = param; | |
7911 pMessages[uNumMessages++].field_8 = a4; | |
7912 } | |
7913 } | |
7914 | |
7915 //----- (0042EBBE) -------------------------------------------------------- | |
7916 int __fastcall sub_42EBBE(int a1, int a2) | |
7917 { | |
7918 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7919 } | |
7920 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7921 | |
7922 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 7923 int stru193_math::Sin(int angle) |
0 | 7924 { |
323 | 7925 return Cos(angle - this->uIntegerHalfPi); |
0 | 7926 } |
7927 | |
7928 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 7929 void _42ECB5_PlayerAttacksActor() |
0 | 7930 { |
271 | 7931 //unsigned int v0; // ebx@1 |
7932 //Player *v1; // esi@1 | |
7933 //bool result; // eax@1 | |
295 | 7934 //int v3; // edi@2 |
271 | 7935 //unsigned int v4; // eax@7 |
0 | 7936 char *v5; // eax@8 |
271 | 7937 //int v6; // ecx@9 |
7938 //signed int v7; // eax@16 | |
295 | 7939 //Actor *v8; // edi@20 |
0 | 7940 unsigned int v9; // ecx@21 |
295 | 7941 //char *v10; // eax@26 |
0 | 7942 char *v11; // eax@26 |
7943 unsigned int v12; // eax@47 | |
295 | 7944 //char *v13; // eax@47 |
7945 //char *v14; // eax@47 | |
7946 //unsigned int v15; // ebx@54 | |
7947 //int v16; // [sp-10h] [bp-4Ch]@24 | |
7948 //int v17; // [sp-10h] [bp-4Ch]@44 | |
7949 //unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7950 //unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7951 //__int16 v20; // [sp-8h] [bp-44h]@24 | |
7952 //__int16 v21; // [sp-8h] [bp-44h]@44 | |
7953 //int v22; // [sp-4h] [bp-40h]@24 | |
7954 //int v23; // [sp-4h] [bp-40h]@44 | |
0 | 7955 SoundID v24; // [sp-4h] [bp-40h]@58 |
295 | 7956 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 |
271 | 7957 //unsigned int a2; // [sp+18h] [bp-24h]@20 |
7958 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
295 | 7959 //int v28; // [sp+20h] [bp-1Ch]@9 |
271 | 7960 //unsigned int *v28b; |
295 | 7961 //int v29; // [sp+24h] [bp-18h]@16 |
7962 //int v30; // [sp+28h] [bp-14h]@16 | |
271 | 7963 //int v31; // [sp+2Ch] [bp-10h]@4 |
295 | 7964 //int v32; // [sp+30h] [bp-Ch]@7 |
271 | 7965 //int v33; // [sp+34h] [bp-8h]@7 |
295 | 7966 //int v34; // [sp+38h] [bp-4h]@17 |
0 | 7967 |
271 | 7968 //v0 = uActiveCharacter; |
7969 //v27 = 6972 * uActiveCharacter; | |
7970 //v1 = &pParty->pPlayers[uActiveCharacter-1]; | |
7971 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); | |
7972 auto player = &pParty->pPlayers[uActiveCharacter - 1]; | |
7973 if (!player->CanAct()) | |
7974 return; | |
7975 | |
7976 pStru277->_427D48(uActiveCharacter); | |
295 | 7977 //v3 = 0; |
271 | 7978 if (pParty->Invisible()) |
7979 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
7980 | |
7981 //v31 = player->pEquipment.uBow; | |
7982 int bow_idx = player->pEquipment.uBow; | |
7983 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) | |
7984 bow_idx = 0; | |
7985 | |
295 | 7986 //v32 = 0; |
7987 int wand_item_id = 0; | |
271 | 7988 //v33 = 0; |
7989 //v4 = v1->pEquipment.uMainHand; | |
7990 int laser_weapon_item_id = 0; | |
7991 | |
7992 int main_hand_idx = player->pEquipment.uMainHand; | |
7993 if (main_hand_idx) | |
0 | 7994 { |
271 | 7995 auto item = &player->pInventoryItems[main_hand_idx - 1]; |
112 | 7996 //v5 = (char *)v1 + 36 * v4; |
271 | 7997 if (!item->Broken()) |
7998 { | |
7999 //v28b = &v1->pInventoryItems[v4].uItemID; | |
8000 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
295 | 8001 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND) |
0 | 8002 { |
295 | 8003 if (item->uNumCharges <= 0) |
8004 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 8005 else |
295 | 8006 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 8007 } |
271 | 8008 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
8009 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 8010 } |
271 | 8011 } |
8012 | |
295 | 8013 //v30 = 0; |
8014 //v29 = 0; | |
8015 //v28 = 0; | |
271 | 8016 //v7 = pMouse->uPointingObjectID; |
8017 | |
8018 int target_pid = pMouse->uPointingObjectID; | |
8019 int target_type = target_pid & 7, | |
8020 target_id = target_pid >> 3; | |
8021 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) | |
8022 { | |
8023 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
8024 target_type = target_pid & 7; | |
8025 target_id = target_pid >> 3; | |
8026 } | |
295 | 8027 |
8028 auto actor = &pActors[target_id]; | |
8029 int actor_distance = 0; | |
271 | 8030 if (target_type == OBJECT_Actor) |
8031 { | |
295 | 8032 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
8033 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
8034 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
8035 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
8036 if (actor_distance < 0) | |
8037 actor_distance = 0; | |
8038 } | |
8039 | |
8040 bool shooting_bow = false, | |
8041 shotting_laser = false, | |
8042 shooting_wand = false; | |
8043 if (laser_weapon_item_id) | |
8044 { | |
8045 shotting_laser = true; | |
8046 _42777D_CastSpell_UseWand_ShootArrow(102, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); | |
8047 } | |
8048 else if (wand_item_id) | |
8049 { | |
8050 shooting_wand = true; | |
8051 | |
8052 int main_hand_idx = player->pEquipment.uMainHand; | |
8053 _42777D_CastSpell_UseWand_ShootArrow(*((int *)&pSpellDatas[66].field_8 + player->pInventoryItems[main_hand_idx - 1].uItemID), uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); | |
8054 | |
8055 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | |
8056 player->pEquipment.uMainHand = 0; | |
8057 } | |
303 | 8058 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 8059 { |
303 | 8060 Vec3_int_ a3; |
8061 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
8062 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
8063 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
8064 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
8065 | |
8066 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); | |
305 | 8067 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) |
295 | 8068 _42FA66_do_explosive_impact( |
8069 actor->vPosition.x, | |
8070 actor->vPosition.y, | |
8071 actor->vPosition.z + actor->uActorHeight / 2, | |
8072 0, 512, uActiveCharacter); | |
303 | 8073 } |
8074 else if (bow_idx) | |
8075 { | |
8076 shooting_bow = true; | |
8077 _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); | |
295 | 8078 } |
8079 else | |
8080 { | |
303 | 8081 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
8082 } | |
8083 | |
8084 if (!pParty->bTurnBasedModeOn) | |
8085 { | |
8086 int recovery = player->GetAttackRecoveryTime(0); | |
8087 if (recovery < 30 ) | |
8088 recovery = 30; | |
8089 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); | |
295 | 8090 } |
8091 | |
8092 | |
8093 int v34 = 0; | |
8094 if (shooting_wand) | |
8095 return; | |
8096 else if (shooting_bow) | |
8097 { | |
8098 v34 = 5; | |
8099 player->PlaySound(SPEECH_50, 0); | |
8100 } | |
8101 if (shotting_laser) | |
8102 v34 = 7; | |
8103 else | |
8104 { | |
8105 int main_hand_idx = player->pEquipment.uMainHand; | |
8106 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) | |
8107 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType; | |
8108 pTurnEngine->_40471C(); | |
8109 } | |
8110 | |
8111 switch (v34) | |
8112 { | |
8113 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
8114 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
8115 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
8116 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
8117 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
8118 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
8119 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
8120 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
8121 } | |
0 | 8122 } |
8123 | |
8124 //----- (0042F184) -------------------------------------------------------- | |
295 | 8125 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 8126 { |
8127 int v4; // edi@1 | |
8128 stru319 *v5; // esi@1 | |
8129 int v6; // eax@2 | |
8130 int v7; // eax@4 | |
8131 int result; // eax@5 | |
8132 int *v9; // edx@8 | |
8133 signed int v10; // ebx@10 | |
8134 int v11; // edi@11 | |
8135 Actor *v12; // esi@12 | |
8136 unsigned __int16 v13; // ax@12 | |
8137 int v14; // eax@22 | |
8138 char v15; // zf@30 | |
8139 int v16; // esi@32 | |
8140 int v17; // ecx@34 | |
8141 stru319 *v18; // eax@39 | |
8142 int v19; // edx@39 | |
8143 int v20; // ecx@41 | |
8144 unsigned __int16 v21; // ax@42 | |
8145 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
8146 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
8147 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
8148 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
8149 int *v26; // [sp+18h] [bp-14h]@8 | |
8150 int v27; // [sp+1Ch] [bp-10h]@10 | |
8151 int *v28; // [sp+20h] [bp-Ch]@10 | |
8152 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
8153 int v30; // [sp+28h] [bp-4h]@6 | |
8154 int i; // [sp+38h] [bp+Ch]@33 | |
8155 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
8156 | |
8157 v4 = 0; | |
8158 v5 = this; | |
8159 v24 = this; | |
8160 if ( pRenderer->pRenderD3D ) | |
8161 { | |
8162 v6 = a3 != 0; | |
8163 if ( a4 ) | |
8164 LOBYTE(v6) = v6 | 8; | |
295 | 8165 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 8166 if ( v7 != -1 ) |
8167 return (unsigned __int16)v7; | |
295 | 8168 else return 0; |
0 | 8169 } |
8170 else | |
8171 { | |
8172 v30 = 0; | |
8173 if ( pRenderer->pActiveZBuffer ) | |
8174 { | |
8175 v29 = viewparams->uScreenX; | |
8176 v23 = viewparams->uScreenZ; | |
8177 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
8178 { | |
8179 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
8180 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8181 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8182 do | |
8183 { | |
8184 if ( (signed int)v29 < (signed int)v23 ) | |
8185 { | |
8186 v28 = v9; | |
8187 v10 = v4; | |
8188 v27 = v23 - v29; | |
8189 do | |
8190 { | |
8191 v22 = *v28; | |
8192 v11 = *v28 & 0xFFFF; | |
141 | 8193 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 8194 { |
8195 v12 = &pActors[(unsigned int)v11 >> 3]; | |
8196 v13 = v12->uAIState; | |
8197 if ( v13 != 5 ) | |
8198 { | |
8199 if ( v13 != 4 | |
8200 && v13 != 11 | |
8201 && v13 != 19 | |
8202 && v13 != 17 | |
8203 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
8204 { | |
8205 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
295 | 8206 && v22 <= pick_depth << 16 ) |
0 | 8207 { |
8208 v14 = 0; | |
8209 if ( v10 > 0 ) | |
8210 { | |
8211 do | |
8212 { | |
8213 if ( dword_50BDA0[v14] == v11 ) | |
8214 break; | |
8215 ++v14; | |
8216 } | |
8217 while ( v14 < v30 ); | |
8218 } | |
8219 if ( v14 == v30 && v10 < 100 ) | |
8220 { | |
8221 ++v30; | |
8222 dword_50BC10[v10] = v22; | |
8223 dword_50BDA0[v10] = v11; | |
8224 ++v10; | |
8225 } | |
8226 } | |
8227 } | |
8228 } | |
8229 } | |
8230 ++v28; | |
8231 --v27; | |
8232 } | |
8233 while ( v27 ); | |
8234 v4 = v30; | |
8235 v5 = v24; | |
8236 } | |
8237 v9 = v26 + 640; | |
8238 v15 = v25-- == 1; | |
8239 v26 += 640; | |
8240 } | |
8241 while ( !v15 ); | |
8242 } | |
8243 if ( v4 > 0 ) | |
8244 { | |
8245 v32 = 1; | |
8246 v16 = (int)dword_50BC10; | |
8247 do | |
8248 { | |
8249 for ( i = v32; i < v4; ++i ) | |
8250 { | |
8251 v17 = dword_50BC10[i]; | |
8252 if ( v17 < *(int *)v16 ) | |
8253 { | |
8254 dword_50BC10[i] = *(int *)v16; | |
8255 *(int *)v16 = v17; | |
8256 } | |
8257 } | |
8258 ++v32; | |
8259 v16 += 4; | |
8260 } | |
8261 while ( v32 - 1 < v4 ); | |
8262 v5 = v24; | |
8263 if ( v4 > 0 ) | |
8264 { | |
8265 v18 = v24; | |
8266 v19 = v4; | |
8267 do | |
8268 { | |
8269 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
8270 v18 += 4; | |
8271 --v19; | |
8272 } | |
8273 while ( v19 ); | |
8274 } | |
8275 } | |
8276 v20 = 0; | |
8277 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
8278 { | |
8279 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8280 if ( v21 != 4 && v21 != 5 ) | |
8281 break; | |
8282 } | |
8283 if ( v20 != v4 ) | |
8284 { | |
8285 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8286 LOBYTE(result) = result | 3; | |
8287 return result; | |
8288 } | |
8289 } | |
8290 } | |
8291 return 0; | |
8292 } | |
8293 | |
8294 | |
8295 //----- (0042F3D6) -------------------------------------------------------- | |
8296 void InitializeTurnBasedAnimations(void *_this) | |
8297 { | |
8298 unsigned int *v1; // edi@1 | |
8299 | |
8300 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8301 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8302 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8303 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8304 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8305 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8306 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8307 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8308 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8309 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8310 v1 = pIconIDs_Turn; | |
8311 do | |
8312 { | |
8313 pIconsFrameTable->InitializeAnimation(*v1); | |
8314 ++v1; | |
8315 } | |
8316 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8317 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8318 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8319 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8320 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8321 } | |
8322 | |
8323 //----- (0042F4DA) -------------------------------------------------------- | |
8324 signed int __cdecl sub_42F4DA() | |
8325 { | |
8326 signed int v0; // edi@1 | |
82 | 8327 Actor *v1; // esi@4 |
0 | 8328 int v2; // ebx@5 |
8329 int v3; // eax@5 | |
8330 int v4; // ebx@5 | |
8331 unsigned int v5; // ecx@5 | |
8332 int v6; // edx@6 | |
8333 unsigned int v7; // edx@8 | |
8334 unsigned int v8; // edx@10 | |
8335 __int16 v9; // ax@12 | |
8336 signed int result; // eax@20 | |
8337 int v11; // [sp+Ch] [bp-10h]@5 | |
8338 int v12; // [sp+10h] [bp-Ch]@5 | |
8339 signed int v13; // [sp+14h] [bp-8h]@3 | |
8340 | |
8341 v0 = 5120; | |
8342 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8343 v0 = 2560; | |
8344 v13 = 0; | |
8345 if ( (signed int)uNumActors <= 0 ) | |
8346 { | |
8347 LABEL_20: | |
8348 result = 0; | |
8349 } | |
8350 else | |
8351 { | |
82 | 8352 v1 = pActors; |
0 | 8353 while ( 1 ) |
8354 { | |
82 | 8355 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8356 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8357 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8358 v3 = v2; |
8359 v4 = v11; | |
8360 v5 = v12; | |
8361 if ( v3 < v11 ) | |
8362 { | |
8363 v6 = v3; | |
8364 v3 = v11; | |
8365 v4 = v6; | |
8366 } | |
8367 if ( v3 < v12 ) | |
8368 { | |
8369 v7 = v3; | |
8370 v3 = v12; | |
8371 v5 = v7; | |
8372 } | |
8373 if ( v4 < (signed int)v5 ) | |
8374 { | |
8375 v8 = v5; | |
8376 v5 = v4; | |
8377 v4 = v8; | |
8378 } | |
8379 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8380 { | |
82 | 8381 v9 = v1->uAIState; |
8382 if ( v1->uAIState != 5 ) | |
0 | 8383 { |
8384 if ( v9 != 4 | |
8385 && v9 != 11 | |
8386 && v9 != 19 | |
8387 && v9 != 17 | |
82 | 8388 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8389 break; |
8390 } | |
8391 } | |
8392 ++v13; | |
82 | 8393 ++v1; |
0 | 8394 if ( v13 >= (signed int)uNumActors ) |
8395 goto LABEL_20; | |
8396 } | |
8397 result = 1; | |
8398 } | |
8399 return result; | |
8400 } | |
8401 | |
8402 //----- (0042F5ED) -------------------------------------------------------- | |
8403 int LayingItem::Create(int yaw, int pitch, int a4, int a5) | |
8404 { | |
8405 LayingItem *v5; // eax@1 | |
8406 signed int v6; // ebx@2 | |
8407 char *v7; // ecx@2 | |
8408 signed int result; // eax@6 | |
8409 LayingItem *v9; // ebx@7 | |
8410 int v10; // edx@11 | |
8411 int v11; // edi@18 | |
8412 __int16 v12; // ax@18 | |
8413 int v13; // ST2C_4@20 | |
8414 int v14; // eax@20 | |
8415 int v15; // [sp-28h] [bp-38h]@14 | |
8416 int v16; // [sp-24h] [bp-34h]@11 | |
8417 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 | |
8418 int *v18; // [sp-14h] [bp-24h]@11 | |
8419 int *v19; // [sp-10h] [bp-20h]@11 | |
8420 int *v20; // [sp-Ch] [bp-1Ch]@11 | |
8421 signed int v21; // [sp+8h] [bp-8h]@2 | |
8422 int angle; // [sp+Ch] [bp-4h]@1 | |
8423 int a4a; // [sp+1Ch] [bp+Ch]@20 | |
8424 int a4b; // [sp+1Ch] [bp+Ch]@20 | |
8425 int a5a; // [sp+20h] [bp+10h]@20 | |
8426 | |
8427 auto a1 = this; | |
8428 angle = yaw; | |
8429 v5 = a1; | |
8430 if ( !a1->uObjectDescID ) | |
8431 return -1; | |
8432 v6 = 0; | |
8433 v7 = (char *)&pLayingItems[0].uObjectDescID; | |
8434 v21 = 0; | |
8435 do | |
8436 { | |
8437 if ( !*(short *)v7 ) | |
8438 break; | |
8439 v7 += 112; | |
8440 ++v6; | |
8441 v21 = v6; | |
8442 } | |
8443 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) ); | |
8444 if ( v6 >= 1000 ) | |
8445 return -1; | |
8446 *(int *)&v5->field_62[2] = v5->vPosition.x; | |
8447 *(int *)&v5->field_62[6] = v5->vPosition.y; | |
8448 v9 = &pLayingItems[v6]; | |
8449 *(int *)&v5->field_62[10] = v5->vPosition.z; | |
8450 memcpy(v9, v5, 0x70u); | |
8451 if ( a5 == 1 ) | |
8452 { | |
8453 v20 = &v9->vPosition.z; | |
8454 v19 = &v9->vPosition.y; | |
8455 v18 = (int *)&v9->vPosition; | |
8456 v17.z = v5->vPosition.z; | |
8457 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8458 v16 = 0; | |
8459 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8460 goto LABEL_16; | |
8461 } | |
8462 if ( a5 == 2 ) | |
8463 { | |
8464 v20 = &v9->vPosition.z; | |
8465 v19 = &v9->vPosition.y; | |
8466 v18 = (int *)&v9->vPosition; | |
8467 v17.z = v5->vPosition.z; | |
8468 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8469 v16 = 0; | |
8470 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8471 goto LABEL_14; | |
8472 } | |
8473 if ( a5 == 3 ) | |
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_14: | |
8483 v15 = 8; | |
8484 LABEL_17: | |
8485 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20); | |
8486 goto LABEL_18; | |
8487 } | |
8488 if ( a5 == 4 ) | |
8489 { | |
8490 v20 = &v9->vPosition.z; | |
8491 v19 = &v9->vPosition.y; | |
8492 v18 = (int *)&v9->vPosition; | |
8493 v17.z = v5->vPosition.z; | |
8494 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8495 v16 = 0; | |
8496 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8497 LABEL_16: | |
8498 v15 = 24; | |
8499 goto LABEL_17; | |
8500 } | |
8501 LABEL_18: | |
8502 v11 = a4; | |
8503 v12 = 0; | |
8504 if ( a4 ) | |
8505 { | |
323 | 8506 a4a = stru_5C6E00->Cos(angle); |
8507 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8508 a4b = stru_5C6E00->Sin(angle); | |
8509 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8510 v14 = stru_5C6E00->Sin(pitch); | |
0 | 8511 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16; |
8512 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16; | |
8513 v12 = (unsigned int)(v14 * v11) >> 16; | |
8514 } | |
8515 else | |
8516 { | |
8517 v9->vVelocity.y = 0; | |
8518 v9->vVelocity.x = 0; | |
8519 } | |
8520 v9->vVelocity.z = v12; | |
8521 result = v21; | |
8522 if ( v21 >= (signed int)uNumLayingItems ) | |
8523 uNumLayingItems = v21 + 1; | |
8524 return result; | |
8525 } | |
8526 | |
8527 //----- (0042F7EB) -------------------------------------------------------- | |
8528 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) | |
8529 { | |
8530 unsigned int v9; // edi@1 | |
8531 signed int v10; // edx@3 | |
8532 char *v11; // ecx@4 | |
8533 unsigned __int16 v12; // ax@7 | |
8534 unsigned int v13; // edx@9 | |
8535 char *v14; // ecx@10 | |
8536 int v15; // esi@17 | |
8537 int v16; // eax@18 | |
8538 int v17; // edi@20 | |
8539 int v18; // esi@20 | |
8540 //LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8541 int v21; // [sp+7Ch] [bp-8h]@1 | |
8542 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8543 | |
8544 v9 = uSpriteID; | |
8545 v21 = x; | |
8546 v22 = uSpriteID; | |
8547 | |
8548 LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8549 //LayingItem::LayingItem(&a1a); | |
8550 a1a.stru_24.Reset(); | |
8551 | |
8552 if ( a9 ) | |
8553 { | |
8554 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8555 v9 = v22; | |
8556 } | |
8557 v10 = 0; | |
8558 a1a.field_50 = 0; | |
8559 a1a.field_4C = 0; | |
8560 a1a.field_48 = 0; | |
8561 a1a.field_54 = 0; | |
8562 a1a.uItemType = v9; | |
8563 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8564 { | |
8565 LABEL_7: | |
8566 v12 = 0; | |
8567 } | |
8568 else | |
8569 { | |
8570 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8571 while ( (short)v9 != *(short *)v11 ) | |
8572 { | |
8573 ++v10; | |
8574 v11 += 56; | |
8575 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8576 goto LABEL_7; | |
8577 } | |
8578 v12 = v10; | |
8579 } | |
8580 a1a.uObjectDescID = v12; | |
8581 a1a.vPosition.z = z; | |
8582 a1a.vPosition.x = v21; | |
8583 a1a.vPosition.y = y; | |
8584 a1a.uSoundID = 0; | |
8585 a1a.uAttributes = attributes; | |
8586 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8587 a1a.uSpriteFrameID = 0; | |
303 | 8588 a1a.field_58_pid = 0; |
0 | 8589 a1a.field_5C = 0; |
8590 if ( !(a1a.uAttributes & 0x10) ) | |
8591 { | |
8592 v13 = 0; | |
222 | 8593 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
0 | 8594 { |
8595 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8596 while ( *(short *)v14 != v9 ) | |
8597 { | |
8598 ++v13; | |
8599 v14 += 48; | |
222 | 8600 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount ) |
0 | 8601 goto LABEL_16; |
8602 } | |
8603 a1a.stru_24.uItemID = v13; | |
8604 } | |
8605 } | |
8606 LABEL_16: | |
8607 if ( a7 ) | |
8608 { | |
8609 v15 = count; | |
8610 if ( count > 0 ) | |
8611 { | |
8612 do | |
8613 { | |
8614 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8615 v16 = rand(); | |
8616 a1a.Create( | |
8617 (signed __int16)a1a.uFacing, | |
8618 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8619 a4, | |
8620 0); | |
8621 --v15; | |
8622 } | |
8623 while ( v15 ); | |
8624 } | |
8625 } | |
8626 else | |
8627 { | |
8628 v17 = count; | |
8629 v18 = stru_5C6E00->uIntegerHalfPi; | |
8630 a1a.uFacing = 0; | |
8631 if ( count > 0 ) | |
8632 { | |
8633 do | |
8634 { | |
8635 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8636 --v17; | |
8637 } | |
8638 while ( v17 ); | |
8639 } | |
8640 } | |
8641 return 1; | |
8642 } | |
8643 | |
8644 //----- (0042F960) -------------------------------------------------------- | |
8645 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8646 { | |
8647 int v3; // ebx@1 | |
8648 int v4; // edi@1 | |
8649 signed int v5; // edx@1 | |
8650 char *v6; // ecx@2 | |
8651 unsigned __int16 v7; // ax@5 | |
8652 signed int v8; // eax@6 | |
8653 signed int v9; // eax@7 | |
8654 //LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8655 | |
8656 v3 = x; | |
8657 v4 = y; | |
8658 | |
8659 LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8660 //LayingItem::LayingItem(&a1); | |
8661 a1.stru_24.Reset(); | |
8662 | |
8663 v5 = 0; | |
8664 a1.field_50 = 0; | |
8665 a1.field_4C = 0; | |
8666 a1.field_48 = 0; | |
8667 a1.field_54 = 0; | |
8668 a1.uItemType = 800; | |
8669 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8670 { | |
8671 LABEL_5: | |
8672 v7 = 0; | |
8673 } | |
8674 else | |
8675 { | |
8676 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8677 while ( *(short *)v6 != 800 ) | |
8678 { | |
8679 ++v5; | |
8680 v6 += 56; | |
8681 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8682 goto LABEL_5; | |
8683 } | |
8684 v7 = v5; | |
8685 } | |
8686 a1.uObjectDescID = v7; | |
8687 a1.vPosition.x = v3; | |
8688 a1.vPosition.y = v4; | |
8689 a1.vPosition.z = z; | |
8690 a1.uSoundID = 0; | |
8691 a1.uAttributes = 0; | |
8692 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8693 a1.uSpriteFrameID = 0; | |
303 | 8694 a1.field_58_pid = 0; |
0 | 8695 a1.field_5C = 0; |
8696 v8 = a1.Create(0, 0, 0, 0); | |
8697 if ( v8 != -1 ) | |
8698 { | |
8699 v9 = 8 * v8; | |
8700 LOBYTE(v9) = v9 | 2; | |
8701 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8702 } | |
8703 } | |
8704 | |
8705 //----- (0042FA22) -------------------------------------------------------- | |
79 | 8706 LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8707 { |
8708 size_t v0; // edx@1 | |
8709 int v1; // ebp@1 | |
79 | 8710 LayingItem *result; // eax@1 |
8711 LayingItem *v3; // ebx@1 | |
0 | 8712 |
8713 v0 = 0; | |
8714 v1 = 0; | |
79 | 8715 //result = (char *)&pLayingItems[0].uObjectDescID; |
8716 result = pLayingItems; | |
0 | 8717 v3 = pLayingItems; |
8718 do | |
8719 { | |
79 | 8720 if ( result->uObjectDescID ) |
0 | 8721 { |
8722 if ( v1 != v0 ) | |
8723 { | |
79 | 8724 memcpy(v3, result, 0x70u); |
8725 result->uObjectDescID = 0; | |
0 | 8726 } |
8727 ++v0; | |
79 | 8728 ++v3;// = (char *)v3 + 112; |
0 | 8729 } |
79 | 8730 ++result;// += 112; |
0 | 8731 ++v1; |
8732 } | |
79 | 8733 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); |
8734 while( result <= &pLayingItems[999] ); | |
0 | 8735 uNumLayingItems = v0; |
8736 return result; | |
8737 } | |
8738 | |
8739 //----- (0042FA66) -------------------------------------------------------- | |
8740 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8741 { | |
8742 int v6; // edi@1 | |
8743 int v7; // esi@1 | |
8744 char *v8; // ecx@2 | |
8745 unsigned __int16 v9; // ax@5 | |
8746 int v10; // eax@10 | |
8747 signed int result; // eax@11 | |
8748 __int16 v12; // ax@12 | |
8749 //LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8750 int v14; // [sp+7Ch] [bp-4h]@1 | |
8751 | |
8752 v6 = a1; | |
8753 v7 = a2; | |
8754 LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8755 //LayingItem::LayingItem(&a1a); | |
8756 a1a.uItemType = 600; | |
8757 a1a.stru_24.Reset(); | |
8758 | |
8759 a1a.field_48 = 6; | |
8760 a1a.field_4C = 8; | |
8761 a1a.field_50 = 3; | |
8762 v14 = 0; | |
8763 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8764 { | |
8765 LABEL_5: | |
8766 v9 = 0; | |
8767 } | |
8768 else | |
8769 { | |
8770 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
8771 while ( (short)a1a.uItemType != *(short *)v8 ) | |
8772 { | |
8773 ++v14; | |
8774 v8 += 56; | |
8775 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8776 goto LABEL_5; | |
8777 } | |
8778 v9 = v14; | |
8779 } | |
8780 a1a.uObjectDescID = v9; | |
8781 a1a.vPosition.x = v6; | |
8782 a1a.vPosition.y = v7; | |
8783 a1a.vPosition.z = a3; | |
8784 a1a.uAttributes = 0; | |
8785 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8786 a1a.uSpriteFrameID = 0; | |
8787 a1a.field_5C = 0; | |
8788 a1a.field_60_distance_related_prolly_lod = 0; | |
8789 a1a.uFacing = 0; | |
8790 a1a.uSoundID = 0; | |
8791 if ( a6 >= 1 || a6 <= 4 ) | |
8792 { | |
8793 v10 = 8 * a6 - 8; | |
303 | 8794 LOBYTE(v10) = v10 | OBJECT_Player; |
8795 a1a.field_58_pid = v10; | |
0 | 8796 } |
8797 else | |
8798 { | |
303 | 8799 a1a.field_58_pid = 0; |
0 | 8800 } |
8801 result = a1a.Create(0, 0, 0, 0); | |
8802 if ( result != -1 ) | |
8803 { | |
8804 v12 = 8 * result; | |
8805 LOBYTE(v12) = v12 | 2; | |
8806 result = stru_50FE08.Add( | |
8807 v12, | |
8808 a5, | |
8809 SLOWORD(a1a.vPosition.x), | |
8810 SLOWORD(a1a.vPosition.y), | |
8811 SLOWORD(a1a.vPosition.z), | |
8812 0, | |
8813 0); | |
8814 } | |
8815 return result; | |
8816 } | |
8817 | |
8818 | |
8819 | |
8820 //----- (0042FB5C) -------------------------------------------------------- | |
8821 bool __fastcall sub_42FB5C(signed int a1) | |
8822 { | |
8823 int v1; // ecx@3 | |
8824 int v2; // ecx@4 | |
8825 int v3; // ecx@5 | |
8826 int v4; // ecx@6 | |
8827 int v5; // ecx@7 | |
8828 int v6; // ecx@8 | |
8829 char v7; // zf@9 | |
8830 | |
8831 if ( a1 > 39 ) | |
8832 { | |
8833 if ( a1 > 77 ) | |
8834 { | |
8835 if ( a1 == 80 ) | |
8836 return 0; | |
8837 if ( a1 > 84 ) | |
8838 { | |
8839 if ( a1 <= 86 ) | |
8840 return 0; | |
8841 v7 = a1 == 95; | |
8842 goto LABEL_20; | |
8843 } | |
8844 } | |
8845 else | |
8846 { | |
8847 if ( a1 == 77 ) | |
8848 return 0; | |
8849 if ( a1 >= 46 ) | |
8850 { | |
8851 if ( a1 <= 47 || a1 == 51 ) | |
8852 return 0; | |
8853 v7 = a1 == 73; | |
8854 goto LABEL_20; | |
8855 } | |
8856 } | |
8857 return 1; | |
8858 } | |
8859 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8860 return 1; | |
8861 v2 = v1 - 3; | |
8862 if ( !v2 ) | |
8863 return 0; | |
8864 v3 = v2 - 1; | |
8865 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8866 return 1; | |
8867 v5 = v4 - 8; | |
8868 if ( !v5 ) | |
8869 return 0; | |
8870 v6 = v5 - 1; | |
8871 if ( !v6 ) | |
8872 return 1; | |
8873 v7 = v6 == 20; | |
8874 LABEL_20: | |
8875 if ( !v7 ) | |
8876 return 1; | |
8877 return 0; | |
8878 } | |
8879 | |
8880 //----- (0042FBDD) -------------------------------------------------------- | |
8881 void __cdecl sub_42FBDD() | |
8882 { | |
388 | 8883 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 8884 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
8885 pRenderer->Present(); | |
8886 } | |
8887 | |
8888 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8889 void __cdecl CloseWindowBackground() |
0 | 8890 { |
388 | 8891 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 8892 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
8893 pRenderer->Present(); | |
8894 } | |
8895 | |
8896 //----- (0042FC4E) -------------------------------------------------------- | |
8897 void __cdecl ProcessInputActions() | |
8898 { | |
8899 ActionQueue *pActionQueue; // esi@7 | |
8900 Keyboard *v3; // ecx@8 | |
8901 char v4; // al@9 | |
8902 ActionQueue *v5; // ecx@19 | |
8903 Player *v6; // ecx@86 | |
8904 Player *v7; // esi@100 | |
8905 char v8; // bl@100 | |
8906 unsigned __int16 v9; // ax@102 | |
8907 int v10; // eax@103 | |
8908 unsigned int v11; // eax@127 | |
8909 signed int v12; // esi@157 | |
8910 Keyboard *v13; // ecx@158 | |
8911 char v14; // al@159 | |
8912 unsigned int v15; // eax@168 | |
8913 void *v16; // esi@177 | |
8914 int v17; // [sp-14h] [bp-1Ch]@8 | |
8915 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8916 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
271 | 8917 //__int16 v20; // [sp-14h] [bp-1Ch]@60 |
0 | 8918 int v21; // [sp-14h] [bp-1Ch]@68 |
8919 int v22; // [sp-Ch] [bp-14h]@158 | |
8920 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8921 int v24; // [sp+4h] [bp-4h]@87 | |
8922 | |
8923 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8924 auto pKeyboard = pGame->pKeyboardInstance; | |
8925 if (!bAlwaysRun) | |
8926 { | |
8927 if (pKeyboard->IsShiftHeld()) | |
8928 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8929 else | |
8930 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8931 } | |
8932 else | |
8933 { | |
8934 if (pKeyboard->IsShiftHeld()) | |
8935 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8936 else | |
8937 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8938 } | |
8939 | |
140 | 8940 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
0 | 8941 LABEL_6: |
8942 if ( !pEventTimer->bPaused ) | |
8943 { | |
8944 inputAction = (InputAction)0; | |
8945 pActionQueue = pPartyActionQueue; | |
8946 while ( 1 ) | |
8947 { | |
8948 v3 = pGame->pKeyboardInstance; | |
8949 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8950 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8951 v4 = v3->WasKeyPressed(v17); | |
8952 else | |
8953 v4 = v3->IsKeyBeingHeld(v17); | |
8954 if ( v4 ) | |
8955 { | |
8956 switch ( inputAction ) | |
8957 { | |
8958 case INPUT_MoveForward: | |
271 | 8959 if (pCurrentScreen != SCREEN_GAME) |
0 | 8960 break; |
8961 if (!pParty->bTurnBasedModeOn) | |
163 | 8962 //goto _do_move_forward; |
0 | 8963 { |
8964 v5 = pActionQueue; | |
140 | 8965 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8966 partyAction = PARTY_RunForward; |
8967 else | |
8968 partyAction = PARTY_WalkForward; | |
163 | 8969 //goto _add_action_and_continue; |
8970 v5->Add(partyAction); | |
8971 break; | |
8972 } | |
8973 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8974 { | |
8975 pTurnEngine->uActionPointsLeft -= 26; | |
8976 //_do_move_forward: | |
8977 v5 = pActionQueue; | |
8978 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8979 partyAction = PARTY_RunForward; | |
8980 else | |
8981 partyAction = PARTY_WalkForward; | |
8982 //goto _add_action_and_continue; | |
8983 v5->Add(partyAction); | |
8984 break; | |
0 | 8985 } |
8986 break; | |
8987 case INPUT_MoveBackwards: | |
17 | 8988 //__debugbreak(); |
271 | 8989 if (pCurrentScreen != SCREEN_GAME) |
0 | 8990 break; |
8991 if (!pParty->bTurnBasedModeOn) | |
17 | 8992 //goto _do_move_backwards; |
8993 { | |
8994 v5 = pActionQueue; | |
8995 if ( pParty->uFlags2 & 2 ) | |
8996 partyAction = PARTY_RunBackward; | |
8997 else | |
8998 partyAction = PARTY_WalkBackward; | |
163 | 8999 //goto _add_action_and_continue; |
9000 v5->Add(partyAction); | |
9001 break; | |
17 | 9002 } |
0 | 9003 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
9004 { | |
9005 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9006 //_do_move_backwards: |
0 | 9007 v5 = pActionQueue; |
9008 if ( pParty->uFlags2 & 2 ) | |
9009 partyAction = PARTY_RunBackward; | |
9010 else | |
9011 partyAction = PARTY_WalkBackward; | |
163 | 9012 //goto _add_action_and_continue; |
9013 v5->Add(partyAction); | |
9014 break; | |
0 | 9015 } |
9016 break; | |
9017 case INPUT_StrafeLeft: | |
17 | 9018 //__debugbreak(); |
271 | 9019 if (pCurrentScreen != SCREEN_GAME) |
0 | 9020 break; |
9021 if (!pParty->bTurnBasedModeOn) | |
17 | 9022 //goto _do_strafe_left; |
9023 { | |
9024 partyAction = PARTY_StrafeLeft; | |
163 | 9025 //goto _add_action_and_continue_; |
9026 v5 = pActionQueue; | |
9027 v5->Add(partyAction); | |
9028 break; | |
17 | 9029 } |
0 | 9030 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
9031 break; | |
9032 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9033 //_do_strafe_left: |
0 | 9034 partyAction = PARTY_StrafeLeft; |
163 | 9035 //goto _add_action_and_continue_; |
9036 v5 = pActionQueue; | |
9037 v5->Add(partyAction); | |
9038 break; | |
0 | 9039 case INPUT_StrafeRight: |
17 | 9040 //__debugbreak(); |
271 | 9041 if (pCurrentScreen != SCREEN_GAME) |
0 | 9042 break; |
9043 if (!pParty->bTurnBasedModeOn) | |
17 | 9044 //goto _do_strafe_right; |
9045 { | |
9046 partyAction = PARTY_StrafeRight; | |
163 | 9047 //goto _add_action_and_continue_; |
9048 v5 = pActionQueue; | |
9049 v5->Add(partyAction); | |
9050 break; | |
17 | 9051 } |
0 | 9052 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
9053 break; | |
9054 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9055 //_do_strafe_right: |
0 | 9056 partyAction = PARTY_StrafeRight; |
163 | 9057 //goto _add_action_and_continue_; |
9058 v5 = pActionQueue; | |
9059 v5->Add(partyAction); | |
9060 break; | |
0 | 9061 case INPUT_TurnLeft: |
271 | 9062 if (pCurrentScreen != SCREEN_GAME) |
0 | 9063 break; |
9064 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
9065 { | |
9066 if (pParty->bTurnBasedModeOn) | |
9067 { | |
9068 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9069 break; | |
9070 pTurnEngine->uActionPointsLeft -= 26; | |
9071 } | |
9072 partyAction_ = PARTY_StrafeLeft; | |
9073 } | |
9074 else | |
9075 { | |
9076 if ( pParty->uFlags2 & 2 ) | |
9077 partyAction_ = PARTY_FastTurnLeft; | |
9078 else | |
9079 partyAction_ = PARTY_TurnLeft; | |
9080 } | |
9081 pActionQueue->Add(partyAction_); | |
9082 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9083 { | |
271 | 9084 pWeather->OnPlayerTurn(10); |
0 | 9085 } |
9086 break; | |
9087 case INPUT_TurnRight: | |
271 | 9088 if (pCurrentScreen != SCREEN_GAME) |
0 | 9089 break; |
9090 if ( GetAsyncKeyState(17) ) // strafing | |
9091 { | |
9092 if (pParty->bTurnBasedModeOn) | |
9093 { | |
9094 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9095 break; | |
9096 pTurnEngine->uActionPointsLeft -= 26; | |
9097 } | |
271 | 9098 v21 = PARTY_StrafeRight; |
0 | 9099 } |
9100 else | |
9101 { | |
9102 if ( pParty->uFlags2 & 2 ) | |
271 | 9103 v21 = PARTY_FastTurnRight; |
0 | 9104 else |
271 | 9105 v21 = PARTY_TurnRight; |
0 | 9106 } |
9107 pActionQueue->Add((PartyAction)v21); | |
9108 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9109 { | |
271 | 9110 pWeather->OnPlayerTurn(-10); |
0 | 9111 } |
9112 break; | |
9113 case INPUT_Jump: | |
17 | 9114 //__debugbreak(); |
271 | 9115 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 9116 break; |
9117 partyAction = (PartyAction)12; | |
163 | 9118 //goto _add_action_and_continue_; |
9119 v5 = pActionQueue; | |
9120 v5->Add(partyAction); | |
9121 break; | |
0 | 9122 case INPUT_Yell: |
187 | 9123 if (!pCurrentScreen && uActiveCharacter) |
0 | 9124 { |
9125 pParty->Yell(); | |
187 | 9126 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 9127 } |
187 | 9128 break; |
0 | 9129 case INPUT_Pass: |
17 | 9130 //__debugbreak(); |
0 | 9131 if ( pCurrentScreen ) |
9132 break; | |
9133 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9134 //goto LABEL_118; |
9135 { | |
9136 pTurnEngine->field_18 |= 8u; | |
9137 break; | |
9138 } | |
0 | 9139 if ( uActiveCharacter ) |
9140 { | |
9141 v6 = pPlayers[uActiveCharacter]; | |
9142 if ( !v6->uTimeToRecovery ) | |
9143 { | |
9144 v24 = v6->GetAttackRecoveryTime(0); | |
9145 if ( !pParty->bTurnBasedModeOn ) | |
9146 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
9147 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
9148 pStru277->_427D48(uActiveCharacter); | |
9149 pTurnEngine->_40471C(); | |
9150 } | |
9151 } | |
9152 break; | |
9153 case INPUT_Combat: | |
17 | 9154 //__debugbreak(); |
271 | 9155 if (pCurrentScreen == SCREEN_GAME) |
0 | 9156 { |
9157 if (pParty->bTurnBasedModeOn) | |
9158 { | |
141 | 9159 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 9160 { |
9161 pParty->bTurnBasedModeOn = 0; | |
9162 pTurnEngine->End(true); | |
9163 } | |
9164 } | |
9165 else | |
9166 { | |
9167 pTurnEngine->Start(); | |
9168 pParty->bTurnBasedModeOn = true; | |
9169 } | |
9170 } | |
9171 break; | |
9172 case INPUT_CastReady: | |
17 | 9173 //__debugbreak(); |
271 | 9174 if (pCurrentScreen != SCREEN_GAME) |
0 | 9175 break; |
9176 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9177 //goto LABEL_118; |
9178 { | |
9179 pTurnEngine->field_18 |= 8u; | |
9180 break; | |
9181 } | |
0 | 9182 if ( !uActiveCharacter ) |
9183 break; | |
9184 v7 = pPlayers[uActiveCharacter]; | |
9185 v8 = v7->uQuickSpell; | |
9186 if ( !v8 | |
9187 || bUnderwater | |
9188 || ((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)), | |
9189 v10 > v7->sMana) ) | |
9190 { | |
9191 pActionQueue = pPartyActionQueue; | |
9192 LABEL_120: | |
437 | 9193 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); |
9194 break; | |
9195 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 9196 { |
271 | 9197 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; |
163 | 9198 //goto _send_message; |
9199 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9200 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9201 ++pMessageQueue_50CBD0->uNumMessages; | |
9202 break; | |
437 | 9203 }*/ |
0 | 9204 } |
9205 else | |
9206 { | |
9207 pActionQueue = pPartyActionQueue; | |
9208 if ( dword_50C9E8 < 40 ) | |
9209 { | |
9210 dword_50C9EC[3 * dword_50C9E8] = 25; | |
437 | 9211 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9212 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 9213 ++dword_50C9E8; |
9214 } | |
9215 } | |
9216 break; | |
9217 case INPUT_Attack: | |
17 | 9218 //__debugbreak(); |
271 | 9219 if (pCurrentScreen != SCREEN_GAME) |
0 | 9220 break; |
9221 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
9222 goto LABEL_120; | |
17 | 9223 //LABEL_118: |
0 | 9224 pTurnEngine->field_18 |= 8u; |
9225 break; | |
9226 case INPUT_EventTrigger: | |
271 | 9227 if (pCurrentScreen == SCREEN_GAME) |
0 | 9228 { |
437 | 9229 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 9230 break; |
271 | 9231 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action; |
163 | 9232 //goto _send_message; |
9233 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9234 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9235 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 9236 break;*/ |
9237 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
163 | 9238 break; |
0 | 9239 } |
151 | 9240 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 9241 { |
9242 v11 = pMessageQueue_50CBD0->uNumMessages; | |
9243 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9244 { | |
437 | 9245 v11 = 0; |
9246 pMessageQueue_50CBD0->uNumMessages = 0; | |
0 | 9247 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
9248 { | |
9249 v11 = 1; | |
9250 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 9251 //LABEL_132: |
271 | 9252 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 9253 //_send_message: |
0 | 9254 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9255 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9256 ++pMessageQueue_50CBD0->uNumMessages; | |
9257 break; | |
9258 } | |
437 | 9259 break; |
0 | 9260 } |
437 | 9261 /*if ( (signed int)v11 < 40 ) |
163 | 9262 //goto LABEL_132; |
9263 { | |
271 | 9264 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 9265 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9266 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9267 ++pMessageQueue_50CBD0->uNumMessages; | |
9268 break; | |
437 | 9269 }*/ |
9270 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 9271 } |
9272 break; | |
9273 case INPUT_CharCycle: | |
17 | 9274 //__debugbreak(); |
151 | 9275 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 9276 || dword_50C9E8 >= 40 ) |
9277 break; | |
9278 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 9279 //goto LABEL_155; |
437 | 9280 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9281 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 9282 ++dword_50C9E8; |
9283 break; | |
0 | 9284 case INPUT_LookUp: |
17 | 9285 //__debugbreak(); |
0 | 9286 if ( pEventTimer->bPaused ) |
9287 break; | |
9288 partyAction = (PartyAction)7; | |
163 | 9289 //goto _add_action_and_continue_; |
9290 v5 = pActionQueue; | |
9291 v5->Add(partyAction); | |
9292 break; | |
0 | 9293 case INPUT_CenterView: |
17 | 9294 //__debugbreak(); |
0 | 9295 if ( pEventTimer->bPaused ) |
9296 break; | |
9297 partyAction = (PartyAction)9; | |
163 | 9298 //goto _add_action_and_continue_; |
9299 v5 = pActionQueue; | |
9300 v5->Add(partyAction); | |
9301 break; | |
0 | 9302 case INPUT_LookDown: |
17 | 9303 //__debugbreak(); |
0 | 9304 if ( pEventTimer->bPaused ) |
9305 break; | |
9306 partyAction = (PartyAction)8; | |
163 | 9307 //goto _add_action_and_continue_; |
9308 v5 = pActionQueue; | |
9309 v5->Add(partyAction); | |
9310 break; | |
0 | 9311 case INPUT_FlyUp: |
17 | 9312 //__debugbreak(); |
0 | 9313 if ( pCurrentScreen |
9314 || pEventTimer->bPaused ) | |
9315 break; | |
9316 partyAction = (PartyAction)13; | |
163 | 9317 //goto _add_action_and_continue_; |
9318 v5 = pActionQueue; | |
9319 v5->Add(partyAction); | |
9320 break; | |
0 | 9321 case INPUT_Land: |
17 | 9322 //__debugbreak(); |
0 | 9323 if ( pCurrentScreen |
9324 || pEventTimer->bPaused ) | |
9325 break; | |
9326 partyAction = (PartyAction)15; | |
163 | 9327 //goto _add_action_and_continue_; |
9328 v5 = pActionQueue; | |
9329 v5->Add(partyAction); | |
9330 break; | |
0 | 9331 case INPUT_FlyDown: |
17 | 9332 //__debugbreak(); |
0 | 9333 if ( !pCurrentScreen |
9334 && !pEventTimer->bPaused ) | |
9335 { | |
9336 partyAction = (PartyAction)14; | |
163 | 9337 //_add_action_and_continue_: |
0 | 9338 v5 = pActionQueue; |
163 | 9339 //_add_action_and_continue: |
0 | 9340 v5->Add(partyAction); |
9341 } | |
9342 break; | |
9343 case INPUT_ZoomIn: | |
17 | 9344 //__debugbreak(); |
0 | 9345 if ( dword_50C9E8 >= 40 ) |
9346 break; | |
9347 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 9348 //goto LABEL_155; |
437 | 9349 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9350 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 9351 ++dword_50C9E8; |
9352 break; | |
0 | 9353 case INPUT_ZoomOut: |
17 | 9354 //__debugbreak(); |
0 | 9355 if ( dword_50C9E8 < 40 ) |
9356 { | |
9357 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 9358 //LABEL_155: |
437 | 9359 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9360 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 9361 ++dword_50C9E8; |
9362 } | |
9363 break; | |
9364 case INPUT_AlwaysRun: | |
9365 bAlwaysRun = bAlwaysRun == 0; | |
9366 break; | |
17 | 9367 default: |
9368 //__debugbreak(); | |
9369 break; | |
0 | 9370 } |
9371 } | |
9372 inputAction = (InputAction)((int)inputAction + 1); | |
9373 if ( (signed int)inputAction >= 30 ) | |
9374 goto LABEL_176; | |
9375 } | |
9376 } | |
9377 v12 = 0; | |
9378 do | |
9379 { | |
9380 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
9381 v13 = pGame->pKeyboardInstance; | |
9382 if ( pKeyActionMap->pToggleTypes[v12] ) | |
9383 v14 = v13->WasKeyPressed(v22); | |
9384 else | |
9385 v14 = v13->IsKeyBeingHeld(v22); | |
9386 if ( v14 && v12 == 9 ) | |
9387 { | |
9388 if ( !pCurrentScreen ) | |
9389 { | |
437 | 9390 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 9391 goto LABEL_175; |
9392 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 9393 //goto LABEL_174; |
9394 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9395 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9396 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9397 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
17 | 9398 goto LABEL_175; |
0 | 9399 } |
151 | 9400 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
9401 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 9402 { |
9403 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9404 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9405 { | |
9406 v15 = 0; | |
9407 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9408 { | |
9409 v15 = 1; | |
437 | 9410 pMessageQueue_50CBD0->uNumMessages = 0; |
17 | 9411 //goto LABEL_173; |
437 | 9412 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape; |
17 | 9413 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9414 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9415 ++pMessageQueue_50CBD0->uNumMessages; | |
9416 goto LABEL_175; | |
0 | 9417 } |
9418 pMessageQueue_50CBD0->uNumMessages = 0; | |
9419 } | |
437 | 9420 /*if ( (signed int)v15 >= 40 ) |
0 | 9421 goto LABEL_175; |
17 | 9422 //LABEL_173: |
0 | 9423 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9424 //LABEL_174: |
0 | 9425 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9426 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9427 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9428 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 9429 goto LABEL_175; |
9430 } | |
9431 } | |
9432 LABEL_175: | |
9433 ++v12; | |
9434 } | |
9435 while ( v12 < 30 ); | |
9436 LABEL_176: | |
9437 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9438 { | |
9439 AsyncKeyboard::LeaveCriticalSection(); | |
9440 v16 = pAsyncKeyboard; | |
9441 AsyncKeyboard::EnterCriticalSection(); | |
9442 memset((char *)v16 + 521, 0, 0x100u); | |
9443 AsyncKeyboard::LeaveCriticalSection(); | |
9444 } | |
9445 } | |
9446 |