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