Mercurial > mm7
annotate mm7_6.cpp @ 423:88c30918eef7
NPC_EventProcessor
author | Gloval |
---|---|
date | Sat, 23 Feb 2013 23:09:48 +0400 |
parents | 111f25d1cc04 |
children | 58b71c1af7d8 |
rev | line source |
---|---|
0 | 1 #include "MM7.h" |
2 | |
3 #include "MapInfo.h" | |
4 #include "Game.h" | |
5 #include "GUIWindow.h" | |
6 #include "GUIFont.h" | |
7 #include "GUIButton.h" | |
8 #include "GUIProgressBar.h" | |
9 #include "Party.h" | |
10 #include "AudioPlayer.h" | |
11 #include "Outdoor.h" | |
12 #include "IndoorCamera.h" | |
13 #include "Overlays.h" | |
14 #include "Monsters.h" | |
15 #include "Arcomage.h" | |
16 #include "LOD.h" | |
17 #include "Actor.h" | |
18 #include "Allocator.h" | |
19 #include "Events.h" | |
20 #include "Viewport.h" | |
21 #include "FrameTableInc.h" | |
22 #include "Math.h" | |
23 #include "LayingItem.h" | |
24 #include "ObjectList.h" | |
25 #include "Chest.h" | |
26 #include "PaletteManager.h" | |
27 #include "DecorationList.h" | |
28 #include "SaveLoad.h" | |
29 #include "stru123.h" | |
30 #include "Time.h" | |
31 #include "IconFrameTable.h" | |
32 #include "stru179.h" | |
33 #include "Awards.h" | |
34 #include "Autonotes.h" | |
35 #include "stru160.h" | |
36 #include "stru279.h" | |
37 #include "TurnEngine.h" | |
38 #include "stru277.h" | |
39 #include "Weather.h" | |
40 #include "stru272.h" | |
41 #include "stru298.h" | |
189 | 42 #include "texts.h" |
0 | 43 #include "StorylineTextTable.h" |
44 #include "Events2D.h" | |
370 | 45 #include "Log.h" |
0 | 46 |
47 #include "mm7_data.h" | |
48 | |
49 | |
50 | |
51 //----- (00424EE0) -------------------------------------------------------- | |
52 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
53 { | |
54 unsigned int v1; // edx@1 | |
55 double v2; // st7@1 | |
56 signed int v3; // edi@1 | |
57 char *v4; // esi@4 | |
58 char *v5; // ecx@4 | |
59 unsigned int v6; // eax@4 | |
60 char *v7; // edx@4 | |
61 double v8; // st6@10 | |
62 double v9; // st5@10 | |
63 double v10; // st6@11 | |
64 unsigned __int8 v11; // c2@15 | |
65 unsigned __int8 v12; // c3@15 | |
66 void *v13; // edi@22 | |
67 char *v14; // eax@22 | |
68 double v15; // st6@22 | |
69 char *v16; // ecx@22 | |
70 signed int result; // eax@24 | |
71 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
72 bool v19; // [sp+Ch] [bp-28h]@6 | |
73 char *v20; // [sp+10h] [bp-24h]@4 | |
74 char *v21; // [sp+14h] [bp-20h]@4 | |
75 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
76 char *v23; // [sp+1Ch] [bp-18h]@4 | |
77 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
78 char *v25; // [sp+24h] [bp-10h]@4 | |
79 char *v26; // [sp+28h] [bp-Ch]@4 | |
80 char *v27; // [sp+2Ch] [bp-8h]@4 | |
81 char *v28; // [sp+30h] [bp-4h]@4 | |
82 | |
83 v1 = uVertexID; | |
84 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
85 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
86 v3 = 0; | |
87 v22 = 0; | |
88 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | |
89 v3 = 1; | |
90 if ( (signed int)(uVertexID + 1) <= 1 ) | |
91 return 0; | |
92 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
93 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
94 v6 = v1; | |
95 v23 = (char *)&array_507D30[0].flt_2C; | |
168 | 96 v26 = (char *)&array_507D30[0]._rhw; |
0 | 97 v24 = array_507D30; |
98 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
99 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
100 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
101 v27 = (char *)&array_507D30[0].v; | |
102 v28 = (char *)&array_507D30[0].u; | |
103 v7 = (char *)&array_50AC10[0].v; | |
104 v18 = v6; | |
105 do | |
106 { | |
107 v19 = v2 >= *((float *)v7 + 5); | |
108 if ( v3 != v19 ) | |
109 { | |
110 if ( v19 ) | |
111 { | |
112 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | |
113 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | |
114 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | |
115 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | |
116 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | |
117 } | |
118 else | |
119 { | |
120 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | |
121 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | |
122 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | |
123 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | |
124 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | |
125 } | |
126 *(float *)v27 = v9; | |
127 *(float *)v25 = v2; | |
128 *(float *)v26 = 1.0 / v2; | |
129 if ( v3 ) | |
130 { | |
131 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
132 { | |
133 v11 = 0; | |
134 v12 = *(float *)v4 == *((float *)v7 - 5); | |
135 goto LABEL_19; | |
136 } | |
137 } | |
138 else | |
139 { | |
140 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
141 { | |
142 v11 = 0; | |
143 v12 = *(float *)v4 == *((float *)v7 + 7); | |
144 LABEL_19: | |
145 if ( v12 | v11 ) | |
146 goto LABEL_21; | |
147 goto LABEL_20; | |
148 } | |
149 } | |
150 LABEL_20: | |
151 v26 += 48; | |
152 ++v24; | |
153 v25 += 48; | |
154 v27 += 48; | |
155 v28 += 48; | |
156 v5 += 48; | |
157 v4 += 48; | |
158 ++v22; | |
159 v23 += 48; | |
160 v21 = v5; | |
161 v20 = v4; | |
162 } | |
163 LABEL_21: | |
164 if ( v19 ) | |
165 { | |
166 v13 = v24; | |
167 v14 = v26; | |
168 v21 += 48; | |
169 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
170 v20 += 48; | |
171 ++v22; | |
172 v28 += 48; | |
173 v27 += 48; | |
174 v25 += 48; | |
175 ++v24; | |
176 v26 += 48; | |
177 memcpy(v13, v7 + 8, 0x30u); | |
178 v16 = v23; | |
179 v23 += 48; | |
180 v4 = v20; | |
181 *(float *)v14 = v15; | |
182 *(int *)v16 = *((int *)v7 + 13); | |
183 v5 = v21; | |
184 } | |
185 v3 = v19; | |
186 v7 += 48; | |
187 --v18; | |
188 } | |
189 while ( v18 ); | |
190 result = v22; | |
191 if ( v22 < 3 ) | |
192 return 0; | |
193 return result; | |
194 } | |
195 | |
196 //----- (004250FE) -------------------------------------------------------- | |
197 signed int __fastcall sr_4250FE(unsigned int uVertexID) | |
198 { | |
199 unsigned int v1; // edx@1 | |
200 char *v2; // edi@5 | |
201 char *v3; // esi@5 | |
202 char *v4; // ecx@5 | |
203 int v5; // ebx@6 | |
204 double v6; // st6@11 | |
205 double v7; // st5@11 | |
206 double v8; // st6@12 | |
207 unsigned __int8 v9; // c2@16 | |
208 unsigned __int8 v10; // c3@16 | |
209 void *v11; // edi@23 | |
210 double v12; // st6@23 | |
211 char *v13; // ecx@23 | |
212 char v14; // zf@24 | |
213 signed int result; // eax@25 | |
214 unsigned int v16; // [sp+8h] [bp-28h]@5 | |
215 bool v17; // [sp+Ch] [bp-24h]@2 | |
216 bool v18; // [sp+10h] [bp-20h]@7 | |
217 char *v19; // [sp+14h] [bp-1Ch]@5 | |
218 char *v20; // [sp+18h] [bp-18h]@5 | |
219 signed int v21; // [sp+1Ch] [bp-14h]@1 | |
220 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5 | |
221 char *v23; // [sp+24h] [bp-Ch]@5 | |
222 char *v24; // [sp+28h] [bp-8h]@5 | |
223 char *v25; // [sp+2Ch] [bp-4h]@5 | |
224 | |
225 v1 = uVertexID; | |
226 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
227 v21 = 0; | |
228 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0; | |
229 if ( (signed int)(uVertexID + 1) <= 1 ) | |
230 return 0; | |
231 v2 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
232 v3 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 233 v24 = (char *)&array_507D30[0]._rhw; |
0 | 234 v22 = array_507D30; |
235 v19 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
236 v20 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
237 v23 = (char *)&array_507D30[0].vWorldViewPosition; | |
238 v25 = (char *)&array_507D30[0].flt_2C; | |
239 v4 = (char *)&array_50AC10[0].vWorldViewPosition; | |
240 v16 = v1; | |
241 do | |
242 { | |
243 v5 = (int)(v4 + 48); | |
244 v18 = *((float *)v4 + 12) >= 8.0; | |
245 if ( v17 != v18 ) | |
246 { | |
247 if ( v18 ) | |
248 { | |
249 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4); | |
250 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1); | |
251 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2); | |
252 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8); | |
253 } | |
254 else | |
255 { | |
256 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5); | |
257 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13); | |
258 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14); | |
259 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20); | |
260 } | |
261 *(float *)v25 = v7; | |
262 *(float *)v23 = 8.0; | |
263 *(int *)v24 = 0x3E000000u; | |
264 if ( v17 ) | |
265 { | |
266 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) ) | |
267 { | |
268 v9 = 0; | |
269 v10 = *(float *)v2 == *((float *)v4 + 2); | |
270 goto LABEL_20; | |
271 } | |
272 } | |
273 else | |
274 { | |
275 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) ) | |
276 { | |
277 v9 = 0; | |
278 v10 = *(float *)v2 == *((float *)v4 + 14); | |
279 LABEL_20: | |
280 if ( v10 | v9 ) | |
281 goto LABEL_22; | |
282 goto LABEL_21; | |
283 } | |
284 } | |
285 LABEL_21: | |
286 ++v22; | |
287 v23 += 48; | |
288 v25 += 48; | |
289 v3 += 48; | |
290 v2 += 48; | |
291 ++v21; | |
292 v24 += 48; | |
293 v20 = v3; | |
294 v19 = v2; | |
295 } | |
296 LABEL_22: | |
297 if ( v18 ) | |
298 { | |
299 v11 = v22; | |
300 v20 += 48; | |
301 v19 += 48; | |
302 v12 = 1.0 / (*(float *)v5 + 0.0000001); | |
303 ++v21; | |
304 v25 += 48; | |
305 v23 += 48; | |
306 ++v22; | |
307 memcpy(v11, v4 + 36, 0x30u); | |
308 v13 = v24; | |
309 v24 += 48; | |
310 v3 = v20; | |
311 v2 = v19; | |
312 *(float *)v13 = v12; | |
313 } | |
314 v14 = v16-- == 1; | |
315 v17 = v18; | |
316 v4 = (char *)v5; | |
317 } | |
318 while ( !v14 ); | |
319 result = v21; | |
320 if ( v21 < 3 ) | |
321 return 0; | |
322 return result; | |
323 } | |
324 | |
325 //----- (004252E8) -------------------------------------------------------- | |
326 signed int __fastcall sr_4252E8(unsigned int uVertexID) | |
327 { | |
328 unsigned int v1; // edx@1 | |
329 double v2; // st7@1 | |
330 char *v3; // edi@5 | |
331 char *v4; // esi@5 | |
332 char *v5; // ecx@5 | |
333 int v6; // ebx@6 | |
334 double v7; // st6@11 | |
335 double v8; // st5@11 | |
336 double v9; // st6@12 | |
337 unsigned __int8 v10; // c2@16 | |
338 unsigned __int8 v11; // c3@16 | |
339 void *v12; // edi@23 | |
340 double v13; // st6@23 | |
341 char *v14; // ecx@23 | |
342 char v15; // zf@24 | |
343 signed int result; // eax@25 | |
344 unsigned int v17; // [sp+8h] [bp-28h]@5 | |
345 bool v18; // [sp+Ch] [bp-24h]@2 | |
346 bool v19; // [sp+10h] [bp-20h]@7 | |
347 char *v20; // [sp+14h] [bp-1Ch]@5 | |
348 char *v21; // [sp+18h] [bp-18h]@5 | |
349 signed int v22; // [sp+1Ch] [bp-14h]@1 | |
350 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5 | |
351 char *v24; // [sp+24h] [bp-Ch]@5 | |
352 char *v25; // [sp+28h] [bp-8h]@5 | |
353 char *v26; // [sp+2Ch] [bp-4h]@5 | |
354 | |
355 v1 = uVertexID; | |
356 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
357 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
358 v22 = 0; | |
359 v18 = array_50AC10[0].vWorldViewPosition.x <= v2; | |
360 if ( (signed int)(uVertexID + 1) <= 1 ) | |
361 return 0; | |
362 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
363 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 364 v25 = (char *)&array_507D30[0]._rhw; |
0 | 365 v23 = array_507D30; |
366 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
367 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
368 v24 = (char *)&array_507D30[0].vWorldViewPosition; | |
369 v26 = (char *)&array_507D30[0].flt_2C; | |
370 v5 = (char *)&array_50AC10[0].vWorldViewPosition; | |
371 v17 = v1; | |
372 do | |
373 { | |
374 v6 = (int)(v5 + 48); | |
375 v19 = v2 >= *((float *)v5 + 12); | |
376 if ( v18 != v19 ) | |
377 { | |
378 if ( v19 ) | |
379 { | |
380 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5); | |
381 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1); | |
382 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2); | |
383 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8); | |
384 } | |
385 else | |
386 { | |
387 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6); | |
388 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13); | |
389 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14); | |
390 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20); | |
391 } | |
392 *(float *)v26 = v8; | |
393 *(float *)v24 = v2; | |
394 *(float *)v25 = 1.0 / v2; | |
395 if ( v18 ) | |
396 { | |
397 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) ) | |
398 { | |
399 v10 = 0; | |
400 v11 = *(float *)v3 == *((float *)v5 + 2); | |
401 goto LABEL_20; | |
402 } | |
403 } | |
404 else | |
405 { | |
406 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) ) | |
407 { | |
408 v10 = 0; | |
409 v11 = *(float *)v3 == *((float *)v5 + 14); | |
410 LABEL_20: | |
411 if ( v11 | v10 ) | |
412 goto LABEL_22; | |
413 goto LABEL_21; | |
414 } | |
415 } | |
416 LABEL_21: | |
417 ++v23; | |
418 v24 += 48; | |
419 v26 += 48; | |
420 v4 += 48; | |
421 v3 += 48; | |
422 ++v22; | |
423 v25 += 48; | |
424 v21 = v4; | |
425 v20 = v3; | |
426 } | |
427 LABEL_22: | |
428 if ( v19 ) | |
429 { | |
430 v12 = v23; | |
431 v21 += 48; | |
432 v20 += 48; | |
433 v13 = 1.0 / (*(float *)v6 + 0.0000001); | |
434 ++v22; | |
435 v26 += 48; | |
436 v24 += 48; | |
437 ++v23; | |
438 memcpy(v12, v5 + 36, 0x30u); | |
439 v14 = v25; | |
440 v25 += 48; | |
441 v4 = v21; | |
442 v3 = v20; | |
443 *(float *)v14 = v13; | |
444 } | |
445 v15 = v17-- == 1; | |
446 v18 = v19; | |
447 v5 = (char *)v6; | |
448 } | |
449 while ( !v15 ); | |
450 result = v22; | |
451 if ( v22 < 3 ) | |
452 return 0; | |
453 return result; | |
454 } | |
455 | |
456 | |
457 | |
458 //----- (004361EF) -------------------------------------------------------- | |
459 IndoorCameraD3D::IndoorCameraD3D() | |
460 { | |
461 IndoorCameraD3D *v1; // esi@1 | |
462 double v2; // st7@1 | |
463 double v3; // st6@1 | |
464 double v4; // st5@1 | |
465 double v5; // st7@1 | |
466 double v6; // st6@1 | |
467 double v7; // st5@1 | |
468 | |
469 v1 = this; | |
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4); | |
471 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14); | |
472 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24); | |
473 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, | |
474 24, | |
475 6, | |
476 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
477 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ | |
478 v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
479 v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
480 v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; | |
481 v1->field_108 = 0.0; | |
482 v1->field_DC = v4; | |
483 v1->field_E0 = v3; | |
484 v1->field_E4 = v2; | |
485 v5 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
486 v6 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
487 v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300); | |
488 v1->field_138 = 0.0; | |
489 v1->field_10C = v7; | |
490 v1->field_110 = v6; | |
491 v1->field_114 = v5; | |
492 v1->field_168 = 0.0; | |
493 v1->field_198 = 0.0; | |
494 v1->field_1C8 = 0.0; | |
495 v1->field_1F8 = 0.0; | |
496 v1->field_228 = 0.0; | |
497 v1->field_258 = 0.0; | |
498 v1->field_288 = 0.0; | |
499 v1->field_2B8 = 0.0; | |
500 v1->field_2E8 = 0.0; | |
501 v1->field_2BC = 0.0; | |
502 v1->field_2C0 = 0.0; | |
503 v1->field_2C4 = 0.0; | |
504 v1->field_318 = 0.0; | |
505 v1->field_2EC = 0.0; | |
506 v1->field_2F0 = 0.0; | |
507 v1->field_2F4 = 0.0; | |
508 v1->field_348 = 0.0; | |
509 v1->field_31C = 0.0; | |
510 v1->field_320 = 0.0; | |
511 v1->field_324 = 0.0; | |
512 v1->field_378 = 0.0; | |
513 v1->field_34C = 0.0; | |
514 v1->field_350 = 0.0; | |
515 v1->field_354 = 0.0; | |
516 for (uint i = 0; i < 16384; ++i) | |
517 { | |
518 list_0037C[i].field_0 = 0; | |
519 list_0037C[i].flt_30 = 0.0f; | |
520 } | |
521 | |
522 list_0037C_size = 0; | |
523 for (uint i = 0; i < 256; ++i) | |
524 list_E0380[i].mm7__vector_000004_size = 0; | |
525 /*v10 = v1->list_E0380; | |
526 v12 = 256; | |
527 do | |
528 { | |
529 v10->mm7__vector_000004_size = 0; | |
530 //mm7__vector_constructor( | |
531 // v10->mm7__vector_000004, | |
532 // 48, | |
533 // 64, | |
534 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); | |
535 //++v10; | |
536 --v12; | |
537 } | |
538 while ( v12 );*/ | |
539 list_E0380_size = 0; | |
540 //v1->vdestructor_ptr = &stru8_pvdtor; | |
541 } | |
542 | |
543 | |
544 //----- (004254D2) -------------------------------------------------------- | |
545 int __fastcall sr_4254D2(signed int a1) | |
546 { | |
547 signed int v1; // ebx@2 | |
548 int v2; // ecx@2 | |
549 int result; // eax@11 | |
550 double v4; // ST74_8@12 | |
551 bool v5; // edi@12 | |
552 char *v6; // esi@13 | |
553 char *v7; // ebx@13 | |
554 double v8; // st7@15 | |
555 double v9; // st7@16 | |
556 double v10; // st6@16 | |
557 double v11; // st7@17 | |
558 float v12; // eax@18 | |
559 double v13; // ST4C_8@19 | |
560 double v14; // ST10_8@19 | |
561 double v15; // ST28_8@20 | |
562 double v16; // ST34_8@20 | |
563 char v17; // zf@20 | |
564 double v18; // ST18_8@21 | |
565 double v19; // ST3C_8@21 | |
566 double v20; // ST44_8@22 | |
567 double v21; // ST54_8@22 | |
568 void *v22; // edi@26 | |
569 double v23; // ST54_8@29 | |
570 bool v24; // esi@29 | |
571 char *v25; // edi@30 | |
572 char *v26; // ebx@30 | |
573 bool v27; // ecx@32 | |
574 double v28; // st7@33 | |
575 double v29; // st7@34 | |
576 double v30; // st6@34 | |
577 double v31; // st7@35 | |
578 double v32; // ST44_8@37 | |
579 double v33; // ST3C_8@37 | |
580 double v34; // ST18_8@38 | |
581 double v35; // ST34_8@38 | |
582 char v36; // zf@38 | |
583 double v37; // ST28_8@39 | |
584 double v38; // ST10_8@39 | |
585 double v39; // ST20_8@40 | |
586 double v40; // ST5C_8@40 | |
587 void *v41; // edi@44 | |
588 double v42; // ST5C_8@47 | |
589 bool v43; // edi@47 | |
590 char *v44; // esi@48 | |
591 char *v45; // ebx@48 | |
592 bool v46; // ecx@49 | |
593 double v47; // st6@50 | |
594 double v48; // st6@51 | |
595 double v49; // st5@51 | |
596 double v50; // st6@52 | |
597 double v51; // ST20_8@54 | |
598 double v52; // ST54_8@54 | |
599 double v53; // ST44_8@55 | |
600 double v54; // ST3C_8@55 | |
601 char v55; // zf@55 | |
602 double v56; // ST18_8@56 | |
603 double v57; // ST34_8@56 | |
604 double v58; // ST28_8@57 | |
605 double v59; // ST10_8@57 | |
606 void *v60; // edi@61 | |
607 double v61; // ST5C_8@64 | |
608 bool v62; // edi@64 | |
609 char *v63; // esi@65 | |
610 char *v64; // ebx@65 | |
611 bool v65; // ecx@66 | |
612 double v66; // st6@67 | |
613 double v67; // st6@68 | |
614 double v68; // st5@68 | |
615 double v69; // st6@69 | |
616 double v70; // ST20_8@71 | |
617 double v71; // ST54_8@71 | |
618 double v72; // ST44_8@72 | |
619 double v73; // ST3C_8@72 | |
620 char v74; // zf@72 | |
621 double v75; // ST18_8@73 | |
622 double v76; // ST34_8@73 | |
623 double v77; // ST28_8@74 | |
624 double v78; // ST10_8@74 | |
625 void *v79; // edi@78 | |
626 int v80; // ebx@81 | |
627 char *v81; // ecx@82 | |
628 signed int v82; // esi@82 | |
629 float v83; // ST78_4@83 | |
630 double v84; // ST5C_8@83 | |
631 float v85; // eax@84 | |
632 double v86; // ST20_8@85 | |
633 double v87; // ST54_8@88 | |
634 float v88; // eax@89 | |
635 double v89; // ST44_8@90 | |
636 unsigned __int8 v90; // sf@94 | |
637 unsigned __int8 v91; // of@94 | |
638 int v92; // edx@97 | |
639 int v93; // esi@97 | |
640 int v94; // edi@97 | |
641 int v95; // eax@97 | |
642 int v96; // eax@104 | |
643 double v97; // [sp+4Ch] [bp-8Ch]@32 | |
644 double v98; // [sp+54h] [bp-84h]@49 | |
645 double v99; // [sp+54h] [bp-84h]@66 | |
646 float v100; // [sp+5Ch] [bp-7Ch]@1 | |
647 float v101; // [sp+60h] [bp-78h]@1 | |
648 float v102; // [sp+64h] [bp-74h]@1 | |
649 double v103; // [sp+6Ch] [bp-6Ch]@14 | |
650 float v104; // [sp+A8h] [bp-30h]@1 | |
651 signed int v105; // [sp+A8h] [bp-30h]@96 | |
652 bool v106; // [sp+ACh] [bp-2Ch]@14 | |
653 bool v107; // [sp+ACh] [bp-2Ch]@32 | |
654 bool v108; // [sp+ACh] [bp-2Ch]@49 | |
655 bool v109; // [sp+ACh] [bp-2Ch]@66 | |
656 signed int v110; // [sp+B0h] [bp-28h]@12 | |
657 char *v111; // [sp+B8h] [bp-20h]@30 | |
658 signed int v112; // [sp+B8h] [bp-20h]@48 | |
659 signed int v113; // [sp+B8h] [bp-20h]@65 | |
660 char *v114; // [sp+BCh] [bp-1Ch]@13 | |
661 signed int v115; // [sp+BCh] [bp-1Ch]@29 | |
662 signed int v116; // [sp+BCh] [bp-1Ch]@64 | |
663 signed int v117; // [sp+C0h] [bp-18h]@1 | |
664 char *v118; // [sp+C0h] [bp-18h]@30 | |
665 char *v119; // [sp+C0h] [bp-18h]@48 | |
666 char *v120; // [sp+C0h] [bp-18h]@65 | |
667 char *v121; // [sp+C4h] [bp-14h]@13 | |
668 char *v122; // [sp+C4h] [bp-14h]@30 | |
669 signed int v123; // [sp+C4h] [bp-14h]@47 | |
670 char *v124; // [sp+C8h] [bp-10h]@30 | |
671 char *v125; // [sp+C8h] [bp-10h]@48 | |
672 char *v126; // [sp+C8h] [bp-10h]@65 | |
673 signed int v127; // [sp+CCh] [bp-Ch]@2 | |
674 char *v128; // [sp+CCh] [bp-Ch]@13 | |
675 char *v129; // [sp+CCh] [bp-Ch]@30 | |
676 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48 | |
677 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65 | |
678 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13 | |
679 char *v133; // [sp+D0h] [bp-8h]@30 | |
680 char *v134; // [sp+D0h] [bp-8h]@48 | |
681 char *v135; // [sp+D0h] [bp-8h]@65 | |
682 signed int v136; // [sp+D4h] [bp-4h]@1 | |
683 char *v137; // [sp+D4h] [bp-4h]@13 | |
684 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30 | |
685 char *v139; // [sp+D4h] [bp-4h]@48 | |
686 char *v140; // [sp+D4h] [bp-4h]@65 | |
687 | |
688 v101 = (double)(signed int)pViewport->uViewportX; | |
689 v100 = (double)(signed int)pViewport->uViewportZ; | |
690 v117 = a1; | |
691 v136 = 1; | |
692 v104 = (double)(signed int)pViewport->uViewportY; | |
693 v102 = (double)(pViewport->uViewportW + 1); | |
694 if ( a1 <= 0 ) | |
695 return v117; | |
696 v127 = a1; | |
697 v1 = a1; | |
698 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2)); | |
699 v2 = 0; | |
700 do | |
701 { | |
702 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 ) | |
703 v136 = 0; | |
704 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 ) | |
705 v136 = 0; | |
706 ++v2; | |
707 --v127; | |
708 } | |
709 while ( v127 ); | |
710 if ( v136 ) | |
711 return v117; | |
712 v110 = 0; | |
713 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1])); | |
714 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15; | |
715 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportX; | |
716 if ( v117 < 1 ) | |
717 goto LABEL_112; | |
718 v6 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
719 v132 = array_50A2B0; | |
720 v137 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
721 v128 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
722 v121 = (char *)&array_50A2B0[0].flt_2C; | |
168 | 723 v114 = (char *)&array_50A2B0[0]._rhw; |
0 | 724 v7 = (char *)&array_50AC10[0].flt_2C; |
725 do | |
726 { | |
727 v103 = *((float *)v7 + 7) + 6.7553994e15; | |
728 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportX; | |
729 if ( !(v5 ^ v106) ) | |
730 goto LABEL_25; | |
731 v8 = v101; | |
732 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportX ) | |
733 { | |
734 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5)); | |
735 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4); | |
736 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3); | |
737 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7; | |
738 } | |
739 else | |
740 { | |
741 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7)); | |
742 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8); | |
743 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9); | |
744 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12); | |
745 } | |
746 *(float *)v121 = v10; | |
747 *(int *)v137 = LODWORD(v101); | |
748 LODWORD(v12) = *(int *)v6; | |
749 if ( v5 ) | |
750 { | |
751 v13 = v12 + 6.7553994e15; | |
752 v14 = *((float *)v7 - 4) + 6.7553994e15; | |
753 if ( LODWORD(v13) == LODWORD(v14) ) | |
754 { | |
755 v15 = *(float *)v137 + 6.7553994e15; | |
756 v16 = *((float *)v7 - 5) + 6.7553994e15; | |
757 v17 = LODWORD(v15) == LODWORD(v16); | |
758 goto LABEL_23; | |
759 } | |
760 } | |
761 else | |
762 { | |
763 v18 = v12 + 6.7553994e15; | |
764 v19 = *((float *)v7 + 8) + 6.7553994e15; | |
765 if ( LODWORD(v18) == LODWORD(v19) ) | |
766 { | |
767 v20 = *(float *)v137 + 6.7553994e15; | |
768 v21 = *((float *)v7 + 7) + 6.7553994e15; | |
769 v17 = LODWORD(v20) == LODWORD(v21); | |
770 LABEL_23: | |
771 if ( v17 ) | |
772 goto LABEL_25; | |
773 goto LABEL_24; | |
774 } | |
775 } | |
776 LABEL_24: | |
777 v121 += 48; | |
778 v114 += 48; | |
779 v6 += 48; | |
780 ++v110; | |
781 ++v132; | |
782 v128 = v6; | |
783 v137 += 48; | |
784 LABEL_25: | |
785 if ( v106 ) | |
786 { | |
787 v22 = v132; | |
788 v128 += 48; | |
789 ++v110; | |
790 v114 += 48; | |
791 v121 += 48; | |
792 v137 += 48; | |
793 ++v132; | |
794 memcpy(v22, v7 + 4, 0x30u); | |
795 v6 = v128; | |
796 } | |
797 v5 = v106; | |
798 v7 += 48; | |
799 --v117; | |
800 } | |
801 while ( v117 ); | |
802 if ( v110 < 3 | |
803 || (v115 = 0, | |
804 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])), | |
805 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15, | |
806 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportZ, | |
807 v110 < 1) ) | |
808 goto LABEL_112; | |
168 | 809 v25 = (char *)&array_509950[0]._rhw; |
0 | 810 v138 = array_509950; |
811 v129 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
812 v118 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
813 v133 = (char *)&array_509950[0].vWorldViewProjX; | |
814 v122 = (char *)&array_509950[0].vWorldViewProjY; | |
815 v124 = (char *)&array_509950[0].flt_2C; | |
168 | 816 v111 = (char *)&array_509950[0]._rhw; |
0 | 817 v26 = (char *)&array_50A2B0[0].flt_2C; |
818 while ( 2 ) | |
819 { | |
820 v97 = *((float *)v26 + 7) + 6.7553994e15; | |
821 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
822 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
823 if ( v24 != v27 ) | |
824 { | |
825 v28 = v100; | |
826 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportZ ) | |
827 { | |
828 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5)); | |
829 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4); | |
830 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3); | |
831 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26; | |
832 } | |
833 else | |
834 { | |
835 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7)); | |
836 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8); | |
837 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9); | |
838 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12); | |
839 } | |
840 *(float *)v124 = v30; | |
841 *(int *)v133 = LODWORD(v100); | |
842 if ( v24 ) | |
843 { | |
844 v32 = *(float *)v122 + 6.7553994e15; | |
845 v33 = *((float *)v26 - 4) + 6.7553994e15; | |
846 if ( LODWORD(v32) == LODWORD(v33) ) | |
847 { | |
848 v34 = *(float *)v133 + 6.7553994e15; | |
849 v35 = *((float *)v26 - 5) + 6.7553994e15; | |
850 v36 = LODWORD(v34) == LODWORD(v35); | |
851 goto LABEL_41; | |
852 } | |
853 goto LABEL_42; | |
854 } | |
855 v37 = *(float *)v118 + 6.7553994e15; | |
856 v38 = *((float *)v26 + 8) + 6.7553994e15; | |
857 if ( LODWORD(v37) != LODWORD(v38) ) | |
858 goto LABEL_42; | |
859 v39 = *(float *)v129 + 6.7553994e15; | |
860 v40 = *((float *)v26 + 7) + 6.7553994e15; | |
861 v36 = LODWORD(v39) == LODWORD(v40); | |
862 LABEL_41: | |
863 if ( !v36 ) | |
864 { | |
865 LABEL_42: | |
866 v129 += 48; | |
867 v118 += 48; | |
868 v133 += 48; | |
869 v122 += 48; | |
870 v124 += 48; | |
871 v111 += 48; | |
872 ++v115; | |
873 ++v138; | |
874 } | |
875 } | |
876 if ( v27 ) | |
877 { | |
878 v41 = v138; | |
879 ++v115; | |
880 v111 += 48; | |
881 v124 += 48; | |
882 v122 += 48; | |
883 v133 += 48; | |
884 v118 += 48; | |
885 v129 += 48; | |
886 ++v138; | |
887 memcpy(v41, v26 + 4, 0x30u); | |
888 } | |
889 v24 = v107; | |
890 v26 += 48; | |
891 --v110; | |
892 if ( v110 ) | |
893 { | |
894 v25 = v111; | |
895 continue; | |
896 } | |
897 break; | |
898 } | |
899 if ( v115 < 3 | |
900 || (v123 = 0, | |
901 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])), | |
902 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15, | |
903 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportY, | |
904 v115 < 1) ) | |
905 goto LABEL_112; | |
906 v44 = (char *)&array_508FF0[0].vWorldViewProjX; | |
907 v130 = array_508FF0; | |
908 v119 = (char *)&array_508FF0[0].vWorldViewProjX; | |
909 v139 = (char *)&array_508FF0[0].vWorldViewProjY; | |
910 v125 = (char *)&array_508FF0[0].flt_2C; | |
168 | 911 v134 = (char *)&array_508FF0[0]._rhw; |
0 | 912 v45 = (char *)&array_509950[0].flt_2C; |
913 v112 = v115; | |
914 while ( 2 ) | |
915 { | |
916 v98 = *((float *)v45 + 8) + 6.7553994e15; | |
917 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
918 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
919 if ( v43 != v46 ) | |
920 { | |
921 v47 = v104; | |
922 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportY ) | |
923 { | |
924 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4)); | |
925 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5); | |
926 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3); | |
927 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45; | |
928 } | |
929 else | |
930 { | |
931 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8)); | |
932 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7); | |
933 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9); | |
934 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12); | |
935 } | |
936 *(float *)v125 = v49; | |
937 *(float *)v139 = v104; | |
938 if ( v43 ) | |
939 { | |
940 v51 = v104 + 6.7553994e15; | |
941 v52 = *((float *)v45 - 4) + 6.7553994e15; | |
942 if ( LODWORD(v51) == LODWORD(v52) ) | |
943 { | |
944 v53 = *(float *)v44 + 6.7553994e15; | |
945 v54 = *((float *)v45 - 5) + 6.7553994e15; | |
946 v55 = LODWORD(v53) == LODWORD(v54); | |
947 goto LABEL_58; | |
948 } | |
949 goto LABEL_59; | |
950 } | |
951 v56 = v104 + 6.7553994e15; | |
952 v57 = *((float *)v45 + 8) + 6.7553994e15; | |
953 if ( LODWORD(v56) != LODWORD(v57) ) | |
954 goto LABEL_59; | |
955 v58 = *(float *)v44 + 6.7553994e15; | |
956 v59 = *((float *)v45 + 7) + 6.7553994e15; | |
957 v55 = LODWORD(v58) == LODWORD(v59); | |
958 LABEL_58: | |
959 if ( !v55 ) | |
960 { | |
961 LABEL_59: | |
962 v139 += 48; | |
963 v125 += 48; | |
964 v134 += 48; | |
965 v44 += 48; | |
966 ++v123; | |
967 ++v130; | |
968 v119 = v44; | |
969 } | |
970 } | |
971 if ( v46 ) | |
972 { | |
973 v60 = v130; | |
974 v119 += 48; | |
975 ++v123; | |
976 v134 += 48; | |
977 v125 += 48; | |
978 v139 += 48; | |
979 ++v130; | |
980 memcpy(v60, v45 + 4, 0x30u); | |
981 v44 = v119; | |
982 } | |
983 v43 = v108; | |
984 v45 += 48; | |
985 --v112; | |
986 if ( v112 ) | |
987 continue; | |
988 break; | |
989 } | |
990 if ( v123 < 3 | |
991 || (v116 = 0, | |
992 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])), | |
993 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15, | |
994 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportW, | |
995 v123 < 1) ) | |
996 goto LABEL_112; | |
997 v63 = (char *)&array_508690[0].vWorldViewProjX; | |
998 v131 = array_508690; | |
999 v120 = (char *)&array_508690[0].vWorldViewProjX; | |
1000 v140 = (char *)&array_508690[0].vWorldViewProjY; | |
1001 v126 = (char *)&array_508690[0].flt_2C; | |
168 | 1002 v135 = (char *)&array_508690[0]._rhw; |
0 | 1003 v64 = (char *)&array_508FF0[0].flt_2C; |
1004 v113 = v123; | |
1005 while ( 2 ) | |
1006 { | |
1007 v99 = *((float *)v64 + 8) + 6.7553994e15; | |
1008 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1009 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1010 if ( v62 != v65 ) | |
1011 { | |
1012 v66 = v102; | |
1013 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportW ) | |
1014 { | |
1015 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4)); | |
1016 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5); | |
1017 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3); | |
1018 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64; | |
1019 } | |
1020 else | |
1021 { | |
1022 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8)); | |
1023 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7); | |
1024 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9); | |
1025 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12); | |
1026 } | |
1027 *(float *)v126 = v68; | |
1028 *(float *)v140 = v102; | |
1029 if ( v62 ) | |
1030 { | |
1031 v70 = v102 + 6.7553994e15; | |
1032 v71 = *((float *)v64 - 4) + 6.7553994e15; | |
1033 if ( LODWORD(v70) == LODWORD(v71) ) | |
1034 { | |
1035 v72 = *(float *)v63 + 6.7553994e15; | |
1036 v73 = *((float *)v64 - 5) + 6.7553994e15; | |
1037 v74 = LODWORD(v72) == LODWORD(v73); | |
1038 goto LABEL_75; | |
1039 } | |
1040 goto LABEL_76; | |
1041 } | |
1042 v75 = v102 + 6.7553994e15; | |
1043 v76 = *((float *)v64 + 8) + 6.7553994e15; | |
1044 if ( LODWORD(v75) != LODWORD(v76) ) | |
1045 goto LABEL_76; | |
1046 v77 = *(float *)v63 + 6.7553994e15; | |
1047 v78 = *((float *)v64 + 7) + 6.7553994e15; | |
1048 v74 = LODWORD(v77) == LODWORD(v78); | |
1049 LABEL_75: | |
1050 if ( !v74 ) | |
1051 { | |
1052 LABEL_76: | |
1053 v140 += 48; | |
1054 v126 += 48; | |
1055 v135 += 48; | |
1056 v63 += 48; | |
1057 ++v116; | |
1058 ++v131; | |
1059 v120 = v63; | |
1060 } | |
1061 } | |
1062 if ( v65 ) | |
1063 { | |
1064 v79 = v131; | |
1065 v120 += 48; | |
1066 ++v116; | |
1067 v135 += 48; | |
1068 v126 += 48; | |
1069 v140 += 48; | |
1070 ++v131; | |
1071 memcpy(v79, v64 + 4, 0x30u); | |
1072 v63 = v120; | |
1073 } | |
1074 v62 = v109; | |
1075 v64 += 48; | |
1076 --v113; | |
1077 if ( v113 ) | |
1078 continue; | |
1079 break; | |
1080 } | |
1081 if ( v116 < 3 ) | |
1082 goto LABEL_112; | |
1083 v80 = v116; | |
1084 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116])); | |
1085 if ( v116 > 0 ) | |
1086 { | |
1087 v81 = (char *)&array_508690[0].vWorldViewProjX; | |
1088 v82 = v116; | |
1089 do | |
1090 { | |
1091 LODWORD(v83) = *(int *)v81; | |
1092 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2); | |
1093 v84 = v83 + 6.7553994e15; | |
1094 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportZ ) | |
1095 { | |
1096 v86 = *(float *)v81 + 6.7553994e15; | |
1097 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportX ) | |
1098 goto LABEL_88; | |
1099 v85 = v101; | |
1100 } | |
1101 else | |
1102 { | |
1103 v85 = v100; | |
1104 } | |
1105 *(int *)v81 = LODWORD(v85); | |
1106 LABEL_88: | |
1107 v87 = *((float *)v81 + 1) + 6.7553994e15; | |
1108 if ( SLODWORD(v87) > (signed int)pViewport->uViewportW ) | |
1109 { | |
1110 v88 = v102; | |
1111 LABEL_92: | |
1112 *((int *)v81 + 1) = LODWORD(v88); | |
1113 goto LABEL_93; | |
1114 } | |
1115 v89 = *((float *)v81 + 1) + 6.7553994e15; | |
1116 if ( SLODWORD(v89) < (signed int)pViewport->uViewportY ) | |
1117 { | |
1118 v88 = v104; | |
1119 goto LABEL_92; | |
1120 } | |
1121 LABEL_93: | |
1122 v81 += 48; | |
1123 --v82; | |
1124 } | |
1125 while ( v82 ); | |
1126 } | |
1127 v91 = __OFSUB__(v116, 3); | |
1128 v90 = v116 - 3 < 0; | |
1129 if ( v116 > 3 ) | |
1130 { | |
1131 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1])); | |
1132 if ( v116 > 0 ) | |
1133 { | |
1134 v105 = 1; | |
1135 do | |
1136 { | |
1137 v92 = v105; | |
1138 v93 = v105 - 1; | |
1139 v94 = v105 + 1; | |
1140 v95 = v105 + 1; | |
1141 if ( v105 - 1 >= v80 ) | |
1142 v93 -= v80; | |
1143 if ( v105 >= v80 ) | |
1144 v92 = v105 - v80; | |
1145 if ( v94 >= v80 ) | |
1146 v95 = v94 - v80; | |
1147 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1148 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY) | |
1149 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1150 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 ) | |
1151 { | |
1152 ++v105; | |
1153 } | |
1154 else | |
1155 { | |
1156 v96 = v105; | |
1157 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) ) | |
1158 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2)); | |
1159 --v80; | |
1160 } | |
1161 } | |
1162 while ( v105 - 1 < v80 ); | |
1163 } | |
1164 v91 = __OFSUB__(v80, 3); | |
1165 v90 = v80 - 3 < 0; | |
1166 } | |
1167 if ( v90 ^ v91 ) | |
1168 LABEL_112: | |
1169 result = 0; | |
1170 else | |
1171 result = v80; | |
1172 return result; | |
1173 } | |
1174 | |
1175 //----- (0042620A) -------------------------------------------------------- | |
1176 bool __thiscall sr_42620A(RenderVertexSoft *p) | |
1177 { | |
1178 __int16 v1; // fps@1 | |
1179 unsigned __int8 v2; // c0@2 | |
1180 char v3; // c2@2 | |
1181 unsigned __int8 v4; // c3@2 | |
1182 bool result; // eax@2 | |
1183 unsigned __int8 v6; // c0@4 | |
1184 char v7; // c2@4 | |
1185 unsigned __int8 v8; // c3@4 | |
1186 unsigned __int8 v9; // c0@6 | |
1187 char v10; // c2@6 | |
1188 unsigned __int8 v11; // c3@6 | |
1189 double v12; // st6@7 | |
1190 float v13; // ST04_4@7 | |
1191 float v14; // ST00_4@7 | |
1192 double v15; // st7@7 | |
1193 double v16; // st6@8 | |
1194 float v17; // ST04_4@8 | |
1195 float v18; // ST00_4@8 | |
1196 double v19; // st7@8 | |
1197 | |
1198 //UNDEF(v1); | |
1199 if ( p->vWorldViewPosition.x < 300.0 | |
1200 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
1201 v3 = 0, | |
1202 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
1203 BYTE1(result) = HIBYTE(v1), | |
1204 !(v2 | v4)) ) | |
1205 { | |
1206 if ( p->vWorldViewPosition.x < 300.0 ) | |
1207 { | |
1208 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
1209 v7 = 0; | |
1210 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
1211 BYTE1(result) = HIBYTE(v1); | |
1212 if ( !(v6 | v8) ) | |
1213 { | |
1214 LOBYTE(result) = 0; | |
1215 return result; | |
1216 } | |
1217 } | |
1218 v9 = 300.0 < p->vWorldViewPosition.x; | |
1219 v10 = 0; | |
1220 v11 = 300.0 == p->vWorldViewPosition.x; | |
1221 BYTE1(result) = HIBYTE(v1); | |
1222 if ( v9 | v11 ) | |
1223 { | |
1224 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
1225 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
1226 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
1227 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
1228 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
1229 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
1230 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
1231 } | |
1232 else | |
1233 { | |
1234 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
1235 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
1236 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
1237 v15 = 300.0 - p->vWorldViewPosition.x; | |
1238 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
1239 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
1240 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
1241 } | |
1242 } | |
1243 LOBYTE(result) = 1; | |
1244 return result; | |
1245 } | |
1246 | |
1247 | |
1248 | |
1249 | |
1250 //----- (004268E3) -------------------------------------------------------- | |
1251 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) | |
1252 { | |
1253 unsigned int v1; // eax@1 | |
1254 unsigned int v2; // edx@1 | |
1255 int v3; // eax@1 | |
1256 int v4; // edx@1 | |
1257 unsigned int v5; // ecx@1 | |
1258 | |
1259 v1 = uColor >> 9; | |
1260 v2 = uColor >> 6; | |
1261 LOWORD(v1) = (uColor >> 9) & 0x7C00; | |
1262 LOWORD(v2) = (uColor >> 6) & 0x3E0; | |
1263 v3 = v2 | v1; | |
1264 v4 = (unsigned __int8)uColor >> 3; | |
1265 v5 = uColor >> 16; | |
1266 LOWORD(v5) = v5 & 0x8000; | |
1267 return v5 | v4 | v3; | |
1268 } | |
1269 | |
1270 //----- (0042690D) -------------------------------------------------------- | |
1271 int __fastcall _42690D_colors_cvt(unsigned int a1) | |
1272 { | |
1273 unsigned int v1; // eax@1 | |
1274 unsigned int v2; // edx@1 | |
1275 | |
1276 v1 = a1 >> 8; | |
1277 v2 = a1 >> 5; | |
1278 LOWORD(v1) = (a1 >> 8) & 0xF800; | |
1279 LOWORD(v2) = (a1 >> 5) & 0x7E0; | |
1280 return ((unsigned __int8)a1 >> 3) | v2 | v1; | |
1281 } | |
1282 | |
1283 //----- (00426947) -------------------------------------------------------- | |
1284 void __cdecl sub_426947() | |
1285 { | |
1286 dword_50C968 = 0; | |
1287 dword_50C994 = 0; | |
1288 dword_50C998_turnbased_icon_1A = 0; | |
1289 } | |
1290 // 50C968: using guessed type int dword_50C968; | |
1291 // 50C994: using guessed type int dword_50C994; | |
1292 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A; | |
1293 | |
1294 | |
1295 | |
1296 //----- (004269A2) -------------------------------------------------------- | |
1297 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1) | |
1298 { | |
89 | 1299 //unsigned __int64 v1; // qax@1 |
1300 Player *v1; | |
1301 int v1b; | |
0 | 1302 signed int v2; // ecx@1 |
82 | 1303 int *v3; // esi@1 |
0 | 1304 bool v4; // edi@6 |
82 | 1305 int *v5; // edi@10 |
1306 Player *v6; // esi@10 | |
0 | 1307 int v7; // eax@13 |
1308 unsigned __int8 v8; // cf@13 | |
89 | 1309 int v10[4]; // [sp+Ch] [bp-14h]@1 |
0 | 1310 int v11; // [sp+1Ch] [bp-4h]@10 |
1311 | |
89 | 1312 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1); |
1313 v1 = pParty->pPlayers; | |
1314 v1b = a1; | |
0 | 1315 v2 = 0; |
89 | 1316 v3 = v10; |
0 | 1317 do |
1318 { | |
89 | 1319 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8)) |
0 | 1320 && !*(int *)HIDWORD(v1) |
1321 && !*(_QWORD *)(HIDWORD(v1) + 8) | |
89 | 1322 && !*(_QWORD *)(HIDWORD(v1) + 16);*/ |
1323 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13])) | |
1324 && !v1->pConditions[14] | |
1325 && !v1->pConditions[15] | |
1326 && !v1->pConditions[16]; | |
82 | 1327 *v3 = v4; |
89 | 1328 //HIDWORD(v1) += 6972; |
1329 ++v1; | |
0 | 1330 v2 += v4; |
82 | 1331 ++v3; |
0 | 1332 } |
89 | 1333 while ( v1 <= &pParty->pPlayers[3] ); |
0 | 1334 if ( v2 ) |
1335 { | |
89 | 1336 v1b = v1b / v2; |
1337 v5 = v10; | |
82 | 1338 v6 = pParty->pPlayers;//[0].uExperience; |
89 | 1339 v11 = v1b; |
0 | 1340 do |
1341 { | |
82 | 1342 if ( *v5 ) |
0 | 1343 { |
1344 if ( v11 ) | |
1345 { | |
82 | 1346 LOBYTE(v7) = v6->GetLearningPercent(); |
89 | 1347 v1b = v11 + v11 * v7 / 100; |
1348 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience)); | |
1349 //need review | |
1350 LODWORD(v6->uExperience) += v1b; | |
1351 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8; | |
82 | 1352 if ( v6->uExperience > 4000000000i64 ) |
0 | 1353 { |
82 | 1354 HIDWORD(v6->uExperience) = 0; |
1355 LODWORD(v6->uExperience) = -294967296; | |
0 | 1356 } |
1357 } | |
1358 } | |
82 | 1359 ++v6; |
1360 ++v5; | |
0 | 1361 } |
82 | 1362 while ( v6 <= &pParty->pPlayers[3] ); |
0 | 1363 } |
89 | 1364 return v1b; |
0 | 1365 } |
1366 | |
1367 //----- (00426A5A) -------------------------------------------------------- | |
1368 void stru319::LootActor(Actor *pActor) | |
1369 { | |
1370 signed int v2; // edi@1 | |
1371 char v3; // zf@1 | |
1372 unsigned int v4; // eax@13 | |
1373 unsigned int v5; // esi@13 | |
1374 int v6; // eax@14 | |
1375 unsigned __int8 v7; // al@30 | |
1376 Party *v8; // esi@34 | |
1377 char *v9; // [sp-4h] [bp-3Ch]@10 | |
1378 char *v10; // [sp-4h] [bp-3Ch]@31 | |
1379 char *v11; // [sp-4h] [bp-3Ch]@38 | |
1380 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 | |
1381 int v13; // [sp+30h] [bp-8h]@1 | |
1382 int v14; // [sp+34h] [bp-4h]@1 | |
1383 | |
1384 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1385 Dst.Reset(); | |
1386 v2 = 0; | |
1387 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; | |
1388 v13 = 0; | |
1389 v14 = 0; | |
1390 if ( v3 ) | |
1391 { | |
1392 if ( !pActor->pMonsterInfo.uTreasureDiceRolls ) | |
1393 goto LABEL_9; | |
1394 do | |
1395 { | |
1396 ++v2; | |
1397 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | |
1398 } | |
1399 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); | |
1400 } | |
1401 else | |
1402 { | |
1403 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 ) | |
1404 goto LABEL_9; | |
377 | 1405 v14 = pActor->array_000234[3].uSpecEnchantmentType; |
0 | 1406 pActor->array_000234[3].Reset(); |
1407 } | |
1408 if ( v14 ) | |
1409 { | |
1410 party_finds_gold(v14, 0); | |
1411 viewparams->bRedrawGameUI = 1; | |
1412 } | |
1413 LABEL_9: | |
1414 if ( pActor->uCarriedItemID ) | |
1415 { | |
1416 Dst.Reset(); | |
1417 Dst.uItemID = pActor->uCarriedItemID; | |
1418 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1419 if ( v14 ) | |
189 | 1420 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9); |
0 | 1421 else |
189 | 1422 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9); |
0 | 1423 ShowStatusBarString(pTmpBuf2, 2u); |
1424 v4 = Dst.uItemID; | |
1425 v5 = Dst.uItemID; | |
1426 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) | |
1427 { | |
1428 v5 = Dst.uItemID; | |
1429 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1; | |
1430 Dst.uNumCharges = v6; | |
1431 Dst.uMaxCharges = v6; | |
1432 v4 = Dst.uItemID; | |
1433 } | |
1434 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) | |
377 | 1435 Dst.uEncantmentType = 2 * rand() % 4 + 2; |
0 | 1436 pItemsTable->SetSpecialBonus(&Dst); |
1437 if ( !pParty->AddItem(&Dst) ) | |
1438 pParty->SetHoldingItem(&Dst); | |
1439 pActor->uCarriedItemID = 0; | |
1440 if ( pActor->array_000234[0].uItemID ) | |
1441 { | |
1442 if ( !pParty->AddItem(pActor->array_000234) ) | |
1443 { | |
1444 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1445 pParty->SetHoldingItem(pActor->array_000234); | |
1446 } | |
1447 pActor->array_000234[0].Reset(); | |
1448 } | |
1449 if ( pActor->array_000234[1].uItemID ) | |
1450 { | |
1451 if ( !pParty->AddItem(&pActor->array_000234[1]) ) | |
1452 { | |
1453 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1454 pParty->SetHoldingItem(&pActor->array_000234[1]); | |
1455 } | |
1456 pActor->array_000234[1].Reset(); | |
1457 } | |
1458 LABEL_55: | |
1459 pActor->Remove(); | |
1460 return; | |
1461 } | |
1462 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) | |
1463 { | |
1464 if ( pActor->array_000234[3].uItemID ) | |
1465 { | |
1466 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); | |
1467 pActor->array_000234[3].Reset(); | |
1468 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1469 if ( v14 ) | |
1470 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); | |
1471 else | |
1472 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); | |
1473 ShowStatusBarString(pTmpBuf2, 2u); | |
1474 if ( !pParty->AddItem(&Dst) ) | |
1475 pParty->SetHoldingItem(&Dst); | |
1476 v13 = 1; | |
1477 } | |
1478 goto LABEL_44; | |
1479 } | |
1480 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | |
1481 { | |
1482 LABEL_44: | |
1483 v8 = pParty; | |
1484 goto LABEL_45; | |
1485 } | |
1486 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | |
1487 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1488 if ( v14 ) | |
1489 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); | |
1490 else | |
1491 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); | |
1492 ShowStatusBarString(pTmpBuf2, 2u); | |
1493 v8 = pParty; | |
1494 if ( !pParty->AddItem(&Dst) ) | |
1495 pParty->SetHoldingItem(&Dst); | |
1496 v13 = 1; | |
1497 LABEL_45: | |
1498 if ( pActor->array_000234[0].uItemID ) | |
1499 { | |
1500 if ( !v8->AddItem(pActor->array_000234) ) | |
1501 { | |
1502 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1503 v8->SetHoldingItem(pActor->array_000234); | |
1504 v13 = 1; | |
1505 } | |
1506 pActor->array_000234[0].Reset(); | |
1507 } | |
1508 if ( pActor->array_000234[1].uItemID ) | |
1509 { | |
1510 if ( !v8->AddItem(&pActor->array_000234[1]) ) | |
1511 { | |
1512 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1513 v8->SetHoldingItem(&pActor->array_000234[1]); | |
1514 v13 = 1; | |
1515 } | |
1516 pActor->array_000234[1].Reset(); | |
1517 } | |
1518 if ( !v13 || rand() % 100 < 90 ) | |
1519 goto LABEL_55; | |
1520 } | |
1521 | |
1522 //----- (00426E10) -------------------------------------------------------- | |
1523 int stru319::which_player_would_attack(Actor *pActor) | |
1524 { | |
1525 signed int v2; // ebx@1 | |
1526 int v3; // ecx@2 | |
1527 signed int v4; // edx@3 | |
1528 char v5; // zf@3 | |
1529 unsigned int v6; // eax@3 | |
1530 int v7; // eax@6 | |
1531 int v8; // eax@7 | |
1532 int v9; // eax@8 | |
1533 int v10; // eax@9 | |
1534 int v11; // eax@10 | |
1535 int v12; // eax@11 | |
1536 int v13; // esi@35 | |
1537 signed int v14; // edi@37 | |
1538 enum CHARACTER_RACE v15; // eax@44 | |
1539 Player *v16; // ecx@47 | |
1540 unsigned __int8 v17; // sf@50 | |
1541 unsigned __int8 v18; // of@50 | |
1542 int v19; // esi@52 | |
1543 Player *v20; // ecx@53 | |
1544 int result; // eax@57 | |
1545 int v22[16]; // [sp+8h] [bp-140h]@3 | |
1546 int v23[60]; // [sp+48h] [bp-100h]@48 | |
1547 int v24; // [sp+138h] [bp-10h]@2 | |
1548 int v25; // [sp+13Ch] [bp-Ch]@1 | |
1549 int v26; // [sp+140h] [bp-8h]@1 | |
1550 int v27; // [sp+144h] [bp-4h]@1 | |
1551 | |
1552 v27 = -1; | |
1553 v26 = -1; | |
1554 v25 = -1; | |
1555 v2 = 0; | |
1556 if ( pActor->pMonsterInfo.uAttackPreference ) | |
1557 { | |
1558 v3 = 0; | |
1559 v24 = 0; | |
1560 do | |
1561 { | |
1562 v4 = 1; | |
1563 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); | |
1564 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; | |
1565 v22[v3] = v6; | |
1566 if ( !v5 ) | |
1567 { | |
1568 if ( (signed int)v6 > 128 ) | |
1569 { | |
1570 switch ( v6 ) | |
1571 { | |
1572 case 0x100u: | |
1573 v27 = 8; | |
1574 break; | |
1575 case 0x200u: | |
1576 v25 = 0; | |
1577 break; | |
1578 case 0x400u: | |
1579 v25 = 1; | |
1580 break; | |
1581 case 0x800u: | |
1582 v26 = 0; | |
1583 break; | |
1584 case 0x1000u: | |
1585 v26 = 1; | |
1586 break; | |
1587 case 0x2000u: | |
1588 v26 = 3; | |
1589 break; | |
1590 case 0x4000u: | |
1591 v26 = 2; | |
1592 break; | |
1593 } | |
1594 } | |
1595 else | |
1596 { | |
1597 if ( v6 == 128 ) | |
1598 { | |
1599 v27 = 4; | |
1600 } | |
1601 else | |
1602 { | |
1603 v7 = v6 - 1; | |
1604 if ( v7 ) | |
1605 { | |
1606 v8 = v7 - 1; | |
1607 if ( v8 ) | |
1608 { | |
1609 v9 = v8 - 2; | |
1610 if ( v9 ) | |
1611 { | |
1612 v10 = v9 - 4; | |
1613 if ( v10 ) | |
1614 { | |
1615 v11 = v10 - 8; | |
1616 if ( v11 ) | |
1617 { | |
1618 v12 = v11 - 16; | |
1619 if ( v12 ) | |
1620 { | |
1621 if ( v12 == 32 ) | |
1622 v27 = 20; | |
1623 } | |
1624 else | |
1625 { | |
1626 v27 = 32; | |
1627 } | |
1628 } | |
1629 else | |
1630 { | |
1631 v27 = 24; | |
1632 } | |
1633 } | |
1634 else | |
1635 { | |
1636 v27 = 28; | |
1637 } | |
1638 } | |
1639 else | |
1640 { | |
1641 v27 = 16; | |
1642 } | |
1643 } | |
1644 else | |
1645 { | |
1646 v27 = 12; | |
1647 } | |
1648 } | |
1649 else | |
1650 { | |
1651 v27 = 0; | |
1652 } | |
1653 } | |
1654 } | |
1655 v2 = 0; | |
1656 v13 = 0; | |
1657 while ( 1 ) | |
1658 { | |
1659 v14 = 0; | |
135 | 1660 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType ) |
0 | 1661 v14 = v4; |
1662 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) | |
1663 v14 = v4; | |
1664 if ( v26 != -1 ) | |
1665 { | |
1666 v15 = pPlayers[v13 + 1]->GetRace(); | |
1667 if ( v26 == v15 ) | |
1668 v14 = 1; | |
1669 } | |
1670 if ( v14 == 1 ) | |
1671 { | |
1672 v16 = pPlayers[v13 + 1]; | |
1673 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) | |
1674 v23[v2++] = v13; | |
1675 } | |
1676 ++v13; | |
1677 if ( v13 >= 4 ) | |
1678 break; | |
1679 v4 = 1; | |
1680 } | |
1681 } | |
1682 v3 = v24 + 1; | |
1683 v18 = __OFSUB__(v24 + 1, 15); | |
1684 v17 = v24++ - 14 < 0; | |
1685 } | |
1686 while ( v17 ^ v18 ); | |
1687 if ( v2 ) | |
1688 goto LABEL_61; | |
1689 } | |
1690 v19 = 0; | |
1691 do | |
1692 { | |
1693 v20 = pPlayers[v19 + 1]; | |
1694 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) | |
1695 v23[v2++] = v19; | |
1696 ++v19; | |
1697 } | |
1698 while ( v19 < 4 ); | |
1699 if ( v2 ) | |
1700 LABEL_61: | |
1701 result = v23[rand() % v2]; | |
1702 else | |
1703 result = 0; | |
1704 return result; | |
1705 } | |
1706 | |
1707 | |
1708 //----- (0042704B) -------------------------------------------------------- | |
1709 bool stru319::special_ability_use_check(Actor *pActor, int a2) | |
1710 { | |
1711 stru319 *v3; // edi@1 | |
1712 signed int v4; // ebx@5 | |
1713 signed int v5; // edi@5 | |
1714 | |
1715 v3 = this; | |
1716 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
1717 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
1718 && rand() % 100 < 5 ) | |
1719 pActor->_44FD29(a2); | |
1720 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); | |
1721 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); | |
1722 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
1723 return 2; | |
1724 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
1725 return 3; | |
1726 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance; | |
1727 } | |
1728 | |
1729 //----- (00427102) -------------------------------------------------------- | |
1730 int stru319::_427102(Actor *pActor, signed int a2) | |
1731 { | |
1732 unsigned __int8 v3; // cf@11 | |
1733 unsigned __int8 v4; // zf@11 | |
1734 SpellBuff *v6; // ecx@46 | |
89 | 1735 Player *v7; // esi@49 |
0 | 1736 signed int v8; // edx@50 |
89 | 1737 SpellBuff *v9; // ecx@50 |
0 | 1738 |
1739 if ( a2 > 73 ) | |
1740 { | |
1741 if ( a2 == 77 ) | |
1742 { | |
1743 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP ) | |
1744 return 0; | |
1745 return 1; | |
1746 } | |
1747 if ( a2 == 80 ) | |
1748 { | |
1749 v6 = pParty->pPartyBuffs; | |
1750 while ( (signed __int64)v6->uExpireTime <= 0 ) | |
1751 { | |
1752 ++v6; | |
89 | 1753 if ( v6 > &pParty->pPartyBuffs[19] ) |
1754 { | |
1755 v7 = pParty->pPlayers;//[0].pPlayerBuffs; | |
0 | 1756 v8 = 0; |
89 | 1757 v9 = v7->pPlayerBuffs; |
1758 while ( v9->uExpireTime <= 0i64 ) | |
0 | 1759 { |
1760 ++v8; | |
89 | 1761 ++v9; |
0 | 1762 if ( v8 >= 24 ) |
1763 { | |
89 | 1764 ++v7; |
1765 if ( v7 <= &pParty->pPlayers[3] ) | |
1766 { | |
1767 v8 = 0; | |
1768 v9 = v7->pPlayerBuffs; | |
1769 } | |
1770 else | |
1771 return 0; | |
0 | 1772 } |
1773 } | |
1774 return 1; | |
1775 } | |
1776 } | |
1777 return 1; | |
1778 } | |
1779 if ( a2 == 85 ) | |
1780 { | |
1781 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 ) | |
1782 return 1; | |
1783 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 ) | |
1784 return 0; | |
1785 v3 = 0; | |
1786 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0; | |
1787 } | |
1788 else | |
1789 { | |
1790 if ( a2 == 86 ) | |
1791 { | |
1792 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 ) | |
1793 return 1; | |
1794 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 ) | |
1795 return 0; | |
1796 v3 = 0; | |
1797 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0; | |
1798 } | |
1799 else | |
1800 { | |
1801 if ( a2 != 95 || SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 ) | |
1802 return 1; | |
1803 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 ) | |
1804 return 0; | |
1805 v3 = 0; | |
1806 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0; | |
1807 } | |
1808 } | |
1809 } | |
1810 else | |
1811 { | |
1812 if ( a2 == 73 ) | |
1813 { | |
1814 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 ) | |
1815 return 1; | |
1816 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 ) | |
1817 return 0; | |
1818 v3 = 0; | |
1819 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0; | |
1820 } | |
89 | 1821 else if ( a2 == 5 ) |
0 | 1822 { |
1823 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 ) | |
1824 return 1; | |
1825 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 ) | |
1826 return 0; | |
1827 v3 = 0; | |
1828 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0; | |
1829 } | |
89 | 1830 else if ( a2 == 17 ) |
0 | 1831 { |
1832 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 ) | |
1833 return 1; | |
1834 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 ) | |
1835 return 0; | |
1836 v3 = 0; | |
1837 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0; | |
1838 } | |
89 | 1839 else if ( a2 == 38 ) |
0 | 1840 { |
1841 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 ) | |
1842 return 1; | |
1843 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 ) | |
1844 return 0; | |
1845 v3 = 0; | |
1846 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0; | |
1847 } | |
89 | 1848 else if ( a2 == 46 ) |
0 | 1849 { |
1850 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 ) | |
1851 return 1; | |
1852 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 ) | |
1853 return 0; | |
1854 v3 = 0; | |
1855 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0; | |
1856 } | |
89 | 1857 else |
1858 { | |
1859 if ( a2 != 47 ) | |
1860 { | |
1861 if ( a2 != 51 || SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 ) | |
1862 return 1; | |
1863 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 ) | |
1864 { | |
1865 v3 = 0; | |
1866 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0; | |
1867 } | |
1868 else | |
1869 return 0; | |
1870 } | |
1871 else | |
1872 { | |
1873 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 ) | |
1874 return 1; | |
1875 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 ) | |
1876 return 0; | |
1877 v3 = 0; | |
1878 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0; | |
1879 } | |
1880 } | |
0 | 1881 } |
1882 if ( !(v3 | v4) ) | |
1883 return 0; | |
1884 return 1; | |
1885 } | |
1886 | |
1887 //----- (004272F5) -------------------------------------------------------- | |
1888 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
1889 { | |
1890 signed int v5; // esi@1 | |
1891 signed int v6; // edi@1 | |
1892 int v7; // esi@8 | |
1893 int v8; // eax@9 | |
1894 int v9; // edx@11 | |
1895 int v10; // edx@13 | |
1896 int v11; // esi@13 | |
1897 unsigned __int8 v12; // sf@13 | |
1898 unsigned __int8 v13; // of@13 | |
1899 int v14; // edx@14 | |
1900 int v15; // eax@14 | |
1901 signed int result; // eax@17 | |
1902 | |
1903 v5 = pActor->pMonsterInfo.uAC; | |
1904 v6 = 0; | |
1905 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 ) | |
1906 v5 /= 2; | |
1907 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1908 v6 = pActor->pActorBuffs[15].uPower; | |
1909 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 ) | |
1910 v6 = pActor->pActorBuffs[16].uPower; | |
1911 v7 = v6 + v5; | |
1912 if ( a3 ) | |
1913 v8 = pPlayer->GetRangedAttack(); | |
1914 else | |
1915 v8 = pPlayer->GetActualAttack(0); | |
1916 v9 = rand() % (v7 + 2 * v8 + 30); | |
1917 if ( a3 == 2 ) | |
1918 { | |
1919 v14 = a4 + v9; | |
1920 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1921 } | |
1922 else | |
1923 { | |
1924 if ( a3 != 3 ) | |
1925 { | |
1926 v10 = a4 + v9; | |
1927 v11 = v7 + 15; | |
1928 v13 = __OFSUB__(v10, v11); | |
1929 v12 = v10 - v11 < 0; | |
1930 goto LABEL_16; | |
1931 } | |
1932 v14 = a4 + v9; | |
1933 v15 = 2 * v7 + 30; | |
1934 } | |
1935 v13 = __OFSUB__(v14, v15); | |
1936 v12 = v14 - v15 < 0; | |
1937 LABEL_16: | |
1938 if ( v12 ^ v13 ) | |
1939 result = 0; | |
1940 else | |
1941 result = 1; | |
1942 return result; | |
1943 } | |
1944 | |
1945 //----- (004273BB) -------------------------------------------------------- | |
1946 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
1947 { | |
1948 Actor *v5; // ecx@1 | |
1949 signed int v6; // ebx@1 | |
1950 signed int v7; // esi@1 | |
1951 unsigned __int8 v8; // zf@1 | |
1952 unsigned __int8 v9; // sf@1 | |
1953 int v10; // ebx@10 | |
1954 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
1955 | |
1956 v5 = a2; | |
1957 v6 = a2->pMonsterInfo.uAC; | |
1958 v7 = 0; | |
1959 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0; | |
1960 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0; | |
1961 a2a = 0; | |
1962 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) ) | |
1963 v6 /= 2; | |
1964 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 ) | |
1965 v7 = v5->pActorBuffs[14].uPower; | |
1966 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 ) | |
1967 v7 = v5->pActorBuffs[16].uPower; | |
1968 v10 = v7 + v6; | |
1969 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1970 a2a = pActor->pActorBuffs[14].uPower; | |
1971 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a ) | |
1972 a2a = pActor->pActorBuffs[17].uPower; | |
1973 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1974 { | |
1975 a2a += pActor->pActorBuffs[11].uPower; | |
1976 pActor->pActorBuffs[11].Reset(); | |
1977 } | |
1978 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
1979 } | |
1980 | |
1981 //----- (004274AD) -------------------------------------------------------- | |
1982 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
1983 { | |
1984 signed int v3; // edi@1 | |
1985 signed int v4; // esi@8 | |
1986 int v5; // esi@8 | |
1987 | |
1988 v3 = 0; | |
1989 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1990 v3 = pActor->pActorBuffs[14].uPower; | |
1991 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 ) | |
1992 v3 = pActor->pActorBuffs[17].uPower; | |
1993 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1994 { | |
1995 v3 += pActor->pActorBuffs[11].uPower; | |
1996 pActor->pActorBuffs[11].Reset(); | |
1997 } | |
1998 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
1999 v5 = rand() % v4 + 1; | |
2000 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
2001 } | |
2002 | |
2003 //----- (00427546) -------------------------------------------------------- | |
2004 int stru319::_427546(int a2) | |
2005 { | |
2006 int result; // eax@2 | |
2007 | |
2008 if ( a2 >= 0 ) | |
2009 { | |
2010 if ( a2 >= 1 ) | |
2011 result = (a2 >= 2) + 2; | |
2012 else | |
2013 result = 1; | |
2014 } | |
2015 else | |
2016 { | |
2017 result = 0; | |
2018 } | |
2019 return result; | |
2020 } | |
2021 | |
2022 //----- (0042756B) -------------------------------------------------------- | |
2023 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
2024 { | |
2025 int v4; // edx@1 | |
2026 int v5; // ecx@1 | |
2027 signed int v6; // eax@4 | |
2028 signed int result; // eax@17 | |
2029 signed int v8; // esi@18 | |
2030 | |
2031 v4 = 0; | |
2032 v5 = 0; | |
2033 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
2034 v5 = pActor->pActorBuffs[14].uPower; | |
2035 switch ( a2 ) | |
2036 { | |
2037 case 4: | |
2038 v6 = pActor->pMonsterInfo.uResPhysical; | |
2039 break; | |
2040 case 0: | |
2041 v6 = pActor->pMonsterInfo.uResFire; | |
2042 goto LABEL_12; | |
2043 case 1: | |
2044 v6 = pActor->pMonsterInfo.uResAir; | |
2045 goto LABEL_12; | |
2046 case 2: | |
2047 v6 = pActor->pMonsterInfo.uResWater; | |
2048 goto LABEL_12; | |
2049 case 3: | |
2050 v6 = pActor->pMonsterInfo.uResEarth; | |
2051 goto LABEL_12; | |
2052 case 6: | |
2053 v6 = pActor->pMonsterInfo.uResSpirit; | |
2054 break; | |
2055 case 7: | |
2056 v6 = pActor->pMonsterInfo.uResMind; | |
2057 goto LABEL_12; | |
2058 case 8: | |
2059 v6 = pActor->pMonsterInfo.uResBody; | |
2060 LABEL_12: | |
2061 v4 = v5; | |
2062 break; | |
2063 case 9: | |
2064 v6 = pActor->pMonsterInfo.uResLight; | |
2065 break; | |
2066 case 10: | |
2067 v6 = pActor->pMonsterInfo.uResDark; | |
2068 break; | |
2069 default: | |
2070 v6 = 0; | |
2071 break; | |
2072 } | |
2073 if ( v6 < 200 ) | |
2074 { | |
2075 v8 = v4 + v6 + 30; | |
2076 if ( rand() % v8 >= 30 ) | |
2077 { | |
2078 a3 >>= 1; | |
2079 if ( rand() % v8 >= 30 ) | |
2080 { | |
2081 a3 >>= 1; | |
2082 if ( rand() % v8 >= 30 ) | |
2083 { | |
2084 a3 >>= 1; | |
2085 if ( rand() % v8 >= 30 ) | |
2086 a3 >>= 1; | |
2087 } | |
2088 } | |
2089 } | |
2090 result = a3; | |
2091 } | |
2092 else | |
2093 { | |
2094 result = 0; | |
2095 } | |
2096 return result; | |
2097 } | |
2098 | |
2099 //----- (00427662) -------------------------------------------------------- | |
2100 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
2101 { | |
2102 Actor *v3; // edi@2 | |
2103 signed int v4; // esi@2 | |
2104 bool result; // eax@13 | |
2105 | |
2106 switch ( uType ) | |
2107 { | |
2108 case 0u: | |
2109 v3 = pActor; | |
2110 v4 = pActor->pMonsterInfo.uResFire; | |
2111 goto LABEL_12; | |
2112 case 1u: | |
2113 v3 = pActor; | |
2114 v4 = pActor->pMonsterInfo.uResAir; | |
2115 goto LABEL_12; | |
2116 case 2u: | |
2117 v3 = pActor; | |
2118 v4 = pActor->pMonsterInfo.uResWater; | |
2119 goto LABEL_12; | |
2120 case 3u: | |
2121 v3 = pActor; | |
2122 v4 = pActor->pMonsterInfo.uResEarth; | |
2123 goto LABEL_12; | |
2124 case 7u: | |
2125 v3 = pActor; | |
2126 v4 = pActor->pMonsterInfo.uResMind; | |
2127 goto LABEL_12; | |
2128 case 6u: | |
2129 v3 = pActor; | |
2130 v4 = pActor->pMonsterInfo.uResSpirit; | |
2131 goto LABEL_12; | |
2132 case 8u: | |
2133 v3 = pActor; | |
2134 v4 = pActor->pMonsterInfo.uResBody; | |
2135 goto LABEL_12; | |
2136 case 9u: | |
2137 v3 = pActor; | |
2138 v4 = pActor->pMonsterInfo.uResLight; | |
2139 goto LABEL_12; | |
2140 case 0xAu: | |
2141 v3 = pActor; | |
2142 v4 = pActor->pMonsterInfo.uResDark; | |
2143 goto LABEL_12; | |
2144 case 4u: | |
2145 v3 = pActor; | |
2146 v4 = pActor->pMonsterInfo.uResPhysical; | |
2147 LABEL_12: | |
2148 if ( v4 < 200 ) | |
2149 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | |
2150 else | |
2151 result = 0; | |
2152 break; | |
2153 default: | |
2154 result = 1; | |
2155 break; | |
2156 } | |
2157 return result; | |
2158 } | |
2159 | |
2160 | |
2161 //----- (00427769) -------------------------------------------------------- | |
2162 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
2163 { | |
2164 bool result; // eax@2 | |
2165 | |
2166 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) | |
2167 result = 1; | |
2168 else | |
2169 result = 0; | |
2170 return result; | |
2171 } | |
2172 | |
2173 //----- (0042777D) -------------------------------------------------------- | |
319 | 2174 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) |
0 | 2175 { |
370 | 2176 //bool result; // eax@2 |
0 | 2177 __int16 v6; // bx@4 |
2178 Player *v7; // eax@4 | |
2179 char v8; // zf@12 | |
2180 unsigned __int16 v9; // cx@16 | |
2181 unsigned int v10; // eax@18 | |
2182 unsigned __int8 v11; // sf@18 | |
2183 unsigned __int8 v12; // of@18 | |
2184 unsigned __int16 v13; // cx@21 | |
2185 unsigned int v14; // eax@23 | |
2186 stru277 *v15; // esi@27 | |
2187 stru277 *v16; // eax@28 | |
2188 GUIWindow *v17; // eax@43 | |
2189 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | |
2190 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | |
2191 unsigned int v20; // [sp-28h] [bp-40h]@44 | |
2192 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | |
2193 unsigned int v22; // [sp-20h] [bp-38h]@44 | |
2194 int v23; // [sp-1Ch] [bp-34h]@44 | |
2195 int v24; // [sp-18h] [bp-30h]@44 | |
2196 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | |
2197 unsigned int v26; // [sp-10h] [bp-28h]@43 | |
2198 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | |
2199 char *v28; // [sp-8h] [bp-20h]@43 | |
2200 Texture *v29; // [sp-4h] [bp-1Ch]@43 | |
2201 __int16 a3a; // [sp+10h] [bp-8h]@1 | |
2202 __int16 a2a; // [sp+14h] [bp-4h]@1 | |
2203 | |
2204 a3a = uPlayerID; | |
2205 a2a = a1; | |
370 | 2206 |
2207 //if ( pParty->bTurnBasedModeOn != 1 | |
2208 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | |
2209 if (pParty->bTurnBasedModeOn) | |
0 | 2210 { |
370 | 2211 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) |
2212 return; | |
2213 } | |
2214 | |
2215 | |
0 | 2216 v6 = a5; |
2217 v7 = &pParty->pPlayers[uPlayerID]; | |
2218 if ( !(a5 & 0x10) ) | |
2219 { | |
2220 switch ( a1 ) | |
2221 { | |
2222 case 47: | |
2223 case 68: | |
2224 case 89: | |
2225 HIBYTE(v6) = HIBYTE(a5) | 1; | |
2226 break; | |
2227 case 4: | |
2228 case 28: | |
2229 case 30: | |
2230 case 91: | |
2231 LOBYTE(v6) = a5 | 0x80; | |
2232 break; | |
2233 case 2: | |
2234 case 6: | |
2235 case 11: | |
2236 case 18: | |
2237 case 20: | |
2238 case 24: | |
2239 case 26: | |
2240 case 29: | |
2241 case 32: | |
2242 case 34: | |
2243 case 35: | |
2244 case 37: | |
2245 case 39: | |
2246 case 44: | |
2247 case 52: | |
2248 case 57: | |
2249 case 60: | |
2250 case 65: | |
2251 case 70: | |
2252 case 76: | |
2253 case 78: | |
2254 case 79: | |
2255 case 87: | |
2256 case 90: | |
2257 case 92: | |
2258 case 93: | |
2259 case 97: | |
2260 if ( !a6 ) | |
2261 goto LABEL_9; | |
2262 break; | |
2263 case 59: | |
2264 case 62: | |
2265 case 66: | |
2266 case 81: | |
2267 case 94: | |
2268 LABEL_9: | |
2269 v6 = a5 | 8; | |
2270 break; | |
2271 case 42: | |
2272 v6 = a5 | 0x40; | |
2273 break; | |
2274 case 46: | |
2275 if ( a4 ) | |
2276 v8 = (a4 & 0x1C0) == 0; | |
2277 else | |
2278 v8 = (v7->pActiveSkills[16] & 0x1C0) == 0; | |
2279 if ( v8 ) | |
2280 goto LABEL_25; | |
2281 break; | |
2282 case 50: | |
2283 v9 = a4; | |
2284 if ( !a4 ) | |
2285 v9 = v7->pActiveSkills[16]; | |
2286 goto LABEL_18; | |
2287 case 95: | |
2288 v9 = a4; | |
2289 if ( !a4 ) | |
2290 v9 = v7->pActiveSkills[20]; | |
2291 LABEL_18: | |
2292 v10 = SkillToMastery(v9); | |
2293 v12 = __OFSUB__(v10, 3); | |
2294 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2295 goto LABEL_24; | |
2296 case 73: | |
2297 v13 = a4; | |
2298 if ( !a4 ) | |
2299 v13 = v7->pActiveSkills[18]; | |
2300 v14 = SkillToMastery(v13); | |
2301 v12 = __OFSUB__(v14, 4); | |
2302 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2303 LABEL_24: | |
2304 if ( v11 ^ v12 ) | |
2305 goto LABEL_25; | |
2306 break; | |
2307 case 40: | |
2308 case 49: | |
2309 case 53: | |
2310 case 55: | |
2311 case 56: | |
2312 case 61: | |
2313 case 64: | |
2314 case 67: | |
2315 case 71: | |
2316 case 72: | |
2317 case 74: | |
2318 LABEL_25: | |
2319 v6 = a5 | 2; | |
2320 break; | |
2321 case 96: | |
2322 HIBYTE(v6) = HIBYTE(a5) | 2; | |
2323 break; | |
2324 default: | |
2325 break; | |
2326 } | |
2327 } | |
370 | 2328 |
0 | 2329 v15 = pStru277; |
2330 if ( v6 & 0x3CA ) | |
2331 { | |
2332 v16 = pStru277; | |
2333 while ( !(v16->field_8 & 0x3CA) ) | |
2334 { | |
2335 ++v16; | |
2336 if ( (signed int)v16 >= (signed int)&unk_50C190 ) | |
2337 goto LABEL_33; | |
2338 } | |
2339 v16->spellnum = 0; | |
2340 } | |
2341 do | |
2342 { | |
2343 LABEL_33: | |
2344 if ( v15->spellnum ) | |
2345 { | |
2346 v8 = (v15->field_8 & 0x3CA) == 0; | |
2347 v15->spellnum = 0; | |
2348 if ( !v8 ) | |
2349 { | |
2350 pGUIWindow_Settings->Release(); | |
2351 pGUIWindow_Settings = 0; | |
2352 pMouse->SetCursorBitmap("MICON1"); | |
2353 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2354 unk_50C9A0 = 0; | |
2355 back_to_game(); | |
2356 } | |
2357 } | |
2358 ++v15; | |
2359 } | |
2360 while ( (signed int)v15 < (signed int)&unk_50C190 ); | |
370 | 2361 int result = pStru277->PushStru277(a2a, a3a, a4, v6, a6); |
0 | 2362 if ( result != -1 ) |
2363 { | |
2364 if ( v6 & 2 ) | |
2365 { | |
2366 if ( pGUIWindow_Settings ) | |
319 | 2367 return; |
0 | 2368 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2369 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2370 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2371 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2372 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
319 | 2373 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2374 return; | |
0 | 2375 } |
2376 if ( v6 & 8 ) | |
2377 { | |
2378 if ( pGUIWindow_Settings ) | |
319 | 2379 return; |
0 | 2380 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2381 v29 = 0; | |
2382 v28 = ""; | |
2383 v27 = 0; | |
2384 v26 = 0; | |
2385 v25 = 70; | |
2386 LABEL_44: | |
2387 v24 = 0; | |
2388 v23 = 1; | |
2389 v22 = 344; | |
2390 v21 = 460; | |
2391 v20 = 8; | |
2392 v19 = 8; | |
2393 pGUIWindow_Settings = v17; | |
2394 v18 = v17; | |
2395 LABEL_56: | |
2396 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
319 | 2397 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2398 return; | |
0 | 2399 } |
2400 if ( v6 & 0x40 ) | |
2401 { | |
2402 if ( pGUIWindow_Settings ) | |
319 | 2403 return; |
0 | 2404 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2405 v29 = 0; | |
2406 v28 = ""; | |
2407 v27 = 0; | |
2408 v26 = 0; | |
2409 v25 = 190; | |
2410 goto LABEL_44; | |
2411 } | |
2412 if ( (char)v6 < 0 ) | |
2413 { | |
2414 if ( pGUIWindow_Settings ) | |
319 | 2415 return; |
0 | 2416 ++pIcons_LOD->uTexturePacksCount; |
2417 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2418 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2419 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2420 unk_50C9A0 = 1; | |
2421 some_active_character = uActiveCharacter; | |
319 | 2422 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2423 return; | |
0 | 2424 } |
2425 if ( HIBYTE(v6) & 1 ) | |
2426 { | |
2427 if ( pGUIWindow_Settings ) | |
319 | 2428 return; |
2429 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
0 | 2430 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); |
2431 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2432 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2433 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
423 | 2434 pGUIWindow_Settings->CreateButton(8, 8, 460, 344, 1, 0, 140, 0, 0, "", NULL); |
2435 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
0 | 2436 } |
2437 if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings ) | |
2438 { | |
319 | 2439 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
0 | 2440 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( |
2441 0x1D5u, | |
2442 0xB2u, | |
319 | 2443 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), |
2444 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
0 | 2445 1, |
2446 0, | |
2447 0xBCu, | |
2448 0, | |
2449 0, | |
2450 "", | |
319 | 2451 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), |
0 | 2452 0); |
2453 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2454 0x272u, | |
2455 0xB2u, | |
319 | 2456 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), |
2457 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
0 | 2458 1, |
2459 0, | |
2460 0xBCu, | |
2461 1u, | |
2462 0, | |
2463 "", | |
319 | 2464 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), |
0 | 2465 0); |
2466 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
319 | 2467 pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0); |
0 | 2468 } |
2469 } | |
2470 } | |
2471 | |
2472 | |
2473 | |
2474 //----- (00427D48) -------------------------------------------------------- | |
2475 void stru277::_427D48(unsigned int uPlayerID) | |
2476 { | |
2477 stru277 *v2; // esi@1 | |
2478 signed int v3; // ebx@1 | |
2479 | |
2480 v2 = this; | |
2481 v3 = 10; | |
2482 do | |
2483 { | |
2484 if ( v2->spellnum ) | |
2485 { | |
2486 if ( v2->field_8 & 0x3CA ) | |
2487 { | |
2488 v2->spellnum = 0; | |
2489 pGUIWindow_Settings->Release(); | |
2490 pGUIWindow_Settings = 0; | |
2491 pMouse->SetCursorBitmap("MICON1"); | |
2492 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2493 unk_50C9A0 = 0; | |
2494 back_to_game(); | |
2495 } | |
2496 } | |
2497 ++v2; | |
2498 --v3; | |
2499 } | |
2500 while ( v3 ); | |
2501 } | |
2502 | |
2503 //----- (00427DA0) -------------------------------------------------------- | |
2504 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6) | |
2505 { | |
2506 unsigned int result; // eax@1 | |
2507 stru277 *v7; // edx@1 | |
2508 stru277 *v8; // ecx@5 | |
2509 | |
2510 result = 0; | |
2511 v7 = this; | |
2512 while ( v7->spellnum ) | |
2513 { | |
2514 ++result; | |
2515 ++v7; | |
2516 if ( (signed int)result >= 10 ) | |
2517 goto LABEL_8; | |
2518 } | |
2519 v8 = &this[result]; | |
2520 v8->spellnum = a2; | |
2521 v8->uPlayerID = uPlayerID; | |
2522 if ( a5 & 0x10 ) | |
2523 v8->uPlayerID_2 = uPlayerID; | |
2524 v8->field_6 = 0; | |
2525 *(int *)&v8->field_C = 0; | |
2526 v8->field_8 = a5; | |
2527 v8->field_A = a4; | |
2528 v8->field_10 = a6; | |
2529 LABEL_8: | |
2530 if ( result == 10 ) | |
2531 result = -1; | |
2532 return result; | |
2533 } | |
2534 | |
2535 //----- (00427E01) -------------------------------------------------------- | |
2536 void stru277::_427E01_cast_spell() | |
2537 { | |
2538 int v1; // esi@1 | |
2539 int v2; // edi@1 | |
2540 stru277 *v3; // ebx@2 | |
2541 signed int v4; // eax@8 | |
2542 __int16 v5; // ax@9 | |
2543 signed int v6; // eax@14 | |
2544 __int16 v7; // ax@23 | |
2545 __int16 v8; // ax@24 | |
2546 char v9; // al@44 | |
2547 int v10; // eax@45 | |
2548 unsigned __int16 v11; // cx@45 | |
2549 signed int v12; // ecx@48 | |
2550 int v13; // eax@53 | |
2551 unsigned __int8 v14; // zf@53 | |
2552 unsigned int v15; // edx@53 | |
2553 signed int v16; // eax@53 | |
2554 Player *v17; // esi@70 | |
2555 int v18; // eax@72 | |
2556 int v19; // eax@74 | |
2557 char *v20; // eax@74 | |
2558 signed int i; // esi@76 | |
2559 int v22; // eax@88 | |
2560 __int16 v23; // ax@88 | |
2561 int v24; // ecx@93 | |
2562 int v25; // ecx@94 | |
2563 signed __int64 v26; // qax@100 | |
2564 char *v27; // ecx@100 | |
2565 unsigned __int64 v28; // qax@102 | |
2566 int v29; // ecx@105 | |
2567 int v30; // ecx@106 | |
2568 int v31; // eax@112 | |
2569 int v32; // eax@112 | |
2570 char *v33; // edx@113 | |
2571 int v34; // eax@121 | |
2572 int v35; // eax@123 | |
2573 int v36; // edx@125 | |
2574 int v37; // eax@129 | |
2575 signed int v38; // edi@129 | |
2576 signed int v39; // eax@129 | |
2577 int v40; // ecx@129 | |
2578 int v41; // eax@129 | |
2579 signed int v42; // eax@129 | |
2580 int *v43; // ecx@129 | |
2581 int v44; // eax@132 | |
2582 int v45; // ecx@132 | |
2583 int v46; // eax@132 | |
2584 unsigned int v47; // edx@133 | |
2585 int v48; // eax@137 | |
2586 int v49; // eax@137 | |
2587 int v50; // eax@141 | |
2588 int v51; // eax@146 | |
2589 __int16 v52; // ax@153 | |
2590 int v53; // eax@153 | |
2591 signed __int64 v54; // qax@164 | |
2592 int v55; // edi@164 | |
2593 stru6 *v56; // eax@165 | |
2594 int v57; // eax@169 | |
2595 signed __int64 v58; // qax@177 | |
2596 int v59; // edi@177 | |
2597 unsigned __int16 v60; // ax@184 | |
2598 int v61; // ecx@184 | |
2599 int v62; // eax@186 | |
2600 int v63; // ecx@187 | |
2601 int v64; // ecx@188 | |
2602 int v65; // ecx@189 | |
2603 const char *v66; // ecx@200 | |
2604 unsigned int v67; // edx@201 | |
2605 char v68; // al@207 | |
89 | 2606 ItemGen *v69; // esi@211 |
0 | 2607 int v70; // ecx@214 |
2608 int v71; // ecx@215 | |
2609 int v72; // ecx@216 | |
2610 __int16 v73; // ST1C_2@222 | |
2611 __int16 v74; // ST18_2@222 | |
2612 stru6 *v75; // eax@222 | |
2613 int v76; // ecx@223 | |
2614 int v77; // ecx@224 | |
2615 int v78; // ecx@225 | |
2616 int v79; // eax@227 | |
2617 int v80; // eax@232 | |
2618 __int16 v81; // ST18_2@245 | |
2619 stru6 *v82; // eax@245 | |
2620 signed int v83; // edi@245 | |
2621 __int16 v84; // ST18_2@245 | |
2622 stru6 *v85; // eax@245 | |
2623 __int16 v86; // ST18_2@245 | |
2624 stru6 *v87; // eax@245 | |
2625 __int16 v88; // ST18_2@245 | |
2626 stru6 *v89; // eax@245 | |
2627 double v90; // st7@245 | |
2628 int v91; // eax@250 | |
89 | 2629 Player *v92; // eax@255 |
0 | 2630 __int16 v93; // ST18_2@260 |
2631 stru6 *v94; // eax@260 | |
2632 __int16 v95; // ST18_2@260 | |
2633 stru6 *v96; // eax@260 | |
2634 __int16 v97; // ST18_2@260 | |
2635 stru6 *v98; // eax@260 | |
2636 __int16 v99; // ST18_2@260 | |
2637 stru6 *v100; // eax@260 | |
2638 int v101; // ecx@261 | |
2639 int v102; // ecx@262 | |
2640 int v103; // ecx@263 | |
2641 int v104; // eax@265 | |
2642 int v105; // edi@271 | |
2643 __int16 v106; // ST18_2@272 | |
2644 stru6 *v107; // eax@272 | |
2645 __int16 v108; // ST1C_2@274 | |
2646 __int16 v109; // ST18_2@274 | |
2647 stru6 *v110; // eax@274 | |
2648 int v111; // eax@274 | |
2649 Actor *v112; // esi@278 | |
2650 int v113; // eax@278 | |
2651 int v114; // ebx@278 | |
2652 unsigned int v115; // ecx@278 | |
2653 int v116; // edx@279 | |
2654 int v117; // edx@281 | |
2655 int v118; // edx@283 | |
2656 int v119; // edi@286 | |
2657 int v120; // eax@286 | |
2658 int v121; // eax@286 | |
2659 signed int v122; // eax@286 | |
2660 int v123; // ecx@288 | |
2661 int v124; // ecx@289 | |
2662 int v125; // ecx@290 | |
2663 int v126; // eax@292 | |
2664 int v127; // eax@296 | |
2665 __int16 v128; // ST18_2@303 | |
2666 stru6 *v129; // eax@303 | |
2667 __int16 v130; // ST18_2@303 | |
2668 stru6 *v131; // eax@303 | |
2669 __int16 v132; // ST18_2@303 | |
2670 stru6 *v133; // eax@303 | |
2671 __int16 v134; // ST18_2@303 | |
2672 stru6 *v135; // eax@303 | |
2673 unsigned __int64 v136; // qax@304 | |
2674 char *v137; // ecx@304 | |
2675 int v138; // ecx@305 | |
2676 int v139; // ecx@306 | |
2677 int v140; // eax@308 | |
2678 __int16 v141; // ST18_2@311 | |
2679 stru6 *v142; // eax@311 | |
2680 __int16 v143; // ST18_2@311 | |
2681 stru6 *v144; // eax@311 | |
2682 __int16 v145; // ST18_2@311 | |
2683 stru6 *v146; // eax@311 | |
2684 __int16 v147; // ST18_2@311 | |
2685 stru6 *v148; // eax@311 | |
2686 int v149; // ecx@312 | |
2687 int v150; // ecx@313 | |
2688 int v151; // ecx@314 | |
2689 signed int v152; // eax@322 | |
2690 int v153; // ecx@322 | |
2691 int v154; // eax@322 | |
2692 int v155; // eax@323 | |
2693 int v156; // eax@323 | |
2694 int v157; // eax@326 | |
2695 double v158; // st7@326 | |
2696 double v159; // st6@326 | |
2697 signed __int64 v160; // qtt@334 | |
2698 int v161; // eax@339 | |
2699 int v162; // edi@340 | |
2700 int v163; // eax@340 | |
2701 signed int v164; // eax@340 | |
2702 signed int v165; // edi@340 | |
2703 stru6 *v166; // eax@340 | |
2704 stru6 *v167; // eax@340 | |
2705 signed int v168; // edi@343 | |
2706 int v169; // eax@344 | |
2707 int v170; // ecx@346 | |
2708 int v171; // ecx@347 | |
2709 int v172; // ecx@348 | |
2710 int v173; // edi@350 | |
2711 signed int v174; // edi@355 | |
2712 __int16 v175; // ST18_2@357 | |
2713 stru6 *v176; // eax@357 | |
2714 __int16 v177; // ST18_2@357 | |
2715 stru6 *v178; // eax@357 | |
2716 __int16 v179; // ST18_2@357 | |
2717 stru6 *v180; // eax@357 | |
2718 __int16 v181; // ST18_2@357 | |
2719 stru6 *v182; // eax@357 | |
2720 signed __int64 v183; // qax@357 | |
2721 int v184; // ecx@358 | |
2722 int v185; // ecx@359 | |
2723 int v186; // ecx@360 | |
2724 int v187; // eax@367 | |
2725 int v188; // esi@369 | |
2726 int v189; // edi@369 | |
2727 const char *v190; // ecx@377 | |
2728 signed int v191; // edi@379 | |
2729 int v192; // ecx@382 | |
2730 int v193; // ecx@383 | |
2731 int v194; // ecx@384 | |
2732 int v195; // eax@386 | |
2733 int v196; // eax@387 | |
2734 __int16 v197; // ST18_2@395 | |
2735 stru6 *v198; // eax@395 | |
2736 __int16 v199; // ST18_2@395 | |
2737 stru6 *v200; // eax@395 | |
2738 __int16 v201; // ST18_2@395 | |
2739 stru6 *v202; // eax@395 | |
2740 __int16 v203; // ST18_2@395 | |
2741 stru6 *v204; // eax@395 | |
2742 signed int v205; // edi@405 | |
2743 int v206; // eax@407 | |
2744 __int16 v207; // cx@407 | |
2745 int v208; // eax@411 | |
2746 signed int v209; // ecx@412 | |
2747 int v210; // edx@412 | |
2748 signed int v211; // ecx@412 | |
2749 int v212; // eax@413 | |
2750 int v213; // eax@413 | |
2751 int v214; // eax@413 | |
2752 int v215; // eax@415 | |
2753 double v216; // st7@415 | |
2754 double v217; // st6@415 | |
2755 signed __int64 v218; // qtt@423 | |
2756 int v219; // ecx@425 | |
2757 int v220; // ecx@426 | |
2758 int v221; // edi@428 | |
2759 char *v222; // edi@434 | |
2760 char v223; // al@438 | |
2761 int v224; // ecx@442 | |
2762 int v225; // ecx@443 | |
2763 int v226; // eax@451 | |
2764 int v227; // esi@453 | |
2765 unsigned int v228; // edi@454 | |
2766 int v229; // edi@466 | |
2767 __int16 v230; // ST18_2@469 | |
2768 stru6 *v231; // eax@469 | |
2769 signed int v232; // esi@469 | |
2770 __int16 v233; // ST18_2@469 | |
2771 stru6 *v234; // eax@469 | |
2772 __int16 v235; // ST18_2@469 | |
2773 stru6 *v236; // eax@469 | |
2774 __int16 v237; // ST18_2@469 | |
2775 stru6 *v238; // eax@469 | |
2776 __int16 v239; // ST1C_2@469 | |
2777 char *v240; // ecx@472 | |
2778 double v241; // st7@478 | |
2779 signed __int64 v242; // qax@484 | |
2780 char *v243; // ecx@484 | |
2781 char *v244; // eax@488 | |
2782 int v245; // edi@492 | |
2783 int v246; // eax@492 | |
2784 char *v247; // eax@497 | |
2785 char v248; // al@497 | |
2786 char v249; // cf@500 | |
2787 float v250; // esi@507 | |
2788 char v251; // al@507 | |
2789 int v252; // edx@510 | |
2790 int m; // esi@510 | |
2791 int v254; // eax@513 | |
2792 int v255; // esi@513 | |
2793 int v256; // ecx@513 | |
2794 int v257; // edx@514 | |
2795 int v258; // ecx@514 | |
2796 char v259; // al@516 | |
2797 int v260; // eax@518 | |
2798 int v261; // esi@519 | |
2799 int v262; // edx@521 | |
2800 int v263; // ecx@521 | |
2801 int v264; // esi@521 | |
2802 int v265; // edx@521 | |
2803 int *ii; // eax@522 | |
2804 int v267; // eax@524 | |
2805 int v268; // eax@524 | |
2806 int v269; // eax@526 | |
2807 char *v270; // eax@531 | |
2808 char v271; // al@531 | |
2809 char v272; // cf@534 | |
2810 float v273; // esi@541 | |
2811 char v274; // al@541 | |
2812 int v275; // edx@544 | |
2813 int k; // esi@544 | |
2814 int v277; // edx@548 | |
2815 int v278; // ecx@548 | |
2816 char v279; // al@550 | |
2817 int v280; // eax@552 | |
2818 int v281; // esi@553 | |
2819 int v282; // edx@555 | |
2820 int v283; // ecx@555 | |
2821 int v284; // esi@555 | |
2822 int v285; // edx@555 | |
2823 int *l; // eax@556 | |
2824 int v287; // eax@558 | |
2825 int v288; // eax@558 | |
2826 ItemGen *v289; // eax@560 | |
2827 signed int v290; // eax@560 | |
2828 unsigned __int8 v291; // al@564 | |
2829 char v292; // al@573 | |
2830 int v293; // eax@575 | |
2831 ItemGen *v294; // esi@575 | |
2832 int v295; // edx@575 | |
2833 int kk; // edi@575 | |
2834 int v297; // edx@579 | |
2835 int v298; // ecx@579 | |
2836 char v299; // al@581 | |
2837 int v300; // eax@583 | |
2838 int v301; // edi@584 | |
2839 int v302; // edx@586 | |
2840 int v303; // ecx@586 | |
2841 int v304; // edi@586 | |
2842 int v305; // edx@586 | |
2843 int *jj; // eax@587 | |
2844 int v307; // eax@589 | |
2845 int v308; // eax@589 | |
2846 char *v309; // ecx@593 | |
2847 char v310; // sf@593 | |
2848 unsigned __int8 v311; // of@593 | |
2849 char v312; // cl@597 | |
2850 char v313; // al@606 | |
2851 int v314; // edx@607 | |
2852 int j; // esi@607 | |
2853 unsigned int v316; // eax@613 | |
2854 const char *v317; // ecx@617 | |
2855 Player *v318; // ecx@619 | |
2856 unsigned int v319; // edi@627 | |
2857 int v320; // ecx@629 | |
2858 int v321; // ecx@630 | |
2859 int v322; // edi@632 | |
2860 int v323; // edi@635 | |
2861 char *v324; // eax@635 | |
2862 Player *v325; // ecx@640 | |
2863 int v326; // eax@643 | |
2864 int v327; // eax@648 | |
2865 int v328; // ecx@651 | |
2866 int v329; // ecx@652 | |
2867 int v330; // edi@654 | |
2868 __int16 v331; // ST18_2@658 | |
2869 stru6 *v332; // eax@658 | |
2870 __int16 v333; // ST18_2@658 | |
2871 stru6 *v334; // eax@658 | |
2872 __int16 v335; // ST18_2@658 | |
2873 stru6 *v336; // eax@658 | |
2874 __int16 v337; // ST18_2@658 | |
2875 stru6 *v338; // eax@658 | |
2876 int v339; // ecx@659 | |
2877 int v340; // ecx@660 | |
2878 int v341; // eax@663 | |
2879 signed int v342; // edi@668 | |
2880 signed int v343; // edi@670 | |
2881 unsigned __int64 v344; // ST08_8@670 | |
2882 __int16 v345; // ST1C_2@671 | |
2883 __int16 v346; // ST18_2@671 | |
2884 stru6 *v347; // eax@671 | |
2885 int v348; // ecx@672 | |
2886 int v349; // ecx@673 | |
2887 int v350; // edi@676 | |
2888 Player *v351; // edi@680 | |
2889 __int16 v352; // ST18_2@685 | |
2890 stru6 *v353; // eax@685 | |
2891 int v354; // ecx@686 | |
2892 int v355; // ecx@687 | |
2893 int v356; // eax@689 | |
112 | 2894 Player *v357; // edi@694 |
0 | 2895 unsigned __int16 v358; // ST1C_2@695 |
2896 __int16 v359; // ST18_2@695 | |
2897 stru6 *v360; // eax@695 | |
2898 __int16 v361; // ST1C_2@697 | |
2899 __int16 v362; // ST18_2@697 | |
2900 stru6 *v363; // eax@697 | |
2901 int v364; // ecx@698 | |
2902 int v365; // ecx@699 | |
2903 int v366; // eax@701 | |
2904 stru6 *v367; // eax@704 | |
2905 int v368; // eax@704 | |
2906 Actor *v369; // edi@705 | |
2907 int v370; // eax@706 | |
2908 int v371; // ecx@709 | |
2909 int v372; // ecx@710 | |
2910 int v373; // eax@715 | |
2911 int v374; // eax@717 | |
112 | 2912 Player *v375; // edi@717 |
0 | 2913 int v376; // eax@717 |
2914 Player *v377; // ecx@719 | |
2915 int v378; // ecx@721 | |
2916 int v379; // ecx@722 | |
2917 int v380; // eax@724 | |
2918 int v381; // edi@727 | |
2919 int v382; // ecx@727 | |
2920 Player *v383; // eax@728 | |
2921 int v384; // eax@733 | |
2922 int v385; // edi@736 | |
2923 signed int v386; // eax@736 | |
2924 Player *v387; // edi@738 | |
2925 int v388; // edi@740 | |
2926 unsigned __int16 v389; // ST1C_2@740 | |
2927 __int16 v390; // ST18_2@740 | |
2928 stru6 *v391; // eax@740 | |
2929 int v392; // ecx@742 | |
2930 int v393; // ecx@743 | |
2931 int v394; // ecx@744 | |
2932 int v395; // edi@747 | |
2933 int v396; // eax@752 | |
2934 int v397; // eax@757 | |
2935 int v398; // eax@757 | |
2936 int v399; // eax@757 | |
2937 char *v400; // esi@757 | |
2938 Game *v401; // ecx@759 | |
2939 __int16 v402; // ST1C_2@759 | |
2940 __int16 v403; // ST18_2@759 | |
2941 stru6 *v404; // eax@759 | |
2942 int v405; // ecx@761 | |
2943 int v406; // ecx@762 | |
2944 int v407; // edi@765 | |
2945 __int16 v408; // ST1C_2@769 | |
2946 __int16 v409; // ST18_2@769 | |
2947 stru6 *v410; // eax@769 | |
2948 int v411; // ecx@772 | |
2949 int v412; // ecx@773 | |
2950 int v413; // edi@775 | |
2951 __int16 v414; // ST1C_2@781 | |
2952 __int16 v415; // ST18_2@781 | |
2953 stru6 *v416; // eax@781 | |
2954 int v417; // eax@787 | |
2955 int v418; // ecx@789 | |
2956 __int16 v419; // ax@791 | |
2957 signed int v420; // eax@793 | |
2958 int v421; // edx@793 | |
2959 const char *v422; // eax@801 | |
2960 int v423; // ecx@808 | |
2961 int v424; // ecx@809 | |
2962 int v425; // eax@811 | |
2963 signed int v426; // eax@815 | |
2964 signed int v427; // eax@820 | |
2965 int v428; // ecx@825 | |
2966 int v429; // ecx@826 | |
2967 int v430; // eax@828 | |
2968 stru6 *v431; // eax@831 | |
2969 int v432; // eax@831 | |
2970 Actor *v433; // edi@832 | |
2971 int v434; // eax@833 | |
2972 int v435; // ecx@837 | |
2973 int v436; // ecx@838 | |
2974 __int16 v437; // ST1C_2@843 | |
2975 __int16 v438; // ST18_2@843 | |
2976 stru6 *v439; // eax@843 | |
2977 int v440; // eax@843 | |
2978 int v441; // eax@847 | |
2979 int v442; // ecx@850 | |
2980 int v443; // ecx@851 | |
2981 int v444; // eax@853 | |
2982 signed int v445; // edi@857 | |
2983 int v446; // ecx@862 | |
2984 LevelDecoration *v447; // edi@864 | |
2985 __int16 v448; // ax@864 | |
2986 char *v449; // esi@870 | |
2987 int v450; // eax@870 | |
2988 int v451; // ecx@875 | |
2989 int v452; // ecx@876 | |
2990 int v453; // edi@878 | |
2991 __int16 v454; // ST1C_2@884 | |
2992 __int16 v455; // ST18_2@884 | |
2993 stru6 *v456; // eax@884 | |
2994 int v457; // ecx@887 | |
2995 int v458; // ecx@888 | |
2996 int v459; // eax@890 | |
2997 signed int v460; // eax@895 | |
2998 Actor *v461; // eax@897 | |
2999 unsigned __int16 v462; // cx@897 | |
3000 signed int v463; // edx@897 | |
3001 int v464; // ecx@905 | |
3002 int v465; // ecx@906 | |
3003 int v466; // edi@909 | |
3004 __int16 v467; // ST1C_2@913 | |
3005 __int16 v468; // ST18_2@913 | |
3006 stru6 *v469; // eax@913 | |
3007 int v470; // edi@913 | |
3008 int v471; // eax@917 | |
3009 int v472; // eax@917 | |
3010 char *v473; // esi@918 | |
3011 __int16 v474; // ST18_2@920 | |
3012 stru6 *v475; // eax@920 | |
3013 __int16 v476; // ST18_2@920 | |
3014 stru6 *v477; // eax@920 | |
3015 __int16 v478; // ST18_2@920 | |
3016 stru6 *v479; // eax@920 | |
3017 __int16 v480; // ST18_2@920 | |
3018 stru6 *v481; // eax@920 | |
3019 __int16 v482; // ST18_2@923 | |
3020 stru6 *v483; // eax@923 | |
3021 __int16 v484; // ST18_2@923 | |
3022 stru6 *v485; // eax@923 | |
3023 __int16 v486; // ST18_2@923 | |
3024 stru6 *v487; // eax@923 | |
3025 __int16 v488; // ST18_2@923 | |
3026 stru6 *v489; // eax@923 | |
3027 __int16 v490; // ST1C_2@924 | |
3028 __int16 v491; // ST18_2@924 | |
3029 stru6 *v492; // eax@924 | |
3030 int v493; // ecx@925 | |
3031 int v494; // ecx@926 | |
3032 __int16 v495; // ST1C_2@931 | |
3033 __int16 v496; // ST18_2@931 | |
3034 stru6 *v497; // eax@931 | |
3035 int v498; // edi@931 | |
3036 int v499; // eax@935 | |
3037 int v500; // eax@935 | |
3038 Player *v501; // edi@939 | |
3039 __int16 v502; // ST18_2@940 | |
3040 stru6 *v503; // eax@940 | |
3041 stru6 *v504; // eax@943 | |
3042 int v505; // eax@943 | |
3043 int v506; // eax@943 | |
3044 int v507; // edi@944 | |
3045 int v508; // eax@944 | |
3046 signed int v509; // eax@944 | |
3047 signed int v510; // edi@944 | |
3048 Actor *v511; // edi@946 | |
3049 int v512; // eax@946 | |
3050 SpellBuff *v513; // edi@946 | |
3051 int v514; // ecx@950 | |
3052 int v515; // ecx@951 | |
3053 int v516; // eax@953 | |
3054 int v517; // eax@956 | |
90 | 3055 Actor *v518; // edx@957 |
0 | 3056 __int16 v519; // cx@958 |
3057 int v520; // ecx@968 | |
3058 int v521; // ecx@969 | |
3059 int v522; // eax@971 | |
3060 __int16 v523; // ST18_2@975 | |
3061 stru6 *v524; // eax@975 | |
3062 __int16 v525; // ST18_2@975 | |
3063 stru6 *v526; // eax@975 | |
3064 __int16 v527; // ST18_2@975 | |
3065 stru6 *v528; // eax@975 | |
3066 __int16 v529; // ST18_2@975 | |
3067 stru6 *v530; // eax@975 | |
3068 int v531; // eax@982 | |
3069 int v532; // eax@982 | |
3070 int v533; // edi@983 | |
3071 int v534; // eax@983 | |
3072 signed int v535; // eax@983 | |
3073 signed int v536; // edi@983 | |
3074 stru6 *v537; // eax@984 | |
3075 int v538; // ecx@985 | |
3076 int v539; // ecx@986 | |
3077 int v540; // eax@988 | |
3078 __int16 v541; // ST18_2@991 | |
3079 stru6 *v542; // eax@991 | |
3080 __int16 v543; // ST18_2@991 | |
3081 stru6 *v544; // eax@991 | |
3082 __int16 v545; // ST18_2@991 | |
3083 stru6 *v546; // eax@991 | |
3084 __int16 v547; // ST18_2@991 | |
3085 stru6 *v548; // eax@991 | |
3086 double v549; // st7@991 | |
3087 unsigned __int16 v550; // di@991 | |
3088 int v551; // ecx@993 | |
3089 int v552; // ecx@994 | |
89 | 3090 Player *v553; // edi@1001 |
0 | 3091 __int16 v554; // ST18_2@1002 |
3092 stru6 *v555; // eax@1002 | |
3093 __int16 v556; // ST18_2@1002 | |
3094 stru6 *v557; // eax@1002 | |
3095 __int16 v558; // ST18_2@1002 | |
3096 stru6 *v559; // eax@1002 | |
3097 __int16 v560; // ST18_2@1002 | |
3098 stru6 *v561; // eax@1002 | |
3099 unsigned __int16 v562; // di@1005 | |
3100 signed int v563; // eax@1010 | |
3101 unsigned int v564; // ecx@1011 | |
3102 signed int v565; // eax@1012 | |
3103 Player **v566; // ecx@1012 | |
3104 int v567; // eax@1012 | |
3105 unsigned __int16 v568; // ST1C_2@1012 | |
3106 __int16 v569; // ST18_2@1012 | |
3107 stru6 *v570; // eax@1012 | |
3108 Player *v571; // eax@1013 | |
3109 char *v572; // ecx@1013 | |
3110 int v573; // ecx@1017 | |
3111 int v574; // ecx@1018 | |
3112 int v575; // eax@1020 | |
3113 signed int v576; // eax@1025 | |
3114 Player *v577; // eax@1026 | |
3115 int v578; // eax@1028 | |
3116 __int16 v579; // ax@1029 | |
3117 int v580; // eax@1031 | |
3118 int v581; // edi@1031 | |
3119 int v582; // eax@1031 | |
3120 __int16 v583; // ST1C_2@1034 | |
3121 __int16 v584; // ST18_2@1034 | |
3122 char *v585; // esi@1034 | |
3123 stru6 *v586; // eax@1034 | |
3124 signed int v587; // eax@1035 | |
3125 int v588; // ecx@1036 | |
3126 int v589; // ecx@1037 | |
3127 int v590; // ecx@1038 | |
3128 char v591; // al@1048 | |
3129 int v592; // esi@1052 | |
3130 int v593; // ecx@1057 | |
3131 int v594; // ecx@1058 | |
3132 int v595; // eax@1064 | |
3133 int v596; // esi@1066 | |
3134 unsigned int v597; // edi@1067 | |
3135 int v598; // eax@1079 | |
3136 signed int v599; // eax@1082 | |
3137 int v600; // edi@1086 | |
3138 int v601; // edx@1086 | |
3139 int v602; // eax@1086 | |
3140 int v603; // ecx@1086 | |
3141 int v604; // eax@1087 | |
3142 char *v605; // eax@1089 | |
3143 int v606; // edx@1091 | |
3144 int v607; // ecx@1100 | |
3145 __int16 v608; // ax@1102 | |
3146 signed int v609; // eax@1104 | |
3147 int v610; // edi@1106 | |
3148 unsigned int v611; // eax@1106 | |
89 | 3149 Player *v612; // edi@1106 |
3150 DDM_DLV_Header *v613; // eax@1108 | |
0 | 3151 int v614; // eax@1116 |
3152 int v615; // edi@1119 | |
3153 __int16 v616; // ST1C_2@1122 | |
3154 __int16 v617; // ST18_2@1122 | |
3155 stru6 *v618; // eax@1122 | |
112 | 3156 Player *v619; // edi@1123 |
0 | 3157 unsigned __int16 v620; // ST1C_2@1124 |
3158 __int16 v621; // ST18_2@1124 | |
3159 stru6 *v622; // eax@1124 | |
3160 signed __int64 v623; // qax@1127 | |
3161 int v624; // eax@1127 | |
3162 int v625; // edi@1129 | |
3163 int v626; // eax@1129 | |
3164 signed int v627; // eax@1129 | |
3165 signed int v628; // edi@1129 | |
3166 int v629; // ecx@1130 | |
3167 Player *v630; // eax@1131 | |
3168 int v631; // eax@1137 | |
3169 int v632; // edi@1140 | |
3170 Player *v633; // eax@1140 | |
3171 signed int v634; // eax@1140 | |
3172 int v635; // edi@1142 | |
3173 unsigned __int16 v636; // ST1C_2@1142 | |
3174 __int16 v637; // ST18_2@1142 | |
3175 stru6 *v638; // eax@1142 | |
3176 stru6 *v639; // eax@1143 | |
3177 int v640; // ecx@1146 | |
3178 int v641; // ecx@1147 | |
3179 int v642; // edi@1156 | |
3180 int v643; // eax@1156 | |
3181 int v644; // eax@1156 | |
3182 signed int v645; // eax@1158 | |
3183 Player *v646; // ebx@1169 | |
3184 int v647; // edi@1169 | |
3185 signed int v648; // ST1C_4@1170 | |
3186 Player *v649; // ecx@1170 | |
3187 unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3188 unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3189 unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3190 unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
3191 int v654; // [sp-4h] [bp-E88h]@124 | |
3192 unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 | |
3193 unsigned int v656; // [sp-4h] [bp-E88h]@639 | |
3194 int v657; // [sp-4h] [bp-E88h]@807 | |
3195 int v658; // [sp+0h] [bp-E84h]@100 | |
3196 int v659; // [sp+0h] [bp-E84h]@123 | |
3197 int v660; // [sp+0h] [bp-E84h]@146 | |
3198 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
3199 int v662; // [sp+0h] [bp-E84h]@304 | |
3200 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 | |
3201 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3202 int v665; // [sp+0h] [bp-E84h]@807 | |
3203 int v666; // [sp+4h] [bp-E80h]@12 | |
3204 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
3205 unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 | |
3206 int v669; // [sp+4h] [bp-E80h]@123 | |
3207 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3208 int v671; // [sp+4h] [bp-E80h]@146 | |
3209 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
3210 unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 | |
3211 __int16 v674; // [sp+4h] [bp-E80h]@684 | |
3212 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3213 int v676; // [sp+4h] [bp-E80h]@807 | |
3214 int v677; // [sp+4h] [bp-E80h]@861 | |
3215 int v678; // [sp+4h] [bp-E80h]@997 | |
3216 int v679; // [sp+14h] [bp-E70h]@515 | |
3217 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3218 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3219 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3220 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3221 int v684; // [sp+D04h] [bp-180h]@416 | |
3222 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3223 int x; // [sp+D20h] [bp-164h]@327 | |
3224 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3225 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3226 int v689; // [sp+D30h] [bp-154h]@943 | |
3227 int v690; // [sp+D34h] [bp-150h]@943 | |
3228 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3229 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3230 int v693; // [sp+D40h] [bp-144h]@137 | |
3231 int v694; // [sp+D44h] [bp-140h]@982 | |
3232 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3233 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3234 int v697; // [sp+D50h] [bp-134h]@129 | |
3235 int v698; // [sp+D54h] [bp-130h]@129 | |
3236 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3237 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3238 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3239 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3240 int v703; // [sp+D70h] [bp-114h]@286 | |
3241 int v704; // [sp+D74h] [bp-110h]@132 | |
3242 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3243 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3244 int v707; // [sp+D80h] [bp-104h]@1127 | |
3245 int v708; // [sp+D84h] [bp-100h]@1127 | |
3246 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3247 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3248 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3249 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3250 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3251 int n; // [sp+DA0h] [bp-E4h]@1 | |
3252 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3253 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3254 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3255 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3256 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3257 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3258 int v721; // [sp+DD8h] [bp-ACh]@163 | |
3259 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3260 int v723; // [sp+E4Ch] [bp-38h]@1 | |
3261 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3262 float v725; // [sp+E54h] [bp-30h]@23 | |
3263 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3264 int v726b; |
0 | 3265 float v727; // [sp+E5Ch] [bp-28h]@1 |
3266 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3267 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3268 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3269 Player *v730b; |
3270 ItemGen *v730c; | |
0 | 3271 int v731; // [sp+E6Ch] [bp-18h]@48 |
3272 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3273 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3274 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3275 int amount; // [sp+E80h] [bp-4h]@1 | |
3276 | |
3277 auto ecx0 = this; | |
3278 | |
3279 v711 = ecx0; | |
3280 | |
3281 LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3282 //LayingItem::LayingItem(&a1); | |
3283 | |
3284 v1 = 0; | |
3285 v2 = 0; | |
3286 amount = 0; | |
3287 LODWORD(v733) = 0; | |
3288 v723 = 0; | |
3289 v727 = 0.0; | |
3290 n = 0; | |
3291 while ( 1 ) | |
3292 { | |
3293 v3 = &v711[n]; | |
3294 HIDWORD(v733) = (int)v3; | |
3295 if ( v3->spellnum == (short)v1 ) | |
3296 goto LABEL_1166; | |
3297 if ( pParty->pPartyBuffs[11].NotExpired() ) | |
3298 pParty->pPartyBuffs[11].Reset(); | |
3299 if ( v3->field_8 & 0x3CA ) | |
3300 { | |
3301 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3302 v711->_427D48(1u); | |
3303 goto LABEL_1166; | |
3304 } | |
3305 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
3306 v4 = *(int *)&v3->field_C; | |
3307 if ( v4 != v1 ) | |
3308 goto LABEL_18; | |
3309 v5 = v3->spellnum; | |
3310 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) | |
3311 v666 = 1; | |
3312 else | |
3313 v666 = v1; | |
271 | 3314 a2 = stru_50C198.FindClosestActor(5120, 1, v666); |
0 | 3315 v6 = pMouse->uPointingObjectID; |
141 | 3316 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) |
0 | 3317 { |
3318 v4 = pMouse->uPointingObjectID; | |
3319 LABEL_18: | |
3320 a2 = v4; | |
3321 } | |
3322 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; | |
3323 if ( (short)a1.uItemType != (short)v1 ) | |
3324 { | |
141 | 3325 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3326 { |
141 | 3327 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3328 v2 = v723; |
3329 v1 = 0; | |
3330 } | |
3331 else | |
3332 { | |
3333 v715.uYawAngle = pParty->sRotationY; | |
3334 v715.uPitchAngle = pParty->sRotationX; | |
3335 } | |
3336 } | |
3337 v7 = v3->field_A; | |
3338 LODWORD(v725) = v1; | |
3339 _this = (ItemGen *)v1; | |
3340 if ( v7 == (short)v1 ) | |
3341 { | |
3342 v8 = v3->spellnum; | |
3343 if ( v3->spellnum >= 12 ) | |
3344 { | |
3345 if ( v8 >= 23 ) | |
3346 { | |
3347 if ( v8 >= 34 ) | |
3348 { | |
3349 if ( v8 >= 45 ) | |
3350 { | |
3351 if ( v8 >= 56 ) | |
3352 { | |
3353 if ( v8 >= 67 ) | |
3354 { | |
3355 if ( v8 >= 78 ) | |
3356 { | |
3357 if ( v8 >= 89 ) | |
3358 { | |
3359 if ( v8 >= 100 ) | |
3360 { | |
3361 if ( v8 != 100 ) | |
3362 { | |
3363 LABEL_45: | |
3364 HIWORD(v10) = HIWORD(pPlayer); | |
3365 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
3366 goto LABEL_47; | |
3367 } | |
3368 v667 = (PLAYER_SKILL_TYPE)5; | |
3369 } | |
3370 else | |
3371 { | |
3372 v667 = (PLAYER_SKILL_TYPE)20; | |
3373 } | |
3374 } | |
3375 else | |
3376 { | |
3377 v667 = (PLAYER_SKILL_TYPE)19; | |
3378 } | |
3379 } | |
3380 else | |
3381 { | |
3382 v667 = (PLAYER_SKILL_TYPE)18; | |
3383 } | |
3384 } | |
3385 else | |
3386 { | |
3387 v667 = (PLAYER_SKILL_TYPE)17; | |
3388 } | |
3389 } | |
3390 else | |
3391 { | |
3392 v667 = (PLAYER_SKILL_TYPE)16; | |
3393 } | |
3394 } | |
3395 else | |
3396 { | |
3397 v667 = (PLAYER_SKILL_TYPE)15; | |
3398 } | |
3399 } | |
3400 else | |
3401 { | |
3402 v667 = (PLAYER_SKILL_TYPE)14; | |
3403 } | |
3404 } | |
3405 else | |
3406 { | |
3407 v667 = (PLAYER_SKILL_TYPE)13; | |
3408 } | |
3409 } | |
3410 else | |
3411 { | |
3412 v667 = (PLAYER_SKILL_TYPE)12; | |
3413 } | |
3414 LODWORD(v725) = v667; | |
3415 v9 = pPlayer->GetActualSkillLevel(v667); | |
3416 v723 = v9 & 0x3F; | |
3417 v2 = v9 & 0x3F; | |
3418 goto LABEL_45; | |
3419 } | |
3420 v11 = v7; | |
3421 v10 = v7 & 0x3F; | |
3422 v723 = v10; | |
3423 v2 = v10; | |
3424 LABEL_47: | |
3425 if ( HIBYTE(v11) & 1 ) | |
3426 { | |
3427 v12 = 4; | |
3428 v731 = 4; | |
3429 } | |
3430 else | |
3431 { | |
3432 if ( (v11 & 0x80u) == 0 ) | |
3433 { | |
3434 v10 = ((v11 & 0x40) != 0) + 1; | |
3435 v731 = ((v11 & 0x40) != 0) + 1; | |
3436 } | |
3437 else | |
3438 { | |
3439 v731 = 3; | |
3440 } | |
3441 v12 = v731; | |
3442 } | |
3443 LOWORD(v10) = v3->spellnum; | |
3444 v730 = v10; | |
3445 v13 = v12 + 10 * (signed __int16)v10; | |
3446 v14 = v3->field_A == (short)v1; | |
3447 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing | |
3448 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); | |
3449 uRequiredMana = v15; | |
3450 sRecoveryTime = v16; | |
3451 if ( !v14 ) | |
3452 uRequiredMana = v1; | |
3453 if ( pParty->uCurrentHour == v1 ) | |
3454 { | |
3455 if ( pParty->uCurrentMinute != v1 ) | |
3456 goto LABEL_62; | |
3457 if ( LODWORD(v725) == 20 ) | |
3458 goto LABEL_61; | |
3459 } | |
3460 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == v1 && LODWORD(v725) == 19 ) | |
3461 LABEL_61: | |
3462 uRequiredMana = v1; | |
3463 LABEL_62: | |
3464 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) | |
3465 break; | |
3466 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); | |
3467 LABEL_203: | |
3468 v3->spellnum = v1; | |
3469 LABEL_1166: | |
3470 ++n; | |
3471 if ( n >= 10 ) | |
3472 return; | |
3473 } | |
3474 if ( !pPlayer->pConditions[0] || (signed __int16)v730 >= 100 ) | |
3475 goto LABEL_69; | |
3476 if ( rand() % 100 >= 50 ) | |
3477 { | |
3478 v12 = v731; | |
3479 LABEL_69: | |
3480 switch ( v3->spellnum ) | |
3481 { | |
3482 case 100: | |
3483 case 101: | |
3484 v17 = pPlayer; | |
3485 _this = (ItemGen *)1; | |
3486 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[5]) >= 3 ) | |
3487 _this = (ItemGen *)2; | |
3488 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3489 a1.stru_24.Reset(); | |
3490 v18 = v3->spellnum; | |
3491 a1.field_4C = v2; | |
3492 a1.field_48 = v18; | |
3493 a1.field_50 = v731; | |
3494 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3495 if ( v17->WearsItem(510, 2) ) | |
3496 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3497 a1.vPosition.x = pParty->vPosition.x; | |
3498 a1.vPosition.y = pParty->vPosition.y; | |
3499 a1.uAttributes = 0; | |
3500 a1.uSpriteFrameID = 0; | |
3501 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3502 v19 = 8 * v3->uPlayerID; | |
303 | 3503 LOBYTE(v19) = v19 | OBJECT_Player; |
3504 a1.field_58_pid = v19; | |
0 | 3505 a1.field_5C = a2; |
3506 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3507 a1.uFacing = LOWORD(v715.uYawAngle); | |
3508 a1.uSoundID = LOWORD(v3->field_10); | |
3509 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3510 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3511 a1.uAttributes = 256; | |
3512 if ( pParty->bTurnBasedModeOn == 1 ) | |
3513 a1.uAttributes = 260; | |
3514 for ( i = 0; i < (signed int)this; ++i ) | |
3515 { | |
3516 if ( i ) | |
3517 a1.vPosition.z += 32; | |
3518 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3519 if ( a1.Create( | |
3520 v715.uYawAngle, | |
3521 v715.uPitchAngle, | |
3522 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3523 v3->uPlayerID + 1) != -1 | |
3524 && pParty->bTurnBasedModeOn == 1 ) | |
3525 ++pTurnEngine->field_1C; | |
3526 } | |
3527 goto LABEL_83; | |
3528 case 102: | |
3529 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); | |
3530 a1.stru_24.Reset(); | |
3531 a1.field_48 = v3->spellnum; | |
3532 a1.field_4C = v723; | |
3533 a1.field_50 = v731; | |
3534 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3535 a1.vPosition.x = pParty->vPosition.x; | |
3536 a1.vPosition.y = pParty->vPosition.y; | |
3537 a1.uAttributes = 0; | |
3538 a1.uSpriteFrameID = 0; | |
3539 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3540 v22 = 8 * v3->uPlayerID; | |
303 | 3541 LOBYTE(v22) = v22 | OBJECT_Player; |
3542 a1.field_58_pid = v22; | |
0 | 3543 a1.field_5C = a2; |
3544 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3545 a1.uFacing = LOWORD(v715.uYawAngle); | |
3546 a1.uSoundID = LOWORD(v3->field_10); | |
3547 memcpy( | |
3548 &a1.stru_24, | |
3549 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3550 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3551 + 5], | |
3552 sizeof(a1.stru_24)); | |
3553 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3554 HIBYTE(a1.uAttributes) |= 1u; | |
3555 a1.uSectorID = v23; | |
3556 if ( pParty->bTurnBasedModeOn == 1 ) | |
3557 LOBYTE(a1.uAttributes) |= 4u; | |
3558 if ( a1.Create( | |
3559 v715.uYawAngle, | |
3560 v715.uPitchAngle, | |
3561 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3562 v3->uPlayerID + 1) != -1 | |
3563 && pParty->bTurnBasedModeOn == 1 ) | |
3564 ++pTurnEngine->field_1C; | |
3565 goto LABEL_83; | |
3566 case 1: | |
3567 LODWORD(v733) = 3600 * v2; | |
3568 v24 = v12 - 2; | |
3569 if ( v24 ) | |
3570 { | |
3571 v25 = v24 - 1; | |
3572 if ( v25 && v25 != 1 ) | |
3573 amount = 2; | |
3574 else | |
3575 amount = 4; | |
3576 } | |
3577 else | |
3578 { | |
3579 amount = 3; | |
3580 } | |
3581 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3582 goto LABEL_83; | |
3583 v668 = v1; | |
3584 v658 = v1; | |
3585 v653 = amount; | |
3586 v651 = v731; | |
3587 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); | |
3588 v27 = (char *)&pParty->pPartyBuffs[16]; | |
3589 goto LABEL_101; | |
3590 case 7: | |
3591 v29 = v12 - 2; | |
3592 if ( v29 ) | |
3593 { | |
3594 v30 = v29 - 1; | |
3595 if ( v30 ) | |
3596 { | |
3597 if ( v30 == 1 ) | |
3598 amount = 9; | |
3599 else | |
3600 amount = 3; | |
3601 } | |
3602 else | |
3603 { | |
3604 amount = 7; | |
3605 } | |
3606 } | |
3607 else | |
3608 { | |
3609 amount = 5; | |
3610 } | |
3611 v31 = v3->uPlayerID; | |
3612 HIDWORD(v733) = v1; | |
3613 v32 = 8 * v31; | |
3614 LOBYTE(v32) = v32 | 4; | |
3615 if ( (signed int)uNumLayingItems > v1 ) | |
3616 { | |
3617 v33 = (char *)&pLayingItems[0].field_48; | |
3618 v730 = uNumLayingItems; | |
3619 do | |
3620 { | |
3621 if ( *((short *)v33 - 36) != (short)v1 && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) | |
3622 ++HIDWORD(v733); | |
3623 v33 += 112; | |
3624 --v730; | |
3625 } | |
3626 while ( v730 ); | |
3627 } | |
3628 if ( SHIDWORD(v733) > amount ) | |
3629 goto LABEL_200; | |
3630 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3631 goto LABEL_83; | |
3632 a1.stru_24.Reset(); | |
3633 a1.field_48 = v3->spellnum; | |
3634 a1.field_4C = v2; | |
3635 a1.field_50 = v731; | |
3636 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3637 a1.vPosition.y = pParty->vPosition.y; | |
3638 a1.vPosition.x = pParty->vPosition.x; | |
3639 a1.uAttributes = v1; | |
3640 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3641 a1.uSectorID = pIndoor->GetSector( | |
3642 pParty->vPosition.x, | |
3643 pParty->vPosition.y, | |
3644 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3645 a1.uSpriteFrameID = v1; | |
3646 v34 = 8 * v3->uPlayerID; | |
303 | 3647 LOBYTE(v34) = v34 | OBJECT_Player; |
3648 a1.field_58_pid = v34; | |
0 | 3649 a1.field_5C = a2; |
3650 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3651 a1.uFacing = LOWORD(v715.uYawAngle); | |
3652 a1.uSoundID = LOWORD(v3->field_10); | |
3653 if ( pParty->bTurnBasedModeOn == 1 ) | |
3654 LOBYTE(a1.uAttributes) |= 4u; | |
3655 v669 = v3->uPlayerID + 1; | |
3656 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3657 v35 = pParty->sRotationX + 10; | |
3658 goto LABEL_124; | |
3659 case 20: | |
3660 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3661 goto LABEL_83; | |
3662 if ( a2 == v1 ) | |
3663 goto LABEL_200; | |
141 | 3664 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3665 goto LABEL_1056; |
3666 v699 = v1; | |
3667 v698 = v1; | |
3668 v697 = v1; | |
3669 a1.stru_24.Reset(); | |
3670 a1.field_48 = v3->spellnum; | |
3671 a1.field_4C = v2; | |
3672 a1.field_50 = v731; | |
3673 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3674 a1.uAttributes = v1; | |
3675 a1.uSectorID = v1; | |
3676 a1.uSpriteFrameID = v1; | |
3677 v37 = v3->uPlayerID; | |
3678 a1.field_60_distance_related_prolly_lod = 0; | |
3679 v37 *= 8; | |
303 | 3680 LOBYTE(v37) = v37 | OBJECT_Player; |
0 | 3681 a1.uFacing = v1; |
303 | 3682 a1.field_58_pid = v37; |
0 | 3683 v38 = a2 >> 3; |
3684 a1.uSoundID = LOWORD(v3->field_10); | |
3685 v39 = a2 >> 3; | |
3686 a1.vPosition.x = pActors[v39].vPosition.x; | |
3687 v40 = pActors[v39].vPosition.y; | |
3688 a1.vPosition.z = pActors[v39].vPosition.z; | |
3689 v41 = 8 * (a2 >> 3); | |
3690 a1.vPosition.y = v40; | |
3691 LOBYTE(v41) = v41 | 3; | |
3692 a1.field_5C = v41; | |
3693 v42 = a1.Create(0, v1, v1, v1); | |
3694 v43 = &v697; | |
3695 goto LABEL_133; | |
3696 case 44: | |
3697 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3698 goto LABEL_83; | |
3699 v726 = (Player *)(a2 >> 3); | |
3700 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3701 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3702 goto LABEL_1056; |
90 | 3703 pActors[a2 >> 3].pActorBuffs[10].Apply( |
0 | 3704 pMiscTimer->uTotalGameTimeElapsed + 128, |
3705 v1, | |
3706 v1, | |
3707 v1, | |
3708 v1); | |
3709 v706 = v1; | |
3710 v705 = v1; | |
3711 v704 = v1; | |
3712 a1.stru_24.Reset(); | |
3713 a1.field_48 = v3->spellnum; | |
3714 a1.field_4C = v2; | |
3715 a1.field_50 = v731; | |
3716 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3717 a1.uAttributes = v1; | |
3718 a1.uSectorID = v1; | |
3719 a1.uSpriteFrameID = v1; | |
3720 v44 = v3->uPlayerID; | |
3721 a1.field_60_distance_related_prolly_lod = 0; | |
3722 a1.uFacing = v1; | |
3723 v44 *= 8; | |
303 | 3724 LOBYTE(v44) = v44 | OBJECT_Player; |
0 | 3725 v38 = (signed int)v726; |
303 | 3726 a1.field_58_pid = v44; |
0 | 3727 a1.uSoundID = LOWORD(v3->field_10); |
3728 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3729 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3730 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3731 v46 = 8 * (int)v726; | |
3732 a1.vPosition.y = v45; | |
3733 LOBYTE(v46) = 8 * (char)v726 | 3; | |
3734 a1.field_5C = v46; | |
3735 v42 = a1.Create(0, v1, v1, v1); | |
3736 v43 = &v704; | |
3737 LABEL_133: | |
3738 v670 = (Vec3_int_ *)v43; | |
3739 v47 = v38; | |
3740 goto LABEL_139; | |
3741 case 79: | |
141 | 3742 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 3743 goto LABEL_83; |
3744 v730 = a2 >> 3; | |
3745 v693 = v1; | |
3746 HIDWORD(v733) = (int)&pActors[a2 >> 3]; | |
3747 v692 = v1; | |
3748 v691 = v1; | |
3749 a1.stru_24.Reset(); | |
3750 a1.field_48 = v3->spellnum; | |
3751 a1.field_4C = v2; | |
3752 a1.field_50 = v731; | |
3753 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3754 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | |
3755 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3756 v48 = *(short *)(HIDWORD(v733) + 138); | |
3757 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
3758 a1.uAttributes = v1; | |
3759 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); | |
3760 a1.uSpriteFrameID = v1; | |
3761 v49 = 8 * v3->uPlayerID; | |
303 | 3762 LOBYTE(v49) = v49 | OBJECT_Player; |
3763 a1.field_58_pid = v49; | |
0 | 3764 a1.field_5C = a2; |
3765 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3766 a1.uFacing = LOWORD(v715.uYawAngle); | |
3767 LOWORD(v49) = LOWORD(v3->field_10); | |
3768 LOBYTE(a1.uAttributes) |= 0x80u; | |
3769 a1.uSoundID = v49; | |
3770 v726 = (Player *)a1.Create(0, v1, v1, v1); | |
3771 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) | |
3772 goto LABEL_200; | |
3773 v47 = v730; | |
3774 v670 = (Vec3_int_ *)&v691; | |
3775 v42 = (signed int)v726; | |
3776 LABEL_139: | |
3777 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3778 goto LABEL_1056; | |
3779 case 2: | |
3780 case 6: | |
3781 case 11: | |
3782 case 18: | |
3783 case 26: | |
3784 case 32: | |
3785 case 34: | |
3786 case 37: | |
3787 case 57: | |
3788 case 65: | |
3789 case 70: | |
3790 case 78: | |
3791 case 97: | |
3792 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3793 goto LABEL_83; | |
3794 a1.stru_24.Reset(); | |
3795 a1.field_48 = v3->spellnum; | |
3796 a1.field_4C = v2; | |
3797 a1.field_50 = v731; | |
3798 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3799 a1.vPosition.y = pParty->vPosition.y; | |
3800 a1.vPosition.x = pParty->vPosition.x; | |
3801 a1.uAttributes = v1; | |
3802 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3803 a1.uSectorID = pIndoor->GetSector( | |
3804 pParty->vPosition.x, | |
3805 pParty->vPosition.y, | |
3806 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3807 a1.uSpriteFrameID = v1; | |
3808 v50 = 8 * v3->uPlayerID; | |
303 | 3809 LOBYTE(v50) = v50 | OBJECT_Player; |
3810 a1.field_58_pid = v50; | |
0 | 3811 a1.field_5C = a2; |
3812 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3813 a1.uFacing = LOWORD(v715.uYawAngle); | |
3814 a1.uSoundID = LOWORD(v3->field_10); | |
3815 if ( pParty->bTurnBasedModeOn == 1 ) | |
3816 LOBYTE(a1.uAttributes) |= 4u; | |
3817 if ( v3->spellnum == 18 ) | |
3818 LOBYTE(a1.uAttributes) |= 0x40u; | |
3819 goto LABEL_156; | |
3820 case 29: | |
3821 case 39: | |
3822 case 76: | |
3823 case 90: | |
3824 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3825 goto LABEL_83; | |
3826 a1.stru_24.Reset(); | |
3827 a1.field_48 = v3->spellnum; | |
3828 a1.field_4C = v2; | |
3829 a1.field_50 = v731; | |
3830 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3831 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3832 a1.vPosition.y = pParty->vPosition.y; | |
3833 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3834 v660 = pParty->vPosition.y; | |
3835 goto LABEL_153; | |
3836 case 87: | |
3837 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3838 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3839 goto LABEL_200; | |
3840 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3841 goto LABEL_152; | |
3842 goto LABEL_83; | |
3843 case 81: | |
3844 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3845 goto LABEL_83; | |
3846 if ( a2 == v1 | |
141 | 3847 || (a2 & 7) != OBJECT_Actor |
0 | 3848 || (v730 = a2 >> 3, |
3849 v721 = (int)&pActors[a2 >> 3], | |
3850 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3851 goto LABEL_1056; | |
413 | 3852 Actor::AI_Stand(v730, 4u, 0x80u, (AIDirection *)v1); |
0 | 3853 v726 = (Player *)(23040 * v2); |
3854 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3855 v55 = v721; | |
3856 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, v1, v1, v1); | |
3857 *(char *)(v55 + 38) |= 8u; | |
3858 *(short *)(v55 + 148) = v1; | |
3859 v672 = v1; | |
3860 *(short *)(v55 + 150) = v1; | |
3861 v661 = (Actor *)v55; | |
3862 goto LABEL_165; | |
3863 case 35: | |
3864 if ( v12 == 2 ) | |
3865 { | |
3866 v57 = 300 * v2; | |
3867 } | |
3868 else | |
3869 { | |
3870 if ( v12 == 3 ) | |
3871 { | |
3872 amount = 4; | |
3873 v57 = 300 * v2; | |
3874 goto LABEL_174; | |
3875 } | |
3876 if ( v12 == 4 ) | |
3877 { | |
3878 v57 = 300 * v2; | |
3879 amount = 8; | |
3880 goto LABEL_174; | |
3881 } | |
3882 v57 = 180 * v2; | |
3883 } | |
3884 amount = 2; | |
3885 LABEL_174: | |
3886 LODWORD(v733) = v57; | |
3887 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3888 goto LABEL_83; | |
141 | 3889 if ( (a2 & 7) != OBJECT_Actor |
0 | 3890 || (v721 = 836 * (a2 >> 3), |
90 | 3891 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3892 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3893 goto LABEL_1056; |
3894 v726 = (Player *)(23040 * v2); | |
3895 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3896 v59 = v721; | |
112 | 3897 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3898 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3899 pParty->uTimePlayed + (signed int)v58, | |
0 | 3900 v731, |
3901 amount, | |
3902 v1, | |
3903 v1); | |
3904 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; | |
3905 v672 = v1; | |
3906 v661 = (Actor *)LODWORD(v718); | |
3907 goto LABEL_165; | |
3908 case 60: | |
3909 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3910 goto LABEL_83; | |
3911 v730 = 836 * (a2 >> 3); | |
90 | 3912 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3913 goto LABEL_1056; |
3914 LODWORD(v733) = 300 * v2; | |
3915 if ( v731 == 2 ) | |
3916 { | |
3917 LODWORD(v733) = 600 * v2; | |
3918 } | |
3919 else | |
3920 { | |
3921 if ( v731 == 3 ) | |
3922 LODWORD(v733) = 29030400; | |
3923 } | |
112 | 3924 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3925 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3926 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3927 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3928 v726 = (Player *)((int)v733 << 7); | |
3929 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3930 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3931 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
3932 v731, | |
3933 v1, | |
3934 v1, | |
3935 v1); | |
3936 a1.stru_24.Reset(); | |
3937 a1.field_48 = v3->spellnum; | |
3938 a1.field_4C = v2; | |
3939 a1.field_50 = v731; | |
3940 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 3941 v61 = a2 >> 3; |
0 | 3942 goto LABEL_1086; |
3943 case 92: | |
3944 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3945 goto LABEL_83; | |
3946 a1.stru_24.Reset(); | |
3947 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3948 a1.vPosition.x = pParty->vPosition.x; | |
3949 a1.vPosition.y = pParty->vPosition.y; | |
3950 a1.uAttributes = v1; | |
3951 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3952 a1.uSectorID = pIndoor->GetSector( | |
3953 pParty->vPosition.x, | |
3954 pParty->vPosition.y, | |
3955 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
3956 a1.uSpriteFrameID = v1; | |
3957 v62 = 8 * v3->uPlayerID; | |
303 | 3958 LOBYTE(v62) = v62 | OBJECT_Player; |
3959 a1.field_58_pid = v62; | |
0 | 3960 a1.field_5C = a2; |
3961 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3962 a1.uFacing = LOWORD(v715.uYawAngle); | |
3963 a1.uSoundID = LOWORD(v3->field_10); | |
3964 a1.field_50 = v731; | |
3965 a1.field_48 = 3; | |
3966 a1.field_4C = 300 * v2; | |
3967 goto LABEL_154; | |
3968 case 4: | |
3969 v63 = v12 - 1; | |
3970 if ( !v63 ) | |
3971 { | |
3972 amount = 10; | |
3973 goto LABEL_195; | |
3974 } | |
3975 v64 = v63 - 1; | |
3976 if ( !v64 ) | |
3977 { | |
3978 amount = 11; | |
3979 goto LABEL_195; | |
3980 } | |
3981 v65 = v64 - 1; | |
3982 if ( !v65 ) | |
3983 { | |
3984 amount = 12; | |
3985 LABEL_195: | |
3986 LODWORD(v733) = 3600 * v2; | |
3987 goto LABEL_196; | |
3988 } | |
3989 if ( v65 == 1 ) | |
3990 { | |
3991 LODWORD(v733) = v1; | |
3992 amount = 12; | |
3993 } | |
3994 LABEL_196: | |
3995 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3996 goto LABEL_83; | |
89 | 3997 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
3998 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
3999 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
4000 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
4001 { | |
315 | 4002 if (!v730c->Broken()) |
0 | 4003 { |
377 | 4004 if ( v730c->uSpecEnchantmentType == v1 ) |
0 | 4005 { |
377 | 4006 if ( v730c->uEncantmentType == v1 ) |
0 | 4007 { |
4008 v68 = BYTE4(v726->pConditions[3]); | |
4009 if ( !v68 || v68 == 1 || v68 == 2 ) | |
4010 { | |
377 | 4011 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
0 | 4012 { |
89 | 4013 v69 = v730c; |
0 | 4014 v14 = v731 == 4; |
4015 *(int *)(v730 + 12) = amount; | |
4016 if ( !v14 ) | |
4017 { | |
4018 v726 = (Player *)((int)v733 << 7); | |
4019 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
4020 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
4021 * 0.033333335); | |
4022 *(int *)(v69 + 20) |= 8u; | |
4023 } | |
4024 *(int *)(v69 + 20) |= 0x10u; | |
4025 LABEL_1055: | |
4026 dword_50C9A8 = 256; | |
4027 LABEL_1056: | |
4028 LODWORD(v727) = 1; | |
4029 LABEL_83: | |
4030 if ( v3->field_8 & 0x20 ) | |
4031 { | |
4032 LABEL_1162: | |
4033 if ( v727 != 0.0 ) | |
4034 pAudioPlayer->PlaySound( | |
4035 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4036 0, | |
4037 0, | |
4038 -1, | |
4039 0, | |
4040 v3->field_10, | |
4041 0, | |
4042 0); | |
4043 } | |
4044 else | |
4045 { | |
4046 if ( sRecoveryTime < 0 ) | |
4047 sRecoveryTime = 0; | |
4048 if ( pParty->bTurnBasedModeOn ) | |
4049 { | |
4050 v645 = sRecoveryTime; | |
4051 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4052 pPlayer->SetRecoveryTime(v645); | |
4053 if ( !some_active_character ) | |
4054 pTurnEngine->_40471C(); | |
4055 } | |
4056 else | |
4057 { | |
4058 pPlayer->SetRecoveryTime( | |
4059 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4060 } | |
4061 if ( v727 != 0.0 ) | |
4062 { | |
187 | 4063 pPlayer->PlaySound(SPEECH_49, 0); |
0 | 4064 goto LABEL_1162; |
4065 } | |
4066 } | |
4067 v3->spellnum = 0; | |
4068 v1 = 0; | |
4069 LABEL_1165: | |
4070 v2 = v723; | |
4071 goto LABEL_1166; | |
4072 } | |
4073 } | |
4074 } | |
4075 } | |
4076 } | |
4077 } | |
4078 LABEL_199: | |
4079 dword_50C9D0 = 113; | |
4080 dword_50C9D4 = v1; | |
4081 dword_50C9D8 = 1; | |
4082 LABEL_200: | |
4083 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4084 LABEL_201: | |
4085 v67 = 2; | |
4086 LABEL_202: | |
4087 ShowStatusBarString(v66, v67); | |
4088 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4089 goto LABEL_203; | |
4090 case 71: | |
4091 v70 = v12 - 1; | |
4092 LODWORD(v733) = 3600 * v2; | |
4093 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4094 { | |
4095 v72 = v71 - 1; | |
4096 if ( v72 ) | |
4097 { | |
4098 if ( v72 == 1 ) | |
4099 amount = 10; | |
4100 } | |
4101 else | |
4102 { | |
4103 amount = 3; | |
4104 } | |
4105 } | |
4106 else | |
4107 { | |
4108 amount = 1; | |
4109 } | |
4110 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4111 goto LABEL_83; | |
4112 v73 = v3->uPlayerID_2; | |
4113 v74 = v3->spellnum; | |
4114 v75 = pGame->GetStru6(); | |
4115 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); | |
4116 v668 = v1; | |
4117 v658 = v1; | |
4118 v653 = amount; | |
4119 v651 = v731; | |
4120 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); | |
4121 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; | |
4122 goto LABEL_103; | |
4123 case 3: | |
4124 case 14: | |
4125 case 25: | |
4126 case 36: | |
4127 case 58: | |
4128 case 69: | |
4129 v76 = v12 - 1; | |
4130 LODWORD(v733) = 3600 * v2; | |
4131 if ( v76 ) | |
4132 { | |
4133 v77 = v76 - 1; | |
4134 if ( v77 ) | |
4135 { | |
4136 v78 = v77 - 1; | |
4137 if ( v78 ) | |
4138 { | |
4139 if ( v78 != 1 ) | |
4140 goto LABEL_232; | |
4141 v79 = 4 * v2; | |
4142 } | |
4143 else | |
4144 { | |
4145 v79 = 3 * v2; | |
4146 } | |
4147 } | |
4148 else | |
4149 { | |
4150 v79 = 2 * v2; | |
4151 } | |
4152 amount = v79; | |
4153 } | |
4154 else | |
4155 { | |
4156 amount = v2; | |
4157 } | |
4158 LABEL_232: | |
4159 v80 = v3->spellnum; | |
4160 switch ( v80 ) | |
4161 { | |
4162 case 3: | |
4163 LODWORD(v725) = 6; | |
4164 break; | |
4165 case 14: | |
4166 LODWORD(v725) = v1; | |
4167 break; | |
4168 case 25: | |
4169 LODWORD(v725) = 17; | |
4170 break; | |
4171 case 36: | |
4172 LODWORD(v725) = 4; | |
4173 break; | |
4174 case 58: | |
4175 LODWORD(v725) = 12; | |
4176 break; | |
4177 default: | |
4178 if ( v80 != 69 ) | |
4179 goto LABEL_1166; | |
4180 LODWORD(v725) = 1; | |
4181 break; | |
4182 } | |
4183 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4184 goto LABEL_83; | |
4185 v81 = v3->spellnum; | |
4186 v82 = pGame->GetStru6(); | |
4187 pGame->GetStru6()->SetPlayerBuffAnim(v81, v1); | |
4188 v83 = 1; | |
4189 v84 = v3->spellnum; | |
4190 v85 = pGame->GetStru6(); | |
4191 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1u); | |
4192 v86 = v3->spellnum; | |
4193 v87 = pGame->GetStru6(); | |
4194 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2u); | |
4195 v88 = v3->spellnum; | |
4196 v89 = pGame->GetStru6(); | |
4197 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3u); | |
4198 v90 = (double)(signed int)v733 * 4.2666669; | |
4199 goto LABEL_304; | |
4200 case 5: | |
4201 if ( v12 <= v1 ) | |
4202 goto LABEL_254; | |
4203 if ( v12 <= 2 ) | |
4204 { | |
4205 v91 = 60 * (v2 + 60); | |
4206 } | |
4207 else | |
4208 { | |
4209 if ( v12 == 3 ) | |
4210 { | |
4211 v91 = 180 * (v2 + 20); | |
4212 } | |
4213 else | |
4214 { | |
4215 if ( v12 != 4 ) | |
4216 goto LABEL_254; | |
4217 v91 = 240 * (v2 + 15); | |
4218 } | |
4219 } | |
4220 LODWORD(v733) = v91; | |
4221 LABEL_254: | |
4222 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4223 { | |
89 | 4224 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4225 LODWORD(v727) = 1; |
4226 do | |
4227 { | |
89 | 4228 if ( v92->pConditions ) |
0 | 4229 LODWORD(v727) = v1; |
89 | 4230 ++v92; |
0 | 4231 } |
89 | 4232 while ( v92 <= &pParty->pPlayers[3] ); |
0 | 4233 if ( LODWORD(v727) != v1 ) |
4234 { | |
4235 v726 = (Player *)((int)v733 << 7); | |
4236 pParty->pPartyBuffs[8].Apply( | |
4237 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
4238 v731, | |
4239 v1, | |
4240 v1, | |
4241 v1); | |
4242 v93 = v3->spellnum; | |
4243 v94 = pGame->GetStru6(); | |
4244 pGame->GetStru6()->SetPlayerBuffAnim(v93, v1); | |
4245 v95 = v3->spellnum; | |
4246 v96 = pGame->GetStru6(); | |
4247 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1u); | |
4248 v97 = v3->spellnum; | |
4249 v98 = pGame->GetStru6(); | |
4250 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2u); | |
4251 v99 = v3->spellnum; | |
4252 v100 = pGame->GetStru6(); | |
4253 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3u); | |
4254 } | |
4255 } | |
4256 goto LABEL_83; | |
4257 case 46: | |
4258 v101 = v12 - 1; | |
4259 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4260 { | |
4261 v103 = v102 - 1; | |
4262 if ( v103 ) | |
4263 { | |
4264 if ( v103 != 1 ) | |
4265 goto LABEL_269; | |
4266 v104 = 3600 * (v2 + 1); | |
4267 } | |
4268 else | |
4269 { | |
4270 v104 = 900 * (v2 + 4); | |
4271 } | |
4272 } | |
4273 else | |
4274 { | |
4275 v104 = 300 * (v2 + 12); | |
4276 } | |
4277 LODWORD(v733) = v104; | |
4278 LABEL_269: | |
4279 amount = v2 + 5; | |
4280 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4281 goto LABEL_83; | |
4282 if ( v731 == 1 ) | |
4283 { | |
4284 v108 = v3->uPlayerID_2; | |
4285 v109 = v3->spellnum; | |
4286 v110 = pGame->GetStru6(); | |
4287 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
4288 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, v1, 65536); | |
4289 v668 = v1; | |
4290 v716 = v111; | |
4291 v658 = v111; | |
4292 v653 = amount; | |
4293 v726 = (Player *)((int)v733 << 7); | |
4294 v651 = 1; | |
4295 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4296 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[1]; | |
4297 goto LABEL_103; | |
4298 } | |
4299 v105 = 0; | |
4300 v726 = (Player *)((int)v733 << 7); | |
4301 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4302 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4303 do |
4304 { | |
4305 v106 = v3->spellnum; | |
4306 v107 = pGame->GetStru6(); | |
4307 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); | |
4308 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, v1, 65536); | |
89 | 4309 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
4310 ++v730b; | |
0 | 4311 ++v105; |
4312 } | |
89 | 4313 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4314 goto LABEL_1056; |
4315 case 52: | |
141 | 4316 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == OBJECT_Actor) |
0 | 4317 { |
4318 v730 = a2 >> 3; | |
4319 v112 = &pActors[a2 >> 3]; | |
4320 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4321 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4322 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4323 _this = (ItemGen *)v113; | |
4324 v114 = v721; | |
4325 v115 = (unsigned int)v726; | |
4326 if ( v113 < v721 ) | |
4327 { | |
4328 v116 = v113; | |
4329 v113 = v721; | |
4330 v114 = v116; | |
4331 } | |
4332 if ( v113 < (signed int)v726 ) | |
4333 { | |
4334 v117 = v113; | |
4335 v113 = (int)v726; | |
4336 v115 = v117; | |
4337 } | |
4338 if ( v114 < (signed int)v115 ) | |
4339 { | |
4340 v118 = v115; | |
4341 v115 = v114; | |
4342 v114 = v118; | |
4343 } | |
4344 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4345 if ( (double)(signed int)this <= 307.2 ) | |
4346 { | |
4347 v703 = 0; | |
4348 v702 = 0; | |
4349 v701 = 0; | |
4350 a1.stru_24.Reset(); | |
4351 v119 = HIDWORD(v733); | |
4352 a1.field_48 = *(int *)HIDWORD(v733); | |
4353 a1.field_4C = v723; | |
4354 a1.field_50 = v731; | |
4355 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4356 a1.uAttributes = 0; | |
4357 a1.uSectorID = 0; | |
4358 a1.uSpriteFrameID = 0; | |
4359 v120 = 8 * *(short *)(v119 + 2); | |
303 | 4360 LOBYTE(v120) = v120 | OBJECT_Player; |
0 | 4361 a1.field_60_distance_related_prolly_lod = 0; |
303 | 4362 a1.field_58_pid = v120; |
0 | 4363 a1.uFacing = 0; |
4364 a1.uSoundID = *(short *)(v119 + 16); | |
4365 a1.vPosition.x = v112->vPosition.x; | |
4366 a1.vPosition.y = v112->vPosition.y; | |
4367 v726 = (Player *)v112->uActorHeight; | |
4368 v121 = 8 * a2; | |
4369 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4370 LOBYTE(v121) = 8 * a2 | 3; | |
4371 a1.field_5C = v121; | |
4372 v122 = a1.Create(0, 0, 0, 0); | |
4373 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4374 LODWORD(v727) = 1; | |
4375 } | |
4376 else | |
4377 { | |
4378 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4379 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4380 *(int *)HIDWORD(v733) = 0; | |
4381 } | |
4382 v3 = (stru277 *)HIDWORD(v733); | |
4383 } | |
4384 goto LABEL_83; | |
4385 case 17: | |
4386 case 38: | |
4387 case 51: | |
4388 v123 = v12 - 1; | |
4389 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4390 { | |
4391 v125 = v124 - 1; | |
4392 if ( v125 ) | |
4393 { | |
4394 if ( v125 != 1 ) | |
4395 goto LABEL_296; | |
4396 v126 = 3600 * (v2 + 1); | |
4397 } | |
4398 else | |
4399 { | |
4400 v126 = 900 * (v2 + 4); | |
4401 } | |
4402 } | |
4403 else | |
4404 { | |
4405 v126 = 300 * (v2 + 12); | |
4406 } | |
4407 LODWORD(v733) = v126; | |
4408 LABEL_296: | |
4409 v127 = v3->spellnum; | |
4410 if ( v127 == 17 ) | |
4411 { | |
4412 amount = v1; | |
4413 LODWORD(v725) = 14; | |
4414 } | |
4415 else | |
4416 { | |
4417 if ( v127 == 38 ) | |
4418 { | |
4419 LODWORD(v725) = 15; | |
4420 amount = v2 + 5; | |
4421 } | |
4422 else | |
4423 { | |
4424 if ( v127 != 51 ) | |
4425 goto LABEL_1166; | |
4426 LODWORD(v725) = 9; | |
4427 amount = v2 + 5; | |
4428 } | |
4429 } | |
4430 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4431 goto LABEL_83; | |
4432 v128 = v3->spellnum; | |
4433 v129 = pGame->GetStru6(); | |
4434 pGame->GetStru6()->SetPlayerBuffAnim(v128, v1); | |
4435 v83 = 1; | |
4436 v130 = v3->spellnum; | |
4437 v131 = pGame->GetStru6(); | |
4438 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1u); | |
4439 v132 = v3->spellnum; | |
4440 v133 = pGame->GetStru6(); | |
4441 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2u); | |
4442 v134 = v3->spellnum; | |
4443 v135 = pGame->GetStru6(); | |
4444 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3u); | |
4445 v726 = (Player *)((int)v733 << 7); | |
4446 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
4447 LABEL_304: | |
4448 v673 = v1; | |
4449 v662 = v1; | |
4450 v655 = amount; | |
4451 v652 = v731; | |
4452 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; | |
4453 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; | |
4454 goto LABEL_977; | |
4455 case 8: | |
4456 v138 = v12 - 2; | |
4457 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4458 v140 = 600 * v2; | |
4459 else | |
4460 v140 = 60 * v2; | |
4461 LODWORD(v733) = v140; | |
4462 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4463 goto LABEL_83; | |
4464 v141 = v3->spellnum; | |
4465 v142 = pGame->GetStru6(); | |
4466 pGame->GetStru6()->SetPlayerBuffAnim(v141, v1); | |
4467 v143 = v3->spellnum; | |
4468 v144 = pGame->GetStru6(); | |
4469 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1u); | |
4470 v145 = v3->spellnum; | |
4471 v146 = pGame->GetStru6(); | |
4472 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2u); | |
4473 v147 = v3->spellnum; | |
4474 v148 = pGame->GetStru6(); | |
4475 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3u); | |
4476 v668 = v1; | |
4477 v726 = (Player *)((int)v733 << 7); | |
4478 v658 = v1; | |
4479 v653 = v2; | |
4480 v651 = v731; | |
4481 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4482 v27 = (char *)&pParty->pPartyBuffs[10]; | |
4483 goto LABEL_102; | |
4484 case 9: | |
4485 v149 = v12 - 1; | |
4486 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4487 { | |
4488 if ( v151 == 1 ) | |
4489 _this = (ItemGen *)20; | |
4490 } | |
4491 else | |
4492 { | |
4493 _this = (ItemGen *)16; | |
4494 } | |
4495 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4496 { | |
4497 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4498 goto LABEL_201; | |
4499 } | |
4500 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4501 goto LABEL_83; | |
4502 LODWORD(v725) = a2 & 7; | |
141 | 4503 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4504 { |
4505 v152 = a2 >> 3; | |
4506 uRequiredMana = pActors[v152].vPosition.x; | |
4507 v153 = pActors[v152].vPosition.y; | |
4508 v154 = pActors[v152].vPosition.z; | |
4509 LODWORD(v727) = v153; | |
4510 } | |
4511 else | |
4512 { | |
323 | 4513 v155 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4514 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); |
323 | 4515 v156 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4516 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); |
4517 v154 = pParty->vPosition.z; | |
4518 } | |
4519 HIDWORD(v733) = v154; | |
4520 v713 = v154 + 2500; | |
4521 v721 = v1; | |
4522 LODWORD(v718) = v1; | |
4523 if ( (signed int)this > v1 ) | |
4524 { | |
4525 *(float *)&y = (double)SHIDWORD(v733); | |
4526 *(float *)&v732 = (double)v713; | |
4527 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4528 v726 = (Player *)this; | |
4529 do | |
4530 { | |
4531 v157 = rand(); | |
4532 v158 = (double)SLODWORD(v718); | |
4533 v718 = v158; | |
4534 v159 = (double)v721; | |
4535 *(float *)&v721 = v159; | |
4536 a2 = v157 % 1000; | |
4537 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4538 v725 = v159 * v159; | |
4539 *(float *)&_this = v158 * v158; | |
4540 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4541 { | |
4542 LODWORD(v687) = v1; | |
4543 HIDWORD(v687) = v1; | |
4544 } | |
4545 else | |
4546 { | |
4547 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4548 v687 = __PAIR__( | |
4549 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4550 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4551 } | |
4552 a1.stru_24.Reset(); | |
4553 a1.field_48 = v3->spellnum; | |
4554 a1.field_4C = v2; | |
4555 a1.field_50 = v731; | |
4556 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4557 a1.uAttributes = v1; | |
4558 a1.vPosition.x = uRequiredMana; | |
4559 a1.vPosition.y = LODWORD(v727); | |
4560 a1.uSectorID = v1; | |
4561 a1.vPosition.z = a2 + v713; | |
4562 a1.uSpriteFrameID = v1; | |
303 | 4563 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4564 a1.field_5C = v730; |
4565 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4566 a1.uFacing = v687; | |
4567 a1.uSoundID = LOWORD(v3->field_10); | |
4568 if ( pParty->bTurnBasedModeOn == 1 ) | |
4569 a1.uAttributes = 4; | |
4570 if ( a1.Create( | |
4571 v687, | |
4572 SHIDWORD(v687), | |
4573 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4574 v1) != -1 | |
4575 && pParty->bTurnBasedModeOn == 1 ) | |
4576 ++pTurnEngine->field_1C; | |
4577 LODWORD(v718) = rand() % 1024 - 512; | |
4578 v160 = rand(); | |
4579 v14 = v726 == (Player *)1; | |
4580 v726 = (Player *)((char *)v726 - 1); | |
4581 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4582 } | |
4583 while ( !v14 ); | |
4584 } | |
4585 goto LABEL_1056; | |
4586 case 10: | |
4587 v67 = 2; | |
4588 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4589 { | |
4590 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4591 goto LABEL_202; | |
4592 } | |
4593 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4594 goto LABEL_83; | |
4595 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
4596 v700.z = v1; | |
4597 v700.y = v1; | |
4598 v700.x = v1; | |
4599 a1.stru_24.Reset(); | |
4600 a1.field_48 = v3->spellnum; | |
4601 a1.field_4C = v2; | |
4602 a1.field_50 = v731; | |
4603 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4604 a1.uAttributes = v1; | |
4605 a1.uSectorID = v1; | |
4606 a1.uSpriteFrameID = v1; | |
4607 v161 = v3->uPlayerID; | |
4608 a1.field_60_distance_related_prolly_lod = 0; | |
4609 a1.uFacing = v1; | |
4610 v161 *= 8; | |
303 | 4611 LOBYTE(v161) = v161 | OBJECT_Player; |
4612 a1.field_58_pid = v161; | |
0 | 4613 a1.uSoundID = LOWORD(v3->field_10); |
4614 a2 = v1; | |
4615 if ( (signed int)v726 > v1 ) | |
4616 { | |
4617 do | |
4618 { | |
4619 v162 = dword_50BF30[a2]; | |
4620 a1.vPosition.x = pActors[v162].vPosition.x; | |
4621 a1.vPosition.y = pActors[v162].vPosition.y; | |
4622 v732 = pActors[v162].uActorHeight; | |
4623 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4624 v163 = 8 * dword_50BF30[a2]; | |
4625 LOBYTE(v163) = v163 | 3; | |
4626 a1.field_5C = v163; | |
4627 v164 = a1.Create(0, v1, v1, v1); | |
4628 v165 = a2; | |
4629 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
4630 v166 = pGame->GetStru6(); | |
4631 v166->_4A81CA(&a1); | |
4632 v167 = pGame->GetStru6(); | |
4633 v167->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
4634 a2 = v165 + 1; | |
4635 } | |
4636 while ( v165 + 1 < (signed int)v726 ); | |
4637 } | |
4638 goto LABEL_1056; | |
4639 case 12: | |
4640 LODWORD(v733) = 3600 * v2; | |
4641 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4642 goto LABEL_83; | |
4643 v168 = 0; | |
4644 do | |
4645 { | |
4646 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, v1, 65536); | |
4647 v716 = v169; | |
4648 } | |
4649 while ( v168 < 4 ); | |
4650 v668 = v1; | |
4651 v732 = (int)v733 << 7; | |
4652 v658 = v1; | |
4653 v653 = v1; | |
4654 v651 = v731; | |
4655 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4656 goto LABEL_992; | |
4657 case 13: | |
4658 v170 = v12 - 1; | |
4659 if ( !v170 ) | |
4660 { | |
4661 v173 = 300 * v2; | |
4662 goto LABEL_353; | |
4663 } | |
4664 v171 = v170 - 1; | |
4665 if ( !v171 ) | |
4666 { | |
4667 v173 = 600 * v2; | |
4668 goto LABEL_353; | |
4669 } | |
4670 v172 = v171 - 1; | |
4671 if ( !v172 || v172 == 1 ) | |
4672 { | |
4673 v173 = 3600 * v2; | |
4674 LABEL_353: | |
4675 LODWORD(v733) = v173; | |
4676 } | |
4677 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4678 goto LABEL_83; | |
4679 v174 = 0; | |
4680 do | |
4681 pOtherOverlayList->_4418B1(2010, v174++ + 100, v1, 65536); | |
4682 while ( v174 < 4 ); | |
4683 v175 = v3->spellnum; | |
4684 v176 = pGame->GetStru6(); | |
4685 pGame->GetStru6()->SetPlayerBuffAnim(v175, v1); | |
4686 v83 = 1; | |
4687 v177 = v3->spellnum; | |
4688 v178 = pGame->GetStru6(); | |
4689 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1u); | |
4690 v179 = v3->spellnum; | |
4691 v180 = pGame->GetStru6(); | |
4692 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2u); | |
4693 v181 = v3->spellnum; | |
4694 v182 = pGame->GetStru6(); | |
4695 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3u); | |
4696 v673 = v1; | |
4697 v732 = (int)v733 << 7; | |
4698 v662 = v1; | |
4699 v655 = v1; | |
4700 v652 = v731; | |
4701 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4702 v137 = (char *)&pParty->pPartyBuffs[5]; | |
4703 goto LABEL_976; | |
4704 case 15: | |
4705 v184 = v12 - 1; | |
4706 if ( v184 ) | |
4707 { | |
4708 v185 = v184 - 1; | |
4709 if ( v185 ) | |
4710 { | |
4711 v186 = v185 - 1; | |
4712 if ( v186 ) | |
4713 { | |
4714 if ( v186 == 1 ) | |
4715 amount = 9; | |
4716 } | |
4717 else | |
4718 { | |
4719 amount = 7; | |
4720 } | |
4721 } | |
4722 else | |
4723 { | |
4724 amount = 5; | |
4725 } | |
4726 } | |
4727 else | |
4728 { | |
4729 amount = 3; | |
4730 } | |
4731 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4732 goto LABEL_83; | |
4733 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
4734 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4735 a1.stru_24.Reset(); | |
4736 a1.field_48 = v3->spellnum; | |
4737 a1.field_4C = v2; | |
4738 a1.field_50 = v731; | |
4739 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4740 a1.vPosition.y = pParty->vPosition.y; | |
4741 a1.vPosition.x = pParty->vPosition.x; | |
4742 a1.uAttributes = v1; | |
4743 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4744 a1.uSectorID = pIndoor->GetSector( | |
4745 pParty->vPosition.x, | |
4746 pParty->vPosition.y, | |
4747 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
4748 a1.uSpriteFrameID = v1; | |
4749 v187 = 8 * v3->uPlayerID; | |
303 | 4750 LOBYTE(v187) = v187 | OBJECT_Player; |
4751 a1.field_58_pid = v187; | |
0 | 4752 a1.field_5C = a2; |
4753 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4754 a1.uSoundID = LOWORD(v3->field_10); | |
4755 if ( pParty->bTurnBasedModeOn == 1 ) | |
4756 LOBYTE(a1.uAttributes) |= 4u; | |
4757 v188 = (signed int)v726 / -2; | |
4758 v189 = (signed int)v726 / 2; | |
4759 while ( v188 <= v189 ) | |
4760 { | |
4761 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4762 if ( a1.Create( | |
4763 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4764 v715.uPitchAngle, | |
4765 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4766 v3->uPlayerID + 1) != -1 | |
4767 && pParty->bTurnBasedModeOn == 1 ) | |
4768 ++pTurnEngine->field_1C; | |
4769 v188 += v732; | |
4770 } | |
4771 goto LABEL_1056; | |
4772 case 16: | |
4773 if ( pParty->uFlags & 8 ) | |
4774 { | |
4775 v190 = pGlobalTXT_LocalizationStrings[493]; | |
4776 goto LABEL_462; | |
4777 } | |
4778 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4779 goto LABEL_83; | |
4780 v191 = 0; | |
4781 do | |
4782 pOtherOverlayList->_4418B1(2040, v191++ + 100, v1, 65536); | |
4783 while ( v191 < 4 ); | |
4784 BYTE1(pParty->uFlags) |= 1u; | |
4785 pParty->uFallSpeed = 1000; | |
4786 goto LABEL_1056; | |
4787 case 19: | |
4788 v192 = v12 - 1; | |
4789 if ( !v192 ) | |
4790 { | |
4791 amount = v2; | |
4792 goto LABEL_391; | |
4793 } | |
4794 v193 = v192 - 1; | |
4795 if ( !v193 ) | |
4796 { | |
4797 v196 = 2 * v2; | |
4798 LABEL_389: | |
4799 amount = v196; | |
4800 LABEL_391: | |
4801 v195 = 600 * v2; | |
4802 goto LABEL_392; | |
4803 } | |
4804 v194 = v193 - 1; | |
4805 if ( !v194 ) | |
4806 { | |
4807 v196 = 3 * v2; | |
4808 goto LABEL_389; | |
4809 } | |
4810 if ( v194 != 1 ) | |
4811 goto LABEL_393; | |
4812 amount = 4 * v2; | |
4813 v195 = 3600 * v2; | |
4814 LABEL_392: | |
4815 LODWORD(v733) = v195; | |
4816 LABEL_393: | |
4817 if ( pParty->uFlags & 0x30 ) | |
4818 { | |
4819 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4820 goto LABEL_201; | |
4821 } | |
4822 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4823 { | |
4824 v197 = v3->spellnum; | |
4825 v198 = pGame->GetStru6(); | |
4826 pGame->GetStru6()->SetPlayerBuffAnim(v197, v1); | |
4827 v83 = 1; | |
4828 v199 = v3->spellnum; | |
4829 v200 = pGame->GetStru6(); | |
4830 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1u); | |
4831 v201 = v3->spellnum; | |
4832 v202 = pGame->GetStru6(); | |
4833 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2u); | |
4834 v203 = v3->spellnum; | |
4835 v204 = pGame->GetStru6(); | |
4836 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3u); | |
4837 v673 = v1; | |
4838 v732 = (int)v733 << 7; | |
4839 v662 = v1; | |
4840 v655 = amount; | |
4841 v652 = v731; | |
4842 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4843 v137 = (char *)&pParty->pPartyBuffs[11]; | |
4844 LABEL_976: | |
4845 v136 = pParty->uTimePlayed + v183; | |
4846 LABEL_977: | |
4847 ((SpellBuff *)v137)->Apply(v136, v652, v655, v662, v673); | |
4848 LABEL_978: | |
4849 LODWORD(v727) = v83; | |
4850 } | |
4851 goto LABEL_83; | |
4852 case 21: | |
4853 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4854 { | |
4855 v190 = pGlobalTXT_LocalizationStrings[494]; | |
4856 LABEL_462: | |
4857 ShowStatusBarString(v190, 2u); | |
4858 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
4859 goto LABEL_83; | |
4860 } | |
4861 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4862 { | |
4863 LABEL_461: | |
4864 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4865 goto LABEL_462; | |
4866 } | |
4867 LODWORD(v733) = 3600 * v2; | |
4868 if ( v731 == 2 || v731 == 3 || (amount = v1, v731 != 4) ) | |
4869 amount = 1; | |
4870 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4871 goto LABEL_83; | |
4872 v205 = 0; | |
4873 do | |
4874 pOtherOverlayList->_4418B1(2090, v205++ + 100, v1, 65536); | |
4875 while ( v205 < 4 ); | |
4876 v206 = pOtherOverlayList->_4418B1(10008, 203, v1, 65536); | |
4877 v207 = v3->uPlayerID + 1; | |
4878 v716 = v206; | |
4879 v668 = v207; | |
4880 v658 = v206; | |
4881 v653 = amount; | |
4882 v732 = (int)v733 << 7; | |
4883 v651 = v731; | |
4884 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4885 v27 = (char *)&pParty->pPartyBuffs[7]; | |
4886 LABEL_101: | |
4887 v26 = (signed int)v26; | |
4888 LABEL_102: | |
4889 v28 = pParty->uTimePlayed + v26; | |
4890 LABEL_103: | |
4891 HIDWORD(v650) = HIDWORD(v28); | |
4892 LABEL_104: | |
4893 LODWORD(v650) = v28; | |
4894 ((SpellBuff *)v27)->Apply(v650, v651, v653, v658, v668); | |
4895 goto LABEL_1056; | |
4896 case 22: | |
4897 v67 = 2; | |
4898 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4899 { | |
4900 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4901 goto LABEL_202; | |
4902 } | |
4903 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4904 goto LABEL_83; | |
4905 v208 = a2 & 7; | |
4906 LODWORD(v725) = a2 & 7; | |
4907 if ( v208 == 3 ) | |
4908 { | |
4909 v209 = a2 >> 3; | |
4910 LODWORD(v718) = pActors[v209].vPosition.x; | |
4911 v210 = pActors[v209].vPosition.y; | |
4912 v211 = pActors[v209].vPosition.z; | |
4913 v713 = v210; | |
4914 } | |
4915 else | |
4916 { | |
323 | 4917 v212 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4918 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); |
323 | 4919 v213 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4920 v214 = sub_42EBBE(2048, v213); |
4921 v211 = pParty->vPosition.z; | |
4922 v713 = pParty->vPosition.y + v214; | |
4923 v208 = LODWORD(v725); | |
4924 } | |
4925 v726 = (Player *)v211; | |
4926 HIDWORD(v733) = v1; | |
4927 *(float *)&v732 = (double)v211; | |
4928 LODWORD(v725) = v211 + 2500; | |
4929 v721 = v1; | |
4930 *(float *)&y = (double)(v211 + 2500); | |
4931 v730 = v208 == 3 ? a2 : 0; | |
4932 a2 = 20; | |
4933 do | |
4934 { | |
4935 v215 = rand(); | |
4936 v216 = (double)v721; | |
4937 v727 = v216; | |
4938 v217 = (double)SHIDWORD(v733); | |
4939 *(float *)&uRequiredMana = v217; | |
4940 _this = (ItemGen *)(v215 % 1000); | |
4941 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4942 *(float *)&v721 = v217 * v217; | |
4943 *(float *)&v726 = v216 * v216; | |
4944 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4945 { | |
4946 LODWORD(v685) = v1; | |
4947 HIDWORD(v685) = v1; | |
4948 } | |
4949 else | |
4950 { | |
4951 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4952 v685 = __PAIR__( | |
4953 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4954 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4955 } | |
4956 a1.stru_24.Reset(); | |
4957 a1.field_48 = v3->spellnum; | |
4958 a1.field_4C = v2; | |
4959 a1.field_50 = v731; | |
4960 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4961 a1.uAttributes = v1; | |
4962 a1.vPosition.x = LODWORD(v718); | |
4963 a1.vPosition.y = v713; | |
4964 a1.uSectorID = v1; | |
4965 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); | |
4966 a1.uSpriteFrameID = v1; | |
303 | 4967 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4968 a1.field_5C = v730; |
4969 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4970 a1.uFacing = v685; | |
4971 a1.uSoundID = LOWORD(v3->field_10); | |
4972 if ( pParty->bTurnBasedModeOn == 1 ) | |
4973 a1.uAttributes = 4; | |
4974 if ( a1.Create( | |
4975 v685, | |
4976 SHIDWORD(v685), | |
4977 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4978 v1) != -1 | |
4979 && pParty->bTurnBasedModeOn == 1 ) | |
4980 ++pTurnEngine->field_1C; | |
4981 v721 = rand() % 1024 - 512; | |
4982 v218 = rand(); | |
4983 v14 = a2-- == 1; | |
4984 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4985 } | |
4986 while ( !v14 ); | |
4987 goto LABEL_1056; | |
4988 case 23: | |
4989 v219 = v12 - 2; | |
4990 if ( v219 ) | |
4991 { | |
4992 v220 = v219 - 1; | |
4993 if ( v220 ) | |
4994 { | |
4995 if ( v220 == 1 ) | |
4996 { | |
4997 amount = v1; | |
4998 goto LABEL_433; | |
4999 } | |
5000 v221 = 180 * v2; | |
5001 } | |
5002 else | |
5003 { | |
5004 v221 = 86400 * v2; | |
5005 } | |
5006 } | |
5007 else | |
5008 { | |
5009 v221 = 3600 * v2; | |
5010 } | |
5011 amount = v221; | |
5012 LABEL_433: | |
5013 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5014 goto LABEL_83; | |
5015 v222 = (char *)pParty->pPlayers; | |
5016 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
5017 break; | |
5018 case 24: | |
5019 v224 = v12 - 2; | |
5020 if ( v224 ) | |
5021 { | |
5022 v225 = v224 - 1; | |
5023 if ( v225 ) | |
5024 { | |
5025 if ( v225 == 1 ) | |
5026 amount = 7; | |
5027 else | |
5028 amount = 1; | |
5029 } | |
5030 else | |
5031 { | |
5032 amount = 5; | |
5033 } | |
5034 } | |
5035 else | |
5036 { | |
5037 amount = 3; | |
5038 } | |
5039 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5040 goto LABEL_83; | |
5041 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
5042 if ( amount == 1 ) | |
5043 { | |
5044 LABEL_152: | |
5045 a1.stru_24.Reset(); | |
5046 a1.field_48 = v3->spellnum; | |
5047 a1.field_50 = v731; | |
5048 a1.field_4C = v2; | |
5049 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5050 a1.vPosition.y = pParty->vPosition.y; | |
5051 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5052 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5053 v660 = pParty->vPosition.y; | |
5054 LABEL_153: | |
5055 a1.uAttributes = v1; | |
5056 a1.vPosition.x = pParty->vPosition.x; | |
5057 a1.vPosition.z = v51; | |
5058 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
5059 a1.uSpriteFrameID = v1; | |
5060 a1.uSectorID = v52; | |
5061 v53 = 8 * v3->uPlayerID; | |
303 | 5062 LOBYTE(v53) = v53 | OBJECT_Player; |
5063 a1.field_58_pid = v53; | |
0 | 5064 a1.field_5C = a2; |
5065 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5066 a1.uFacing = LOWORD(v715.uYawAngle); | |
5067 a1.uSoundID = LOWORD(v3->field_10); | |
5068 LABEL_154: | |
5069 if ( pParty->bTurnBasedModeOn == 1 ) | |
5070 LOBYTE(a1.uAttributes) |= 4u; | |
5071 LABEL_156: | |
5072 v669 = v3->uPlayerID + 1; | |
5073 v36 = v715.uYawAngle; | |
5074 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5075 v654 = v715.uPitchAngle; | |
5076 LABEL_157: | |
5077 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
5078 ++pTurnEngine->field_1C; | |
5079 } | |
5080 else | |
5081 { | |
5082 v732 = SHIDWORD(v733) / (amount - 1); | |
5083 a1.stru_24.Reset(); | |
5084 a1.field_48 = v3->spellnum; | |
5085 a1.field_4C = v2; | |
5086 a1.field_50 = v731; | |
5087 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5088 a1.vPosition.y = pParty->vPosition.y; | |
5089 a1.vPosition.x = pParty->vPosition.x; | |
5090 a1.uAttributes = v1; | |
5091 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5092 a1.uSectorID = pIndoor->GetSector( | |
5093 pParty->vPosition.x, | |
5094 pParty->vPosition.y, | |
5095 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5096 a1.uSpriteFrameID = v1; | |
5097 v226 = 8 * v3->uPlayerID; | |
303 | 5098 LOBYTE(v226) = v226 | OBJECT_Player; |
5099 a1.field_58_pid = v226; | |
0 | 5100 a1.field_5C = a2; |
5101 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5102 a1.uSoundID = LOWORD(v3->field_10); | |
5103 if ( pParty->bTurnBasedModeOn == 1 ) | |
5104 LOBYTE(a1.uAttributes) |= 4u; | |
5105 v227 = SHIDWORD(v733) / -2; | |
5106 y = (char *)(SHIDWORD(v733) / 2); | |
5107 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5108 { | |
5109 v228 = v715.uYawAngle; | |
5110 do | |
5111 { | |
5112 a1.uFacing = v227 + v228; | |
5113 if ( a1.Create( | |
5114 v227 + v228, | |
5115 v715.uPitchAngle, | |
5116 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5117 v3->uPlayerID + 1) != -1 | |
5118 && pParty->bTurnBasedModeOn == 1 ) | |
5119 ++pTurnEngine->field_1C; | |
5120 v227 += v732; | |
5121 } | |
5122 while ( v227 <= (signed int)y ); | |
5123 } | |
5124 } | |
5125 goto LABEL_1056; | |
5126 case 27: | |
5127 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5128 goto LABEL_461; | |
5129 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5130 v229 = 600 * v2; | |
5131 else | |
5132 v229 = 3600 * v2; | |
5133 LODWORD(v733) = v229; | |
5134 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5135 goto LABEL_83; | |
5136 v716 = pOtherOverlayList->_4418B1(10005, 201, v1, 65536); | |
5137 v230 = v3->spellnum; | |
5138 v231 = pGame->GetStru6(); | |
5139 pGame->GetStru6()->SetPlayerBuffAnim(v230, v1); | |
5140 v232 = 1; | |
5141 v233 = v3->spellnum; | |
5142 v234 = pGame->GetStru6(); | |
5143 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1u); | |
5144 v235 = v3->spellnum; | |
5145 v236 = pGame->GetStru6(); | |
5146 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2u); | |
5147 v237 = v3->spellnum; | |
5148 v238 = pGame->GetStru6(); | |
5149 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3u); | |
5150 v239 = v3->uPlayerID + 1; | |
5151 v732 = v229 << 7; | |
5152 pParty->pPartyBuffs[18].Apply( | |
5153 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5154 v731, | |
5155 amount, | |
5156 v716, | |
5157 v239); | |
5158 if ( v731 == 4 ) | |
5159 pParty->pPartyBuffs[18].uFlags = 1; | |
89 | 5160 LODWORD(v727) = v232; |
5161 goto LABEL_83; | |
0 | 5162 case 28: |
5163 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5164 goto LABEL_83; | |
5165 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; | |
5166 y = v240; | |
5167 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5168 goto LABEL_199; | |
5169 if ( v731 == 1 || v731 == 2 ) | |
5170 { | |
5171 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5172 } | |
5173 else | |
5174 { | |
5175 if ( v731 == 3 ) | |
5176 { | |
5177 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5178 } | |
5179 else | |
5180 { | |
5181 if ( v731 != 4 ) | |
5182 { | |
5183 v241 = 0.0; | |
5184 goto LABEL_484; | |
5185 } | |
5186 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5187 } | |
5188 } | |
5189 if ( v241 > 1.0 ) | |
5190 v241 = 1.0; | |
5191 LABEL_484: | |
5192 v732 = (unsigned __int8)v240[25]; | |
5193 v242 = (signed __int64)((double)v732 * v241); | |
5194 v243 = y; | |
5195 y[25] = v242; | |
5196 *((int *)v243 + 4) = (unsigned __int8)v242; | |
5197 if ( (unsigned __int8)v242 <= v1 ) | |
5198 { | |
5199 *(int *)v243 = v1; | |
5200 dword_50C9D0 = 113; | |
5201 dword_50C9D4 = v1; | |
5202 dword_50C9D8 = 1; | |
5203 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
5204 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5205 v3->spellnum = v1; | |
5206 goto LABEL_1165; | |
5207 } | |
5208 *((int *)v243 + 5) |= 0x40u; | |
5209 goto LABEL_1055; | |
5210 case 30: | |
5211 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5212 goto LABEL_83; | |
5213 uRequiredMana = v1; | |
5214 HIDWORD(v733) = 10 * v2; | |
5215 v730 = 1; | |
5216 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5217 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5218 if ( v731 == 1 ) | |
5219 { | |
5220 v245 = (int)&v244[36 * a2 + 532]; | |
5221 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5222 v311 = __OFSUB__(*(int *)v245, 134); | |
5223 v14 = *(int *)v245 == 134; | |
5224 v310 = *(int *)v245 - 134 < 0; | |
5225 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5226 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5227 { | |
5228 if ( *(int *)&v244[36 * a2 + 544] == v1 ) | |
5229 { | |
5230 if ( *(int *)&v244[36 * a2 + 536] == v1 ) | |
5231 { | |
5232 if ( *(int *)&v244[36 * a2 + 540] == v1 ) | |
5233 { | |
5234 v312 = v309[28]; | |
5235 if ( v312 ) | |
5236 { | |
5237 if ( v312 != 1 ) | |
5238 { | |
5239 if ( v312 != 2 ) | |
5240 { | |
5241 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5242 if ( !(v244[36 * a2 + 552] & 2) ) | |
5243 { | |
5244 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5245 { | |
5246 uRequiredMana = 1; | |
5247 v730 = v1; | |
5248 } | |
5249 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5250 uRequiredMana = 1; | |
5251 if ( uRequiredMana == v1 ) | |
5252 { | |
5253 v313 = *(char *)(LODWORD(v725) + 28); | |
5254 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5255 { | |
224 | 5256 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5257 *(int *)(v245 + 4) = 0; |
222 | 5258 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5259 + 1]; |
5260 ; | |
222 | 5261 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5262 + 1] ) |
5263 { | |
5264 ++*(int *)(v245 + 4); | |
5265 if ( j >= v314 ) | |
5266 break; | |
5267 } | |
5268 v254 = rand(); | |
224 | 5269 v255 = 10;//pItemsTable->field_116D8[17]; |
5270 v256 = 10;//pItemsTable->field_116D8[16]; | |
0 | 5271 LABEL_611: |
5272 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5273 LABEL_612: | |
5274 _this->uItemID |= 0x20u; | |
5275 goto LABEL_1055; | |
5276 } | |
5277 goto LABEL_615; | |
5278 } | |
5279 LABEL_613: | |
5280 v316 = _this->uItemID; | |
5281 if ( !(BYTE1(v316) & 2) ) | |
5282 { | |
5283 LOBYTE(v316) = v316 | 2; | |
5284 _this->uItemID = v316; | |
5285 } | |
5286 } | |
5287 } | |
5288 } | |
5289 } | |
5290 } | |
5291 } | |
5292 } | |
5293 } | |
5294 LABEL_616: | |
5295 if ( LODWORD(v727) == v1 ) | |
5296 { | |
5297 v317 = pGlobalTXT_LocalizationStrings[428]; | |
5298 if ( v730 == v1 ) | |
5299 v317 = pGlobalTXT_LocalizationStrings[585]; | |
5300 ShowStatusBarString(v317, 2u); | |
5301 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
5302 v318 = v726; | |
5303 v3->spellnum = v1; | |
187 | 5304 v318->PlaySound(SPEECH_43, v1); |
0 | 5305 } |
5306 goto LABEL_83; | |
5307 } | |
5308 if ( v731 != 2 ) | |
5309 { | |
5310 if ( v731 == 3 ) | |
5311 { | |
5312 v245 = (int)&v244[36 * a2 + 532]; | |
5313 v269 = *(int *)v245; | |
5314 if ( *(int *)v245 > 134 | |
5315 || *(int *)(v245 + 12) != v1 | |
5316 || *(int *)(v245 + 4) != v1 | |
5317 || *(int *)(v245 + 8) != v1 | |
5318 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) | |
5319 goto LABEL_616; | |
5320 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5321 LODWORD(v725) = (int)v270; | |
5322 v271 = v270[28]; | |
5323 if ( v271 && v271 != 1 && v271 != 2 ) | |
5324 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5325 else | |
5326 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5327 if ( v272 ) | |
5328 { | |
5329 uRequiredMana = 1; | |
5330 v730 = v1; | |
5331 } | |
5332 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5333 uRequiredMana = 1; | |
5334 if ( uRequiredMana != v1 ) | |
5335 goto LABEL_613; | |
5336 v273 = v725; | |
5337 v274 = *(char *)(LODWORD(v725) + 28); | |
5338 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 ) | |
5339 { | |
5340 if ( rand() % 100 < 80 | |
5341 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5342 { | |
224 | 5343 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5344 *(int *)(v245 + 4) = 0; |
222 | 5345 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5346 ; |
222 | 5347 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5348 + 1] ) |
5349 { | |
5350 ++*(int *)(v245 + 4); | |
5351 if ( k >= v275 ) | |
5352 break; | |
5353 } | |
5354 v254 = rand(); | |
224 | 5355 v255 = 10;//pItemsTable->field_116D8[19]; |
5356 v256 = 10;//pItemsTable->field_116D8[18]; | |
0 | 5357 goto LABEL_611; |
5358 } | |
222 | 5359 v277 = pItemsTable->pSpecialEnchantments_count; |
0 | 5360 v278 = 0; |
5361 v725 = 0.0; | |
5362 HIDWORD(v733) = 0; | |
222 | 5363 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5364 { |
5365 v730 = (int)&v679; | |
5366 do | |
5367 { | |
222 | 5368 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement); |
0 | 5369 if ( !v279 || v279 == 1 ) |
5370 { | |
222 | 5371 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5372 + 4] |
5373 + v278 * 28); | |
5374 LODWORD(v725) += v280; | |
5375 if ( v280 ) | |
5376 { | |
5377 v281 = v730; | |
5378 v730 += 4; | |
5379 *(int *)v281 = HIDWORD(v733); | |
5380 } | |
5381 } | |
5382 ++HIDWORD(v733); | |
5383 ++v278; | |
5384 } | |
5385 while ( SHIDWORD(v733) < v277 ); | |
5386 } | |
5387 v282 = rand() % SLODWORD(v725); | |
5388 v283 = v679; | |
5389 *(int *)(v245 + 12) = v679; | |
222 | 5390 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5391 v285 = v282 + 1; |
5392 if ( v284 < v285 ) | |
5393 { | |
5394 for ( l = &v679; ; l = (int *)v732 ) | |
5395 { | |
5396 v287 = (int)(l + 1); | |
5397 v732 = v287; | |
5398 v288 = *(int *)v287; | |
5399 *(int *)(v245 + 12) = v288; | |
222 | 5400 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5401 + 4]; |
5402 if ( v284 >= v285 ) | |
5403 break; | |
5404 } | |
5405 } | |
5406 goto LABEL_525; | |
5407 } | |
5408 } | |
5409 else | |
5410 { | |
5411 if ( v731 != 4 | |
5412 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
377 | 5413 || v726->pInventoryItems[a2].uSpecEnchantmentType != v1 |
5414 || v726->pInventoryItems[a2].uEncantmentType != v1 | |
0 | 5415 || v726->pInventoryItems[a2]._bonus_strength != v1 |
315 | 5416 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) |
0 | 5417 goto LABEL_616; |
5418 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5419 LODWORD(v725) = (int)v247; | |
5420 v248 = v247[28]; | |
5421 if ( v248 && v248 != 1 && v248 != 2 ) | |
5422 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5423 else | |
5424 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5425 if ( v249 ) | |
5426 { | |
5427 uRequiredMana = 1; | |
5428 v730 = v1; | |
5429 } | |
5430 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5431 uRequiredMana = 1; | |
5432 if ( uRequiredMana != v1 ) | |
5433 goto LABEL_613; | |
5434 v250 = v725; | |
5435 v251 = *(char *)(LODWORD(v725) + 28); | |
5436 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 ) | |
5437 { | |
5438 if ( rand() % 100 < 80 | |
5439 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5440 { | |
224 | 5441 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5442 *(int *)(v245 + 4) = 0; |
222 | 5443 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5444 ; |
222 | 5445 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5446 + 1] ) |
5447 { | |
5448 ++*(int *)(v245 + 4); | |
5449 if ( m >= v252 ) | |
5450 break; | |
5451 } | |
5452 v254 = rand(); | |
224 | 5453 v255 = 10;// pItemsTable->field_116D8[21]; |
5454 v256 = 10;//pItemsTable->field_116D8[20]; | |
0 | 5455 goto LABEL_611; |
5456 } | |
222 | 5457 v257 = pItemsTable->pSpecialEnchantments_count; |
0 | 5458 v258 = 0; |
5459 v725 = 0.0; | |
5460 HIDWORD(v733) = 0; | |
222 | 5461 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5462 { |
5463 v730 = (int)&v679; | |
5464 do | |
5465 { | |
222 | 5466 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
0 | 5467 if ( !v259 || v259 == 1 ) |
5468 { | |
222 | 5469 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5470 + 4] |
5471 + v258 * 28); | |
5472 LODWORD(v725) += v260; | |
5473 if ( v260 ) | |
5474 { | |
5475 v261 = v730; | |
5476 v730 += 4; | |
5477 *(int *)v261 = HIDWORD(v733); | |
5478 } | |
5479 } | |
5480 ++HIDWORD(v733); | |
5481 ++v258; | |
5482 } | |
5483 while ( SHIDWORD(v733) < v257 ); | |
5484 } | |
5485 v262 = rand() % SLODWORD(v725); | |
5486 v263 = v679; | |
5487 *(int *)(v245 + 12) = v679; | |
222 | 5488 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5489 v265 = v262 + 1; |
5490 if ( v264 < v265 ) | |
5491 { | |
5492 for ( ii = &v679; ; ii = (int *)v732 ) | |
5493 { | |
5494 v267 = (int)(ii + 1); | |
5495 v732 = v267; | |
5496 v268 = *(int *)v267; | |
5497 *(int *)(v245 + 12) = v268; | |
222 | 5498 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5499 + 4]; |
5500 if ( v264 >= v265 ) | |
5501 break; | |
5502 } | |
5503 } | |
5504 LABEL_525: | |
5505 ++*(int *)(v245 + 12); | |
5506 goto LABEL_612; | |
5507 } | |
5508 } | |
5509 LABEL_615: | |
5510 v1 = 0; | |
5511 goto LABEL_616; | |
5512 } | |
5513 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5514 _this = v289; | |
5515 v290 = v289->uItemID; | |
5516 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5517 if ( v290 > 134 | |
377 | 5518 || _this->uSpecEnchantmentType != v1 |
5519 || _this->uEncantmentType != v1 | |
0 | 5520 || _this->_bonus_strength != v1 |
5521 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 | |
5522 || v291 == 1 | |
5523 || v291 == 2 | |
315 | 5524 || _this->Broken()) |
0 | 5525 goto LABEL_616; |
5526 if ( _this->GetValue() < 0x1C2 ) | |
5527 uRequiredMana = 1; | |
5528 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5529 uRequiredMana = 1; | |
5530 if ( uRequiredMana != v1 ) | |
5531 goto LABEL_199; | |
5532 v292 = *(char *)(LODWORD(v725) + 28); | |
5533 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5534 { | |
5535 v2 = v723; | |
5536 v1 = 0; | |
5537 goto LABEL_199; | |
5538 } | |
5539 if ( rand() % 100 >= 80 ) | |
5540 { | |
222 | 5541 v297 = pItemsTable->pSpecialEnchantments_count; |
0 | 5542 v294 = _this; |
5543 v298 = 0; | |
5544 v725 = 0.0; | |
5545 HIDWORD(v733) = 0; | |
222 | 5546 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5547 { |
5548 v730 = (int)&v679; | |
5549 do | |
5550 { | |
222 | 5551 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement); |
0 | 5552 if ( !v299 || v299 == 1 ) |
5553 { | |
222 | 5554 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4] |
0 | 5555 + v298 * 28); |
5556 LODWORD(v725) += v300; | |
5557 if ( v300 ) | |
5558 { | |
5559 v301 = v730; | |
5560 v730 += 4; | |
5561 *(int *)v301 = HIDWORD(v733); | |
5562 } | |
5563 } | |
5564 ++HIDWORD(v733); | |
5565 ++v298; | |
5566 } | |
5567 while ( SHIDWORD(v733) < v297 ); | |
5568 } | |
5569 v302 = rand() % SLODWORD(v725); | |
5570 v303 = v679; | |
377 | 5571 v294->uSpecEnchantmentType = v679; |
222 | 5572 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5573 v305 = v302 + 1; |
5574 if ( v304 < v305 ) | |
5575 { | |
5576 for ( jj = &v679; ; jj = (int *)v732 ) | |
5577 { | |
5578 v307 = (int)(jj + 1); | |
5579 v732 = v307; | |
5580 v308 = *(int *)v307; | |
377 | 5581 v294->uSpecEnchantmentType = v308; |
222 | 5582 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5583 if ( v304 >= v305 ) |
5584 break; | |
5585 } | |
5586 } | |
377 | 5587 ++v294->uSpecEnchantmentType; |
0 | 5588 } |
5589 else | |
5590 { | |
5591 v293 = rand(); | |
5592 v294 = _this; | |
224 | 5593 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
377 | 5594 _this->uEncantmentType = 0; |
222 | 5595 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; |
0 | 5596 ; |
377 | 5597 kk += pItemsTable->pEnchantments[v294->uEncantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType |
0 | 5598 + 1] ) |
5599 { | |
377 | 5600 ++v294->uEncantmentType; |
0 | 5601 if ( kk >= v295 ) |
5602 break; | |
5603 } | |
224 | 5604 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5605 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
0 | 5606 } |
5607 v294->uAttributes |= 0x20u; | |
5608 goto LABEL_1055; | |
5609 case 31: | |
5610 amount = 10 * v2; | |
5611 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
5612 goto LABEL_83; | |
5613 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) | |
5614 goto LABEL_200; | |
5615 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
5616 pMessageQueue_50CBD0->SendMessage((UIMessageType)195, v1, v1); | |
5617 goto LABEL_1056; | |
5618 case 33: | |
5619 LODWORD(v733) = 604800 * v2; | |
5620 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5621 goto LABEL_200; | |
5622 v319 = uRequiredMana; | |
5623 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5624 { | |
5625 pEventTimer->Pause(); | |
5626 pMessageQueue_50CBD0->SendMessage((UIMessageType)177, v1, v1); | |
5627 qword_506350 = (signed int)v733; | |
5628 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5629 ::uRequiredMana = v319; | |
5630 ::sRecoveryTime = sRecoveryTime; | |
5631 dword_50633C = v3->field_10; | |
5632 dword_506338 = v3->spellnum; | |
5633 LOBYTE(v3->field_8) |= 0x20u; | |
5634 } | |
5635 goto LABEL_83; | |
5636 case 40: | |
5637 v320 = v12 - 2; | |
5638 if ( !v320 ) | |
5639 goto LABEL_632; | |
5640 v321 = v320 - 1; | |
5641 if ( v321 ) | |
5642 { | |
5643 if ( v321 == 1 ) | |
5644 goto LABEL_634; | |
5645 LABEL_632: | |
5646 v322 = 3600 * v2; | |
5647 } | |
5648 else | |
5649 { | |
5650 v322 = 86400 * v2; | |
5651 } | |
5652 amount = v322; | |
5653 LABEL_634: | |
5654 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5655 goto LABEL_83; | |
5656 v323 = v3->uPlayerID_2; | |
5657 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5658 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5659 goto LABEL_1056; | |
5660 if ( v731 == 4 ) | |
5661 goto LABEL_637; | |
5662 v732 = amount << 7; | |
5663 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5664 v656 = 15; | |
5665 goto LABEL_640; | |
5666 case 41: | |
5667 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5668 goto LABEL_83; | |
5669 a1.stru_24.Reset(); | |
5670 a1.field_48 = v3->spellnum; | |
5671 a1.field_4C = v2; | |
5672 a1.field_50 = v731; | |
5673 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5674 a1.vPosition.y = pParty->vPosition.y; | |
5675 a1.vPosition.x = pParty->vPosition.x; | |
5676 a1.uAttributes = v1; | |
5677 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5678 a1.uSectorID = pIndoor->GetSector( | |
5679 pParty->vPosition.x, | |
5680 pParty->vPosition.y, | |
5681 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
5682 a1.uSpriteFrameID = v1; | |
5683 v326 = 8 * v3->uPlayerID; | |
303 | 5684 LOBYTE(v326) = v326 | OBJECT_Player; |
5685 a1.field_58_pid = v326; | |
0 | 5686 a1.field_5C = a2; |
5687 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5688 a1.uFacing = LOWORD(pParty->sRotationY); | |
5689 a1.uSoundID = LOWORD(v3->field_10); | |
5690 if ( pParty->bTurnBasedModeOn == 1 ) | |
5691 LOBYTE(a1.uAttributes) |= 4u; | |
5692 v669 = v3->uPlayerID + 1; | |
5693 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5694 v654 = pParty->sRotationX; | |
5695 goto LABEL_125; | |
5696 case 43: | |
5697 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5698 goto LABEL_200; | |
5699 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5700 goto LABEL_83; | |
5701 a1.uItemType = 4090; | |
5702 a1.stru_24.Reset(); | |
5703 a1.field_48 = v3->spellnum; | |
5704 a1.field_4C = v2; | |
5705 a1.field_50 = v731; | |
5706 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5707 a1.vPosition.x = pParty->vPosition.x; | |
5708 a1.vPosition.y = pParty->vPosition.y; | |
5709 a1.uAttributes = v1; | |
5710 a1.uSectorID = v1; | |
5711 a1.uSpriteFrameID = v1; | |
5712 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5713 v327 = 8 * v3->uPlayerID; | |
303 | 5714 LOBYTE(v327) = v327 | OBJECT_Player; |
0 | 5715 a1.field_60_distance_related_prolly_lod = 0; |
303 | 5716 a1.field_58_pid = v327; |
0 | 5717 a1.field_5C = a2; |
5718 a1.uFacing = LOWORD(pParty->sRotationY); | |
5719 a1.uSoundID = LOWORD(v3->field_10); | |
5720 if ( pParty->bTurnBasedModeOn == 1 ) | |
5721 a1.uAttributes = 4; | |
5722 v669 = v1; | |
5723 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5724 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5725 LABEL_124: | |
5726 v654 = v35; | |
5727 LABEL_125: | |
5728 v36 = pParty->sRotationY; | |
5729 goto LABEL_157; | |
5730 case 45: | |
5731 v328 = v12 - 2; | |
5732 if ( v328 ) | |
5733 { | |
5734 v329 = v328 - 1; | |
5735 if ( v329 && v329 != 1 ) | |
5736 v330 = 600 * v2; | |
5737 else | |
5738 v330 = 3600 * v2; | |
5739 } | |
5740 else | |
5741 { | |
5742 v330 = 1800 * v2; | |
5743 } | |
5744 LODWORD(v733) = v330; | |
5745 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5746 goto LABEL_83; | |
5747 v331 = v3->spellnum; | |
5748 v332 = pGame->GetStru6(); | |
5749 pGame->GetStru6()->SetPlayerBuffAnim(v331, v1); | |
5750 v83 = 1; | |
5751 v333 = v3->spellnum; | |
5752 v334 = pGame->GetStru6(); | |
5753 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1u); | |
5754 v335 = v3->spellnum; | |
5755 v336 = pGame->GetStru6(); | |
5756 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2u); | |
5757 v337 = v3->spellnum; | |
5758 v338 = pGame->GetStru6(); | |
5759 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3u); | |
5760 v673 = v1; | |
5761 v732 = (int)v733 << 7; | |
5762 v662 = v1; | |
5763 v655 = v1; | |
5764 v652 = v731; | |
5765 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5766 v137 = (char *)&pParty->pPartyBuffs[3]; | |
5767 goto LABEL_976; | |
5768 case 47: | |
5769 LODWORD(v733) = 300; | |
5770 v339 = v12 - 2; | |
5771 if ( v339 ) | |
5772 { | |
5773 v340 = v339 - 1; | |
5774 if ( v340 ) | |
5775 { | |
5776 if ( v340 != 1 ) | |
5777 { | |
5778 amount = v2; | |
5779 goto LABEL_667; | |
5780 } | |
5781 v341 = 6 * v2; | |
5782 } | |
5783 else | |
5784 { | |
5785 v341 = 4 * v2; | |
5786 } | |
5787 } | |
5788 else | |
5789 { | |
5790 v341 = 2 * v2; | |
5791 } | |
5792 amount = v341; | |
5793 LABEL_667: | |
5794 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5795 goto LABEL_83; | |
5796 v342 = *(int *)&v3->field_C; | |
5797 if ( v342 == v1 ) | |
5798 { | |
5799 v345 = v3->uPlayerID_2; | |
5800 v346 = v3->spellnum; | |
5801 v347 = pGame->GetStru6(); | |
5802 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); | |
5803 v668 = v1; | |
5804 v658 = v1; | |
5805 v653 = amount; | |
5806 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; | |
5807 v651 = v731; | |
5808 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5809 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; | |
5810 goto LABEL_104; | |
5811 } | |
141 | 5812 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5813 { |
5814 v343 = v342 >> 3; | |
5815 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | |
5816 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; | |
5817 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); | |
5818 BYTE2(pActors[v343].uAttributes) |= 8u; | |
5819 v672 = v1; | |
5820 v661 = &pActors[v343]; | |
5821 LABEL_165: | |
5822 v56 = pGame->GetStru6(); | |
5823 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5824 } | |
5825 goto LABEL_1056; | |
5826 case 49: | |
5827 v348 = v12 - 2; | |
5828 if ( !v348 ) | |
5829 goto LABEL_677; | |
5830 v349 = v348 - 1; | |
5831 if ( v349 ) | |
5832 { | |
5833 if ( v349 == 1 ) | |
5834 { | |
5835 amount = v1; | |
5836 goto LABEL_679; | |
5837 } | |
5838 LABEL_677: | |
5839 v350 = 3600 * v2; | |
5840 } | |
5841 else | |
5842 { | |
5843 v350 = 86400 * v2; | |
5844 } | |
5845 amount = v350; | |
5846 LABEL_679: | |
5847 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5848 goto LABEL_83; | |
5849 v351 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5850 if ( !v351->pConditions[0] ) | |
5851 goto LABEL_1056; | |
5852 if ( v731 == 4 ) | |
5853 { | |
5854 LODWORD(v351->pConditions[0]) = v1; | |
5855 HIDWORD(v351->pConditions[0]) = v1; | |
5856 goto LABEL_904; | |
5857 } | |
5858 v732 = amount << 7; | |
5859 v351->DiscardConditionIfLastsLongerThan( | |
5860 v1, | |
5861 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
5862 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5863 goto LABEL_1056; | |
5864 v674 = v3->uPlayerID_2; | |
5865 goto LABEL_685; | |
5866 case 50: | |
5867 v354 = v12 - 2; | |
5868 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5869 v356 = 900 * (v2 + 4); | |
5870 else | |
5871 v356 = 300 * (v2 + 12); | |
5872 LODWORD(v733) = v356; | |
5873 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5874 goto LABEL_83; | |
5875 if ( v731 == 1 || v731 == 2 ) | |
5876 { | |
5877 v361 = v3->uPlayerID_2; | |
5878 v362 = v3->spellnum; | |
5879 v363 = pGame->GetStru6(); | |
5880 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); | |
5881 v668 = v1; | |
5882 v732 = (int)v733 << 7; | |
5883 v658 = v1; | |
5884 v653 = v1; | |
5885 v651 = v731; | |
5886 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5887 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; | |
5888 goto LABEL_103; | |
5889 } | |
5890 a2 = v1; | |
5891 v732 = (int)v733 << 7; | |
5892 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5893 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5894 do |
5895 { | |
5896 v358 = a2; | |
5897 v359 = v3->spellnum; | |
5898 v360 = pGame->GetStru6(); | |
5899 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); | |
112 | 5900 v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, v1, v1, v1); |
0 | 5901 ++a2; |
112 | 5902 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5903 } | |
5904 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5905 goto LABEL_1056; |
5906 case 48: | |
5907 v364 = v12 - 2; | |
5908 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5909 v366 = 60 * (v2 + 3); | |
5910 else | |
5911 v366 = 300 * v2 + 180; | |
5912 LODWORD(v733) = v366; | |
5913 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5914 goto LABEL_83; | |
5915 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
5916 v367 = pGame->GetStru6(); | |
5917 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | |
5918 ++a1.uItemType; | |
5919 a1.stru_24.Reset(); | |
5920 a1.field_48 = v3->spellnum; | |
5921 a1.field_4C = v2; | |
5922 a1.field_50 = v731; | |
5923 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5924 a1.uAttributes = v1; | |
5925 a1.uSectorID = v1; | |
5926 a1.uSpriteFrameID = v1; | |
5927 v368 = v3->uPlayerID; | |
5928 a1.field_60_distance_related_prolly_lod = 0; | |
5929 a1.uFacing = v1; | |
5930 v368 *= 8; | |
303 | 5931 LOBYTE(v368) = v368 | OBJECT_Player; |
5932 a1.field_58_pid = v368; | |
0 | 5933 a1.uSoundID = LOWORD(v3->field_10); |
5934 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
5935 { | |
5936 v369 = &pActors[dword_50BF30[a2]]; | |
5937 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5938 { | |
5939 a1.vPosition.x = v369->vPosition.x; | |
5940 a1.vPosition.y = v369->vPosition.y; | |
5941 v732 = v369->uActorHeight; | |
5942 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5943 v370 = 8 * dword_50BF30[a2]; | |
5944 LOBYTE(v370) = v370 | 3; | |
5945 a1.field_5C = v370; | |
5946 a1.Create(0, v1, v1, v1); | |
5947 v732 = (int)v733 << 7; | |
5948 v369->pActorBuffs[4].Apply( | |
5949 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
5950 v731, | |
5951 v1, | |
5952 v1, | |
5953 v1); | |
5954 } | |
5955 } | |
5956 goto LABEL_1056; | |
5957 case 53: | |
5958 v371 = v12 - 2; | |
5959 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
5960 amount = v1; | |
5961 else | |
5962 amount = 86400 * v2; | |
5963 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5964 goto LABEL_83; | |
5965 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, v1, 65536); | |
5966 v373 = v3->uPlayerID_2; | |
5967 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5968 goto LABEL_1056; | |
5969 v14 = v731 == 4; | |
5970 pParty->pPlayers[v373].sHealth = 1; | |
5971 if ( v14 ) | |
5972 { | |
5973 v374 = v3->uPlayerID_2; | |
5974 LODWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5975 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | |
5976 v376 = v3->uPlayerID_2; | |
5977 LODWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5978 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | |
5979 } | |
5980 else | |
5981 { | |
5982 v732 = amount << 7; | |
5983 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5984 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5985 0xEu, | |
5986 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5987 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5988 0xDu, | |
5989 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5990 } | |
112 | 5991 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 5992 goto LABEL_720; |
5993 case 54: | |
5994 v378 = v12 - 2; | |
5995 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
5996 v380 = 4 * v2; | |
5997 else | |
5998 v380 = 3 * v2; | |
5999 amount = v380; | |
6000 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6001 goto LABEL_83; | |
6002 v381 = 0; | |
6003 HIDWORD(v733) = amount; | |
6004 v730 = 0; | |
6005 v382 = 1; | |
6006 do | |
6007 { | |
6008 v383 = pPlayers[v382]; | |
6009 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
6010 v682[v381++] = v382; | |
6011 ++v382; | |
6012 } | |
6013 while ( v382 <= 4 ); | |
6014 v384 = 0; | |
6015 v730 = v381; | |
6016 if ( v381 > v1 ) | |
6017 { | |
6018 do | |
6019 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
6020 while ( v384 < v381 ); | |
6021 } | |
6022 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
6023 HIDWORD(v733) = v1; | |
6024 if ( v381 > v1 ) | |
6025 { | |
6026 do | |
6027 { | |
6028 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
6029 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
6030 v726 = *(Player **)v385; | |
6031 v386 = v726->GetMaxHealth(); | |
6032 if ( v726->sHealth > v386 ) | |
6033 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
6034 v387 = *(Player **)v385; | |
6035 if ( v387->sHealth > v1 ) | |
6036 { | |
6037 LODWORD(v387->pConditions[13]) = v1; | |
6038 HIDWORD(v387->pConditions[13]) = v1; | |
6039 } | |
6040 v388 = HIDWORD(v733); | |
6041 v389 = LOWORD(v682[HIDWORD(v733)]) - 1; | |
6042 v390 = v3->spellnum; | |
6043 v391 = pGame->GetStru6(); | |
6044 pGame->GetStru6()->SetPlayerBuffAnim(v390, v389); | |
6045 HIDWORD(v733) = v388 + 1; | |
6046 } | |
6047 while ( v388 + 1 < v730 ); | |
6048 } | |
6049 goto LABEL_1056; | |
6050 case 55: | |
6051 v392 = v12 - 1; | |
6052 if ( !v392 ) | |
6053 { | |
6054 v395 = 180 * v2; | |
6055 goto LABEL_750; | |
6056 } | |
6057 v393 = v392 - 1; | |
6058 if ( !v393 ) | |
6059 { | |
6060 v395 = 10800 * v2; | |
6061 goto LABEL_750; | |
6062 } | |
6063 v394 = v393 - 1; | |
6064 if ( !v394 ) | |
6065 { | |
6066 v395 = 259200 * v2; | |
6067 LABEL_750: | |
6068 amount = v395; | |
6069 goto LABEL_751; | |
6070 } | |
6071 if ( v394 == 1 ) | |
6072 amount = v1; | |
6073 LABEL_751: | |
6074 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6075 goto LABEL_83; | |
6076 v396 = v3->uPlayerID_2; | |
6077 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
6078 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
6079 { | |
6080 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
187 | 6081 pParty->pPlayers[v396].PlaySound(SPEECH_25, v1); |
0 | 6082 if ( v731 == 4 ) |
6083 { | |
6084 v397 = v3->uPlayerID_2; | |
6085 LODWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6086 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | |
6087 v398 = v3->uPlayerID_2; | |
6088 LODWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6089 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | |
6090 v399 = v3->uPlayerID_2; | |
6091 LODWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6092 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | |
6093 } | |
6094 else | |
6095 { | |
6096 v732 = amount << 7; | |
6097 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6098 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6099 0x10u, | |
6100 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6101 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6102 0xEu, | |
6103 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6104 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6105 0xDu, | |
6106 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6107 } | |
6108 v83 = 1; | |
112 | 6109 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
0 | 6110 v401 = pGame; |
6111 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; | |
6112 v402 = v3->uPlayerID_2; | |
6113 v403 = v3->spellnum; | |
6114 v404 = pGame->GetStru6(); | |
6115 pGame->GetStru6()->SetPlayerBuffAnim(v403, v402); | |
6116 } | |
6117 else | |
6118 { | |
6119 v83 = 1; | |
6120 } | |
6121 goto LABEL_978; | |
6122 case 61: | |
6123 v405 = v12 - 2; | |
6124 if ( !v405 ) | |
6125 goto LABEL_766; | |
6126 v406 = v405 - 1; | |
6127 if ( v406 ) | |
6128 { | |
6129 if ( v406 == 1 ) | |
6130 { | |
6131 amount = v1; | |
6132 goto LABEL_768; | |
6133 } | |
6134 LABEL_766: | |
6135 v407 = 3600 * v2; | |
6136 } | |
6137 else | |
6138 { | |
6139 v407 = 86400 * v2; | |
6140 } | |
6141 amount = v407; | |
6142 LABEL_768: | |
6143 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6144 goto LABEL_83; | |
6145 v408 = v3->uPlayerID_2; | |
6146 v409 = v3->spellnum; | |
6147 v410 = pGame->GetStru6(); | |
6148 pGame->GetStru6()->SetPlayerBuffAnim(v409, v408); | |
6149 v323 = v3->uPlayerID_2; | |
6150 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6151 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6152 goto LABEL_1056; | |
6153 if ( v731 == 4 ) | |
6154 goto LABEL_637; | |
6155 v732 = amount << 7; | |
6156 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6157 v656 = 12; | |
6158 goto LABEL_640; | |
6159 case 56: | |
6160 v411 = v12 - 2; | |
6161 if ( v411 ) | |
6162 { | |
6163 v412 = v411 - 1; | |
6164 if ( v412 ) | |
6165 { | |
6166 if ( v412 == 1 ) | |
6167 { | |
6168 amount = v1; | |
6169 goto LABEL_780; | |
6170 } | |
6171 v413 = 180 * v2; | |
6172 } | |
6173 else | |
6174 { | |
6175 v413 = 86400 * v2; | |
6176 } | |
6177 } | |
6178 else | |
6179 { | |
6180 v413 = 3600 * v2; | |
6181 } | |
6182 amount = v413; | |
6183 LABEL_780: | |
6184 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6185 goto LABEL_83; | |
6186 v414 = v3->uPlayerID_2; | |
6187 v415 = v3->spellnum; | |
6188 v416 = pGame->GetStru6(); | |
6189 pGame->GetStru6()->SetPlayerBuffAnim(v415, v414); | |
6190 v323 = v3->uPlayerID_2; | |
6191 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6192 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6193 goto LABEL_1056; | |
6194 if ( v731 == 4 ) | |
6195 goto LABEL_637; | |
6196 v732 = amount << 7; | |
6197 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6198 v656 = 3; | |
6199 goto LABEL_640; | |
6200 case 59: | |
6201 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6202 goto LABEL_83; | |
141 | 6203 if ( a2 == v1 || (a2 & 7) != OBJECT_Actor) |
0 | 6204 goto LABEL_1056; |
6205 v417 = (int)&pActors[a2 >> 3]; | |
6206 v730 = v417; | |
6207 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6208 { | |
6209 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6210 v417 = v730; | |
6211 } | |
6212 v418 = *(int *)(v417 + 672); | |
6213 HIDWORD(v733) = v1; | |
6214 if ( pItemsTable->pItems[v418].uEquipType == 18 ) | |
6215 HIDWORD(v733) = *(int *)(v417 + 684); | |
6216 | |
6217 //ItemGen::ItemGen(&v683); | |
6218 v683.Reset(); | |
6219 | |
6220 v419 = *(short *)(v730 + 180); | |
6221 if ( v419 != (short)v1 ) | |
6222 { | |
6223 v683.uItemID = v419; | |
6224 goto LABEL_799; | |
6225 } | |
6226 v420 = 0; | |
6227 v421 = v730 + 564; | |
6228 while ( *(int *)v421 == v1 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) | |
6229 { | |
6230 ++v420; | |
6231 v421 += 36; | |
6232 if ( v420 >= 4 ) | |
6233 goto LABEL_799; | |
6234 } | |
6235 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6236 v2 = v723; | |
6237 v1 = 0; | |
6238 LABEL_799: | |
6239 if ( HIDWORD(v733) != v1 ) | |
6240 { | |
6241 v675 = (const char *)HIDWORD(v733); | |
6242 if ( v683.uItemID != v1 ) | |
6243 { | |
6244 v422 = v683.GetDisplayName(); | |
6245 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6246 goto LABEL_807; | |
6247 } | |
6248 v664 = "%d gold"; | |
6249 goto LABEL_803; | |
6250 } | |
6251 if ( v683.uItemID != v1 ) | |
6252 { | |
6253 v675 = v683.GetDisplayName(); | |
6254 v664 = "(%s)"; | |
6255 LABEL_803: | |
6256 sprintf(pTmpBuf2, v664, v675); | |
6257 goto LABEL_807; | |
6258 } | |
6259 strcpy(pTmpBuf2, "nothing"); | |
6260 LABEL_807: | |
6261 ShowStatusBarString(pTmpBuf2, 2u); | |
6262 a1.stru_24.Reset(); | |
6263 a1.field_48 = v3->spellnum; | |
6264 a1.field_4C = v2; | |
6265 a1.field_50 = v731; | |
6266 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6267 a1.vPosition.x = *(short *)(v730 + 142); | |
6268 a1.vPosition.y = *(short *)(v730 + 144); | |
6269 v676 = *(short *)(v730 + 138); | |
6270 v665 = a1.vPosition.y; | |
6271 a1.vPosition.z = *(short *)(v730 + 138); | |
6272 v657 = a1.vPosition.x; | |
6273 goto LABEL_1087; | |
6274 case 62: | |
6275 v423 = v12 - 2; | |
6276 if ( !v423 ) | |
6277 goto LABEL_813; | |
6278 v424 = v423 - 1; | |
6279 if ( v424 ) | |
6280 { | |
6281 if ( v424 == 1 ) | |
6282 v425 = 3600 * v2; | |
6283 else | |
6284 LABEL_813: | |
6285 v425 = 300 * v2; | |
6286 } | |
6287 else | |
6288 { | |
6289 v425 = 600 * v2; | |
6290 } | |
6291 amount = v425; | |
6292 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6293 goto LABEL_83; | |
6294 v426 = a2 >> 3; | |
141 | 6295 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6296 goto LABEL_1056; |
6297 v730 = 836 * v426; | |
6298 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6299 { | |
90 | 6300 pActors[v426].pActorBuffs[1].Reset(); |
6301 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6302 v732 = amount << 7; |
90 | 6303 pActors[v426].pActorBuffs[9].Apply( |
0 | 6304 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6305 v731, | |
6306 v1, | |
6307 v1, | |
6308 v1); | |
90 | 6309 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6310 } |
6311 a1.stru_24.Reset(); | |
6312 a1.field_48 = v3->spellnum; | |
6313 a1.field_4C = v2; | |
6314 a1.field_50 = v731; | |
6315 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6316 v61 = v426; |
0 | 6317 goto LABEL_1086; |
6318 case 66: | |
6319 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6320 goto LABEL_83; | |
6321 amount = 600 * v2; | |
6322 v427 = a2 >> 3; | |
141 | 6323 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6324 goto LABEL_1056; |
6325 v730 = 836 * v427; | |
6326 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6327 goto LABEL_83; | |
90 | 6328 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6329 { | |
6330 pActors[v427].pActorBuffs[9].Reset(); | |
6331 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6332 v732 = amount << 7; |
90 | 6333 pActors[v427].pActorBuffs[12].Apply( |
0 | 6334 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6335 v731, | |
6336 v1, | |
6337 v1, | |
6338 v1); | |
6339 } | |
6340 a1.stru_24.Reset(); | |
6341 a1.field_48 = v3->spellnum; | |
6342 a1.field_4C = v2; | |
6343 a1.field_50 = v731; | |
6344 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6345 v61 = v427; |
0 | 6346 goto LABEL_1086; |
6347 case 63: | |
6348 v428 = v12 - 2; | |
6349 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6350 v430 = 300 * v2; | |
6351 else | |
6352 v430 = 180 * v2; | |
6353 amount = v430; | |
6354 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6355 goto LABEL_83; | |
6356 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6357 v431 = pGame->GetStru6(); | |
6358 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | |
6359 ++a1.uItemType; | |
6360 a1.stru_24.Reset(); | |
6361 a1.field_48 = v3->spellnum; | |
6362 a1.field_4C = v2; | |
6363 a1.field_50 = v731; | |
6364 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6365 a1.uAttributes = v1; | |
6366 a1.uSectorID = v1; | |
6367 a1.uSpriteFrameID = v1; | |
6368 v432 = v3->uPlayerID; | |
6369 a1.field_60_distance_related_prolly_lod = 0; | |
6370 a1.uFacing = v1; | |
6371 v432 *= 8; | |
303 | 6372 LOBYTE(v432) = v432 | OBJECT_Player; |
6373 a1.field_58_pid = v432; | |
0 | 6374 a1.uSoundID = LOWORD(v3->field_10); |
6375 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | |
6376 { | |
6377 v433 = &pActors[dword_50BF30[a2]]; | |
6378 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6379 break; | |
6380 a1.vPosition.x = v433->vPosition.x; | |
6381 a1.vPosition.y = v433->vPosition.y; | |
6382 v732 = v433->uActorHeight; | |
6383 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6384 v434 = 8 * dword_50BF30[a2]; | |
6385 LOBYTE(v434) = v434 | 3; | |
6386 a1.field_5C = v434; | |
6387 a1.Create(0, v1, v1, v1); | |
6388 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) | |
6389 { | |
6390 v732 = amount << 7; | |
6391 v433->pActorBuffs[4].Apply( | |
6392 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
6393 v731, | |
6394 v1, | |
6395 v1, | |
6396 v1); | |
6397 } | |
6398 } | |
6399 goto LABEL_1056; | |
6400 case 64: | |
6401 v435 = v12 - 2; | |
6402 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
6403 amount = v1; | |
6404 else | |
6405 amount = 86400 * v2; | |
6406 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6407 goto LABEL_83; | |
6408 v437 = v3->uPlayerID_2; | |
6409 v438 = v3->spellnum; | |
6410 v439 = pGame->GetStru6(); | |
6411 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); | |
6412 v440 = v3->uPlayerID_2; | |
6413 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6414 { | |
6415 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
187 | 6416 pParty->pPlayers[v440].PlaySound(SPEECH_25, v1); |
0 | 6417 if ( v731 == 4 ) |
6418 { | |
6419 v441 = v3->uPlayerID_2; | |
6420 LODWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6421 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | |
6422 } | |
6423 else | |
6424 { | |
6425 v732 = amount << 7; | |
6426 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6427 5u, | |
6428 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6429 } | |
6430 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6431 LABEL_720: | |
6432 v377->SetCondition(1u, v1); | |
6433 } | |
6434 goto LABEL_1056; | |
6435 case 42: | |
6436 v442 = v12 - 2; | |
6437 if ( !v442 ) | |
6438 goto LABEL_855; | |
6439 v443 = v442 - 1; | |
6440 if ( v443 ) | |
6441 { | |
6442 if ( v443 == 1 ) | |
6443 v444 = 4 * v2; | |
6444 else | |
6445 LABEL_855: | |
6446 v444 = 2 * v2; | |
6447 } | |
6448 else | |
6449 { | |
6450 v444 = 3 * v2; | |
6451 } | |
6452 amount = v444; | |
6453 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6454 goto LABEL_83; | |
6455 v445 = a2 >> 3; | |
141 | 6456 if ( (a2 & 7) == OBJECT_Item) |
0 | 6457 { |
6458 v449 = (char *)&pLayingItems[v445].stru_24; | |
6459 v450 = *(int *)v449; | |
6460 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6461 { | |
6462 party_finds_gold(*((int *)v449 + 3), 0); | |
6463 viewparams->bRedrawGameUI = 1; | |
6464 } | |
6465 else | |
6466 { | |
189 | 6467 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
0 | 6468 ShowStatusBarString(pTmpBuf2, 2u); |
6469 if ( !pParty->AddItem(&pLayingItems[v445].stru_24) ) | |
6470 pParty->SetHoldingItem(&pLayingItems[v445].stru_24); | |
6471 } | |
6472 LayingItem::_42F933(v445); | |
6473 } | |
6474 else | |
6475 { | |
141 | 6476 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6477 { |
6478 stru_50C198.LootActor(&pActors[v445]); | |
6479 } | |
6480 else | |
6481 { | |
141 | 6482 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6483 { |
141 | 6484 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6485 goto LABEL_1056; |
6486 dword_507CD8 = 1; | |
6487 v677 = 1; | |
6488 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6489 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6490 else | |
6491 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6492 goto LABEL_866; | |
6493 } | |
6494 v447 = &pLevelDecorations[v445]; | |
6495 dword_507CD8 = 1; | |
6496 v448 = v447->field_16_event_id; | |
6497 if ( v448 != (short)v1 ) | |
6498 { | |
6499 v677 = 1; | |
6500 v446 = v448; | |
6501 LABEL_866: | |
6502 EventProcessor(v446, a2, v677); | |
6503 goto LABEL_1056; | |
6504 } | |
6505 if ( v447->IsInteractive() ) | |
6506 { | |
6507 _5C3420_pDecoration = v447; | |
6508 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); | |
6509 _5C3420_pDecoration = (LevelDecoration *)v1; | |
6510 } | |
6511 } | |
6512 } | |
6513 goto LABEL_1056; | |
6514 case 67: | |
6515 v451 = v12 - 2; | |
6516 if ( v451 ) | |
6517 { | |
6518 v452 = v451 - 1; | |
6519 if ( v452 ) | |
6520 { | |
6521 if ( v452 == 1 ) | |
6522 { | |
6523 amount = v1; | |
6524 goto LABEL_883; | |
6525 } | |
6526 v453 = 180 * v2; | |
6527 } | |
6528 else | |
6529 { | |
6530 v453 = 86400 * v2; | |
6531 } | |
6532 } | |
6533 else | |
6534 { | |
6535 v453 = 3600 * v2; | |
6536 } | |
6537 amount = v453; | |
6538 LABEL_883: | |
6539 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6540 goto LABEL_83; | |
6541 v454 = v3->uPlayerID_2; | |
6542 v455 = v3->spellnum; | |
6543 v456 = pGame->GetStru6(); | |
6544 pGame->GetStru6()->SetPlayerBuffAnim(v455, v454); | |
6545 v323 = v3->uPlayerID_2; | |
6546 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6547 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6548 goto LABEL_1056; | |
6549 if ( v731 == 4 ) | |
6550 { | |
6551 LABEL_637: | |
6552 *(int *)v324 = v1; | |
6553 *((int *)v324 + 1) = v1; | |
6554 goto LABEL_1056; | |
6555 } | |
6556 v732 = amount << 7; | |
6557 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6558 v656 = 1; | |
6559 LABEL_640: | |
6560 v325 = &pParty->pPlayers[v323]; | |
6561 goto LABEL_641; | |
6562 case 68: | |
6563 v457 = v12 - 2; | |
6564 if ( v457 ) | |
6565 { | |
6566 v458 = v457 - 1; | |
6567 if ( v458 ) | |
6568 { | |
6569 if ( v458 == 1 ) | |
6570 v459 = 5 * v2 + 5; | |
6571 else | |
6572 v459 = 2 * v2 + 5; | |
6573 } | |
6574 else | |
6575 { | |
6576 v459 = 4 * v2 + 5; | |
6577 } | |
6578 } | |
6579 else | |
6580 { | |
6581 v459 = 3 * v2 + 5; | |
6582 } | |
6583 amount = v459; | |
6584 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6585 goto LABEL_83; | |
6586 v460 = *(int *)&v3->field_C; | |
6587 if ( v460 == v1 ) | |
6588 { | |
6589 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6590 LABEL_904: | |
6591 v674 = v3->uPlayerID_2; | |
6592 LABEL_685: | |
6593 v352 = v3->spellnum; | |
6594 v353 = pGame->GetStru6(); | |
6595 pGame->GetStru6()->SetPlayerBuffAnim(v352, v674); | |
6596 } | |
6597 else | |
6598 { | |
141 | 6599 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6600 { |
6601 v461 = &pActors[v460 >> 3]; | |
6602 v462 = v461->uAIState; | |
6603 v463 = v461->pMonsterInfo.uHP; | |
6604 if ( v462 != 5 ) | |
6605 { | |
6606 if ( v462 != 4 ) | |
6607 { | |
6608 if ( v462 != 19 ) | |
6609 { | |
6610 if ( v462 != 11 ) | |
6611 { | |
6612 v461->sCurrentHP += amount; | |
6613 if ( v461->sCurrentHP > v463 ) | |
6614 v461->sCurrentHP = v463; | |
6615 } | |
6616 } | |
6617 } | |
6618 } | |
6619 } | |
6620 } | |
6621 goto LABEL_1056; | |
6622 case 72: | |
6623 v464 = v12 - 2; | |
6624 if ( !v464 ) | |
6625 goto LABEL_910; | |
6626 v465 = v464 - 1; | |
6627 if ( v465 ) | |
6628 { | |
6629 if ( v465 == 1 ) | |
6630 { | |
6631 amount = v1; | |
6632 goto LABEL_912; | |
6633 } | |
6634 LABEL_910: | |
6635 v466 = 3600 * v2; | |
6636 } | |
6637 else | |
6638 { | |
6639 v466 = 86400 * v2; | |
6640 } | |
6641 amount = v466; | |
6642 LABEL_912: | |
6643 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6644 goto LABEL_83; | |
6645 v467 = v3->uPlayerID_2; | |
6646 v468 = v3->spellnum; | |
6647 v469 = pGame->GetStru6(); | |
6648 pGame->GetStru6()->SetPlayerBuffAnim(v468, v467); | |
6649 v470 = v3->uPlayerID_2; | |
6650 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6651 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6652 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6653 goto LABEL_1056; | |
6654 if ( v731 == 4 ) | |
6655 { | |
6656 LODWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6657 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | |
6658 v471 = v3->uPlayerID_2; | |
6659 LODWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6660 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | |
6661 v472 = v3->uPlayerID_2; | |
6662 LODWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6663 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | |
6664 goto LABEL_1056; | |
6665 } | |
6666 v732 = amount << 7; | |
6667 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6668 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6669 6u, | |
6670 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6671 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6672 8u, | |
6673 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6674 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6675 v656 = 10; | |
6676 goto LABEL_937; | |
6677 case 75: | |
6678 amount = v2; | |
6679 LODWORD(v733) = 3600 * v2; | |
6680 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6681 goto LABEL_83; | |
6682 v474 = v3->spellnum; | |
6683 v475 = pGame->GetStru6(); | |
6684 pGame->GetStru6()->SetPlayerBuffAnim(v474, v1); | |
6685 v476 = v3->spellnum; | |
6686 v477 = pGame->GetStru6(); | |
6687 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1u); | |
6688 v478 = v3->spellnum; | |
6689 v479 = pGame->GetStru6(); | |
6690 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2u); | |
6691 v480 = v3->spellnum; | |
6692 v481 = pGame->GetStru6(); | |
6693 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3u); | |
6694 v668 = v1; | |
6695 v732 = (int)v733 << 7; | |
6696 v658 = v1; | |
6697 v653 = v2; | |
6698 v651 = v731; | |
6699 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6700 v27 = (char *)&pParty->pPartyBuffs[13]; | |
6701 goto LABEL_101; | |
6702 case 73: | |
6703 LODWORD(v733) = 3600 * v2; | |
6704 amount = v2; | |
6705 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6706 goto LABEL_83; | |
6707 if ( v731 == 4 ) | |
6708 { | |
6709 v482 = v3->spellnum; | |
6710 v483 = pGame->GetStru6(); | |
6711 pGame->GetStru6()->SetPlayerBuffAnim(v482, v1); | |
6712 v484 = v3->spellnum; | |
6713 v485 = pGame->GetStru6(); | |
6714 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1u); | |
6715 v486 = v3->spellnum; | |
6716 v487 = pGame->GetStru6(); | |
6717 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2u); | |
6718 v488 = v3->spellnum; | |
6719 v489 = pGame->GetStru6(); | |
6720 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3u); | |
6721 v732 = (int)v733 << 7; | |
6722 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6723 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6724 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6725 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | |
6726 v668 = v1; | |
6727 v658 = v2; | |
6728 v653 = v2; | |
6729 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; | |
6730 v651 = 4; | |
6731 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; | |
6732 v27 = (char *)&pParty->pPlayers[3].pPlayerBuffs[6]; | |
6733 goto LABEL_104; | |
6734 } | |
6735 v490 = v3->uPlayerID_2; | |
6736 v491 = v3->spellnum; | |
6737 v492 = pGame->GetStru6(); | |
6738 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); | |
6739 v668 = v1; | |
6740 v732 = (int)v733 << 7; | |
6741 v658 = v2; | |
6742 v653 = v2; | |
6743 v651 = v731; | |
6744 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6745 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; | |
6746 goto LABEL_103; | |
6747 case 74: | |
6748 v493 = v12 - 2; | |
6749 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
6750 amount = v1; | |
6751 else | |
6752 amount = 86400 * v2; | |
6753 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6754 goto LABEL_83; | |
6755 v495 = v3->uPlayerID_2; | |
6756 v496 = v3->spellnum; | |
6757 v497 = pGame->GetStru6(); | |
6758 pGame->GetStru6()->SetPlayerBuffAnim(v496, v495); | |
6759 v498 = v3->uPlayerID_2; | |
6760 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6761 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6762 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6763 goto LABEL_1056; | |
6764 if ( v731 == 4 ) | |
6765 { | |
6766 LODWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6767 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | |
6768 v499 = v3->uPlayerID_2; | |
6769 LODWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6770 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | |
6771 v500 = v3->uPlayerID_2; | |
6772 LODWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6773 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | |
6774 } | |
6775 else | |
6776 { | |
6777 v732 = amount << 7; | |
6778 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6779 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6780 7u, | |
6781 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6782 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6783 9u, | |
6784 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6785 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6786 v656 = 11; | |
6787 LABEL_937: | |
112 | 6788 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6789 LABEL_641: |
6790 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6791 } | |
6792 goto LABEL_1056; | |
6793 case 77: | |
6794 amount = 5 * v2 + 10; | |
6795 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6796 goto LABEL_83; | |
6797 v501 = pParty->pPlayers; | |
6798 do | |
6799 { | |
6800 v502 = v3->spellnum; | |
6801 v503 = pGame->GetStru6(); | |
6802 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); | |
6803 v501->Heal(amount); | |
6804 ++v501; | |
6805 ++v1; | |
6806 } | |
6807 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6808 goto LABEL_1056; | |
6809 case 80: | |
6810 sRecoveryTime -= v2; | |
6811 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6812 goto LABEL_83; | |
6813 v504 = pGame->GetStru6(); | |
6814 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); | |
6815 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6816 ++a1.uItemType; | |
6817 HIDWORD(v733) = v505; | |
6818 v690 = v1; | |
6819 v689 = v1; | |
6820 v688 = v1; | |
6821 a1.stru_24.Reset(); | |
6822 a1.field_48 = v3->spellnum; | |
6823 a1.field_4C = v2; | |
6824 a1.field_50 = v731; | |
6825 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6826 a1.uAttributes = v1; | |
6827 a1.uSectorID = v1; | |
6828 a1.uSpriteFrameID = v1; | |
6829 v506 = v3->uPlayerID; | |
6830 a1.field_60_distance_related_prolly_lod = 0; | |
6831 a1.uFacing = v1; | |
6832 v506 *= 8; | |
303 | 6833 LOBYTE(v506) = v506 | OBJECT_Player; |
6834 a1.field_58_pid = v506; | |
0 | 6835 a1.uSoundID = LOWORD(v3->field_10); |
6836 a2 = v1; | |
6837 if ( SHIDWORD(v733) > v1 ) | |
6838 { | |
6839 do | |
6840 { | |
6841 v507 = dword_50BF30[a2]; | |
6842 a1.vPosition.x = pActors[v507].vPosition.x; | |
6843 a1.vPosition.y = pActors[v507].vPosition.y; | |
6844 v732 = pActors[v507].uActorHeight; | |
6845 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6846 v508 = 8 * dword_50BF30[a2]; | |
6847 LOBYTE(v508) = v508 | 3; | |
6848 a1.field_5C = v508; | |
6849 v509 = a1.Create(0, v1, v1, v1); | |
6850 v510 = a2; | |
6851 DamageMonsterFromParty(8 * v509 | 2, dword_50BF30[a2], (Vec3_int_ *)&v688); | |
6852 a2 = v510 + 1; | |
6853 } | |
6854 while ( v510 + 1 < SHIDWORD(v733) ); | |
6855 } | |
6856 for ( a2 = v1; a2 < SHIDWORD(v733); ++a2 ) | |
6857 { | |
6858 v511 = &pActors[dword_50BF30[a2]]; | |
6859 a1.vPosition.x = v511->vPosition.x; | |
6860 a1.vPosition.y = v511->vPosition.y; | |
6861 v732 = v511->uActorHeight; | |
6862 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6863 v512 = 8 * dword_50BF30[a2]; | |
6864 LOBYTE(v512) = v512 | 3; | |
6865 a1.field_5C = v512; | |
6866 a1.Create(0, v1, v1, v1); | |
6867 v513 = v511->pActorBuffs; | |
6868 v726 = (Player *)22; | |
6869 do | |
6870 { | |
6871 v513->Reset(); | |
6872 ++v513; | |
6873 v726 = (Player *)((char *)v726 - 1); | |
6874 } | |
6875 while ( *(float *)&v726 != 0.0 ); | |
6876 } | |
6877 goto LABEL_1056; | |
6878 case 82: | |
6879 v514 = v12 - 2; | |
6880 if ( !v514 ) | |
6881 goto LABEL_955; | |
6882 v515 = v514 - 1; | |
6883 if ( v515 ) | |
6884 { | |
6885 if ( v515 == 1 ) | |
6886 { | |
6887 v516 = 900 * v2; | |
6888 amount = 5; | |
6889 } | |
6890 else | |
6891 { | |
6892 LABEL_955: | |
6893 v516 = 300 * v2; | |
6894 amount = 1; | |
6895 } | |
6896 } | |
6897 else | |
6898 { | |
6899 v516 = 900 * v2; | |
6900 amount = 3; | |
6901 } | |
6902 v733 = __PAIR__(v1, v516); | |
6903 v517 = 8 * v3->uPlayerID; | |
6904 LOBYTE(v517) = v517 | 4; | |
6905 if ( (signed int)uNumActors > v1 ) | |
6906 { | |
90 | 6907 v518 = pActors;//[0].uAIState; |
6908 v726b = uNumActors; | |
0 | 6909 do |
6910 { | |
90 | 6911 v519 = v518->uAIState; |
6912 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6913 ++HIDWORD(v733); |
90 | 6914 ++v518; |
6915 --v726; | |
0 | 6916 } |
90 | 6917 while ( v726 != 0 ); |
0 | 6918 } |
6919 if ( SHIDWORD(v733) >= amount ) | |
6920 { | |
6921 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6922 goto LABEL_201; | |
6923 } | |
6924 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6925 goto LABEL_83; | |
6926 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); | |
6927 goto LABEL_1056; | |
6928 case 83: | |
6929 v520 = v12 - 2; | |
6930 if ( !v520 ) | |
6931 goto LABEL_973; | |
6932 v521 = v520 - 1; | |
6933 if ( v521 ) | |
6934 { | |
6935 if ( v521 == 1 ) | |
6936 { | |
6937 LODWORD(v733) = 18000 * v2; | |
6938 v522 = 5 * v2 + 10; | |
6939 } | |
6940 else | |
6941 { | |
6942 LABEL_973: | |
6943 LODWORD(v733) = 10800 * v2; | |
6944 v522 = 3 * v2 + 10; | |
6945 } | |
6946 } | |
6947 else | |
6948 { | |
6949 LODWORD(v733) = 14400 * v2; | |
6950 v522 = 4 * v2 + 10; | |
6951 } | |
6952 amount = v522; | |
6953 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6954 goto LABEL_83; | |
6955 v523 = v3->spellnum; | |
6956 v524 = pGame->GetStru6(); | |
6957 pGame->GetStru6()->SetPlayerBuffAnim(v523, v1); | |
6958 v83 = 1; | |
6959 v525 = v3->spellnum; | |
6960 v526 = pGame->GetStru6(); | |
6961 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1u); | |
6962 v527 = v3->spellnum; | |
6963 v528 = pGame->GetStru6(); | |
6964 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2u); | |
6965 v529 = v3->spellnum; | |
6966 v530 = pGame->GetStru6(); | |
6967 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3u); | |
6968 v673 = v1; | |
6969 v732 = (int)v733 << 7; | |
6970 v662 = v1; | |
6971 v655 = amount; | |
6972 v652 = v731; | |
6973 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6974 v137 = (char *)&pParty->pPartyBuffs[2]; | |
6975 goto LABEL_976; | |
6976 case 84: | |
6977 v67 = 2; | |
6978 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6979 { | |
6980 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6981 goto LABEL_202; | |
6982 } | |
6983 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6984 goto LABEL_83; | |
6985 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6986 ++a1.uItemType; | |
6987 v726 = (Player *)v531; | |
6988 v696 = v1; | |
6989 v695 = v1; | |
6990 v694 = v1; | |
6991 a1.stru_24.Reset(); | |
6992 a1.field_48 = v3->spellnum; | |
6993 a1.field_4C = v2; | |
6994 a1.field_50 = v731; | |
6995 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6996 a1.uAttributes = v1; | |
6997 a1.uSectorID = v1; | |
6998 a1.uSpriteFrameID = v1; | |
6999 v532 = v3->uPlayerID; | |
7000 a1.field_60_distance_related_prolly_lod = 0; | |
7001 a1.uFacing = v1; | |
7002 v532 *= 8; | |
303 | 7003 LOBYTE(v532) = v532 | OBJECT_Player; |
7004 a1.field_58_pid = v532; | |
0 | 7005 a1.uSoundID = LOWORD(v3->field_10); |
7006 a2 = v1; | |
7007 if ( (signed int)v726 > v1 ) | |
7008 { | |
7009 do | |
7010 { | |
7011 v533 = dword_50BF30[a2]; | |
7012 a1.vPosition.x = pActors[v533].vPosition.x; | |
7013 a1.vPosition.y = pActors[v533].vPosition.y; | |
7014 v732 = pActors[v533].uActorHeight; | |
7015 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7016 v534 = 8 * dword_50BF30[a2]; | |
7017 LOBYTE(v534) = v534 | 3; | |
7018 a1.field_5C = v534; | |
7019 v535 = a1.Create(0, v1, v1, v1); | |
7020 v536 = a2; | |
7021 DamageMonsterFromParty(8 * v535 | 2, dword_50BF30[a2], (Vec3_int_ *)&v694); | |
7022 a2 = v536 + 1; | |
7023 } | |
7024 while ( v536 + 1 < (signed int)v726 ); | |
7025 } | |
7026 v537 = pGame->GetStru6(); | |
7027 pGame->GetStru6()->_4A8BFC(); | |
7028 goto LABEL_1056; | |
7029 case 85: | |
7030 v538 = v12 - 2; | |
7031 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
7032 { | |
7033 amount = 5 * v2; | |
7034 v540 = 18000 * v2; | |
7035 } | |
7036 else | |
7037 { | |
7038 amount = 4 * v2; | |
7039 v540 = 14400 * v2; | |
7040 } | |
7041 v730 = v540; | |
7042 LODWORD(v733) = v540; | |
7043 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7044 goto LABEL_83; | |
7045 v541 = v3->spellnum; | |
7046 v542 = pGame->GetStru6(); | |
7047 pGame->GetStru6()->SetPlayerBuffAnim(v541, v1); | |
7048 v543 = v3->spellnum; | |
7049 v544 = pGame->GetStru6(); | |
7050 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1u); | |
7051 v545 = v3->spellnum; | |
7052 v546 = pGame->GetStru6(); | |
7053 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2u); | |
7054 v547 = v3->spellnum; | |
7055 v548 = pGame->GetStru6(); | |
7056 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3u); | |
7057 v732 = v730 << 7; | |
7058 v549 = (double)(v730 << 7) * 0.033333335; | |
7059 *((float *)&v733 + 1) = v549; | |
7060 v712 = (signed __int64)v549; | |
7061 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, v1, v1); | |
7062 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7063 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7064 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7065 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7066 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | |
7067 v550 = v2 + 5; | |
7068 pParty->pPartyBuffs[ 5].Apply( | |
7069 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7070 v731, | |
7071 v550, | |
7072 v1, | |
7073 v1); | |
7074 v668 = v1; | |
7075 v658 = v1; | |
7076 v653 = v550; | |
7077 v651 = v731; | |
7078 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); | |
7079 LABEL_992: | |
7080 v27 = (char *)&pParty->pPartyBuffs[19]; | |
7081 goto LABEL_103; | |
7082 case 86: | |
7083 v551 = v12 - 2; | |
7084 if ( !v551 ) | |
7085 goto LABEL_998; | |
7086 v552 = v551 - 1; | |
7087 if ( v552 ) | |
7088 { | |
7089 if ( v552 == 1 ) | |
7090 { | |
7091 amount = 15; | |
7092 HIDWORD(v733) = 20; | |
7093 goto LABEL_1000; | |
7094 } | |
7095 LABEL_998: | |
7096 v678 = 4; | |
7097 } | |
7098 else | |
7099 { | |
7100 v678 = 12; | |
7101 } | |
7102 amount = v678; | |
7103 HIDWORD(v733) = v678; | |
7104 LABEL_1000: | |
7105 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7106 goto LABEL_83; | |
7107 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); | |
7108 v732 = (300 * amount * v2 + 60) << 7; | |
7109 v730 = v2 + 5; | |
7110 v726 = (Player *)v1; | |
89 | 7111 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 7112 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
7113 do | |
7114 { | |
7115 v554 = v3->spellnum; | |
7116 v555 = pGame->GetStru6(); | |
7117 pGame->GetStru6()->SetPlayerBuffAnim(v554, v1); | |
7118 v556 = v3->spellnum; | |
7119 v557 = pGame->GetStru6(); | |
7120 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1u); | |
7121 v558 = v3->spellnum; | |
7122 v559 = pGame->GetStru6(); | |
7123 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2u); | |
7124 v560 = v3->spellnum; | |
7125 v561 = pGame->GetStru6(); | |
7126 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3u); | |
89 | 7127 //((SpellBuff *)(v553 + 6056))->Apply( |
7128 v553->pPlayerBuffs[4].Apply( | |
0 | 7129 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7130 v731, | |
7131 v730, | |
7132 v1, | |
7133 v1); | |
7134 if ( *(_QWORD *)v553 ) | |
7135 v726 = (Player *)1; | |
89 | 7136 ++v553; |
7137 } | |
7138 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 7139 v562 = v731; |
7140 pParty->pPartyBuffs[9].Apply( | |
7141 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7142 v731, | |
7143 v730, | |
7144 v1, | |
7145 v1); | |
7146 pParty->pPartyBuffs[14].Apply( | |
7147 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7148 v562, | |
7149 v1, | |
7150 v1, | |
7151 v1); | |
7152 pParty->pPartyBuffs[15].Apply( | |
7153 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7154 v562, | |
7155 v730, | |
7156 v1, | |
7157 v1); | |
7158 if ( v726 != (Player *)v1 ) | |
7159 goto LABEL_1056; | |
7160 v668 = v1; | |
7161 v732 = (int)y << 7; | |
7162 v658 = v1; | |
7163 v653 = v730; | |
7164 v651 = v562; | |
7165 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 | |
7166 + (double)(signed __int64)pParty->uTimePlayed); | |
7167 v27 = (char *)&pParty->pPartyBuffs[8]; | |
7168 goto LABEL_103; | |
7169 case 88: | |
7170 amount = 3; | |
7171 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
7172 goto LABEL_200; | |
7173 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7174 goto LABEL_83; | |
7175 a2 = v1; | |
7176 _this = (ItemGen *)&pPlayers[1]; | |
7177 do | |
7178 { | |
7179 v563 = 0; | |
7180 do | |
7181 { | |
7182 v564 = _this->uItemID; | |
7183 *(int *)(v563 + _this->uItemID) = v1; | |
7184 v563 += 8; | |
7185 *(int *)(v563 + v564 - 4) = v1; | |
7186 } | |
7187 while ( v563 <= 128 ); | |
7188 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
7189 v566 = (Player **)_this; | |
7190 *(int *)(_this->uItemID + 6460) = v565; | |
7191 v567 = (*v566)->GetMaxMana(); | |
7192 v568 = a2; | |
7193 *(int *)(_this->uItemID + 6464) = v567; | |
7194 v569 = v3->spellnum; | |
7195 v570 = pGame->GetStru6(); | |
7196 pGame->GetStru6()->SetPlayerBuffAnim(v569, v568); | |
7197 ++a2; | |
7198 _this = (ItemGen *)((char *)_this + 4); | |
7199 } | |
7200 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
7201 v571 = pPlayer; | |
7202 v572 = (char *)&pPlayer->sAgeModifier; | |
7203 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
7204 *(short *)v572 = 120; | |
7205 else | |
7206 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
7207 sRecoveryTime += -5 * v2; | |
7208 ++v571->uNumDivineInterventionCastsThisDay; | |
7209 goto LABEL_1056; | |
7210 case 89: | |
7211 v573 = v12 - 2; | |
7212 if ( v573 ) | |
7213 { | |
7214 v574 = v573 - 1; | |
7215 if ( v574 ) | |
7216 { | |
7217 if ( v574 == 1 ) | |
7218 v575 = 5 * v2; | |
7219 else | |
7220 v575 = 2 * v2; | |
7221 } | |
7222 else | |
7223 { | |
7224 v575 = 4 * v2; | |
7225 } | |
7226 } | |
7227 else | |
7228 { | |
7229 v575 = 3 * v2; | |
7230 } | |
7231 amount = v575; | |
7232 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7233 goto LABEL_83; | |
7234 v576 = *(int *)&v3->field_C; | |
7235 if ( v576 == v1 ) | |
7236 { | |
7237 v583 = v3->uPlayerID_2; | |
7238 v584 = v3->spellnum; | |
7239 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
7240 v586 = pGame->GetStru6(); | |
7241 pGame->GetStru6()->SetPlayerBuffAnim(v584, v583); | |
7242 if ( *((_QWORD *)v585 + 14) ) | |
7243 { | |
7244 ((Player *)v585)->SetCondition(0x11u, 1); | |
7245 v587 = ((Player *)v585)->GetSexByVoice(); | |
7246 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7247 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7248 } | |
7249 goto LABEL_83; | |
7250 } | |
7251 v577 = (Player *)(v576 >> 3); | |
7252 v726 = v577; | |
7253 if ( v577 == (Player *)-1 ) | |
7254 { | |
7255 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7256 goto LABEL_201; | |
7257 } | |
7258 v578 = (int)&pActors[(int)v577]; | |
7259 v721 = v578; | |
7260 if ( *(short *)(v578 + 40) > (signed __int16)v1 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) | |
7261 goto LABEL_200; | |
7262 ++a1.uItemType; | |
7263 a1.stru_24.Reset(); | |
7264 a1.field_48 = v3->spellnum; | |
7265 a1.field_4C = v2; | |
7266 a1.field_50 = v731; | |
7267 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7268 a1.uAttributes = v1; | |
7269 a1.uSectorID = v1; | |
7270 a1.uSpriteFrameID = v1; | |
7271 v580 = v3->uPlayerID; | |
7272 a1.field_60_distance_related_prolly_lod = 0; | |
7273 v581 = v721; | |
7274 v580 *= 8; | |
303 | 7275 LOBYTE(v580) = v580 | OBJECT_Player; |
0 | 7276 a1.uFacing = v1; |
303 | 7277 a1.field_58_pid = v580; |
0 | 7278 a1.uSoundID = LOWORD(v3->field_10); |
7279 a1.vPosition.x = *(short *)(v721 + 142); | |
7280 a1.vPosition.y = *(short *)(v721 + 144); | |
7281 v732 = *(short *)(v721 + 138); | |
7282 v582 = 8 * (int)v726; | |
7283 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7284 LOBYTE(v582) = 8 * (char)v726 | 3; | |
7285 a1.field_5C = v582; | |
7286 a1.Create(0, v1, v1, v1); | |
7287 if ( *(char *)(v581 + 52) > amount ) | |
7288 goto LABEL_83; | |
7289 Actor::Resurrect((unsigned int)v726); | |
7290 *(char *)(v581 + 61) = 0; | |
7291 *(char *)(v581 + 53) = 0; | |
7292 *(char *)(v581 + 54) = 0; | |
7293 *(char *)(v581 + 55) = 0; | |
7294 *(char *)(v581 + 56) = 0; | |
7295 *(char *)(v581 + 57) = 0; | |
7296 *(int *)(v581 + 712) = 9999; | |
7297 *(char *)(v581 + 38) &= 0xF7u; | |
7298 *(int *)(v581 + 708) = v1; | |
7299 ((SpellBuff *)(v581 + 356))->Reset(); | |
7300 ((SpellBuff *)(v581 + 228))->Reset(); | |
7301 ((SpellBuff *)(v581 + 404))->Reset(); | |
7302 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7303 *(short *)(v581 + 40) = 10 * amount; | |
7304 goto LABEL_1056; | |
7305 case 91: | |
7306 v588 = v12 - 1; | |
7307 amount = 16; | |
7308 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7309 { | |
7310 if ( v590 == 1 ) | |
7311 LODWORD(v733) = v1; | |
7312 } | |
7313 else | |
7314 { | |
7315 LODWORD(v733) = 3600 * v2; | |
7316 } | |
7317 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7318 goto LABEL_83; | |
7319 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; | |
7320 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7321 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7322 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7323 || *(char *)(HIDWORD(v733) + 20) & 2 | |
7324 || *(int *)(HIDWORD(v733) + 12) != v1 | |
7325 || *(int *)(HIDWORD(v733) + 4) != v1 | |
7326 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 | |
377 | 7327 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) |
0 | 7328 goto LABEL_199; |
7329 v592 = HIDWORD(v733); | |
7330 v14 = v731 == 4; | |
7331 *(int *)(HIDWORD(v733) + 12) = 16; | |
7332 if ( !v14 ) | |
7333 { | |
7334 v732 = (int)v733 << 7; | |
7335 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7336 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7337 *(int *)(v592 + 20) |= 8u; | |
7338 } | |
7339 *(char *)(v592 + 20) |= 0x80u; | |
7340 goto LABEL_1055; | |
7341 case 93: | |
7342 v593 = v12 - 2; | |
7343 if ( !v593 ) | |
7344 goto LABEL_1062; | |
7345 v594 = v593 - 1; | |
7346 if ( v594 ) | |
7347 { | |
7348 if ( v594 == 1 ) | |
7349 amount = 9; | |
7350 else | |
7351 LABEL_1062: | |
7352 amount = 5; | |
7353 } | |
7354 else | |
7355 { | |
7356 amount = 7; | |
7357 } | |
7358 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7359 goto LABEL_83; | |
7360 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
7361 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7362 a1.stru_24.Reset(); | |
7363 a1.field_48 = v3->spellnum; | |
7364 a1.field_4C = v2; | |
7365 a1.field_50 = v731; | |
7366 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7367 a1.vPosition.x = pParty->vPosition.x; | |
7368 a1.vPosition.y = pParty->vPosition.y; | |
7369 a1.uAttributes = v1; | |
7370 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
7371 a1.uSectorID = pIndoor->GetSector( | |
7372 pParty->vPosition.x, | |
7373 pParty->vPosition.y, | |
7374 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
7375 a1.uSpriteFrameID = v1; | |
7376 v595 = 8 * v3->uPlayerID; | |
303 | 7377 LOBYTE(v595) = v595 | OBJECT_Player; |
7378 a1.field_58_pid = v595; | |
0 | 7379 a1.field_5C = a2; |
7380 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7381 a1.uSoundID = LOWORD(v3->field_10); | |
7382 if ( pParty->bTurnBasedModeOn == 1 ) | |
7383 LOBYTE(a1.uAttributes) |= 4u; | |
7384 v596 = (signed int)v726 / -2; | |
7385 y = (char *)((signed int)v726 / 2); | |
7386 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7387 { | |
7388 v597 = v715.uYawAngle; | |
7389 do | |
7390 { | |
7391 a1.uFacing = v596 + v597; | |
7392 if ( a1.Create( | |
7393 v596 + v597, | |
7394 v715.uPitchAngle, | |
7395 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7396 v3->uPlayerID + 1) != -1 | |
7397 && pParty->bTurnBasedModeOn == 1 ) | |
7398 ++pTurnEngine->field_1C; | |
7399 v596 += v732; | |
7400 } | |
7401 while ( v596 <= (signed int)y ); | |
7402 } | |
7403 goto LABEL_1056; | |
7404 case 94: | |
7405 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7406 goto LABEL_83; | |
7407 if ( v731 == 1 || v731 == 2 ) | |
7408 { | |
7409 v598 = 180 * v2; | |
7410 goto LABEL_1081; | |
7411 } | |
7412 if ( v731 == 3 ) | |
7413 { | |
7414 v598 = 300 * v2; | |
7415 LABEL_1081: | |
7416 LODWORD(v733) = v598; | |
7417 goto LABEL_1082; | |
7418 } | |
7419 if ( v731 == 4 ) | |
7420 LODWORD(v733) = 29030400; | |
7421 LABEL_1082: | |
7422 v599 = a2 >> 3; | |
141 | 7423 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7424 goto LABEL_1056; |
7425 v730 = 836 * v599; | |
7426 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
7427 goto LABEL_83; | |
90 | 7428 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7429 goto LABEL_200; |
90 | 7430 pActors[v599].pActorBuffs[9].Reset(); |
7431 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7432 v732 = (int)v733 << 7; |
90 | 7433 pActors[v599].pActorBuffs[12].Apply( |
0 | 7434 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
7435 v731, | |
7436 v1, | |
7437 v1, | |
7438 v1); | |
7439 a1.stru_24.Reset(); | |
7440 a1.field_48 = v3->spellnum; | |
7441 a1.field_4C = v2; | |
7442 a1.field_50 = v731; | |
7443 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 7444 v61 = v599; |
0 | 7445 LABEL_1086: |
90 | 7446 v600 = pActors[v61].vPosition.y; |
7447 v601 = pActors[v61].vPosition.x; | |
0 | 7448 a1.uObjectDescID = v60; |
7449 a1.vPosition.x = v601; | |
90 | 7450 v602 = pActors[v61].uActorHeight; |
7451 v603 = pActors[v61].vPosition.z; | |
0 | 7452 a1.vPosition.y = v600; |
7453 v676 = v603 + v602; | |
7454 v665 = v600; | |
7455 a1.vPosition.z = v603 + v602; | |
7456 v657 = v601; | |
7457 LABEL_1087: | |
7458 a1.uAttributes = v1; | |
7459 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); | |
7460 a1.uSpriteFrameID = v1; | |
7461 v604 = 8 * v3->uPlayerID; | |
303 | 7462 LOBYTE(v604) = v604 | OBJECT_Player; |
7463 a1.field_58_pid = v604; | |
0 | 7464 a1.field_5C = a2; |
7465 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7466 a1.uFacing = LOWORD(v715.uYawAngle); | |
7467 LOWORD(v604) = LOWORD(v3->field_10); | |
7468 LOBYTE(a1.uAttributes) |= 0x80u; | |
7469 a1.uSoundID = v604; | |
7470 a1.Create(0, v1, v1, v3->uPlayerID + 1); | |
7471 goto LABEL_1056; | |
7472 case 96: | |
7473 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7474 goto LABEL_83; | |
7475 HIDWORD(v733) = v1; | |
7476 memset(&pStru179, v1, 0xFA0u); | |
7477 _this = (ItemGen *)v1; | |
7478 v605 = (char *)pParty->pHirelings; | |
7479 do | |
7480 { | |
7481 if ( *(int *)v605 != v1 ) | |
7482 { | |
7483 v606 = HIDWORD(v733)++; | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
79
diff
changeset
|
7484 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7485 } |
7486 _this = (ItemGen *)((char *)_this + 1); | |
7487 v605 += 76; | |
7488 } | |
7489 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
7490 _this = (ItemGen *)v1; | |
7491 if ( (signed int)pNPCStats->uNumNewNPCs > v1 ) | |
7492 { | |
7493 v730 = (int)pNPCStats->pNewNPCData; | |
7494 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7495 do | |
7496 { | |
7497 if ( *(char *)(v730 + 8) & 0x80 | |
7498 && (pParty->pHirelings[0].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) | |
7499 && (pParty->pHirelings[1].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
7500 { | |
7501 v607 = HIDWORD(v733); | |
7502 HIDWORD(v733) += 4; | |
7503 *(int *)v607 = (int)_this + 3; | |
7504 } | |
7505 _this = (ItemGen *)((char *)_this + 1); | |
7506 v730 += 76; | |
7507 } | |
7508 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7509 } | |
7510 v608 = v3->uPlayerID_2; | |
7511 if ( v608 != 4 && v608 != 5 | |
7512 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= v1) | |
7513 || v609 >= 3 ) | |
7514 goto LABEL_200; | |
7515 v610 = 76 * v609; | |
7516 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = v1; | |
7517 v611 = pIconsFrameTable->FindIcon("spell96"); | |
7518 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( | |
7519 v611); | |
7520 v232 = 1; | |
7521 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; | |
89 | 7522 v612 = pParty->pPlayers; |
0 | 7523 do |
7524 { | |
89 | 7525 v612->sHealth = v612->GetMaxHealth(); |
7526 v612->sMana = v612->GetMaxMana(); | |
7527 ++v612; | |
7528 } | |
7529 while ( v612 <= &pParty->pPlayers[3] ); | |
7530 v613 = &pOutdoor->ddm; | |
0 | 7531 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7532 v613 = &pIndoor->dlv; |
7533 v613->uReputation += 15; | |
7534 if ( v613->uReputation > 10000 ) | |
7535 v613->uReputation = 10000; | |
0 | 7536 LODWORD(v727) = v232; |
7537 goto LABEL_83; | |
7538 case 95: | |
7539 if ( v12 <= v1 ) | |
7540 goto LABEL_1119; | |
7541 if ( v12 <= 3 ) | |
7542 { | |
7543 v614 = 300 * (v2 + 12); | |
7544 } | |
7545 else | |
7546 { | |
7547 if ( v12 != 4 ) | |
7548 goto LABEL_1119; | |
7549 v614 = 900 * (v2 + 4); | |
7550 } | |
7551 LODWORD(v733) = v614; | |
7552 LABEL_1119: | |
7553 v615 = v2 + 5; | |
7554 amount = v615; | |
7555 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7556 goto LABEL_83; | |
7557 if ( v731 != 3 && v731 != 4 ) | |
7558 { | |
7559 v616 = v3->uPlayerID_2; | |
7560 v617 = v3->spellnum; | |
7561 v618 = pGame->GetStru6(); | |
7562 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); | |
7563 v668 = v1; | |
7564 v658 = v716; | |
7565 v732 = (int)v733 << 7; | |
7566 v653 = v615; | |
7567 v651 = v731; | |
7568 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7569 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; | |
7570 goto LABEL_103; | |
7571 } | |
7572 a2 = v1; | |
7573 v732 = (int)v733 << 7; | |
7574 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7575 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7576 do |
7577 { | |
7578 v620 = a2; | |
7579 v621 = v3->spellnum; | |
7580 v622 = pGame->GetStru6(); | |
7581 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); | |
112 | 7582 v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); |
0 | 7583 ++a2; |
112 | 7584 ++v619; |
7585 } | |
7586 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7587 goto LABEL_1056; |
7588 case 99: | |
7589 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7590 goto LABEL_83; | |
7591 v726 = (Player *)v1; | |
7592 pGame->GetIndoorCamera(); | |
7593 v623 = (signed __int64)GetPickDepth(); | |
7594 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
7595 v709 = v1; | |
7596 v708 = v1; | |
7597 v707 = v1; | |
7598 a1.stru_24.Reset(); | |
7599 a1.field_48 = v3->spellnum; | |
7600 a1.field_4C = v2; | |
7601 a1.field_50 = v731; | |
7602 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7603 a1.uAttributes = v1; | |
7604 a1.uSectorID = v1; | |
7605 a1.uSpriteFrameID = v1; | |
7606 v624 = v3->uPlayerID; | |
7607 a1.field_60_distance_related_prolly_lod = 0; | |
7608 a1.uFacing = v1; | |
7609 v624 *= 8; | |
303 | 7610 LOBYTE(v624) = v624 | OBJECT_Player; |
7611 a1.field_58_pid = v624; | |
0 | 7612 a1.uSoundID = LOWORD(v3->field_10); |
7613 a2 = v1; | |
7614 if ( SHIDWORD(v733) > v1 ) | |
7615 { | |
7616 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7617 do | |
7618 { | |
7619 v625 = dword_50BF30[a2]; | |
7620 a1.vPosition.x = pActors[v625].vPosition.x; | |
7621 a1.vPosition.y = pActors[v625].vPosition.y; | |
7622 v732 = pActors[v625].uActorHeight; | |
7623 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7624 v626 = 8 * dword_50BF30[a2]; | |
7625 LOBYTE(v626) = v626 | 3; | |
7626 a1.field_5C = v626; | |
7627 v627 = a1.Create(0, v1, v1, v1); | |
7628 v628 = a2; | |
7629 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7630 a2 = v628 + 1; | |
7631 } | |
7632 while ( v628 + 1 < SHIDWORD(v733) ); | |
7633 } | |
7634 v730 = v1; | |
7635 v629 = 1; | |
7636 do | |
7637 { | |
7638 v630 = pPlayers[v629]; | |
7639 if ( !v630->pConditions[2] | |
7640 && !v630->pConditions[12] | |
7641 && !v630->pConditions[13] | |
7642 && !v630->pConditions[14] | |
7643 && !v630->pConditions[15] | |
7644 && !v630->pConditions[16] ) | |
7645 { | |
7646 v631 = v730++; | |
7647 v681[v631] = v629; | |
7648 } | |
7649 ++v629; | |
7650 } | |
7651 while ( v629 <= 4 ); | |
7652 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
7653 HIDWORD(v733) = v1; | |
7654 if ( v730 > v1 ) | |
7655 { | |
7656 do | |
7657 { | |
7658 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7659 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7660 v633->sHealth += v732; | |
7661 v726 = *(Player **)v632; | |
7662 v634 = v726->GetMaxHealth(); | |
7663 if ( v726->sHealth > v634 ) | |
7664 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7665 v635 = HIDWORD(v733); | |
7666 v636 = WORD2(v733); | |
7667 v637 = v3->spellnum; | |
7668 v638 = pGame->GetStru6(); | |
7669 pGame->GetStru6()->SetPlayerBuffAnim(v637, v636); | |
7670 HIDWORD(v733) = v635 + 1; | |
7671 } | |
7672 while ( v635 + 1 < v730 ); | |
7673 } | |
7674 v639 = pGame->GetStru6(); | |
7675 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(v1, 0x40u); | |
7676 goto LABEL_1056; | |
7677 case 98: | |
7678 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7679 { | |
7680 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7681 goto LABEL_201; | |
7682 } | |
7683 v640 = v12 - 2; | |
7684 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7685 amount = 3; | |
349 | 7686 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > v1 ) |
0 | 7687 goto LABEL_200; |
7688 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7689 goto LABEL_83; | |
349 | 7690 pParty->armageddon_timer = 256; |
0 | 7691 pParty->field_16140 = v2; |
7692 ++pPlayer->uNumArmageddonCasts; | |
7693 if ( pParty->bTurnBasedModeOn == 1 ) | |
7694 ++pTurnEngine->field_1C; | |
7695 v726 = (Player *)50; | |
7696 do | |
7697 { | |
7698 v642 = rand() % 4096 - 2048; | |
7699 v643 = rand(); | |
7700 v721 = v642 + pParty->vPosition.x; | |
7701 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
7702 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1); | |
7703 v644 = rand(); | |
7704 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1); | |
7705 v726 = (Player *)((char *)v726 - 1); | |
7706 } | |
7707 while ( *(float *)&v726 != 0.0 ); | |
7708 goto LABEL_1056; | |
7709 default: | |
7710 goto LABEL_83; | |
7711 } | |
7712 while ( 2 ) | |
7713 { | |
7714 if ( v731 == 4 ) | |
7715 { | |
7716 if ( *((_QWORD *)v222 + 2) ) | |
7717 { | |
7718 *((int *)v222 + 4) = v1; | |
7719 *((int *)v222 + 5) = v1; | |
7720 goto LABEL_439; | |
7721 } | |
7722 } | |
7723 else | |
7724 { | |
7725 v732 = amount << 7; | |
7726 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7727 2u, | |
7728 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7729 v222 = (char *)HIDWORD(v733); | |
7730 if ( v223 ) | |
7731 LABEL_439: | |
187 | 7732 ((Player *)v222)->PlaySound(SPEECH_103, v1); |
0 | 7733 } |
7734 v222 += 6972; | |
7735 HIDWORD(v733) = (int)v222; | |
7736 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7737 goto LABEL_1056; | |
7738 continue; | |
7739 } | |
7740 } | |
7741 if ( pParty->bTurnBasedModeOn == v1 ) | |
7742 { | |
7743 v646 = pPlayer; | |
7744 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
7745 v647 = n; | |
7746 } | |
7747 else | |
7748 { | |
7749 v647 = n; | |
7750 v646 = pPlayer; | |
7751 v648 = sRecoveryTime; | |
7752 v649 = pPlayer; | |
7753 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
7754 v649->SetRecoveryTime(v648); | |
7755 pTurnEngine->_40471C(); | |
7756 } | |
7757 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
7758 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | |
7759 v711[v647].spellnum = v1; | |
7760 v646->sMana -= uRequiredMana; | |
7761 } | |
7762 //----- (0042EB42) -------------------------------------------------------- | |
7763 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7764 { | |
7765 unsigned int v2; // edx@1 | |
7766 signed int v3; // eax@1 | |
7767 char *v4; // ecx@2 | |
7768 | |
7769 v2 = this->uNumObjects; | |
7770 v3 = 0; | |
7771 if ( (signed int)this->uNumObjects <= 0 ) | |
7772 { | |
7773 LABEL_5: | |
7774 LOWORD(v3) = 0; | |
7775 } | |
7776 else | |
7777 { | |
7778 v4 = (char *)&this->pObjects->uObjectID; | |
7779 while ( uItemID != *(short *)v4 ) | |
7780 { | |
7781 ++v3; | |
7782 v4 += 56; | |
7783 if ( v3 >= (signed int)v2 ) | |
7784 goto LABEL_5; | |
7785 } | |
7786 } | |
7787 return v3; | |
7788 } | |
7789 | |
7790 | |
7791 | |
7792 //----- (0042EB78) -------------------------------------------------------- | |
7793 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7794 { | |
7795 return 8 * this->pIcons[uIconID].uAnimLength; | |
7796 } | |
7797 | |
7798 //----- (0042EB8D) -------------------------------------------------------- | |
7799 void GUIMessageQueue::SendMessage(UIMessageType msg, int param, unsigned int a4) | |
7800 { | |
7801 if (uNumMessages < 40) | |
7802 { | |
7803 pMessages[uNumMessages].eType = msg; | |
7804 pMessages[uNumMessages].param = param; | |
7805 pMessages[uNumMessages++].field_8 = a4; | |
7806 } | |
7807 } | |
7808 | |
7809 //----- (0042EBBE) -------------------------------------------------------- | |
7810 int __fastcall sub_42EBBE(int a1, int a2) | |
7811 { | |
7812 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7813 } | |
7814 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7815 | |
7816 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 7817 int stru193_math::Sin(int angle) |
0 | 7818 { |
323 | 7819 return Cos(angle - this->uIntegerHalfPi); |
0 | 7820 } |
7821 | |
7822 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 7823 void _42ECB5_PlayerAttacksActor() |
0 | 7824 { |
271 | 7825 //unsigned int v0; // ebx@1 |
7826 //Player *v1; // esi@1 | |
7827 //bool result; // eax@1 | |
295 | 7828 //int v3; // edi@2 |
271 | 7829 //unsigned int v4; // eax@7 |
0 | 7830 char *v5; // eax@8 |
271 | 7831 //int v6; // ecx@9 |
7832 //signed int v7; // eax@16 | |
295 | 7833 //Actor *v8; // edi@20 |
0 | 7834 unsigned int v9; // ecx@21 |
295 | 7835 //char *v10; // eax@26 |
0 | 7836 char *v11; // eax@26 |
7837 unsigned int v12; // eax@47 | |
295 | 7838 //char *v13; // eax@47 |
7839 //char *v14; // eax@47 | |
7840 //unsigned int v15; // ebx@54 | |
7841 //int v16; // [sp-10h] [bp-4Ch]@24 | |
7842 //int v17; // [sp-10h] [bp-4Ch]@44 | |
7843 //unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7844 //unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7845 //__int16 v20; // [sp-8h] [bp-44h]@24 | |
7846 //__int16 v21; // [sp-8h] [bp-44h]@44 | |
7847 //int v22; // [sp-4h] [bp-40h]@24 | |
7848 //int v23; // [sp-4h] [bp-40h]@44 | |
0 | 7849 SoundID v24; // [sp-4h] [bp-40h]@58 |
295 | 7850 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 |
271 | 7851 //unsigned int a2; // [sp+18h] [bp-24h]@20 |
7852 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
295 | 7853 //int v28; // [sp+20h] [bp-1Ch]@9 |
271 | 7854 //unsigned int *v28b; |
295 | 7855 //int v29; // [sp+24h] [bp-18h]@16 |
7856 //int v30; // [sp+28h] [bp-14h]@16 | |
271 | 7857 //int v31; // [sp+2Ch] [bp-10h]@4 |
295 | 7858 //int v32; // [sp+30h] [bp-Ch]@7 |
271 | 7859 //int v33; // [sp+34h] [bp-8h]@7 |
295 | 7860 //int v34; // [sp+38h] [bp-4h]@17 |
0 | 7861 |
271 | 7862 //v0 = uActiveCharacter; |
7863 //v27 = 6972 * uActiveCharacter; | |
7864 //v1 = &pParty->pPlayers[uActiveCharacter-1]; | |
7865 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); | |
7866 auto player = &pParty->pPlayers[uActiveCharacter - 1]; | |
7867 if (!player->CanAct()) | |
7868 return; | |
7869 | |
7870 pStru277->_427D48(uActiveCharacter); | |
295 | 7871 //v3 = 0; |
271 | 7872 if (pParty->Invisible()) |
7873 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
7874 | |
7875 //v31 = player->pEquipment.uBow; | |
7876 int bow_idx = player->pEquipment.uBow; | |
7877 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) | |
7878 bow_idx = 0; | |
7879 | |
295 | 7880 //v32 = 0; |
7881 int wand_item_id = 0; | |
271 | 7882 //v33 = 0; |
7883 //v4 = v1->pEquipment.uMainHand; | |
7884 int laser_weapon_item_id = 0; | |
7885 | |
7886 int main_hand_idx = player->pEquipment.uMainHand; | |
7887 if (main_hand_idx) | |
0 | 7888 { |
271 | 7889 auto item = &player->pInventoryItems[main_hand_idx - 1]; |
112 | 7890 //v5 = (char *)v1 + 36 * v4; |
271 | 7891 if (!item->Broken()) |
7892 { | |
7893 //v28b = &v1->pInventoryItems[v4].uItemID; | |
7894 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
295 | 7895 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND) |
0 | 7896 { |
295 | 7897 if (item->uNumCharges <= 0) |
7898 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 7899 else |
295 | 7900 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 7901 } |
271 | 7902 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
7903 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 7904 } |
271 | 7905 } |
7906 | |
295 | 7907 //v30 = 0; |
7908 //v29 = 0; | |
7909 //v28 = 0; | |
271 | 7910 //v7 = pMouse->uPointingObjectID; |
7911 | |
7912 int target_pid = pMouse->uPointingObjectID; | |
7913 int target_type = target_pid & 7, | |
7914 target_id = target_pid >> 3; | |
7915 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) | |
7916 { | |
7917 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
7918 target_type = target_pid & 7; | |
7919 target_id = target_pid >> 3; | |
7920 } | |
295 | 7921 |
7922 auto actor = &pActors[target_id]; | |
7923 int actor_distance = 0; | |
271 | 7924 if (target_type == OBJECT_Actor) |
7925 { | |
295 | 7926 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
7927 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
7928 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
7929 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
7930 if (actor_distance < 0) | |
7931 actor_distance = 0; | |
7932 } | |
7933 | |
7934 bool shooting_bow = false, | |
7935 shotting_laser = false, | |
7936 shooting_wand = false; | |
7937 if (laser_weapon_item_id) | |
7938 { | |
7939 shotting_laser = true; | |
7940 _42777D_CastSpell_UseWand_ShootArrow(102, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); | |
7941 } | |
7942 else if (wand_item_id) | |
7943 { | |
7944 shooting_wand = true; | |
7945 | |
7946 int main_hand_idx = player->pEquipment.uMainHand; | |
7947 _42777D_CastSpell_UseWand_ShootArrow(*((int *)&pSpellDatas[66].field_8 + player->pInventoryItems[main_hand_idx - 1].uItemID), uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); | |
7948 | |
7949 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | |
7950 player->pEquipment.uMainHand = 0; | |
7951 } | |
303 | 7952 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 7953 { |
303 | 7954 Vec3_int_ a3; |
7955 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
7956 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
7957 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
7958 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
7959 | |
7960 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); | |
305 | 7961 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) |
295 | 7962 _42FA66_do_explosive_impact( |
7963 actor->vPosition.x, | |
7964 actor->vPosition.y, | |
7965 actor->vPosition.z + actor->uActorHeight / 2, | |
7966 0, 512, uActiveCharacter); | |
303 | 7967 } |
7968 else if (bow_idx) | |
7969 { | |
7970 shooting_bow = true; | |
7971 _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); | |
295 | 7972 } |
7973 else | |
7974 { | |
303 | 7975 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
7976 } | |
7977 | |
7978 if (!pParty->bTurnBasedModeOn) | |
7979 { | |
7980 int recovery = player->GetAttackRecoveryTime(0); | |
7981 if (recovery < 30 ) | |
7982 recovery = 30; | |
7983 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); | |
295 | 7984 } |
7985 | |
7986 | |
7987 int v34 = 0; | |
7988 if (shooting_wand) | |
7989 return; | |
7990 else if (shooting_bow) | |
7991 { | |
7992 v34 = 5; | |
7993 player->PlaySound(SPEECH_50, 0); | |
7994 } | |
7995 if (shotting_laser) | |
7996 v34 = 7; | |
7997 else | |
7998 { | |
7999 int main_hand_idx = player->pEquipment.uMainHand; | |
8000 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) | |
8001 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType; | |
8002 pTurnEngine->_40471C(); | |
8003 } | |
8004 | |
8005 switch (v34) | |
8006 { | |
8007 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
8008 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
8009 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
8010 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
8011 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
8012 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
8013 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
8014 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
8015 } | |
0 | 8016 } |
8017 | |
8018 //----- (0042F184) -------------------------------------------------------- | |
295 | 8019 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 8020 { |
8021 int v4; // edi@1 | |
8022 stru319 *v5; // esi@1 | |
8023 int v6; // eax@2 | |
8024 int v7; // eax@4 | |
8025 int result; // eax@5 | |
8026 int *v9; // edx@8 | |
8027 signed int v10; // ebx@10 | |
8028 int v11; // edi@11 | |
8029 Actor *v12; // esi@12 | |
8030 unsigned __int16 v13; // ax@12 | |
8031 int v14; // eax@22 | |
8032 char v15; // zf@30 | |
8033 int v16; // esi@32 | |
8034 int v17; // ecx@34 | |
8035 stru319 *v18; // eax@39 | |
8036 int v19; // edx@39 | |
8037 int v20; // ecx@41 | |
8038 unsigned __int16 v21; // ax@42 | |
8039 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
8040 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
8041 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
8042 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
8043 int *v26; // [sp+18h] [bp-14h]@8 | |
8044 int v27; // [sp+1Ch] [bp-10h]@10 | |
8045 int *v28; // [sp+20h] [bp-Ch]@10 | |
8046 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
8047 int v30; // [sp+28h] [bp-4h]@6 | |
8048 int i; // [sp+38h] [bp+Ch]@33 | |
8049 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
8050 | |
8051 v4 = 0; | |
8052 v5 = this; | |
8053 v24 = this; | |
8054 if ( pRenderer->pRenderD3D ) | |
8055 { | |
8056 v6 = a3 != 0; | |
8057 if ( a4 ) | |
8058 LOBYTE(v6) = v6 | 8; | |
295 | 8059 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 8060 if ( v7 != -1 ) |
8061 return (unsigned __int16)v7; | |
295 | 8062 else return 0; |
0 | 8063 } |
8064 else | |
8065 { | |
8066 v30 = 0; | |
8067 if ( pRenderer->pActiveZBuffer ) | |
8068 { | |
8069 v29 = viewparams->uScreenX; | |
8070 v23 = viewparams->uScreenZ; | |
8071 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
8072 { | |
8073 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
8074 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8075 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8076 do | |
8077 { | |
8078 if ( (signed int)v29 < (signed int)v23 ) | |
8079 { | |
8080 v28 = v9; | |
8081 v10 = v4; | |
8082 v27 = v23 - v29; | |
8083 do | |
8084 { | |
8085 v22 = *v28; | |
8086 v11 = *v28 & 0xFFFF; | |
141 | 8087 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 8088 { |
8089 v12 = &pActors[(unsigned int)v11 >> 3]; | |
8090 v13 = v12->uAIState; | |
8091 if ( v13 != 5 ) | |
8092 { | |
8093 if ( v13 != 4 | |
8094 && v13 != 11 | |
8095 && v13 != 19 | |
8096 && v13 != 17 | |
8097 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
8098 { | |
8099 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
295 | 8100 && v22 <= pick_depth << 16 ) |
0 | 8101 { |
8102 v14 = 0; | |
8103 if ( v10 > 0 ) | |
8104 { | |
8105 do | |
8106 { | |
8107 if ( dword_50BDA0[v14] == v11 ) | |
8108 break; | |
8109 ++v14; | |
8110 } | |
8111 while ( v14 < v30 ); | |
8112 } | |
8113 if ( v14 == v30 && v10 < 100 ) | |
8114 { | |
8115 ++v30; | |
8116 dword_50BC10[v10] = v22; | |
8117 dword_50BDA0[v10] = v11; | |
8118 ++v10; | |
8119 } | |
8120 } | |
8121 } | |
8122 } | |
8123 } | |
8124 ++v28; | |
8125 --v27; | |
8126 } | |
8127 while ( v27 ); | |
8128 v4 = v30; | |
8129 v5 = v24; | |
8130 } | |
8131 v9 = v26 + 640; | |
8132 v15 = v25-- == 1; | |
8133 v26 += 640; | |
8134 } | |
8135 while ( !v15 ); | |
8136 } | |
8137 if ( v4 > 0 ) | |
8138 { | |
8139 v32 = 1; | |
8140 v16 = (int)dword_50BC10; | |
8141 do | |
8142 { | |
8143 for ( i = v32; i < v4; ++i ) | |
8144 { | |
8145 v17 = dword_50BC10[i]; | |
8146 if ( v17 < *(int *)v16 ) | |
8147 { | |
8148 dword_50BC10[i] = *(int *)v16; | |
8149 *(int *)v16 = v17; | |
8150 } | |
8151 } | |
8152 ++v32; | |
8153 v16 += 4; | |
8154 } | |
8155 while ( v32 - 1 < v4 ); | |
8156 v5 = v24; | |
8157 if ( v4 > 0 ) | |
8158 { | |
8159 v18 = v24; | |
8160 v19 = v4; | |
8161 do | |
8162 { | |
8163 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
8164 v18 += 4; | |
8165 --v19; | |
8166 } | |
8167 while ( v19 ); | |
8168 } | |
8169 } | |
8170 v20 = 0; | |
8171 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
8172 { | |
8173 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8174 if ( v21 != 4 && v21 != 5 ) | |
8175 break; | |
8176 } | |
8177 if ( v20 != v4 ) | |
8178 { | |
8179 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8180 LOBYTE(result) = result | 3; | |
8181 return result; | |
8182 } | |
8183 } | |
8184 } | |
8185 return 0; | |
8186 } | |
8187 | |
8188 | |
8189 //----- (0042F3D6) -------------------------------------------------------- | |
8190 void InitializeTurnBasedAnimations(void *_this) | |
8191 { | |
8192 unsigned int *v1; // edi@1 | |
8193 | |
8194 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8195 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8196 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8197 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8198 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8199 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8200 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8201 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8202 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8203 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8204 v1 = pIconIDs_Turn; | |
8205 do | |
8206 { | |
8207 pIconsFrameTable->InitializeAnimation(*v1); | |
8208 ++v1; | |
8209 } | |
8210 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8211 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8212 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8213 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8214 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8215 } | |
8216 | |
8217 //----- (0042F4DA) -------------------------------------------------------- | |
8218 signed int __cdecl sub_42F4DA() | |
8219 { | |
8220 signed int v0; // edi@1 | |
82 | 8221 Actor *v1; // esi@4 |
0 | 8222 int v2; // ebx@5 |
8223 int v3; // eax@5 | |
8224 int v4; // ebx@5 | |
8225 unsigned int v5; // ecx@5 | |
8226 int v6; // edx@6 | |
8227 unsigned int v7; // edx@8 | |
8228 unsigned int v8; // edx@10 | |
8229 __int16 v9; // ax@12 | |
8230 signed int result; // eax@20 | |
8231 int v11; // [sp+Ch] [bp-10h]@5 | |
8232 int v12; // [sp+10h] [bp-Ch]@5 | |
8233 signed int v13; // [sp+14h] [bp-8h]@3 | |
8234 | |
8235 v0 = 5120; | |
8236 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8237 v0 = 2560; | |
8238 v13 = 0; | |
8239 if ( (signed int)uNumActors <= 0 ) | |
8240 { | |
8241 LABEL_20: | |
8242 result = 0; | |
8243 } | |
8244 else | |
8245 { | |
82 | 8246 v1 = pActors; |
0 | 8247 while ( 1 ) |
8248 { | |
82 | 8249 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8250 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8251 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8252 v3 = v2; |
8253 v4 = v11; | |
8254 v5 = v12; | |
8255 if ( v3 < v11 ) | |
8256 { | |
8257 v6 = v3; | |
8258 v3 = v11; | |
8259 v4 = v6; | |
8260 } | |
8261 if ( v3 < v12 ) | |
8262 { | |
8263 v7 = v3; | |
8264 v3 = v12; | |
8265 v5 = v7; | |
8266 } | |
8267 if ( v4 < (signed int)v5 ) | |
8268 { | |
8269 v8 = v5; | |
8270 v5 = v4; | |
8271 v4 = v8; | |
8272 } | |
8273 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8274 { | |
82 | 8275 v9 = v1->uAIState; |
8276 if ( v1->uAIState != 5 ) | |
0 | 8277 { |
8278 if ( v9 != 4 | |
8279 && v9 != 11 | |
8280 && v9 != 19 | |
8281 && v9 != 17 | |
82 | 8282 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8283 break; |
8284 } | |
8285 } | |
8286 ++v13; | |
82 | 8287 ++v1; |
0 | 8288 if ( v13 >= (signed int)uNumActors ) |
8289 goto LABEL_20; | |
8290 } | |
8291 result = 1; | |
8292 } | |
8293 return result; | |
8294 } | |
8295 | |
8296 //----- (0042F5ED) -------------------------------------------------------- | |
8297 int LayingItem::Create(int yaw, int pitch, int a4, int a5) | |
8298 { | |
8299 LayingItem *v5; // eax@1 | |
8300 signed int v6; // ebx@2 | |
8301 char *v7; // ecx@2 | |
8302 signed int result; // eax@6 | |
8303 LayingItem *v9; // ebx@7 | |
8304 int v10; // edx@11 | |
8305 int v11; // edi@18 | |
8306 __int16 v12; // ax@18 | |
8307 int v13; // ST2C_4@20 | |
8308 int v14; // eax@20 | |
8309 int v15; // [sp-28h] [bp-38h]@14 | |
8310 int v16; // [sp-24h] [bp-34h]@11 | |
8311 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 | |
8312 int *v18; // [sp-14h] [bp-24h]@11 | |
8313 int *v19; // [sp-10h] [bp-20h]@11 | |
8314 int *v20; // [sp-Ch] [bp-1Ch]@11 | |
8315 signed int v21; // [sp+8h] [bp-8h]@2 | |
8316 int angle; // [sp+Ch] [bp-4h]@1 | |
8317 int a4a; // [sp+1Ch] [bp+Ch]@20 | |
8318 int a4b; // [sp+1Ch] [bp+Ch]@20 | |
8319 int a5a; // [sp+20h] [bp+10h]@20 | |
8320 | |
8321 auto a1 = this; | |
8322 angle = yaw; | |
8323 v5 = a1; | |
8324 if ( !a1->uObjectDescID ) | |
8325 return -1; | |
8326 v6 = 0; | |
8327 v7 = (char *)&pLayingItems[0].uObjectDescID; | |
8328 v21 = 0; | |
8329 do | |
8330 { | |
8331 if ( !*(short *)v7 ) | |
8332 break; | |
8333 v7 += 112; | |
8334 ++v6; | |
8335 v21 = v6; | |
8336 } | |
8337 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) ); | |
8338 if ( v6 >= 1000 ) | |
8339 return -1; | |
8340 *(int *)&v5->field_62[2] = v5->vPosition.x; | |
8341 *(int *)&v5->field_62[6] = v5->vPosition.y; | |
8342 v9 = &pLayingItems[v6]; | |
8343 *(int *)&v5->field_62[10] = v5->vPosition.z; | |
8344 memcpy(v9, v5, 0x70u); | |
8345 if ( a5 == 1 ) | |
8346 { | |
8347 v20 = &v9->vPosition.z; | |
8348 v19 = &v9->vPosition.y; | |
8349 v18 = (int *)&v9->vPosition; | |
8350 v17.z = v5->vPosition.z; | |
8351 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8352 v16 = 0; | |
8353 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8354 goto LABEL_16; | |
8355 } | |
8356 if ( a5 == 2 ) | |
8357 { | |
8358 v20 = &v9->vPosition.z; | |
8359 v19 = &v9->vPosition.y; | |
8360 v18 = (int *)&v9->vPosition; | |
8361 v17.z = v5->vPosition.z; | |
8362 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8363 v16 = 0; | |
8364 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8365 goto LABEL_14; | |
8366 } | |
8367 if ( a5 == 3 ) | |
8368 { | |
8369 v20 = &v9->vPosition.z; | |
8370 v19 = &v9->vPosition.y; | |
8371 v18 = (int *)&v9->vPosition; | |
8372 v17.z = v5->vPosition.z; | |
8373 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8374 v16 = 0; | |
8375 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8376 LABEL_14: | |
8377 v15 = 8; | |
8378 LABEL_17: | |
8379 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20); | |
8380 goto LABEL_18; | |
8381 } | |
8382 if ( a5 == 4 ) | |
8383 { | |
8384 v20 = &v9->vPosition.z; | |
8385 v19 = &v9->vPosition.y; | |
8386 v18 = (int *)&v9->vPosition; | |
8387 v17.z = v5->vPosition.z; | |
8388 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8389 v16 = 0; | |
8390 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8391 LABEL_16: | |
8392 v15 = 24; | |
8393 goto LABEL_17; | |
8394 } | |
8395 LABEL_18: | |
8396 v11 = a4; | |
8397 v12 = 0; | |
8398 if ( a4 ) | |
8399 { | |
323 | 8400 a4a = stru_5C6E00->Cos(angle); |
8401 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8402 a4b = stru_5C6E00->Sin(angle); | |
8403 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8404 v14 = stru_5C6E00->Sin(pitch); | |
0 | 8405 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16; |
8406 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16; | |
8407 v12 = (unsigned int)(v14 * v11) >> 16; | |
8408 } | |
8409 else | |
8410 { | |
8411 v9->vVelocity.y = 0; | |
8412 v9->vVelocity.x = 0; | |
8413 } | |
8414 v9->vVelocity.z = v12; | |
8415 result = v21; | |
8416 if ( v21 >= (signed int)uNumLayingItems ) | |
8417 uNumLayingItems = v21 + 1; | |
8418 return result; | |
8419 } | |
8420 | |
8421 //----- (0042F7EB) -------------------------------------------------------- | |
8422 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) | |
8423 { | |
8424 unsigned int v9; // edi@1 | |
8425 signed int v10; // edx@3 | |
8426 char *v11; // ecx@4 | |
8427 unsigned __int16 v12; // ax@7 | |
8428 unsigned int v13; // edx@9 | |
8429 char *v14; // ecx@10 | |
8430 int v15; // esi@17 | |
8431 int v16; // eax@18 | |
8432 int v17; // edi@20 | |
8433 int v18; // esi@20 | |
8434 //LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8435 int v21; // [sp+7Ch] [bp-8h]@1 | |
8436 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8437 | |
8438 v9 = uSpriteID; | |
8439 v21 = x; | |
8440 v22 = uSpriteID; | |
8441 | |
8442 LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8443 //LayingItem::LayingItem(&a1a); | |
8444 a1a.stru_24.Reset(); | |
8445 | |
8446 if ( a9 ) | |
8447 { | |
8448 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8449 v9 = v22; | |
8450 } | |
8451 v10 = 0; | |
8452 a1a.field_50 = 0; | |
8453 a1a.field_4C = 0; | |
8454 a1a.field_48 = 0; | |
8455 a1a.field_54 = 0; | |
8456 a1a.uItemType = v9; | |
8457 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8458 { | |
8459 LABEL_7: | |
8460 v12 = 0; | |
8461 } | |
8462 else | |
8463 { | |
8464 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8465 while ( (short)v9 != *(short *)v11 ) | |
8466 { | |
8467 ++v10; | |
8468 v11 += 56; | |
8469 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8470 goto LABEL_7; | |
8471 } | |
8472 v12 = v10; | |
8473 } | |
8474 a1a.uObjectDescID = v12; | |
8475 a1a.vPosition.z = z; | |
8476 a1a.vPosition.x = v21; | |
8477 a1a.vPosition.y = y; | |
8478 a1a.uSoundID = 0; | |
8479 a1a.uAttributes = attributes; | |
8480 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8481 a1a.uSpriteFrameID = 0; | |
303 | 8482 a1a.field_58_pid = 0; |
0 | 8483 a1a.field_5C = 0; |
8484 if ( !(a1a.uAttributes & 0x10) ) | |
8485 { | |
8486 v13 = 0; | |
222 | 8487 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
0 | 8488 { |
8489 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8490 while ( *(short *)v14 != v9 ) | |
8491 { | |
8492 ++v13; | |
8493 v14 += 48; | |
222 | 8494 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount ) |
0 | 8495 goto LABEL_16; |
8496 } | |
8497 a1a.stru_24.uItemID = v13; | |
8498 } | |
8499 } | |
8500 LABEL_16: | |
8501 if ( a7 ) | |
8502 { | |
8503 v15 = count; | |
8504 if ( count > 0 ) | |
8505 { | |
8506 do | |
8507 { | |
8508 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8509 v16 = rand(); | |
8510 a1a.Create( | |
8511 (signed __int16)a1a.uFacing, | |
8512 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8513 a4, | |
8514 0); | |
8515 --v15; | |
8516 } | |
8517 while ( v15 ); | |
8518 } | |
8519 } | |
8520 else | |
8521 { | |
8522 v17 = count; | |
8523 v18 = stru_5C6E00->uIntegerHalfPi; | |
8524 a1a.uFacing = 0; | |
8525 if ( count > 0 ) | |
8526 { | |
8527 do | |
8528 { | |
8529 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8530 --v17; | |
8531 } | |
8532 while ( v17 ); | |
8533 } | |
8534 } | |
8535 return 1; | |
8536 } | |
8537 | |
8538 //----- (0042F960) -------------------------------------------------------- | |
8539 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8540 { | |
8541 int v3; // ebx@1 | |
8542 int v4; // edi@1 | |
8543 signed int v5; // edx@1 | |
8544 char *v6; // ecx@2 | |
8545 unsigned __int16 v7; // ax@5 | |
8546 signed int v8; // eax@6 | |
8547 signed int v9; // eax@7 | |
8548 //LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8549 | |
8550 v3 = x; | |
8551 v4 = y; | |
8552 | |
8553 LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8554 //LayingItem::LayingItem(&a1); | |
8555 a1.stru_24.Reset(); | |
8556 | |
8557 v5 = 0; | |
8558 a1.field_50 = 0; | |
8559 a1.field_4C = 0; | |
8560 a1.field_48 = 0; | |
8561 a1.field_54 = 0; | |
8562 a1.uItemType = 800; | |
8563 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8564 { | |
8565 LABEL_5: | |
8566 v7 = 0; | |
8567 } | |
8568 else | |
8569 { | |
8570 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8571 while ( *(short *)v6 != 800 ) | |
8572 { | |
8573 ++v5; | |
8574 v6 += 56; | |
8575 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8576 goto LABEL_5; | |
8577 } | |
8578 v7 = v5; | |
8579 } | |
8580 a1.uObjectDescID = v7; | |
8581 a1.vPosition.x = v3; | |
8582 a1.vPosition.y = v4; | |
8583 a1.vPosition.z = z; | |
8584 a1.uSoundID = 0; | |
8585 a1.uAttributes = 0; | |
8586 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8587 a1.uSpriteFrameID = 0; | |
303 | 8588 a1.field_58_pid = 0; |
0 | 8589 a1.field_5C = 0; |
8590 v8 = a1.Create(0, 0, 0, 0); | |
8591 if ( v8 != -1 ) | |
8592 { | |
8593 v9 = 8 * v8; | |
8594 LOBYTE(v9) = v9 | 2; | |
8595 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8596 } | |
8597 } | |
8598 | |
8599 //----- (0042FA22) -------------------------------------------------------- | |
79 | 8600 LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8601 { |
8602 size_t v0; // edx@1 | |
8603 int v1; // ebp@1 | |
79 | 8604 LayingItem *result; // eax@1 |
8605 LayingItem *v3; // ebx@1 | |
0 | 8606 |
8607 v0 = 0; | |
8608 v1 = 0; | |
79 | 8609 //result = (char *)&pLayingItems[0].uObjectDescID; |
8610 result = pLayingItems; | |
0 | 8611 v3 = pLayingItems; |
8612 do | |
8613 { | |
79 | 8614 if ( result->uObjectDescID ) |
0 | 8615 { |
8616 if ( v1 != v0 ) | |
8617 { | |
79 | 8618 memcpy(v3, result, 0x70u); |
8619 result->uObjectDescID = 0; | |
0 | 8620 } |
8621 ++v0; | |
79 | 8622 ++v3;// = (char *)v3 + 112; |
0 | 8623 } |
79 | 8624 ++result;// += 112; |
0 | 8625 ++v1; |
8626 } | |
79 | 8627 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); |
8628 while( result <= &pLayingItems[999] ); | |
0 | 8629 uNumLayingItems = v0; |
8630 return result; | |
8631 } | |
8632 | |
8633 //----- (0042FA66) -------------------------------------------------------- | |
8634 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8635 { | |
8636 int v6; // edi@1 | |
8637 int v7; // esi@1 | |
8638 char *v8; // ecx@2 | |
8639 unsigned __int16 v9; // ax@5 | |
8640 int v10; // eax@10 | |
8641 signed int result; // eax@11 | |
8642 __int16 v12; // ax@12 | |
8643 //LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8644 int v14; // [sp+7Ch] [bp-4h]@1 | |
8645 | |
8646 v6 = a1; | |
8647 v7 = a2; | |
8648 LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8649 //LayingItem::LayingItem(&a1a); | |
8650 a1a.uItemType = 600; | |
8651 a1a.stru_24.Reset(); | |
8652 | |
8653 a1a.field_48 = 6; | |
8654 a1a.field_4C = 8; | |
8655 a1a.field_50 = 3; | |
8656 v14 = 0; | |
8657 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8658 { | |
8659 LABEL_5: | |
8660 v9 = 0; | |
8661 } | |
8662 else | |
8663 { | |
8664 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
8665 while ( (short)a1a.uItemType != *(short *)v8 ) | |
8666 { | |
8667 ++v14; | |
8668 v8 += 56; | |
8669 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8670 goto LABEL_5; | |
8671 } | |
8672 v9 = v14; | |
8673 } | |
8674 a1a.uObjectDescID = v9; | |
8675 a1a.vPosition.x = v6; | |
8676 a1a.vPosition.y = v7; | |
8677 a1a.vPosition.z = a3; | |
8678 a1a.uAttributes = 0; | |
8679 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8680 a1a.uSpriteFrameID = 0; | |
8681 a1a.field_5C = 0; | |
8682 a1a.field_60_distance_related_prolly_lod = 0; | |
8683 a1a.uFacing = 0; | |
8684 a1a.uSoundID = 0; | |
8685 if ( a6 >= 1 || a6 <= 4 ) | |
8686 { | |
8687 v10 = 8 * a6 - 8; | |
303 | 8688 LOBYTE(v10) = v10 | OBJECT_Player; |
8689 a1a.field_58_pid = v10; | |
0 | 8690 } |
8691 else | |
8692 { | |
303 | 8693 a1a.field_58_pid = 0; |
0 | 8694 } |
8695 result = a1a.Create(0, 0, 0, 0); | |
8696 if ( result != -1 ) | |
8697 { | |
8698 v12 = 8 * result; | |
8699 LOBYTE(v12) = v12 | 2; | |
8700 result = stru_50FE08.Add( | |
8701 v12, | |
8702 a5, | |
8703 SLOWORD(a1a.vPosition.x), | |
8704 SLOWORD(a1a.vPosition.y), | |
8705 SLOWORD(a1a.vPosition.z), | |
8706 0, | |
8707 0); | |
8708 } | |
8709 return result; | |
8710 } | |
8711 | |
8712 | |
8713 | |
8714 //----- (0042FB5C) -------------------------------------------------------- | |
8715 bool __fastcall sub_42FB5C(signed int a1) | |
8716 { | |
8717 int v1; // ecx@3 | |
8718 int v2; // ecx@4 | |
8719 int v3; // ecx@5 | |
8720 int v4; // ecx@6 | |
8721 int v5; // ecx@7 | |
8722 int v6; // ecx@8 | |
8723 char v7; // zf@9 | |
8724 | |
8725 if ( a1 > 39 ) | |
8726 { | |
8727 if ( a1 > 77 ) | |
8728 { | |
8729 if ( a1 == 80 ) | |
8730 return 0; | |
8731 if ( a1 > 84 ) | |
8732 { | |
8733 if ( a1 <= 86 ) | |
8734 return 0; | |
8735 v7 = a1 == 95; | |
8736 goto LABEL_20; | |
8737 } | |
8738 } | |
8739 else | |
8740 { | |
8741 if ( a1 == 77 ) | |
8742 return 0; | |
8743 if ( a1 >= 46 ) | |
8744 { | |
8745 if ( a1 <= 47 || a1 == 51 ) | |
8746 return 0; | |
8747 v7 = a1 == 73; | |
8748 goto LABEL_20; | |
8749 } | |
8750 } | |
8751 return 1; | |
8752 } | |
8753 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8754 return 1; | |
8755 v2 = v1 - 3; | |
8756 if ( !v2 ) | |
8757 return 0; | |
8758 v3 = v2 - 1; | |
8759 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8760 return 1; | |
8761 v5 = v4 - 8; | |
8762 if ( !v5 ) | |
8763 return 0; | |
8764 v6 = v5 - 1; | |
8765 if ( !v6 ) | |
8766 return 1; | |
8767 v7 = v6 == 20; | |
8768 LABEL_20: | |
8769 if ( !v7 ) | |
8770 return 1; | |
8771 return 0; | |
8772 } | |
8773 | |
8774 //----- (0042FBDD) -------------------------------------------------------- | |
8775 void __cdecl sub_42FBDD() | |
8776 { | |
388 | 8777 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 8778 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
8779 pRenderer->Present(); | |
8780 } | |
8781 | |
8782 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8783 void __cdecl CloseWindowBackground() |
0 | 8784 { |
388 | 8785 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 8786 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
8787 pRenderer->Present(); | |
8788 } | |
8789 | |
8790 //----- (0042FC4E) -------------------------------------------------------- | |
8791 void __cdecl ProcessInputActions() | |
8792 { | |
8793 ActionQueue *pActionQueue; // esi@7 | |
8794 Keyboard *v3; // ecx@8 | |
8795 char v4; // al@9 | |
8796 ActionQueue *v5; // ecx@19 | |
8797 Player *v6; // ecx@86 | |
8798 Player *v7; // esi@100 | |
8799 char v8; // bl@100 | |
8800 unsigned __int16 v9; // ax@102 | |
8801 int v10; // eax@103 | |
8802 unsigned int v11; // eax@127 | |
8803 signed int v12; // esi@157 | |
8804 Keyboard *v13; // ecx@158 | |
8805 char v14; // al@159 | |
8806 unsigned int v15; // eax@168 | |
8807 void *v16; // esi@177 | |
8808 int v17; // [sp-14h] [bp-1Ch]@8 | |
8809 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8810 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
271 | 8811 //__int16 v20; // [sp-14h] [bp-1Ch]@60 |
0 | 8812 int v21; // [sp-14h] [bp-1Ch]@68 |
8813 int v22; // [sp-Ch] [bp-14h]@158 | |
8814 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8815 int v24; // [sp+4h] [bp-4h]@87 | |
8816 | |
8817 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8818 auto pKeyboard = pGame->pKeyboardInstance; | |
8819 if (!bAlwaysRun) | |
8820 { | |
8821 if (pKeyboard->IsShiftHeld()) | |
8822 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8823 else | |
8824 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8825 } | |
8826 else | |
8827 { | |
8828 if (pKeyboard->IsShiftHeld()) | |
8829 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8830 else | |
8831 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8832 } | |
8833 | |
140 | 8834 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
0 | 8835 LABEL_6: |
8836 if ( !pEventTimer->bPaused ) | |
8837 { | |
8838 inputAction = (InputAction)0; | |
8839 pActionQueue = pPartyActionQueue; | |
8840 while ( 1 ) | |
8841 { | |
8842 v3 = pGame->pKeyboardInstance; | |
8843 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8844 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8845 v4 = v3->WasKeyPressed(v17); | |
8846 else | |
8847 v4 = v3->IsKeyBeingHeld(v17); | |
8848 if ( v4 ) | |
8849 { | |
8850 switch ( inputAction ) | |
8851 { | |
8852 case INPUT_MoveForward: | |
271 | 8853 if (pCurrentScreen != SCREEN_GAME) |
0 | 8854 break; |
8855 if (!pParty->bTurnBasedModeOn) | |
163 | 8856 //goto _do_move_forward; |
0 | 8857 { |
8858 v5 = pActionQueue; | |
140 | 8859 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8860 partyAction = PARTY_RunForward; |
8861 else | |
8862 partyAction = PARTY_WalkForward; | |
163 | 8863 //goto _add_action_and_continue; |
8864 v5->Add(partyAction); | |
8865 break; | |
8866 } | |
8867 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8868 { | |
8869 pTurnEngine->uActionPointsLeft -= 26; | |
8870 //_do_move_forward: | |
8871 v5 = pActionQueue; | |
8872 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8873 partyAction = PARTY_RunForward; | |
8874 else | |
8875 partyAction = PARTY_WalkForward; | |
8876 //goto _add_action_and_continue; | |
8877 v5->Add(partyAction); | |
8878 break; | |
0 | 8879 } |
8880 break; | |
8881 case INPUT_MoveBackwards: | |
17 | 8882 //__debugbreak(); |
271 | 8883 if (pCurrentScreen != SCREEN_GAME) |
0 | 8884 break; |
8885 if (!pParty->bTurnBasedModeOn) | |
17 | 8886 //goto _do_move_backwards; |
8887 { | |
8888 v5 = pActionQueue; | |
8889 if ( pParty->uFlags2 & 2 ) | |
8890 partyAction = PARTY_RunBackward; | |
8891 else | |
8892 partyAction = PARTY_WalkBackward; | |
163 | 8893 //goto _add_action_and_continue; |
8894 v5->Add(partyAction); | |
8895 break; | |
17 | 8896 } |
0 | 8897 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8898 { | |
8899 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8900 //_do_move_backwards: |
0 | 8901 v5 = pActionQueue; |
8902 if ( pParty->uFlags2 & 2 ) | |
8903 partyAction = PARTY_RunBackward; | |
8904 else | |
8905 partyAction = PARTY_WalkBackward; | |
163 | 8906 //goto _add_action_and_continue; |
8907 v5->Add(partyAction); | |
8908 break; | |
0 | 8909 } |
8910 break; | |
8911 case INPUT_StrafeLeft: | |
17 | 8912 //__debugbreak(); |
271 | 8913 if (pCurrentScreen != SCREEN_GAME) |
0 | 8914 break; |
8915 if (!pParty->bTurnBasedModeOn) | |
17 | 8916 //goto _do_strafe_left; |
8917 { | |
8918 partyAction = PARTY_StrafeLeft; | |
163 | 8919 //goto _add_action_and_continue_; |
8920 v5 = pActionQueue; | |
8921 v5->Add(partyAction); | |
8922 break; | |
17 | 8923 } |
0 | 8924 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8925 break; | |
8926 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8927 //_do_strafe_left: |
0 | 8928 partyAction = PARTY_StrafeLeft; |
163 | 8929 //goto _add_action_and_continue_; |
8930 v5 = pActionQueue; | |
8931 v5->Add(partyAction); | |
8932 break; | |
0 | 8933 case INPUT_StrafeRight: |
17 | 8934 //__debugbreak(); |
271 | 8935 if (pCurrentScreen != SCREEN_GAME) |
0 | 8936 break; |
8937 if (!pParty->bTurnBasedModeOn) | |
17 | 8938 //goto _do_strafe_right; |
8939 { | |
8940 partyAction = PARTY_StrafeRight; | |
163 | 8941 //goto _add_action_and_continue_; |
8942 v5 = pActionQueue; | |
8943 v5->Add(partyAction); | |
8944 break; | |
17 | 8945 } |
0 | 8946 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8947 break; | |
8948 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8949 //_do_strafe_right: |
0 | 8950 partyAction = PARTY_StrafeRight; |
163 | 8951 //goto _add_action_and_continue_; |
8952 v5 = pActionQueue; | |
8953 v5->Add(partyAction); | |
8954 break; | |
0 | 8955 case INPUT_TurnLeft: |
271 | 8956 if (pCurrentScreen != SCREEN_GAME) |
0 | 8957 break; |
8958 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
8959 { | |
8960 if (pParty->bTurnBasedModeOn) | |
8961 { | |
8962 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8963 break; | |
8964 pTurnEngine->uActionPointsLeft -= 26; | |
8965 } | |
8966 partyAction_ = PARTY_StrafeLeft; | |
8967 } | |
8968 else | |
8969 { | |
8970 if ( pParty->uFlags2 & 2 ) | |
8971 partyAction_ = PARTY_FastTurnLeft; | |
8972 else | |
8973 partyAction_ = PARTY_TurnLeft; | |
8974 } | |
8975 pActionQueue->Add(partyAction_); | |
8976 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8977 { | |
271 | 8978 pWeather->OnPlayerTurn(10); |
0 | 8979 } |
8980 break; | |
8981 case INPUT_TurnRight: | |
271 | 8982 if (pCurrentScreen != SCREEN_GAME) |
0 | 8983 break; |
8984 if ( GetAsyncKeyState(17) ) // strafing | |
8985 { | |
8986 if (pParty->bTurnBasedModeOn) | |
8987 { | |
8988 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8989 break; | |
8990 pTurnEngine->uActionPointsLeft -= 26; | |
8991 } | |
271 | 8992 v21 = PARTY_StrafeRight; |
0 | 8993 } |
8994 else | |
8995 { | |
8996 if ( pParty->uFlags2 & 2 ) | |
271 | 8997 v21 = PARTY_FastTurnRight; |
0 | 8998 else |
271 | 8999 v21 = PARTY_TurnRight; |
0 | 9000 } |
9001 pActionQueue->Add((PartyAction)v21); | |
9002 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9003 { | |
271 | 9004 pWeather->OnPlayerTurn(-10); |
0 | 9005 } |
9006 break; | |
9007 case INPUT_Jump: | |
17 | 9008 //__debugbreak(); |
271 | 9009 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 9010 break; |
9011 partyAction = (PartyAction)12; | |
163 | 9012 //goto _add_action_and_continue_; |
9013 v5 = pActionQueue; | |
9014 v5->Add(partyAction); | |
9015 break; | |
0 | 9016 case INPUT_Yell: |
187 | 9017 if (!pCurrentScreen && uActiveCharacter) |
0 | 9018 { |
9019 pParty->Yell(); | |
187 | 9020 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 9021 } |
187 | 9022 break; |
0 | 9023 case INPUT_Pass: |
17 | 9024 //__debugbreak(); |
0 | 9025 if ( pCurrentScreen ) |
9026 break; | |
9027 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9028 //goto LABEL_118; |
9029 { | |
9030 pTurnEngine->field_18 |= 8u; | |
9031 break; | |
9032 } | |
0 | 9033 if ( uActiveCharacter ) |
9034 { | |
9035 v6 = pPlayers[uActiveCharacter]; | |
9036 if ( !v6->uTimeToRecovery ) | |
9037 { | |
9038 v24 = v6->GetAttackRecoveryTime(0); | |
9039 if ( !pParty->bTurnBasedModeOn ) | |
9040 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
9041 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
9042 pStru277->_427D48(uActiveCharacter); | |
9043 pTurnEngine->_40471C(); | |
9044 } | |
9045 } | |
9046 break; | |
9047 case INPUT_Combat: | |
17 | 9048 //__debugbreak(); |
271 | 9049 if (pCurrentScreen == SCREEN_GAME) |
0 | 9050 { |
9051 if (pParty->bTurnBasedModeOn) | |
9052 { | |
141 | 9053 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 9054 { |
9055 pParty->bTurnBasedModeOn = 0; | |
9056 pTurnEngine->End(true); | |
9057 } | |
9058 } | |
9059 else | |
9060 { | |
9061 pTurnEngine->Start(); | |
9062 pParty->bTurnBasedModeOn = true; | |
9063 } | |
9064 } | |
9065 break; | |
9066 case INPUT_CastReady: | |
17 | 9067 //__debugbreak(); |
271 | 9068 if (pCurrentScreen != SCREEN_GAME) |
0 | 9069 break; |
9070 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9071 //goto LABEL_118; |
9072 { | |
9073 pTurnEngine->field_18 |= 8u; | |
9074 break; | |
9075 } | |
0 | 9076 if ( !uActiveCharacter ) |
9077 break; | |
9078 v7 = pPlayers[uActiveCharacter]; | |
9079 v8 = v7->uQuickSpell; | |
9080 if ( !v8 | |
9081 || bUnderwater | |
9082 || ((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)), | |
9083 v10 > v7->sMana) ) | |
9084 { | |
9085 pActionQueue = pPartyActionQueue; | |
9086 LABEL_120: | |
271 | 9087 |
0 | 9088 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
9089 { | |
271 | 9090 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; |
163 | 9091 //goto _send_message; |
9092 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9093 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9094 ++pMessageQueue_50CBD0->uNumMessages; | |
9095 break; | |
0 | 9096 } |
9097 } | |
9098 else | |
9099 { | |
9100 pActionQueue = pPartyActionQueue; | |
9101 if ( dword_50C9E8 < 40 ) | |
9102 { | |
9103 dword_50C9EC[3 * dword_50C9E8] = 25; | |
9104 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9105 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9106 ++dword_50C9E8; | |
9107 } | |
9108 } | |
9109 break; | |
9110 case INPUT_Attack: | |
17 | 9111 //__debugbreak(); |
271 | 9112 if (pCurrentScreen != SCREEN_GAME) |
0 | 9113 break; |
9114 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
9115 goto LABEL_120; | |
17 | 9116 //LABEL_118: |
0 | 9117 pTurnEngine->field_18 |= 8u; |
9118 break; | |
9119 case INPUT_EventTrigger: | |
271 | 9120 if (pCurrentScreen == SCREEN_GAME) |
0 | 9121 { |
9122 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9123 break; | |
271 | 9124 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action; |
163 | 9125 //goto _send_message; |
9126 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9127 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9128 ++pMessageQueue_50CBD0->uNumMessages; | |
9129 break; | |
0 | 9130 } |
151 | 9131 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 9132 { |
9133 v11 = pMessageQueue_50CBD0->uNumMessages; | |
9134 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9135 { | |
9136 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9137 { | |
9138 v11 = 1; | |
9139 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 9140 //LABEL_132: |
271 | 9141 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 9142 //_send_message: |
0 | 9143 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9144 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9145 ++pMessageQueue_50CBD0->uNumMessages; | |
9146 break; | |
9147 } | |
9148 v11 = 0; | |
9149 pMessageQueue_50CBD0->uNumMessages = 0; | |
9150 } | |
9151 if ( (signed int)v11 < 40 ) | |
163 | 9152 //goto LABEL_132; |
9153 { | |
271 | 9154 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 9155 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9156 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9157 ++pMessageQueue_50CBD0->uNumMessages; | |
9158 break; | |
9159 } | |
0 | 9160 } |
9161 break; | |
9162 case INPUT_CharCycle: | |
17 | 9163 //__debugbreak(); |
151 | 9164 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 9165 || dword_50C9E8 >= 40 ) |
9166 break; | |
9167 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 9168 //goto LABEL_155; |
9169 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9170 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9171 ++dword_50C9E8; | |
9172 break; | |
0 | 9173 case INPUT_LookUp: |
17 | 9174 //__debugbreak(); |
0 | 9175 if ( pEventTimer->bPaused ) |
9176 break; | |
9177 partyAction = (PartyAction)7; | |
163 | 9178 //goto _add_action_and_continue_; |
9179 v5 = pActionQueue; | |
9180 v5->Add(partyAction); | |
9181 break; | |
0 | 9182 case INPUT_CenterView: |
17 | 9183 //__debugbreak(); |
0 | 9184 if ( pEventTimer->bPaused ) |
9185 break; | |
9186 partyAction = (PartyAction)9; | |
163 | 9187 //goto _add_action_and_continue_; |
9188 v5 = pActionQueue; | |
9189 v5->Add(partyAction); | |
9190 break; | |
0 | 9191 case INPUT_LookDown: |
17 | 9192 //__debugbreak(); |
0 | 9193 if ( pEventTimer->bPaused ) |
9194 break; | |
9195 partyAction = (PartyAction)8; | |
163 | 9196 //goto _add_action_and_continue_; |
9197 v5 = pActionQueue; | |
9198 v5->Add(partyAction); | |
9199 break; | |
0 | 9200 case INPUT_FlyUp: |
17 | 9201 //__debugbreak(); |
0 | 9202 if ( pCurrentScreen |
9203 || pEventTimer->bPaused ) | |
9204 break; | |
9205 partyAction = (PartyAction)13; | |
163 | 9206 //goto _add_action_and_continue_; |
9207 v5 = pActionQueue; | |
9208 v5->Add(partyAction); | |
9209 break; | |
0 | 9210 case INPUT_Land: |
17 | 9211 //__debugbreak(); |
0 | 9212 if ( pCurrentScreen |
9213 || pEventTimer->bPaused ) | |
9214 break; | |
9215 partyAction = (PartyAction)15; | |
163 | 9216 //goto _add_action_and_continue_; |
9217 v5 = pActionQueue; | |
9218 v5->Add(partyAction); | |
9219 break; | |
0 | 9220 case INPUT_FlyDown: |
17 | 9221 //__debugbreak(); |
0 | 9222 if ( !pCurrentScreen |
9223 && !pEventTimer->bPaused ) | |
9224 { | |
9225 partyAction = (PartyAction)14; | |
163 | 9226 //_add_action_and_continue_: |
0 | 9227 v5 = pActionQueue; |
163 | 9228 //_add_action_and_continue: |
0 | 9229 v5->Add(partyAction); |
9230 } | |
9231 break; | |
9232 case INPUT_ZoomIn: | |
17 | 9233 //__debugbreak(); |
0 | 9234 if ( dword_50C9E8 >= 40 ) |
9235 break; | |
9236 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 9237 //goto LABEL_155; |
9238 dword_50C9F0[3 * dword_50C9E8] = 0; | |
9239 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9240 ++dword_50C9E8; | |
9241 break; | |
0 | 9242 case INPUT_ZoomOut: |
17 | 9243 //__debugbreak(); |
0 | 9244 if ( dword_50C9E8 < 40 ) |
9245 { | |
9246 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 9247 //LABEL_155: |
0 | 9248 dword_50C9F0[3 * dword_50C9E8] = 0; |
9249 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0; | |
9250 ++dword_50C9E8; | |
9251 } | |
9252 break; | |
9253 case INPUT_AlwaysRun: | |
9254 bAlwaysRun = bAlwaysRun == 0; | |
9255 break; | |
17 | 9256 default: |
9257 //__debugbreak(); | |
9258 break; | |
0 | 9259 } |
9260 } | |
9261 inputAction = (InputAction)((int)inputAction + 1); | |
9262 if ( (signed int)inputAction >= 30 ) | |
9263 goto LABEL_176; | |
9264 } | |
9265 } | |
9266 v12 = 0; | |
9267 do | |
9268 { | |
9269 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
9270 v13 = pGame->pKeyboardInstance; | |
9271 if ( pKeyActionMap->pToggleTypes[v12] ) | |
9272 v14 = v13->WasKeyPressed(v22); | |
9273 else | |
9274 v14 = v13->IsKeyBeingHeld(v22); | |
9275 if ( v14 && v12 == 9 ) | |
9276 { | |
9277 if ( !pCurrentScreen ) | |
9278 { | |
9279 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
9280 goto LABEL_175; | |
9281 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 9282 //goto LABEL_174; |
9283 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9284 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9285 ++pMessageQueue_50CBD0->uNumMessages; | |
9286 goto LABEL_175; | |
0 | 9287 } |
151 | 9288 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
9289 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 9290 { |
9291 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9292 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9293 { | |
9294 v15 = 0; | |
9295 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9296 { | |
9297 v15 = 1; | |
9298 pMessageQueue_50CBD0->uNumMessages = 1; | |
17 | 9299 //goto LABEL_173; |
9300 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; | |
9301 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9302 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9303 ++pMessageQueue_50CBD0->uNumMessages; | |
9304 goto LABEL_175; | |
0 | 9305 } |
9306 pMessageQueue_50CBD0->uNumMessages = 0; | |
9307 } | |
9308 if ( (signed int)v15 >= 40 ) | |
9309 goto LABEL_175; | |
17 | 9310 //LABEL_173: |
0 | 9311 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9312 //LABEL_174: |
0 | 9313 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9314 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9315 ++pMessageQueue_50CBD0->uNumMessages; | |
9316 goto LABEL_175; | |
9317 } | |
9318 } | |
9319 LABEL_175: | |
9320 ++v12; | |
9321 } | |
9322 while ( v12 < 30 ); | |
9323 LABEL_176: | |
9324 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9325 { | |
9326 AsyncKeyboard::LeaveCriticalSection(); | |
9327 v16 = pAsyncKeyboard; | |
9328 AsyncKeyboard::EnterCriticalSection(); | |
9329 memset((char *)v16 + 521, 0, 0x100u); | |
9330 AsyncKeyboard::LeaveCriticalSection(); | |
9331 } | |
9332 } | |
9333 |