Mercurial > mm7
annotate mm7_6.cpp @ 490:cc4b7981c1bb
Wands
author | Nomad |
---|---|
date | Wed, 27 Feb 2013 23:13:02 +0200 |
parents | a3939d5067c4 |
children | cb0ad52d6a26 |
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) -------------------------------------------------------- | |
488 | 2517 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int a6) |
0 | 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; | |
488 | 2538 v8->spell_target_pid = 0; |
0 | 2539 v8->field_8 = a5; |
488 | 2540 v8->forced_spell_skill_level = skill_level; |
0 | 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 | |
488 | 2554 //signed int v4; // eax@8 |
2555 //__int16 v5; // ax@9 | |
0 | 2556 signed int v6; // eax@14 |
488 | 2557 //__int16 v7; // ax@23 |
2558 //__int16 v8; // ax@24 | |
2559 //char v9; // al@44 | |
2560 //int v10; // eax@45 | |
0 | 2561 unsigned __int16 v11; // cx@45 |
2562 signed int v12; // ecx@48 | |
490 | 2563 //int v13; // eax@53 |
0 | 2564 unsigned __int8 v14; // zf@53 |
488 | 2565 //unsigned int v15; // edx@53 |
2566 //signed int v16; // eax@53 | |
0 | 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 | |
488 | 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 | |
0 | 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 | |
488 | 2606 //stru6 *v56; // eax@165 |
0 | 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 | |
488 | 2623 //__int16 v73; // ST1C_2@222 |
2624 //__int16 v74; // ST18_2@222 | |
2625 //stru6 *v75; // eax@222 | |
0 | 2626 int v76; // ecx@223 |
2627 int v77; // ecx@224 | |
2628 int v78; // ecx@225 | |
2629 int v79; // eax@227 | |
488 | 2630 //int v80; // eax@232 |
2631 //__int16 v81; // ST18_2@245 | |
2632 //stru6 *v82; // eax@245 | |
0 | 2633 signed int v83; // edi@245 |
488 | 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 | |
0 | 2640 double v90; // st7@245 |
2641 int v91; // eax@250 | |
89 | 2642 Player *v92; // eax@255 |
488 | 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 | |
0 | 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 | |
488 | 2656 //__int16 v106; // ST18_2@272 |
2657 //stru6 *v107; // eax@272 | |
0 | 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 | |
488 | 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 | |
0 | 2688 int v138; // ecx@305 |
2689 int v139; // ecx@306 | |
2690 int v140; // eax@308 | |
488 | 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 | |
0 | 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 | |
488 | 2716 //stru6 *v166; // eax@340 |
2717 //stru6 *v167; // eax@340 | |
0 | 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 | |
488 | 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 | |
0 | 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 | |
488 | 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 | |
0 | 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 | |
488 | 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 | |
0 | 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 | |
488 | 2863 char v313; // al@606pGame->GetStru6() |
0 | 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 | |
488 | 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 | |
0 | 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 | |
488 | 2895 //__int16 v345; // ST1C_2@671 |
2896 //__int16 v346; // ST18_2@671 | |
2897 //stru6 *v347; // eax@671 | |
0 | 2898 int v348; // ecx@672 |
2899 int v349; // ecx@673 | |
2900 int v350; // edi@676 | |
2901 Player *v351; // edi@680 | |
488 | 2902 //__int16 v352; // ST18_2@685 |
2903 //stru6 *v353; // eax@685 | |
0 | 2904 int v354; // ecx@686 |
2905 int v355; // ecx@687 | |
2906 int v356; // eax@689 | |
112 | 2907 Player *v357; // edi@694 |
488 | 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 | |
0 | 2914 int v364; // ecx@698 |
2915 int v365; // ecx@699 | |
2916 int v366; // eax@701 | |
488 | 2917 //stru6 *v367; // eax@704 |
0 | 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 | |
488 | 2939 //unsigned __int16 v389; // ST1C_2@740 |
2940 //__int16 v390; // ST18_2@740 | |
2941 //stru6 *v391; // eax@740 | |
0 | 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 | |
488 | 2951 //Game *v401; // ecx@759 |
2952 //__int16 v402; // ST1C_2@759 | |
2953 //__int16 v403; // ST18_2@759 | |
2954 //stru6 *v404; // eax@759 | |
0 | 2955 int v405; // ecx@761 |
2956 int v406; // ecx@762 | |
2957 int v407; // edi@765 | |
488 | 2958 //__int16 v408; // ST1C_2@769 |
2959 //__int16 v409; // ST18_2@769 | |
2960 //stru6 *v410; // eax@769 | |
0 | 2961 int v411; // ecx@772 |
2962 int v412; // ecx@773 | |
2963 int v413; // edi@775 | |
488 | 2964 //__int16 v414; // ST1C_2@781 |
2965 //__int16 v415; // ST18_2@781 | |
2966 //stru6 *v416; // eax@781 | |
0 | 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 | |
488 | 2981 //stru6 *v431; // eax@831 |
0 | 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 | |
488 | 2987 //__int16 v437; // ST1C_2@843 |
2988 //__int16 v438; // ST18_2@843 | |
2989 //stru6 *v439; // eax@843 | |
0 | 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 | |
488 | 3004 //__int16 v454; // ST1C_2@884 |
3005 //__int16 v455; // ST18_2@884 | |
3006 //stru6 *v456; // eax@884 | |
0 | 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 | |
488 | 3017 //__int16 v467; // ST1C_2@913 |
3018 //__int16 v468; // ST18_2@913 | |
3019 //stru6 *v469; // eax@913 | |
0 | 3020 int v470; // edi@913 |
3021 int v471; // eax@917 | |
3022 int v472; // eax@917 | |
3023 char *v473; // esi@918 | |
488 | 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 | |
0 | 3043 int v493; // ecx@925 |
3044 int v494; // ecx@926 | |
488 | 3045 //__int16 v495; // ST1C_2@931 |
3046 //__int16 v496; // ST18_2@931 | |
3047 //stru6 *v497; // eax@931 | |
0 | 3048 int v498; // edi@931 |
3049 int v499; // eax@935 | |
3050 int v500; // eax@935 | |
3051 Player *v501; // edi@939 | |
488 | 3052 //__int16 v502; // ST18_2@940 |
3053 //stru6 *v503; // eax@940 | |
3054 //stru6 *v504; // eax@943 | |
0 | 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 | |
488 | 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 | |
0 | 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 | |
488 | 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 | |
0 | 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 |
488 | 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 | |
0 | 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 | |
488 | 3118 //unsigned __int16 v568; // ST1C_2@1012 |
3119 //__int16 v569; // ST18_2@1012 | |
3120 //stru6 *v570; // eax@1012 | |
0 | 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 | |
488 | 3133 //__int16 v583; // ST1C_2@1034 |
3134 //__int16 v584; // ST18_2@1034 | |
0 | 3135 char *v585; // esi@1034 |
488 | 3136 //stru6 *v586; // eax@1034 |
0 | 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 | |
488 | 3166 //__int16 v616; // ST1C_2@1122 |
3167 //__int16 v617; // ST18_2@1122 | |
3168 //stru6 *v618; // eax@1122 | |
112 | 3169 Player *v619; // edi@1123 |
488 | 3170 //unsigned __int16 v620; // ST1C_2@1124 |
3171 //__int16 v621; // ST18_2@1124 | |
3172 //stru6 *v622; // eax@1124 | |
0 | 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 | |
488 | 3186 //unsigned __int16 v636; // ST1C_2@1142 |
3187 //__int16 v637; // ST18_2@1142 | |
3188 //stru6 *v638; // eax@1142 | |
3189 //stru6 *v639; // eax@1143 | |
0 | 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 | |
488 | 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 | |
0 | 3204 int v654; // [sp-4h] [bp-E88h]@124 |
488 | 3205 //unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 |
0 | 3206 unsigned int v656; // [sp-4h] [bp-E88h]@639 |
3207 int v657; // [sp-4h] [bp-E88h]@807 | |
488 | 3208 //int v658; // [sp+0h] [bp-E84h]@100 |
0 | 3209 int v659; // [sp+0h] [bp-E84h]@123 |
3210 int v660; // [sp+0h] [bp-E84h]@146 | |
3211 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
488 | 3212 //int v662; // [sp+0h] [bp-E84h]@304 |
0 | 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 | |
488 | 3218 //unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 |
0 | 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 | |
488 | 3223 //unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 |
0 | 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]; | |
488 | 3321 |
3322 a2 = v3->spell_target_pid; | |
3323 if (!a2) | |
0 | 3324 { |
488 | 3325 if (v3->spellnum == SPELL_LIGHT_DESTROY_UNDEAD || |
3326 v3->spellnum == SPELL_SPIRIT_TURN_UNDEAD || | |
3327 v3->spellnum == SPELL_DARK_CONTROL_UNDEAD ) | |
3328 v666 = 1; | |
3329 else | |
3330 v666 = 0; | |
3331 | |
3332 a2 = stru_50C198.FindClosestActor(5120, 1, v666); | |
3333 v6 = pMouse->uPointingObjectID; | |
3334 if ( pMouse->uPointingObjectID && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) | |
3335 a2 = pMouse->uPointingObjectID; | |
0 | 3336 } |
488 | 3337 |
3338 | |
3339 a1.uItemType = stru_4E3ACC[v3->spellnum].field_0; | |
486 | 3340 if (a1.uItemType) |
0 | 3341 { |
141 | 3342 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3343 { |
141 | 3344 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3345 v2 = v723; |
3346 } | |
3347 else | |
3348 { | |
3349 v715.uYawAngle = pParty->sRotationY; | |
3350 v715.uPitchAngle = pParty->sRotationX; | |
3351 } | |
3352 } | |
488 | 3353 |
486 | 3354 LODWORD(v725) = 0; |
3355 _this = 0; | |
488 | 3356 if (v3->forced_spell_skill_level) |
3357 { | |
3358 v11 = v3->forced_spell_skill_level; | |
3359 v723 = v11 & 0x3F; | |
3360 v2 = v723; | |
3361 } | |
3362 else | |
0 | 3363 { |
488 | 3364 //v667 = PLAYER_SKILL_STAFF; |
3365 if (v3->spellnum < SPELL_AIR_WIZARD_EYE) | |
3366 v667 = PLAYER_SKILL_FIRE; | |
3367 else if (v3->spellnum < SPELL_WATER_AWAKEN) | |
3368 v667 = PLAYER_SKILL_AIR; | |
3369 else if (v3->spellnum < SPELL_EARTH_STUN) | |
3370 v667 = PLAYER_SKILL_WATER; | |
3371 else if (v3->spellnum < SPELL_SPIRIT_DETECT_LIFE) | |
3372 v667 = PLAYER_SKILL_EARTH; | |
3373 else if (v3->spellnum < SPELL_MIND_REMOVE_FEAR) | |
3374 v667 = PLAYER_SKILL_SPIRIT; | |
3375 else if (v3->spellnum < SPELL_BODY_CURE_WEAKNESS) | |
3376 v667 = PLAYER_SKILL_MIND; | |
3377 else if (v3->spellnum < SPELL_LIGHT_LIGHT_BOLT) | |
3378 v667 = PLAYER_SKILL_BODY; | |
3379 else if (v3->spellnum < SPELL_DARK_REANIMATE) | |
3380 v667 = PLAYER_SKILL_LIGHT; | |
3381 else if (v3->spellnum < SPELL_BOW_ARROW) | |
3382 v667 = PLAYER_SKILL_DARK; | |
3383 else if (v3->spellnum == SPELL_BOW_ARROW) | |
3384 v667 = PLAYER_SKILL_BOW; | |
3385 else assert(false && "Unknown spell"); | |
3386 | |
0 | 3387 LODWORD(v725) = v667; |
488 | 3388 v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F; |
3389 v2 = v723; | |
3390 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
0 | 3391 } |
488 | 3392 |
0 | 3393 if ( HIBYTE(v11) & 1 ) |
3394 { | |
3395 v12 = 4; | |
3396 v731 = 4; | |
3397 } | |
3398 else | |
3399 { | |
3400 if ( (v11 & 0x80u) == 0 ) | |
3401 { | |
3402 v731 = ((v11 & 0x40) != 0) + 1; | |
3403 } | |
3404 else | |
3405 { | |
3406 v731 = 3; | |
3407 } | |
3408 v12 = v731; | |
3409 } | |
488 | 3410 |
3411 v730 = v3->spellnum; | |
3412 if (v3->forced_spell_skill_level) | |
486 | 3413 uRequiredMana = 0; |
488 | 3414 else |
3415 uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v12 - 1]; | |
3416 sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v12 - 1]; | |
3417 | |
3418 if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || | |
490 | 3419 LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) |
486 | 3420 uRequiredMana = 0; |
488 | 3421 |
3422 if (v3->spellnum >= PLAYER_SKILL_BOW || pPlayer->sMana >= uRequiredMana) | |
0 | 3423 break; |
488 | 3424 |
3425 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points" | |
0 | 3426 LABEL_203: |
486 | 3427 v3->spellnum = 0; |
0 | 3428 LABEL_1166: |
3429 ++n; | |
3430 if ( n >= 10 ) | |
3431 return; | |
3432 } | |
488 | 3433 |
3434 if (pPlayer->Cursed() && v730 < SPELL_BOW_ARROW) | |
3435 if (rand() % 100 < 50) | |
3436 { | |
3437 if ( pParty->bTurnBasedModeOn == 0 ) | |
3438 { | |
3439 //v646 = pPlayer; | |
3440 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
3441 //v647 = n; | |
3442 } | |
3443 else | |
3444 { | |
3445 //v647 = n; | |
3446 //v646 = pPlayer; | |
3447 //v648 = sRecoveryTime; | |
3448 //v649 = pPlayer; | |
3449 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
3450 pPlayer->SetRecoveryTime(sRecoveryTime); | |
3451 pTurnEngine->_40471C(); | |
3452 } | |
3453 | |
3454 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); // "Spell failed" | |
3455 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
3456 v711[n].spellnum = 0; | |
3457 pPlayer->sMana -= uRequiredMana; | |
3458 return; | |
3459 } | |
3460 | |
0 | 3461 switch ( v3->spellnum ) |
3462 { | |
488 | 3463 case SPELL_BOW_ARROW: |
3464 case SPELL_101: | |
0 | 3465 v17 = pPlayer; |
3466 _this = (ItemGen *)1; | |
488 | 3467 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 ) |
0 | 3468 _this = (ItemGen *)2; |
3469 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3470 a1.stru_24.Reset(); | |
3471 v18 = v3->spellnum; | |
3472 a1.field_4C = v2; | |
3473 a1.field_48 = v18; | |
3474 a1.field_50 = v731; | |
3475 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3476 if ( v17->WearsItem(510, 2) ) | |
3477 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3478 a1.vPosition.x = pParty->vPosition.x; | |
3479 a1.vPosition.y = pParty->vPosition.y; | |
3480 a1.uAttributes = 0; | |
3481 a1.uSpriteFrameID = 0; | |
3482 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3483 v19 = 8 * v3->uPlayerID; | |
303 | 3484 LOBYTE(v19) = v19 | OBJECT_Player; |
3485 a1.field_58_pid = v19; | |
0 | 3486 a1.field_5C = a2; |
3487 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3488 a1.uFacing = LOWORD(v715.uYawAngle); | |
3489 a1.uSoundID = LOWORD(v3->field_10); | |
3490 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3491 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3492 a1.uAttributes = 256; | |
3493 if ( pParty->bTurnBasedModeOn == 1 ) | |
3494 a1.uAttributes = 260; | |
3495 for ( i = 0; i < (signed int)this; ++i ) | |
3496 { | |
3497 if ( i ) | |
3498 a1.vPosition.z += 32; | |
3499 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3500 if ( a1.Create( | |
3501 v715.uYawAngle, | |
3502 v715.uPitchAngle, | |
3503 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3504 v3->uPlayerID + 1) != -1 | |
3505 && pParty->bTurnBasedModeOn == 1 ) | |
3506 ++pTurnEngine->field_1C; | |
3507 } | |
488 | 3508 goto play_sound_and_continue; |
3509 | |
490 | 3510 case SPELL_LASER_PROJECTILE: |
0 | 3511 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); |
3512 a1.stru_24.Reset(); | |
3513 a1.field_48 = v3->spellnum; | |
3514 a1.field_4C = v723; | |
3515 a1.field_50 = v731; | |
3516 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3517 a1.vPosition.x = pParty->vPosition.x; | |
3518 a1.vPosition.y = pParty->vPosition.y; | |
3519 a1.uAttributes = 0; | |
3520 a1.uSpriteFrameID = 0; | |
3521 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3522 v22 = 8 * v3->uPlayerID; | |
303 | 3523 LOBYTE(v22) = v22 | OBJECT_Player; |
3524 a1.field_58_pid = v22; | |
0 | 3525 a1.field_5C = a2; |
3526 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3527 a1.uFacing = LOWORD(v715.uYawAngle); | |
3528 a1.uSoundID = LOWORD(v3->field_10); | |
3529 memcpy( | |
3530 &a1.stru_24, | |
3531 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3532 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3533 + 5], | |
3534 sizeof(a1.stru_24)); | |
3535 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3536 HIBYTE(a1.uAttributes) |= 1u; | |
3537 a1.uSectorID = v23; | |
3538 if ( pParty->bTurnBasedModeOn == 1 ) | |
3539 LOBYTE(a1.uAttributes) |= 4u; | |
3540 if ( a1.Create( | |
3541 v715.uYawAngle, | |
3542 v715.uPitchAngle, | |
3543 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3544 v3->uPlayerID + 1) != -1 | |
3545 && pParty->bTurnBasedModeOn == 1 ) | |
3546 ++pTurnEngine->field_1C; | |
488 | 3547 goto play_sound_and_continue; |
3548 | |
3549 case SPELL_FIRE_TORCH_LIGHT: | |
0 | 3550 LODWORD(v733) = 3600 * v2; |
488 | 3551 |
3552 switch (v12) | |
3553 { | |
3554 case 1: amount = 2; break; | |
3555 case 2: amount = 3; break; | |
3556 case 3: | |
3557 case 4: amount = 4; break; | |
3558 default: | |
3559 assert(false); | |
3560 } | |
3561 | |
0 | 3562 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
488 | 3563 goto play_sound_and_continue; |
3564 | |
3565 pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * v2 * 4.2666669), v731, amount, 0, 0); | |
3566 goto LABEL_1056; | |
3567 | |
0 | 3568 case 7: |
3569 v29 = v12 - 2; | |
3570 if ( v29 ) | |
3571 { | |
3572 v30 = v29 - 1; | |
3573 if ( v30 ) | |
3574 { | |
3575 if ( v30 == 1 ) | |
3576 amount = 9; | |
3577 else | |
3578 amount = 3; | |
3579 } | |
3580 else | |
3581 { | |
3582 amount = 7; | |
3583 } | |
3584 } | |
3585 else | |
3586 { | |
3587 amount = 5; | |
3588 } | |
3589 v31 = v3->uPlayerID; | |
486 | 3590 HIDWORD(v733) = 0; |
0 | 3591 v32 = 8 * v31; |
486 | 3592 LOBYTE(v32) = v32 | OBJECT_Player; |
3593 if ( (signed int)uNumLayingItems > 0 ) | |
0 | 3594 { |
3595 v33 = (char *)&pLayingItems[0].field_48; | |
3596 v730 = uNumLayingItems; | |
3597 do | |
3598 { | |
486 | 3599 if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) |
0 | 3600 ++HIDWORD(v733); |
3601 v33 += 112; | |
3602 --v730; | |
3603 } | |
3604 while ( v730 ); | |
3605 } | |
3606 if ( SHIDWORD(v733) > amount ) | |
3607 goto LABEL_200; | |
3608 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3609 goto play_sound_and_continue; |
0 | 3610 a1.stru_24.Reset(); |
3611 a1.field_48 = v3->spellnum; | |
3612 a1.field_4C = v2; | |
3613 a1.field_50 = v731; | |
3614 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3615 a1.vPosition.y = pParty->vPosition.y; | |
3616 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3617 a1.uAttributes = 0; |
0 | 3618 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3619 a1.uSectorID = pIndoor->GetSector( | |
3620 pParty->vPosition.x, | |
3621 pParty->vPosition.y, | |
3622 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3623 a1.uSpriteFrameID = 0; |
0 | 3624 v34 = 8 * v3->uPlayerID; |
303 | 3625 LOBYTE(v34) = v34 | OBJECT_Player; |
3626 a1.field_58_pid = v34; | |
0 | 3627 a1.field_5C = a2; |
3628 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3629 a1.uFacing = LOWORD(v715.uYawAngle); | |
3630 a1.uSoundID = LOWORD(v3->field_10); | |
3631 if ( pParty->bTurnBasedModeOn == 1 ) | |
3632 LOBYTE(a1.uAttributes) |= 4u; | |
3633 v669 = v3->uPlayerID + 1; | |
3634 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3635 v35 = pParty->sRotationX + 10; | |
3636 goto LABEL_124; | |
3637 case 20: | |
3638 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3639 goto play_sound_and_continue; |
486 | 3640 if (!a2) |
0 | 3641 goto LABEL_200; |
141 | 3642 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3643 goto LABEL_1056; |
486 | 3644 v699 = 0; |
3645 v698 = 0; | |
3646 v697 = 0; | |
0 | 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); | |
486 | 3652 a1.uAttributes = 0; |
3653 a1.uSectorID = 0; | |
3654 a1.uSpriteFrameID = 0; | |
0 | 3655 v37 = v3->uPlayerID; |
3656 a1.field_60_distance_related_prolly_lod = 0; | |
3657 v37 *= 8; | |
303 | 3658 LOBYTE(v37) = v37 | OBJECT_Player; |
486 | 3659 a1.uFacing = 0; |
303 | 3660 a1.field_58_pid = v37; |
0 | 3661 v38 = a2 >> 3; |
3662 a1.uSoundID = LOWORD(v3->field_10); | |
3663 v39 = a2 >> 3; | |
3664 a1.vPosition.x = pActors[v39].vPosition.x; | |
3665 v40 = pActors[v39].vPosition.y; | |
3666 a1.vPosition.z = pActors[v39].vPosition.z; | |
3667 v41 = 8 * (a2 >> 3); | |
3668 a1.vPosition.y = v40; | |
486 | 3669 LOBYTE(v41) = v41 | OBJECT_Actor; |
0 | 3670 a1.field_5C = v41; |
486 | 3671 v42 = a1.Create(0, 0, 0, 0); |
0 | 3672 v43 = &v697; |
3673 goto LABEL_133; | |
3674 case 44: | |
3675 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3676 goto play_sound_and_continue; |
0 | 3677 v726 = (Player *)(a2 >> 3); |
3678 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3679 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3680 goto LABEL_1056; |
90 | 3681 pActors[a2 >> 3].pActorBuffs[10].Apply( |
486 | 3682 pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); |
3683 v706 = 0; | |
3684 v705 = 0; | |
3685 v704 = 0; | |
0 | 3686 a1.stru_24.Reset(); |
3687 a1.field_48 = v3->spellnum; | |
3688 a1.field_4C = v2; | |
3689 a1.field_50 = v731; | |
3690 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 3691 a1.uAttributes = 0; |
3692 a1.uSectorID = 0; | |
3693 a1.uSpriteFrameID = 0; | |
0 | 3694 v44 = v3->uPlayerID; |
3695 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 3696 a1.uFacing = 0; |
0 | 3697 v44 *= 8; |
303 | 3698 LOBYTE(v44) = v44 | OBJECT_Player; |
0 | 3699 v38 = (signed int)v726; |
303 | 3700 a1.field_58_pid = v44; |
0 | 3701 a1.uSoundID = LOWORD(v3->field_10); |
3702 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3703 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3704 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3705 v46 = 8 * (int)v726; | |
3706 a1.vPosition.y = v45; | |
486 | 3707 LOBYTE(v46) = 8 * (char)v726 | OBJECT_Actor; |
0 | 3708 a1.field_5C = v46; |
486 | 3709 v42 = a1.Create(0, 0, 0, 0); |
0 | 3710 v43 = &v704; |
3711 LABEL_133: | |
3712 v670 = (Vec3_int_ *)v43; | |
3713 v47 = v38; | |
3714 goto LABEL_139; | |
3715 case 79: | |
486 | 3716 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || (a2 & 7) != OBJECT_Actor) |
488 | 3717 goto play_sound_and_continue; |
0 | 3718 v730 = a2 >> 3; |
486 | 3719 v693 = 0; |
0 | 3720 HIDWORD(v733) = (int)&pActors[a2 >> 3]; |
486 | 3721 v692 = 0; |
3722 v691 = 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); | |
3728 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | |
3729 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3730 v48 = *(short *)(HIDWORD(v733) + 138); | |
3731 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
486 | 3732 a1.uAttributes = 0; |
0 | 3733 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); |
486 | 3734 a1.uSpriteFrameID = 0; |
0 | 3735 v49 = 8 * v3->uPlayerID; |
303 | 3736 LOBYTE(v49) = v49 | OBJECT_Player; |
3737 a1.field_58_pid = v49; | |
0 | 3738 a1.field_5C = a2; |
3739 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3740 a1.uFacing = LOWORD(v715.uYawAngle); | |
3741 LOWORD(v49) = LOWORD(v3->field_10); | |
3742 LOBYTE(a1.uAttributes) |= 0x80u; | |
3743 a1.uSoundID = v49; | |
486 | 3744 v726 = (Player *)a1.Create(0, 0, 0, 0); |
0 | 3745 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) |
3746 goto LABEL_200; | |
3747 v47 = v730; | |
3748 v670 = (Vec3_int_ *)&v691; | |
3749 v42 = (signed int)v726; | |
3750 LABEL_139: | |
3751 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3752 goto LABEL_1056; | |
3753 case 2: | |
3754 case 6: | |
3755 case 11: | |
3756 case 18: | |
3757 case 26: | |
3758 case 32: | |
3759 case 34: | |
3760 case 37: | |
3761 case 57: | |
3762 case 65: | |
3763 case 70: | |
3764 case 78: | |
3765 case 97: | |
3766 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3767 goto play_sound_and_continue; |
0 | 3768 a1.stru_24.Reset(); |
3769 a1.field_48 = v3->spellnum; | |
3770 a1.field_4C = v2; | |
3771 a1.field_50 = v731; | |
3772 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3773 a1.vPosition.y = pParty->vPosition.y; | |
3774 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3775 a1.uAttributes = 0; |
0 | 3776 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3777 a1.uSectorID = pIndoor->GetSector( | |
3778 pParty->vPosition.x, | |
3779 pParty->vPosition.y, | |
3780 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3781 a1.uSpriteFrameID = 0; |
0 | 3782 v50 = 8 * v3->uPlayerID; |
303 | 3783 LOBYTE(v50) = v50 | OBJECT_Player; |
3784 a1.field_58_pid = v50; | |
0 | 3785 a1.field_5C = a2; |
3786 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3787 a1.uFacing = LOWORD(v715.uYawAngle); | |
3788 a1.uSoundID = LOWORD(v3->field_10); | |
3789 if ( pParty->bTurnBasedModeOn == 1 ) | |
3790 LOBYTE(a1.uAttributes) |= 4u; | |
3791 if ( v3->spellnum == 18 ) | |
3792 LOBYTE(a1.uAttributes) |= 0x40u; | |
3793 goto LABEL_156; | |
3794 case 29: | |
3795 case 39: | |
3796 case 76: | |
3797 case 90: | |
3798 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3799 goto play_sound_and_continue; |
0 | 3800 a1.stru_24.Reset(); |
3801 a1.field_48 = v3->spellnum; | |
3802 a1.field_4C = v2; | |
3803 a1.field_50 = v731; | |
3804 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3805 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3806 a1.vPosition.y = pParty->vPosition.y; | |
3807 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3808 v660 = pParty->vPosition.y; | |
3809 goto LABEL_153; | |
3810 case 87: | |
3811 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3812 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3813 goto LABEL_200; | |
3814 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3815 goto LABEL_152; | |
488 | 3816 goto play_sound_and_continue; |
0 | 3817 case 81: |
3818 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3819 goto play_sound_and_continue; |
486 | 3820 if ( !a2 |
141 | 3821 || (a2 & 7) != OBJECT_Actor |
0 | 3822 || (v730 = a2 >> 3, |
3823 v721 = (int)&pActors[a2 >> 3], | |
3824 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3825 goto LABEL_1056; | |
486 | 3826 Actor::AI_Stand(v730, 4u, 0x80u, 0); |
0 | 3827 v726 = (Player *)(23040 * v2); |
3828 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3829 v55 = v721; | |
486 | 3830 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0); |
0 | 3831 *(char *)(v55 + 38) |= 8u; |
486 | 3832 *(short *)(v55 + 148) = 0; |
3833 v672 = 0; | |
3834 *(short *)(v55 + 150) = 0; | |
0 | 3835 v661 = (Actor *)v55; |
3836 goto LABEL_165; | |
3837 case 35: | |
3838 if ( v12 == 2 ) | |
3839 { | |
3840 v57 = 300 * v2; | |
3841 } | |
3842 else | |
3843 { | |
3844 if ( v12 == 3 ) | |
3845 { | |
3846 amount = 4; | |
3847 v57 = 300 * v2; | |
3848 goto LABEL_174; | |
3849 } | |
3850 if ( v12 == 4 ) | |
3851 { | |
3852 v57 = 300 * v2; | |
3853 amount = 8; | |
3854 goto LABEL_174; | |
3855 } | |
3856 v57 = 180 * v2; | |
3857 } | |
3858 amount = 2; | |
3859 LABEL_174: | |
3860 LODWORD(v733) = v57; | |
3861 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3862 goto play_sound_and_continue; |
141 | 3863 if ( (a2 & 7) != OBJECT_Actor |
0 | 3864 || (v721 = 836 * (a2 >> 3), |
90 | 3865 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3866 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3867 goto LABEL_1056; |
3868 v726 = (Player *)(23040 * v2); | |
3869 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3870 v59 = v721; | |
112 | 3871 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3872 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3873 pParty->uTimePlayed + (signed int)v58, | |
0 | 3874 v731, |
3875 amount, | |
486 | 3876 0, |
3877 0); | |
0 | 3878 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; |
486 | 3879 v672 = 0; |
0 | 3880 v661 = (Actor *)LODWORD(v718); |
3881 goto LABEL_165; | |
3882 case 60: | |
3883 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3884 goto play_sound_and_continue; |
0 | 3885 v730 = 836 * (a2 >> 3); |
90 | 3886 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3887 goto LABEL_1056; |
3888 LODWORD(v733) = 300 * v2; | |
3889 if ( v731 == 2 ) | |
3890 { | |
3891 LODWORD(v733) = 600 * v2; | |
3892 } | |
3893 else | |
3894 { | |
3895 if ( v731 == 3 ) | |
3896 LODWORD(v733) = 29030400; | |
3897 } | |
112 | 3898 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3899 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3900 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3901 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3902 v726 = (Player *)((int)v733 << 7); | |
3903 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3904 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3905 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 3906 v731, 0, 0, 0); |
0 | 3907 a1.stru_24.Reset(); |
3908 a1.field_48 = v3->spellnum; | |
3909 a1.field_4C = v2; | |
3910 a1.field_50 = v731; | |
3911 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 3912 v61 = a2 >> 3; |
0 | 3913 goto LABEL_1086; |
3914 case 92: | |
3915 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3916 goto play_sound_and_continue; |
0 | 3917 a1.stru_24.Reset(); |
3918 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
3919 a1.vPosition.x = pParty->vPosition.x; | |
3920 a1.vPosition.y = pParty->vPosition.y; | |
486 | 3921 a1.uAttributes = 0; |
0 | 3922 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3923 a1.uSectorID = pIndoor->GetSector( | |
3924 pParty->vPosition.x, | |
3925 pParty->vPosition.y, | |
3926 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3927 a1.uSpriteFrameID = 0; |
0 | 3928 v62 = 8 * v3->uPlayerID; |
303 | 3929 LOBYTE(v62) = v62 | OBJECT_Player; |
3930 a1.field_58_pid = v62; | |
0 | 3931 a1.field_5C = a2; |
3932 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3933 a1.uFacing = LOWORD(v715.uYawAngle); | |
3934 a1.uSoundID = LOWORD(v3->field_10); | |
3935 a1.field_50 = v731; | |
3936 a1.field_48 = 3; | |
3937 a1.field_4C = 300 * v2; | |
3938 goto LABEL_154; | |
3939 case 4: | |
3940 v63 = v12 - 1; | |
3941 if ( !v63 ) | |
3942 { | |
3943 amount = 10; | |
3944 goto LABEL_195; | |
3945 } | |
3946 v64 = v63 - 1; | |
3947 if ( !v64 ) | |
3948 { | |
3949 amount = 11; | |
3950 goto LABEL_195; | |
3951 } | |
3952 v65 = v64 - 1; | |
3953 if ( !v65 ) | |
3954 { | |
3955 amount = 12; | |
3956 LABEL_195: | |
3957 LODWORD(v733) = 3600 * v2; | |
3958 goto LABEL_196; | |
3959 } | |
3960 if ( v65 == 1 ) | |
3961 { | |
486 | 3962 LODWORD(v733) = 0; |
0 | 3963 amount = 12; |
3964 } | |
3965 LABEL_196: | |
3966 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3967 goto play_sound_and_continue; |
89 | 3968 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
3969 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
3970 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
3971 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
3972 { | |
315 | 3973 if (!v730c->Broken()) |
0 | 3974 { |
486 | 3975 if (!v730c->uSpecEnchantmentType) |
0 | 3976 { |
486 | 3977 if (!v730c->uEncantmentType) |
0 | 3978 { |
3979 v68 = BYTE4(v726->pConditions[3]); | |
3980 if ( !v68 || v68 == 1 || v68 == 2 ) | |
3981 { | |
377 | 3982 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
0 | 3983 { |
89 | 3984 v69 = v730c; |
0 | 3985 v14 = v731 == 4; |
3986 *(int *)(v730 + 12) = amount; | |
3987 if ( !v14 ) | |
3988 { | |
3989 v726 = (Player *)((int)v733 << 7); | |
3990 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
3991 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
3992 * 0.033333335); | |
3993 *(int *)(v69 + 20) |= 8u; | |
3994 } | |
3995 *(int *)(v69 + 20) |= 0x10u; | |
3996 LABEL_1055: | |
3997 dword_50C9A8 = 256; | |
3998 LABEL_1056: | |
3999 LODWORD(v727) = 1; | |
488 | 4000 play_sound_and_continue: |
0 | 4001 if ( v3->field_8 & 0x20 ) |
4002 { | |
4003 LABEL_1162: | |
4004 if ( v727 != 0.0 ) | |
4005 pAudioPlayer->PlaySound( | |
4006 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4007 0, | |
4008 0, | |
4009 -1, | |
4010 0, | |
4011 v3->field_10, | |
4012 0, | |
4013 0); | |
4014 } | |
4015 else | |
4016 { | |
4017 if ( sRecoveryTime < 0 ) | |
4018 sRecoveryTime = 0; | |
4019 if ( pParty->bTurnBasedModeOn ) | |
4020 { | |
4021 v645 = sRecoveryTime; | |
4022 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4023 pPlayer->SetRecoveryTime(v645); | |
4024 if ( !some_active_character ) | |
4025 pTurnEngine->_40471C(); | |
4026 } | |
4027 else | |
4028 { | |
4029 pPlayer->SetRecoveryTime( | |
4030 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4031 } | |
4032 if ( v727 != 0.0 ) | |
4033 { | |
187 | 4034 pPlayer->PlaySound(SPEECH_49, 0); |
0 | 4035 goto LABEL_1162; |
4036 } | |
4037 } | |
4038 v3->spellnum = 0; | |
486 | 4039 //v1 = 0; |
0 | 4040 LABEL_1165: |
4041 v2 = v723; | |
4042 goto LABEL_1166; | |
4043 } | |
4044 } | |
4045 } | |
4046 } | |
4047 } | |
4048 } | |
4049 LABEL_199: | |
4050 dword_50C9D0 = 113; | |
486 | 4051 dword_50C9D4 = 0; |
0 | 4052 dword_50C9D8 = 1; |
4053 LABEL_200: | |
4054 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4055 LABEL_201: | |
4056 v67 = 2; | |
4057 LABEL_202: | |
4058 ShowStatusBarString(v66, v67); | |
486 | 4059 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 4060 goto LABEL_203; |
488 | 4061 |
4062 case SPELL_BODY_REGENERATION: | |
0 | 4063 v70 = v12 - 1; |
4064 LODWORD(v733) = 3600 * v2; | |
4065 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4066 { | |
4067 v72 = v71 - 1; | |
4068 if ( v72 ) | |
4069 { | |
4070 if ( v72 == 1 ) | |
4071 amount = 10; | |
4072 } | |
4073 else | |
4074 { | |
4075 amount = 3; | |
4076 } | |
4077 } | |
4078 else | |
4079 { | |
4080 amount = 1; | |
4081 } | |
4082 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4083 goto play_sound_and_continue; |
4084 | |
4085 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
4086 | |
4087 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_REGENERATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669), v731, amount, 0, 0); | |
4088 goto LABEL_1056; | |
4089 | |
4090 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
4091 case SPELL_AIR_PROTECTION_FROM_AIR: | |
4092 case SPELL_WATER_PROTECTION_FROM_WATER: | |
4093 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
4094 case SPELL_MIND_PROTECTION_FROM_MIND: | |
4095 case SPELL_BODY_PROTECTION_FROM_BODY: | |
0 | 4096 v76 = v12 - 1; |
4097 LODWORD(v733) = 3600 * v2; | |
4098 if ( v76 ) | |
4099 { | |
4100 v77 = v76 - 1; | |
4101 if ( v77 ) | |
4102 { | |
4103 v78 = v77 - 1; | |
4104 if ( v78 ) | |
4105 { | |
4106 if ( v78 != 1 ) | |
4107 goto LABEL_232; | |
4108 v79 = 4 * v2; | |
4109 } | |
4110 else | |
4111 { | |
4112 v79 = 3 * v2; | |
4113 } | |
4114 } | |
4115 else | |
4116 { | |
4117 v79 = 2 * v2; | |
4118 } | |
4119 amount = v79; | |
4120 } | |
4121 else | |
4122 { | |
4123 amount = v2; | |
4124 } | |
4125 LABEL_232: | |
488 | 4126 //v80 = v3->spellnum; |
4127 switch (v3->spellnum) | |
4128 { | |
4129 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
4130 LODWORD(v725) = PARTY_BUFF_RESIST_FIRE; | |
0 | 4131 break; |
488 | 4132 case SPELL_AIR_PROTECTION_FROM_AIR: |
4133 LODWORD(v725) = PARTY_BUFF_RESIST_AIR; | |
0 | 4134 break; |
488 | 4135 case SPELL_WATER_PROTECTION_FROM_WATER: |
4136 LODWORD(v725) = PARTY_BUFF_RESIST_WATER; | |
4137 break; | |
4138 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
4139 LODWORD(v725) = PARTY_BUFF_RESIST_EARTH; | |
0 | 4140 break; |
488 | 4141 case SPELL_MIND_PROTECTION_FROM_MIND: |
4142 LODWORD(v725) = PARTY_BUFF_RESIST_MIND; | |
0 | 4143 break; |
488 | 4144 case SPELL_BODY_PROTECTION_FROM_BODY: |
4145 LODWORD(v725) = PARTY_BUFF_RESIST_BODY; | |
0 | 4146 break; |
4147 default: | |
488 | 4148 assert(false); |
4149 goto LABEL_1166; | |
0 | 4150 } |
4151 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4152 goto play_sound_and_continue; |
4153 | |
4154 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4155 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4156 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4157 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4158 v83 = 1; |
488 | 4159 |
0 | 4160 v90 = (double)(signed int)v733 * 4.2666669; |
488 | 4161 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); |
4162 LODWORD(v727) = 1; | |
4163 goto play_sound_and_continue; | |
4164 | |
4165 case SPELL_FIRE_HASTE: | |
486 | 4166 if ( v12 <= 0 ) |
0 | 4167 goto LABEL_254; |
4168 if ( v12 <= 2 ) | |
4169 { | |
4170 v91 = 60 * (v2 + 60); | |
4171 } | |
4172 else | |
4173 { | |
4174 if ( v12 == 3 ) | |
4175 { | |
4176 v91 = 180 * (v2 + 20); | |
4177 } | |
4178 else | |
4179 { | |
4180 if ( v12 != 4 ) | |
4181 goto LABEL_254; | |
4182 v91 = 240 * (v2 + 15); | |
4183 } | |
4184 } | |
4185 LODWORD(v733) = v91; | |
4186 LABEL_254: | |
4187 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4188 { | |
89 | 4189 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4190 LODWORD(v727) = 1; |
4191 do | |
4192 { | |
89 | 4193 if ( v92->pConditions ) |
486 | 4194 LODWORD(v727) = 0; |
89 | 4195 ++v92; |
0 | 4196 } |
89 | 4197 while ( v92 <= &pParty->pPlayers[3] ); |
486 | 4198 if (LODWORD(v727)) |
0 | 4199 { |
4200 v726 = (Player *)((int)v733 << 7); | |
488 | 4201 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
4202 | |
4203 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4204 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4205 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4206 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4207 } |
4208 } | |
488 | 4209 goto play_sound_and_continue; |
4210 | |
4211 case SPELL_SPIRIT_BLESS: | |
0 | 4212 v101 = v12 - 1; |
4213 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4214 { | |
4215 v103 = v102 - 1; | |
4216 if ( v103 ) | |
4217 { | |
4218 if ( v103 != 1 ) | |
4219 goto LABEL_269; | |
4220 v104 = 3600 * (v2 + 1); | |
4221 } | |
4222 else | |
4223 { | |
4224 v104 = 900 * (v2 + 4); | |
4225 } | |
4226 } | |
4227 else | |
4228 { | |
4229 v104 = 300 * (v2 + 12); | |
4230 } | |
4231 LODWORD(v733) = v104; | |
4232 LABEL_269: | |
4233 amount = v2 + 5; | |
4234 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4235 goto play_sound_and_continue; |
0 | 4236 if ( v731 == 1 ) |
4237 { | |
4238 v108 = v3->uPlayerID_2; | |
4239 v109 = v3->spellnum; | |
4240 v110 = pGame->GetStru6(); | |
4241 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
486 | 4242 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, 0, 65536); |
488 | 4243 //v668 = 0; |
0 | 4244 v716 = v111; |
488 | 4245 //v658 = v111; |
4246 //v653 = amount; | |
0 | 4247 v726 = (Player *)((int)v733 << 7); |
488 | 4248 //v651 = 1; |
4249 //v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4250 //v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS]; | |
4251 //LABEL_103: | |
4252 //HIDWORD(v650) = HIDWORD(v28); | |
4253 //LABEL_104: | |
4254 //LODWORD(v650) = v28; | |
4255 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), 1, amount, v111, 0); | |
4256 goto LABEL_1056; | |
0 | 4257 } |
4258 v105 = 0; | |
4259 v726 = (Player *)((int)v733 << 7); | |
4260 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4261 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4262 do |
4263 { | |
488 | 4264 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v105); |
486 | 4265 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536); |
4266 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | |
89 | 4267 ++v730b; |
0 | 4268 ++v105; |
4269 } | |
89 | 4270 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4271 goto LABEL_1056; |
488 | 4272 |
0 | 4273 case 52: |
486 | 4274 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && (a2 & 7) == OBJECT_Actor) |
0 | 4275 { |
4276 v730 = a2 >> 3; | |
4277 v112 = &pActors[a2 >> 3]; | |
4278 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4279 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4280 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4281 _this = (ItemGen *)v113; | |
4282 v114 = v721; | |
4283 v115 = (unsigned int)v726; | |
4284 if ( v113 < v721 ) | |
4285 { | |
4286 v116 = v113; | |
4287 v113 = v721; | |
4288 v114 = v116; | |
4289 } | |
4290 if ( v113 < (signed int)v726 ) | |
4291 { | |
4292 v117 = v113; | |
4293 v113 = (int)v726; | |
4294 v115 = v117; | |
4295 } | |
4296 if ( v114 < (signed int)v115 ) | |
4297 { | |
4298 v118 = v115; | |
4299 v115 = v114; | |
4300 v114 = v118; | |
4301 } | |
4302 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4303 if ( (double)(signed int)this <= 307.2 ) | |
4304 { | |
4305 v703 = 0; | |
4306 v702 = 0; | |
4307 v701 = 0; | |
4308 a1.stru_24.Reset(); | |
4309 v119 = HIDWORD(v733); | |
4310 a1.field_48 = *(int *)HIDWORD(v733); | |
4311 a1.field_4C = v723; | |
4312 a1.field_50 = v731; | |
4313 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4314 a1.uAttributes = 0; | |
4315 a1.uSectorID = 0; | |
4316 a1.uSpriteFrameID = 0; | |
4317 v120 = 8 * *(short *)(v119 + 2); | |
303 | 4318 LOBYTE(v120) = v120 | OBJECT_Player; |
0 | 4319 a1.field_60_distance_related_prolly_lod = 0; |
303 | 4320 a1.field_58_pid = v120; |
0 | 4321 a1.uFacing = 0; |
4322 a1.uSoundID = *(short *)(v119 + 16); | |
4323 a1.vPosition.x = v112->vPosition.x; | |
4324 a1.vPosition.y = v112->vPosition.y; | |
4325 v726 = (Player *)v112->uActorHeight; | |
4326 v121 = 8 * a2; | |
4327 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4328 LOBYTE(v121) = 8 * a2 | 3; | |
4329 a1.field_5C = v121; | |
4330 v122 = a1.Create(0, 0, 0, 0); | |
4331 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4332 LODWORD(v727) = 1; | |
4333 } | |
4334 else | |
4335 { | |
4336 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4337 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4338 *(int *)HIDWORD(v733) = 0; | |
4339 } | |
4340 v3 = (stru277 *)HIDWORD(v733); | |
4341 } | |
488 | 4342 goto play_sound_and_continue; |
4343 | |
4344 case SPELL_AIR_SHIELD: | |
4345 case SPELL_EARTH_STONESKIN: | |
4346 case SPELL_SPIRIT_HEROISM: | |
0 | 4347 v123 = v12 - 1; |
4348 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4349 { | |
4350 v125 = v124 - 1; | |
4351 if ( v125 ) | |
4352 { | |
4353 if ( v125 != 1 ) | |
4354 goto LABEL_296; | |
4355 v126 = 3600 * (v2 + 1); | |
4356 } | |
4357 else | |
4358 { | |
4359 v126 = 900 * (v2 + 4); | |
4360 } | |
4361 } | |
4362 else | |
4363 { | |
4364 v126 = 300 * (v2 + 12); | |
4365 } | |
4366 LODWORD(v733) = v126; | |
4367 LABEL_296: | |
4368 v127 = v3->spellnum; | |
4369 if ( v127 == 17 ) | |
4370 { | |
486 | 4371 amount = 0; |
0 | 4372 LODWORD(v725) = 14; |
4373 } | |
4374 else | |
4375 { | |
4376 if ( v127 == 38 ) | |
4377 { | |
4378 LODWORD(v725) = 15; | |
4379 amount = v2 + 5; | |
4380 } | |
4381 else | |
4382 { | |
4383 if ( v127 != 51 ) | |
4384 goto LABEL_1166; | |
4385 LODWORD(v725) = 9; | |
4386 amount = v2 + 5; | |
4387 } | |
4388 } | |
4389 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4390 goto play_sound_and_continue; |
4391 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4392 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4393 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4394 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4395 v83 = 1; |
4396 v726 = (Player *)((int)v733 << 7); | |
4397 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
488 | 4398 //LABEL_304: |
4399 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); | |
4400 LODWORD(v727) = v83; | |
4401 goto play_sound_and_continue; | |
4402 | |
4403 case SPELL_FIRE_IMMOLATION: | |
0 | 4404 v138 = v12 - 2; |
4405 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4406 v140 = 600 * v2; | |
4407 else | |
4408 v140 = 60 * v2; | |
4409 LODWORD(v733) = v140; | |
4410 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4411 goto play_sound_and_continue; |
4412 | |
4413 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4414 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4415 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4416 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
4417 | |
0 | 4418 v726 = (Player *)((int)v733 << 7); |
488 | 4419 |
4420 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | |
4421 goto LABEL_1056; | |
4422 | |
0 | 4423 case 9: |
4424 v149 = v12 - 1; | |
4425 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4426 { | |
4427 if ( v151 == 1 ) | |
4428 _this = (ItemGen *)20; | |
4429 } | |
4430 else | |
4431 { | |
4432 _this = (ItemGen *)16; | |
4433 } | |
4434 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4435 { | |
4436 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4437 goto LABEL_201; | |
4438 } | |
4439 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4440 goto play_sound_and_continue; |
0 | 4441 LODWORD(v725) = a2 & 7; |
141 | 4442 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4443 { |
4444 v152 = a2 >> 3; | |
4445 uRequiredMana = pActors[v152].vPosition.x; | |
4446 v153 = pActors[v152].vPosition.y; | |
4447 v154 = pActors[v152].vPosition.z; | |
4448 LODWORD(v727) = v153; | |
4449 } | |
4450 else | |
4451 { | |
323 | 4452 v155 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4453 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); |
323 | 4454 v156 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4455 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); |
4456 v154 = pParty->vPosition.z; | |
4457 } | |
4458 HIDWORD(v733) = v154; | |
4459 v713 = v154 + 2500; | |
486 | 4460 v721 = 0; |
4461 LODWORD(v718) = 0; | |
4462 if ( (signed int)this > 0 ) | |
0 | 4463 { |
4464 *(float *)&y = (double)SHIDWORD(v733); | |
4465 *(float *)&v732 = (double)v713; | |
4466 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4467 v726 = (Player *)this; | |
4468 do | |
4469 { | |
4470 v157 = rand(); | |
4471 v158 = (double)SLODWORD(v718); | |
4472 v718 = v158; | |
4473 v159 = (double)v721; | |
4474 *(float *)&v721 = v159; | |
4475 a2 = v157 % 1000; | |
4476 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4477 v725 = v159 * v159; | |
4478 *(float *)&_this = v158 * v158; | |
4479 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4480 { | |
486 | 4481 LODWORD(v687) = 0; |
4482 HIDWORD(v687) = 0; | |
0 | 4483 } |
4484 else | |
4485 { | |
4486 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4487 v687 = __PAIR__( | |
4488 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4489 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4490 } | |
4491 a1.stru_24.Reset(); | |
4492 a1.field_48 = v3->spellnum; | |
4493 a1.field_4C = v2; | |
4494 a1.field_50 = v731; | |
4495 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 4496 a1.uAttributes = 0; |
0 | 4497 a1.vPosition.x = uRequiredMana; |
4498 a1.vPosition.y = LODWORD(v727); | |
486 | 4499 a1.uSectorID = 0; |
0 | 4500 a1.vPosition.z = a2 + v713; |
486 | 4501 a1.uSpriteFrameID = 0; |
303 | 4502 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4503 a1.field_5C = v730; |
4504 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4505 a1.uFacing = v687; | |
4506 a1.uSoundID = LOWORD(v3->field_10); | |
4507 if ( pParty->bTurnBasedModeOn == 1 ) | |
4508 a1.uAttributes = 4; | |
4509 if ( a1.Create( | |
4510 v687, | |
4511 SHIDWORD(v687), | |
4512 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4513 0) != -1 |
0 | 4514 && pParty->bTurnBasedModeOn == 1 ) |
4515 ++pTurnEngine->field_1C; | |
4516 LODWORD(v718) = rand() % 1024 - 512; | |
4517 v160 = rand(); | |
4518 v14 = v726 == (Player *)1; | |
4519 v726 = (Player *)((char *)v726 - 1); | |
4520 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4521 } | |
4522 while ( !v14 ); | |
4523 } | |
4524 goto LABEL_1056; | |
4525 case 10: | |
4526 v67 = 2; | |
4527 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4528 { | |
4529 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4530 goto LABEL_202; | |
4531 } | |
4532 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4533 goto play_sound_and_continue; |
0 | 4534 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
486 | 4535 v700.z = 0; |
4536 v700.y = 0; | |
4537 v700.x = 0; | |
0 | 4538 a1.stru_24.Reset(); |
4539 a1.field_48 = v3->spellnum; | |
4540 a1.field_4C = v2; | |
4541 a1.field_50 = v731; | |
4542 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 4543 a1.uAttributes = 0; |
4544 a1.uSectorID = 0; | |
4545 a1.uSpriteFrameID = 0; | |
0 | 4546 v161 = v3->uPlayerID; |
4547 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 4548 a1.uFacing = 0; |
0 | 4549 v161 *= 8; |
303 | 4550 LOBYTE(v161) = v161 | OBJECT_Player; |
4551 a1.field_58_pid = v161; | |
0 | 4552 a1.uSoundID = LOWORD(v3->field_10); |
486 | 4553 a2 = 0; |
4554 if ( (signed int)v726 > 0 ) | |
0 | 4555 { |
4556 do | |
4557 { | |
4558 v162 = dword_50BF30[a2]; | |
4559 a1.vPosition.x = pActors[v162].vPosition.x; | |
4560 a1.vPosition.y = pActors[v162].vPosition.y; | |
4561 v732 = pActors[v162].uActorHeight; | |
4562 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4563 v163 = 8 * dword_50BF30[a2]; | |
486 | 4564 LOBYTE(v163) = v163 | OBJECT_Actor; |
0 | 4565 a1.field_5C = v163; |
486 | 4566 v164 = a1.Create(0, 0, 0, 0); |
0 | 4567 v165 = a2; |
4568 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
488 | 4569 pGame->GetStru6()->_4A81CA(&a1); |
4570 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
0 | 4571 a2 = v165 + 1; |
4572 } | |
4573 while ( v165 + 1 < (signed int)v726 ); | |
4574 } | |
4575 goto LABEL_1056; | |
488 | 4576 |
4577 case SPELL_AIR_WIZARD_EYE: | |
0 | 4578 LODWORD(v733) = 3600 * v2; |
4579 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4580 goto play_sound_and_continue; |
0 | 4581 v168 = 0; |
4582 do | |
4583 { | |
486 | 4584 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536); |
0 | 4585 v716 = v169; |
4586 } | |
4587 while ( v168 < 4 ); | |
488 | 4588 |
0 | 4589 v732 = (int)v733 << 7; |
488 | 4590 |
4591 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | |
4592 goto LABEL_1056; | |
4593 | |
4594 case SPELL_AIR_FEATHER_FALL: | |
0 | 4595 v170 = v12 - 1; |
4596 if ( !v170 ) | |
4597 { | |
4598 v173 = 300 * v2; | |
4599 goto LABEL_353; | |
4600 } | |
4601 v171 = v170 - 1; | |
4602 if ( !v171 ) | |
4603 { | |
4604 v173 = 600 * v2; | |
4605 goto LABEL_353; | |
4606 } | |
4607 v172 = v171 - 1; | |
4608 if ( !v172 || v172 == 1 ) | |
4609 { | |
4610 v173 = 3600 * v2; | |
4611 LABEL_353: | |
4612 LODWORD(v733) = v173; | |
4613 } | |
4614 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4615 goto play_sound_and_continue; |
0 | 4616 v174 = 0; |
4617 do | |
486 | 4618 pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536); |
0 | 4619 while ( v174 < 4 ); |
488 | 4620 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4621 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4622 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4623 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4624 v83 = 1; |
4625 v732 = (int)v733 << 7; | |
488 | 4626 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
4627 LODWORD(v727) = v83; | |
4628 goto play_sound_and_continue; | |
4629 | |
4630 case SPELL_AIR_SPARKS: | |
0 | 4631 v184 = v12 - 1; |
4632 if ( v184 ) | |
4633 { | |
4634 v185 = v184 - 1; | |
4635 if ( v185 ) | |
4636 { | |
4637 v186 = v185 - 1; | |
4638 if ( v186 ) | |
4639 { | |
4640 if ( v186 == 1 ) | |
4641 amount = 9; | |
4642 } | |
4643 else | |
4644 { | |
4645 amount = 7; | |
4646 } | |
4647 } | |
4648 else | |
4649 { | |
4650 amount = 5; | |
4651 } | |
4652 } | |
4653 else | |
4654 { | |
4655 amount = 3; | |
4656 } | |
4657 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4658 goto play_sound_and_continue; |
0 | 4659 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); |
4660 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4661 a1.stru_24.Reset(); | |
4662 a1.field_48 = v3->spellnum; | |
4663 a1.field_4C = v2; | |
4664 a1.field_50 = v731; | |
4665 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4666 a1.vPosition.y = pParty->vPosition.y; | |
4667 a1.vPosition.x = pParty->vPosition.x; | |
486 | 4668 a1.uAttributes = 0; |
0 | 4669 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
4670 a1.uSectorID = pIndoor->GetSector( | |
4671 pParty->vPosition.x, | |
4672 pParty->vPosition.y, | |
4673 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 4674 a1.uSpriteFrameID = 0; |
0 | 4675 v187 = 8 * v3->uPlayerID; |
303 | 4676 LOBYTE(v187) = v187 | OBJECT_Player; |
4677 a1.field_58_pid = v187; | |
0 | 4678 a1.field_5C = a2; |
4679 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4680 a1.uSoundID = LOWORD(v3->field_10); | |
4681 if ( pParty->bTurnBasedModeOn == 1 ) | |
4682 LOBYTE(a1.uAttributes) |= 4u; | |
4683 v188 = (signed int)v726 / -2; | |
4684 v189 = (signed int)v726 / 2; | |
4685 while ( v188 <= v189 ) | |
4686 { | |
4687 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4688 if ( a1.Create( | |
4689 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4690 v715.uPitchAngle, | |
4691 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4692 v3->uPlayerID + 1) != -1 | |
4693 && pParty->bTurnBasedModeOn == 1 ) | |
4694 ++pTurnEngine->field_1C; | |
4695 v188 += v732; | |
4696 } | |
4697 goto LABEL_1056; | |
4698 case 16: | |
4699 if ( pParty->uFlags & 8 ) | |
4700 { | |
4701 v190 = pGlobalTXT_LocalizationStrings[493]; | |
4702 goto LABEL_462; | |
4703 } | |
4704 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4705 goto play_sound_and_continue; |
0 | 4706 v191 = 0; |
4707 do | |
486 | 4708 pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536); |
0 | 4709 while ( v191 < 4 ); |
4710 BYTE1(pParty->uFlags) |= 1u; | |
4711 pParty->uFallSpeed = 1000; | |
4712 goto LABEL_1056; | |
488 | 4713 |
4714 case SPELL_AIR_INVISIBILITY: | |
0 | 4715 v192 = v12 - 1; |
4716 if ( !v192 ) | |
4717 { | |
4718 amount = v2; | |
4719 goto LABEL_391; | |
4720 } | |
4721 v193 = v192 - 1; | |
4722 if ( !v193 ) | |
4723 { | |
4724 v196 = 2 * v2; | |
4725 LABEL_389: | |
4726 amount = v196; | |
4727 LABEL_391: | |
4728 v195 = 600 * v2; | |
4729 goto LABEL_392; | |
4730 } | |
4731 v194 = v193 - 1; | |
4732 if ( !v194 ) | |
4733 { | |
4734 v196 = 3 * v2; | |
4735 goto LABEL_389; | |
4736 } | |
4737 if ( v194 != 1 ) | |
4738 goto LABEL_393; | |
4739 amount = 4 * v2; | |
4740 v195 = 3600 * v2; | |
4741 LABEL_392: | |
4742 LODWORD(v733) = v195; | |
4743 LABEL_393: | |
4744 if ( pParty->uFlags & 0x30 ) | |
4745 { | |
4746 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4747 goto LABEL_201; | |
4748 } | |
4749 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4750 { | |
488 | 4751 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4752 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4753 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4754 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4755 v83 = 1; |
4756 v732 = (int)v733 << 7; | |
488 | 4757 |
4758 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); | |
0 | 4759 LODWORD(v727) = v83; |
4760 } | |
488 | 4761 goto play_sound_and_continue; |
0 | 4762 case 21: |
4763 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4764 { | |
4765 v190 = pGlobalTXT_LocalizationStrings[494]; | |
4766 LABEL_462: | |
4767 ShowStatusBarString(v190, 2u); | |
486 | 4768 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
488 | 4769 goto play_sound_and_continue; |
0 | 4770 } |
4771 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4772 { | |
4773 LABEL_461: | |
4774 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4775 goto LABEL_462; | |
4776 } | |
4777 LODWORD(v733) = 3600 * v2; | |
486 | 4778 if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) ) |
0 | 4779 amount = 1; |
4780 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4781 goto play_sound_and_continue; |
0 | 4782 v205 = 0; |
4783 do | |
486 | 4784 pOtherOverlayList->_4418B1(2090, v205++ + 100, 0, 65536); |
0 | 4785 while ( v205 < 4 ); |
486 | 4786 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); |
0 | 4787 v207 = v3->uPlayerID + 1; |
4788 v716 = v206; | |
488 | 4789 |
0 | 4790 v732 = (int)v733 << 7; |
488 | 4791 |
4792 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207); | |
0 | 4793 goto LABEL_1056; |
488 | 4794 |
0 | 4795 case 22: |
4796 v67 = 2; | |
4797 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4798 { | |
4799 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4800 goto LABEL_202; | |
4801 } | |
4802 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4803 goto play_sound_and_continue; |
0 | 4804 v208 = a2 & 7; |
4805 LODWORD(v725) = a2 & 7; | |
4806 if ( v208 == 3 ) | |
4807 { | |
4808 v209 = a2 >> 3; | |
4809 LODWORD(v718) = pActors[v209].vPosition.x; | |
4810 v210 = pActors[v209].vPosition.y; | |
4811 v211 = pActors[v209].vPosition.z; | |
4812 v713 = v210; | |
4813 } | |
4814 else | |
4815 { | |
323 | 4816 v212 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4817 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); |
323 | 4818 v213 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4819 v214 = sub_42EBBE(2048, v213); |
4820 v211 = pParty->vPosition.z; | |
4821 v713 = pParty->vPosition.y + v214; | |
4822 v208 = LODWORD(v725); | |
4823 } | |
4824 v726 = (Player *)v211; | |
486 | 4825 HIDWORD(v733) = 0; |
0 | 4826 *(float *)&v732 = (double)v211; |
4827 LODWORD(v725) = v211 + 2500; | |
486 | 4828 v721 = 0; |
0 | 4829 *(float *)&y = (double)(v211 + 2500); |
4830 v730 = v208 == 3 ? a2 : 0; | |
4831 a2 = 20; | |
4832 do | |
4833 { | |
4834 v215 = rand(); | |
4835 v216 = (double)v721; | |
4836 v727 = v216; | |
4837 v217 = (double)SHIDWORD(v733); | |
4838 *(float *)&uRequiredMana = v217; | |
4839 _this = (ItemGen *)(v215 % 1000); | |
4840 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4841 *(float *)&v721 = v217 * v217; | |
4842 *(float *)&v726 = v216 * v216; | |
4843 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4844 { | |
486 | 4845 LODWORD(v685) = 0; |
4846 HIDWORD(v685) = 0; | |
0 | 4847 } |
4848 else | |
4849 { | |
4850 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4851 v685 = __PAIR__( | |
4852 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4853 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4854 } | |
4855 a1.stru_24.Reset(); | |
4856 a1.field_48 = v3->spellnum; | |
4857 a1.field_4C = v2; | |
4858 a1.field_50 = v731; | |
4859 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 4860 a1.uAttributes = 0; |
0 | 4861 a1.vPosition.x = LODWORD(v718); |
4862 a1.vPosition.y = v713; | |
486 | 4863 a1.uSectorID = 0; |
0 | 4864 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); |
486 | 4865 a1.uSpriteFrameID = 0; |
303 | 4866 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4867 a1.field_5C = v730; |
4868 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4869 a1.uFacing = v685; | |
4870 a1.uSoundID = LOWORD(v3->field_10); | |
4871 if ( pParty->bTurnBasedModeOn == 1 ) | |
4872 a1.uAttributes = 4; | |
4873 if ( a1.Create( | |
4874 v685, | |
4875 SHIDWORD(v685), | |
4876 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4877 0) != -1 |
0 | 4878 && pParty->bTurnBasedModeOn == 1 ) |
4879 ++pTurnEngine->field_1C; | |
4880 v721 = rand() % 1024 - 512; | |
4881 v218 = rand(); | |
4882 v14 = a2-- == 1; | |
4883 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4884 } | |
4885 while ( !v14 ); | |
4886 goto LABEL_1056; | |
4887 case 23: | |
4888 v219 = v12 - 2; | |
4889 if ( v219 ) | |
4890 { | |
4891 v220 = v219 - 1; | |
4892 if ( v220 ) | |
4893 { | |
4894 if ( v220 == 1 ) | |
4895 { | |
486 | 4896 amount = 0; |
0 | 4897 goto LABEL_433; |
4898 } | |
4899 v221 = 180 * v2; | |
4900 } | |
4901 else | |
4902 { | |
4903 v221 = 86400 * v2; | |
4904 } | |
4905 } | |
4906 else | |
4907 { | |
4908 v221 = 3600 * v2; | |
4909 } | |
4910 amount = v221; | |
4911 LABEL_433: | |
4912 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4913 goto play_sound_and_continue; |
0 | 4914 v222 = (char *)pParty->pPlayers; |
4915 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
4916 break; | |
4917 case 24: | |
4918 v224 = v12 - 2; | |
4919 if ( v224 ) | |
4920 { | |
4921 v225 = v224 - 1; | |
4922 if ( v225 ) | |
4923 { | |
4924 if ( v225 == 1 ) | |
4925 amount = 7; | |
4926 else | |
4927 amount = 1; | |
4928 } | |
4929 else | |
4930 { | |
4931 amount = 5; | |
4932 } | |
4933 } | |
4934 else | |
4935 { | |
4936 amount = 3; | |
4937 } | |
4938 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4939 goto play_sound_and_continue; |
0 | 4940 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; |
4941 if ( amount == 1 ) | |
4942 { | |
4943 LABEL_152: | |
4944 a1.stru_24.Reset(); | |
4945 a1.field_48 = v3->spellnum; | |
4946 a1.field_50 = v731; | |
4947 a1.field_4C = v2; | |
4948 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4949 a1.vPosition.y = pParty->vPosition.y; | |
4950 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4951 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4952 v660 = pParty->vPosition.y; | |
4953 LABEL_153: | |
486 | 4954 a1.uAttributes = 0; |
0 | 4955 a1.vPosition.x = pParty->vPosition.x; |
4956 a1.vPosition.z = v51; | |
4957 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
486 | 4958 a1.uSpriteFrameID = 0; |
0 | 4959 a1.uSectorID = v52; |
4960 v53 = 8 * v3->uPlayerID; | |
303 | 4961 LOBYTE(v53) = v53 | OBJECT_Player; |
4962 a1.field_58_pid = v53; | |
0 | 4963 a1.field_5C = a2; |
4964 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4965 a1.uFacing = LOWORD(v715.uYawAngle); | |
4966 a1.uSoundID = LOWORD(v3->field_10); | |
4967 LABEL_154: | |
4968 if ( pParty->bTurnBasedModeOn == 1 ) | |
4969 LOBYTE(a1.uAttributes) |= 4u; | |
4970 LABEL_156: | |
4971 v669 = v3->uPlayerID + 1; | |
4972 v36 = v715.uYawAngle; | |
4973 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
4974 v654 = v715.uPitchAngle; | |
4975 LABEL_157: | |
4976 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
4977 ++pTurnEngine->field_1C; | |
4978 } | |
4979 else | |
4980 { | |
4981 v732 = SHIDWORD(v733) / (amount - 1); | |
4982 a1.stru_24.Reset(); | |
4983 a1.field_48 = v3->spellnum; | |
4984 a1.field_4C = v2; | |
4985 a1.field_50 = v731; | |
4986 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
4987 a1.vPosition.y = pParty->vPosition.y; | |
4988 a1.vPosition.x = pParty->vPosition.x; | |
486 | 4989 a1.uAttributes = 0; |
0 | 4990 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
4991 a1.uSectorID = pIndoor->GetSector( | |
4992 pParty->vPosition.x, | |
4993 pParty->vPosition.y, | |
4994 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 4995 a1.uSpriteFrameID = 0; |
0 | 4996 v226 = 8 * v3->uPlayerID; |
303 | 4997 LOBYTE(v226) = v226 | OBJECT_Player; |
4998 a1.field_58_pid = v226; | |
0 | 4999 a1.field_5C = a2; |
5000 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5001 a1.uSoundID = LOWORD(v3->field_10); | |
5002 if ( pParty->bTurnBasedModeOn == 1 ) | |
5003 LOBYTE(a1.uAttributes) |= 4u; | |
5004 v227 = SHIDWORD(v733) / -2; | |
5005 y = (char *)(SHIDWORD(v733) / 2); | |
5006 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5007 { | |
5008 v228 = v715.uYawAngle; | |
5009 do | |
5010 { | |
5011 a1.uFacing = v227 + v228; | |
5012 if ( a1.Create( | |
5013 v227 + v228, | |
5014 v715.uPitchAngle, | |
5015 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5016 v3->uPlayerID + 1) != -1 | |
5017 && pParty->bTurnBasedModeOn == 1 ) | |
5018 ++pTurnEngine->field_1C; | |
5019 v227 += v732; | |
5020 } | |
5021 while ( v227 <= (signed int)y ); | |
5022 } | |
5023 } | |
5024 goto LABEL_1056; | |
5025 case 27: | |
5026 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5027 goto LABEL_461; | |
5028 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5029 v229 = 600 * v2; | |
5030 else | |
5031 v229 = 3600 * v2; | |
5032 LODWORD(v733) = v229; | |
5033 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5034 goto play_sound_and_continue; |
486 | 5035 v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); |
488 | 5036 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
5037 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
5038 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
5039 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 5040 v239 = v3->uPlayerID + 1; |
5041 v732 = v229 << 7; | |
5042 pParty->pPartyBuffs[18].Apply( | |
5043 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5044 v731, | |
5045 amount, | |
5046 v716, | |
5047 v239); | |
5048 if ( v731 == 4 ) | |
5049 pParty->pPartyBuffs[18].uFlags = 1; | |
488 | 5050 LODWORD(v727) = 1; |
5051 goto play_sound_and_continue; | |
0 | 5052 case 28: |
5053 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5054 goto play_sound_and_continue; |
0 | 5055 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
5056 y = v240; | |
5057 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5058 goto LABEL_199; | |
5059 if ( v731 == 1 || v731 == 2 ) | |
5060 { | |
5061 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5062 } | |
5063 else | |
5064 { | |
5065 if ( v731 == 3 ) | |
5066 { | |
5067 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5068 } | |
5069 else | |
5070 { | |
5071 if ( v731 != 4 ) | |
5072 { | |
5073 v241 = 0.0; | |
5074 goto LABEL_484; | |
5075 } | |
5076 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5077 } | |
5078 } | |
5079 if ( v241 > 1.0 ) | |
5080 v241 = 1.0; | |
5081 LABEL_484: | |
5082 v732 = (unsigned __int8)v240[25]; | |
5083 v242 = (signed __int64)((double)v732 * v241); | |
5084 v243 = y; | |
5085 y[25] = v242; | |
5086 *((int *)v243 + 4) = (unsigned __int8)v242; | |
486 | 5087 if ( (unsigned __int8)v242 <= 0 ) |
5088 { | |
5089 *(int *)v243 = 0; | |
0 | 5090 dword_50C9D0 = 113; |
486 | 5091 dword_50C9D4 = 0; |
0 | 5092 dword_50C9D8 = 1; |
5093 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
486 | 5094 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5095 v3->spellnum = 0; | |
0 | 5096 goto LABEL_1165; |
5097 } | |
5098 *((int *)v243 + 5) |= 0x40u; | |
5099 goto LABEL_1055; | |
5100 case 30: | |
5101 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5102 goto play_sound_and_continue; |
486 | 5103 uRequiredMana = 0; |
0 | 5104 HIDWORD(v733) = 10 * v2; |
5105 v730 = 1; | |
5106 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5107 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5108 if ( v731 == 1 ) | |
5109 { | |
5110 v245 = (int)&v244[36 * a2 + 532]; | |
5111 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5112 v311 = __OFSUB__(*(int *)v245, 134); | |
5113 v14 = *(int *)v245 == 134; | |
5114 v310 = *(int *)v245 - 134 < 0; | |
5115 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5116 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5117 { | |
486 | 5118 if ( *(int *)&v244[36 * a2 + 544] == 0 ) |
0 | 5119 { |
486 | 5120 if ( *(int *)&v244[36 * a2 + 536] == 0 ) |
0 | 5121 { |
486 | 5122 if ( *(int *)&v244[36 * a2 + 540] == 0 ) |
0 | 5123 { |
5124 v312 = v309[28]; | |
5125 if ( v312 ) | |
5126 { | |
5127 if ( v312 != 1 ) | |
5128 { | |
5129 if ( v312 != 2 ) | |
5130 { | |
5131 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5132 if ( !(v244[36 * a2 + 552] & 2) ) | |
5133 { | |
5134 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5135 { | |
5136 uRequiredMana = 1; | |
486 | 5137 v730 = 0; |
0 | 5138 } |
5139 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5140 uRequiredMana = 1; | |
486 | 5141 if (!uRequiredMana) |
0 | 5142 { |
5143 v313 = *(char *)(LODWORD(v725) + 28); | |
5144 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5145 { | |
224 | 5146 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5147 *(int *)(v245 + 4) = 0; |
222 | 5148 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5149 + 1]; |
5150 ; | |
222 | 5151 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5152 + 1] ) |
5153 { | |
5154 ++*(int *)(v245 + 4); | |
5155 if ( j >= v314 ) | |
5156 break; | |
5157 } | |
5158 v254 = rand(); | |
224 | 5159 v255 = 10;//pItemsTable->field_116D8[17]; |
5160 v256 = 10;//pItemsTable->field_116D8[16]; | |
0 | 5161 LABEL_611: |
5162 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5163 LABEL_612: | |
5164 _this->uItemID |= 0x20u; | |
5165 goto LABEL_1055; | |
5166 } | |
5167 goto LABEL_615; | |
5168 } | |
5169 LABEL_613: | |
5170 v316 = _this->uItemID; | |
5171 if ( !(BYTE1(v316) & 2) ) | |
5172 { | |
5173 LOBYTE(v316) = v316 | 2; | |
5174 _this->uItemID = v316; | |
5175 } | |
5176 } | |
5177 } | |
5178 } | |
5179 } | |
5180 } | |
5181 } | |
5182 } | |
5183 } | |
5184 LABEL_616: | |
486 | 5185 if ( LODWORD(v727) == 0 ) |
0 | 5186 { |
5187 v317 = pGlobalTXT_LocalizationStrings[428]; | |
486 | 5188 if ( v730 == 0 ) |
0 | 5189 v317 = pGlobalTXT_LocalizationStrings[585]; |
5190 ShowStatusBarString(v317, 2u); | |
486 | 5191 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 5192 v318 = v726; |
486 | 5193 v3->spellnum = 0; |
5194 v318->PlaySound(SPEECH_43, 0); | |
0 | 5195 } |
488 | 5196 goto play_sound_and_continue; |
0 | 5197 } |
5198 if ( v731 != 2 ) | |
5199 { | |
5200 if ( v731 == 3 ) | |
5201 { | |
5202 v245 = (int)&v244[36 * a2 + 532]; | |
5203 v269 = *(int *)v245; | |
5204 if ( *(int *)v245 > 134 | |
486 | 5205 || *(int *)(v245 + 12) != 0 |
5206 || *(int *)(v245 + 4) != 0 | |
5207 || *(int *)(v245 + 8) != 0 | |
0 | 5208 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) |
5209 goto LABEL_616; | |
5210 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5211 LODWORD(v725) = (int)v270; | |
5212 v271 = v270[28]; | |
5213 if ( v271 && v271 != 1 && v271 != 2 ) | |
5214 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5215 else | |
5216 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5217 if ( v272 ) | |
5218 { | |
5219 uRequiredMana = 1; | |
486 | 5220 v730 = 0; |
0 | 5221 } |
5222 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5223 uRequiredMana = 1; | |
486 | 5224 if (uRequiredMana) |
0 | 5225 goto LABEL_613; |
5226 v273 = v725; | |
5227 v274 = *(char *)(LODWORD(v725) + 28); | |
5228 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 ) | |
5229 { | |
5230 if ( rand() % 100 < 80 | |
5231 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5232 { | |
224 | 5233 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5234 *(int *)(v245 + 4) = 0; |
222 | 5235 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5236 ; |
222 | 5237 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5238 + 1] ) |
5239 { | |
5240 ++*(int *)(v245 + 4); | |
5241 if ( k >= v275 ) | |
5242 break; | |
5243 } | |
5244 v254 = rand(); | |
224 | 5245 v255 = 10;//pItemsTable->field_116D8[19]; |
5246 v256 = 10;//pItemsTable->field_116D8[18]; | |
0 | 5247 goto LABEL_611; |
5248 } | |
222 | 5249 v277 = pItemsTable->pSpecialEnchantments_count; |
0 | 5250 v278 = 0; |
5251 v725 = 0.0; | |
5252 HIDWORD(v733) = 0; | |
222 | 5253 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5254 { |
5255 v730 = (int)&v679; | |
5256 do | |
5257 { | |
222 | 5258 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement); |
0 | 5259 if ( !v279 || v279 == 1 ) |
5260 { | |
222 | 5261 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5262 + 4] |
5263 + v278 * 28); | |
5264 LODWORD(v725) += v280; | |
5265 if ( v280 ) | |
5266 { | |
5267 v281 = v730; | |
5268 v730 += 4; | |
5269 *(int *)v281 = HIDWORD(v733); | |
5270 } | |
5271 } | |
5272 ++HIDWORD(v733); | |
5273 ++v278; | |
5274 } | |
5275 while ( SHIDWORD(v733) < v277 ); | |
5276 } | |
5277 v282 = rand() % SLODWORD(v725); | |
5278 v283 = v679; | |
5279 *(int *)(v245 + 12) = v679; | |
222 | 5280 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5281 v285 = v282 + 1; |
5282 if ( v284 < v285 ) | |
5283 { | |
5284 for ( l = &v679; ; l = (int *)v732 ) | |
5285 { | |
5286 v287 = (int)(l + 1); | |
5287 v732 = v287; | |
5288 v288 = *(int *)v287; | |
5289 *(int *)(v245 + 12) = v288; | |
222 | 5290 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5291 + 4]; |
5292 if ( v284 >= v285 ) | |
5293 break; | |
5294 } | |
5295 } | |
5296 goto LABEL_525; | |
5297 } | |
5298 } | |
5299 else | |
5300 { | |
5301 if ( v731 != 4 | |
5302 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
486 | 5303 || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 |
5304 || v726->pInventoryItems[a2].uEncantmentType != 0 | |
5305 || v726->pInventoryItems[a2]._bonus_strength != 0 | |
315 | 5306 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) |
0 | 5307 goto LABEL_616; |
5308 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5309 LODWORD(v725) = (int)v247; | |
5310 v248 = v247[28]; | |
5311 if ( v248 && v248 != 1 && v248 != 2 ) | |
5312 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5313 else | |
5314 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5315 if ( v249 ) | |
5316 { | |
5317 uRequiredMana = 1; | |
486 | 5318 v730 = 0; |
0 | 5319 } |
5320 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5321 uRequiredMana = 1; | |
486 | 5322 if (uRequiredMana) |
0 | 5323 goto LABEL_613; |
5324 v250 = v725; | |
5325 v251 = *(char *)(LODWORD(v725) + 28); | |
5326 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 ) | |
5327 { | |
5328 if ( rand() % 100 < 80 | |
5329 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5330 { | |
224 | 5331 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5332 *(int *)(v245 + 4) = 0; |
222 | 5333 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5334 ; |
222 | 5335 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5336 + 1] ) |
5337 { | |
5338 ++*(int *)(v245 + 4); | |
5339 if ( m >= v252 ) | |
5340 break; | |
5341 } | |
5342 v254 = rand(); | |
224 | 5343 v255 = 10;// pItemsTable->field_116D8[21]; |
5344 v256 = 10;//pItemsTable->field_116D8[20]; | |
0 | 5345 goto LABEL_611; |
5346 } | |
222 | 5347 v257 = pItemsTable->pSpecialEnchantments_count; |
0 | 5348 v258 = 0; |
5349 v725 = 0.0; | |
5350 HIDWORD(v733) = 0; | |
222 | 5351 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5352 { |
5353 v730 = (int)&v679; | |
5354 do | |
5355 { | |
222 | 5356 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
0 | 5357 if ( !v259 || v259 == 1 ) |
5358 { | |
222 | 5359 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5360 + 4] |
5361 + v258 * 28); | |
5362 LODWORD(v725) += v260; | |
5363 if ( v260 ) | |
5364 { | |
5365 v261 = v730; | |
5366 v730 += 4; | |
5367 *(int *)v261 = HIDWORD(v733); | |
5368 } | |
5369 } | |
5370 ++HIDWORD(v733); | |
5371 ++v258; | |
5372 } | |
5373 while ( SHIDWORD(v733) < v257 ); | |
5374 } | |
5375 v262 = rand() % SLODWORD(v725); | |
5376 v263 = v679; | |
5377 *(int *)(v245 + 12) = v679; | |
222 | 5378 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5379 v265 = v262 + 1; |
5380 if ( v264 < v265 ) | |
5381 { | |
5382 for ( ii = &v679; ; ii = (int *)v732 ) | |
5383 { | |
5384 v267 = (int)(ii + 1); | |
5385 v732 = v267; | |
5386 v268 = *(int *)v267; | |
5387 *(int *)(v245 + 12) = v268; | |
222 | 5388 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5389 + 4]; |
5390 if ( v264 >= v265 ) | |
5391 break; | |
5392 } | |
5393 } | |
5394 LABEL_525: | |
5395 ++*(int *)(v245 + 12); | |
5396 goto LABEL_612; | |
5397 } | |
5398 } | |
5399 LABEL_615: | |
486 | 5400 //v1 = 0; |
0 | 5401 goto LABEL_616; |
5402 } | |
5403 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5404 _this = v289; | |
5405 v290 = v289->uItemID; | |
5406 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5407 if ( v290 > 134 | |
486 | 5408 || _this->uSpecEnchantmentType != 0 |
5409 || _this->uEncantmentType != 0 | |
5410 || _this->_bonus_strength != 0 | |
0 | 5411 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 |
5412 || v291 == 1 | |
5413 || v291 == 2 | |
315 | 5414 || _this->Broken()) |
0 | 5415 goto LABEL_616; |
5416 if ( _this->GetValue() < 0x1C2 ) | |
5417 uRequiredMana = 1; | |
5418 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5419 uRequiredMana = 1; | |
486 | 5420 if ( uRequiredMana != 0 ) |
0 | 5421 goto LABEL_199; |
5422 v292 = *(char *)(LODWORD(v725) + 28); | |
5423 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5424 { | |
5425 v2 = v723; | |
486 | 5426 //v1 = 0; |
0 | 5427 goto LABEL_199; |
5428 } | |
5429 if ( rand() % 100 >= 80 ) | |
5430 { | |
222 | 5431 v297 = pItemsTable->pSpecialEnchantments_count; |
0 | 5432 v294 = _this; |
5433 v298 = 0; | |
5434 v725 = 0.0; | |
5435 HIDWORD(v733) = 0; | |
222 | 5436 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5437 { |
5438 v730 = (int)&v679; | |
5439 do | |
5440 { | |
222 | 5441 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement); |
0 | 5442 if ( !v299 || v299 == 1 ) |
5443 { | |
222 | 5444 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4] |
0 | 5445 + v298 * 28); |
5446 LODWORD(v725) += v300; | |
5447 if ( v300 ) | |
5448 { | |
5449 v301 = v730; | |
5450 v730 += 4; | |
5451 *(int *)v301 = HIDWORD(v733); | |
5452 } | |
5453 } | |
5454 ++HIDWORD(v733); | |
5455 ++v298; | |
5456 } | |
5457 while ( SHIDWORD(v733) < v297 ); | |
5458 } | |
5459 v302 = rand() % SLODWORD(v725); | |
5460 v303 = v679; | |
377 | 5461 v294->uSpecEnchantmentType = v679; |
222 | 5462 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5463 v305 = v302 + 1; |
5464 if ( v304 < v305 ) | |
5465 { | |
5466 for ( jj = &v679; ; jj = (int *)v732 ) | |
5467 { | |
5468 v307 = (int)(jj + 1); | |
5469 v732 = v307; | |
5470 v308 = *(int *)v307; | |
377 | 5471 v294->uSpecEnchantmentType = v308; |
222 | 5472 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5473 if ( v304 >= v305 ) |
5474 break; | |
5475 } | |
5476 } | |
377 | 5477 ++v294->uSpecEnchantmentType; |
0 | 5478 } |
5479 else | |
5480 { | |
5481 v293 = rand(); | |
5482 v294 = _this; | |
224 | 5483 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
377 | 5484 _this->uEncantmentType = 0; |
222 | 5485 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; |
0 | 5486 ; |
377 | 5487 kk += pItemsTable->pEnchantments[v294->uEncantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType |
0 | 5488 + 1] ) |
5489 { | |
377 | 5490 ++v294->uEncantmentType; |
0 | 5491 if ( kk >= v295 ) |
5492 break; | |
5493 } | |
224 | 5494 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5495 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
0 | 5496 } |
5497 v294->uAttributes |= 0x20u; | |
5498 goto LABEL_1055; | |
5499 case 31: | |
5500 amount = 10 * v2; | |
5501 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
488 | 5502 goto play_sound_and_continue; |
0 | 5503 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) |
5504 goto LABEL_200; | |
5505 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
486 | 5506 pMessageQueue_50CBD0->AddMessage(UIMSG_C3, 0, 0); |
0 | 5507 goto LABEL_1056; |
5508 case 33: | |
5509 LODWORD(v733) = 604800 * v2; | |
5510 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5511 goto LABEL_200; | |
5512 v319 = uRequiredMana; | |
5513 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5514 { | |
5515 pEventTimer->Pause(); | |
486 | 5516 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, 0, 0); |
0 | 5517 qword_506350 = (signed int)v733; |
5518 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5519 ::uRequiredMana = v319; | |
5520 ::sRecoveryTime = sRecoveryTime; | |
5521 dword_50633C = v3->field_10; | |
5522 dword_506338 = v3->spellnum; | |
5523 LOBYTE(v3->field_8) |= 0x20u; | |
5524 } | |
488 | 5525 goto play_sound_and_continue; |
0 | 5526 case 40: |
5527 v320 = v12 - 2; | |
5528 if ( !v320 ) | |
5529 goto LABEL_632; | |
5530 v321 = v320 - 1; | |
5531 if ( v321 ) | |
5532 { | |
5533 if ( v321 == 1 ) | |
5534 goto LABEL_634; | |
5535 LABEL_632: | |
5536 v322 = 3600 * v2; | |
5537 } | |
5538 else | |
5539 { | |
5540 v322 = 86400 * v2; | |
5541 } | |
5542 amount = v322; | |
5543 LABEL_634: | |
5544 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5545 goto play_sound_and_continue; |
0 | 5546 v323 = v3->uPlayerID_2; |
5547 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5548 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5549 goto LABEL_1056; | |
5550 if ( v731 == 4 ) | |
5551 goto LABEL_637; | |
5552 v732 = amount << 7; | |
5553 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5554 v656 = 15; | |
5555 goto LABEL_640; | |
5556 case 41: | |
5557 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5558 goto play_sound_and_continue; |
0 | 5559 a1.stru_24.Reset(); |
5560 a1.field_48 = v3->spellnum; | |
5561 a1.field_4C = v2; | |
5562 a1.field_50 = v731; | |
5563 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5564 a1.vPosition.y = pParty->vPosition.y; | |
5565 a1.vPosition.x = pParty->vPosition.x; | |
486 | 5566 a1.uAttributes = 0; |
0 | 5567 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5568 a1.uSectorID = pIndoor->GetSector( | |
5569 pParty->vPosition.x, | |
5570 pParty->vPosition.y, | |
5571 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 5572 a1.uSpriteFrameID = 0; |
0 | 5573 v326 = 8 * v3->uPlayerID; |
303 | 5574 LOBYTE(v326) = v326 | OBJECT_Player; |
5575 a1.field_58_pid = v326; | |
0 | 5576 a1.field_5C = a2; |
5577 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5578 a1.uFacing = LOWORD(pParty->sRotationY); | |
5579 a1.uSoundID = LOWORD(v3->field_10); | |
5580 if ( pParty->bTurnBasedModeOn == 1 ) | |
5581 LOBYTE(a1.uAttributes) |= 4u; | |
5582 v669 = v3->uPlayerID + 1; | |
5583 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5584 v654 = pParty->sRotationX; | |
5585 goto LABEL_125; | |
5586 case 43: | |
5587 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5588 goto LABEL_200; | |
5589 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5590 goto play_sound_and_continue; |
0 | 5591 a1.uItemType = 4090; |
5592 a1.stru_24.Reset(); | |
5593 a1.field_48 = v3->spellnum; | |
5594 a1.field_4C = v2; | |
5595 a1.field_50 = v731; | |
5596 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
5597 a1.vPosition.x = pParty->vPosition.x; | |
5598 a1.vPosition.y = pParty->vPosition.y; | |
486 | 5599 a1.uAttributes = 0; |
5600 a1.uSectorID = 0; | |
5601 a1.uSpriteFrameID = 0; | |
0 | 5602 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5603 v327 = 8 * v3->uPlayerID; | |
303 | 5604 LOBYTE(v327) = v327 | OBJECT_Player; |
0 | 5605 a1.field_60_distance_related_prolly_lod = 0; |
303 | 5606 a1.field_58_pid = v327; |
0 | 5607 a1.field_5C = a2; |
5608 a1.uFacing = LOWORD(pParty->sRotationY); | |
5609 a1.uSoundID = LOWORD(v3->field_10); | |
5610 if ( pParty->bTurnBasedModeOn == 1 ) | |
5611 a1.uAttributes = 4; | |
486 | 5612 v669 = 0; |
0 | 5613 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5614 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5615 LABEL_124: | |
5616 v654 = v35; | |
5617 LABEL_125: | |
5618 v36 = pParty->sRotationY; | |
5619 goto LABEL_157; | |
488 | 5620 |
5621 case SPELL_SPIRIT_DETECT_LIFE: | |
0 | 5622 v328 = v12 - 2; |
5623 if ( v328 ) | |
5624 { | |
5625 v329 = v328 - 1; | |
5626 if ( v329 && v329 != 1 ) | |
5627 v330 = 600 * v2; | |
5628 else | |
5629 v330 = 3600 * v2; | |
5630 } | |
5631 else | |
5632 { | |
5633 v330 = 1800 * v2; | |
5634 } | |
5635 LODWORD(v733) = v330; | |
5636 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5637 goto play_sound_and_continue; |
5638 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
5639 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
5640 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
5641 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 5642 v83 = 1; |
488 | 5643 |
0 | 5644 v732 = (int)v733 << 7; |
488 | 5645 |
5646 pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | |
5647 LODWORD(v727) = v83; | |
5648 | |
5649 goto play_sound_and_continue; | |
5650 | |
5651 case SPELL_SPIRIT_FATE: | |
0 | 5652 LODWORD(v733) = 300; |
5653 v339 = v12 - 2; | |
5654 if ( v339 ) | |
5655 { | |
5656 v340 = v339 - 1; | |
5657 if ( v340 ) | |
5658 { | |
5659 if ( v340 != 1 ) | |
5660 { | |
5661 amount = v2; | |
5662 goto LABEL_667; | |
5663 } | |
5664 v341 = 6 * v2; | |
5665 } | |
5666 else | |
5667 { | |
5668 v341 = 4 * v2; | |
5669 } | |
5670 } | |
5671 else | |
5672 { | |
5673 v341 = 2 * v2; | |
5674 } | |
5675 amount = v341; | |
5676 LABEL_667: | |
5677 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5678 goto play_sound_and_continue; |
5679 v342 = v3->spell_target_pid; | |
486 | 5680 if ( v342 == 0 ) |
0 | 5681 { |
488 | 5682 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5683 | |
5684 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0); | |
5685 goto LABEL_1056; | |
0 | 5686 } |
141 | 5687 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5688 { |
5689 v343 = v342 >> 3; | |
486 | 5690 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32); |
0 | 5691 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; |
486 | 5692 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0); |
0 | 5693 BYTE2(pActors[v343].uAttributes) |= 8u; |
486 | 5694 v672 = 0; |
0 | 5695 v661 = &pActors[v343]; |
5696 LABEL_165: | |
5697 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5698 } | |
5699 goto LABEL_1056; | |
488 | 5700 |
0 | 5701 case 49: |
5702 v348 = v12 - 2; | |
5703 if ( !v348 ) | |
5704 goto LABEL_677; | |
5705 v349 = v348 - 1; | |
5706 if ( v349 ) | |
5707 { | |
5708 if ( v349 == 1 ) | |
5709 { | |
486 | 5710 amount = 0; |
0 | 5711 goto LABEL_679; |
5712 } | |
5713 LABEL_677: | |
5714 v350 = 3600 * v2; | |
5715 } | |
5716 else | |
5717 { | |
5718 v350 = 86400 * v2; | |
5719 } | |
5720 amount = v350; | |
5721 LABEL_679: | |
5722 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5723 goto play_sound_and_continue; |
0 | 5724 v351 = &pParty->pPlayers[v3->uPlayerID_2]; |
5725 if ( !v351->pConditions[0] ) | |
5726 goto LABEL_1056; | |
5727 if ( v731 == 4 ) | |
5728 { | |
486 | 5729 LODWORD(v351->pConditions[0]) = 0; |
5730 HIDWORD(v351->pConditions[0]) = 0; | |
0 | 5731 goto LABEL_904; |
5732 } | |
5733 v732 = amount << 7; | |
5734 v351->DiscardConditionIfLastsLongerThan( | |
486 | 5735 0, |
0 | 5736 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); |
5737 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5738 goto LABEL_1056; | |
5739 v674 = v3->uPlayerID_2; | |
5740 goto LABEL_685; | |
488 | 5741 case SPELL_SPIRIT_PRESERVATION: |
0 | 5742 v354 = v12 - 2; |
5743 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5744 v356 = 900 * (v2 + 4); | |
5745 else | |
5746 v356 = 300 * (v2 + 12); | |
5747 LODWORD(v733) = v356; | |
5748 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5749 goto play_sound_and_continue; |
0 | 5750 if ( v731 == 1 || v731 == 2 ) |
5751 { | |
488 | 5752 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5753 | |
0 | 5754 v732 = (int)v733 << 7; |
488 | 5755 |
5756 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | |
5757 goto LABEL_1056; | |
0 | 5758 } |
486 | 5759 a2 = 0; |
0 | 5760 v732 = (int)v733 << 7; |
5761 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5762 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5763 do |
5764 { | |
488 | 5765 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
5766 v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); | |
0 | 5767 ++a2; |
112 | 5768 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5769 } | |
5770 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5771 goto LABEL_1056; |
5772 case 48: | |
5773 v364 = v12 - 2; | |
5774 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5775 v366 = 60 * (v2 + 3); | |
5776 else | |
5777 v366 = 300 * v2 + 180; | |
5778 LODWORD(v733) = v366; | |
5779 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5780 goto play_sound_and_continue; |
0 | 5781 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
5782 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | |
5783 ++a1.uItemType; | |
5784 a1.stru_24.Reset(); | |
5785 a1.field_48 = v3->spellnum; | |
5786 a1.field_4C = v2; | |
5787 a1.field_50 = v731; | |
5788 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 5789 a1.uAttributes = 0; |
5790 a1.uSectorID = 0; | |
5791 a1.uSpriteFrameID = 0; | |
0 | 5792 v368 = v3->uPlayerID; |
5793 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 5794 a1.uFacing = 0; |
0 | 5795 v368 *= 8; |
303 | 5796 LOBYTE(v368) = v368 | OBJECT_Player; |
5797 a1.field_58_pid = v368; | |
0 | 5798 a1.uSoundID = LOWORD(v3->field_10); |
486 | 5799 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 5800 { |
5801 v369 = &pActors[dword_50BF30[a2]]; | |
5802 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5803 { | |
5804 a1.vPosition.x = v369->vPosition.x; | |
5805 a1.vPosition.y = v369->vPosition.y; | |
5806 v732 = v369->uActorHeight; | |
5807 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5808 v370 = 8 * dword_50BF30[a2]; | |
486 | 5809 LOBYTE(v370) = v370 | OBJECT_Actor; |
0 | 5810 a1.field_5C = v370; |
486 | 5811 a1.Create(0, 0, 0, 0); |
0 | 5812 v732 = (int)v733 << 7; |
5813 v369->pActorBuffs[4].Apply( | |
5814 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
486 | 5815 v731, 0, 0, 0); |
0 | 5816 } |
5817 } | |
5818 goto LABEL_1056; | |
5819 case 53: | |
5820 v371 = v12 - 2; | |
5821 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
486 | 5822 amount = 0; |
0 | 5823 else |
5824 amount = 86400 * v2; | |
5825 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5826 goto play_sound_and_continue; |
486 | 5827 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, 0, 65536); |
0 | 5828 v373 = v3->uPlayerID_2; |
5829 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5830 goto LABEL_1056; | |
5831 v14 = v731 == 4; | |
5832 pParty->pPlayers[v373].sHealth = 1; | |
5833 if ( v14 ) | |
5834 { | |
5835 v374 = v3->uPlayerID_2; | |
486 | 5836 LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0; |
5837 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0; | |
0 | 5838 v376 = v3->uPlayerID_2; |
486 | 5839 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0; |
5840 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0; | |
0 | 5841 } |
5842 else | |
5843 { | |
5844 v732 = amount << 7; | |
5845 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5846 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5847 0xEu, | |
5848 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5849 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5850 0xDu, | |
5851 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5852 } | |
112 | 5853 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 5854 goto LABEL_720; |
5855 case 54: | |
5856 v378 = v12 - 2; | |
5857 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
5858 v380 = 4 * v2; | |
5859 else | |
5860 v380 = 3 * v2; | |
5861 amount = v380; | |
5862 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5863 goto play_sound_and_continue; |
0 | 5864 v381 = 0; |
5865 HIDWORD(v733) = amount; | |
5866 v730 = 0; | |
5867 v382 = 1; | |
5868 do | |
5869 { | |
5870 v383 = pPlayers[v382]; | |
5871 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
5872 v682[v381++] = v382; | |
5873 ++v382; | |
5874 } | |
5875 while ( v382 <= 4 ); | |
5876 v384 = 0; | |
5877 v730 = v381; | |
486 | 5878 if ( v381 > 0 ) |
0 | 5879 { |
5880 do | |
5881 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
5882 while ( v384 < v381 ); | |
5883 } | |
5884 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
486 | 5885 HIDWORD(v733) = 0; |
5886 if ( v381 > 0 ) | |
0 | 5887 { |
5888 do | |
5889 { | |
5890 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
5891 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
5892 v726 = *(Player **)v385; | |
5893 v386 = v726->GetMaxHealth(); | |
5894 if ( v726->sHealth > v386 ) | |
5895 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
5896 v387 = *(Player **)v385; | |
486 | 5897 if ( v387->sHealth > 0 ) |
0 | 5898 { |
486 | 5899 LODWORD(v387->pConditions[13]) = 0; |
5900 HIDWORD(v387->pConditions[13]) = 0; | |
0 | 5901 } |
5902 v388 = HIDWORD(v733); | |
488 | 5903 |
5904 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, LOWORD(v682[HIDWORD(v733)]) - 1); | |
0 | 5905 HIDWORD(v733) = v388 + 1; |
5906 } | |
5907 while ( v388 + 1 < v730 ); | |
5908 } | |
5909 goto LABEL_1056; | |
488 | 5910 |
0 | 5911 case 55: |
5912 v392 = v12 - 1; | |
5913 if ( !v392 ) | |
5914 { | |
5915 v395 = 180 * v2; | |
5916 goto LABEL_750; | |
5917 } | |
5918 v393 = v392 - 1; | |
5919 if ( !v393 ) | |
5920 { | |
5921 v395 = 10800 * v2; | |
5922 goto LABEL_750; | |
5923 } | |
5924 v394 = v393 - 1; | |
5925 if ( !v394 ) | |
5926 { | |
5927 v395 = 259200 * v2; | |
5928 LABEL_750: | |
5929 amount = v395; | |
5930 goto LABEL_751; | |
5931 } | |
5932 if ( v394 == 1 ) | |
486 | 5933 amount = 0; |
0 | 5934 LABEL_751: |
5935 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5936 goto play_sound_and_continue; |
0 | 5937 v396 = v3->uPlayerID_2; |
5938 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
5939 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
5940 { | |
5941 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
486 | 5942 pParty->pPlayers[v396].PlaySound(SPEECH_25, 0); |
0 | 5943 if ( v731 == 4 ) |
5944 { | |
5945 v397 = v3->uPlayerID_2; | |
486 | 5946 LODWORD(pParty->pPlayers[v397].pConditions[16]) = 0; |
5947 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = 0; | |
0 | 5948 v398 = v3->uPlayerID_2; |
486 | 5949 LODWORD(pParty->pPlayers[v398].pConditions[14]) = 0; |
5950 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = 0; | |
0 | 5951 v399 = v3->uPlayerID_2; |
486 | 5952 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0; |
5953 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0; | |
0 | 5954 } |
5955 else | |
5956 { | |
5957 v732 = amount << 7; | |
5958 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5959 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5960 0x10u, | |
5961 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5962 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5963 0xEu, | |
5964 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5965 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5966 0xDu, | |
5967 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5968 } | |
5969 v83 = 1; | |
112 | 5970 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
488 | 5971 |
0 | 5972 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; |
488 | 5973 |
5974 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 5975 } |
5976 else | |
5977 { | |
5978 v83 = 1; | |
5979 } | |
488 | 5980 LODWORD(v727) = v83; |
5981 goto play_sound_and_continue; | |
5982 | |
0 | 5983 case 61: |
5984 v405 = v12 - 2; | |
5985 if ( !v405 ) | |
5986 goto LABEL_766; | |
5987 v406 = v405 - 1; | |
5988 if ( v406 ) | |
5989 { | |
5990 if ( v406 == 1 ) | |
5991 { | |
486 | 5992 amount = 0; |
0 | 5993 goto LABEL_768; |
5994 } | |
5995 LABEL_766: | |
5996 v407 = 3600 * v2; | |
5997 } | |
5998 else | |
5999 { | |
6000 v407 = 86400 * v2; | |
6001 } | |
6002 amount = v407; | |
6003 LABEL_768: | |
6004 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6005 goto play_sound_and_continue; |
6006 | |
6007 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6008 v323 = v3->uPlayerID_2; |
6009 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6010 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6011 goto LABEL_1056; | |
6012 if ( v731 == 4 ) | |
6013 goto LABEL_637; | |
6014 v732 = amount << 7; | |
6015 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6016 v656 = 12; | |
6017 goto LABEL_640; | |
6018 case 56: | |
6019 v411 = v12 - 2; | |
6020 if ( v411 ) | |
6021 { | |
6022 v412 = v411 - 1; | |
6023 if ( v412 ) | |
6024 { | |
6025 if ( v412 == 1 ) | |
6026 { | |
486 | 6027 amount = 0; |
0 | 6028 goto LABEL_780; |
6029 } | |
6030 v413 = 180 * v2; | |
6031 } | |
6032 else | |
6033 { | |
6034 v413 = 86400 * v2; | |
6035 } | |
6036 } | |
6037 else | |
6038 { | |
6039 v413 = 3600 * v2; | |
6040 } | |
6041 amount = v413; | |
6042 LABEL_780: | |
6043 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6044 goto play_sound_and_continue; |
6045 | |
6046 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6047 v323 = v3->uPlayerID_2; |
6048 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6049 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6050 goto LABEL_1056; | |
6051 if ( v731 == 4 ) | |
6052 goto LABEL_637; | |
6053 v732 = amount << 7; | |
6054 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6055 v656 = 3; | |
6056 goto LABEL_640; | |
6057 case 59: | |
6058 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6059 goto play_sound_and_continue; |
486 | 6060 if ( a2 == 0 || (a2 & 7) != OBJECT_Actor) |
0 | 6061 goto LABEL_1056; |
6062 v417 = (int)&pActors[a2 >> 3]; | |
6063 v730 = v417; | |
6064 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6065 { | |
6066 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6067 v417 = v730; | |
6068 } | |
6069 v418 = *(int *)(v417 + 672); | |
486 | 6070 HIDWORD(v733) = 0; |
0 | 6071 if ( pItemsTable->pItems[v418].uEquipType == 18 ) |
6072 HIDWORD(v733) = *(int *)(v417 + 684); | |
6073 | |
6074 //ItemGen::ItemGen(&v683); | |
6075 v683.Reset(); | |
6076 | |
6077 v419 = *(short *)(v730 + 180); | |
486 | 6078 if (v419) |
0 | 6079 { |
6080 v683.uItemID = v419; | |
6081 goto LABEL_799; | |
6082 } | |
6083 v420 = 0; | |
6084 v421 = v730 + 564; | |
486 | 6085 while ( !*(int *)v421 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) |
0 | 6086 { |
6087 ++v420; | |
6088 v421 += 36; | |
6089 if ( v420 >= 4 ) | |
6090 goto LABEL_799; | |
6091 } | |
6092 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6093 v2 = v723; | |
486 | 6094 //v1 = 0; |
0 | 6095 LABEL_799: |
486 | 6096 if ( HIDWORD(v733) != 0 ) |
0 | 6097 { |
6098 v675 = (const char *)HIDWORD(v733); | |
486 | 6099 if (v683.uItemID) |
0 | 6100 { |
6101 v422 = v683.GetDisplayName(); | |
6102 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6103 goto LABEL_807; | |
6104 } | |
6105 v664 = "%d gold"; | |
6106 goto LABEL_803; | |
6107 } | |
486 | 6108 if (v683.uItemID) |
0 | 6109 { |
6110 v675 = v683.GetDisplayName(); | |
6111 v664 = "(%s)"; | |
6112 LABEL_803: | |
6113 sprintf(pTmpBuf2, v664, v675); | |
6114 goto LABEL_807; | |
6115 } | |
6116 strcpy(pTmpBuf2, "nothing"); | |
6117 LABEL_807: | |
6118 ShowStatusBarString(pTmpBuf2, 2u); | |
6119 a1.stru_24.Reset(); | |
6120 a1.field_48 = v3->spellnum; | |
6121 a1.field_4C = v2; | |
6122 a1.field_50 = v731; | |
6123 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
6124 a1.vPosition.x = *(short *)(v730 + 142); | |
6125 a1.vPosition.y = *(short *)(v730 + 144); | |
6126 v676 = *(short *)(v730 + 138); | |
6127 v665 = a1.vPosition.y; | |
6128 a1.vPosition.z = *(short *)(v730 + 138); | |
6129 v657 = a1.vPosition.x; | |
6130 goto LABEL_1087; | |
6131 case 62: | |
6132 v423 = v12 - 2; | |
6133 if ( !v423 ) | |
6134 goto LABEL_813; | |
6135 v424 = v423 - 1; | |
6136 if ( v424 ) | |
6137 { | |
6138 if ( v424 == 1 ) | |
6139 v425 = 3600 * v2; | |
6140 else | |
6141 LABEL_813: | |
6142 v425 = 300 * v2; | |
6143 } | |
6144 else | |
6145 { | |
6146 v425 = 600 * v2; | |
6147 } | |
6148 amount = v425; | |
6149 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6150 goto play_sound_and_continue; |
0 | 6151 v426 = a2 >> 3; |
141 | 6152 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6153 goto LABEL_1056; |
6154 v730 = 836 * v426; | |
6155 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6156 { | |
90 | 6157 pActors[v426].pActorBuffs[1].Reset(); |
6158 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6159 v732 = amount << 7; |
90 | 6160 pActors[v426].pActorBuffs[9].Apply( |
0 | 6161 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6162 v731, 0, 0, 0); |
90 | 6163 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6164 } |
6165 a1.stru_24.Reset(); | |
6166 a1.field_48 = v3->spellnum; | |
6167 a1.field_4C = v2; | |
6168 a1.field_50 = v731; | |
6169 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6170 v61 = v426; |
0 | 6171 goto LABEL_1086; |
6172 case 66: | |
6173 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6174 goto play_sound_and_continue; |
0 | 6175 amount = 600 * v2; |
6176 v427 = a2 >> 3; | |
141 | 6177 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6178 goto LABEL_1056; |
6179 v730 = 836 * v427; | |
6180 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
488 | 6181 goto play_sound_and_continue; |
90 | 6182 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6183 { | |
6184 pActors[v427].pActorBuffs[9].Reset(); | |
6185 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6186 v732 = amount << 7; |
90 | 6187 pActors[v427].pActorBuffs[12].Apply( |
0 | 6188 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6189 v731, 0, 0, 0); |
0 | 6190 } |
6191 a1.stru_24.Reset(); | |
6192 a1.field_48 = v3->spellnum; | |
6193 a1.field_4C = v2; | |
6194 a1.field_50 = v731; | |
6195 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 6196 v61 = v427; |
0 | 6197 goto LABEL_1086; |
6198 case 63: | |
6199 v428 = v12 - 2; | |
6200 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6201 v430 = 300 * v2; | |
6202 else | |
6203 v430 = 180 * v2; | |
6204 amount = v430; | |
6205 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6206 goto play_sound_and_continue; |
0 | 6207 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
6208 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | |
6209 ++a1.uItemType; | |
6210 a1.stru_24.Reset(); | |
6211 a1.field_48 = v3->spellnum; | |
6212 a1.field_4C = v2; | |
6213 a1.field_50 = v731; | |
6214 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 6215 a1.uAttributes = 0; |
6216 a1.uSectorID = 0; | |
6217 a1.uSpriteFrameID = 0; | |
0 | 6218 v432 = v3->uPlayerID; |
6219 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6220 a1.uFacing = 0; |
0 | 6221 v432 *= 8; |
303 | 6222 LOBYTE(v432) = v432 | OBJECT_Player; |
6223 a1.field_58_pid = v432; | |
0 | 6224 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6225 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 6226 { |
6227 v433 = &pActors[dword_50BF30[a2]]; | |
6228 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6229 break; | |
6230 a1.vPosition.x = v433->vPosition.x; | |
6231 a1.vPosition.y = v433->vPosition.y; | |
6232 v732 = v433->uActorHeight; | |
6233 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6234 v434 = 8 * dword_50BF30[a2]; | |
486 | 6235 LOBYTE(v434) = v434 | OBJECT_Actor; |
0 | 6236 a1.field_5C = v434; |
486 | 6237 a1.Create(0, 0, 0, 0); |
0 | 6238 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) |
6239 { | |
6240 v732 = amount << 7; | |
6241 v433->pActorBuffs[4].Apply( | |
6242 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
486 | 6243 v731, 0, 0, 0); |
0 | 6244 } |
6245 } | |
6246 goto LABEL_1056; | |
6247 case 64: | |
6248 v435 = v12 - 2; | |
6249 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
486 | 6250 amount = 0; |
0 | 6251 else |
6252 amount = 86400 * v2; | |
6253 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6254 goto play_sound_and_continue; |
6255 | |
6256 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6257 v440 = v3->uPlayerID_2; |
6258 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6259 { | |
6260 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
486 | 6261 pParty->pPlayers[v440].PlaySound(SPEECH_25, 0); |
0 | 6262 if ( v731 == 4 ) |
6263 { | |
6264 v441 = v3->uPlayerID_2; | |
486 | 6265 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; |
6266 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; | |
0 | 6267 } |
6268 else | |
6269 { | |
6270 v732 = amount << 7; | |
6271 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6272 5u, | |
6273 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6274 } | |
6275 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6276 LABEL_720: | |
486 | 6277 v377->SetCondition(1, 0); |
0 | 6278 } |
6279 goto LABEL_1056; | |
6280 case 42: | |
6281 v442 = v12 - 2; | |
6282 if ( !v442 ) | |
6283 goto LABEL_855; | |
6284 v443 = v442 - 1; | |
6285 if ( v443 ) | |
6286 { | |
6287 if ( v443 == 1 ) | |
6288 v444 = 4 * v2; | |
6289 else | |
6290 LABEL_855: | |
6291 v444 = 2 * v2; | |
6292 } | |
6293 else | |
6294 { | |
6295 v444 = 3 * v2; | |
6296 } | |
6297 amount = v444; | |
6298 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6299 goto play_sound_and_continue; |
0 | 6300 v445 = a2 >> 3; |
141 | 6301 if ( (a2 & 7) == OBJECT_Item) |
0 | 6302 { |
6303 v449 = (char *)&pLayingItems[v445].stru_24; | |
6304 v450 = *(int *)v449; | |
6305 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6306 { | |
6307 party_finds_gold(*((int *)v449 + 3), 0); | |
6308 viewparams->bRedrawGameUI = 1; | |
6309 } | |
6310 else | |
6311 { | |
189 | 6312 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
0 | 6313 ShowStatusBarString(pTmpBuf2, 2u); |
6314 if ( !pParty->AddItem(&pLayingItems[v445].stru_24) ) | |
6315 pParty->SetHoldingItem(&pLayingItems[v445].stru_24); | |
6316 } | |
430 | 6317 LayingItem::OnItemPickup(v445); |
0 | 6318 } |
6319 else | |
6320 { | |
141 | 6321 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6322 { |
6323 stru_50C198.LootActor(&pActors[v445]); | |
6324 } | |
6325 else | |
6326 { | |
141 | 6327 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6328 { |
141 | 6329 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6330 goto LABEL_1056; |
6331 dword_507CD8 = 1; | |
6332 v677 = 1; | |
6333 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6334 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6335 else | |
6336 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6337 goto LABEL_866; | |
6338 } | |
6339 v447 = &pLevelDecorations[v445]; | |
6340 dword_507CD8 = 1; | |
6341 v448 = v447->field_16_event_id; | |
486 | 6342 if (v448) |
0 | 6343 { |
6344 v677 = 1; | |
6345 v446 = v448; | |
6346 LABEL_866: | |
6347 EventProcessor(v446, a2, v677); | |
6348 goto LABEL_1056; | |
6349 } | |
6350 if ( v447->IsInteractive() ) | |
6351 { | |
469 | 6352 GlobalEventInfo = (int)v447; |
0 | 6353 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); |
486 | 6354 GlobalEventInfo = 0; |
0 | 6355 } |
6356 } | |
6357 } | |
6358 goto LABEL_1056; | |
6359 case 67: | |
6360 v451 = v12 - 2; | |
6361 if ( v451 ) | |
6362 { | |
6363 v452 = v451 - 1; | |
6364 if ( v452 ) | |
6365 { | |
6366 if ( v452 == 1 ) | |
6367 { | |
486 | 6368 amount = 0; |
0 | 6369 goto LABEL_883; |
6370 } | |
6371 v453 = 180 * v2; | |
6372 } | |
6373 else | |
6374 { | |
6375 v453 = 86400 * v2; | |
6376 } | |
6377 } | |
6378 else | |
6379 { | |
6380 v453 = 3600 * v2; | |
6381 } | |
6382 amount = v453; | |
6383 LABEL_883: | |
6384 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6385 goto play_sound_and_continue; |
6386 | |
6387 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6388 v323 = v3->uPlayerID_2; |
6389 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6390 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6391 goto LABEL_1056; | |
6392 if ( v731 == 4 ) | |
6393 { | |
6394 LABEL_637: | |
486 | 6395 *(int *)v324 = 0; |
6396 *((int *)v324 + 1) = 0; | |
0 | 6397 goto LABEL_1056; |
6398 } | |
6399 v732 = amount << 7; | |
6400 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6401 v656 = 1; | |
6402 LABEL_640: | |
6403 v325 = &pParty->pPlayers[v323]; | |
6404 goto LABEL_641; | |
6405 case 68: | |
6406 v457 = v12 - 2; | |
6407 if ( v457 ) | |
6408 { | |
6409 v458 = v457 - 1; | |
6410 if ( v458 ) | |
6411 { | |
6412 if ( v458 == 1 ) | |
6413 v459 = 5 * v2 + 5; | |
6414 else | |
6415 v459 = 2 * v2 + 5; | |
6416 } | |
6417 else | |
6418 { | |
6419 v459 = 4 * v2 + 5; | |
6420 } | |
6421 } | |
6422 else | |
6423 { | |
6424 v459 = 3 * v2 + 5; | |
6425 } | |
6426 amount = v459; | |
6427 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6428 goto play_sound_and_continue; |
6429 v460 = v3->spell_target_pid; | |
486 | 6430 if (!v460) |
0 | 6431 { |
6432 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6433 LABEL_904: | |
6434 v674 = v3->uPlayerID_2; | |
6435 LABEL_685: | |
488 | 6436 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v674); |
0 | 6437 } |
6438 else | |
6439 { | |
141 | 6440 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6441 { |
6442 v461 = &pActors[v460 >> 3]; | |
6443 v462 = v461->uAIState; | |
6444 v463 = v461->pMonsterInfo.uHP; | |
6445 if ( v462 != 5 ) | |
6446 { | |
6447 if ( v462 != 4 ) | |
6448 { | |
6449 if ( v462 != 19 ) | |
6450 { | |
6451 if ( v462 != 11 ) | |
6452 { | |
6453 v461->sCurrentHP += amount; | |
6454 if ( v461->sCurrentHP > v463 ) | |
6455 v461->sCurrentHP = v463; | |
6456 } | |
6457 } | |
6458 } | |
6459 } | |
6460 } | |
6461 } | |
6462 goto LABEL_1056; | |
6463 case 72: | |
6464 v464 = v12 - 2; | |
6465 if ( !v464 ) | |
6466 goto LABEL_910; | |
6467 v465 = v464 - 1; | |
6468 if ( v465 ) | |
6469 { | |
6470 if ( v465 == 1 ) | |
6471 { | |
486 | 6472 amount = 0; |
0 | 6473 goto LABEL_912; |
6474 } | |
6475 LABEL_910: | |
6476 v466 = 3600 * v2; | |
6477 } | |
6478 else | |
6479 { | |
6480 v466 = 86400 * v2; | |
6481 } | |
6482 amount = v466; | |
6483 LABEL_912: | |
6484 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6485 goto play_sound_and_continue; |
6486 | |
6487 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6488 v470 = v3->uPlayerID_2; |
6489 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6490 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6491 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6492 goto LABEL_1056; | |
6493 if ( v731 == 4 ) | |
6494 { | |
486 | 6495 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; |
6496 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; | |
0 | 6497 v471 = v3->uPlayerID_2; |
486 | 6498 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; |
6499 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; | |
0 | 6500 v472 = v3->uPlayerID_2; |
486 | 6501 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; |
6502 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; | |
0 | 6503 goto LABEL_1056; |
6504 } | |
6505 v732 = amount << 7; | |
6506 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6507 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6508 6u, | |
6509 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6510 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6511 8u, | |
6512 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6513 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6514 v656 = 10; | |
6515 goto LABEL_937; | |
488 | 6516 |
6517 | |
0 | 6518 case 75: |
6519 amount = v2; | |
6520 LODWORD(v733) = 3600 * v2; | |
6521 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6522 goto play_sound_and_continue; |
6523 | |
6524 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6525 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6526 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6527 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6528 | |
0 | 6529 v732 = (int)v733 << 7; |
488 | 6530 |
6531 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | |
6532 goto LABEL_1056; | |
6533 | |
0 | 6534 case 73: |
6535 LODWORD(v733) = 3600 * v2; | |
6536 amount = v2; | |
6537 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6538 goto play_sound_and_continue; |
0 | 6539 if ( v731 == 4 ) |
6540 { | |
488 | 6541 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6542 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6543 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6544 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 6545 v732 = (int)v733 << 7; |
6546 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
488 | 6547 pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6548 pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6549 pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6550 | |
6551 pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, v2, v2, 0); | |
6552 goto LABEL_1056; | |
6553 //goto LABEL_104; | |
6554 } | |
6555 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
6556 | |
0 | 6557 v732 = (int)v733 << 7; |
488 | 6558 |
6559 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, v2, 0); | |
6560 goto LABEL_1056; | |
0 | 6561 case 74: |
6562 v493 = v12 - 2; | |
6563 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
486 | 6564 amount = 0; |
0 | 6565 else |
6566 amount = 86400 * v2; | |
6567 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6568 goto play_sound_and_continue; |
6569 | |
6570 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6571 v498 = v3->uPlayerID_2; |
6572 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6573 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6574 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6575 goto LABEL_1056; | |
6576 if ( v731 == 4 ) | |
6577 { | |
486 | 6578 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; |
6579 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; | |
0 | 6580 v499 = v3->uPlayerID_2; |
486 | 6581 LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0; |
6582 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0; | |
0 | 6583 v500 = v3->uPlayerID_2; |
486 | 6584 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; |
6585 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; | |
0 | 6586 } |
6587 else | |
6588 { | |
6589 v732 = amount << 7; | |
6590 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6591 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6592 7u, | |
6593 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6594 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6595 9u, | |
6596 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6597 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6598 v656 = 11; | |
6599 LABEL_937: | |
112 | 6600 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6601 LABEL_641: |
6602 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6603 } | |
6604 goto LABEL_1056; | |
6605 case 77: | |
486 | 6606 { |
0 | 6607 amount = 5 * v2 + 10; |
6608 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6609 goto play_sound_and_continue; |
0 | 6610 v501 = pParty->pPlayers; |
486 | 6611 int v1 = 0; |
0 | 6612 do |
6613 { | |
488 | 6614 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v1); |
0 | 6615 v501->Heal(amount); |
6616 ++v501; | |
6617 ++v1; | |
6618 } | |
6619 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6620 goto LABEL_1056; | |
486 | 6621 } |
0 | 6622 case 80: |
6623 sRecoveryTime -= v2; | |
6624 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6625 goto play_sound_and_continue; |
6626 | |
0 | 6627 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); |
6628 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
6629 ++a1.uItemType; | |
6630 HIDWORD(v733) = v505; | |
486 | 6631 v690 = 0; |
6632 v689 = 0; | |
6633 v688 = 0; | |
0 | 6634 a1.stru_24.Reset(); |
6635 a1.field_48 = v3->spellnum; | |
6636 a1.field_4C = v2; | |
6637 a1.field_50 = v731; | |
6638 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 6639 a1.uAttributes = 0; |
6640 a1.uSectorID = 0; | |
6641 a1.uSpriteFrameID = 0; | |
0 | 6642 v506 = v3->uPlayerID; |
6643 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6644 a1.uFacing = 0; |
0 | 6645 v506 *= 8; |
303 | 6646 LOBYTE(v506) = v506 | OBJECT_Player; |
6647 a1.field_58_pid = v506; | |
0 | 6648 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6649 a2 = 0; |
6650 if ( SHIDWORD(v733) > 0 ) | |
0 | 6651 { |
6652 do | |
6653 { | |
6654 v507 = dword_50BF30[a2]; | |
6655 a1.vPosition.x = pActors[v507].vPosition.x; | |
6656 a1.vPosition.y = pActors[v507].vPosition.y; | |
6657 v732 = pActors[v507].uActorHeight; | |
6658 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6659 v508 = 8 * dword_50BF30[a2]; | |
486 | 6660 LOBYTE(v508) = v508 | OBJECT_Actor; |
0 | 6661 a1.field_5C = v508; |
486 | 6662 v509 = a1.Create(0, 0, 0, 0); |
0 | 6663 v510 = a2; |
486 | 6664 DamageMonsterFromParty(8 * v509 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v688); |
0 | 6665 a2 = v510 + 1; |
6666 } | |
6667 while ( v510 + 1 < SHIDWORD(v733) ); | |
6668 } | |
486 | 6669 for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 ) |
0 | 6670 { |
6671 v511 = &pActors[dword_50BF30[a2]]; | |
6672 a1.vPosition.x = v511->vPosition.x; | |
6673 a1.vPosition.y = v511->vPosition.y; | |
6674 v732 = v511->uActorHeight; | |
6675 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6676 v512 = 8 * dword_50BF30[a2]; | |
486 | 6677 LOBYTE(v512) = v512 | OBJECT_Actor; |
0 | 6678 a1.field_5C = v512; |
486 | 6679 a1.Create(0, 0, 0, 0); |
0 | 6680 v513 = v511->pActorBuffs; |
6681 v726 = (Player *)22; | |
6682 do | |
6683 { | |
6684 v513->Reset(); | |
6685 ++v513; | |
6686 v726 = (Player *)((char *)v726 - 1); | |
6687 } | |
6688 while ( *(float *)&v726 != 0.0 ); | |
6689 } | |
6690 goto LABEL_1056; | |
6691 case 82: | |
6692 v514 = v12 - 2; | |
6693 if ( !v514 ) | |
6694 goto LABEL_955; | |
6695 v515 = v514 - 1; | |
6696 if ( v515 ) | |
6697 { | |
6698 if ( v515 == 1 ) | |
6699 { | |
6700 v516 = 900 * v2; | |
6701 amount = 5; | |
6702 } | |
6703 else | |
6704 { | |
6705 LABEL_955: | |
6706 v516 = 300 * v2; | |
6707 amount = 1; | |
6708 } | |
6709 } | |
6710 else | |
6711 { | |
6712 v516 = 900 * v2; | |
6713 amount = 3; | |
6714 } | |
486 | 6715 v733 = __PAIR__(0, v516); |
0 | 6716 v517 = 8 * v3->uPlayerID; |
6717 LOBYTE(v517) = v517 | 4; | |
486 | 6718 if ( (signed int)uNumActors > 0 ) |
0 | 6719 { |
90 | 6720 v518 = pActors;//[0].uAIState; |
6721 v726b = uNumActors; | |
0 | 6722 do |
6723 { | |
90 | 6724 v519 = v518->uAIState; |
6725 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6726 ++HIDWORD(v733); |
90 | 6727 ++v518; |
6728 --v726; | |
0 | 6729 } |
90 | 6730 while ( v726 != 0 ); |
0 | 6731 } |
6732 if ( SHIDWORD(v733) >= amount ) | |
6733 { | |
6734 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6735 goto LABEL_201; | |
6736 } | |
6737 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6738 goto play_sound_and_continue; |
0 | 6739 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); |
6740 goto LABEL_1056; | |
6741 case 83: | |
6742 v520 = v12 - 2; | |
6743 if ( !v520 ) | |
6744 goto LABEL_973; | |
6745 v521 = v520 - 1; | |
6746 if ( v521 ) | |
6747 { | |
6748 if ( v521 == 1 ) | |
6749 { | |
6750 LODWORD(v733) = 18000 * v2; | |
6751 v522 = 5 * v2 + 10; | |
6752 } | |
6753 else | |
6754 { | |
6755 LABEL_973: | |
6756 LODWORD(v733) = 10800 * v2; | |
6757 v522 = 3 * v2 + 10; | |
6758 } | |
6759 } | |
6760 else | |
6761 { | |
6762 LODWORD(v733) = 14400 * v2; | |
6763 v522 = 4 * v2 + 10; | |
6764 } | |
6765 amount = v522; | |
6766 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6767 goto play_sound_and_continue; |
6768 | |
6769 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6770 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6771 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6772 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 6773 v83 = 1; |
488 | 6774 |
0 | 6775 v732 = (int)v733 << 7; |
488 | 6776 |
6777 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); | |
6778 LODWORD(v727) = v83; | |
6779 | |
6780 goto play_sound_and_continue; | |
6781 | |
0 | 6782 case 84: |
6783 v67 = 2; | |
6784 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6785 { | |
6786 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6787 goto LABEL_202; | |
6788 } | |
6789 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6790 goto play_sound_and_continue; |
0 | 6791 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); |
6792 ++a1.uItemType; | |
6793 v726 = (Player *)v531; | |
486 | 6794 v696 = 0; |
6795 v695 = 0; | |
6796 v694 = 0; | |
0 | 6797 a1.stru_24.Reset(); |
6798 a1.field_48 = v3->spellnum; | |
6799 a1.field_4C = v2; | |
6800 a1.field_50 = v731; | |
6801 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 6802 a1.uAttributes = 0; |
6803 a1.uSectorID = 0; | |
6804 a1.uSpriteFrameID = 0; | |
0 | 6805 v532 = v3->uPlayerID; |
6806 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6807 a1.uFacing = 0; |
0 | 6808 v532 *= 8; |
303 | 6809 LOBYTE(v532) = v532 | OBJECT_Player; |
6810 a1.field_58_pid = v532; | |
0 | 6811 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6812 a2 = 0; |
6813 if ( (signed int)v726 > 0 ) | |
0 | 6814 { |
6815 do | |
6816 { | |
6817 v533 = dword_50BF30[a2]; | |
6818 a1.vPosition.x = pActors[v533].vPosition.x; | |
6819 a1.vPosition.y = pActors[v533].vPosition.y; | |
6820 v732 = pActors[v533].uActorHeight; | |
6821 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6822 v534 = 8 * dword_50BF30[a2]; | |
486 | 6823 LOBYTE(v534) = v534 | OBJECT_Actor; |
0 | 6824 a1.field_5C = v534; |
486 | 6825 v535 = a1.Create(0, 0, 0, 0); |
0 | 6826 v536 = a2; |
486 | 6827 DamageMonsterFromParty(8 * v535 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v694); |
0 | 6828 a2 = v536 + 1; |
6829 } | |
6830 while ( v536 + 1 < (signed int)v726 ); | |
6831 } | |
6832 v537 = pGame->GetStru6(); | |
6833 pGame->GetStru6()->_4A8BFC(); | |
6834 goto LABEL_1056; | |
488 | 6835 |
6836 case SPELL_LIGHT_DAY_OF_PROTECTION: | |
0 | 6837 v538 = v12 - 2; |
6838 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
6839 { | |
6840 amount = 5 * v2; | |
6841 v540 = 18000 * v2; | |
6842 } | |
6843 else | |
6844 { | |
6845 amount = 4 * v2; | |
6846 v540 = 14400 * v2; | |
6847 } | |
6848 v730 = v540; | |
6849 LODWORD(v733) = v540; | |
6850 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6851 goto play_sound_and_continue; |
6852 | |
6853 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6854 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6855 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6856 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6857 | |
0 | 6858 v732 = v730 << 7; |
6859 v549 = (double)(v730 << 7) * 0.033333335; | |
6860 *((float *)&v733 + 1) = v549; | |
6861 v712 = (signed __int64)v549; | |
488 | 6862 pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, 0, 0); |
6863 pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6864 pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6865 pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6866 pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6867 pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
0 | 6868 v550 = v2 + 5; |
488 | 6869 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply( |
0 | 6870 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
6871 v731, | |
486 | 6872 v550, 0, 0); |
488 | 6873 |
6874 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0); | |
6875 goto LABEL_1056; | |
0 | 6876 case 86: |
6877 v551 = v12 - 2; | |
6878 if ( !v551 ) | |
6879 goto LABEL_998; | |
6880 v552 = v551 - 1; | |
6881 if ( v552 ) | |
6882 { | |
6883 if ( v552 == 1 ) | |
6884 { | |
6885 amount = 15; | |
6886 HIDWORD(v733) = 20; | |
6887 goto LABEL_1000; | |
6888 } | |
6889 LABEL_998: | |
6890 v678 = 4; | |
6891 } | |
6892 else | |
6893 { | |
6894 v678 = 12; | |
6895 } | |
6896 amount = v678; | |
6897 HIDWORD(v733) = v678; | |
6898 LABEL_1000: | |
6899 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6900 goto play_sound_and_continue; |
0 | 6901 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); |
6902 v732 = (300 * amount * v2 + 60) << 7; | |
6903 v730 = v2 + 5; | |
486 | 6904 v726 = 0; |
89 | 6905 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 6906 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
6907 do | |
6908 { | |
488 | 6909 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6910 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6911 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6912 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6913 | |
89 | 6914 //((SpellBuff *)(v553 + 6056))->Apply( |
488 | 6915 v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
0 | 6916 if ( *(_QWORD *)v553 ) |
6917 v726 = (Player *)1; | |
89 | 6918 ++v553; |
6919 } | |
6920 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 6921 v562 = v731; |
488 | 6922 pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
6923 pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, 0, 0, 0); | |
6924 pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, v730, 0, 0); | |
486 | 6925 if (v726) |
0 | 6926 goto LABEL_1056; |
6927 v732 = (int)y << 7; | |
488 | 6928 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply((signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 + (double)(signed __int64)pParty->uTimePlayed), v562, v730, 0, 0); |
6929 goto LABEL_1056; | |
0 | 6930 case 88: |
6931 amount = 3; | |
6932 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
6933 goto LABEL_200; | |
6934 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6935 goto play_sound_and_continue; |
486 | 6936 a2 = 0; |
0 | 6937 _this = (ItemGen *)&pPlayers[1]; |
6938 do | |
6939 { | |
6940 v563 = 0; | |
6941 do | |
6942 { | |
6943 v564 = _this->uItemID; | |
486 | 6944 *(int *)(v563 + _this->uItemID) = 0; |
0 | 6945 v563 += 8; |
486 | 6946 *(int *)(v563 + v564 - 4) = 0; |
0 | 6947 } |
6948 while ( v563 <= 128 ); | |
6949 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
6950 v566 = (Player **)_this; | |
6951 *(int *)(_this->uItemID + 6460) = v565; | |
6952 v567 = (*v566)->GetMaxMana(); | |
6953 *(int *)(_this->uItemID + 6464) = v567; | |
488 | 6954 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
0 | 6955 ++a2; |
6956 _this = (ItemGen *)((char *)_this + 4); | |
6957 } | |
6958 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
6959 v571 = pPlayer; | |
6960 v572 = (char *)&pPlayer->sAgeModifier; | |
6961 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
6962 *(short *)v572 = 120; | |
6963 else | |
6964 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
6965 sRecoveryTime += -5 * v2; | |
6966 ++v571->uNumDivineInterventionCastsThisDay; | |
6967 goto LABEL_1056; | |
6968 case 89: | |
6969 v573 = v12 - 2; | |
6970 if ( v573 ) | |
6971 { | |
6972 v574 = v573 - 1; | |
6973 if ( v574 ) | |
6974 { | |
6975 if ( v574 == 1 ) | |
6976 v575 = 5 * v2; | |
6977 else | |
6978 v575 = 2 * v2; | |
6979 } | |
6980 else | |
6981 { | |
6982 v575 = 4 * v2; | |
6983 } | |
6984 } | |
6985 else | |
6986 { | |
6987 v575 = 3 * v2; | |
6988 } | |
6989 amount = v575; | |
6990 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6991 goto play_sound_and_continue; |
6992 v576 = v3->spell_target_pid; | |
486 | 6993 if (!v576) |
0 | 6994 { |
6995 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
488 | 6996 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
0 | 6997 if ( *((_QWORD *)v585 + 14) ) |
6998 { | |
6999 ((Player *)v585)->SetCondition(0x11u, 1); | |
7000 v587 = ((Player *)v585)->GetSexByVoice(); | |
7001 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7002 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7003 } | |
488 | 7004 goto play_sound_and_continue; |
0 | 7005 } |
7006 v577 = (Player *)(v576 >> 3); | |
7007 v726 = v577; | |
7008 if ( v577 == (Player *)-1 ) | |
7009 { | |
7010 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7011 goto LABEL_201; | |
7012 } | |
7013 v578 = (int)&pActors[(int)v577]; | |
7014 v721 = v578; | |
486 | 7015 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) |
0 | 7016 goto LABEL_200; |
7017 ++a1.uItemType; | |
7018 a1.stru_24.Reset(); | |
7019 a1.field_48 = v3->spellnum; | |
7020 a1.field_4C = v2; | |
7021 a1.field_50 = v731; | |
7022 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 7023 a1.uAttributes = 0; |
7024 a1.uSectorID = 0; | |
7025 a1.uSpriteFrameID = 0; | |
0 | 7026 v580 = v3->uPlayerID; |
7027 a1.field_60_distance_related_prolly_lod = 0; | |
7028 v581 = v721; | |
7029 v580 *= 8; | |
303 | 7030 LOBYTE(v580) = v580 | OBJECT_Player; |
486 | 7031 a1.uFacing = 0; |
303 | 7032 a1.field_58_pid = v580; |
0 | 7033 a1.uSoundID = LOWORD(v3->field_10); |
7034 a1.vPosition.x = *(short *)(v721 + 142); | |
7035 a1.vPosition.y = *(short *)(v721 + 144); | |
7036 v732 = *(short *)(v721 + 138); | |
7037 v582 = 8 * (int)v726; | |
7038 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
486 | 7039 LOBYTE(v582) = 8 * (char)v726 | OBJECT_Actor; |
0 | 7040 a1.field_5C = v582; |
486 | 7041 a1.Create(0, 0, 0, 0); |
0 | 7042 if ( *(char *)(v581 + 52) > amount ) |
488 | 7043 goto play_sound_and_continue; |
0 | 7044 Actor::Resurrect((unsigned int)v726); |
7045 *(char *)(v581 + 61) = 0; | |
7046 *(char *)(v581 + 53) = 0; | |
7047 *(char *)(v581 + 54) = 0; | |
7048 *(char *)(v581 + 55) = 0; | |
7049 *(char *)(v581 + 56) = 0; | |
7050 *(char *)(v581 + 57) = 0; | |
7051 *(int *)(v581 + 712) = 9999; | |
7052 *(char *)(v581 + 38) &= 0xF7u; | |
486 | 7053 *(int *)(v581 + 708) = 0; |
0 | 7054 ((SpellBuff *)(v581 + 356))->Reset(); |
7055 ((SpellBuff *)(v581 + 228))->Reset(); | |
7056 ((SpellBuff *)(v581 + 404))->Reset(); | |
7057 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7058 *(short *)(v581 + 40) = 10 * amount; | |
7059 goto LABEL_1056; | |
7060 case 91: | |
7061 v588 = v12 - 1; | |
7062 amount = 16; | |
7063 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7064 { | |
7065 if ( v590 == 1 ) | |
486 | 7066 LODWORD(v733) = 0; |
0 | 7067 } |
7068 else | |
7069 { | |
7070 LODWORD(v733) = 3600 * v2; | |
7071 } | |
7072 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7073 goto play_sound_and_continue; |
0 | 7074 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; |
7075 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7076 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7077 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7078 || *(char *)(HIDWORD(v733) + 20) & 2 | |
486 | 7079 || *(int *)(HIDWORD(v733) + 12) != 0 |
7080 || *(int *)(HIDWORD(v733) + 4) != 0 | |
0 | 7081 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 |
377 | 7082 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) |
0 | 7083 goto LABEL_199; |
7084 v592 = HIDWORD(v733); | |
7085 v14 = v731 == 4; | |
7086 *(int *)(HIDWORD(v733) + 12) = 16; | |
7087 if ( !v14 ) | |
7088 { | |
7089 v732 = (int)v733 << 7; | |
7090 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7091 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7092 *(int *)(v592 + 20) |= 8u; | |
7093 } | |
7094 *(char *)(v592 + 20) |= 0x80u; | |
7095 goto LABEL_1055; | |
7096 case 93: | |
7097 v593 = v12 - 2; | |
7098 if ( !v593 ) | |
7099 goto LABEL_1062; | |
7100 v594 = v593 - 1; | |
7101 if ( v594 ) | |
7102 { | |
7103 if ( v594 == 1 ) | |
7104 amount = 9; | |
7105 else | |
7106 LABEL_1062: | |
7107 amount = 5; | |
7108 } | |
7109 else | |
7110 { | |
7111 amount = 7; | |
7112 } | |
7113 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7114 goto play_sound_and_continue; |
0 | 7115 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); |
7116 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7117 a1.stru_24.Reset(); | |
7118 a1.field_48 = v3->spellnum; | |
7119 a1.field_4C = v2; | |
7120 a1.field_50 = v731; | |
7121 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
7122 a1.vPosition.x = pParty->vPosition.x; | |
7123 a1.vPosition.y = pParty->vPosition.y; | |
486 | 7124 a1.uAttributes = 0; |
0 | 7125 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
7126 a1.uSectorID = pIndoor->GetSector( | |
7127 pParty->vPosition.x, | |
7128 pParty->vPosition.y, | |
7129 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
486 | 7130 a1.uSpriteFrameID = 0; |
0 | 7131 v595 = 8 * v3->uPlayerID; |
303 | 7132 LOBYTE(v595) = v595 | OBJECT_Player; |
7133 a1.field_58_pid = v595; | |
0 | 7134 a1.field_5C = a2; |
7135 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7136 a1.uSoundID = LOWORD(v3->field_10); | |
7137 if ( pParty->bTurnBasedModeOn == 1 ) | |
7138 LOBYTE(a1.uAttributes) |= 4u; | |
7139 v596 = (signed int)v726 / -2; | |
7140 y = (char *)((signed int)v726 / 2); | |
7141 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7142 { | |
7143 v597 = v715.uYawAngle; | |
7144 do | |
7145 { | |
7146 a1.uFacing = v596 + v597; | |
7147 if ( a1.Create( | |
7148 v596 + v597, | |
7149 v715.uPitchAngle, | |
7150 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7151 v3->uPlayerID + 1) != -1 | |
7152 && pParty->bTurnBasedModeOn == 1 ) | |
7153 ++pTurnEngine->field_1C; | |
7154 v596 += v732; | |
7155 } | |
7156 while ( v596 <= (signed int)y ); | |
7157 } | |
7158 goto LABEL_1056; | |
7159 case 94: | |
7160 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7161 goto play_sound_and_continue; |
0 | 7162 if ( v731 == 1 || v731 == 2 ) |
7163 { | |
7164 v598 = 180 * v2; | |
7165 goto LABEL_1081; | |
7166 } | |
7167 if ( v731 == 3 ) | |
7168 { | |
7169 v598 = 300 * v2; | |
7170 LABEL_1081: | |
7171 LODWORD(v733) = v598; | |
7172 goto LABEL_1082; | |
7173 } | |
7174 if ( v731 == 4 ) | |
7175 LODWORD(v733) = 29030400; | |
7176 LABEL_1082: | |
7177 v599 = a2 >> 3; | |
141 | 7178 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7179 goto LABEL_1056; |
7180 v730 = 836 * v599; | |
7181 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
488 | 7182 goto play_sound_and_continue; |
90 | 7183 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7184 goto LABEL_200; |
90 | 7185 pActors[v599].pActorBuffs[9].Reset(); |
7186 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7187 v732 = (int)v733 << 7; |
90 | 7188 pActors[v599].pActorBuffs[12].Apply( |
0 | 7189 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 7190 v731, 0, 0, 0); |
0 | 7191 a1.stru_24.Reset(); |
7192 a1.field_48 = v3->spellnum; | |
7193 a1.field_4C = v2; | |
7194 a1.field_50 = v731; | |
7195 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | |
90 | 7196 v61 = v599; |
0 | 7197 LABEL_1086: |
90 | 7198 v600 = pActors[v61].vPosition.y; |
7199 v601 = pActors[v61].vPosition.x; | |
0 | 7200 a1.uObjectDescID = v60; |
7201 a1.vPosition.x = v601; | |
90 | 7202 v602 = pActors[v61].uActorHeight; |
7203 v603 = pActors[v61].vPosition.z; | |
0 | 7204 a1.vPosition.y = v600; |
7205 v676 = v603 + v602; | |
7206 v665 = v600; | |
7207 a1.vPosition.z = v603 + v602; | |
7208 v657 = v601; | |
7209 LABEL_1087: | |
486 | 7210 a1.uAttributes = 0; |
0 | 7211 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); |
486 | 7212 a1.uSpriteFrameID = 0; |
0 | 7213 v604 = 8 * v3->uPlayerID; |
303 | 7214 LOBYTE(v604) = v604 | OBJECT_Player; |
7215 a1.field_58_pid = v604; | |
0 | 7216 a1.field_5C = a2; |
7217 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7218 a1.uFacing = LOWORD(v715.uYawAngle); | |
7219 LOWORD(v604) = LOWORD(v3->field_10); | |
7220 LOBYTE(a1.uAttributes) |= 0x80u; | |
7221 a1.uSoundID = v604; | |
486 | 7222 a1.Create(0, 0, 0, v3->uPlayerID + 1); |
0 | 7223 goto LABEL_1056; |
7224 case 96: | |
7225 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7226 goto play_sound_and_continue; |
486 | 7227 HIDWORD(v733) = 0; |
7228 memset(&pStru179, 0, 0xFA0u); | |
7229 _this = 0; | |
0 | 7230 v605 = (char *)pParty->pHirelings; |
7231 do | |
7232 { | |
486 | 7233 if ( *(int *)v605) |
0 | 7234 { |
7235 v606 = HIDWORD(v733)++; | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
79
diff
changeset
|
7236 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7237 } |
7238 _this = (ItemGen *)((char *)_this + 1); | |
7239 v605 += 76; | |
7240 } | |
7241 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
486 | 7242 _this = 0; |
7243 if ( (signed int)pNPCStats->uNumNewNPCs > 0) | |
0 | 7244 { |
7245 v730 = (int)pNPCStats->pNewNPCData; | |
7246 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7247 do | |
7248 { | |
7249 if ( *(char *)(v730 + 8) & 0x80 | |
486 | 7250 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) |
7251 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
0 | 7252 { |
7253 v607 = HIDWORD(v733); | |
7254 HIDWORD(v733) += 4; | |
7255 *(int *)v607 = (int)_this + 3; | |
7256 } | |
7257 _this = (ItemGen *)((char *)_this + 1); | |
7258 v730 += 76; | |
7259 } | |
7260 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7261 } | |
7262 v608 = v3->uPlayerID_2; | |
7263 if ( v608 != 4 && v608 != 5 | |
486 | 7264 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) |
0 | 7265 || v609 >= 3 ) |
7266 goto LABEL_200; | |
7267 v610 = 76 * v609; | |
486 | 7268 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; |
0 | 7269 v611 = pIconsFrameTable->FindIcon("spell96"); |
488 | 7270 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611); |
0 | 7271 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; |
89 | 7272 v612 = pParty->pPlayers; |
0 | 7273 do |
7274 { | |
89 | 7275 v612->sHealth = v612->GetMaxHealth(); |
7276 v612->sMana = v612->GetMaxMana(); | |
7277 ++v612; | |
7278 } | |
7279 while ( v612 <= &pParty->pPlayers[3] ); | |
7280 v613 = &pOutdoor->ddm; | |
0 | 7281 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7282 v613 = &pIndoor->dlv; |
7283 v613->uReputation += 15; | |
7284 if ( v613->uReputation > 10000 ) | |
7285 v613->uReputation = 10000; | |
488 | 7286 LODWORD(v727) = 1; |
7287 goto play_sound_and_continue; | |
0 | 7288 case 95: |
486 | 7289 if ( v12 <= 0 ) |
0 | 7290 goto LABEL_1119; |
7291 if ( v12 <= 3 ) | |
7292 { | |
7293 v614 = 300 * (v2 + 12); | |
7294 } | |
7295 else | |
7296 { | |
7297 if ( v12 != 4 ) | |
7298 goto LABEL_1119; | |
7299 v614 = 900 * (v2 + 4); | |
7300 } | |
7301 LODWORD(v733) = v614; | |
7302 LABEL_1119: | |
7303 v615 = v2 + 5; | |
7304 amount = v615; | |
7305 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7306 goto play_sound_and_continue; |
0 | 7307 if ( v731 != 3 && v731 != 4 ) |
7308 { | |
488 | 7309 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
7310 | |
0 | 7311 v732 = (int)v733 << 7; |
488 | 7312 |
7313 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v615, v716, 0); | |
7314 goto LABEL_1056; | |
0 | 7315 } |
486 | 7316 a2 = 0; |
0 | 7317 v732 = (int)v733 << 7; |
7318 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7319 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7320 do |
7321 { | |
488 | 7322 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
7323 v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | |
0 | 7324 ++a2; |
112 | 7325 ++v619; |
7326 } | |
7327 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7328 goto LABEL_1056; |
7329 case 99: | |
7330 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7331 goto play_sound_and_continue; |
486 | 7332 v726 = 0; |
0 | 7333 pGame->GetIndoorCamera(); |
7334 v623 = (signed __int64)GetPickDepth(); | |
7335 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
486 | 7336 v709 = 0; |
7337 v708 = 0; | |
7338 v707 = 0; | |
0 | 7339 a1.stru_24.Reset(); |
7340 a1.field_48 = v3->spellnum; | |
7341 a1.field_4C = v2; | |
7342 a1.field_50 = v731; | |
7343 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | |
486 | 7344 a1.uAttributes = 0; |
7345 a1.uSectorID = 0; | |
7346 a1.uSpriteFrameID = 0; | |
0 | 7347 v624 = v3->uPlayerID; |
7348 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 7349 a1.uFacing = 0; |
0 | 7350 v624 *= 8; |
303 | 7351 LOBYTE(v624) = v624 | OBJECT_Player; |
7352 a1.field_58_pid = v624; | |
0 | 7353 a1.uSoundID = LOWORD(v3->field_10); |
486 | 7354 a2 = 0; |
7355 if ( SHIDWORD(v733) > 0 ) | |
0 | 7356 { |
7357 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7358 do | |
7359 { | |
7360 v625 = dword_50BF30[a2]; | |
7361 a1.vPosition.x = pActors[v625].vPosition.x; | |
7362 a1.vPosition.y = pActors[v625].vPosition.y; | |
7363 v732 = pActors[v625].uActorHeight; | |
7364 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7365 v626 = 8 * dword_50BF30[a2]; | |
486 | 7366 LOBYTE(v626) = v626 | OBJECT_Actor; |
0 | 7367 a1.field_5C = v626; |
486 | 7368 v627 = a1.Create(0, 0, 0, 0); |
0 | 7369 v628 = a2; |
7370 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7371 a2 = v628 + 1; | |
7372 } | |
7373 while ( v628 + 1 < SHIDWORD(v733) ); | |
7374 } | |
486 | 7375 v730 = 0; |
0 | 7376 v629 = 1; |
7377 do | |
7378 { | |
7379 v630 = pPlayers[v629]; | |
7380 if ( !v630->pConditions[2] | |
7381 && !v630->pConditions[12] | |
7382 && !v630->pConditions[13] | |
7383 && !v630->pConditions[14] | |
7384 && !v630->pConditions[15] | |
7385 && !v630->pConditions[16] ) | |
7386 { | |
7387 v631 = v730++; | |
7388 v681[v631] = v629; | |
7389 } | |
7390 ++v629; | |
7391 } | |
7392 while ( v629 <= 4 ); | |
7393 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
486 | 7394 HIDWORD(v733) = 0; |
7395 if ( v730 > 0 ) | |
0 | 7396 { |
7397 do | |
7398 { | |
7399 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7400 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7401 v633->sHealth += v732; | |
7402 v726 = *(Player **)v632; | |
7403 v634 = v726->GetMaxHealth(); | |
7404 if ( v726->sHealth > v634 ) | |
7405 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7406 v635 = HIDWORD(v733); | |
488 | 7407 |
7408 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, WORD2(v733)); | |
0 | 7409 HIDWORD(v733) = v635 + 1; |
7410 } | |
7411 while ( v635 + 1 < v730 ); | |
7412 } | |
486 | 7413 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); |
0 | 7414 goto LABEL_1056; |
7415 case 98: | |
7416 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7417 { | |
7418 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7419 goto LABEL_201; | |
7420 } | |
7421 v640 = v12 - 2; | |
7422 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7423 amount = 3; | |
486 | 7424 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) |
0 | 7425 goto LABEL_200; |
7426 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7427 goto play_sound_and_continue; |
349 | 7428 pParty->armageddon_timer = 256; |
0 | 7429 pParty->field_16140 = v2; |
7430 ++pPlayer->uNumArmageddonCasts; | |
7431 if ( pParty->bTurnBasedModeOn == 1 ) | |
7432 ++pTurnEngine->field_1C; | |
7433 v726 = (Player *)50; | |
7434 do | |
7435 { | |
7436 v642 = rand() % 4096 - 2048; | |
7437 v643 = rand(); | |
7438 v721 = v642 + pParty->vPosition.x; | |
7439 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
486 | 7440 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0); |
0 | 7441 v644 = rand(); |
486 | 7442 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0); |
0 | 7443 v726 = (Player *)((char *)v726 - 1); |
7444 } | |
7445 while ( *(float *)&v726 != 0.0 ); | |
7446 goto LABEL_1056; | |
7447 default: | |
488 | 7448 goto play_sound_and_continue; |
0 | 7449 } |
7450 while ( 2 ) | |
7451 { | |
7452 if ( v731 == 4 ) | |
7453 { | |
7454 if ( *((_QWORD *)v222 + 2) ) | |
7455 { | |
486 | 7456 *((int *)v222 + 4) = 0; |
7457 *((int *)v222 + 5) = 0; | |
0 | 7458 goto LABEL_439; |
7459 } | |
7460 } | |
7461 else | |
7462 { | |
7463 v732 = amount << 7; | |
7464 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7465 2u, | |
7466 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7467 v222 = (char *)HIDWORD(v733); | |
7468 if ( v223 ) | |
7469 LABEL_439: | |
486 | 7470 ((Player *)v222)->PlaySound(SPEECH_103, 0); |
0 | 7471 } |
7472 v222 += 6972; | |
7473 HIDWORD(v733) = (int)v222; | |
7474 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7475 goto LABEL_1056; | |
7476 continue; | |
7477 } | |
7478 } | |
7479 //----- (0042EB42) -------------------------------------------------------- | |
7480 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7481 { | |
7482 unsigned int v2; // edx@1 | |
7483 signed int v3; // eax@1 | |
7484 char *v4; // ecx@2 | |
7485 | |
7486 v2 = this->uNumObjects; | |
7487 v3 = 0; | |
7488 if ( (signed int)this->uNumObjects <= 0 ) | |
7489 { | |
7490 LABEL_5: | |
7491 LOWORD(v3) = 0; | |
7492 } | |
7493 else | |
7494 { | |
7495 v4 = (char *)&this->pObjects->uObjectID; | |
7496 while ( uItemID != *(short *)v4 ) | |
7497 { | |
7498 ++v3; | |
7499 v4 += 56; | |
7500 if ( v3 >= (signed int)v2 ) | |
7501 goto LABEL_5; | |
7502 } | |
7503 } | |
7504 return v3; | |
7505 } | |
7506 | |
7507 | |
7508 | |
7509 //----- (0042EB78) -------------------------------------------------------- | |
7510 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7511 { | |
7512 return 8 * this->pIcons[uIconID].uAnimLength; | |
7513 } | |
7514 | |
437 | 7515 |
7516 const wchar_t *UIMessage2String(UIMessageType msg) | |
7517 { | |
7518 #define CASE(xxx) case xxx: _swprintf(b, L"%03X/%s", msg, L#xxx); return b; | |
7519 static wchar_t b[256]; // bad for threads | |
7520 switch (msg) | |
7521 { | |
7522 CASE(UIMSG_SelectSpell) | |
7523 CASE(UIMSG_ChangeGameState) | |
7524 CASE(UIMSG_Attack) | |
7525 CASE(UIMSG_PlayArcomage) | |
7526 CASE(UIMSG_MainMenu_ShowPartyCreationWnd) | |
7527 CASE(UIMSG_MainMenu_ShowLoadWindow) | |
7528 CASE(UIMSG_ShowCredits) | |
7529 CASE(UIMSG_ExitToWindows) | |
7530 CASE(UIMSG_PlayerCreationChangeName) | |
7531 CASE(UIMSG_PlayerCreationClickPlus) | |
7532 CASE(UIMSG_PlayerCreationClickMinus) | |
7533 CASE(UIMSG_PlayerCreationSelectActiveSkill) | |
7534 CASE(UIMSG_PlayerCreationSelectClass) | |
7535 CASE(UIMSG_PlayerCreationClickOK) | |
7536 CASE(UIMSG_PlayerCreationClickReset) | |
7537 CASE(UIMSG_AutonotesBook) | |
7538 CASE(UIMSG_PlayerCreationRemoveUpSkill) | |
7539 CASE(UIMSG_PlayerCreationRemoveDownSkill) | |
7540 CASE(UIMSG_SPellbook_ShowHightlightedSpellInfo) | |
7541 CASE(UIMSG_LoadGame) | |
7542 CASE(UIMSG_SaveGame) | |
7543 CASE(UIMSG_ShowStatus_DateTime) | |
7544 CASE(UIMSG_ShowStatus_ManaHP) | |
7545 CASE(UIMSG_ShowStatus_Player) | |
7546 CASE(UIMSG_Wait5Minutes) | |
7547 CASE(UIMSG_Wait1Hour) | |
7548 CASE(UIMSG_ShowStatus_Food) | |
7549 CASE(UIMSG_ShowStatus_Funds) | |
7550 CASE(UIMSG_QuickReference) | |
7551 CASE(UIMSG_GameMenuButton) | |
7552 CASE(UIMSG_AlreadyResting) | |
7553 CASE(UIMSG_SelectCharacter) | |
7554 CASE(UIMSG_ChangeSoundVolume) | |
7555 CASE(UIMSG_ChangeMusicVolume) | |
7556 CASE(UIMSG_Escape) | |
7557 CASE(UIMSG_PlayerCreation_SelectAttribute) | |
7558 CASE(UIMSG_InventoryLeftClick) | |
7559 CASE(UIMSG_SkillUp) | |
7560 CASE(UIMSG_GameMenu_ReturnToGame) | |
7561 CASE(UIMSG_StartNewGame) | |
7562 CASE(UIMSG_Game_OpenLoadGameDialog) | |
7563 CASE(UIMSG_Game_OpenSaveGameDialog) | |
7564 CASE(UIMSG_Game_OpenOptionsDialog) | |
7565 CASE(UIMSG_SetGraphicsMode) | |
7566 CASE(UIMSG_Quit) | |
7567 CASE(UIMSG_StartHireling1Dialogue) | |
7568 CASE(UIMSG_StartHireling2Dialogue) | |
7569 CASE(UIMSG_SelectDialogueOption) | |
7570 CASE(UIMSG_CastSpellFromBook) | |
7571 CASE(UIMSG_PlayerCreation_VoicePrev) | |
7572 CASE(UIMSG_PlayerCreation_VoiceNext) | |
7573 CASE(UIMSG_StartNPCDialogue) | |
7574 CASE(UIMSG_ArrowUp) | |
7575 CASE(UIMSG_DownArrow) | |
7576 CASE(UIMSG_LoadSlot) | |
7577 CASE(UIMSG_SelectLoadSlot) | |
7578 CASE(UIMSG_Cancel) | |
7579 CASE(UIMSG_ExitRest) | |
7580 CASE(UIMSG_PlayerCreation_FacePrev) | |
7581 CASE(UIMSG_PlayerCreation_FaceNext) | |
7582 CASE(UIMSG_CycleCharacters) | |
7583 CASE(UIMSG_SetTurnSpeed) | |
7584 CASE(UIMSG_ToggleWalkSound) | |
7585 CASE(UIMSG_ChangeVoiceVolume) | |
7586 CASE(UIMSG_ToggleShowDamage) | |
7587 CASE(UIMSG_ScrollNPCPanel) | |
7588 CASE(UIMSG_ShowFinalWindow) | |
7589 CASE(UIMSG_OpenQuestBook) | |
7590 CASE(UIMSG_OpenAutonotes) | |
7591 CASE(UIMSG_OpenMapBook) | |
7592 CASE(UIMSG_OpenCalendar) | |
7593 CASE(UIMSG_OpenHistoryBook) | |
7594 CASE(UIMSG_ToggleAlwaysRun) | |
7595 CASE(UIMSG_ToggleFlipOnExit) | |
7596 CASE(UIMSG_Game_Action) | |
7597 CASE(UIMSG_OpenRestUI) | |
7598 CASE(UIMSG_TransitionUI_Confirm) | |
7599 CASE(UIMSG_OpenKeyMappingOptions) | |
7600 CASE(UIMSG_SelectKeyPage1) | |
7601 CASE(UIMSG_SelectKeyPage2) | |
7602 CASE(UIMSG_ResetKeyMapping) | |
7603 CASE(UIMSG_ChangeKeyButton) | |
7604 CASE(UIMSG_OpenVideoOptions) | |
7605 CASE(UIMSG_ToggleBloodsplats) | |
7606 CASE(UIMSG_ToggleColoredLights) | |
7607 CASE(UIMSG_ToggleTint) | |
7608 default: | |
7609 _swprintf(b, L"UIMSG_%03X", msg); return b; | |
7610 }; | |
7611 #undef CASE | |
7612 } | |
7613 | |
7614 | |
0 | 7615 //----- (0042EB8D) -------------------------------------------------------- |
437 | 7616 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |
0 | 7617 { |
482 | 7618 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); |
0 | 7619 if (uNumMessages < 40) |
7620 { | |
437 | 7621 files[uNumMessages] = file; |
7622 lines[uNumMessages] = line; | |
7623 | |
0 | 7624 pMessages[uNumMessages].eType = msg; |
7625 pMessages[uNumMessages].param = param; | |
7626 pMessages[uNumMessages++].field_8 = a4; | |
7627 } | |
7628 } | |
7629 | |
7630 //----- (0042EBBE) -------------------------------------------------------- | |
7631 int __fastcall sub_42EBBE(int a1, int a2) | |
7632 { | |
7633 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7634 } | |
7635 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7636 | |
7637 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 7638 int stru193_math::Sin(int angle) |
0 | 7639 { |
323 | 7640 return Cos(angle - this->uIntegerHalfPi); |
0 | 7641 } |
7642 | |
7643 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 7644 void _42ECB5_PlayerAttacksActor() |
0 | 7645 { |
271 | 7646 //unsigned int v0; // ebx@1 |
7647 //Player *v1; // esi@1 | |
7648 //bool result; // eax@1 | |
295 | 7649 //int v3; // edi@2 |
271 | 7650 //unsigned int v4; // eax@7 |
0 | 7651 char *v5; // eax@8 |
271 | 7652 //int v6; // ecx@9 |
7653 //signed int v7; // eax@16 | |
295 | 7654 //Actor *v8; // edi@20 |
0 | 7655 unsigned int v9; // ecx@21 |
295 | 7656 //char *v10; // eax@26 |
0 | 7657 char *v11; // eax@26 |
7658 unsigned int v12; // eax@47 | |
295 | 7659 //char *v13; // eax@47 |
7660 //char *v14; // eax@47 | |
7661 //unsigned int v15; // ebx@54 | |
7662 //int v16; // [sp-10h] [bp-4Ch]@24 | |
7663 //int v17; // [sp-10h] [bp-4Ch]@44 | |
7664 //unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7665 //unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7666 //__int16 v20; // [sp-8h] [bp-44h]@24 | |
7667 //__int16 v21; // [sp-8h] [bp-44h]@44 | |
7668 //int v22; // [sp-4h] [bp-40h]@24 | |
7669 //int v23; // [sp-4h] [bp-40h]@44 | |
0 | 7670 SoundID v24; // [sp-4h] [bp-40h]@58 |
295 | 7671 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 |
271 | 7672 //unsigned int a2; // [sp+18h] [bp-24h]@20 |
7673 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
295 | 7674 //int v28; // [sp+20h] [bp-1Ch]@9 |
271 | 7675 //unsigned int *v28b; |
295 | 7676 //int v29; // [sp+24h] [bp-18h]@16 |
7677 //int v30; // [sp+28h] [bp-14h]@16 | |
271 | 7678 //int v31; // [sp+2Ch] [bp-10h]@4 |
295 | 7679 //int v32; // [sp+30h] [bp-Ch]@7 |
271 | 7680 //int v33; // [sp+34h] [bp-8h]@7 |
295 | 7681 //int v34; // [sp+38h] [bp-4h]@17 |
0 | 7682 |
271 | 7683 //v0 = uActiveCharacter; |
7684 //v27 = 6972 * uActiveCharacter; | |
7685 //v1 = &pParty->pPlayers[uActiveCharacter-1]; | |
7686 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); | |
7687 auto player = &pParty->pPlayers[uActiveCharacter - 1]; | |
7688 if (!player->CanAct()) | |
7689 return; | |
7690 | |
7691 pStru277->_427D48(uActiveCharacter); | |
295 | 7692 //v3 = 0; |
271 | 7693 if (pParty->Invisible()) |
7694 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
7695 | |
7696 //v31 = player->pEquipment.uBow; | |
7697 int bow_idx = player->pEquipment.uBow; | |
7698 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) | |
7699 bow_idx = 0; | |
7700 | |
295 | 7701 //v32 = 0; |
7702 int wand_item_id = 0; | |
271 | 7703 //v33 = 0; |
7704 //v4 = v1->pEquipment.uMainHand; | |
7705 int laser_weapon_item_id = 0; | |
7706 | |
7707 int main_hand_idx = player->pEquipment.uMainHand; | |
7708 if (main_hand_idx) | |
0 | 7709 { |
271 | 7710 auto item = &player->pInventoryItems[main_hand_idx - 1]; |
112 | 7711 //v5 = (char *)v1 + 36 * v4; |
271 | 7712 if (!item->Broken()) |
7713 { | |
7714 //v28b = &v1->pInventoryItems[v4].uItemID; | |
7715 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
295 | 7716 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND) |
0 | 7717 { |
295 | 7718 if (item->uNumCharges <= 0) |
7719 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 7720 else |
295 | 7721 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 7722 } |
271 | 7723 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
7724 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 7725 } |
271 | 7726 } |
7727 | |
295 | 7728 //v30 = 0; |
7729 //v29 = 0; | |
7730 //v28 = 0; | |
271 | 7731 //v7 = pMouse->uPointingObjectID; |
7732 | |
7733 int target_pid = pMouse->uPointingObjectID; | |
7734 int target_type = target_pid & 7, | |
7735 target_id = target_pid >> 3; | |
7736 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) | |
7737 { | |
7738 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
7739 target_type = target_pid & 7; | |
7740 target_id = target_pid >> 3; | |
7741 } | |
295 | 7742 |
7743 auto actor = &pActors[target_id]; | |
7744 int actor_distance = 0; | |
271 | 7745 if (target_type == OBJECT_Actor) |
7746 { | |
295 | 7747 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
7748 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
7749 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
7750 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
7751 if (actor_distance < 0) | |
7752 actor_distance = 0; | |
7753 } | |
7754 | |
7755 bool shooting_bow = false, | |
7756 shotting_laser = false, | |
7757 shooting_wand = false; | |
7758 if (laser_weapon_item_id) | |
7759 { | |
7760 shotting_laser = true; | |
490 | 7761 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); |
295 | 7762 } |
7763 else if (wand_item_id) | |
7764 { | |
7765 shooting_wand = true; | |
7766 | |
7767 int main_hand_idx = player->pEquipment.uMainHand; | |
490 | 7768 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItems[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); |
295 | 7769 |
7770 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | |
7771 player->pEquipment.uMainHand = 0; | |
7772 } | |
303 | 7773 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 7774 { |
303 | 7775 Vec3_int_ a3; |
7776 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
7777 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
7778 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
7779 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
7780 | |
7781 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); | |
305 | 7782 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) |
295 | 7783 _42FA66_do_explosive_impact( |
7784 actor->vPosition.x, | |
7785 actor->vPosition.y, | |
7786 actor->vPosition.z + actor->uActorHeight / 2, | |
7787 0, 512, uActiveCharacter); | |
303 | 7788 } |
7789 else if (bow_idx) | |
7790 { | |
7791 shooting_bow = true; | |
490 | 7792 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0); |
295 | 7793 } |
7794 else | |
7795 { | |
303 | 7796 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
7797 } | |
7798 | |
7799 if (!pParty->bTurnBasedModeOn) | |
7800 { | |
7801 int recovery = player->GetAttackRecoveryTime(0); | |
7802 if (recovery < 30 ) | |
7803 recovery = 30; | |
7804 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); | |
295 | 7805 } |
7806 | |
7807 | |
7808 int v34 = 0; | |
7809 if (shooting_wand) | |
7810 return; | |
7811 else if (shooting_bow) | |
7812 { | |
7813 v34 = 5; | |
7814 player->PlaySound(SPEECH_50, 0); | |
7815 } | |
7816 if (shotting_laser) | |
7817 v34 = 7; | |
7818 else | |
7819 { | |
7820 int main_hand_idx = player->pEquipment.uMainHand; | |
7821 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) | |
7822 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType; | |
7823 pTurnEngine->_40471C(); | |
7824 } | |
7825 | |
7826 switch (v34) | |
7827 { | |
7828 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
7829 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
7830 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
7831 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
7832 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
7833 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
7834 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
7835 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
7836 } | |
0 | 7837 } |
7838 | |
7839 //----- (0042F184) -------------------------------------------------------- | |
295 | 7840 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 7841 { |
7842 int v4; // edi@1 | |
7843 stru319 *v5; // esi@1 | |
7844 int v6; // eax@2 | |
7845 int v7; // eax@4 | |
7846 int result; // eax@5 | |
7847 int *v9; // edx@8 | |
7848 signed int v10; // ebx@10 | |
7849 int v11; // edi@11 | |
7850 Actor *v12; // esi@12 | |
7851 unsigned __int16 v13; // ax@12 | |
7852 int v14; // eax@22 | |
7853 char v15; // zf@30 | |
7854 int v16; // esi@32 | |
7855 int v17; // ecx@34 | |
7856 stru319 *v18; // eax@39 | |
7857 int v19; // edx@39 | |
7858 int v20; // ecx@41 | |
7859 unsigned __int16 v21; // ax@42 | |
7860 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
7861 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
7862 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
7863 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
7864 int *v26; // [sp+18h] [bp-14h]@8 | |
7865 int v27; // [sp+1Ch] [bp-10h]@10 | |
7866 int *v28; // [sp+20h] [bp-Ch]@10 | |
7867 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
7868 int v30; // [sp+28h] [bp-4h]@6 | |
7869 int i; // [sp+38h] [bp+Ch]@33 | |
7870 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
7871 | |
7872 v4 = 0; | |
7873 v5 = this; | |
7874 v24 = this; | |
7875 if ( pRenderer->pRenderD3D ) | |
7876 { | |
7877 v6 = a3 != 0; | |
7878 if ( a4 ) | |
7879 LOBYTE(v6) = v6 | 8; | |
295 | 7880 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 7881 if ( v7 != -1 ) |
7882 return (unsigned __int16)v7; | |
295 | 7883 else return 0; |
0 | 7884 } |
7885 else | |
7886 { | |
7887 v30 = 0; | |
7888 if ( pRenderer->pActiveZBuffer ) | |
7889 { | |
7890 v29 = viewparams->uScreenX; | |
7891 v23 = viewparams->uScreenZ; | |
7892 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
7893 { | |
7894 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
7895 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
7896 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
7897 do | |
7898 { | |
7899 if ( (signed int)v29 < (signed int)v23 ) | |
7900 { | |
7901 v28 = v9; | |
7902 v10 = v4; | |
7903 v27 = v23 - v29; | |
7904 do | |
7905 { | |
7906 v22 = *v28; | |
7907 v11 = *v28 & 0xFFFF; | |
141 | 7908 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 7909 { |
7910 v12 = &pActors[(unsigned int)v11 >> 3]; | |
7911 v13 = v12->uAIState; | |
7912 if ( v13 != 5 ) | |
7913 { | |
7914 if ( v13 != 4 | |
7915 && v13 != 11 | |
7916 && v13 != 19 | |
7917 && v13 != 17 | |
7918 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
7919 { | |
7920 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
295 | 7921 && v22 <= pick_depth << 16 ) |
0 | 7922 { |
7923 v14 = 0; | |
7924 if ( v10 > 0 ) | |
7925 { | |
7926 do | |
7927 { | |
7928 if ( dword_50BDA0[v14] == v11 ) | |
7929 break; | |
7930 ++v14; | |
7931 } | |
7932 while ( v14 < v30 ); | |
7933 } | |
7934 if ( v14 == v30 && v10 < 100 ) | |
7935 { | |
7936 ++v30; | |
7937 dword_50BC10[v10] = v22; | |
7938 dword_50BDA0[v10] = v11; | |
7939 ++v10; | |
7940 } | |
7941 } | |
7942 } | |
7943 } | |
7944 } | |
7945 ++v28; | |
7946 --v27; | |
7947 } | |
7948 while ( v27 ); | |
7949 v4 = v30; | |
7950 v5 = v24; | |
7951 } | |
7952 v9 = v26 + 640; | |
7953 v15 = v25-- == 1; | |
7954 v26 += 640; | |
7955 } | |
7956 while ( !v15 ); | |
7957 } | |
7958 if ( v4 > 0 ) | |
7959 { | |
7960 v32 = 1; | |
7961 v16 = (int)dword_50BC10; | |
7962 do | |
7963 { | |
7964 for ( i = v32; i < v4; ++i ) | |
7965 { | |
7966 v17 = dword_50BC10[i]; | |
7967 if ( v17 < *(int *)v16 ) | |
7968 { | |
7969 dword_50BC10[i] = *(int *)v16; | |
7970 *(int *)v16 = v17; | |
7971 } | |
7972 } | |
7973 ++v32; | |
7974 v16 += 4; | |
7975 } | |
7976 while ( v32 - 1 < v4 ); | |
7977 v5 = v24; | |
7978 if ( v4 > 0 ) | |
7979 { | |
7980 v18 = v24; | |
7981 v19 = v4; | |
7982 do | |
7983 { | |
7984 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
7985 v18 += 4; | |
7986 --v19; | |
7987 } | |
7988 while ( v19 ); | |
7989 } | |
7990 } | |
7991 v20 = 0; | |
7992 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
7993 { | |
7994 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
7995 if ( v21 != 4 && v21 != 5 ) | |
7996 break; | |
7997 } | |
7998 if ( v20 != v4 ) | |
7999 { | |
8000 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8001 LOBYTE(result) = result | 3; | |
8002 return result; | |
8003 } | |
8004 } | |
8005 } | |
8006 return 0; | |
8007 } | |
8008 | |
8009 | |
8010 //----- (0042F3D6) -------------------------------------------------------- | |
8011 void InitializeTurnBasedAnimations(void *_this) | |
8012 { | |
8013 unsigned int *v1; // edi@1 | |
8014 | |
8015 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8016 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8017 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8018 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8019 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8020 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8021 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8022 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8023 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8024 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8025 v1 = pIconIDs_Turn; | |
8026 do | |
8027 { | |
8028 pIconsFrameTable->InitializeAnimation(*v1); | |
8029 ++v1; | |
8030 } | |
8031 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8032 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8033 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8034 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8035 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8036 } | |
8037 | |
8038 //----- (0042F4DA) -------------------------------------------------------- | |
8039 signed int __cdecl sub_42F4DA() | |
8040 { | |
8041 signed int v0; // edi@1 | |
82 | 8042 Actor *v1; // esi@4 |
0 | 8043 int v2; // ebx@5 |
8044 int v3; // eax@5 | |
8045 int v4; // ebx@5 | |
8046 unsigned int v5; // ecx@5 | |
8047 int v6; // edx@6 | |
8048 unsigned int v7; // edx@8 | |
8049 unsigned int v8; // edx@10 | |
8050 __int16 v9; // ax@12 | |
8051 signed int result; // eax@20 | |
8052 int v11; // [sp+Ch] [bp-10h]@5 | |
8053 int v12; // [sp+10h] [bp-Ch]@5 | |
8054 signed int v13; // [sp+14h] [bp-8h]@3 | |
8055 | |
8056 v0 = 5120; | |
8057 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8058 v0 = 2560; | |
8059 v13 = 0; | |
8060 if ( (signed int)uNumActors <= 0 ) | |
8061 { | |
8062 LABEL_20: | |
8063 result = 0; | |
8064 } | |
8065 else | |
8066 { | |
82 | 8067 v1 = pActors; |
0 | 8068 while ( 1 ) |
8069 { | |
82 | 8070 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8071 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8072 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8073 v3 = v2; |
8074 v4 = v11; | |
8075 v5 = v12; | |
8076 if ( v3 < v11 ) | |
8077 { | |
8078 v6 = v3; | |
8079 v3 = v11; | |
8080 v4 = v6; | |
8081 } | |
8082 if ( v3 < v12 ) | |
8083 { | |
8084 v7 = v3; | |
8085 v3 = v12; | |
8086 v5 = v7; | |
8087 } | |
8088 if ( v4 < (signed int)v5 ) | |
8089 { | |
8090 v8 = v5; | |
8091 v5 = v4; | |
8092 v4 = v8; | |
8093 } | |
8094 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8095 { | |
82 | 8096 v9 = v1->uAIState; |
8097 if ( v1->uAIState != 5 ) | |
0 | 8098 { |
8099 if ( v9 != 4 | |
8100 && v9 != 11 | |
8101 && v9 != 19 | |
8102 && v9 != 17 | |
82 | 8103 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8104 break; |
8105 } | |
8106 } | |
8107 ++v13; | |
82 | 8108 ++v1; |
0 | 8109 if ( v13 >= (signed int)uNumActors ) |
8110 goto LABEL_20; | |
8111 } | |
8112 result = 1; | |
8113 } | |
8114 return result; | |
8115 } | |
8116 | |
8117 //----- (0042F5ED) -------------------------------------------------------- | |
8118 int LayingItem::Create(int yaw, int pitch, int a4, int a5) | |
8119 { | |
8120 LayingItem *v5; // eax@1 | |
8121 signed int v6; // ebx@2 | |
8122 char *v7; // ecx@2 | |
8123 signed int result; // eax@6 | |
8124 LayingItem *v9; // ebx@7 | |
8125 int v10; // edx@11 | |
8126 int v11; // edi@18 | |
8127 __int16 v12; // ax@18 | |
8128 int v13; // ST2C_4@20 | |
8129 int v14; // eax@20 | |
8130 int v15; // [sp-28h] [bp-38h]@14 | |
8131 int v16; // [sp-24h] [bp-34h]@11 | |
8132 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 | |
8133 int *v18; // [sp-14h] [bp-24h]@11 | |
8134 int *v19; // [sp-10h] [bp-20h]@11 | |
8135 int *v20; // [sp-Ch] [bp-1Ch]@11 | |
8136 signed int v21; // [sp+8h] [bp-8h]@2 | |
8137 int angle; // [sp+Ch] [bp-4h]@1 | |
8138 int a4a; // [sp+1Ch] [bp+Ch]@20 | |
8139 int a4b; // [sp+1Ch] [bp+Ch]@20 | |
8140 int a5a; // [sp+20h] [bp+10h]@20 | |
8141 | |
8142 auto a1 = this; | |
8143 angle = yaw; | |
8144 v5 = a1; | |
8145 if ( !a1->uObjectDescID ) | |
8146 return -1; | |
8147 v6 = 0; | |
8148 v7 = (char *)&pLayingItems[0].uObjectDescID; | |
8149 v21 = 0; | |
8150 do | |
8151 { | |
8152 if ( !*(short *)v7 ) | |
8153 break; | |
8154 v7 += 112; | |
8155 ++v6; | |
8156 v21 = v6; | |
8157 } | |
8158 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) ); | |
8159 if ( v6 >= 1000 ) | |
8160 return -1; | |
8161 *(int *)&v5->field_62[2] = v5->vPosition.x; | |
8162 *(int *)&v5->field_62[6] = v5->vPosition.y; | |
8163 v9 = &pLayingItems[v6]; | |
8164 *(int *)&v5->field_62[10] = v5->vPosition.z; | |
8165 memcpy(v9, v5, 0x70u); | |
8166 if ( a5 == 1 ) | |
8167 { | |
8168 v20 = &v9->vPosition.z; | |
8169 v19 = &v9->vPosition.y; | |
8170 v18 = (int *)&v9->vPosition; | |
8171 v17.z = v5->vPosition.z; | |
8172 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8173 v16 = 0; | |
8174 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8175 goto LABEL_16; | |
8176 } | |
8177 if ( a5 == 2 ) | |
8178 { | |
8179 v20 = &v9->vPosition.z; | |
8180 v19 = &v9->vPosition.y; | |
8181 v18 = (int *)&v9->vPosition; | |
8182 v17.z = v5->vPosition.z; | |
8183 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8184 v16 = 0; | |
8185 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing; | |
8186 goto LABEL_14; | |
8187 } | |
8188 if ( a5 == 3 ) | |
8189 { | |
8190 v20 = &v9->vPosition.z; | |
8191 v19 = &v9->vPosition.y; | |
8192 v18 = (int *)&v9->vPosition; | |
8193 v17.z = v5->vPosition.z; | |
8194 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8195 v16 = 0; | |
8196 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8197 LABEL_14: | |
8198 v15 = 8; | |
8199 LABEL_17: | |
8200 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20); | |
8201 goto LABEL_18; | |
8202 } | |
8203 if ( a5 == 4 ) | |
8204 { | |
8205 v20 = &v9->vPosition.z; | |
8206 v19 = &v9->vPosition.y; | |
8207 v18 = (int *)&v9->vPosition; | |
8208 v17.z = v5->vPosition.z; | |
8209 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x; | |
8210 v16 = 0; | |
8211 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi; | |
8212 LABEL_16: | |
8213 v15 = 24; | |
8214 goto LABEL_17; | |
8215 } | |
8216 LABEL_18: | |
8217 v11 = a4; | |
8218 v12 = 0; | |
8219 if ( a4 ) | |
8220 { | |
323 | 8221 a4a = stru_5C6E00->Cos(angle); |
8222 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8223 a4b = stru_5C6E00->Sin(angle); | |
8224 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
8225 v14 = stru_5C6E00->Sin(pitch); | |
0 | 8226 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16; |
8227 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16; | |
8228 v12 = (unsigned int)(v14 * v11) >> 16; | |
8229 } | |
8230 else | |
8231 { | |
8232 v9->vVelocity.y = 0; | |
8233 v9->vVelocity.x = 0; | |
8234 } | |
8235 v9->vVelocity.z = v12; | |
8236 result = v21; | |
8237 if ( v21 >= (signed int)uNumLayingItems ) | |
8238 uNumLayingItems = v21 + 1; | |
8239 return result; | |
8240 } | |
8241 | |
8242 //----- (0042F7EB) -------------------------------------------------------- | |
8243 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) | |
8244 { | |
8245 unsigned int v9; // edi@1 | |
8246 signed int v10; // edx@3 | |
8247 char *v11; // ecx@4 | |
8248 unsigned __int16 v12; // ax@7 | |
8249 unsigned int v13; // edx@9 | |
8250 char *v14; // ecx@10 | |
8251 int v15; // esi@17 | |
8252 int v16; // eax@18 | |
8253 int v17; // edi@20 | |
8254 int v18; // esi@20 | |
8255 //LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8256 int v21; // [sp+7Ch] [bp-8h]@1 | |
8257 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8258 | |
8259 v9 = uSpriteID; | |
8260 v21 = x; | |
8261 v22 = uSpriteID; | |
8262 | |
8263 LayingItem a1a; // [sp+Ch] [bp-78h]@1 | |
8264 //LayingItem::LayingItem(&a1a); | |
8265 a1a.stru_24.Reset(); | |
8266 | |
8267 if ( a9 ) | |
8268 { | |
8269 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8270 v9 = v22; | |
8271 } | |
8272 v10 = 0; | |
8273 a1a.field_50 = 0; | |
8274 a1a.field_4C = 0; | |
8275 a1a.field_48 = 0; | |
8276 a1a.field_54 = 0; | |
8277 a1a.uItemType = v9; | |
8278 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8279 { | |
8280 LABEL_7: | |
8281 v12 = 0; | |
8282 } | |
8283 else | |
8284 { | |
8285 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8286 while ( (short)v9 != *(short *)v11 ) | |
8287 { | |
8288 ++v10; | |
8289 v11 += 56; | |
8290 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8291 goto LABEL_7; | |
8292 } | |
8293 v12 = v10; | |
8294 } | |
8295 a1a.uObjectDescID = v12; | |
8296 a1a.vPosition.z = z; | |
8297 a1a.vPosition.x = v21; | |
8298 a1a.vPosition.y = y; | |
8299 a1a.uSoundID = 0; | |
8300 a1a.uAttributes = attributes; | |
8301 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8302 a1a.uSpriteFrameID = 0; | |
303 | 8303 a1a.field_58_pid = 0; |
0 | 8304 a1a.field_5C = 0; |
8305 if ( !(a1a.uAttributes & 0x10) ) | |
8306 { | |
8307 v13 = 0; | |
222 | 8308 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
0 | 8309 { |
8310 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8311 while ( *(short *)v14 != v9 ) | |
8312 { | |
8313 ++v13; | |
8314 v14 += 48; | |
222 | 8315 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount ) |
0 | 8316 goto LABEL_16; |
8317 } | |
8318 a1a.stru_24.uItemID = v13; | |
8319 } | |
8320 } | |
8321 LABEL_16: | |
8322 if ( a7 ) | |
8323 { | |
8324 v15 = count; | |
8325 if ( count > 0 ) | |
8326 { | |
8327 do | |
8328 { | |
8329 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8330 v16 = rand(); | |
8331 a1a.Create( | |
8332 (signed __int16)a1a.uFacing, | |
8333 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8334 a4, | |
8335 0); | |
8336 --v15; | |
8337 } | |
8338 while ( v15 ); | |
8339 } | |
8340 } | |
8341 else | |
8342 { | |
8343 v17 = count; | |
8344 v18 = stru_5C6E00->uIntegerHalfPi; | |
8345 a1a.uFacing = 0; | |
8346 if ( count > 0 ) | |
8347 { | |
8348 do | |
8349 { | |
8350 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8351 --v17; | |
8352 } | |
8353 while ( v17 ); | |
8354 } | |
8355 } | |
8356 return 1; | |
8357 } | |
8358 | |
8359 //----- (0042F960) -------------------------------------------------------- | |
8360 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8361 { | |
8362 int v3; // ebx@1 | |
8363 int v4; // edi@1 | |
8364 signed int v5; // edx@1 | |
8365 char *v6; // ecx@2 | |
8366 unsigned __int16 v7; // ax@5 | |
8367 signed int v8; // eax@6 | |
8368 signed int v9; // eax@7 | |
8369 //LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8370 | |
8371 v3 = x; | |
8372 v4 = y; | |
8373 | |
8374 LayingItem a1; // [sp+Ch] [bp-70h]@1 | |
8375 //LayingItem::LayingItem(&a1); | |
8376 a1.stru_24.Reset(); | |
8377 | |
8378 v5 = 0; | |
8379 a1.field_50 = 0; | |
8380 a1.field_4C = 0; | |
8381 a1.field_48 = 0; | |
8382 a1.field_54 = 0; | |
8383 a1.uItemType = 800; | |
8384 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8385 { | |
8386 LABEL_5: | |
8387 v7 = 0; | |
8388 } | |
8389 else | |
8390 { | |
8391 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8392 while ( *(short *)v6 != 800 ) | |
8393 { | |
8394 ++v5; | |
8395 v6 += 56; | |
8396 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8397 goto LABEL_5; | |
8398 } | |
8399 v7 = v5; | |
8400 } | |
8401 a1.uObjectDescID = v7; | |
8402 a1.vPosition.x = v3; | |
8403 a1.vPosition.y = v4; | |
8404 a1.vPosition.z = z; | |
8405 a1.uSoundID = 0; | |
8406 a1.uAttributes = 0; | |
8407 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8408 a1.uSpriteFrameID = 0; | |
303 | 8409 a1.field_58_pid = 0; |
0 | 8410 a1.field_5C = 0; |
8411 v8 = a1.Create(0, 0, 0, 0); | |
8412 if ( v8 != -1 ) | |
8413 { | |
8414 v9 = 8 * v8; | |
8415 LOBYTE(v9) = v9 | 2; | |
8416 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8417 } | |
8418 } | |
8419 | |
8420 //----- (0042FA22) -------------------------------------------------------- | |
79 | 8421 LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8422 { |
8423 size_t v0; // edx@1 | |
8424 int v1; // ebp@1 | |
79 | 8425 LayingItem *result; // eax@1 |
8426 LayingItem *v3; // ebx@1 | |
0 | 8427 |
8428 v0 = 0; | |
8429 v1 = 0; | |
79 | 8430 //result = (char *)&pLayingItems[0].uObjectDescID; |
8431 result = pLayingItems; | |
0 | 8432 v3 = pLayingItems; |
8433 do | |
8434 { | |
79 | 8435 if ( result->uObjectDescID ) |
0 | 8436 { |
8437 if ( v1 != v0 ) | |
8438 { | |
79 | 8439 memcpy(v3, result, 0x70u); |
8440 result->uObjectDescID = 0; | |
0 | 8441 } |
8442 ++v0; | |
79 | 8443 ++v3;// = (char *)v3 + 112; |
0 | 8444 } |
79 | 8445 ++result;// += 112; |
0 | 8446 ++v1; |
8447 } | |
79 | 8448 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); |
8449 while( result <= &pLayingItems[999] ); | |
0 | 8450 uNumLayingItems = v0; |
8451 return result; | |
8452 } | |
8453 | |
8454 //----- (0042FA66) -------------------------------------------------------- | |
8455 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8456 { | |
8457 int v6; // edi@1 | |
8458 int v7; // esi@1 | |
8459 char *v8; // ecx@2 | |
8460 unsigned __int16 v9; // ax@5 | |
8461 int v10; // eax@10 | |
8462 signed int result; // eax@11 | |
8463 __int16 v12; // ax@12 | |
8464 //LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8465 int v14; // [sp+7Ch] [bp-4h]@1 | |
8466 | |
8467 v6 = a1; | |
8468 v7 = a2; | |
8469 LayingItem a1a; // [sp+Ch] [bp-74h]@1 | |
8470 //LayingItem::LayingItem(&a1a); | |
8471 a1a.uItemType = 600; | |
8472 a1a.stru_24.Reset(); | |
8473 | |
8474 a1a.field_48 = 6; | |
8475 a1a.field_4C = 8; | |
8476 a1a.field_50 = 3; | |
8477 v14 = 0; | |
8478 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8479 { | |
8480 LABEL_5: | |
8481 v9 = 0; | |
8482 } | |
8483 else | |
8484 { | |
8485 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
8486 while ( (short)a1a.uItemType != *(short *)v8 ) | |
8487 { | |
8488 ++v14; | |
8489 v8 += 56; | |
8490 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8491 goto LABEL_5; | |
8492 } | |
8493 v9 = v14; | |
8494 } | |
8495 a1a.uObjectDescID = v9; | |
8496 a1a.vPosition.x = v6; | |
8497 a1a.vPosition.y = v7; | |
8498 a1a.vPosition.z = a3; | |
8499 a1a.uAttributes = 0; | |
8500 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8501 a1a.uSpriteFrameID = 0; | |
8502 a1a.field_5C = 0; | |
8503 a1a.field_60_distance_related_prolly_lod = 0; | |
8504 a1a.uFacing = 0; | |
8505 a1a.uSoundID = 0; | |
8506 if ( a6 >= 1 || a6 <= 4 ) | |
8507 { | |
8508 v10 = 8 * a6 - 8; | |
303 | 8509 LOBYTE(v10) = v10 | OBJECT_Player; |
8510 a1a.field_58_pid = v10; | |
0 | 8511 } |
8512 else | |
8513 { | |
303 | 8514 a1a.field_58_pid = 0; |
0 | 8515 } |
8516 result = a1a.Create(0, 0, 0, 0); | |
8517 if ( result != -1 ) | |
8518 { | |
8519 v12 = 8 * result; | |
8520 LOBYTE(v12) = v12 | 2; | |
8521 result = stru_50FE08.Add( | |
8522 v12, | |
8523 a5, | |
8524 SLOWORD(a1a.vPosition.x), | |
8525 SLOWORD(a1a.vPosition.y), | |
8526 SLOWORD(a1a.vPosition.z), | |
8527 0, | |
8528 0); | |
8529 } | |
8530 return result; | |
8531 } | |
8532 | |
8533 | |
8534 | |
8535 //----- (0042FB5C) -------------------------------------------------------- | |
8536 bool __fastcall sub_42FB5C(signed int a1) | |
8537 { | |
8538 int v1; // ecx@3 | |
8539 int v2; // ecx@4 | |
8540 int v3; // ecx@5 | |
8541 int v4; // ecx@6 | |
8542 int v5; // ecx@7 | |
8543 int v6; // ecx@8 | |
8544 char v7; // zf@9 | |
8545 | |
8546 if ( a1 > 39 ) | |
8547 { | |
8548 if ( a1 > 77 ) | |
8549 { | |
8550 if ( a1 == 80 ) | |
8551 return 0; | |
8552 if ( a1 > 84 ) | |
8553 { | |
8554 if ( a1 <= 86 ) | |
8555 return 0; | |
8556 v7 = a1 == 95; | |
8557 goto LABEL_20; | |
8558 } | |
8559 } | |
8560 else | |
8561 { | |
8562 if ( a1 == 77 ) | |
8563 return 0; | |
8564 if ( a1 >= 46 ) | |
8565 { | |
8566 if ( a1 <= 47 || a1 == 51 ) | |
8567 return 0; | |
8568 v7 = a1 == 73; | |
8569 goto LABEL_20; | |
8570 } | |
8571 } | |
8572 return 1; | |
8573 } | |
8574 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8575 return 1; | |
8576 v2 = v1 - 3; | |
8577 if ( !v2 ) | |
8578 return 0; | |
8579 v3 = v2 - 1; | |
8580 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8581 return 1; | |
8582 v5 = v4 - 8; | |
8583 if ( !v5 ) | |
8584 return 0; | |
8585 v6 = v5 - 1; | |
8586 if ( !v6 ) | |
8587 return 1; | |
8588 v7 = v6 == 20; | |
8589 LABEL_20: | |
8590 if ( !v7 ) | |
8591 return 1; | |
8592 return 0; | |
8593 } | |
8594 | |
8595 //----- (0042FBDD) -------------------------------------------------------- | |
8596 void __cdecl sub_42FBDD() | |
8597 { | |
388 | 8598 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 8599 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
8600 pRenderer->Present(); | |
8601 } | |
8602 | |
8603 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8604 void __cdecl CloseWindowBackground() |
0 | 8605 { |
388 | 8606 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 8607 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
8608 pRenderer->Present(); | |
8609 } | |
8610 | |
8611 //----- (0042FC4E) -------------------------------------------------------- | |
8612 void __cdecl ProcessInputActions() | |
8613 { | |
8614 ActionQueue *pActionQueue; // esi@7 | |
8615 Keyboard *v3; // ecx@8 | |
8616 char v4; // al@9 | |
8617 ActionQueue *v5; // ecx@19 | |
8618 Player *v6; // ecx@86 | |
8619 Player *v7; // esi@100 | |
8620 char v8; // bl@100 | |
8621 unsigned __int16 v9; // ax@102 | |
8622 int v10; // eax@103 | |
8623 unsigned int v11; // eax@127 | |
8624 signed int v12; // esi@157 | |
8625 Keyboard *v13; // ecx@158 | |
8626 char v14; // al@159 | |
8627 unsigned int v15; // eax@168 | |
8628 void *v16; // esi@177 | |
8629 int v17; // [sp-14h] [bp-1Ch]@8 | |
8630 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8631 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
271 | 8632 //__int16 v20; // [sp-14h] [bp-1Ch]@60 |
0 | 8633 int v21; // [sp-14h] [bp-1Ch]@68 |
8634 int v22; // [sp-Ch] [bp-14h]@158 | |
8635 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8636 int v24; // [sp+4h] [bp-4h]@87 | |
8637 | |
8638 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8639 auto pKeyboard = pGame->pKeyboardInstance; | |
8640 if (!bAlwaysRun) | |
8641 { | |
8642 if (pKeyboard->IsShiftHeld()) | |
8643 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8644 else | |
8645 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8646 } | |
8647 else | |
8648 { | |
8649 if (pKeyboard->IsShiftHeld()) | |
8650 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8651 else | |
8652 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8653 } | |
8654 | |
140 | 8655 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
486 | 8656 //LABEL_6: |
0 | 8657 if ( !pEventTimer->bPaused ) |
8658 { | |
8659 inputAction = (InputAction)0; | |
8660 pActionQueue = pPartyActionQueue; | |
8661 while ( 1 ) | |
8662 { | |
8663 v3 = pGame->pKeyboardInstance; | |
8664 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8665 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8666 v4 = v3->WasKeyPressed(v17); | |
8667 else | |
8668 v4 = v3->IsKeyBeingHeld(v17); | |
8669 if ( v4 ) | |
8670 { | |
8671 switch ( inputAction ) | |
8672 { | |
8673 case INPUT_MoveForward: | |
271 | 8674 if (pCurrentScreen != SCREEN_GAME) |
0 | 8675 break; |
8676 if (!pParty->bTurnBasedModeOn) | |
163 | 8677 //goto _do_move_forward; |
0 | 8678 { |
8679 v5 = pActionQueue; | |
140 | 8680 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8681 partyAction = PARTY_RunForward; |
8682 else | |
8683 partyAction = PARTY_WalkForward; | |
163 | 8684 //goto _add_action_and_continue; |
8685 v5->Add(partyAction); | |
8686 break; | |
8687 } | |
8688 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8689 { | |
8690 pTurnEngine->uActionPointsLeft -= 26; | |
8691 //_do_move_forward: | |
8692 v5 = pActionQueue; | |
8693 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8694 partyAction = PARTY_RunForward; | |
8695 else | |
8696 partyAction = PARTY_WalkForward; | |
8697 //goto _add_action_and_continue; | |
8698 v5->Add(partyAction); | |
8699 break; | |
0 | 8700 } |
8701 break; | |
8702 case INPUT_MoveBackwards: | |
17 | 8703 //__debugbreak(); |
271 | 8704 if (pCurrentScreen != SCREEN_GAME) |
0 | 8705 break; |
8706 if (!pParty->bTurnBasedModeOn) | |
17 | 8707 //goto _do_move_backwards; |
8708 { | |
8709 v5 = pActionQueue; | |
8710 if ( pParty->uFlags2 & 2 ) | |
8711 partyAction = PARTY_RunBackward; | |
8712 else | |
8713 partyAction = PARTY_WalkBackward; | |
163 | 8714 //goto _add_action_and_continue; |
8715 v5->Add(partyAction); | |
8716 break; | |
17 | 8717 } |
0 | 8718 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8719 { | |
8720 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8721 //_do_move_backwards: |
0 | 8722 v5 = pActionQueue; |
8723 if ( pParty->uFlags2 & 2 ) | |
8724 partyAction = PARTY_RunBackward; | |
8725 else | |
8726 partyAction = PARTY_WalkBackward; | |
163 | 8727 //goto _add_action_and_continue; |
8728 v5->Add(partyAction); | |
8729 break; | |
0 | 8730 } |
8731 break; | |
8732 case INPUT_StrafeLeft: | |
17 | 8733 //__debugbreak(); |
271 | 8734 if (pCurrentScreen != SCREEN_GAME) |
0 | 8735 break; |
8736 if (!pParty->bTurnBasedModeOn) | |
17 | 8737 //goto _do_strafe_left; |
8738 { | |
8739 partyAction = PARTY_StrafeLeft; | |
163 | 8740 //goto _add_action_and_continue_; |
8741 v5 = pActionQueue; | |
8742 v5->Add(partyAction); | |
8743 break; | |
17 | 8744 } |
0 | 8745 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8746 break; | |
8747 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8748 //_do_strafe_left: |
0 | 8749 partyAction = PARTY_StrafeLeft; |
163 | 8750 //goto _add_action_and_continue_; |
8751 v5 = pActionQueue; | |
8752 v5->Add(partyAction); | |
8753 break; | |
0 | 8754 case INPUT_StrafeRight: |
17 | 8755 //__debugbreak(); |
271 | 8756 if (pCurrentScreen != SCREEN_GAME) |
0 | 8757 break; |
8758 if (!pParty->bTurnBasedModeOn) | |
17 | 8759 //goto _do_strafe_right; |
8760 { | |
8761 partyAction = PARTY_StrafeRight; | |
163 | 8762 //goto _add_action_and_continue_; |
8763 v5 = pActionQueue; | |
8764 v5->Add(partyAction); | |
8765 break; | |
17 | 8766 } |
0 | 8767 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8768 break; | |
8769 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8770 //_do_strafe_right: |
0 | 8771 partyAction = PARTY_StrafeRight; |
163 | 8772 //goto _add_action_and_continue_; |
8773 v5 = pActionQueue; | |
8774 v5->Add(partyAction); | |
8775 break; | |
0 | 8776 case INPUT_TurnLeft: |
271 | 8777 if (pCurrentScreen != SCREEN_GAME) |
0 | 8778 break; |
8779 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
8780 { | |
8781 if (pParty->bTurnBasedModeOn) | |
8782 { | |
8783 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8784 break; | |
8785 pTurnEngine->uActionPointsLeft -= 26; | |
8786 } | |
8787 partyAction_ = PARTY_StrafeLeft; | |
8788 } | |
8789 else | |
8790 { | |
8791 if ( pParty->uFlags2 & 2 ) | |
8792 partyAction_ = PARTY_FastTurnLeft; | |
8793 else | |
8794 partyAction_ = PARTY_TurnLeft; | |
8795 } | |
8796 pActionQueue->Add(partyAction_); | |
8797 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8798 { | |
271 | 8799 pWeather->OnPlayerTurn(10); |
0 | 8800 } |
8801 break; | |
8802 case INPUT_TurnRight: | |
271 | 8803 if (pCurrentScreen != SCREEN_GAME) |
0 | 8804 break; |
8805 if ( GetAsyncKeyState(17) ) // strafing | |
8806 { | |
8807 if (pParty->bTurnBasedModeOn) | |
8808 { | |
8809 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8810 break; | |
8811 pTurnEngine->uActionPointsLeft -= 26; | |
8812 } | |
271 | 8813 v21 = PARTY_StrafeRight; |
0 | 8814 } |
8815 else | |
8816 { | |
8817 if ( pParty->uFlags2 & 2 ) | |
271 | 8818 v21 = PARTY_FastTurnRight; |
0 | 8819 else |
271 | 8820 v21 = PARTY_TurnRight; |
0 | 8821 } |
8822 pActionQueue->Add((PartyAction)v21); | |
8823 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8824 { | |
271 | 8825 pWeather->OnPlayerTurn(-10); |
0 | 8826 } |
8827 break; | |
8828 case INPUT_Jump: | |
17 | 8829 //__debugbreak(); |
271 | 8830 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 8831 break; |
8832 partyAction = (PartyAction)12; | |
163 | 8833 //goto _add_action_and_continue_; |
8834 v5 = pActionQueue; | |
8835 v5->Add(partyAction); | |
8836 break; | |
0 | 8837 case INPUT_Yell: |
187 | 8838 if (!pCurrentScreen && uActiveCharacter) |
0 | 8839 { |
8840 pParty->Yell(); | |
187 | 8841 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 8842 } |
187 | 8843 break; |
0 | 8844 case INPUT_Pass: |
17 | 8845 //__debugbreak(); |
0 | 8846 if ( pCurrentScreen ) |
8847 break; | |
8848 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 8849 //goto LABEL_118; |
8850 { | |
8851 pTurnEngine->field_18 |= 8u; | |
8852 break; | |
8853 } | |
0 | 8854 if ( uActiveCharacter ) |
8855 { | |
8856 v6 = pPlayers[uActiveCharacter]; | |
8857 if ( !v6->uTimeToRecovery ) | |
8858 { | |
8859 v24 = v6->GetAttackRecoveryTime(0); | |
8860 if ( !pParty->bTurnBasedModeOn ) | |
8861 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
8862 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
8863 pStru277->_427D48(uActiveCharacter); | |
8864 pTurnEngine->_40471C(); | |
8865 } | |
8866 } | |
8867 break; | |
8868 case INPUT_Combat: | |
17 | 8869 //__debugbreak(); |
271 | 8870 if (pCurrentScreen == SCREEN_GAME) |
0 | 8871 { |
8872 if (pParty->bTurnBasedModeOn) | |
8873 { | |
141 | 8874 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 8875 { |
8876 pParty->bTurnBasedModeOn = 0; | |
8877 pTurnEngine->End(true); | |
8878 } | |
8879 } | |
8880 else | |
8881 { | |
8882 pTurnEngine->Start(); | |
8883 pParty->bTurnBasedModeOn = true; | |
8884 } | |
8885 } | |
8886 break; | |
8887 case INPUT_CastReady: | |
17 | 8888 //__debugbreak(); |
271 | 8889 if (pCurrentScreen != SCREEN_GAME) |
0 | 8890 break; |
8891 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 8892 //goto LABEL_118; |
8893 { | |
8894 pTurnEngine->field_18 |= 8u; | |
8895 break; | |
8896 } | |
0 | 8897 if ( !uActiveCharacter ) |
8898 break; | |
8899 v7 = pPlayers[uActiveCharacter]; | |
8900 v8 = v7->uQuickSpell; | |
8901 if ( !v8 | |
8902 || bUnderwater | |
8903 || ((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)), | |
8904 v10 > v7->sMana) ) | |
8905 { | |
8906 pActionQueue = pPartyActionQueue; | |
8907 LABEL_120: | |
437 | 8908 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); |
8909 break; | |
8910 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 8911 { |
271 | 8912 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; |
163 | 8913 //goto _send_message; |
8914 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8915 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8916 ++pMessageQueue_50CBD0->uNumMessages; | |
8917 break; | |
437 | 8918 }*/ |
0 | 8919 } |
8920 else | |
8921 { | |
8922 pActionQueue = pPartyActionQueue; | |
8923 if ( dword_50C9E8 < 40 ) | |
8924 { | |
8925 dword_50C9EC[3 * dword_50C9E8] = 25; | |
437 | 8926 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8927 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 8928 ++dword_50C9E8; |
8929 } | |
8930 } | |
8931 break; | |
8932 case INPUT_Attack: | |
17 | 8933 //__debugbreak(); |
271 | 8934 if (pCurrentScreen != SCREEN_GAME) |
0 | 8935 break; |
8936 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
8937 goto LABEL_120; | |
17 | 8938 //LABEL_118: |
0 | 8939 pTurnEngine->field_18 |= 8u; |
8940 break; | |
8941 case INPUT_EventTrigger: | |
271 | 8942 if (pCurrentScreen == SCREEN_GAME) |
0 | 8943 { |
437 | 8944 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 8945 break; |
271 | 8946 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action; |
163 | 8947 //goto _send_message; |
8948 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8949 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8950 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 8951 break;*/ |
8952 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
163 | 8953 break; |
0 | 8954 } |
151 | 8955 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 8956 { |
8957 v11 = pMessageQueue_50CBD0->uNumMessages; | |
8958 if ( pMessageQueue_50CBD0->uNumMessages ) | |
8959 { | |
437 | 8960 v11 = 0; |
8961 pMessageQueue_50CBD0->uNumMessages = 0; | |
0 | 8962 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
8963 { | |
8964 v11 = 1; | |
8965 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 8966 //LABEL_132: |
271 | 8967 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 8968 //_send_message: |
0 | 8969 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
8970 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8971 ++pMessageQueue_50CBD0->uNumMessages; | |
8972 break; | |
8973 } | |
437 | 8974 break; |
0 | 8975 } |
437 | 8976 /*if ( (signed int)v11 < 40 ) |
163 | 8977 //goto LABEL_132; |
8978 { | |
271 | 8979 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 8980 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
8981 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8982 ++pMessageQueue_50CBD0->uNumMessages; | |
8983 break; | |
437 | 8984 }*/ |
8985 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 8986 } |
8987 break; | |
8988 case INPUT_CharCycle: | |
17 | 8989 //__debugbreak(); |
151 | 8990 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 8991 || dword_50C9E8 >= 40 ) |
8992 break; | |
8993 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 8994 //goto LABEL_155; |
437 | 8995 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8996 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 8997 ++dword_50C9E8; |
8998 break; | |
0 | 8999 case INPUT_LookUp: |
17 | 9000 //__debugbreak(); |
0 | 9001 if ( pEventTimer->bPaused ) |
9002 break; | |
9003 partyAction = (PartyAction)7; | |
163 | 9004 //goto _add_action_and_continue_; |
9005 v5 = pActionQueue; | |
9006 v5->Add(partyAction); | |
9007 break; | |
0 | 9008 case INPUT_CenterView: |
17 | 9009 //__debugbreak(); |
0 | 9010 if ( pEventTimer->bPaused ) |
9011 break; | |
9012 partyAction = (PartyAction)9; | |
163 | 9013 //goto _add_action_and_continue_; |
9014 v5 = pActionQueue; | |
9015 v5->Add(partyAction); | |
9016 break; | |
0 | 9017 case INPUT_LookDown: |
17 | 9018 //__debugbreak(); |
0 | 9019 if ( pEventTimer->bPaused ) |
9020 break; | |
9021 partyAction = (PartyAction)8; | |
163 | 9022 //goto _add_action_and_continue_; |
9023 v5 = pActionQueue; | |
9024 v5->Add(partyAction); | |
9025 break; | |
0 | 9026 case INPUT_FlyUp: |
17 | 9027 //__debugbreak(); |
0 | 9028 if ( pCurrentScreen |
9029 || pEventTimer->bPaused ) | |
9030 break; | |
9031 partyAction = (PartyAction)13; | |
163 | 9032 //goto _add_action_and_continue_; |
9033 v5 = pActionQueue; | |
9034 v5->Add(partyAction); | |
9035 break; | |
0 | 9036 case INPUT_Land: |
17 | 9037 //__debugbreak(); |
0 | 9038 if ( pCurrentScreen |
9039 || pEventTimer->bPaused ) | |
9040 break; | |
9041 partyAction = (PartyAction)15; | |
163 | 9042 //goto _add_action_and_continue_; |
9043 v5 = pActionQueue; | |
9044 v5->Add(partyAction); | |
9045 break; | |
0 | 9046 case INPUT_FlyDown: |
17 | 9047 //__debugbreak(); |
0 | 9048 if ( !pCurrentScreen |
9049 && !pEventTimer->bPaused ) | |
9050 { | |
9051 partyAction = (PartyAction)14; | |
163 | 9052 //_add_action_and_continue_: |
0 | 9053 v5 = pActionQueue; |
163 | 9054 //_add_action_and_continue: |
0 | 9055 v5->Add(partyAction); |
9056 } | |
9057 break; | |
9058 case INPUT_ZoomIn: | |
17 | 9059 //__debugbreak(); |
0 | 9060 if ( dword_50C9E8 >= 40 ) |
9061 break; | |
9062 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 9063 //goto LABEL_155; |
437 | 9064 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9065 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 9066 ++dword_50C9E8; |
9067 break; | |
0 | 9068 case INPUT_ZoomOut: |
17 | 9069 //__debugbreak(); |
0 | 9070 if ( dword_50C9E8 < 40 ) |
9071 { | |
9072 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 9073 //LABEL_155: |
437 | 9074 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9075 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 9076 ++dword_50C9E8; |
9077 } | |
9078 break; | |
9079 case INPUT_AlwaysRun: | |
9080 bAlwaysRun = bAlwaysRun == 0; | |
9081 break; | |
17 | 9082 default: |
9083 //__debugbreak(); | |
9084 break; | |
0 | 9085 } |
9086 } | |
9087 inputAction = (InputAction)((int)inputAction + 1); | |
9088 if ( (signed int)inputAction >= 30 ) | |
9089 goto LABEL_176; | |
9090 } | |
9091 } | |
9092 v12 = 0; | |
9093 do | |
9094 { | |
9095 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
9096 v13 = pGame->pKeyboardInstance; | |
9097 if ( pKeyActionMap->pToggleTypes[v12] ) | |
9098 v14 = v13->WasKeyPressed(v22); | |
9099 else | |
9100 v14 = v13->IsKeyBeingHeld(v22); | |
9101 if ( v14 && v12 == 9 ) | |
9102 { | |
9103 if ( !pCurrentScreen ) | |
9104 { | |
437 | 9105 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 9106 goto LABEL_175; |
9107 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 9108 //goto LABEL_174; |
9109 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9110 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9111 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9112 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
17 | 9113 goto LABEL_175; |
0 | 9114 } |
151 | 9115 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
9116 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 9117 { |
9118 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9119 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9120 { | |
9121 v15 = 0; | |
9122 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9123 { | |
9124 v15 = 1; | |
437 | 9125 pMessageQueue_50CBD0->uNumMessages = 0; |
17 | 9126 //goto LABEL_173; |
437 | 9127 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape; |
17 | 9128 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9129 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9130 ++pMessageQueue_50CBD0->uNumMessages; | |
9131 goto LABEL_175; | |
0 | 9132 } |
9133 pMessageQueue_50CBD0->uNumMessages = 0; | |
9134 } | |
437 | 9135 /*if ( (signed int)v15 >= 40 ) |
0 | 9136 goto LABEL_175; |
17 | 9137 //LABEL_173: |
0 | 9138 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9139 //LABEL_174: |
0 | 9140 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9141 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9142 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9143 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 9144 goto LABEL_175; |
9145 } | |
9146 } | |
9147 LABEL_175: | |
9148 ++v12; | |
9149 } | |
9150 while ( v12 < 30 ); | |
9151 LABEL_176: | |
9152 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9153 { | |
9154 AsyncKeyboard::LeaveCriticalSection(); | |
9155 v16 = pAsyncKeyboard; | |
9156 AsyncKeyboard::EnterCriticalSection(); | |
9157 memset((char *)v16 + 521, 0, 0x100u); | |
9158 AsyncKeyboard::LeaveCriticalSection(); | |
9159 } | |
9160 } | |
9161 |