Mercurial > mm7
annotate mm7_6.cpp @ 588:829fb49eee05
OnGameViewportClick cleaned partly
author | zipi |
---|---|
date | Wed, 06 Mar 2013 12:43:58 +0000 |
parents | f90753ebabe3 |
children | c03428cb4119 |
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" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
23 #include "SpriteObject.h" |
0 | 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 "Awards.h" | |
33 #include "Autonotes.h" | |
34 #include "stru160.h" | |
35 #include "stru279.h" | |
36 #include "TurnEngine.h" | |
37 #include "stru277.h" | |
38 #include "Weather.h" | |
39 #include "stru272.h" | |
40 #include "stru298.h" | |
189 | 41 #include "texts.h" |
0 | 42 #include "StorylineTextTable.h" |
43 #include "Events2D.h" | |
370 | 44 #include "Log.h" |
0 | 45 |
46 #include "mm7_data.h" | |
47 | |
48 | |
49 | |
50 //----- (00424EE0) -------------------------------------------------------- | |
51 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
52 { | |
53 unsigned int v1; // edx@1 | |
54 double v2; // st7@1 | |
55 signed int v3; // edi@1 | |
56 char *v4; // esi@4 | |
57 char *v5; // ecx@4 | |
58 unsigned int v6; // eax@4 | |
59 char *v7; // edx@4 | |
60 double v8; // st6@10 | |
61 double v9; // st5@10 | |
62 double v10; // st6@11 | |
63 unsigned __int8 v11; // c2@15 | |
64 unsigned __int8 v12; // c3@15 | |
65 void *v13; // edi@22 | |
66 char *v14; // eax@22 | |
67 double v15; // st6@22 | |
68 char *v16; // ecx@22 | |
69 signed int result; // eax@24 | |
70 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
71 bool v19; // [sp+Ch] [bp-28h]@6 | |
72 char *v20; // [sp+10h] [bp-24h]@4 | |
73 char *v21; // [sp+14h] [bp-20h]@4 | |
74 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
75 char *v23; // [sp+1Ch] [bp-18h]@4 | |
76 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
77 char *v25; // [sp+24h] [bp-10h]@4 | |
78 char *v26; // [sp+28h] [bp-Ch]@4 | |
79 char *v27; // [sp+2Ch] [bp-8h]@4 | |
80 char *v28; // [sp+30h] [bp-4h]@4 | |
81 | |
82 v1 = uVertexID; | |
83 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
84 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
85 v3 = 0; | |
86 v22 = 0; | |
87 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | |
88 v3 = 1; | |
89 if ( (signed int)(uVertexID + 1) <= 1 ) | |
90 return 0; | |
91 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
92 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
93 v6 = v1; | |
94 v23 = (char *)&array_507D30[0].flt_2C; | |
168 | 95 v26 = (char *)&array_507D30[0]._rhw; |
0 | 96 v24 = array_507D30; |
97 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
98 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
99 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
100 v27 = (char *)&array_507D30[0].v; | |
101 v28 = (char *)&array_507D30[0].u; | |
102 v7 = (char *)&array_50AC10[0].v; | |
103 v18 = v6; | |
104 do | |
105 { | |
106 v19 = v2 >= *((float *)v7 + 5); | |
107 if ( v3 != v19 ) | |
108 { | |
109 if ( v19 ) | |
110 { | |
111 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | |
112 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | |
113 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | |
114 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | |
115 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | |
116 } | |
117 else | |
118 { | |
119 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | |
120 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | |
121 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | |
122 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | |
123 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | |
124 } | |
125 *(float *)v27 = v9; | |
126 *(float *)v25 = v2; | |
127 *(float *)v26 = 1.0 / v2; | |
128 if ( v3 ) | |
129 { | |
130 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
131 { | |
132 v11 = 0; | |
133 v12 = *(float *)v4 == *((float *)v7 - 5); | |
134 goto LABEL_19; | |
135 } | |
136 } | |
137 else | |
138 { | |
139 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
140 { | |
141 v11 = 0; | |
142 v12 = *(float *)v4 == *((float *)v7 + 7); | |
143 LABEL_19: | |
144 if ( v12 | v11 ) | |
145 goto LABEL_21; | |
146 goto LABEL_20; | |
147 } | |
148 } | |
149 LABEL_20: | |
150 v26 += 48; | |
151 ++v24; | |
152 v25 += 48; | |
153 v27 += 48; | |
154 v28 += 48; | |
155 v5 += 48; | |
156 v4 += 48; | |
157 ++v22; | |
158 v23 += 48; | |
159 v21 = v5; | |
160 v20 = v4; | |
161 } | |
162 LABEL_21: | |
163 if ( v19 ) | |
164 { | |
165 v13 = v24; | |
166 v14 = v26; | |
167 v21 += 48; | |
168 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
169 v20 += 48; | |
170 ++v22; | |
171 v28 += 48; | |
172 v27 += 48; | |
173 v25 += 48; | |
174 ++v24; | |
175 v26 += 48; | |
176 memcpy(v13, v7 + 8, 0x30u); | |
177 v16 = v23; | |
178 v23 += 48; | |
179 v4 = v20; | |
180 *(float *)v14 = v15; | |
181 *(int *)v16 = *((int *)v7 + 13); | |
182 v5 = v21; | |
183 } | |
184 v3 = v19; | |
185 v7 += 48; | |
186 --v18; | |
187 } | |
188 while ( v18 ); | |
189 result = v22; | |
190 if ( v22 < 3 ) | |
191 return 0; | |
192 return result; | |
193 } | |
194 | |
195 //----- (004250FE) -------------------------------------------------------- | |
196 signed int __fastcall sr_4250FE(unsigned int uVertexID) | |
197 { | |
198 unsigned int v1; // edx@1 | |
199 char *v2; // edi@5 | |
200 char *v3; // esi@5 | |
201 char *v4; // ecx@5 | |
202 int v5; // ebx@6 | |
203 double v6; // st6@11 | |
204 double v7; // st5@11 | |
205 double v8; // st6@12 | |
206 unsigned __int8 v9; // c2@16 | |
207 unsigned __int8 v10; // c3@16 | |
208 void *v11; // edi@23 | |
209 double v12; // st6@23 | |
210 char *v13; // ecx@23 | |
211 char v14; // zf@24 | |
212 signed int result; // eax@25 | |
213 unsigned int v16; // [sp+8h] [bp-28h]@5 | |
214 bool v17; // [sp+Ch] [bp-24h]@2 | |
215 bool v18; // [sp+10h] [bp-20h]@7 | |
216 char *v19; // [sp+14h] [bp-1Ch]@5 | |
217 char *v20; // [sp+18h] [bp-18h]@5 | |
218 signed int v21; // [sp+1Ch] [bp-14h]@1 | |
219 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5 | |
220 char *v23; // [sp+24h] [bp-Ch]@5 | |
221 char *v24; // [sp+28h] [bp-8h]@5 | |
222 char *v25; // [sp+2Ch] [bp-4h]@5 | |
223 | |
224 v1 = uVertexID; | |
225 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
226 v21 = 0; | |
227 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0; | |
228 if ( (signed int)(uVertexID + 1) <= 1 ) | |
229 return 0; | |
230 v2 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
231 v3 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 232 v24 = (char *)&array_507D30[0]._rhw; |
0 | 233 v22 = array_507D30; |
234 v19 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
235 v20 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
236 v23 = (char *)&array_507D30[0].vWorldViewPosition; | |
237 v25 = (char *)&array_507D30[0].flt_2C; | |
238 v4 = (char *)&array_50AC10[0].vWorldViewPosition; | |
239 v16 = v1; | |
240 do | |
241 { | |
242 v5 = (int)(v4 + 48); | |
243 v18 = *((float *)v4 + 12) >= 8.0; | |
244 if ( v17 != v18 ) | |
245 { | |
246 if ( v18 ) | |
247 { | |
248 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4); | |
249 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1); | |
250 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2); | |
251 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8); | |
252 } | |
253 else | |
254 { | |
255 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5); | |
256 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13); | |
257 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14); | |
258 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20); | |
259 } | |
260 *(float *)v25 = v7; | |
261 *(float *)v23 = 8.0; | |
262 *(int *)v24 = 0x3E000000u; | |
263 if ( v17 ) | |
264 { | |
265 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) ) | |
266 { | |
267 v9 = 0; | |
268 v10 = *(float *)v2 == *((float *)v4 + 2); | |
269 goto LABEL_20; | |
270 } | |
271 } | |
272 else | |
273 { | |
274 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) ) | |
275 { | |
276 v9 = 0; | |
277 v10 = *(float *)v2 == *((float *)v4 + 14); | |
278 LABEL_20: | |
279 if ( v10 | v9 ) | |
280 goto LABEL_22; | |
281 goto LABEL_21; | |
282 } | |
283 } | |
284 LABEL_21: | |
285 ++v22; | |
286 v23 += 48; | |
287 v25 += 48; | |
288 v3 += 48; | |
289 v2 += 48; | |
290 ++v21; | |
291 v24 += 48; | |
292 v20 = v3; | |
293 v19 = v2; | |
294 } | |
295 LABEL_22: | |
296 if ( v18 ) | |
297 { | |
298 v11 = v22; | |
299 v20 += 48; | |
300 v19 += 48; | |
301 v12 = 1.0 / (*(float *)v5 + 0.0000001); | |
302 ++v21; | |
303 v25 += 48; | |
304 v23 += 48; | |
305 ++v22; | |
306 memcpy(v11, v4 + 36, 0x30u); | |
307 v13 = v24; | |
308 v24 += 48; | |
309 v3 = v20; | |
310 v2 = v19; | |
311 *(float *)v13 = v12; | |
312 } | |
313 v14 = v16-- == 1; | |
314 v17 = v18; | |
315 v4 = (char *)v5; | |
316 } | |
317 while ( !v14 ); | |
318 result = v21; | |
319 if ( v21 < 3 ) | |
320 return 0; | |
321 return result; | |
322 } | |
323 | |
324 //----- (004252E8) -------------------------------------------------------- | |
325 signed int __fastcall sr_4252E8(unsigned int uVertexID) | |
326 { | |
327 unsigned int v1; // edx@1 | |
328 double v2; // st7@1 | |
329 char *v3; // edi@5 | |
330 char *v4; // esi@5 | |
331 char *v5; // ecx@5 | |
332 int v6; // ebx@6 | |
333 double v7; // st6@11 | |
334 double v8; // st5@11 | |
335 double v9; // st6@12 | |
336 unsigned __int8 v10; // c2@16 | |
337 unsigned __int8 v11; // c3@16 | |
338 void *v12; // edi@23 | |
339 double v13; // st6@23 | |
340 char *v14; // ecx@23 | |
341 char v15; // zf@24 | |
342 signed int result; // eax@25 | |
343 unsigned int v17; // [sp+8h] [bp-28h]@5 | |
344 bool v18; // [sp+Ch] [bp-24h]@2 | |
345 bool v19; // [sp+10h] [bp-20h]@7 | |
346 char *v20; // [sp+14h] [bp-1Ch]@5 | |
347 char *v21; // [sp+18h] [bp-18h]@5 | |
348 signed int v22; // [sp+1Ch] [bp-14h]@1 | |
349 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5 | |
350 char *v24; // [sp+24h] [bp-Ch]@5 | |
351 char *v25; // [sp+28h] [bp-8h]@5 | |
352 char *v26; // [sp+2Ch] [bp-4h]@5 | |
353 | |
354 v1 = uVertexID; | |
355 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
356 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
357 v22 = 0; | |
358 v18 = array_50AC10[0].vWorldViewPosition.x <= v2; | |
359 if ( (signed int)(uVertexID + 1) <= 1 ) | |
360 return 0; | |
361 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
362 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 363 v25 = (char *)&array_507D30[0]._rhw; |
0 | 364 v23 = array_507D30; |
365 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
366 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
367 v24 = (char *)&array_507D30[0].vWorldViewPosition; | |
368 v26 = (char *)&array_507D30[0].flt_2C; | |
369 v5 = (char *)&array_50AC10[0].vWorldViewPosition; | |
370 v17 = v1; | |
371 do | |
372 { | |
373 v6 = (int)(v5 + 48); | |
374 v19 = v2 >= *((float *)v5 + 12); | |
375 if ( v18 != v19 ) | |
376 { | |
377 if ( v19 ) | |
378 { | |
379 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5); | |
380 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1); | |
381 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2); | |
382 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8); | |
383 } | |
384 else | |
385 { | |
386 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6); | |
387 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13); | |
388 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14); | |
389 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20); | |
390 } | |
391 *(float *)v26 = v8; | |
392 *(float *)v24 = v2; | |
393 *(float *)v25 = 1.0 / v2; | |
394 if ( v18 ) | |
395 { | |
396 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) ) | |
397 { | |
398 v10 = 0; | |
399 v11 = *(float *)v3 == *((float *)v5 + 2); | |
400 goto LABEL_20; | |
401 } | |
402 } | |
403 else | |
404 { | |
405 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) ) | |
406 { | |
407 v10 = 0; | |
408 v11 = *(float *)v3 == *((float *)v5 + 14); | |
409 LABEL_20: | |
410 if ( v11 | v10 ) | |
411 goto LABEL_22; | |
412 goto LABEL_21; | |
413 } | |
414 } | |
415 LABEL_21: | |
416 ++v23; | |
417 v24 += 48; | |
418 v26 += 48; | |
419 v4 += 48; | |
420 v3 += 48; | |
421 ++v22; | |
422 v25 += 48; | |
423 v21 = v4; | |
424 v20 = v3; | |
425 } | |
426 LABEL_22: | |
427 if ( v19 ) | |
428 { | |
429 v12 = v23; | |
430 v21 += 48; | |
431 v20 += 48; | |
432 v13 = 1.0 / (*(float *)v6 + 0.0000001); | |
433 ++v22; | |
434 v26 += 48; | |
435 v24 += 48; | |
436 ++v23; | |
437 memcpy(v12, v5 + 36, 0x30u); | |
438 v14 = v25; | |
439 v25 += 48; | |
440 v4 = v21; | |
441 v3 = v20; | |
442 *(float *)v14 = v13; | |
443 } | |
444 v15 = v17-- == 1; | |
445 v18 = v19; | |
446 v5 = (char *)v6; | |
447 } | |
448 while ( !v15 ); | |
449 result = v22; | |
450 if ( v22 < 3 ) | |
451 return 0; | |
452 return result; | |
453 } | |
454 | |
455 | |
456 | |
457 //----- (004361EF) -------------------------------------------------------- | |
458 IndoorCameraD3D::IndoorCameraD3D() | |
459 { | |
460 IndoorCameraD3D *v1; // esi@1 | |
461 double v2; // st7@1 | |
462 double v3; // st6@1 | |
463 double v4; // st5@1 | |
464 double v5; // st7@1 | |
465 double v6; // st6@1 | |
466 double v7; // st5@1 | |
467 | |
468 v1 = this; | |
469 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4); | |
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14); | |
471 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24); | |
472 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, | |
473 24, | |
474 6, | |
475 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
476 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ | |
477 v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
478 v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
479 v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; | |
480 v1->field_108 = 0.0; | |
481 v1->field_DC = v4; | |
482 v1->field_E0 = v3; | |
483 v1->field_E4 = v2; | |
484 v5 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
485 v6 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
486 v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300); | |
487 v1->field_138 = 0.0; | |
488 v1->field_10C = v7; | |
489 v1->field_110 = v6; | |
490 v1->field_114 = v5; | |
491 v1->field_168 = 0.0; | |
492 v1->field_198 = 0.0; | |
493 v1->field_1C8 = 0.0; | |
494 v1->field_1F8 = 0.0; | |
495 v1->field_228 = 0.0; | |
496 v1->field_258 = 0.0; | |
497 v1->field_288 = 0.0; | |
498 v1->field_2B8 = 0.0; | |
499 v1->field_2E8 = 0.0; | |
500 v1->field_2BC = 0.0; | |
501 v1->field_2C0 = 0.0; | |
502 v1->field_2C4 = 0.0; | |
503 v1->field_318 = 0.0; | |
504 v1->field_2EC = 0.0; | |
505 v1->field_2F0 = 0.0; | |
506 v1->field_2F4 = 0.0; | |
507 v1->field_348 = 0.0; | |
508 v1->field_31C = 0.0; | |
509 v1->field_320 = 0.0; | |
510 v1->field_324 = 0.0; | |
511 v1->field_378 = 0.0; | |
512 v1->field_34C = 0.0; | |
513 v1->field_350 = 0.0; | |
514 v1->field_354 = 0.0; | |
515 for (uint i = 0; i < 16384; ++i) | |
516 { | |
517 list_0037C[i].field_0 = 0; | |
518 list_0037C[i].flt_30 = 0.0f; | |
519 } | |
520 | |
521 list_0037C_size = 0; | |
522 for (uint i = 0; i < 256; ++i) | |
523 list_E0380[i].mm7__vector_000004_size = 0; | |
524 /*v10 = v1->list_E0380; | |
525 v12 = 256; | |
526 do | |
527 { | |
528 v10->mm7__vector_000004_size = 0; | |
529 //mm7__vector_constructor( | |
530 // v10->mm7__vector_000004, | |
531 // 48, | |
532 // 64, | |
533 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); | |
534 //++v10; | |
535 --v12; | |
536 } | |
537 while ( v12 );*/ | |
538 list_E0380_size = 0; | |
539 //v1->vdestructor_ptr = &stru8_pvdtor; | |
540 } | |
541 | |
542 | |
543 //----- (004254D2) -------------------------------------------------------- | |
544 int __fastcall sr_4254D2(signed int a1) | |
545 { | |
546 signed int v1; // ebx@2 | |
547 int v2; // ecx@2 | |
548 int result; // eax@11 | |
549 double v4; // ST74_8@12 | |
550 bool v5; // edi@12 | |
551 char *v6; // esi@13 | |
552 char *v7; // ebx@13 | |
553 double v8; // st7@15 | |
554 double v9; // st7@16 | |
555 double v10; // st6@16 | |
556 double v11; // st7@17 | |
557 float v12; // eax@18 | |
558 double v13; // ST4C_8@19 | |
559 double v14; // ST10_8@19 | |
560 double v15; // ST28_8@20 | |
561 double v16; // ST34_8@20 | |
562 char v17; // zf@20 | |
563 double v18; // ST18_8@21 | |
564 double v19; // ST3C_8@21 | |
565 double v20; // ST44_8@22 | |
566 double v21; // ST54_8@22 | |
567 void *v22; // edi@26 | |
568 double v23; // ST54_8@29 | |
569 bool v24; // esi@29 | |
570 char *v25; // edi@30 | |
571 char *v26; // ebx@30 | |
572 bool v27; // ecx@32 | |
573 double v28; // st7@33 | |
574 double v29; // st7@34 | |
575 double v30; // st6@34 | |
576 double v31; // st7@35 | |
577 double v32; // ST44_8@37 | |
578 double v33; // ST3C_8@37 | |
579 double v34; // ST18_8@38 | |
580 double v35; // ST34_8@38 | |
581 char v36; // zf@38 | |
582 double v37; // ST28_8@39 | |
583 double v38; // ST10_8@39 | |
584 double v39; // ST20_8@40 | |
585 double v40; // ST5C_8@40 | |
586 void *v41; // edi@44 | |
587 double v42; // ST5C_8@47 | |
588 bool v43; // edi@47 | |
589 char *v44; // esi@48 | |
590 char *v45; // ebx@48 | |
591 bool v46; // ecx@49 | |
592 double v47; // st6@50 | |
593 double v48; // st6@51 | |
594 double v49; // st5@51 | |
595 double v50; // st6@52 | |
596 double v51; // ST20_8@54 | |
597 double v52; // ST54_8@54 | |
598 double v53; // ST44_8@55 | |
599 double v54; // ST3C_8@55 | |
600 char v55; // zf@55 | |
601 double v56; // ST18_8@56 | |
602 double v57; // ST34_8@56 | |
603 double v58; // ST28_8@57 | |
604 double v59; // ST10_8@57 | |
605 void *v60; // edi@61 | |
606 double v61; // ST5C_8@64 | |
607 bool v62; // edi@64 | |
608 char *v63; // esi@65 | |
609 char *v64; // ebx@65 | |
610 bool v65; // ecx@66 | |
611 double v66; // st6@67 | |
612 double v67; // st6@68 | |
613 double v68; // st5@68 | |
614 double v69; // st6@69 | |
615 double v70; // ST20_8@71 | |
616 double v71; // ST54_8@71 | |
617 double v72; // ST44_8@72 | |
618 double v73; // ST3C_8@72 | |
619 char v74; // zf@72 | |
620 double v75; // ST18_8@73 | |
621 double v76; // ST34_8@73 | |
622 double v77; // ST28_8@74 | |
623 double v78; // ST10_8@74 | |
624 void *v79; // edi@78 | |
625 int v80; // ebx@81 | |
626 char *v81; // ecx@82 | |
627 signed int v82; // esi@82 | |
628 float v83; // ST78_4@83 | |
629 double v84; // ST5C_8@83 | |
630 float v85; // eax@84 | |
631 double v86; // ST20_8@85 | |
632 double v87; // ST54_8@88 | |
633 float v88; // eax@89 | |
634 double v89; // ST44_8@90 | |
635 unsigned __int8 v90; // sf@94 | |
636 unsigned __int8 v91; // of@94 | |
637 int v92; // edx@97 | |
638 int v93; // esi@97 | |
639 int v94; // edi@97 | |
640 int v95; // eax@97 | |
641 int v96; // eax@104 | |
642 double v97; // [sp+4Ch] [bp-8Ch]@32 | |
643 double v98; // [sp+54h] [bp-84h]@49 | |
644 double v99; // [sp+54h] [bp-84h]@66 | |
645 float v100; // [sp+5Ch] [bp-7Ch]@1 | |
646 float v101; // [sp+60h] [bp-78h]@1 | |
647 float v102; // [sp+64h] [bp-74h]@1 | |
648 double v103; // [sp+6Ch] [bp-6Ch]@14 | |
649 float v104; // [sp+A8h] [bp-30h]@1 | |
650 signed int v105; // [sp+A8h] [bp-30h]@96 | |
651 bool v106; // [sp+ACh] [bp-2Ch]@14 | |
652 bool v107; // [sp+ACh] [bp-2Ch]@32 | |
653 bool v108; // [sp+ACh] [bp-2Ch]@49 | |
654 bool v109; // [sp+ACh] [bp-2Ch]@66 | |
655 signed int v110; // [sp+B0h] [bp-28h]@12 | |
656 char *v111; // [sp+B8h] [bp-20h]@30 | |
657 signed int v112; // [sp+B8h] [bp-20h]@48 | |
658 signed int v113; // [sp+B8h] [bp-20h]@65 | |
659 char *v114; // [sp+BCh] [bp-1Ch]@13 | |
660 signed int v115; // [sp+BCh] [bp-1Ch]@29 | |
661 signed int v116; // [sp+BCh] [bp-1Ch]@64 | |
662 signed int v117; // [sp+C0h] [bp-18h]@1 | |
663 char *v118; // [sp+C0h] [bp-18h]@30 | |
664 char *v119; // [sp+C0h] [bp-18h]@48 | |
665 char *v120; // [sp+C0h] [bp-18h]@65 | |
666 char *v121; // [sp+C4h] [bp-14h]@13 | |
667 char *v122; // [sp+C4h] [bp-14h]@30 | |
668 signed int v123; // [sp+C4h] [bp-14h]@47 | |
669 char *v124; // [sp+C8h] [bp-10h]@30 | |
670 char *v125; // [sp+C8h] [bp-10h]@48 | |
671 char *v126; // [sp+C8h] [bp-10h]@65 | |
672 signed int v127; // [sp+CCh] [bp-Ch]@2 | |
673 char *v128; // [sp+CCh] [bp-Ch]@13 | |
674 char *v129; // [sp+CCh] [bp-Ch]@30 | |
675 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48 | |
676 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65 | |
677 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13 | |
678 char *v133; // [sp+D0h] [bp-8h]@30 | |
679 char *v134; // [sp+D0h] [bp-8h]@48 | |
680 char *v135; // [sp+D0h] [bp-8h]@65 | |
681 signed int v136; // [sp+D4h] [bp-4h]@1 | |
682 char *v137; // [sp+D4h] [bp-4h]@13 | |
683 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30 | |
684 char *v139; // [sp+D4h] [bp-4h]@48 | |
685 char *v140; // [sp+D4h] [bp-4h]@65 | |
686 | |
687 v101 = (double)(signed int)pViewport->uViewportX; | |
688 v100 = (double)(signed int)pViewport->uViewportZ; | |
689 v117 = a1; | |
690 v136 = 1; | |
691 v104 = (double)(signed int)pViewport->uViewportY; | |
692 v102 = (double)(pViewport->uViewportW + 1); | |
693 if ( a1 <= 0 ) | |
694 return v117; | |
695 v127 = a1; | |
696 v1 = a1; | |
697 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2)); | |
698 v2 = 0; | |
699 do | |
700 { | |
701 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 ) | |
702 v136 = 0; | |
703 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 ) | |
704 v136 = 0; | |
705 ++v2; | |
706 --v127; | |
707 } | |
708 while ( v127 ); | |
709 if ( v136 ) | |
710 return v117; | |
711 v110 = 0; | |
712 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1])); | |
713 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15; | |
714 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportX; | |
715 if ( v117 < 1 ) | |
716 goto LABEL_112; | |
717 v6 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
718 v132 = array_50A2B0; | |
719 v137 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
720 v128 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
721 v121 = (char *)&array_50A2B0[0].flt_2C; | |
168 | 722 v114 = (char *)&array_50A2B0[0]._rhw; |
0 | 723 v7 = (char *)&array_50AC10[0].flt_2C; |
724 do | |
725 { | |
726 v103 = *((float *)v7 + 7) + 6.7553994e15; | |
727 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportX; | |
728 if ( !(v5 ^ v106) ) | |
729 goto LABEL_25; | |
730 v8 = v101; | |
731 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportX ) | |
732 { | |
733 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5)); | |
734 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4); | |
735 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3); | |
736 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7; | |
737 } | |
738 else | |
739 { | |
740 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7)); | |
741 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8); | |
742 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9); | |
743 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12); | |
744 } | |
745 *(float *)v121 = v10; | |
746 *(int *)v137 = LODWORD(v101); | |
747 LODWORD(v12) = *(int *)v6; | |
748 if ( v5 ) | |
749 { | |
750 v13 = v12 + 6.7553994e15; | |
751 v14 = *((float *)v7 - 4) + 6.7553994e15; | |
752 if ( LODWORD(v13) == LODWORD(v14) ) | |
753 { | |
754 v15 = *(float *)v137 + 6.7553994e15; | |
755 v16 = *((float *)v7 - 5) + 6.7553994e15; | |
756 v17 = LODWORD(v15) == LODWORD(v16); | |
757 goto LABEL_23; | |
758 } | |
759 } | |
760 else | |
761 { | |
762 v18 = v12 + 6.7553994e15; | |
763 v19 = *((float *)v7 + 8) + 6.7553994e15; | |
764 if ( LODWORD(v18) == LODWORD(v19) ) | |
765 { | |
766 v20 = *(float *)v137 + 6.7553994e15; | |
767 v21 = *((float *)v7 + 7) + 6.7553994e15; | |
768 v17 = LODWORD(v20) == LODWORD(v21); | |
769 LABEL_23: | |
770 if ( v17 ) | |
771 goto LABEL_25; | |
772 goto LABEL_24; | |
773 } | |
774 } | |
775 LABEL_24: | |
776 v121 += 48; | |
777 v114 += 48; | |
778 v6 += 48; | |
779 ++v110; | |
780 ++v132; | |
781 v128 = v6; | |
782 v137 += 48; | |
783 LABEL_25: | |
784 if ( v106 ) | |
785 { | |
786 v22 = v132; | |
787 v128 += 48; | |
788 ++v110; | |
789 v114 += 48; | |
790 v121 += 48; | |
791 v137 += 48; | |
792 ++v132; | |
793 memcpy(v22, v7 + 4, 0x30u); | |
794 v6 = v128; | |
795 } | |
796 v5 = v106; | |
797 v7 += 48; | |
798 --v117; | |
799 } | |
800 while ( v117 ); | |
801 if ( v110 < 3 | |
802 || (v115 = 0, | |
803 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])), | |
804 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15, | |
805 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportZ, | |
806 v110 < 1) ) | |
807 goto LABEL_112; | |
168 | 808 v25 = (char *)&array_509950[0]._rhw; |
0 | 809 v138 = array_509950; |
810 v129 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
811 v118 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
812 v133 = (char *)&array_509950[0].vWorldViewProjX; | |
813 v122 = (char *)&array_509950[0].vWorldViewProjY; | |
814 v124 = (char *)&array_509950[0].flt_2C; | |
168 | 815 v111 = (char *)&array_509950[0]._rhw; |
0 | 816 v26 = (char *)&array_50A2B0[0].flt_2C; |
817 while ( 2 ) | |
818 { | |
819 v97 = *((float *)v26 + 7) + 6.7553994e15; | |
820 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
821 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
822 if ( v24 != v27 ) | |
823 { | |
824 v28 = v100; | |
825 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportZ ) | |
826 { | |
827 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5)); | |
828 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4); | |
829 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3); | |
830 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26; | |
831 } | |
832 else | |
833 { | |
834 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7)); | |
835 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8); | |
836 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9); | |
837 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12); | |
838 } | |
839 *(float *)v124 = v30; | |
840 *(int *)v133 = LODWORD(v100); | |
841 if ( v24 ) | |
842 { | |
843 v32 = *(float *)v122 + 6.7553994e15; | |
844 v33 = *((float *)v26 - 4) + 6.7553994e15; | |
845 if ( LODWORD(v32) == LODWORD(v33) ) | |
846 { | |
847 v34 = *(float *)v133 + 6.7553994e15; | |
848 v35 = *((float *)v26 - 5) + 6.7553994e15; | |
849 v36 = LODWORD(v34) == LODWORD(v35); | |
850 goto LABEL_41; | |
851 } | |
852 goto LABEL_42; | |
853 } | |
854 v37 = *(float *)v118 + 6.7553994e15; | |
855 v38 = *((float *)v26 + 8) + 6.7553994e15; | |
856 if ( LODWORD(v37) != LODWORD(v38) ) | |
857 goto LABEL_42; | |
858 v39 = *(float *)v129 + 6.7553994e15; | |
859 v40 = *((float *)v26 + 7) + 6.7553994e15; | |
860 v36 = LODWORD(v39) == LODWORD(v40); | |
861 LABEL_41: | |
862 if ( !v36 ) | |
863 { | |
864 LABEL_42: | |
865 v129 += 48; | |
866 v118 += 48; | |
867 v133 += 48; | |
868 v122 += 48; | |
869 v124 += 48; | |
870 v111 += 48; | |
871 ++v115; | |
872 ++v138; | |
873 } | |
874 } | |
875 if ( v27 ) | |
876 { | |
877 v41 = v138; | |
878 ++v115; | |
879 v111 += 48; | |
880 v124 += 48; | |
881 v122 += 48; | |
882 v133 += 48; | |
883 v118 += 48; | |
884 v129 += 48; | |
885 ++v138; | |
886 memcpy(v41, v26 + 4, 0x30u); | |
887 } | |
888 v24 = v107; | |
889 v26 += 48; | |
890 --v110; | |
891 if ( v110 ) | |
892 { | |
893 v25 = v111; | |
894 continue; | |
895 } | |
896 break; | |
897 } | |
898 if ( v115 < 3 | |
899 || (v123 = 0, | |
900 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])), | |
901 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15, | |
902 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportY, | |
903 v115 < 1) ) | |
904 goto LABEL_112; | |
905 v44 = (char *)&array_508FF0[0].vWorldViewProjX; | |
906 v130 = array_508FF0; | |
907 v119 = (char *)&array_508FF0[0].vWorldViewProjX; | |
908 v139 = (char *)&array_508FF0[0].vWorldViewProjY; | |
909 v125 = (char *)&array_508FF0[0].flt_2C; | |
168 | 910 v134 = (char *)&array_508FF0[0]._rhw; |
0 | 911 v45 = (char *)&array_509950[0].flt_2C; |
912 v112 = v115; | |
913 while ( 2 ) | |
914 { | |
915 v98 = *((float *)v45 + 8) + 6.7553994e15; | |
916 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
917 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
918 if ( v43 != v46 ) | |
919 { | |
920 v47 = v104; | |
921 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportY ) | |
922 { | |
923 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4)); | |
924 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5); | |
925 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3); | |
926 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45; | |
927 } | |
928 else | |
929 { | |
930 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8)); | |
931 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7); | |
932 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9); | |
933 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12); | |
934 } | |
935 *(float *)v125 = v49; | |
936 *(float *)v139 = v104; | |
937 if ( v43 ) | |
938 { | |
939 v51 = v104 + 6.7553994e15; | |
940 v52 = *((float *)v45 - 4) + 6.7553994e15; | |
941 if ( LODWORD(v51) == LODWORD(v52) ) | |
942 { | |
943 v53 = *(float *)v44 + 6.7553994e15; | |
944 v54 = *((float *)v45 - 5) + 6.7553994e15; | |
945 v55 = LODWORD(v53) == LODWORD(v54); | |
946 goto LABEL_58; | |
947 } | |
948 goto LABEL_59; | |
949 } | |
950 v56 = v104 + 6.7553994e15; | |
951 v57 = *((float *)v45 + 8) + 6.7553994e15; | |
952 if ( LODWORD(v56) != LODWORD(v57) ) | |
953 goto LABEL_59; | |
954 v58 = *(float *)v44 + 6.7553994e15; | |
955 v59 = *((float *)v45 + 7) + 6.7553994e15; | |
956 v55 = LODWORD(v58) == LODWORD(v59); | |
957 LABEL_58: | |
958 if ( !v55 ) | |
959 { | |
960 LABEL_59: | |
961 v139 += 48; | |
962 v125 += 48; | |
963 v134 += 48; | |
964 v44 += 48; | |
965 ++v123; | |
966 ++v130; | |
967 v119 = v44; | |
968 } | |
969 } | |
970 if ( v46 ) | |
971 { | |
972 v60 = v130; | |
973 v119 += 48; | |
974 ++v123; | |
975 v134 += 48; | |
976 v125 += 48; | |
977 v139 += 48; | |
978 ++v130; | |
979 memcpy(v60, v45 + 4, 0x30u); | |
980 v44 = v119; | |
981 } | |
982 v43 = v108; | |
983 v45 += 48; | |
984 --v112; | |
985 if ( v112 ) | |
986 continue; | |
987 break; | |
988 } | |
989 if ( v123 < 3 | |
990 || (v116 = 0, | |
991 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])), | |
992 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15, | |
993 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportW, | |
994 v123 < 1) ) | |
995 goto LABEL_112; | |
996 v63 = (char *)&array_508690[0].vWorldViewProjX; | |
997 v131 = array_508690; | |
998 v120 = (char *)&array_508690[0].vWorldViewProjX; | |
999 v140 = (char *)&array_508690[0].vWorldViewProjY; | |
1000 v126 = (char *)&array_508690[0].flt_2C; | |
168 | 1001 v135 = (char *)&array_508690[0]._rhw; |
0 | 1002 v64 = (char *)&array_508FF0[0].flt_2C; |
1003 v113 = v123; | |
1004 while ( 2 ) | |
1005 { | |
1006 v99 = *((float *)v64 + 8) + 6.7553994e15; | |
1007 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1008 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1009 if ( v62 != v65 ) | |
1010 { | |
1011 v66 = v102; | |
1012 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportW ) | |
1013 { | |
1014 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4)); | |
1015 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5); | |
1016 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3); | |
1017 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64; | |
1018 } | |
1019 else | |
1020 { | |
1021 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8)); | |
1022 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7); | |
1023 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9); | |
1024 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12); | |
1025 } | |
1026 *(float *)v126 = v68; | |
1027 *(float *)v140 = v102; | |
1028 if ( v62 ) | |
1029 { | |
1030 v70 = v102 + 6.7553994e15; | |
1031 v71 = *((float *)v64 - 4) + 6.7553994e15; | |
1032 if ( LODWORD(v70) == LODWORD(v71) ) | |
1033 { | |
1034 v72 = *(float *)v63 + 6.7553994e15; | |
1035 v73 = *((float *)v64 - 5) + 6.7553994e15; | |
1036 v74 = LODWORD(v72) == LODWORD(v73); | |
1037 goto LABEL_75; | |
1038 } | |
1039 goto LABEL_76; | |
1040 } | |
1041 v75 = v102 + 6.7553994e15; | |
1042 v76 = *((float *)v64 + 8) + 6.7553994e15; | |
1043 if ( LODWORD(v75) != LODWORD(v76) ) | |
1044 goto LABEL_76; | |
1045 v77 = *(float *)v63 + 6.7553994e15; | |
1046 v78 = *((float *)v64 + 7) + 6.7553994e15; | |
1047 v74 = LODWORD(v77) == LODWORD(v78); | |
1048 LABEL_75: | |
1049 if ( !v74 ) | |
1050 { | |
1051 LABEL_76: | |
1052 v140 += 48; | |
1053 v126 += 48; | |
1054 v135 += 48; | |
1055 v63 += 48; | |
1056 ++v116; | |
1057 ++v131; | |
1058 v120 = v63; | |
1059 } | |
1060 } | |
1061 if ( v65 ) | |
1062 { | |
1063 v79 = v131; | |
1064 v120 += 48; | |
1065 ++v116; | |
1066 v135 += 48; | |
1067 v126 += 48; | |
1068 v140 += 48; | |
1069 ++v131; | |
1070 memcpy(v79, v64 + 4, 0x30u); | |
1071 v63 = v120; | |
1072 } | |
1073 v62 = v109; | |
1074 v64 += 48; | |
1075 --v113; | |
1076 if ( v113 ) | |
1077 continue; | |
1078 break; | |
1079 } | |
1080 if ( v116 < 3 ) | |
1081 goto LABEL_112; | |
1082 v80 = v116; | |
1083 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116])); | |
1084 if ( v116 > 0 ) | |
1085 { | |
1086 v81 = (char *)&array_508690[0].vWorldViewProjX; | |
1087 v82 = v116; | |
1088 do | |
1089 { | |
1090 LODWORD(v83) = *(int *)v81; | |
1091 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2); | |
1092 v84 = v83 + 6.7553994e15; | |
1093 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportZ ) | |
1094 { | |
1095 v86 = *(float *)v81 + 6.7553994e15; | |
1096 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportX ) | |
1097 goto LABEL_88; | |
1098 v85 = v101; | |
1099 } | |
1100 else | |
1101 { | |
1102 v85 = v100; | |
1103 } | |
1104 *(int *)v81 = LODWORD(v85); | |
1105 LABEL_88: | |
1106 v87 = *((float *)v81 + 1) + 6.7553994e15; | |
1107 if ( SLODWORD(v87) > (signed int)pViewport->uViewportW ) | |
1108 { | |
1109 v88 = v102; | |
1110 LABEL_92: | |
1111 *((int *)v81 + 1) = LODWORD(v88); | |
1112 goto LABEL_93; | |
1113 } | |
1114 v89 = *((float *)v81 + 1) + 6.7553994e15; | |
1115 if ( SLODWORD(v89) < (signed int)pViewport->uViewportY ) | |
1116 { | |
1117 v88 = v104; | |
1118 goto LABEL_92; | |
1119 } | |
1120 LABEL_93: | |
1121 v81 += 48; | |
1122 --v82; | |
1123 } | |
1124 while ( v82 ); | |
1125 } | |
1126 v91 = __OFSUB__(v116, 3); | |
1127 v90 = v116 - 3 < 0; | |
1128 if ( v116 > 3 ) | |
1129 { | |
1130 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1])); | |
1131 if ( v116 > 0 ) | |
1132 { | |
1133 v105 = 1; | |
1134 do | |
1135 { | |
1136 v92 = v105; | |
1137 v93 = v105 - 1; | |
1138 v94 = v105 + 1; | |
1139 v95 = v105 + 1; | |
1140 if ( v105 - 1 >= v80 ) | |
1141 v93 -= v80; | |
1142 if ( v105 >= v80 ) | |
1143 v92 = v105 - v80; | |
1144 if ( v94 >= v80 ) | |
1145 v95 = v94 - v80; | |
1146 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1147 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY) | |
1148 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1149 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 ) | |
1150 { | |
1151 ++v105; | |
1152 } | |
1153 else | |
1154 { | |
1155 v96 = v105; | |
1156 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) ) | |
1157 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2)); | |
1158 --v80; | |
1159 } | |
1160 } | |
1161 while ( v105 - 1 < v80 ); | |
1162 } | |
1163 v91 = __OFSUB__(v80, 3); | |
1164 v90 = v80 - 3 < 0; | |
1165 } | |
1166 if ( v90 ^ v91 ) | |
1167 LABEL_112: | |
1168 result = 0; | |
1169 else | |
1170 result = v80; | |
1171 return result; | |
1172 } | |
1173 | |
1174 //----- (0042620A) -------------------------------------------------------- | |
1175 bool __thiscall sr_42620A(RenderVertexSoft *p) | |
1176 { | |
1177 __int16 v1; // fps@1 | |
1178 unsigned __int8 v2; // c0@2 | |
1179 char v3; // c2@2 | |
1180 unsigned __int8 v4; // c3@2 | |
1181 bool result; // eax@2 | |
1182 unsigned __int8 v6; // c0@4 | |
1183 char v7; // c2@4 | |
1184 unsigned __int8 v8; // c3@4 | |
1185 unsigned __int8 v9; // c0@6 | |
1186 char v10; // c2@6 | |
1187 unsigned __int8 v11; // c3@6 | |
1188 double v12; // st6@7 | |
1189 float v13; // ST04_4@7 | |
1190 float v14; // ST00_4@7 | |
1191 double v15; // st7@7 | |
1192 double v16; // st6@8 | |
1193 float v17; // ST04_4@8 | |
1194 float v18; // ST00_4@8 | |
1195 double v19; // st7@8 | |
1196 | |
1197 //UNDEF(v1); | |
1198 if ( p->vWorldViewPosition.x < 300.0 | |
1199 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
1200 v3 = 0, | |
1201 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
1202 BYTE1(result) = HIBYTE(v1), | |
1203 !(v2 | v4)) ) | |
1204 { | |
1205 if ( p->vWorldViewPosition.x < 300.0 ) | |
1206 { | |
1207 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
1208 v7 = 0; | |
1209 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
1210 BYTE1(result) = HIBYTE(v1); | |
1211 if ( !(v6 | v8) ) | |
1212 { | |
1213 LOBYTE(result) = 0; | |
1214 return result; | |
1215 } | |
1216 } | |
1217 v9 = 300.0 < p->vWorldViewPosition.x; | |
1218 v10 = 0; | |
1219 v11 = 300.0 == p->vWorldViewPosition.x; | |
1220 BYTE1(result) = HIBYTE(v1); | |
1221 if ( v9 | v11 ) | |
1222 { | |
1223 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
1224 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
1225 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
1226 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
1227 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
1228 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
1229 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
1230 } | |
1231 else | |
1232 { | |
1233 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
1234 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
1235 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
1236 v15 = 300.0 - p->vWorldViewPosition.x; | |
1237 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
1238 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
1239 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
1240 } | |
1241 } | |
1242 LOBYTE(result) = 1; | |
1243 return result; | |
1244 } | |
1245 | |
1246 | |
1247 | |
1248 | |
1249 //----- (004268E3) -------------------------------------------------------- | |
1250 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) | |
1251 { | |
1252 unsigned int v1; // eax@1 | |
1253 unsigned int v2; // edx@1 | |
1254 int v3; // eax@1 | |
1255 int v4; // edx@1 | |
1256 unsigned int v5; // ecx@1 | |
1257 | |
1258 v1 = uColor >> 9; | |
1259 v2 = uColor >> 6; | |
1260 LOWORD(v1) = (uColor >> 9) & 0x7C00; | |
1261 LOWORD(v2) = (uColor >> 6) & 0x3E0; | |
1262 v3 = v2 | v1; | |
1263 v4 = (unsigned __int8)uColor >> 3; | |
1264 v5 = uColor >> 16; | |
1265 LOWORD(v5) = v5 & 0x8000; | |
1266 return v5 | v4 | v3; | |
1267 } | |
1268 | |
1269 //----- (0042690D) -------------------------------------------------------- | |
1270 int __fastcall _42690D_colors_cvt(unsigned int a1) | |
1271 { | |
1272 unsigned int v1; // eax@1 | |
1273 unsigned int v2; // edx@1 | |
1274 | |
1275 v1 = a1 >> 8; | |
1276 v2 = a1 >> 5; | |
1277 LOWORD(v1) = (a1 >> 8) & 0xF800; | |
1278 LOWORD(v2) = (a1 >> 5) & 0x7E0; | |
1279 return ((unsigned __int8)a1 >> 3) | v2 | v1; | |
1280 } | |
1281 | |
1282 //----- (00426947) -------------------------------------------------------- | |
1283 void __cdecl sub_426947() | |
1284 { | |
1285 dword_50C968 = 0; | |
1286 dword_50C994 = 0; | |
1287 dword_50C998_turnbased_icon_1A = 0; | |
1288 } | |
1289 // 50C968: using guessed type int dword_50C968; | |
1290 // 50C994: using guessed type int dword_50C994; | |
1291 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A; | |
1292 | |
1293 | |
1294 | |
1295 //----- (004269A2) -------------------------------------------------------- | |
1296 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1) | |
1297 { | |
89 | 1298 //unsigned __int64 v1; // qax@1 |
1299 Player *v1; | |
1300 int v1b; | |
0 | 1301 signed int v2; // ecx@1 |
82 | 1302 int *v3; // esi@1 |
0 | 1303 bool v4; // edi@6 |
82 | 1304 int *v5; // edi@10 |
1305 Player *v6; // esi@10 | |
0 | 1306 int v7; // eax@13 |
1307 unsigned __int8 v8; // cf@13 | |
89 | 1308 int v10[4]; // [sp+Ch] [bp-14h]@1 |
0 | 1309 int v11; // [sp+1Ch] [bp-4h]@10 |
1310 | |
89 | 1311 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1); |
1312 v1 = pParty->pPlayers; | |
1313 v1b = a1; | |
0 | 1314 v2 = 0; |
89 | 1315 v3 = v10; |
0 | 1316 do |
1317 { | |
89 | 1318 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8)) |
0 | 1319 && !*(int *)HIDWORD(v1) |
1320 && !*(_QWORD *)(HIDWORD(v1) + 8) | |
89 | 1321 && !*(_QWORD *)(HIDWORD(v1) + 16);*/ |
1322 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13])) | |
1323 && !v1->pConditions[14] | |
1324 && !v1->pConditions[15] | |
1325 && !v1->pConditions[16]; | |
82 | 1326 *v3 = v4; |
89 | 1327 //HIDWORD(v1) += 6972; |
1328 ++v1; | |
0 | 1329 v2 += v4; |
82 | 1330 ++v3; |
0 | 1331 } |
89 | 1332 while ( v1 <= &pParty->pPlayers[3] ); |
0 | 1333 if ( v2 ) |
1334 { | |
89 | 1335 v1b = v1b / v2; |
1336 v5 = v10; | |
82 | 1337 v6 = pParty->pPlayers;//[0].uExperience; |
89 | 1338 v11 = v1b; |
0 | 1339 do |
1340 { | |
82 | 1341 if ( *v5 ) |
0 | 1342 { |
1343 if ( v11 ) | |
1344 { | |
82 | 1345 LOBYTE(v7) = v6->GetLearningPercent(); |
89 | 1346 v1b = v11 + v11 * v7 / 100; |
1347 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience)); | |
1348 //need review | |
1349 LODWORD(v6->uExperience) += v1b; | |
1350 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8; | |
82 | 1351 if ( v6->uExperience > 4000000000i64 ) |
0 | 1352 { |
82 | 1353 HIDWORD(v6->uExperience) = 0; |
1354 LODWORD(v6->uExperience) = -294967296; | |
0 | 1355 } |
1356 } | |
1357 } | |
82 | 1358 ++v6; |
1359 ++v5; | |
0 | 1360 } |
82 | 1361 while ( v6 <= &pParty->pPlayers[3] ); |
0 | 1362 } |
89 | 1363 return v1b; |
0 | 1364 } |
1365 | |
1366 //----- (00426A5A) -------------------------------------------------------- | |
1367 void stru319::LootActor(Actor *pActor) | |
1368 { | |
1369 signed int v2; // edi@1 | |
1370 char v3; // zf@1 | |
1371 unsigned int v4; // eax@13 | |
1372 unsigned int v5; // esi@13 | |
1373 int v6; // eax@14 | |
1374 unsigned __int8 v7; // al@30 | |
1375 Party *v8; // esi@34 | |
1376 char *v9; // [sp-4h] [bp-3Ch]@10 | |
1377 char *v10; // [sp-4h] [bp-3Ch]@31 | |
1378 char *v11; // [sp-4h] [bp-3Ch]@38 | |
1379 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 | |
1380 int v13; // [sp+30h] [bp-8h]@1 | |
1381 int v14; // [sp+34h] [bp-4h]@1 | |
1382 | |
1383 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1384 Dst.Reset(); | |
1385 v2 = 0; | |
1386 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; | |
1387 v13 = 0; | |
1388 v14 = 0; | |
1389 if ( v3 ) | |
1390 { | |
1391 if ( !pActor->pMonsterInfo.uTreasureDiceRolls ) | |
1392 goto LABEL_9; | |
1393 do | |
1394 { | |
1395 ++v2; | |
1396 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | |
1397 } | |
1398 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); | |
1399 } | |
1400 else | |
1401 { | |
1402 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 ) | |
1403 goto LABEL_9; | |
377 | 1404 v14 = pActor->array_000234[3].uSpecEnchantmentType; |
0 | 1405 pActor->array_000234[3].Reset(); |
1406 } | |
1407 if ( v14 ) | |
1408 { | |
1409 party_finds_gold(v14, 0); | |
1410 viewparams->bRedrawGameUI = 1; | |
1411 } | |
1412 LABEL_9: | |
1413 if ( pActor->uCarriedItemID ) | |
1414 { | |
1415 Dst.Reset(); | |
1416 Dst.uItemID = pActor->uCarriedItemID; | |
1417 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1418 if ( v14 ) | |
189 | 1419 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9); |
0 | 1420 else |
189 | 1421 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9); |
0 | 1422 ShowStatusBarString(pTmpBuf2, 2u); |
1423 v4 = Dst.uItemID; | |
1424 v5 = Dst.uItemID; | |
1425 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) | |
1426 { | |
1427 v5 = Dst.uItemID; | |
1428 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1; | |
1429 Dst.uNumCharges = v6; | |
1430 Dst.uMaxCharges = v6; | |
1431 v4 = Dst.uItemID; | |
1432 } | |
1433 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) | |
570 | 1434 Dst.uEnchantmentType = 2 * rand() % 4 + 2; |
0 | 1435 pItemsTable->SetSpecialBonus(&Dst); |
1436 if ( !pParty->AddItem(&Dst) ) | |
1437 pParty->SetHoldingItem(&Dst); | |
1438 pActor->uCarriedItemID = 0; | |
1439 if ( pActor->array_000234[0].uItemID ) | |
1440 { | |
1441 if ( !pParty->AddItem(pActor->array_000234) ) | |
1442 { | |
1443 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1444 pParty->SetHoldingItem(pActor->array_000234); | |
1445 } | |
1446 pActor->array_000234[0].Reset(); | |
1447 } | |
1448 if ( pActor->array_000234[1].uItemID ) | |
1449 { | |
1450 if ( !pParty->AddItem(&pActor->array_000234[1]) ) | |
1451 { | |
1452 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1453 pParty->SetHoldingItem(&pActor->array_000234[1]); | |
1454 } | |
1455 pActor->array_000234[1].Reset(); | |
1456 } | |
1457 LABEL_55: | |
1458 pActor->Remove(); | |
1459 return; | |
1460 } | |
1461 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) | |
1462 { | |
1463 if ( pActor->array_000234[3].uItemID ) | |
1464 { | |
1465 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); | |
1466 pActor->array_000234[3].Reset(); | |
1467 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1468 if ( v14 ) | |
1469 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); | |
1470 else | |
1471 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); | |
1472 ShowStatusBarString(pTmpBuf2, 2u); | |
1473 if ( !pParty->AddItem(&Dst) ) | |
1474 pParty->SetHoldingItem(&Dst); | |
1475 v13 = 1; | |
1476 } | |
1477 goto LABEL_44; | |
1478 } | |
1479 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | |
1480 { | |
1481 LABEL_44: | |
1482 v8 = pParty; | |
1483 goto LABEL_45; | |
1484 } | |
1485 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | |
1486 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1487 if ( v14 ) | |
1488 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); | |
1489 else | |
1490 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); | |
1491 ShowStatusBarString(pTmpBuf2, 2u); | |
1492 v8 = pParty; | |
1493 if ( !pParty->AddItem(&Dst) ) | |
1494 pParty->SetHoldingItem(&Dst); | |
1495 v13 = 1; | |
1496 LABEL_45: | |
1497 if ( pActor->array_000234[0].uItemID ) | |
1498 { | |
1499 if ( !v8->AddItem(pActor->array_000234) ) | |
1500 { | |
1501 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1502 v8->SetHoldingItem(pActor->array_000234); | |
1503 v13 = 1; | |
1504 } | |
1505 pActor->array_000234[0].Reset(); | |
1506 } | |
1507 if ( pActor->array_000234[1].uItemID ) | |
1508 { | |
1509 if ( !v8->AddItem(&pActor->array_000234[1]) ) | |
1510 { | |
1511 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1512 v8->SetHoldingItem(&pActor->array_000234[1]); | |
1513 v13 = 1; | |
1514 } | |
1515 pActor->array_000234[1].Reset(); | |
1516 } | |
1517 if ( !v13 || rand() % 100 < 90 ) | |
1518 goto LABEL_55; | |
1519 } | |
1520 | |
1521 //----- (00426E10) -------------------------------------------------------- | |
1522 int stru319::which_player_would_attack(Actor *pActor) | |
1523 { | |
1524 signed int v2; // ebx@1 | |
1525 int v3; // ecx@2 | |
1526 signed int v4; // edx@3 | |
1527 char v5; // zf@3 | |
1528 unsigned int v6; // eax@3 | |
1529 int v7; // eax@6 | |
1530 int v8; // eax@7 | |
1531 int v9; // eax@8 | |
1532 int v10; // eax@9 | |
1533 int v11; // eax@10 | |
1534 int v12; // eax@11 | |
1535 int v13; // esi@35 | |
1536 signed int v14; // edi@37 | |
1537 enum CHARACTER_RACE v15; // eax@44 | |
1538 Player *v16; // ecx@47 | |
1539 unsigned __int8 v17; // sf@50 | |
1540 unsigned __int8 v18; // of@50 | |
1541 int v19; // esi@52 | |
1542 Player *v20; // ecx@53 | |
1543 int result; // eax@57 | |
1544 int v22[16]; // [sp+8h] [bp-140h]@3 | |
1545 int v23[60]; // [sp+48h] [bp-100h]@48 | |
1546 int v24; // [sp+138h] [bp-10h]@2 | |
1547 int v25; // [sp+13Ch] [bp-Ch]@1 | |
1548 int v26; // [sp+140h] [bp-8h]@1 | |
1549 int v27; // [sp+144h] [bp-4h]@1 | |
1550 | |
1551 v27 = -1; | |
1552 v26 = -1; | |
1553 v25 = -1; | |
1554 v2 = 0; | |
1555 if ( pActor->pMonsterInfo.uAttackPreference ) | |
1556 { | |
1557 v3 = 0; | |
1558 v24 = 0; | |
1559 do | |
1560 { | |
1561 v4 = 1; | |
1562 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); | |
1563 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; | |
1564 v22[v3] = v6; | |
1565 if ( !v5 ) | |
1566 { | |
1567 if ( (signed int)v6 > 128 ) | |
1568 { | |
1569 switch ( v6 ) | |
1570 { | |
1571 case 0x100u: | |
1572 v27 = 8; | |
1573 break; | |
1574 case 0x200u: | |
1575 v25 = 0; | |
1576 break; | |
1577 case 0x400u: | |
1578 v25 = 1; | |
1579 break; | |
1580 case 0x800u: | |
1581 v26 = 0; | |
1582 break; | |
1583 case 0x1000u: | |
1584 v26 = 1; | |
1585 break; | |
1586 case 0x2000u: | |
1587 v26 = 3; | |
1588 break; | |
1589 case 0x4000u: | |
1590 v26 = 2; | |
1591 break; | |
1592 } | |
1593 } | |
1594 else | |
1595 { | |
1596 if ( v6 == 128 ) | |
1597 { | |
1598 v27 = 4; | |
1599 } | |
1600 else | |
1601 { | |
1602 v7 = v6 - 1; | |
1603 if ( v7 ) | |
1604 { | |
1605 v8 = v7 - 1; | |
1606 if ( v8 ) | |
1607 { | |
1608 v9 = v8 - 2; | |
1609 if ( v9 ) | |
1610 { | |
1611 v10 = v9 - 4; | |
1612 if ( v10 ) | |
1613 { | |
1614 v11 = v10 - 8; | |
1615 if ( v11 ) | |
1616 { | |
1617 v12 = v11 - 16; | |
1618 if ( v12 ) | |
1619 { | |
1620 if ( v12 == 32 ) | |
1621 v27 = 20; | |
1622 } | |
1623 else | |
1624 { | |
1625 v27 = 32; | |
1626 } | |
1627 } | |
1628 else | |
1629 { | |
1630 v27 = 24; | |
1631 } | |
1632 } | |
1633 else | |
1634 { | |
1635 v27 = 28; | |
1636 } | |
1637 } | |
1638 else | |
1639 { | |
1640 v27 = 16; | |
1641 } | |
1642 } | |
1643 else | |
1644 { | |
1645 v27 = 12; | |
1646 } | |
1647 } | |
1648 else | |
1649 { | |
1650 v27 = 0; | |
1651 } | |
1652 } | |
1653 } | |
1654 v2 = 0; | |
1655 v13 = 0; | |
1656 while ( 1 ) | |
1657 { | |
1658 v14 = 0; | |
135 | 1659 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType ) |
0 | 1660 v14 = v4; |
1661 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) | |
1662 v14 = v4; | |
1663 if ( v26 != -1 ) | |
1664 { | |
1665 v15 = pPlayers[v13 + 1]->GetRace(); | |
1666 if ( v26 == v15 ) | |
1667 v14 = 1; | |
1668 } | |
1669 if ( v14 == 1 ) | |
1670 { | |
1671 v16 = pPlayers[v13 + 1]; | |
1672 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) | |
1673 v23[v2++] = v13; | |
1674 } | |
1675 ++v13; | |
1676 if ( v13 >= 4 ) | |
1677 break; | |
1678 v4 = 1; | |
1679 } | |
1680 } | |
1681 v3 = v24 + 1; | |
1682 v18 = __OFSUB__(v24 + 1, 15); | |
1683 v17 = v24++ - 14 < 0; | |
1684 } | |
1685 while ( v17 ^ v18 ); | |
1686 if ( v2 ) | |
1687 goto LABEL_61; | |
1688 } | |
1689 v19 = 0; | |
1690 do | |
1691 { | |
1692 v20 = pPlayers[v19 + 1]; | |
1693 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) | |
1694 v23[v2++] = v19; | |
1695 ++v19; | |
1696 } | |
1697 while ( v19 < 4 ); | |
1698 if ( v2 ) | |
1699 LABEL_61: | |
1700 result = v23[rand() % v2]; | |
1701 else | |
1702 result = 0; | |
1703 return result; | |
1704 } | |
1705 | |
1706 | |
1707 //----- (0042704B) -------------------------------------------------------- | |
1708 bool stru319::special_ability_use_check(Actor *pActor, int a2) | |
1709 { | |
1710 stru319 *v3; // edi@1 | |
1711 signed int v4; // ebx@5 | |
1712 signed int v5; // edi@5 | |
1713 | |
1714 v3 = this; | |
1715 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
1716 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
1717 && rand() % 100 < 5 ) | |
1718 pActor->_44FD29(a2); | |
1719 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); | |
1720 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); | |
1721 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
1722 return 2; | |
1723 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
1724 return 3; | |
1725 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance; | |
1726 } | |
1727 | |
1728 //----- (00427102) -------------------------------------------------------- | |
1729 int stru319::_427102(Actor *pActor, signed int a2) | |
1730 { | |
1731 unsigned __int8 v3; // cf@11 | |
1732 unsigned __int8 v4; // zf@11 | |
1733 SpellBuff *v6; // ecx@46 | |
89 | 1734 Player *v7; // esi@49 |
0 | 1735 signed int v8; // edx@50 |
89 | 1736 SpellBuff *v9; // ecx@50 |
0 | 1737 |
1738 if ( a2 > 73 ) | |
1739 { | |
1740 if ( a2 == 77 ) | |
1741 { | |
1742 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP ) | |
1743 return 0; | |
1744 return 1; | |
1745 } | |
1746 if ( a2 == 80 ) | |
1747 { | |
1748 v6 = pParty->pPartyBuffs; | |
1749 while ( (signed __int64)v6->uExpireTime <= 0 ) | |
1750 { | |
1751 ++v6; | |
89 | 1752 if ( v6 > &pParty->pPartyBuffs[19] ) |
1753 { | |
1754 v7 = pParty->pPlayers;//[0].pPlayerBuffs; | |
0 | 1755 v8 = 0; |
89 | 1756 v9 = v7->pPlayerBuffs; |
1757 while ( v9->uExpireTime <= 0i64 ) | |
0 | 1758 { |
1759 ++v8; | |
89 | 1760 ++v9; |
0 | 1761 if ( v8 >= 24 ) |
1762 { | |
89 | 1763 ++v7; |
1764 if ( v7 <= &pParty->pPlayers[3] ) | |
1765 { | |
1766 v8 = 0; | |
1767 v9 = v7->pPlayerBuffs; | |
1768 } | |
1769 else | |
1770 return 0; | |
0 | 1771 } |
1772 } | |
1773 return 1; | |
1774 } | |
1775 } | |
1776 return 1; | |
1777 } | |
1778 if ( a2 == 85 ) | |
1779 { | |
1780 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 ) | |
1781 return 1; | |
1782 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 ) | |
1783 return 0; | |
1784 v3 = 0; | |
1785 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0; | |
1786 } | |
1787 else | |
1788 { | |
1789 if ( a2 == 86 ) | |
1790 { | |
1791 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 ) | |
1792 return 1; | |
1793 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 ) | |
1794 return 0; | |
1795 v3 = 0; | |
1796 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0; | |
1797 } | |
1798 else | |
1799 { | |
1800 if ( a2 != 95 || SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 ) | |
1801 return 1; | |
1802 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 ) | |
1803 return 0; | |
1804 v3 = 0; | |
1805 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0; | |
1806 } | |
1807 } | |
1808 } | |
1809 else | |
1810 { | |
1811 if ( a2 == 73 ) | |
1812 { | |
1813 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 ) | |
1814 return 1; | |
1815 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 ) | |
1816 return 0; | |
1817 v3 = 0; | |
1818 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0; | |
1819 } | |
89 | 1820 else if ( a2 == 5 ) |
0 | 1821 { |
1822 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 ) | |
1823 return 1; | |
1824 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 ) | |
1825 return 0; | |
1826 v3 = 0; | |
1827 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0; | |
1828 } | |
89 | 1829 else if ( a2 == 17 ) |
0 | 1830 { |
1831 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 ) | |
1832 return 1; | |
1833 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 ) | |
1834 return 0; | |
1835 v3 = 0; | |
1836 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0; | |
1837 } | |
89 | 1838 else if ( a2 == 38 ) |
0 | 1839 { |
1840 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 ) | |
1841 return 1; | |
1842 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 ) | |
1843 return 0; | |
1844 v3 = 0; | |
1845 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0; | |
1846 } | |
89 | 1847 else if ( a2 == 46 ) |
0 | 1848 { |
1849 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 ) | |
1850 return 1; | |
1851 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 ) | |
1852 return 0; | |
1853 v3 = 0; | |
1854 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0; | |
1855 } | |
89 | 1856 else |
1857 { | |
1858 if ( a2 != 47 ) | |
1859 { | |
1860 if ( a2 != 51 || SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 ) | |
1861 return 1; | |
1862 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 ) | |
1863 { | |
1864 v3 = 0; | |
1865 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0; | |
1866 } | |
1867 else | |
1868 return 0; | |
1869 } | |
1870 else | |
1871 { | |
1872 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 ) | |
1873 return 1; | |
1874 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 ) | |
1875 return 0; | |
1876 v3 = 0; | |
1877 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0; | |
1878 } | |
1879 } | |
0 | 1880 } |
1881 if ( !(v3 | v4) ) | |
1882 return 0; | |
1883 return 1; | |
1884 } | |
1885 | |
1886 //----- (004272F5) -------------------------------------------------------- | |
1887 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
1888 { | |
1889 signed int v5; // esi@1 | |
1890 signed int v6; // edi@1 | |
1891 int v7; // esi@8 | |
1892 int v8; // eax@9 | |
1893 int v9; // edx@11 | |
1894 int v10; // edx@13 | |
1895 int v11; // esi@13 | |
1896 unsigned __int8 v12; // sf@13 | |
1897 unsigned __int8 v13; // of@13 | |
1898 int v14; // edx@14 | |
1899 int v15; // eax@14 | |
1900 signed int result; // eax@17 | |
1901 | |
1902 v5 = pActor->pMonsterInfo.uAC; | |
1903 v6 = 0; | |
1904 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 ) | |
1905 v5 /= 2; | |
1906 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1907 v6 = pActor->pActorBuffs[15].uPower; | |
1908 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 ) | |
1909 v6 = pActor->pActorBuffs[16].uPower; | |
1910 v7 = v6 + v5; | |
1911 if ( a3 ) | |
1912 v8 = pPlayer->GetRangedAttack(); | |
1913 else | |
1914 v8 = pPlayer->GetActualAttack(0); | |
1915 v9 = rand() % (v7 + 2 * v8 + 30); | |
1916 if ( a3 == 2 ) | |
1917 { | |
1918 v14 = a4 + v9; | |
1919 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1920 } | |
1921 else | |
1922 { | |
1923 if ( a3 != 3 ) | |
1924 { | |
1925 v10 = a4 + v9; | |
1926 v11 = v7 + 15; | |
1927 v13 = __OFSUB__(v10, v11); | |
1928 v12 = v10 - v11 < 0; | |
1929 goto LABEL_16; | |
1930 } | |
1931 v14 = a4 + v9; | |
1932 v15 = 2 * v7 + 30; | |
1933 } | |
1934 v13 = __OFSUB__(v14, v15); | |
1935 v12 = v14 - v15 < 0; | |
1936 LABEL_16: | |
1937 if ( v12 ^ v13 ) | |
1938 result = 0; | |
1939 else | |
1940 result = 1; | |
1941 return result; | |
1942 } | |
1943 | |
1944 //----- (004273BB) -------------------------------------------------------- | |
1945 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
1946 { | |
1947 Actor *v5; // ecx@1 | |
1948 signed int v6; // ebx@1 | |
1949 signed int v7; // esi@1 | |
1950 unsigned __int8 v8; // zf@1 | |
1951 unsigned __int8 v9; // sf@1 | |
1952 int v10; // ebx@10 | |
1953 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
1954 | |
1955 v5 = a2; | |
1956 v6 = a2->pMonsterInfo.uAC; | |
1957 v7 = 0; | |
1958 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0; | |
1959 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0; | |
1960 a2a = 0; | |
1961 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) ) | |
1962 v6 /= 2; | |
1963 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 ) | |
1964 v7 = v5->pActorBuffs[14].uPower; | |
1965 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 ) | |
1966 v7 = v5->pActorBuffs[16].uPower; | |
1967 v10 = v7 + v6; | |
1968 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1969 a2a = pActor->pActorBuffs[14].uPower; | |
1970 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a ) | |
1971 a2a = pActor->pActorBuffs[17].uPower; | |
1972 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1973 { | |
1974 a2a += pActor->pActorBuffs[11].uPower; | |
1975 pActor->pActorBuffs[11].Reset(); | |
1976 } | |
1977 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
1978 } | |
1979 | |
1980 //----- (004274AD) -------------------------------------------------------- | |
1981 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
1982 { | |
1983 signed int v3; // edi@1 | |
1984 signed int v4; // esi@8 | |
1985 int v5; // esi@8 | |
1986 | |
1987 v3 = 0; | |
1988 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1989 v3 = pActor->pActorBuffs[14].uPower; | |
1990 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 ) | |
1991 v3 = pActor->pActorBuffs[17].uPower; | |
1992 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1993 { | |
1994 v3 += pActor->pActorBuffs[11].uPower; | |
1995 pActor->pActorBuffs[11].Reset(); | |
1996 } | |
1997 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
1998 v5 = rand() % v4 + 1; | |
1999 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
2000 } | |
2001 | |
2002 //----- (00427546) -------------------------------------------------------- | |
2003 int stru319::_427546(int a2) | |
2004 { | |
2005 int result; // eax@2 | |
2006 | |
2007 if ( a2 >= 0 ) | |
2008 { | |
2009 if ( a2 >= 1 ) | |
2010 result = (a2 >= 2) + 2; | |
2011 else | |
2012 result = 1; | |
2013 } | |
2014 else | |
2015 { | |
2016 result = 0; | |
2017 } | |
2018 return result; | |
2019 } | |
2020 | |
2021 //----- (0042756B) -------------------------------------------------------- | |
2022 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
2023 { | |
2024 int v4; // edx@1 | |
2025 int v5; // ecx@1 | |
2026 signed int v6; // eax@4 | |
2027 signed int result; // eax@17 | |
2028 signed int v8; // esi@18 | |
2029 | |
2030 v4 = 0; | |
2031 v5 = 0; | |
2032 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
2033 v5 = pActor->pActorBuffs[14].uPower; | |
2034 switch ( a2 ) | |
2035 { | |
2036 case 4: | |
2037 v6 = pActor->pMonsterInfo.uResPhysical; | |
2038 break; | |
2039 case 0: | |
2040 v6 = pActor->pMonsterInfo.uResFire; | |
2041 goto LABEL_12; | |
2042 case 1: | |
2043 v6 = pActor->pMonsterInfo.uResAir; | |
2044 goto LABEL_12; | |
2045 case 2: | |
2046 v6 = pActor->pMonsterInfo.uResWater; | |
2047 goto LABEL_12; | |
2048 case 3: | |
2049 v6 = pActor->pMonsterInfo.uResEarth; | |
2050 goto LABEL_12; | |
2051 case 6: | |
2052 v6 = pActor->pMonsterInfo.uResSpirit; | |
2053 break; | |
2054 case 7: | |
2055 v6 = pActor->pMonsterInfo.uResMind; | |
2056 goto LABEL_12; | |
2057 case 8: | |
2058 v6 = pActor->pMonsterInfo.uResBody; | |
2059 LABEL_12: | |
2060 v4 = v5; | |
2061 break; | |
2062 case 9: | |
2063 v6 = pActor->pMonsterInfo.uResLight; | |
2064 break; | |
2065 case 10: | |
2066 v6 = pActor->pMonsterInfo.uResDark; | |
2067 break; | |
2068 default: | |
2069 v6 = 0; | |
2070 break; | |
2071 } | |
2072 if ( v6 < 200 ) | |
2073 { | |
2074 v8 = v4 + v6 + 30; | |
2075 if ( rand() % v8 >= 30 ) | |
2076 { | |
2077 a3 >>= 1; | |
2078 if ( rand() % v8 >= 30 ) | |
2079 { | |
2080 a3 >>= 1; | |
2081 if ( rand() % v8 >= 30 ) | |
2082 { | |
2083 a3 >>= 1; | |
2084 if ( rand() % v8 >= 30 ) | |
2085 a3 >>= 1; | |
2086 } | |
2087 } | |
2088 } | |
2089 result = a3; | |
2090 } | |
2091 else | |
2092 { | |
2093 result = 0; | |
2094 } | |
2095 return result; | |
2096 } | |
2097 | |
2098 //----- (00427662) -------------------------------------------------------- | |
2099 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
2100 { | |
2101 Actor *v3; // edi@2 | |
2102 signed int v4; // esi@2 | |
2103 bool result; // eax@13 | |
2104 | |
2105 switch ( uType ) | |
2106 { | |
2107 case 0u: | |
2108 v3 = pActor; | |
2109 v4 = pActor->pMonsterInfo.uResFire; | |
2110 goto LABEL_12; | |
2111 case 1u: | |
2112 v3 = pActor; | |
2113 v4 = pActor->pMonsterInfo.uResAir; | |
2114 goto LABEL_12; | |
2115 case 2u: | |
2116 v3 = pActor; | |
2117 v4 = pActor->pMonsterInfo.uResWater; | |
2118 goto LABEL_12; | |
2119 case 3u: | |
2120 v3 = pActor; | |
2121 v4 = pActor->pMonsterInfo.uResEarth; | |
2122 goto LABEL_12; | |
2123 case 7u: | |
2124 v3 = pActor; | |
2125 v4 = pActor->pMonsterInfo.uResMind; | |
2126 goto LABEL_12; | |
2127 case 6u: | |
2128 v3 = pActor; | |
2129 v4 = pActor->pMonsterInfo.uResSpirit; | |
2130 goto LABEL_12; | |
2131 case 8u: | |
2132 v3 = pActor; | |
2133 v4 = pActor->pMonsterInfo.uResBody; | |
2134 goto LABEL_12; | |
2135 case 9u: | |
2136 v3 = pActor; | |
2137 v4 = pActor->pMonsterInfo.uResLight; | |
2138 goto LABEL_12; | |
2139 case 0xAu: | |
2140 v3 = pActor; | |
2141 v4 = pActor->pMonsterInfo.uResDark; | |
2142 goto LABEL_12; | |
2143 case 4u: | |
2144 v3 = pActor; | |
2145 v4 = pActor->pMonsterInfo.uResPhysical; | |
2146 LABEL_12: | |
2147 if ( v4 < 200 ) | |
2148 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | |
2149 else | |
2150 result = 0; | |
2151 break; | |
2152 default: | |
2153 result = 1; | |
2154 break; | |
2155 } | |
2156 return result; | |
2157 } | |
2158 | |
2159 | |
2160 //----- (00427769) -------------------------------------------------------- | |
2161 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
2162 { | |
2163 bool result; // eax@2 | |
2164 | |
2165 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) | |
2166 result = 1; | |
2167 else | |
2168 result = 0; | |
2169 return result; | |
2170 } | |
2171 | |
2172 //----- (0042777D) -------------------------------------------------------- | |
319 | 2173 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) |
0 | 2174 { |
370 | 2175 //bool result; // eax@2 |
486 | 2176 //__int16 v6; // bx@4 |
437 | 2177 //Player *v7; // eax@4 |
486 | 2178 //char v8; // zf@12 |
0 | 2179 unsigned __int16 v9; // cx@16 |
2180 unsigned int v10; // eax@18 | |
2181 unsigned __int8 v11; // sf@18 | |
2182 unsigned __int8 v12; // of@18 | |
2183 unsigned __int16 v13; // cx@21 | |
2184 unsigned int v14; // eax@23 | |
486 | 2185 //stru277 *v15; // esi@27 |
2186 //stru277 *v16; // eax@28 | |
0 | 2187 GUIWindow *v17; // eax@43 |
2188 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | |
2189 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | |
2190 unsigned int v20; // [sp-28h] [bp-40h]@44 | |
2191 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | |
2192 unsigned int v22; // [sp-20h] [bp-38h]@44 | |
2193 int v23; // [sp-1Ch] [bp-34h]@44 | |
2194 int v24; // [sp-18h] [bp-30h]@44 | |
2195 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | |
2196 unsigned int v26; // [sp-10h] [bp-28h]@43 | |
2197 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | |
2198 char *v28; // [sp-8h] [bp-20h]@43 | |
2199 Texture *v29; // [sp-4h] [bp-1Ch]@43 | |
486 | 2200 //__int16 a3a; // [sp+10h] [bp-8h]@1 |
2201 //__int16 a2a; // [sp+14h] [bp-4h]@1 | |
2202 | |
2203 //a3a = uPlayerID; | |
2204 //a2a = a1; | |
370 | 2205 |
2206 //if ( pParty->bTurnBasedModeOn != 1 | |
2207 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | |
2208 if (pParty->bTurnBasedModeOn) | |
0 | 2209 { |
370 | 2210 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) |
2211 return; | |
2212 } | |
2213 | |
2214 | |
486 | 2215 //v6 = a5; |
437 | 2216 //v7 = &pParty->pPlayers[uPlayerID]; |
2217 assert(uPlayerID < 4); | |
2218 auto player = &pParty->pPlayers[uPlayerID]; | |
0 | 2219 if ( !(a5 & 0x10) ) |
2220 { | |
2221 switch ( a1 ) | |
2222 { | |
486 | 2223 case SPELL_SPIRIT_FATE: |
2224 case SPELL_BODY_FIRST_AID: | |
2225 case SPELL_DARK_REANIMATE: | |
2226 //HIBYTE(v6) = HIBYTE(a5) | 1; | |
2227 a5 |= 0x0100; | |
0 | 2228 break; |
486 | 2229 |
2230 case SPELL_FIRE_FIRE_AURA: | |
2231 case SPELL_WATER_RECHARGE_ITEM: | |
2232 case SPELL_WATER_ENCHANT_ITEM: | |
2233 case SPELL_DARK_VAMPIRIC_WEAPON: | |
2234 //LOBYTE(v6) = a5 | 0x80; | |
2235 a5 |= 0x0080; | |
0 | 2236 break; |
486 | 2237 |
2238 case SPELL_FIRE_FIRE_BOLT: | |
2239 case SPELL_FIRE_FIREBALL: | |
2240 case SPELL_FIRE_INCINERATE: | |
2241 case SPELL_AIR_LIGHNING_BOLT: | |
2242 case SPELL_AIR_IMPLOSION: | |
2243 case SPELL_WATER_POISON_SPRAY: | |
2244 case SPELL_WATER_ICE_BOLT: | |
2245 case SPELL_WATER_ACID_BURST: | |
2246 case SPELL_WATER_ICE_BLAST: | |
2247 case SPELL_EARTH_STUN: | |
2248 case SPELL_EARTH_SLOW: | |
2249 case SPELL_EARTH_DEADLY_SWARM: | |
2250 case SPELL_EARTH_BLADES: | |
2251 case SPELL_EARTH_MASS_DISTORTION: | |
2252 case SPELL_SPIRIT_SPIRIT_LASH: | |
2253 case SPELL_MIND_MIND_BLAST: | |
2254 case SPELL_MIND_CHARM: | |
2255 case SPELL_MIND_PSYCHIC_SHOCK: | |
2256 case SPELL_BODY_HARM: | |
2257 case SPELL_BODY_FLYING_FIST: | |
2258 case SPELL_LIGHT_LIGHT_BOLT: | |
2259 case SPELL_LIGHT_DESTROY_UNDEAD: | |
2260 case SPELL_LIGHT_SUNRAY: | |
2261 case SPELL_DARK_TOXIC_CLOUD: | |
2262 case SPELL_DARK_SHRINKING_RAY: | |
2263 case SPELL_DARK_SHARPMETAL: | |
2264 case SPELL_DARK_DRAGON_BREATH: | |
0 | 2265 if ( !a6 ) |
486 | 2266 a5 |= 0x0008; |
0 | 2267 break; |
486 | 2268 case SPELL_MIND_TELEPATHY: |
2269 case SPELL_MIND_BERSERK: | |
2270 case SPELL_MIND_ENSLAVE: | |
2271 case SPELL_LIGHT_PARALYZE: | |
2272 case SPELL_DARK_CONTROL_UNDEAD: | |
2273 //LABEL_9: | |
2274 //v6 = a5 | 8; | |
2275 a5 |= 0x0008; | |
0 | 2276 break; |
486 | 2277 |
2278 case SPELL_EARTH_TELEKINESIS: | |
2279 a5 |= 0x0040; | |
2280 break; | |
2281 | |
2282 case SPELL_SPIRIT_BLESS: | |
2283 if (a4 && ~a4 & 0x01C0) | |
2284 goto LABEL_25; | |
2285 else if ((player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0); | |
0 | 2286 goto LABEL_25; |
2287 break; | |
486 | 2288 |
2289 case SPELL_SPIRIT_PRESERVATION: | |
0 | 2290 v9 = a4; |
2291 if ( !a4 ) | |
437 | 2292 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT]; |
0 | 2293 goto LABEL_18; |
486 | 2294 |
2295 case SPELL_DARK_PAIN_REFLECTION: | |
0 | 2296 v9 = a4; |
2297 if ( !a4 ) | |
437 | 2298 v9 = player->pActiveSkills[PLAYER_SKILL_DARK]; |
0 | 2299 LABEL_18: |
2300 v10 = SkillToMastery(v9); | |
2301 v12 = __OFSUB__(v10, 3); | |
2302 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2303 goto LABEL_24; | |
486 | 2304 |
2305 case SPELL_BODY_HAMMERHANDS: | |
0 | 2306 v13 = a4; |
2307 if ( !a4 ) | |
437 | 2308 v13 = player->pActiveSkills[PLAYER_SKILL_BODY]; |
0 | 2309 v14 = SkillToMastery(v13); |
2310 v12 = __OFSUB__(v14, 4); | |
2311 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2312 LABEL_24: | |
2313 if ( v11 ^ v12 ) | |
2314 goto LABEL_25; | |
2315 break; | |
486 | 2316 |
2317 case SPELL_EARTH_STONE_TO_FLESH: | |
2318 case SPELL_SPIRIT_REMOVE_CURSE: | |
2319 case SPELL_SPIRIT_RAISE_DEAD: | |
2320 case SPELL_SPIRIT_RESSURECTION: | |
2321 case SPELL_MIND_REMOVE_FEAR: | |
2322 case SPELL_MIND_CURE_PARALYSIS: | |
2323 case SPELL_MIND_CURE_INSANITY: | |
2324 case SPELL_BODY_CURE_WEAKNESS: | |
2325 case SPELL_BODY_REGENERATION: | |
2326 case SPELL_BODY_CURE_POISON: | |
2327 case SPELL_BODY_CURE_DISEASE: | |
0 | 2328 LABEL_25: |
486 | 2329 //v6 = a5 | 2; |
2330 a5 |= 0x0002; | |
0 | 2331 break; |
486 | 2332 |
2333 case SPELL_DARK_SACRIFICE: | |
2334 //HIBYTE(v6) = HIBYTE(a5) | 2; | |
2335 a5 |= 0x0200; | |
0 | 2336 break; |
2337 default: | |
2338 break; | |
2339 } | |
2340 } | |
370 | 2341 |
486 | 2342 |
2343 if (a5 & 0x3CA) | |
0 | 2344 { |
486 | 2345 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); |
2346 for (uint i = 0; i < 10; ++i) | |
2347 if (pStru277[i].field_8 & 0x3CA) | |
2348 { | |
2349 pStru277[i].spellnum = 0; | |
2350 break; | |
2351 } | |
0 | 2352 } |
486 | 2353 |
2354 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); | |
2355 for (uint i = 0; i < 10; ++i) | |
0 | 2356 { |
486 | 2357 auto spell = pStru277 + i; |
2358 if (!spell->spellnum) | |
2359 continue; | |
2360 | |
2361 spell->spellnum = 0; | |
2362 if (spell->field_8 & 0x3CA) | |
0 | 2363 { |
486 | 2364 pGUIWindow_Settings->Release(); |
2365 pGUIWindow_Settings = nullptr; | |
2366 pMouse->SetCursorBitmap("MICON1"); | |
2367 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2368 unk_50C9A0 = 0; | |
2369 back_to_game(); | |
0 | 2370 } |
2371 } | |
486 | 2372 |
2373 int result = pStru277->PushStru277(a1, uPlayerID, a4, a5, a6); | |
0 | 2374 if ( result != -1 ) |
2375 { | |
486 | 2376 if ( a5 & 2 ) |
0 | 2377 { |
2378 if ( pGUIWindow_Settings ) | |
319 | 2379 return; |
0 | 2380 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2381 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2382 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2383 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2384 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
319 | 2385 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2386 return; | |
0 | 2387 } |
486 | 2388 if ( a5 & 8 ) |
0 | 2389 { |
2390 if ( pGUIWindow_Settings ) | |
319 | 2391 return; |
0 | 2392 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2393 v29 = 0; | |
2394 v28 = ""; | |
2395 v27 = 0; | |
2396 v26 = 0; | |
2397 v25 = 70; | |
2398 LABEL_44: | |
2399 v24 = 0; | |
2400 v23 = 1; | |
2401 v22 = 344; | |
2402 v21 = 460; | |
2403 v20 = 8; | |
2404 v19 = 8; | |
2405 pGUIWindow_Settings = v17; | |
2406 v18 = v17; | |
2407 LABEL_56: | |
2408 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
319 | 2409 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2410 return; | |
0 | 2411 } |
486 | 2412 if ( a5 & 0x40 ) |
0 | 2413 { |
2414 if ( pGUIWindow_Settings ) | |
319 | 2415 return; |
0 | 2416 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2417 v29 = 0; | |
2418 v28 = ""; | |
2419 v27 = 0; | |
2420 v26 = 0; | |
2421 v25 = 190; | |
2422 goto LABEL_44; | |
2423 } | |
486 | 2424 if ( (char)a5 < 0 ) |
0 | 2425 { |
2426 if ( pGUIWindow_Settings ) | |
319 | 2427 return; |
0 | 2428 ++pIcons_LOD->uTexturePacksCount; |
2429 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2430 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2431 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2432 unk_50C9A0 = 1; | |
2433 some_active_character = uActiveCharacter; | |
319 | 2434 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2435 return; | |
0 | 2436 } |
486 | 2437 if ( HIBYTE(a5) & 1 ) |
0 | 2438 { |
2439 if ( pGUIWindow_Settings ) | |
319 | 2440 return; |
2441 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
0 | 2442 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); |
2443 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2444 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2445 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
423 | 2446 pGUIWindow_Settings->CreateButton(8, 8, 460, 344, 1, 0, 140, 0, 0, "", NULL); |
2447 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
0 | 2448 } |
486 | 2449 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) |
0 | 2450 { |
319 | 2451 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
0 | 2452 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( |
2453 0x1D5u, | |
2454 0xB2u, | |
319 | 2455 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), |
2456 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
0 | 2457 1, |
2458 0, | |
2459 0xBCu, | |
2460 0, | |
2461 0, | |
2462 "", | |
319 | 2463 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), |
0 | 2464 0); |
2465 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2466 0x272u, | |
2467 0xB2u, | |
319 | 2468 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), |
2469 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
0 | 2470 1, |
2471 0, | |
2472 0xBCu, | |
2473 1u, | |
2474 0, | |
2475 "", | |
319 | 2476 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), |
0 | 2477 0); |
2478 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
319 | 2479 pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0); |
0 | 2480 } |
2481 } | |
2482 } | |
2483 | |
2484 | |
2485 | |
2486 //----- (00427D48) -------------------------------------------------------- | |
2487 void stru277::_427D48(unsigned int uPlayerID) | |
2488 { | |
2489 stru277 *v2; // esi@1 | |
2490 signed int v3; // ebx@1 | |
2491 | |
2492 v2 = this; | |
2493 v3 = 10; | |
2494 do | |
2495 { | |
2496 if ( v2->spellnum ) | |
2497 { | |
2498 if ( v2->field_8 & 0x3CA ) | |
2499 { | |
2500 v2->spellnum = 0; | |
2501 pGUIWindow_Settings->Release(); | |
2502 pGUIWindow_Settings = 0; | |
2503 pMouse->SetCursorBitmap("MICON1"); | |
2504 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2505 unk_50C9A0 = 0; | |
2506 back_to_game(); | |
2507 } | |
2508 } | |
2509 ++v2; | |
2510 --v3; | |
2511 } | |
2512 while ( v3 ); | |
2513 } | |
2514 | |
2515 //----- (00427DA0) -------------------------------------------------------- | |
488 | 2516 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int a6) |
0 | 2517 { |
2518 unsigned int result; // eax@1 | |
2519 stru277 *v7; // edx@1 | |
2520 stru277 *v8; // ecx@5 | |
2521 | |
2522 result = 0; | |
2523 v7 = this; | |
2524 while ( v7->spellnum ) | |
2525 { | |
2526 ++result; | |
2527 ++v7; | |
2528 if ( (signed int)result >= 10 ) | |
2529 goto LABEL_8; | |
2530 } | |
2531 v8 = &this[result]; | |
2532 v8->spellnum = a2; | |
2533 v8->uPlayerID = uPlayerID; | |
2534 if ( a5 & 0x10 ) | |
2535 v8->uPlayerID_2 = uPlayerID; | |
2536 v8->field_6 = 0; | |
488 | 2537 v8->spell_target_pid = 0; |
0 | 2538 v8->field_8 = a5; |
488 | 2539 v8->forced_spell_skill_level = skill_level; |
0 | 2540 v8->field_10 = a6; |
2541 LABEL_8: | |
2542 if ( result == 10 ) | |
2543 result = -1; | |
2544 return result; | |
2545 } | |
2546 | |
2547 //----- (00427E01) -------------------------------------------------------- | |
2548 void stru277::_427E01_cast_spell() | |
2549 { | |
486 | 2550 //int v1; // esi@1 |
0 | 2551 int v2; // edi@1 |
2552 stru277 *v3; // ebx@2 | |
488 | 2553 //signed int v4; // eax@8 |
2554 //__int16 v5; // ax@9 | |
0 | 2555 signed int v6; // eax@14 |
488 | 2556 //__int16 v7; // ax@23 |
2557 //__int16 v8; // ax@24 | |
2558 //char v9; // al@44 | |
2559 //int v10; // eax@45 | |
0 | 2560 unsigned __int16 v11; // cx@45 |
2561 signed int v12; // ecx@48 | |
490 | 2562 //int v13; // eax@53 |
0 | 2563 unsigned __int8 v14; // zf@53 |
488 | 2564 //unsigned int v15; // edx@53 |
2565 //signed int v16; // eax@53 | |
0 | 2566 Player *v17; // esi@70 |
2567 int v18; // eax@72 | |
2568 int v19; // eax@74 | |
2569 char *v20; // eax@74 | |
2570 signed int i; // esi@76 | |
2571 int v22; // eax@88 | |
2572 __int16 v23; // ax@88 | |
488 | 2573 //int v24; // ecx@93 |
2574 //int v25; // ecx@94 | |
2575 //signed __int64 v26; // qax@100 | |
2576 //char *v27; // ecx@100 | |
2577 //unsigned __int64 v28; // qax@102 | |
0 | 2578 int v29; // ecx@105 |
2579 int v30; // ecx@106 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
2580 //int v31; // eax@112 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
2581 //int v32; // eax@112 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
2582 //char *v33; // edx@113 |
0 | 2583 int v34; // eax@121 |
2584 int v35; // eax@123 | |
2585 int v36; // edx@125 | |
2586 int v37; // eax@129 | |
2587 signed int v38; // edi@129 | |
2588 signed int v39; // eax@129 | |
2589 int v40; // ecx@129 | |
2590 int v41; // eax@129 | |
2591 signed int v42; // eax@129 | |
2592 int *v43; // ecx@129 | |
2593 int v44; // eax@132 | |
2594 int v45; // ecx@132 | |
2595 int v46; // eax@132 | |
2596 unsigned int v47; // edx@133 | |
2597 int v48; // eax@137 | |
2598 int v49; // eax@137 | |
2599 int v50; // eax@141 | |
2600 int v51; // eax@146 | |
2601 __int16 v52; // ax@153 | |
2602 int v53; // eax@153 | |
2603 signed __int64 v54; // qax@164 | |
2604 int v55; // edi@164 | |
488 | 2605 //stru6 *v56; // eax@165 |
0 | 2606 int v57; // eax@169 |
2607 signed __int64 v58; // qax@177 | |
2608 int v59; // edi@177 | |
2609 unsigned __int16 v60; // ax@184 | |
2610 int v61; // ecx@184 | |
2611 int v62; // eax@186 | |
2612 int v63; // ecx@187 | |
2613 int v64; // ecx@188 | |
2614 int v65; // ecx@189 | |
2615 const char *v66; // ecx@200 | |
2616 unsigned int v67; // edx@201 | |
2617 char v68; // al@207 | |
89 | 2618 ItemGen *v69; // esi@211 |
0 | 2619 int v70; // ecx@214 |
2620 int v71; // ecx@215 | |
2621 int v72; // ecx@216 | |
488 | 2622 //__int16 v73; // ST1C_2@222 |
2623 //__int16 v74; // ST18_2@222 | |
2624 //stru6 *v75; // eax@222 | |
0 | 2625 int v76; // ecx@223 |
2626 int v77; // ecx@224 | |
2627 int v78; // ecx@225 | |
2628 int v79; // eax@227 | |
488 | 2629 //int v80; // eax@232 |
2630 //__int16 v81; // ST18_2@245 | |
2631 //stru6 *v82; // eax@245 | |
0 | 2632 signed int v83; // edi@245 |
488 | 2633 //__int16 v84; // ST18_2@245 |
2634 //stru6 *v85; // eax@245 | |
2635 //__int16 v86; // ST18_2@245 | |
2636 //stru6 *v87; // eax@245 | |
2637 //__int16 v88; // ST18_2@245 | |
2638 //stru6 *v89; // eax@245 | |
0 | 2639 double v90; // st7@245 |
2640 int v91; // eax@250 | |
89 | 2641 Player *v92; // eax@255 |
488 | 2642 //__int16 v93; // ST18_2@260 |
2643 //stru6 *v94; // eax@260 | |
2644 //__int16 v95; // ST18_2@260 | |
2645 //stru6 *v96; // eax@260 | |
2646 //__int16 v97; // ST18_2@260 | |
2647 //stru6 *v98; // eax@260 | |
2648 //__int16 v99; // ST18_2@260 | |
2649 //stru6 *v100; // eax@260 | |
0 | 2650 int v101; // ecx@261 |
2651 int v102; // ecx@262 | |
2652 int v103; // ecx@263 | |
2653 int v104; // eax@265 | |
2654 int v105; // edi@271 | |
488 | 2655 //__int16 v106; // ST18_2@272 |
2656 //stru6 *v107; // eax@272 | |
0 | 2657 __int16 v108; // ST1C_2@274 |
2658 __int16 v109; // ST18_2@274 | |
2659 stru6 *v110; // eax@274 | |
2660 int v111; // eax@274 | |
2661 Actor *v112; // esi@278 | |
2662 int v113; // eax@278 | |
2663 int v114; // ebx@278 | |
2664 unsigned int v115; // ecx@278 | |
2665 int v116; // edx@279 | |
2666 int v117; // edx@281 | |
2667 int v118; // edx@283 | |
2668 int v119; // edi@286 | |
2669 int v120; // eax@286 | |
2670 int v121; // eax@286 | |
2671 signed int v122; // eax@286 | |
2672 int v123; // ecx@288 | |
2673 int v124; // ecx@289 | |
2674 int v125; // ecx@290 | |
2675 int v126; // eax@292 | |
2676 int v127; // eax@296 | |
488 | 2677 //__int16 v128; // ST18_2@303 |
2678 //stru6 *v129; // eax@303 | |
2679 //__int16 v130; // ST18_2@303 | |
2680 //stru6 *v131; // eax@303 | |
2681 //__int16 v132; // ST18_2@303 | |
2682 //stru6 *v133; // eax@303 | |
2683 //__int16 v134; // ST18_2@303 | |
2684 //stru6 *v135; // eax@303 | |
2685 //unsigned __int64 v136; // qax@304 | |
2686 //char *v137; // ecx@304 | |
0 | 2687 int v138; // ecx@305 |
2688 int v139; // ecx@306 | |
2689 int v140; // eax@308 | |
488 | 2690 //__int16 v141; // ST18_2@311 |
2691 //stru6 *v142; // eax@311 | |
2692 //__int16 v143; // ST18_2@311 | |
2693 //stru6 *v144; // eax@311 | |
2694 //__int16 v145; // ST18_2@311 | |
2695 //stru6 *v146; // eax@311 | |
2696 //__int16 v147; // ST18_2@311 | |
2697 //stru6 *v148; // eax@311 | |
0 | 2698 int v149; // ecx@312 |
2699 int v150; // ecx@313 | |
2700 int v151; // ecx@314 | |
2701 signed int v152; // eax@322 | |
2702 int v153; // ecx@322 | |
2703 int v154; // eax@322 | |
2704 int v155; // eax@323 | |
2705 int v156; // eax@323 | |
2706 int v157; // eax@326 | |
2707 double v158; // st7@326 | |
2708 double v159; // st6@326 | |
2709 signed __int64 v160; // qtt@334 | |
2710 int v161; // eax@339 | |
2711 int v162; // edi@340 | |
2712 int v163; // eax@340 | |
2713 signed int v164; // eax@340 | |
2714 signed int v165; // edi@340 | |
488 | 2715 //stru6 *v166; // eax@340 |
2716 //stru6 *v167; // eax@340 | |
0 | 2717 signed int v168; // edi@343 |
2718 int v169; // eax@344 | |
2719 int v170; // ecx@346 | |
2720 int v171; // ecx@347 | |
2721 int v172; // ecx@348 | |
2722 int v173; // edi@350 | |
2723 signed int v174; // edi@355 | |
488 | 2724 //__int16 v175; // ST18_2@357 |
2725 //stru6 *v176; // eax@357 | |
2726 //__int16 v177; // ST18_2@357 | |
2727 //stru6 *v178; // eax@357 | |
2728 //__int16 v179; // ST18_2@357 | |
2729 //stru6 *v180; // eax@357 | |
2730 //__int16 v181; // ST18_2@357 | |
2731 //stru6 *v182; // eax@357 | |
2732 //signed __int64 v183; // qax@357 | |
0 | 2733 int v184; // ecx@358 |
2734 int v185; // ecx@359 | |
2735 int v186; // ecx@360 | |
2736 int v187; // eax@367 | |
2737 int v188; // esi@369 | |
2738 int v189; // edi@369 | |
2739 const char *v190; // ecx@377 | |
2740 signed int v191; // edi@379 | |
2741 int v192; // ecx@382 | |
2742 int v193; // ecx@383 | |
2743 int v194; // ecx@384 | |
2744 int v195; // eax@386 | |
2745 int v196; // eax@387 | |
488 | 2746 //__int16 v197; // ST18_2@395 |
2747 //stru6 *v198; // eax@395 | |
2748 //__int16 v199; // ST18_2@395 | |
2749 //stru6 *v200; // eax@395 | |
2750 //__int16 v201; // ST18_2@395 | |
2751 //stru6 *v202; // eax@395 | |
2752 //__int16 v203; // ST18_2@395 | |
2753 //stru6 *v204; // eax@395 | |
0 | 2754 signed int v205; // edi@405 |
2755 int v206; // eax@407 | |
2756 __int16 v207; // cx@407 | |
2757 int v208; // eax@411 | |
2758 signed int v209; // ecx@412 | |
2759 int v210; // edx@412 | |
2760 signed int v211; // ecx@412 | |
2761 int v212; // eax@413 | |
2762 int v213; // eax@413 | |
2763 int v214; // eax@413 | |
2764 int v215; // eax@415 | |
2765 double v216; // st7@415 | |
2766 double v217; // st6@415 | |
2767 signed __int64 v218; // qtt@423 | |
2768 int v219; // ecx@425 | |
2769 int v220; // ecx@426 | |
2770 int v221; // edi@428 | |
2771 char *v222; // edi@434 | |
2772 char v223; // al@438 | |
2773 int v224; // ecx@442 | |
2774 int v225; // ecx@443 | |
2775 int v226; // eax@451 | |
2776 int v227; // esi@453 | |
2777 unsigned int v228; // edi@454 | |
2778 int v229; // edi@466 | |
488 | 2779 //__int16 v230; // ST18_2@469 |
2780 //stru6 *v231; // eax@469 | |
2781 //signed int v232; // esi@469 | |
2782 //__int16 v233; // ST18_2@469 | |
2783 //stru6 *v234; // eax@469 | |
2784 //__int16 v235; // ST18_2@469 | |
2785 //stru6 *v236; // eax@469 | |
2786 //__int16 v237; // ST18_2@469 | |
2787 //stru6 *v238; // eax@469 | |
0 | 2788 __int16 v239; // ST1C_2@469 |
2789 char *v240; // ecx@472 | |
2790 double v241; // st7@478 | |
2791 signed __int64 v242; // qax@484 | |
2792 char *v243; // ecx@484 | |
2793 char *v244; // eax@488 | |
2794 int v245; // edi@492 | |
2795 int v246; // eax@492 | |
2796 char *v247; // eax@497 | |
2797 char v248; // al@497 | |
2798 char v249; // cf@500 | |
2799 float v250; // esi@507 | |
2800 char v251; // al@507 | |
2801 int v252; // edx@510 | |
2802 int m; // esi@510 | |
2803 int v254; // eax@513 | |
2804 int v255; // esi@513 | |
2805 int v256; // ecx@513 | |
2806 int v257; // edx@514 | |
2807 int v258; // ecx@514 | |
2808 char v259; // al@516 | |
2809 int v260; // eax@518 | |
2810 int v261; // esi@519 | |
2811 int v262; // edx@521 | |
2812 int v263; // ecx@521 | |
2813 int v264; // esi@521 | |
2814 int v265; // edx@521 | |
2815 int *ii; // eax@522 | |
2816 int v267; // eax@524 | |
2817 int v268; // eax@524 | |
2818 int v269; // eax@526 | |
2819 char *v270; // eax@531 | |
2820 char v271; // al@531 | |
2821 char v272; // cf@534 | |
2822 float v273; // esi@541 | |
2823 char v274; // al@541 | |
2824 int v275; // edx@544 | |
2825 int k; // esi@544 | |
2826 int v277; // edx@548 | |
2827 int v278; // ecx@548 | |
2828 char v279; // al@550 | |
2829 int v280; // eax@552 | |
2830 int v281; // esi@553 | |
2831 int v282; // edx@555 | |
2832 int v283; // ecx@555 | |
2833 int v284; // esi@555 | |
2834 int v285; // edx@555 | |
2835 int *l; // eax@556 | |
2836 int v287; // eax@558 | |
2837 int v288; // eax@558 | |
2838 ItemGen *v289; // eax@560 | |
2839 signed int v290; // eax@560 | |
2840 unsigned __int8 v291; // al@564 | |
2841 char v292; // al@573 | |
2842 int v293; // eax@575 | |
2843 ItemGen *v294; // esi@575 | |
2844 int v295; // edx@575 | |
2845 int kk; // edi@575 | |
2846 int v297; // edx@579 | |
2847 int v298; // ecx@579 | |
2848 char v299; // al@581 | |
2849 int v300; // eax@583 | |
2850 int v301; // edi@584 | |
2851 int v302; // edx@586 | |
2852 int v303; // ecx@586 | |
2853 int v304; // edi@586 | |
2854 int v305; // edx@586 | |
2855 int *jj; // eax@587 | |
2856 int v307; // eax@589 | |
2857 int v308; // eax@589 | |
2858 char *v309; // ecx@593 | |
2859 char v310; // sf@593 | |
2860 unsigned __int8 v311; // of@593 | |
2861 char v312; // cl@597 | |
488 | 2862 char v313; // al@606pGame->GetStru6() |
0 | 2863 int v314; // edx@607 |
2864 int j; // esi@607 | |
2865 unsigned int v316; // eax@613 | |
2866 const char *v317; // ecx@617 | |
2867 Player *v318; // ecx@619 | |
2868 unsigned int v319; // edi@627 | |
2869 int v320; // ecx@629 | |
2870 int v321; // ecx@630 | |
2871 int v322; // edi@632 | |
2872 int v323; // edi@635 | |
2873 char *v324; // eax@635 | |
2874 Player *v325; // ecx@640 | |
2875 int v326; // eax@643 | |
2876 int v327; // eax@648 | |
2877 int v328; // ecx@651 | |
2878 int v329; // ecx@652 | |
2879 int v330; // edi@654 | |
488 | 2880 //__int16 v331; // ST18_2@658 |
2881 //stru6 *v332; // eax@658 | |
2882 //__int16 v333; // ST18_2@658 | |
2883 //stru6 *v334; // eax@658 | |
2884 //__int16 v335; // ST18_2@658 | |
2885 //stru6 *v336; // eax@658 | |
2886 //__int16 v337; // ST18_2@658 | |
2887 //stru6 *v338; // eax@658 | |
0 | 2888 int v339; // ecx@659 |
2889 int v340; // ecx@660 | |
2890 int v341; // eax@663 | |
2891 signed int v342; // edi@668 | |
2892 signed int v343; // edi@670 | |
2893 unsigned __int64 v344; // ST08_8@670 | |
488 | 2894 //__int16 v345; // ST1C_2@671 |
2895 //__int16 v346; // ST18_2@671 | |
2896 //stru6 *v347; // eax@671 | |
0 | 2897 int v348; // ecx@672 |
2898 int v349; // ecx@673 | |
2899 int v350; // edi@676 | |
2900 Player *v351; // edi@680 | |
488 | 2901 //__int16 v352; // ST18_2@685 |
2902 //stru6 *v353; // eax@685 | |
0 | 2903 int v354; // ecx@686 |
2904 int v355; // ecx@687 | |
2905 int v356; // eax@689 | |
112 | 2906 Player *v357; // edi@694 |
488 | 2907 //unsigned __int16 v358; // ST1C_2@695 |
2908 //__int16 v359; // ST18_2@695 | |
2909 //stru6 *v360; // eax@695 | |
2910 //__int16 v361; // ST1C_2@697 | |
2911 //__int16 v362; // ST18_2@697 | |
2912 //stru6 *v363; // eax@697 | |
0 | 2913 int v364; // ecx@698 |
2914 int v365; // ecx@699 | |
2915 int v366; // eax@701 | |
488 | 2916 //stru6 *v367; // eax@704 |
0 | 2917 int v368; // eax@704 |
2918 Actor *v369; // edi@705 | |
2919 int v370; // eax@706 | |
2920 int v371; // ecx@709 | |
2921 int v372; // ecx@710 | |
2922 int v373; // eax@715 | |
2923 int v374; // eax@717 | |
112 | 2924 Player *v375; // edi@717 |
0 | 2925 int v376; // eax@717 |
2926 Player *v377; // ecx@719 | |
2927 int v378; // ecx@721 | |
2928 int v379; // ecx@722 | |
2929 int v380; // eax@724 | |
2930 int v381; // edi@727 | |
2931 int v382; // ecx@727 | |
2932 Player *v383; // eax@728 | |
2933 int v384; // eax@733 | |
2934 int v385; // edi@736 | |
2935 signed int v386; // eax@736 | |
2936 Player *v387; // edi@738 | |
2937 int v388; // edi@740 | |
488 | 2938 //unsigned __int16 v389; // ST1C_2@740 |
2939 //__int16 v390; // ST18_2@740 | |
2940 //stru6 *v391; // eax@740 | |
0 | 2941 int v392; // ecx@742 |
2942 int v393; // ecx@743 | |
2943 int v394; // ecx@744 | |
2944 int v395; // edi@747 | |
2945 int v396; // eax@752 | |
2946 int v397; // eax@757 | |
2947 int v398; // eax@757 | |
2948 int v399; // eax@757 | |
2949 char *v400; // esi@757 | |
488 | 2950 //Game *v401; // ecx@759 |
2951 //__int16 v402; // ST1C_2@759 | |
2952 //__int16 v403; // ST18_2@759 | |
2953 //stru6 *v404; // eax@759 | |
0 | 2954 int v405; // ecx@761 |
2955 int v406; // ecx@762 | |
2956 int v407; // edi@765 | |
488 | 2957 //__int16 v408; // ST1C_2@769 |
2958 //__int16 v409; // ST18_2@769 | |
2959 //stru6 *v410; // eax@769 | |
0 | 2960 int v411; // ecx@772 |
2961 int v412; // ecx@773 | |
2962 int v413; // edi@775 | |
488 | 2963 //__int16 v414; // ST1C_2@781 |
2964 //__int16 v415; // ST18_2@781 | |
2965 //stru6 *v416; // eax@781 | |
0 | 2966 int v417; // eax@787 |
2967 int v418; // ecx@789 | |
2968 __int16 v419; // ax@791 | |
2969 signed int v420; // eax@793 | |
2970 int v421; // edx@793 | |
2971 const char *v422; // eax@801 | |
2972 int v423; // ecx@808 | |
2973 int v424; // ecx@809 | |
2974 int v425; // eax@811 | |
2975 signed int v426; // eax@815 | |
2976 signed int v427; // eax@820 | |
2977 int v428; // ecx@825 | |
2978 int v429; // ecx@826 | |
2979 int v430; // eax@828 | |
488 | 2980 //stru6 *v431; // eax@831 |
0 | 2981 int v432; // eax@831 |
2982 Actor *v433; // edi@832 | |
2983 int v434; // eax@833 | |
2984 int v435; // ecx@837 | |
2985 int v436; // ecx@838 | |
488 | 2986 //__int16 v437; // ST1C_2@843 |
2987 //__int16 v438; // ST18_2@843 | |
2988 //stru6 *v439; // eax@843 | |
0 | 2989 int v440; // eax@843 |
2990 int v441; // eax@847 | |
2991 int v442; // ecx@850 | |
2992 int v443; // ecx@851 | |
2993 int v444; // eax@853 | |
2994 signed int v445; // edi@857 | |
2995 int v446; // ecx@862 | |
2996 LevelDecoration *v447; // edi@864 | |
2997 __int16 v448; // ax@864 | |
2998 char *v449; // esi@870 | |
2999 int v450; // eax@870 | |
3000 int v451; // ecx@875 | |
3001 int v452; // ecx@876 | |
3002 int v453; // edi@878 | |
488 | 3003 //__int16 v454; // ST1C_2@884 |
3004 //__int16 v455; // ST18_2@884 | |
3005 //stru6 *v456; // eax@884 | |
0 | 3006 int v457; // ecx@887 |
3007 int v458; // ecx@888 | |
3008 int v459; // eax@890 | |
3009 signed int v460; // eax@895 | |
3010 Actor *v461; // eax@897 | |
3011 unsigned __int16 v462; // cx@897 | |
3012 signed int v463; // edx@897 | |
3013 int v464; // ecx@905 | |
3014 int v465; // ecx@906 | |
3015 int v466; // edi@909 | |
488 | 3016 //__int16 v467; // ST1C_2@913 |
3017 //__int16 v468; // ST18_2@913 | |
3018 //stru6 *v469; // eax@913 | |
0 | 3019 int v470; // edi@913 |
3020 int v471; // eax@917 | |
3021 int v472; // eax@917 | |
3022 char *v473; // esi@918 | |
488 | 3023 //__int16 v474; // ST18_2@920 |
3024 //stru6 *v475; // eax@920 | |
3025 //__int16 v476; // ST18_2@920 | |
3026 //stru6 *v477; // eax@920 | |
3027 //__int16 v478; // ST18_2@920 | |
3028 //stru6 *v479; // eax@920 | |
3029 //__int16 v480; // ST18_2@920 | |
3030 //stru6 *v481; // eax@920 | |
3031 //__int16 v482; // ST18_2@923 | |
3032 //stru6 *v483; // eax@923 | |
3033 //__int16 v484; // ST18_2@923 | |
3034 //stru6 *v485; // eax@923 | |
3035 //__int16 v486; // ST18_2@923 | |
3036 //stru6 *v487; // eax@923 | |
3037 //__int16 v488; // ST18_2@923 | |
3038 //stru6 *v489; // eax@923 | |
3039 //__int16 v490; // ST1C_2@924 | |
3040 //__int16 v491; // ST18_2@924 | |
3041 //stru6 *v492; // eax@924 | |
0 | 3042 int v493; // ecx@925 |
3043 int v494; // ecx@926 | |
488 | 3044 //__int16 v495; // ST1C_2@931 |
3045 //__int16 v496; // ST18_2@931 | |
3046 //stru6 *v497; // eax@931 | |
0 | 3047 int v498; // edi@931 |
3048 int v499; // eax@935 | |
3049 int v500; // eax@935 | |
3050 Player *v501; // edi@939 | |
488 | 3051 //__int16 v502; // ST18_2@940 |
3052 //stru6 *v503; // eax@940 | |
3053 //stru6 *v504; // eax@943 | |
0 | 3054 int v505; // eax@943 |
3055 int v506; // eax@943 | |
3056 int v507; // edi@944 | |
3057 int v508; // eax@944 | |
3058 signed int v509; // eax@944 | |
3059 signed int v510; // edi@944 | |
3060 Actor *v511; // edi@946 | |
3061 int v512; // eax@946 | |
3062 SpellBuff *v513; // edi@946 | |
3063 int v514; // ecx@950 | |
3064 int v515; // ecx@951 | |
3065 int v516; // eax@953 | |
3066 int v517; // eax@956 | |
90 | 3067 Actor *v518; // edx@957 |
0 | 3068 __int16 v519; // cx@958 |
3069 int v520; // ecx@968 | |
3070 int v521; // ecx@969 | |
3071 int v522; // eax@971 | |
488 | 3072 //__int16 v523; // ST18_2@975 |
3073 //stru6 *v524; // eax@975 | |
3074 //__int16 v525; // ST18_2@975 | |
3075 //stru6 *v526; // eax@975 | |
3076 //__int16 v527; // ST18_2@975 | |
3077 //stru6 *v528; // eax@975 | |
3078 //__int16 v529; // ST18_2@975 | |
3079 //stru6 *v530; // eax@975 | |
0 | 3080 int v531; // eax@982 |
3081 int v532; // eax@982 | |
3082 int v533; // edi@983 | |
3083 int v534; // eax@983 | |
3084 signed int v535; // eax@983 | |
3085 signed int v536; // edi@983 | |
3086 stru6 *v537; // eax@984 | |
3087 int v538; // ecx@985 | |
3088 int v539; // ecx@986 | |
3089 int v540; // eax@988 | |
488 | 3090 //__int16 v541; // ST18_2@991 |
3091 //stru6 *v542; // eax@991 | |
3092 //__int16 v543; // ST18_2@991 | |
3093 //stru6 *v544; // eax@991 | |
3094 //__int16 v545; // ST18_2@991 | |
3095 //stru6 *v546; // eax@991 | |
3096 //__int16 v547; // ST18_2@991 | |
0 | 3097 stru6 *v548; // eax@991 |
3098 double v549; // st7@991 | |
3099 unsigned __int16 v550; // di@991 | |
3100 int v551; // ecx@993 | |
3101 int v552; // ecx@994 | |
89 | 3102 Player *v553; // edi@1001 |
488 | 3103 //__int16 v554; // ST18_2@1002 |
3104 //stru6 *v555; // eax@1002 | |
3105 //__int16 v556; // ST18_2@1002 | |
3106 //stru6 *v557; // eax@1002 | |
3107 //__int16 v558; // ST18_2@1002 | |
3108 //stru6 *v559; // eax@1002 | |
3109 //__int16 v560; // ST18_2@1002 | |
3110 //stru6 *v561; // eax@1002 | |
0 | 3111 unsigned __int16 v562; // di@1005 |
3112 signed int v563; // eax@1010 | |
3113 unsigned int v564; // ecx@1011 | |
3114 signed int v565; // eax@1012 | |
3115 Player **v566; // ecx@1012 | |
3116 int v567; // eax@1012 | |
488 | 3117 //unsigned __int16 v568; // ST1C_2@1012 |
3118 //__int16 v569; // ST18_2@1012 | |
3119 //stru6 *v570; // eax@1012 | |
0 | 3120 Player *v571; // eax@1013 |
3121 char *v572; // ecx@1013 | |
3122 int v573; // ecx@1017 | |
3123 int v574; // ecx@1018 | |
3124 int v575; // eax@1020 | |
3125 signed int v576; // eax@1025 | |
3126 Player *v577; // eax@1026 | |
3127 int v578; // eax@1028 | |
3128 __int16 v579; // ax@1029 | |
3129 int v580; // eax@1031 | |
3130 int v581; // edi@1031 | |
3131 int v582; // eax@1031 | |
488 | 3132 //__int16 v583; // ST1C_2@1034 |
3133 //__int16 v584; // ST18_2@1034 | |
0 | 3134 char *v585; // esi@1034 |
488 | 3135 //stru6 *v586; // eax@1034 |
0 | 3136 signed int v587; // eax@1035 |
3137 int v588; // ecx@1036 | |
3138 int v589; // ecx@1037 | |
3139 int v590; // ecx@1038 | |
3140 char v591; // al@1048 | |
3141 int v592; // esi@1052 | |
3142 int v593; // ecx@1057 | |
3143 int v594; // ecx@1058 | |
3144 int v595; // eax@1064 | |
3145 int v596; // esi@1066 | |
3146 unsigned int v597; // edi@1067 | |
3147 int v598; // eax@1079 | |
3148 signed int v599; // eax@1082 | |
3149 int v600; // edi@1086 | |
3150 int v601; // edx@1086 | |
3151 int v602; // eax@1086 | |
3152 int v603; // ecx@1086 | |
3153 int v604; // eax@1087 | |
3154 char *v605; // eax@1089 | |
3155 int v606; // edx@1091 | |
3156 int v607; // ecx@1100 | |
3157 __int16 v608; // ax@1102 | |
3158 signed int v609; // eax@1104 | |
3159 int v610; // edi@1106 | |
3160 unsigned int v611; // eax@1106 | |
89 | 3161 Player *v612; // edi@1106 |
3162 DDM_DLV_Header *v613; // eax@1108 | |
0 | 3163 int v614; // eax@1116 |
3164 int v615; // edi@1119 | |
488 | 3165 //__int16 v616; // ST1C_2@1122 |
3166 //__int16 v617; // ST18_2@1122 | |
3167 //stru6 *v618; // eax@1122 | |
112 | 3168 Player *v619; // edi@1123 |
488 | 3169 //unsigned __int16 v620; // ST1C_2@1124 |
3170 //__int16 v621; // ST18_2@1124 | |
3171 //stru6 *v622; // eax@1124 | |
0 | 3172 signed __int64 v623; // qax@1127 |
3173 int v624; // eax@1127 | |
3174 int v625; // edi@1129 | |
3175 int v626; // eax@1129 | |
3176 signed int v627; // eax@1129 | |
3177 signed int v628; // edi@1129 | |
3178 int v629; // ecx@1130 | |
3179 Player *v630; // eax@1131 | |
3180 int v631; // eax@1137 | |
3181 int v632; // edi@1140 | |
3182 Player *v633; // eax@1140 | |
3183 signed int v634; // eax@1140 | |
3184 int v635; // edi@1142 | |
488 | 3185 //unsigned __int16 v636; // ST1C_2@1142 |
3186 //__int16 v637; // ST18_2@1142 | |
3187 //stru6 *v638; // eax@1142 | |
3188 //stru6 *v639; // eax@1143 | |
0 | 3189 int v640; // ecx@1146 |
3190 int v641; // ecx@1147 | |
3191 int v642; // edi@1156 | |
3192 int v643; // eax@1156 | |
3193 int v644; // eax@1156 | |
3194 signed int v645; // eax@1158 | |
488 | 3195 //Player *v646; // ebx@1169 |
3196 //int v647; // edi@1169 | |
3197 //signed int v648; // ST1C_4@1170 | |
3198 //Player *v649; // ecx@1170 | |
3199 //unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3200 //unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3201 //unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3202 //unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
0 | 3203 int v654; // [sp-4h] [bp-E88h]@124 |
488 | 3204 //unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 |
0 | 3205 unsigned int v656; // [sp-4h] [bp-E88h]@639 |
3206 int v657; // [sp-4h] [bp-E88h]@807 | |
488 | 3207 //int v658; // [sp+0h] [bp-E84h]@100 |
0 | 3208 int v659; // [sp+0h] [bp-E84h]@123 |
3209 int v660; // [sp+0h] [bp-E84h]@146 | |
3210 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
488 | 3211 //int v662; // [sp+0h] [bp-E84h]@304 |
0 | 3212 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 |
3213 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3214 int v665; // [sp+0h] [bp-E84h]@807 | |
3215 int v666; // [sp+4h] [bp-E80h]@12 | |
3216 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
488 | 3217 //unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 |
0 | 3218 int v669; // [sp+4h] [bp-E80h]@123 |
3219 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3220 int v671; // [sp+4h] [bp-E80h]@146 | |
3221 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
488 | 3222 //unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 |
0 | 3223 __int16 v674; // [sp+4h] [bp-E80h]@684 |
3224 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3225 int v676; // [sp+4h] [bp-E80h]@807 | |
3226 int v677; // [sp+4h] [bp-E80h]@861 | |
3227 int v678; // [sp+4h] [bp-E80h]@997 | |
3228 int v679; // [sp+14h] [bp-E70h]@515 | |
3229 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3230 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3231 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3232 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3233 int v684; // [sp+D04h] [bp-180h]@416 | |
3234 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3235 int x; // [sp+D20h] [bp-164h]@327 | |
3236 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3237 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3238 int v689; // [sp+D30h] [bp-154h]@943 | |
3239 int v690; // [sp+D34h] [bp-150h]@943 | |
3240 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3241 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3242 int v693; // [sp+D40h] [bp-144h]@137 | |
3243 int v694; // [sp+D44h] [bp-140h]@982 | |
3244 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3245 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3246 int v697; // [sp+D50h] [bp-134h]@129 | |
3247 int v698; // [sp+D54h] [bp-130h]@129 | |
3248 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3249 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3250 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3251 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3252 int v703; // [sp+D70h] [bp-114h]@286 | |
3253 int v704; // [sp+D74h] [bp-110h]@132 | |
3254 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3255 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3256 int v707; // [sp+D80h] [bp-104h]@1127 | |
3257 int v708; // [sp+D84h] [bp-100h]@1127 | |
3258 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3259 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3260 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3261 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3262 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3263 int n; // [sp+DA0h] [bp-E4h]@1 | |
3264 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3265 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3266 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3267 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3268 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3269 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3270 int v721; // [sp+DD8h] [bp-ACh]@163 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3271 //SpriteObject a1; // [sp+DDCh] [bp-A8h]@1 |
0 | 3272 int v723; // [sp+E4Ch] [bp-38h]@1 |
3273 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3274 float v725; // [sp+E54h] [bp-30h]@23 | |
3275 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3276 int v726b; |
0 | 3277 float v727; // [sp+E5Ch] [bp-28h]@1 |
3278 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3279 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3280 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3281 Player *v730b; |
3282 ItemGen *v730c; | |
0 | 3283 int v731; // [sp+E6Ch] [bp-18h]@48 |
3284 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3285 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3286 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3287 int amount; // [sp+E80h] [bp-4h]@1 | |
3288 | |
3289 auto ecx0 = this; | |
3290 | |
3291 v711 = ecx0; | |
3292 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3293 SpriteObject a1; // [sp+DDCh] [bp-A8h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3294 //SpriteObject::SpriteObject(&a1); |
0 | 3295 |
486 | 3296 //v1 = 0; |
0 | 3297 v2 = 0; |
3298 amount = 0; | |
3299 LODWORD(v733) = 0; | |
3300 v723 = 0; | |
3301 v727 = 0.0; | |
3302 n = 0; | |
3303 while ( 1 ) | |
3304 { | |
3305 v3 = &v711[n]; | |
3306 HIDWORD(v733) = (int)v3; | |
486 | 3307 if ( v3->spellnum == 0 ) |
0 | 3308 goto LABEL_1166; |
486 | 3309 |
3310 if (pParty->Invisible()) | |
3311 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
3312 | |
0 | 3313 if ( v3->field_8 & 0x3CA ) |
3314 { | |
3315 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3316 v711->_427D48(1u); | |
3317 goto LABEL_1166; | |
3318 } | |
3319 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
488 | 3320 |
3321 a2 = v3->spell_target_pid; | |
3322 if (!a2) | |
0 | 3323 { |
488 | 3324 if (v3->spellnum == SPELL_LIGHT_DESTROY_UNDEAD || |
3325 v3->spellnum == SPELL_SPIRIT_TURN_UNDEAD || | |
3326 v3->spellnum == SPELL_DARK_CONTROL_UNDEAD ) | |
3327 v666 = 1; | |
3328 else | |
3329 v666 = 0; | |
3330 | |
3331 a2 = stru_50C198.FindClosestActor(5120, 1, v666); | |
3332 v6 = pMouse->uPointingObjectID; | |
3333 if ( pMouse->uPointingObjectID && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) | |
3334 a2 = pMouse->uPointingObjectID; | |
0 | 3335 } |
488 | 3336 |
3337 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3338 a1.uType = stru_4E3ACC[v3->spellnum].field_0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3339 if (a1.uType) |
0 | 3340 { |
141 | 3341 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3342 { |
141 | 3343 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3344 v2 = v723; |
3345 } | |
3346 else | |
3347 { | |
3348 v715.uYawAngle = pParty->sRotationY; | |
3349 v715.uPitchAngle = pParty->sRotationX; | |
3350 } | |
3351 } | |
488 | 3352 |
486 | 3353 LODWORD(v725) = 0; |
3354 _this = 0; | |
488 | 3355 if (v3->forced_spell_skill_level) |
3356 { | |
3357 v11 = v3->forced_spell_skill_level; | |
3358 v723 = v11 & 0x3F; | |
3359 v2 = v723; | |
3360 } | |
3361 else | |
0 | 3362 { |
488 | 3363 //v667 = PLAYER_SKILL_STAFF; |
3364 if (v3->spellnum < SPELL_AIR_WIZARD_EYE) | |
3365 v667 = PLAYER_SKILL_FIRE; | |
3366 else if (v3->spellnum < SPELL_WATER_AWAKEN) | |
3367 v667 = PLAYER_SKILL_AIR; | |
3368 else if (v3->spellnum < SPELL_EARTH_STUN) | |
3369 v667 = PLAYER_SKILL_WATER; | |
3370 else if (v3->spellnum < SPELL_SPIRIT_DETECT_LIFE) | |
3371 v667 = PLAYER_SKILL_EARTH; | |
3372 else if (v3->spellnum < SPELL_MIND_REMOVE_FEAR) | |
3373 v667 = PLAYER_SKILL_SPIRIT; | |
3374 else if (v3->spellnum < SPELL_BODY_CURE_WEAKNESS) | |
3375 v667 = PLAYER_SKILL_MIND; | |
3376 else if (v3->spellnum < SPELL_LIGHT_LIGHT_BOLT) | |
3377 v667 = PLAYER_SKILL_BODY; | |
3378 else if (v3->spellnum < SPELL_DARK_REANIMATE) | |
3379 v667 = PLAYER_SKILL_LIGHT; | |
3380 else if (v3->spellnum < SPELL_BOW_ARROW) | |
3381 v667 = PLAYER_SKILL_DARK; | |
3382 else if (v3->spellnum == SPELL_BOW_ARROW) | |
3383 v667 = PLAYER_SKILL_BOW; | |
3384 else assert(false && "Unknown spell"); | |
3385 | |
0 | 3386 LODWORD(v725) = v667; |
488 | 3387 v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F; |
3388 v2 = v723; | |
3389 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
0 | 3390 } |
488 | 3391 |
0 | 3392 if ( HIBYTE(v11) & 1 ) |
3393 { | |
3394 v12 = 4; | |
3395 v731 = 4; | |
3396 } | |
3397 else | |
3398 { | |
3399 if ( (v11 & 0x80u) == 0 ) | |
3400 { | |
3401 v731 = ((v11 & 0x40) != 0) + 1; | |
3402 } | |
3403 else | |
3404 { | |
3405 v731 = 3; | |
3406 } | |
3407 v12 = v731; | |
3408 } | |
488 | 3409 |
3410 v730 = v3->spellnum; | |
3411 if (v3->forced_spell_skill_level) | |
486 | 3412 uRequiredMana = 0; |
488 | 3413 else |
3414 uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v12 - 1]; | |
3415 sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v12 - 1]; | |
3416 | |
3417 if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || | |
490 | 3418 LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) |
486 | 3419 uRequiredMana = 0; |
488 | 3420 |
3421 if (v3->spellnum >= PLAYER_SKILL_BOW || pPlayer->sMana >= uRequiredMana) | |
0 | 3422 break; |
488 | 3423 |
3424 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points" | |
0 | 3425 LABEL_203: |
486 | 3426 v3->spellnum = 0; |
0 | 3427 LABEL_1166: |
3428 ++n; | |
3429 if ( n >= 10 ) | |
3430 return; | |
3431 } | |
488 | 3432 |
3433 if (pPlayer->Cursed() && v730 < SPELL_BOW_ARROW) | |
3434 if (rand() % 100 < 50) | |
3435 { | |
3436 if ( pParty->bTurnBasedModeOn == 0 ) | |
3437 { | |
3438 //v646 = pPlayer; | |
3439 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
3440 //v647 = n; | |
3441 } | |
3442 else | |
3443 { | |
3444 //v647 = n; | |
3445 //v646 = pPlayer; | |
3446 //v648 = sRecoveryTime; | |
3447 //v649 = pPlayer; | |
3448 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
3449 pPlayer->SetRecoveryTime(sRecoveryTime); | |
3450 pTurnEngine->_40471C(); | |
3451 } | |
3452 | |
3453 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); // "Spell failed" | |
3454 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
3455 v711[n].spellnum = 0; | |
3456 pPlayer->sMana -= uRequiredMana; | |
3457 return; | |
3458 } | |
3459 | |
0 | 3460 switch ( v3->spellnum ) |
3461 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3462 case SPELL_101: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3463 assert(false && "Unknown spell effect #101 (prolly flaming bow arrow"); |
488 | 3464 case SPELL_BOW_ARROW: |
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; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3475 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 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; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3516 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 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 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3568 case SPELL_FIRE_FIRE_SPIKE: |
0 | 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 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3589 //v31 = v3->uPlayerID; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3590 //v32 = 8 * v31; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3591 //LOBYTE(v32) = v32 | OBJECT_Player; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3592 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3593 //if ( (signed int)uNumSpriteObjects > 0 ) |
486 | 3594 HIDWORD(v733) = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3595 for (uint i = 0; i < uNumSpriteObjects; ++i) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3596 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3597 auto object = pSpriteObjects + i; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3598 if (object->uType && object->field_48 == 7 && object->field_58_pid == 8 * (int)v3->uPlayerID | OBJECT_Player) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3599 ++HIDWORD(v733); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3600 /*v33 = (char *)&pSpriteObjects[0].field_48; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3601 v730 = uNumSpriteObjects; |
0 | 3602 do |
3603 { | |
486 | 3604 if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) |
0 | 3605 ++HIDWORD(v733); |
3606 v33 += 112; | |
3607 --v730; | |
3608 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3609 while ( v730 );*/ |
0 | 3610 } |
3611 if ( SHIDWORD(v733) > amount ) | |
3612 goto LABEL_200; | |
3613 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3614 goto play_sound_and_continue; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3615 |
0 | 3616 a1.stru_24.Reset(); |
3617 a1.field_48 = v3->spellnum; | |
3618 a1.field_4C = v2; | |
3619 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3620 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3621 a1.vPosition.y = pParty->vPosition.y; |
3622 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3623 a1.uAttributes = 0; |
0 | 3624 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3625 a1.uSectorID = pIndoor->GetSector( | |
3626 pParty->vPosition.x, | |
3627 pParty->vPosition.y, | |
3628 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3629 a1.uSpriteFrameID = 0; |
0 | 3630 v34 = 8 * v3->uPlayerID; |
303 | 3631 LOBYTE(v34) = v34 | OBJECT_Player; |
3632 a1.field_58_pid = v34; | |
0 | 3633 a1.field_5C = a2; |
3634 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3635 a1.uFacing = LOWORD(v715.uYawAngle); | |
3636 a1.uSoundID = LOWORD(v3->field_10); | |
3637 if ( pParty->bTurnBasedModeOn == 1 ) | |
3638 LOBYTE(a1.uAttributes) |= 4u; | |
3639 v669 = v3->uPlayerID + 1; | |
3640 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3641 v35 = pParty->sRotationX + 10; | |
3642 goto LABEL_124; | |
3643 case 20: | |
3644 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3645 goto play_sound_and_continue; |
486 | 3646 if (!a2) |
0 | 3647 goto LABEL_200; |
141 | 3648 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3649 goto LABEL_1056; |
486 | 3650 v699 = 0; |
3651 v698 = 0; | |
3652 v697 = 0; | |
0 | 3653 a1.stru_24.Reset(); |
3654 a1.field_48 = v3->spellnum; | |
3655 a1.field_4C = v2; | |
3656 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3657 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 3658 a1.uAttributes = 0; |
3659 a1.uSectorID = 0; | |
3660 a1.uSpriteFrameID = 0; | |
0 | 3661 v37 = v3->uPlayerID; |
3662 a1.field_60_distance_related_prolly_lod = 0; | |
3663 v37 *= 8; | |
303 | 3664 LOBYTE(v37) = v37 | OBJECT_Player; |
486 | 3665 a1.uFacing = 0; |
303 | 3666 a1.field_58_pid = v37; |
0 | 3667 v38 = a2 >> 3; |
3668 a1.uSoundID = LOWORD(v3->field_10); | |
3669 v39 = a2 >> 3; | |
3670 a1.vPosition.x = pActors[v39].vPosition.x; | |
3671 v40 = pActors[v39].vPosition.y; | |
3672 a1.vPosition.z = pActors[v39].vPosition.z; | |
3673 v41 = 8 * (a2 >> 3); | |
3674 a1.vPosition.y = v40; | |
486 | 3675 LOBYTE(v41) = v41 | OBJECT_Actor; |
0 | 3676 a1.field_5C = v41; |
486 | 3677 v42 = a1.Create(0, 0, 0, 0); |
0 | 3678 v43 = &v697; |
3679 goto LABEL_133; | |
3680 case 44: | |
3681 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3682 goto play_sound_and_continue; |
0 | 3683 v726 = (Player *)(a2 >> 3); |
3684 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3685 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3686 goto LABEL_1056; |
90 | 3687 pActors[a2 >> 3].pActorBuffs[10].Apply( |
486 | 3688 pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); |
3689 v706 = 0; | |
3690 v705 = 0; | |
3691 v704 = 0; | |
0 | 3692 a1.stru_24.Reset(); |
3693 a1.field_48 = v3->spellnum; | |
3694 a1.field_4C = v2; | |
3695 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3696 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 3697 a1.uAttributes = 0; |
3698 a1.uSectorID = 0; | |
3699 a1.uSpriteFrameID = 0; | |
0 | 3700 v44 = v3->uPlayerID; |
3701 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 3702 a1.uFacing = 0; |
0 | 3703 v44 *= 8; |
303 | 3704 LOBYTE(v44) = v44 | OBJECT_Player; |
0 | 3705 v38 = (signed int)v726; |
303 | 3706 a1.field_58_pid = v44; |
0 | 3707 a1.uSoundID = LOWORD(v3->field_10); |
3708 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3709 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3710 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3711 v46 = 8 * (int)v726; | |
3712 a1.vPosition.y = v45; | |
486 | 3713 LOBYTE(v46) = 8 * (char)v726 | OBJECT_Actor; |
0 | 3714 a1.field_5C = v46; |
486 | 3715 v42 = a1.Create(0, 0, 0, 0); |
0 | 3716 v43 = &v704; |
3717 LABEL_133: | |
3718 v670 = (Vec3_int_ *)v43; | |
3719 v47 = v38; | |
3720 goto LABEL_139; | |
3721 case 79: | |
486 | 3722 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || (a2 & 7) != OBJECT_Actor) |
488 | 3723 goto play_sound_and_continue; |
0 | 3724 v730 = a2 >> 3; |
486 | 3725 v693 = 0; |
0 | 3726 HIDWORD(v733) = (int)&pActors[a2 >> 3]; |
486 | 3727 v692 = 0; |
3728 v691 = 0; | |
0 | 3729 a1.stru_24.Reset(); |
3730 a1.field_48 = v3->spellnum; | |
3731 a1.field_4C = v2; | |
3732 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3733 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3734 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); |
3735 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3736 v48 = *(short *)(HIDWORD(v733) + 138); | |
3737 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
486 | 3738 a1.uAttributes = 0; |
0 | 3739 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); |
486 | 3740 a1.uSpriteFrameID = 0; |
0 | 3741 v49 = 8 * v3->uPlayerID; |
303 | 3742 LOBYTE(v49) = v49 | OBJECT_Player; |
3743 a1.field_58_pid = v49; | |
0 | 3744 a1.field_5C = a2; |
3745 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3746 a1.uFacing = LOWORD(v715.uYawAngle); | |
3747 LOWORD(v49) = LOWORD(v3->field_10); | |
3748 LOBYTE(a1.uAttributes) |= 0x80u; | |
3749 a1.uSoundID = v49; | |
486 | 3750 v726 = (Player *)a1.Create(0, 0, 0, 0); |
0 | 3751 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) |
3752 goto LABEL_200; | |
3753 v47 = v730; | |
3754 v670 = (Vec3_int_ *)&v691; | |
3755 v42 = (signed int)v726; | |
3756 LABEL_139: | |
3757 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3758 goto LABEL_1056; | |
573 | 3759 case SPELL_FIRE_FIRE_BOLT: |
0 | 3760 case 6: |
3761 case 11: | |
3762 case 18: | |
3763 case 26: | |
3764 case 32: | |
3765 case 34: | |
3766 case 37: | |
3767 case 57: | |
3768 case 65: | |
3769 case 70: | |
3770 case 78: | |
3771 case 97: | |
3772 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3773 goto play_sound_and_continue; |
0 | 3774 a1.stru_24.Reset(); |
3775 a1.field_48 = v3->spellnum; | |
3776 a1.field_4C = v2; | |
3777 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3778 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3779 a1.vPosition.y = pParty->vPosition.y; |
3780 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3781 a1.uAttributes = 0; |
0 | 3782 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3783 a1.uSectorID = pIndoor->GetSector( | |
3784 pParty->vPosition.x, | |
3785 pParty->vPosition.y, | |
3786 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3787 a1.uSpriteFrameID = 0; |
0 | 3788 v50 = 8 * v3->uPlayerID; |
303 | 3789 LOBYTE(v50) = v50 | OBJECT_Player; |
3790 a1.field_58_pid = v50; | |
0 | 3791 a1.field_5C = a2; |
3792 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3793 a1.uFacing = LOWORD(v715.uYawAngle); | |
3794 a1.uSoundID = LOWORD(v3->field_10); | |
3795 if ( pParty->bTurnBasedModeOn == 1 ) | |
3796 LOBYTE(a1.uAttributes) |= 4u; | |
3797 if ( v3->spellnum == 18 ) | |
3798 LOBYTE(a1.uAttributes) |= 0x40u; | |
3799 goto LABEL_156; | |
3800 case 29: | |
3801 case 39: | |
3802 case 76: | |
3803 case 90: | |
3804 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3805 goto play_sound_and_continue; |
0 | 3806 a1.stru_24.Reset(); |
3807 a1.field_48 = v3->spellnum; | |
3808 a1.field_4C = v2; | |
3809 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3810 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3811 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
3812 a1.vPosition.y = pParty->vPosition.y; | |
3813 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3814 v660 = pParty->vPosition.y; | |
3815 goto LABEL_153; | |
3816 case 87: | |
3817 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3818 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3819 goto LABEL_200; | |
3820 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3821 goto LABEL_152; | |
488 | 3822 goto play_sound_and_continue; |
0 | 3823 case 81: |
3824 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3825 goto play_sound_and_continue; |
486 | 3826 if ( !a2 |
141 | 3827 || (a2 & 7) != OBJECT_Actor |
0 | 3828 || (v730 = a2 >> 3, |
3829 v721 = (int)&pActors[a2 >> 3], | |
3830 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3831 goto LABEL_1056; | |
486 | 3832 Actor::AI_Stand(v730, 4u, 0x80u, 0); |
0 | 3833 v726 = (Player *)(23040 * v2); |
3834 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3835 v55 = v721; | |
486 | 3836 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0); |
0 | 3837 *(char *)(v55 + 38) |= 8u; |
486 | 3838 *(short *)(v55 + 148) = 0; |
3839 v672 = 0; | |
3840 *(short *)(v55 + 150) = 0; | |
0 | 3841 v661 = (Actor *)v55; |
3842 goto LABEL_165; | |
3843 case 35: | |
3844 if ( v12 == 2 ) | |
3845 { | |
3846 v57 = 300 * v2; | |
3847 } | |
3848 else | |
3849 { | |
3850 if ( v12 == 3 ) | |
3851 { | |
3852 amount = 4; | |
3853 v57 = 300 * v2; | |
3854 goto LABEL_174; | |
3855 } | |
3856 if ( v12 == 4 ) | |
3857 { | |
3858 v57 = 300 * v2; | |
3859 amount = 8; | |
3860 goto LABEL_174; | |
3861 } | |
3862 v57 = 180 * v2; | |
3863 } | |
3864 amount = 2; | |
3865 LABEL_174: | |
3866 LODWORD(v733) = v57; | |
3867 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3868 goto play_sound_and_continue; |
141 | 3869 if ( (a2 & 7) != OBJECT_Actor |
0 | 3870 || (v721 = 836 * (a2 >> 3), |
90 | 3871 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3872 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3873 goto LABEL_1056; |
3874 v726 = (Player *)(23040 * v2); | |
3875 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3876 v59 = v721; | |
112 | 3877 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3878 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3879 pParty->uTimePlayed + (signed int)v58, | |
0 | 3880 v731, |
3881 amount, | |
486 | 3882 0, |
3883 0); | |
0 | 3884 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; |
486 | 3885 v672 = 0; |
0 | 3886 v661 = (Actor *)LODWORD(v718); |
3887 goto LABEL_165; | |
3888 case 60: | |
3889 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3890 goto play_sound_and_continue; |
0 | 3891 v730 = 836 * (a2 >> 3); |
90 | 3892 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3893 goto LABEL_1056; |
3894 LODWORD(v733) = 300 * v2; | |
3895 if ( v731 == 2 ) | |
3896 { | |
3897 LODWORD(v733) = 600 * v2; | |
3898 } | |
3899 else | |
3900 { | |
3901 if ( v731 == 3 ) | |
3902 LODWORD(v733) = 29030400; | |
3903 } | |
112 | 3904 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3905 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3906 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3907 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3908 v726 = (Player *)((int)v733 << 7); | |
3909 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3910 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3911 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 3912 v731, 0, 0, 0); |
0 | 3913 a1.stru_24.Reset(); |
3914 a1.field_48 = v3->spellnum; | |
3915 a1.field_4C = v2; | |
3916 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3917 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 3918 v61 = a2 >> 3; |
0 | 3919 goto LABEL_1086; |
3920 case 92: | |
3921 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3922 goto play_sound_and_continue; |
0 | 3923 a1.stru_24.Reset(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3924 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3925 a1.vPosition.x = pParty->vPosition.x; |
3926 a1.vPosition.y = pParty->vPosition.y; | |
486 | 3927 a1.uAttributes = 0; |
0 | 3928 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3929 a1.uSectorID = pIndoor->GetSector( | |
3930 pParty->vPosition.x, | |
3931 pParty->vPosition.y, | |
3932 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3933 a1.uSpriteFrameID = 0; |
0 | 3934 v62 = 8 * v3->uPlayerID; |
303 | 3935 LOBYTE(v62) = v62 | OBJECT_Player; |
3936 a1.field_58_pid = v62; | |
0 | 3937 a1.field_5C = a2; |
3938 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3939 a1.uFacing = LOWORD(v715.uYawAngle); | |
3940 a1.uSoundID = LOWORD(v3->field_10); | |
3941 a1.field_50 = v731; | |
3942 a1.field_48 = 3; | |
3943 a1.field_4C = 300 * v2; | |
3944 goto LABEL_154; | |
3945 case 4: | |
3946 v63 = v12 - 1; | |
3947 if ( !v63 ) | |
3948 { | |
3949 amount = 10; | |
3950 goto LABEL_195; | |
3951 } | |
3952 v64 = v63 - 1; | |
3953 if ( !v64 ) | |
3954 { | |
3955 amount = 11; | |
3956 goto LABEL_195; | |
3957 } | |
3958 v65 = v64 - 1; | |
3959 if ( !v65 ) | |
3960 { | |
3961 amount = 12; | |
3962 LABEL_195: | |
3963 LODWORD(v733) = 3600 * v2; | |
3964 goto LABEL_196; | |
3965 } | |
3966 if ( v65 == 1 ) | |
3967 { | |
486 | 3968 LODWORD(v733) = 0; |
0 | 3969 amount = 12; |
3970 } | |
3971 LABEL_196: | |
3972 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3973 goto play_sound_and_continue; |
89 | 3974 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
3975 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
3976 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
3977 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
3978 { | |
315 | 3979 if (!v730c->Broken()) |
0 | 3980 { |
486 | 3981 if (!v730c->uSpecEnchantmentType) |
0 | 3982 { |
570 | 3983 if (!v730c->uEnchantmentType) |
0 | 3984 { |
3985 v68 = BYTE4(v726->pConditions[3]); | |
3986 if ( !v68 || v68 == 1 || v68 == 2 ) | |
3987 { | |
377 | 3988 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
0 | 3989 { |
89 | 3990 v69 = v730c; |
0 | 3991 v14 = v731 == 4; |
3992 *(int *)(v730 + 12) = amount; | |
3993 if ( !v14 ) | |
3994 { | |
3995 v726 = (Player *)((int)v733 << 7); | |
3996 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
3997 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
3998 * 0.033333335); | |
3999 *(int *)(v69 + 20) |= 8u; | |
4000 } | |
4001 *(int *)(v69 + 20) |= 0x10u; | |
4002 LABEL_1055: | |
4003 dword_50C9A8 = 256; | |
4004 LABEL_1056: | |
4005 LODWORD(v727) = 1; | |
488 | 4006 play_sound_and_continue: |
0 | 4007 if ( v3->field_8 & 0x20 ) |
4008 { | |
4009 LABEL_1162: | |
4010 if ( v727 != 0.0 ) | |
4011 pAudioPlayer->PlaySound( | |
4012 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4013 0, | |
4014 0, | |
4015 -1, | |
4016 0, | |
4017 v3->field_10, | |
4018 0, | |
4019 0); | |
4020 } | |
4021 else | |
4022 { | |
4023 if ( sRecoveryTime < 0 ) | |
4024 sRecoveryTime = 0; | |
4025 if ( pParty->bTurnBasedModeOn ) | |
4026 { | |
4027 v645 = sRecoveryTime; | |
4028 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4029 pPlayer->SetRecoveryTime(v645); | |
4030 if ( !some_active_character ) | |
4031 pTurnEngine->_40471C(); | |
4032 } | |
4033 else | |
4034 { | |
4035 pPlayer->SetRecoveryTime( | |
4036 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4037 } | |
4038 if ( v727 != 0.0 ) | |
4039 { | |
187 | 4040 pPlayer->PlaySound(SPEECH_49, 0); |
0 | 4041 goto LABEL_1162; |
4042 } | |
4043 } | |
4044 v3->spellnum = 0; | |
486 | 4045 //v1 = 0; |
0 | 4046 LABEL_1165: |
4047 v2 = v723; | |
4048 goto LABEL_1166; | |
4049 } | |
4050 } | |
4051 } | |
4052 } | |
4053 } | |
4054 } | |
4055 LABEL_199: | |
4056 dword_50C9D0 = 113; | |
486 | 4057 dword_50C9D4 = 0; |
0 | 4058 dword_50C9D8 = 1; |
4059 LABEL_200: | |
4060 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4061 LABEL_201: | |
4062 v67 = 2; | |
4063 LABEL_202: | |
4064 ShowStatusBarString(v66, v67); | |
486 | 4065 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 4066 goto LABEL_203; |
488 | 4067 |
4068 case SPELL_BODY_REGENERATION: | |
0 | 4069 v70 = v12 - 1; |
4070 LODWORD(v733) = 3600 * v2; | |
4071 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4072 { | |
4073 v72 = v71 - 1; | |
4074 if ( v72 ) | |
4075 { | |
4076 if ( v72 == 1 ) | |
4077 amount = 10; | |
4078 } | |
4079 else | |
4080 { | |
4081 amount = 3; | |
4082 } | |
4083 } | |
4084 else | |
4085 { | |
4086 amount = 1; | |
4087 } | |
4088 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4089 goto play_sound_and_continue; |
4090 | |
4091 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
4092 | |
4093 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); | |
4094 goto LABEL_1056; | |
4095 | |
4096 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
4097 case SPELL_AIR_PROTECTION_FROM_AIR: | |
4098 case SPELL_WATER_PROTECTION_FROM_WATER: | |
4099 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
4100 case SPELL_MIND_PROTECTION_FROM_MIND: | |
4101 case SPELL_BODY_PROTECTION_FROM_BODY: | |
0 | 4102 v76 = v12 - 1; |
4103 LODWORD(v733) = 3600 * v2; | |
4104 if ( v76 ) | |
4105 { | |
4106 v77 = v76 - 1; | |
4107 if ( v77 ) | |
4108 { | |
4109 v78 = v77 - 1; | |
4110 if ( v78 ) | |
4111 { | |
4112 if ( v78 != 1 ) | |
4113 goto LABEL_232; | |
4114 v79 = 4 * v2; | |
4115 } | |
4116 else | |
4117 { | |
4118 v79 = 3 * v2; | |
4119 } | |
4120 } | |
4121 else | |
4122 { | |
4123 v79 = 2 * v2; | |
4124 } | |
4125 amount = v79; | |
4126 } | |
4127 else | |
4128 { | |
4129 amount = v2; | |
4130 } | |
4131 LABEL_232: | |
488 | 4132 //v80 = v3->spellnum; |
4133 switch (v3->spellnum) | |
4134 { | |
4135 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
4136 LODWORD(v725) = PARTY_BUFF_RESIST_FIRE; | |
0 | 4137 break; |
488 | 4138 case SPELL_AIR_PROTECTION_FROM_AIR: |
4139 LODWORD(v725) = PARTY_BUFF_RESIST_AIR; | |
0 | 4140 break; |
488 | 4141 case SPELL_WATER_PROTECTION_FROM_WATER: |
4142 LODWORD(v725) = PARTY_BUFF_RESIST_WATER; | |
4143 break; | |
4144 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
4145 LODWORD(v725) = PARTY_BUFF_RESIST_EARTH; | |
0 | 4146 break; |
488 | 4147 case SPELL_MIND_PROTECTION_FROM_MIND: |
4148 LODWORD(v725) = PARTY_BUFF_RESIST_MIND; | |
0 | 4149 break; |
488 | 4150 case SPELL_BODY_PROTECTION_FROM_BODY: |
4151 LODWORD(v725) = PARTY_BUFF_RESIST_BODY; | |
0 | 4152 break; |
4153 default: | |
488 | 4154 assert(false); |
4155 goto LABEL_1166; | |
0 | 4156 } |
4157 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4158 goto play_sound_and_continue; |
4159 | |
4160 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4161 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4162 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4163 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4164 v83 = 1; |
488 | 4165 |
0 | 4166 v90 = (double)(signed int)v733 * 4.2666669; |
488 | 4167 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); |
4168 LODWORD(v727) = 1; | |
4169 goto play_sound_and_continue; | |
4170 | |
4171 case SPELL_FIRE_HASTE: | |
486 | 4172 if ( v12 <= 0 ) |
0 | 4173 goto LABEL_254; |
4174 if ( v12 <= 2 ) | |
4175 { | |
4176 v91 = 60 * (v2 + 60); | |
4177 } | |
4178 else | |
4179 { | |
4180 if ( v12 == 3 ) | |
4181 { | |
4182 v91 = 180 * (v2 + 20); | |
4183 } | |
4184 else | |
4185 { | |
4186 if ( v12 != 4 ) | |
4187 goto LABEL_254; | |
4188 v91 = 240 * (v2 + 15); | |
4189 } | |
4190 } | |
4191 LODWORD(v733) = v91; | |
4192 LABEL_254: | |
4193 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4194 { | |
89 | 4195 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4196 LODWORD(v727) = 1; |
4197 do | |
4198 { | |
89 | 4199 if ( v92->pConditions ) |
486 | 4200 LODWORD(v727) = 0; |
89 | 4201 ++v92; |
0 | 4202 } |
89 | 4203 while ( v92 <= &pParty->pPlayers[3] ); |
486 | 4204 if (LODWORD(v727)) |
0 | 4205 { |
4206 v726 = (Player *)((int)v733 << 7); | |
488 | 4207 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
4208 | |
4209 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4210 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4211 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4212 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4213 } |
4214 } | |
488 | 4215 goto play_sound_and_continue; |
4216 | |
4217 case SPELL_SPIRIT_BLESS: | |
0 | 4218 v101 = v12 - 1; |
4219 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4220 { | |
4221 v103 = v102 - 1; | |
4222 if ( v103 ) | |
4223 { | |
4224 if ( v103 != 1 ) | |
4225 goto LABEL_269; | |
4226 v104 = 3600 * (v2 + 1); | |
4227 } | |
4228 else | |
4229 { | |
4230 v104 = 900 * (v2 + 4); | |
4231 } | |
4232 } | |
4233 else | |
4234 { | |
4235 v104 = 300 * (v2 + 12); | |
4236 } | |
4237 LODWORD(v733) = v104; | |
4238 LABEL_269: | |
4239 amount = v2 + 5; | |
4240 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4241 goto play_sound_and_continue; |
0 | 4242 if ( v731 == 1 ) |
4243 { | |
4244 v108 = v3->uPlayerID_2; | |
4245 v109 = v3->spellnum; | |
4246 v110 = pGame->GetStru6(); | |
4247 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
486 | 4248 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, 0, 65536); |
488 | 4249 //v668 = 0; |
0 | 4250 v716 = v111; |
488 | 4251 //v658 = v111; |
4252 //v653 = amount; | |
0 | 4253 v726 = (Player *)((int)v733 << 7); |
488 | 4254 //v651 = 1; |
4255 //v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4256 //v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS]; | |
4257 //LABEL_103: | |
4258 //HIDWORD(v650) = HIDWORD(v28); | |
4259 //LABEL_104: | |
4260 //LODWORD(v650) = v28; | |
4261 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); | |
4262 goto LABEL_1056; | |
0 | 4263 } |
4264 v105 = 0; | |
4265 v726 = (Player *)((int)v733 << 7); | |
4266 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4267 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4268 do |
4269 { | |
488 | 4270 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v105); |
486 | 4271 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536); |
4272 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | |
89 | 4273 ++v730b; |
0 | 4274 ++v105; |
4275 } | |
89 | 4276 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4277 goto LABEL_1056; |
488 | 4278 |
0 | 4279 case 52: |
486 | 4280 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && (a2 & 7) == OBJECT_Actor) |
0 | 4281 { |
4282 v730 = a2 >> 3; | |
4283 v112 = &pActors[a2 >> 3]; | |
4284 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4285 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4286 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4287 _this = (ItemGen *)v113; | |
4288 v114 = v721; | |
4289 v115 = (unsigned int)v726; | |
4290 if ( v113 < v721 ) | |
4291 { | |
4292 v116 = v113; | |
4293 v113 = v721; | |
4294 v114 = v116; | |
4295 } | |
4296 if ( v113 < (signed int)v726 ) | |
4297 { | |
4298 v117 = v113; | |
4299 v113 = (int)v726; | |
4300 v115 = v117; | |
4301 } | |
4302 if ( v114 < (signed int)v115 ) | |
4303 { | |
4304 v118 = v115; | |
4305 v115 = v114; | |
4306 v114 = v118; | |
4307 } | |
4308 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4309 if ( (double)(signed int)this <= 307.2 ) | |
4310 { | |
4311 v703 = 0; | |
4312 v702 = 0; | |
4313 v701 = 0; | |
4314 a1.stru_24.Reset(); | |
4315 v119 = HIDWORD(v733); | |
4316 a1.field_48 = *(int *)HIDWORD(v733); | |
4317 a1.field_4C = v723; | |
4318 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4319 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4320 a1.uAttributes = 0; |
4321 a1.uSectorID = 0; | |
4322 a1.uSpriteFrameID = 0; | |
4323 v120 = 8 * *(short *)(v119 + 2); | |
303 | 4324 LOBYTE(v120) = v120 | OBJECT_Player; |
0 | 4325 a1.field_60_distance_related_prolly_lod = 0; |
303 | 4326 a1.field_58_pid = v120; |
0 | 4327 a1.uFacing = 0; |
4328 a1.uSoundID = *(short *)(v119 + 16); | |
4329 a1.vPosition.x = v112->vPosition.x; | |
4330 a1.vPosition.y = v112->vPosition.y; | |
4331 v726 = (Player *)v112->uActorHeight; | |
4332 v121 = 8 * a2; | |
4333 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4334 LOBYTE(v121) = 8 * a2 | 3; | |
4335 a1.field_5C = v121; | |
4336 v122 = a1.Create(0, 0, 0, 0); | |
4337 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4338 LODWORD(v727) = 1; | |
4339 } | |
4340 else | |
4341 { | |
4342 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4343 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4344 *(int *)HIDWORD(v733) = 0; | |
4345 } | |
4346 v3 = (stru277 *)HIDWORD(v733); | |
4347 } | |
488 | 4348 goto play_sound_and_continue; |
4349 | |
4350 case SPELL_AIR_SHIELD: | |
4351 case SPELL_EARTH_STONESKIN: | |
4352 case SPELL_SPIRIT_HEROISM: | |
0 | 4353 v123 = v12 - 1; |
4354 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4355 { | |
4356 v125 = v124 - 1; | |
4357 if ( v125 ) | |
4358 { | |
4359 if ( v125 != 1 ) | |
4360 goto LABEL_296; | |
4361 v126 = 3600 * (v2 + 1); | |
4362 } | |
4363 else | |
4364 { | |
4365 v126 = 900 * (v2 + 4); | |
4366 } | |
4367 } | |
4368 else | |
4369 { | |
4370 v126 = 300 * (v2 + 12); | |
4371 } | |
4372 LODWORD(v733) = v126; | |
4373 LABEL_296: | |
4374 v127 = v3->spellnum; | |
4375 if ( v127 == 17 ) | |
4376 { | |
486 | 4377 amount = 0; |
0 | 4378 LODWORD(v725) = 14; |
4379 } | |
4380 else | |
4381 { | |
4382 if ( v127 == 38 ) | |
4383 { | |
4384 LODWORD(v725) = 15; | |
4385 amount = v2 + 5; | |
4386 } | |
4387 else | |
4388 { | |
4389 if ( v127 != 51 ) | |
4390 goto LABEL_1166; | |
4391 LODWORD(v725) = 9; | |
4392 amount = v2 + 5; | |
4393 } | |
4394 } | |
4395 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4396 goto play_sound_and_continue; |
4397 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4398 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4399 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4400 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4401 v83 = 1; |
4402 v726 = (Player *)((int)v733 << 7); | |
4403 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
488 | 4404 //LABEL_304: |
4405 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); | |
4406 LODWORD(v727) = v83; | |
4407 goto play_sound_and_continue; | |
4408 | |
4409 case SPELL_FIRE_IMMOLATION: | |
0 | 4410 v138 = v12 - 2; |
4411 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4412 v140 = 600 * v2; | |
4413 else | |
4414 v140 = 60 * v2; | |
4415 LODWORD(v733) = v140; | |
4416 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4417 goto play_sound_and_continue; |
4418 | |
4419 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4420 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4421 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4422 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
4423 | |
0 | 4424 v726 = (Player *)((int)v733 << 7); |
488 | 4425 |
4426 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | |
4427 goto LABEL_1056; | |
4428 | |
0 | 4429 case 9: |
4430 v149 = v12 - 1; | |
4431 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4432 { | |
4433 if ( v151 == 1 ) | |
4434 _this = (ItemGen *)20; | |
4435 } | |
4436 else | |
4437 { | |
4438 _this = (ItemGen *)16; | |
4439 } | |
4440 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4441 { | |
4442 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4443 goto LABEL_201; | |
4444 } | |
4445 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4446 goto play_sound_and_continue; |
0 | 4447 LODWORD(v725) = a2 & 7; |
141 | 4448 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4449 { |
4450 v152 = a2 >> 3; | |
4451 uRequiredMana = pActors[v152].vPosition.x; | |
4452 v153 = pActors[v152].vPosition.y; | |
4453 v154 = pActors[v152].vPosition.z; | |
4454 LODWORD(v727) = v153; | |
4455 } | |
4456 else | |
4457 { | |
323 | 4458 v155 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4459 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); |
323 | 4460 v156 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4461 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); |
4462 v154 = pParty->vPosition.z; | |
4463 } | |
4464 HIDWORD(v733) = v154; | |
4465 v713 = v154 + 2500; | |
486 | 4466 v721 = 0; |
4467 LODWORD(v718) = 0; | |
4468 if ( (signed int)this > 0 ) | |
0 | 4469 { |
4470 *(float *)&y = (double)SHIDWORD(v733); | |
4471 *(float *)&v732 = (double)v713; | |
4472 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4473 v726 = (Player *)this; | |
4474 do | |
4475 { | |
4476 v157 = rand(); | |
4477 v158 = (double)SLODWORD(v718); | |
4478 v718 = v158; | |
4479 v159 = (double)v721; | |
4480 *(float *)&v721 = v159; | |
4481 a2 = v157 % 1000; | |
4482 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4483 v725 = v159 * v159; | |
4484 *(float *)&_this = v158 * v158; | |
4485 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4486 { | |
486 | 4487 LODWORD(v687) = 0; |
4488 HIDWORD(v687) = 0; | |
0 | 4489 } |
4490 else | |
4491 { | |
4492 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4493 v687 = __PAIR__( | |
4494 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4495 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4496 } | |
4497 a1.stru_24.Reset(); | |
4498 a1.field_48 = v3->spellnum; | |
4499 a1.field_4C = v2; | |
4500 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4501 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 4502 a1.uAttributes = 0; |
0 | 4503 a1.vPosition.x = uRequiredMana; |
4504 a1.vPosition.y = LODWORD(v727); | |
486 | 4505 a1.uSectorID = 0; |
0 | 4506 a1.vPosition.z = a2 + v713; |
486 | 4507 a1.uSpriteFrameID = 0; |
303 | 4508 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4509 a1.field_5C = v730; |
4510 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4511 a1.uFacing = v687; | |
4512 a1.uSoundID = LOWORD(v3->field_10); | |
4513 if ( pParty->bTurnBasedModeOn == 1 ) | |
4514 a1.uAttributes = 4; | |
4515 if ( a1.Create( | |
4516 v687, | |
4517 SHIDWORD(v687), | |
4518 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4519 0) != -1 |
0 | 4520 && pParty->bTurnBasedModeOn == 1 ) |
4521 ++pTurnEngine->field_1C; | |
4522 LODWORD(v718) = rand() % 1024 - 512; | |
4523 v160 = rand(); | |
4524 v14 = v726 == (Player *)1; | |
4525 v726 = (Player *)((char *)v726 - 1); | |
4526 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4527 } | |
4528 while ( !v14 ); | |
4529 } | |
4530 goto LABEL_1056; | |
4531 case 10: | |
4532 v67 = 2; | |
4533 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4534 { | |
4535 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4536 goto LABEL_202; | |
4537 } | |
4538 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4539 goto play_sound_and_continue; |
0 | 4540 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
486 | 4541 v700.z = 0; |
4542 v700.y = 0; | |
4543 v700.x = 0; | |
0 | 4544 a1.stru_24.Reset(); |
4545 a1.field_48 = v3->spellnum; | |
4546 a1.field_4C = v2; | |
4547 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4548 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 4549 a1.uAttributes = 0; |
4550 a1.uSectorID = 0; | |
4551 a1.uSpriteFrameID = 0; | |
0 | 4552 v161 = v3->uPlayerID; |
4553 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 4554 a1.uFacing = 0; |
0 | 4555 v161 *= 8; |
303 | 4556 LOBYTE(v161) = v161 | OBJECT_Player; |
4557 a1.field_58_pid = v161; | |
0 | 4558 a1.uSoundID = LOWORD(v3->field_10); |
486 | 4559 a2 = 0; |
4560 if ( (signed int)v726 > 0 ) | |
0 | 4561 { |
4562 do | |
4563 { | |
4564 v162 = dword_50BF30[a2]; | |
4565 a1.vPosition.x = pActors[v162].vPosition.x; | |
4566 a1.vPosition.y = pActors[v162].vPosition.y; | |
4567 v732 = pActors[v162].uActorHeight; | |
4568 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4569 v163 = 8 * dword_50BF30[a2]; | |
486 | 4570 LOBYTE(v163) = v163 | OBJECT_Actor; |
0 | 4571 a1.field_5C = v163; |
486 | 4572 v164 = a1.Create(0, 0, 0, 0); |
0 | 4573 v165 = a2; |
4574 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
488 | 4575 pGame->GetStru6()->_4A81CA(&a1); |
4576 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
0 | 4577 a2 = v165 + 1; |
4578 } | |
4579 while ( v165 + 1 < (signed int)v726 ); | |
4580 } | |
4581 goto LABEL_1056; | |
488 | 4582 |
4583 case SPELL_AIR_WIZARD_EYE: | |
0 | 4584 LODWORD(v733) = 3600 * v2; |
4585 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4586 goto play_sound_and_continue; |
0 | 4587 v168 = 0; |
4588 do | |
4589 { | |
486 | 4590 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536); |
0 | 4591 v716 = v169; |
4592 } | |
4593 while ( v168 < 4 ); | |
488 | 4594 |
0 | 4595 v732 = (int)v733 << 7; |
488 | 4596 |
4597 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | |
4598 goto LABEL_1056; | |
4599 | |
4600 case SPELL_AIR_FEATHER_FALL: | |
0 | 4601 v170 = v12 - 1; |
4602 if ( !v170 ) | |
4603 { | |
4604 v173 = 300 * v2; | |
4605 goto LABEL_353; | |
4606 } | |
4607 v171 = v170 - 1; | |
4608 if ( !v171 ) | |
4609 { | |
4610 v173 = 600 * v2; | |
4611 goto LABEL_353; | |
4612 } | |
4613 v172 = v171 - 1; | |
4614 if ( !v172 || v172 == 1 ) | |
4615 { | |
4616 v173 = 3600 * v2; | |
4617 LABEL_353: | |
4618 LODWORD(v733) = v173; | |
4619 } | |
4620 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4621 goto play_sound_and_continue; |
0 | 4622 v174 = 0; |
4623 do | |
486 | 4624 pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536); |
0 | 4625 while ( v174 < 4 ); |
488 | 4626 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4627 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4628 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4629 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4630 v83 = 1; |
4631 v732 = (int)v733 << 7; | |
488 | 4632 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); |
4633 LODWORD(v727) = v83; | |
4634 goto play_sound_and_continue; | |
4635 | |
4636 case SPELL_AIR_SPARKS: | |
0 | 4637 v184 = v12 - 1; |
4638 if ( v184 ) | |
4639 { | |
4640 v185 = v184 - 1; | |
4641 if ( v185 ) | |
4642 { | |
4643 v186 = v185 - 1; | |
4644 if ( v186 ) | |
4645 { | |
4646 if ( v186 == 1 ) | |
4647 amount = 9; | |
4648 } | |
4649 else | |
4650 { | |
4651 amount = 7; | |
4652 } | |
4653 } | |
4654 else | |
4655 { | |
4656 amount = 5; | |
4657 } | |
4658 } | |
4659 else | |
4660 { | |
4661 amount = 3; | |
4662 } | |
4663 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4664 goto play_sound_and_continue; |
0 | 4665 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); |
4666 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4667 a1.stru_24.Reset(); | |
4668 a1.field_48 = v3->spellnum; | |
4669 a1.field_4C = v2; | |
4670 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4671 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4672 a1.vPosition.y = pParty->vPosition.y; |
4673 a1.vPosition.x = pParty->vPosition.x; | |
486 | 4674 a1.uAttributes = 0; |
0 | 4675 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
4676 a1.uSectorID = pIndoor->GetSector( | |
4677 pParty->vPosition.x, | |
4678 pParty->vPosition.y, | |
4679 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 4680 a1.uSpriteFrameID = 0; |
0 | 4681 v187 = 8 * v3->uPlayerID; |
303 | 4682 LOBYTE(v187) = v187 | OBJECT_Player; |
4683 a1.field_58_pid = v187; | |
0 | 4684 a1.field_5C = a2; |
4685 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4686 a1.uSoundID = LOWORD(v3->field_10); | |
4687 if ( pParty->bTurnBasedModeOn == 1 ) | |
4688 LOBYTE(a1.uAttributes) |= 4u; | |
4689 v188 = (signed int)v726 / -2; | |
4690 v189 = (signed int)v726 / 2; | |
4691 while ( v188 <= v189 ) | |
4692 { | |
4693 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4694 if ( a1.Create( | |
4695 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4696 v715.uPitchAngle, | |
4697 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4698 v3->uPlayerID + 1) != -1 | |
4699 && pParty->bTurnBasedModeOn == 1 ) | |
4700 ++pTurnEngine->field_1C; | |
4701 v188 += v732; | |
4702 } | |
4703 goto LABEL_1056; | |
4704 case 16: | |
569 | 4705 if ( pParty->uFlags & PARTY_FLAGS_1_FALLING) |
4706 { | |
4707 v190 = pGlobalTXT_LocalizationStrings[493]; // Can't cast Jump while airborne! | |
0 | 4708 goto LABEL_462; |
4709 } | |
4710 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4711 goto play_sound_and_continue; |
0 | 4712 v191 = 0; |
4713 do | |
486 | 4714 pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536); |
0 | 4715 while ( v191 < 4 ); |
4716 BYTE1(pParty->uFlags) |= 1u; | |
4717 pParty->uFallSpeed = 1000; | |
4718 goto LABEL_1056; | |
488 | 4719 |
4720 case SPELL_AIR_INVISIBILITY: | |
0 | 4721 v192 = v12 - 1; |
4722 if ( !v192 ) | |
4723 { | |
4724 amount = v2; | |
4725 goto LABEL_391; | |
4726 } | |
4727 v193 = v192 - 1; | |
4728 if ( !v193 ) | |
4729 { | |
4730 v196 = 2 * v2; | |
4731 LABEL_389: | |
4732 amount = v196; | |
4733 LABEL_391: | |
4734 v195 = 600 * v2; | |
4735 goto LABEL_392; | |
4736 } | |
4737 v194 = v193 - 1; | |
4738 if ( !v194 ) | |
4739 { | |
4740 v196 = 3 * v2; | |
4741 goto LABEL_389; | |
4742 } | |
4743 if ( v194 != 1 ) | |
4744 goto LABEL_393; | |
4745 amount = 4 * v2; | |
4746 v195 = 3600 * v2; | |
4747 LABEL_392: | |
4748 LODWORD(v733) = v195; | |
4749 LABEL_393: | |
4750 if ( pParty->uFlags & 0x30 ) | |
4751 { | |
4752 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4753 goto LABEL_201; | |
4754 } | |
4755 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4756 { | |
488 | 4757 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4758 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4759 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4760 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4761 v83 = 1; |
4762 v732 = (int)v733 << 7; | |
488 | 4763 |
4764 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 | 4765 LODWORD(v727) = v83; |
4766 } | |
488 | 4767 goto play_sound_and_continue; |
0 | 4768 case 21: |
4769 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4770 { | |
569 | 4771 v190 = pGlobalTXT_LocalizationStrings[494]; // Can not cast Fly indoors! |
0 | 4772 LABEL_462: |
4773 ShowStatusBarString(v190, 2u); | |
486 | 4774 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
488 | 4775 goto play_sound_and_continue; |
0 | 4776 } |
4777 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4778 { | |
4779 LABEL_461: | |
4780 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4781 goto LABEL_462; | |
4782 } | |
4783 LODWORD(v733) = 3600 * v2; | |
486 | 4784 if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) ) |
0 | 4785 amount = 1; |
4786 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4787 goto play_sound_and_continue; |
0 | 4788 v205 = 0; |
4789 do | |
486 | 4790 pOtherOverlayList->_4418B1(2090, v205++ + 100, 0, 65536); |
0 | 4791 while ( v205 < 4 ); |
486 | 4792 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); |
0 | 4793 v207 = v3->uPlayerID + 1; |
4794 v716 = v206; | |
488 | 4795 |
0 | 4796 v732 = (int)v733 << 7; |
488 | 4797 |
4798 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207); | |
0 | 4799 goto LABEL_1056; |
488 | 4800 |
0 | 4801 case 22: |
4802 v67 = 2; | |
4803 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4804 { | |
4805 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4806 goto LABEL_202; | |
4807 } | |
4808 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4809 goto play_sound_and_continue; |
0 | 4810 v208 = a2 & 7; |
4811 LODWORD(v725) = a2 & 7; | |
4812 if ( v208 == 3 ) | |
4813 { | |
4814 v209 = a2 >> 3; | |
4815 LODWORD(v718) = pActors[v209].vPosition.x; | |
4816 v210 = pActors[v209].vPosition.y; | |
4817 v211 = pActors[v209].vPosition.z; | |
4818 v713 = v210; | |
4819 } | |
4820 else | |
4821 { | |
323 | 4822 v212 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4823 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); |
323 | 4824 v213 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4825 v214 = sub_42EBBE(2048, v213); |
4826 v211 = pParty->vPosition.z; | |
4827 v713 = pParty->vPosition.y + v214; | |
4828 v208 = LODWORD(v725); | |
4829 } | |
4830 v726 = (Player *)v211; | |
486 | 4831 HIDWORD(v733) = 0; |
0 | 4832 *(float *)&v732 = (double)v211; |
4833 LODWORD(v725) = v211 + 2500; | |
486 | 4834 v721 = 0; |
0 | 4835 *(float *)&y = (double)(v211 + 2500); |
4836 v730 = v208 == 3 ? a2 : 0; | |
4837 a2 = 20; | |
4838 do | |
4839 { | |
4840 v215 = rand(); | |
4841 v216 = (double)v721; | |
4842 v727 = v216; | |
4843 v217 = (double)SHIDWORD(v733); | |
4844 *(float *)&uRequiredMana = v217; | |
4845 _this = (ItemGen *)(v215 % 1000); | |
4846 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4847 *(float *)&v721 = v217 * v217; | |
4848 *(float *)&v726 = v216 * v216; | |
4849 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4850 { | |
486 | 4851 LODWORD(v685) = 0; |
4852 HIDWORD(v685) = 0; | |
0 | 4853 } |
4854 else | |
4855 { | |
4856 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4857 v685 = __PAIR__( | |
4858 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4859 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4860 } | |
4861 a1.stru_24.Reset(); | |
4862 a1.field_48 = v3->spellnum; | |
4863 a1.field_4C = v2; | |
4864 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4865 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 4866 a1.uAttributes = 0; |
0 | 4867 a1.vPosition.x = LODWORD(v718); |
4868 a1.vPosition.y = v713; | |
486 | 4869 a1.uSectorID = 0; |
0 | 4870 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); |
486 | 4871 a1.uSpriteFrameID = 0; |
303 | 4872 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4873 a1.field_5C = v730; |
4874 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4875 a1.uFacing = v685; | |
4876 a1.uSoundID = LOWORD(v3->field_10); | |
4877 if ( pParty->bTurnBasedModeOn == 1 ) | |
4878 a1.uAttributes = 4; | |
4879 if ( a1.Create( | |
4880 v685, | |
4881 SHIDWORD(v685), | |
4882 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4883 0) != -1 |
0 | 4884 && pParty->bTurnBasedModeOn == 1 ) |
4885 ++pTurnEngine->field_1C; | |
4886 v721 = rand() % 1024 - 512; | |
4887 v218 = rand(); | |
4888 v14 = a2-- == 1; | |
4889 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4890 } | |
4891 while ( !v14 ); | |
4892 goto LABEL_1056; | |
4893 case 23: | |
4894 v219 = v12 - 2; | |
4895 if ( v219 ) | |
4896 { | |
4897 v220 = v219 - 1; | |
4898 if ( v220 ) | |
4899 { | |
4900 if ( v220 == 1 ) | |
4901 { | |
486 | 4902 amount = 0; |
0 | 4903 goto LABEL_433; |
4904 } | |
4905 v221 = 180 * v2; | |
4906 } | |
4907 else | |
4908 { | |
4909 v221 = 86400 * v2; | |
4910 } | |
4911 } | |
4912 else | |
4913 { | |
4914 v221 = 3600 * v2; | |
4915 } | |
4916 amount = v221; | |
4917 LABEL_433: | |
4918 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4919 goto play_sound_and_continue; |
0 | 4920 v222 = (char *)pParty->pPlayers; |
4921 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
4922 break; | |
4923 case 24: | |
4924 v224 = v12 - 2; | |
4925 if ( v224 ) | |
4926 { | |
4927 v225 = v224 - 1; | |
4928 if ( v225 ) | |
4929 { | |
4930 if ( v225 == 1 ) | |
4931 amount = 7; | |
4932 else | |
4933 amount = 1; | |
4934 } | |
4935 else | |
4936 { | |
4937 amount = 5; | |
4938 } | |
4939 } | |
4940 else | |
4941 { | |
4942 amount = 3; | |
4943 } | |
4944 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4945 goto play_sound_and_continue; |
0 | 4946 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; |
4947 if ( amount == 1 ) | |
4948 { | |
4949 LABEL_152: | |
4950 a1.stru_24.Reset(); | |
4951 a1.field_48 = v3->spellnum; | |
4952 a1.field_50 = v731; | |
4953 a1.field_4C = v2; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4954 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4955 a1.vPosition.y = pParty->vPosition.y; |
4956 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4957 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4958 v660 = pParty->vPosition.y; | |
4959 LABEL_153: | |
486 | 4960 a1.uAttributes = 0; |
0 | 4961 a1.vPosition.x = pParty->vPosition.x; |
4962 a1.vPosition.z = v51; | |
4963 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
486 | 4964 a1.uSpriteFrameID = 0; |
0 | 4965 a1.uSectorID = v52; |
4966 v53 = 8 * v3->uPlayerID; | |
303 | 4967 LOBYTE(v53) = v53 | OBJECT_Player; |
4968 a1.field_58_pid = v53; | |
0 | 4969 a1.field_5C = a2; |
4970 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4971 a1.uFacing = LOWORD(v715.uYawAngle); | |
4972 a1.uSoundID = LOWORD(v3->field_10); | |
4973 LABEL_154: | |
4974 if ( pParty->bTurnBasedModeOn == 1 ) | |
4975 LOBYTE(a1.uAttributes) |= 4u; | |
4976 LABEL_156: | |
4977 v669 = v3->uPlayerID + 1; | |
4978 v36 = v715.uYawAngle; | |
4979 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
4980 v654 = v715.uPitchAngle; | |
4981 LABEL_157: | |
4982 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
4983 ++pTurnEngine->field_1C; | |
4984 } | |
4985 else | |
4986 { | |
4987 v732 = SHIDWORD(v733) / (amount - 1); | |
4988 a1.stru_24.Reset(); | |
4989 a1.field_48 = v3->spellnum; | |
4990 a1.field_4C = v2; | |
4991 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4992 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4993 a1.vPosition.y = pParty->vPosition.y; |
4994 a1.vPosition.x = pParty->vPosition.x; | |
486 | 4995 a1.uAttributes = 0; |
0 | 4996 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
4997 a1.uSectorID = pIndoor->GetSector( | |
4998 pParty->vPosition.x, | |
4999 pParty->vPosition.y, | |
5000 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 5001 a1.uSpriteFrameID = 0; |
0 | 5002 v226 = 8 * v3->uPlayerID; |
303 | 5003 LOBYTE(v226) = v226 | OBJECT_Player; |
5004 a1.field_58_pid = v226; | |
0 | 5005 a1.field_5C = a2; |
5006 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5007 a1.uSoundID = LOWORD(v3->field_10); | |
5008 if ( pParty->bTurnBasedModeOn == 1 ) | |
5009 LOBYTE(a1.uAttributes) |= 4u; | |
5010 v227 = SHIDWORD(v733) / -2; | |
5011 y = (char *)(SHIDWORD(v733) / 2); | |
5012 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5013 { | |
5014 v228 = v715.uYawAngle; | |
5015 do | |
5016 { | |
5017 a1.uFacing = v227 + v228; | |
5018 if ( a1.Create( | |
5019 v227 + v228, | |
5020 v715.uPitchAngle, | |
5021 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5022 v3->uPlayerID + 1) != -1 | |
5023 && pParty->bTurnBasedModeOn == 1 ) | |
5024 ++pTurnEngine->field_1C; | |
5025 v227 += v732; | |
5026 } | |
5027 while ( v227 <= (signed int)y ); | |
5028 } | |
5029 } | |
5030 goto LABEL_1056; | |
5031 case 27: | |
5032 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5033 goto LABEL_461; | |
5034 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5035 v229 = 600 * v2; | |
5036 else | |
5037 v229 = 3600 * v2; | |
5038 LODWORD(v733) = v229; | |
5039 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5040 goto play_sound_and_continue; |
486 | 5041 v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); |
488 | 5042 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
5043 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
5044 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
5045 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 5046 v239 = v3->uPlayerID + 1; |
5047 v732 = v229 << 7; | |
5048 pParty->pPartyBuffs[18].Apply( | |
5049 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5050 v731, | |
5051 amount, | |
5052 v716, | |
5053 v239); | |
5054 if ( v731 == 4 ) | |
5055 pParty->pPartyBuffs[18].uFlags = 1; | |
488 | 5056 LODWORD(v727) = 1; |
5057 goto play_sound_and_continue; | |
0 | 5058 case 28: |
5059 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5060 goto play_sound_and_continue; |
0 | 5061 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
5062 y = v240; | |
5063 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5064 goto LABEL_199; | |
5065 if ( v731 == 1 || v731 == 2 ) | |
5066 { | |
5067 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5068 } | |
5069 else | |
5070 { | |
5071 if ( v731 == 3 ) | |
5072 { | |
5073 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5074 } | |
5075 else | |
5076 { | |
5077 if ( v731 != 4 ) | |
5078 { | |
5079 v241 = 0.0; | |
5080 goto LABEL_484; | |
5081 } | |
5082 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5083 } | |
5084 } | |
5085 if ( v241 > 1.0 ) | |
5086 v241 = 1.0; | |
5087 LABEL_484: | |
5088 v732 = (unsigned __int8)v240[25]; | |
5089 v242 = (signed __int64)((double)v732 * v241); | |
5090 v243 = y; | |
5091 y[25] = v242; | |
5092 *((int *)v243 + 4) = (unsigned __int8)v242; | |
486 | 5093 if ( (unsigned __int8)v242 <= 0 ) |
5094 { | |
5095 *(int *)v243 = 0; | |
0 | 5096 dword_50C9D0 = 113; |
486 | 5097 dword_50C9D4 = 0; |
0 | 5098 dword_50C9D8 = 1; |
5099 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
486 | 5100 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5101 v3->spellnum = 0; | |
0 | 5102 goto LABEL_1165; |
5103 } | |
5104 *((int *)v243 + 5) |= 0x40u; | |
5105 goto LABEL_1055; | |
5106 case 30: | |
5107 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5108 goto play_sound_and_continue; |
486 | 5109 uRequiredMana = 0; |
0 | 5110 HIDWORD(v733) = 10 * v2; |
5111 v730 = 1; | |
5112 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5113 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5114 if ( v731 == 1 ) | |
5115 { | |
5116 v245 = (int)&v244[36 * a2 + 532]; | |
5117 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5118 v311 = __OFSUB__(*(int *)v245, 134); | |
5119 v14 = *(int *)v245 == 134; | |
5120 v310 = *(int *)v245 - 134 < 0; | |
5121 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5122 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5123 { | |
486 | 5124 if ( *(int *)&v244[36 * a2 + 544] == 0 ) |
0 | 5125 { |
486 | 5126 if ( *(int *)&v244[36 * a2 + 536] == 0 ) |
0 | 5127 { |
486 | 5128 if ( *(int *)&v244[36 * a2 + 540] == 0 ) |
0 | 5129 { |
5130 v312 = v309[28]; | |
5131 if ( v312 ) | |
5132 { | |
5133 if ( v312 != 1 ) | |
5134 { | |
5135 if ( v312 != 2 ) | |
5136 { | |
5137 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5138 if ( !(v244[36 * a2 + 552] & 2) ) | |
5139 { | |
5140 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5141 { | |
5142 uRequiredMana = 1; | |
486 | 5143 v730 = 0; |
0 | 5144 } |
5145 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5146 uRequiredMana = 1; | |
486 | 5147 if (!uRequiredMana) |
0 | 5148 { |
5149 v313 = *(char *)(LODWORD(v725) + 28); | |
5150 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5151 { | |
224 | 5152 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5153 *(int *)(v245 + 4) = 0; |
222 | 5154 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5155 + 1]; |
5156 ; | |
222 | 5157 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5158 + 1] ) |
5159 { | |
5160 ++*(int *)(v245 + 4); | |
5161 if ( j >= v314 ) | |
5162 break; | |
5163 } | |
5164 v254 = rand(); | |
224 | 5165 v255 = 10;//pItemsTable->field_116D8[17]; |
5166 v256 = 10;//pItemsTable->field_116D8[16]; | |
0 | 5167 LABEL_611: |
5168 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5169 LABEL_612: | |
5170 _this->uItemID |= 0x20u; | |
5171 goto LABEL_1055; | |
5172 } | |
5173 goto LABEL_615; | |
5174 } | |
5175 LABEL_613: | |
5176 v316 = _this->uItemID; | |
5177 if ( !(BYTE1(v316) & 2) ) | |
5178 { | |
5179 LOBYTE(v316) = v316 | 2; | |
5180 _this->uItemID = v316; | |
5181 } | |
5182 } | |
5183 } | |
5184 } | |
5185 } | |
5186 } | |
5187 } | |
5188 } | |
5189 } | |
5190 LABEL_616: | |
486 | 5191 if ( LODWORD(v727) == 0 ) |
0 | 5192 { |
5193 v317 = pGlobalTXT_LocalizationStrings[428]; | |
486 | 5194 if ( v730 == 0 ) |
0 | 5195 v317 = pGlobalTXT_LocalizationStrings[585]; |
5196 ShowStatusBarString(v317, 2u); | |
486 | 5197 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 5198 v318 = v726; |
486 | 5199 v3->spellnum = 0; |
5200 v318->PlaySound(SPEECH_43, 0); | |
0 | 5201 } |
488 | 5202 goto play_sound_and_continue; |
0 | 5203 } |
5204 if ( v731 != 2 ) | |
5205 { | |
5206 if ( v731 == 3 ) | |
5207 { | |
5208 v245 = (int)&v244[36 * a2 + 532]; | |
5209 v269 = *(int *)v245; | |
5210 if ( *(int *)v245 > 134 | |
486 | 5211 || *(int *)(v245 + 12) != 0 |
5212 || *(int *)(v245 + 4) != 0 | |
5213 || *(int *)(v245 + 8) != 0 | |
0 | 5214 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) |
5215 goto LABEL_616; | |
5216 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5217 LODWORD(v725) = (int)v270; | |
5218 v271 = v270[28]; | |
5219 if ( v271 && v271 != 1 && v271 != 2 ) | |
5220 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5221 else | |
5222 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5223 if ( v272 ) | |
5224 { | |
5225 uRequiredMana = 1; | |
486 | 5226 v730 = 0; |
0 | 5227 } |
5228 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5229 uRequiredMana = 1; | |
486 | 5230 if (uRequiredMana) |
0 | 5231 goto LABEL_613; |
5232 v273 = v725; | |
5233 v274 = *(char *)(LODWORD(v725) + 28); | |
5234 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 ) | |
5235 { | |
5236 if ( rand() % 100 < 80 | |
5237 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5238 { | |
224 | 5239 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5240 *(int *)(v245 + 4) = 0; |
222 | 5241 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5242 ; |
222 | 5243 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5244 + 1] ) |
5245 { | |
5246 ++*(int *)(v245 + 4); | |
5247 if ( k >= v275 ) | |
5248 break; | |
5249 } | |
5250 v254 = rand(); | |
224 | 5251 v255 = 10;//pItemsTable->field_116D8[19]; |
5252 v256 = 10;//pItemsTable->field_116D8[18]; | |
0 | 5253 goto LABEL_611; |
5254 } | |
222 | 5255 v277 = pItemsTable->pSpecialEnchantments_count; |
0 | 5256 v278 = 0; |
5257 v725 = 0.0; | |
5258 HIDWORD(v733) = 0; | |
222 | 5259 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5260 { |
5261 v730 = (int)&v679; | |
5262 do | |
5263 { | |
222 | 5264 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement); |
0 | 5265 if ( !v279 || v279 == 1 ) |
5266 { | |
222 | 5267 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5268 + 4] |
5269 + v278 * 28); | |
5270 LODWORD(v725) += v280; | |
5271 if ( v280 ) | |
5272 { | |
5273 v281 = v730; | |
5274 v730 += 4; | |
5275 *(int *)v281 = HIDWORD(v733); | |
5276 } | |
5277 } | |
5278 ++HIDWORD(v733); | |
5279 ++v278; | |
5280 } | |
5281 while ( SHIDWORD(v733) < v277 ); | |
5282 } | |
5283 v282 = rand() % SLODWORD(v725); | |
5284 v283 = v679; | |
5285 *(int *)(v245 + 12) = v679; | |
222 | 5286 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5287 v285 = v282 + 1; |
5288 if ( v284 < v285 ) | |
5289 { | |
5290 for ( l = &v679; ; l = (int *)v732 ) | |
5291 { | |
5292 v287 = (int)(l + 1); | |
5293 v732 = v287; | |
5294 v288 = *(int *)v287; | |
5295 *(int *)(v245 + 12) = v288; | |
222 | 5296 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5297 + 4]; |
5298 if ( v284 >= v285 ) | |
5299 break; | |
5300 } | |
5301 } | |
5302 goto LABEL_525; | |
5303 } | |
5304 } | |
5305 else | |
5306 { | |
5307 if ( v731 != 4 | |
5308 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
486 | 5309 || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 |
570 | 5310 || v726->pInventoryItems[a2].uEnchantmentType != 0 |
486 | 5311 || v726->pInventoryItems[a2]._bonus_strength != 0 |
315 | 5312 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) |
0 | 5313 goto LABEL_616; |
5314 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5315 LODWORD(v725) = (int)v247; | |
5316 v248 = v247[28]; | |
5317 if ( v248 && v248 != 1 && v248 != 2 ) | |
5318 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5319 else | |
5320 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5321 if ( v249 ) | |
5322 { | |
5323 uRequiredMana = 1; | |
486 | 5324 v730 = 0; |
0 | 5325 } |
5326 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5327 uRequiredMana = 1; | |
486 | 5328 if (uRequiredMana) |
0 | 5329 goto LABEL_613; |
5330 v250 = v725; | |
5331 v251 = *(char *)(LODWORD(v725) + 28); | |
5332 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 ) | |
5333 { | |
5334 if ( rand() % 100 < 80 | |
5335 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5336 { | |
224 | 5337 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5338 *(int *)(v245 + 4) = 0; |
222 | 5339 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5340 ; |
222 | 5341 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5342 + 1] ) |
5343 { | |
5344 ++*(int *)(v245 + 4); | |
5345 if ( m >= v252 ) | |
5346 break; | |
5347 } | |
5348 v254 = rand(); | |
224 | 5349 v255 = 10;// pItemsTable->field_116D8[21]; |
5350 v256 = 10;//pItemsTable->field_116D8[20]; | |
0 | 5351 goto LABEL_611; |
5352 } | |
222 | 5353 v257 = pItemsTable->pSpecialEnchantments_count; |
0 | 5354 v258 = 0; |
5355 v725 = 0.0; | |
5356 HIDWORD(v733) = 0; | |
222 | 5357 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5358 { |
5359 v730 = (int)&v679; | |
5360 do | |
5361 { | |
222 | 5362 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
0 | 5363 if ( !v259 || v259 == 1 ) |
5364 { | |
222 | 5365 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5366 + 4] |
5367 + v258 * 28); | |
5368 LODWORD(v725) += v260; | |
5369 if ( v260 ) | |
5370 { | |
5371 v261 = v730; | |
5372 v730 += 4; | |
5373 *(int *)v261 = HIDWORD(v733); | |
5374 } | |
5375 } | |
5376 ++HIDWORD(v733); | |
5377 ++v258; | |
5378 } | |
5379 while ( SHIDWORD(v733) < v257 ); | |
5380 } | |
5381 v262 = rand() % SLODWORD(v725); | |
5382 v263 = v679; | |
5383 *(int *)(v245 + 12) = v679; | |
222 | 5384 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5385 v265 = v262 + 1; |
5386 if ( v264 < v265 ) | |
5387 { | |
5388 for ( ii = &v679; ; ii = (int *)v732 ) | |
5389 { | |
5390 v267 = (int)(ii + 1); | |
5391 v732 = v267; | |
5392 v268 = *(int *)v267; | |
5393 *(int *)(v245 + 12) = v268; | |
222 | 5394 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5395 + 4]; |
5396 if ( v264 >= v265 ) | |
5397 break; | |
5398 } | |
5399 } | |
5400 LABEL_525: | |
5401 ++*(int *)(v245 + 12); | |
5402 goto LABEL_612; | |
5403 } | |
5404 } | |
5405 LABEL_615: | |
486 | 5406 //v1 = 0; |
0 | 5407 goto LABEL_616; |
5408 } | |
5409 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5410 _this = v289; | |
5411 v290 = v289->uItemID; | |
5412 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5413 if ( v290 > 134 | |
486 | 5414 || _this->uSpecEnchantmentType != 0 |
570 | 5415 || _this->uEnchantmentType != 0 |
486 | 5416 || _this->_bonus_strength != 0 |
0 | 5417 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 |
5418 || v291 == 1 | |
5419 || v291 == 2 | |
315 | 5420 || _this->Broken()) |
0 | 5421 goto LABEL_616; |
5422 if ( _this->GetValue() < 0x1C2 ) | |
5423 uRequiredMana = 1; | |
5424 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5425 uRequiredMana = 1; | |
486 | 5426 if ( uRequiredMana != 0 ) |
0 | 5427 goto LABEL_199; |
5428 v292 = *(char *)(LODWORD(v725) + 28); | |
5429 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5430 { | |
5431 v2 = v723; | |
486 | 5432 //v1 = 0; |
0 | 5433 goto LABEL_199; |
5434 } | |
5435 if ( rand() % 100 >= 80 ) | |
5436 { | |
222 | 5437 v297 = pItemsTable->pSpecialEnchantments_count; |
0 | 5438 v294 = _this; |
5439 v298 = 0; | |
5440 v725 = 0.0; | |
5441 HIDWORD(v733) = 0; | |
222 | 5442 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5443 { |
5444 v730 = (int)&v679; | |
5445 do | |
5446 { | |
222 | 5447 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement); |
0 | 5448 if ( !v299 || v299 == 1 ) |
5449 { | |
222 | 5450 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4] |
0 | 5451 + v298 * 28); |
5452 LODWORD(v725) += v300; | |
5453 if ( v300 ) | |
5454 { | |
5455 v301 = v730; | |
5456 v730 += 4; | |
5457 *(int *)v301 = HIDWORD(v733); | |
5458 } | |
5459 } | |
5460 ++HIDWORD(v733); | |
5461 ++v298; | |
5462 } | |
5463 while ( SHIDWORD(v733) < v297 ); | |
5464 } | |
5465 v302 = rand() % SLODWORD(v725); | |
5466 v303 = v679; | |
377 | 5467 v294->uSpecEnchantmentType = v679; |
222 | 5468 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5469 v305 = v302 + 1; |
5470 if ( v304 < v305 ) | |
5471 { | |
5472 for ( jj = &v679; ; jj = (int *)v732 ) | |
5473 { | |
5474 v307 = (int)(jj + 1); | |
5475 v732 = v307; | |
5476 v308 = *(int *)v307; | |
377 | 5477 v294->uSpecEnchantmentType = v308; |
222 | 5478 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5479 if ( v304 >= v305 ) |
5480 break; | |
5481 } | |
5482 } | |
377 | 5483 ++v294->uSpecEnchantmentType; |
0 | 5484 } |
5485 else | |
5486 { | |
5487 v293 = rand(); | |
5488 v294 = _this; | |
224 | 5489 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
570 | 5490 _this->uEnchantmentType = 0; |
222 | 5491 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; |
0 | 5492 ; |
570 | 5493 kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType |
0 | 5494 + 1] ) |
5495 { | |
570 | 5496 ++v294->uEnchantmentType; |
0 | 5497 if ( kk >= v295 ) |
5498 break; | |
5499 } | |
224 | 5500 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5501 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
0 | 5502 } |
5503 v294->uAttributes |= 0x20u; | |
5504 goto LABEL_1055; | |
5505 case 31: | |
5506 amount = 10 * v2; | |
5507 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
488 | 5508 goto play_sound_and_continue; |
0 | 5509 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) |
5510 goto LABEL_200; | |
5511 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
486 | 5512 pMessageQueue_50CBD0->AddMessage(UIMSG_C3, 0, 0); |
0 | 5513 goto LABEL_1056; |
5514 case 33: | |
5515 LODWORD(v733) = 604800 * v2; | |
5516 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5517 goto LABEL_200; | |
5518 v319 = uRequiredMana; | |
5519 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5520 { | |
5521 pEventTimer->Pause(); | |
486 | 5522 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, 0, 0); |
0 | 5523 qword_506350 = (signed int)v733; |
5524 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5525 ::uRequiredMana = v319; | |
5526 ::sRecoveryTime = sRecoveryTime; | |
5527 dword_50633C = v3->field_10; | |
5528 dword_506338 = v3->spellnum; | |
5529 LOBYTE(v3->field_8) |= 0x20u; | |
5530 } | |
488 | 5531 goto play_sound_and_continue; |
0 | 5532 case 40: |
5533 v320 = v12 - 2; | |
5534 if ( !v320 ) | |
5535 goto LABEL_632; | |
5536 v321 = v320 - 1; | |
5537 if ( v321 ) | |
5538 { | |
5539 if ( v321 == 1 ) | |
5540 goto LABEL_634; | |
5541 LABEL_632: | |
5542 v322 = 3600 * v2; | |
5543 } | |
5544 else | |
5545 { | |
5546 v322 = 86400 * v2; | |
5547 } | |
5548 amount = v322; | |
5549 LABEL_634: | |
5550 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5551 goto play_sound_and_continue; |
0 | 5552 v323 = v3->uPlayerID_2; |
5553 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5554 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5555 goto LABEL_1056; | |
5556 if ( v731 == 4 ) | |
5557 goto LABEL_637; | |
5558 v732 = amount << 7; | |
5559 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5560 v656 = 15; | |
5561 goto LABEL_640; | |
5562 case 41: | |
5563 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5564 goto play_sound_and_continue; |
0 | 5565 a1.stru_24.Reset(); |
5566 a1.field_48 = v3->spellnum; | |
5567 a1.field_4C = v2; | |
5568 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5569 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 5570 a1.vPosition.y = pParty->vPosition.y; |
5571 a1.vPosition.x = pParty->vPosition.x; | |
486 | 5572 a1.uAttributes = 0; |
0 | 5573 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5574 a1.uSectorID = pIndoor->GetSector( | |
5575 pParty->vPosition.x, | |
5576 pParty->vPosition.y, | |
5577 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 5578 a1.uSpriteFrameID = 0; |
0 | 5579 v326 = 8 * v3->uPlayerID; |
303 | 5580 LOBYTE(v326) = v326 | OBJECT_Player; |
5581 a1.field_58_pid = v326; | |
0 | 5582 a1.field_5C = a2; |
5583 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5584 a1.uFacing = LOWORD(pParty->sRotationY); | |
5585 a1.uSoundID = LOWORD(v3->field_10); | |
5586 if ( pParty->bTurnBasedModeOn == 1 ) | |
5587 LOBYTE(a1.uAttributes) |= 4u; | |
5588 v669 = v3->uPlayerID + 1; | |
5589 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5590 v654 = pParty->sRotationX; | |
5591 goto LABEL_125; | |
5592 case 43: | |
5593 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5594 goto LABEL_200; | |
5595 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5596 goto play_sound_and_continue; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5597 a1.uType = 4090; |
0 | 5598 a1.stru_24.Reset(); |
5599 a1.field_48 = v3->spellnum; | |
5600 a1.field_4C = v2; | |
5601 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5602 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 5603 a1.vPosition.x = pParty->vPosition.x; |
5604 a1.vPosition.y = pParty->vPosition.y; | |
486 | 5605 a1.uAttributes = 0; |
5606 a1.uSectorID = 0; | |
5607 a1.uSpriteFrameID = 0; | |
0 | 5608 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5609 v327 = 8 * v3->uPlayerID; | |
303 | 5610 LOBYTE(v327) = v327 | OBJECT_Player; |
0 | 5611 a1.field_60_distance_related_prolly_lod = 0; |
303 | 5612 a1.field_58_pid = v327; |
0 | 5613 a1.field_5C = a2; |
5614 a1.uFacing = LOWORD(pParty->sRotationY); | |
5615 a1.uSoundID = LOWORD(v3->field_10); | |
5616 if ( pParty->bTurnBasedModeOn == 1 ) | |
5617 a1.uAttributes = 4; | |
486 | 5618 v669 = 0; |
0 | 5619 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5620 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5621 LABEL_124: | |
5622 v654 = v35; | |
5623 LABEL_125: | |
5624 v36 = pParty->sRotationY; | |
5625 goto LABEL_157; | |
488 | 5626 |
5627 case SPELL_SPIRIT_DETECT_LIFE: | |
0 | 5628 v328 = v12 - 2; |
5629 if ( v328 ) | |
5630 { | |
5631 v329 = v328 - 1; | |
5632 if ( v329 && v329 != 1 ) | |
5633 v330 = 600 * v2; | |
5634 else | |
5635 v330 = 3600 * v2; | |
5636 } | |
5637 else | |
5638 { | |
5639 v330 = 1800 * v2; | |
5640 } | |
5641 LODWORD(v733) = v330; | |
5642 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5643 goto play_sound_and_continue; |
5644 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
5645 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
5646 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
5647 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 5648 v83 = 1; |
488 | 5649 |
0 | 5650 v732 = (int)v733 << 7; |
488 | 5651 |
5652 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); | |
5653 LODWORD(v727) = v83; | |
5654 | |
5655 goto play_sound_and_continue; | |
5656 | |
5657 case SPELL_SPIRIT_FATE: | |
0 | 5658 LODWORD(v733) = 300; |
5659 v339 = v12 - 2; | |
5660 if ( v339 ) | |
5661 { | |
5662 v340 = v339 - 1; | |
5663 if ( v340 ) | |
5664 { | |
5665 if ( v340 != 1 ) | |
5666 { | |
5667 amount = v2; | |
5668 goto LABEL_667; | |
5669 } | |
5670 v341 = 6 * v2; | |
5671 } | |
5672 else | |
5673 { | |
5674 v341 = 4 * v2; | |
5675 } | |
5676 } | |
5677 else | |
5678 { | |
5679 v341 = 2 * v2; | |
5680 } | |
5681 amount = v341; | |
5682 LABEL_667: | |
5683 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5684 goto play_sound_and_continue; |
5685 v342 = v3->spell_target_pid; | |
486 | 5686 if ( v342 == 0 ) |
0 | 5687 { |
488 | 5688 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5689 | |
5690 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0); | |
5691 goto LABEL_1056; | |
0 | 5692 } |
141 | 5693 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5694 { |
5695 v343 = v342 >> 3; | |
486 | 5696 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32); |
0 | 5697 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; |
486 | 5698 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0); |
0 | 5699 BYTE2(pActors[v343].uAttributes) |= 8u; |
486 | 5700 v672 = 0; |
0 | 5701 v661 = &pActors[v343]; |
5702 LABEL_165: | |
5703 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5704 } | |
5705 goto LABEL_1056; | |
488 | 5706 |
0 | 5707 case 49: |
5708 v348 = v12 - 2; | |
5709 if ( !v348 ) | |
5710 goto LABEL_677; | |
5711 v349 = v348 - 1; | |
5712 if ( v349 ) | |
5713 { | |
5714 if ( v349 == 1 ) | |
5715 { | |
486 | 5716 amount = 0; |
0 | 5717 goto LABEL_679; |
5718 } | |
5719 LABEL_677: | |
5720 v350 = 3600 * v2; | |
5721 } | |
5722 else | |
5723 { | |
5724 v350 = 86400 * v2; | |
5725 } | |
5726 amount = v350; | |
5727 LABEL_679: | |
5728 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5729 goto play_sound_and_continue; |
0 | 5730 v351 = &pParty->pPlayers[v3->uPlayerID_2]; |
5731 if ( !v351->pConditions[0] ) | |
5732 goto LABEL_1056; | |
5733 if ( v731 == 4 ) | |
5734 { | |
486 | 5735 LODWORD(v351->pConditions[0]) = 0; |
5736 HIDWORD(v351->pConditions[0]) = 0; | |
0 | 5737 goto LABEL_904; |
5738 } | |
5739 v732 = amount << 7; | |
5740 v351->DiscardConditionIfLastsLongerThan( | |
486 | 5741 0, |
0 | 5742 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); |
5743 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5744 goto LABEL_1056; | |
5745 v674 = v3->uPlayerID_2; | |
5746 goto LABEL_685; | |
488 | 5747 case SPELL_SPIRIT_PRESERVATION: |
0 | 5748 v354 = v12 - 2; |
5749 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5750 v356 = 900 * (v2 + 4); | |
5751 else | |
5752 v356 = 300 * (v2 + 12); | |
5753 LODWORD(v733) = v356; | |
5754 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5755 goto play_sound_and_continue; |
0 | 5756 if ( v731 == 1 || v731 == 2 ) |
5757 { | |
488 | 5758 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5759 | |
0 | 5760 v732 = (int)v733 << 7; |
488 | 5761 |
5762 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); | |
5763 goto LABEL_1056; | |
0 | 5764 } |
486 | 5765 a2 = 0; |
0 | 5766 v732 = (int)v733 << 7; |
5767 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5768 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5769 do |
5770 { | |
488 | 5771 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
5772 v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); | |
0 | 5773 ++a2; |
112 | 5774 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5775 } | |
5776 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5777 goto LABEL_1056; |
5778 case 48: | |
5779 v364 = v12 - 2; | |
5780 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5781 v366 = 60 * (v2 + 3); | |
5782 else | |
5783 v366 = 300 * v2 + 180; | |
5784 LODWORD(v733) = v366; | |
5785 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5786 goto play_sound_and_continue; |
0 | 5787 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
5788 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5789 ++a1.uType; |
0 | 5790 a1.stru_24.Reset(); |
5791 a1.field_48 = v3->spellnum; | |
5792 a1.field_4C = v2; | |
5793 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5794 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 5795 a1.uAttributes = 0; |
5796 a1.uSectorID = 0; | |
5797 a1.uSpriteFrameID = 0; | |
0 | 5798 v368 = v3->uPlayerID; |
5799 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 5800 a1.uFacing = 0; |
0 | 5801 v368 *= 8; |
303 | 5802 LOBYTE(v368) = v368 | OBJECT_Player; |
5803 a1.field_58_pid = v368; | |
0 | 5804 a1.uSoundID = LOWORD(v3->field_10); |
486 | 5805 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 5806 { |
5807 v369 = &pActors[dword_50BF30[a2]]; | |
5808 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5809 { | |
5810 a1.vPosition.x = v369->vPosition.x; | |
5811 a1.vPosition.y = v369->vPosition.y; | |
5812 v732 = v369->uActorHeight; | |
5813 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5814 v370 = 8 * dword_50BF30[a2]; | |
486 | 5815 LOBYTE(v370) = v370 | OBJECT_Actor; |
0 | 5816 a1.field_5C = v370; |
486 | 5817 a1.Create(0, 0, 0, 0); |
0 | 5818 v732 = (int)v733 << 7; |
5819 v369->pActorBuffs[4].Apply( | |
5820 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
486 | 5821 v731, 0, 0, 0); |
0 | 5822 } |
5823 } | |
5824 goto LABEL_1056; | |
5825 case 53: | |
5826 v371 = v12 - 2; | |
5827 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
486 | 5828 amount = 0; |
0 | 5829 else |
5830 amount = 86400 * v2; | |
5831 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5832 goto play_sound_and_continue; |
486 | 5833 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, 0, 65536); |
0 | 5834 v373 = v3->uPlayerID_2; |
5835 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5836 goto LABEL_1056; | |
5837 v14 = v731 == 4; | |
5838 pParty->pPlayers[v373].sHealth = 1; | |
5839 if ( v14 ) | |
5840 { | |
5841 v374 = v3->uPlayerID_2; | |
486 | 5842 LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0; |
5843 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0; | |
0 | 5844 v376 = v3->uPlayerID_2; |
486 | 5845 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0; |
5846 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0; | |
0 | 5847 } |
5848 else | |
5849 { | |
5850 v732 = amount << 7; | |
5851 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5852 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5853 0xEu, | |
5854 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5855 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5856 0xDu, | |
5857 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5858 } | |
112 | 5859 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 5860 goto LABEL_720; |
5861 case 54: | |
5862 v378 = v12 - 2; | |
5863 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
5864 v380 = 4 * v2; | |
5865 else | |
5866 v380 = 3 * v2; | |
5867 amount = v380; | |
5868 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5869 goto play_sound_and_continue; |
0 | 5870 v381 = 0; |
5871 HIDWORD(v733) = amount; | |
5872 v730 = 0; | |
5873 v382 = 1; | |
5874 do | |
5875 { | |
5876 v383 = pPlayers[v382]; | |
5877 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
5878 v682[v381++] = v382; | |
5879 ++v382; | |
5880 } | |
5881 while ( v382 <= 4 ); | |
5882 v384 = 0; | |
5883 v730 = v381; | |
486 | 5884 if ( v381 > 0 ) |
0 | 5885 { |
5886 do | |
5887 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
5888 while ( v384 < v381 ); | |
5889 } | |
5890 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
486 | 5891 HIDWORD(v733) = 0; |
5892 if ( v381 > 0 ) | |
0 | 5893 { |
5894 do | |
5895 { | |
5896 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
5897 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
5898 v726 = *(Player **)v385; | |
5899 v386 = v726->GetMaxHealth(); | |
5900 if ( v726->sHealth > v386 ) | |
5901 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
5902 v387 = *(Player **)v385; | |
486 | 5903 if ( v387->sHealth > 0 ) |
0 | 5904 { |
486 | 5905 LODWORD(v387->pConditions[13]) = 0; |
5906 HIDWORD(v387->pConditions[13]) = 0; | |
0 | 5907 } |
5908 v388 = HIDWORD(v733); | |
488 | 5909 |
5910 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, LOWORD(v682[HIDWORD(v733)]) - 1); | |
0 | 5911 HIDWORD(v733) = v388 + 1; |
5912 } | |
5913 while ( v388 + 1 < v730 ); | |
5914 } | |
5915 goto LABEL_1056; | |
488 | 5916 |
0 | 5917 case 55: |
5918 v392 = v12 - 1; | |
5919 if ( !v392 ) | |
5920 { | |
5921 v395 = 180 * v2; | |
5922 goto LABEL_750; | |
5923 } | |
5924 v393 = v392 - 1; | |
5925 if ( !v393 ) | |
5926 { | |
5927 v395 = 10800 * v2; | |
5928 goto LABEL_750; | |
5929 } | |
5930 v394 = v393 - 1; | |
5931 if ( !v394 ) | |
5932 { | |
5933 v395 = 259200 * v2; | |
5934 LABEL_750: | |
5935 amount = v395; | |
5936 goto LABEL_751; | |
5937 } | |
5938 if ( v394 == 1 ) | |
486 | 5939 amount = 0; |
0 | 5940 LABEL_751: |
5941 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5942 goto play_sound_and_continue; |
0 | 5943 v396 = v3->uPlayerID_2; |
5944 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
5945 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
5946 { | |
5947 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
486 | 5948 pParty->pPlayers[v396].PlaySound(SPEECH_25, 0); |
0 | 5949 if ( v731 == 4 ) |
5950 { | |
5951 v397 = v3->uPlayerID_2; | |
486 | 5952 LODWORD(pParty->pPlayers[v397].pConditions[16]) = 0; |
5953 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = 0; | |
0 | 5954 v398 = v3->uPlayerID_2; |
486 | 5955 LODWORD(pParty->pPlayers[v398].pConditions[14]) = 0; |
5956 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = 0; | |
0 | 5957 v399 = v3->uPlayerID_2; |
486 | 5958 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0; |
5959 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0; | |
0 | 5960 } |
5961 else | |
5962 { | |
5963 v732 = amount << 7; | |
5964 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5965 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5966 0x10u, | |
5967 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5968 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5969 0xEu, | |
5970 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5971 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5972 0xDu, | |
5973 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5974 } | |
5975 v83 = 1; | |
112 | 5976 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
488 | 5977 |
0 | 5978 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; |
488 | 5979 |
5980 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 5981 } |
5982 else | |
5983 { | |
5984 v83 = 1; | |
5985 } | |
488 | 5986 LODWORD(v727) = v83; |
5987 goto play_sound_and_continue; | |
5988 | |
0 | 5989 case 61: |
5990 v405 = v12 - 2; | |
5991 if ( !v405 ) | |
5992 goto LABEL_766; | |
5993 v406 = v405 - 1; | |
5994 if ( v406 ) | |
5995 { | |
5996 if ( v406 == 1 ) | |
5997 { | |
486 | 5998 amount = 0; |
0 | 5999 goto LABEL_768; |
6000 } | |
6001 LABEL_766: | |
6002 v407 = 3600 * v2; | |
6003 } | |
6004 else | |
6005 { | |
6006 v407 = 86400 * v2; | |
6007 } | |
6008 amount = v407; | |
6009 LABEL_768: | |
6010 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6011 goto play_sound_and_continue; |
6012 | |
6013 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6014 v323 = v3->uPlayerID_2; |
6015 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6016 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6017 goto LABEL_1056; | |
6018 if ( v731 == 4 ) | |
6019 goto LABEL_637; | |
6020 v732 = amount << 7; | |
6021 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6022 v656 = 12; | |
6023 goto LABEL_640; | |
6024 case 56: | |
6025 v411 = v12 - 2; | |
6026 if ( v411 ) | |
6027 { | |
6028 v412 = v411 - 1; | |
6029 if ( v412 ) | |
6030 { | |
6031 if ( v412 == 1 ) | |
6032 { | |
486 | 6033 amount = 0; |
0 | 6034 goto LABEL_780; |
6035 } | |
6036 v413 = 180 * v2; | |
6037 } | |
6038 else | |
6039 { | |
6040 v413 = 86400 * v2; | |
6041 } | |
6042 } | |
6043 else | |
6044 { | |
6045 v413 = 3600 * v2; | |
6046 } | |
6047 amount = v413; | |
6048 LABEL_780: | |
6049 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6050 goto play_sound_and_continue; |
6051 | |
6052 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6053 v323 = v3->uPlayerID_2; |
6054 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6055 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6056 goto LABEL_1056; | |
6057 if ( v731 == 4 ) | |
6058 goto LABEL_637; | |
6059 v732 = amount << 7; | |
6060 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6061 v656 = 3; | |
6062 goto LABEL_640; | |
6063 case 59: | |
6064 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6065 goto play_sound_and_continue; |
486 | 6066 if ( a2 == 0 || (a2 & 7) != OBJECT_Actor) |
0 | 6067 goto LABEL_1056; |
6068 v417 = (int)&pActors[a2 >> 3]; | |
6069 v730 = v417; | |
6070 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6071 { | |
6072 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6073 v417 = v730; | |
6074 } | |
6075 v418 = *(int *)(v417 + 672); | |
486 | 6076 HIDWORD(v733) = 0; |
0 | 6077 if ( pItemsTable->pItems[v418].uEquipType == 18 ) |
6078 HIDWORD(v733) = *(int *)(v417 + 684); | |
6079 | |
6080 //ItemGen::ItemGen(&v683); | |
6081 v683.Reset(); | |
6082 | |
6083 v419 = *(short *)(v730 + 180); | |
486 | 6084 if (v419) |
0 | 6085 { |
6086 v683.uItemID = v419; | |
6087 goto LABEL_799; | |
6088 } | |
6089 v420 = 0; | |
6090 v421 = v730 + 564; | |
486 | 6091 while ( !*(int *)v421 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) |
0 | 6092 { |
6093 ++v420; | |
6094 v421 += 36; | |
6095 if ( v420 >= 4 ) | |
6096 goto LABEL_799; | |
6097 } | |
6098 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6099 v2 = v723; | |
486 | 6100 //v1 = 0; |
0 | 6101 LABEL_799: |
486 | 6102 if ( HIDWORD(v733) != 0 ) |
0 | 6103 { |
6104 v675 = (const char *)HIDWORD(v733); | |
486 | 6105 if (v683.uItemID) |
0 | 6106 { |
6107 v422 = v683.GetDisplayName(); | |
6108 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6109 goto LABEL_807; | |
6110 } | |
6111 v664 = "%d gold"; | |
6112 goto LABEL_803; | |
6113 } | |
486 | 6114 if (v683.uItemID) |
0 | 6115 { |
6116 v675 = v683.GetDisplayName(); | |
6117 v664 = "(%s)"; | |
6118 LABEL_803: | |
6119 sprintf(pTmpBuf2, v664, v675); | |
6120 goto LABEL_807; | |
6121 } | |
6122 strcpy(pTmpBuf2, "nothing"); | |
6123 LABEL_807: | |
6124 ShowStatusBarString(pTmpBuf2, 2u); | |
6125 a1.stru_24.Reset(); | |
6126 a1.field_48 = v3->spellnum; | |
6127 a1.field_4C = v2; | |
6128 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6129 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 6130 a1.vPosition.x = *(short *)(v730 + 142); |
6131 a1.vPosition.y = *(short *)(v730 + 144); | |
6132 v676 = *(short *)(v730 + 138); | |
6133 v665 = a1.vPosition.y; | |
6134 a1.vPosition.z = *(short *)(v730 + 138); | |
6135 v657 = a1.vPosition.x; | |
6136 goto LABEL_1087; | |
6137 case 62: | |
6138 v423 = v12 - 2; | |
6139 if ( !v423 ) | |
6140 goto LABEL_813; | |
6141 v424 = v423 - 1; | |
6142 if ( v424 ) | |
6143 { | |
6144 if ( v424 == 1 ) | |
6145 v425 = 3600 * v2; | |
6146 else | |
6147 LABEL_813: | |
6148 v425 = 300 * v2; | |
6149 } | |
6150 else | |
6151 { | |
6152 v425 = 600 * v2; | |
6153 } | |
6154 amount = v425; | |
6155 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6156 goto play_sound_and_continue; |
0 | 6157 v426 = a2 >> 3; |
141 | 6158 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6159 goto LABEL_1056; |
6160 v730 = 836 * v426; | |
6161 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6162 { | |
90 | 6163 pActors[v426].pActorBuffs[1].Reset(); |
6164 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6165 v732 = amount << 7; |
90 | 6166 pActors[v426].pActorBuffs[9].Apply( |
0 | 6167 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6168 v731, 0, 0, 0); |
90 | 6169 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6170 } |
6171 a1.stru_24.Reset(); | |
6172 a1.field_48 = v3->spellnum; | |
6173 a1.field_4C = v2; | |
6174 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6175 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 6176 v61 = v426; |
0 | 6177 goto LABEL_1086; |
6178 case 66: | |
6179 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6180 goto play_sound_and_continue; |
0 | 6181 amount = 600 * v2; |
6182 v427 = a2 >> 3; | |
141 | 6183 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6184 goto LABEL_1056; |
6185 v730 = 836 * v427; | |
6186 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
488 | 6187 goto play_sound_and_continue; |
90 | 6188 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6189 { | |
6190 pActors[v427].pActorBuffs[9].Reset(); | |
6191 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6192 v732 = amount << 7; |
90 | 6193 pActors[v427].pActorBuffs[12].Apply( |
0 | 6194 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6195 v731, 0, 0, 0); |
0 | 6196 } |
6197 a1.stru_24.Reset(); | |
6198 a1.field_48 = v3->spellnum; | |
6199 a1.field_4C = v2; | |
6200 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6201 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 6202 v61 = v427; |
0 | 6203 goto LABEL_1086; |
6204 case 63: | |
6205 v428 = v12 - 2; | |
6206 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6207 v430 = 300 * v2; | |
6208 else | |
6209 v430 = 180 * v2; | |
6210 amount = v430; | |
6211 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6212 goto play_sound_and_continue; |
0 | 6213 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
6214 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6215 ++a1.uType; |
0 | 6216 a1.stru_24.Reset(); |
6217 a1.field_48 = v3->spellnum; | |
6218 a1.field_4C = v2; | |
6219 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6220 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 6221 a1.uAttributes = 0; |
6222 a1.uSectorID = 0; | |
6223 a1.uSpriteFrameID = 0; | |
0 | 6224 v432 = v3->uPlayerID; |
6225 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6226 a1.uFacing = 0; |
0 | 6227 v432 *= 8; |
303 | 6228 LOBYTE(v432) = v432 | OBJECT_Player; |
6229 a1.field_58_pid = v432; | |
0 | 6230 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6231 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 6232 { |
6233 v433 = &pActors[dword_50BF30[a2]]; | |
6234 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6235 break; | |
6236 a1.vPosition.x = v433->vPosition.x; | |
6237 a1.vPosition.y = v433->vPosition.y; | |
6238 v732 = v433->uActorHeight; | |
6239 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6240 v434 = 8 * dword_50BF30[a2]; | |
486 | 6241 LOBYTE(v434) = v434 | OBJECT_Actor; |
0 | 6242 a1.field_5C = v434; |
486 | 6243 a1.Create(0, 0, 0, 0); |
0 | 6244 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) |
6245 { | |
6246 v732 = amount << 7; | |
6247 v433->pActorBuffs[4].Apply( | |
6248 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
486 | 6249 v731, 0, 0, 0); |
0 | 6250 } |
6251 } | |
6252 goto LABEL_1056; | |
6253 case 64: | |
6254 v435 = v12 - 2; | |
6255 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
486 | 6256 amount = 0; |
0 | 6257 else |
6258 amount = 86400 * v2; | |
6259 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6260 goto play_sound_and_continue; |
6261 | |
6262 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6263 v440 = v3->uPlayerID_2; |
6264 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6265 { | |
6266 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
486 | 6267 pParty->pPlayers[v440].PlaySound(SPEECH_25, 0); |
0 | 6268 if ( v731 == 4 ) |
6269 { | |
6270 v441 = v3->uPlayerID_2; | |
486 | 6271 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; |
6272 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; | |
0 | 6273 } |
6274 else | |
6275 { | |
6276 v732 = amount << 7; | |
6277 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6278 5u, | |
6279 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6280 } | |
6281 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6282 LABEL_720: | |
486 | 6283 v377->SetCondition(1, 0); |
0 | 6284 } |
6285 goto LABEL_1056; | |
6286 case 42: | |
6287 v442 = v12 - 2; | |
6288 if ( !v442 ) | |
6289 goto LABEL_855; | |
6290 v443 = v442 - 1; | |
6291 if ( v443 ) | |
6292 { | |
6293 if ( v443 == 1 ) | |
6294 v444 = 4 * v2; | |
6295 else | |
6296 LABEL_855: | |
6297 v444 = 2 * v2; | |
6298 } | |
6299 else | |
6300 { | |
6301 v444 = 3 * v2; | |
6302 } | |
6303 amount = v444; | |
6304 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6305 goto play_sound_and_continue; |
0 | 6306 v445 = a2 >> 3; |
141 | 6307 if ( (a2 & 7) == OBJECT_Item) |
0 | 6308 { |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6309 v449 = (char *)&pSpriteObjects[v445].stru_24; |
0 | 6310 v450 = *(int *)v449; |
6311 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6312 { | |
6313 party_finds_gold(*((int *)v449 + 3), 0); | |
6314 viewparams->bRedrawGameUI = 1; | |
6315 } | |
6316 else | |
6317 { | |
189 | 6318 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
0 | 6319 ShowStatusBarString(pTmpBuf2, 2u); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6320 if ( !pParty->AddItem(&pSpriteObjects[v445].stru_24) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6321 pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24); |
0 | 6322 } |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6323 SpriteObject::OnInteraction(v445); |
0 | 6324 } |
6325 else | |
6326 { | |
141 | 6327 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6328 { |
6329 stru_50C198.LootActor(&pActors[v445]); | |
6330 } | |
6331 else | |
6332 { | |
141 | 6333 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6334 { |
141 | 6335 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6336 goto LABEL_1056; |
6337 dword_507CD8 = 1; | |
6338 v677 = 1; | |
6339 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6340 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6341 else | |
6342 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6343 goto LABEL_866; | |
6344 } | |
6345 v447 = &pLevelDecorations[v445]; | |
6346 dword_507CD8 = 1; | |
6347 v448 = v447->field_16_event_id; | |
486 | 6348 if (v448) |
0 | 6349 { |
6350 v677 = 1; | |
6351 v446 = v448; | |
6352 LABEL_866: | |
6353 EventProcessor(v446, a2, v677); | |
6354 goto LABEL_1056; | |
6355 } | |
6356 if ( v447->IsInteractive() ) | |
6357 { | |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
6358 activeLevelDecoration = v447; |
0 | 6359 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
6360 activeLevelDecoration = NULL; |
0 | 6361 } |
6362 } | |
6363 } | |
6364 goto LABEL_1056; | |
6365 case 67: | |
6366 v451 = v12 - 2; | |
6367 if ( v451 ) | |
6368 { | |
6369 v452 = v451 - 1; | |
6370 if ( v452 ) | |
6371 { | |
6372 if ( v452 == 1 ) | |
6373 { | |
486 | 6374 amount = 0; |
0 | 6375 goto LABEL_883; |
6376 } | |
6377 v453 = 180 * v2; | |
6378 } | |
6379 else | |
6380 { | |
6381 v453 = 86400 * v2; | |
6382 } | |
6383 } | |
6384 else | |
6385 { | |
6386 v453 = 3600 * v2; | |
6387 } | |
6388 amount = v453; | |
6389 LABEL_883: | |
6390 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6391 goto play_sound_and_continue; |
6392 | |
6393 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6394 v323 = v3->uPlayerID_2; |
6395 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6396 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6397 goto LABEL_1056; | |
6398 if ( v731 == 4 ) | |
6399 { | |
6400 LABEL_637: | |
486 | 6401 *(int *)v324 = 0; |
6402 *((int *)v324 + 1) = 0; | |
0 | 6403 goto LABEL_1056; |
6404 } | |
6405 v732 = amount << 7; | |
6406 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6407 v656 = 1; | |
6408 LABEL_640: | |
6409 v325 = &pParty->pPlayers[v323]; | |
6410 goto LABEL_641; | |
6411 case 68: | |
6412 v457 = v12 - 2; | |
6413 if ( v457 ) | |
6414 { | |
6415 v458 = v457 - 1; | |
6416 if ( v458 ) | |
6417 { | |
6418 if ( v458 == 1 ) | |
6419 v459 = 5 * v2 + 5; | |
6420 else | |
6421 v459 = 2 * v2 + 5; | |
6422 } | |
6423 else | |
6424 { | |
6425 v459 = 4 * v2 + 5; | |
6426 } | |
6427 } | |
6428 else | |
6429 { | |
6430 v459 = 3 * v2 + 5; | |
6431 } | |
6432 amount = v459; | |
6433 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6434 goto play_sound_and_continue; |
6435 v460 = v3->spell_target_pid; | |
486 | 6436 if (!v460) |
0 | 6437 { |
6438 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6439 LABEL_904: | |
6440 v674 = v3->uPlayerID_2; | |
6441 LABEL_685: | |
488 | 6442 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v674); |
0 | 6443 } |
6444 else | |
6445 { | |
141 | 6446 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6447 { |
6448 v461 = &pActors[v460 >> 3]; | |
6449 v462 = v461->uAIState; | |
6450 v463 = v461->pMonsterInfo.uHP; | |
6451 if ( v462 != 5 ) | |
6452 { | |
6453 if ( v462 != 4 ) | |
6454 { | |
6455 if ( v462 != 19 ) | |
6456 { | |
6457 if ( v462 != 11 ) | |
6458 { | |
6459 v461->sCurrentHP += amount; | |
6460 if ( v461->sCurrentHP > v463 ) | |
6461 v461->sCurrentHP = v463; | |
6462 } | |
6463 } | |
6464 } | |
6465 } | |
6466 } | |
6467 } | |
6468 goto LABEL_1056; | |
6469 case 72: | |
6470 v464 = v12 - 2; | |
6471 if ( !v464 ) | |
6472 goto LABEL_910; | |
6473 v465 = v464 - 1; | |
6474 if ( v465 ) | |
6475 { | |
6476 if ( v465 == 1 ) | |
6477 { | |
486 | 6478 amount = 0; |
0 | 6479 goto LABEL_912; |
6480 } | |
6481 LABEL_910: | |
6482 v466 = 3600 * v2; | |
6483 } | |
6484 else | |
6485 { | |
6486 v466 = 86400 * v2; | |
6487 } | |
6488 amount = v466; | |
6489 LABEL_912: | |
6490 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6491 goto play_sound_and_continue; |
6492 | |
6493 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6494 v470 = v3->uPlayerID_2; |
6495 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6496 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6497 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6498 goto LABEL_1056; | |
6499 if ( v731 == 4 ) | |
6500 { | |
486 | 6501 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; |
6502 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; | |
0 | 6503 v471 = v3->uPlayerID_2; |
486 | 6504 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; |
6505 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; | |
0 | 6506 v472 = v3->uPlayerID_2; |
486 | 6507 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; |
6508 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; | |
0 | 6509 goto LABEL_1056; |
6510 } | |
6511 v732 = amount << 7; | |
6512 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6513 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6514 6u, | |
6515 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6516 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6517 8u, | |
6518 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6519 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6520 v656 = 10; | |
6521 goto LABEL_937; | |
488 | 6522 |
6523 | |
0 | 6524 case 75: |
6525 amount = v2; | |
6526 LODWORD(v733) = 3600 * v2; | |
6527 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6528 goto play_sound_and_continue; |
6529 | |
6530 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6531 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6532 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6533 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6534 | |
0 | 6535 v732 = (int)v733 << 7; |
488 | 6536 |
6537 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | |
6538 goto LABEL_1056; | |
6539 | |
0 | 6540 case 73: |
6541 LODWORD(v733) = 3600 * v2; | |
6542 amount = v2; | |
6543 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6544 goto play_sound_and_continue; |
0 | 6545 if ( v731 == 4 ) |
6546 { | |
488 | 6547 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6548 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6549 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6550 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 6551 v732 = (int)v733 << 7; |
6552 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
488 | 6553 pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6554 pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6555 pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6556 | |
6557 pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, v2, v2, 0); | |
6558 goto LABEL_1056; | |
6559 //goto LABEL_104; | |
6560 } | |
6561 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
6562 | |
0 | 6563 v732 = (int)v733 << 7; |
488 | 6564 |
6565 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); | |
6566 goto LABEL_1056; | |
0 | 6567 case 74: |
6568 v493 = v12 - 2; | |
6569 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
486 | 6570 amount = 0; |
0 | 6571 else |
6572 amount = 86400 * v2; | |
6573 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6574 goto play_sound_and_continue; |
6575 | |
6576 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6577 v498 = v3->uPlayerID_2; |
6578 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6579 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6580 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6581 goto LABEL_1056; | |
6582 if ( v731 == 4 ) | |
6583 { | |
486 | 6584 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; |
6585 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; | |
0 | 6586 v499 = v3->uPlayerID_2; |
486 | 6587 LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0; |
6588 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0; | |
0 | 6589 v500 = v3->uPlayerID_2; |
486 | 6590 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; |
6591 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; | |
0 | 6592 } |
6593 else | |
6594 { | |
6595 v732 = amount << 7; | |
6596 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6597 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6598 7u, | |
6599 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6600 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6601 9u, | |
6602 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6603 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6604 v656 = 11; | |
6605 LABEL_937: | |
112 | 6606 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6607 LABEL_641: |
6608 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6609 } | |
6610 goto LABEL_1056; | |
6611 case 77: | |
486 | 6612 { |
0 | 6613 amount = 5 * v2 + 10; |
6614 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6615 goto play_sound_and_continue; |
0 | 6616 v501 = pParty->pPlayers; |
486 | 6617 int v1 = 0; |
0 | 6618 do |
6619 { | |
488 | 6620 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v1); |
0 | 6621 v501->Heal(amount); |
6622 ++v501; | |
6623 ++v1; | |
6624 } | |
6625 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6626 goto LABEL_1056; | |
486 | 6627 } |
0 | 6628 case 80: |
6629 sRecoveryTime -= v2; | |
6630 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6631 goto play_sound_and_continue; |
6632 | |
0 | 6633 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); |
6634 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6635 ++a1.uType; |
0 | 6636 HIDWORD(v733) = v505; |
486 | 6637 v690 = 0; |
6638 v689 = 0; | |
6639 v688 = 0; | |
0 | 6640 a1.stru_24.Reset(); |
6641 a1.field_48 = v3->spellnum; | |
6642 a1.field_4C = v2; | |
6643 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6644 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 6645 a1.uAttributes = 0; |
6646 a1.uSectorID = 0; | |
6647 a1.uSpriteFrameID = 0; | |
0 | 6648 v506 = v3->uPlayerID; |
6649 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6650 a1.uFacing = 0; |
0 | 6651 v506 *= 8; |
303 | 6652 LOBYTE(v506) = v506 | OBJECT_Player; |
6653 a1.field_58_pid = v506; | |
0 | 6654 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6655 a2 = 0; |
6656 if ( SHIDWORD(v733) > 0 ) | |
0 | 6657 { |
6658 do | |
6659 { | |
6660 v507 = dword_50BF30[a2]; | |
6661 a1.vPosition.x = pActors[v507].vPosition.x; | |
6662 a1.vPosition.y = pActors[v507].vPosition.y; | |
6663 v732 = pActors[v507].uActorHeight; | |
6664 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6665 v508 = 8 * dword_50BF30[a2]; | |
486 | 6666 LOBYTE(v508) = v508 | OBJECT_Actor; |
0 | 6667 a1.field_5C = v508; |
486 | 6668 v509 = a1.Create(0, 0, 0, 0); |
0 | 6669 v510 = a2; |
486 | 6670 DamageMonsterFromParty(8 * v509 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v688); |
0 | 6671 a2 = v510 + 1; |
6672 } | |
6673 while ( v510 + 1 < SHIDWORD(v733) ); | |
6674 } | |
486 | 6675 for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 ) |
0 | 6676 { |
6677 v511 = &pActors[dword_50BF30[a2]]; | |
6678 a1.vPosition.x = v511->vPosition.x; | |
6679 a1.vPosition.y = v511->vPosition.y; | |
6680 v732 = v511->uActorHeight; | |
6681 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6682 v512 = 8 * dword_50BF30[a2]; | |
486 | 6683 LOBYTE(v512) = v512 | OBJECT_Actor; |
0 | 6684 a1.field_5C = v512; |
486 | 6685 a1.Create(0, 0, 0, 0); |
0 | 6686 v513 = v511->pActorBuffs; |
6687 v726 = (Player *)22; | |
6688 do | |
6689 { | |
6690 v513->Reset(); | |
6691 ++v513; | |
6692 v726 = (Player *)((char *)v726 - 1); | |
6693 } | |
6694 while ( *(float *)&v726 != 0.0 ); | |
6695 } | |
6696 goto LABEL_1056; | |
6697 case 82: | |
6698 v514 = v12 - 2; | |
6699 if ( !v514 ) | |
6700 goto LABEL_955; | |
6701 v515 = v514 - 1; | |
6702 if ( v515 ) | |
6703 { | |
6704 if ( v515 == 1 ) | |
6705 { | |
6706 v516 = 900 * v2; | |
6707 amount = 5; | |
6708 } | |
6709 else | |
6710 { | |
6711 LABEL_955: | |
6712 v516 = 300 * v2; | |
6713 amount = 1; | |
6714 } | |
6715 } | |
6716 else | |
6717 { | |
6718 v516 = 900 * v2; | |
6719 amount = 3; | |
6720 } | |
486 | 6721 v733 = __PAIR__(0, v516); |
0 | 6722 v517 = 8 * v3->uPlayerID; |
6723 LOBYTE(v517) = v517 | 4; | |
486 | 6724 if ( (signed int)uNumActors > 0 ) |
0 | 6725 { |
90 | 6726 v518 = pActors;//[0].uAIState; |
6727 v726b = uNumActors; | |
0 | 6728 do |
6729 { | |
90 | 6730 v519 = v518->uAIState; |
6731 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6732 ++HIDWORD(v733); |
90 | 6733 ++v518; |
6734 --v726; | |
0 | 6735 } |
90 | 6736 while ( v726 != 0 ); |
0 | 6737 } |
6738 if ( SHIDWORD(v733) >= amount ) | |
6739 { | |
6740 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6741 goto LABEL_201; | |
6742 } | |
6743 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6744 goto play_sound_and_continue; |
0 | 6745 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); |
6746 goto LABEL_1056; | |
6747 case 83: | |
6748 v520 = v12 - 2; | |
6749 if ( !v520 ) | |
6750 goto LABEL_973; | |
6751 v521 = v520 - 1; | |
6752 if ( v521 ) | |
6753 { | |
6754 if ( v521 == 1 ) | |
6755 { | |
6756 LODWORD(v733) = 18000 * v2; | |
6757 v522 = 5 * v2 + 10; | |
6758 } | |
6759 else | |
6760 { | |
6761 LABEL_973: | |
6762 LODWORD(v733) = 10800 * v2; | |
6763 v522 = 3 * v2 + 10; | |
6764 } | |
6765 } | |
6766 else | |
6767 { | |
6768 LODWORD(v733) = 14400 * v2; | |
6769 v522 = 4 * v2 + 10; | |
6770 } | |
6771 amount = v522; | |
6772 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6773 goto play_sound_and_continue; |
6774 | |
6775 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6776 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6777 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6778 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 6779 v83 = 1; |
488 | 6780 |
0 | 6781 v732 = (int)v733 << 7; |
488 | 6782 |
6783 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); | |
6784 LODWORD(v727) = v83; | |
6785 | |
6786 goto play_sound_and_continue; | |
6787 | |
0 | 6788 case 84: |
6789 v67 = 2; | |
6790 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6791 { | |
6792 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6793 goto LABEL_202; | |
6794 } | |
6795 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6796 goto play_sound_and_continue; |
0 | 6797 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6798 ++a1.uType; |
0 | 6799 v726 = (Player *)v531; |
486 | 6800 v696 = 0; |
6801 v695 = 0; | |
6802 v694 = 0; | |
0 | 6803 a1.stru_24.Reset(); |
6804 a1.field_48 = v3->spellnum; | |
6805 a1.field_4C = v2; | |
6806 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6807 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 6808 a1.uAttributes = 0; |
6809 a1.uSectorID = 0; | |
6810 a1.uSpriteFrameID = 0; | |
0 | 6811 v532 = v3->uPlayerID; |
6812 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6813 a1.uFacing = 0; |
0 | 6814 v532 *= 8; |
303 | 6815 LOBYTE(v532) = v532 | OBJECT_Player; |
6816 a1.field_58_pid = v532; | |
0 | 6817 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6818 a2 = 0; |
6819 if ( (signed int)v726 > 0 ) | |
0 | 6820 { |
6821 do | |
6822 { | |
6823 v533 = dword_50BF30[a2]; | |
6824 a1.vPosition.x = pActors[v533].vPosition.x; | |
6825 a1.vPosition.y = pActors[v533].vPosition.y; | |
6826 v732 = pActors[v533].uActorHeight; | |
6827 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6828 v534 = 8 * dword_50BF30[a2]; | |
486 | 6829 LOBYTE(v534) = v534 | OBJECT_Actor; |
0 | 6830 a1.field_5C = v534; |
486 | 6831 v535 = a1.Create(0, 0, 0, 0); |
0 | 6832 v536 = a2; |
486 | 6833 DamageMonsterFromParty(8 * v535 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v694); |
0 | 6834 a2 = v536 + 1; |
6835 } | |
6836 while ( v536 + 1 < (signed int)v726 ); | |
6837 } | |
6838 v537 = pGame->GetStru6(); | |
6839 pGame->GetStru6()->_4A8BFC(); | |
6840 goto LABEL_1056; | |
488 | 6841 |
6842 case SPELL_LIGHT_DAY_OF_PROTECTION: | |
0 | 6843 v538 = v12 - 2; |
6844 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
6845 { | |
6846 amount = 5 * v2; | |
6847 v540 = 18000 * v2; | |
6848 } | |
6849 else | |
6850 { | |
6851 amount = 4 * v2; | |
6852 v540 = 14400 * v2; | |
6853 } | |
6854 v730 = v540; | |
6855 LODWORD(v733) = v540; | |
6856 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6857 goto play_sound_and_continue; |
6858 | |
6859 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6860 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6861 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6862 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6863 | |
0 | 6864 v732 = v730 << 7; |
6865 v549 = (double)(v730 << 7) * 0.033333335; | |
6866 *((float *)&v733 + 1) = v549; | |
6867 v712 = (signed __int64)v549; | |
488 | 6868 pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, 0, 0); |
6869 pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6870 pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6871 pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6872 pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6873 pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
0 | 6874 v550 = v2 + 5; |
488 | 6875 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply( |
0 | 6876 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
6877 v731, | |
486 | 6878 v550, 0, 0); |
488 | 6879 |
6880 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0); | |
6881 goto LABEL_1056; | |
0 | 6882 case 86: |
6883 v551 = v12 - 2; | |
6884 if ( !v551 ) | |
6885 goto LABEL_998; | |
6886 v552 = v551 - 1; | |
6887 if ( v552 ) | |
6888 { | |
6889 if ( v552 == 1 ) | |
6890 { | |
6891 amount = 15; | |
6892 HIDWORD(v733) = 20; | |
6893 goto LABEL_1000; | |
6894 } | |
6895 LABEL_998: | |
6896 v678 = 4; | |
6897 } | |
6898 else | |
6899 { | |
6900 v678 = 12; | |
6901 } | |
6902 amount = v678; | |
6903 HIDWORD(v733) = v678; | |
6904 LABEL_1000: | |
6905 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6906 goto play_sound_and_continue; |
0 | 6907 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); |
6908 v732 = (300 * amount * v2 + 60) << 7; | |
6909 v730 = v2 + 5; | |
486 | 6910 v726 = 0; |
89 | 6911 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 6912 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
6913 do | |
6914 { | |
488 | 6915 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6916 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6917 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6918 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6919 | |
89 | 6920 //((SpellBuff *)(v553 + 6056))->Apply( |
488 | 6921 v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
0 | 6922 if ( *(_QWORD *)v553 ) |
6923 v726 = (Player *)1; | |
89 | 6924 ++v553; |
6925 } | |
6926 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 6927 v562 = v731; |
488 | 6928 pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
6929 pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, 0, 0, 0); | |
6930 pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, v730, 0, 0); | |
486 | 6931 if (v726) |
0 | 6932 goto LABEL_1056; |
6933 v732 = (int)y << 7; | |
488 | 6934 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); |
6935 goto LABEL_1056; | |
0 | 6936 case 88: |
6937 amount = 3; | |
6938 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
6939 goto LABEL_200; | |
6940 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6941 goto play_sound_and_continue; |
486 | 6942 a2 = 0; |
0 | 6943 _this = (ItemGen *)&pPlayers[1]; |
6944 do | |
6945 { | |
6946 v563 = 0; | |
6947 do | |
6948 { | |
6949 v564 = _this->uItemID; | |
486 | 6950 *(int *)(v563 + _this->uItemID) = 0; |
0 | 6951 v563 += 8; |
486 | 6952 *(int *)(v563 + v564 - 4) = 0; |
0 | 6953 } |
6954 while ( v563 <= 128 ); | |
6955 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
6956 v566 = (Player **)_this; | |
6957 *(int *)(_this->uItemID + 6460) = v565; | |
6958 v567 = (*v566)->GetMaxMana(); | |
6959 *(int *)(_this->uItemID + 6464) = v567; | |
488 | 6960 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
0 | 6961 ++a2; |
6962 _this = (ItemGen *)((char *)_this + 4); | |
6963 } | |
6964 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
6965 v571 = pPlayer; | |
6966 v572 = (char *)&pPlayer->sAgeModifier; | |
6967 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
6968 *(short *)v572 = 120; | |
6969 else | |
6970 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
6971 sRecoveryTime += -5 * v2; | |
6972 ++v571->uNumDivineInterventionCastsThisDay; | |
6973 goto LABEL_1056; | |
6974 case 89: | |
6975 v573 = v12 - 2; | |
6976 if ( v573 ) | |
6977 { | |
6978 v574 = v573 - 1; | |
6979 if ( v574 ) | |
6980 { | |
6981 if ( v574 == 1 ) | |
6982 v575 = 5 * v2; | |
6983 else | |
6984 v575 = 2 * v2; | |
6985 } | |
6986 else | |
6987 { | |
6988 v575 = 4 * v2; | |
6989 } | |
6990 } | |
6991 else | |
6992 { | |
6993 v575 = 3 * v2; | |
6994 } | |
6995 amount = v575; | |
6996 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6997 goto play_sound_and_continue; |
6998 v576 = v3->spell_target_pid; | |
486 | 6999 if (!v576) |
0 | 7000 { |
7001 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
488 | 7002 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
0 | 7003 if ( *((_QWORD *)v585 + 14) ) |
7004 { | |
7005 ((Player *)v585)->SetCondition(0x11u, 1); | |
7006 v587 = ((Player *)v585)->GetSexByVoice(); | |
7007 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7008 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7009 } | |
488 | 7010 goto play_sound_and_continue; |
0 | 7011 } |
7012 v577 = (Player *)(v576 >> 3); | |
7013 v726 = v577; | |
7014 if ( v577 == (Player *)-1 ) | |
7015 { | |
7016 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7017 goto LABEL_201; | |
7018 } | |
7019 v578 = (int)&pActors[(int)v577]; | |
7020 v721 = v578; | |
486 | 7021 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) |
0 | 7022 goto LABEL_200; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7023 ++a1.uType; |
0 | 7024 a1.stru_24.Reset(); |
7025 a1.field_48 = v3->spellnum; | |
7026 a1.field_4C = v2; | |
7027 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7028 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 7029 a1.uAttributes = 0; |
7030 a1.uSectorID = 0; | |
7031 a1.uSpriteFrameID = 0; | |
0 | 7032 v580 = v3->uPlayerID; |
7033 a1.field_60_distance_related_prolly_lod = 0; | |
7034 v581 = v721; | |
7035 v580 *= 8; | |
303 | 7036 LOBYTE(v580) = v580 | OBJECT_Player; |
486 | 7037 a1.uFacing = 0; |
303 | 7038 a1.field_58_pid = v580; |
0 | 7039 a1.uSoundID = LOWORD(v3->field_10); |
7040 a1.vPosition.x = *(short *)(v721 + 142); | |
7041 a1.vPosition.y = *(short *)(v721 + 144); | |
7042 v732 = *(short *)(v721 + 138); | |
7043 v582 = 8 * (int)v726; | |
7044 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
486 | 7045 LOBYTE(v582) = 8 * (char)v726 | OBJECT_Actor; |
0 | 7046 a1.field_5C = v582; |
486 | 7047 a1.Create(0, 0, 0, 0); |
0 | 7048 if ( *(char *)(v581 + 52) > amount ) |
488 | 7049 goto play_sound_and_continue; |
0 | 7050 Actor::Resurrect((unsigned int)v726); |
7051 *(char *)(v581 + 61) = 0; | |
7052 *(char *)(v581 + 53) = 0; | |
7053 *(char *)(v581 + 54) = 0; | |
7054 *(char *)(v581 + 55) = 0; | |
7055 *(char *)(v581 + 56) = 0; | |
7056 *(char *)(v581 + 57) = 0; | |
7057 *(int *)(v581 + 712) = 9999; | |
7058 *(char *)(v581 + 38) &= 0xF7u; | |
486 | 7059 *(int *)(v581 + 708) = 0; |
0 | 7060 ((SpellBuff *)(v581 + 356))->Reset(); |
7061 ((SpellBuff *)(v581 + 228))->Reset(); | |
7062 ((SpellBuff *)(v581 + 404))->Reset(); | |
7063 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7064 *(short *)(v581 + 40) = 10 * amount; | |
7065 goto LABEL_1056; | |
7066 case 91: | |
7067 v588 = v12 - 1; | |
7068 amount = 16; | |
7069 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7070 { | |
7071 if ( v590 == 1 ) | |
486 | 7072 LODWORD(v733) = 0; |
0 | 7073 } |
7074 else | |
7075 { | |
7076 LODWORD(v733) = 3600 * v2; | |
7077 } | |
7078 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7079 goto play_sound_and_continue; |
0 | 7080 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; |
7081 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7082 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7083 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7084 || *(char *)(HIDWORD(v733) + 20) & 2 | |
486 | 7085 || *(int *)(HIDWORD(v733) + 12) != 0 |
7086 || *(int *)(HIDWORD(v733) + 4) != 0 | |
0 | 7087 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 |
377 | 7088 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) |
0 | 7089 goto LABEL_199; |
7090 v592 = HIDWORD(v733); | |
7091 v14 = v731 == 4; | |
7092 *(int *)(HIDWORD(v733) + 12) = 16; | |
7093 if ( !v14 ) | |
7094 { | |
7095 v732 = (int)v733 << 7; | |
7096 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7097 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7098 *(int *)(v592 + 20) |= 8u; | |
7099 } | |
7100 *(char *)(v592 + 20) |= 0x80u; | |
7101 goto LABEL_1055; | |
7102 case 93: | |
7103 v593 = v12 - 2; | |
7104 if ( !v593 ) | |
7105 goto LABEL_1062; | |
7106 v594 = v593 - 1; | |
7107 if ( v594 ) | |
7108 { | |
7109 if ( v594 == 1 ) | |
7110 amount = 9; | |
7111 else | |
7112 LABEL_1062: | |
7113 amount = 5; | |
7114 } | |
7115 else | |
7116 { | |
7117 amount = 7; | |
7118 } | |
7119 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7120 goto play_sound_and_continue; |
0 | 7121 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); |
7122 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7123 a1.stru_24.Reset(); | |
7124 a1.field_48 = v3->spellnum; | |
7125 a1.field_4C = v2; | |
7126 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7127 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 7128 a1.vPosition.x = pParty->vPosition.x; |
7129 a1.vPosition.y = pParty->vPosition.y; | |
486 | 7130 a1.uAttributes = 0; |
0 | 7131 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
7132 a1.uSectorID = pIndoor->GetSector( | |
7133 pParty->vPosition.x, | |
7134 pParty->vPosition.y, | |
7135 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
486 | 7136 a1.uSpriteFrameID = 0; |
0 | 7137 v595 = 8 * v3->uPlayerID; |
303 | 7138 LOBYTE(v595) = v595 | OBJECT_Player; |
7139 a1.field_58_pid = v595; | |
0 | 7140 a1.field_5C = a2; |
7141 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7142 a1.uSoundID = LOWORD(v3->field_10); | |
7143 if ( pParty->bTurnBasedModeOn == 1 ) | |
7144 LOBYTE(a1.uAttributes) |= 4u; | |
7145 v596 = (signed int)v726 / -2; | |
7146 y = (char *)((signed int)v726 / 2); | |
7147 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7148 { | |
7149 v597 = v715.uYawAngle; | |
7150 do | |
7151 { | |
7152 a1.uFacing = v596 + v597; | |
7153 if ( a1.Create( | |
7154 v596 + v597, | |
7155 v715.uPitchAngle, | |
7156 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7157 v3->uPlayerID + 1) != -1 | |
7158 && pParty->bTurnBasedModeOn == 1 ) | |
7159 ++pTurnEngine->field_1C; | |
7160 v596 += v732; | |
7161 } | |
7162 while ( v596 <= (signed int)y ); | |
7163 } | |
7164 goto LABEL_1056; | |
7165 case 94: | |
7166 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7167 goto play_sound_and_continue; |
0 | 7168 if ( v731 == 1 || v731 == 2 ) |
7169 { | |
7170 v598 = 180 * v2; | |
7171 goto LABEL_1081; | |
7172 } | |
7173 if ( v731 == 3 ) | |
7174 { | |
7175 v598 = 300 * v2; | |
7176 LABEL_1081: | |
7177 LODWORD(v733) = v598; | |
7178 goto LABEL_1082; | |
7179 } | |
7180 if ( v731 == 4 ) | |
7181 LODWORD(v733) = 29030400; | |
7182 LABEL_1082: | |
7183 v599 = a2 >> 3; | |
141 | 7184 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7185 goto LABEL_1056; |
7186 v730 = 836 * v599; | |
7187 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
488 | 7188 goto play_sound_and_continue; |
90 | 7189 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7190 goto LABEL_200; |
90 | 7191 pActors[v599].pActorBuffs[9].Reset(); |
7192 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7193 v732 = (int)v733 << 7; |
90 | 7194 pActors[v599].pActorBuffs[12].Apply( |
0 | 7195 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 7196 v731, 0, 0, 0); |
0 | 7197 a1.stru_24.Reset(); |
7198 a1.field_48 = v3->spellnum; | |
7199 a1.field_4C = v2; | |
7200 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7201 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 7202 v61 = v599; |
0 | 7203 LABEL_1086: |
90 | 7204 v600 = pActors[v61].vPosition.y; |
7205 v601 = pActors[v61].vPosition.x; | |
0 | 7206 a1.uObjectDescID = v60; |
7207 a1.vPosition.x = v601; | |
90 | 7208 v602 = pActors[v61].uActorHeight; |
7209 v603 = pActors[v61].vPosition.z; | |
0 | 7210 a1.vPosition.y = v600; |
7211 v676 = v603 + v602; | |
7212 v665 = v600; | |
7213 a1.vPosition.z = v603 + v602; | |
7214 v657 = v601; | |
7215 LABEL_1087: | |
486 | 7216 a1.uAttributes = 0; |
0 | 7217 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); |
486 | 7218 a1.uSpriteFrameID = 0; |
0 | 7219 v604 = 8 * v3->uPlayerID; |
303 | 7220 LOBYTE(v604) = v604 | OBJECT_Player; |
7221 a1.field_58_pid = v604; | |
0 | 7222 a1.field_5C = a2; |
7223 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7224 a1.uFacing = LOWORD(v715.uYawAngle); | |
7225 LOWORD(v604) = LOWORD(v3->field_10); | |
7226 LOBYTE(a1.uAttributes) |= 0x80u; | |
7227 a1.uSoundID = v604; | |
486 | 7228 a1.Create(0, 0, 0, v3->uPlayerID + 1); |
0 | 7229 goto LABEL_1056; |
7230 case 96: | |
7231 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7232 goto play_sound_and_continue; |
486 | 7233 HIDWORD(v733) = 0; |
521 | 7234 memset(&achievedAwardsIndex, 0, 4000); |
486 | 7235 _this = 0; |
0 | 7236 v605 = (char *)pParty->pHirelings; |
7237 do | |
7238 { | |
486 | 7239 if ( *(int *)v605) |
0 | 7240 { |
7241 v606 = HIDWORD(v733)++; | |
521 | 7242 achievedAwardsIndex[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7243 } |
7244 _this = (ItemGen *)((char *)_this + 1); | |
7245 v605 += 76; | |
7246 } | |
7247 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
486 | 7248 _this = 0; |
7249 if ( (signed int)pNPCStats->uNumNewNPCs > 0) | |
0 | 7250 { |
7251 v730 = (int)pNPCStats->pNewNPCData; | |
7252 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7253 do | |
7254 { | |
7255 if ( *(char *)(v730 + 8) & 0x80 | |
486 | 7256 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) |
7257 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
0 | 7258 { |
7259 v607 = HIDWORD(v733); | |
7260 HIDWORD(v733) += 4; | |
7261 *(int *)v607 = (int)_this + 3; | |
7262 } | |
7263 _this = (ItemGen *)((char *)_this + 1); | |
7264 v730 += 76; | |
7265 } | |
7266 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7267 } | |
7268 v608 = v3->uPlayerID_2; | |
7269 if ( v608 != 4 && v608 != 5 | |
486 | 7270 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) |
0 | 7271 || v609 >= 3 ) |
7272 goto LABEL_200; | |
7273 v610 = 76 * v609; | |
486 | 7274 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; |
0 | 7275 v611 = pIconsFrameTable->FindIcon("spell96"); |
488 | 7276 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611); |
0 | 7277 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; |
89 | 7278 v612 = pParty->pPlayers; |
0 | 7279 do |
7280 { | |
89 | 7281 v612->sHealth = v612->GetMaxHealth(); |
7282 v612->sMana = v612->GetMaxMana(); | |
7283 ++v612; | |
7284 } | |
7285 while ( v612 <= &pParty->pPlayers[3] ); | |
7286 v613 = &pOutdoor->ddm; | |
0 | 7287 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7288 v613 = &pIndoor->dlv; |
7289 v613->uReputation += 15; | |
7290 if ( v613->uReputation > 10000 ) | |
7291 v613->uReputation = 10000; | |
488 | 7292 LODWORD(v727) = 1; |
7293 goto play_sound_and_continue; | |
0 | 7294 case 95: |
486 | 7295 if ( v12 <= 0 ) |
0 | 7296 goto LABEL_1119; |
7297 if ( v12 <= 3 ) | |
7298 { | |
7299 v614 = 300 * (v2 + 12); | |
7300 } | |
7301 else | |
7302 { | |
7303 if ( v12 != 4 ) | |
7304 goto LABEL_1119; | |
7305 v614 = 900 * (v2 + 4); | |
7306 } | |
7307 LODWORD(v733) = v614; | |
7308 LABEL_1119: | |
7309 v615 = v2 + 5; | |
7310 amount = v615; | |
7311 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7312 goto play_sound_and_continue; |
0 | 7313 if ( v731 != 3 && v731 != 4 ) |
7314 { | |
488 | 7315 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
7316 | |
0 | 7317 v732 = (int)v733 << 7; |
488 | 7318 |
7319 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); | |
7320 goto LABEL_1056; | |
0 | 7321 } |
486 | 7322 a2 = 0; |
0 | 7323 v732 = (int)v733 << 7; |
7324 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7325 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7326 do |
7327 { | |
488 | 7328 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
7329 v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | |
0 | 7330 ++a2; |
112 | 7331 ++v619; |
7332 } | |
7333 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7334 goto LABEL_1056; |
7335 case 99: | |
7336 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7337 goto play_sound_and_continue; |
486 | 7338 v726 = 0; |
0 | 7339 pGame->GetIndoorCamera(); |
7340 v623 = (signed __int64)GetPickDepth(); | |
7341 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
486 | 7342 v709 = 0; |
7343 v708 = 0; | |
7344 v707 = 0; | |
0 | 7345 a1.stru_24.Reset(); |
7346 a1.field_48 = v3->spellnum; | |
7347 a1.field_4C = v2; | |
7348 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7349 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 7350 a1.uAttributes = 0; |
7351 a1.uSectorID = 0; | |
7352 a1.uSpriteFrameID = 0; | |
0 | 7353 v624 = v3->uPlayerID; |
7354 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 7355 a1.uFacing = 0; |
0 | 7356 v624 *= 8; |
303 | 7357 LOBYTE(v624) = v624 | OBJECT_Player; |
7358 a1.field_58_pid = v624; | |
0 | 7359 a1.uSoundID = LOWORD(v3->field_10); |
486 | 7360 a2 = 0; |
7361 if ( SHIDWORD(v733) > 0 ) | |
0 | 7362 { |
7363 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7364 do | |
7365 { | |
7366 v625 = dword_50BF30[a2]; | |
7367 a1.vPosition.x = pActors[v625].vPosition.x; | |
7368 a1.vPosition.y = pActors[v625].vPosition.y; | |
7369 v732 = pActors[v625].uActorHeight; | |
7370 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7371 v626 = 8 * dword_50BF30[a2]; | |
486 | 7372 LOBYTE(v626) = v626 | OBJECT_Actor; |
0 | 7373 a1.field_5C = v626; |
486 | 7374 v627 = a1.Create(0, 0, 0, 0); |
0 | 7375 v628 = a2; |
7376 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7377 a2 = v628 + 1; | |
7378 } | |
7379 while ( v628 + 1 < SHIDWORD(v733) ); | |
7380 } | |
486 | 7381 v730 = 0; |
0 | 7382 v629 = 1; |
7383 do | |
7384 { | |
7385 v630 = pPlayers[v629]; | |
7386 if ( !v630->pConditions[2] | |
7387 && !v630->pConditions[12] | |
7388 && !v630->pConditions[13] | |
7389 && !v630->pConditions[14] | |
7390 && !v630->pConditions[15] | |
7391 && !v630->pConditions[16] ) | |
7392 { | |
7393 v631 = v730++; | |
7394 v681[v631] = v629; | |
7395 } | |
7396 ++v629; | |
7397 } | |
7398 while ( v629 <= 4 ); | |
7399 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
486 | 7400 HIDWORD(v733) = 0; |
7401 if ( v730 > 0 ) | |
0 | 7402 { |
7403 do | |
7404 { | |
7405 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7406 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7407 v633->sHealth += v732; | |
7408 v726 = *(Player **)v632; | |
7409 v634 = v726->GetMaxHealth(); | |
7410 if ( v726->sHealth > v634 ) | |
7411 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7412 v635 = HIDWORD(v733); | |
488 | 7413 |
7414 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, WORD2(v733)); | |
0 | 7415 HIDWORD(v733) = v635 + 1; |
7416 } | |
7417 while ( v635 + 1 < v730 ); | |
7418 } | |
486 | 7419 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); |
0 | 7420 goto LABEL_1056; |
7421 case 98: | |
7422 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7423 { | |
7424 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7425 goto LABEL_201; | |
7426 } | |
7427 v640 = v12 - 2; | |
7428 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7429 amount = 3; | |
486 | 7430 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) |
0 | 7431 goto LABEL_200; |
7432 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7433 goto play_sound_and_continue; |
349 | 7434 pParty->armageddon_timer = 256; |
0 | 7435 pParty->field_16140 = v2; |
7436 ++pPlayer->uNumArmageddonCasts; | |
7437 if ( pParty->bTurnBasedModeOn == 1 ) | |
7438 ++pTurnEngine->field_1C; | |
7439 v726 = (Player *)50; | |
7440 do | |
7441 { | |
7442 v642 = rand() % 4096 - 2048; | |
7443 v643 = rand(); | |
7444 v721 = v642 + pParty->vPosition.x; | |
7445 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
486 | 7446 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0); |
0 | 7447 v644 = rand(); |
486 | 7448 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0); |
0 | 7449 v726 = (Player *)((char *)v726 - 1); |
7450 } | |
7451 while ( *(float *)&v726 != 0.0 ); | |
7452 goto LABEL_1056; | |
7453 default: | |
488 | 7454 goto play_sound_and_continue; |
0 | 7455 } |
7456 while ( 2 ) | |
7457 { | |
7458 if ( v731 == 4 ) | |
7459 { | |
7460 if ( *((_QWORD *)v222 + 2) ) | |
7461 { | |
486 | 7462 *((int *)v222 + 4) = 0; |
7463 *((int *)v222 + 5) = 0; | |
0 | 7464 goto LABEL_439; |
7465 } | |
7466 } | |
7467 else | |
7468 { | |
7469 v732 = amount << 7; | |
7470 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7471 2u, | |
7472 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7473 v222 = (char *)HIDWORD(v733); | |
7474 if ( v223 ) | |
7475 LABEL_439: | |
486 | 7476 ((Player *)v222)->PlaySound(SPEECH_103, 0); |
0 | 7477 } |
7478 v222 += 6972; | |
7479 HIDWORD(v733) = (int)v222; | |
7480 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7481 goto LABEL_1056; | |
7482 continue; | |
7483 } | |
7484 } | |
7485 //----- (0042EB42) -------------------------------------------------------- | |
7486 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7487 { | |
7488 unsigned int v2; // edx@1 | |
7489 signed int v3; // eax@1 | |
7490 char *v4; // ecx@2 | |
7491 | |
7492 v2 = this->uNumObjects; | |
7493 v3 = 0; | |
7494 if ( (signed int)this->uNumObjects <= 0 ) | |
7495 { | |
7496 LABEL_5: | |
7497 LOWORD(v3) = 0; | |
7498 } | |
7499 else | |
7500 { | |
7501 v4 = (char *)&this->pObjects->uObjectID; | |
7502 while ( uItemID != *(short *)v4 ) | |
7503 { | |
7504 ++v3; | |
7505 v4 += 56; | |
7506 if ( v3 >= (signed int)v2 ) | |
7507 goto LABEL_5; | |
7508 } | |
7509 } | |
7510 return v3; | |
7511 } | |
7512 | |
7513 | |
7514 | |
7515 //----- (0042EB78) -------------------------------------------------------- | |
7516 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7517 { | |
7518 return 8 * this->pIcons[uIconID].uAnimLength; | |
7519 } | |
7520 | |
437 | 7521 |
7522 const wchar_t *UIMessage2String(UIMessageType msg) | |
7523 { | |
7524 #define CASE(xxx) case xxx: _swprintf(b, L"%03X/%s", msg, L#xxx); return b; | |
7525 static wchar_t b[256]; // bad for threads | |
7526 switch (msg) | |
7527 { | |
7528 CASE(UIMSG_SelectSpell) | |
7529 CASE(UIMSG_ChangeGameState) | |
7530 CASE(UIMSG_Attack) | |
7531 CASE(UIMSG_PlayArcomage) | |
7532 CASE(UIMSG_MainMenu_ShowPartyCreationWnd) | |
7533 CASE(UIMSG_MainMenu_ShowLoadWindow) | |
7534 CASE(UIMSG_ShowCredits) | |
7535 CASE(UIMSG_ExitToWindows) | |
7536 CASE(UIMSG_PlayerCreationChangeName) | |
7537 CASE(UIMSG_PlayerCreationClickPlus) | |
7538 CASE(UIMSG_PlayerCreationClickMinus) | |
7539 CASE(UIMSG_PlayerCreationSelectActiveSkill) | |
7540 CASE(UIMSG_PlayerCreationSelectClass) | |
7541 CASE(UIMSG_PlayerCreationClickOK) | |
7542 CASE(UIMSG_PlayerCreationClickReset) | |
7543 CASE(UIMSG_AutonotesBook) | |
7544 CASE(UIMSG_PlayerCreationRemoveUpSkill) | |
7545 CASE(UIMSG_PlayerCreationRemoveDownSkill) | |
7546 CASE(UIMSG_SPellbook_ShowHightlightedSpellInfo) | |
7547 CASE(UIMSG_LoadGame) | |
7548 CASE(UIMSG_SaveGame) | |
7549 CASE(UIMSG_ShowStatus_DateTime) | |
7550 CASE(UIMSG_ShowStatus_ManaHP) | |
7551 CASE(UIMSG_ShowStatus_Player) | |
7552 CASE(UIMSG_Wait5Minutes) | |
7553 CASE(UIMSG_Wait1Hour) | |
7554 CASE(UIMSG_ShowStatus_Food) | |
7555 CASE(UIMSG_ShowStatus_Funds) | |
7556 CASE(UIMSG_QuickReference) | |
7557 CASE(UIMSG_GameMenuButton) | |
7558 CASE(UIMSG_AlreadyResting) | |
7559 CASE(UIMSG_SelectCharacter) | |
7560 CASE(UIMSG_ChangeSoundVolume) | |
7561 CASE(UIMSG_ChangeMusicVolume) | |
7562 CASE(UIMSG_Escape) | |
7563 CASE(UIMSG_PlayerCreation_SelectAttribute) | |
7564 CASE(UIMSG_InventoryLeftClick) | |
7565 CASE(UIMSG_SkillUp) | |
7566 CASE(UIMSG_GameMenu_ReturnToGame) | |
7567 CASE(UIMSG_StartNewGame) | |
7568 CASE(UIMSG_Game_OpenLoadGameDialog) | |
7569 CASE(UIMSG_Game_OpenSaveGameDialog) | |
7570 CASE(UIMSG_Game_OpenOptionsDialog) | |
7571 CASE(UIMSG_SetGraphicsMode) | |
7572 CASE(UIMSG_Quit) | |
7573 CASE(UIMSG_StartHireling1Dialogue) | |
7574 CASE(UIMSG_StartHireling2Dialogue) | |
7575 CASE(UIMSG_SelectDialogueOption) | |
7576 CASE(UIMSG_CastSpellFromBook) | |
7577 CASE(UIMSG_PlayerCreation_VoicePrev) | |
7578 CASE(UIMSG_PlayerCreation_VoiceNext) | |
7579 CASE(UIMSG_StartNPCDialogue) | |
7580 CASE(UIMSG_ArrowUp) | |
7581 CASE(UIMSG_DownArrow) | |
7582 CASE(UIMSG_LoadSlot) | |
7583 CASE(UIMSG_SelectLoadSlot) | |
7584 CASE(UIMSG_Cancel) | |
7585 CASE(UIMSG_ExitRest) | |
7586 CASE(UIMSG_PlayerCreation_FacePrev) | |
7587 CASE(UIMSG_PlayerCreation_FaceNext) | |
7588 CASE(UIMSG_CycleCharacters) | |
7589 CASE(UIMSG_SetTurnSpeed) | |
7590 CASE(UIMSG_ToggleWalkSound) | |
7591 CASE(UIMSG_ChangeVoiceVolume) | |
7592 CASE(UIMSG_ToggleShowDamage) | |
7593 CASE(UIMSG_ScrollNPCPanel) | |
7594 CASE(UIMSG_ShowFinalWindow) | |
7595 CASE(UIMSG_OpenQuestBook) | |
7596 CASE(UIMSG_OpenAutonotes) | |
7597 CASE(UIMSG_OpenMapBook) | |
7598 CASE(UIMSG_OpenCalendar) | |
7599 CASE(UIMSG_OpenHistoryBook) | |
7600 CASE(UIMSG_ToggleAlwaysRun) | |
7601 CASE(UIMSG_ToggleFlipOnExit) | |
7602 CASE(UIMSG_Game_Action) | |
7603 CASE(UIMSG_OpenRestUI) | |
7604 CASE(UIMSG_TransitionUI_Confirm) | |
7605 CASE(UIMSG_OpenKeyMappingOptions) | |
7606 CASE(UIMSG_SelectKeyPage1) | |
7607 CASE(UIMSG_SelectKeyPage2) | |
7608 CASE(UIMSG_ResetKeyMapping) | |
7609 CASE(UIMSG_ChangeKeyButton) | |
7610 CASE(UIMSG_OpenVideoOptions) | |
7611 CASE(UIMSG_ToggleBloodsplats) | |
7612 CASE(UIMSG_ToggleColoredLights) | |
7613 CASE(UIMSG_ToggleTint) | |
7614 default: | |
7615 _swprintf(b, L"UIMSG_%03X", msg); return b; | |
7616 }; | |
7617 #undef CASE | |
7618 } | |
7619 | |
7620 | |
0 | 7621 //----- (0042EB8D) -------------------------------------------------------- |
437 | 7622 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |
0 | 7623 { |
482 | 7624 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); |
0 | 7625 if (uNumMessages < 40) |
7626 { | |
437 | 7627 files[uNumMessages] = file; |
7628 lines[uNumMessages] = line; | |
7629 | |
0 | 7630 pMessages[uNumMessages].eType = msg; |
7631 pMessages[uNumMessages].param = param; | |
7632 pMessages[uNumMessages++].field_8 = a4; | |
7633 } | |
7634 } | |
7635 | |
7636 //----- (0042EBBE) -------------------------------------------------------- | |
7637 int __fastcall sub_42EBBE(int a1, int a2) | |
7638 { | |
7639 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7640 } | |
7641 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7642 | |
7643 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 7644 int stru193_math::Sin(int angle) |
0 | 7645 { |
323 | 7646 return Cos(angle - this->uIntegerHalfPi); |
0 | 7647 } |
7648 | |
7649 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 7650 void _42ECB5_PlayerAttacksActor() |
0 | 7651 { |
271 | 7652 //unsigned int v0; // ebx@1 |
7653 //Player *v1; // esi@1 | |
7654 //bool result; // eax@1 | |
295 | 7655 //int v3; // edi@2 |
271 | 7656 //unsigned int v4; // eax@7 |
0 | 7657 char *v5; // eax@8 |
271 | 7658 //int v6; // ecx@9 |
7659 //signed int v7; // eax@16 | |
295 | 7660 //Actor *v8; // edi@20 |
0 | 7661 unsigned int v9; // ecx@21 |
295 | 7662 //char *v10; // eax@26 |
0 | 7663 char *v11; // eax@26 |
7664 unsigned int v12; // eax@47 | |
295 | 7665 //char *v13; // eax@47 |
7666 //char *v14; // eax@47 | |
7667 //unsigned int v15; // ebx@54 | |
7668 //int v16; // [sp-10h] [bp-4Ch]@24 | |
7669 //int v17; // [sp-10h] [bp-4Ch]@44 | |
7670 //unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7671 //unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7672 //__int16 v20; // [sp-8h] [bp-44h]@24 | |
7673 //__int16 v21; // [sp-8h] [bp-44h]@44 | |
7674 //int v22; // [sp-4h] [bp-40h]@24 | |
7675 //int v23; // [sp-4h] [bp-40h]@44 | |
0 | 7676 SoundID v24; // [sp-4h] [bp-40h]@58 |
295 | 7677 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 |
271 | 7678 //unsigned int a2; // [sp+18h] [bp-24h]@20 |
7679 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
295 | 7680 //int v28; // [sp+20h] [bp-1Ch]@9 |
271 | 7681 //unsigned int *v28b; |
295 | 7682 //int v29; // [sp+24h] [bp-18h]@16 |
7683 //int v30; // [sp+28h] [bp-14h]@16 | |
271 | 7684 //int v31; // [sp+2Ch] [bp-10h]@4 |
295 | 7685 //int v32; // [sp+30h] [bp-Ch]@7 |
271 | 7686 //int v33; // [sp+34h] [bp-8h]@7 |
295 | 7687 //int v34; // [sp+38h] [bp-4h]@17 |
0 | 7688 |
271 | 7689 //v0 = uActiveCharacter; |
7690 //v27 = 6972 * uActiveCharacter; | |
7691 //v1 = &pParty->pPlayers[uActiveCharacter-1]; | |
7692 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); | |
7693 auto player = &pParty->pPlayers[uActiveCharacter - 1]; | |
7694 if (!player->CanAct()) | |
7695 return; | |
7696 | |
7697 pStru277->_427D48(uActiveCharacter); | |
295 | 7698 //v3 = 0; |
271 | 7699 if (pParty->Invisible()) |
7700 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
7701 | |
7702 //v31 = player->pEquipment.uBow; | |
7703 int bow_idx = player->pEquipment.uBow; | |
7704 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) | |
7705 bow_idx = 0; | |
7706 | |
295 | 7707 //v32 = 0; |
7708 int wand_item_id = 0; | |
271 | 7709 //v33 = 0; |
7710 //v4 = v1->pEquipment.uMainHand; | |
7711 int laser_weapon_item_id = 0; | |
7712 | |
7713 int main_hand_idx = player->pEquipment.uMainHand; | |
7714 if (main_hand_idx) | |
0 | 7715 { |
271 | 7716 auto item = &player->pInventoryItems[main_hand_idx - 1]; |
112 | 7717 //v5 = (char *)v1 + 36 * v4; |
271 | 7718 if (!item->Broken()) |
7719 { | |
7720 //v28b = &v1->pInventoryItems[v4].uItemID; | |
7721 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
295 | 7722 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND) |
0 | 7723 { |
295 | 7724 if (item->uNumCharges <= 0) |
7725 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 7726 else |
295 | 7727 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 7728 } |
271 | 7729 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
7730 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 7731 } |
271 | 7732 } |
7733 | |
295 | 7734 //v30 = 0; |
7735 //v29 = 0; | |
7736 //v28 = 0; | |
271 | 7737 //v7 = pMouse->uPointingObjectID; |
7738 | |
7739 int target_pid = pMouse->uPointingObjectID; | |
7740 int target_type = target_pid & 7, | |
7741 target_id = target_pid >> 3; | |
7742 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) | |
7743 { | |
7744 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
7745 target_type = target_pid & 7; | |
7746 target_id = target_pid >> 3; | |
7747 } | |
295 | 7748 |
7749 auto actor = &pActors[target_id]; | |
7750 int actor_distance = 0; | |
271 | 7751 if (target_type == OBJECT_Actor) |
7752 { | |
295 | 7753 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
7754 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
7755 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
7756 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
7757 if (actor_distance < 0) | |
7758 actor_distance = 0; | |
7759 } | |
7760 | |
7761 bool shooting_bow = false, | |
7762 shotting_laser = false, | |
7763 shooting_wand = false; | |
7764 if (laser_weapon_item_id) | |
7765 { | |
7766 shotting_laser = true; | |
490 | 7767 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); |
295 | 7768 } |
7769 else if (wand_item_id) | |
7770 { | |
7771 shooting_wand = true; | |
7772 | |
7773 int main_hand_idx = player->pEquipment.uMainHand; | |
490 | 7774 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItems[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); |
295 | 7775 |
7776 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | |
7777 player->pEquipment.uMainHand = 0; | |
7778 } | |
303 | 7779 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 7780 { |
303 | 7781 Vec3_int_ a3; |
7782 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
7783 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
7784 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
7785 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
7786 | |
7787 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); | |
305 | 7788 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) |
295 | 7789 _42FA66_do_explosive_impact( |
7790 actor->vPosition.x, | |
7791 actor->vPosition.y, | |
7792 actor->vPosition.z + actor->uActorHeight / 2, | |
7793 0, 512, uActiveCharacter); | |
303 | 7794 } |
7795 else if (bow_idx) | |
7796 { | |
7797 shooting_bow = true; | |
490 | 7798 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0); |
295 | 7799 } |
7800 else | |
7801 { | |
303 | 7802 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
7803 } | |
7804 | |
7805 if (!pParty->bTurnBasedModeOn) | |
7806 { | |
7807 int recovery = player->GetAttackRecoveryTime(0); | |
7808 if (recovery < 30 ) | |
7809 recovery = 30; | |
7810 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); | |
295 | 7811 } |
7812 | |
7813 | |
7814 int v34 = 0; | |
7815 if (shooting_wand) | |
7816 return; | |
7817 else if (shooting_bow) | |
7818 { | |
7819 v34 = 5; | |
7820 player->PlaySound(SPEECH_50, 0); | |
7821 } | |
7822 if (shotting_laser) | |
7823 v34 = 7; | |
7824 else | |
7825 { | |
7826 int main_hand_idx = player->pEquipment.uMainHand; | |
7827 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) | |
7828 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType; | |
7829 pTurnEngine->_40471C(); | |
7830 } | |
7831 | |
7832 switch (v34) | |
7833 { | |
7834 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
7835 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
7836 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
7837 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
7838 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
7839 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
7840 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
7841 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
7842 } | |
0 | 7843 } |
7844 | |
7845 //----- (0042F184) -------------------------------------------------------- | |
295 | 7846 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 7847 { |
7848 int v4; // edi@1 | |
7849 stru319 *v5; // esi@1 | |
7850 int v6; // eax@2 | |
7851 int v7; // eax@4 | |
7852 int result; // eax@5 | |
7853 int *v9; // edx@8 | |
7854 signed int v10; // ebx@10 | |
7855 int v11; // edi@11 | |
7856 Actor *v12; // esi@12 | |
7857 unsigned __int16 v13; // ax@12 | |
7858 int v14; // eax@22 | |
7859 char v15; // zf@30 | |
7860 int v16; // esi@32 | |
7861 int v17; // ecx@34 | |
7862 stru319 *v18; // eax@39 | |
7863 int v19; // edx@39 | |
7864 int v20; // ecx@41 | |
7865 unsigned __int16 v21; // ax@42 | |
7866 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
7867 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
7868 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
7869 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
7870 int *v26; // [sp+18h] [bp-14h]@8 | |
7871 int v27; // [sp+1Ch] [bp-10h]@10 | |
7872 int *v28; // [sp+20h] [bp-Ch]@10 | |
7873 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
7874 int v30; // [sp+28h] [bp-4h]@6 | |
7875 int i; // [sp+38h] [bp+Ch]@33 | |
7876 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
7877 | |
7878 v4 = 0; | |
7879 v5 = this; | |
7880 v24 = this; | |
7881 if ( pRenderer->pRenderD3D ) | |
7882 { | |
7883 v6 = a3 != 0; | |
7884 if ( a4 ) | |
7885 LOBYTE(v6) = v6 | 8; | |
295 | 7886 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 7887 if ( v7 != -1 ) |
7888 return (unsigned __int16)v7; | |
295 | 7889 else return 0; |
0 | 7890 } |
7891 else | |
7892 { | |
7893 v30 = 0; | |
7894 if ( pRenderer->pActiveZBuffer ) | |
7895 { | |
7896 v29 = viewparams->uScreenX; | |
7897 v23 = viewparams->uScreenZ; | |
7898 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
7899 { | |
7900 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
7901 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
7902 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
7903 do | |
7904 { | |
7905 if ( (signed int)v29 < (signed int)v23 ) | |
7906 { | |
7907 v28 = v9; | |
7908 v10 = v4; | |
7909 v27 = v23 - v29; | |
7910 do | |
7911 { | |
7912 v22 = *v28; | |
7913 v11 = *v28 & 0xFFFF; | |
141 | 7914 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 7915 { |
7916 v12 = &pActors[(unsigned int)v11 >> 3]; | |
7917 v13 = v12->uAIState; | |
7918 if ( v13 != 5 ) | |
7919 { | |
7920 if ( v13 != 4 | |
7921 && v13 != 11 | |
7922 && v13 != 19 | |
7923 && v13 != 17 | |
7924 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
7925 { | |
7926 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
295 | 7927 && v22 <= pick_depth << 16 ) |
0 | 7928 { |
7929 v14 = 0; | |
7930 if ( v10 > 0 ) | |
7931 { | |
7932 do | |
7933 { | |
7934 if ( dword_50BDA0[v14] == v11 ) | |
7935 break; | |
7936 ++v14; | |
7937 } | |
7938 while ( v14 < v30 ); | |
7939 } | |
7940 if ( v14 == v30 && v10 < 100 ) | |
7941 { | |
7942 ++v30; | |
7943 dword_50BC10[v10] = v22; | |
7944 dword_50BDA0[v10] = v11; | |
7945 ++v10; | |
7946 } | |
7947 } | |
7948 } | |
7949 } | |
7950 } | |
7951 ++v28; | |
7952 --v27; | |
7953 } | |
7954 while ( v27 ); | |
7955 v4 = v30; | |
7956 v5 = v24; | |
7957 } | |
7958 v9 = v26 + 640; | |
7959 v15 = v25-- == 1; | |
7960 v26 += 640; | |
7961 } | |
7962 while ( !v15 ); | |
7963 } | |
7964 if ( v4 > 0 ) | |
7965 { | |
7966 v32 = 1; | |
7967 v16 = (int)dword_50BC10; | |
7968 do | |
7969 { | |
7970 for ( i = v32; i < v4; ++i ) | |
7971 { | |
7972 v17 = dword_50BC10[i]; | |
7973 if ( v17 < *(int *)v16 ) | |
7974 { | |
7975 dword_50BC10[i] = *(int *)v16; | |
7976 *(int *)v16 = v17; | |
7977 } | |
7978 } | |
7979 ++v32; | |
7980 v16 += 4; | |
7981 } | |
7982 while ( v32 - 1 < v4 ); | |
7983 v5 = v24; | |
7984 if ( v4 > 0 ) | |
7985 { | |
7986 v18 = v24; | |
7987 v19 = v4; | |
7988 do | |
7989 { | |
7990 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
7991 v18 += 4; | |
7992 --v19; | |
7993 } | |
7994 while ( v19 ); | |
7995 } | |
7996 } | |
7997 v20 = 0; | |
7998 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
7999 { | |
8000 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8001 if ( v21 != 4 && v21 != 5 ) | |
8002 break; | |
8003 } | |
8004 if ( v20 != v4 ) | |
8005 { | |
8006 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8007 LOBYTE(result) = result | 3; | |
8008 return result; | |
8009 } | |
8010 } | |
8011 } | |
8012 return 0; | |
8013 } | |
8014 | |
8015 | |
8016 //----- (0042F3D6) -------------------------------------------------------- | |
8017 void InitializeTurnBasedAnimations(void *_this) | |
8018 { | |
8019 unsigned int *v1; // edi@1 | |
8020 | |
8021 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8022 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8023 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8024 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8025 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8026 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8027 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8028 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8029 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8030 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8031 v1 = pIconIDs_Turn; | |
8032 do | |
8033 { | |
8034 pIconsFrameTable->InitializeAnimation(*v1); | |
8035 ++v1; | |
8036 } | |
8037 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8038 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8039 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8040 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8041 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8042 } | |
8043 | |
8044 //----- (0042F4DA) -------------------------------------------------------- | |
8045 signed int __cdecl sub_42F4DA() | |
8046 { | |
8047 signed int v0; // edi@1 | |
82 | 8048 Actor *v1; // esi@4 |
0 | 8049 int v2; // ebx@5 |
8050 int v3; // eax@5 | |
8051 int v4; // ebx@5 | |
8052 unsigned int v5; // ecx@5 | |
8053 int v6; // edx@6 | |
8054 unsigned int v7; // edx@8 | |
8055 unsigned int v8; // edx@10 | |
8056 __int16 v9; // ax@12 | |
8057 signed int result; // eax@20 | |
8058 int v11; // [sp+Ch] [bp-10h]@5 | |
8059 int v12; // [sp+10h] [bp-Ch]@5 | |
8060 signed int v13; // [sp+14h] [bp-8h]@3 | |
8061 | |
8062 v0 = 5120; | |
8063 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8064 v0 = 2560; | |
8065 v13 = 0; | |
8066 if ( (signed int)uNumActors <= 0 ) | |
8067 { | |
8068 LABEL_20: | |
8069 result = 0; | |
8070 } | |
8071 else | |
8072 { | |
82 | 8073 v1 = pActors; |
0 | 8074 while ( 1 ) |
8075 { | |
82 | 8076 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8077 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8078 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8079 v3 = v2; |
8080 v4 = v11; | |
8081 v5 = v12; | |
8082 if ( v3 < v11 ) | |
8083 { | |
8084 v6 = v3; | |
8085 v3 = v11; | |
8086 v4 = v6; | |
8087 } | |
8088 if ( v3 < v12 ) | |
8089 { | |
8090 v7 = v3; | |
8091 v3 = v12; | |
8092 v5 = v7; | |
8093 } | |
8094 if ( v4 < (signed int)v5 ) | |
8095 { | |
8096 v8 = v5; | |
8097 v5 = v4; | |
8098 v4 = v8; | |
8099 } | |
8100 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8101 { | |
82 | 8102 v9 = v1->uAIState; |
8103 if ( v1->uAIState != 5 ) | |
0 | 8104 { |
8105 if ( v9 != 4 | |
8106 && v9 != 11 | |
8107 && v9 != 19 | |
8108 && v9 != 17 | |
82 | 8109 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8110 break; |
8111 } | |
8112 } | |
8113 ++v13; | |
82 | 8114 ++v1; |
0 | 8115 if ( v13 >= (signed int)uNumActors ) |
8116 goto LABEL_20; | |
8117 } | |
8118 result = 1; | |
8119 } | |
8120 return result; | |
8121 } | |
8122 | |
8123 //----- (0042F7EB) -------------------------------------------------------- | |
8124 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) | |
8125 { | |
8126 unsigned int v9; // edi@1 | |
8127 signed int v10; // edx@3 | |
8128 char *v11; // ecx@4 | |
8129 unsigned __int16 v12; // ax@7 | |
8130 unsigned int v13; // edx@9 | |
8131 char *v14; // ecx@10 | |
8132 int v15; // esi@17 | |
8133 int v16; // eax@18 | |
8134 int v17; // edi@20 | |
8135 int v18; // esi@20 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8136 //SpriteObject a1a; // [sp+Ch] [bp-78h]@1 |
0 | 8137 int v21; // [sp+7Ch] [bp-8h]@1 |
8138 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8139 | |
8140 v9 = uSpriteID; | |
8141 v21 = x; | |
8142 v22 = uSpriteID; | |
8143 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8144 SpriteObject a1a; // [sp+Ch] [bp-78h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8145 //SpriteObject::SpriteObject(&a1a); |
0 | 8146 a1a.stru_24.Reset(); |
8147 | |
8148 if ( a9 ) | |
8149 { | |
8150 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8151 v9 = v22; | |
8152 } | |
8153 v10 = 0; | |
8154 a1a.field_50 = 0; | |
8155 a1a.field_4C = 0; | |
8156 a1a.field_48 = 0; | |
8157 a1a.field_54 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8158 a1a.uType = v9; |
0 | 8159 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
8160 { | |
8161 LABEL_7: | |
8162 v12 = 0; | |
8163 } | |
8164 else | |
8165 { | |
8166 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8167 while ( (short)v9 != *(short *)v11 ) | |
8168 { | |
8169 ++v10; | |
8170 v11 += 56; | |
8171 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8172 goto LABEL_7; | |
8173 } | |
8174 v12 = v10; | |
8175 } | |
8176 a1a.uObjectDescID = v12; | |
8177 a1a.vPosition.z = z; | |
8178 a1a.vPosition.x = v21; | |
8179 a1a.vPosition.y = y; | |
8180 a1a.uSoundID = 0; | |
8181 a1a.uAttributes = attributes; | |
8182 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8183 a1a.uSpriteFrameID = 0; | |
303 | 8184 a1a.field_58_pid = 0; |
0 | 8185 a1a.field_5C = 0; |
8186 if ( !(a1a.uAttributes & 0x10) ) | |
8187 { | |
8188 v13 = 0; | |
222 | 8189 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
0 | 8190 { |
8191 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8192 while ( *(short *)v14 != v9 ) | |
8193 { | |
8194 ++v13; | |
8195 v14 += 48; | |
222 | 8196 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount ) |
0 | 8197 goto LABEL_16; |
8198 } | |
8199 a1a.stru_24.uItemID = v13; | |
8200 } | |
8201 } | |
8202 LABEL_16: | |
8203 if ( a7 ) | |
8204 { | |
8205 v15 = count; | |
8206 if ( count > 0 ) | |
8207 { | |
8208 do | |
8209 { | |
8210 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8211 v16 = rand(); | |
8212 a1a.Create( | |
8213 (signed __int16)a1a.uFacing, | |
8214 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8215 a4, | |
8216 0); | |
8217 --v15; | |
8218 } | |
8219 while ( v15 ); | |
8220 } | |
8221 } | |
8222 else | |
8223 { | |
8224 v17 = count; | |
8225 v18 = stru_5C6E00->uIntegerHalfPi; | |
8226 a1a.uFacing = 0; | |
8227 if ( count > 0 ) | |
8228 { | |
8229 do | |
8230 { | |
8231 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8232 --v17; | |
8233 } | |
8234 while ( v17 ); | |
8235 } | |
8236 } | |
8237 return 1; | |
8238 } | |
8239 | |
8240 //----- (0042F960) -------------------------------------------------------- | |
8241 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8242 { | |
8243 int v3; // ebx@1 | |
8244 int v4; // edi@1 | |
8245 signed int v5; // edx@1 | |
8246 char *v6; // ecx@2 | |
8247 unsigned __int16 v7; // ax@5 | |
8248 signed int v8; // eax@6 | |
8249 signed int v9; // eax@7 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8250 //SpriteObject a1; // [sp+Ch] [bp-70h]@1 |
0 | 8251 |
8252 v3 = x; | |
8253 v4 = y; | |
8254 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8255 SpriteObject a1; // [sp+Ch] [bp-70h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8256 //SpriteObject::SpriteObject(&a1); |
0 | 8257 a1.stru_24.Reset(); |
8258 | |
8259 v5 = 0; | |
8260 a1.field_50 = 0; | |
8261 a1.field_4C = 0; | |
8262 a1.field_48 = 0; | |
8263 a1.field_54 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8264 a1.uType = 800; |
0 | 8265 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
8266 { | |
8267 LABEL_5: | |
8268 v7 = 0; | |
8269 } | |
8270 else | |
8271 { | |
8272 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8273 while ( *(short *)v6 != 800 ) | |
8274 { | |
8275 ++v5; | |
8276 v6 += 56; | |
8277 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8278 goto LABEL_5; | |
8279 } | |
8280 v7 = v5; | |
8281 } | |
8282 a1.uObjectDescID = v7; | |
8283 a1.vPosition.x = v3; | |
8284 a1.vPosition.y = v4; | |
8285 a1.vPosition.z = z; | |
8286 a1.uSoundID = 0; | |
8287 a1.uAttributes = 0; | |
8288 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8289 a1.uSpriteFrameID = 0; | |
303 | 8290 a1.field_58_pid = 0; |
0 | 8291 a1.field_5C = 0; |
8292 v8 = a1.Create(0, 0, 0, 0); | |
8293 if ( v8 != -1 ) | |
8294 { | |
8295 v9 = 8 * v8; | |
8296 LOBYTE(v9) = v9 | 2; | |
8297 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8298 } | |
8299 } | |
8300 | |
8301 //----- (0042FA22) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8302 SpriteObject *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8303 { |
8304 size_t v0; // edx@1 | |
8305 int v1; // ebp@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8306 SpriteObject *result; // eax@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8307 SpriteObject *v3; // ebx@1 |
0 | 8308 |
8309 v0 = 0; | |
8310 v1 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8311 //result = (char *)&pSpriteObjects[0].uObjectDescID; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8312 result = pSpriteObjects; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8313 v3 = pSpriteObjects; |
0 | 8314 do |
8315 { | |
79 | 8316 if ( result->uObjectDescID ) |
0 | 8317 { |
8318 if ( v1 != v0 ) | |
8319 { | |
79 | 8320 memcpy(v3, result, 0x70u); |
8321 result->uObjectDescID = 0; | |
0 | 8322 } |
8323 ++v0; | |
79 | 8324 ++v3;// = (char *)v3 + 112; |
0 | 8325 } |
79 | 8326 ++result;// += 112; |
0 | 8327 ++v1; |
8328 } | |
79 | 8329 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8330 while( result <= &pSpriteObjects[999] ); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8331 uNumSpriteObjects = v0; |
0 | 8332 return result; |
8333 } | |
8334 | |
8335 //----- (0042FA66) -------------------------------------------------------- | |
8336 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8337 { | |
8338 int v6; // edi@1 | |
8339 int v7; // esi@1 | |
8340 char *v8; // ecx@2 | |
8341 unsigned __int16 v9; // ax@5 | |
8342 int v10; // eax@10 | |
8343 signed int result; // eax@11 | |
8344 __int16 v12; // ax@12 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8345 //SpriteObject a1a; // [sp+Ch] [bp-74h]@1 |
0 | 8346 int v14; // [sp+7Ch] [bp-4h]@1 |
8347 | |
8348 v6 = a1; | |
8349 v7 = a2; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8350 SpriteObject a1a; // [sp+Ch] [bp-74h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8351 //SpriteObject::SpriteObject(&a1a); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8352 a1a.uType = 600; |
0 | 8353 a1a.stru_24.Reset(); |
8354 | |
8355 a1a.field_48 = 6; | |
8356 a1a.field_4C = 8; | |
8357 a1a.field_50 = 3; | |
8358 v14 = 0; | |
8359 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8360 { | |
8361 LABEL_5: | |
8362 v9 = 0; | |
8363 } | |
8364 else | |
8365 { | |
8366 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8367 while ( (short)a1a.uType != *(short *)v8 ) |
0 | 8368 { |
8369 ++v14; | |
8370 v8 += 56; | |
8371 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8372 goto LABEL_5; | |
8373 } | |
8374 v9 = v14; | |
8375 } | |
8376 a1a.uObjectDescID = v9; | |
8377 a1a.vPosition.x = v6; | |
8378 a1a.vPosition.y = v7; | |
8379 a1a.vPosition.z = a3; | |
8380 a1a.uAttributes = 0; | |
8381 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8382 a1a.uSpriteFrameID = 0; | |
8383 a1a.field_5C = 0; | |
8384 a1a.field_60_distance_related_prolly_lod = 0; | |
8385 a1a.uFacing = 0; | |
8386 a1a.uSoundID = 0; | |
8387 if ( a6 >= 1 || a6 <= 4 ) | |
8388 { | |
8389 v10 = 8 * a6 - 8; | |
303 | 8390 LOBYTE(v10) = v10 | OBJECT_Player; |
8391 a1a.field_58_pid = v10; | |
0 | 8392 } |
8393 else | |
8394 { | |
303 | 8395 a1a.field_58_pid = 0; |
0 | 8396 } |
8397 result = a1a.Create(0, 0, 0, 0); | |
8398 if ( result != -1 ) | |
8399 { | |
8400 v12 = 8 * result; | |
8401 LOBYTE(v12) = v12 | 2; | |
8402 result = stru_50FE08.Add( | |
8403 v12, | |
8404 a5, | |
8405 SLOWORD(a1a.vPosition.x), | |
8406 SLOWORD(a1a.vPosition.y), | |
8407 SLOWORD(a1a.vPosition.z), | |
8408 0, | |
8409 0); | |
8410 } | |
8411 return result; | |
8412 } | |
8413 | |
8414 | |
8415 | |
8416 //----- (0042FB5C) -------------------------------------------------------- | |
8417 bool __fastcall sub_42FB5C(signed int a1) | |
8418 { | |
8419 int v1; // ecx@3 | |
8420 int v2; // ecx@4 | |
8421 int v3; // ecx@5 | |
8422 int v4; // ecx@6 | |
8423 int v5; // ecx@7 | |
8424 int v6; // ecx@8 | |
8425 char v7; // zf@9 | |
8426 | |
8427 if ( a1 > 39 ) | |
8428 { | |
8429 if ( a1 > 77 ) | |
8430 { | |
8431 if ( a1 == 80 ) | |
8432 return 0; | |
8433 if ( a1 > 84 ) | |
8434 { | |
8435 if ( a1 <= 86 ) | |
8436 return 0; | |
8437 v7 = a1 == 95; | |
8438 goto LABEL_20; | |
8439 } | |
8440 } | |
8441 else | |
8442 { | |
8443 if ( a1 == 77 ) | |
8444 return 0; | |
8445 if ( a1 >= 46 ) | |
8446 { | |
8447 if ( a1 <= 47 || a1 == 51 ) | |
8448 return 0; | |
8449 v7 = a1 == 73; | |
8450 goto LABEL_20; | |
8451 } | |
8452 } | |
8453 return 1; | |
8454 } | |
8455 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8456 return 1; | |
8457 v2 = v1 - 3; | |
8458 if ( !v2 ) | |
8459 return 0; | |
8460 v3 = v2 - 1; | |
8461 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8462 return 1; | |
8463 v5 = v4 - 8; | |
8464 if ( !v5 ) | |
8465 return 0; | |
8466 v6 = v5 - 1; | |
8467 if ( !v6 ) | |
8468 return 1; | |
8469 v7 = v6 == 20; | |
8470 LABEL_20: | |
8471 if ( !v7 ) | |
8472 return 1; | |
8473 return 0; | |
8474 } | |
8475 | |
8476 //----- (0042FBDD) -------------------------------------------------------- | |
8477 void __cdecl sub_42FBDD() | |
8478 { | |
388 | 8479 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 8480 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
8481 pRenderer->Present(); | |
8482 } | |
8483 | |
8484 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8485 void __cdecl CloseWindowBackground() |
0 | 8486 { |
388 | 8487 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 8488 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
8489 pRenderer->Present(); | |
8490 } | |
8491 | |
8492 //----- (0042FC4E) -------------------------------------------------------- | |
8493 void __cdecl ProcessInputActions() | |
8494 { | |
8495 ActionQueue *pActionQueue; // esi@7 | |
8496 Keyboard *v3; // ecx@8 | |
8497 char v4; // al@9 | |
8498 ActionQueue *v5; // ecx@19 | |
8499 Player *v6; // ecx@86 | |
8500 Player *v7; // esi@100 | |
8501 char v8; // bl@100 | |
8502 unsigned __int16 v9; // ax@102 | |
8503 int v10; // eax@103 | |
8504 unsigned int v11; // eax@127 | |
8505 signed int v12; // esi@157 | |
8506 Keyboard *v13; // ecx@158 | |
8507 char v14; // al@159 | |
8508 unsigned int v15; // eax@168 | |
8509 void *v16; // esi@177 | |
8510 int v17; // [sp-14h] [bp-1Ch]@8 | |
8511 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8512 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
271 | 8513 //__int16 v20; // [sp-14h] [bp-1Ch]@60 |
0 | 8514 int v21; // [sp-14h] [bp-1Ch]@68 |
8515 int v22; // [sp-Ch] [bp-14h]@158 | |
8516 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8517 int v24; // [sp+4h] [bp-4h]@87 | |
8518 | |
8519 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8520 auto pKeyboard = pGame->pKeyboardInstance; | |
8521 if (!bAlwaysRun) | |
8522 { | |
8523 if (pKeyboard->IsShiftHeld()) | |
8524 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8525 else | |
8526 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8527 } | |
8528 else | |
8529 { | |
8530 if (pKeyboard->IsShiftHeld()) | |
8531 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8532 else | |
8533 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8534 } | |
8535 | |
140 | 8536 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
486 | 8537 //LABEL_6: |
0 | 8538 if ( !pEventTimer->bPaused ) |
8539 { | |
8540 inputAction = (InputAction)0; | |
8541 pActionQueue = pPartyActionQueue; | |
8542 while ( 1 ) | |
8543 { | |
8544 v3 = pGame->pKeyboardInstance; | |
8545 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8546 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8547 v4 = v3->WasKeyPressed(v17); | |
8548 else | |
8549 v4 = v3->IsKeyBeingHeld(v17); | |
8550 if ( v4 ) | |
8551 { | |
8552 switch ( inputAction ) | |
8553 { | |
8554 case INPUT_MoveForward: | |
271 | 8555 if (pCurrentScreen != SCREEN_GAME) |
0 | 8556 break; |
8557 if (!pParty->bTurnBasedModeOn) | |
163 | 8558 //goto _do_move_forward; |
0 | 8559 { |
8560 v5 = pActionQueue; | |
140 | 8561 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8562 partyAction = PARTY_RunForward; |
8563 else | |
8564 partyAction = PARTY_WalkForward; | |
163 | 8565 //goto _add_action_and_continue; |
8566 v5->Add(partyAction); | |
8567 break; | |
8568 } | |
8569 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8570 { | |
8571 pTurnEngine->uActionPointsLeft -= 26; | |
8572 //_do_move_forward: | |
8573 v5 = pActionQueue; | |
8574 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8575 partyAction = PARTY_RunForward; | |
8576 else | |
8577 partyAction = PARTY_WalkForward; | |
8578 //goto _add_action_and_continue; | |
8579 v5->Add(partyAction); | |
8580 break; | |
0 | 8581 } |
8582 break; | |
8583 case INPUT_MoveBackwards: | |
17 | 8584 //__debugbreak(); |
271 | 8585 if (pCurrentScreen != SCREEN_GAME) |
0 | 8586 break; |
8587 if (!pParty->bTurnBasedModeOn) | |
17 | 8588 //goto _do_move_backwards; |
8589 { | |
8590 v5 = pActionQueue; | |
8591 if ( pParty->uFlags2 & 2 ) | |
8592 partyAction = PARTY_RunBackward; | |
8593 else | |
8594 partyAction = PARTY_WalkBackward; | |
163 | 8595 //goto _add_action_and_continue; |
8596 v5->Add(partyAction); | |
8597 break; | |
17 | 8598 } |
0 | 8599 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8600 { | |
8601 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8602 //_do_move_backwards: |
0 | 8603 v5 = pActionQueue; |
8604 if ( pParty->uFlags2 & 2 ) | |
8605 partyAction = PARTY_RunBackward; | |
8606 else | |
8607 partyAction = PARTY_WalkBackward; | |
163 | 8608 //goto _add_action_and_continue; |
8609 v5->Add(partyAction); | |
8610 break; | |
0 | 8611 } |
8612 break; | |
8613 case INPUT_StrafeLeft: | |
17 | 8614 //__debugbreak(); |
271 | 8615 if (pCurrentScreen != SCREEN_GAME) |
0 | 8616 break; |
8617 if (!pParty->bTurnBasedModeOn) | |
17 | 8618 //goto _do_strafe_left; |
8619 { | |
8620 partyAction = PARTY_StrafeLeft; | |
163 | 8621 //goto _add_action_and_continue_; |
8622 v5 = pActionQueue; | |
8623 v5->Add(partyAction); | |
8624 break; | |
17 | 8625 } |
0 | 8626 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8627 break; | |
8628 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8629 //_do_strafe_left: |
0 | 8630 partyAction = PARTY_StrafeLeft; |
163 | 8631 //goto _add_action_and_continue_; |
8632 v5 = pActionQueue; | |
8633 v5->Add(partyAction); | |
8634 break; | |
0 | 8635 case INPUT_StrafeRight: |
17 | 8636 //__debugbreak(); |
271 | 8637 if (pCurrentScreen != SCREEN_GAME) |
0 | 8638 break; |
8639 if (!pParty->bTurnBasedModeOn) | |
17 | 8640 //goto _do_strafe_right; |
8641 { | |
8642 partyAction = PARTY_StrafeRight; | |
163 | 8643 //goto _add_action_and_continue_; |
8644 v5 = pActionQueue; | |
8645 v5->Add(partyAction); | |
8646 break; | |
17 | 8647 } |
0 | 8648 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8649 break; | |
8650 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8651 //_do_strafe_right: |
0 | 8652 partyAction = PARTY_StrafeRight; |
163 | 8653 //goto _add_action_and_continue_; |
8654 v5 = pActionQueue; | |
8655 v5->Add(partyAction); | |
8656 break; | |
0 | 8657 case INPUT_TurnLeft: |
271 | 8658 if (pCurrentScreen != SCREEN_GAME) |
0 | 8659 break; |
8660 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
8661 { | |
8662 if (pParty->bTurnBasedModeOn) | |
8663 { | |
8664 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8665 break; | |
8666 pTurnEngine->uActionPointsLeft -= 26; | |
8667 } | |
8668 partyAction_ = PARTY_StrafeLeft; | |
8669 } | |
8670 else | |
8671 { | |
8672 if ( pParty->uFlags2 & 2 ) | |
8673 partyAction_ = PARTY_FastTurnLeft; | |
8674 else | |
8675 partyAction_ = PARTY_TurnLeft; | |
8676 } | |
8677 pActionQueue->Add(partyAction_); | |
8678 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8679 { | |
271 | 8680 pWeather->OnPlayerTurn(10); |
0 | 8681 } |
8682 break; | |
8683 case INPUT_TurnRight: | |
271 | 8684 if (pCurrentScreen != SCREEN_GAME) |
0 | 8685 break; |
8686 if ( GetAsyncKeyState(17) ) // strafing | |
8687 { | |
8688 if (pParty->bTurnBasedModeOn) | |
8689 { | |
8690 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8691 break; | |
8692 pTurnEngine->uActionPointsLeft -= 26; | |
8693 } | |
271 | 8694 v21 = PARTY_StrafeRight; |
0 | 8695 } |
8696 else | |
8697 { | |
8698 if ( pParty->uFlags2 & 2 ) | |
271 | 8699 v21 = PARTY_FastTurnRight; |
0 | 8700 else |
271 | 8701 v21 = PARTY_TurnRight; |
0 | 8702 } |
8703 pActionQueue->Add((PartyAction)v21); | |
8704 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8705 { | |
271 | 8706 pWeather->OnPlayerTurn(-10); |
0 | 8707 } |
8708 break; | |
8709 case INPUT_Jump: | |
17 | 8710 //__debugbreak(); |
271 | 8711 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 8712 break; |
8713 partyAction = (PartyAction)12; | |
163 | 8714 //goto _add_action_and_continue_; |
8715 v5 = pActionQueue; | |
8716 v5->Add(partyAction); | |
8717 break; | |
0 | 8718 case INPUT_Yell: |
187 | 8719 if (!pCurrentScreen && uActiveCharacter) |
0 | 8720 { |
8721 pParty->Yell(); | |
187 | 8722 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 8723 } |
187 | 8724 break; |
0 | 8725 case INPUT_Pass: |
17 | 8726 //__debugbreak(); |
0 | 8727 if ( pCurrentScreen ) |
8728 break; | |
8729 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 8730 //goto LABEL_118; |
8731 { | |
8732 pTurnEngine->field_18 |= 8u; | |
8733 break; | |
8734 } | |
0 | 8735 if ( uActiveCharacter ) |
8736 { | |
8737 v6 = pPlayers[uActiveCharacter]; | |
8738 if ( !v6->uTimeToRecovery ) | |
8739 { | |
8740 v24 = v6->GetAttackRecoveryTime(0); | |
8741 if ( !pParty->bTurnBasedModeOn ) | |
8742 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
8743 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
8744 pStru277->_427D48(uActiveCharacter); | |
8745 pTurnEngine->_40471C(); | |
8746 } | |
8747 } | |
8748 break; | |
8749 case INPUT_Combat: | |
17 | 8750 //__debugbreak(); |
271 | 8751 if (pCurrentScreen == SCREEN_GAME) |
0 | 8752 { |
8753 if (pParty->bTurnBasedModeOn) | |
8754 { | |
141 | 8755 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 8756 { |
8757 pParty->bTurnBasedModeOn = 0; | |
8758 pTurnEngine->End(true); | |
8759 } | |
8760 } | |
8761 else | |
8762 { | |
8763 pTurnEngine->Start(); | |
8764 pParty->bTurnBasedModeOn = true; | |
8765 } | |
8766 } | |
8767 break; | |
8768 case INPUT_CastReady: | |
17 | 8769 //__debugbreak(); |
271 | 8770 if (pCurrentScreen != SCREEN_GAME) |
0 | 8771 break; |
8772 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 8773 //goto LABEL_118; |
8774 { | |
8775 pTurnEngine->field_18 |= 8u; | |
8776 break; | |
8777 } | |
0 | 8778 if ( !uActiveCharacter ) |
8779 break; | |
8780 v7 = pPlayers[uActiveCharacter]; | |
8781 v8 = v7->uQuickSpell; | |
8782 if ( !v8 | |
8783 || bUnderwater | |
8784 || ((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)), | |
8785 v10 > v7->sMana) ) | |
8786 { | |
8787 pActionQueue = pPartyActionQueue; | |
8788 LABEL_120: | |
437 | 8789 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); |
8790 break; | |
8791 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 8792 { |
271 | 8793 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; |
163 | 8794 //goto _send_message; |
8795 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8796 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8797 ++pMessageQueue_50CBD0->uNumMessages; | |
8798 break; | |
437 | 8799 }*/ |
0 | 8800 } |
8801 else | |
8802 { | |
8803 pActionQueue = pPartyActionQueue; | |
8804 if ( dword_50C9E8 < 40 ) | |
8805 { | |
8806 dword_50C9EC[3 * dword_50C9E8] = 25; | |
437 | 8807 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8808 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 8809 ++dword_50C9E8; |
8810 } | |
8811 } | |
8812 break; | |
8813 case INPUT_Attack: | |
17 | 8814 //__debugbreak(); |
271 | 8815 if (pCurrentScreen != SCREEN_GAME) |
0 | 8816 break; |
8817 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
8818 goto LABEL_120; | |
17 | 8819 //LABEL_118: |
0 | 8820 pTurnEngine->field_18 |= 8u; |
8821 break; | |
8822 case INPUT_EventTrigger: | |
271 | 8823 if (pCurrentScreen == SCREEN_GAME) |
0 | 8824 { |
437 | 8825 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 8826 break; |
271 | 8827 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action; |
163 | 8828 //goto _send_message; |
8829 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8830 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8831 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 8832 break;*/ |
8833 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
163 | 8834 break; |
0 | 8835 } |
151 | 8836 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 8837 { |
8838 v11 = pMessageQueue_50CBD0->uNumMessages; | |
8839 if ( pMessageQueue_50CBD0->uNumMessages ) | |
8840 { | |
437 | 8841 v11 = 0; |
8842 pMessageQueue_50CBD0->uNumMessages = 0; | |
0 | 8843 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
8844 { | |
8845 v11 = 1; | |
8846 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 8847 //LABEL_132: |
271 | 8848 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 8849 //_send_message: |
0 | 8850 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
8851 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8852 ++pMessageQueue_50CBD0->uNumMessages; | |
8853 break; | |
8854 } | |
437 | 8855 break; |
0 | 8856 } |
437 | 8857 /*if ( (signed int)v11 < 40 ) |
163 | 8858 //goto LABEL_132; |
8859 { | |
271 | 8860 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 8861 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
8862 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8863 ++pMessageQueue_50CBD0->uNumMessages; | |
8864 break; | |
437 | 8865 }*/ |
8866 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 8867 } |
8868 break; | |
8869 case INPUT_CharCycle: | |
17 | 8870 //__debugbreak(); |
151 | 8871 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 8872 || dword_50C9E8 >= 40 ) |
8873 break; | |
8874 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 8875 //goto LABEL_155; |
437 | 8876 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8877 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 8878 ++dword_50C9E8; |
8879 break; | |
0 | 8880 case INPUT_LookUp: |
17 | 8881 //__debugbreak(); |
0 | 8882 if ( pEventTimer->bPaused ) |
8883 break; | |
8884 partyAction = (PartyAction)7; | |
163 | 8885 //goto _add_action_and_continue_; |
8886 v5 = pActionQueue; | |
8887 v5->Add(partyAction); | |
8888 break; | |
0 | 8889 case INPUT_CenterView: |
17 | 8890 //__debugbreak(); |
0 | 8891 if ( pEventTimer->bPaused ) |
8892 break; | |
8893 partyAction = (PartyAction)9; | |
163 | 8894 //goto _add_action_and_continue_; |
8895 v5 = pActionQueue; | |
8896 v5->Add(partyAction); | |
8897 break; | |
0 | 8898 case INPUT_LookDown: |
17 | 8899 //__debugbreak(); |
0 | 8900 if ( pEventTimer->bPaused ) |
8901 break; | |
8902 partyAction = (PartyAction)8; | |
163 | 8903 //goto _add_action_and_continue_; |
8904 v5 = pActionQueue; | |
8905 v5->Add(partyAction); | |
8906 break; | |
0 | 8907 case INPUT_FlyUp: |
17 | 8908 //__debugbreak(); |
0 | 8909 if ( pCurrentScreen |
8910 || pEventTimer->bPaused ) | |
8911 break; | |
8912 partyAction = (PartyAction)13; | |
163 | 8913 //goto _add_action_and_continue_; |
8914 v5 = pActionQueue; | |
8915 v5->Add(partyAction); | |
8916 break; | |
0 | 8917 case INPUT_Land: |
17 | 8918 //__debugbreak(); |
0 | 8919 if ( pCurrentScreen |
8920 || pEventTimer->bPaused ) | |
8921 break; | |
8922 partyAction = (PartyAction)15; | |
163 | 8923 //goto _add_action_and_continue_; |
8924 v5 = pActionQueue; | |
8925 v5->Add(partyAction); | |
8926 break; | |
0 | 8927 case INPUT_FlyDown: |
17 | 8928 //__debugbreak(); |
0 | 8929 if ( !pCurrentScreen |
8930 && !pEventTimer->bPaused ) | |
8931 { | |
8932 partyAction = (PartyAction)14; | |
163 | 8933 //_add_action_and_continue_: |
0 | 8934 v5 = pActionQueue; |
163 | 8935 //_add_action_and_continue: |
0 | 8936 v5->Add(partyAction); |
8937 } | |
8938 break; | |
8939 case INPUT_ZoomIn: | |
17 | 8940 //__debugbreak(); |
0 | 8941 if ( dword_50C9E8 >= 40 ) |
8942 break; | |
8943 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 8944 //goto LABEL_155; |
437 | 8945 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8946 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 8947 ++dword_50C9E8; |
8948 break; | |
0 | 8949 case INPUT_ZoomOut: |
17 | 8950 //__debugbreak(); |
0 | 8951 if ( dword_50C9E8 < 40 ) |
8952 { | |
8953 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 8954 //LABEL_155: |
437 | 8955 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8956 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 8957 ++dword_50C9E8; |
8958 } | |
8959 break; | |
8960 case INPUT_AlwaysRun: | |
8961 bAlwaysRun = bAlwaysRun == 0; | |
8962 break; | |
17 | 8963 default: |
8964 //__debugbreak(); | |
8965 break; | |
0 | 8966 } |
8967 } | |
8968 inputAction = (InputAction)((int)inputAction + 1); | |
8969 if ( (signed int)inputAction >= 30 ) | |
8970 goto LABEL_176; | |
8971 } | |
8972 } | |
8973 v12 = 0; | |
8974 do | |
8975 { | |
8976 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
8977 v13 = pGame->pKeyboardInstance; | |
8978 if ( pKeyActionMap->pToggleTypes[v12] ) | |
8979 v14 = v13->WasKeyPressed(v22); | |
8980 else | |
8981 v14 = v13->IsKeyBeingHeld(v22); | |
8982 if ( v14 && v12 == 9 ) | |
8983 { | |
8984 if ( !pCurrentScreen ) | |
8985 { | |
437 | 8986 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 8987 goto LABEL_175; |
8988 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 8989 //goto LABEL_174; |
8990 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8991 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 8992 ++pMessageQueue_50CBD0->uNumMessages;*/ |
8993 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
17 | 8994 goto LABEL_175; |
0 | 8995 } |
151 | 8996 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
8997 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 8998 { |
8999 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9000 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9001 { | |
9002 v15 = 0; | |
9003 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9004 { | |
9005 v15 = 1; | |
437 | 9006 pMessageQueue_50CBD0->uNumMessages = 0; |
17 | 9007 //goto LABEL_173; |
437 | 9008 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape; |
17 | 9009 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9010 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9011 ++pMessageQueue_50CBD0->uNumMessages; | |
9012 goto LABEL_175; | |
0 | 9013 } |
9014 pMessageQueue_50CBD0->uNumMessages = 0; | |
9015 } | |
437 | 9016 /*if ( (signed int)v15 >= 40 ) |
0 | 9017 goto LABEL_175; |
17 | 9018 //LABEL_173: |
0 | 9019 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9020 //LABEL_174: |
0 | 9021 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9022 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9023 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9024 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 9025 goto LABEL_175; |
9026 } | |
9027 } | |
9028 LABEL_175: | |
9029 ++v12; | |
9030 } | |
9031 while ( v12 < 30 ); | |
9032 LABEL_176: | |
9033 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9034 { | |
9035 AsyncKeyboard::LeaveCriticalSection(); | |
9036 v16 = pAsyncKeyboard; | |
9037 AsyncKeyboard::EnterCriticalSection(); | |
9038 memset((char *)v16 + 521, 0, 0x100u); | |
9039 AsyncKeyboard::LeaveCriticalSection(); | |
9040 } | |
9041 } | |
9042 |