Mercurial > mm7
annotate mm7_6.cpp @ 486:7887a9cf9e7b
Spells
author | Nomad |
---|---|
date | Wed, 27 Feb 2013 17:29:05 +0200 |
parents | 9898e6b413d8 |
children | a3939d5067c4 |
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 |
486 | 2177 //__int16 v6; // bx@4 |
437 | 2178 //Player *v7; // eax@4 |
486 | 2179 //char v8; // zf@12 |
0 | 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 | |
486 | 2186 //stru277 *v15; // esi@27 |
2187 //stru277 *v16; // eax@28 | |
0 | 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 | |
486 | 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 | |
486 | 2216 //v6 = a5; |
437 | 2217 //v7 = &pParty->pPlayers[uPlayerID]; |
2218 assert(uPlayerID < 4); | |
2219 auto player = &pParty->pPlayers[uPlayerID]; | |
0 | 2220 if ( !(a5 & 0x10) ) |
2221 { | |
2222 switch ( a1 ) | |
2223 { | |
486 | 2224 case SPELL_SPIRIT_FATE: |
2225 case SPELL_BODY_FIRST_AID: | |
2226 case SPELL_DARK_REANIMATE: | |
2227 //HIBYTE(v6) = HIBYTE(a5) | 1; | |
2228 a5 |= 0x0100; | |
0 | 2229 break; |
486 | 2230 |
2231 case SPELL_FIRE_FIRE_AURA: | |
2232 case SPELL_WATER_RECHARGE_ITEM: | |
2233 case SPELL_WATER_ENCHANT_ITEM: | |
2234 case SPELL_DARK_VAMPIRIC_WEAPON: | |
2235 //LOBYTE(v6) = a5 | 0x80; | |
2236 a5 |= 0x0080; | |
0 | 2237 break; |
486 | 2238 |
2239 case SPELL_FIRE_FIRE_BOLT: | |
2240 case SPELL_FIRE_FIREBALL: | |
2241 case SPELL_FIRE_INCINERATE: | |
2242 case SPELL_AIR_LIGHNING_BOLT: | |
2243 case SPELL_AIR_IMPLOSION: | |
2244 case SPELL_WATER_POISON_SPRAY: | |
2245 case SPELL_WATER_ICE_BOLT: | |
2246 case SPELL_WATER_ACID_BURST: | |
2247 case SPELL_WATER_ICE_BLAST: | |
2248 case SPELL_EARTH_STUN: | |
2249 case SPELL_EARTH_SLOW: | |
2250 case SPELL_EARTH_DEADLY_SWARM: | |
2251 case SPELL_EARTH_BLADES: | |
2252 case SPELL_EARTH_MASS_DISTORTION: | |
2253 case SPELL_SPIRIT_SPIRIT_LASH: | |
2254 case SPELL_MIND_MIND_BLAST: | |
2255 case SPELL_MIND_CHARM: | |
2256 case SPELL_MIND_PSYCHIC_SHOCK: | |
2257 case SPELL_BODY_HARM: | |
2258 case SPELL_BODY_FLYING_FIST: | |
2259 case SPELL_LIGHT_LIGHT_BOLT: | |
2260 case SPELL_LIGHT_DESTROY_UNDEAD: | |
2261 case SPELL_LIGHT_SUNRAY: | |
2262 case SPELL_DARK_TOXIC_CLOUD: | |
2263 case SPELL_DARK_SHRINKING_RAY: | |
2264 case SPELL_DARK_SHARPMETAL: | |
2265 case SPELL_DARK_DRAGON_BREATH: | |
0 | 2266 if ( !a6 ) |
486 | 2267 a5 |= 0x0008; |
0 | 2268 break; |
486 | 2269 case SPELL_MIND_TELEPATHY: |
2270 case SPELL_MIND_BERSERK: | |
2271 case SPELL_MIND_ENSLAVE: | |
2272 case SPELL_LIGHT_PARALYZE: | |
2273 case SPELL_DARK_CONTROL_UNDEAD: | |
2274 //LABEL_9: | |
2275 //v6 = a5 | 8; | |
2276 a5 |= 0x0008; | |
0 | 2277 break; |
486 | 2278 |
2279 case SPELL_EARTH_TELEKINESIS: | |
2280 a5 |= 0x0040; | |
2281 break; | |
2282 | |
2283 case SPELL_SPIRIT_BLESS: | |
2284 if (a4 && ~a4 & 0x01C0) | |
2285 goto LABEL_25; | |
2286 else if ((player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0); | |
0 | 2287 goto LABEL_25; |
2288 break; | |
486 | 2289 |
2290 case SPELL_SPIRIT_PRESERVATION: | |
0 | 2291 v9 = a4; |
2292 if ( !a4 ) | |
437 | 2293 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT]; |
0 | 2294 goto LABEL_18; |
486 | 2295 |
2296 case SPELL_DARK_PAIN_REFLECTION: | |
0 | 2297 v9 = a4; |
2298 if ( !a4 ) | |
437 | 2299 v9 = player->pActiveSkills[PLAYER_SKILL_DARK]; |
0 | 2300 LABEL_18: |
2301 v10 = SkillToMastery(v9); | |
2302 v12 = __OFSUB__(v10, 3); | |
2303 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2304 goto LABEL_24; | |
486 | 2305 |
2306 case SPELL_BODY_HAMMERHANDS: | |
0 | 2307 v13 = a4; |
2308 if ( !a4 ) | |
437 | 2309 v13 = player->pActiveSkills[PLAYER_SKILL_BODY]; |
0 | 2310 v14 = SkillToMastery(v13); |
2311 v12 = __OFSUB__(v14, 4); | |
2312 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2313 LABEL_24: | |
2314 if ( v11 ^ v12 ) | |
2315 goto LABEL_25; | |
2316 break; | |
486 | 2317 |
2318 case SPELL_EARTH_STONE_TO_FLESH: | |
2319 case SPELL_SPIRIT_REMOVE_CURSE: | |
2320 case SPELL_SPIRIT_RAISE_DEAD: | |
2321 case SPELL_SPIRIT_RESSURECTION: | |
2322 case SPELL_MIND_REMOVE_FEAR: | |
2323 case SPELL_MIND_CURE_PARALYSIS: | |
2324 case SPELL_MIND_CURE_INSANITY: | |
2325 case SPELL_BODY_CURE_WEAKNESS: | |
2326 case SPELL_BODY_REGENERATION: | |
2327 case SPELL_BODY_CURE_POISON: | |
2328 case SPELL_BODY_CURE_DISEASE: | |
0 | 2329 LABEL_25: |
486 | 2330 //v6 = a5 | 2; |
2331 a5 |= 0x0002; | |
0 | 2332 break; |
486 | 2333 |
2334 case SPELL_DARK_SACRIFICE: | |
2335 //HIBYTE(v6) = HIBYTE(a5) | 2; | |
2336 a5 |= 0x0200; | |
0 | 2337 break; |
2338 default: | |
2339 break; | |
2340 } | |
2341 } | |
370 | 2342 |
486 | 2343 |
2344 if (a5 & 0x3CA) | |
0 | 2345 { |
486 | 2346 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); |
2347 for (uint i = 0; i < 10; ++i) | |
2348 if (pStru277[i].field_8 & 0x3CA) | |
2349 { | |
2350 pStru277[i].spellnum = 0; | |
2351 break; | |
2352 } | |
0 | 2353 } |
486 | 2354 |
2355 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); | |
2356 for (uint i = 0; i < 10; ++i) | |
0 | 2357 { |
486 | 2358 auto spell = pStru277 + i; |
2359 if (!spell->spellnum) | |
2360 continue; | |
2361 | |
2362 spell->spellnum = 0; | |
2363 if (spell->field_8 & 0x3CA) | |
0 | 2364 { |
486 | 2365 pGUIWindow_Settings->Release(); |
2366 pGUIWindow_Settings = nullptr; | |
2367 pMouse->SetCursorBitmap("MICON1"); | |
2368 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2369 unk_50C9A0 = 0; | |
2370 back_to_game(); | |
0 | 2371 } |
2372 } | |
486 | 2373 |
2374 int result = pStru277->PushStru277(a1, uPlayerID, a4, a5, a6); | |
0 | 2375 if ( result != -1 ) |
2376 { | |
486 | 2377 if ( a5 & 2 ) |
0 | 2378 { |
2379 if ( pGUIWindow_Settings ) | |
319 | 2380 return; |
0 | 2381 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2382 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2383 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2384 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2385 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
319 | 2386 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2387 return; | |
0 | 2388 } |
486 | 2389 if ( a5 & 8 ) |
0 | 2390 { |
2391 if ( pGUIWindow_Settings ) | |
319 | 2392 return; |
0 | 2393 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2394 v29 = 0; | |
2395 v28 = ""; | |
2396 v27 = 0; | |
2397 v26 = 0; | |
2398 v25 = 70; | |
2399 LABEL_44: | |
2400 v24 = 0; | |
2401 v23 = 1; | |
2402 v22 = 344; | |
2403 v21 = 460; | |
2404 v20 = 8; | |
2405 v19 = 8; | |
2406 pGUIWindow_Settings = v17; | |
2407 v18 = v17; | |
2408 LABEL_56: | |
2409 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
319 | 2410 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2411 return; | |
0 | 2412 } |
486 | 2413 if ( a5 & 0x40 ) |
0 | 2414 { |
2415 if ( pGUIWindow_Settings ) | |
319 | 2416 return; |
0 | 2417 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2418 v29 = 0; | |
2419 v28 = ""; | |
2420 v27 = 0; | |
2421 v26 = 0; | |
2422 v25 = 190; | |
2423 goto LABEL_44; | |
2424 } | |
486 | 2425 if ( (char)a5 < 0 ) |
0 | 2426 { |
2427 if ( pGUIWindow_Settings ) | |
319 | 2428 return; |
0 | 2429 ++pIcons_LOD->uTexturePacksCount; |
2430 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2431 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2432 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2433 unk_50C9A0 = 1; | |
2434 some_active_character = uActiveCharacter; | |
319 | 2435 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2436 return; | |
0 | 2437 } |
486 | 2438 if ( HIBYTE(a5) & 1 ) |
0 | 2439 { |
2440 if ( pGUIWindow_Settings ) | |
319 | 2441 return; |
2442 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
0 | 2443 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); |
2444 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2445 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2446 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
423 | 2447 pGUIWindow_Settings->CreateButton(8, 8, 460, 344, 1, 0, 140, 0, 0, "", NULL); |
2448 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
0 | 2449 } |
486 | 2450 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) |
0 | 2451 { |
319 | 2452 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
0 | 2453 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( |
2454 0x1D5u, | |
2455 0xB2u, | |
319 | 2456 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), |
2457 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
0 | 2458 1, |
2459 0, | |
2460 0xBCu, | |
2461 0, | |
2462 0, | |
2463 "", | |
319 | 2464 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), |
0 | 2465 0); |
2466 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2467 0x272u, | |
2468 0xB2u, | |
319 | 2469 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), |
2470 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
0 | 2471 1, |
2472 0, | |
2473 0xBCu, | |
2474 1u, | |
2475 0, | |
2476 "", | |
319 | 2477 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), |
0 | 2478 0); |
2479 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
319 | 2480 pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0); |
0 | 2481 } |
2482 } | |
2483 } | |
2484 | |
2485 | |
2486 | |
2487 //----- (00427D48) -------------------------------------------------------- | |
2488 void stru277::_427D48(unsigned int uPlayerID) | |
2489 { | |
2490 stru277 *v2; // esi@1 | |
2491 signed int v3; // ebx@1 | |
2492 | |
2493 v2 = this; | |
2494 v3 = 10; | |
2495 do | |
2496 { | |
2497 if ( v2->spellnum ) | |
2498 { | |
2499 if ( v2->field_8 & 0x3CA ) | |
2500 { | |
2501 v2->spellnum = 0; | |
2502 pGUIWindow_Settings->Release(); | |
2503 pGUIWindow_Settings = 0; | |
2504 pMouse->SetCursorBitmap("MICON1"); | |
2505 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2506 unk_50C9A0 = 0; | |
2507 back_to_game(); | |
2508 } | |
2509 } | |
2510 ++v2; | |
2511 --v3; | |
2512 } | |
2513 while ( v3 ); | |
2514 } | |
2515 | |
2516 //----- (00427DA0) -------------------------------------------------------- | |
2517 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6) | |
2518 { | |
2519 unsigned int result; // eax@1 | |
2520 stru277 *v7; // edx@1 | |
2521 stru277 *v8; // ecx@5 | |
2522 | |
2523 result = 0; | |
2524 v7 = this; | |
2525 while ( v7->spellnum ) | |
2526 { | |
2527 ++result; | |
2528 ++v7; | |
2529 if ( (signed int)result >= 10 ) | |
2530 goto LABEL_8; | |
2531 } | |
2532 v8 = &this[result]; | |
2533 v8->spellnum = a2; | |
2534 v8->uPlayerID = uPlayerID; | |
2535 if ( a5 & 0x10 ) | |
2536 v8->uPlayerID_2 = uPlayerID; | |
2537 v8->field_6 = 0; | |
2538 *(int *)&v8->field_C = 0; | |
2539 v8->field_8 = a5; | |
2540 v8->field_A = a4; | |
2541 v8->field_10 = a6; | |
2542 LABEL_8: | |
2543 if ( result == 10 ) | |
2544 result = -1; | |
2545 return result; | |
2546 } | |
2547 | |
2548 //----- (00427E01) -------------------------------------------------------- | |
2549 void stru277::_427E01_cast_spell() | |
2550 { | |
486 | 2551 //int v1; // esi@1 |
0 | 2552 int v2; // edi@1 |
2553 stru277 *v3; // ebx@2 | |
2554 signed int v4; // eax@8 | |
2555 __int16 v5; // ax@9 | |
2556 signed int v6; // eax@14 | |
2557 __int16 v7; // ax@23 | |
2558 __int16 v8; // ax@24 | |
2559 char v9; // al@44 | |
2560 int v10; // eax@45 | |
2561 unsigned __int16 v11; // cx@45 | |
2562 signed int v12; // ecx@48 | |
2563 int v13; // eax@53 | |
2564 unsigned __int8 v14; // zf@53 | |
2565 unsigned int v15; // edx@53 | |
2566 signed int v16; // eax@53 | |
2567 Player *v17; // esi@70 | |
2568 int v18; // eax@72 | |
2569 int v19; // eax@74 | |
2570 char *v20; // eax@74 | |
2571 signed int i; // esi@76 | |
2572 int v22; // eax@88 | |
2573 __int16 v23; // ax@88 | |
2574 int v24; // ecx@93 | |
2575 int v25; // ecx@94 | |
2576 signed __int64 v26; // qax@100 | |
2577 char *v27; // ecx@100 | |
2578 unsigned __int64 v28; // qax@102 | |
2579 int v29; // ecx@105 | |
2580 int v30; // ecx@106 | |
2581 int v31; // eax@112 | |
2582 int v32; // eax@112 | |
2583 char *v33; // edx@113 | |
2584 int v34; // eax@121 | |
2585 int v35; // eax@123 | |
2586 int v36; // edx@125 | |
2587 int v37; // eax@129 | |
2588 signed int v38; // edi@129 | |
2589 signed int v39; // eax@129 | |
2590 int v40; // ecx@129 | |
2591 int v41; // eax@129 | |
2592 signed int v42; // eax@129 | |
2593 int *v43; // ecx@129 | |
2594 int v44; // eax@132 | |
2595 int v45; // ecx@132 | |
2596 int v46; // eax@132 | |
2597 unsigned int v47; // edx@133 | |
2598 int v48; // eax@137 | |
2599 int v49; // eax@137 | |
2600 int v50; // eax@141 | |
2601 int v51; // eax@146 | |
2602 __int16 v52; // ax@153 | |
2603 int v53; // eax@153 | |
2604 signed __int64 v54; // qax@164 | |
2605 int v55; // edi@164 | |
2606 stru6 *v56; // eax@165 | |
2607 int v57; // eax@169 | |
2608 signed __int64 v58; // qax@177 | |
2609 int v59; // edi@177 | |
2610 unsigned __int16 v60; // ax@184 | |
2611 int v61; // ecx@184 | |
2612 int v62; // eax@186 | |
2613 int v63; // ecx@187 | |
2614 int v64; // ecx@188 | |
2615 int v65; // ecx@189 | |
2616 const char *v66; // ecx@200 | |
2617 unsigned int v67; // edx@201 | |
2618 char v68; // al@207 | |
89 | 2619 ItemGen *v69; // esi@211 |
0 | 2620 int v70; // ecx@214 |
2621 int v71; // ecx@215 | |
2622 int v72; // ecx@216 | |
2623 __int16 v73; // ST1C_2@222 | |
2624 __int16 v74; // ST18_2@222 | |
2625 stru6 *v75; // eax@222 | |
2626 int v76; // ecx@223 | |
2627 int v77; // ecx@224 | |
2628 int v78; // ecx@225 | |
2629 int v79; // eax@227 | |
2630 int v80; // eax@232 | |
2631 __int16 v81; // ST18_2@245 | |
2632 stru6 *v82; // eax@245 | |
2633 signed int v83; // edi@245 | |
2634 __int16 v84; // ST18_2@245 | |
2635 stru6 *v85; // eax@245 | |
2636 __int16 v86; // ST18_2@245 | |
2637 stru6 *v87; // eax@245 | |
2638 __int16 v88; // ST18_2@245 | |
2639 stru6 *v89; // eax@245 | |
2640 double v90; // st7@245 | |
2641 int v91; // eax@250 | |
89 | 2642 Player *v92; // eax@255 |
0 | 2643 __int16 v93; // ST18_2@260 |
2644 stru6 *v94; // eax@260 | |
2645 __int16 v95; // ST18_2@260 | |
2646 stru6 *v96; // eax@260 | |
2647 __int16 v97; // ST18_2@260 | |
2648 stru6 *v98; // eax@260 | |
2649 __int16 v99; // ST18_2@260 | |
2650 stru6 *v100; // eax@260 | |
2651 int v101; // ecx@261 | |
2652 int v102; // ecx@262 | |
2653 int v103; // ecx@263 | |
2654 int v104; // eax@265 | |
2655 int v105; // edi@271 | |
2656 __int16 v106; // ST18_2@272 | |
2657 stru6 *v107; // eax@272 | |
2658 __int16 v108; // ST1C_2@274 | |
2659 __int16 v109; // ST18_2@274 | |
2660 stru6 *v110; // eax@274 | |
2661 int v111; // eax@274 | |
2662 Actor *v112; // esi@278 | |
2663 int v113; // eax@278 | |
2664 int v114; // ebx@278 | |
2665 unsigned int v115; // ecx@278 | |
2666 int v116; // edx@279 | |
2667 int v117; // edx@281 | |
2668 int v118; // edx@283 | |
2669 int v119; // edi@286 | |
2670 int v120; // eax@286 | |
2671 int v121; // eax@286 | |
2672 signed int v122; // eax@286 | |
2673 int v123; // ecx@288 | |
2674 int v124; // ecx@289 | |
2675 int v125; // ecx@290 | |
2676 int v126; // eax@292 | |
2677 int v127; // eax@296 | |
2678 __int16 v128; // ST18_2@303 | |
2679 stru6 *v129; // eax@303 | |
2680 __int16 v130; // ST18_2@303 | |
2681 stru6 *v131; // eax@303 | |
2682 __int16 v132; // ST18_2@303 | |
2683 stru6 *v133; // eax@303 | |
2684 __int16 v134; // ST18_2@303 | |
2685 stru6 *v135; // eax@303 | |
2686 unsigned __int64 v136; // qax@304 | |
2687 char *v137; // ecx@304 | |
2688 int v138; // ecx@305 | |
2689 int v139; // ecx@306 | |
2690 int v140; // eax@308 | |
2691 __int16 v141; // ST18_2@311 | |
2692 stru6 *v142; // eax@311 | |
2693 __int16 v143; // ST18_2@311 | |
2694 stru6 *v144; // eax@311 | |
2695 __int16 v145; // ST18_2@311 | |
2696 stru6 *v146; // eax@311 | |
2697 __int16 v147; // ST18_2@311 | |
2698 stru6 *v148; // eax@311 | |
2699 int v149; // ecx@312 | |
2700 int v150; // ecx@313 | |
2701 int v151; // ecx@314 | |
2702 signed int v152; // eax@322 | |
2703 int v153; // ecx@322 | |
2704 int v154; // eax@322 | |
2705 int v155; // eax@323 | |
2706 int v156; // eax@323 | |
2707 int v157; // eax@326 | |
2708 double v158; // st7@326 | |
2709 double v159; // st6@326 | |
2710 signed __int64 v160; // qtt@334 | |
2711 int v161; // eax@339 | |
2712 int v162; // edi@340 | |
2713 int v163; // eax@340 | |
2714 signed int v164; // eax@340 | |
2715 signed int v165; // edi@340 | |
2716 stru6 *v166; // eax@340 | |
2717 stru6 *v167; // eax@340 | |
2718 signed int v168; // edi@343 | |
2719 int v169; // eax@344 | |
2720 int v170; // ecx@346 | |
2721 int v171; // ecx@347 | |
2722 int v172; // ecx@348 | |
2723 int v173; // edi@350 | |
2724 signed int v174; // edi@355 | |
2725 __int16 v175; // ST18_2@357 | |
2726 stru6 *v176; // eax@357 | |
2727 __int16 v177; // ST18_2@357 | |
2728 stru6 *v178; // eax@357 | |
2729 __int16 v179; // ST18_2@357 | |
2730 stru6 *v180; // eax@357 | |
2731 __int16 v181; // ST18_2@357 | |
2732 stru6 *v182; // eax@357 | |
2733 signed __int64 v183; // qax@357 | |
2734 int v184; // ecx@358 | |
2735 int v185; // ecx@359 | |
2736 int v186; // ecx@360 | |
2737 int v187; // eax@367 | |
2738 int v188; // esi@369 | |
2739 int v189; // edi@369 | |
2740 const char *v190; // ecx@377 | |
2741 signed int v191; // edi@379 | |
2742 int v192; // ecx@382 | |
2743 int v193; // ecx@383 | |
2744 int v194; // ecx@384 | |
2745 int v195; // eax@386 | |
2746 int v196; // eax@387 | |
2747 __int16 v197; // ST18_2@395 | |
2748 stru6 *v198; // eax@395 | |
2749 __int16 v199; // ST18_2@395 | |
2750 stru6 *v200; // eax@395 | |
2751 __int16 v201; // ST18_2@395 | |
2752 stru6 *v202; // eax@395 | |
2753 __int16 v203; // ST18_2@395 | |
2754 stru6 *v204; // eax@395 | |
2755 signed int v205; // edi@405 | |
2756 int v206; // eax@407 | |
2757 __int16 v207; // cx@407 | |
2758 int v208; // eax@411 | |
2759 signed int v209; // ecx@412 | |
2760 int v210; // edx@412 | |
2761 signed int v211; // ecx@412 | |
2762 int v212; // eax@413 | |
2763 int v213; // eax@413 | |
2764 int v214; // eax@413 | |
2765 int v215; // eax@415 | |
2766 double v216; // st7@415 | |
2767 double v217; // st6@415 | |
2768 signed __int64 v218; // qtt@423 | |
2769 int v219; // ecx@425 | |
2770 int v220; // ecx@426 | |
2771 int v221; // edi@428 | |
2772 char *v222; // edi@434 | |
2773 char v223; // al@438 | |
2774 int v224; // ecx@442 | |
2775 int v225; // ecx@443 | |
2776 int v226; // eax@451 | |
2777 int v227; // esi@453 | |
2778 unsigned int v228; // edi@454 | |
2779 int v229; // edi@466 | |
2780 __int16 v230; // ST18_2@469 | |
2781 stru6 *v231; // eax@469 | |
2782 signed int v232; // esi@469 | |
2783 __int16 v233; // ST18_2@469 | |
2784 stru6 *v234; // eax@469 | |
2785 __int16 v235; // ST18_2@469 | |
2786 stru6 *v236; // eax@469 | |
2787 __int16 v237; // ST18_2@469 | |
2788 stru6 *v238; // eax@469 | |
2789 __int16 v239; // ST1C_2@469 | |
2790 char *v240; // ecx@472 | |
2791 double v241; // st7@478 | |
2792 signed __int64 v242; // qax@484 | |
2793 char *v243; // ecx@484 | |
2794 char *v244; // eax@488 | |
2795 int v245; // edi@492 | |
2796 int v246; // eax@492 | |
2797 char *v247; // eax@497 | |
2798 char v248; // al@497 | |
2799 char v249; // cf@500 | |
2800 float v250; // esi@507 | |
2801 char v251; // al@507 | |
2802 int v252; // edx@510 | |
2803 int m; // esi@510 | |
2804 int v254; // eax@513 | |
2805 int v255; // esi@513 | |
2806 int v256; // ecx@513 | |
2807 int v257; // edx@514 | |
2808 int v258; // ecx@514 | |
2809 char v259; // al@516 | |
2810 int v260; // eax@518 | |
2811 int v261; // esi@519 | |
2812 int v262; // edx@521 | |
2813 int v263; // ecx@521 | |
2814 int v264; // esi@521 | |
2815 int v265; // edx@521 | |
2816 int *ii; // eax@522 | |
2817 int v267; // eax@524 | |
2818 int v268; // eax@524 | |
2819 int v269; // eax@526 | |
2820 char *v270; // eax@531 | |
2821 char v271; // al@531 | |
2822 char v272; // cf@534 | |
2823 float v273; // esi@541 | |
2824 char v274; // al@541 | |
2825 int v275; // edx@544 | |
2826 int k; // esi@544 | |
2827 int v277; // edx@548 | |
2828 int v278; // ecx@548 | |
2829 char v279; // al@550 | |
2830 int v280; // eax@552 | |
2831 int v281; // esi@553 | |
2832 int v282; // edx@555 | |
2833 int v283; // ecx@555 | |
2834 int v284; // esi@555 | |
2835 int v285; // edx@555 | |
2836 int *l; // eax@556 | |
2837 int v287; // eax@558 | |
2838 int v288; // eax@558 | |
2839 ItemGen *v289; // eax@560 | |
2840 signed int v290; // eax@560 | |
2841 unsigned __int8 v291; // al@564 | |
2842 char v292; // al@573 | |
2843 int v293; // eax@575 | |
2844 ItemGen *v294; // esi@575 | |
2845 int v295; // edx@575 | |
2846 int kk; // edi@575 | |
2847 int v297; // edx@579 | |
2848 int v298; // ecx@579 | |
2849 char v299; // al@581 | |
2850 int v300; // eax@583 | |
2851 int v301; // edi@584 | |
2852 int v302; // edx@586 | |
2853 int v303; // ecx@586 | |
2854 int v304; // edi@586 | |
2855 int v305; // edx@586 | |
2856 int *jj; // eax@587 | |
2857 int v307; // eax@589 | |
2858 int v308; // eax@589 | |
2859 char *v309; // ecx@593 | |
2860 char v310; // sf@593 | |
2861 unsigned __int8 v311; // of@593 | |
2862 char v312; // cl@597 | |
2863 char v313; // al@606 | |
2864 int v314; // edx@607 | |
2865 int j; // esi@607 | |
2866 unsigned int v316; // eax@613 | |
2867 const char *v317; // ecx@617 | |
2868 Player *v318; // ecx@619 | |
2869 unsigned int v319; // edi@627 | |
2870 int v320; // ecx@629 | |
2871 int v321; // ecx@630 | |
2872 int v322; // edi@632 | |
2873 int v323; // edi@635 | |
2874 char *v324; // eax@635 | |
2875 Player *v325; // ecx@640 | |
2876 int v326; // eax@643 | |
2877 int v327; // eax@648 | |
2878 int v328; // ecx@651 | |
2879 int v329; // ecx@652 | |
2880 int v330; // edi@654 | |
2881 __int16 v331; // ST18_2@658 | |
2882 stru6 *v332; // eax@658 | |
2883 __int16 v333; // ST18_2@658 | |
2884 stru6 *v334; // eax@658 | |
2885 __int16 v335; // ST18_2@658 | |
2886 stru6 *v336; // eax@658 | |
2887 __int16 v337; // ST18_2@658 | |
2888 stru6 *v338; // eax@658 | |
2889 int v339; // ecx@659 | |
2890 int v340; // ecx@660 | |
2891 int v341; // eax@663 | |
2892 signed int v342; // edi@668 | |
2893 signed int v343; // edi@670 | |
2894 unsigned __int64 v344; // ST08_8@670 | |
2895 __int16 v345; // ST1C_2@671 | |
2896 __int16 v346; // ST18_2@671 | |
2897 stru6 *v347; // eax@671 | |
2898 int v348; // ecx@672 | |
2899 int v349; // ecx@673 | |
2900 int v350; // edi@676 | |
2901 Player *v351; // edi@680 | |
2902 __int16 v352; // ST18_2@685 | |
2903 stru6 *v353; // eax@685 | |
2904 int v354; // ecx@686 | |
2905 int v355; // ecx@687 | |
2906 int v356; // eax@689 | |
112 | 2907 Player *v357; // edi@694 |
0 | 2908 unsigned __int16 v358; // ST1C_2@695 |
2909 __int16 v359; // ST18_2@695 | |
2910 stru6 *v360; // eax@695 | |
2911 __int16 v361; // ST1C_2@697 | |
2912 __int16 v362; // ST18_2@697 | |
2913 stru6 *v363; // eax@697 | |
2914 int v364; // ecx@698 | |
2915 int v365; // ecx@699 | |
2916 int v366; // eax@701 | |
2917 stru6 *v367; // eax@704 | |
2918 int v368; // eax@704 | |
2919 Actor *v369; // edi@705 | |
2920 int v370; // eax@706 | |
2921 int v371; // ecx@709 | |
2922 int v372; // ecx@710 | |
2923 int v373; // eax@715 | |
2924 int v374; // eax@717 | |
112 | 2925 Player *v375; // edi@717 |
0 | 2926 int v376; // eax@717 |
2927 Player *v377; // ecx@719 | |
2928 int v378; // ecx@721 | |
2929 int v379; // ecx@722 | |
2930 int v380; // eax@724 | |
2931 int v381; // edi@727 | |
2932 int v382; // ecx@727 | |
2933 Player *v383; // eax@728 | |
2934 int v384; // eax@733 | |
2935 int v385; // edi@736 | |
2936 signed int v386; // eax@736 | |
2937 Player *v387; // edi@738 | |
2938 int v388; // edi@740 | |
2939 unsigned __int16 v389; // ST1C_2@740 | |
2940 __int16 v390; // ST18_2@740 | |
2941 stru6 *v391; // eax@740 | |
2942 int v392; // ecx@742 | |
2943 int v393; // ecx@743 | |
2944 int v394; // ecx@744 | |
2945 int v395; // edi@747 | |
2946 int v396; // eax@752 | |
2947 int v397; // eax@757 | |
2948 int v398; // eax@757 | |
2949 int v399; // eax@757 | |
2950 char *v400; // esi@757 | |
2951 Game *v401; // ecx@759 | |
2952 __int16 v402; // ST1C_2@759 | |
2953 __int16 v403; // ST18_2@759 | |
2954 stru6 *v404; // eax@759 | |
2955 int v405; // ecx@761 | |
2956 int v406; // ecx@762 | |
2957 int v407; // edi@765 | |
2958 __int16 v408; // ST1C_2@769 | |
2959 __int16 v409; // ST18_2@769 | |
2960 stru6 *v410; // eax@769 | |
2961 int v411; // ecx@772 | |
2962 int v412; // ecx@773 | |
2963 int v413; // edi@775 | |
2964 __int16 v414; // ST1C_2@781 | |
2965 __int16 v415; // ST18_2@781 | |
2966 stru6 *v416; // eax@781 | |
2967 int v417; // eax@787 | |
2968 int v418; // ecx@789 | |
2969 __int16 v419; // ax@791 | |
2970 signed int v420; // eax@793 | |
2971 int v421; // edx@793 | |
2972 const char *v422; // eax@801 | |
2973 int v423; // ecx@808 | |
2974 int v424; // ecx@809 | |
2975 int v425; // eax@811 | |
2976 signed int v426; // eax@815 | |
2977 signed int v427; // eax@820 | |
2978 int v428; // ecx@825 | |
2979 int v429; // ecx@826 | |
2980 int v430; // eax@828 | |
2981 stru6 *v431; // eax@831 | |
2982 int v432; // eax@831 | |
2983 Actor *v433; // edi@832 | |
2984 int v434; // eax@833 | |
2985 int v435; // ecx@837 | |
2986 int v436; // ecx@838 | |
2987 __int16 v437; // ST1C_2@843 | |
2988 __int16 v438; // ST18_2@843 | |
2989 stru6 *v439; // eax@843 | |
2990 int v440; // eax@843 | |
2991 int v441; // eax@847 | |
2992 int v442; // ecx@850 | |
2993 int v443; // ecx@851 | |
2994 int v444; // eax@853 | |
2995 signed int v445; // edi@857 | |
2996 int v446; // ecx@862 | |
2997 LevelDecoration *v447; // edi@864 | |
2998 __int16 v448; // ax@864 | |
2999 char *v449; // esi@870 | |
3000 int v450; // eax@870 | |
3001 int v451; // ecx@875 | |
3002 int v452; // ecx@876 | |
3003 int v453; // edi@878 | |
3004 __int16 v454; // ST1C_2@884 | |
3005 __int16 v455; // ST18_2@884 | |
3006 stru6 *v456; // eax@884 | |
3007 int v457; // ecx@887 | |
3008 int v458; // ecx@888 | |
3009 int v459; // eax@890 | |
3010 signed int v460; // eax@895 | |
3011 Actor *v461; // eax@897 | |
3012 unsigned __int16 v462; // cx@897 | |
3013 signed int v463; // edx@897 | |
3014 int v464; // ecx@905 | |
3015 int v465; // ecx@906 | |
3016 int v466; // edi@909 | |
3017 __int16 v467; // ST1C_2@913 | |
3018 __int16 v468; // ST18_2@913 | |
3019 stru6 *v469; // eax@913 | |
3020 int v470; // edi@913 | |
3021 int v471; // eax@917 | |
3022 int v472; // eax@917 | |
3023 char *v473; // esi@918 | |
3024 __int16 v474; // ST18_2@920 | |
3025 stru6 *v475; // eax@920 | |
3026 __int16 v476; // ST18_2@920 | |
3027 stru6 *v477; // eax@920 | |
3028 __int16 v478; // ST18_2@920 | |
3029 stru6 *v479; // eax@920 | |
3030 __int16 v480; // ST18_2@920 | |
3031 stru6 *v481; // eax@920 | |
3032 __int16 v482; // ST18_2@923 | |
3033 stru6 *v483; // eax@923 | |
3034 __int16 v484; // ST18_2@923 | |
3035 stru6 *v485; // eax@923 | |
3036 __int16 v486; // ST18_2@923 | |
3037 stru6 *v487; // eax@923 | |
3038 __int16 v488; // ST18_2@923 | |
3039 stru6 *v489; // eax@923 | |
3040 __int16 v490; // ST1C_2@924 | |
3041 __int16 v491; // ST18_2@924 | |
3042 stru6 *v492; // eax@924 | |
3043 int v493; // ecx@925 | |
3044 int v494; // ecx@926 | |
3045 __int16 v495; // ST1C_2@931 | |
3046 __int16 v496; // ST18_2@931 | |
3047 stru6 *v497; // eax@931 | |
3048 int v498; // edi@931 | |
3049 int v499; // eax@935 | |
3050 int v500; // eax@935 | |
3051 Player *v501; // edi@939 | |
3052 __int16 v502; // ST18_2@940 | |
3053 stru6 *v503; // eax@940 | |
3054 stru6 *v504; // eax@943 | |
3055 int v505; // eax@943 | |
3056 int v506; // eax@943 | |
3057 int v507; // edi@944 | |
3058 int v508; // eax@944 | |
3059 signed int v509; // eax@944 | |
3060 signed int v510; // edi@944 | |
3061 Actor *v511; // edi@946 | |
3062 int v512; // eax@946 | |
3063 SpellBuff *v513; // edi@946 | |
3064 int v514; // ecx@950 | |
3065 int v515; // ecx@951 | |
3066 int v516; // eax@953 | |
3067 int v517; // eax@956 | |
90 | 3068 Actor *v518; // edx@957 |
0 | 3069 __int16 v519; // cx@958 |
3070 int v520; // ecx@968 | |
3071 int v521; // ecx@969 | |
3072 int v522; // eax@971 | |
3073 __int16 v523; // ST18_2@975 | |
3074 stru6 *v524; // eax@975 | |
3075 __int16 v525; // ST18_2@975 | |
3076 stru6 *v526; // eax@975 | |
3077 __int16 v527; // ST18_2@975 | |
3078 stru6 *v528; // eax@975 | |
3079 __int16 v529; // ST18_2@975 | |
3080 stru6 *v530; // eax@975 | |
3081 int v531; // eax@982 | |
3082 int v532; // eax@982 | |
3083 int v533; // edi@983 | |
3084 int v534; // eax@983 | |
3085 signed int v535; // eax@983 | |
3086 signed int v536; // edi@983 | |
3087 stru6 *v537; // eax@984 | |
3088 int v538; // ecx@985 | |
3089 int v539; // ecx@986 | |
3090 int v540; // eax@988 | |
3091 __int16 v541; // ST18_2@991 | |
3092 stru6 *v542; // eax@991 | |
3093 __int16 v543; // ST18_2@991 | |
3094 stru6 *v544; // eax@991 | |
3095 __int16 v545; // ST18_2@991 | |
3096 stru6 *v546; // eax@991 | |
3097 __int16 v547; // ST18_2@991 | |
3098 stru6 *v548; // eax@991 | |
3099 double v549; // st7@991 | |
3100 unsigned __int16 v550; // di@991 | |
3101 int v551; // ecx@993 | |
3102 int v552; // ecx@994 | |
89 | 3103 Player *v553; // edi@1001 |
0 | 3104 __int16 v554; // ST18_2@1002 |
3105 stru6 *v555; // eax@1002 | |
3106 __int16 v556; // ST18_2@1002 | |
3107 stru6 *v557; // eax@1002 | |
3108 __int16 v558; // ST18_2@1002 | |
3109 stru6 *v559; // eax@1002 | |
3110 __int16 v560; // ST18_2@1002 | |
3111 stru6 *v561; // eax@1002 | |
3112 unsigned __int16 v562; // di@1005 | |
3113 signed int v563; // eax@1010 | |
3114 unsigned int v564; // ecx@1011 | |
3115 signed int v565; // eax@1012 | |
3116 Player **v566; // ecx@1012 | |
3117 int v567; // eax@1012 | |
3118 unsigned __int16 v568; // ST1C_2@1012 | |
3119 __int16 v569; // ST18_2@1012 | |
3120 stru6 *v570; // eax@1012 | |
3121 Player *v571; // eax@1013 | |
3122 char *v572; // ecx@1013 | |
3123 int v573; // ecx@1017 | |
3124 int v574; // ecx@1018 | |
3125 int v575; // eax@1020 | |
3126 signed int v576; // eax@1025 | |
3127 Player *v577; // eax@1026 | |
3128 int v578; // eax@1028 | |
3129 __int16 v579; // ax@1029 | |
3130 int v580; // eax@1031 | |
3131 int v581; // edi@1031 | |
3132 int v582; // eax@1031 | |
3133 __int16 v583; // ST1C_2@1034 | |
3134 __int16 v584; // ST18_2@1034 | |
3135 char *v585; // esi@1034 | |
3136 stru6 *v586; // eax@1034 | |
3137 signed int v587; // eax@1035 | |
3138 int v588; // ecx@1036 | |
3139 int v589; // ecx@1037 | |
3140 int v590; // ecx@1038 | |
3141 char v591; // al@1048 | |
3142 int v592; // esi@1052 | |
3143 int v593; // ecx@1057 | |
3144 int v594; // ecx@1058 | |
3145 int v595; // eax@1064 | |
3146 int v596; // esi@1066 | |
3147 unsigned int v597; // edi@1067 | |
3148 int v598; // eax@1079 | |
3149 signed int v599; // eax@1082 | |
3150 int v600; // edi@1086 | |
3151 int v601; // edx@1086 | |
3152 int v602; // eax@1086 | |
3153 int v603; // ecx@1086 | |
3154 int v604; // eax@1087 | |
3155 char *v605; // eax@1089 | |
3156 int v606; // edx@1091 | |
3157 int v607; // ecx@1100 | |
3158 __int16 v608; // ax@1102 | |
3159 signed int v609; // eax@1104 | |
3160 int v610; // edi@1106 | |
3161 unsigned int v611; // eax@1106 | |
89 | 3162 Player *v612; // edi@1106 |
3163 DDM_DLV_Header *v613; // eax@1108 | |
0 | 3164 int v614; // eax@1116 |
3165 int v615; // edi@1119 | |
3166 __int16 v616; // ST1C_2@1122 | |
3167 __int16 v617; // ST18_2@1122 | |
3168 stru6 *v618; // eax@1122 | |
112 | 3169 Player *v619; // edi@1123 |
0 | 3170 unsigned __int16 v620; // ST1C_2@1124 |
3171 __int16 v621; // ST18_2@1124 | |
3172 stru6 *v622; // eax@1124 | |
3173 signed __int64 v623; // qax@1127 | |
3174 int v624; // eax@1127 | |
3175 int v625; // edi@1129 | |
3176 int v626; // eax@1129 | |
3177 signed int v627; // eax@1129 | |
3178 signed int v628; // edi@1129 | |
3179 int v629; // ecx@1130 | |
3180 Player *v630; // eax@1131 | |
3181 int v631; // eax@1137 | |
3182 int v632; // edi@1140 | |
3183 Player *v633; // eax@1140 | |
3184 signed int v634; // eax@1140 | |
3185 int v635; // edi@1142 | |
3186 unsigned __int16 v636; // ST1C_2@1142 | |
3187 __int16 v637; // ST18_2@1142 | |
3188 stru6 *v638; // eax@1142 | |
3189 stru6 *v639; // eax@1143 | |
3190 int v640; // ecx@1146 | |
3191 int v641; // ecx@1147 | |
3192 int v642; // edi@1156 | |
3193 int v643; // eax@1156 | |
3194 int v644; // eax@1156 | |
3195 signed int v645; // eax@1158 | |
3196 Player *v646; // ebx@1169 | |
3197 int v647; // edi@1169 | |
3198 signed int v648; // ST1C_4@1170 | |
3199 Player *v649; // ecx@1170 | |
3200 unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3201 unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3202 unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3203 unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
3204 int v654; // [sp-4h] [bp-E88h]@124 | |
3205 unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 | |
3206 unsigned int v656; // [sp-4h] [bp-E88h]@639 | |
3207 int v657; // [sp-4h] [bp-E88h]@807 | |
3208 int v658; // [sp+0h] [bp-E84h]@100 | |
3209 int v659; // [sp+0h] [bp-E84h]@123 | |
3210 int v660; // [sp+0h] [bp-E84h]@146 | |
3211 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
3212 int v662; // [sp+0h] [bp-E84h]@304 | |
3213 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 | |
3214 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3215 int v665; // [sp+0h] [bp-E84h]@807 | |
3216 int v666; // [sp+4h] [bp-E80h]@12 | |
3217 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
3218 unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 | |
3219 int v669; // [sp+4h] [bp-E80h]@123 | |
3220 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3221 int v671; // [sp+4h] [bp-E80h]@146 | |
3222 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
3223 unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 | |
3224 __int16 v674; // [sp+4h] [bp-E80h]@684 | |
3225 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3226 int v676; // [sp+4h] [bp-E80h]@807 | |
3227 int v677; // [sp+4h] [bp-E80h]@861 | |
3228 int v678; // [sp+4h] [bp-E80h]@997 | |
3229 int v679; // [sp+14h] [bp-E70h]@515 | |
3230 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3231 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3232 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3233 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3234 int v684; // [sp+D04h] [bp-180h]@416 | |
3235 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3236 int x; // [sp+D20h] [bp-164h]@327 | |
3237 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3238 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3239 int v689; // [sp+D30h] [bp-154h]@943 | |
3240 int v690; // [sp+D34h] [bp-150h]@943 | |
3241 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3242 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3243 int v693; // [sp+D40h] [bp-144h]@137 | |
3244 int v694; // [sp+D44h] [bp-140h]@982 | |
3245 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3246 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3247 int v697; // [sp+D50h] [bp-134h]@129 | |
3248 int v698; // [sp+D54h] [bp-130h]@129 | |
3249 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3250 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3251 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3252 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3253 int v703; // [sp+D70h] [bp-114h]@286 | |
3254 int v704; // [sp+D74h] [bp-110h]@132 | |
3255 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3256 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3257 int v707; // [sp+D80h] [bp-104h]@1127 | |
3258 int v708; // [sp+D84h] [bp-100h]@1127 | |
3259 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3260 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3261 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3262 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3263 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3264 int n; // [sp+DA0h] [bp-E4h]@1 | |
3265 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3266 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3267 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3268 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3269 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3270 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3271 int v721; // [sp+DD8h] [bp-ACh]@163 | |
3272 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3273 int v723; // [sp+E4Ch] [bp-38h]@1 | |
3274 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3275 float v725; // [sp+E54h] [bp-30h]@23 | |
3276 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3277 int v726b; |
0 | 3278 float v727; // [sp+E5Ch] [bp-28h]@1 |
3279 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3280 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3281 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3282 Player *v730b; |
3283 ItemGen *v730c; | |
0 | 3284 int v731; // [sp+E6Ch] [bp-18h]@48 |
3285 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3286 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3287 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3288 int amount; // [sp+E80h] [bp-4h]@1 | |
3289 | |
3290 auto ecx0 = this; | |
3291 | |
3292 v711 = ecx0; | |
3293 | |
3294 LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | |
3295 //LayingItem::LayingItem(&a1); | |
3296 | |
486 | 3297 //v1 = 0; |
0 | 3298 v2 = 0; |
3299 amount = 0; | |
3300 LODWORD(v733) = 0; | |
3301 v723 = 0; | |
3302 v727 = 0.0; | |
3303 n = 0; | |
3304 while ( 1 ) | |
3305 { | |
3306 v3 = &v711[n]; | |
3307 HIDWORD(v733) = (int)v3; | |
486 | 3308 if ( v3->spellnum == 0 ) |
0 | 3309 goto LABEL_1166; |
486 | 3310 |
3311 if (pParty->Invisible()) | |
3312 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
3313 | |
0 | 3314 if ( v3->field_8 & 0x3CA ) |
3315 { | |
3316 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3317 v711->_427D48(1u); | |
3318 goto LABEL_1166; | |
3319 } | |
3320 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
3321 v4 = *(int *)&v3->field_C; | |
486 | 3322 if (v4) |
0 | 3323 goto LABEL_18; |
3324 v5 = v3->spellnum; | |
3325 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) | |
3326 v666 = 1; | |
3327 else | |
486 | 3328 v666 = 0; |
271 | 3329 a2 = stru_50C198.FindClosestActor(5120, 1, v666); |
0 | 3330 v6 = pMouse->uPointingObjectID; |
486 | 3331 if ( pMouse->uPointingObjectID && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) |
0 | 3332 { |
3333 v4 = pMouse->uPointingObjectID; | |
3334 LABEL_18: | |
3335 a2 = v4; | |
3336 } | |
3337 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; | |
486 | 3338 if (a1.uItemType) |
0 | 3339 { |
141 | 3340 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3341 { |
141 | 3342 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3343 v2 = v723; |
486 | 3344 //v1 = 0; |
0 | 3345 } |
3346 else | |
3347 { | |
3348 v715.uYawAngle = pParty->sRotationY; | |
3349 v715.uPitchAngle = pParty->sRotationX; | |
3350 } | |
3351 } | |
3352 v7 = v3->field_A; | |
486 | 3353 LODWORD(v725) = 0; |
3354 _this = 0; | |
3355 if (!v7) | |
0 | 3356 { |
3357 v8 = v3->spellnum; | |
3358 if ( v3->spellnum >= 12 ) | |
3359 { | |
3360 if ( v8 >= 23 ) | |
3361 { | |
3362 if ( v8 >= 34 ) | |
3363 { | |
3364 if ( v8 >= 45 ) | |
3365 { | |
3366 if ( v8 >= 56 ) | |
3367 { | |
3368 if ( v8 >= 67 ) | |
3369 { | |
3370 if ( v8 >= 78 ) | |
3371 { | |
3372 if ( v8 >= 89 ) | |
3373 { | |
3374 if ( v8 >= 100 ) | |
3375 { | |
3376 if ( v8 != 100 ) | |
3377 { | |
3378 LABEL_45: | |
3379 HIWORD(v10) = HIWORD(pPlayer); | |
3380 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
3381 goto LABEL_47; | |
3382 } | |
3383 v667 = (PLAYER_SKILL_TYPE)5; | |
3384 } | |
3385 else | |
3386 { | |
3387 v667 = (PLAYER_SKILL_TYPE)20; | |
3388 } | |
3389 } | |
3390 else | |
3391 { | |
3392 v667 = (PLAYER_SKILL_TYPE)19; | |
3393 } | |
3394 } | |
3395 else | |
3396 { | |
3397 v667 = (PLAYER_SKILL_TYPE)18; | |
3398 } | |
3399 } | |
3400 else | |
3401 { | |
3402 v667 = (PLAYER_SKILL_TYPE)17; | |
3403 } | |
3404 } | |
3405 else | |
3406 { | |
3407 v667 = (PLAYER_SKILL_TYPE)16; | |
3408 } | |
3409 } | |
3410 else | |
3411 { | |
3412 v667 = (PLAYER_SKILL_TYPE)15; | |
3413 } | |
3414 } | |
3415 else | |
3416 { | |
3417 v667 = (PLAYER_SKILL_TYPE)14; | |
3418 } | |
3419 } | |
3420 else | |
3421 { | |
3422 v667 = (PLAYER_SKILL_TYPE)13; | |
3423 } | |
3424 } | |
3425 else | |
3426 { | |
3427 v667 = (PLAYER_SKILL_TYPE)12; | |
3428 } | |
3429 LODWORD(v725) = v667; | |
3430 v9 = pPlayer->GetActualSkillLevel(v667); | |
3431 v723 = v9 & 0x3F; | |
3432 v2 = v9 & 0x3F; | |
3433 goto LABEL_45; | |
3434 } | |
3435 v11 = v7; | |
3436 v10 = v7 & 0x3F; | |
3437 v723 = v10; | |
3438 v2 = v10; | |
3439 LABEL_47: | |
3440 if ( HIBYTE(v11) & 1 ) | |
3441 { | |
3442 v12 = 4; | |
3443 v731 = 4; | |
3444 } | |
3445 else | |
3446 { | |
3447 if ( (v11 & 0x80u) == 0 ) | |
3448 { | |
3449 v10 = ((v11 & 0x40) != 0) + 1; | |
3450 v731 = ((v11 & 0x40) != 0) + 1; | |
3451 } | |
3452 else | |
3453 { | |
3454 v731 = 3; | |
3455 } | |
3456 v12 = v731; | |
3457 } | |
3458 LOWORD(v10) = v3->spellnum; | |
3459 v730 = v10; | |
3460 v13 = v12 + 10 * (signed __int16)v10; | |
486 | 3461 v14 = v3->field_A == 0; |
0 | 3462 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing |
3463 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); | |
3464 uRequiredMana = v15; | |
3465 sRecoveryTime = v16; | |
3466 if ( !v14 ) | |
486 | 3467 uRequiredMana = 0; |
3468 if ( pParty->uCurrentHour == 0 ) | |
0 | 3469 { |
486 | 3470 if ( pParty->uCurrentMinute != 0 ) |
0 | 3471 goto LABEL_62; |
3472 if ( LODWORD(v725) == 20 ) | |
3473 goto LABEL_61; | |
3474 } | |
486 | 3475 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0 && LODWORD(v725) == 19 ) |
0 | 3476 LABEL_61: |
486 | 3477 uRequiredMana = 0; |
0 | 3478 LABEL_62: |
3479 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) | |
3480 break; | |
3481 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); | |
3482 LABEL_203: | |
486 | 3483 v3->spellnum = 0; |
0 | 3484 LABEL_1166: |
3485 ++n; | |
3486 if ( n >= 10 ) | |
3487 return; | |
3488 } | |
3489 if ( !pPlayer->pConditions[0] || (signed __int16)v730 >= 100 ) | |
3490 goto LABEL_69; | |
3491 if ( rand() % 100 >= 50 ) | |
3492 { | |
3493 v12 = v731; | |
3494 LABEL_69: | |
3495 switch ( v3->spellnum ) | |
3496 { | |
3497 case 100: | |
3498 case 101: | |
3499 v17 = pPlayer; | |
3500 _this = (ItemGen *)1; | |
3501 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[5]) >= 3 ) | |
3502 _this = (ItemGen *)2; | |
3503 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3504 a1.stru_24.Reset(); | |
3505 v18 = v3->spellnum; | |
3506 a1.field_4C = v2; | |
3507 a1.field_48 = v18; | |
3508 a1.field_50 = v731; | |
3509 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3510 if ( v17->WearsItem(510, 2) ) | |
3511 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3512 a1.vPosition.x = pParty->vPosition.x; | |
3513 a1.vPosition.y = pParty->vPosition.y; | |
3514 a1.uAttributes = 0; | |
3515 a1.uSpriteFrameID = 0; | |
3516 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3517 v19 = 8 * v3->uPlayerID; | |
303 | 3518 LOBYTE(v19) = v19 | OBJECT_Player; |
3519 a1.field_58_pid = v19; | |
0 | 3520 a1.field_5C = a2; |
3521 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3522 a1.uFacing = LOWORD(v715.uYawAngle); | |
3523 a1.uSoundID = LOWORD(v3->field_10); | |
3524 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3525 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3526 a1.uAttributes = 256; | |
3527 if ( pParty->bTurnBasedModeOn == 1 ) | |
3528 a1.uAttributes = 260; | |
3529 for ( i = 0; i < (signed int)this; ++i ) | |
3530 { | |
3531 if ( i ) | |
3532 a1.vPosition.z += 32; | |
3533 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3534 if ( a1.Create( | |
3535 v715.uYawAngle, | |
3536 v715.uPitchAngle, | |
3537 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3538 v3->uPlayerID + 1) != -1 | |
3539 && pParty->bTurnBasedModeOn == 1 ) | |
3540 ++pTurnEngine->field_1C; | |
3541 } | |
3542 goto LABEL_83; | |
3543 case 102: | |
3544 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); | |
3545 a1.stru_24.Reset(); | |
3546 a1.field_48 = v3->spellnum; | |
3547 a1.field_4C = v723; | |
3548 a1.field_50 = v731; | |
3549 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3550 a1.vPosition.x = pParty->vPosition.x; | |
3551 a1.vPosition.y = pParty->vPosition.y; | |
3552 a1.uAttributes = 0; | |
3553 a1.uSpriteFrameID = 0; | |
3554 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3555 v22 = 8 * v3->uPlayerID; | |
303 | 3556 LOBYTE(v22) = v22 | OBJECT_Player; |
3557 a1.field_58_pid = v22; | |
0 | 3558 a1.field_5C = a2; |
3559 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3560 a1.uFacing = LOWORD(v715.uYawAngle); | |
3561 a1.uSoundID = LOWORD(v3->field_10); | |
3562 memcpy( | |
3563 &a1.stru_24, | |
3564 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3565 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3566 + 5], | |
3567 sizeof(a1.stru_24)); | |
3568 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3569 HIBYTE(a1.uAttributes) |= 1u; | |
3570 a1.uSectorID = v23; | |
3571 if ( pParty->bTurnBasedModeOn == 1 ) | |
3572 LOBYTE(a1.uAttributes) |= 4u; | |
3573 if ( a1.Create( | |
3574 v715.uYawAngle, | |
3575 v715.uPitchAngle, | |
3576 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3577 v3->uPlayerID + 1) != -1 | |
3578 && pParty->bTurnBasedModeOn == 1 ) | |
3579 ++pTurnEngine->field_1C; | |
3580 goto LABEL_83; | |
3581 case 1: | |
3582 LODWORD(v733) = 3600 * v2; | |
3583 v24 = v12 - 2; | |
3584 if ( v24 ) | |
3585 { | |
3586 v25 = v24 - 1; | |
3587 if ( v25 && v25 != 1 ) | |
3588 amount = 2; | |
3589 else | |
3590 amount = 4; | |
3591 } | |
3592 else | |
3593 { | |
3594 amount = 3; | |
3595 } | |
3596 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3597 goto LABEL_83; | |
486 | 3598 v668 = 0; |
3599 v658 = 0; | |
0 | 3600 v653 = amount; |
3601 v651 = v731; | |
3602 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); | |
3603 v27 = (char *)&pParty->pPartyBuffs[16]; | |
3604 goto LABEL_101; | |
3605 case 7: | |
3606 v29 = v12 - 2; | |
3607 if ( v29 ) | |
3608 { | |
3609 v30 = v29 - 1; | |
3610 if ( v30 ) | |
3611 { | |
3612 if ( v30 == 1 ) | |
3613 amount = 9; | |
3614 else | |
3615 amount = 3; | |
3616 } | |
3617 else | |
3618 { | |
3619 amount = 7; | |
3620 } | |
3621 } | |
3622 else | |
3623 { | |
3624 amount = 5; | |
3625 } | |
3626 v31 = v3->uPlayerID; | |
486 | 3627 HIDWORD(v733) = 0; |
0 | 3628 v32 = 8 * v31; |
486 | 3629 LOBYTE(v32) = v32 | OBJECT_Player; |
3630 if ( (signed int)uNumLayingItems > 0 ) | |
0 | 3631 { |
3632 v33 = (char *)&pLayingItems[0].field_48; | |
3633 v730 = uNumLayingItems; | |
3634 do | |
3635 { | |
486 | 3636 if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) |
0 | 3637 ++HIDWORD(v733); |
3638 v33 += 112; | |
3639 --v730; | |
3640 } | |
3641 while ( v730 ); | |
3642 } | |
3643 if ( SHIDWORD(v733) > amount ) | |
3644 goto LABEL_200; | |
3645 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3646 goto LABEL_83; | |
3647 a1.stru_24.Reset(); | |
3648 a1.field_48 = v3->spellnum; | |
3649 a1.field_4C = v2; | |
3650 a1.field_50 = v731; | |
3651 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3652 a1.vPosition.y = pParty->vPosition.y; | |
3653 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3654 a1.uAttributes = 0; |
0 | 3655 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3656 a1.uSectorID = pIndoor->GetSector( | |
3657 pParty->vPosition.x, | |
3658 pParty->vPosition.y, | |
3659 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3660 a1.uSpriteFrameID = 0; |
0 | 3661 v34 = 8 * v3->uPlayerID; |
303 | 3662 LOBYTE(v34) = v34 | OBJECT_Player; |
3663 a1.field_58_pid = v34; | |
0 | 3664 a1.field_5C = a2; |
3665 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3666 a1.uFacing = LOWORD(v715.uYawAngle); | |
3667 a1.uSoundID = LOWORD(v3->field_10); | |
3668 if ( pParty->bTurnBasedModeOn == 1 ) | |
3669 LOBYTE(a1.uAttributes) |= 4u; | |
3670 v669 = v3->uPlayerID + 1; | |
3671 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3672 v35 = pParty->sRotationX + 10; | |
3673 goto LABEL_124; | |
3674 case 20: | |
3675 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3676 goto LABEL_83; | |
486 | 3677 if (!a2) |
0 | 3678 goto LABEL_200; |
141 | 3679 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3680 goto LABEL_1056; |
486 | 3681 v699 = 0; |
3682 v698 = 0; | |
3683 v697 = 0; | |
0 | 3684 a1.stru_24.Reset(); |
3685 a1.field_48 = v3->spellnum; | |
3686 a1.field_4C = v2; | |
3687 a1.field_50 = v731; | |
3688 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 3689 a1.uAttributes = 0; |
3690 a1.uSectorID = 0; | |
3691 a1.uSpriteFrameID = 0; | |
0 | 3692 v37 = v3->uPlayerID; |
3693 a1.field_60_distance_related_prolly_lod = 0; | |
3694 v37 *= 8; | |
303 | 3695 LOBYTE(v37) = v37 | OBJECT_Player; |
486 | 3696 a1.uFacing = 0; |
303 | 3697 a1.field_58_pid = v37; |
0 | 3698 v38 = a2 >> 3; |
3699 a1.uSoundID = LOWORD(v3->field_10); | |
3700 v39 = a2 >> 3; | |
3701 a1.vPosition.x = pActors[v39].vPosition.x; | |
3702 v40 = pActors[v39].vPosition.y; | |
3703 a1.vPosition.z = pActors[v39].vPosition.z; | |
3704 v41 = 8 * (a2 >> 3); | |
3705 a1.vPosition.y = v40; | |
486 | 3706 LOBYTE(v41) = v41 | OBJECT_Actor; |
0 | 3707 a1.field_5C = v41; |
486 | 3708 v42 = a1.Create(0, 0, 0, 0); |
0 | 3709 v43 = &v697; |
3710 goto LABEL_133; | |
3711 case 44: | |
3712 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3713 goto LABEL_83; | |
3714 v726 = (Player *)(a2 >> 3); | |
3715 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3716 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3717 goto LABEL_1056; |
90 | 3718 pActors[a2 >> 3].pActorBuffs[10].Apply( |
486 | 3719 pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); |
3720 v706 = 0; | |
3721 v705 = 0; | |
3722 v704 = 0; | |
0 | 3723 a1.stru_24.Reset(); |
3724 a1.field_48 = v3->spellnum; | |
3725 a1.field_4C = v2; | |
3726 a1.field_50 = v731; | |
3727 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 3728 a1.uAttributes = 0; |
3729 a1.uSectorID = 0; | |
3730 a1.uSpriteFrameID = 0; | |
0 | 3731 v44 = v3->uPlayerID; |
3732 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 3733 a1.uFacing = 0; |
0 | 3734 v44 *= 8; |
303 | 3735 LOBYTE(v44) = v44 | OBJECT_Player; |
0 | 3736 v38 = (signed int)v726; |
303 | 3737 a1.field_58_pid = v44; |
0 | 3738 a1.uSoundID = LOWORD(v3->field_10); |
3739 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3740 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3741 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3742 v46 = 8 * (int)v726; | |
3743 a1.vPosition.y = v45; | |
486 | 3744 LOBYTE(v46) = 8 * (char)v726 | OBJECT_Actor; |
0 | 3745 a1.field_5C = v46; |
486 | 3746 v42 = a1.Create(0, 0, 0, 0); |
0 | 3747 v43 = &v704; |
3748 LABEL_133: | |
3749 v670 = (Vec3_int_ *)v43; | |
3750 v47 = v38; | |
3751 goto LABEL_139; | |
3752 case 79: | |
486 | 3753 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || (a2 & 7) != OBJECT_Actor) |
0 | 3754 goto LABEL_83; |
3755 v730 = a2 >> 3; | |
486 | 3756 v693 = 0; |
0 | 3757 HIDWORD(v733) = (int)&pActors[a2 >> 3]; |
486 | 3758 v692 = 0; |
3759 v691 = 0; | |
0 | 3760 a1.stru_24.Reset(); |
3761 a1.field_48 = v3->spellnum; | |
3762 a1.field_4C = v2; | |
3763 a1.field_50 = v731; | |
3764 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3765 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | |
3766 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3767 v48 = *(short *)(HIDWORD(v733) + 138); | |
3768 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
486 | 3769 a1.uAttributes = 0; |
0 | 3770 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); |
486 | 3771 a1.uSpriteFrameID = 0; |
0 | 3772 v49 = 8 * v3->uPlayerID; |
303 | 3773 LOBYTE(v49) = v49 | OBJECT_Player; |
3774 a1.field_58_pid = v49; | |
0 | 3775 a1.field_5C = a2; |
3776 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3777 a1.uFacing = LOWORD(v715.uYawAngle); | |
3778 LOWORD(v49) = LOWORD(v3->field_10); | |
3779 LOBYTE(a1.uAttributes) |= 0x80u; | |
3780 a1.uSoundID = v49; | |
486 | 3781 v726 = (Player *)a1.Create(0, 0, 0, 0); |
0 | 3782 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) |
3783 goto LABEL_200; | |
3784 v47 = v730; | |
3785 v670 = (Vec3_int_ *)&v691; | |
3786 v42 = (signed int)v726; | |
3787 LABEL_139: | |
3788 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3789 goto LABEL_1056; | |
3790 case 2: | |
3791 case 6: | |
3792 case 11: | |
3793 case 18: | |
3794 case 26: | |
3795 case 32: | |
3796 case 34: | |
3797 case 37: | |
3798 case 57: | |
3799 case 65: | |
3800 case 70: | |
3801 case 78: | |
3802 case 97: | |
3803 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3804 goto LABEL_83; | |
3805 a1.stru_24.Reset(); | |
3806 a1.field_48 = v3->spellnum; | |
3807 a1.field_4C = v2; | |
3808 a1.field_50 = v731; | |
3809 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3810 a1.vPosition.y = pParty->vPosition.y; | |
3811 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3812 a1.uAttributes = 0; |
0 | 3813 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3814 a1.uSectorID = pIndoor->GetSector( | |
3815 pParty->vPosition.x, | |
3816 pParty->vPosition.y, | |
3817 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3818 a1.uSpriteFrameID = 0; |
0 | 3819 v50 = 8 * v3->uPlayerID; |
303 | 3820 LOBYTE(v50) = v50 | OBJECT_Player; |
3821 a1.field_58_pid = v50; | |
0 | 3822 a1.field_5C = a2; |
3823 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3824 a1.uFacing = LOWORD(v715.uYawAngle); | |
3825 a1.uSoundID = LOWORD(v3->field_10); | |
3826 if ( pParty->bTurnBasedModeOn == 1 ) | |
3827 LOBYTE(a1.uAttributes) |= 4u; | |
3828 if ( v3->spellnum == 18 ) | |
3829 LOBYTE(a1.uAttributes) |= 0x40u; | |
3830 goto LABEL_156; | |
3831 case 29: | |
3832 case 39: | |
3833 case 76: | |
3834 case 90: | |
3835 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3836 goto LABEL_83; | |
3837 a1.stru_24.Reset(); | |
3838 a1.field_48 = v3->spellnum; | |
3839 a1.field_4C = v2; | |
3840 a1.field_50 = v731; | |
3841 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3842 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3843 a1.vPosition.y = pParty->vPosition.y; | |
3844 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3845 v660 = pParty->vPosition.y; | |
3846 goto LABEL_153; | |
3847 case 87: | |
3848 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3849 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3850 goto LABEL_200; | |
3851 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3852 goto LABEL_152; | |
3853 goto LABEL_83; | |
3854 case 81: | |
3855 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3856 goto LABEL_83; | |
486 | 3857 if ( !a2 |
141 | 3858 || (a2 & 7) != OBJECT_Actor |
0 | 3859 || (v730 = a2 >> 3, |
3860 v721 = (int)&pActors[a2 >> 3], | |
3861 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3862 goto LABEL_1056; | |
486 | 3863 Actor::AI_Stand(v730, 4u, 0x80u, 0); |
0 | 3864 v726 = (Player *)(23040 * v2); |
3865 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3866 v55 = v721; | |
486 | 3867 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0); |
0 | 3868 *(char *)(v55 + 38) |= 8u; |
486 | 3869 *(short *)(v55 + 148) = 0; |
3870 v672 = 0; | |
3871 *(short *)(v55 + 150) = 0; | |
0 | 3872 v661 = (Actor *)v55; |
3873 goto LABEL_165; | |
3874 case 35: | |
3875 if ( v12 == 2 ) | |
3876 { | |
3877 v57 = 300 * v2; | |
3878 } | |
3879 else | |
3880 { | |
3881 if ( v12 == 3 ) | |
3882 { | |
3883 amount = 4; | |
3884 v57 = 300 * v2; | |
3885 goto LABEL_174; | |
3886 } | |
3887 if ( v12 == 4 ) | |
3888 { | |
3889 v57 = 300 * v2; | |
3890 amount = 8; | |
3891 goto LABEL_174; | |
3892 } | |
3893 v57 = 180 * v2; | |
3894 } | |
3895 amount = 2; | |
3896 LABEL_174: | |
3897 LODWORD(v733) = v57; | |
3898 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3899 goto LABEL_83; | |
141 | 3900 if ( (a2 & 7) != OBJECT_Actor |
0 | 3901 || (v721 = 836 * (a2 >> 3), |
90 | 3902 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3903 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3904 goto LABEL_1056; |
3905 v726 = (Player *)(23040 * v2); | |
3906 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3907 v59 = v721; | |
112 | 3908 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3909 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3910 pParty->uTimePlayed + (signed int)v58, | |
0 | 3911 v731, |
3912 amount, | |
486 | 3913 0, |
3914 0); | |
0 | 3915 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; |
486 | 3916 v672 = 0; |
0 | 3917 v661 = (Actor *)LODWORD(v718); |
3918 goto LABEL_165; | |
3919 case 60: | |
3920 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3921 goto LABEL_83; | |
3922 v730 = 836 * (a2 >> 3); | |
90 | 3923 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3924 goto LABEL_1056; |
3925 LODWORD(v733) = 300 * v2; | |
3926 if ( v731 == 2 ) | |
3927 { | |
3928 LODWORD(v733) = 600 * v2; | |
3929 } | |
3930 else | |
3931 { | |
3932 if ( v731 == 3 ) | |
3933 LODWORD(v733) = 29030400; | |
3934 } | |
112 | 3935 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3936 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3937 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3938 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3939 v726 = (Player *)((int)v733 << 7); | |
3940 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3941 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3942 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 3943 v731, 0, 0, 0); |
0 | 3944 a1.stru_24.Reset(); |
3945 a1.field_48 = v3->spellnum; | |
3946 a1.field_4C = v2; | |
3947 a1.field_50 = v731; | |
3948 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 3949 v61 = a2 >> 3; |
0 | 3950 goto LABEL_1086; |
3951 case 92: | |
3952 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
3953 goto LABEL_83; | |
3954 a1.stru_24.Reset(); | |
3955 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3956 a1.vPosition.x = pParty->vPosition.x; | |
3957 a1.vPosition.y = pParty->vPosition.y; | |
486 | 3958 a1.uAttributes = 0; |
0 | 3959 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3960 a1.uSectorID = pIndoor->GetSector( | |
3961 pParty->vPosition.x, | |
3962 pParty->vPosition.y, | |
3963 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3964 a1.uSpriteFrameID = 0; |
0 | 3965 v62 = 8 * v3->uPlayerID; |
303 | 3966 LOBYTE(v62) = v62 | OBJECT_Player; |
3967 a1.field_58_pid = v62; | |
0 | 3968 a1.field_5C = a2; |
3969 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3970 a1.uFacing = LOWORD(v715.uYawAngle); | |
3971 a1.uSoundID = LOWORD(v3->field_10); | |
3972 a1.field_50 = v731; | |
3973 a1.field_48 = 3; | |
3974 a1.field_4C = 300 * v2; | |
3975 goto LABEL_154; | |
3976 case 4: | |
3977 v63 = v12 - 1; | |
3978 if ( !v63 ) | |
3979 { | |
3980 amount = 10; | |
3981 goto LABEL_195; | |
3982 } | |
3983 v64 = v63 - 1; | |
3984 if ( !v64 ) | |
3985 { | |
3986 amount = 11; | |
3987 goto LABEL_195; | |
3988 } | |
3989 v65 = v64 - 1; | |
3990 if ( !v65 ) | |
3991 { | |
3992 amount = 12; | |
3993 LABEL_195: | |
3994 LODWORD(v733) = 3600 * v2; | |
3995 goto LABEL_196; | |
3996 } | |
3997 if ( v65 == 1 ) | |
3998 { | |
486 | 3999 LODWORD(v733) = 0; |
0 | 4000 amount = 12; |
4001 } | |
4002 LABEL_196: | |
4003 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4004 goto LABEL_83; | |
89 | 4005 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
4006 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
4007 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
4008 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
4009 { | |
315 | 4010 if (!v730c->Broken()) |
0 | 4011 { |
486 | 4012 if (!v730c->uSpecEnchantmentType) |
0 | 4013 { |
486 | 4014 if (!v730c->uEncantmentType) |
0 | 4015 { |
4016 v68 = BYTE4(v726->pConditions[3]); | |
4017 if ( !v68 || v68 == 1 || v68 == 2 ) | |
4018 { | |
377 | 4019 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
0 | 4020 { |
89 | 4021 v69 = v730c; |
0 | 4022 v14 = v731 == 4; |
4023 *(int *)(v730 + 12) = amount; | |
4024 if ( !v14 ) | |
4025 { | |
4026 v726 = (Player *)((int)v733 << 7); | |
4027 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
4028 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
4029 * 0.033333335); | |
4030 *(int *)(v69 + 20) |= 8u; | |
4031 } | |
4032 *(int *)(v69 + 20) |= 0x10u; | |
4033 LABEL_1055: | |
4034 dword_50C9A8 = 256; | |
4035 LABEL_1056: | |
4036 LODWORD(v727) = 1; | |
4037 LABEL_83: | |
4038 if ( v3->field_8 & 0x20 ) | |
4039 { | |
4040 LABEL_1162: | |
4041 if ( v727 != 0.0 ) | |
4042 pAudioPlayer->PlaySound( | |
4043 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4044 0, | |
4045 0, | |
4046 -1, | |
4047 0, | |
4048 v3->field_10, | |
4049 0, | |
4050 0); | |
4051 } | |
4052 else | |
4053 { | |
4054 if ( sRecoveryTime < 0 ) | |
4055 sRecoveryTime = 0; | |
4056 if ( pParty->bTurnBasedModeOn ) | |
4057 { | |
4058 v645 = sRecoveryTime; | |
4059 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4060 pPlayer->SetRecoveryTime(v645); | |
4061 if ( !some_active_character ) | |
4062 pTurnEngine->_40471C(); | |
4063 } | |
4064 else | |
4065 { | |
4066 pPlayer->SetRecoveryTime( | |
4067 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4068 } | |
4069 if ( v727 != 0.0 ) | |
4070 { | |
187 | 4071 pPlayer->PlaySound(SPEECH_49, 0); |
0 | 4072 goto LABEL_1162; |
4073 } | |
4074 } | |
4075 v3->spellnum = 0; | |
486 | 4076 //v1 = 0; |
0 | 4077 LABEL_1165: |
4078 v2 = v723; | |
4079 goto LABEL_1166; | |
4080 } | |
4081 } | |
4082 } | |
4083 } | |
4084 } | |
4085 } | |
4086 LABEL_199: | |
4087 dword_50C9D0 = 113; | |
486 | 4088 dword_50C9D4 = 0; |
0 | 4089 dword_50C9D8 = 1; |
4090 LABEL_200: | |
4091 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4092 LABEL_201: | |
4093 v67 = 2; | |
4094 LABEL_202: | |
4095 ShowStatusBarString(v66, v67); | |
486 | 4096 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 4097 goto LABEL_203; |
4098 case 71: | |
4099 v70 = v12 - 1; | |
4100 LODWORD(v733) = 3600 * v2; | |
4101 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4102 { | |
4103 v72 = v71 - 1; | |
4104 if ( v72 ) | |
4105 { | |
4106 if ( v72 == 1 ) | |
4107 amount = 10; | |
4108 } | |
4109 else | |
4110 { | |
4111 amount = 3; | |
4112 } | |
4113 } | |
4114 else | |
4115 { | |
4116 amount = 1; | |
4117 } | |
4118 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4119 goto LABEL_83; | |
4120 v73 = v3->uPlayerID_2; | |
4121 v74 = v3->spellnum; | |
4122 v75 = pGame->GetStru6(); | |
4123 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); | |
486 | 4124 v668 = 0; |
4125 v658 = 0; | |
0 | 4126 v653 = amount; |
4127 v651 = v731; | |
4128 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); | |
4129 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; | |
4130 goto LABEL_103; | |
4131 case 3: | |
4132 case 14: | |
4133 case 25: | |
4134 case 36: | |
4135 case 58: | |
4136 case 69: | |
4137 v76 = v12 - 1; | |
4138 LODWORD(v733) = 3600 * v2; | |
4139 if ( v76 ) | |
4140 { | |
4141 v77 = v76 - 1; | |
4142 if ( v77 ) | |
4143 { | |
4144 v78 = v77 - 1; | |
4145 if ( v78 ) | |
4146 { | |
4147 if ( v78 != 1 ) | |
4148 goto LABEL_232; | |
4149 v79 = 4 * v2; | |
4150 } | |
4151 else | |
4152 { | |
4153 v79 = 3 * v2; | |
4154 } | |
4155 } | |
4156 else | |
4157 { | |
4158 v79 = 2 * v2; | |
4159 } | |
4160 amount = v79; | |
4161 } | |
4162 else | |
4163 { | |
4164 amount = v2; | |
4165 } | |
4166 LABEL_232: | |
4167 v80 = v3->spellnum; | |
4168 switch ( v80 ) | |
4169 { | |
4170 case 3: | |
4171 LODWORD(v725) = 6; | |
4172 break; | |
4173 case 14: | |
486 | 4174 LODWORD(v725) = 0; |
0 | 4175 break; |
4176 case 25: | |
4177 LODWORD(v725) = 17; | |
4178 break; | |
4179 case 36: | |
4180 LODWORD(v725) = 4; | |
4181 break; | |
4182 case 58: | |
4183 LODWORD(v725) = 12; | |
4184 break; | |
4185 default: | |
4186 if ( v80 != 69 ) | |
4187 goto LABEL_1166; | |
4188 LODWORD(v725) = 1; | |
4189 break; | |
4190 } | |
4191 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4192 goto LABEL_83; | |
4193 v81 = v3->spellnum; | |
4194 v82 = pGame->GetStru6(); | |
486 | 4195 pGame->GetStru6()->SetPlayerBuffAnim(v81, 0); |
0 | 4196 v83 = 1; |
4197 v84 = v3->spellnum; | |
4198 v85 = pGame->GetStru6(); | |
486 | 4199 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1); |
0 | 4200 v86 = v3->spellnum; |
4201 v87 = pGame->GetStru6(); | |
486 | 4202 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2); |
0 | 4203 v88 = v3->spellnum; |
4204 v89 = pGame->GetStru6(); | |
486 | 4205 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3); |
0 | 4206 v90 = (double)(signed int)v733 * 4.2666669; |
4207 goto LABEL_304; | |
4208 case 5: | |
486 | 4209 if ( v12 <= 0 ) |
0 | 4210 goto LABEL_254; |
4211 if ( v12 <= 2 ) | |
4212 { | |
4213 v91 = 60 * (v2 + 60); | |
4214 } | |
4215 else | |
4216 { | |
4217 if ( v12 == 3 ) | |
4218 { | |
4219 v91 = 180 * (v2 + 20); | |
4220 } | |
4221 else | |
4222 { | |
4223 if ( v12 != 4 ) | |
4224 goto LABEL_254; | |
4225 v91 = 240 * (v2 + 15); | |
4226 } | |
4227 } | |
4228 LODWORD(v733) = v91; | |
4229 LABEL_254: | |
4230 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4231 { | |
89 | 4232 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4233 LODWORD(v727) = 1; |
4234 do | |
4235 { | |
89 | 4236 if ( v92->pConditions ) |
486 | 4237 LODWORD(v727) = 0; |
89 | 4238 ++v92; |
0 | 4239 } |
89 | 4240 while ( v92 <= &pParty->pPlayers[3] ); |
486 | 4241 if (LODWORD(v727)) |
0 | 4242 { |
4243 v726 = (Player *)((int)v733 << 7); | |
4244 pParty->pPartyBuffs[8].Apply( | |
4245 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
486 | 4246 v731, 0, 0, 0); |
0 | 4247 v93 = v3->spellnum; |
4248 v94 = pGame->GetStru6(); | |
486 | 4249 pGame->GetStru6()->SetPlayerBuffAnim(v93, 0); |
0 | 4250 v95 = v3->spellnum; |
4251 v96 = pGame->GetStru6(); | |
486 | 4252 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1); |
0 | 4253 v97 = v3->spellnum; |
4254 v98 = pGame->GetStru6(); | |
486 | 4255 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2); |
0 | 4256 v99 = v3->spellnum; |
4257 v100 = pGame->GetStru6(); | |
486 | 4258 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3); |
0 | 4259 } |
4260 } | |
4261 goto LABEL_83; | |
4262 case 46: | |
4263 v101 = v12 - 1; | |
4264 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4265 { | |
4266 v103 = v102 - 1; | |
4267 if ( v103 ) | |
4268 { | |
4269 if ( v103 != 1 ) | |
4270 goto LABEL_269; | |
4271 v104 = 3600 * (v2 + 1); | |
4272 } | |
4273 else | |
4274 { | |
4275 v104 = 900 * (v2 + 4); | |
4276 } | |
4277 } | |
4278 else | |
4279 { | |
4280 v104 = 300 * (v2 + 12); | |
4281 } | |
4282 LODWORD(v733) = v104; | |
4283 LABEL_269: | |
4284 amount = v2 + 5; | |
4285 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4286 goto LABEL_83; | |
4287 if ( v731 == 1 ) | |
4288 { | |
4289 v108 = v3->uPlayerID_2; | |
4290 v109 = v3->spellnum; | |
4291 v110 = pGame->GetStru6(); | |
4292 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
486 | 4293 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, 0, 65536); |
4294 v668 = 0; | |
0 | 4295 v716 = v111; |
4296 v658 = v111; | |
4297 v653 = amount; | |
4298 v726 = (Player *)((int)v733 << 7); | |
4299 v651 = 1; | |
4300 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4301 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[1]; | |
4302 goto LABEL_103; | |
4303 } | |
4304 v105 = 0; | |
4305 v726 = (Player *)((int)v733 << 7); | |
4306 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4307 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4308 do |
4309 { | |
4310 v106 = v3->spellnum; | |
4311 v107 = pGame->GetStru6(); | |
4312 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); | |
486 | 4313 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536); |
4314 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | |
89 | 4315 ++v730b; |
0 | 4316 ++v105; |
4317 } | |
89 | 4318 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4319 goto LABEL_1056; |
4320 case 52: | |
486 | 4321 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && (a2 & 7) == OBJECT_Actor) |
0 | 4322 { |
4323 v730 = a2 >> 3; | |
4324 v112 = &pActors[a2 >> 3]; | |
4325 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4326 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4327 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4328 _this = (ItemGen *)v113; | |
4329 v114 = v721; | |
4330 v115 = (unsigned int)v726; | |
4331 if ( v113 < v721 ) | |
4332 { | |
4333 v116 = v113; | |
4334 v113 = v721; | |
4335 v114 = v116; | |
4336 } | |
4337 if ( v113 < (signed int)v726 ) | |
4338 { | |
4339 v117 = v113; | |
4340 v113 = (int)v726; | |
4341 v115 = v117; | |
4342 } | |
4343 if ( v114 < (signed int)v115 ) | |
4344 { | |
4345 v118 = v115; | |
4346 v115 = v114; | |
4347 v114 = v118; | |
4348 } | |
4349 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4350 if ( (double)(signed int)this <= 307.2 ) | |
4351 { | |
4352 v703 = 0; | |
4353 v702 = 0; | |
4354 v701 = 0; | |
4355 a1.stru_24.Reset(); | |
4356 v119 = HIDWORD(v733); | |
4357 a1.field_48 = *(int *)HIDWORD(v733); | |
4358 a1.field_4C = v723; | |
4359 a1.field_50 = v731; | |
4360 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4361 a1.uAttributes = 0; | |
4362 a1.uSectorID = 0; | |
4363 a1.uSpriteFrameID = 0; | |
4364 v120 = 8 * *(short *)(v119 + 2); | |
303 | 4365 LOBYTE(v120) = v120 | OBJECT_Player; |
0 | 4366 a1.field_60_distance_related_prolly_lod = 0; |
303 | 4367 a1.field_58_pid = v120; |
0 | 4368 a1.uFacing = 0; |
4369 a1.uSoundID = *(short *)(v119 + 16); | |
4370 a1.vPosition.x = v112->vPosition.x; | |
4371 a1.vPosition.y = v112->vPosition.y; | |
4372 v726 = (Player *)v112->uActorHeight; | |
4373 v121 = 8 * a2; | |
4374 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4375 LOBYTE(v121) = 8 * a2 | 3; | |
4376 a1.field_5C = v121; | |
4377 v122 = a1.Create(0, 0, 0, 0); | |
4378 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4379 LODWORD(v727) = 1; | |
4380 } | |
4381 else | |
4382 { | |
4383 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4384 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4385 *(int *)HIDWORD(v733) = 0; | |
4386 } | |
4387 v3 = (stru277 *)HIDWORD(v733); | |
4388 } | |
4389 goto LABEL_83; | |
4390 case 17: | |
4391 case 38: | |
4392 case 51: | |
4393 v123 = v12 - 1; | |
4394 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4395 { | |
4396 v125 = v124 - 1; | |
4397 if ( v125 ) | |
4398 { | |
4399 if ( v125 != 1 ) | |
4400 goto LABEL_296; | |
4401 v126 = 3600 * (v2 + 1); | |
4402 } | |
4403 else | |
4404 { | |
4405 v126 = 900 * (v2 + 4); | |
4406 } | |
4407 } | |
4408 else | |
4409 { | |
4410 v126 = 300 * (v2 + 12); | |
4411 } | |
4412 LODWORD(v733) = v126; | |
4413 LABEL_296: | |
4414 v127 = v3->spellnum; | |
4415 if ( v127 == 17 ) | |
4416 { | |
486 | 4417 amount = 0; |
0 | 4418 LODWORD(v725) = 14; |
4419 } | |
4420 else | |
4421 { | |
4422 if ( v127 == 38 ) | |
4423 { | |
4424 LODWORD(v725) = 15; | |
4425 amount = v2 + 5; | |
4426 } | |
4427 else | |
4428 { | |
4429 if ( v127 != 51 ) | |
4430 goto LABEL_1166; | |
4431 LODWORD(v725) = 9; | |
4432 amount = v2 + 5; | |
4433 } | |
4434 } | |
4435 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4436 goto LABEL_83; | |
4437 v128 = v3->spellnum; | |
4438 v129 = pGame->GetStru6(); | |
486 | 4439 pGame->GetStru6()->SetPlayerBuffAnim(v128, 0); |
0 | 4440 v83 = 1; |
4441 v130 = v3->spellnum; | |
4442 v131 = pGame->GetStru6(); | |
486 | 4443 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1); |
0 | 4444 v132 = v3->spellnum; |
4445 v133 = pGame->GetStru6(); | |
486 | 4446 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2); |
0 | 4447 v134 = v3->spellnum; |
4448 v135 = pGame->GetStru6(); | |
486 | 4449 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3); |
0 | 4450 v726 = (Player *)((int)v733 << 7); |
4451 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
4452 LABEL_304: | |
486 | 4453 v673 = 0; |
4454 v662 = 0; | |
0 | 4455 v655 = amount; |
4456 v652 = v731; | |
4457 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; | |
4458 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; | |
4459 goto LABEL_977; | |
4460 case 8: | |
4461 v138 = v12 - 2; | |
4462 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4463 v140 = 600 * v2; | |
4464 else | |
4465 v140 = 60 * v2; | |
4466 LODWORD(v733) = v140; | |
4467 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4468 goto LABEL_83; | |
4469 v141 = v3->spellnum; | |
4470 v142 = pGame->GetStru6(); | |
486 | 4471 pGame->GetStru6()->SetPlayerBuffAnim(v141, 0); |
0 | 4472 v143 = v3->spellnum; |
4473 v144 = pGame->GetStru6(); | |
486 | 4474 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1); |
0 | 4475 v145 = v3->spellnum; |
4476 v146 = pGame->GetStru6(); | |
486 | 4477 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2); |
0 | 4478 v147 = v3->spellnum; |
4479 v148 = pGame->GetStru6(); | |
486 | 4480 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3); |
4481 v668 = 0; | |
0 | 4482 v726 = (Player *)((int)v733 << 7); |
486 | 4483 v658 = 0; |
0 | 4484 v653 = v2; |
4485 v651 = v731; | |
4486 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4487 v27 = (char *)&pParty->pPartyBuffs[10]; | |
4488 goto LABEL_102; | |
4489 case 9: | |
4490 v149 = v12 - 1; | |
4491 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4492 { | |
4493 if ( v151 == 1 ) | |
4494 _this = (ItemGen *)20; | |
4495 } | |
4496 else | |
4497 { | |
4498 _this = (ItemGen *)16; | |
4499 } | |
4500 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4501 { | |
4502 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4503 goto LABEL_201; | |
4504 } | |
4505 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4506 goto LABEL_83; | |
4507 LODWORD(v725) = a2 & 7; | |
141 | 4508 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4509 { |
4510 v152 = a2 >> 3; | |
4511 uRequiredMana = pActors[v152].vPosition.x; | |
4512 v153 = pActors[v152].vPosition.y; | |
4513 v154 = pActors[v152].vPosition.z; | |
4514 LODWORD(v727) = v153; | |
4515 } | |
4516 else | |
4517 { | |
323 | 4518 v155 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4519 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); |
323 | 4520 v156 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4521 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); |
4522 v154 = pParty->vPosition.z; | |
4523 } | |
4524 HIDWORD(v733) = v154; | |
4525 v713 = v154 + 2500; | |
486 | 4526 v721 = 0; |
4527 LODWORD(v718) = 0; | |
4528 if ( (signed int)this > 0 ) | |
0 | 4529 { |
4530 *(float *)&y = (double)SHIDWORD(v733); | |
4531 *(float *)&v732 = (double)v713; | |
4532 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4533 v726 = (Player *)this; | |
4534 do | |
4535 { | |
4536 v157 = rand(); | |
4537 v158 = (double)SLODWORD(v718); | |
4538 v718 = v158; | |
4539 v159 = (double)v721; | |
4540 *(float *)&v721 = v159; | |
4541 a2 = v157 % 1000; | |
4542 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4543 v725 = v159 * v159; | |
4544 *(float *)&_this = v158 * v158; | |
4545 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4546 { | |
486 | 4547 LODWORD(v687) = 0; |
4548 HIDWORD(v687) = 0; | |
0 | 4549 } |
4550 else | |
4551 { | |
4552 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4553 v687 = __PAIR__( | |
4554 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4555 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4556 } | |
4557 a1.stru_24.Reset(); | |
4558 a1.field_48 = v3->spellnum; | |
4559 a1.field_4C = v2; | |
4560 a1.field_50 = v731; | |
4561 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 4562 a1.uAttributes = 0; |
0 | 4563 a1.vPosition.x = uRequiredMana; |
4564 a1.vPosition.y = LODWORD(v727); | |
486 | 4565 a1.uSectorID = 0; |
0 | 4566 a1.vPosition.z = a2 + v713; |
486 | 4567 a1.uSpriteFrameID = 0; |
303 | 4568 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4569 a1.field_5C = v730; |
4570 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4571 a1.uFacing = v687; | |
4572 a1.uSoundID = LOWORD(v3->field_10); | |
4573 if ( pParty->bTurnBasedModeOn == 1 ) | |
4574 a1.uAttributes = 4; | |
4575 if ( a1.Create( | |
4576 v687, | |
4577 SHIDWORD(v687), | |
4578 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4579 0) != -1 |
0 | 4580 && pParty->bTurnBasedModeOn == 1 ) |
4581 ++pTurnEngine->field_1C; | |
4582 LODWORD(v718) = rand() % 1024 - 512; | |
4583 v160 = rand(); | |
4584 v14 = v726 == (Player *)1; | |
4585 v726 = (Player *)((char *)v726 - 1); | |
4586 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4587 } | |
4588 while ( !v14 ); | |
4589 } | |
4590 goto LABEL_1056; | |
4591 case 10: | |
4592 v67 = 2; | |
4593 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4594 { | |
4595 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4596 goto LABEL_202; | |
4597 } | |
4598 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4599 goto LABEL_83; | |
4600 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
486 | 4601 v700.z = 0; |
4602 v700.y = 0; | |
4603 v700.x = 0; | |
0 | 4604 a1.stru_24.Reset(); |
4605 a1.field_48 = v3->spellnum; | |
4606 a1.field_4C = v2; | |
4607 a1.field_50 = v731; | |
4608 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 4609 a1.uAttributes = 0; |
4610 a1.uSectorID = 0; | |
4611 a1.uSpriteFrameID = 0; | |
0 | 4612 v161 = v3->uPlayerID; |
4613 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 4614 a1.uFacing = 0; |
0 | 4615 v161 *= 8; |
303 | 4616 LOBYTE(v161) = v161 | OBJECT_Player; |
4617 a1.field_58_pid = v161; | |
0 | 4618 a1.uSoundID = LOWORD(v3->field_10); |
486 | 4619 a2 = 0; |
4620 if ( (signed int)v726 > 0 ) | |
0 | 4621 { |
4622 do | |
4623 { | |
4624 v162 = dword_50BF30[a2]; | |
4625 a1.vPosition.x = pActors[v162].vPosition.x; | |
4626 a1.vPosition.y = pActors[v162].vPosition.y; | |
4627 v732 = pActors[v162].uActorHeight; | |
4628 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4629 v163 = 8 * dword_50BF30[a2]; | |
486 | 4630 LOBYTE(v163) = v163 | OBJECT_Actor; |
0 | 4631 a1.field_5C = v163; |
486 | 4632 v164 = a1.Create(0, 0, 0, 0); |
0 | 4633 v165 = a2; |
4634 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
4635 v166 = pGame->GetStru6(); | |
4636 v166->_4A81CA(&a1); | |
4637 v167 = pGame->GetStru6(); | |
4638 v167->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
4639 a2 = v165 + 1; | |
4640 } | |
4641 while ( v165 + 1 < (signed int)v726 ); | |
4642 } | |
4643 goto LABEL_1056; | |
4644 case 12: | |
4645 LODWORD(v733) = 3600 * v2; | |
4646 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4647 goto LABEL_83; | |
4648 v168 = 0; | |
4649 do | |
4650 { | |
486 | 4651 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536); |
0 | 4652 v716 = v169; |
4653 } | |
4654 while ( v168 < 4 ); | |
486 | 4655 v668 = 0; |
0 | 4656 v732 = (int)v733 << 7; |
486 | 4657 v658 = 0; |
4658 v653 = 0; | |
0 | 4659 v651 = v731; |
4660 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4661 goto LABEL_992; | |
4662 case 13: | |
4663 v170 = v12 - 1; | |
4664 if ( !v170 ) | |
4665 { | |
4666 v173 = 300 * v2; | |
4667 goto LABEL_353; | |
4668 } | |
4669 v171 = v170 - 1; | |
4670 if ( !v171 ) | |
4671 { | |
4672 v173 = 600 * v2; | |
4673 goto LABEL_353; | |
4674 } | |
4675 v172 = v171 - 1; | |
4676 if ( !v172 || v172 == 1 ) | |
4677 { | |
4678 v173 = 3600 * v2; | |
4679 LABEL_353: | |
4680 LODWORD(v733) = v173; | |
4681 } | |
4682 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4683 goto LABEL_83; | |
4684 v174 = 0; | |
4685 do | |
486 | 4686 pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536); |
0 | 4687 while ( v174 < 4 ); |
4688 v175 = v3->spellnum; | |
4689 v176 = pGame->GetStru6(); | |
486 | 4690 pGame->GetStru6()->SetPlayerBuffAnim(v175, 0); |
0 | 4691 v83 = 1; |
4692 v177 = v3->spellnum; | |
4693 v178 = pGame->GetStru6(); | |
486 | 4694 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1); |
0 | 4695 v179 = v3->spellnum; |
4696 v180 = pGame->GetStru6(); | |
486 | 4697 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2); |
0 | 4698 v181 = v3->spellnum; |
4699 v182 = pGame->GetStru6(); | |
486 | 4700 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3); |
4701 v673 = 0; | |
0 | 4702 v732 = (int)v733 << 7; |
486 | 4703 v662 = 0; |
4704 v655 = 0; | |
0 | 4705 v652 = v731; |
4706 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4707 v137 = (char *)&pParty->pPartyBuffs[5]; | |
4708 goto LABEL_976; | |
4709 case 15: | |
4710 v184 = v12 - 1; | |
4711 if ( v184 ) | |
4712 { | |
4713 v185 = v184 - 1; | |
4714 if ( v185 ) | |
4715 { | |
4716 v186 = v185 - 1; | |
4717 if ( v186 ) | |
4718 { | |
4719 if ( v186 == 1 ) | |
4720 amount = 9; | |
4721 } | |
4722 else | |
4723 { | |
4724 amount = 7; | |
4725 } | |
4726 } | |
4727 else | |
4728 { | |
4729 amount = 5; | |
4730 } | |
4731 } | |
4732 else | |
4733 { | |
4734 amount = 3; | |
4735 } | |
4736 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4737 goto LABEL_83; | |
4738 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
4739 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4740 a1.stru_24.Reset(); | |
4741 a1.field_48 = v3->spellnum; | |
4742 a1.field_4C = v2; | |
4743 a1.field_50 = v731; | |
4744 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4745 a1.vPosition.y = pParty->vPosition.y; | |
4746 a1.vPosition.x = pParty->vPosition.x; | |
486 | 4747 a1.uAttributes = 0; |
0 | 4748 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
4749 a1.uSectorID = pIndoor->GetSector( | |
4750 pParty->vPosition.x, | |
4751 pParty->vPosition.y, | |
4752 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 4753 a1.uSpriteFrameID = 0; |
0 | 4754 v187 = 8 * v3->uPlayerID; |
303 | 4755 LOBYTE(v187) = v187 | OBJECT_Player; |
4756 a1.field_58_pid = v187; | |
0 | 4757 a1.field_5C = a2; |
4758 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4759 a1.uSoundID = LOWORD(v3->field_10); | |
4760 if ( pParty->bTurnBasedModeOn == 1 ) | |
4761 LOBYTE(a1.uAttributes) |= 4u; | |
4762 v188 = (signed int)v726 / -2; | |
4763 v189 = (signed int)v726 / 2; | |
4764 while ( v188 <= v189 ) | |
4765 { | |
4766 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4767 if ( a1.Create( | |
4768 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4769 v715.uPitchAngle, | |
4770 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4771 v3->uPlayerID + 1) != -1 | |
4772 && pParty->bTurnBasedModeOn == 1 ) | |
4773 ++pTurnEngine->field_1C; | |
4774 v188 += v732; | |
4775 } | |
4776 goto LABEL_1056; | |
4777 case 16: | |
4778 if ( pParty->uFlags & 8 ) | |
4779 { | |
4780 v190 = pGlobalTXT_LocalizationStrings[493]; | |
4781 goto LABEL_462; | |
4782 } | |
4783 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4784 goto LABEL_83; | |
4785 v191 = 0; | |
4786 do | |
486 | 4787 pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536); |
0 | 4788 while ( v191 < 4 ); |
4789 BYTE1(pParty->uFlags) |= 1u; | |
4790 pParty->uFallSpeed = 1000; | |
4791 goto LABEL_1056; | |
4792 case 19: | |
4793 v192 = v12 - 1; | |
4794 if ( !v192 ) | |
4795 { | |
4796 amount = v2; | |
4797 goto LABEL_391; | |
4798 } | |
4799 v193 = v192 - 1; | |
4800 if ( !v193 ) | |
4801 { | |
4802 v196 = 2 * v2; | |
4803 LABEL_389: | |
4804 amount = v196; | |
4805 LABEL_391: | |
4806 v195 = 600 * v2; | |
4807 goto LABEL_392; | |
4808 } | |
4809 v194 = v193 - 1; | |
4810 if ( !v194 ) | |
4811 { | |
4812 v196 = 3 * v2; | |
4813 goto LABEL_389; | |
4814 } | |
4815 if ( v194 != 1 ) | |
4816 goto LABEL_393; | |
4817 amount = 4 * v2; | |
4818 v195 = 3600 * v2; | |
4819 LABEL_392: | |
4820 LODWORD(v733) = v195; | |
4821 LABEL_393: | |
4822 if ( pParty->uFlags & 0x30 ) | |
4823 { | |
4824 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4825 goto LABEL_201; | |
4826 } | |
4827 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4828 { | |
4829 v197 = v3->spellnum; | |
4830 v198 = pGame->GetStru6(); | |
486 | 4831 pGame->GetStru6()->SetPlayerBuffAnim(v197, 0); |
0 | 4832 v83 = 1; |
4833 v199 = v3->spellnum; | |
4834 v200 = pGame->GetStru6(); | |
486 | 4835 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1); |
0 | 4836 v201 = v3->spellnum; |
4837 v202 = pGame->GetStru6(); | |
486 | 4838 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2); |
0 | 4839 v203 = v3->spellnum; |
4840 v204 = pGame->GetStru6(); | |
486 | 4841 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3); |
4842 v673 = 0; | |
0 | 4843 v732 = (int)v733 << 7; |
486 | 4844 v662 = 0; |
0 | 4845 v655 = amount; |
4846 v652 = v731; | |
4847 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4848 v137 = (char *)&pParty->pPartyBuffs[11]; | |
4849 LABEL_976: | |
4850 v136 = pParty->uTimePlayed + v183; | |
4851 LABEL_977: | |
4852 ((SpellBuff *)v137)->Apply(v136, v652, v655, v662, v673); | |
4853 LABEL_978: | |
4854 LODWORD(v727) = v83; | |
4855 } | |
4856 goto LABEL_83; | |
4857 case 21: | |
4858 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4859 { | |
4860 v190 = pGlobalTXT_LocalizationStrings[494]; | |
4861 LABEL_462: | |
4862 ShowStatusBarString(v190, 2u); | |
486 | 4863 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 4864 goto LABEL_83; |
4865 } | |
4866 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4867 { | |
4868 LABEL_461: | |
4869 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4870 goto LABEL_462; | |
4871 } | |
4872 LODWORD(v733) = 3600 * v2; | |
486 | 4873 if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) ) |
0 | 4874 amount = 1; |
4875 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4876 goto LABEL_83; | |
4877 v205 = 0; | |
4878 do | |
486 | 4879 pOtherOverlayList->_4418B1(2090, v205++ + 100, 0, 65536); |
0 | 4880 while ( v205 < 4 ); |
486 | 4881 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); |
0 | 4882 v207 = v3->uPlayerID + 1; |
4883 v716 = v206; | |
4884 v668 = v207; | |
4885 v658 = v206; | |
4886 v653 = amount; | |
4887 v732 = (int)v733 << 7; | |
4888 v651 = v731; | |
4889 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4890 v27 = (char *)&pParty->pPartyBuffs[7]; | |
4891 LABEL_101: | |
4892 v26 = (signed int)v26; | |
4893 LABEL_102: | |
4894 v28 = pParty->uTimePlayed + v26; | |
4895 LABEL_103: | |
4896 HIDWORD(v650) = HIDWORD(v28); | |
4897 LABEL_104: | |
4898 LODWORD(v650) = v28; | |
4899 ((SpellBuff *)v27)->Apply(v650, v651, v653, v658, v668); | |
4900 goto LABEL_1056; | |
4901 case 22: | |
4902 v67 = 2; | |
4903 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4904 { | |
4905 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4906 goto LABEL_202; | |
4907 } | |
4908 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
4909 goto LABEL_83; | |
4910 v208 = a2 & 7; | |
4911 LODWORD(v725) = a2 & 7; | |
4912 if ( v208 == 3 ) | |
4913 { | |
4914 v209 = a2 >> 3; | |
4915 LODWORD(v718) = pActors[v209].vPosition.x; | |
4916 v210 = pActors[v209].vPosition.y; | |
4917 v211 = pActors[v209].vPosition.z; | |
4918 v713 = v210; | |
4919 } | |
4920 else | |
4921 { | |
323 | 4922 v212 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4923 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); |
323 | 4924 v213 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4925 v214 = sub_42EBBE(2048, v213); |
4926 v211 = pParty->vPosition.z; | |
4927 v713 = pParty->vPosition.y + v214; | |
4928 v208 = LODWORD(v725); | |
4929 } | |
4930 v726 = (Player *)v211; | |
486 | 4931 HIDWORD(v733) = 0; |
0 | 4932 *(float *)&v732 = (double)v211; |
4933 LODWORD(v725) = v211 + 2500; | |
486 | 4934 v721 = 0; |
0 | 4935 *(float *)&y = (double)(v211 + 2500); |
4936 v730 = v208 == 3 ? a2 : 0; | |
4937 a2 = 20; | |
4938 do | |
4939 { | |
4940 v215 = rand(); | |
4941 v216 = (double)v721; | |
4942 v727 = v216; | |
4943 v217 = (double)SHIDWORD(v733); | |
4944 *(float *)&uRequiredMana = v217; | |
4945 _this = (ItemGen *)(v215 % 1000); | |
4946 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4947 *(float *)&v721 = v217 * v217; | |
4948 *(float *)&v726 = v216 * v216; | |
4949 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4950 { | |
486 | 4951 LODWORD(v685) = 0; |
4952 HIDWORD(v685) = 0; | |
0 | 4953 } |
4954 else | |
4955 { | |
4956 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4957 v685 = __PAIR__( | |
4958 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4959 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4960 } | |
4961 a1.stru_24.Reset(); | |
4962 a1.field_48 = v3->spellnum; | |
4963 a1.field_4C = v2; | |
4964 a1.field_50 = v731; | |
4965 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 4966 a1.uAttributes = 0; |
0 | 4967 a1.vPosition.x = LODWORD(v718); |
4968 a1.vPosition.y = v713; | |
486 | 4969 a1.uSectorID = 0; |
0 | 4970 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); |
486 | 4971 a1.uSpriteFrameID = 0; |
303 | 4972 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4973 a1.field_5C = v730; |
4974 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4975 a1.uFacing = v685; | |
4976 a1.uSoundID = LOWORD(v3->field_10); | |
4977 if ( pParty->bTurnBasedModeOn == 1 ) | |
4978 a1.uAttributes = 4; | |
4979 if ( a1.Create( | |
4980 v685, | |
4981 SHIDWORD(v685), | |
4982 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4983 0) != -1 |
0 | 4984 && pParty->bTurnBasedModeOn == 1 ) |
4985 ++pTurnEngine->field_1C; | |
4986 v721 = rand() % 1024 - 512; | |
4987 v218 = rand(); | |
4988 v14 = a2-- == 1; | |
4989 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4990 } | |
4991 while ( !v14 ); | |
4992 goto LABEL_1056; | |
4993 case 23: | |
4994 v219 = v12 - 2; | |
4995 if ( v219 ) | |
4996 { | |
4997 v220 = v219 - 1; | |
4998 if ( v220 ) | |
4999 { | |
5000 if ( v220 == 1 ) | |
5001 { | |
486 | 5002 amount = 0; |
0 | 5003 goto LABEL_433; |
5004 } | |
5005 v221 = 180 * v2; | |
5006 } | |
5007 else | |
5008 { | |
5009 v221 = 86400 * v2; | |
5010 } | |
5011 } | |
5012 else | |
5013 { | |
5014 v221 = 3600 * v2; | |
5015 } | |
5016 amount = v221; | |
5017 LABEL_433: | |
5018 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5019 goto LABEL_83; | |
5020 v222 = (char *)pParty->pPlayers; | |
5021 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
5022 break; | |
5023 case 24: | |
5024 v224 = v12 - 2; | |
5025 if ( v224 ) | |
5026 { | |
5027 v225 = v224 - 1; | |
5028 if ( v225 ) | |
5029 { | |
5030 if ( v225 == 1 ) | |
5031 amount = 7; | |
5032 else | |
5033 amount = 1; | |
5034 } | |
5035 else | |
5036 { | |
5037 amount = 5; | |
5038 } | |
5039 } | |
5040 else | |
5041 { | |
5042 amount = 3; | |
5043 } | |
5044 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5045 goto LABEL_83; | |
5046 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
5047 if ( amount == 1 ) | |
5048 { | |
5049 LABEL_152: | |
5050 a1.stru_24.Reset(); | |
5051 a1.field_48 = v3->spellnum; | |
5052 a1.field_50 = v731; | |
5053 a1.field_4C = v2; | |
5054 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5055 a1.vPosition.y = pParty->vPosition.y; | |
5056 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5057 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
5058 v660 = pParty->vPosition.y; | |
5059 LABEL_153: | |
486 | 5060 a1.uAttributes = 0; |
0 | 5061 a1.vPosition.x = pParty->vPosition.x; |
5062 a1.vPosition.z = v51; | |
5063 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
486 | 5064 a1.uSpriteFrameID = 0; |
0 | 5065 a1.uSectorID = v52; |
5066 v53 = 8 * v3->uPlayerID; | |
303 | 5067 LOBYTE(v53) = v53 | OBJECT_Player; |
5068 a1.field_58_pid = v53; | |
0 | 5069 a1.field_5C = a2; |
5070 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5071 a1.uFacing = LOWORD(v715.uYawAngle); | |
5072 a1.uSoundID = LOWORD(v3->field_10); | |
5073 LABEL_154: | |
5074 if ( pParty->bTurnBasedModeOn == 1 ) | |
5075 LOBYTE(a1.uAttributes) |= 4u; | |
5076 LABEL_156: | |
5077 v669 = v3->uPlayerID + 1; | |
5078 v36 = v715.uYawAngle; | |
5079 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5080 v654 = v715.uPitchAngle; | |
5081 LABEL_157: | |
5082 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
5083 ++pTurnEngine->field_1C; | |
5084 } | |
5085 else | |
5086 { | |
5087 v732 = SHIDWORD(v733) / (amount - 1); | |
5088 a1.stru_24.Reset(); | |
5089 a1.field_48 = v3->spellnum; | |
5090 a1.field_4C = v2; | |
5091 a1.field_50 = v731; | |
5092 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5093 a1.vPosition.y = pParty->vPosition.y; | |
5094 a1.vPosition.x = pParty->vPosition.x; | |
486 | 5095 a1.uAttributes = 0; |
0 | 5096 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5097 a1.uSectorID = pIndoor->GetSector( | |
5098 pParty->vPosition.x, | |
5099 pParty->vPosition.y, | |
5100 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 5101 a1.uSpriteFrameID = 0; |
0 | 5102 v226 = 8 * v3->uPlayerID; |
303 | 5103 LOBYTE(v226) = v226 | OBJECT_Player; |
5104 a1.field_58_pid = v226; | |
0 | 5105 a1.field_5C = a2; |
5106 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5107 a1.uSoundID = LOWORD(v3->field_10); | |
5108 if ( pParty->bTurnBasedModeOn == 1 ) | |
5109 LOBYTE(a1.uAttributes) |= 4u; | |
5110 v227 = SHIDWORD(v733) / -2; | |
5111 y = (char *)(SHIDWORD(v733) / 2); | |
5112 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5113 { | |
5114 v228 = v715.uYawAngle; | |
5115 do | |
5116 { | |
5117 a1.uFacing = v227 + v228; | |
5118 if ( a1.Create( | |
5119 v227 + v228, | |
5120 v715.uPitchAngle, | |
5121 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5122 v3->uPlayerID + 1) != -1 | |
5123 && pParty->bTurnBasedModeOn == 1 ) | |
5124 ++pTurnEngine->field_1C; | |
5125 v227 += v732; | |
5126 } | |
5127 while ( v227 <= (signed int)y ); | |
5128 } | |
5129 } | |
5130 goto LABEL_1056; | |
5131 case 27: | |
5132 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5133 goto LABEL_461; | |
5134 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5135 v229 = 600 * v2; | |
5136 else | |
5137 v229 = 3600 * v2; | |
5138 LODWORD(v733) = v229; | |
5139 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5140 goto LABEL_83; | |
486 | 5141 v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); |
0 | 5142 v230 = v3->spellnum; |
5143 v231 = pGame->GetStru6(); | |
486 | 5144 pGame->GetStru6()->SetPlayerBuffAnim(v230, 0); |
0 | 5145 v232 = 1; |
5146 v233 = v3->spellnum; | |
5147 v234 = pGame->GetStru6(); | |
486 | 5148 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1); |
0 | 5149 v235 = v3->spellnum; |
5150 v236 = pGame->GetStru6(); | |
486 | 5151 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2); |
0 | 5152 v237 = v3->spellnum; |
5153 v238 = pGame->GetStru6(); | |
486 | 5154 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3); |
0 | 5155 v239 = v3->uPlayerID + 1; |
5156 v732 = v229 << 7; | |
5157 pParty->pPartyBuffs[18].Apply( | |
5158 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5159 v731, | |
5160 amount, | |
5161 v716, | |
5162 v239); | |
5163 if ( v731 == 4 ) | |
5164 pParty->pPartyBuffs[18].uFlags = 1; | |
89 | 5165 LODWORD(v727) = v232; |
5166 goto LABEL_83; | |
0 | 5167 case 28: |
5168 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5169 goto LABEL_83; | |
5170 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; | |
5171 y = v240; | |
5172 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5173 goto LABEL_199; | |
5174 if ( v731 == 1 || v731 == 2 ) | |
5175 { | |
5176 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5177 } | |
5178 else | |
5179 { | |
5180 if ( v731 == 3 ) | |
5181 { | |
5182 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5183 } | |
5184 else | |
5185 { | |
5186 if ( v731 != 4 ) | |
5187 { | |
5188 v241 = 0.0; | |
5189 goto LABEL_484; | |
5190 } | |
5191 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5192 } | |
5193 } | |
5194 if ( v241 > 1.0 ) | |
5195 v241 = 1.0; | |
5196 LABEL_484: | |
5197 v732 = (unsigned __int8)v240[25]; | |
5198 v242 = (signed __int64)((double)v732 * v241); | |
5199 v243 = y; | |
5200 y[25] = v242; | |
5201 *((int *)v243 + 4) = (unsigned __int8)v242; | |
486 | 5202 if ( (unsigned __int8)v242 <= 0 ) |
5203 { | |
5204 *(int *)v243 = 0; | |
0 | 5205 dword_50C9D0 = 113; |
486 | 5206 dword_50C9D4 = 0; |
0 | 5207 dword_50C9D8 = 1; |
5208 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
486 | 5209 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5210 v3->spellnum = 0; | |
0 | 5211 goto LABEL_1165; |
5212 } | |
5213 *((int *)v243 + 5) |= 0x40u; | |
5214 goto LABEL_1055; | |
5215 case 30: | |
5216 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5217 goto LABEL_83; | |
486 | 5218 uRequiredMana = 0; |
0 | 5219 HIDWORD(v733) = 10 * v2; |
5220 v730 = 1; | |
5221 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5222 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5223 if ( v731 == 1 ) | |
5224 { | |
5225 v245 = (int)&v244[36 * a2 + 532]; | |
5226 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5227 v311 = __OFSUB__(*(int *)v245, 134); | |
5228 v14 = *(int *)v245 == 134; | |
5229 v310 = *(int *)v245 - 134 < 0; | |
5230 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5231 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5232 { | |
486 | 5233 if ( *(int *)&v244[36 * a2 + 544] == 0 ) |
0 | 5234 { |
486 | 5235 if ( *(int *)&v244[36 * a2 + 536] == 0 ) |
0 | 5236 { |
486 | 5237 if ( *(int *)&v244[36 * a2 + 540] == 0 ) |
0 | 5238 { |
5239 v312 = v309[28]; | |
5240 if ( v312 ) | |
5241 { | |
5242 if ( v312 != 1 ) | |
5243 { | |
5244 if ( v312 != 2 ) | |
5245 { | |
5246 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5247 if ( !(v244[36 * a2 + 552] & 2) ) | |
5248 { | |
5249 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5250 { | |
5251 uRequiredMana = 1; | |
486 | 5252 v730 = 0; |
0 | 5253 } |
5254 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5255 uRequiredMana = 1; | |
486 | 5256 if (!uRequiredMana) |
0 | 5257 { |
5258 v313 = *(char *)(LODWORD(v725) + 28); | |
5259 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5260 { | |
224 | 5261 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5262 *(int *)(v245 + 4) = 0; |
222 | 5263 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5264 + 1]; |
5265 ; | |
222 | 5266 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5267 + 1] ) |
5268 { | |
5269 ++*(int *)(v245 + 4); | |
5270 if ( j >= v314 ) | |
5271 break; | |
5272 } | |
5273 v254 = rand(); | |
224 | 5274 v255 = 10;//pItemsTable->field_116D8[17]; |
5275 v256 = 10;//pItemsTable->field_116D8[16]; | |
0 | 5276 LABEL_611: |
5277 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5278 LABEL_612: | |
5279 _this->uItemID |= 0x20u; | |
5280 goto LABEL_1055; | |
5281 } | |
5282 goto LABEL_615; | |
5283 } | |
5284 LABEL_613: | |
5285 v316 = _this->uItemID; | |
5286 if ( !(BYTE1(v316) & 2) ) | |
5287 { | |
5288 LOBYTE(v316) = v316 | 2; | |
5289 _this->uItemID = v316; | |
5290 } | |
5291 } | |
5292 } | |
5293 } | |
5294 } | |
5295 } | |
5296 } | |
5297 } | |
5298 } | |
5299 LABEL_616: | |
486 | 5300 if ( LODWORD(v727) == 0 ) |
0 | 5301 { |
5302 v317 = pGlobalTXT_LocalizationStrings[428]; | |
486 | 5303 if ( v730 == 0 ) |
0 | 5304 v317 = pGlobalTXT_LocalizationStrings[585]; |
5305 ShowStatusBarString(v317, 2u); | |
486 | 5306 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 5307 v318 = v726; |
486 | 5308 v3->spellnum = 0; |
5309 v318->PlaySound(SPEECH_43, 0); | |
0 | 5310 } |
5311 goto LABEL_83; | |
5312 } | |
5313 if ( v731 != 2 ) | |
5314 { | |
5315 if ( v731 == 3 ) | |
5316 { | |
5317 v245 = (int)&v244[36 * a2 + 532]; | |
5318 v269 = *(int *)v245; | |
5319 if ( *(int *)v245 > 134 | |
486 | 5320 || *(int *)(v245 + 12) != 0 |
5321 || *(int *)(v245 + 4) != 0 | |
5322 || *(int *)(v245 + 8) != 0 | |
0 | 5323 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) |
5324 goto LABEL_616; | |
5325 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5326 LODWORD(v725) = (int)v270; | |
5327 v271 = v270[28]; | |
5328 if ( v271 && v271 != 1 && v271 != 2 ) | |
5329 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5330 else | |
5331 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5332 if ( v272 ) | |
5333 { | |
5334 uRequiredMana = 1; | |
486 | 5335 v730 = 0; |
0 | 5336 } |
5337 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5338 uRequiredMana = 1; | |
486 | 5339 if (uRequiredMana) |
0 | 5340 goto LABEL_613; |
5341 v273 = v725; | |
5342 v274 = *(char *)(LODWORD(v725) + 28); | |
5343 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 ) | |
5344 { | |
5345 if ( rand() % 100 < 80 | |
5346 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5347 { | |
224 | 5348 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5349 *(int *)(v245 + 4) = 0; |
222 | 5350 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5351 ; |
222 | 5352 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5353 + 1] ) |
5354 { | |
5355 ++*(int *)(v245 + 4); | |
5356 if ( k >= v275 ) | |
5357 break; | |
5358 } | |
5359 v254 = rand(); | |
224 | 5360 v255 = 10;//pItemsTable->field_116D8[19]; |
5361 v256 = 10;//pItemsTable->field_116D8[18]; | |
0 | 5362 goto LABEL_611; |
5363 } | |
222 | 5364 v277 = pItemsTable->pSpecialEnchantments_count; |
0 | 5365 v278 = 0; |
5366 v725 = 0.0; | |
5367 HIDWORD(v733) = 0; | |
222 | 5368 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5369 { |
5370 v730 = (int)&v679; | |
5371 do | |
5372 { | |
222 | 5373 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement); |
0 | 5374 if ( !v279 || v279 == 1 ) |
5375 { | |
222 | 5376 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5377 + 4] |
5378 + v278 * 28); | |
5379 LODWORD(v725) += v280; | |
5380 if ( v280 ) | |
5381 { | |
5382 v281 = v730; | |
5383 v730 += 4; | |
5384 *(int *)v281 = HIDWORD(v733); | |
5385 } | |
5386 } | |
5387 ++HIDWORD(v733); | |
5388 ++v278; | |
5389 } | |
5390 while ( SHIDWORD(v733) < v277 ); | |
5391 } | |
5392 v282 = rand() % SLODWORD(v725); | |
5393 v283 = v679; | |
5394 *(int *)(v245 + 12) = v679; | |
222 | 5395 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5396 v285 = v282 + 1; |
5397 if ( v284 < v285 ) | |
5398 { | |
5399 for ( l = &v679; ; l = (int *)v732 ) | |
5400 { | |
5401 v287 = (int)(l + 1); | |
5402 v732 = v287; | |
5403 v288 = *(int *)v287; | |
5404 *(int *)(v245 + 12) = v288; | |
222 | 5405 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5406 + 4]; |
5407 if ( v284 >= v285 ) | |
5408 break; | |
5409 } | |
5410 } | |
5411 goto LABEL_525; | |
5412 } | |
5413 } | |
5414 else | |
5415 { | |
5416 if ( v731 != 4 | |
5417 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
486 | 5418 || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 |
5419 || v726->pInventoryItems[a2].uEncantmentType != 0 | |
5420 || v726->pInventoryItems[a2]._bonus_strength != 0 | |
315 | 5421 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) |
0 | 5422 goto LABEL_616; |
5423 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5424 LODWORD(v725) = (int)v247; | |
5425 v248 = v247[28]; | |
5426 if ( v248 && v248 != 1 && v248 != 2 ) | |
5427 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5428 else | |
5429 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5430 if ( v249 ) | |
5431 { | |
5432 uRequiredMana = 1; | |
486 | 5433 v730 = 0; |
0 | 5434 } |
5435 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5436 uRequiredMana = 1; | |
486 | 5437 if (uRequiredMana) |
0 | 5438 goto LABEL_613; |
5439 v250 = v725; | |
5440 v251 = *(char *)(LODWORD(v725) + 28); | |
5441 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 ) | |
5442 { | |
5443 if ( rand() % 100 < 80 | |
5444 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5445 { | |
224 | 5446 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5447 *(int *)(v245 + 4) = 0; |
222 | 5448 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5449 ; |
222 | 5450 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5451 + 1] ) |
5452 { | |
5453 ++*(int *)(v245 + 4); | |
5454 if ( m >= v252 ) | |
5455 break; | |
5456 } | |
5457 v254 = rand(); | |
224 | 5458 v255 = 10;// pItemsTable->field_116D8[21]; |
5459 v256 = 10;//pItemsTable->field_116D8[20]; | |
0 | 5460 goto LABEL_611; |
5461 } | |
222 | 5462 v257 = pItemsTable->pSpecialEnchantments_count; |
0 | 5463 v258 = 0; |
5464 v725 = 0.0; | |
5465 HIDWORD(v733) = 0; | |
222 | 5466 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5467 { |
5468 v730 = (int)&v679; | |
5469 do | |
5470 { | |
222 | 5471 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
0 | 5472 if ( !v259 || v259 == 1 ) |
5473 { | |
222 | 5474 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5475 + 4] |
5476 + v258 * 28); | |
5477 LODWORD(v725) += v260; | |
5478 if ( v260 ) | |
5479 { | |
5480 v261 = v730; | |
5481 v730 += 4; | |
5482 *(int *)v261 = HIDWORD(v733); | |
5483 } | |
5484 } | |
5485 ++HIDWORD(v733); | |
5486 ++v258; | |
5487 } | |
5488 while ( SHIDWORD(v733) < v257 ); | |
5489 } | |
5490 v262 = rand() % SLODWORD(v725); | |
5491 v263 = v679; | |
5492 *(int *)(v245 + 12) = v679; | |
222 | 5493 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5494 v265 = v262 + 1; |
5495 if ( v264 < v265 ) | |
5496 { | |
5497 for ( ii = &v679; ; ii = (int *)v732 ) | |
5498 { | |
5499 v267 = (int)(ii + 1); | |
5500 v732 = v267; | |
5501 v268 = *(int *)v267; | |
5502 *(int *)(v245 + 12) = v268; | |
222 | 5503 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5504 + 4]; |
5505 if ( v264 >= v265 ) | |
5506 break; | |
5507 } | |
5508 } | |
5509 LABEL_525: | |
5510 ++*(int *)(v245 + 12); | |
5511 goto LABEL_612; | |
5512 } | |
5513 } | |
5514 LABEL_615: | |
486 | 5515 //v1 = 0; |
0 | 5516 goto LABEL_616; |
5517 } | |
5518 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5519 _this = v289; | |
5520 v290 = v289->uItemID; | |
5521 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5522 if ( v290 > 134 | |
486 | 5523 || _this->uSpecEnchantmentType != 0 |
5524 || _this->uEncantmentType != 0 | |
5525 || _this->_bonus_strength != 0 | |
0 | 5526 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 |
5527 || v291 == 1 | |
5528 || v291 == 2 | |
315 | 5529 || _this->Broken()) |
0 | 5530 goto LABEL_616; |
5531 if ( _this->GetValue() < 0x1C2 ) | |
5532 uRequiredMana = 1; | |
5533 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5534 uRequiredMana = 1; | |
486 | 5535 if ( uRequiredMana != 0 ) |
0 | 5536 goto LABEL_199; |
5537 v292 = *(char *)(LODWORD(v725) + 28); | |
5538 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5539 { | |
5540 v2 = v723; | |
486 | 5541 //v1 = 0; |
0 | 5542 goto LABEL_199; |
5543 } | |
5544 if ( rand() % 100 >= 80 ) | |
5545 { | |
222 | 5546 v297 = pItemsTable->pSpecialEnchantments_count; |
0 | 5547 v294 = _this; |
5548 v298 = 0; | |
5549 v725 = 0.0; | |
5550 HIDWORD(v733) = 0; | |
222 | 5551 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5552 { |
5553 v730 = (int)&v679; | |
5554 do | |
5555 { | |
222 | 5556 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement); |
0 | 5557 if ( !v299 || v299 == 1 ) |
5558 { | |
222 | 5559 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4] |
0 | 5560 + v298 * 28); |
5561 LODWORD(v725) += v300; | |
5562 if ( v300 ) | |
5563 { | |
5564 v301 = v730; | |
5565 v730 += 4; | |
5566 *(int *)v301 = HIDWORD(v733); | |
5567 } | |
5568 } | |
5569 ++HIDWORD(v733); | |
5570 ++v298; | |
5571 } | |
5572 while ( SHIDWORD(v733) < v297 ); | |
5573 } | |
5574 v302 = rand() % SLODWORD(v725); | |
5575 v303 = v679; | |
377 | 5576 v294->uSpecEnchantmentType = v679; |
222 | 5577 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5578 v305 = v302 + 1; |
5579 if ( v304 < v305 ) | |
5580 { | |
5581 for ( jj = &v679; ; jj = (int *)v732 ) | |
5582 { | |
5583 v307 = (int)(jj + 1); | |
5584 v732 = v307; | |
5585 v308 = *(int *)v307; | |
377 | 5586 v294->uSpecEnchantmentType = v308; |
222 | 5587 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5588 if ( v304 >= v305 ) |
5589 break; | |
5590 } | |
5591 } | |
377 | 5592 ++v294->uSpecEnchantmentType; |
0 | 5593 } |
5594 else | |
5595 { | |
5596 v293 = rand(); | |
5597 v294 = _this; | |
224 | 5598 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
377 | 5599 _this->uEncantmentType = 0; |
222 | 5600 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; |
0 | 5601 ; |
377 | 5602 kk += pItemsTable->pEnchantments[v294->uEncantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType |
0 | 5603 + 1] ) |
5604 { | |
377 | 5605 ++v294->uEncantmentType; |
0 | 5606 if ( kk >= v295 ) |
5607 break; | |
5608 } | |
224 | 5609 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5610 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
0 | 5611 } |
5612 v294->uAttributes |= 0x20u; | |
5613 goto LABEL_1055; | |
5614 case 31: | |
5615 amount = 10 * v2; | |
5616 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
5617 goto LABEL_83; | |
5618 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) | |
5619 goto LABEL_200; | |
5620 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
486 | 5621 pMessageQueue_50CBD0->AddMessage(UIMSG_C3, 0, 0); |
0 | 5622 goto LABEL_1056; |
5623 case 33: | |
5624 LODWORD(v733) = 604800 * v2; | |
5625 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5626 goto LABEL_200; | |
5627 v319 = uRequiredMana; | |
5628 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5629 { | |
5630 pEventTimer->Pause(); | |
486 | 5631 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, 0, 0); |
0 | 5632 qword_506350 = (signed int)v733; |
5633 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5634 ::uRequiredMana = v319; | |
5635 ::sRecoveryTime = sRecoveryTime; | |
5636 dword_50633C = v3->field_10; | |
5637 dword_506338 = v3->spellnum; | |
5638 LOBYTE(v3->field_8) |= 0x20u; | |
5639 } | |
5640 goto LABEL_83; | |
5641 case 40: | |
5642 v320 = v12 - 2; | |
5643 if ( !v320 ) | |
5644 goto LABEL_632; | |
5645 v321 = v320 - 1; | |
5646 if ( v321 ) | |
5647 { | |
5648 if ( v321 == 1 ) | |
5649 goto LABEL_634; | |
5650 LABEL_632: | |
5651 v322 = 3600 * v2; | |
5652 } | |
5653 else | |
5654 { | |
5655 v322 = 86400 * v2; | |
5656 } | |
5657 amount = v322; | |
5658 LABEL_634: | |
5659 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5660 goto LABEL_83; | |
5661 v323 = v3->uPlayerID_2; | |
5662 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5663 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5664 goto LABEL_1056; | |
5665 if ( v731 == 4 ) | |
5666 goto LABEL_637; | |
5667 v732 = amount << 7; | |
5668 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5669 v656 = 15; | |
5670 goto LABEL_640; | |
5671 case 41: | |
5672 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5673 goto LABEL_83; | |
5674 a1.stru_24.Reset(); | |
5675 a1.field_48 = v3->spellnum; | |
5676 a1.field_4C = v2; | |
5677 a1.field_50 = v731; | |
5678 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5679 a1.vPosition.y = pParty->vPosition.y; | |
5680 a1.vPosition.x = pParty->vPosition.x; | |
486 | 5681 a1.uAttributes = 0; |
0 | 5682 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5683 a1.uSectorID = pIndoor->GetSector( | |
5684 pParty->vPosition.x, | |
5685 pParty->vPosition.y, | |
5686 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 5687 a1.uSpriteFrameID = 0; |
0 | 5688 v326 = 8 * v3->uPlayerID; |
303 | 5689 LOBYTE(v326) = v326 | OBJECT_Player; |
5690 a1.field_58_pid = v326; | |
0 | 5691 a1.field_5C = a2; |
5692 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5693 a1.uFacing = LOWORD(pParty->sRotationY); | |
5694 a1.uSoundID = LOWORD(v3->field_10); | |
5695 if ( pParty->bTurnBasedModeOn == 1 ) | |
5696 LOBYTE(a1.uAttributes) |= 4u; | |
5697 v669 = v3->uPlayerID + 1; | |
5698 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5699 v654 = pParty->sRotationX; | |
5700 goto LABEL_125; | |
5701 case 43: | |
5702 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5703 goto LABEL_200; | |
5704 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5705 goto LABEL_83; | |
5706 a1.uItemType = 4090; | |
5707 a1.stru_24.Reset(); | |
5708 a1.field_48 = v3->spellnum; | |
5709 a1.field_4C = v2; | |
5710 a1.field_50 = v731; | |
5711 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5712 a1.vPosition.x = pParty->vPosition.x; | |
5713 a1.vPosition.y = pParty->vPosition.y; | |
486 | 5714 a1.uAttributes = 0; |
5715 a1.uSectorID = 0; | |
5716 a1.uSpriteFrameID = 0; | |
0 | 5717 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5718 v327 = 8 * v3->uPlayerID; | |
303 | 5719 LOBYTE(v327) = v327 | OBJECT_Player; |
0 | 5720 a1.field_60_distance_related_prolly_lod = 0; |
303 | 5721 a1.field_58_pid = v327; |
0 | 5722 a1.field_5C = a2; |
5723 a1.uFacing = LOWORD(pParty->sRotationY); | |
5724 a1.uSoundID = LOWORD(v3->field_10); | |
5725 if ( pParty->bTurnBasedModeOn == 1 ) | |
5726 a1.uAttributes = 4; | |
486 | 5727 v669 = 0; |
0 | 5728 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5729 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5730 LABEL_124: | |
5731 v654 = v35; | |
5732 LABEL_125: | |
5733 v36 = pParty->sRotationY; | |
5734 goto LABEL_157; | |
5735 case 45: | |
5736 v328 = v12 - 2; | |
5737 if ( v328 ) | |
5738 { | |
5739 v329 = v328 - 1; | |
5740 if ( v329 && v329 != 1 ) | |
5741 v330 = 600 * v2; | |
5742 else | |
5743 v330 = 3600 * v2; | |
5744 } | |
5745 else | |
5746 { | |
5747 v330 = 1800 * v2; | |
5748 } | |
5749 LODWORD(v733) = v330; | |
5750 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5751 goto LABEL_83; | |
5752 v331 = v3->spellnum; | |
5753 v332 = pGame->GetStru6(); | |
486 | 5754 pGame->GetStru6()->SetPlayerBuffAnim(v331, 0); |
0 | 5755 v83 = 1; |
5756 v333 = v3->spellnum; | |
5757 v334 = pGame->GetStru6(); | |
486 | 5758 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1); |
0 | 5759 v335 = v3->spellnum; |
5760 v336 = pGame->GetStru6(); | |
486 | 5761 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2); |
0 | 5762 v337 = v3->spellnum; |
5763 v338 = pGame->GetStru6(); | |
486 | 5764 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3); |
5765 v673 = 0; | |
0 | 5766 v732 = (int)v733 << 7; |
486 | 5767 v662 = 0; |
5768 v655 = 0; | |
0 | 5769 v652 = v731; |
5770 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5771 v137 = (char *)&pParty->pPartyBuffs[3]; | |
5772 goto LABEL_976; | |
5773 case 47: | |
5774 LODWORD(v733) = 300; | |
5775 v339 = v12 - 2; | |
5776 if ( v339 ) | |
5777 { | |
5778 v340 = v339 - 1; | |
5779 if ( v340 ) | |
5780 { | |
5781 if ( v340 != 1 ) | |
5782 { | |
5783 amount = v2; | |
5784 goto LABEL_667; | |
5785 } | |
5786 v341 = 6 * v2; | |
5787 } | |
5788 else | |
5789 { | |
5790 v341 = 4 * v2; | |
5791 } | |
5792 } | |
5793 else | |
5794 { | |
5795 v341 = 2 * v2; | |
5796 } | |
5797 amount = v341; | |
5798 LABEL_667: | |
5799 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5800 goto LABEL_83; | |
5801 v342 = *(int *)&v3->field_C; | |
486 | 5802 if ( v342 == 0 ) |
0 | 5803 { |
5804 v345 = v3->uPlayerID_2; | |
5805 v346 = v3->spellnum; | |
5806 v347 = pGame->GetStru6(); | |
5807 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); | |
486 | 5808 v668 = 0; |
5809 v658 = 0; | |
0 | 5810 v653 = amount; |
5811 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; | |
5812 v651 = v731; | |
486 | 5813 HIDWORD(v650) = 0 + ((pParty->uTimePlayed + 1280) >> 32); |
0 | 5814 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; |
5815 goto LABEL_104; | |
5816 } | |
141 | 5817 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5818 { |
5819 v343 = v342 >> 3; | |
486 | 5820 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32); |
0 | 5821 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; |
486 | 5822 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0); |
0 | 5823 BYTE2(pActors[v343].uAttributes) |= 8u; |
486 | 5824 v672 = 0; |
0 | 5825 v661 = &pActors[v343]; |
5826 LABEL_165: | |
5827 v56 = pGame->GetStru6(); | |
5828 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5829 } | |
5830 goto LABEL_1056; | |
5831 case 49: | |
5832 v348 = v12 - 2; | |
5833 if ( !v348 ) | |
5834 goto LABEL_677; | |
5835 v349 = v348 - 1; | |
5836 if ( v349 ) | |
5837 { | |
5838 if ( v349 == 1 ) | |
5839 { | |
486 | 5840 amount = 0; |
0 | 5841 goto LABEL_679; |
5842 } | |
5843 LABEL_677: | |
5844 v350 = 3600 * v2; | |
5845 } | |
5846 else | |
5847 { | |
5848 v350 = 86400 * v2; | |
5849 } | |
5850 amount = v350; | |
5851 LABEL_679: | |
5852 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5853 goto LABEL_83; | |
5854 v351 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5855 if ( !v351->pConditions[0] ) | |
5856 goto LABEL_1056; | |
5857 if ( v731 == 4 ) | |
5858 { | |
486 | 5859 LODWORD(v351->pConditions[0]) = 0; |
5860 HIDWORD(v351->pConditions[0]) = 0; | |
0 | 5861 goto LABEL_904; |
5862 } | |
5863 v732 = amount << 7; | |
5864 v351->DiscardConditionIfLastsLongerThan( | |
486 | 5865 0, |
0 | 5866 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); |
5867 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5868 goto LABEL_1056; | |
5869 v674 = v3->uPlayerID_2; | |
5870 goto LABEL_685; | |
5871 case 50: | |
5872 v354 = v12 - 2; | |
5873 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5874 v356 = 900 * (v2 + 4); | |
5875 else | |
5876 v356 = 300 * (v2 + 12); | |
5877 LODWORD(v733) = v356; | |
5878 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5879 goto LABEL_83; | |
5880 if ( v731 == 1 || v731 == 2 ) | |
5881 { | |
5882 v361 = v3->uPlayerID_2; | |
5883 v362 = v3->spellnum; | |
5884 v363 = pGame->GetStru6(); | |
5885 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); | |
486 | 5886 v668 = 0; |
0 | 5887 v732 = (int)v733 << 7; |
486 | 5888 v658 = 0; |
5889 v653 = 0; | |
0 | 5890 v651 = v731; |
5891 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
5892 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; | |
5893 goto LABEL_103; | |
5894 } | |
486 | 5895 a2 = 0; |
0 | 5896 v732 = (int)v733 << 7; |
5897 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5898 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5899 do |
5900 { | |
5901 v358 = a2; | |
5902 v359 = v3->spellnum; | |
5903 v360 = pGame->GetStru6(); | |
5904 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); | |
486 | 5905 v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); |
0 | 5906 ++a2; |
112 | 5907 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5908 } | |
5909 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5910 goto LABEL_1056; |
5911 case 48: | |
5912 v364 = v12 - 2; | |
5913 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5914 v366 = 60 * (v2 + 3); | |
5915 else | |
5916 v366 = 300 * v2 + 180; | |
5917 LODWORD(v733) = v366; | |
5918 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5919 goto LABEL_83; | |
5920 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
5921 v367 = pGame->GetStru6(); | |
5922 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | |
5923 ++a1.uItemType; | |
5924 a1.stru_24.Reset(); | |
5925 a1.field_48 = v3->spellnum; | |
5926 a1.field_4C = v2; | |
5927 a1.field_50 = v731; | |
5928 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 5929 a1.uAttributes = 0; |
5930 a1.uSectorID = 0; | |
5931 a1.uSpriteFrameID = 0; | |
0 | 5932 v368 = v3->uPlayerID; |
5933 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 5934 a1.uFacing = 0; |
0 | 5935 v368 *= 8; |
303 | 5936 LOBYTE(v368) = v368 | OBJECT_Player; |
5937 a1.field_58_pid = v368; | |
0 | 5938 a1.uSoundID = LOWORD(v3->field_10); |
486 | 5939 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 5940 { |
5941 v369 = &pActors[dword_50BF30[a2]]; | |
5942 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5943 { | |
5944 a1.vPosition.x = v369->vPosition.x; | |
5945 a1.vPosition.y = v369->vPosition.y; | |
5946 v732 = v369->uActorHeight; | |
5947 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5948 v370 = 8 * dword_50BF30[a2]; | |
486 | 5949 LOBYTE(v370) = v370 | OBJECT_Actor; |
0 | 5950 a1.field_5C = v370; |
486 | 5951 a1.Create(0, 0, 0, 0); |
0 | 5952 v732 = (int)v733 << 7; |
5953 v369->pActorBuffs[4].Apply( | |
5954 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
486 | 5955 v731, 0, 0, 0); |
0 | 5956 } |
5957 } | |
5958 goto LABEL_1056; | |
5959 case 53: | |
5960 v371 = v12 - 2; | |
5961 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
486 | 5962 amount = 0; |
0 | 5963 else |
5964 amount = 86400 * v2; | |
5965 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
5966 goto LABEL_83; | |
486 | 5967 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, 0, 65536); |
0 | 5968 v373 = v3->uPlayerID_2; |
5969 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5970 goto LABEL_1056; | |
5971 v14 = v731 == 4; | |
5972 pParty->pPlayers[v373].sHealth = 1; | |
5973 if ( v14 ) | |
5974 { | |
5975 v374 = v3->uPlayerID_2; | |
486 | 5976 LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0; |
5977 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0; | |
0 | 5978 v376 = v3->uPlayerID_2; |
486 | 5979 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0; |
5980 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0; | |
0 | 5981 } |
5982 else | |
5983 { | |
5984 v732 = amount << 7; | |
5985 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5986 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5987 0xEu, | |
5988 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5989 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5990 0xDu, | |
5991 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5992 } | |
112 | 5993 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 5994 goto LABEL_720; |
5995 case 54: | |
5996 v378 = v12 - 2; | |
5997 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
5998 v380 = 4 * v2; | |
5999 else | |
6000 v380 = 3 * v2; | |
6001 amount = v380; | |
6002 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6003 goto LABEL_83; | |
6004 v381 = 0; | |
6005 HIDWORD(v733) = amount; | |
6006 v730 = 0; | |
6007 v382 = 1; | |
6008 do | |
6009 { | |
6010 v383 = pPlayers[v382]; | |
6011 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
6012 v682[v381++] = v382; | |
6013 ++v382; | |
6014 } | |
6015 while ( v382 <= 4 ); | |
6016 v384 = 0; | |
6017 v730 = v381; | |
486 | 6018 if ( v381 > 0 ) |
0 | 6019 { |
6020 do | |
6021 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
6022 while ( v384 < v381 ); | |
6023 } | |
6024 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
486 | 6025 HIDWORD(v733) = 0; |
6026 if ( v381 > 0 ) | |
0 | 6027 { |
6028 do | |
6029 { | |
6030 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
6031 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
6032 v726 = *(Player **)v385; | |
6033 v386 = v726->GetMaxHealth(); | |
6034 if ( v726->sHealth > v386 ) | |
6035 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
6036 v387 = *(Player **)v385; | |
486 | 6037 if ( v387->sHealth > 0 ) |
0 | 6038 { |
486 | 6039 LODWORD(v387->pConditions[13]) = 0; |
6040 HIDWORD(v387->pConditions[13]) = 0; | |
0 | 6041 } |
6042 v388 = HIDWORD(v733); | |
6043 v389 = LOWORD(v682[HIDWORD(v733)]) - 1; | |
6044 v390 = v3->spellnum; | |
6045 v391 = pGame->GetStru6(); | |
6046 pGame->GetStru6()->SetPlayerBuffAnim(v390, v389); | |
6047 HIDWORD(v733) = v388 + 1; | |
6048 } | |
6049 while ( v388 + 1 < v730 ); | |
6050 } | |
6051 goto LABEL_1056; | |
6052 case 55: | |
6053 v392 = v12 - 1; | |
6054 if ( !v392 ) | |
6055 { | |
6056 v395 = 180 * v2; | |
6057 goto LABEL_750; | |
6058 } | |
6059 v393 = v392 - 1; | |
6060 if ( !v393 ) | |
6061 { | |
6062 v395 = 10800 * v2; | |
6063 goto LABEL_750; | |
6064 } | |
6065 v394 = v393 - 1; | |
6066 if ( !v394 ) | |
6067 { | |
6068 v395 = 259200 * v2; | |
6069 LABEL_750: | |
6070 amount = v395; | |
6071 goto LABEL_751; | |
6072 } | |
6073 if ( v394 == 1 ) | |
486 | 6074 amount = 0; |
0 | 6075 LABEL_751: |
6076 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6077 goto LABEL_83; | |
6078 v396 = v3->uPlayerID_2; | |
6079 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
6080 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
6081 { | |
6082 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
486 | 6083 pParty->pPlayers[v396].PlaySound(SPEECH_25, 0); |
0 | 6084 if ( v731 == 4 ) |
6085 { | |
6086 v397 = v3->uPlayerID_2; | |
486 | 6087 LODWORD(pParty->pPlayers[v397].pConditions[16]) = 0; |
6088 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = 0; | |
0 | 6089 v398 = v3->uPlayerID_2; |
486 | 6090 LODWORD(pParty->pPlayers[v398].pConditions[14]) = 0; |
6091 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = 0; | |
0 | 6092 v399 = v3->uPlayerID_2; |
486 | 6093 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0; |
6094 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0; | |
0 | 6095 } |
6096 else | |
6097 { | |
6098 v732 = amount << 7; | |
6099 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6100 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6101 0x10u, | |
6102 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6103 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6104 0xEu, | |
6105 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6106 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6107 0xDu, | |
6108 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6109 } | |
6110 v83 = 1; | |
112 | 6111 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
0 | 6112 v401 = pGame; |
6113 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; | |
6114 v402 = v3->uPlayerID_2; | |
6115 v403 = v3->spellnum; | |
6116 v404 = pGame->GetStru6(); | |
6117 pGame->GetStru6()->SetPlayerBuffAnim(v403, v402); | |
6118 } | |
6119 else | |
6120 { | |
6121 v83 = 1; | |
6122 } | |
6123 goto LABEL_978; | |
6124 case 61: | |
6125 v405 = v12 - 2; | |
6126 if ( !v405 ) | |
6127 goto LABEL_766; | |
6128 v406 = v405 - 1; | |
6129 if ( v406 ) | |
6130 { | |
6131 if ( v406 == 1 ) | |
6132 { | |
486 | 6133 amount = 0; |
0 | 6134 goto LABEL_768; |
6135 } | |
6136 LABEL_766: | |
6137 v407 = 3600 * v2; | |
6138 } | |
6139 else | |
6140 { | |
6141 v407 = 86400 * v2; | |
6142 } | |
6143 amount = v407; | |
6144 LABEL_768: | |
6145 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6146 goto LABEL_83; | |
6147 v408 = v3->uPlayerID_2; | |
6148 v409 = v3->spellnum; | |
6149 v410 = pGame->GetStru6(); | |
6150 pGame->GetStru6()->SetPlayerBuffAnim(v409, v408); | |
6151 v323 = v3->uPlayerID_2; | |
6152 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6153 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6154 goto LABEL_1056; | |
6155 if ( v731 == 4 ) | |
6156 goto LABEL_637; | |
6157 v732 = amount << 7; | |
6158 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6159 v656 = 12; | |
6160 goto LABEL_640; | |
6161 case 56: | |
6162 v411 = v12 - 2; | |
6163 if ( v411 ) | |
6164 { | |
6165 v412 = v411 - 1; | |
6166 if ( v412 ) | |
6167 { | |
6168 if ( v412 == 1 ) | |
6169 { | |
486 | 6170 amount = 0; |
0 | 6171 goto LABEL_780; |
6172 } | |
6173 v413 = 180 * v2; | |
6174 } | |
6175 else | |
6176 { | |
6177 v413 = 86400 * v2; | |
6178 } | |
6179 } | |
6180 else | |
6181 { | |
6182 v413 = 3600 * v2; | |
6183 } | |
6184 amount = v413; | |
6185 LABEL_780: | |
6186 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6187 goto LABEL_83; | |
6188 v414 = v3->uPlayerID_2; | |
6189 v415 = v3->spellnum; | |
6190 v416 = pGame->GetStru6(); | |
6191 pGame->GetStru6()->SetPlayerBuffAnim(v415, v414); | |
6192 v323 = v3->uPlayerID_2; | |
6193 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6194 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6195 goto LABEL_1056; | |
6196 if ( v731 == 4 ) | |
6197 goto LABEL_637; | |
6198 v732 = amount << 7; | |
6199 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6200 v656 = 3; | |
6201 goto LABEL_640; | |
6202 case 59: | |
6203 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6204 goto LABEL_83; | |
486 | 6205 if ( a2 == 0 || (a2 & 7) != OBJECT_Actor) |
0 | 6206 goto LABEL_1056; |
6207 v417 = (int)&pActors[a2 >> 3]; | |
6208 v730 = v417; | |
6209 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6210 { | |
6211 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6212 v417 = v730; | |
6213 } | |
6214 v418 = *(int *)(v417 + 672); | |
486 | 6215 HIDWORD(v733) = 0; |
0 | 6216 if ( pItemsTable->pItems[v418].uEquipType == 18 ) |
6217 HIDWORD(v733) = *(int *)(v417 + 684); | |
6218 | |
6219 //ItemGen::ItemGen(&v683); | |
6220 v683.Reset(); | |
6221 | |
6222 v419 = *(short *)(v730 + 180); | |
486 | 6223 if (v419) |
0 | 6224 { |
6225 v683.uItemID = v419; | |
6226 goto LABEL_799; | |
6227 } | |
6228 v420 = 0; | |
6229 v421 = v730 + 564; | |
486 | 6230 while ( !*(int *)v421 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) |
0 | 6231 { |
6232 ++v420; | |
6233 v421 += 36; | |
6234 if ( v420 >= 4 ) | |
6235 goto LABEL_799; | |
6236 } | |
6237 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6238 v2 = v723; | |
486 | 6239 //v1 = 0; |
0 | 6240 LABEL_799: |
486 | 6241 if ( HIDWORD(v733) != 0 ) |
0 | 6242 { |
6243 v675 = (const char *)HIDWORD(v733); | |
486 | 6244 if (v683.uItemID) |
0 | 6245 { |
6246 v422 = v683.GetDisplayName(); | |
6247 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6248 goto LABEL_807; | |
6249 } | |
6250 v664 = "%d gold"; | |
6251 goto LABEL_803; | |
6252 } | |
486 | 6253 if (v683.uItemID) |
0 | 6254 { |
6255 v675 = v683.GetDisplayName(); | |
6256 v664 = "(%s)"; | |
6257 LABEL_803: | |
6258 sprintf(pTmpBuf2, v664, v675); | |
6259 goto LABEL_807; | |
6260 } | |
6261 strcpy(pTmpBuf2, "nothing"); | |
6262 LABEL_807: | |
6263 ShowStatusBarString(pTmpBuf2, 2u); | |
6264 a1.stru_24.Reset(); | |
6265 a1.field_48 = v3->spellnum; | |
6266 a1.field_4C = v2; | |
6267 a1.field_50 = v731; | |
6268 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6269 a1.vPosition.x = *(short *)(v730 + 142); | |
6270 a1.vPosition.y = *(short *)(v730 + 144); | |
6271 v676 = *(short *)(v730 + 138); | |
6272 v665 = a1.vPosition.y; | |
6273 a1.vPosition.z = *(short *)(v730 + 138); | |
6274 v657 = a1.vPosition.x; | |
6275 goto LABEL_1087; | |
6276 case 62: | |
6277 v423 = v12 - 2; | |
6278 if ( !v423 ) | |
6279 goto LABEL_813; | |
6280 v424 = v423 - 1; | |
6281 if ( v424 ) | |
6282 { | |
6283 if ( v424 == 1 ) | |
6284 v425 = 3600 * v2; | |
6285 else | |
6286 LABEL_813: | |
6287 v425 = 300 * v2; | |
6288 } | |
6289 else | |
6290 { | |
6291 v425 = 600 * v2; | |
6292 } | |
6293 amount = v425; | |
6294 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6295 goto LABEL_83; | |
6296 v426 = a2 >> 3; | |
141 | 6297 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6298 goto LABEL_1056; |
6299 v730 = 836 * v426; | |
6300 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6301 { | |
90 | 6302 pActors[v426].pActorBuffs[1].Reset(); |
6303 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6304 v732 = amount << 7; |
90 | 6305 pActors[v426].pActorBuffs[9].Apply( |
0 | 6306 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6307 v731, 0, 0, 0); |
90 | 6308 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6309 } |
6310 a1.stru_24.Reset(); | |
6311 a1.field_48 = v3->spellnum; | |
6312 a1.field_4C = v2; | |
6313 a1.field_50 = v731; | |
6314 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6315 v61 = v426; |
0 | 6316 goto LABEL_1086; |
6317 case 66: | |
6318 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6319 goto LABEL_83; | |
6320 amount = 600 * v2; | |
6321 v427 = a2 >> 3; | |
141 | 6322 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6323 goto LABEL_1056; |
6324 v730 = 836 * v427; | |
6325 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6326 goto LABEL_83; | |
90 | 6327 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6328 { | |
6329 pActors[v427].pActorBuffs[9].Reset(); | |
6330 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6331 v732 = amount << 7; |
90 | 6332 pActors[v427].pActorBuffs[12].Apply( |
0 | 6333 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6334 v731, 0, 0, 0); |
0 | 6335 } |
6336 a1.stru_24.Reset(); | |
6337 a1.field_48 = v3->spellnum; | |
6338 a1.field_4C = v2; | |
6339 a1.field_50 = v731; | |
6340 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6341 v61 = v427; |
0 | 6342 goto LABEL_1086; |
6343 case 63: | |
6344 v428 = v12 - 2; | |
6345 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6346 v430 = 300 * v2; | |
6347 else | |
6348 v430 = 180 * v2; | |
6349 amount = v430; | |
6350 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6351 goto LABEL_83; | |
6352 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6353 v431 = pGame->GetStru6(); | |
6354 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | |
6355 ++a1.uItemType; | |
6356 a1.stru_24.Reset(); | |
6357 a1.field_48 = v3->spellnum; | |
6358 a1.field_4C = v2; | |
6359 a1.field_50 = v731; | |
6360 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 6361 a1.uAttributes = 0; |
6362 a1.uSectorID = 0; | |
6363 a1.uSpriteFrameID = 0; | |
0 | 6364 v432 = v3->uPlayerID; |
6365 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6366 a1.uFacing = 0; |
0 | 6367 v432 *= 8; |
303 | 6368 LOBYTE(v432) = v432 | OBJECT_Player; |
6369 a1.field_58_pid = v432; | |
0 | 6370 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6371 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 6372 { |
6373 v433 = &pActors[dword_50BF30[a2]]; | |
6374 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6375 break; | |
6376 a1.vPosition.x = v433->vPosition.x; | |
6377 a1.vPosition.y = v433->vPosition.y; | |
6378 v732 = v433->uActorHeight; | |
6379 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6380 v434 = 8 * dword_50BF30[a2]; | |
486 | 6381 LOBYTE(v434) = v434 | OBJECT_Actor; |
0 | 6382 a1.field_5C = v434; |
486 | 6383 a1.Create(0, 0, 0, 0); |
0 | 6384 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) |
6385 { | |
6386 v732 = amount << 7; | |
6387 v433->pActorBuffs[4].Apply( | |
6388 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
486 | 6389 v731, 0, 0, 0); |
0 | 6390 } |
6391 } | |
6392 goto LABEL_1056; | |
6393 case 64: | |
6394 v435 = v12 - 2; | |
6395 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
486 | 6396 amount = 0; |
0 | 6397 else |
6398 amount = 86400 * v2; | |
6399 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6400 goto LABEL_83; | |
6401 v437 = v3->uPlayerID_2; | |
6402 v438 = v3->spellnum; | |
6403 v439 = pGame->GetStru6(); | |
6404 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); | |
6405 v440 = v3->uPlayerID_2; | |
6406 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6407 { | |
6408 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
486 | 6409 pParty->pPlayers[v440].PlaySound(SPEECH_25, 0); |
0 | 6410 if ( v731 == 4 ) |
6411 { | |
6412 v441 = v3->uPlayerID_2; | |
486 | 6413 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; |
6414 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; | |
0 | 6415 } |
6416 else | |
6417 { | |
6418 v732 = amount << 7; | |
6419 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6420 5u, | |
6421 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6422 } | |
6423 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6424 LABEL_720: | |
486 | 6425 v377->SetCondition(1, 0); |
0 | 6426 } |
6427 goto LABEL_1056; | |
6428 case 42: | |
6429 v442 = v12 - 2; | |
6430 if ( !v442 ) | |
6431 goto LABEL_855; | |
6432 v443 = v442 - 1; | |
6433 if ( v443 ) | |
6434 { | |
6435 if ( v443 == 1 ) | |
6436 v444 = 4 * v2; | |
6437 else | |
6438 LABEL_855: | |
6439 v444 = 2 * v2; | |
6440 } | |
6441 else | |
6442 { | |
6443 v444 = 3 * v2; | |
6444 } | |
6445 amount = v444; | |
6446 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6447 goto LABEL_83; | |
6448 v445 = a2 >> 3; | |
141 | 6449 if ( (a2 & 7) == OBJECT_Item) |
0 | 6450 { |
6451 v449 = (char *)&pLayingItems[v445].stru_24; | |
6452 v450 = *(int *)v449; | |
6453 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6454 { | |
6455 party_finds_gold(*((int *)v449 + 3), 0); | |
6456 viewparams->bRedrawGameUI = 1; | |
6457 } | |
6458 else | |
6459 { | |
189 | 6460 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
0 | 6461 ShowStatusBarString(pTmpBuf2, 2u); |
6462 if ( !pParty->AddItem(&pLayingItems[v445].stru_24) ) | |
6463 pParty->SetHoldingItem(&pLayingItems[v445].stru_24); | |
6464 } | |
430 | 6465 LayingItem::OnItemPickup(v445); |
0 | 6466 } |
6467 else | |
6468 { | |
141 | 6469 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6470 { |
6471 stru_50C198.LootActor(&pActors[v445]); | |
6472 } | |
6473 else | |
6474 { | |
141 | 6475 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6476 { |
141 | 6477 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6478 goto LABEL_1056; |
6479 dword_507CD8 = 1; | |
6480 v677 = 1; | |
6481 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6482 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6483 else | |
6484 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6485 goto LABEL_866; | |
6486 } | |
6487 v447 = &pLevelDecorations[v445]; | |
6488 dword_507CD8 = 1; | |
6489 v448 = v447->field_16_event_id; | |
486 | 6490 if (v448) |
0 | 6491 { |
6492 v677 = 1; | |
6493 v446 = v448; | |
6494 LABEL_866: | |
6495 EventProcessor(v446, a2, v677); | |
6496 goto LABEL_1056; | |
6497 } | |
6498 if ( v447->IsInteractive() ) | |
6499 { | |
469 | 6500 GlobalEventInfo = (int)v447; |
0 | 6501 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); |
486 | 6502 GlobalEventInfo = 0; |
0 | 6503 } |
6504 } | |
6505 } | |
6506 goto LABEL_1056; | |
6507 case 67: | |
6508 v451 = v12 - 2; | |
6509 if ( v451 ) | |
6510 { | |
6511 v452 = v451 - 1; | |
6512 if ( v452 ) | |
6513 { | |
6514 if ( v452 == 1 ) | |
6515 { | |
486 | 6516 amount = 0; |
0 | 6517 goto LABEL_883; |
6518 } | |
6519 v453 = 180 * v2; | |
6520 } | |
6521 else | |
6522 { | |
6523 v453 = 86400 * v2; | |
6524 } | |
6525 } | |
6526 else | |
6527 { | |
6528 v453 = 3600 * v2; | |
6529 } | |
6530 amount = v453; | |
6531 LABEL_883: | |
6532 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6533 goto LABEL_83; | |
6534 v454 = v3->uPlayerID_2; | |
6535 v455 = v3->spellnum; | |
6536 v456 = pGame->GetStru6(); | |
6537 pGame->GetStru6()->SetPlayerBuffAnim(v455, v454); | |
6538 v323 = v3->uPlayerID_2; | |
6539 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6540 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6541 goto LABEL_1056; | |
6542 if ( v731 == 4 ) | |
6543 { | |
6544 LABEL_637: | |
486 | 6545 *(int *)v324 = 0; |
6546 *((int *)v324 + 1) = 0; | |
0 | 6547 goto LABEL_1056; |
6548 } | |
6549 v732 = amount << 7; | |
6550 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6551 v656 = 1; | |
6552 LABEL_640: | |
6553 v325 = &pParty->pPlayers[v323]; | |
6554 goto LABEL_641; | |
6555 case 68: | |
6556 v457 = v12 - 2; | |
6557 if ( v457 ) | |
6558 { | |
6559 v458 = v457 - 1; | |
6560 if ( v458 ) | |
6561 { | |
6562 if ( v458 == 1 ) | |
6563 v459 = 5 * v2 + 5; | |
6564 else | |
6565 v459 = 2 * v2 + 5; | |
6566 } | |
6567 else | |
6568 { | |
6569 v459 = 4 * v2 + 5; | |
6570 } | |
6571 } | |
6572 else | |
6573 { | |
6574 v459 = 3 * v2 + 5; | |
6575 } | |
6576 amount = v459; | |
6577 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6578 goto LABEL_83; | |
6579 v460 = *(int *)&v3->field_C; | |
486 | 6580 if (!v460) |
0 | 6581 { |
6582 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6583 LABEL_904: | |
6584 v674 = v3->uPlayerID_2; | |
6585 LABEL_685: | |
6586 v352 = v3->spellnum; | |
6587 v353 = pGame->GetStru6(); | |
6588 pGame->GetStru6()->SetPlayerBuffAnim(v352, v674); | |
6589 } | |
6590 else | |
6591 { | |
141 | 6592 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6593 { |
6594 v461 = &pActors[v460 >> 3]; | |
6595 v462 = v461->uAIState; | |
6596 v463 = v461->pMonsterInfo.uHP; | |
6597 if ( v462 != 5 ) | |
6598 { | |
6599 if ( v462 != 4 ) | |
6600 { | |
6601 if ( v462 != 19 ) | |
6602 { | |
6603 if ( v462 != 11 ) | |
6604 { | |
6605 v461->sCurrentHP += amount; | |
6606 if ( v461->sCurrentHP > v463 ) | |
6607 v461->sCurrentHP = v463; | |
6608 } | |
6609 } | |
6610 } | |
6611 } | |
6612 } | |
6613 } | |
6614 goto LABEL_1056; | |
6615 case 72: | |
6616 v464 = v12 - 2; | |
6617 if ( !v464 ) | |
6618 goto LABEL_910; | |
6619 v465 = v464 - 1; | |
6620 if ( v465 ) | |
6621 { | |
6622 if ( v465 == 1 ) | |
6623 { | |
486 | 6624 amount = 0; |
0 | 6625 goto LABEL_912; |
6626 } | |
6627 LABEL_910: | |
6628 v466 = 3600 * v2; | |
6629 } | |
6630 else | |
6631 { | |
6632 v466 = 86400 * v2; | |
6633 } | |
6634 amount = v466; | |
6635 LABEL_912: | |
6636 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6637 goto LABEL_83; | |
6638 v467 = v3->uPlayerID_2; | |
6639 v468 = v3->spellnum; | |
6640 v469 = pGame->GetStru6(); | |
6641 pGame->GetStru6()->SetPlayerBuffAnim(v468, v467); | |
6642 v470 = v3->uPlayerID_2; | |
6643 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6644 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6645 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6646 goto LABEL_1056; | |
6647 if ( v731 == 4 ) | |
6648 { | |
486 | 6649 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; |
6650 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; | |
0 | 6651 v471 = v3->uPlayerID_2; |
486 | 6652 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; |
6653 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; | |
0 | 6654 v472 = v3->uPlayerID_2; |
486 | 6655 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; |
6656 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; | |
0 | 6657 goto LABEL_1056; |
6658 } | |
6659 v732 = amount << 7; | |
6660 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6661 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6662 6u, | |
6663 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6664 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6665 8u, | |
6666 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6667 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6668 v656 = 10; | |
6669 goto LABEL_937; | |
6670 case 75: | |
6671 amount = v2; | |
6672 LODWORD(v733) = 3600 * v2; | |
6673 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6674 goto LABEL_83; | |
6675 v474 = v3->spellnum; | |
6676 v475 = pGame->GetStru6(); | |
486 | 6677 pGame->GetStru6()->SetPlayerBuffAnim(v474, 0); |
0 | 6678 v476 = v3->spellnum; |
6679 v477 = pGame->GetStru6(); | |
486 | 6680 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1); |
0 | 6681 v478 = v3->spellnum; |
6682 v479 = pGame->GetStru6(); | |
486 | 6683 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2); |
0 | 6684 v480 = v3->spellnum; |
6685 v481 = pGame->GetStru6(); | |
486 | 6686 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3); |
6687 v668 = 0; | |
0 | 6688 v732 = (int)v733 << 7; |
486 | 6689 v658 = 0; |
0 | 6690 v653 = v2; |
6691 v651 = v731; | |
6692 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6693 v27 = (char *)&pParty->pPartyBuffs[13]; | |
6694 goto LABEL_101; | |
6695 case 73: | |
6696 LODWORD(v733) = 3600 * v2; | |
6697 amount = v2; | |
6698 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6699 goto LABEL_83; | |
6700 if ( v731 == 4 ) | |
6701 { | |
6702 v482 = v3->spellnum; | |
6703 v483 = pGame->GetStru6(); | |
486 | 6704 pGame->GetStru6()->SetPlayerBuffAnim(v482, 0); |
0 | 6705 v484 = v3->spellnum; |
6706 v485 = pGame->GetStru6(); | |
486 | 6707 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1); |
0 | 6708 v486 = v3->spellnum; |
6709 v487 = pGame->GetStru6(); | |
486 | 6710 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2); |
0 | 6711 v488 = v3->spellnum; |
6712 v489 = pGame->GetStru6(); | |
486 | 6713 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3); |
0 | 6714 v732 = (int)v733 << 7; |
6715 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
486 | 6716 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6717 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6718 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6719 v668 = 0; | |
0 | 6720 v658 = v2; |
6721 v653 = v2; | |
6722 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; | |
6723 v651 = 4; | |
6724 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; | |
6725 v27 = (char *)&pParty->pPlayers[3].pPlayerBuffs[6]; | |
6726 goto LABEL_104; | |
6727 } | |
6728 v490 = v3->uPlayerID_2; | |
6729 v491 = v3->spellnum; | |
6730 v492 = pGame->GetStru6(); | |
6731 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); | |
486 | 6732 v668 = 0; |
0 | 6733 v732 = (int)v733 << 7; |
6734 v658 = v2; | |
6735 v653 = v2; | |
6736 v651 = v731; | |
6737 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6738 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; | |
6739 goto LABEL_103; | |
6740 case 74: | |
6741 v493 = v12 - 2; | |
6742 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
486 | 6743 amount = 0; |
0 | 6744 else |
6745 amount = 86400 * v2; | |
6746 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6747 goto LABEL_83; | |
6748 v495 = v3->uPlayerID_2; | |
6749 v496 = v3->spellnum; | |
6750 v497 = pGame->GetStru6(); | |
6751 pGame->GetStru6()->SetPlayerBuffAnim(v496, v495); | |
6752 v498 = v3->uPlayerID_2; | |
6753 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6754 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6755 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6756 goto LABEL_1056; | |
6757 if ( v731 == 4 ) | |
6758 { | |
486 | 6759 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; |
6760 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; | |
0 | 6761 v499 = v3->uPlayerID_2; |
486 | 6762 LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0; |
6763 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0; | |
0 | 6764 v500 = v3->uPlayerID_2; |
486 | 6765 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; |
6766 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; | |
0 | 6767 } |
6768 else | |
6769 { | |
6770 v732 = amount << 7; | |
6771 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6772 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6773 7u, | |
6774 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6775 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6776 9u, | |
6777 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6778 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6779 v656 = 11; | |
6780 LABEL_937: | |
112 | 6781 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6782 LABEL_641: |
6783 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6784 } | |
6785 goto LABEL_1056; | |
6786 case 77: | |
486 | 6787 { |
0 | 6788 amount = 5 * v2 + 10; |
6789 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6790 goto LABEL_83; | |
6791 v501 = pParty->pPlayers; | |
486 | 6792 int v1 = 0; |
0 | 6793 do |
6794 { | |
6795 v502 = v3->spellnum; | |
6796 v503 = pGame->GetStru6(); | |
6797 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); | |
6798 v501->Heal(amount); | |
6799 ++v501; | |
6800 ++v1; | |
6801 } | |
6802 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6803 goto LABEL_1056; | |
486 | 6804 } |
0 | 6805 case 80: |
6806 sRecoveryTime -= v2; | |
6807 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6808 goto LABEL_83; | |
6809 v504 = pGame->GetStru6(); | |
6810 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); | |
6811 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6812 ++a1.uItemType; | |
6813 HIDWORD(v733) = v505; | |
486 | 6814 v690 = 0; |
6815 v689 = 0; | |
6816 v688 = 0; | |
0 | 6817 a1.stru_24.Reset(); |
6818 a1.field_48 = v3->spellnum; | |
6819 a1.field_4C = v2; | |
6820 a1.field_50 = v731; | |
6821 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 6822 a1.uAttributes = 0; |
6823 a1.uSectorID = 0; | |
6824 a1.uSpriteFrameID = 0; | |
0 | 6825 v506 = v3->uPlayerID; |
6826 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6827 a1.uFacing = 0; |
0 | 6828 v506 *= 8; |
303 | 6829 LOBYTE(v506) = v506 | OBJECT_Player; |
6830 a1.field_58_pid = v506; | |
0 | 6831 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6832 a2 = 0; |
6833 if ( SHIDWORD(v733) > 0 ) | |
0 | 6834 { |
6835 do | |
6836 { | |
6837 v507 = dword_50BF30[a2]; | |
6838 a1.vPosition.x = pActors[v507].vPosition.x; | |
6839 a1.vPosition.y = pActors[v507].vPosition.y; | |
6840 v732 = pActors[v507].uActorHeight; | |
6841 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6842 v508 = 8 * dword_50BF30[a2]; | |
486 | 6843 LOBYTE(v508) = v508 | OBJECT_Actor; |
0 | 6844 a1.field_5C = v508; |
486 | 6845 v509 = a1.Create(0, 0, 0, 0); |
0 | 6846 v510 = a2; |
486 | 6847 DamageMonsterFromParty(8 * v509 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v688); |
0 | 6848 a2 = v510 + 1; |
6849 } | |
6850 while ( v510 + 1 < SHIDWORD(v733) ); | |
6851 } | |
486 | 6852 for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 ) |
0 | 6853 { |
6854 v511 = &pActors[dword_50BF30[a2]]; | |
6855 a1.vPosition.x = v511->vPosition.x; | |
6856 a1.vPosition.y = v511->vPosition.y; | |
6857 v732 = v511->uActorHeight; | |
6858 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6859 v512 = 8 * dword_50BF30[a2]; | |
486 | 6860 LOBYTE(v512) = v512 | OBJECT_Actor; |
0 | 6861 a1.field_5C = v512; |
486 | 6862 a1.Create(0, 0, 0, 0); |
0 | 6863 v513 = v511->pActorBuffs; |
6864 v726 = (Player *)22; | |
6865 do | |
6866 { | |
6867 v513->Reset(); | |
6868 ++v513; | |
6869 v726 = (Player *)((char *)v726 - 1); | |
6870 } | |
6871 while ( *(float *)&v726 != 0.0 ); | |
6872 } | |
6873 goto LABEL_1056; | |
6874 case 82: | |
6875 v514 = v12 - 2; | |
6876 if ( !v514 ) | |
6877 goto LABEL_955; | |
6878 v515 = v514 - 1; | |
6879 if ( v515 ) | |
6880 { | |
6881 if ( v515 == 1 ) | |
6882 { | |
6883 v516 = 900 * v2; | |
6884 amount = 5; | |
6885 } | |
6886 else | |
6887 { | |
6888 LABEL_955: | |
6889 v516 = 300 * v2; | |
6890 amount = 1; | |
6891 } | |
6892 } | |
6893 else | |
6894 { | |
6895 v516 = 900 * v2; | |
6896 amount = 3; | |
6897 } | |
486 | 6898 v733 = __PAIR__(0, v516); |
0 | 6899 v517 = 8 * v3->uPlayerID; |
6900 LOBYTE(v517) = v517 | 4; | |
486 | 6901 if ( (signed int)uNumActors > 0 ) |
0 | 6902 { |
90 | 6903 v518 = pActors;//[0].uAIState; |
6904 v726b = uNumActors; | |
0 | 6905 do |
6906 { | |
90 | 6907 v519 = v518->uAIState; |
6908 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6909 ++HIDWORD(v733); |
90 | 6910 ++v518; |
6911 --v726; | |
0 | 6912 } |
90 | 6913 while ( v726 != 0 ); |
0 | 6914 } |
6915 if ( SHIDWORD(v733) >= amount ) | |
6916 { | |
6917 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6918 goto LABEL_201; | |
6919 } | |
6920 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6921 goto LABEL_83; | |
6922 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); | |
6923 goto LABEL_1056; | |
6924 case 83: | |
6925 v520 = v12 - 2; | |
6926 if ( !v520 ) | |
6927 goto LABEL_973; | |
6928 v521 = v520 - 1; | |
6929 if ( v521 ) | |
6930 { | |
6931 if ( v521 == 1 ) | |
6932 { | |
6933 LODWORD(v733) = 18000 * v2; | |
6934 v522 = 5 * v2 + 10; | |
6935 } | |
6936 else | |
6937 { | |
6938 LABEL_973: | |
6939 LODWORD(v733) = 10800 * v2; | |
6940 v522 = 3 * v2 + 10; | |
6941 } | |
6942 } | |
6943 else | |
6944 { | |
6945 LODWORD(v733) = 14400 * v2; | |
6946 v522 = 4 * v2 + 10; | |
6947 } | |
6948 amount = v522; | |
6949 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6950 goto LABEL_83; | |
6951 v523 = v3->spellnum; | |
6952 v524 = pGame->GetStru6(); | |
486 | 6953 pGame->GetStru6()->SetPlayerBuffAnim(v523, 0); |
0 | 6954 v83 = 1; |
6955 v525 = v3->spellnum; | |
6956 v526 = pGame->GetStru6(); | |
486 | 6957 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1); |
0 | 6958 v527 = v3->spellnum; |
6959 v528 = pGame->GetStru6(); | |
486 | 6960 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2); |
0 | 6961 v529 = v3->spellnum; |
6962 v530 = pGame->GetStru6(); | |
486 | 6963 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3); |
6964 v673 = 0; | |
0 | 6965 v732 = (int)v733 << 7; |
486 | 6966 v662 = 0; |
0 | 6967 v655 = amount; |
6968 v652 = v731; | |
6969 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
6970 v137 = (char *)&pParty->pPartyBuffs[2]; | |
6971 goto LABEL_976; | |
6972 case 84: | |
6973 v67 = 2; | |
6974 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6975 { | |
6976 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6977 goto LABEL_202; | |
6978 } | |
6979 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
6980 goto LABEL_83; | |
6981 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6982 ++a1.uItemType; | |
6983 v726 = (Player *)v531; | |
486 | 6984 v696 = 0; |
6985 v695 = 0; | |
6986 v694 = 0; | |
0 | 6987 a1.stru_24.Reset(); |
6988 a1.field_48 = v3->spellnum; | |
6989 a1.field_4C = v2; | |
6990 a1.field_50 = v731; | |
6991 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 6992 a1.uAttributes = 0; |
6993 a1.uSectorID = 0; | |
6994 a1.uSpriteFrameID = 0; | |
0 | 6995 v532 = v3->uPlayerID; |
6996 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6997 a1.uFacing = 0; |
0 | 6998 v532 *= 8; |
303 | 6999 LOBYTE(v532) = v532 | OBJECT_Player; |
7000 a1.field_58_pid = v532; | |
0 | 7001 a1.uSoundID = LOWORD(v3->field_10); |
486 | 7002 a2 = 0; |
7003 if ( (signed int)v726 > 0 ) | |
0 | 7004 { |
7005 do | |
7006 { | |
7007 v533 = dword_50BF30[a2]; | |
7008 a1.vPosition.x = pActors[v533].vPosition.x; | |
7009 a1.vPosition.y = pActors[v533].vPosition.y; | |
7010 v732 = pActors[v533].uActorHeight; | |
7011 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7012 v534 = 8 * dword_50BF30[a2]; | |
486 | 7013 LOBYTE(v534) = v534 | OBJECT_Actor; |
0 | 7014 a1.field_5C = v534; |
486 | 7015 v535 = a1.Create(0, 0, 0, 0); |
0 | 7016 v536 = a2; |
486 | 7017 DamageMonsterFromParty(8 * v535 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v694); |
0 | 7018 a2 = v536 + 1; |
7019 } | |
7020 while ( v536 + 1 < (signed int)v726 ); | |
7021 } | |
7022 v537 = pGame->GetStru6(); | |
7023 pGame->GetStru6()->_4A8BFC(); | |
7024 goto LABEL_1056; | |
7025 case 85: | |
7026 v538 = v12 - 2; | |
7027 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
7028 { | |
7029 amount = 5 * v2; | |
7030 v540 = 18000 * v2; | |
7031 } | |
7032 else | |
7033 { | |
7034 amount = 4 * v2; | |
7035 v540 = 14400 * v2; | |
7036 } | |
7037 v730 = v540; | |
7038 LODWORD(v733) = v540; | |
7039 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7040 goto LABEL_83; | |
7041 v541 = v3->spellnum; | |
7042 v542 = pGame->GetStru6(); | |
486 | 7043 pGame->GetStru6()->SetPlayerBuffAnim(v541, 0); |
0 | 7044 v543 = v3->spellnum; |
7045 v544 = pGame->GetStru6(); | |
486 | 7046 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1); |
0 | 7047 v545 = v3->spellnum; |
7048 v546 = pGame->GetStru6(); | |
486 | 7049 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2); |
0 | 7050 v547 = v3->spellnum; |
7051 v548 = pGame->GetStru6(); | |
486 | 7052 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3); |
0 | 7053 v732 = v730 << 7; |
7054 v549 = (double)(v730 << 7) * 0.033333335; | |
7055 *((float *)&v733 + 1) = v549; | |
7056 v712 = (signed __int64)v549; | |
486 | 7057 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, 0, 0); |
7058 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
7059 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
7060 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
7061 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
7062 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
0 | 7063 v550 = v2 + 5; |
7064 pParty->pPartyBuffs[ 5].Apply( | |
7065 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
7066 v731, | |
486 | 7067 v550, 0, 0); |
7068 v668 = 0; | |
7069 v658 = 0; | |
0 | 7070 v653 = v550; |
7071 v651 = v731; | |
7072 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); | |
7073 LABEL_992: | |
7074 v27 = (char *)&pParty->pPartyBuffs[19]; | |
7075 goto LABEL_103; | |
7076 case 86: | |
7077 v551 = v12 - 2; | |
7078 if ( !v551 ) | |
7079 goto LABEL_998; | |
7080 v552 = v551 - 1; | |
7081 if ( v552 ) | |
7082 { | |
7083 if ( v552 == 1 ) | |
7084 { | |
7085 amount = 15; | |
7086 HIDWORD(v733) = 20; | |
7087 goto LABEL_1000; | |
7088 } | |
7089 LABEL_998: | |
7090 v678 = 4; | |
7091 } | |
7092 else | |
7093 { | |
7094 v678 = 12; | |
7095 } | |
7096 amount = v678; | |
7097 HIDWORD(v733) = v678; | |
7098 LABEL_1000: | |
7099 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7100 goto LABEL_83; | |
7101 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); | |
7102 v732 = (300 * amount * v2 + 60) << 7; | |
7103 v730 = v2 + 5; | |
486 | 7104 v726 = 0; |
89 | 7105 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 7106 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
7107 do | |
7108 { | |
7109 v554 = v3->spellnum; | |
7110 v555 = pGame->GetStru6(); | |
486 | 7111 pGame->GetStru6()->SetPlayerBuffAnim(v554, 0); |
0 | 7112 v556 = v3->spellnum; |
7113 v557 = pGame->GetStru6(); | |
486 | 7114 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1); |
0 | 7115 v558 = v3->spellnum; |
7116 v559 = pGame->GetStru6(); | |
486 | 7117 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2); |
0 | 7118 v560 = v3->spellnum; |
7119 v561 = pGame->GetStru6(); | |
486 | 7120 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3); |
89 | 7121 //((SpellBuff *)(v553 + 6056))->Apply( |
7122 v553->pPlayerBuffs[4].Apply( | |
0 | 7123 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
486 | 7124 v731, v730, 0, 0); |
0 | 7125 if ( *(_QWORD *)v553 ) |
7126 v726 = (Player *)1; | |
89 | 7127 ++v553; |
7128 } | |
7129 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 7130 v562 = v731; |
7131 pParty->pPartyBuffs[9].Apply( | |
7132 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
486 | 7133 v731, v730, 0, 0); |
0 | 7134 pParty->pPartyBuffs[14].Apply( |
7135 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
486 | 7136 v562, 0, 0, 0); |
0 | 7137 pParty->pPartyBuffs[15].Apply( |
7138 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | |
486 | 7139 v562, v730, 0, 0); |
7140 if (v726) | |
0 | 7141 goto LABEL_1056; |
486 | 7142 v668 = 0; |
0 | 7143 v732 = (int)y << 7; |
486 | 7144 v658 = 0; |
0 | 7145 v653 = v730; |
7146 v651 = v562; | |
7147 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 | |
7148 + (double)(signed __int64)pParty->uTimePlayed); | |
7149 v27 = (char *)&pParty->pPartyBuffs[8]; | |
7150 goto LABEL_103; | |
7151 case 88: | |
7152 amount = 3; | |
7153 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
7154 goto LABEL_200; | |
7155 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7156 goto LABEL_83; | |
486 | 7157 a2 = 0; |
0 | 7158 _this = (ItemGen *)&pPlayers[1]; |
7159 do | |
7160 { | |
7161 v563 = 0; | |
7162 do | |
7163 { | |
7164 v564 = _this->uItemID; | |
486 | 7165 *(int *)(v563 + _this->uItemID) = 0; |
0 | 7166 v563 += 8; |
486 | 7167 *(int *)(v563 + v564 - 4) = 0; |
0 | 7168 } |
7169 while ( v563 <= 128 ); | |
7170 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
7171 v566 = (Player **)_this; | |
7172 *(int *)(_this->uItemID + 6460) = v565; | |
7173 v567 = (*v566)->GetMaxMana(); | |
7174 v568 = a2; | |
7175 *(int *)(_this->uItemID + 6464) = v567; | |
7176 v569 = v3->spellnum; | |
7177 v570 = pGame->GetStru6(); | |
7178 pGame->GetStru6()->SetPlayerBuffAnim(v569, v568); | |
7179 ++a2; | |
7180 _this = (ItemGen *)((char *)_this + 4); | |
7181 } | |
7182 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
7183 v571 = pPlayer; | |
7184 v572 = (char *)&pPlayer->sAgeModifier; | |
7185 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
7186 *(short *)v572 = 120; | |
7187 else | |
7188 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
7189 sRecoveryTime += -5 * v2; | |
7190 ++v571->uNumDivineInterventionCastsThisDay; | |
7191 goto LABEL_1056; | |
7192 case 89: | |
7193 v573 = v12 - 2; | |
7194 if ( v573 ) | |
7195 { | |
7196 v574 = v573 - 1; | |
7197 if ( v574 ) | |
7198 { | |
7199 if ( v574 == 1 ) | |
7200 v575 = 5 * v2; | |
7201 else | |
7202 v575 = 2 * v2; | |
7203 } | |
7204 else | |
7205 { | |
7206 v575 = 4 * v2; | |
7207 } | |
7208 } | |
7209 else | |
7210 { | |
7211 v575 = 3 * v2; | |
7212 } | |
7213 amount = v575; | |
7214 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7215 goto LABEL_83; | |
7216 v576 = *(int *)&v3->field_C; | |
486 | 7217 if (!v576) |
0 | 7218 { |
7219 v583 = v3->uPlayerID_2; | |
7220 v584 = v3->spellnum; | |
7221 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
7222 v586 = pGame->GetStru6(); | |
7223 pGame->GetStru6()->SetPlayerBuffAnim(v584, v583); | |
7224 if ( *((_QWORD *)v585 + 14) ) | |
7225 { | |
7226 ((Player *)v585)->SetCondition(0x11u, 1); | |
7227 v587 = ((Player *)v585)->GetSexByVoice(); | |
7228 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7229 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7230 } | |
7231 goto LABEL_83; | |
7232 } | |
7233 v577 = (Player *)(v576 >> 3); | |
7234 v726 = v577; | |
7235 if ( v577 == (Player *)-1 ) | |
7236 { | |
7237 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7238 goto LABEL_201; | |
7239 } | |
7240 v578 = (int)&pActors[(int)v577]; | |
7241 v721 = v578; | |
486 | 7242 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) |
0 | 7243 goto LABEL_200; |
7244 ++a1.uItemType; | |
7245 a1.stru_24.Reset(); | |
7246 a1.field_48 = v3->spellnum; | |
7247 a1.field_4C = v2; | |
7248 a1.field_50 = v731; | |
7249 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 7250 a1.uAttributes = 0; |
7251 a1.uSectorID = 0; | |
7252 a1.uSpriteFrameID = 0; | |
0 | 7253 v580 = v3->uPlayerID; |
7254 a1.field_60_distance_related_prolly_lod = 0; | |
7255 v581 = v721; | |
7256 v580 *= 8; | |
303 | 7257 LOBYTE(v580) = v580 | OBJECT_Player; |
486 | 7258 a1.uFacing = 0; |
303 | 7259 a1.field_58_pid = v580; |
0 | 7260 a1.uSoundID = LOWORD(v3->field_10); |
7261 a1.vPosition.x = *(short *)(v721 + 142); | |
7262 a1.vPosition.y = *(short *)(v721 + 144); | |
7263 v732 = *(short *)(v721 + 138); | |
7264 v582 = 8 * (int)v726; | |
7265 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
486 | 7266 LOBYTE(v582) = 8 * (char)v726 | OBJECT_Actor; |
0 | 7267 a1.field_5C = v582; |
486 | 7268 a1.Create(0, 0, 0, 0); |
0 | 7269 if ( *(char *)(v581 + 52) > amount ) |
7270 goto LABEL_83; | |
7271 Actor::Resurrect((unsigned int)v726); | |
7272 *(char *)(v581 + 61) = 0; | |
7273 *(char *)(v581 + 53) = 0; | |
7274 *(char *)(v581 + 54) = 0; | |
7275 *(char *)(v581 + 55) = 0; | |
7276 *(char *)(v581 + 56) = 0; | |
7277 *(char *)(v581 + 57) = 0; | |
7278 *(int *)(v581 + 712) = 9999; | |
7279 *(char *)(v581 + 38) &= 0xF7u; | |
486 | 7280 *(int *)(v581 + 708) = 0; |
0 | 7281 ((SpellBuff *)(v581 + 356))->Reset(); |
7282 ((SpellBuff *)(v581 + 228))->Reset(); | |
7283 ((SpellBuff *)(v581 + 404))->Reset(); | |
7284 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7285 *(short *)(v581 + 40) = 10 * amount; | |
7286 goto LABEL_1056; | |
7287 case 91: | |
7288 v588 = v12 - 1; | |
7289 amount = 16; | |
7290 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7291 { | |
7292 if ( v590 == 1 ) | |
486 | 7293 LODWORD(v733) = 0; |
0 | 7294 } |
7295 else | |
7296 { | |
7297 LODWORD(v733) = 3600 * v2; | |
7298 } | |
7299 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7300 goto LABEL_83; | |
7301 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; | |
7302 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7303 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7304 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7305 || *(char *)(HIDWORD(v733) + 20) & 2 | |
486 | 7306 || *(int *)(HIDWORD(v733) + 12) != 0 |
7307 || *(int *)(HIDWORD(v733) + 4) != 0 | |
0 | 7308 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 |
377 | 7309 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) |
0 | 7310 goto LABEL_199; |
7311 v592 = HIDWORD(v733); | |
7312 v14 = v731 == 4; | |
7313 *(int *)(HIDWORD(v733) + 12) = 16; | |
7314 if ( !v14 ) | |
7315 { | |
7316 v732 = (int)v733 << 7; | |
7317 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7318 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7319 *(int *)(v592 + 20) |= 8u; | |
7320 } | |
7321 *(char *)(v592 + 20) |= 0x80u; | |
7322 goto LABEL_1055; | |
7323 case 93: | |
7324 v593 = v12 - 2; | |
7325 if ( !v593 ) | |
7326 goto LABEL_1062; | |
7327 v594 = v593 - 1; | |
7328 if ( v594 ) | |
7329 { | |
7330 if ( v594 == 1 ) | |
7331 amount = 9; | |
7332 else | |
7333 LABEL_1062: | |
7334 amount = 5; | |
7335 } | |
7336 else | |
7337 { | |
7338 amount = 7; | |
7339 } | |
7340 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7341 goto LABEL_83; | |
7342 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | |
7343 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7344 a1.stru_24.Reset(); | |
7345 a1.field_48 = v3->spellnum; | |
7346 a1.field_4C = v2; | |
7347 a1.field_50 = v731; | |
7348 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7349 a1.vPosition.x = pParty->vPosition.x; | |
7350 a1.vPosition.y = pParty->vPosition.y; | |
486 | 7351 a1.uAttributes = 0; |
0 | 7352 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
7353 a1.uSectorID = pIndoor->GetSector( | |
7354 pParty->vPosition.x, | |
7355 pParty->vPosition.y, | |
7356 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
486 | 7357 a1.uSpriteFrameID = 0; |
0 | 7358 v595 = 8 * v3->uPlayerID; |
303 | 7359 LOBYTE(v595) = v595 | OBJECT_Player; |
7360 a1.field_58_pid = v595; | |
0 | 7361 a1.field_5C = a2; |
7362 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7363 a1.uSoundID = LOWORD(v3->field_10); | |
7364 if ( pParty->bTurnBasedModeOn == 1 ) | |
7365 LOBYTE(a1.uAttributes) |= 4u; | |
7366 v596 = (signed int)v726 / -2; | |
7367 y = (char *)((signed int)v726 / 2); | |
7368 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7369 { | |
7370 v597 = v715.uYawAngle; | |
7371 do | |
7372 { | |
7373 a1.uFacing = v596 + v597; | |
7374 if ( a1.Create( | |
7375 v596 + v597, | |
7376 v715.uPitchAngle, | |
7377 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7378 v3->uPlayerID + 1) != -1 | |
7379 && pParty->bTurnBasedModeOn == 1 ) | |
7380 ++pTurnEngine->field_1C; | |
7381 v596 += v732; | |
7382 } | |
7383 while ( v596 <= (signed int)y ); | |
7384 } | |
7385 goto LABEL_1056; | |
7386 case 94: | |
7387 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7388 goto LABEL_83; | |
7389 if ( v731 == 1 || v731 == 2 ) | |
7390 { | |
7391 v598 = 180 * v2; | |
7392 goto LABEL_1081; | |
7393 } | |
7394 if ( v731 == 3 ) | |
7395 { | |
7396 v598 = 300 * v2; | |
7397 LABEL_1081: | |
7398 LODWORD(v733) = v598; | |
7399 goto LABEL_1082; | |
7400 } | |
7401 if ( v731 == 4 ) | |
7402 LODWORD(v733) = 29030400; | |
7403 LABEL_1082: | |
7404 v599 = a2 >> 3; | |
141 | 7405 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7406 goto LABEL_1056; |
7407 v730 = 836 * v599; | |
7408 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
7409 goto LABEL_83; | |
90 | 7410 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7411 goto LABEL_200; |
90 | 7412 pActors[v599].pActorBuffs[9].Reset(); |
7413 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7414 v732 = (int)v733 << 7; |
90 | 7415 pActors[v599].pActorBuffs[12].Apply( |
0 | 7416 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 7417 v731, 0, 0, 0); |
0 | 7418 a1.stru_24.Reset(); |
7419 a1.field_48 = v3->spellnum; | |
7420 a1.field_4C = v2; | |
7421 a1.field_50 = v731; | |
7422 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 7423 v61 = v599; |
0 | 7424 LABEL_1086: |
90 | 7425 v600 = pActors[v61].vPosition.y; |
7426 v601 = pActors[v61].vPosition.x; | |
0 | 7427 a1.uObjectDescID = v60; |
7428 a1.vPosition.x = v601; | |
90 | 7429 v602 = pActors[v61].uActorHeight; |
7430 v603 = pActors[v61].vPosition.z; | |
0 | 7431 a1.vPosition.y = v600; |
7432 v676 = v603 + v602; | |
7433 v665 = v600; | |
7434 a1.vPosition.z = v603 + v602; | |
7435 v657 = v601; | |
7436 LABEL_1087: | |
486 | 7437 a1.uAttributes = 0; |
0 | 7438 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); |
486 | 7439 a1.uSpriteFrameID = 0; |
0 | 7440 v604 = 8 * v3->uPlayerID; |
303 | 7441 LOBYTE(v604) = v604 | OBJECT_Player; |
7442 a1.field_58_pid = v604; | |
0 | 7443 a1.field_5C = a2; |
7444 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7445 a1.uFacing = LOWORD(v715.uYawAngle); | |
7446 LOWORD(v604) = LOWORD(v3->field_10); | |
7447 LOBYTE(a1.uAttributes) |= 0x80u; | |
7448 a1.uSoundID = v604; | |
486 | 7449 a1.Create(0, 0, 0, v3->uPlayerID + 1); |
0 | 7450 goto LABEL_1056; |
7451 case 96: | |
7452 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7453 goto LABEL_83; | |
486 | 7454 HIDWORD(v733) = 0; |
7455 memset(&pStru179, 0, 0xFA0u); | |
7456 _this = 0; | |
0 | 7457 v605 = (char *)pParty->pHirelings; |
7458 do | |
7459 { | |
486 | 7460 if ( *(int *)v605) |
0 | 7461 { |
7462 v606 = HIDWORD(v733)++; | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
79
diff
changeset
|
7463 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7464 } |
7465 _this = (ItemGen *)((char *)_this + 1); | |
7466 v605 += 76; | |
7467 } | |
7468 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
486 | 7469 _this = 0; |
7470 if ( (signed int)pNPCStats->uNumNewNPCs > 0) | |
0 | 7471 { |
7472 v730 = (int)pNPCStats->pNewNPCData; | |
7473 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7474 do | |
7475 { | |
7476 if ( *(char *)(v730 + 8) & 0x80 | |
486 | 7477 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) |
7478 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
0 | 7479 { |
7480 v607 = HIDWORD(v733); | |
7481 HIDWORD(v733) += 4; | |
7482 *(int *)v607 = (int)_this + 3; | |
7483 } | |
7484 _this = (ItemGen *)((char *)_this + 1); | |
7485 v730 += 76; | |
7486 } | |
7487 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7488 } | |
7489 v608 = v3->uPlayerID_2; | |
7490 if ( v608 != 4 && v608 != 5 | |
486 | 7491 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) |
0 | 7492 || v609 >= 3 ) |
7493 goto LABEL_200; | |
7494 v610 = 76 * v609; | |
486 | 7495 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; |
0 | 7496 v611 = pIconsFrameTable->FindIcon("spell96"); |
7497 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( | |
7498 v611); | |
7499 v232 = 1; | |
7500 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; | |
89 | 7501 v612 = pParty->pPlayers; |
0 | 7502 do |
7503 { | |
89 | 7504 v612->sHealth = v612->GetMaxHealth(); |
7505 v612->sMana = v612->GetMaxMana(); | |
7506 ++v612; | |
7507 } | |
7508 while ( v612 <= &pParty->pPlayers[3] ); | |
7509 v613 = &pOutdoor->ddm; | |
0 | 7510 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7511 v613 = &pIndoor->dlv; |
7512 v613->uReputation += 15; | |
7513 if ( v613->uReputation > 10000 ) | |
7514 v613->uReputation = 10000; | |
0 | 7515 LODWORD(v727) = v232; |
7516 goto LABEL_83; | |
7517 case 95: | |
486 | 7518 if ( v12 <= 0 ) |
0 | 7519 goto LABEL_1119; |
7520 if ( v12 <= 3 ) | |
7521 { | |
7522 v614 = 300 * (v2 + 12); | |
7523 } | |
7524 else | |
7525 { | |
7526 if ( v12 != 4 ) | |
7527 goto LABEL_1119; | |
7528 v614 = 900 * (v2 + 4); | |
7529 } | |
7530 LODWORD(v733) = v614; | |
7531 LABEL_1119: | |
7532 v615 = v2 + 5; | |
7533 amount = v615; | |
7534 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7535 goto LABEL_83; | |
7536 if ( v731 != 3 && v731 != 4 ) | |
7537 { | |
7538 v616 = v3->uPlayerID_2; | |
7539 v617 = v3->spellnum; | |
7540 v618 = pGame->GetStru6(); | |
7541 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); | |
486 | 7542 v668 = 0; |
0 | 7543 v658 = v716; |
7544 v732 = (int)v733 << 7; | |
7545 v653 = v615; | |
7546 v651 = v731; | |
7547 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7548 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; | |
7549 goto LABEL_103; | |
7550 } | |
486 | 7551 a2 = 0; |
0 | 7552 v732 = (int)v733 << 7; |
7553 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7554 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7555 do |
7556 { | |
7557 v620 = a2; | |
7558 v621 = v3->spellnum; | |
7559 v622 = pGame->GetStru6(); | |
7560 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); | |
486 | 7561 v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); |
0 | 7562 ++a2; |
112 | 7563 ++v619; |
7564 } | |
7565 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7566 goto LABEL_1056; |
7567 case 99: | |
7568 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7569 goto LABEL_83; | |
486 | 7570 v726 = 0; |
0 | 7571 pGame->GetIndoorCamera(); |
7572 v623 = (signed __int64)GetPickDepth(); | |
7573 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
486 | 7574 v709 = 0; |
7575 v708 = 0; | |
7576 v707 = 0; | |
0 | 7577 a1.stru_24.Reset(); |
7578 a1.field_48 = v3->spellnum; | |
7579 a1.field_4C = v2; | |
7580 a1.field_50 = v731; | |
7581 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 7582 a1.uAttributes = 0; |
7583 a1.uSectorID = 0; | |
7584 a1.uSpriteFrameID = 0; | |
0 | 7585 v624 = v3->uPlayerID; |
7586 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 7587 a1.uFacing = 0; |
0 | 7588 v624 *= 8; |
303 | 7589 LOBYTE(v624) = v624 | OBJECT_Player; |
7590 a1.field_58_pid = v624; | |
0 | 7591 a1.uSoundID = LOWORD(v3->field_10); |
486 | 7592 a2 = 0; |
7593 if ( SHIDWORD(v733) > 0 ) | |
0 | 7594 { |
7595 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7596 do | |
7597 { | |
7598 v625 = dword_50BF30[a2]; | |
7599 a1.vPosition.x = pActors[v625].vPosition.x; | |
7600 a1.vPosition.y = pActors[v625].vPosition.y; | |
7601 v732 = pActors[v625].uActorHeight; | |
7602 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7603 v626 = 8 * dword_50BF30[a2]; | |
486 | 7604 LOBYTE(v626) = v626 | OBJECT_Actor; |
0 | 7605 a1.field_5C = v626; |
486 | 7606 v627 = a1.Create(0, 0, 0, 0); |
0 | 7607 v628 = a2; |
7608 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7609 a2 = v628 + 1; | |
7610 } | |
7611 while ( v628 + 1 < SHIDWORD(v733) ); | |
7612 } | |
486 | 7613 v730 = 0; |
0 | 7614 v629 = 1; |
7615 do | |
7616 { | |
7617 v630 = pPlayers[v629]; | |
7618 if ( !v630->pConditions[2] | |
7619 && !v630->pConditions[12] | |
7620 && !v630->pConditions[13] | |
7621 && !v630->pConditions[14] | |
7622 && !v630->pConditions[15] | |
7623 && !v630->pConditions[16] ) | |
7624 { | |
7625 v631 = v730++; | |
7626 v681[v631] = v629; | |
7627 } | |
7628 ++v629; | |
7629 } | |
7630 while ( v629 <= 4 ); | |
7631 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
486 | 7632 HIDWORD(v733) = 0; |
7633 if ( v730 > 0 ) | |
0 | 7634 { |
7635 do | |
7636 { | |
7637 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7638 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7639 v633->sHealth += v732; | |
7640 v726 = *(Player **)v632; | |
7641 v634 = v726->GetMaxHealth(); | |
7642 if ( v726->sHealth > v634 ) | |
7643 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7644 v635 = HIDWORD(v733); | |
7645 v636 = WORD2(v733); | |
7646 v637 = v3->spellnum; | |
7647 v638 = pGame->GetStru6(); | |
7648 pGame->GetStru6()->SetPlayerBuffAnim(v637, v636); | |
7649 HIDWORD(v733) = v635 + 1; | |
7650 } | |
7651 while ( v635 + 1 < v730 ); | |
7652 } | |
7653 v639 = pGame->GetStru6(); | |
486 | 7654 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); |
0 | 7655 goto LABEL_1056; |
7656 case 98: | |
7657 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7658 { | |
7659 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7660 goto LABEL_201; | |
7661 } | |
7662 v640 = v12 - 2; | |
7663 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7664 amount = 3; | |
486 | 7665 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) |
0 | 7666 goto LABEL_200; |
7667 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
7668 goto LABEL_83; | |
349 | 7669 pParty->armageddon_timer = 256; |
0 | 7670 pParty->field_16140 = v2; |
7671 ++pPlayer->uNumArmageddonCasts; | |
7672 if ( pParty->bTurnBasedModeOn == 1 ) | |
7673 ++pTurnEngine->field_1C; | |
7674 v726 = (Player *)50; | |
7675 do | |
7676 { | |
7677 v642 = rand() % 4096 - 2048; | |
7678 v643 = rand(); | |
7679 v721 = v642 + pParty->vPosition.x; | |
7680 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
486 | 7681 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0); |
0 | 7682 v644 = rand(); |
486 | 7683 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0); |
0 | 7684 v726 = (Player *)((char *)v726 - 1); |
7685 } | |
7686 while ( *(float *)&v726 != 0.0 ); | |
7687 goto LABEL_1056; | |
7688 default: | |
7689 goto LABEL_83; | |
7690 } | |
7691 while ( 2 ) | |
7692 { | |
7693 if ( v731 == 4 ) | |
7694 { | |
7695 if ( *((_QWORD *)v222 + 2) ) | |
7696 { | |
486 | 7697 *((int *)v222 + 4) = 0; |
7698 *((int *)v222 + 5) = 0; | |
0 | 7699 goto LABEL_439; |
7700 } | |
7701 } | |
7702 else | |
7703 { | |
7704 v732 = amount << 7; | |
7705 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7706 2u, | |
7707 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7708 v222 = (char *)HIDWORD(v733); | |
7709 if ( v223 ) | |
7710 LABEL_439: | |
486 | 7711 ((Player *)v222)->PlaySound(SPEECH_103, 0); |
0 | 7712 } |
7713 v222 += 6972; | |
7714 HIDWORD(v733) = (int)v222; | |
7715 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7716 goto LABEL_1056; | |
7717 continue; | |
7718 } | |
7719 } | |
486 | 7720 if ( pParty->bTurnBasedModeOn == 0 ) |
0 | 7721 { |
7722 v646 = pPlayer; | |
7723 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
7724 v647 = n; | |
7725 } | |
7726 else | |
7727 { | |
7728 v647 = n; | |
7729 v646 = pPlayer; | |
7730 v648 = sRecoveryTime; | |
7731 v649 = pPlayer; | |
7732 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
7733 v649->SetRecoveryTime(v648); | |
7734 pTurnEngine->_40471C(); | |
7735 } | |
7736 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
486 | 7737 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
7738 v711[v647].spellnum = 0; | |
0 | 7739 v646->sMana -= uRequiredMana; |
7740 } | |
7741 //----- (0042EB42) -------------------------------------------------------- | |
7742 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7743 { | |
7744 unsigned int v2; // edx@1 | |
7745 signed int v3; // eax@1 | |
7746 char *v4; // ecx@2 | |
7747 | |
7748 v2 = this->uNumObjects; | |
7749 v3 = 0; | |
7750 if ( (signed int)this->uNumObjects <= 0 ) | |
7751 { | |
7752 LABEL_5: | |
7753 LOWORD(v3) = 0; | |
7754 } | |
7755 else | |
7756 { | |
7757 v4 = (char *)&this->pObjects->uObjectID; | |
7758 while ( uItemID != *(short *)v4 ) | |
7759 { | |
7760 ++v3; | |
7761 v4 += 56; | |
7762 if ( v3 >= (signed int)v2 ) | |
7763 goto LABEL_5; | |
7764 } | |
7765 } | |
7766 return v3; | |
7767 } | |
7768 | |
7769 | |
7770 | |
7771 //----- (0042EB78) -------------------------------------------------------- | |
7772 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7773 { | |
7774 return 8 * this->pIcons[uIconID].uAnimLength; | |
7775 } | |
7776 | |
437 | 7777 |
7778 const wchar_t *UIMessage2String(UIMessageType msg) | |
7779 { | |
7780 #define CASE(xxx) case xxx: _swprintf(b, L"%03X/%s", msg, L#xxx); return b; | |
7781 static wchar_t b[256]; // bad for threads | |
7782 switch (msg) | |
7783 { | |
7784 CASE(UIMSG_SelectSpell) | |
7785 CASE(UIMSG_ChangeGameState) | |
7786 CASE(UIMSG_Attack) | |
7787 CASE(UIMSG_PlayArcomage) | |
7788 CASE(UIMSG_MainMenu_ShowPartyCreationWnd) | |
7789 CASE(UIMSG_MainMenu_ShowLoadWindow) | |
7790 CASE(UIMSG_ShowCredits) | |
7791 CASE(UIMSG_ExitToWindows) | |
7792 CASE(UIMSG_PlayerCreationChangeName) | |
7793 CASE(UIMSG_PlayerCreationClickPlus) | |
7794 CASE(UIMSG_PlayerCreationClickMinus) | |
7795 CASE(UIMSG_PlayerCreationSelectActiveSkill) | |
7796 CASE(UIMSG_PlayerCreationSelectClass) | |
7797 CASE(UIMSG_PlayerCreationClickOK) | |
7798 CASE(UIMSG_PlayerCreationClickReset) | |
7799 CASE(UIMSG_AutonotesBook) | |
7800 CASE(UIMSG_PlayerCreationRemoveUpSkill) | |
7801 CASE(UIMSG_PlayerCreationRemoveDownSkill) | |
7802 CASE(UIMSG_SPellbook_ShowHightlightedSpellInfo) | |
7803 CASE(UIMSG_LoadGame) | |
7804 CASE(UIMSG_SaveGame) | |
7805 CASE(UIMSG_ShowStatus_DateTime) | |
7806 CASE(UIMSG_ShowStatus_ManaHP) | |
7807 CASE(UIMSG_ShowStatus_Player) | |
7808 CASE(UIMSG_Wait5Minutes) | |
7809 CASE(UIMSG_Wait1Hour) | |
7810 CASE(UIMSG_ShowStatus_Food) | |
7811 CASE(UIMSG_ShowStatus_Funds) | |
7812 CASE(UIMSG_QuickReference) | |
7813 CASE(UIMSG_GameMenuButton) | |
7814 CASE(UIMSG_AlreadyResting) | |
7815 CASE(UIMSG_SelectCharacter) | |
7816 CASE(UIMSG_ChangeSoundVolume) | |
7817 CASE(UIMSG_ChangeMusicVolume) | |
7818 CASE(UIMSG_Escape) | |
7819 CASE(UIMSG_PlayerCreation_SelectAttribute) | |
7820 CASE(UIMSG_InventoryLeftClick) | |
7821 CASE(UIMSG_SkillUp) | |
7822 CASE(UIMSG_GameMenu_ReturnToGame) | |
7823 CASE(UIMSG_StartNewGame) | |
7824 CASE(UIMSG_Game_OpenLoadGameDialog) | |
7825 CASE(UIMSG_Game_OpenSaveGameDialog) | |
7826 CASE(UIMSG_Game_OpenOptionsDialog) | |
7827 CASE(UIMSG_SetGraphicsMode) | |
7828 CASE(UIMSG_Quit) | |
7829 CASE(UIMSG_StartHireling1Dialogue) | |
7830 CASE(UIMSG_StartHireling2Dialogue) | |
7831 CASE(UIMSG_SelectDialogueOption) | |
7832 CASE(UIMSG_CastSpellFromBook) | |
7833 CASE(UIMSG_PlayerCreation_VoicePrev) | |
7834 CASE(UIMSG_PlayerCreation_VoiceNext) | |
7835 CASE(UIMSG_StartNPCDialogue) | |
7836 CASE(UIMSG_ArrowUp) | |
7837 CASE(UIMSG_DownArrow) | |
7838 CASE(UIMSG_LoadSlot) | |
7839 CASE(UIMSG_SelectLoadSlot) | |
7840 CASE(UIMSG_Cancel) | |
7841 CASE(UIMSG_ExitRest) | |
7842 CASE(UIMSG_PlayerCreation_FacePrev) | |
7843 CASE(UIMSG_PlayerCreation_FaceNext) | |
7844 CASE(UIMSG_CycleCharacters) | |
7845 CASE(UIMSG_SetTurnSpeed) | |
7846 CASE(UIMSG_ToggleWalkSound) | |
7847 CASE(UIMSG_ChangeVoiceVolume) | |
7848 CASE(UIMSG_ToggleShowDamage) | |
7849 CASE(UIMSG_ScrollNPCPanel) | |
7850 CASE(UIMSG_ShowFinalWindow) | |
7851 CASE(UIMSG_OpenQuestBook) | |
7852 CASE(UIMSG_OpenAutonotes) | |
7853 CASE(UIMSG_OpenMapBook) | |
7854 CASE(UIMSG_OpenCalendar) | |
7855 CASE(UIMSG_OpenHistoryBook) | |
7856 CASE(UIMSG_ToggleAlwaysRun) | |
7857 CASE(UIMSG_ToggleFlipOnExit) | |
7858 CASE(UIMSG_Game_Action) | |
7859 CASE(UIMSG_OpenRestUI) | |
7860 CASE(UIMSG_TransitionUI_Confirm) | |
7861 CASE(UIMSG_OpenKeyMappingOptions) | |
7862 CASE(UIMSG_SelectKeyPage1) | |
7863 CASE(UIMSG_SelectKeyPage2) | |
7864 CASE(UIMSG_ResetKeyMapping) | |
7865 CASE(UIMSG_ChangeKeyButton) | |
7866 CASE(UIMSG_OpenVideoOptions) | |
7867 CASE(UIMSG_ToggleBloodsplats) | |
7868 CASE(UIMSG_ToggleColoredLights) | |
7869 CASE(UIMSG_ToggleTint) | |
7870 default: | |
7871 _swprintf(b, L"UIMSG_%03X", msg); return b; | |
7872 }; | |
7873 #undef CASE | |
7874 } | |
7875 | |
7876 | |
0 | 7877 //----- (0042EB8D) -------------------------------------------------------- |
437 | 7878 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |
0 | 7879 { |
482 | 7880 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); |
0 | 7881 if (uNumMessages < 40) |
7882 { | |
437 | 7883 files[uNumMessages] = file; |
7884 lines[uNumMessages] = line; | |
7885 | |
0 | 7886 pMessages[uNumMessages].eType = msg; |
7887 pMessages[uNumMessages].param = param; | |
7888 pMessages[uNumMessages++].field_8 = a4; | |
7889 } | |
7890 } | |
7891 | |
7892 //----- (0042EBBE) -------------------------------------------------------- | |
7893 int __fastcall sub_42EBBE(int a1, int a2) | |
7894 { | |
7895 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7896 } | |
7897 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7898 | |
7899 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 7900 int stru193_math::Sin(int angle) |
0 | 7901 { |
323 | 7902 return Cos(angle - this->uIntegerHalfPi); |
0 | 7903 } |
7904 | |
7905 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 7906 void _42ECB5_PlayerAttacksActor() |
0 | 7907 { |
271 | 7908 //unsigned int v0; // ebx@1 |
7909 //Player *v1; // esi@1 | |
7910 //bool result; // eax@1 | |
295 | 7911 //int v3; // edi@2 |
271 | 7912 //unsigned int v4; // eax@7 |
0 | 7913 char *v5; // eax@8 |
271 | 7914 //int v6; // ecx@9 |
7915 //signed int v7; // eax@16 | |
295 | 7916 //Actor *v8; // edi@20 |
0 | 7917 unsigned int v9; // ecx@21 |
295 | 7918 //char *v10; // eax@26 |
0 | 7919 char *v11; // eax@26 |
7920 unsigned int v12; // eax@47 | |
295 | 7921 //char *v13; // eax@47 |
7922 //char *v14; // eax@47 | |
7923 //unsigned int v15; // ebx@54 | |
7924 //int v16; // [sp-10h] [bp-4Ch]@24 | |
7925 //int v17; // [sp-10h] [bp-4Ch]@44 | |
7926 //unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7927 //unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7928 //__int16 v20; // [sp-8h] [bp-44h]@24 | |
7929 //__int16 v21; // [sp-8h] [bp-44h]@44 | |
7930 //int v22; // [sp-4h] [bp-40h]@24 | |
7931 //int v23; // [sp-4h] [bp-40h]@44 | |
0 | 7932 SoundID v24; // [sp-4h] [bp-40h]@58 |
295 | 7933 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 |
271 | 7934 //unsigned int a2; // [sp+18h] [bp-24h]@20 |
7935 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
295 | 7936 //int v28; // [sp+20h] [bp-1Ch]@9 |
271 | 7937 //unsigned int *v28b; |
295 | 7938 //int v29; // [sp+24h] [bp-18h]@16 |
7939 //int v30; // [sp+28h] [bp-14h]@16 | |
271 | 7940 //int v31; // [sp+2Ch] [bp-10h]@4 |
295 | 7941 //int v32; // [sp+30h] [bp-Ch]@7 |
271 | 7942 //int v33; // [sp+34h] [bp-8h]@7 |
295 | 7943 //int v34; // [sp+38h] [bp-4h]@17 |
0 | 7944 |
271 | 7945 //v0 = uActiveCharacter; |
7946 //v27 = 6972 * uActiveCharacter; | |
7947 //v1 = &pParty->pPlayers[uActiveCharacter-1]; | |
7948 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); | |
7949 auto player = &pParty->pPlayers[uActiveCharacter - 1]; | |
7950 if (!player->CanAct()) | |
7951 return; | |
7952 | |
7953 pStru277->_427D48(uActiveCharacter); | |
295 | 7954 //v3 = 0; |
271 | 7955 if (pParty->Invisible()) |
7956 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
7957 | |
7958 //v31 = player->pEquipment.uBow; | |
7959 int bow_idx = player->pEquipment.uBow; | |
7960 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) | |
7961 bow_idx = 0; | |
7962 | |
295 | 7963 //v32 = 0; |
7964 int wand_item_id = 0; | |
271 | 7965 //v33 = 0; |
7966 //v4 = v1->pEquipment.uMainHand; | |
7967 int laser_weapon_item_id = 0; | |
7968 | |
7969 int main_hand_idx = player->pEquipment.uMainHand; | |
7970 if (main_hand_idx) | |
0 | 7971 { |
271 | 7972 auto item = &player->pInventoryItems[main_hand_idx - 1]; |
112 | 7973 //v5 = (char *)v1 + 36 * v4; |
271 | 7974 if (!item->Broken()) |
7975 { | |
7976 //v28b = &v1->pInventoryItems[v4].uItemID; | |
7977 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
295 | 7978 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND) |
0 | 7979 { |
295 | 7980 if (item->uNumCharges <= 0) |
7981 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 7982 else |
295 | 7983 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 7984 } |
271 | 7985 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
7986 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 7987 } |
271 | 7988 } |
7989 | |
295 | 7990 //v30 = 0; |
7991 //v29 = 0; | |
7992 //v28 = 0; | |
271 | 7993 //v7 = pMouse->uPointingObjectID; |
7994 | |
7995 int target_pid = pMouse->uPointingObjectID; | |
7996 int target_type = target_pid & 7, | |
7997 target_id = target_pid >> 3; | |
7998 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) | |
7999 { | |
8000 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
8001 target_type = target_pid & 7; | |
8002 target_id = target_pid >> 3; | |
8003 } | |
295 | 8004 |
8005 auto actor = &pActors[target_id]; | |
8006 int actor_distance = 0; | |
271 | 8007 if (target_type == OBJECT_Actor) |
8008 { | |
295 | 8009 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
8010 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
8011 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
8012 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
8013 if (actor_distance < 0) | |
8014 actor_distance = 0; | |
8015 } | |
8016 | |
8017 bool shooting_bow = false, | |
8018 shotting_laser = false, | |
8019 shooting_wand = false; | |
8020 if (laser_weapon_item_id) | |
8021 { | |
8022 shotting_laser = true; | |
8023 _42777D_CastSpell_UseWand_ShootArrow(102, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); | |
8024 } | |
8025 else if (wand_item_id) | |
8026 { | |
8027 shooting_wand = true; | |
8028 | |
8029 int main_hand_idx = player->pEquipment.uMainHand; | |
8030 _42777D_CastSpell_UseWand_ShootArrow(*((int *)&pSpellDatas[66].field_8 + player->pInventoryItems[main_hand_idx - 1].uItemID), uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); | |
8031 | |
8032 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | |
8033 player->pEquipment.uMainHand = 0; | |
8034 } | |
303 | 8035 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 8036 { |
303 | 8037 Vec3_int_ a3; |
8038 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
8039 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
8040 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
8041 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
8042 | |
8043 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); | |
305 | 8044 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) |
295 | 8045 _42FA66_do_explosive_impact( |
8046 actor->vPosition.x, | |
8047 actor->vPosition.y, | |
8048 actor->vPosition.z + actor->uActorHeight / 2, | |
8049 0, 512, uActiveCharacter); | |
303 | 8050 } |
8051 else if (bow_idx) | |
8052 { | |
8053 shooting_bow = true; | |
8054 _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); | |
295 | 8055 } |
8056 else | |
8057 { | |
303 | 8058 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
8059 } | |
8060 | |
8061 if (!pParty->bTurnBasedModeOn) | |
8062 { | |
8063 int recovery = player->GetAttackRecoveryTime(0); | |
8064 if (recovery < 30 ) | |
8065 recovery = 30; | |
8066 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); | |
295 | 8067 } |
8068 | |
8069 | |
8070 int v34 = 0; | |
8071 if (shooting_wand) | |
8072 return; | |
8073 else if (shooting_bow) | |
8074 { | |
8075 v34 = 5; | |
8076 player->PlaySound(SPEECH_50, 0); | |
8077 } | |
8078 if (shotting_laser) | |
8079 v34 = 7; | |
8080 else | |
8081 { | |
8082 int main_hand_idx = player->pEquipment.uMainHand; | |
8083 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) | |
8084 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType; | |
8085 pTurnEngine->_40471C(); | |
8086 } | |
8087 | |
8088 switch (v34) | |
8089 { | |
8090 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
8091 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
8092 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
8093 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
8094 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
8095 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
8096 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
8097 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
8098 } | |
0 | 8099 } |
8100 | |
8101 //----- (0042F184) -------------------------------------------------------- | |
295 | 8102 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 8103 { |
8104 int v4; // edi@1 | |
8105 stru319 *v5; // esi@1 | |
8106 int v6; // eax@2 | |
8107 int v7; // eax@4 | |
8108 int result; // eax@5 | |
8109 int *v9; // edx@8 | |
8110 signed int v10; // ebx@10 | |
8111 int v11; // edi@11 | |
8112 Actor *v12; // esi@12 | |
8113 unsigned __int16 v13; // ax@12 | |
8114 int v14; // eax@22 | |
8115 char v15; // zf@30 | |
8116 int v16; // esi@32 | |
8117 int v17; // ecx@34 | |
8118 stru319 *v18; // eax@39 | |
8119 int v19; // edx@39 | |
8120 int v20; // ecx@41 | |
8121 unsigned __int16 v21; // ax@42 | |
8122 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
8123 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
8124 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
8125 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
8126 int *v26; // [sp+18h] [bp-14h]@8 | |
8127 int v27; // [sp+1Ch] [bp-10h]@10 | |
8128 int *v28; // [sp+20h] [bp-Ch]@10 | |
8129 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
8130 int v30; // [sp+28h] [bp-4h]@6 | |
8131 int i; // [sp+38h] [bp+Ch]@33 | |
8132 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
8133 | |
8134 v4 = 0; | |
8135 v5 = this; | |
8136 v24 = this; | |
8137 if ( pRenderer->pRenderD3D ) | |
8138 { | |
8139 v6 = a3 != 0; | |
8140 if ( a4 ) | |
8141 LOBYTE(v6) = v6 | 8; | |
295 | 8142 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 8143 if ( v7 != -1 ) |
8144 return (unsigned __int16)v7; | |
295 | 8145 else return 0; |
0 | 8146 } |
8147 else | |
8148 { | |
8149 v30 = 0; | |
8150 if ( pRenderer->pActiveZBuffer ) | |
8151 { | |
8152 v29 = viewparams->uScreenX; | |
8153 v23 = viewparams->uScreenZ; | |
8154 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
8155 { | |
8156 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
8157 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8158 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
8159 do | |
8160 { | |
8161 if ( (signed int)v29 < (signed int)v23 ) | |
8162 { | |
8163 v28 = v9; | |
8164 v10 = v4; | |
8165 v27 = v23 - v29; | |
8166 do | |
8167 { | |
8168 v22 = *v28; | |
8169 v11 = *v28 & 0xFFFF; | |
141 | 8170 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 8171 { |
8172 v12 = &pActors[(unsigned int)v11 >> 3]; | |
8173 v13 = v12->uAIState; | |
8174 if ( v13 != 5 ) | |
8175 { | |
8176 if ( v13 != 4 | |
8177 && v13 != 11 | |
8178 && v13 != 19 | |
8179 && v13 != 17 | |
8180 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
8181 { | |
8182 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
295 | 8183 && v22 <= pick_depth << 16 ) |
0 | 8184 { |
8185 v14 = 0; | |
8186 if ( v10 > 0 ) | |
8187 { | |
8188 do | |
8189 { | |
8190 if ( dword_50BDA0[v14] == v11 ) | |
8191 break; | |
8192 ++v14; | |
8193 } | |
8194 while ( v14 < v30 ); | |
8195 } | |
8196 if ( v14 == v30 && v10 < 100 ) | |
8197 { | |
8198 ++v30; | |
8199 dword_50BC10[v10] = v22; | |
8200 dword_50BDA0[v10] = v11; | |
8201 ++v10; | |
8202 } | |
8203 } | |
8204 } | |
8205 } | |
8206 } | |
8207 ++v28; | |
8208 --v27; | |
8209 } | |
8210 while ( v27 ); | |
8211 v4 = v30; | |
8212 v5 = v24; | |
8213 } | |
8214 v9 = v26 + 640; | |
8215 v15 = v25-- == 1; | |
8216 v26 += 640; | |
8217 } | |
8218 while ( !v15 ); | |
8219 } | |
8220 if ( v4 > 0 ) | |
8221 { | |
8222 v32 = 1; | |
8223 v16 = (int)dword_50BC10; | |
8224 do | |
8225 { | |
8226 for ( i = v32; i < v4; ++i ) | |
8227 { | |
8228 v17 = dword_50BC10[i]; | |
8229 if ( v17 < *(int *)v16 ) | |
8230 { | |
8231 dword_50BC10[i] = *(int *)v16; | |
8232 *(int *)v16 = v17; | |
8233 } | |
8234 } | |
8235 ++v32; | |
8236 v16 += 4; | |
8237 } | |
8238 while ( v32 - 1 < v4 ); | |
8239 v5 = v24; | |
8240 if ( v4 > 0 ) | |
8241 { | |
8242 v18 = v24; | |
8243 v19 = v4; | |
8244 do | |
8245 { | |
8246 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
8247 v18 += 4; | |
8248 --v19; | |
8249 } | |
8250 while ( v19 ); | |
8251 } | |
8252 } | |
8253 v20 = 0; | |
8254 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
8255 { | |
8256 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8257 if ( v21 != 4 && v21 != 5 ) | |
8258 break; | |
8259 } | |
8260 if ( v20 != v4 ) | |
8261 { | |
8262 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8263 LOBYTE(result) = result | 3; | |
8264 return result; | |
8265 } | |
8266 } | |
8267 } | |
8268 return 0; | |
8269 } | |
8270 | |
8271 | |
8272 //----- (0042F3D6) -------------------------------------------------------- | |
8273 void InitializeTurnBasedAnimations(void *_this) | |
8274 { | |
8275 unsigned int *v1; // edi@1 | |
8276 | |
8277 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8278 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8279 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8280 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8281 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8282 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8283 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8284 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8285 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8286 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8287 v1 = pIconIDs_Turn; | |
8288 do | |
8289 { | |
8290 pIconsFrameTable->InitializeAnimation(*v1); | |
8291 ++v1; | |
8292 } | |
8293 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8294 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8295 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8296 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8297 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8298 } | |
8299 | |
8300 //----- (0042F4DA) -------------------------------------------------------- | |
8301 signed int __cdecl sub_42F4DA() | |
8302 { | |
8303 signed int v0; // edi@1 | |
82 | 8304 Actor *v1; // esi@4 |
0 | 8305 int v2; // ebx@5 |
8306 int v3; // eax@5 | |
8307 int v4; // ebx@5 | |
8308 unsigned int v5; // ecx@5 | |
8309 int v6; // edx@6 | |
8310 unsigned int v7; // edx@8 | |
8311 unsigned int v8; // edx@10 | |
8312 __int16 v9; // ax@12 | |
8313 signed int result; // eax@20 | |
8314 int v11; // [sp+Ch] [bp-10h]@5 | |
8315 int v12; // [sp+10h] [bp-Ch]@5 | |
8316 signed int v13; // [sp+14h] [bp-8h]@3 | |
8317 | |
8318 v0 = 5120; | |
8319 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8320 v0 = 2560; | |
8321 v13 = 0; | |
8322 if ( (signed int)uNumActors <= 0 ) | |
8323 { | |
8324 LABEL_20: | |
8325 result = 0; | |
8326 } | |
8327 else | |
8328 { | |
82 | 8329 v1 = pActors; |
0 | 8330 while ( 1 ) |
8331 { | |
82 | 8332 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8333 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8334 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8335 v3 = v2; |
8336 v4 = v11; | |
8337 v5 = v12; | |
8338 if ( v3 < v11 ) | |
8339 { | |
8340 v6 = v3; | |
8341 v3 = v11; | |
8342 v4 = v6; | |
8343 } | |
8344 if ( v3 < v12 ) | |
8345 { | |
8346 v7 = v3; | |
8347 v3 = v12; | |
8348 v5 = v7; | |
8349 } | |
8350 if ( v4 < (signed int)v5 ) | |
8351 { | |
8352 v8 = v5; | |
8353 v5 = v4; | |
8354 v4 = v8; | |
8355 } | |
8356 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8357 { | |
82 | 8358 v9 = v1->uAIState; |
8359 if ( v1->uAIState != 5 ) | |
0 | 8360 { |
8361 if ( v9 != 4 | |
8362 && v9 != 11 | |
8363 && v9 != 19 | |
8364 && v9 != 17 | |
82 | 8365 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8366 break; |
8367 } | |
8368 } | |
8369 ++v13; | |
82 | 8370 ++v1; |
0 | 8371 if ( v13 >= (signed int)uNumActors ) |
8372 goto LABEL_20; | |
8373 } | |
8374 result = 1; | |
8375 } | |
8376 return result; | |
8377 } | |
8378 | |
8379 //----- (0042F5ED) -------------------------------------------------------- | |
8380 int LayingItem::Create(int yaw, int pitch, int a4, int a5) | |
8381 { | |
8382 LayingItem *v5; // eax@1 | |
8383 signed int v6; // ebx@2 | |
8384 char *v7; // ecx@2 | |
8385 signed int result; // eax@6 | |
8386 LayingItem *v9; // ebx@7 | |
8387 int v10; // edx@11 | |
8388 int v11; // edi@18 | |
8389 __int16 v12; // ax@18 | |
8390 int v13; // ST2C_4@20 | |
8391 int v14; // eax@20 | |
8392 int v15; // [sp-28h] [bp-38h]@14 | |
8393 int v16; // [sp-24h] [bp-34h]@11 | |
8394 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 | |
8395 int *v18; // [sp-14h] [bp-24h]@11 | |
8396 int *v19; // [sp-10h] [bp-20h]@11 | |
8397 int *v20; // [sp-Ch] [bp-1Ch]@11 | |
8398 signed int v21; // [sp+8h] [bp-8h]@2 | |
8399 int angle; // [sp+Ch] [bp-4h]@1 | |
8400 int a4a; // [sp+1Ch] [bp+Ch]@20 | |
8401 int a4b; // [sp+1Ch] [bp+Ch]@20 | |
8402 int a5a; // [sp+20h] [bp+10h]@20 | |
8403 | |
8404 auto a1 = this; | |
8405 angle = yaw; | |
8406 v5 = a1; | |
8407 if ( !a1->uObjectDescID ) | |
8408 return -1; | |
8409 v6 = 0; | |
8410 v7 = (char *)&pLayingItems[0].uObjectDescID; | |
8411 v21 = 0; | |
8412 do | |
8413 { | |
8414 if ( !*(short *)v7 ) | |
8415 break; | |
8416 v7 += 112; | |
8417 ++v6; | |
8418 v21 = v6; | |
8419 } | |
8420 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) ); | |
8421 if ( v6 >= 1000 ) | |
8422 return -1; | |
8423 *(int *)&v5->field_62[2] = v5->vPosition.x; | |
8424 *(int *)&v5->field_62[6] = v5->vPosition.y; | |
8425 v9 = &pLayingItems[v6]; | |
8426 *(int *)&v5->field_62[10] = v5->vPosition.z; | |
8427 memcpy(v9, v5, 0x70u); | |
8428 if ( a5 == 1 ) | |
8429 { | |
8430 v20 = &v9->vPosition.z; | |
8431 v19 = &v9->vPosition.y; | |
8432 v18 = (int *)&v9->vPosition; | |
8433 v17.z = v5->vPosition.z; | |
8434 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8435 v16 = 0; | |
8436 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8437 goto LABEL_16; | |
8438 } | |
8439 if ( a5 == 2 ) | |
8440 { | |
8441 v20 = &v9->vPosition.z; | |
8442 v19 = &v9->vPosition.y; | |
8443 v18 = (int *)&v9->vPosition; | |
8444 v17.z = v5->vPosition.z; | |
8445 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8446 v16 = 0; | |
8447 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8448 goto LABEL_14; | |
8449 } | |
8450 if ( a5 == 3 ) | |
8451 { | |
8452 v20 = &v9->vPosition.z; | |
8453 v19 = &v9->vPosition.y; | |
8454 v18 = (int *)&v9->vPosition; | |
8455 v17.z = v5->vPosition.z; | |
8456 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8457 v16 = 0; | |
8458 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8459 LABEL_14: | |
8460 v15 = 8; | |
8461 LABEL_17: | |
8462 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20); | |
8463 goto LABEL_18; | |
8464 } | |
8465 if ( a5 == 4 ) | |
8466 { | |
8467 v20 = &v9->vPosition.z; | |
8468 v19 = &v9->vPosition.y; | |
8469 v18 = (int *)&v9->vPosition; | |
8470 v17.z = v5->vPosition.z; | |
8471 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8472 v16 = 0; | |
8473 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8474 LABEL_16: | |
8475 v15 = 24; | |
8476 goto LABEL_17; | |
8477 } | |
8478 LABEL_18: | |
8479 v11 = a4; | |
8480 v12 = 0; | |
8481 if ( a4 ) | |
8482 { | |
323 | 8483 a4a = stru_5C6E00->Cos(angle); |
8484 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8485 a4b = stru_5C6E00->Sin(angle); | |
8486 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8487 v14 = stru_5C6E00->Sin(pitch); | |
0 | 8488 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16; |
8489 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16; | |
8490 v12 = (unsigned int)(v14 * v11) >> 16; | |
8491 } | |
8492 else | |
8493 { | |
8494 v9->vVelocity.y = 0; | |
8495 v9->vVelocity.x = 0; | |
8496 } | |
8497 v9->vVelocity.z = v12; | |
8498 result = v21; | |
8499 if ( v21 >= (signed int)uNumLayingItems ) | |
8500 uNumLayingItems = v21 + 1; | |
8501 return result; | |
8502 } | |
8503 | |
8504 //----- (0042F7EB) -------------------------------------------------------- | |
8505 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) | |
8506 { | |
8507 unsigned int v9; // edi@1 | |
8508 signed int v10; // edx@3 | |
8509 char *v11; // ecx@4 | |
8510 unsigned __int16 v12; // ax@7 | |
8511 unsigned int v13; // edx@9 | |
8512 char *v14; // ecx@10 | |
8513 int v15; // esi@17 | |
8514 int v16; // eax@18 | |
8515 int v17; // edi@20 | |
8516 int v18; // esi@20 | |
8517 //LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8518 int v21; // [sp+7Ch] [bp-8h]@1 | |
8519 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8520 | |
8521 v9 = uSpriteID; | |
8522 v21 = x; | |
8523 v22 = uSpriteID; | |
8524 | |
8525 LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8526 //LayingItem::LayingItem(&a1a); | |
8527 a1a.stru_24.Reset(); | |
8528 | |
8529 if ( a9 ) | |
8530 { | |
8531 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8532 v9 = v22; | |
8533 } | |
8534 v10 = 0; | |
8535 a1a.field_50 = 0; | |
8536 a1a.field_4C = 0; | |
8537 a1a.field_48 = 0; | |
8538 a1a.field_54 = 0; | |
8539 a1a.uItemType = v9; | |
8540 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8541 { | |
8542 LABEL_7: | |
8543 v12 = 0; | |
8544 } | |
8545 else | |
8546 { | |
8547 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8548 while ( (short)v9 != *(short *)v11 ) | |
8549 { | |
8550 ++v10; | |
8551 v11 += 56; | |
8552 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8553 goto LABEL_7; | |
8554 } | |
8555 v12 = v10; | |
8556 } | |
8557 a1a.uObjectDescID = v12; | |
8558 a1a.vPosition.z = z; | |
8559 a1a.vPosition.x = v21; | |
8560 a1a.vPosition.y = y; | |
8561 a1a.uSoundID = 0; | |
8562 a1a.uAttributes = attributes; | |
8563 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8564 a1a.uSpriteFrameID = 0; | |
303 | 8565 a1a.field_58_pid = 0; |
0 | 8566 a1a.field_5C = 0; |
8567 if ( !(a1a.uAttributes & 0x10) ) | |
8568 { | |
8569 v13 = 0; | |
222 | 8570 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
0 | 8571 { |
8572 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8573 while ( *(short *)v14 != v9 ) | |
8574 { | |
8575 ++v13; | |
8576 v14 += 48; | |
222 | 8577 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount ) |
0 | 8578 goto LABEL_16; |
8579 } | |
8580 a1a.stru_24.uItemID = v13; | |
8581 } | |
8582 } | |
8583 LABEL_16: | |
8584 if ( a7 ) | |
8585 { | |
8586 v15 = count; | |
8587 if ( count > 0 ) | |
8588 { | |
8589 do | |
8590 { | |
8591 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8592 v16 = rand(); | |
8593 a1a.Create( | |
8594 (signed __int16)a1a.uFacing, | |
8595 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8596 a4, | |
8597 0); | |
8598 --v15; | |
8599 } | |
8600 while ( v15 ); | |
8601 } | |
8602 } | |
8603 else | |
8604 { | |
8605 v17 = count; | |
8606 v18 = stru_5C6E00->uIntegerHalfPi; | |
8607 a1a.uFacing = 0; | |
8608 if ( count > 0 ) | |
8609 { | |
8610 do | |
8611 { | |
8612 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8613 --v17; | |
8614 } | |
8615 while ( v17 ); | |
8616 } | |
8617 } | |
8618 return 1; | |
8619 } | |
8620 | |
8621 //----- (0042F960) -------------------------------------------------------- | |
8622 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8623 { | |
8624 int v3; // ebx@1 | |
8625 int v4; // edi@1 | |
8626 signed int v5; // edx@1 | |
8627 char *v6; // ecx@2 | |
8628 unsigned __int16 v7; // ax@5 | |
8629 signed int v8; // eax@6 | |
8630 signed int v9; // eax@7 | |
8631 //LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8632 | |
8633 v3 = x; | |
8634 v4 = y; | |
8635 | |
8636 LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8637 //LayingItem::LayingItem(&a1); | |
8638 a1.stru_24.Reset(); | |
8639 | |
8640 v5 = 0; | |
8641 a1.field_50 = 0; | |
8642 a1.field_4C = 0; | |
8643 a1.field_48 = 0; | |
8644 a1.field_54 = 0; | |
8645 a1.uItemType = 800; | |
8646 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8647 { | |
8648 LABEL_5: | |
8649 v7 = 0; | |
8650 } | |
8651 else | |
8652 { | |
8653 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8654 while ( *(short *)v6 != 800 ) | |
8655 { | |
8656 ++v5; | |
8657 v6 += 56; | |
8658 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8659 goto LABEL_5; | |
8660 } | |
8661 v7 = v5; | |
8662 } | |
8663 a1.uObjectDescID = v7; | |
8664 a1.vPosition.x = v3; | |
8665 a1.vPosition.y = v4; | |
8666 a1.vPosition.z = z; | |
8667 a1.uSoundID = 0; | |
8668 a1.uAttributes = 0; | |
8669 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8670 a1.uSpriteFrameID = 0; | |
303 | 8671 a1.field_58_pid = 0; |
0 | 8672 a1.field_5C = 0; |
8673 v8 = a1.Create(0, 0, 0, 0); | |
8674 if ( v8 != -1 ) | |
8675 { | |
8676 v9 = 8 * v8; | |
8677 LOBYTE(v9) = v9 | 2; | |
8678 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8679 } | |
8680 } | |
8681 | |
8682 //----- (0042FA22) -------------------------------------------------------- | |
79 | 8683 LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8684 { |
8685 size_t v0; // edx@1 | |
8686 int v1; // ebp@1 | |
79 | 8687 LayingItem *result; // eax@1 |
8688 LayingItem *v3; // ebx@1 | |
0 | 8689 |
8690 v0 = 0; | |
8691 v1 = 0; | |
79 | 8692 //result = (char *)&pLayingItems[0].uObjectDescID; |
8693 result = pLayingItems; | |
0 | 8694 v3 = pLayingItems; |
8695 do | |
8696 { | |
79 | 8697 if ( result->uObjectDescID ) |
0 | 8698 { |
8699 if ( v1 != v0 ) | |
8700 { | |
79 | 8701 memcpy(v3, result, 0x70u); |
8702 result->uObjectDescID = 0; | |
0 | 8703 } |
8704 ++v0; | |
79 | 8705 ++v3;// = (char *)v3 + 112; |
0 | 8706 } |
79 | 8707 ++result;// += 112; |
0 | 8708 ++v1; |
8709 } | |
79 | 8710 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); |
8711 while( result <= &pLayingItems[999] ); | |
0 | 8712 uNumLayingItems = v0; |
8713 return result; | |
8714 } | |
8715 | |
8716 //----- (0042FA66) -------------------------------------------------------- | |
8717 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8718 { | |
8719 int v6; // edi@1 | |
8720 int v7; // esi@1 | |
8721 char *v8; // ecx@2 | |
8722 unsigned __int16 v9; // ax@5 | |
8723 int v10; // eax@10 | |
8724 signed int result; // eax@11 | |
8725 __int16 v12; // ax@12 | |
8726 //LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8727 int v14; // [sp+7Ch] [bp-4h]@1 | |
8728 | |
8729 v6 = a1; | |
8730 v7 = a2; | |
8731 LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8732 //LayingItem::LayingItem(&a1a); | |
8733 a1a.uItemType = 600; | |
8734 a1a.stru_24.Reset(); | |
8735 | |
8736 a1a.field_48 = 6; | |
8737 a1a.field_4C = 8; | |
8738 a1a.field_50 = 3; | |
8739 v14 = 0; | |
8740 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8741 { | |
8742 LABEL_5: | |
8743 v9 = 0; | |
8744 } | |
8745 else | |
8746 { | |
8747 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
8748 while ( (short)a1a.uItemType != *(short *)v8 ) | |
8749 { | |
8750 ++v14; | |
8751 v8 += 56; | |
8752 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8753 goto LABEL_5; | |
8754 } | |
8755 v9 = v14; | |
8756 } | |
8757 a1a.uObjectDescID = v9; | |
8758 a1a.vPosition.x = v6; | |
8759 a1a.vPosition.y = v7; | |
8760 a1a.vPosition.z = a3; | |
8761 a1a.uAttributes = 0; | |
8762 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8763 a1a.uSpriteFrameID = 0; | |
8764 a1a.field_5C = 0; | |
8765 a1a.field_60_distance_related_prolly_lod = 0; | |
8766 a1a.uFacing = 0; | |
8767 a1a.uSoundID = 0; | |
8768 if ( a6 >= 1 || a6 <= 4 ) | |
8769 { | |
8770 v10 = 8 * a6 - 8; | |
303 | 8771 LOBYTE(v10) = v10 | OBJECT_Player; |
8772 a1a.field_58_pid = v10; | |
0 | 8773 } |
8774 else | |
8775 { | |
303 | 8776 a1a.field_58_pid = 0; |
0 | 8777 } |
8778 result = a1a.Create(0, 0, 0, 0); | |
8779 if ( result != -1 ) | |
8780 { | |
8781 v12 = 8 * result; | |
8782 LOBYTE(v12) = v12 | 2; | |
8783 result = stru_50FE08.Add( | |
8784 v12, | |
8785 a5, | |
8786 SLOWORD(a1a.vPosition.x), | |
8787 SLOWORD(a1a.vPosition.y), | |
8788 SLOWORD(a1a.vPosition.z), | |
8789 0, | |
8790 0); | |
8791 } | |
8792 return result; | |
8793 } | |
8794 | |
8795 | |
8796 | |
8797 //----- (0042FB5C) -------------------------------------------------------- | |
8798 bool __fastcall sub_42FB5C(signed int a1) | |
8799 { | |
8800 int v1; // ecx@3 | |
8801 int v2; // ecx@4 | |
8802 int v3; // ecx@5 | |
8803 int v4; // ecx@6 | |
8804 int v5; // ecx@7 | |
8805 int v6; // ecx@8 | |
8806 char v7; // zf@9 | |
8807 | |
8808 if ( a1 > 39 ) | |
8809 { | |
8810 if ( a1 > 77 ) | |
8811 { | |
8812 if ( a1 == 80 ) | |
8813 return 0; | |
8814 if ( a1 > 84 ) | |
8815 { | |
8816 if ( a1 <= 86 ) | |
8817 return 0; | |
8818 v7 = a1 == 95; | |
8819 goto LABEL_20; | |
8820 } | |
8821 } | |
8822 else | |
8823 { | |
8824 if ( a1 == 77 ) | |
8825 return 0; | |
8826 if ( a1 >= 46 ) | |
8827 { | |
8828 if ( a1 <= 47 || a1 == 51 ) | |
8829 return 0; | |
8830 v7 = a1 == 73; | |
8831 goto LABEL_20; | |
8832 } | |
8833 } | |
8834 return 1; | |
8835 } | |
8836 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8837 return 1; | |
8838 v2 = v1 - 3; | |
8839 if ( !v2 ) | |
8840 return 0; | |
8841 v3 = v2 - 1; | |
8842 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8843 return 1; | |
8844 v5 = v4 - 8; | |
8845 if ( !v5 ) | |
8846 return 0; | |
8847 v6 = v5 - 1; | |
8848 if ( !v6 ) | |
8849 return 1; | |
8850 v7 = v6 == 20; | |
8851 LABEL_20: | |
8852 if ( !v7 ) | |
8853 return 1; | |
8854 return 0; | |
8855 } | |
8856 | |
8857 //----- (0042FBDD) -------------------------------------------------------- | |
8858 void __cdecl sub_42FBDD() | |
8859 { | |
388 | 8860 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 8861 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
8862 pRenderer->Present(); | |
8863 } | |
8864 | |
8865 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8866 void __cdecl CloseWindowBackground() |
0 | 8867 { |
388 | 8868 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 8869 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
8870 pRenderer->Present(); | |
8871 } | |
8872 | |
8873 //----- (0042FC4E) -------------------------------------------------------- | |
8874 void __cdecl ProcessInputActions() | |
8875 { | |
8876 ActionQueue *pActionQueue; // esi@7 | |
8877 Keyboard *v3; // ecx@8 | |
8878 char v4; // al@9 | |
8879 ActionQueue *v5; // ecx@19 | |
8880 Player *v6; // ecx@86 | |
8881 Player *v7; // esi@100 | |
8882 char v8; // bl@100 | |
8883 unsigned __int16 v9; // ax@102 | |
8884 int v10; // eax@103 | |
8885 unsigned int v11; // eax@127 | |
8886 signed int v12; // esi@157 | |
8887 Keyboard *v13; // ecx@158 | |
8888 char v14; // al@159 | |
8889 unsigned int v15; // eax@168 | |
8890 void *v16; // esi@177 | |
8891 int v17; // [sp-14h] [bp-1Ch]@8 | |
8892 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8893 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
271 | 8894 //__int16 v20; // [sp-14h] [bp-1Ch]@60 |
0 | 8895 int v21; // [sp-14h] [bp-1Ch]@68 |
8896 int v22; // [sp-Ch] [bp-14h]@158 | |
8897 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8898 int v24; // [sp+4h] [bp-4h]@87 | |
8899 | |
8900 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8901 auto pKeyboard = pGame->pKeyboardInstance; | |
8902 if (!bAlwaysRun) | |
8903 { | |
8904 if (pKeyboard->IsShiftHeld()) | |
8905 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8906 else | |
8907 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8908 } | |
8909 else | |
8910 { | |
8911 if (pKeyboard->IsShiftHeld()) | |
8912 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8913 else | |
8914 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8915 } | |
8916 | |
140 | 8917 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
486 | 8918 //LABEL_6: |
0 | 8919 if ( !pEventTimer->bPaused ) |
8920 { | |
8921 inputAction = (InputAction)0; | |
8922 pActionQueue = pPartyActionQueue; | |
8923 while ( 1 ) | |
8924 { | |
8925 v3 = pGame->pKeyboardInstance; | |
8926 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8927 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8928 v4 = v3->WasKeyPressed(v17); | |
8929 else | |
8930 v4 = v3->IsKeyBeingHeld(v17); | |
8931 if ( v4 ) | |
8932 { | |
8933 switch ( inputAction ) | |
8934 { | |
8935 case INPUT_MoveForward: | |
271 | 8936 if (pCurrentScreen != SCREEN_GAME) |
0 | 8937 break; |
8938 if (!pParty->bTurnBasedModeOn) | |
163 | 8939 //goto _do_move_forward; |
0 | 8940 { |
8941 v5 = pActionQueue; | |
140 | 8942 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8943 partyAction = PARTY_RunForward; |
8944 else | |
8945 partyAction = PARTY_WalkForward; | |
163 | 8946 //goto _add_action_and_continue; |
8947 v5->Add(partyAction); | |
8948 break; | |
8949 } | |
8950 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8951 { | |
8952 pTurnEngine->uActionPointsLeft -= 26; | |
8953 //_do_move_forward: | |
8954 v5 = pActionQueue; | |
8955 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8956 partyAction = PARTY_RunForward; | |
8957 else | |
8958 partyAction = PARTY_WalkForward; | |
8959 //goto _add_action_and_continue; | |
8960 v5->Add(partyAction); | |
8961 break; | |
0 | 8962 } |
8963 break; | |
8964 case INPUT_MoveBackwards: | |
17 | 8965 //__debugbreak(); |
271 | 8966 if (pCurrentScreen != SCREEN_GAME) |
0 | 8967 break; |
8968 if (!pParty->bTurnBasedModeOn) | |
17 | 8969 //goto _do_move_backwards; |
8970 { | |
8971 v5 = pActionQueue; | |
8972 if ( pParty->uFlags2 & 2 ) | |
8973 partyAction = PARTY_RunBackward; | |
8974 else | |
8975 partyAction = PARTY_WalkBackward; | |
163 | 8976 //goto _add_action_and_continue; |
8977 v5->Add(partyAction); | |
8978 break; | |
17 | 8979 } |
0 | 8980 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8981 { | |
8982 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8983 //_do_move_backwards: |
0 | 8984 v5 = pActionQueue; |
8985 if ( pParty->uFlags2 & 2 ) | |
8986 partyAction = PARTY_RunBackward; | |
8987 else | |
8988 partyAction = PARTY_WalkBackward; | |
163 | 8989 //goto _add_action_and_continue; |
8990 v5->Add(partyAction); | |
8991 break; | |
0 | 8992 } |
8993 break; | |
8994 case INPUT_StrafeLeft: | |
17 | 8995 //__debugbreak(); |
271 | 8996 if (pCurrentScreen != SCREEN_GAME) |
0 | 8997 break; |
8998 if (!pParty->bTurnBasedModeOn) | |
17 | 8999 //goto _do_strafe_left; |
9000 { | |
9001 partyAction = PARTY_StrafeLeft; | |
163 | 9002 //goto _add_action_and_continue_; |
9003 v5 = pActionQueue; | |
9004 v5->Add(partyAction); | |
9005 break; | |
17 | 9006 } |
0 | 9007 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
9008 break; | |
9009 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9010 //_do_strafe_left: |
0 | 9011 partyAction = PARTY_StrafeLeft; |
163 | 9012 //goto _add_action_and_continue_; |
9013 v5 = pActionQueue; | |
9014 v5->Add(partyAction); | |
9015 break; | |
0 | 9016 case INPUT_StrafeRight: |
17 | 9017 //__debugbreak(); |
271 | 9018 if (pCurrentScreen != SCREEN_GAME) |
0 | 9019 break; |
9020 if (!pParty->bTurnBasedModeOn) | |
17 | 9021 //goto _do_strafe_right; |
9022 { | |
9023 partyAction = PARTY_StrafeRight; | |
163 | 9024 //goto _add_action_and_continue_; |
9025 v5 = pActionQueue; | |
9026 v5->Add(partyAction); | |
9027 break; | |
17 | 9028 } |
0 | 9029 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
9030 break; | |
9031 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 9032 //_do_strafe_right: |
0 | 9033 partyAction = PARTY_StrafeRight; |
163 | 9034 //goto _add_action_and_continue_; |
9035 v5 = pActionQueue; | |
9036 v5->Add(partyAction); | |
9037 break; | |
0 | 9038 case INPUT_TurnLeft: |
271 | 9039 if (pCurrentScreen != SCREEN_GAME) |
0 | 9040 break; |
9041 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
9042 { | |
9043 if (pParty->bTurnBasedModeOn) | |
9044 { | |
9045 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9046 break; | |
9047 pTurnEngine->uActionPointsLeft -= 26; | |
9048 } | |
9049 partyAction_ = PARTY_StrafeLeft; | |
9050 } | |
9051 else | |
9052 { | |
9053 if ( pParty->uFlags2 & 2 ) | |
9054 partyAction_ = PARTY_FastTurnLeft; | |
9055 else | |
9056 partyAction_ = PARTY_TurnLeft; | |
9057 } | |
9058 pActionQueue->Add(partyAction_); | |
9059 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9060 { | |
271 | 9061 pWeather->OnPlayerTurn(10); |
0 | 9062 } |
9063 break; | |
9064 case INPUT_TurnRight: | |
271 | 9065 if (pCurrentScreen != SCREEN_GAME) |
0 | 9066 break; |
9067 if ( GetAsyncKeyState(17) ) // strafing | |
9068 { | |
9069 if (pParty->bTurnBasedModeOn) | |
9070 { | |
9071 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
9072 break; | |
9073 pTurnEngine->uActionPointsLeft -= 26; | |
9074 } | |
271 | 9075 v21 = PARTY_StrafeRight; |
0 | 9076 } |
9077 else | |
9078 { | |
9079 if ( pParty->uFlags2 & 2 ) | |
271 | 9080 v21 = PARTY_FastTurnRight; |
0 | 9081 else |
271 | 9082 v21 = PARTY_TurnRight; |
0 | 9083 } |
9084 pActionQueue->Add((PartyAction)v21); | |
9085 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
9086 { | |
271 | 9087 pWeather->OnPlayerTurn(-10); |
0 | 9088 } |
9089 break; | |
9090 case INPUT_Jump: | |
17 | 9091 //__debugbreak(); |
271 | 9092 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 9093 break; |
9094 partyAction = (PartyAction)12; | |
163 | 9095 //goto _add_action_and_continue_; |
9096 v5 = pActionQueue; | |
9097 v5->Add(partyAction); | |
9098 break; | |
0 | 9099 case INPUT_Yell: |
187 | 9100 if (!pCurrentScreen && uActiveCharacter) |
0 | 9101 { |
9102 pParty->Yell(); | |
187 | 9103 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 9104 } |
187 | 9105 break; |
0 | 9106 case INPUT_Pass: |
17 | 9107 //__debugbreak(); |
0 | 9108 if ( pCurrentScreen ) |
9109 break; | |
9110 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9111 //goto LABEL_118; |
9112 { | |
9113 pTurnEngine->field_18 |= 8u; | |
9114 break; | |
9115 } | |
0 | 9116 if ( uActiveCharacter ) |
9117 { | |
9118 v6 = pPlayers[uActiveCharacter]; | |
9119 if ( !v6->uTimeToRecovery ) | |
9120 { | |
9121 v24 = v6->GetAttackRecoveryTime(0); | |
9122 if ( !pParty->bTurnBasedModeOn ) | |
9123 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
9124 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
9125 pStru277->_427D48(uActiveCharacter); | |
9126 pTurnEngine->_40471C(); | |
9127 } | |
9128 } | |
9129 break; | |
9130 case INPUT_Combat: | |
17 | 9131 //__debugbreak(); |
271 | 9132 if (pCurrentScreen == SCREEN_GAME) |
0 | 9133 { |
9134 if (pParty->bTurnBasedModeOn) | |
9135 { | |
141 | 9136 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 9137 { |
9138 pParty->bTurnBasedModeOn = 0; | |
9139 pTurnEngine->End(true); | |
9140 } | |
9141 } | |
9142 else | |
9143 { | |
9144 pTurnEngine->Start(); | |
9145 pParty->bTurnBasedModeOn = true; | |
9146 } | |
9147 } | |
9148 break; | |
9149 case INPUT_CastReady: | |
17 | 9150 //__debugbreak(); |
271 | 9151 if (pCurrentScreen != SCREEN_GAME) |
0 | 9152 break; |
9153 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 9154 //goto LABEL_118; |
9155 { | |
9156 pTurnEngine->field_18 |= 8u; | |
9157 break; | |
9158 } | |
0 | 9159 if ( !uActiveCharacter ) |
9160 break; | |
9161 v7 = pPlayers[uActiveCharacter]; | |
9162 v8 = v7->uQuickSpell; | |
9163 if ( !v8 | |
9164 || bUnderwater | |
9165 || ((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)), | |
9166 v10 > v7->sMana) ) | |
9167 { | |
9168 pActionQueue = pPartyActionQueue; | |
9169 LABEL_120: | |
437 | 9170 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); |
9171 break; | |
9172 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 9173 { |
271 | 9174 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; |
163 | 9175 //goto _send_message; |
9176 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9177 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9178 ++pMessageQueue_50CBD0->uNumMessages; | |
9179 break; | |
437 | 9180 }*/ |
0 | 9181 } |
9182 else | |
9183 { | |
9184 pActionQueue = pPartyActionQueue; | |
9185 if ( dword_50C9E8 < 40 ) | |
9186 { | |
9187 dword_50C9EC[3 * dword_50C9E8] = 25; | |
437 | 9188 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9189 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 9190 ++dword_50C9E8; |
9191 } | |
9192 } | |
9193 break; | |
9194 case INPUT_Attack: | |
17 | 9195 //__debugbreak(); |
271 | 9196 if (pCurrentScreen != SCREEN_GAME) |
0 | 9197 break; |
9198 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
9199 goto LABEL_120; | |
17 | 9200 //LABEL_118: |
0 | 9201 pTurnEngine->field_18 |= 8u; |
9202 break; | |
9203 case INPUT_EventTrigger: | |
271 | 9204 if (pCurrentScreen == SCREEN_GAME) |
0 | 9205 { |
437 | 9206 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 9207 break; |
271 | 9208 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action; |
163 | 9209 //goto _send_message; |
9210 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9211 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9212 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 9213 break;*/ |
9214 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
163 | 9215 break; |
0 | 9216 } |
151 | 9217 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 9218 { |
9219 v11 = pMessageQueue_50CBD0->uNumMessages; | |
9220 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9221 { | |
437 | 9222 v11 = 0; |
9223 pMessageQueue_50CBD0->uNumMessages = 0; | |
0 | 9224 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
9225 { | |
9226 v11 = 1; | |
9227 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 9228 //LABEL_132: |
271 | 9229 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 9230 //_send_message: |
0 | 9231 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9232 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9233 ++pMessageQueue_50CBD0->uNumMessages; | |
9234 break; | |
9235 } | |
437 | 9236 break; |
0 | 9237 } |
437 | 9238 /*if ( (signed int)v11 < 40 ) |
163 | 9239 //goto LABEL_132; |
9240 { | |
271 | 9241 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 9242 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9243 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9244 ++pMessageQueue_50CBD0->uNumMessages; | |
9245 break; | |
437 | 9246 }*/ |
9247 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 9248 } |
9249 break; | |
9250 case INPUT_CharCycle: | |
17 | 9251 //__debugbreak(); |
151 | 9252 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 9253 || dword_50C9E8 >= 40 ) |
9254 break; | |
9255 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 9256 //goto LABEL_155; |
437 | 9257 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9258 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 9259 ++dword_50C9E8; |
9260 break; | |
0 | 9261 case INPUT_LookUp: |
17 | 9262 //__debugbreak(); |
0 | 9263 if ( pEventTimer->bPaused ) |
9264 break; | |
9265 partyAction = (PartyAction)7; | |
163 | 9266 //goto _add_action_and_continue_; |
9267 v5 = pActionQueue; | |
9268 v5->Add(partyAction); | |
9269 break; | |
0 | 9270 case INPUT_CenterView: |
17 | 9271 //__debugbreak(); |
0 | 9272 if ( pEventTimer->bPaused ) |
9273 break; | |
9274 partyAction = (PartyAction)9; | |
163 | 9275 //goto _add_action_and_continue_; |
9276 v5 = pActionQueue; | |
9277 v5->Add(partyAction); | |
9278 break; | |
0 | 9279 case INPUT_LookDown: |
17 | 9280 //__debugbreak(); |
0 | 9281 if ( pEventTimer->bPaused ) |
9282 break; | |
9283 partyAction = (PartyAction)8; | |
163 | 9284 //goto _add_action_and_continue_; |
9285 v5 = pActionQueue; | |
9286 v5->Add(partyAction); | |
9287 break; | |
0 | 9288 case INPUT_FlyUp: |
17 | 9289 //__debugbreak(); |
0 | 9290 if ( pCurrentScreen |
9291 || pEventTimer->bPaused ) | |
9292 break; | |
9293 partyAction = (PartyAction)13; | |
163 | 9294 //goto _add_action_and_continue_; |
9295 v5 = pActionQueue; | |
9296 v5->Add(partyAction); | |
9297 break; | |
0 | 9298 case INPUT_Land: |
17 | 9299 //__debugbreak(); |
0 | 9300 if ( pCurrentScreen |
9301 || pEventTimer->bPaused ) | |
9302 break; | |
9303 partyAction = (PartyAction)15; | |
163 | 9304 //goto _add_action_and_continue_; |
9305 v5 = pActionQueue; | |
9306 v5->Add(partyAction); | |
9307 break; | |
0 | 9308 case INPUT_FlyDown: |
17 | 9309 //__debugbreak(); |
0 | 9310 if ( !pCurrentScreen |
9311 && !pEventTimer->bPaused ) | |
9312 { | |
9313 partyAction = (PartyAction)14; | |
163 | 9314 //_add_action_and_continue_: |
0 | 9315 v5 = pActionQueue; |
163 | 9316 //_add_action_and_continue: |
0 | 9317 v5->Add(partyAction); |
9318 } | |
9319 break; | |
9320 case INPUT_ZoomIn: | |
17 | 9321 //__debugbreak(); |
0 | 9322 if ( dword_50C9E8 >= 40 ) |
9323 break; | |
9324 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 9325 //goto LABEL_155; |
437 | 9326 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9327 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 9328 ++dword_50C9E8; |
9329 break; | |
0 | 9330 case INPUT_ZoomOut: |
17 | 9331 //__debugbreak(); |
0 | 9332 if ( dword_50C9E8 < 40 ) |
9333 { | |
9334 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 9335 //LABEL_155: |
437 | 9336 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9337 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 9338 ++dword_50C9E8; |
9339 } | |
9340 break; | |
9341 case INPUT_AlwaysRun: | |
9342 bAlwaysRun = bAlwaysRun == 0; | |
9343 break; | |
17 | 9344 default: |
9345 //__debugbreak(); | |
9346 break; | |
0 | 9347 } |
9348 } | |
9349 inputAction = (InputAction)((int)inputAction + 1); | |
9350 if ( (signed int)inputAction >= 30 ) | |
9351 goto LABEL_176; | |
9352 } | |
9353 } | |
9354 v12 = 0; | |
9355 do | |
9356 { | |
9357 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
9358 v13 = pGame->pKeyboardInstance; | |
9359 if ( pKeyActionMap->pToggleTypes[v12] ) | |
9360 v14 = v13->WasKeyPressed(v22); | |
9361 else | |
9362 v14 = v13->IsKeyBeingHeld(v22); | |
9363 if ( v14 && v12 == 9 ) | |
9364 { | |
9365 if ( !pCurrentScreen ) | |
9366 { | |
437 | 9367 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 9368 goto LABEL_175; |
9369 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 9370 //goto LABEL_174; |
9371 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9372 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9373 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9374 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
17 | 9375 goto LABEL_175; |
0 | 9376 } |
151 | 9377 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
9378 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 9379 { |
9380 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9381 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9382 { | |
9383 v15 = 0; | |
9384 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9385 { | |
9386 v15 = 1; | |
437 | 9387 pMessageQueue_50CBD0->uNumMessages = 0; |
17 | 9388 //goto LABEL_173; |
437 | 9389 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape; |
17 | 9390 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9391 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9392 ++pMessageQueue_50CBD0->uNumMessages; | |
9393 goto LABEL_175; | |
0 | 9394 } |
9395 pMessageQueue_50CBD0->uNumMessages = 0; | |
9396 } | |
437 | 9397 /*if ( (signed int)v15 >= 40 ) |
0 | 9398 goto LABEL_175; |
17 | 9399 //LABEL_173: |
0 | 9400 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9401 //LABEL_174: |
0 | 9402 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9403 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9404 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9405 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 9406 goto LABEL_175; |
9407 } | |
9408 } | |
9409 LABEL_175: | |
9410 ++v12; | |
9411 } | |
9412 while ( v12 < 30 ); | |
9413 LABEL_176: | |
9414 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9415 { | |
9416 AsyncKeyboard::LeaveCriticalSection(); | |
9417 v16 = pAsyncKeyboard; | |
9418 AsyncKeyboard::EnterCriticalSection(); | |
9419 memset((char *)v16 + 521, 0, 0x100u); | |
9420 AsyncKeyboard::LeaveCriticalSection(); | |
9421 } | |
9422 } | |
9423 |