Mercurial > mm7
annotate mm7_6.cpp @ 523:8f7f651311bc
Merge
author | Nomad |
---|---|
date | Sat, 02 Mar 2013 01:32:30 +0200 |
parents | 663c4f618f56 |
children | 5196a51cc9ec |
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 "stru179.h" | |
33 #include "Awards.h" | |
34 #include "Autonotes.h" | |
35 #include "stru160.h" | |
36 #include "stru279.h" | |
37 #include "TurnEngine.h" | |
38 #include "stru277.h" | |
39 #include "Weather.h" | |
40 #include "stru272.h" | |
41 #include "stru298.h" | |
189 | 42 #include "texts.h" |
0 | 43 #include "StorylineTextTable.h" |
44 #include "Events2D.h" | |
370 | 45 #include "Log.h" |
0 | 46 |
47 #include "mm7_data.h" | |
48 | |
49 | |
50 | |
51 //----- (00424EE0) -------------------------------------------------------- | |
52 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
53 { | |
54 unsigned int v1; // edx@1 | |
55 double v2; // st7@1 | |
56 signed int v3; // edi@1 | |
57 char *v4; // esi@4 | |
58 char *v5; // ecx@4 | |
59 unsigned int v6; // eax@4 | |
60 char *v7; // edx@4 | |
61 double v8; // st6@10 | |
62 double v9; // st5@10 | |
63 double v10; // st6@11 | |
64 unsigned __int8 v11; // c2@15 | |
65 unsigned __int8 v12; // c3@15 | |
66 void *v13; // edi@22 | |
67 char *v14; // eax@22 | |
68 double v15; // st6@22 | |
69 char *v16; // ecx@22 | |
70 signed int result; // eax@24 | |
71 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
72 bool v19; // [sp+Ch] [bp-28h]@6 | |
73 char *v20; // [sp+10h] [bp-24h]@4 | |
74 char *v21; // [sp+14h] [bp-20h]@4 | |
75 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
76 char *v23; // [sp+1Ch] [bp-18h]@4 | |
77 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
78 char *v25; // [sp+24h] [bp-10h]@4 | |
79 char *v26; // [sp+28h] [bp-Ch]@4 | |
80 char *v27; // [sp+2Ch] [bp-8h]@4 | |
81 char *v28; // [sp+30h] [bp-4h]@4 | |
82 | |
83 v1 = uVertexID; | |
84 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
85 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
86 v3 = 0; | |
87 v22 = 0; | |
88 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | |
89 v3 = 1; | |
90 if ( (signed int)(uVertexID + 1) <= 1 ) | |
91 return 0; | |
92 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
93 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
94 v6 = v1; | |
95 v23 = (char *)&array_507D30[0].flt_2C; | |
168 | 96 v26 = (char *)&array_507D30[0]._rhw; |
0 | 97 v24 = array_507D30; |
98 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
99 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
100 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
101 v27 = (char *)&array_507D30[0].v; | |
102 v28 = (char *)&array_507D30[0].u; | |
103 v7 = (char *)&array_50AC10[0].v; | |
104 v18 = v6; | |
105 do | |
106 { | |
107 v19 = v2 >= *((float *)v7 + 5); | |
108 if ( v3 != v19 ) | |
109 { | |
110 if ( v19 ) | |
111 { | |
112 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | |
113 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | |
114 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | |
115 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | |
116 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | |
117 } | |
118 else | |
119 { | |
120 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | |
121 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | |
122 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | |
123 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | |
124 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | |
125 } | |
126 *(float *)v27 = v9; | |
127 *(float *)v25 = v2; | |
128 *(float *)v26 = 1.0 / v2; | |
129 if ( v3 ) | |
130 { | |
131 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
132 { | |
133 v11 = 0; | |
134 v12 = *(float *)v4 == *((float *)v7 - 5); | |
135 goto LABEL_19; | |
136 } | |
137 } | |
138 else | |
139 { | |
140 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
141 { | |
142 v11 = 0; | |
143 v12 = *(float *)v4 == *((float *)v7 + 7); | |
144 LABEL_19: | |
145 if ( v12 | v11 ) | |
146 goto LABEL_21; | |
147 goto LABEL_20; | |
148 } | |
149 } | |
150 LABEL_20: | |
151 v26 += 48; | |
152 ++v24; | |
153 v25 += 48; | |
154 v27 += 48; | |
155 v28 += 48; | |
156 v5 += 48; | |
157 v4 += 48; | |
158 ++v22; | |
159 v23 += 48; | |
160 v21 = v5; | |
161 v20 = v4; | |
162 } | |
163 LABEL_21: | |
164 if ( v19 ) | |
165 { | |
166 v13 = v24; | |
167 v14 = v26; | |
168 v21 += 48; | |
169 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
170 v20 += 48; | |
171 ++v22; | |
172 v28 += 48; | |
173 v27 += 48; | |
174 v25 += 48; | |
175 ++v24; | |
176 v26 += 48; | |
177 memcpy(v13, v7 + 8, 0x30u); | |
178 v16 = v23; | |
179 v23 += 48; | |
180 v4 = v20; | |
181 *(float *)v14 = v15; | |
182 *(int *)v16 = *((int *)v7 + 13); | |
183 v5 = v21; | |
184 } | |
185 v3 = v19; | |
186 v7 += 48; | |
187 --v18; | |
188 } | |
189 while ( v18 ); | |
190 result = v22; | |
191 if ( v22 < 3 ) | |
192 return 0; | |
193 return result; | |
194 } | |
195 | |
196 //----- (004250FE) -------------------------------------------------------- | |
197 signed int __fastcall sr_4250FE(unsigned int uVertexID) | |
198 { | |
199 unsigned int v1; // edx@1 | |
200 char *v2; // edi@5 | |
201 char *v3; // esi@5 | |
202 char *v4; // ecx@5 | |
203 int v5; // ebx@6 | |
204 double v6; // st6@11 | |
205 double v7; // st5@11 | |
206 double v8; // st6@12 | |
207 unsigned __int8 v9; // c2@16 | |
208 unsigned __int8 v10; // c3@16 | |
209 void *v11; // edi@23 | |
210 double v12; // st6@23 | |
211 char *v13; // ecx@23 | |
212 char v14; // zf@24 | |
213 signed int result; // eax@25 | |
214 unsigned int v16; // [sp+8h] [bp-28h]@5 | |
215 bool v17; // [sp+Ch] [bp-24h]@2 | |
216 bool v18; // [sp+10h] [bp-20h]@7 | |
217 char *v19; // [sp+14h] [bp-1Ch]@5 | |
218 char *v20; // [sp+18h] [bp-18h]@5 | |
219 signed int v21; // [sp+1Ch] [bp-14h]@1 | |
220 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5 | |
221 char *v23; // [sp+24h] [bp-Ch]@5 | |
222 char *v24; // [sp+28h] [bp-8h]@5 | |
223 char *v25; // [sp+2Ch] [bp-4h]@5 | |
224 | |
225 v1 = uVertexID; | |
226 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
227 v21 = 0; | |
228 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0; | |
229 if ( (signed int)(uVertexID + 1) <= 1 ) | |
230 return 0; | |
231 v2 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
232 v3 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 233 v24 = (char *)&array_507D30[0]._rhw; |
0 | 234 v22 = array_507D30; |
235 v19 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
236 v20 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
237 v23 = (char *)&array_507D30[0].vWorldViewPosition; | |
238 v25 = (char *)&array_507D30[0].flt_2C; | |
239 v4 = (char *)&array_50AC10[0].vWorldViewPosition; | |
240 v16 = v1; | |
241 do | |
242 { | |
243 v5 = (int)(v4 + 48); | |
244 v18 = *((float *)v4 + 12) >= 8.0; | |
245 if ( v17 != v18 ) | |
246 { | |
247 if ( v18 ) | |
248 { | |
249 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4); | |
250 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1); | |
251 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2); | |
252 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8); | |
253 } | |
254 else | |
255 { | |
256 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5); | |
257 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13); | |
258 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14); | |
259 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20); | |
260 } | |
261 *(float *)v25 = v7; | |
262 *(float *)v23 = 8.0; | |
263 *(int *)v24 = 0x3E000000u; | |
264 if ( v17 ) | |
265 { | |
266 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) ) | |
267 { | |
268 v9 = 0; | |
269 v10 = *(float *)v2 == *((float *)v4 + 2); | |
270 goto LABEL_20; | |
271 } | |
272 } | |
273 else | |
274 { | |
275 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) ) | |
276 { | |
277 v9 = 0; | |
278 v10 = *(float *)v2 == *((float *)v4 + 14); | |
279 LABEL_20: | |
280 if ( v10 | v9 ) | |
281 goto LABEL_22; | |
282 goto LABEL_21; | |
283 } | |
284 } | |
285 LABEL_21: | |
286 ++v22; | |
287 v23 += 48; | |
288 v25 += 48; | |
289 v3 += 48; | |
290 v2 += 48; | |
291 ++v21; | |
292 v24 += 48; | |
293 v20 = v3; | |
294 v19 = v2; | |
295 } | |
296 LABEL_22: | |
297 if ( v18 ) | |
298 { | |
299 v11 = v22; | |
300 v20 += 48; | |
301 v19 += 48; | |
302 v12 = 1.0 / (*(float *)v5 + 0.0000001); | |
303 ++v21; | |
304 v25 += 48; | |
305 v23 += 48; | |
306 ++v22; | |
307 memcpy(v11, v4 + 36, 0x30u); | |
308 v13 = v24; | |
309 v24 += 48; | |
310 v3 = v20; | |
311 v2 = v19; | |
312 *(float *)v13 = v12; | |
313 } | |
314 v14 = v16-- == 1; | |
315 v17 = v18; | |
316 v4 = (char *)v5; | |
317 } | |
318 while ( !v14 ); | |
319 result = v21; | |
320 if ( v21 < 3 ) | |
321 return 0; | |
322 return result; | |
323 } | |
324 | |
325 //----- (004252E8) -------------------------------------------------------- | |
326 signed int __fastcall sr_4252E8(unsigned int uVertexID) | |
327 { | |
328 unsigned int v1; // edx@1 | |
329 double v2; // st7@1 | |
330 char *v3; // edi@5 | |
331 char *v4; // esi@5 | |
332 char *v5; // ecx@5 | |
333 int v6; // ebx@6 | |
334 double v7; // st6@11 | |
335 double v8; // st5@11 | |
336 double v9; // st6@12 | |
337 unsigned __int8 v10; // c2@16 | |
338 unsigned __int8 v11; // c3@16 | |
339 void *v12; // edi@23 | |
340 double v13; // st6@23 | |
341 char *v14; // ecx@23 | |
342 char v15; // zf@24 | |
343 signed int result; // eax@25 | |
344 unsigned int v17; // [sp+8h] [bp-28h]@5 | |
345 bool v18; // [sp+Ch] [bp-24h]@2 | |
346 bool v19; // [sp+10h] [bp-20h]@7 | |
347 char *v20; // [sp+14h] [bp-1Ch]@5 | |
348 char *v21; // [sp+18h] [bp-18h]@5 | |
349 signed int v22; // [sp+1Ch] [bp-14h]@1 | |
350 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5 | |
351 char *v24; // [sp+24h] [bp-Ch]@5 | |
352 char *v25; // [sp+28h] [bp-8h]@5 | |
353 char *v26; // [sp+2Ch] [bp-4h]@5 | |
354 | |
355 v1 = uVertexID; | |
356 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
357 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
358 v22 = 0; | |
359 v18 = array_50AC10[0].vWorldViewPosition.x <= v2; | |
360 if ( (signed int)(uVertexID + 1) <= 1 ) | |
361 return 0; | |
362 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
363 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 364 v25 = (char *)&array_507D30[0]._rhw; |
0 | 365 v23 = array_507D30; |
366 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
367 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
368 v24 = (char *)&array_507D30[0].vWorldViewPosition; | |
369 v26 = (char *)&array_507D30[0].flt_2C; | |
370 v5 = (char *)&array_50AC10[0].vWorldViewPosition; | |
371 v17 = v1; | |
372 do | |
373 { | |
374 v6 = (int)(v5 + 48); | |
375 v19 = v2 >= *((float *)v5 + 12); | |
376 if ( v18 != v19 ) | |
377 { | |
378 if ( v19 ) | |
379 { | |
380 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5); | |
381 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1); | |
382 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2); | |
383 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8); | |
384 } | |
385 else | |
386 { | |
387 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6); | |
388 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13); | |
389 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14); | |
390 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20); | |
391 } | |
392 *(float *)v26 = v8; | |
393 *(float *)v24 = v2; | |
394 *(float *)v25 = 1.0 / v2; | |
395 if ( v18 ) | |
396 { | |
397 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) ) | |
398 { | |
399 v10 = 0; | |
400 v11 = *(float *)v3 == *((float *)v5 + 2); | |
401 goto LABEL_20; | |
402 } | |
403 } | |
404 else | |
405 { | |
406 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) ) | |
407 { | |
408 v10 = 0; | |
409 v11 = *(float *)v3 == *((float *)v5 + 14); | |
410 LABEL_20: | |
411 if ( v11 | v10 ) | |
412 goto LABEL_22; | |
413 goto LABEL_21; | |
414 } | |
415 } | |
416 LABEL_21: | |
417 ++v23; | |
418 v24 += 48; | |
419 v26 += 48; | |
420 v4 += 48; | |
421 v3 += 48; | |
422 ++v22; | |
423 v25 += 48; | |
424 v21 = v4; | |
425 v20 = v3; | |
426 } | |
427 LABEL_22: | |
428 if ( v19 ) | |
429 { | |
430 v12 = v23; | |
431 v21 += 48; | |
432 v20 += 48; | |
433 v13 = 1.0 / (*(float *)v6 + 0.0000001); | |
434 ++v22; | |
435 v26 += 48; | |
436 v24 += 48; | |
437 ++v23; | |
438 memcpy(v12, v5 + 36, 0x30u); | |
439 v14 = v25; | |
440 v25 += 48; | |
441 v4 = v21; | |
442 v3 = v20; | |
443 *(float *)v14 = v13; | |
444 } | |
445 v15 = v17-- == 1; | |
446 v18 = v19; | |
447 v5 = (char *)v6; | |
448 } | |
449 while ( !v15 ); | |
450 result = v22; | |
451 if ( v22 < 3 ) | |
452 return 0; | |
453 return result; | |
454 } | |
455 | |
456 | |
457 | |
458 //----- (004361EF) -------------------------------------------------------- | |
459 IndoorCameraD3D::IndoorCameraD3D() | |
460 { | |
461 IndoorCameraD3D *v1; // esi@1 | |
462 double v2; // st7@1 | |
463 double v3; // st6@1 | |
464 double v4; // st5@1 | |
465 double v5; // st7@1 | |
466 double v6; // st6@1 | |
467 double v7; // st5@1 | |
468 | |
469 v1 = this; | |
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4); | |
471 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14); | |
472 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24); | |
473 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, | |
474 24, | |
475 6, | |
476 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
477 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ | |
478 v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
479 v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
480 v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; | |
481 v1->field_108 = 0.0; | |
482 v1->field_DC = v4; | |
483 v1->field_E0 = v3; | |
484 v1->field_E4 = v2; | |
485 v5 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
486 v6 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
487 v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300); | |
488 v1->field_138 = 0.0; | |
489 v1->field_10C = v7; | |
490 v1->field_110 = v6; | |
491 v1->field_114 = v5; | |
492 v1->field_168 = 0.0; | |
493 v1->field_198 = 0.0; | |
494 v1->field_1C8 = 0.0; | |
495 v1->field_1F8 = 0.0; | |
496 v1->field_228 = 0.0; | |
497 v1->field_258 = 0.0; | |
498 v1->field_288 = 0.0; | |
499 v1->field_2B8 = 0.0; | |
500 v1->field_2E8 = 0.0; | |
501 v1->field_2BC = 0.0; | |
502 v1->field_2C0 = 0.0; | |
503 v1->field_2C4 = 0.0; | |
504 v1->field_318 = 0.0; | |
505 v1->field_2EC = 0.0; | |
506 v1->field_2F0 = 0.0; | |
507 v1->field_2F4 = 0.0; | |
508 v1->field_348 = 0.0; | |
509 v1->field_31C = 0.0; | |
510 v1->field_320 = 0.0; | |
511 v1->field_324 = 0.0; | |
512 v1->field_378 = 0.0; | |
513 v1->field_34C = 0.0; | |
514 v1->field_350 = 0.0; | |
515 v1->field_354 = 0.0; | |
516 for (uint i = 0; i < 16384; ++i) | |
517 { | |
518 list_0037C[i].field_0 = 0; | |
519 list_0037C[i].flt_30 = 0.0f; | |
520 } | |
521 | |
522 list_0037C_size = 0; | |
523 for (uint i = 0; i < 256; ++i) | |
524 list_E0380[i].mm7__vector_000004_size = 0; | |
525 /*v10 = v1->list_E0380; | |
526 v12 = 256; | |
527 do | |
528 { | |
529 v10->mm7__vector_000004_size = 0; | |
530 //mm7__vector_constructor( | |
531 // v10->mm7__vector_000004, | |
532 // 48, | |
533 // 64, | |
534 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); | |
535 //++v10; | |
536 --v12; | |
537 } | |
538 while ( v12 );*/ | |
539 list_E0380_size = 0; | |
540 //v1->vdestructor_ptr = &stru8_pvdtor; | |
541 } | |
542 | |
543 | |
544 //----- (004254D2) -------------------------------------------------------- | |
545 int __fastcall sr_4254D2(signed int a1) | |
546 { | |
547 signed int v1; // ebx@2 | |
548 int v2; // ecx@2 | |
549 int result; // eax@11 | |
550 double v4; // ST74_8@12 | |
551 bool v5; // edi@12 | |
552 char *v6; // esi@13 | |
553 char *v7; // ebx@13 | |
554 double v8; // st7@15 | |
555 double v9; // st7@16 | |
556 double v10; // st6@16 | |
557 double v11; // st7@17 | |
558 float v12; // eax@18 | |
559 double v13; // ST4C_8@19 | |
560 double v14; // ST10_8@19 | |
561 double v15; // ST28_8@20 | |
562 double v16; // ST34_8@20 | |
563 char v17; // zf@20 | |
564 double v18; // ST18_8@21 | |
565 double v19; // ST3C_8@21 | |
566 double v20; // ST44_8@22 | |
567 double v21; // ST54_8@22 | |
568 void *v22; // edi@26 | |
569 double v23; // ST54_8@29 | |
570 bool v24; // esi@29 | |
571 char *v25; // edi@30 | |
572 char *v26; // ebx@30 | |
573 bool v27; // ecx@32 | |
574 double v28; // st7@33 | |
575 double v29; // st7@34 | |
576 double v30; // st6@34 | |
577 double v31; // st7@35 | |
578 double v32; // ST44_8@37 | |
579 double v33; // ST3C_8@37 | |
580 double v34; // ST18_8@38 | |
581 double v35; // ST34_8@38 | |
582 char v36; // zf@38 | |
583 double v37; // ST28_8@39 | |
584 double v38; // ST10_8@39 | |
585 double v39; // ST20_8@40 | |
586 double v40; // ST5C_8@40 | |
587 void *v41; // edi@44 | |
588 double v42; // ST5C_8@47 | |
589 bool v43; // edi@47 | |
590 char *v44; // esi@48 | |
591 char *v45; // ebx@48 | |
592 bool v46; // ecx@49 | |
593 double v47; // st6@50 | |
594 double v48; // st6@51 | |
595 double v49; // st5@51 | |
596 double v50; // st6@52 | |
597 double v51; // ST20_8@54 | |
598 double v52; // ST54_8@54 | |
599 double v53; // ST44_8@55 | |
600 double v54; // ST3C_8@55 | |
601 char v55; // zf@55 | |
602 double v56; // ST18_8@56 | |
603 double v57; // ST34_8@56 | |
604 double v58; // ST28_8@57 | |
605 double v59; // ST10_8@57 | |
606 void *v60; // edi@61 | |
607 double v61; // ST5C_8@64 | |
608 bool v62; // edi@64 | |
609 char *v63; // esi@65 | |
610 char *v64; // ebx@65 | |
611 bool v65; // ecx@66 | |
612 double v66; // st6@67 | |
613 double v67; // st6@68 | |
614 double v68; // st5@68 | |
615 double v69; // st6@69 | |
616 double v70; // ST20_8@71 | |
617 double v71; // ST54_8@71 | |
618 double v72; // ST44_8@72 | |
619 double v73; // ST3C_8@72 | |
620 char v74; // zf@72 | |
621 double v75; // ST18_8@73 | |
622 double v76; // ST34_8@73 | |
623 double v77; // ST28_8@74 | |
624 double v78; // ST10_8@74 | |
625 void *v79; // edi@78 | |
626 int v80; // ebx@81 | |
627 char *v81; // ecx@82 | |
628 signed int v82; // esi@82 | |
629 float v83; // ST78_4@83 | |
630 double v84; // ST5C_8@83 | |
631 float v85; // eax@84 | |
632 double v86; // ST20_8@85 | |
633 double v87; // ST54_8@88 | |
634 float v88; // eax@89 | |
635 double v89; // ST44_8@90 | |
636 unsigned __int8 v90; // sf@94 | |
637 unsigned __int8 v91; // of@94 | |
638 int v92; // edx@97 | |
639 int v93; // esi@97 | |
640 int v94; // edi@97 | |
641 int v95; // eax@97 | |
642 int v96; // eax@104 | |
643 double v97; // [sp+4Ch] [bp-8Ch]@32 | |
644 double v98; // [sp+54h] [bp-84h]@49 | |
645 double v99; // [sp+54h] [bp-84h]@66 | |
646 float v100; // [sp+5Ch] [bp-7Ch]@1 | |
647 float v101; // [sp+60h] [bp-78h]@1 | |
648 float v102; // [sp+64h] [bp-74h]@1 | |
649 double v103; // [sp+6Ch] [bp-6Ch]@14 | |
650 float v104; // [sp+A8h] [bp-30h]@1 | |
651 signed int v105; // [sp+A8h] [bp-30h]@96 | |
652 bool v106; // [sp+ACh] [bp-2Ch]@14 | |
653 bool v107; // [sp+ACh] [bp-2Ch]@32 | |
654 bool v108; // [sp+ACh] [bp-2Ch]@49 | |
655 bool v109; // [sp+ACh] [bp-2Ch]@66 | |
656 signed int v110; // [sp+B0h] [bp-28h]@12 | |
657 char *v111; // [sp+B8h] [bp-20h]@30 | |
658 signed int v112; // [sp+B8h] [bp-20h]@48 | |
659 signed int v113; // [sp+B8h] [bp-20h]@65 | |
660 char *v114; // [sp+BCh] [bp-1Ch]@13 | |
661 signed int v115; // [sp+BCh] [bp-1Ch]@29 | |
662 signed int v116; // [sp+BCh] [bp-1Ch]@64 | |
663 signed int v117; // [sp+C0h] [bp-18h]@1 | |
664 char *v118; // [sp+C0h] [bp-18h]@30 | |
665 char *v119; // [sp+C0h] [bp-18h]@48 | |
666 char *v120; // [sp+C0h] [bp-18h]@65 | |
667 char *v121; // [sp+C4h] [bp-14h]@13 | |
668 char *v122; // [sp+C4h] [bp-14h]@30 | |
669 signed int v123; // [sp+C4h] [bp-14h]@47 | |
670 char *v124; // [sp+C8h] [bp-10h]@30 | |
671 char *v125; // [sp+C8h] [bp-10h]@48 | |
672 char *v126; // [sp+C8h] [bp-10h]@65 | |
673 signed int v127; // [sp+CCh] [bp-Ch]@2 | |
674 char *v128; // [sp+CCh] [bp-Ch]@13 | |
675 char *v129; // [sp+CCh] [bp-Ch]@30 | |
676 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48 | |
677 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65 | |
678 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13 | |
679 char *v133; // [sp+D0h] [bp-8h]@30 | |
680 char *v134; // [sp+D0h] [bp-8h]@48 | |
681 char *v135; // [sp+D0h] [bp-8h]@65 | |
682 signed int v136; // [sp+D4h] [bp-4h]@1 | |
683 char *v137; // [sp+D4h] [bp-4h]@13 | |
684 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30 | |
685 char *v139; // [sp+D4h] [bp-4h]@48 | |
686 char *v140; // [sp+D4h] [bp-4h]@65 | |
687 | |
688 v101 = (double)(signed int)pViewport->uViewportX; | |
689 v100 = (double)(signed int)pViewport->uViewportZ; | |
690 v117 = a1; | |
691 v136 = 1; | |
692 v104 = (double)(signed int)pViewport->uViewportY; | |
693 v102 = (double)(pViewport->uViewportW + 1); | |
694 if ( a1 <= 0 ) | |
695 return v117; | |
696 v127 = a1; | |
697 v1 = a1; | |
698 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2)); | |
699 v2 = 0; | |
700 do | |
701 { | |
702 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 ) | |
703 v136 = 0; | |
704 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 ) | |
705 v136 = 0; | |
706 ++v2; | |
707 --v127; | |
708 } | |
709 while ( v127 ); | |
710 if ( v136 ) | |
711 return v117; | |
712 v110 = 0; | |
713 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1])); | |
714 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15; | |
715 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportX; | |
716 if ( v117 < 1 ) | |
717 goto LABEL_112; | |
718 v6 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
719 v132 = array_50A2B0; | |
720 v137 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
721 v128 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
722 v121 = (char *)&array_50A2B0[0].flt_2C; | |
168 | 723 v114 = (char *)&array_50A2B0[0]._rhw; |
0 | 724 v7 = (char *)&array_50AC10[0].flt_2C; |
725 do | |
726 { | |
727 v103 = *((float *)v7 + 7) + 6.7553994e15; | |
728 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportX; | |
729 if ( !(v5 ^ v106) ) | |
730 goto LABEL_25; | |
731 v8 = v101; | |
732 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportX ) | |
733 { | |
734 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5)); | |
735 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4); | |
736 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3); | |
737 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7; | |
738 } | |
739 else | |
740 { | |
741 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7)); | |
742 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8); | |
743 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9); | |
744 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12); | |
745 } | |
746 *(float *)v121 = v10; | |
747 *(int *)v137 = LODWORD(v101); | |
748 LODWORD(v12) = *(int *)v6; | |
749 if ( v5 ) | |
750 { | |
751 v13 = v12 + 6.7553994e15; | |
752 v14 = *((float *)v7 - 4) + 6.7553994e15; | |
753 if ( LODWORD(v13) == LODWORD(v14) ) | |
754 { | |
755 v15 = *(float *)v137 + 6.7553994e15; | |
756 v16 = *((float *)v7 - 5) + 6.7553994e15; | |
757 v17 = LODWORD(v15) == LODWORD(v16); | |
758 goto LABEL_23; | |
759 } | |
760 } | |
761 else | |
762 { | |
763 v18 = v12 + 6.7553994e15; | |
764 v19 = *((float *)v7 + 8) + 6.7553994e15; | |
765 if ( LODWORD(v18) == LODWORD(v19) ) | |
766 { | |
767 v20 = *(float *)v137 + 6.7553994e15; | |
768 v21 = *((float *)v7 + 7) + 6.7553994e15; | |
769 v17 = LODWORD(v20) == LODWORD(v21); | |
770 LABEL_23: | |
771 if ( v17 ) | |
772 goto LABEL_25; | |
773 goto LABEL_24; | |
774 } | |
775 } | |
776 LABEL_24: | |
777 v121 += 48; | |
778 v114 += 48; | |
779 v6 += 48; | |
780 ++v110; | |
781 ++v132; | |
782 v128 = v6; | |
783 v137 += 48; | |
784 LABEL_25: | |
785 if ( v106 ) | |
786 { | |
787 v22 = v132; | |
788 v128 += 48; | |
789 ++v110; | |
790 v114 += 48; | |
791 v121 += 48; | |
792 v137 += 48; | |
793 ++v132; | |
794 memcpy(v22, v7 + 4, 0x30u); | |
795 v6 = v128; | |
796 } | |
797 v5 = v106; | |
798 v7 += 48; | |
799 --v117; | |
800 } | |
801 while ( v117 ); | |
802 if ( v110 < 3 | |
803 || (v115 = 0, | |
804 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])), | |
805 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15, | |
806 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportZ, | |
807 v110 < 1) ) | |
808 goto LABEL_112; | |
168 | 809 v25 = (char *)&array_509950[0]._rhw; |
0 | 810 v138 = array_509950; |
811 v129 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
812 v118 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
813 v133 = (char *)&array_509950[0].vWorldViewProjX; | |
814 v122 = (char *)&array_509950[0].vWorldViewProjY; | |
815 v124 = (char *)&array_509950[0].flt_2C; | |
168 | 816 v111 = (char *)&array_509950[0]._rhw; |
0 | 817 v26 = (char *)&array_50A2B0[0].flt_2C; |
818 while ( 2 ) | |
819 { | |
820 v97 = *((float *)v26 + 7) + 6.7553994e15; | |
821 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
822 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ; | |
823 if ( v24 != v27 ) | |
824 { | |
825 v28 = v100; | |
826 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportZ ) | |
827 { | |
828 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5)); | |
829 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4); | |
830 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3); | |
831 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26; | |
832 } | |
833 else | |
834 { | |
835 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7)); | |
836 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8); | |
837 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9); | |
838 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12); | |
839 } | |
840 *(float *)v124 = v30; | |
841 *(int *)v133 = LODWORD(v100); | |
842 if ( v24 ) | |
843 { | |
844 v32 = *(float *)v122 + 6.7553994e15; | |
845 v33 = *((float *)v26 - 4) + 6.7553994e15; | |
846 if ( LODWORD(v32) == LODWORD(v33) ) | |
847 { | |
848 v34 = *(float *)v133 + 6.7553994e15; | |
849 v35 = *((float *)v26 - 5) + 6.7553994e15; | |
850 v36 = LODWORD(v34) == LODWORD(v35); | |
851 goto LABEL_41; | |
852 } | |
853 goto LABEL_42; | |
854 } | |
855 v37 = *(float *)v118 + 6.7553994e15; | |
856 v38 = *((float *)v26 + 8) + 6.7553994e15; | |
857 if ( LODWORD(v37) != LODWORD(v38) ) | |
858 goto LABEL_42; | |
859 v39 = *(float *)v129 + 6.7553994e15; | |
860 v40 = *((float *)v26 + 7) + 6.7553994e15; | |
861 v36 = LODWORD(v39) == LODWORD(v40); | |
862 LABEL_41: | |
863 if ( !v36 ) | |
864 { | |
865 LABEL_42: | |
866 v129 += 48; | |
867 v118 += 48; | |
868 v133 += 48; | |
869 v122 += 48; | |
870 v124 += 48; | |
871 v111 += 48; | |
872 ++v115; | |
873 ++v138; | |
874 } | |
875 } | |
876 if ( v27 ) | |
877 { | |
878 v41 = v138; | |
879 ++v115; | |
880 v111 += 48; | |
881 v124 += 48; | |
882 v122 += 48; | |
883 v133 += 48; | |
884 v118 += 48; | |
885 v129 += 48; | |
886 ++v138; | |
887 memcpy(v41, v26 + 4, 0x30u); | |
888 } | |
889 v24 = v107; | |
890 v26 += 48; | |
891 --v110; | |
892 if ( v110 ) | |
893 { | |
894 v25 = v111; | |
895 continue; | |
896 } | |
897 break; | |
898 } | |
899 if ( v115 < 3 | |
900 || (v123 = 0, | |
901 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])), | |
902 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15, | |
903 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportY, | |
904 v115 < 1) ) | |
905 goto LABEL_112; | |
906 v44 = (char *)&array_508FF0[0].vWorldViewProjX; | |
907 v130 = array_508FF0; | |
908 v119 = (char *)&array_508FF0[0].vWorldViewProjX; | |
909 v139 = (char *)&array_508FF0[0].vWorldViewProjY; | |
910 v125 = (char *)&array_508FF0[0].flt_2C; | |
168 | 911 v134 = (char *)&array_508FF0[0]._rhw; |
0 | 912 v45 = (char *)&array_509950[0].flt_2C; |
913 v112 = v115; | |
914 while ( 2 ) | |
915 { | |
916 v98 = *((float *)v45 + 8) + 6.7553994e15; | |
917 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
918 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportY; | |
919 if ( v43 != v46 ) | |
920 { | |
921 v47 = v104; | |
922 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportY ) | |
923 { | |
924 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4)); | |
925 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5); | |
926 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3); | |
927 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45; | |
928 } | |
929 else | |
930 { | |
931 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8)); | |
932 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7); | |
933 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9); | |
934 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12); | |
935 } | |
936 *(float *)v125 = v49; | |
937 *(float *)v139 = v104; | |
938 if ( v43 ) | |
939 { | |
940 v51 = v104 + 6.7553994e15; | |
941 v52 = *((float *)v45 - 4) + 6.7553994e15; | |
942 if ( LODWORD(v51) == LODWORD(v52) ) | |
943 { | |
944 v53 = *(float *)v44 + 6.7553994e15; | |
945 v54 = *((float *)v45 - 5) + 6.7553994e15; | |
946 v55 = LODWORD(v53) == LODWORD(v54); | |
947 goto LABEL_58; | |
948 } | |
949 goto LABEL_59; | |
950 } | |
951 v56 = v104 + 6.7553994e15; | |
952 v57 = *((float *)v45 + 8) + 6.7553994e15; | |
953 if ( LODWORD(v56) != LODWORD(v57) ) | |
954 goto LABEL_59; | |
955 v58 = *(float *)v44 + 6.7553994e15; | |
956 v59 = *((float *)v45 + 7) + 6.7553994e15; | |
957 v55 = LODWORD(v58) == LODWORD(v59); | |
958 LABEL_58: | |
959 if ( !v55 ) | |
960 { | |
961 LABEL_59: | |
962 v139 += 48; | |
963 v125 += 48; | |
964 v134 += 48; | |
965 v44 += 48; | |
966 ++v123; | |
967 ++v130; | |
968 v119 = v44; | |
969 } | |
970 } | |
971 if ( v46 ) | |
972 { | |
973 v60 = v130; | |
974 v119 += 48; | |
975 ++v123; | |
976 v134 += 48; | |
977 v125 += 48; | |
978 v139 += 48; | |
979 ++v130; | |
980 memcpy(v60, v45 + 4, 0x30u); | |
981 v44 = v119; | |
982 } | |
983 v43 = v108; | |
984 v45 += 48; | |
985 --v112; | |
986 if ( v112 ) | |
987 continue; | |
988 break; | |
989 } | |
990 if ( v123 < 3 | |
991 || (v116 = 0, | |
992 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])), | |
993 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15, | |
994 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportW, | |
995 v123 < 1) ) | |
996 goto LABEL_112; | |
997 v63 = (char *)&array_508690[0].vWorldViewProjX; | |
998 v131 = array_508690; | |
999 v120 = (char *)&array_508690[0].vWorldViewProjX; | |
1000 v140 = (char *)&array_508690[0].vWorldViewProjY; | |
1001 v126 = (char *)&array_508690[0].flt_2C; | |
168 | 1002 v135 = (char *)&array_508690[0]._rhw; |
0 | 1003 v64 = (char *)&array_508FF0[0].flt_2C; |
1004 v113 = v123; | |
1005 while ( 2 ) | |
1006 { | |
1007 v99 = *((float *)v64 + 8) + 6.7553994e15; | |
1008 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1009 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportW; | |
1010 if ( v62 != v65 ) | |
1011 { | |
1012 v66 = v102; | |
1013 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportW ) | |
1014 { | |
1015 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4)); | |
1016 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5); | |
1017 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3); | |
1018 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64; | |
1019 } | |
1020 else | |
1021 { | |
1022 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8)); | |
1023 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7); | |
1024 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9); | |
1025 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12); | |
1026 } | |
1027 *(float *)v126 = v68; | |
1028 *(float *)v140 = v102; | |
1029 if ( v62 ) | |
1030 { | |
1031 v70 = v102 + 6.7553994e15; | |
1032 v71 = *((float *)v64 - 4) + 6.7553994e15; | |
1033 if ( LODWORD(v70) == LODWORD(v71) ) | |
1034 { | |
1035 v72 = *(float *)v63 + 6.7553994e15; | |
1036 v73 = *((float *)v64 - 5) + 6.7553994e15; | |
1037 v74 = LODWORD(v72) == LODWORD(v73); | |
1038 goto LABEL_75; | |
1039 } | |
1040 goto LABEL_76; | |
1041 } | |
1042 v75 = v102 + 6.7553994e15; | |
1043 v76 = *((float *)v64 + 8) + 6.7553994e15; | |
1044 if ( LODWORD(v75) != LODWORD(v76) ) | |
1045 goto LABEL_76; | |
1046 v77 = *(float *)v63 + 6.7553994e15; | |
1047 v78 = *((float *)v64 + 7) + 6.7553994e15; | |
1048 v74 = LODWORD(v77) == LODWORD(v78); | |
1049 LABEL_75: | |
1050 if ( !v74 ) | |
1051 { | |
1052 LABEL_76: | |
1053 v140 += 48; | |
1054 v126 += 48; | |
1055 v135 += 48; | |
1056 v63 += 48; | |
1057 ++v116; | |
1058 ++v131; | |
1059 v120 = v63; | |
1060 } | |
1061 } | |
1062 if ( v65 ) | |
1063 { | |
1064 v79 = v131; | |
1065 v120 += 48; | |
1066 ++v116; | |
1067 v135 += 48; | |
1068 v126 += 48; | |
1069 v140 += 48; | |
1070 ++v131; | |
1071 memcpy(v79, v64 + 4, 0x30u); | |
1072 v63 = v120; | |
1073 } | |
1074 v62 = v109; | |
1075 v64 += 48; | |
1076 --v113; | |
1077 if ( v113 ) | |
1078 continue; | |
1079 break; | |
1080 } | |
1081 if ( v116 < 3 ) | |
1082 goto LABEL_112; | |
1083 v80 = v116; | |
1084 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116])); | |
1085 if ( v116 > 0 ) | |
1086 { | |
1087 v81 = (char *)&array_508690[0].vWorldViewProjX; | |
1088 v82 = v116; | |
1089 do | |
1090 { | |
1091 LODWORD(v83) = *(int *)v81; | |
1092 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2); | |
1093 v84 = v83 + 6.7553994e15; | |
1094 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportZ ) | |
1095 { | |
1096 v86 = *(float *)v81 + 6.7553994e15; | |
1097 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportX ) | |
1098 goto LABEL_88; | |
1099 v85 = v101; | |
1100 } | |
1101 else | |
1102 { | |
1103 v85 = v100; | |
1104 } | |
1105 *(int *)v81 = LODWORD(v85); | |
1106 LABEL_88: | |
1107 v87 = *((float *)v81 + 1) + 6.7553994e15; | |
1108 if ( SLODWORD(v87) > (signed int)pViewport->uViewportW ) | |
1109 { | |
1110 v88 = v102; | |
1111 LABEL_92: | |
1112 *((int *)v81 + 1) = LODWORD(v88); | |
1113 goto LABEL_93; | |
1114 } | |
1115 v89 = *((float *)v81 + 1) + 6.7553994e15; | |
1116 if ( SLODWORD(v89) < (signed int)pViewport->uViewportY ) | |
1117 { | |
1118 v88 = v104; | |
1119 goto LABEL_92; | |
1120 } | |
1121 LABEL_93: | |
1122 v81 += 48; | |
1123 --v82; | |
1124 } | |
1125 while ( v82 ); | |
1126 } | |
1127 v91 = __OFSUB__(v116, 3); | |
1128 v90 = v116 - 3 < 0; | |
1129 if ( v116 > 3 ) | |
1130 { | |
1131 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1])); | |
1132 if ( v116 > 0 ) | |
1133 { | |
1134 v105 = 1; | |
1135 do | |
1136 { | |
1137 v92 = v105; | |
1138 v93 = v105 - 1; | |
1139 v94 = v105 + 1; | |
1140 v95 = v105 + 1; | |
1141 if ( v105 - 1 >= v80 ) | |
1142 v93 -= v80; | |
1143 if ( v105 >= v80 ) | |
1144 v92 = v105 - v80; | |
1145 if ( v94 >= v80 ) | |
1146 v95 = v94 - v80; | |
1147 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1148 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY) | |
1149 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1150 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 ) | |
1151 { | |
1152 ++v105; | |
1153 } | |
1154 else | |
1155 { | |
1156 v96 = v105; | |
1157 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) ) | |
1158 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2)); | |
1159 --v80; | |
1160 } | |
1161 } | |
1162 while ( v105 - 1 < v80 ); | |
1163 } | |
1164 v91 = __OFSUB__(v80, 3); | |
1165 v90 = v80 - 3 < 0; | |
1166 } | |
1167 if ( v90 ^ v91 ) | |
1168 LABEL_112: | |
1169 result = 0; | |
1170 else | |
1171 result = v80; | |
1172 return result; | |
1173 } | |
1174 | |
1175 //----- (0042620A) -------------------------------------------------------- | |
1176 bool __thiscall sr_42620A(RenderVertexSoft *p) | |
1177 { | |
1178 __int16 v1; // fps@1 | |
1179 unsigned __int8 v2; // c0@2 | |
1180 char v3; // c2@2 | |
1181 unsigned __int8 v4; // c3@2 | |
1182 bool result; // eax@2 | |
1183 unsigned __int8 v6; // c0@4 | |
1184 char v7; // c2@4 | |
1185 unsigned __int8 v8; // c3@4 | |
1186 unsigned __int8 v9; // c0@6 | |
1187 char v10; // c2@6 | |
1188 unsigned __int8 v11; // c3@6 | |
1189 double v12; // st6@7 | |
1190 float v13; // ST04_4@7 | |
1191 float v14; // ST00_4@7 | |
1192 double v15; // st7@7 | |
1193 double v16; // st6@8 | |
1194 float v17; // ST04_4@8 | |
1195 float v18; // ST00_4@8 | |
1196 double v19; // st7@8 | |
1197 | |
1198 //UNDEF(v1); | |
1199 if ( p->vWorldViewPosition.x < 300.0 | |
1200 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
1201 v3 = 0, | |
1202 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
1203 BYTE1(result) = HIBYTE(v1), | |
1204 !(v2 | v4)) ) | |
1205 { | |
1206 if ( p->vWorldViewPosition.x < 300.0 ) | |
1207 { | |
1208 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
1209 v7 = 0; | |
1210 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
1211 BYTE1(result) = HIBYTE(v1); | |
1212 if ( !(v6 | v8) ) | |
1213 { | |
1214 LOBYTE(result) = 0; | |
1215 return result; | |
1216 } | |
1217 } | |
1218 v9 = 300.0 < p->vWorldViewPosition.x; | |
1219 v10 = 0; | |
1220 v11 = 300.0 == p->vWorldViewPosition.x; | |
1221 BYTE1(result) = HIBYTE(v1); | |
1222 if ( v9 | v11 ) | |
1223 { | |
1224 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
1225 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
1226 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
1227 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
1228 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
1229 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
1230 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
1231 } | |
1232 else | |
1233 { | |
1234 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
1235 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
1236 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
1237 v15 = 300.0 - p->vWorldViewPosition.x; | |
1238 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
1239 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
1240 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
1241 } | |
1242 } | |
1243 LOBYTE(result) = 1; | |
1244 return result; | |
1245 } | |
1246 | |
1247 | |
1248 | |
1249 | |
1250 //----- (004268E3) -------------------------------------------------------- | |
1251 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) | |
1252 { | |
1253 unsigned int v1; // eax@1 | |
1254 unsigned int v2; // edx@1 | |
1255 int v3; // eax@1 | |
1256 int v4; // edx@1 | |
1257 unsigned int v5; // ecx@1 | |
1258 | |
1259 v1 = uColor >> 9; | |
1260 v2 = uColor >> 6; | |
1261 LOWORD(v1) = (uColor >> 9) & 0x7C00; | |
1262 LOWORD(v2) = (uColor >> 6) & 0x3E0; | |
1263 v3 = v2 | v1; | |
1264 v4 = (unsigned __int8)uColor >> 3; | |
1265 v5 = uColor >> 16; | |
1266 LOWORD(v5) = v5 & 0x8000; | |
1267 return v5 | v4 | v3; | |
1268 } | |
1269 | |
1270 //----- (0042690D) -------------------------------------------------------- | |
1271 int __fastcall _42690D_colors_cvt(unsigned int a1) | |
1272 { | |
1273 unsigned int v1; // eax@1 | |
1274 unsigned int v2; // edx@1 | |
1275 | |
1276 v1 = a1 >> 8; | |
1277 v2 = a1 >> 5; | |
1278 LOWORD(v1) = (a1 >> 8) & 0xF800; | |
1279 LOWORD(v2) = (a1 >> 5) & 0x7E0; | |
1280 return ((unsigned __int8)a1 >> 3) | v2 | v1; | |
1281 } | |
1282 | |
1283 //----- (00426947) -------------------------------------------------------- | |
1284 void __cdecl sub_426947() | |
1285 { | |
1286 dword_50C968 = 0; | |
1287 dword_50C994 = 0; | |
1288 dword_50C998_turnbased_icon_1A = 0; | |
1289 } | |
1290 // 50C968: using guessed type int dword_50C968; | |
1291 // 50C994: using guessed type int dword_50C994; | |
1292 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A; | |
1293 | |
1294 | |
1295 | |
1296 //----- (004269A2) -------------------------------------------------------- | |
1297 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1) | |
1298 { | |
89 | 1299 //unsigned __int64 v1; // qax@1 |
1300 Player *v1; | |
1301 int v1b; | |
0 | 1302 signed int v2; // ecx@1 |
82 | 1303 int *v3; // esi@1 |
0 | 1304 bool v4; // edi@6 |
82 | 1305 int *v5; // edi@10 |
1306 Player *v6; // esi@10 | |
0 | 1307 int v7; // eax@13 |
1308 unsigned __int8 v8; // cf@13 | |
89 | 1309 int v10[4]; // [sp+Ch] [bp-14h]@1 |
0 | 1310 int v11; // [sp+1Ch] [bp-4h]@10 |
1311 | |
89 | 1312 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1); |
1313 v1 = pParty->pPlayers; | |
1314 v1b = a1; | |
0 | 1315 v2 = 0; |
89 | 1316 v3 = v10; |
0 | 1317 do |
1318 { | |
89 | 1319 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8)) |
0 | 1320 && !*(int *)HIDWORD(v1) |
1321 && !*(_QWORD *)(HIDWORD(v1) + 8) | |
89 | 1322 && !*(_QWORD *)(HIDWORD(v1) + 16);*/ |
1323 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13])) | |
1324 && !v1->pConditions[14] | |
1325 && !v1->pConditions[15] | |
1326 && !v1->pConditions[16]; | |
82 | 1327 *v3 = v4; |
89 | 1328 //HIDWORD(v1) += 6972; |
1329 ++v1; | |
0 | 1330 v2 += v4; |
82 | 1331 ++v3; |
0 | 1332 } |
89 | 1333 while ( v1 <= &pParty->pPlayers[3] ); |
0 | 1334 if ( v2 ) |
1335 { | |
89 | 1336 v1b = v1b / v2; |
1337 v5 = v10; | |
82 | 1338 v6 = pParty->pPlayers;//[0].uExperience; |
89 | 1339 v11 = v1b; |
0 | 1340 do |
1341 { | |
82 | 1342 if ( *v5 ) |
0 | 1343 { |
1344 if ( v11 ) | |
1345 { | |
82 | 1346 LOBYTE(v7) = v6->GetLearningPercent(); |
89 | 1347 v1b = v11 + v11 * v7 / 100; |
1348 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience)); | |
1349 //need review | |
1350 LODWORD(v6->uExperience) += v1b; | |
1351 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8; | |
82 | 1352 if ( v6->uExperience > 4000000000i64 ) |
0 | 1353 { |
82 | 1354 HIDWORD(v6->uExperience) = 0; |
1355 LODWORD(v6->uExperience) = -294967296; | |
0 | 1356 } |
1357 } | |
1358 } | |
82 | 1359 ++v6; |
1360 ++v5; | |
0 | 1361 } |
82 | 1362 while ( v6 <= &pParty->pPlayers[3] ); |
0 | 1363 } |
89 | 1364 return v1b; |
0 | 1365 } |
1366 | |
1367 //----- (00426A5A) -------------------------------------------------------- | |
1368 void stru319::LootActor(Actor *pActor) | |
1369 { | |
1370 signed int v2; // edi@1 | |
1371 char v3; // zf@1 | |
1372 unsigned int v4; // eax@13 | |
1373 unsigned int v5; // esi@13 | |
1374 int v6; // eax@14 | |
1375 unsigned __int8 v7; // al@30 | |
1376 Party *v8; // esi@34 | |
1377 char *v9; // [sp-4h] [bp-3Ch]@10 | |
1378 char *v10; // [sp-4h] [bp-3Ch]@31 | |
1379 char *v11; // [sp-4h] [bp-3Ch]@38 | |
1380 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 | |
1381 int v13; // [sp+30h] [bp-8h]@1 | |
1382 int v14; // [sp+34h] [bp-4h]@1 | |
1383 | |
1384 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1385 Dst.Reset(); | |
1386 v2 = 0; | |
1387 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; | |
1388 v13 = 0; | |
1389 v14 = 0; | |
1390 if ( v3 ) | |
1391 { | |
1392 if ( !pActor->pMonsterInfo.uTreasureDiceRolls ) | |
1393 goto LABEL_9; | |
1394 do | |
1395 { | |
1396 ++v2; | |
1397 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | |
1398 } | |
1399 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); | |
1400 } | |
1401 else | |
1402 { | |
1403 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 ) | |
1404 goto LABEL_9; | |
377 | 1405 v14 = pActor->array_000234[3].uSpecEnchantmentType; |
0 | 1406 pActor->array_000234[3].Reset(); |
1407 } | |
1408 if ( v14 ) | |
1409 { | |
1410 party_finds_gold(v14, 0); | |
1411 viewparams->bRedrawGameUI = 1; | |
1412 } | |
1413 LABEL_9: | |
1414 if ( pActor->uCarriedItemID ) | |
1415 { | |
1416 Dst.Reset(); | |
1417 Dst.uItemID = pActor->uCarriedItemID; | |
1418 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1419 if ( v14 ) | |
189 | 1420 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9); |
0 | 1421 else |
189 | 1422 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9); |
0 | 1423 ShowStatusBarString(pTmpBuf2, 2u); |
1424 v4 = Dst.uItemID; | |
1425 v5 = Dst.uItemID; | |
1426 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) | |
1427 { | |
1428 v5 = Dst.uItemID; | |
1429 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1; | |
1430 Dst.uNumCharges = v6; | |
1431 Dst.uMaxCharges = v6; | |
1432 v4 = Dst.uItemID; | |
1433 } | |
1434 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) | |
377 | 1435 Dst.uEncantmentType = 2 * rand() % 4 + 2; |
0 | 1436 pItemsTable->SetSpecialBonus(&Dst); |
1437 if ( !pParty->AddItem(&Dst) ) | |
1438 pParty->SetHoldingItem(&Dst); | |
1439 pActor->uCarriedItemID = 0; | |
1440 if ( pActor->array_000234[0].uItemID ) | |
1441 { | |
1442 if ( !pParty->AddItem(pActor->array_000234) ) | |
1443 { | |
1444 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1445 pParty->SetHoldingItem(pActor->array_000234); | |
1446 } | |
1447 pActor->array_000234[0].Reset(); | |
1448 } | |
1449 if ( pActor->array_000234[1].uItemID ) | |
1450 { | |
1451 if ( !pParty->AddItem(&pActor->array_000234[1]) ) | |
1452 { | |
1453 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1454 pParty->SetHoldingItem(&pActor->array_000234[1]); | |
1455 } | |
1456 pActor->array_000234[1].Reset(); | |
1457 } | |
1458 LABEL_55: | |
1459 pActor->Remove(); | |
1460 return; | |
1461 } | |
1462 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) | |
1463 { | |
1464 if ( pActor->array_000234[3].uItemID ) | |
1465 { | |
1466 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); | |
1467 pActor->array_000234[3].Reset(); | |
1468 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1469 if ( v14 ) | |
1470 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); | |
1471 else | |
1472 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); | |
1473 ShowStatusBarString(pTmpBuf2, 2u); | |
1474 if ( !pParty->AddItem(&Dst) ) | |
1475 pParty->SetHoldingItem(&Dst); | |
1476 v13 = 1; | |
1477 } | |
1478 goto LABEL_44; | |
1479 } | |
1480 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | |
1481 { | |
1482 LABEL_44: | |
1483 v8 = pParty; | |
1484 goto LABEL_45; | |
1485 } | |
1486 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | |
1487 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1488 if ( v14 ) | |
1489 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); | |
1490 else | |
1491 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); | |
1492 ShowStatusBarString(pTmpBuf2, 2u); | |
1493 v8 = pParty; | |
1494 if ( !pParty->AddItem(&Dst) ) | |
1495 pParty->SetHoldingItem(&Dst); | |
1496 v13 = 1; | |
1497 LABEL_45: | |
1498 if ( pActor->array_000234[0].uItemID ) | |
1499 { | |
1500 if ( !v8->AddItem(pActor->array_000234) ) | |
1501 { | |
1502 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1503 v8->SetHoldingItem(pActor->array_000234); | |
1504 v13 = 1; | |
1505 } | |
1506 pActor->array_000234[0].Reset(); | |
1507 } | |
1508 if ( pActor->array_000234[1].uItemID ) | |
1509 { | |
1510 if ( !v8->AddItem(&pActor->array_000234[1]) ) | |
1511 { | |
1512 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1513 v8->SetHoldingItem(&pActor->array_000234[1]); | |
1514 v13 = 1; | |
1515 } | |
1516 pActor->array_000234[1].Reset(); | |
1517 } | |
1518 if ( !v13 || rand() % 100 < 90 ) | |
1519 goto LABEL_55; | |
1520 } | |
1521 | |
1522 //----- (00426E10) -------------------------------------------------------- | |
1523 int stru319::which_player_would_attack(Actor *pActor) | |
1524 { | |
1525 signed int v2; // ebx@1 | |
1526 int v3; // ecx@2 | |
1527 signed int v4; // edx@3 | |
1528 char v5; // zf@3 | |
1529 unsigned int v6; // eax@3 | |
1530 int v7; // eax@6 | |
1531 int v8; // eax@7 | |
1532 int v9; // eax@8 | |
1533 int v10; // eax@9 | |
1534 int v11; // eax@10 | |
1535 int v12; // eax@11 | |
1536 int v13; // esi@35 | |
1537 signed int v14; // edi@37 | |
1538 enum CHARACTER_RACE v15; // eax@44 | |
1539 Player *v16; // ecx@47 | |
1540 unsigned __int8 v17; // sf@50 | |
1541 unsigned __int8 v18; // of@50 | |
1542 int v19; // esi@52 | |
1543 Player *v20; // ecx@53 | |
1544 int result; // eax@57 | |
1545 int v22[16]; // [sp+8h] [bp-140h]@3 | |
1546 int v23[60]; // [sp+48h] [bp-100h]@48 | |
1547 int v24; // [sp+138h] [bp-10h]@2 | |
1548 int v25; // [sp+13Ch] [bp-Ch]@1 | |
1549 int v26; // [sp+140h] [bp-8h]@1 | |
1550 int v27; // [sp+144h] [bp-4h]@1 | |
1551 | |
1552 v27 = -1; | |
1553 v26 = -1; | |
1554 v25 = -1; | |
1555 v2 = 0; | |
1556 if ( pActor->pMonsterInfo.uAttackPreference ) | |
1557 { | |
1558 v3 = 0; | |
1559 v24 = 0; | |
1560 do | |
1561 { | |
1562 v4 = 1; | |
1563 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); | |
1564 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; | |
1565 v22[v3] = v6; | |
1566 if ( !v5 ) | |
1567 { | |
1568 if ( (signed int)v6 > 128 ) | |
1569 { | |
1570 switch ( v6 ) | |
1571 { | |
1572 case 0x100u: | |
1573 v27 = 8; | |
1574 break; | |
1575 case 0x200u: | |
1576 v25 = 0; | |
1577 break; | |
1578 case 0x400u: | |
1579 v25 = 1; | |
1580 break; | |
1581 case 0x800u: | |
1582 v26 = 0; | |
1583 break; | |
1584 case 0x1000u: | |
1585 v26 = 1; | |
1586 break; | |
1587 case 0x2000u: | |
1588 v26 = 3; | |
1589 break; | |
1590 case 0x4000u: | |
1591 v26 = 2; | |
1592 break; | |
1593 } | |
1594 } | |
1595 else | |
1596 { | |
1597 if ( v6 == 128 ) | |
1598 { | |
1599 v27 = 4; | |
1600 } | |
1601 else | |
1602 { | |
1603 v7 = v6 - 1; | |
1604 if ( v7 ) | |
1605 { | |
1606 v8 = v7 - 1; | |
1607 if ( v8 ) | |
1608 { | |
1609 v9 = v8 - 2; | |
1610 if ( v9 ) | |
1611 { | |
1612 v10 = v9 - 4; | |
1613 if ( v10 ) | |
1614 { | |
1615 v11 = v10 - 8; | |
1616 if ( v11 ) | |
1617 { | |
1618 v12 = v11 - 16; | |
1619 if ( v12 ) | |
1620 { | |
1621 if ( v12 == 32 ) | |
1622 v27 = 20; | |
1623 } | |
1624 else | |
1625 { | |
1626 v27 = 32; | |
1627 } | |
1628 } | |
1629 else | |
1630 { | |
1631 v27 = 24; | |
1632 } | |
1633 } | |
1634 else | |
1635 { | |
1636 v27 = 28; | |
1637 } | |
1638 } | |
1639 else | |
1640 { | |
1641 v27 = 16; | |
1642 } | |
1643 } | |
1644 else | |
1645 { | |
1646 v27 = 12; | |
1647 } | |
1648 } | |
1649 else | |
1650 { | |
1651 v27 = 0; | |
1652 } | |
1653 } | |
1654 } | |
1655 v2 = 0; | |
1656 v13 = 0; | |
1657 while ( 1 ) | |
1658 { | |
1659 v14 = 0; | |
135 | 1660 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType ) |
0 | 1661 v14 = v4; |
1662 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) | |
1663 v14 = v4; | |
1664 if ( v26 != -1 ) | |
1665 { | |
1666 v15 = pPlayers[v13 + 1]->GetRace(); | |
1667 if ( v26 == v15 ) | |
1668 v14 = 1; | |
1669 } | |
1670 if ( v14 == 1 ) | |
1671 { | |
1672 v16 = pPlayers[v13 + 1]; | |
1673 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) | |
1674 v23[v2++] = v13; | |
1675 } | |
1676 ++v13; | |
1677 if ( v13 >= 4 ) | |
1678 break; | |
1679 v4 = 1; | |
1680 } | |
1681 } | |
1682 v3 = v24 + 1; | |
1683 v18 = __OFSUB__(v24 + 1, 15); | |
1684 v17 = v24++ - 14 < 0; | |
1685 } | |
1686 while ( v17 ^ v18 ); | |
1687 if ( v2 ) | |
1688 goto LABEL_61; | |
1689 } | |
1690 v19 = 0; | |
1691 do | |
1692 { | |
1693 v20 = pPlayers[v19 + 1]; | |
1694 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) | |
1695 v23[v2++] = v19; | |
1696 ++v19; | |
1697 } | |
1698 while ( v19 < 4 ); | |
1699 if ( v2 ) | |
1700 LABEL_61: | |
1701 result = v23[rand() % v2]; | |
1702 else | |
1703 result = 0; | |
1704 return result; | |
1705 } | |
1706 | |
1707 | |
1708 //----- (0042704B) -------------------------------------------------------- | |
1709 bool stru319::special_ability_use_check(Actor *pActor, int a2) | |
1710 { | |
1711 stru319 *v3; // edi@1 | |
1712 signed int v4; // ebx@5 | |
1713 signed int v5; // edi@5 | |
1714 | |
1715 v3 = this; | |
1716 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
1717 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
1718 && rand() % 100 < 5 ) | |
1719 pActor->_44FD29(a2); | |
1720 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); | |
1721 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); | |
1722 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
1723 return 2; | |
1724 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
1725 return 3; | |
1726 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance; | |
1727 } | |
1728 | |
1729 //----- (00427102) -------------------------------------------------------- | |
1730 int stru319::_427102(Actor *pActor, signed int a2) | |
1731 { | |
1732 unsigned __int8 v3; // cf@11 | |
1733 unsigned __int8 v4; // zf@11 | |
1734 SpellBuff *v6; // ecx@46 | |
89 | 1735 Player *v7; // esi@49 |
0 | 1736 signed int v8; // edx@50 |
89 | 1737 SpellBuff *v9; // ecx@50 |
0 | 1738 |
1739 if ( a2 > 73 ) | |
1740 { | |
1741 if ( a2 == 77 ) | |
1742 { | |
1743 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP ) | |
1744 return 0; | |
1745 return 1; | |
1746 } | |
1747 if ( a2 == 80 ) | |
1748 { | |
1749 v6 = pParty->pPartyBuffs; | |
1750 while ( (signed __int64)v6->uExpireTime <= 0 ) | |
1751 { | |
1752 ++v6; | |
89 | 1753 if ( v6 > &pParty->pPartyBuffs[19] ) |
1754 { | |
1755 v7 = pParty->pPlayers;//[0].pPlayerBuffs; | |
0 | 1756 v8 = 0; |
89 | 1757 v9 = v7->pPlayerBuffs; |
1758 while ( v9->uExpireTime <= 0i64 ) | |
0 | 1759 { |
1760 ++v8; | |
89 | 1761 ++v9; |
0 | 1762 if ( v8 >= 24 ) |
1763 { | |
89 | 1764 ++v7; |
1765 if ( v7 <= &pParty->pPlayers[3] ) | |
1766 { | |
1767 v8 = 0; | |
1768 v9 = v7->pPlayerBuffs; | |
1769 } | |
1770 else | |
1771 return 0; | |
0 | 1772 } |
1773 } | |
1774 return 1; | |
1775 } | |
1776 } | |
1777 return 1; | |
1778 } | |
1779 if ( a2 == 85 ) | |
1780 { | |
1781 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 ) | |
1782 return 1; | |
1783 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 ) | |
1784 return 0; | |
1785 v3 = 0; | |
1786 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0; | |
1787 } | |
1788 else | |
1789 { | |
1790 if ( a2 == 86 ) | |
1791 { | |
1792 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 ) | |
1793 return 1; | |
1794 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 ) | |
1795 return 0; | |
1796 v3 = 0; | |
1797 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0; | |
1798 } | |
1799 else | |
1800 { | |
1801 if ( a2 != 95 || SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 ) | |
1802 return 1; | |
1803 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 ) | |
1804 return 0; | |
1805 v3 = 0; | |
1806 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0; | |
1807 } | |
1808 } | |
1809 } | |
1810 else | |
1811 { | |
1812 if ( a2 == 73 ) | |
1813 { | |
1814 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 ) | |
1815 return 1; | |
1816 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 ) | |
1817 return 0; | |
1818 v3 = 0; | |
1819 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0; | |
1820 } | |
89 | 1821 else if ( a2 == 5 ) |
0 | 1822 { |
1823 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 ) | |
1824 return 1; | |
1825 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 ) | |
1826 return 0; | |
1827 v3 = 0; | |
1828 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0; | |
1829 } | |
89 | 1830 else if ( a2 == 17 ) |
0 | 1831 { |
1832 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 ) | |
1833 return 1; | |
1834 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 ) | |
1835 return 0; | |
1836 v3 = 0; | |
1837 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0; | |
1838 } | |
89 | 1839 else if ( a2 == 38 ) |
0 | 1840 { |
1841 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 ) | |
1842 return 1; | |
1843 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 ) | |
1844 return 0; | |
1845 v3 = 0; | |
1846 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0; | |
1847 } | |
89 | 1848 else if ( a2 == 46 ) |
0 | 1849 { |
1850 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 ) | |
1851 return 1; | |
1852 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 ) | |
1853 return 0; | |
1854 v3 = 0; | |
1855 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0; | |
1856 } | |
89 | 1857 else |
1858 { | |
1859 if ( a2 != 47 ) | |
1860 { | |
1861 if ( a2 != 51 || SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 ) | |
1862 return 1; | |
1863 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 ) | |
1864 { | |
1865 v3 = 0; | |
1866 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0; | |
1867 } | |
1868 else | |
1869 return 0; | |
1870 } | |
1871 else | |
1872 { | |
1873 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 ) | |
1874 return 1; | |
1875 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 ) | |
1876 return 0; | |
1877 v3 = 0; | |
1878 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0; | |
1879 } | |
1880 } | |
0 | 1881 } |
1882 if ( !(v3 | v4) ) | |
1883 return 0; | |
1884 return 1; | |
1885 } | |
1886 | |
1887 //----- (004272F5) -------------------------------------------------------- | |
1888 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
1889 { | |
1890 signed int v5; // esi@1 | |
1891 signed int v6; // edi@1 | |
1892 int v7; // esi@8 | |
1893 int v8; // eax@9 | |
1894 int v9; // edx@11 | |
1895 int v10; // edx@13 | |
1896 int v11; // esi@13 | |
1897 unsigned __int8 v12; // sf@13 | |
1898 unsigned __int8 v13; // of@13 | |
1899 int v14; // edx@14 | |
1900 int v15; // eax@14 | |
1901 signed int result; // eax@17 | |
1902 | |
1903 v5 = pActor->pMonsterInfo.uAC; | |
1904 v6 = 0; | |
1905 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 ) | |
1906 v5 /= 2; | |
1907 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1908 v6 = pActor->pActorBuffs[15].uPower; | |
1909 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 ) | |
1910 v6 = pActor->pActorBuffs[16].uPower; | |
1911 v7 = v6 + v5; | |
1912 if ( a3 ) | |
1913 v8 = pPlayer->GetRangedAttack(); | |
1914 else | |
1915 v8 = pPlayer->GetActualAttack(0); | |
1916 v9 = rand() % (v7 + 2 * v8 + 30); | |
1917 if ( a3 == 2 ) | |
1918 { | |
1919 v14 = a4 + v9; | |
1920 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1921 } | |
1922 else | |
1923 { | |
1924 if ( a3 != 3 ) | |
1925 { | |
1926 v10 = a4 + v9; | |
1927 v11 = v7 + 15; | |
1928 v13 = __OFSUB__(v10, v11); | |
1929 v12 = v10 - v11 < 0; | |
1930 goto LABEL_16; | |
1931 } | |
1932 v14 = a4 + v9; | |
1933 v15 = 2 * v7 + 30; | |
1934 } | |
1935 v13 = __OFSUB__(v14, v15); | |
1936 v12 = v14 - v15 < 0; | |
1937 LABEL_16: | |
1938 if ( v12 ^ v13 ) | |
1939 result = 0; | |
1940 else | |
1941 result = 1; | |
1942 return result; | |
1943 } | |
1944 | |
1945 //----- (004273BB) -------------------------------------------------------- | |
1946 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
1947 { | |
1948 Actor *v5; // ecx@1 | |
1949 signed int v6; // ebx@1 | |
1950 signed int v7; // esi@1 | |
1951 unsigned __int8 v8; // zf@1 | |
1952 unsigned __int8 v9; // sf@1 | |
1953 int v10; // ebx@10 | |
1954 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
1955 | |
1956 v5 = a2; | |
1957 v6 = a2->pMonsterInfo.uAC; | |
1958 v7 = 0; | |
1959 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0; | |
1960 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0; | |
1961 a2a = 0; | |
1962 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) ) | |
1963 v6 /= 2; | |
1964 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 ) | |
1965 v7 = v5->pActorBuffs[14].uPower; | |
1966 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 ) | |
1967 v7 = v5->pActorBuffs[16].uPower; | |
1968 v10 = v7 + v6; | |
1969 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1970 a2a = pActor->pActorBuffs[14].uPower; | |
1971 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a ) | |
1972 a2a = pActor->pActorBuffs[17].uPower; | |
1973 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1974 { | |
1975 a2a += pActor->pActorBuffs[11].uPower; | |
1976 pActor->pActorBuffs[11].Reset(); | |
1977 } | |
1978 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
1979 } | |
1980 | |
1981 //----- (004274AD) -------------------------------------------------------- | |
1982 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
1983 { | |
1984 signed int v3; // edi@1 | |
1985 signed int v4; // esi@8 | |
1986 int v5; // esi@8 | |
1987 | |
1988 v3 = 0; | |
1989 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1990 v3 = pActor->pActorBuffs[14].uPower; | |
1991 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 ) | |
1992 v3 = pActor->pActorBuffs[17].uPower; | |
1993 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1994 { | |
1995 v3 += pActor->pActorBuffs[11].uPower; | |
1996 pActor->pActorBuffs[11].Reset(); | |
1997 } | |
1998 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
1999 v5 = rand() % v4 + 1; | |
2000 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
2001 } | |
2002 | |
2003 //----- (00427546) -------------------------------------------------------- | |
2004 int stru319::_427546(int a2) | |
2005 { | |
2006 int result; // eax@2 | |
2007 | |
2008 if ( a2 >= 0 ) | |
2009 { | |
2010 if ( a2 >= 1 ) | |
2011 result = (a2 >= 2) + 2; | |
2012 else | |
2013 result = 1; | |
2014 } | |
2015 else | |
2016 { | |
2017 result = 0; | |
2018 } | |
2019 return result; | |
2020 } | |
2021 | |
2022 //----- (0042756B) -------------------------------------------------------- | |
2023 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
2024 { | |
2025 int v4; // edx@1 | |
2026 int v5; // ecx@1 | |
2027 signed int v6; // eax@4 | |
2028 signed int result; // eax@17 | |
2029 signed int v8; // esi@18 | |
2030 | |
2031 v4 = 0; | |
2032 v5 = 0; | |
2033 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
2034 v5 = pActor->pActorBuffs[14].uPower; | |
2035 switch ( a2 ) | |
2036 { | |
2037 case 4: | |
2038 v6 = pActor->pMonsterInfo.uResPhysical; | |
2039 break; | |
2040 case 0: | |
2041 v6 = pActor->pMonsterInfo.uResFire; | |
2042 goto LABEL_12; | |
2043 case 1: | |
2044 v6 = pActor->pMonsterInfo.uResAir; | |
2045 goto LABEL_12; | |
2046 case 2: | |
2047 v6 = pActor->pMonsterInfo.uResWater; | |
2048 goto LABEL_12; | |
2049 case 3: | |
2050 v6 = pActor->pMonsterInfo.uResEarth; | |
2051 goto LABEL_12; | |
2052 case 6: | |
2053 v6 = pActor->pMonsterInfo.uResSpirit; | |
2054 break; | |
2055 case 7: | |
2056 v6 = pActor->pMonsterInfo.uResMind; | |
2057 goto LABEL_12; | |
2058 case 8: | |
2059 v6 = pActor->pMonsterInfo.uResBody; | |
2060 LABEL_12: | |
2061 v4 = v5; | |
2062 break; | |
2063 case 9: | |
2064 v6 = pActor->pMonsterInfo.uResLight; | |
2065 break; | |
2066 case 10: | |
2067 v6 = pActor->pMonsterInfo.uResDark; | |
2068 break; | |
2069 default: | |
2070 v6 = 0; | |
2071 break; | |
2072 } | |
2073 if ( v6 < 200 ) | |
2074 { | |
2075 v8 = v4 + v6 + 30; | |
2076 if ( rand() % v8 >= 30 ) | |
2077 { | |
2078 a3 >>= 1; | |
2079 if ( rand() % v8 >= 30 ) | |
2080 { | |
2081 a3 >>= 1; | |
2082 if ( rand() % v8 >= 30 ) | |
2083 { | |
2084 a3 >>= 1; | |
2085 if ( rand() % v8 >= 30 ) | |
2086 a3 >>= 1; | |
2087 } | |
2088 } | |
2089 } | |
2090 result = a3; | |
2091 } | |
2092 else | |
2093 { | |
2094 result = 0; | |
2095 } | |
2096 return result; | |
2097 } | |
2098 | |
2099 //----- (00427662) -------------------------------------------------------- | |
2100 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
2101 { | |
2102 Actor *v3; // edi@2 | |
2103 signed int v4; // esi@2 | |
2104 bool result; // eax@13 | |
2105 | |
2106 switch ( uType ) | |
2107 { | |
2108 case 0u: | |
2109 v3 = pActor; | |
2110 v4 = pActor->pMonsterInfo.uResFire; | |
2111 goto LABEL_12; | |
2112 case 1u: | |
2113 v3 = pActor; | |
2114 v4 = pActor->pMonsterInfo.uResAir; | |
2115 goto LABEL_12; | |
2116 case 2u: | |
2117 v3 = pActor; | |
2118 v4 = pActor->pMonsterInfo.uResWater; | |
2119 goto LABEL_12; | |
2120 case 3u: | |
2121 v3 = pActor; | |
2122 v4 = pActor->pMonsterInfo.uResEarth; | |
2123 goto LABEL_12; | |
2124 case 7u: | |
2125 v3 = pActor; | |
2126 v4 = pActor->pMonsterInfo.uResMind; | |
2127 goto LABEL_12; | |
2128 case 6u: | |
2129 v3 = pActor; | |
2130 v4 = pActor->pMonsterInfo.uResSpirit; | |
2131 goto LABEL_12; | |
2132 case 8u: | |
2133 v3 = pActor; | |
2134 v4 = pActor->pMonsterInfo.uResBody; | |
2135 goto LABEL_12; | |
2136 case 9u: | |
2137 v3 = pActor; | |
2138 v4 = pActor->pMonsterInfo.uResLight; | |
2139 goto LABEL_12; | |
2140 case 0xAu: | |
2141 v3 = pActor; | |
2142 v4 = pActor->pMonsterInfo.uResDark; | |
2143 goto LABEL_12; | |
2144 case 4u: | |
2145 v3 = pActor; | |
2146 v4 = pActor->pMonsterInfo.uResPhysical; | |
2147 LABEL_12: | |
2148 if ( v4 < 200 ) | |
2149 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | |
2150 else | |
2151 result = 0; | |
2152 break; | |
2153 default: | |
2154 result = 1; | |
2155 break; | |
2156 } | |
2157 return result; | |
2158 } | |
2159 | |
2160 | |
2161 //----- (00427769) -------------------------------------------------------- | |
2162 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
2163 { | |
2164 bool result; // eax@2 | |
2165 | |
2166 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) | |
2167 result = 1; | |
2168 else | |
2169 result = 0; | |
2170 return result; | |
2171 } | |
2172 | |
2173 //----- (0042777D) -------------------------------------------------------- | |
319 | 2174 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) |
0 | 2175 { |
370 | 2176 //bool result; // eax@2 |
486 | 2177 //__int16 v6; // bx@4 |
437 | 2178 //Player *v7; // eax@4 |
486 | 2179 //char v8; // zf@12 |
0 | 2180 unsigned __int16 v9; // cx@16 |
2181 unsigned int v10; // eax@18 | |
2182 unsigned __int8 v11; // sf@18 | |
2183 unsigned __int8 v12; // of@18 | |
2184 unsigned __int16 v13; // cx@21 | |
2185 unsigned int v14; // eax@23 | |
486 | 2186 //stru277 *v15; // esi@27 |
2187 //stru277 *v16; // eax@28 | |
0 | 2188 GUIWindow *v17; // eax@43 |
2189 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | |
2190 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | |
2191 unsigned int v20; // [sp-28h] [bp-40h]@44 | |
2192 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | |
2193 unsigned int v22; // [sp-20h] [bp-38h]@44 | |
2194 int v23; // [sp-1Ch] [bp-34h]@44 | |
2195 int v24; // [sp-18h] [bp-30h]@44 | |
2196 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | |
2197 unsigned int v26; // [sp-10h] [bp-28h]@43 | |
2198 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | |
2199 char *v28; // [sp-8h] [bp-20h]@43 | |
2200 Texture *v29; // [sp-4h] [bp-1Ch]@43 | |
486 | 2201 //__int16 a3a; // [sp+10h] [bp-8h]@1 |
2202 //__int16 a2a; // [sp+14h] [bp-4h]@1 | |
2203 | |
2204 //a3a = uPlayerID; | |
2205 //a2a = a1; | |
370 | 2206 |
2207 //if ( pParty->bTurnBasedModeOn != 1 | |
2208 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | |
2209 if (pParty->bTurnBasedModeOn) | |
0 | 2210 { |
370 | 2211 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) |
2212 return; | |
2213 } | |
2214 | |
2215 | |
486 | 2216 //v6 = a5; |
437 | 2217 //v7 = &pParty->pPlayers[uPlayerID]; |
2218 assert(uPlayerID < 4); | |
2219 auto player = &pParty->pPlayers[uPlayerID]; | |
0 | 2220 if ( !(a5 & 0x10) ) |
2221 { | |
2222 switch ( a1 ) | |
2223 { | |
486 | 2224 case SPELL_SPIRIT_FATE: |
2225 case SPELL_BODY_FIRST_AID: | |
2226 case SPELL_DARK_REANIMATE: | |
2227 //HIBYTE(v6) = HIBYTE(a5) | 1; | |
2228 a5 |= 0x0100; | |
0 | 2229 break; |
486 | 2230 |
2231 case SPELL_FIRE_FIRE_AURA: | |
2232 case SPELL_WATER_RECHARGE_ITEM: | |
2233 case SPELL_WATER_ENCHANT_ITEM: | |
2234 case SPELL_DARK_VAMPIRIC_WEAPON: | |
2235 //LOBYTE(v6) = a5 | 0x80; | |
2236 a5 |= 0x0080; | |
0 | 2237 break; |
486 | 2238 |
2239 case SPELL_FIRE_FIRE_BOLT: | |
2240 case SPELL_FIRE_FIREBALL: | |
2241 case SPELL_FIRE_INCINERATE: | |
2242 case SPELL_AIR_LIGHNING_BOLT: | |
2243 case SPELL_AIR_IMPLOSION: | |
2244 case SPELL_WATER_POISON_SPRAY: | |
2245 case SPELL_WATER_ICE_BOLT: | |
2246 case SPELL_WATER_ACID_BURST: | |
2247 case SPELL_WATER_ICE_BLAST: | |
2248 case SPELL_EARTH_STUN: | |
2249 case SPELL_EARTH_SLOW: | |
2250 case SPELL_EARTH_DEADLY_SWARM: | |
2251 case SPELL_EARTH_BLADES: | |
2252 case SPELL_EARTH_MASS_DISTORTION: | |
2253 case SPELL_SPIRIT_SPIRIT_LASH: | |
2254 case SPELL_MIND_MIND_BLAST: | |
2255 case SPELL_MIND_CHARM: | |
2256 case SPELL_MIND_PSYCHIC_SHOCK: | |
2257 case SPELL_BODY_HARM: | |
2258 case SPELL_BODY_FLYING_FIST: | |
2259 case SPELL_LIGHT_LIGHT_BOLT: | |
2260 case SPELL_LIGHT_DESTROY_UNDEAD: | |
2261 case SPELL_LIGHT_SUNRAY: | |
2262 case SPELL_DARK_TOXIC_CLOUD: | |
2263 case SPELL_DARK_SHRINKING_RAY: | |
2264 case SPELL_DARK_SHARPMETAL: | |
2265 case SPELL_DARK_DRAGON_BREATH: | |
0 | 2266 if ( !a6 ) |
486 | 2267 a5 |= 0x0008; |
0 | 2268 break; |
486 | 2269 case SPELL_MIND_TELEPATHY: |
2270 case SPELL_MIND_BERSERK: | |
2271 case SPELL_MIND_ENSLAVE: | |
2272 case SPELL_LIGHT_PARALYZE: | |
2273 case SPELL_DARK_CONTROL_UNDEAD: | |
2274 //LABEL_9: | |
2275 //v6 = a5 | 8; | |
2276 a5 |= 0x0008; | |
0 | 2277 break; |
486 | 2278 |
2279 case SPELL_EARTH_TELEKINESIS: | |
2280 a5 |= 0x0040; | |
2281 break; | |
2282 | |
2283 case SPELL_SPIRIT_BLESS: | |
2284 if (a4 && ~a4 & 0x01C0) | |
2285 goto LABEL_25; | |
2286 else if ((player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0); | |
0 | 2287 goto LABEL_25; |
2288 break; | |
486 | 2289 |
2290 case SPELL_SPIRIT_PRESERVATION: | |
0 | 2291 v9 = a4; |
2292 if ( !a4 ) | |
437 | 2293 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT]; |
0 | 2294 goto LABEL_18; |
486 | 2295 |
2296 case SPELL_DARK_PAIN_REFLECTION: | |
0 | 2297 v9 = a4; |
2298 if ( !a4 ) | |
437 | 2299 v9 = player->pActiveSkills[PLAYER_SKILL_DARK]; |
0 | 2300 LABEL_18: |
2301 v10 = SkillToMastery(v9); | |
2302 v12 = __OFSUB__(v10, 3); | |
2303 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2304 goto LABEL_24; | |
486 | 2305 |
2306 case SPELL_BODY_HAMMERHANDS: | |
0 | 2307 v13 = a4; |
2308 if ( !a4 ) | |
437 | 2309 v13 = player->pActiveSkills[PLAYER_SKILL_BODY]; |
0 | 2310 v14 = SkillToMastery(v13); |
2311 v12 = __OFSUB__(v14, 4); | |
2312 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2313 LABEL_24: | |
2314 if ( v11 ^ v12 ) | |
2315 goto LABEL_25; | |
2316 break; | |
486 | 2317 |
2318 case SPELL_EARTH_STONE_TO_FLESH: | |
2319 case SPELL_SPIRIT_REMOVE_CURSE: | |
2320 case SPELL_SPIRIT_RAISE_DEAD: | |
2321 case SPELL_SPIRIT_RESSURECTION: | |
2322 case SPELL_MIND_REMOVE_FEAR: | |
2323 case SPELL_MIND_CURE_PARALYSIS: | |
2324 case SPELL_MIND_CURE_INSANITY: | |
2325 case SPELL_BODY_CURE_WEAKNESS: | |
2326 case SPELL_BODY_REGENERATION: | |
2327 case SPELL_BODY_CURE_POISON: | |
2328 case SPELL_BODY_CURE_DISEASE: | |
0 | 2329 LABEL_25: |
486 | 2330 //v6 = a5 | 2; |
2331 a5 |= 0x0002; | |
0 | 2332 break; |
486 | 2333 |
2334 case SPELL_DARK_SACRIFICE: | |
2335 //HIBYTE(v6) = HIBYTE(a5) | 2; | |
2336 a5 |= 0x0200; | |
0 | 2337 break; |
2338 default: | |
2339 break; | |
2340 } | |
2341 } | |
370 | 2342 |
486 | 2343 |
2344 if (a5 & 0x3CA) | |
0 | 2345 { |
486 | 2346 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); |
2347 for (uint i = 0; i < 10; ++i) | |
2348 if (pStru277[i].field_8 & 0x3CA) | |
2349 { | |
2350 pStru277[i].spellnum = 0; | |
2351 break; | |
2352 } | |
0 | 2353 } |
486 | 2354 |
2355 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); | |
2356 for (uint i = 0; i < 10; ++i) | |
0 | 2357 { |
486 | 2358 auto spell = pStru277 + i; |
2359 if (!spell->spellnum) | |
2360 continue; | |
2361 | |
2362 spell->spellnum = 0; | |
2363 if (spell->field_8 & 0x3CA) | |
0 | 2364 { |
486 | 2365 pGUIWindow_Settings->Release(); |
2366 pGUIWindow_Settings = nullptr; | |
2367 pMouse->SetCursorBitmap("MICON1"); | |
2368 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2369 unk_50C9A0 = 0; | |
2370 back_to_game(); | |
0 | 2371 } |
2372 } | |
486 | 2373 |
2374 int result = pStru277->PushStru277(a1, uPlayerID, a4, a5, a6); | |
0 | 2375 if ( result != -1 ) |
2376 { | |
486 | 2377 if ( a5 & 2 ) |
0 | 2378 { |
2379 if ( pGUIWindow_Settings ) | |
319 | 2380 return; |
0 | 2381 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2382 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2383 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2384 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2385 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
319 | 2386 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2387 return; | |
0 | 2388 } |
486 | 2389 if ( a5 & 8 ) |
0 | 2390 { |
2391 if ( pGUIWindow_Settings ) | |
319 | 2392 return; |
0 | 2393 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2394 v29 = 0; | |
2395 v28 = ""; | |
2396 v27 = 0; | |
2397 v26 = 0; | |
2398 v25 = 70; | |
2399 LABEL_44: | |
2400 v24 = 0; | |
2401 v23 = 1; | |
2402 v22 = 344; | |
2403 v21 = 460; | |
2404 v20 = 8; | |
2405 v19 = 8; | |
2406 pGUIWindow_Settings = v17; | |
2407 v18 = v17; | |
2408 LABEL_56: | |
2409 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
319 | 2410 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2411 return; | |
0 | 2412 } |
486 | 2413 if ( a5 & 0x40 ) |
0 | 2414 { |
2415 if ( pGUIWindow_Settings ) | |
319 | 2416 return; |
0 | 2417 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2418 v29 = 0; | |
2419 v28 = ""; | |
2420 v27 = 0; | |
2421 v26 = 0; | |
2422 v25 = 190; | |
2423 goto LABEL_44; | |
2424 } | |
486 | 2425 if ( (char)a5 < 0 ) |
0 | 2426 { |
2427 if ( pGUIWindow_Settings ) | |
319 | 2428 return; |
0 | 2429 ++pIcons_LOD->uTexturePacksCount; |
2430 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2431 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2432 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2433 unk_50C9A0 = 1; | |
2434 some_active_character = uActiveCharacter; | |
319 | 2435 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2436 return; | |
0 | 2437 } |
486 | 2438 if ( HIBYTE(a5) & 1 ) |
0 | 2439 { |
2440 if ( pGUIWindow_Settings ) | |
319 | 2441 return; |
2442 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
0 | 2443 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); |
2444 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2445 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2446 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
423 | 2447 pGUIWindow_Settings->CreateButton(8, 8, 460, 344, 1, 0, 140, 0, 0, "", NULL); |
2448 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
0 | 2449 } |
486 | 2450 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) |
0 | 2451 { |
319 | 2452 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
0 | 2453 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( |
2454 0x1D5u, | |
2455 0xB2u, | |
319 | 2456 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), |
2457 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
0 | 2458 1, |
2459 0, | |
2460 0xBCu, | |
2461 0, | |
2462 0, | |
2463 "", | |
319 | 2464 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), |
0 | 2465 0); |
2466 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2467 0x272u, | |
2468 0xB2u, | |
319 | 2469 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), |
2470 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
0 | 2471 1, |
2472 0, | |
2473 0xBCu, | |
2474 1u, | |
2475 0, | |
2476 "", | |
319 | 2477 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), |
0 | 2478 0); |
2479 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
319 | 2480 pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0); |
0 | 2481 } |
2482 } | |
2483 } | |
2484 | |
2485 | |
2486 | |
2487 //----- (00427D48) -------------------------------------------------------- | |
2488 void stru277::_427D48(unsigned int uPlayerID) | |
2489 { | |
2490 stru277 *v2; // esi@1 | |
2491 signed int v3; // ebx@1 | |
2492 | |
2493 v2 = this; | |
2494 v3 = 10; | |
2495 do | |
2496 { | |
2497 if ( v2->spellnum ) | |
2498 { | |
2499 if ( v2->field_8 & 0x3CA ) | |
2500 { | |
2501 v2->spellnum = 0; | |
2502 pGUIWindow_Settings->Release(); | |
2503 pGUIWindow_Settings = 0; | |
2504 pMouse->SetCursorBitmap("MICON1"); | |
2505 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2506 unk_50C9A0 = 0; | |
2507 back_to_game(); | |
2508 } | |
2509 } | |
2510 ++v2; | |
2511 --v3; | |
2512 } | |
2513 while ( v3 ); | |
2514 } | |
2515 | |
2516 //----- (00427DA0) -------------------------------------------------------- | |
488 | 2517 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int a6) |
0 | 2518 { |
2519 unsigned int result; // eax@1 | |
2520 stru277 *v7; // edx@1 | |
2521 stru277 *v8; // ecx@5 | |
2522 | |
2523 result = 0; | |
2524 v7 = this; | |
2525 while ( v7->spellnum ) | |
2526 { | |
2527 ++result; | |
2528 ++v7; | |
2529 if ( (signed int)result >= 10 ) | |
2530 goto LABEL_8; | |
2531 } | |
2532 v8 = &this[result]; | |
2533 v8->spellnum = a2; | |
2534 v8->uPlayerID = uPlayerID; | |
2535 if ( a5 & 0x10 ) | |
2536 v8->uPlayerID_2 = uPlayerID; | |
2537 v8->field_6 = 0; | |
488 | 2538 v8->spell_target_pid = 0; |
0 | 2539 v8->field_8 = a5; |
488 | 2540 v8->forced_spell_skill_level = skill_level; |
0 | 2541 v8->field_10 = a6; |
2542 LABEL_8: | |
2543 if ( result == 10 ) | |
2544 result = -1; | |
2545 return result; | |
2546 } | |
2547 | |
2548 //----- (00427E01) -------------------------------------------------------- | |
2549 void stru277::_427E01_cast_spell() | |
2550 { | |
486 | 2551 //int v1; // esi@1 |
0 | 2552 int v2; // edi@1 |
2553 stru277 *v3; // ebx@2 | |
488 | 2554 //signed int v4; // eax@8 |
2555 //__int16 v5; // ax@9 | |
0 | 2556 signed int v6; // eax@14 |
488 | 2557 //__int16 v7; // ax@23 |
2558 //__int16 v8; // ax@24 | |
2559 //char v9; // al@44 | |
2560 //int v10; // eax@45 | |
0 | 2561 unsigned __int16 v11; // cx@45 |
2562 signed int v12; // ecx@48 | |
490 | 2563 //int v13; // eax@53 |
0 | 2564 unsigned __int8 v14; // zf@53 |
488 | 2565 //unsigned int v15; // edx@53 |
2566 //signed int v16; // eax@53 | |
0 | 2567 Player *v17; // esi@70 |
2568 int v18; // eax@72 | |
2569 int v19; // eax@74 | |
2570 char *v20; // eax@74 | |
2571 signed int i; // esi@76 | |
2572 int v22; // eax@88 | |
2573 __int16 v23; // ax@88 | |
488 | 2574 //int v24; // ecx@93 |
2575 //int v25; // ecx@94 | |
2576 //signed __int64 v26; // qax@100 | |
2577 //char *v27; // ecx@100 | |
2578 //unsigned __int64 v28; // qax@102 | |
0 | 2579 int v29; // ecx@105 |
2580 int v30; // ecx@106 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
2581 //int v31; // eax@112 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
2582 //int v32; // eax@112 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
2583 //char *v33; // edx@113 |
0 | 2584 int v34; // eax@121 |
2585 int v35; // eax@123 | |
2586 int v36; // edx@125 | |
2587 int v37; // eax@129 | |
2588 signed int v38; // edi@129 | |
2589 signed int v39; // eax@129 | |
2590 int v40; // ecx@129 | |
2591 int v41; // eax@129 | |
2592 signed int v42; // eax@129 | |
2593 int *v43; // ecx@129 | |
2594 int v44; // eax@132 | |
2595 int v45; // ecx@132 | |
2596 int v46; // eax@132 | |
2597 unsigned int v47; // edx@133 | |
2598 int v48; // eax@137 | |
2599 int v49; // eax@137 | |
2600 int v50; // eax@141 | |
2601 int v51; // eax@146 | |
2602 __int16 v52; // ax@153 | |
2603 int v53; // eax@153 | |
2604 signed __int64 v54; // qax@164 | |
2605 int v55; // edi@164 | |
488 | 2606 //stru6 *v56; // eax@165 |
0 | 2607 int v57; // eax@169 |
2608 signed __int64 v58; // qax@177 | |
2609 int v59; // edi@177 | |
2610 unsigned __int16 v60; // ax@184 | |
2611 int v61; // ecx@184 | |
2612 int v62; // eax@186 | |
2613 int v63; // ecx@187 | |
2614 int v64; // ecx@188 | |
2615 int v65; // ecx@189 | |
2616 const char *v66; // ecx@200 | |
2617 unsigned int v67; // edx@201 | |
2618 char v68; // al@207 | |
89 | 2619 ItemGen *v69; // esi@211 |
0 | 2620 int v70; // ecx@214 |
2621 int v71; // ecx@215 | |
2622 int v72; // ecx@216 | |
488 | 2623 //__int16 v73; // ST1C_2@222 |
2624 //__int16 v74; // ST18_2@222 | |
2625 //stru6 *v75; // eax@222 | |
0 | 2626 int v76; // ecx@223 |
2627 int v77; // ecx@224 | |
2628 int v78; // ecx@225 | |
2629 int v79; // eax@227 | |
488 | 2630 //int v80; // eax@232 |
2631 //__int16 v81; // ST18_2@245 | |
2632 //stru6 *v82; // eax@245 | |
0 | 2633 signed int v83; // edi@245 |
488 | 2634 //__int16 v84; // ST18_2@245 |
2635 //stru6 *v85; // eax@245 | |
2636 //__int16 v86; // ST18_2@245 | |
2637 //stru6 *v87; // eax@245 | |
2638 //__int16 v88; // ST18_2@245 | |
2639 //stru6 *v89; // eax@245 | |
0 | 2640 double v90; // st7@245 |
2641 int v91; // eax@250 | |
89 | 2642 Player *v92; // eax@255 |
488 | 2643 //__int16 v93; // ST18_2@260 |
2644 //stru6 *v94; // eax@260 | |
2645 //__int16 v95; // ST18_2@260 | |
2646 //stru6 *v96; // eax@260 | |
2647 //__int16 v97; // ST18_2@260 | |
2648 //stru6 *v98; // eax@260 | |
2649 //__int16 v99; // ST18_2@260 | |
2650 //stru6 *v100; // eax@260 | |
0 | 2651 int v101; // ecx@261 |
2652 int v102; // ecx@262 | |
2653 int v103; // ecx@263 | |
2654 int v104; // eax@265 | |
2655 int v105; // edi@271 | |
488 | 2656 //__int16 v106; // ST18_2@272 |
2657 //stru6 *v107; // eax@272 | |
0 | 2658 __int16 v108; // ST1C_2@274 |
2659 __int16 v109; // ST18_2@274 | |
2660 stru6 *v110; // eax@274 | |
2661 int v111; // eax@274 | |
2662 Actor *v112; // esi@278 | |
2663 int v113; // eax@278 | |
2664 int v114; // ebx@278 | |
2665 unsigned int v115; // ecx@278 | |
2666 int v116; // edx@279 | |
2667 int v117; // edx@281 | |
2668 int v118; // edx@283 | |
2669 int v119; // edi@286 | |
2670 int v120; // eax@286 | |
2671 int v121; // eax@286 | |
2672 signed int v122; // eax@286 | |
2673 int v123; // ecx@288 | |
2674 int v124; // ecx@289 | |
2675 int v125; // ecx@290 | |
2676 int v126; // eax@292 | |
2677 int v127; // eax@296 | |
488 | 2678 //__int16 v128; // ST18_2@303 |
2679 //stru6 *v129; // eax@303 | |
2680 //__int16 v130; // ST18_2@303 | |
2681 //stru6 *v131; // eax@303 | |
2682 //__int16 v132; // ST18_2@303 | |
2683 //stru6 *v133; // eax@303 | |
2684 //__int16 v134; // ST18_2@303 | |
2685 //stru6 *v135; // eax@303 | |
2686 //unsigned __int64 v136; // qax@304 | |
2687 //char *v137; // ecx@304 | |
0 | 2688 int v138; // ecx@305 |
2689 int v139; // ecx@306 | |
2690 int v140; // eax@308 | |
488 | 2691 //__int16 v141; // ST18_2@311 |
2692 //stru6 *v142; // eax@311 | |
2693 //__int16 v143; // ST18_2@311 | |
2694 //stru6 *v144; // eax@311 | |
2695 //__int16 v145; // ST18_2@311 | |
2696 //stru6 *v146; // eax@311 | |
2697 //__int16 v147; // ST18_2@311 | |
2698 //stru6 *v148; // eax@311 | |
0 | 2699 int v149; // ecx@312 |
2700 int v150; // ecx@313 | |
2701 int v151; // ecx@314 | |
2702 signed int v152; // eax@322 | |
2703 int v153; // ecx@322 | |
2704 int v154; // eax@322 | |
2705 int v155; // eax@323 | |
2706 int v156; // eax@323 | |
2707 int v157; // eax@326 | |
2708 double v158; // st7@326 | |
2709 double v159; // st6@326 | |
2710 signed __int64 v160; // qtt@334 | |
2711 int v161; // eax@339 | |
2712 int v162; // edi@340 | |
2713 int v163; // eax@340 | |
2714 signed int v164; // eax@340 | |
2715 signed int v165; // edi@340 | |
488 | 2716 //stru6 *v166; // eax@340 |
2717 //stru6 *v167; // eax@340 | |
0 | 2718 signed int v168; // edi@343 |
2719 int v169; // eax@344 | |
2720 int v170; // ecx@346 | |
2721 int v171; // ecx@347 | |
2722 int v172; // ecx@348 | |
2723 int v173; // edi@350 | |
2724 signed int v174; // edi@355 | |
488 | 2725 //__int16 v175; // ST18_2@357 |
2726 //stru6 *v176; // eax@357 | |
2727 //__int16 v177; // ST18_2@357 | |
2728 //stru6 *v178; // eax@357 | |
2729 //__int16 v179; // ST18_2@357 | |
2730 //stru6 *v180; // eax@357 | |
2731 //__int16 v181; // ST18_2@357 | |
2732 //stru6 *v182; // eax@357 | |
2733 //signed __int64 v183; // qax@357 | |
0 | 2734 int v184; // ecx@358 |
2735 int v185; // ecx@359 | |
2736 int v186; // ecx@360 | |
2737 int v187; // eax@367 | |
2738 int v188; // esi@369 | |
2739 int v189; // edi@369 | |
2740 const char *v190; // ecx@377 | |
2741 signed int v191; // edi@379 | |
2742 int v192; // ecx@382 | |
2743 int v193; // ecx@383 | |
2744 int v194; // ecx@384 | |
2745 int v195; // eax@386 | |
2746 int v196; // eax@387 | |
488 | 2747 //__int16 v197; // ST18_2@395 |
2748 //stru6 *v198; // eax@395 | |
2749 //__int16 v199; // ST18_2@395 | |
2750 //stru6 *v200; // eax@395 | |
2751 //__int16 v201; // ST18_2@395 | |
2752 //stru6 *v202; // eax@395 | |
2753 //__int16 v203; // ST18_2@395 | |
2754 //stru6 *v204; // eax@395 | |
0 | 2755 signed int v205; // edi@405 |
2756 int v206; // eax@407 | |
2757 __int16 v207; // cx@407 | |
2758 int v208; // eax@411 | |
2759 signed int v209; // ecx@412 | |
2760 int v210; // edx@412 | |
2761 signed int v211; // ecx@412 | |
2762 int v212; // eax@413 | |
2763 int v213; // eax@413 | |
2764 int v214; // eax@413 | |
2765 int v215; // eax@415 | |
2766 double v216; // st7@415 | |
2767 double v217; // st6@415 | |
2768 signed __int64 v218; // qtt@423 | |
2769 int v219; // ecx@425 | |
2770 int v220; // ecx@426 | |
2771 int v221; // edi@428 | |
2772 char *v222; // edi@434 | |
2773 char v223; // al@438 | |
2774 int v224; // ecx@442 | |
2775 int v225; // ecx@443 | |
2776 int v226; // eax@451 | |
2777 int v227; // esi@453 | |
2778 unsigned int v228; // edi@454 | |
2779 int v229; // edi@466 | |
488 | 2780 //__int16 v230; // ST18_2@469 |
2781 //stru6 *v231; // eax@469 | |
2782 //signed int v232; // esi@469 | |
2783 //__int16 v233; // ST18_2@469 | |
2784 //stru6 *v234; // eax@469 | |
2785 //__int16 v235; // ST18_2@469 | |
2786 //stru6 *v236; // eax@469 | |
2787 //__int16 v237; // ST18_2@469 | |
2788 //stru6 *v238; // eax@469 | |
0 | 2789 __int16 v239; // ST1C_2@469 |
2790 char *v240; // ecx@472 | |
2791 double v241; // st7@478 | |
2792 signed __int64 v242; // qax@484 | |
2793 char *v243; // ecx@484 | |
2794 char *v244; // eax@488 | |
2795 int v245; // edi@492 | |
2796 int v246; // eax@492 | |
2797 char *v247; // eax@497 | |
2798 char v248; // al@497 | |
2799 char v249; // cf@500 | |
2800 float v250; // esi@507 | |
2801 char v251; // al@507 | |
2802 int v252; // edx@510 | |
2803 int m; // esi@510 | |
2804 int v254; // eax@513 | |
2805 int v255; // esi@513 | |
2806 int v256; // ecx@513 | |
2807 int v257; // edx@514 | |
2808 int v258; // ecx@514 | |
2809 char v259; // al@516 | |
2810 int v260; // eax@518 | |
2811 int v261; // esi@519 | |
2812 int v262; // edx@521 | |
2813 int v263; // ecx@521 | |
2814 int v264; // esi@521 | |
2815 int v265; // edx@521 | |
2816 int *ii; // eax@522 | |
2817 int v267; // eax@524 | |
2818 int v268; // eax@524 | |
2819 int v269; // eax@526 | |
2820 char *v270; // eax@531 | |
2821 char v271; // al@531 | |
2822 char v272; // cf@534 | |
2823 float v273; // esi@541 | |
2824 char v274; // al@541 | |
2825 int v275; // edx@544 | |
2826 int k; // esi@544 | |
2827 int v277; // edx@548 | |
2828 int v278; // ecx@548 | |
2829 char v279; // al@550 | |
2830 int v280; // eax@552 | |
2831 int v281; // esi@553 | |
2832 int v282; // edx@555 | |
2833 int v283; // ecx@555 | |
2834 int v284; // esi@555 | |
2835 int v285; // edx@555 | |
2836 int *l; // eax@556 | |
2837 int v287; // eax@558 | |
2838 int v288; // eax@558 | |
2839 ItemGen *v289; // eax@560 | |
2840 signed int v290; // eax@560 | |
2841 unsigned __int8 v291; // al@564 | |
2842 char v292; // al@573 | |
2843 int v293; // eax@575 | |
2844 ItemGen *v294; // esi@575 | |
2845 int v295; // edx@575 | |
2846 int kk; // edi@575 | |
2847 int v297; // edx@579 | |
2848 int v298; // ecx@579 | |
2849 char v299; // al@581 | |
2850 int v300; // eax@583 | |
2851 int v301; // edi@584 | |
2852 int v302; // edx@586 | |
2853 int v303; // ecx@586 | |
2854 int v304; // edi@586 | |
2855 int v305; // edx@586 | |
2856 int *jj; // eax@587 | |
2857 int v307; // eax@589 | |
2858 int v308; // eax@589 | |
2859 char *v309; // ecx@593 | |
2860 char v310; // sf@593 | |
2861 unsigned __int8 v311; // of@593 | |
2862 char v312; // cl@597 | |
488 | 2863 char v313; // al@606pGame->GetStru6() |
0 | 2864 int v314; // edx@607 |
2865 int j; // esi@607 | |
2866 unsigned int v316; // eax@613 | |
2867 const char *v317; // ecx@617 | |
2868 Player *v318; // ecx@619 | |
2869 unsigned int v319; // edi@627 | |
2870 int v320; // ecx@629 | |
2871 int v321; // ecx@630 | |
2872 int v322; // edi@632 | |
2873 int v323; // edi@635 | |
2874 char *v324; // eax@635 | |
2875 Player *v325; // ecx@640 | |
2876 int v326; // eax@643 | |
2877 int v327; // eax@648 | |
2878 int v328; // ecx@651 | |
2879 int v329; // ecx@652 | |
2880 int v330; // edi@654 | |
488 | 2881 //__int16 v331; // ST18_2@658 |
2882 //stru6 *v332; // eax@658 | |
2883 //__int16 v333; // ST18_2@658 | |
2884 //stru6 *v334; // eax@658 | |
2885 //__int16 v335; // ST18_2@658 | |
2886 //stru6 *v336; // eax@658 | |
2887 //__int16 v337; // ST18_2@658 | |
2888 //stru6 *v338; // eax@658 | |
0 | 2889 int v339; // ecx@659 |
2890 int v340; // ecx@660 | |
2891 int v341; // eax@663 | |
2892 signed int v342; // edi@668 | |
2893 signed int v343; // edi@670 | |
2894 unsigned __int64 v344; // ST08_8@670 | |
488 | 2895 //__int16 v345; // ST1C_2@671 |
2896 //__int16 v346; // ST18_2@671 | |
2897 //stru6 *v347; // eax@671 | |
0 | 2898 int v348; // ecx@672 |
2899 int v349; // ecx@673 | |
2900 int v350; // edi@676 | |
2901 Player *v351; // edi@680 | |
488 | 2902 //__int16 v352; // ST18_2@685 |
2903 //stru6 *v353; // eax@685 | |
0 | 2904 int v354; // ecx@686 |
2905 int v355; // ecx@687 | |
2906 int v356; // eax@689 | |
112 | 2907 Player *v357; // edi@694 |
488 | 2908 //unsigned __int16 v358; // ST1C_2@695 |
2909 //__int16 v359; // ST18_2@695 | |
2910 //stru6 *v360; // eax@695 | |
2911 //__int16 v361; // ST1C_2@697 | |
2912 //__int16 v362; // ST18_2@697 | |
2913 //stru6 *v363; // eax@697 | |
0 | 2914 int v364; // ecx@698 |
2915 int v365; // ecx@699 | |
2916 int v366; // eax@701 | |
488 | 2917 //stru6 *v367; // eax@704 |
0 | 2918 int v368; // eax@704 |
2919 Actor *v369; // edi@705 | |
2920 int v370; // eax@706 | |
2921 int v371; // ecx@709 | |
2922 int v372; // ecx@710 | |
2923 int v373; // eax@715 | |
2924 int v374; // eax@717 | |
112 | 2925 Player *v375; // edi@717 |
0 | 2926 int v376; // eax@717 |
2927 Player *v377; // ecx@719 | |
2928 int v378; // ecx@721 | |
2929 int v379; // ecx@722 | |
2930 int v380; // eax@724 | |
2931 int v381; // edi@727 | |
2932 int v382; // ecx@727 | |
2933 Player *v383; // eax@728 | |
2934 int v384; // eax@733 | |
2935 int v385; // edi@736 | |
2936 signed int v386; // eax@736 | |
2937 Player *v387; // edi@738 | |
2938 int v388; // edi@740 | |
488 | 2939 //unsigned __int16 v389; // ST1C_2@740 |
2940 //__int16 v390; // ST18_2@740 | |
2941 //stru6 *v391; // eax@740 | |
0 | 2942 int v392; // ecx@742 |
2943 int v393; // ecx@743 | |
2944 int v394; // ecx@744 | |
2945 int v395; // edi@747 | |
2946 int v396; // eax@752 | |
2947 int v397; // eax@757 | |
2948 int v398; // eax@757 | |
2949 int v399; // eax@757 | |
2950 char *v400; // esi@757 | |
488 | 2951 //Game *v401; // ecx@759 |
2952 //__int16 v402; // ST1C_2@759 | |
2953 //__int16 v403; // ST18_2@759 | |
2954 //stru6 *v404; // eax@759 | |
0 | 2955 int v405; // ecx@761 |
2956 int v406; // ecx@762 | |
2957 int v407; // edi@765 | |
488 | 2958 //__int16 v408; // ST1C_2@769 |
2959 //__int16 v409; // ST18_2@769 | |
2960 //stru6 *v410; // eax@769 | |
0 | 2961 int v411; // ecx@772 |
2962 int v412; // ecx@773 | |
2963 int v413; // edi@775 | |
488 | 2964 //__int16 v414; // ST1C_2@781 |
2965 //__int16 v415; // ST18_2@781 | |
2966 //stru6 *v416; // eax@781 | |
0 | 2967 int v417; // eax@787 |
2968 int v418; // ecx@789 | |
2969 __int16 v419; // ax@791 | |
2970 signed int v420; // eax@793 | |
2971 int v421; // edx@793 | |
2972 const char *v422; // eax@801 | |
2973 int v423; // ecx@808 | |
2974 int v424; // ecx@809 | |
2975 int v425; // eax@811 | |
2976 signed int v426; // eax@815 | |
2977 signed int v427; // eax@820 | |
2978 int v428; // ecx@825 | |
2979 int v429; // ecx@826 | |
2980 int v430; // eax@828 | |
488 | 2981 //stru6 *v431; // eax@831 |
0 | 2982 int v432; // eax@831 |
2983 Actor *v433; // edi@832 | |
2984 int v434; // eax@833 | |
2985 int v435; // ecx@837 | |
2986 int v436; // ecx@838 | |
488 | 2987 //__int16 v437; // ST1C_2@843 |
2988 //__int16 v438; // ST18_2@843 | |
2989 //stru6 *v439; // eax@843 | |
0 | 2990 int v440; // eax@843 |
2991 int v441; // eax@847 | |
2992 int v442; // ecx@850 | |
2993 int v443; // ecx@851 | |
2994 int v444; // eax@853 | |
2995 signed int v445; // edi@857 | |
2996 int v446; // ecx@862 | |
2997 LevelDecoration *v447; // edi@864 | |
2998 __int16 v448; // ax@864 | |
2999 char *v449; // esi@870 | |
3000 int v450; // eax@870 | |
3001 int v451; // ecx@875 | |
3002 int v452; // ecx@876 | |
3003 int v453; // edi@878 | |
488 | 3004 //__int16 v454; // ST1C_2@884 |
3005 //__int16 v455; // ST18_2@884 | |
3006 //stru6 *v456; // eax@884 | |
0 | 3007 int v457; // ecx@887 |
3008 int v458; // ecx@888 | |
3009 int v459; // eax@890 | |
3010 signed int v460; // eax@895 | |
3011 Actor *v461; // eax@897 | |
3012 unsigned __int16 v462; // cx@897 | |
3013 signed int v463; // edx@897 | |
3014 int v464; // ecx@905 | |
3015 int v465; // ecx@906 | |
3016 int v466; // edi@909 | |
488 | 3017 //__int16 v467; // ST1C_2@913 |
3018 //__int16 v468; // ST18_2@913 | |
3019 //stru6 *v469; // eax@913 | |
0 | 3020 int v470; // edi@913 |
3021 int v471; // eax@917 | |
3022 int v472; // eax@917 | |
3023 char *v473; // esi@918 | |
488 | 3024 //__int16 v474; // ST18_2@920 |
3025 //stru6 *v475; // eax@920 | |
3026 //__int16 v476; // ST18_2@920 | |
3027 //stru6 *v477; // eax@920 | |
3028 //__int16 v478; // ST18_2@920 | |
3029 //stru6 *v479; // eax@920 | |
3030 //__int16 v480; // ST18_2@920 | |
3031 //stru6 *v481; // eax@920 | |
3032 //__int16 v482; // ST18_2@923 | |
3033 //stru6 *v483; // eax@923 | |
3034 //__int16 v484; // ST18_2@923 | |
3035 //stru6 *v485; // eax@923 | |
3036 //__int16 v486; // ST18_2@923 | |
3037 //stru6 *v487; // eax@923 | |
3038 //__int16 v488; // ST18_2@923 | |
3039 //stru6 *v489; // eax@923 | |
3040 //__int16 v490; // ST1C_2@924 | |
3041 //__int16 v491; // ST18_2@924 | |
3042 //stru6 *v492; // eax@924 | |
0 | 3043 int v493; // ecx@925 |
3044 int v494; // ecx@926 | |
488 | 3045 //__int16 v495; // ST1C_2@931 |
3046 //__int16 v496; // ST18_2@931 | |
3047 //stru6 *v497; // eax@931 | |
0 | 3048 int v498; // edi@931 |
3049 int v499; // eax@935 | |
3050 int v500; // eax@935 | |
3051 Player *v501; // edi@939 | |
488 | 3052 //__int16 v502; // ST18_2@940 |
3053 //stru6 *v503; // eax@940 | |
3054 //stru6 *v504; // eax@943 | |
0 | 3055 int v505; // eax@943 |
3056 int v506; // eax@943 | |
3057 int v507; // edi@944 | |
3058 int v508; // eax@944 | |
3059 signed int v509; // eax@944 | |
3060 signed int v510; // edi@944 | |
3061 Actor *v511; // edi@946 | |
3062 int v512; // eax@946 | |
3063 SpellBuff *v513; // edi@946 | |
3064 int v514; // ecx@950 | |
3065 int v515; // ecx@951 | |
3066 int v516; // eax@953 | |
3067 int v517; // eax@956 | |
90 | 3068 Actor *v518; // edx@957 |
0 | 3069 __int16 v519; // cx@958 |
3070 int v520; // ecx@968 | |
3071 int v521; // ecx@969 | |
3072 int v522; // eax@971 | |
488 | 3073 //__int16 v523; // ST18_2@975 |
3074 //stru6 *v524; // eax@975 | |
3075 //__int16 v525; // ST18_2@975 | |
3076 //stru6 *v526; // eax@975 | |
3077 //__int16 v527; // ST18_2@975 | |
3078 //stru6 *v528; // eax@975 | |
3079 //__int16 v529; // ST18_2@975 | |
3080 //stru6 *v530; // eax@975 | |
0 | 3081 int v531; // eax@982 |
3082 int v532; // eax@982 | |
3083 int v533; // edi@983 | |
3084 int v534; // eax@983 | |
3085 signed int v535; // eax@983 | |
3086 signed int v536; // edi@983 | |
3087 stru6 *v537; // eax@984 | |
3088 int v538; // ecx@985 | |
3089 int v539; // ecx@986 | |
3090 int v540; // eax@988 | |
488 | 3091 //__int16 v541; // ST18_2@991 |
3092 //stru6 *v542; // eax@991 | |
3093 //__int16 v543; // ST18_2@991 | |
3094 //stru6 *v544; // eax@991 | |
3095 //__int16 v545; // ST18_2@991 | |
3096 //stru6 *v546; // eax@991 | |
3097 //__int16 v547; // ST18_2@991 | |
0 | 3098 stru6 *v548; // eax@991 |
3099 double v549; // st7@991 | |
3100 unsigned __int16 v550; // di@991 | |
3101 int v551; // ecx@993 | |
3102 int v552; // ecx@994 | |
89 | 3103 Player *v553; // edi@1001 |
488 | 3104 //__int16 v554; // ST18_2@1002 |
3105 //stru6 *v555; // eax@1002 | |
3106 //__int16 v556; // ST18_2@1002 | |
3107 //stru6 *v557; // eax@1002 | |
3108 //__int16 v558; // ST18_2@1002 | |
3109 //stru6 *v559; // eax@1002 | |
3110 //__int16 v560; // ST18_2@1002 | |
3111 //stru6 *v561; // eax@1002 | |
0 | 3112 unsigned __int16 v562; // di@1005 |
3113 signed int v563; // eax@1010 | |
3114 unsigned int v564; // ecx@1011 | |
3115 signed int v565; // eax@1012 | |
3116 Player **v566; // ecx@1012 | |
3117 int v567; // eax@1012 | |
488 | 3118 //unsigned __int16 v568; // ST1C_2@1012 |
3119 //__int16 v569; // ST18_2@1012 | |
3120 //stru6 *v570; // eax@1012 | |
0 | 3121 Player *v571; // eax@1013 |
3122 char *v572; // ecx@1013 | |
3123 int v573; // ecx@1017 | |
3124 int v574; // ecx@1018 | |
3125 int v575; // eax@1020 | |
3126 signed int v576; // eax@1025 | |
3127 Player *v577; // eax@1026 | |
3128 int v578; // eax@1028 | |
3129 __int16 v579; // ax@1029 | |
3130 int v580; // eax@1031 | |
3131 int v581; // edi@1031 | |
3132 int v582; // eax@1031 | |
488 | 3133 //__int16 v583; // ST1C_2@1034 |
3134 //__int16 v584; // ST18_2@1034 | |
0 | 3135 char *v585; // esi@1034 |
488 | 3136 //stru6 *v586; // eax@1034 |
0 | 3137 signed int v587; // eax@1035 |
3138 int v588; // ecx@1036 | |
3139 int v589; // ecx@1037 | |
3140 int v590; // ecx@1038 | |
3141 char v591; // al@1048 | |
3142 int v592; // esi@1052 | |
3143 int v593; // ecx@1057 | |
3144 int v594; // ecx@1058 | |
3145 int v595; // eax@1064 | |
3146 int v596; // esi@1066 | |
3147 unsigned int v597; // edi@1067 | |
3148 int v598; // eax@1079 | |
3149 signed int v599; // eax@1082 | |
3150 int v600; // edi@1086 | |
3151 int v601; // edx@1086 | |
3152 int v602; // eax@1086 | |
3153 int v603; // ecx@1086 | |
3154 int v604; // eax@1087 | |
3155 char *v605; // eax@1089 | |
3156 int v606; // edx@1091 | |
3157 int v607; // ecx@1100 | |
3158 __int16 v608; // ax@1102 | |
3159 signed int v609; // eax@1104 | |
3160 int v610; // edi@1106 | |
3161 unsigned int v611; // eax@1106 | |
89 | 3162 Player *v612; // edi@1106 |
3163 DDM_DLV_Header *v613; // eax@1108 | |
0 | 3164 int v614; // eax@1116 |
3165 int v615; // edi@1119 | |
488 | 3166 //__int16 v616; // ST1C_2@1122 |
3167 //__int16 v617; // ST18_2@1122 | |
3168 //stru6 *v618; // eax@1122 | |
112 | 3169 Player *v619; // edi@1123 |
488 | 3170 //unsigned __int16 v620; // ST1C_2@1124 |
3171 //__int16 v621; // ST18_2@1124 | |
3172 //stru6 *v622; // eax@1124 | |
0 | 3173 signed __int64 v623; // qax@1127 |
3174 int v624; // eax@1127 | |
3175 int v625; // edi@1129 | |
3176 int v626; // eax@1129 | |
3177 signed int v627; // eax@1129 | |
3178 signed int v628; // edi@1129 | |
3179 int v629; // ecx@1130 | |
3180 Player *v630; // eax@1131 | |
3181 int v631; // eax@1137 | |
3182 int v632; // edi@1140 | |
3183 Player *v633; // eax@1140 | |
3184 signed int v634; // eax@1140 | |
3185 int v635; // edi@1142 | |
488 | 3186 //unsigned __int16 v636; // ST1C_2@1142 |
3187 //__int16 v637; // ST18_2@1142 | |
3188 //stru6 *v638; // eax@1142 | |
3189 //stru6 *v639; // eax@1143 | |
0 | 3190 int v640; // ecx@1146 |
3191 int v641; // ecx@1147 | |
3192 int v642; // edi@1156 | |
3193 int v643; // eax@1156 | |
3194 int v644; // eax@1156 | |
3195 signed int v645; // eax@1158 | |
488 | 3196 //Player *v646; // ebx@1169 |
3197 //int v647; // edi@1169 | |
3198 //signed int v648; // ST1C_4@1170 | |
3199 //Player *v649; // ecx@1170 | |
3200 //unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3201 //unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3202 //unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3203 //unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
0 | 3204 int v654; // [sp-4h] [bp-E88h]@124 |
488 | 3205 //unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 |
0 | 3206 unsigned int v656; // [sp-4h] [bp-E88h]@639 |
3207 int v657; // [sp-4h] [bp-E88h]@807 | |
488 | 3208 //int v658; // [sp+0h] [bp-E84h]@100 |
0 | 3209 int v659; // [sp+0h] [bp-E84h]@123 |
3210 int v660; // [sp+0h] [bp-E84h]@146 | |
3211 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
488 | 3212 //int v662; // [sp+0h] [bp-E84h]@304 |
0 | 3213 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 |
3214 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3215 int v665; // [sp+0h] [bp-E84h]@807 | |
3216 int v666; // [sp+4h] [bp-E80h]@12 | |
3217 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
488 | 3218 //unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 |
0 | 3219 int v669; // [sp+4h] [bp-E80h]@123 |
3220 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3221 int v671; // [sp+4h] [bp-E80h]@146 | |
3222 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
488 | 3223 //unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 |
0 | 3224 __int16 v674; // [sp+4h] [bp-E80h]@684 |
3225 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3226 int v676; // [sp+4h] [bp-E80h]@807 | |
3227 int v677; // [sp+4h] [bp-E80h]@861 | |
3228 int v678; // [sp+4h] [bp-E80h]@997 | |
3229 int v679; // [sp+14h] [bp-E70h]@515 | |
3230 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3231 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3232 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3233 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3234 int v684; // [sp+D04h] [bp-180h]@416 | |
3235 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3236 int x; // [sp+D20h] [bp-164h]@327 | |
3237 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3238 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3239 int v689; // [sp+D30h] [bp-154h]@943 | |
3240 int v690; // [sp+D34h] [bp-150h]@943 | |
3241 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3242 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3243 int v693; // [sp+D40h] [bp-144h]@137 | |
3244 int v694; // [sp+D44h] [bp-140h]@982 | |
3245 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3246 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3247 int v697; // [sp+D50h] [bp-134h]@129 | |
3248 int v698; // [sp+D54h] [bp-130h]@129 | |
3249 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3250 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3251 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3252 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3253 int v703; // [sp+D70h] [bp-114h]@286 | |
3254 int v704; // [sp+D74h] [bp-110h]@132 | |
3255 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3256 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3257 int v707; // [sp+D80h] [bp-104h]@1127 | |
3258 int v708; // [sp+D84h] [bp-100h]@1127 | |
3259 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3260 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3261 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3262 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3263 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3264 int n; // [sp+DA0h] [bp-E4h]@1 | |
3265 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3266 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3267 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3268 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3269 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3270 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3271 int v721; // [sp+DD8h] [bp-ACh]@163 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3272 //SpriteObject a1; // [sp+DDCh] [bp-A8h]@1 |
0 | 3273 int v723; // [sp+E4Ch] [bp-38h]@1 |
3274 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3275 float v725; // [sp+E54h] [bp-30h]@23 | |
3276 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3277 int v726b; |
0 | 3278 float v727; // [sp+E5Ch] [bp-28h]@1 |
3279 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3280 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3281 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3282 Player *v730b; |
3283 ItemGen *v730c; | |
0 | 3284 int v731; // [sp+E6Ch] [bp-18h]@48 |
3285 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3286 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3287 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3288 int amount; // [sp+E80h] [bp-4h]@1 | |
3289 | |
3290 auto ecx0 = this; | |
3291 | |
3292 v711 = ecx0; | |
3293 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3294 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
|
3295 //SpriteObject::SpriteObject(&a1); |
0 | 3296 |
486 | 3297 //v1 = 0; |
0 | 3298 v2 = 0; |
3299 amount = 0; | |
3300 LODWORD(v733) = 0; | |
3301 v723 = 0; | |
3302 v727 = 0.0; | |
3303 n = 0; | |
3304 while ( 1 ) | |
3305 { | |
3306 v3 = &v711[n]; | |
3307 HIDWORD(v733) = (int)v3; | |
486 | 3308 if ( v3->spellnum == 0 ) |
0 | 3309 goto LABEL_1166; |
486 | 3310 |
3311 if (pParty->Invisible()) | |
3312 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
3313 | |
0 | 3314 if ( v3->field_8 & 0x3CA ) |
3315 { | |
3316 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3317 v711->_427D48(1u); | |
3318 goto LABEL_1166; | |
3319 } | |
3320 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
488 | 3321 |
3322 a2 = v3->spell_target_pid; | |
3323 if (!a2) | |
0 | 3324 { |
488 | 3325 if (v3->spellnum == SPELL_LIGHT_DESTROY_UNDEAD || |
3326 v3->spellnum == SPELL_SPIRIT_TURN_UNDEAD || | |
3327 v3->spellnum == SPELL_DARK_CONTROL_UNDEAD ) | |
3328 v666 = 1; | |
3329 else | |
3330 v666 = 0; | |
3331 | |
3332 a2 = stru_50C198.FindClosestActor(5120, 1, v666); | |
3333 v6 = pMouse->uPointingObjectID; | |
3334 if ( pMouse->uPointingObjectID && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) | |
3335 a2 = pMouse->uPointingObjectID; | |
0 | 3336 } |
488 | 3337 |
3338 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3339 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
|
3340 if (a1.uType) |
0 | 3341 { |
141 | 3342 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3343 { |
141 | 3344 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3345 v2 = v723; |
3346 } | |
3347 else | |
3348 { | |
3349 v715.uYawAngle = pParty->sRotationY; | |
3350 v715.uPitchAngle = pParty->sRotationX; | |
3351 } | |
3352 } | |
488 | 3353 |
486 | 3354 LODWORD(v725) = 0; |
3355 _this = 0; | |
488 | 3356 if (v3->forced_spell_skill_level) |
3357 { | |
3358 v11 = v3->forced_spell_skill_level; | |
3359 v723 = v11 & 0x3F; | |
3360 v2 = v723; | |
3361 } | |
3362 else | |
0 | 3363 { |
488 | 3364 //v667 = PLAYER_SKILL_STAFF; |
3365 if (v3->spellnum < SPELL_AIR_WIZARD_EYE) | |
3366 v667 = PLAYER_SKILL_FIRE; | |
3367 else if (v3->spellnum < SPELL_WATER_AWAKEN) | |
3368 v667 = PLAYER_SKILL_AIR; | |
3369 else if (v3->spellnum < SPELL_EARTH_STUN) | |
3370 v667 = PLAYER_SKILL_WATER; | |
3371 else if (v3->spellnum < SPELL_SPIRIT_DETECT_LIFE) | |
3372 v667 = PLAYER_SKILL_EARTH; | |
3373 else if (v3->spellnum < SPELL_MIND_REMOVE_FEAR) | |
3374 v667 = PLAYER_SKILL_SPIRIT; | |
3375 else if (v3->spellnum < SPELL_BODY_CURE_WEAKNESS) | |
3376 v667 = PLAYER_SKILL_MIND; | |
3377 else if (v3->spellnum < SPELL_LIGHT_LIGHT_BOLT) | |
3378 v667 = PLAYER_SKILL_BODY; | |
3379 else if (v3->spellnum < SPELL_DARK_REANIMATE) | |
3380 v667 = PLAYER_SKILL_LIGHT; | |
3381 else if (v3->spellnum < SPELL_BOW_ARROW) | |
3382 v667 = PLAYER_SKILL_DARK; | |
3383 else if (v3->spellnum == SPELL_BOW_ARROW) | |
3384 v667 = PLAYER_SKILL_BOW; | |
3385 else assert(false && "Unknown spell"); | |
3386 | |
0 | 3387 LODWORD(v725) = v667; |
488 | 3388 v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F; |
3389 v2 = v723; | |
3390 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
0 | 3391 } |
488 | 3392 |
0 | 3393 if ( HIBYTE(v11) & 1 ) |
3394 { | |
3395 v12 = 4; | |
3396 v731 = 4; | |
3397 } | |
3398 else | |
3399 { | |
3400 if ( (v11 & 0x80u) == 0 ) | |
3401 { | |
3402 v731 = ((v11 & 0x40) != 0) + 1; | |
3403 } | |
3404 else | |
3405 { | |
3406 v731 = 3; | |
3407 } | |
3408 v12 = v731; | |
3409 } | |
488 | 3410 |
3411 v730 = v3->spellnum; | |
3412 if (v3->forced_spell_skill_level) | |
486 | 3413 uRequiredMana = 0; |
488 | 3414 else |
3415 uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v12 - 1]; | |
3416 sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v12 - 1]; | |
3417 | |
3418 if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || | |
490 | 3419 LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) |
486 | 3420 uRequiredMana = 0; |
488 | 3421 |
3422 if (v3->spellnum >= PLAYER_SKILL_BOW || pPlayer->sMana >= uRequiredMana) | |
0 | 3423 break; |
488 | 3424 |
3425 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points" | |
0 | 3426 LABEL_203: |
486 | 3427 v3->spellnum = 0; |
0 | 3428 LABEL_1166: |
3429 ++n; | |
3430 if ( n >= 10 ) | |
3431 return; | |
3432 } | |
488 | 3433 |
3434 if (pPlayer->Cursed() && v730 < SPELL_BOW_ARROW) | |
3435 if (rand() % 100 < 50) | |
3436 { | |
3437 if ( pParty->bTurnBasedModeOn == 0 ) | |
3438 { | |
3439 //v646 = pPlayer; | |
3440 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
3441 //v647 = n; | |
3442 } | |
3443 else | |
3444 { | |
3445 //v647 = n; | |
3446 //v646 = pPlayer; | |
3447 //v648 = sRecoveryTime; | |
3448 //v649 = pPlayer; | |
3449 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
3450 pPlayer->SetRecoveryTime(sRecoveryTime); | |
3451 pTurnEngine->_40471C(); | |
3452 } | |
3453 | |
3454 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); // "Spell failed" | |
3455 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
3456 v711[n].spellnum = 0; | |
3457 pPlayer->sMana -= uRequiredMana; | |
3458 return; | |
3459 } | |
3460 | |
0 | 3461 switch ( v3->spellnum ) |
3462 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3463 case SPELL_101: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3464 assert(false && "Unknown spell effect #101 (prolly flaming bow arrow"); |
488 | 3465 case SPELL_BOW_ARROW: |
0 | 3466 v17 = pPlayer; |
3467 _this = (ItemGen *)1; | |
488 | 3468 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 ) |
0 | 3469 _this = (ItemGen *)2; |
3470 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3471 a1.stru_24.Reset(); | |
3472 v18 = v3->spellnum; | |
3473 a1.field_4C = v2; | |
3474 a1.field_48 = v18; | |
3475 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3476 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3477 if ( v17->WearsItem(510, 2) ) |
3478 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3479 a1.vPosition.x = pParty->vPosition.x; | |
3480 a1.vPosition.y = pParty->vPosition.y; | |
3481 a1.uAttributes = 0; | |
3482 a1.uSpriteFrameID = 0; | |
3483 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3484 v19 = 8 * v3->uPlayerID; | |
303 | 3485 LOBYTE(v19) = v19 | OBJECT_Player; |
3486 a1.field_58_pid = v19; | |
0 | 3487 a1.field_5C = a2; |
3488 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3489 a1.uFacing = LOWORD(v715.uYawAngle); | |
3490 a1.uSoundID = LOWORD(v3->field_10); | |
3491 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3492 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3493 a1.uAttributes = 256; | |
3494 if ( pParty->bTurnBasedModeOn == 1 ) | |
3495 a1.uAttributes = 260; | |
3496 for ( i = 0; i < (signed int)this; ++i ) | |
3497 { | |
3498 if ( i ) | |
3499 a1.vPosition.z += 32; | |
3500 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3501 if ( a1.Create( | |
3502 v715.uYawAngle, | |
3503 v715.uPitchAngle, | |
3504 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3505 v3->uPlayerID + 1) != -1 | |
3506 && pParty->bTurnBasedModeOn == 1 ) | |
3507 ++pTurnEngine->field_1C; | |
3508 } | |
488 | 3509 goto play_sound_and_continue; |
3510 | |
490 | 3511 case SPELL_LASER_PROJECTILE: |
0 | 3512 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); |
3513 a1.stru_24.Reset(); | |
3514 a1.field_48 = v3->spellnum; | |
3515 a1.field_4C = v723; | |
3516 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3517 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3518 a1.vPosition.x = pParty->vPosition.x; |
3519 a1.vPosition.y = pParty->vPosition.y; | |
3520 a1.uAttributes = 0; | |
3521 a1.uSpriteFrameID = 0; | |
3522 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3523 v22 = 8 * v3->uPlayerID; | |
303 | 3524 LOBYTE(v22) = v22 | OBJECT_Player; |
3525 a1.field_58_pid = v22; | |
0 | 3526 a1.field_5C = a2; |
3527 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3528 a1.uFacing = LOWORD(v715.uYawAngle); | |
3529 a1.uSoundID = LOWORD(v3->field_10); | |
3530 memcpy( | |
3531 &a1.stru_24, | |
3532 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3533 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3534 + 5], | |
3535 sizeof(a1.stru_24)); | |
3536 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3537 HIBYTE(a1.uAttributes) |= 1u; | |
3538 a1.uSectorID = v23; | |
3539 if ( pParty->bTurnBasedModeOn == 1 ) | |
3540 LOBYTE(a1.uAttributes) |= 4u; | |
3541 if ( a1.Create( | |
3542 v715.uYawAngle, | |
3543 v715.uPitchAngle, | |
3544 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3545 v3->uPlayerID + 1) != -1 | |
3546 && pParty->bTurnBasedModeOn == 1 ) | |
3547 ++pTurnEngine->field_1C; | |
488 | 3548 goto play_sound_and_continue; |
3549 | |
3550 case SPELL_FIRE_TORCH_LIGHT: | |
0 | 3551 LODWORD(v733) = 3600 * v2; |
488 | 3552 |
3553 switch (v12) | |
3554 { | |
3555 case 1: amount = 2; break; | |
3556 case 2: amount = 3; break; | |
3557 case 3: | |
3558 case 4: amount = 4; break; | |
3559 default: | |
3560 assert(false); | |
3561 } | |
3562 | |
0 | 3563 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
488 | 3564 goto play_sound_and_continue; |
3565 | |
3566 pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * v2 * 4.2666669), v731, amount, 0, 0); | |
3567 goto LABEL_1056; | |
3568 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3569 case SPELL_FIRE_FIRE_SPIKE: |
0 | 3570 v29 = v12 - 2; |
3571 if ( v29 ) | |
3572 { | |
3573 v30 = v29 - 1; | |
3574 if ( v30 ) | |
3575 { | |
3576 if ( v30 == 1 ) | |
3577 amount = 9; | |
3578 else | |
3579 amount = 3; | |
3580 } | |
3581 else | |
3582 { | |
3583 amount = 7; | |
3584 } | |
3585 } | |
3586 else | |
3587 { | |
3588 amount = 5; | |
3589 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3590 //v31 = v3->uPlayerID; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3591 //v32 = 8 * v31; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3592 //LOBYTE(v32) = v32 | OBJECT_Player; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3593 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3594 //if ( (signed int)uNumSpriteObjects > 0 ) |
486 | 3595 HIDWORD(v733) = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3596 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
|
3597 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3598 auto object = pSpriteObjects + i; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3599 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
|
3600 ++HIDWORD(v733); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3601 /*v33 = (char *)&pSpriteObjects[0].field_48; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3602 v730 = uNumSpriteObjects; |
0 | 3603 do |
3604 { | |
486 | 3605 if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) |
0 | 3606 ++HIDWORD(v733); |
3607 v33 += 112; | |
3608 --v730; | |
3609 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3610 while ( v730 );*/ |
0 | 3611 } |
3612 if ( SHIDWORD(v733) > amount ) | |
3613 goto LABEL_200; | |
3614 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3615 goto play_sound_and_continue; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3616 |
0 | 3617 a1.stru_24.Reset(); |
3618 a1.field_48 = v3->spellnum; | |
3619 a1.field_4C = v2; | |
3620 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3621 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3622 a1.vPosition.y = pParty->vPosition.y; |
3623 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3624 a1.uAttributes = 0; |
0 | 3625 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3626 a1.uSectorID = pIndoor->GetSector( | |
3627 pParty->vPosition.x, | |
3628 pParty->vPosition.y, | |
3629 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3630 a1.uSpriteFrameID = 0; |
0 | 3631 v34 = 8 * v3->uPlayerID; |
303 | 3632 LOBYTE(v34) = v34 | OBJECT_Player; |
3633 a1.field_58_pid = v34; | |
0 | 3634 a1.field_5C = a2; |
3635 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3636 a1.uFacing = LOWORD(v715.uYawAngle); | |
3637 a1.uSoundID = LOWORD(v3->field_10); | |
3638 if ( pParty->bTurnBasedModeOn == 1 ) | |
3639 LOBYTE(a1.uAttributes) |= 4u; | |
3640 v669 = v3->uPlayerID + 1; | |
3641 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3642 v35 = pParty->sRotationX + 10; | |
3643 goto LABEL_124; | |
3644 case 20: | |
3645 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3646 goto play_sound_and_continue; |
486 | 3647 if (!a2) |
0 | 3648 goto LABEL_200; |
141 | 3649 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3650 goto LABEL_1056; |
486 | 3651 v699 = 0; |
3652 v698 = 0; | |
3653 v697 = 0; | |
0 | 3654 a1.stru_24.Reset(); |
3655 a1.field_48 = v3->spellnum; | |
3656 a1.field_4C = v2; | |
3657 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3658 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 3659 a1.uAttributes = 0; |
3660 a1.uSectorID = 0; | |
3661 a1.uSpriteFrameID = 0; | |
0 | 3662 v37 = v3->uPlayerID; |
3663 a1.field_60_distance_related_prolly_lod = 0; | |
3664 v37 *= 8; | |
303 | 3665 LOBYTE(v37) = v37 | OBJECT_Player; |
486 | 3666 a1.uFacing = 0; |
303 | 3667 a1.field_58_pid = v37; |
0 | 3668 v38 = a2 >> 3; |
3669 a1.uSoundID = LOWORD(v3->field_10); | |
3670 v39 = a2 >> 3; | |
3671 a1.vPosition.x = pActors[v39].vPosition.x; | |
3672 v40 = pActors[v39].vPosition.y; | |
3673 a1.vPosition.z = pActors[v39].vPosition.z; | |
3674 v41 = 8 * (a2 >> 3); | |
3675 a1.vPosition.y = v40; | |
486 | 3676 LOBYTE(v41) = v41 | OBJECT_Actor; |
0 | 3677 a1.field_5C = v41; |
486 | 3678 v42 = a1.Create(0, 0, 0, 0); |
0 | 3679 v43 = &v697; |
3680 goto LABEL_133; | |
3681 case 44: | |
3682 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3683 goto play_sound_and_continue; |
0 | 3684 v726 = (Player *)(a2 >> 3); |
3685 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3686 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3687 goto LABEL_1056; |
90 | 3688 pActors[a2 >> 3].pActorBuffs[10].Apply( |
486 | 3689 pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); |
3690 v706 = 0; | |
3691 v705 = 0; | |
3692 v704 = 0; | |
0 | 3693 a1.stru_24.Reset(); |
3694 a1.field_48 = v3->spellnum; | |
3695 a1.field_4C = v2; | |
3696 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3697 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 3698 a1.uAttributes = 0; |
3699 a1.uSectorID = 0; | |
3700 a1.uSpriteFrameID = 0; | |
0 | 3701 v44 = v3->uPlayerID; |
3702 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 3703 a1.uFacing = 0; |
0 | 3704 v44 *= 8; |
303 | 3705 LOBYTE(v44) = v44 | OBJECT_Player; |
0 | 3706 v38 = (signed int)v726; |
303 | 3707 a1.field_58_pid = v44; |
0 | 3708 a1.uSoundID = LOWORD(v3->field_10); |
3709 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3710 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3711 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3712 v46 = 8 * (int)v726; | |
3713 a1.vPosition.y = v45; | |
486 | 3714 LOBYTE(v46) = 8 * (char)v726 | OBJECT_Actor; |
0 | 3715 a1.field_5C = v46; |
486 | 3716 v42 = a1.Create(0, 0, 0, 0); |
0 | 3717 v43 = &v704; |
3718 LABEL_133: | |
3719 v670 = (Vec3_int_ *)v43; | |
3720 v47 = v38; | |
3721 goto LABEL_139; | |
3722 case 79: | |
486 | 3723 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || (a2 & 7) != OBJECT_Actor) |
488 | 3724 goto play_sound_and_continue; |
0 | 3725 v730 = a2 >> 3; |
486 | 3726 v693 = 0; |
0 | 3727 HIDWORD(v733) = (int)&pActors[a2 >> 3]; |
486 | 3728 v692 = 0; |
3729 v691 = 0; | |
0 | 3730 a1.stru_24.Reset(); |
3731 a1.field_48 = v3->spellnum; | |
3732 a1.field_4C = v2; | |
3733 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3734 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3735 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); |
3736 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3737 v48 = *(short *)(HIDWORD(v733) + 138); | |
3738 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
486 | 3739 a1.uAttributes = 0; |
0 | 3740 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); |
486 | 3741 a1.uSpriteFrameID = 0; |
0 | 3742 v49 = 8 * v3->uPlayerID; |
303 | 3743 LOBYTE(v49) = v49 | OBJECT_Player; |
3744 a1.field_58_pid = v49; | |
0 | 3745 a1.field_5C = a2; |
3746 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3747 a1.uFacing = LOWORD(v715.uYawAngle); | |
3748 LOWORD(v49) = LOWORD(v3->field_10); | |
3749 LOBYTE(a1.uAttributes) |= 0x80u; | |
3750 a1.uSoundID = v49; | |
486 | 3751 v726 = (Player *)a1.Create(0, 0, 0, 0); |
0 | 3752 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) |
3753 goto LABEL_200; | |
3754 v47 = v730; | |
3755 v670 = (Vec3_int_ *)&v691; | |
3756 v42 = (signed int)v726; | |
3757 LABEL_139: | |
3758 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3759 goto LABEL_1056; | |
3760 case 2: | |
3761 case 6: | |
3762 case 11: | |
3763 case 18: | |
3764 case 26: | |
3765 case 32: | |
3766 case 34: | |
3767 case 37: | |
3768 case 57: | |
3769 case 65: | |
3770 case 70: | |
3771 case 78: | |
3772 case 97: | |
3773 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3774 goto play_sound_and_continue; |
0 | 3775 a1.stru_24.Reset(); |
3776 a1.field_48 = v3->spellnum; | |
3777 a1.field_4C = v2; | |
3778 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3779 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3780 a1.vPosition.y = pParty->vPosition.y; |
3781 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3782 a1.uAttributes = 0; |
0 | 3783 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3784 a1.uSectorID = pIndoor->GetSector( | |
3785 pParty->vPosition.x, | |
3786 pParty->vPosition.y, | |
3787 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3788 a1.uSpriteFrameID = 0; |
0 | 3789 v50 = 8 * v3->uPlayerID; |
303 | 3790 LOBYTE(v50) = v50 | OBJECT_Player; |
3791 a1.field_58_pid = v50; | |
0 | 3792 a1.field_5C = a2; |
3793 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3794 a1.uFacing = LOWORD(v715.uYawAngle); | |
3795 a1.uSoundID = LOWORD(v3->field_10); | |
3796 if ( pParty->bTurnBasedModeOn == 1 ) | |
3797 LOBYTE(a1.uAttributes) |= 4u; | |
3798 if ( v3->spellnum == 18 ) | |
3799 LOBYTE(a1.uAttributes) |= 0x40u; | |
3800 goto LABEL_156; | |
3801 case 29: | |
3802 case 39: | |
3803 case 76: | |
3804 case 90: | |
3805 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3806 goto play_sound_and_continue; |
0 | 3807 a1.stru_24.Reset(); |
3808 a1.field_48 = v3->spellnum; | |
3809 a1.field_4C = v2; | |
3810 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3811 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3812 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
3813 a1.vPosition.y = pParty->vPosition.y; | |
3814 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3815 v660 = pParty->vPosition.y; | |
3816 goto LABEL_153; | |
3817 case 87: | |
3818 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3819 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
3820 goto LABEL_200; | |
3821 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
3822 goto LABEL_152; | |
488 | 3823 goto play_sound_and_continue; |
0 | 3824 case 81: |
3825 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3826 goto play_sound_and_continue; |
486 | 3827 if ( !a2 |
141 | 3828 || (a2 & 7) != OBJECT_Actor |
0 | 3829 || (v730 = a2 >> 3, |
3830 v721 = (int)&pActors[a2 >> 3], | |
3831 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3832 goto LABEL_1056; | |
486 | 3833 Actor::AI_Stand(v730, 4u, 0x80u, 0); |
0 | 3834 v726 = (Player *)(23040 * v2); |
3835 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3836 v55 = v721; | |
486 | 3837 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0); |
0 | 3838 *(char *)(v55 + 38) |= 8u; |
486 | 3839 *(short *)(v55 + 148) = 0; |
3840 v672 = 0; | |
3841 *(short *)(v55 + 150) = 0; | |
0 | 3842 v661 = (Actor *)v55; |
3843 goto LABEL_165; | |
3844 case 35: | |
3845 if ( v12 == 2 ) | |
3846 { | |
3847 v57 = 300 * v2; | |
3848 } | |
3849 else | |
3850 { | |
3851 if ( v12 == 3 ) | |
3852 { | |
3853 amount = 4; | |
3854 v57 = 300 * v2; | |
3855 goto LABEL_174; | |
3856 } | |
3857 if ( v12 == 4 ) | |
3858 { | |
3859 v57 = 300 * v2; | |
3860 amount = 8; | |
3861 goto LABEL_174; | |
3862 } | |
3863 v57 = 180 * v2; | |
3864 } | |
3865 amount = 2; | |
3866 LABEL_174: | |
3867 LODWORD(v733) = v57; | |
3868 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3869 goto play_sound_and_continue; |
141 | 3870 if ( (a2 & 7) != OBJECT_Actor |
0 | 3871 || (v721 = 836 * (a2 >> 3), |
90 | 3872 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3873 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3874 goto LABEL_1056; |
3875 v726 = (Player *)(23040 * v2); | |
3876 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3877 v59 = v721; | |
112 | 3878 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3879 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3880 pParty->uTimePlayed + (signed int)v58, | |
0 | 3881 v731, |
3882 amount, | |
486 | 3883 0, |
3884 0); | |
0 | 3885 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; |
486 | 3886 v672 = 0; |
0 | 3887 v661 = (Actor *)LODWORD(v718); |
3888 goto LABEL_165; | |
3889 case 60: | |
3890 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3891 goto play_sound_and_continue; |
0 | 3892 v730 = 836 * (a2 >> 3); |
90 | 3893 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3894 goto LABEL_1056; |
3895 LODWORD(v733) = 300 * v2; | |
3896 if ( v731 == 2 ) | |
3897 { | |
3898 LODWORD(v733) = 600 * v2; | |
3899 } | |
3900 else | |
3901 { | |
3902 if ( v731 == 3 ) | |
3903 LODWORD(v733) = 29030400; | |
3904 } | |
112 | 3905 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3906 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3907 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3908 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3909 v726 = (Player *)((int)v733 << 7); | |
3910 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3911 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3912 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 3913 v731, 0, 0, 0); |
0 | 3914 a1.stru_24.Reset(); |
3915 a1.field_48 = v3->spellnum; | |
3916 a1.field_4C = v2; | |
3917 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3918 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 3919 v61 = a2 >> 3; |
0 | 3920 goto LABEL_1086; |
3921 case 92: | |
3922 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3923 goto play_sound_and_continue; |
0 | 3924 a1.stru_24.Reset(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3925 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3926 a1.vPosition.x = pParty->vPosition.x; |
3927 a1.vPosition.y = pParty->vPosition.y; | |
486 | 3928 a1.uAttributes = 0; |
0 | 3929 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3930 a1.uSectorID = pIndoor->GetSector( | |
3931 pParty->vPosition.x, | |
3932 pParty->vPosition.y, | |
3933 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3934 a1.uSpriteFrameID = 0; |
0 | 3935 v62 = 8 * v3->uPlayerID; |
303 | 3936 LOBYTE(v62) = v62 | OBJECT_Player; |
3937 a1.field_58_pid = v62; | |
0 | 3938 a1.field_5C = a2; |
3939 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3940 a1.uFacing = LOWORD(v715.uYawAngle); | |
3941 a1.uSoundID = LOWORD(v3->field_10); | |
3942 a1.field_50 = v731; | |
3943 a1.field_48 = 3; | |
3944 a1.field_4C = 300 * v2; | |
3945 goto LABEL_154; | |
3946 case 4: | |
3947 v63 = v12 - 1; | |
3948 if ( !v63 ) | |
3949 { | |
3950 amount = 10; | |
3951 goto LABEL_195; | |
3952 } | |
3953 v64 = v63 - 1; | |
3954 if ( !v64 ) | |
3955 { | |
3956 amount = 11; | |
3957 goto LABEL_195; | |
3958 } | |
3959 v65 = v64 - 1; | |
3960 if ( !v65 ) | |
3961 { | |
3962 amount = 12; | |
3963 LABEL_195: | |
3964 LODWORD(v733) = 3600 * v2; | |
3965 goto LABEL_196; | |
3966 } | |
3967 if ( v65 == 1 ) | |
3968 { | |
486 | 3969 LODWORD(v733) = 0; |
0 | 3970 amount = 12; |
3971 } | |
3972 LABEL_196: | |
3973 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3974 goto play_sound_and_continue; |
89 | 3975 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
3976 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
3977 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
3978 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
3979 { | |
315 | 3980 if (!v730c->Broken()) |
0 | 3981 { |
486 | 3982 if (!v730c->uSpecEnchantmentType) |
0 | 3983 { |
486 | 3984 if (!v730c->uEncantmentType) |
0 | 3985 { |
3986 v68 = BYTE4(v726->pConditions[3]); | |
3987 if ( !v68 || v68 == 1 || v68 == 2 ) | |
3988 { | |
377 | 3989 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
0 | 3990 { |
89 | 3991 v69 = v730c; |
0 | 3992 v14 = v731 == 4; |
3993 *(int *)(v730 + 12) = amount; | |
3994 if ( !v14 ) | |
3995 { | |
3996 v726 = (Player *)((int)v733 << 7); | |
3997 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
3998 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
3999 * 0.033333335); | |
4000 *(int *)(v69 + 20) |= 8u; | |
4001 } | |
4002 *(int *)(v69 + 20) |= 0x10u; | |
4003 LABEL_1055: | |
4004 dword_50C9A8 = 256; | |
4005 LABEL_1056: | |
4006 LODWORD(v727) = 1; | |
488 | 4007 play_sound_and_continue: |
0 | 4008 if ( v3->field_8 & 0x20 ) |
4009 { | |
4010 LABEL_1162: | |
4011 if ( v727 != 0.0 ) | |
4012 pAudioPlayer->PlaySound( | |
4013 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4014 0, | |
4015 0, | |
4016 -1, | |
4017 0, | |
4018 v3->field_10, | |
4019 0, | |
4020 0); | |
4021 } | |
4022 else | |
4023 { | |
4024 if ( sRecoveryTime < 0 ) | |
4025 sRecoveryTime = 0; | |
4026 if ( pParty->bTurnBasedModeOn ) | |
4027 { | |
4028 v645 = sRecoveryTime; | |
4029 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4030 pPlayer->SetRecoveryTime(v645); | |
4031 if ( !some_active_character ) | |
4032 pTurnEngine->_40471C(); | |
4033 } | |
4034 else | |
4035 { | |
4036 pPlayer->SetRecoveryTime( | |
4037 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4038 } | |
4039 if ( v727 != 0.0 ) | |
4040 { | |
187 | 4041 pPlayer->PlaySound(SPEECH_49, 0); |
0 | 4042 goto LABEL_1162; |
4043 } | |
4044 } | |
4045 v3->spellnum = 0; | |
486 | 4046 //v1 = 0; |
0 | 4047 LABEL_1165: |
4048 v2 = v723; | |
4049 goto LABEL_1166; | |
4050 } | |
4051 } | |
4052 } | |
4053 } | |
4054 } | |
4055 } | |
4056 LABEL_199: | |
4057 dword_50C9D0 = 113; | |
486 | 4058 dword_50C9D4 = 0; |
0 | 4059 dword_50C9D8 = 1; |
4060 LABEL_200: | |
4061 v66 = pGlobalTXT_LocalizationStrings[428]; | |
4062 LABEL_201: | |
4063 v67 = 2; | |
4064 LABEL_202: | |
4065 ShowStatusBarString(v66, v67); | |
486 | 4066 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 4067 goto LABEL_203; |
488 | 4068 |
4069 case SPELL_BODY_REGENERATION: | |
0 | 4070 v70 = v12 - 1; |
4071 LODWORD(v733) = 3600 * v2; | |
4072 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4073 { | |
4074 v72 = v71 - 1; | |
4075 if ( v72 ) | |
4076 { | |
4077 if ( v72 == 1 ) | |
4078 amount = 10; | |
4079 } | |
4080 else | |
4081 { | |
4082 amount = 3; | |
4083 } | |
4084 } | |
4085 else | |
4086 { | |
4087 amount = 1; | |
4088 } | |
4089 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4090 goto play_sound_and_continue; |
4091 | |
4092 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
4093 | |
4094 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); | |
4095 goto LABEL_1056; | |
4096 | |
4097 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
4098 case SPELL_AIR_PROTECTION_FROM_AIR: | |
4099 case SPELL_WATER_PROTECTION_FROM_WATER: | |
4100 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
4101 case SPELL_MIND_PROTECTION_FROM_MIND: | |
4102 case SPELL_BODY_PROTECTION_FROM_BODY: | |
0 | 4103 v76 = v12 - 1; |
4104 LODWORD(v733) = 3600 * v2; | |
4105 if ( v76 ) | |
4106 { | |
4107 v77 = v76 - 1; | |
4108 if ( v77 ) | |
4109 { | |
4110 v78 = v77 - 1; | |
4111 if ( v78 ) | |
4112 { | |
4113 if ( v78 != 1 ) | |
4114 goto LABEL_232; | |
4115 v79 = 4 * v2; | |
4116 } | |
4117 else | |
4118 { | |
4119 v79 = 3 * v2; | |
4120 } | |
4121 } | |
4122 else | |
4123 { | |
4124 v79 = 2 * v2; | |
4125 } | |
4126 amount = v79; | |
4127 } | |
4128 else | |
4129 { | |
4130 amount = v2; | |
4131 } | |
4132 LABEL_232: | |
488 | 4133 //v80 = v3->spellnum; |
4134 switch (v3->spellnum) | |
4135 { | |
4136 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
4137 LODWORD(v725) = PARTY_BUFF_RESIST_FIRE; | |
0 | 4138 break; |
488 | 4139 case SPELL_AIR_PROTECTION_FROM_AIR: |
4140 LODWORD(v725) = PARTY_BUFF_RESIST_AIR; | |
0 | 4141 break; |
488 | 4142 case SPELL_WATER_PROTECTION_FROM_WATER: |
4143 LODWORD(v725) = PARTY_BUFF_RESIST_WATER; | |
4144 break; | |
4145 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
4146 LODWORD(v725) = PARTY_BUFF_RESIST_EARTH; | |
0 | 4147 break; |
488 | 4148 case SPELL_MIND_PROTECTION_FROM_MIND: |
4149 LODWORD(v725) = PARTY_BUFF_RESIST_MIND; | |
0 | 4150 break; |
488 | 4151 case SPELL_BODY_PROTECTION_FROM_BODY: |
4152 LODWORD(v725) = PARTY_BUFF_RESIST_BODY; | |
0 | 4153 break; |
4154 default: | |
488 | 4155 assert(false); |
4156 goto LABEL_1166; | |
0 | 4157 } |
4158 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4159 goto play_sound_and_continue; |
4160 | |
4161 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4162 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4163 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4164 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4165 v83 = 1; |
488 | 4166 |
0 | 4167 v90 = (double)(signed int)v733 * 4.2666669; |
488 | 4168 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); |
4169 LODWORD(v727) = 1; | |
4170 goto play_sound_and_continue; | |
4171 | |
4172 case SPELL_FIRE_HASTE: | |
486 | 4173 if ( v12 <= 0 ) |
0 | 4174 goto LABEL_254; |
4175 if ( v12 <= 2 ) | |
4176 { | |
4177 v91 = 60 * (v2 + 60); | |
4178 } | |
4179 else | |
4180 { | |
4181 if ( v12 == 3 ) | |
4182 { | |
4183 v91 = 180 * (v2 + 20); | |
4184 } | |
4185 else | |
4186 { | |
4187 if ( v12 != 4 ) | |
4188 goto LABEL_254; | |
4189 v91 = 240 * (v2 + 15); | |
4190 } | |
4191 } | |
4192 LODWORD(v733) = v91; | |
4193 LABEL_254: | |
4194 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4195 { | |
89 | 4196 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4197 LODWORD(v727) = 1; |
4198 do | |
4199 { | |
89 | 4200 if ( v92->pConditions ) |
486 | 4201 LODWORD(v727) = 0; |
89 | 4202 ++v92; |
0 | 4203 } |
89 | 4204 while ( v92 <= &pParty->pPlayers[3] ); |
486 | 4205 if (LODWORD(v727)) |
0 | 4206 { |
4207 v726 = (Player *)((int)v733 << 7); | |
488 | 4208 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
4209 | |
4210 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4211 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4212 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4213 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4214 } |
4215 } | |
488 | 4216 goto play_sound_and_continue; |
4217 | |
4218 case SPELL_SPIRIT_BLESS: | |
0 | 4219 v101 = v12 - 1; |
4220 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4221 { | |
4222 v103 = v102 - 1; | |
4223 if ( v103 ) | |
4224 { | |
4225 if ( v103 != 1 ) | |
4226 goto LABEL_269; | |
4227 v104 = 3600 * (v2 + 1); | |
4228 } | |
4229 else | |
4230 { | |
4231 v104 = 900 * (v2 + 4); | |
4232 } | |
4233 } | |
4234 else | |
4235 { | |
4236 v104 = 300 * (v2 + 12); | |
4237 } | |
4238 LODWORD(v733) = v104; | |
4239 LABEL_269: | |
4240 amount = v2 + 5; | |
4241 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4242 goto play_sound_and_continue; |
0 | 4243 if ( v731 == 1 ) |
4244 { | |
4245 v108 = v3->uPlayerID_2; | |
4246 v109 = v3->spellnum; | |
4247 v110 = pGame->GetStru6(); | |
4248 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
486 | 4249 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, 0, 65536); |
488 | 4250 //v668 = 0; |
0 | 4251 v716 = v111; |
488 | 4252 //v658 = v111; |
4253 //v653 = amount; | |
0 | 4254 v726 = (Player *)((int)v733 << 7); |
488 | 4255 //v651 = 1; |
4256 //v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4257 //v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS]; | |
4258 //LABEL_103: | |
4259 //HIDWORD(v650) = HIDWORD(v28); | |
4260 //LABEL_104: | |
4261 //LODWORD(v650) = v28; | |
4262 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); | |
4263 goto LABEL_1056; | |
0 | 4264 } |
4265 v105 = 0; | |
4266 v726 = (Player *)((int)v733 << 7); | |
4267 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4268 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4269 do |
4270 { | |
488 | 4271 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v105); |
486 | 4272 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536); |
4273 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | |
89 | 4274 ++v730b; |
0 | 4275 ++v105; |
4276 } | |
89 | 4277 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4278 goto LABEL_1056; |
488 | 4279 |
0 | 4280 case 52: |
486 | 4281 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && (a2 & 7) == OBJECT_Actor) |
0 | 4282 { |
4283 v730 = a2 >> 3; | |
4284 v112 = &pActors[a2 >> 3]; | |
4285 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4286 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4287 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4288 _this = (ItemGen *)v113; | |
4289 v114 = v721; | |
4290 v115 = (unsigned int)v726; | |
4291 if ( v113 < v721 ) | |
4292 { | |
4293 v116 = v113; | |
4294 v113 = v721; | |
4295 v114 = v116; | |
4296 } | |
4297 if ( v113 < (signed int)v726 ) | |
4298 { | |
4299 v117 = v113; | |
4300 v113 = (int)v726; | |
4301 v115 = v117; | |
4302 } | |
4303 if ( v114 < (signed int)v115 ) | |
4304 { | |
4305 v118 = v115; | |
4306 v115 = v114; | |
4307 v114 = v118; | |
4308 } | |
4309 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4310 if ( (double)(signed int)this <= 307.2 ) | |
4311 { | |
4312 v703 = 0; | |
4313 v702 = 0; | |
4314 v701 = 0; | |
4315 a1.stru_24.Reset(); | |
4316 v119 = HIDWORD(v733); | |
4317 a1.field_48 = *(int *)HIDWORD(v733); | |
4318 a1.field_4C = v723; | |
4319 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4320 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4321 a1.uAttributes = 0; |
4322 a1.uSectorID = 0; | |
4323 a1.uSpriteFrameID = 0; | |
4324 v120 = 8 * *(short *)(v119 + 2); | |
303 | 4325 LOBYTE(v120) = v120 | OBJECT_Player; |
0 | 4326 a1.field_60_distance_related_prolly_lod = 0; |
303 | 4327 a1.field_58_pid = v120; |
0 | 4328 a1.uFacing = 0; |
4329 a1.uSoundID = *(short *)(v119 + 16); | |
4330 a1.vPosition.x = v112->vPosition.x; | |
4331 a1.vPosition.y = v112->vPosition.y; | |
4332 v726 = (Player *)v112->uActorHeight; | |
4333 v121 = 8 * a2; | |
4334 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4335 LOBYTE(v121) = 8 * a2 | 3; | |
4336 a1.field_5C = v121; | |
4337 v122 = a1.Create(0, 0, 0, 0); | |
4338 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4339 LODWORD(v727) = 1; | |
4340 } | |
4341 else | |
4342 { | |
4343 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4344 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4345 *(int *)HIDWORD(v733) = 0; | |
4346 } | |
4347 v3 = (stru277 *)HIDWORD(v733); | |
4348 } | |
488 | 4349 goto play_sound_and_continue; |
4350 | |
4351 case SPELL_AIR_SHIELD: | |
4352 case SPELL_EARTH_STONESKIN: | |
4353 case SPELL_SPIRIT_HEROISM: | |
0 | 4354 v123 = v12 - 1; |
4355 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4356 { | |
4357 v125 = v124 - 1; | |
4358 if ( v125 ) | |
4359 { | |
4360 if ( v125 != 1 ) | |
4361 goto LABEL_296; | |
4362 v126 = 3600 * (v2 + 1); | |
4363 } | |
4364 else | |
4365 { | |
4366 v126 = 900 * (v2 + 4); | |
4367 } | |
4368 } | |
4369 else | |
4370 { | |
4371 v126 = 300 * (v2 + 12); | |
4372 } | |
4373 LODWORD(v733) = v126; | |
4374 LABEL_296: | |
4375 v127 = v3->spellnum; | |
4376 if ( v127 == 17 ) | |
4377 { | |
486 | 4378 amount = 0; |
0 | 4379 LODWORD(v725) = 14; |
4380 } | |
4381 else | |
4382 { | |
4383 if ( v127 == 38 ) | |
4384 { | |
4385 LODWORD(v725) = 15; | |
4386 amount = v2 + 5; | |
4387 } | |
4388 else | |
4389 { | |
4390 if ( v127 != 51 ) | |
4391 goto LABEL_1166; | |
4392 LODWORD(v725) = 9; | |
4393 amount = v2 + 5; | |
4394 } | |
4395 } | |
4396 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4397 goto play_sound_and_continue; |
4398 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4399 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4400 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4401 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4402 v83 = 1; |
4403 v726 = (Player *)((int)v733 << 7); | |
4404 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
488 | 4405 //LABEL_304: |
4406 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); | |
4407 LODWORD(v727) = v83; | |
4408 goto play_sound_and_continue; | |
4409 | |
4410 case SPELL_FIRE_IMMOLATION: | |
0 | 4411 v138 = v12 - 2; |
4412 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4413 v140 = 600 * v2; | |
4414 else | |
4415 v140 = 60 * v2; | |
4416 LODWORD(v733) = v140; | |
4417 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4418 goto play_sound_and_continue; |
4419 | |
4420 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4421 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4422 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4423 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
4424 | |
0 | 4425 v726 = (Player *)((int)v733 << 7); |
488 | 4426 |
4427 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | |
4428 goto LABEL_1056; | |
4429 | |
0 | 4430 case 9: |
4431 v149 = v12 - 1; | |
4432 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4433 { | |
4434 if ( v151 == 1 ) | |
4435 _this = (ItemGen *)20; | |
4436 } | |
4437 else | |
4438 { | |
4439 _this = (ItemGen *)16; | |
4440 } | |
4441 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4442 { | |
4443 v66 = pGlobalTXT_LocalizationStrings[491]; | |
4444 goto LABEL_201; | |
4445 } | |
4446 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4447 goto play_sound_and_continue; |
0 | 4448 LODWORD(v725) = a2 & 7; |
141 | 4449 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4450 { |
4451 v152 = a2 >> 3; | |
4452 uRequiredMana = pActors[v152].vPosition.x; | |
4453 v153 = pActors[v152].vPosition.y; | |
4454 v154 = pActors[v152].vPosition.z; | |
4455 LODWORD(v727) = v153; | |
4456 } | |
4457 else | |
4458 { | |
323 | 4459 v155 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4460 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); |
323 | 4461 v156 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4462 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); |
4463 v154 = pParty->vPosition.z; | |
4464 } | |
4465 HIDWORD(v733) = v154; | |
4466 v713 = v154 + 2500; | |
486 | 4467 v721 = 0; |
4468 LODWORD(v718) = 0; | |
4469 if ( (signed int)this > 0 ) | |
0 | 4470 { |
4471 *(float *)&y = (double)SHIDWORD(v733); | |
4472 *(float *)&v732 = (double)v713; | |
4473 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4474 v726 = (Player *)this; | |
4475 do | |
4476 { | |
4477 v157 = rand(); | |
4478 v158 = (double)SLODWORD(v718); | |
4479 v718 = v158; | |
4480 v159 = (double)v721; | |
4481 *(float *)&v721 = v159; | |
4482 a2 = v157 % 1000; | |
4483 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4484 v725 = v159 * v159; | |
4485 *(float *)&_this = v158 * v158; | |
4486 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4487 { | |
486 | 4488 LODWORD(v687) = 0; |
4489 HIDWORD(v687) = 0; | |
0 | 4490 } |
4491 else | |
4492 { | |
4493 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4494 v687 = __PAIR__( | |
4495 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4496 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4497 } | |
4498 a1.stru_24.Reset(); | |
4499 a1.field_48 = v3->spellnum; | |
4500 a1.field_4C = v2; | |
4501 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4502 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 4503 a1.uAttributes = 0; |
0 | 4504 a1.vPosition.x = uRequiredMana; |
4505 a1.vPosition.y = LODWORD(v727); | |
486 | 4506 a1.uSectorID = 0; |
0 | 4507 a1.vPosition.z = a2 + v713; |
486 | 4508 a1.uSpriteFrameID = 0; |
303 | 4509 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4510 a1.field_5C = v730; |
4511 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4512 a1.uFacing = v687; | |
4513 a1.uSoundID = LOWORD(v3->field_10); | |
4514 if ( pParty->bTurnBasedModeOn == 1 ) | |
4515 a1.uAttributes = 4; | |
4516 if ( a1.Create( | |
4517 v687, | |
4518 SHIDWORD(v687), | |
4519 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4520 0) != -1 |
0 | 4521 && pParty->bTurnBasedModeOn == 1 ) |
4522 ++pTurnEngine->field_1C; | |
4523 LODWORD(v718) = rand() % 1024 - 512; | |
4524 v160 = rand(); | |
4525 v14 = v726 == (Player *)1; | |
4526 v726 = (Player *)((char *)v726 - 1); | |
4527 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4528 } | |
4529 while ( !v14 ); | |
4530 } | |
4531 goto LABEL_1056; | |
4532 case 10: | |
4533 v67 = 2; | |
4534 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4535 { | |
4536 v66 = pGlobalTXT_LocalizationStrings[492]; | |
4537 goto LABEL_202; | |
4538 } | |
4539 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4540 goto play_sound_and_continue; |
0 | 4541 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
486 | 4542 v700.z = 0; |
4543 v700.y = 0; | |
4544 v700.x = 0; | |
0 | 4545 a1.stru_24.Reset(); |
4546 a1.field_48 = v3->spellnum; | |
4547 a1.field_4C = v2; | |
4548 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4549 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 4550 a1.uAttributes = 0; |
4551 a1.uSectorID = 0; | |
4552 a1.uSpriteFrameID = 0; | |
0 | 4553 v161 = v3->uPlayerID; |
4554 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 4555 a1.uFacing = 0; |
0 | 4556 v161 *= 8; |
303 | 4557 LOBYTE(v161) = v161 | OBJECT_Player; |
4558 a1.field_58_pid = v161; | |
0 | 4559 a1.uSoundID = LOWORD(v3->field_10); |
486 | 4560 a2 = 0; |
4561 if ( (signed int)v726 > 0 ) | |
0 | 4562 { |
4563 do | |
4564 { | |
4565 v162 = dword_50BF30[a2]; | |
4566 a1.vPosition.x = pActors[v162].vPosition.x; | |
4567 a1.vPosition.y = pActors[v162].vPosition.y; | |
4568 v732 = pActors[v162].uActorHeight; | |
4569 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4570 v163 = 8 * dword_50BF30[a2]; | |
486 | 4571 LOBYTE(v163) = v163 | OBJECT_Actor; |
0 | 4572 a1.field_5C = v163; |
486 | 4573 v164 = a1.Create(0, 0, 0, 0); |
0 | 4574 v165 = a2; |
4575 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
488 | 4576 pGame->GetStru6()->_4A81CA(&a1); |
4577 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
0 | 4578 a2 = v165 + 1; |
4579 } | |
4580 while ( v165 + 1 < (signed int)v726 ); | |
4581 } | |
4582 goto LABEL_1056; | |
488 | 4583 |
4584 case SPELL_AIR_WIZARD_EYE: | |
0 | 4585 LODWORD(v733) = 3600 * v2; |
4586 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4587 goto play_sound_and_continue; |
0 | 4588 v168 = 0; |
4589 do | |
4590 { | |
486 | 4591 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536); |
0 | 4592 v716 = v169; |
4593 } | |
4594 while ( v168 < 4 ); | |
488 | 4595 |
0 | 4596 v732 = (int)v733 << 7; |
488 | 4597 |
4598 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | |
4599 goto LABEL_1056; | |
4600 | |
4601 case SPELL_AIR_FEATHER_FALL: | |
0 | 4602 v170 = v12 - 1; |
4603 if ( !v170 ) | |
4604 { | |
4605 v173 = 300 * v2; | |
4606 goto LABEL_353; | |
4607 } | |
4608 v171 = v170 - 1; | |
4609 if ( !v171 ) | |
4610 { | |
4611 v173 = 600 * v2; | |
4612 goto LABEL_353; | |
4613 } | |
4614 v172 = v171 - 1; | |
4615 if ( !v172 || v172 == 1 ) | |
4616 { | |
4617 v173 = 3600 * v2; | |
4618 LABEL_353: | |
4619 LODWORD(v733) = v173; | |
4620 } | |
4621 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4622 goto play_sound_and_continue; |
0 | 4623 v174 = 0; |
4624 do | |
486 | 4625 pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536); |
0 | 4626 while ( v174 < 4 ); |
488 | 4627 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4628 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4629 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4630 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4631 v83 = 1; |
4632 v732 = (int)v733 << 7; | |
488 | 4633 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); |
4634 LODWORD(v727) = v83; | |
4635 goto play_sound_and_continue; | |
4636 | |
4637 case SPELL_AIR_SPARKS: | |
0 | 4638 v184 = v12 - 1; |
4639 if ( v184 ) | |
4640 { | |
4641 v185 = v184 - 1; | |
4642 if ( v185 ) | |
4643 { | |
4644 v186 = v185 - 1; | |
4645 if ( v186 ) | |
4646 { | |
4647 if ( v186 == 1 ) | |
4648 amount = 9; | |
4649 } | |
4650 else | |
4651 { | |
4652 amount = 7; | |
4653 } | |
4654 } | |
4655 else | |
4656 { | |
4657 amount = 5; | |
4658 } | |
4659 } | |
4660 else | |
4661 { | |
4662 amount = 3; | |
4663 } | |
4664 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4665 goto play_sound_and_continue; |
0 | 4666 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); |
4667 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4668 a1.stru_24.Reset(); | |
4669 a1.field_48 = v3->spellnum; | |
4670 a1.field_4C = v2; | |
4671 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4672 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4673 a1.vPosition.y = pParty->vPosition.y; |
4674 a1.vPosition.x = pParty->vPosition.x; | |
486 | 4675 a1.uAttributes = 0; |
0 | 4676 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
4677 a1.uSectorID = pIndoor->GetSector( | |
4678 pParty->vPosition.x, | |
4679 pParty->vPosition.y, | |
4680 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 4681 a1.uSpriteFrameID = 0; |
0 | 4682 v187 = 8 * v3->uPlayerID; |
303 | 4683 LOBYTE(v187) = v187 | OBJECT_Player; |
4684 a1.field_58_pid = v187; | |
0 | 4685 a1.field_5C = a2; |
4686 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4687 a1.uSoundID = LOWORD(v3->field_10); | |
4688 if ( pParty->bTurnBasedModeOn == 1 ) | |
4689 LOBYTE(a1.uAttributes) |= 4u; | |
4690 v188 = (signed int)v726 / -2; | |
4691 v189 = (signed int)v726 / 2; | |
4692 while ( v188 <= v189 ) | |
4693 { | |
4694 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4695 if ( a1.Create( | |
4696 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4697 v715.uPitchAngle, | |
4698 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4699 v3->uPlayerID + 1) != -1 | |
4700 && pParty->bTurnBasedModeOn == 1 ) | |
4701 ++pTurnEngine->field_1C; | |
4702 v188 += v732; | |
4703 } | |
4704 goto LABEL_1056; | |
4705 case 16: | |
4706 if ( pParty->uFlags & 8 ) | |
4707 { | |
4708 v190 = pGlobalTXT_LocalizationStrings[493]; | |
4709 goto LABEL_462; | |
4710 } | |
4711 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4712 goto play_sound_and_continue; |
0 | 4713 v191 = 0; |
4714 do | |
486 | 4715 pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536); |
0 | 4716 while ( v191 < 4 ); |
4717 BYTE1(pParty->uFlags) |= 1u; | |
4718 pParty->uFallSpeed = 1000; | |
4719 goto LABEL_1056; | |
488 | 4720 |
4721 case SPELL_AIR_INVISIBILITY: | |
0 | 4722 v192 = v12 - 1; |
4723 if ( !v192 ) | |
4724 { | |
4725 amount = v2; | |
4726 goto LABEL_391; | |
4727 } | |
4728 v193 = v192 - 1; | |
4729 if ( !v193 ) | |
4730 { | |
4731 v196 = 2 * v2; | |
4732 LABEL_389: | |
4733 amount = v196; | |
4734 LABEL_391: | |
4735 v195 = 600 * v2; | |
4736 goto LABEL_392; | |
4737 } | |
4738 v194 = v193 - 1; | |
4739 if ( !v194 ) | |
4740 { | |
4741 v196 = 3 * v2; | |
4742 goto LABEL_389; | |
4743 } | |
4744 if ( v194 != 1 ) | |
4745 goto LABEL_393; | |
4746 amount = 4 * v2; | |
4747 v195 = 3600 * v2; | |
4748 LABEL_392: | |
4749 LODWORD(v733) = v195; | |
4750 LABEL_393: | |
4751 if ( pParty->uFlags & 0x30 ) | |
4752 { | |
4753 v66 = pGlobalTXT_LocalizationStrings[638]; | |
4754 goto LABEL_201; | |
4755 } | |
4756 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4757 { | |
488 | 4758 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4759 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4760 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4761 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4762 v83 = 1; |
4763 v732 = (int)v733 << 7; | |
488 | 4764 |
4765 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 | 4766 LODWORD(v727) = v83; |
4767 } | |
488 | 4768 goto play_sound_and_continue; |
0 | 4769 case 21: |
4770 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4771 { | |
4772 v190 = pGlobalTXT_LocalizationStrings[494]; | |
4773 LABEL_462: | |
4774 ShowStatusBarString(v190, 2u); | |
486 | 4775 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
488 | 4776 goto play_sound_and_continue; |
0 | 4777 } |
4778 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4779 { | |
4780 LABEL_461: | |
4781 v190 = pGlobalTXT_LocalizationStrings[428]; | |
4782 goto LABEL_462; | |
4783 } | |
4784 LODWORD(v733) = 3600 * v2; | |
486 | 4785 if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) ) |
0 | 4786 amount = 1; |
4787 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4788 goto play_sound_and_continue; |
0 | 4789 v205 = 0; |
4790 do | |
486 | 4791 pOtherOverlayList->_4418B1(2090, v205++ + 100, 0, 65536); |
0 | 4792 while ( v205 < 4 ); |
486 | 4793 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); |
0 | 4794 v207 = v3->uPlayerID + 1; |
4795 v716 = v206; | |
488 | 4796 |
0 | 4797 v732 = (int)v733 << 7; |
488 | 4798 |
4799 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207); | |
0 | 4800 goto LABEL_1056; |
488 | 4801 |
0 | 4802 case 22: |
4803 v67 = 2; | |
4804 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4805 { | |
4806 v66 = pGlobalTXT_LocalizationStrings[495]; | |
4807 goto LABEL_202; | |
4808 } | |
4809 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4810 goto play_sound_and_continue; |
0 | 4811 v208 = a2 & 7; |
4812 LODWORD(v725) = a2 & 7; | |
4813 if ( v208 == 3 ) | |
4814 { | |
4815 v209 = a2 >> 3; | |
4816 LODWORD(v718) = pActors[v209].vPosition.x; | |
4817 v210 = pActors[v209].vPosition.y; | |
4818 v211 = pActors[v209].vPosition.z; | |
4819 v713 = v210; | |
4820 } | |
4821 else | |
4822 { | |
323 | 4823 v212 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4824 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); |
323 | 4825 v213 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4826 v214 = sub_42EBBE(2048, v213); |
4827 v211 = pParty->vPosition.z; | |
4828 v713 = pParty->vPosition.y + v214; | |
4829 v208 = LODWORD(v725); | |
4830 } | |
4831 v726 = (Player *)v211; | |
486 | 4832 HIDWORD(v733) = 0; |
0 | 4833 *(float *)&v732 = (double)v211; |
4834 LODWORD(v725) = v211 + 2500; | |
486 | 4835 v721 = 0; |
0 | 4836 *(float *)&y = (double)(v211 + 2500); |
4837 v730 = v208 == 3 ? a2 : 0; | |
4838 a2 = 20; | |
4839 do | |
4840 { | |
4841 v215 = rand(); | |
4842 v216 = (double)v721; | |
4843 v727 = v216; | |
4844 v217 = (double)SHIDWORD(v733); | |
4845 *(float *)&uRequiredMana = v217; | |
4846 _this = (ItemGen *)(v215 % 1000); | |
4847 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4848 *(float *)&v721 = v217 * v217; | |
4849 *(float *)&v726 = v216 * v216; | |
4850 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4851 { | |
486 | 4852 LODWORD(v685) = 0; |
4853 HIDWORD(v685) = 0; | |
0 | 4854 } |
4855 else | |
4856 { | |
4857 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4858 v685 = __PAIR__( | |
4859 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4860 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4861 } | |
4862 a1.stru_24.Reset(); | |
4863 a1.field_48 = v3->spellnum; | |
4864 a1.field_4C = v2; | |
4865 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4866 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 4867 a1.uAttributes = 0; |
0 | 4868 a1.vPosition.x = LODWORD(v718); |
4869 a1.vPosition.y = v713; | |
486 | 4870 a1.uSectorID = 0; |
0 | 4871 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); |
486 | 4872 a1.uSpriteFrameID = 0; |
303 | 4873 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4874 a1.field_5C = v730; |
4875 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4876 a1.uFacing = v685; | |
4877 a1.uSoundID = LOWORD(v3->field_10); | |
4878 if ( pParty->bTurnBasedModeOn == 1 ) | |
4879 a1.uAttributes = 4; | |
4880 if ( a1.Create( | |
4881 v685, | |
4882 SHIDWORD(v685), | |
4883 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4884 0) != -1 |
0 | 4885 && pParty->bTurnBasedModeOn == 1 ) |
4886 ++pTurnEngine->field_1C; | |
4887 v721 = rand() % 1024 - 512; | |
4888 v218 = rand(); | |
4889 v14 = a2-- == 1; | |
4890 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4891 } | |
4892 while ( !v14 ); | |
4893 goto LABEL_1056; | |
4894 case 23: | |
4895 v219 = v12 - 2; | |
4896 if ( v219 ) | |
4897 { | |
4898 v220 = v219 - 1; | |
4899 if ( v220 ) | |
4900 { | |
4901 if ( v220 == 1 ) | |
4902 { | |
486 | 4903 amount = 0; |
0 | 4904 goto LABEL_433; |
4905 } | |
4906 v221 = 180 * v2; | |
4907 } | |
4908 else | |
4909 { | |
4910 v221 = 86400 * v2; | |
4911 } | |
4912 } | |
4913 else | |
4914 { | |
4915 v221 = 3600 * v2; | |
4916 } | |
4917 amount = v221; | |
4918 LABEL_433: | |
4919 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4920 goto play_sound_and_continue; |
0 | 4921 v222 = (char *)pParty->pPlayers; |
4922 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
4923 break; | |
4924 case 24: | |
4925 v224 = v12 - 2; | |
4926 if ( v224 ) | |
4927 { | |
4928 v225 = v224 - 1; | |
4929 if ( v225 ) | |
4930 { | |
4931 if ( v225 == 1 ) | |
4932 amount = 7; | |
4933 else | |
4934 amount = 1; | |
4935 } | |
4936 else | |
4937 { | |
4938 amount = 5; | |
4939 } | |
4940 } | |
4941 else | |
4942 { | |
4943 amount = 3; | |
4944 } | |
4945 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4946 goto play_sound_and_continue; |
0 | 4947 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; |
4948 if ( amount == 1 ) | |
4949 { | |
4950 LABEL_152: | |
4951 a1.stru_24.Reset(); | |
4952 a1.field_48 = v3->spellnum; | |
4953 a1.field_50 = v731; | |
4954 a1.field_4C = v2; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4955 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4956 a1.vPosition.y = pParty->vPosition.y; |
4957 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4958 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4959 v660 = pParty->vPosition.y; | |
4960 LABEL_153: | |
486 | 4961 a1.uAttributes = 0; |
0 | 4962 a1.vPosition.x = pParty->vPosition.x; |
4963 a1.vPosition.z = v51; | |
4964 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
486 | 4965 a1.uSpriteFrameID = 0; |
0 | 4966 a1.uSectorID = v52; |
4967 v53 = 8 * v3->uPlayerID; | |
303 | 4968 LOBYTE(v53) = v53 | OBJECT_Player; |
4969 a1.field_58_pid = v53; | |
0 | 4970 a1.field_5C = a2; |
4971 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4972 a1.uFacing = LOWORD(v715.uYawAngle); | |
4973 a1.uSoundID = LOWORD(v3->field_10); | |
4974 LABEL_154: | |
4975 if ( pParty->bTurnBasedModeOn == 1 ) | |
4976 LOBYTE(a1.uAttributes) |= 4u; | |
4977 LABEL_156: | |
4978 v669 = v3->uPlayerID + 1; | |
4979 v36 = v715.uYawAngle; | |
4980 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
4981 v654 = v715.uPitchAngle; | |
4982 LABEL_157: | |
4983 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
4984 ++pTurnEngine->field_1C; | |
4985 } | |
4986 else | |
4987 { | |
4988 v732 = SHIDWORD(v733) / (amount - 1); | |
4989 a1.stru_24.Reset(); | |
4990 a1.field_48 = v3->spellnum; | |
4991 a1.field_4C = v2; | |
4992 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4993 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4994 a1.vPosition.y = pParty->vPosition.y; |
4995 a1.vPosition.x = pParty->vPosition.x; | |
486 | 4996 a1.uAttributes = 0; |
0 | 4997 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
4998 a1.uSectorID = pIndoor->GetSector( | |
4999 pParty->vPosition.x, | |
5000 pParty->vPosition.y, | |
5001 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 5002 a1.uSpriteFrameID = 0; |
0 | 5003 v226 = 8 * v3->uPlayerID; |
303 | 5004 LOBYTE(v226) = v226 | OBJECT_Player; |
5005 a1.field_58_pid = v226; | |
0 | 5006 a1.field_5C = a2; |
5007 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5008 a1.uSoundID = LOWORD(v3->field_10); | |
5009 if ( pParty->bTurnBasedModeOn == 1 ) | |
5010 LOBYTE(a1.uAttributes) |= 4u; | |
5011 v227 = SHIDWORD(v733) / -2; | |
5012 y = (char *)(SHIDWORD(v733) / 2); | |
5013 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5014 { | |
5015 v228 = v715.uYawAngle; | |
5016 do | |
5017 { | |
5018 a1.uFacing = v227 + v228; | |
5019 if ( a1.Create( | |
5020 v227 + v228, | |
5021 v715.uPitchAngle, | |
5022 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5023 v3->uPlayerID + 1) != -1 | |
5024 && pParty->bTurnBasedModeOn == 1 ) | |
5025 ++pTurnEngine->field_1C; | |
5026 v227 += v732; | |
5027 } | |
5028 while ( v227 <= (signed int)y ); | |
5029 } | |
5030 } | |
5031 goto LABEL_1056; | |
5032 case 27: | |
5033 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
5034 goto LABEL_461; | |
5035 if ( v731 == 2 || v731 != 3 && v731 != 4 ) | |
5036 v229 = 600 * v2; | |
5037 else | |
5038 v229 = 3600 * v2; | |
5039 LODWORD(v733) = v229; | |
5040 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5041 goto play_sound_and_continue; |
486 | 5042 v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); |
488 | 5043 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
5044 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
5045 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
5046 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 5047 v239 = v3->uPlayerID + 1; |
5048 v732 = v229 << 7; | |
5049 pParty->pPartyBuffs[18].Apply( | |
5050 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5051 v731, | |
5052 amount, | |
5053 v716, | |
5054 v239); | |
5055 if ( v731 == 4 ) | |
5056 pParty->pPartyBuffs[18].uFlags = 1; | |
488 | 5057 LODWORD(v727) = 1; |
5058 goto play_sound_and_continue; | |
0 | 5059 case 28: |
5060 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5061 goto play_sound_and_continue; |
0 | 5062 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
5063 y = v240; | |
5064 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
5065 goto LABEL_199; | |
5066 if ( v731 == 1 || v731 == 2 ) | |
5067 { | |
5068 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5069 } | |
5070 else | |
5071 { | |
5072 if ( v731 == 3 ) | |
5073 { | |
5074 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5075 } | |
5076 else | |
5077 { | |
5078 if ( v731 != 4 ) | |
5079 { | |
5080 v241 = 0.0; | |
5081 goto LABEL_484; | |
5082 } | |
5083 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5084 } | |
5085 } | |
5086 if ( v241 > 1.0 ) | |
5087 v241 = 1.0; | |
5088 LABEL_484: | |
5089 v732 = (unsigned __int8)v240[25]; | |
5090 v242 = (signed __int64)((double)v732 * v241); | |
5091 v243 = y; | |
5092 y[25] = v242; | |
5093 *((int *)v243 + 4) = (unsigned __int8)v242; | |
486 | 5094 if ( (unsigned __int8)v242 <= 0 ) |
5095 { | |
5096 *(int *)v243 = 0; | |
0 | 5097 dword_50C9D0 = 113; |
486 | 5098 dword_50C9D4 = 0; |
0 | 5099 dword_50C9D8 = 1; |
5100 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
486 | 5101 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5102 v3->spellnum = 0; | |
0 | 5103 goto LABEL_1165; |
5104 } | |
5105 *((int *)v243 + 5) |= 0x40u; | |
5106 goto LABEL_1055; | |
5107 case 30: | |
5108 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5109 goto play_sound_and_continue; |
486 | 5110 uRequiredMana = 0; |
0 | 5111 HIDWORD(v733) = 10 * v2; |
5112 v730 = 1; | |
5113 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5114 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5115 if ( v731 == 1 ) | |
5116 { | |
5117 v245 = (int)&v244[36 * a2 + 532]; | |
5118 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5119 v311 = __OFSUB__(*(int *)v245, 134); | |
5120 v14 = *(int *)v245 == 134; | |
5121 v310 = *(int *)v245 - 134 < 0; | |
5122 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5123 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5124 { | |
486 | 5125 if ( *(int *)&v244[36 * a2 + 544] == 0 ) |
0 | 5126 { |
486 | 5127 if ( *(int *)&v244[36 * a2 + 536] == 0 ) |
0 | 5128 { |
486 | 5129 if ( *(int *)&v244[36 * a2 + 540] == 0 ) |
0 | 5130 { |
5131 v312 = v309[28]; | |
5132 if ( v312 ) | |
5133 { | |
5134 if ( v312 != 1 ) | |
5135 { | |
5136 if ( v312 != 2 ) | |
5137 { | |
5138 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5139 if ( !(v244[36 * a2 + 552] & 2) ) | |
5140 { | |
5141 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5142 { | |
5143 uRequiredMana = 1; | |
486 | 5144 v730 = 0; |
0 | 5145 } |
5146 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5147 uRequiredMana = 1; | |
486 | 5148 if (!uRequiredMana) |
0 | 5149 { |
5150 v313 = *(char *)(LODWORD(v725) + 28); | |
5151 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5152 { | |
224 | 5153 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5154 *(int *)(v245 + 4) = 0; |
222 | 5155 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5156 + 1]; |
5157 ; | |
222 | 5158 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5159 + 1] ) |
5160 { | |
5161 ++*(int *)(v245 + 4); | |
5162 if ( j >= v314 ) | |
5163 break; | |
5164 } | |
5165 v254 = rand(); | |
224 | 5166 v255 = 10;//pItemsTable->field_116D8[17]; |
5167 v256 = 10;//pItemsTable->field_116D8[16]; | |
0 | 5168 LABEL_611: |
5169 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5170 LABEL_612: | |
5171 _this->uItemID |= 0x20u; | |
5172 goto LABEL_1055; | |
5173 } | |
5174 goto LABEL_615; | |
5175 } | |
5176 LABEL_613: | |
5177 v316 = _this->uItemID; | |
5178 if ( !(BYTE1(v316) & 2) ) | |
5179 { | |
5180 LOBYTE(v316) = v316 | 2; | |
5181 _this->uItemID = v316; | |
5182 } | |
5183 } | |
5184 } | |
5185 } | |
5186 } | |
5187 } | |
5188 } | |
5189 } | |
5190 } | |
5191 LABEL_616: | |
486 | 5192 if ( LODWORD(v727) == 0 ) |
0 | 5193 { |
5194 v317 = pGlobalTXT_LocalizationStrings[428]; | |
486 | 5195 if ( v730 == 0 ) |
0 | 5196 v317 = pGlobalTXT_LocalizationStrings[585]; |
5197 ShowStatusBarString(v317, 2u); | |
486 | 5198 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 5199 v318 = v726; |
486 | 5200 v3->spellnum = 0; |
5201 v318->PlaySound(SPEECH_43, 0); | |
0 | 5202 } |
488 | 5203 goto play_sound_and_continue; |
0 | 5204 } |
5205 if ( v731 != 2 ) | |
5206 { | |
5207 if ( v731 == 3 ) | |
5208 { | |
5209 v245 = (int)&v244[36 * a2 + 532]; | |
5210 v269 = *(int *)v245; | |
5211 if ( *(int *)v245 > 134 | |
486 | 5212 || *(int *)(v245 + 12) != 0 |
5213 || *(int *)(v245 + 4) != 0 | |
5214 || *(int *)(v245 + 8) != 0 | |
0 | 5215 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) |
5216 goto LABEL_616; | |
5217 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5218 LODWORD(v725) = (int)v270; | |
5219 v271 = v270[28]; | |
5220 if ( v271 && v271 != 1 && v271 != 2 ) | |
5221 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5222 else | |
5223 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5224 if ( v272 ) | |
5225 { | |
5226 uRequiredMana = 1; | |
486 | 5227 v730 = 0; |
0 | 5228 } |
5229 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5230 uRequiredMana = 1; | |
486 | 5231 if (uRequiredMana) |
0 | 5232 goto LABEL_613; |
5233 v273 = v725; | |
5234 v274 = *(char *)(LODWORD(v725) + 28); | |
5235 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 ) | |
5236 { | |
5237 if ( rand() % 100 < 80 | |
5238 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5239 { | |
224 | 5240 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5241 *(int *)(v245 + 4) = 0; |
222 | 5242 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5243 ; |
222 | 5244 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5245 + 1] ) |
5246 { | |
5247 ++*(int *)(v245 + 4); | |
5248 if ( k >= v275 ) | |
5249 break; | |
5250 } | |
5251 v254 = rand(); | |
224 | 5252 v255 = 10;//pItemsTable->field_116D8[19]; |
5253 v256 = 10;//pItemsTable->field_116D8[18]; | |
0 | 5254 goto LABEL_611; |
5255 } | |
222 | 5256 v277 = pItemsTable->pSpecialEnchantments_count; |
0 | 5257 v278 = 0; |
5258 v725 = 0.0; | |
5259 HIDWORD(v733) = 0; | |
222 | 5260 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5261 { |
5262 v730 = (int)&v679; | |
5263 do | |
5264 { | |
222 | 5265 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement); |
0 | 5266 if ( !v279 || v279 == 1 ) |
5267 { | |
222 | 5268 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5269 + 4] |
5270 + v278 * 28); | |
5271 LODWORD(v725) += v280; | |
5272 if ( v280 ) | |
5273 { | |
5274 v281 = v730; | |
5275 v730 += 4; | |
5276 *(int *)v281 = HIDWORD(v733); | |
5277 } | |
5278 } | |
5279 ++HIDWORD(v733); | |
5280 ++v278; | |
5281 } | |
5282 while ( SHIDWORD(v733) < v277 ); | |
5283 } | |
5284 v282 = rand() % SLODWORD(v725); | |
5285 v283 = v679; | |
5286 *(int *)(v245 + 12) = v679; | |
222 | 5287 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5288 v285 = v282 + 1; |
5289 if ( v284 < v285 ) | |
5290 { | |
5291 for ( l = &v679; ; l = (int *)v732 ) | |
5292 { | |
5293 v287 = (int)(l + 1); | |
5294 v732 = v287; | |
5295 v288 = *(int *)v287; | |
5296 *(int *)(v245 + 12) = v288; | |
222 | 5297 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5298 + 4]; |
5299 if ( v284 >= v285 ) | |
5300 break; | |
5301 } | |
5302 } | |
5303 goto LABEL_525; | |
5304 } | |
5305 } | |
5306 else | |
5307 { | |
5308 if ( v731 != 4 | |
5309 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
486 | 5310 || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 |
5311 || v726->pInventoryItems[a2].uEncantmentType != 0 | |
5312 || v726->pInventoryItems[a2]._bonus_strength != 0 | |
315 | 5313 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) |
0 | 5314 goto LABEL_616; |
5315 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5316 LODWORD(v725) = (int)v247; | |
5317 v248 = v247[28]; | |
5318 if ( v248 && v248 != 1 && v248 != 2 ) | |
5319 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5320 else | |
5321 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5322 if ( v249 ) | |
5323 { | |
5324 uRequiredMana = 1; | |
486 | 5325 v730 = 0; |
0 | 5326 } |
5327 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5328 uRequiredMana = 1; | |
486 | 5329 if (uRequiredMana) |
0 | 5330 goto LABEL_613; |
5331 v250 = v725; | |
5332 v251 = *(char *)(LODWORD(v725) + 28); | |
5333 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 ) | |
5334 { | |
5335 if ( rand() % 100 < 80 | |
5336 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5337 { | |
224 | 5338 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5339 *(int *)(v245 + 4) = 0; |
222 | 5340 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5341 ; |
222 | 5342 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5343 + 1] ) |
5344 { | |
5345 ++*(int *)(v245 + 4); | |
5346 if ( m >= v252 ) | |
5347 break; | |
5348 } | |
5349 v254 = rand(); | |
224 | 5350 v255 = 10;// pItemsTable->field_116D8[21]; |
5351 v256 = 10;//pItemsTable->field_116D8[20]; | |
0 | 5352 goto LABEL_611; |
5353 } | |
222 | 5354 v257 = pItemsTable->pSpecialEnchantments_count; |
0 | 5355 v258 = 0; |
5356 v725 = 0.0; | |
5357 HIDWORD(v733) = 0; | |
222 | 5358 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5359 { |
5360 v730 = (int)&v679; | |
5361 do | |
5362 { | |
222 | 5363 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
0 | 5364 if ( !v259 || v259 == 1 ) |
5365 { | |
222 | 5366 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5367 + 4] |
5368 + v258 * 28); | |
5369 LODWORD(v725) += v260; | |
5370 if ( v260 ) | |
5371 { | |
5372 v261 = v730; | |
5373 v730 += 4; | |
5374 *(int *)v261 = HIDWORD(v733); | |
5375 } | |
5376 } | |
5377 ++HIDWORD(v733); | |
5378 ++v258; | |
5379 } | |
5380 while ( SHIDWORD(v733) < v257 ); | |
5381 } | |
5382 v262 = rand() % SLODWORD(v725); | |
5383 v263 = v679; | |
5384 *(int *)(v245 + 12) = v679; | |
222 | 5385 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5386 v265 = v262 + 1; |
5387 if ( v264 < v265 ) | |
5388 { | |
5389 for ( ii = &v679; ; ii = (int *)v732 ) | |
5390 { | |
5391 v267 = (int)(ii + 1); | |
5392 v732 = v267; | |
5393 v268 = *(int *)v267; | |
5394 *(int *)(v245 + 12) = v268; | |
222 | 5395 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5396 + 4]; |
5397 if ( v264 >= v265 ) | |
5398 break; | |
5399 } | |
5400 } | |
5401 LABEL_525: | |
5402 ++*(int *)(v245 + 12); | |
5403 goto LABEL_612; | |
5404 } | |
5405 } | |
5406 LABEL_615: | |
486 | 5407 //v1 = 0; |
0 | 5408 goto LABEL_616; |
5409 } | |
5410 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5411 _this = v289; | |
5412 v290 = v289->uItemID; | |
5413 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5414 if ( v290 > 134 | |
486 | 5415 || _this->uSpecEnchantmentType != 0 |
5416 || _this->uEncantmentType != 0 | |
5417 || _this->_bonus_strength != 0 | |
0 | 5418 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 |
5419 || v291 == 1 | |
5420 || v291 == 2 | |
315 | 5421 || _this->Broken()) |
0 | 5422 goto LABEL_616; |
5423 if ( _this->GetValue() < 0x1C2 ) | |
5424 uRequiredMana = 1; | |
5425 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5426 uRequiredMana = 1; | |
486 | 5427 if ( uRequiredMana != 0 ) |
0 | 5428 goto LABEL_199; |
5429 v292 = *(char *)(LODWORD(v725) + 28); | |
5430 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5431 { | |
5432 v2 = v723; | |
486 | 5433 //v1 = 0; |
0 | 5434 goto LABEL_199; |
5435 } | |
5436 if ( rand() % 100 >= 80 ) | |
5437 { | |
222 | 5438 v297 = pItemsTable->pSpecialEnchantments_count; |
0 | 5439 v294 = _this; |
5440 v298 = 0; | |
5441 v725 = 0.0; | |
5442 HIDWORD(v733) = 0; | |
222 | 5443 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5444 { |
5445 v730 = (int)&v679; | |
5446 do | |
5447 { | |
222 | 5448 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement); |
0 | 5449 if ( !v299 || v299 == 1 ) |
5450 { | |
222 | 5451 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4] |
0 | 5452 + v298 * 28); |
5453 LODWORD(v725) += v300; | |
5454 if ( v300 ) | |
5455 { | |
5456 v301 = v730; | |
5457 v730 += 4; | |
5458 *(int *)v301 = HIDWORD(v733); | |
5459 } | |
5460 } | |
5461 ++HIDWORD(v733); | |
5462 ++v298; | |
5463 } | |
5464 while ( SHIDWORD(v733) < v297 ); | |
5465 } | |
5466 v302 = rand() % SLODWORD(v725); | |
5467 v303 = v679; | |
377 | 5468 v294->uSpecEnchantmentType = v679; |
222 | 5469 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5470 v305 = v302 + 1; |
5471 if ( v304 < v305 ) | |
5472 { | |
5473 for ( jj = &v679; ; jj = (int *)v732 ) | |
5474 { | |
5475 v307 = (int)(jj + 1); | |
5476 v732 = v307; | |
5477 v308 = *(int *)v307; | |
377 | 5478 v294->uSpecEnchantmentType = v308; |
222 | 5479 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5480 if ( v304 >= v305 ) |
5481 break; | |
5482 } | |
5483 } | |
377 | 5484 ++v294->uSpecEnchantmentType; |
0 | 5485 } |
5486 else | |
5487 { | |
5488 v293 = rand(); | |
5489 v294 = _this; | |
224 | 5490 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
377 | 5491 _this->uEncantmentType = 0; |
222 | 5492 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; |
0 | 5493 ; |
377 | 5494 kk += pItemsTable->pEnchantments[v294->uEncantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType |
0 | 5495 + 1] ) |
5496 { | |
377 | 5497 ++v294->uEncantmentType; |
0 | 5498 if ( kk >= v295 ) |
5499 break; | |
5500 } | |
224 | 5501 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5502 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
0 | 5503 } |
5504 v294->uAttributes |= 0x20u; | |
5505 goto LABEL_1055; | |
5506 case 31: | |
5507 amount = 10 * v2; | |
5508 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
488 | 5509 goto play_sound_and_continue; |
0 | 5510 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) |
5511 goto LABEL_200; | |
5512 byte_50C0C0 = LOBYTE(v3->uPlayerID); | |
486 | 5513 pMessageQueue_50CBD0->AddMessage(UIMSG_C3, 0, 0); |
0 | 5514 goto LABEL_1056; |
5515 case 33: | |
5516 LODWORD(v733) = 604800 * v2; | |
5517 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
5518 goto LABEL_200; | |
5519 v319 = uRequiredMana; | |
5520 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5521 { | |
5522 pEventTimer->Pause(); | |
486 | 5523 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, 0, 0); |
0 | 5524 qword_506350 = (signed int)v733; |
5525 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5526 ::uRequiredMana = v319; | |
5527 ::sRecoveryTime = sRecoveryTime; | |
5528 dword_50633C = v3->field_10; | |
5529 dword_506338 = v3->spellnum; | |
5530 LOBYTE(v3->field_8) |= 0x20u; | |
5531 } | |
488 | 5532 goto play_sound_and_continue; |
0 | 5533 case 40: |
5534 v320 = v12 - 2; | |
5535 if ( !v320 ) | |
5536 goto LABEL_632; | |
5537 v321 = v320 - 1; | |
5538 if ( v321 ) | |
5539 { | |
5540 if ( v321 == 1 ) | |
5541 goto LABEL_634; | |
5542 LABEL_632: | |
5543 v322 = 3600 * v2; | |
5544 } | |
5545 else | |
5546 { | |
5547 v322 = 86400 * v2; | |
5548 } | |
5549 amount = v322; | |
5550 LABEL_634: | |
5551 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5552 goto play_sound_and_continue; |
0 | 5553 v323 = v3->uPlayerID_2; |
5554 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5555 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5556 goto LABEL_1056; | |
5557 if ( v731 == 4 ) | |
5558 goto LABEL_637; | |
5559 v732 = amount << 7; | |
5560 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5561 v656 = 15; | |
5562 goto LABEL_640; | |
5563 case 41: | |
5564 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5565 goto play_sound_and_continue; |
0 | 5566 a1.stru_24.Reset(); |
5567 a1.field_48 = v3->spellnum; | |
5568 a1.field_4C = v2; | |
5569 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5570 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 5571 a1.vPosition.y = pParty->vPosition.y; |
5572 a1.vPosition.x = pParty->vPosition.x; | |
486 | 5573 a1.uAttributes = 0; |
0 | 5574 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5575 a1.uSectorID = pIndoor->GetSector( | |
5576 pParty->vPosition.x, | |
5577 pParty->vPosition.y, | |
5578 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 5579 a1.uSpriteFrameID = 0; |
0 | 5580 v326 = 8 * v3->uPlayerID; |
303 | 5581 LOBYTE(v326) = v326 | OBJECT_Player; |
5582 a1.field_58_pid = v326; | |
0 | 5583 a1.field_5C = a2; |
5584 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5585 a1.uFacing = LOWORD(pParty->sRotationY); | |
5586 a1.uSoundID = LOWORD(v3->field_10); | |
5587 if ( pParty->bTurnBasedModeOn == 1 ) | |
5588 LOBYTE(a1.uAttributes) |= 4u; | |
5589 v669 = v3->uPlayerID + 1; | |
5590 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5591 v654 = pParty->sRotationX; | |
5592 goto LABEL_125; | |
5593 case 43: | |
5594 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5595 goto LABEL_200; | |
5596 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5597 goto play_sound_and_continue; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5598 a1.uType = 4090; |
0 | 5599 a1.stru_24.Reset(); |
5600 a1.field_48 = v3->spellnum; | |
5601 a1.field_4C = v2; | |
5602 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5603 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 5604 a1.vPosition.x = pParty->vPosition.x; |
5605 a1.vPosition.y = pParty->vPosition.y; | |
486 | 5606 a1.uAttributes = 0; |
5607 a1.uSectorID = 0; | |
5608 a1.uSpriteFrameID = 0; | |
0 | 5609 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5610 v327 = 8 * v3->uPlayerID; | |
303 | 5611 LOBYTE(v327) = v327 | OBJECT_Player; |
0 | 5612 a1.field_60_distance_related_prolly_lod = 0; |
303 | 5613 a1.field_58_pid = v327; |
0 | 5614 a1.field_5C = a2; |
5615 a1.uFacing = LOWORD(pParty->sRotationY); | |
5616 a1.uSoundID = LOWORD(v3->field_10); | |
5617 if ( pParty->bTurnBasedModeOn == 1 ) | |
5618 a1.uAttributes = 4; | |
486 | 5619 v669 = 0; |
0 | 5620 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5621 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5622 LABEL_124: | |
5623 v654 = v35; | |
5624 LABEL_125: | |
5625 v36 = pParty->sRotationY; | |
5626 goto LABEL_157; | |
488 | 5627 |
5628 case SPELL_SPIRIT_DETECT_LIFE: | |
0 | 5629 v328 = v12 - 2; |
5630 if ( v328 ) | |
5631 { | |
5632 v329 = v328 - 1; | |
5633 if ( v329 && v329 != 1 ) | |
5634 v330 = 600 * v2; | |
5635 else | |
5636 v330 = 3600 * v2; | |
5637 } | |
5638 else | |
5639 { | |
5640 v330 = 1800 * v2; | |
5641 } | |
5642 LODWORD(v733) = v330; | |
5643 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5644 goto play_sound_and_continue; |
5645 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
5646 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
5647 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
5648 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 5649 v83 = 1; |
488 | 5650 |
0 | 5651 v732 = (int)v733 << 7; |
488 | 5652 |
5653 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); | |
5654 LODWORD(v727) = v83; | |
5655 | |
5656 goto play_sound_and_continue; | |
5657 | |
5658 case SPELL_SPIRIT_FATE: | |
0 | 5659 LODWORD(v733) = 300; |
5660 v339 = v12 - 2; | |
5661 if ( v339 ) | |
5662 { | |
5663 v340 = v339 - 1; | |
5664 if ( v340 ) | |
5665 { | |
5666 if ( v340 != 1 ) | |
5667 { | |
5668 amount = v2; | |
5669 goto LABEL_667; | |
5670 } | |
5671 v341 = 6 * v2; | |
5672 } | |
5673 else | |
5674 { | |
5675 v341 = 4 * v2; | |
5676 } | |
5677 } | |
5678 else | |
5679 { | |
5680 v341 = 2 * v2; | |
5681 } | |
5682 amount = v341; | |
5683 LABEL_667: | |
5684 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5685 goto play_sound_and_continue; |
5686 v342 = v3->spell_target_pid; | |
486 | 5687 if ( v342 == 0 ) |
0 | 5688 { |
488 | 5689 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5690 | |
5691 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0); | |
5692 goto LABEL_1056; | |
0 | 5693 } |
141 | 5694 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5695 { |
5696 v343 = v342 >> 3; | |
486 | 5697 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32); |
0 | 5698 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; |
486 | 5699 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0); |
0 | 5700 BYTE2(pActors[v343].uAttributes) |= 8u; |
486 | 5701 v672 = 0; |
0 | 5702 v661 = &pActors[v343]; |
5703 LABEL_165: | |
5704 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5705 } | |
5706 goto LABEL_1056; | |
488 | 5707 |
0 | 5708 case 49: |
5709 v348 = v12 - 2; | |
5710 if ( !v348 ) | |
5711 goto LABEL_677; | |
5712 v349 = v348 - 1; | |
5713 if ( v349 ) | |
5714 { | |
5715 if ( v349 == 1 ) | |
5716 { | |
486 | 5717 amount = 0; |
0 | 5718 goto LABEL_679; |
5719 } | |
5720 LABEL_677: | |
5721 v350 = 3600 * v2; | |
5722 } | |
5723 else | |
5724 { | |
5725 v350 = 86400 * v2; | |
5726 } | |
5727 amount = v350; | |
5728 LABEL_679: | |
5729 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5730 goto play_sound_and_continue; |
0 | 5731 v351 = &pParty->pPlayers[v3->uPlayerID_2]; |
5732 if ( !v351->pConditions[0] ) | |
5733 goto LABEL_1056; | |
5734 if ( v731 == 4 ) | |
5735 { | |
486 | 5736 LODWORD(v351->pConditions[0]) = 0; |
5737 HIDWORD(v351->pConditions[0]) = 0; | |
0 | 5738 goto LABEL_904; |
5739 } | |
5740 v732 = amount << 7; | |
5741 v351->DiscardConditionIfLastsLongerThan( | |
486 | 5742 0, |
0 | 5743 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); |
5744 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5745 goto LABEL_1056; | |
5746 v674 = v3->uPlayerID_2; | |
5747 goto LABEL_685; | |
488 | 5748 case SPELL_SPIRIT_PRESERVATION: |
0 | 5749 v354 = v12 - 2; |
5750 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5751 v356 = 900 * (v2 + 4); | |
5752 else | |
5753 v356 = 300 * (v2 + 12); | |
5754 LODWORD(v733) = v356; | |
5755 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5756 goto play_sound_and_continue; |
0 | 5757 if ( v731 == 1 || v731 == 2 ) |
5758 { | |
488 | 5759 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5760 | |
0 | 5761 v732 = (int)v733 << 7; |
488 | 5762 |
5763 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); | |
5764 goto LABEL_1056; | |
0 | 5765 } |
486 | 5766 a2 = 0; |
0 | 5767 v732 = (int)v733 << 7; |
5768 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5769 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5770 do |
5771 { | |
488 | 5772 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
5773 v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); | |
0 | 5774 ++a2; |
112 | 5775 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5776 } | |
5777 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5778 goto LABEL_1056; |
5779 case 48: | |
5780 v364 = v12 - 2; | |
5781 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5782 v366 = 60 * (v2 + 3); | |
5783 else | |
5784 v366 = 300 * v2 + 180; | |
5785 LODWORD(v733) = v366; | |
5786 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5787 goto play_sound_and_continue; |
0 | 5788 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
5789 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
|
5790 ++a1.uType; |
0 | 5791 a1.stru_24.Reset(); |
5792 a1.field_48 = v3->spellnum; | |
5793 a1.field_4C = v2; | |
5794 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5795 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 5796 a1.uAttributes = 0; |
5797 a1.uSectorID = 0; | |
5798 a1.uSpriteFrameID = 0; | |
0 | 5799 v368 = v3->uPlayerID; |
5800 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 5801 a1.uFacing = 0; |
0 | 5802 v368 *= 8; |
303 | 5803 LOBYTE(v368) = v368 | OBJECT_Player; |
5804 a1.field_58_pid = v368; | |
0 | 5805 a1.uSoundID = LOWORD(v3->field_10); |
486 | 5806 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 5807 { |
5808 v369 = &pActors[dword_50BF30[a2]]; | |
5809 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5810 { | |
5811 a1.vPosition.x = v369->vPosition.x; | |
5812 a1.vPosition.y = v369->vPosition.y; | |
5813 v732 = v369->uActorHeight; | |
5814 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5815 v370 = 8 * dword_50BF30[a2]; | |
486 | 5816 LOBYTE(v370) = v370 | OBJECT_Actor; |
0 | 5817 a1.field_5C = v370; |
486 | 5818 a1.Create(0, 0, 0, 0); |
0 | 5819 v732 = (int)v733 << 7; |
5820 v369->pActorBuffs[4].Apply( | |
5821 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
486 | 5822 v731, 0, 0, 0); |
0 | 5823 } |
5824 } | |
5825 goto LABEL_1056; | |
5826 case 53: | |
5827 v371 = v12 - 2; | |
5828 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
486 | 5829 amount = 0; |
0 | 5830 else |
5831 amount = 86400 * v2; | |
5832 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5833 goto play_sound_and_continue; |
486 | 5834 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, 0, 65536); |
0 | 5835 v373 = v3->uPlayerID_2; |
5836 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5837 goto LABEL_1056; | |
5838 v14 = v731 == 4; | |
5839 pParty->pPlayers[v373].sHealth = 1; | |
5840 if ( v14 ) | |
5841 { | |
5842 v374 = v3->uPlayerID_2; | |
486 | 5843 LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0; |
5844 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0; | |
0 | 5845 v376 = v3->uPlayerID_2; |
486 | 5846 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0; |
5847 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0; | |
0 | 5848 } |
5849 else | |
5850 { | |
5851 v732 = amount << 7; | |
5852 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5853 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5854 0xEu, | |
5855 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5856 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5857 0xDu, | |
5858 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5859 } | |
112 | 5860 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 5861 goto LABEL_720; |
5862 case 54: | |
5863 v378 = v12 - 2; | |
5864 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
5865 v380 = 4 * v2; | |
5866 else | |
5867 v380 = 3 * v2; | |
5868 amount = v380; | |
5869 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5870 goto play_sound_and_continue; |
0 | 5871 v381 = 0; |
5872 HIDWORD(v733) = amount; | |
5873 v730 = 0; | |
5874 v382 = 1; | |
5875 do | |
5876 { | |
5877 v383 = pPlayers[v382]; | |
5878 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
5879 v682[v381++] = v382; | |
5880 ++v382; | |
5881 } | |
5882 while ( v382 <= 4 ); | |
5883 v384 = 0; | |
5884 v730 = v381; | |
486 | 5885 if ( v381 > 0 ) |
0 | 5886 { |
5887 do | |
5888 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
5889 while ( v384 < v381 ); | |
5890 } | |
5891 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
486 | 5892 HIDWORD(v733) = 0; |
5893 if ( v381 > 0 ) | |
0 | 5894 { |
5895 do | |
5896 { | |
5897 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
5898 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
5899 v726 = *(Player **)v385; | |
5900 v386 = v726->GetMaxHealth(); | |
5901 if ( v726->sHealth > v386 ) | |
5902 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
5903 v387 = *(Player **)v385; | |
486 | 5904 if ( v387->sHealth > 0 ) |
0 | 5905 { |
486 | 5906 LODWORD(v387->pConditions[13]) = 0; |
5907 HIDWORD(v387->pConditions[13]) = 0; | |
0 | 5908 } |
5909 v388 = HIDWORD(v733); | |
488 | 5910 |
5911 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, LOWORD(v682[HIDWORD(v733)]) - 1); | |
0 | 5912 HIDWORD(v733) = v388 + 1; |
5913 } | |
5914 while ( v388 + 1 < v730 ); | |
5915 } | |
5916 goto LABEL_1056; | |
488 | 5917 |
0 | 5918 case 55: |
5919 v392 = v12 - 1; | |
5920 if ( !v392 ) | |
5921 { | |
5922 v395 = 180 * v2; | |
5923 goto LABEL_750; | |
5924 } | |
5925 v393 = v392 - 1; | |
5926 if ( !v393 ) | |
5927 { | |
5928 v395 = 10800 * v2; | |
5929 goto LABEL_750; | |
5930 } | |
5931 v394 = v393 - 1; | |
5932 if ( !v394 ) | |
5933 { | |
5934 v395 = 259200 * v2; | |
5935 LABEL_750: | |
5936 amount = v395; | |
5937 goto LABEL_751; | |
5938 } | |
5939 if ( v394 == 1 ) | |
486 | 5940 amount = 0; |
0 | 5941 LABEL_751: |
5942 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5943 goto play_sound_and_continue; |
0 | 5944 v396 = v3->uPlayerID_2; |
5945 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
5946 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
5947 { | |
5948 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
486 | 5949 pParty->pPlayers[v396].PlaySound(SPEECH_25, 0); |
0 | 5950 if ( v731 == 4 ) |
5951 { | |
5952 v397 = v3->uPlayerID_2; | |
486 | 5953 LODWORD(pParty->pPlayers[v397].pConditions[16]) = 0; |
5954 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = 0; | |
0 | 5955 v398 = v3->uPlayerID_2; |
486 | 5956 LODWORD(pParty->pPlayers[v398].pConditions[14]) = 0; |
5957 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = 0; | |
0 | 5958 v399 = v3->uPlayerID_2; |
486 | 5959 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0; |
5960 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0; | |
0 | 5961 } |
5962 else | |
5963 { | |
5964 v732 = amount << 7; | |
5965 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5966 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5967 0x10u, | |
5968 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5969 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5970 0xEu, | |
5971 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5972 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5973 0xDu, | |
5974 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5975 } | |
5976 v83 = 1; | |
112 | 5977 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
488 | 5978 |
0 | 5979 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; |
488 | 5980 |
5981 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 5982 } |
5983 else | |
5984 { | |
5985 v83 = 1; | |
5986 } | |
488 | 5987 LODWORD(v727) = v83; |
5988 goto play_sound_and_continue; | |
5989 | |
0 | 5990 case 61: |
5991 v405 = v12 - 2; | |
5992 if ( !v405 ) | |
5993 goto LABEL_766; | |
5994 v406 = v405 - 1; | |
5995 if ( v406 ) | |
5996 { | |
5997 if ( v406 == 1 ) | |
5998 { | |
486 | 5999 amount = 0; |
0 | 6000 goto LABEL_768; |
6001 } | |
6002 LABEL_766: | |
6003 v407 = 3600 * v2; | |
6004 } | |
6005 else | |
6006 { | |
6007 v407 = 86400 * v2; | |
6008 } | |
6009 amount = v407; | |
6010 LABEL_768: | |
6011 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6012 goto play_sound_and_continue; |
6013 | |
6014 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6015 v323 = v3->uPlayerID_2; |
6016 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6017 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6018 goto LABEL_1056; | |
6019 if ( v731 == 4 ) | |
6020 goto LABEL_637; | |
6021 v732 = amount << 7; | |
6022 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6023 v656 = 12; | |
6024 goto LABEL_640; | |
6025 case 56: | |
6026 v411 = v12 - 2; | |
6027 if ( v411 ) | |
6028 { | |
6029 v412 = v411 - 1; | |
6030 if ( v412 ) | |
6031 { | |
6032 if ( v412 == 1 ) | |
6033 { | |
486 | 6034 amount = 0; |
0 | 6035 goto LABEL_780; |
6036 } | |
6037 v413 = 180 * v2; | |
6038 } | |
6039 else | |
6040 { | |
6041 v413 = 86400 * v2; | |
6042 } | |
6043 } | |
6044 else | |
6045 { | |
6046 v413 = 3600 * v2; | |
6047 } | |
6048 amount = v413; | |
6049 LABEL_780: | |
6050 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6051 goto play_sound_and_continue; |
6052 | |
6053 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6054 v323 = v3->uPlayerID_2; |
6055 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6056 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6057 goto LABEL_1056; | |
6058 if ( v731 == 4 ) | |
6059 goto LABEL_637; | |
6060 v732 = amount << 7; | |
6061 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6062 v656 = 3; | |
6063 goto LABEL_640; | |
6064 case 59: | |
6065 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6066 goto play_sound_and_continue; |
486 | 6067 if ( a2 == 0 || (a2 & 7) != OBJECT_Actor) |
0 | 6068 goto LABEL_1056; |
6069 v417 = (int)&pActors[a2 >> 3]; | |
6070 v730 = v417; | |
6071 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6072 { | |
6073 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6074 v417 = v730; | |
6075 } | |
6076 v418 = *(int *)(v417 + 672); | |
486 | 6077 HIDWORD(v733) = 0; |
0 | 6078 if ( pItemsTable->pItems[v418].uEquipType == 18 ) |
6079 HIDWORD(v733) = *(int *)(v417 + 684); | |
6080 | |
6081 //ItemGen::ItemGen(&v683); | |
6082 v683.Reset(); | |
6083 | |
6084 v419 = *(short *)(v730 + 180); | |
486 | 6085 if (v419) |
0 | 6086 { |
6087 v683.uItemID = v419; | |
6088 goto LABEL_799; | |
6089 } | |
6090 v420 = 0; | |
6091 v421 = v730 + 564; | |
486 | 6092 while ( !*(int *)v421 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) |
0 | 6093 { |
6094 ++v420; | |
6095 v421 += 36; | |
6096 if ( v420 >= 4 ) | |
6097 goto LABEL_799; | |
6098 } | |
6099 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6100 v2 = v723; | |
486 | 6101 //v1 = 0; |
0 | 6102 LABEL_799: |
486 | 6103 if ( HIDWORD(v733) != 0 ) |
0 | 6104 { |
6105 v675 = (const char *)HIDWORD(v733); | |
486 | 6106 if (v683.uItemID) |
0 | 6107 { |
6108 v422 = v683.GetDisplayName(); | |
6109 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6110 goto LABEL_807; | |
6111 } | |
6112 v664 = "%d gold"; | |
6113 goto LABEL_803; | |
6114 } | |
486 | 6115 if (v683.uItemID) |
0 | 6116 { |
6117 v675 = v683.GetDisplayName(); | |
6118 v664 = "(%s)"; | |
6119 LABEL_803: | |
6120 sprintf(pTmpBuf2, v664, v675); | |
6121 goto LABEL_807; | |
6122 } | |
6123 strcpy(pTmpBuf2, "nothing"); | |
6124 LABEL_807: | |
6125 ShowStatusBarString(pTmpBuf2, 2u); | |
6126 a1.stru_24.Reset(); | |
6127 a1.field_48 = v3->spellnum; | |
6128 a1.field_4C = v2; | |
6129 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6130 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 6131 a1.vPosition.x = *(short *)(v730 + 142); |
6132 a1.vPosition.y = *(short *)(v730 + 144); | |
6133 v676 = *(short *)(v730 + 138); | |
6134 v665 = a1.vPosition.y; | |
6135 a1.vPosition.z = *(short *)(v730 + 138); | |
6136 v657 = a1.vPosition.x; | |
6137 goto LABEL_1087; | |
6138 case 62: | |
6139 v423 = v12 - 2; | |
6140 if ( !v423 ) | |
6141 goto LABEL_813; | |
6142 v424 = v423 - 1; | |
6143 if ( v424 ) | |
6144 { | |
6145 if ( v424 == 1 ) | |
6146 v425 = 3600 * v2; | |
6147 else | |
6148 LABEL_813: | |
6149 v425 = 300 * v2; | |
6150 } | |
6151 else | |
6152 { | |
6153 v425 = 600 * v2; | |
6154 } | |
6155 amount = v425; | |
6156 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6157 goto play_sound_and_continue; |
0 | 6158 v426 = a2 >> 3; |
141 | 6159 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6160 goto LABEL_1056; |
6161 v730 = 836 * v426; | |
6162 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6163 { | |
90 | 6164 pActors[v426].pActorBuffs[1].Reset(); |
6165 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6166 v732 = amount << 7; |
90 | 6167 pActors[v426].pActorBuffs[9].Apply( |
0 | 6168 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6169 v731, 0, 0, 0); |
90 | 6170 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6171 } |
6172 a1.stru_24.Reset(); | |
6173 a1.field_48 = v3->spellnum; | |
6174 a1.field_4C = v2; | |
6175 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6176 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 6177 v61 = v426; |
0 | 6178 goto LABEL_1086; |
6179 case 66: | |
6180 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6181 goto play_sound_and_continue; |
0 | 6182 amount = 600 * v2; |
6183 v427 = a2 >> 3; | |
141 | 6184 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6185 goto LABEL_1056; |
6186 v730 = 836 * v427; | |
6187 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
488 | 6188 goto play_sound_and_continue; |
90 | 6189 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6190 { | |
6191 pActors[v427].pActorBuffs[9].Reset(); | |
6192 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6193 v732 = amount << 7; |
90 | 6194 pActors[v427].pActorBuffs[12].Apply( |
0 | 6195 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6196 v731, 0, 0, 0); |
0 | 6197 } |
6198 a1.stru_24.Reset(); | |
6199 a1.field_48 = v3->spellnum; | |
6200 a1.field_4C = v2; | |
6201 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6202 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 6203 v61 = v427; |
0 | 6204 goto LABEL_1086; |
6205 case 63: | |
6206 v428 = v12 - 2; | |
6207 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6208 v430 = 300 * v2; | |
6209 else | |
6210 v430 = 180 * v2; | |
6211 amount = v430; | |
6212 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6213 goto play_sound_and_continue; |
0 | 6214 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
6215 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
|
6216 ++a1.uType; |
0 | 6217 a1.stru_24.Reset(); |
6218 a1.field_48 = v3->spellnum; | |
6219 a1.field_4C = v2; | |
6220 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6221 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 6222 a1.uAttributes = 0; |
6223 a1.uSectorID = 0; | |
6224 a1.uSpriteFrameID = 0; | |
0 | 6225 v432 = v3->uPlayerID; |
6226 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6227 a1.uFacing = 0; |
0 | 6228 v432 *= 8; |
303 | 6229 LOBYTE(v432) = v432 | OBJECT_Player; |
6230 a1.field_58_pid = v432; | |
0 | 6231 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6232 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 6233 { |
6234 v433 = &pActors[dword_50BF30[a2]]; | |
6235 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6236 break; | |
6237 a1.vPosition.x = v433->vPosition.x; | |
6238 a1.vPosition.y = v433->vPosition.y; | |
6239 v732 = v433->uActorHeight; | |
6240 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6241 v434 = 8 * dword_50BF30[a2]; | |
486 | 6242 LOBYTE(v434) = v434 | OBJECT_Actor; |
0 | 6243 a1.field_5C = v434; |
486 | 6244 a1.Create(0, 0, 0, 0); |
0 | 6245 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) |
6246 { | |
6247 v732 = amount << 7; | |
6248 v433->pActorBuffs[4].Apply( | |
6249 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
486 | 6250 v731, 0, 0, 0); |
0 | 6251 } |
6252 } | |
6253 goto LABEL_1056; | |
6254 case 64: | |
6255 v435 = v12 - 2; | |
6256 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
486 | 6257 amount = 0; |
0 | 6258 else |
6259 amount = 86400 * v2; | |
6260 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6261 goto play_sound_and_continue; |
6262 | |
6263 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6264 v440 = v3->uPlayerID_2; |
6265 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6266 { | |
6267 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
486 | 6268 pParty->pPlayers[v440].PlaySound(SPEECH_25, 0); |
0 | 6269 if ( v731 == 4 ) |
6270 { | |
6271 v441 = v3->uPlayerID_2; | |
486 | 6272 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; |
6273 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; | |
0 | 6274 } |
6275 else | |
6276 { | |
6277 v732 = amount << 7; | |
6278 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6279 5u, | |
6280 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6281 } | |
6282 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6283 LABEL_720: | |
486 | 6284 v377->SetCondition(1, 0); |
0 | 6285 } |
6286 goto LABEL_1056; | |
6287 case 42: | |
6288 v442 = v12 - 2; | |
6289 if ( !v442 ) | |
6290 goto LABEL_855; | |
6291 v443 = v442 - 1; | |
6292 if ( v443 ) | |
6293 { | |
6294 if ( v443 == 1 ) | |
6295 v444 = 4 * v2; | |
6296 else | |
6297 LABEL_855: | |
6298 v444 = 2 * v2; | |
6299 } | |
6300 else | |
6301 { | |
6302 v444 = 3 * v2; | |
6303 } | |
6304 amount = v444; | |
6305 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6306 goto play_sound_and_continue; |
0 | 6307 v445 = a2 >> 3; |
141 | 6308 if ( (a2 & 7) == OBJECT_Item) |
0 | 6309 { |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6310 v449 = (char *)&pSpriteObjects[v445].stru_24; |
0 | 6311 v450 = *(int *)v449; |
6312 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6313 { | |
6314 party_finds_gold(*((int *)v449 + 3), 0); | |
6315 viewparams->bRedrawGameUI = 1; | |
6316 } | |
6317 else | |
6318 { | |
189 | 6319 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
0 | 6320 ShowStatusBarString(pTmpBuf2, 2u); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6321 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
|
6322 pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24); |
0 | 6323 } |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6324 SpriteObject::OnInteraction(v445); |
0 | 6325 } |
6326 else | |
6327 { | |
141 | 6328 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6329 { |
6330 stru_50C198.LootActor(&pActors[v445]); | |
6331 } | |
6332 else | |
6333 { | |
141 | 6334 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6335 { |
141 | 6336 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6337 goto LABEL_1056; |
6338 dword_507CD8 = 1; | |
6339 v677 = 1; | |
6340 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6341 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6342 else | |
6343 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6344 goto LABEL_866; | |
6345 } | |
6346 v447 = &pLevelDecorations[v445]; | |
6347 dword_507CD8 = 1; | |
6348 v448 = v447->field_16_event_id; | |
486 | 6349 if (v448) |
0 | 6350 { |
6351 v677 = 1; | |
6352 v446 = v448; | |
6353 LABEL_866: | |
6354 EventProcessor(v446, a2, v677); | |
6355 goto LABEL_1056; | |
6356 } | |
6357 if ( v447->IsInteractive() ) | |
6358 { | |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
6359 activeLevelDecoration = v447; |
0 | 6360 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
|
6361 activeLevelDecoration = NULL; |
0 | 6362 } |
6363 } | |
6364 } | |
6365 goto LABEL_1056; | |
6366 case 67: | |
6367 v451 = v12 - 2; | |
6368 if ( v451 ) | |
6369 { | |
6370 v452 = v451 - 1; | |
6371 if ( v452 ) | |
6372 { | |
6373 if ( v452 == 1 ) | |
6374 { | |
486 | 6375 amount = 0; |
0 | 6376 goto LABEL_883; |
6377 } | |
6378 v453 = 180 * v2; | |
6379 } | |
6380 else | |
6381 { | |
6382 v453 = 86400 * v2; | |
6383 } | |
6384 } | |
6385 else | |
6386 { | |
6387 v453 = 3600 * v2; | |
6388 } | |
6389 amount = v453; | |
6390 LABEL_883: | |
6391 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6392 goto play_sound_and_continue; |
6393 | |
6394 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6395 v323 = v3->uPlayerID_2; |
6396 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6397 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6398 goto LABEL_1056; | |
6399 if ( v731 == 4 ) | |
6400 { | |
6401 LABEL_637: | |
486 | 6402 *(int *)v324 = 0; |
6403 *((int *)v324 + 1) = 0; | |
0 | 6404 goto LABEL_1056; |
6405 } | |
6406 v732 = amount << 7; | |
6407 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6408 v656 = 1; | |
6409 LABEL_640: | |
6410 v325 = &pParty->pPlayers[v323]; | |
6411 goto LABEL_641; | |
6412 case 68: | |
6413 v457 = v12 - 2; | |
6414 if ( v457 ) | |
6415 { | |
6416 v458 = v457 - 1; | |
6417 if ( v458 ) | |
6418 { | |
6419 if ( v458 == 1 ) | |
6420 v459 = 5 * v2 + 5; | |
6421 else | |
6422 v459 = 2 * v2 + 5; | |
6423 } | |
6424 else | |
6425 { | |
6426 v459 = 4 * v2 + 5; | |
6427 } | |
6428 } | |
6429 else | |
6430 { | |
6431 v459 = 3 * v2 + 5; | |
6432 } | |
6433 amount = v459; | |
6434 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6435 goto play_sound_and_continue; |
6436 v460 = v3->spell_target_pid; | |
486 | 6437 if (!v460) |
0 | 6438 { |
6439 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6440 LABEL_904: | |
6441 v674 = v3->uPlayerID_2; | |
6442 LABEL_685: | |
488 | 6443 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v674); |
0 | 6444 } |
6445 else | |
6446 { | |
141 | 6447 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6448 { |
6449 v461 = &pActors[v460 >> 3]; | |
6450 v462 = v461->uAIState; | |
6451 v463 = v461->pMonsterInfo.uHP; | |
6452 if ( v462 != 5 ) | |
6453 { | |
6454 if ( v462 != 4 ) | |
6455 { | |
6456 if ( v462 != 19 ) | |
6457 { | |
6458 if ( v462 != 11 ) | |
6459 { | |
6460 v461->sCurrentHP += amount; | |
6461 if ( v461->sCurrentHP > v463 ) | |
6462 v461->sCurrentHP = v463; | |
6463 } | |
6464 } | |
6465 } | |
6466 } | |
6467 } | |
6468 } | |
6469 goto LABEL_1056; | |
6470 case 72: | |
6471 v464 = v12 - 2; | |
6472 if ( !v464 ) | |
6473 goto LABEL_910; | |
6474 v465 = v464 - 1; | |
6475 if ( v465 ) | |
6476 { | |
6477 if ( v465 == 1 ) | |
6478 { | |
486 | 6479 amount = 0; |
0 | 6480 goto LABEL_912; |
6481 } | |
6482 LABEL_910: | |
6483 v466 = 3600 * v2; | |
6484 } | |
6485 else | |
6486 { | |
6487 v466 = 86400 * v2; | |
6488 } | |
6489 amount = v466; | |
6490 LABEL_912: | |
6491 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6492 goto play_sound_and_continue; |
6493 | |
6494 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6495 v470 = v3->uPlayerID_2; |
6496 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6497 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6498 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6499 goto LABEL_1056; | |
6500 if ( v731 == 4 ) | |
6501 { | |
486 | 6502 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; |
6503 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; | |
0 | 6504 v471 = v3->uPlayerID_2; |
486 | 6505 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; |
6506 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; | |
0 | 6507 v472 = v3->uPlayerID_2; |
486 | 6508 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; |
6509 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; | |
0 | 6510 goto LABEL_1056; |
6511 } | |
6512 v732 = amount << 7; | |
6513 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6514 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6515 6u, | |
6516 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6517 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6518 8u, | |
6519 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6520 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6521 v656 = 10; | |
6522 goto LABEL_937; | |
488 | 6523 |
6524 | |
0 | 6525 case 75: |
6526 amount = v2; | |
6527 LODWORD(v733) = 3600 * v2; | |
6528 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6529 goto play_sound_and_continue; |
6530 | |
6531 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6532 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6533 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6534 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6535 | |
0 | 6536 v732 = (int)v733 << 7; |
488 | 6537 |
6538 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | |
6539 goto LABEL_1056; | |
6540 | |
0 | 6541 case 73: |
6542 LODWORD(v733) = 3600 * v2; | |
6543 amount = v2; | |
6544 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6545 goto play_sound_and_continue; |
0 | 6546 if ( v731 == 4 ) |
6547 { | |
488 | 6548 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6549 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6550 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6551 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 6552 v732 = (int)v733 << 7; |
6553 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
488 | 6554 pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6555 pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6556 pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6557 | |
6558 pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, v2, v2, 0); | |
6559 goto LABEL_1056; | |
6560 //goto LABEL_104; | |
6561 } | |
6562 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
6563 | |
0 | 6564 v732 = (int)v733 << 7; |
488 | 6565 |
6566 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); | |
6567 goto LABEL_1056; | |
0 | 6568 case 74: |
6569 v493 = v12 - 2; | |
6570 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
486 | 6571 amount = 0; |
0 | 6572 else |
6573 amount = 86400 * v2; | |
6574 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6575 goto play_sound_and_continue; |
6576 | |
6577 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6578 v498 = v3->uPlayerID_2; |
6579 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6580 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6581 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6582 goto LABEL_1056; | |
6583 if ( v731 == 4 ) | |
6584 { | |
486 | 6585 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; |
6586 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; | |
0 | 6587 v499 = v3->uPlayerID_2; |
486 | 6588 LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0; |
6589 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0; | |
0 | 6590 v500 = v3->uPlayerID_2; |
486 | 6591 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; |
6592 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; | |
0 | 6593 } |
6594 else | |
6595 { | |
6596 v732 = amount << 7; | |
6597 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6598 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6599 7u, | |
6600 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6601 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6602 9u, | |
6603 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6604 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6605 v656 = 11; | |
6606 LABEL_937: | |
112 | 6607 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6608 LABEL_641: |
6609 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6610 } | |
6611 goto LABEL_1056; | |
6612 case 77: | |
486 | 6613 { |
0 | 6614 amount = 5 * v2 + 10; |
6615 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6616 goto play_sound_and_continue; |
0 | 6617 v501 = pParty->pPlayers; |
486 | 6618 int v1 = 0; |
0 | 6619 do |
6620 { | |
488 | 6621 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v1); |
0 | 6622 v501->Heal(amount); |
6623 ++v501; | |
6624 ++v1; | |
6625 } | |
6626 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6627 goto LABEL_1056; | |
486 | 6628 } |
0 | 6629 case 80: |
6630 sRecoveryTime -= v2; | |
6631 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6632 goto play_sound_and_continue; |
6633 | |
0 | 6634 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); |
6635 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
|
6636 ++a1.uType; |
0 | 6637 HIDWORD(v733) = v505; |
486 | 6638 v690 = 0; |
6639 v689 = 0; | |
6640 v688 = 0; | |
0 | 6641 a1.stru_24.Reset(); |
6642 a1.field_48 = v3->spellnum; | |
6643 a1.field_4C = v2; | |
6644 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6645 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 6646 a1.uAttributes = 0; |
6647 a1.uSectorID = 0; | |
6648 a1.uSpriteFrameID = 0; | |
0 | 6649 v506 = v3->uPlayerID; |
6650 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6651 a1.uFacing = 0; |
0 | 6652 v506 *= 8; |
303 | 6653 LOBYTE(v506) = v506 | OBJECT_Player; |
6654 a1.field_58_pid = v506; | |
0 | 6655 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6656 a2 = 0; |
6657 if ( SHIDWORD(v733) > 0 ) | |
0 | 6658 { |
6659 do | |
6660 { | |
6661 v507 = dword_50BF30[a2]; | |
6662 a1.vPosition.x = pActors[v507].vPosition.x; | |
6663 a1.vPosition.y = pActors[v507].vPosition.y; | |
6664 v732 = pActors[v507].uActorHeight; | |
6665 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6666 v508 = 8 * dword_50BF30[a2]; | |
486 | 6667 LOBYTE(v508) = v508 | OBJECT_Actor; |
0 | 6668 a1.field_5C = v508; |
486 | 6669 v509 = a1.Create(0, 0, 0, 0); |
0 | 6670 v510 = a2; |
486 | 6671 DamageMonsterFromParty(8 * v509 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v688); |
0 | 6672 a2 = v510 + 1; |
6673 } | |
6674 while ( v510 + 1 < SHIDWORD(v733) ); | |
6675 } | |
486 | 6676 for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 ) |
0 | 6677 { |
6678 v511 = &pActors[dword_50BF30[a2]]; | |
6679 a1.vPosition.x = v511->vPosition.x; | |
6680 a1.vPosition.y = v511->vPosition.y; | |
6681 v732 = v511->uActorHeight; | |
6682 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6683 v512 = 8 * dword_50BF30[a2]; | |
486 | 6684 LOBYTE(v512) = v512 | OBJECT_Actor; |
0 | 6685 a1.field_5C = v512; |
486 | 6686 a1.Create(0, 0, 0, 0); |
0 | 6687 v513 = v511->pActorBuffs; |
6688 v726 = (Player *)22; | |
6689 do | |
6690 { | |
6691 v513->Reset(); | |
6692 ++v513; | |
6693 v726 = (Player *)((char *)v726 - 1); | |
6694 } | |
6695 while ( *(float *)&v726 != 0.0 ); | |
6696 } | |
6697 goto LABEL_1056; | |
6698 case 82: | |
6699 v514 = v12 - 2; | |
6700 if ( !v514 ) | |
6701 goto LABEL_955; | |
6702 v515 = v514 - 1; | |
6703 if ( v515 ) | |
6704 { | |
6705 if ( v515 == 1 ) | |
6706 { | |
6707 v516 = 900 * v2; | |
6708 amount = 5; | |
6709 } | |
6710 else | |
6711 { | |
6712 LABEL_955: | |
6713 v516 = 300 * v2; | |
6714 amount = 1; | |
6715 } | |
6716 } | |
6717 else | |
6718 { | |
6719 v516 = 900 * v2; | |
6720 amount = 3; | |
6721 } | |
486 | 6722 v733 = __PAIR__(0, v516); |
0 | 6723 v517 = 8 * v3->uPlayerID; |
6724 LOBYTE(v517) = v517 | 4; | |
486 | 6725 if ( (signed int)uNumActors > 0 ) |
0 | 6726 { |
90 | 6727 v518 = pActors;//[0].uAIState; |
6728 v726b = uNumActors; | |
0 | 6729 do |
6730 { | |
90 | 6731 v519 = v518->uAIState; |
6732 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6733 ++HIDWORD(v733); |
90 | 6734 ++v518; |
6735 --v726; | |
0 | 6736 } |
90 | 6737 while ( v726 != 0 ); |
0 | 6738 } |
6739 if ( SHIDWORD(v733) >= amount ) | |
6740 { | |
6741 v66 = pGlobalTXT_LocalizationStrings[648]; | |
6742 goto LABEL_201; | |
6743 } | |
6744 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6745 goto play_sound_and_continue; |
0 | 6746 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); |
6747 goto LABEL_1056; | |
6748 case 83: | |
6749 v520 = v12 - 2; | |
6750 if ( !v520 ) | |
6751 goto LABEL_973; | |
6752 v521 = v520 - 1; | |
6753 if ( v521 ) | |
6754 { | |
6755 if ( v521 == 1 ) | |
6756 { | |
6757 LODWORD(v733) = 18000 * v2; | |
6758 v522 = 5 * v2 + 10; | |
6759 } | |
6760 else | |
6761 { | |
6762 LABEL_973: | |
6763 LODWORD(v733) = 10800 * v2; | |
6764 v522 = 3 * v2 + 10; | |
6765 } | |
6766 } | |
6767 else | |
6768 { | |
6769 LODWORD(v733) = 14400 * v2; | |
6770 v522 = 4 * v2 + 10; | |
6771 } | |
6772 amount = v522; | |
6773 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6774 goto play_sound_and_continue; |
6775 | |
6776 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6777 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6778 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6779 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 6780 v83 = 1; |
488 | 6781 |
0 | 6782 v732 = (int)v733 << 7; |
488 | 6783 |
6784 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); | |
6785 LODWORD(v727) = v83; | |
6786 | |
6787 goto play_sound_and_continue; | |
6788 | |
0 | 6789 case 84: |
6790 v67 = 2; | |
6791 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
6792 { | |
6793 v66 = pGlobalTXT_LocalizationStrings[497]; | |
6794 goto LABEL_202; | |
6795 } | |
6796 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6797 goto play_sound_and_continue; |
0 | 6798 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
|
6799 ++a1.uType; |
0 | 6800 v726 = (Player *)v531; |
486 | 6801 v696 = 0; |
6802 v695 = 0; | |
6803 v694 = 0; | |
0 | 6804 a1.stru_24.Reset(); |
6805 a1.field_48 = v3->spellnum; | |
6806 a1.field_4C = v2; | |
6807 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6808 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 6809 a1.uAttributes = 0; |
6810 a1.uSectorID = 0; | |
6811 a1.uSpriteFrameID = 0; | |
0 | 6812 v532 = v3->uPlayerID; |
6813 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6814 a1.uFacing = 0; |
0 | 6815 v532 *= 8; |
303 | 6816 LOBYTE(v532) = v532 | OBJECT_Player; |
6817 a1.field_58_pid = v532; | |
0 | 6818 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6819 a2 = 0; |
6820 if ( (signed int)v726 > 0 ) | |
0 | 6821 { |
6822 do | |
6823 { | |
6824 v533 = dword_50BF30[a2]; | |
6825 a1.vPosition.x = pActors[v533].vPosition.x; | |
6826 a1.vPosition.y = pActors[v533].vPosition.y; | |
6827 v732 = pActors[v533].uActorHeight; | |
6828 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6829 v534 = 8 * dword_50BF30[a2]; | |
486 | 6830 LOBYTE(v534) = v534 | OBJECT_Actor; |
0 | 6831 a1.field_5C = v534; |
486 | 6832 v535 = a1.Create(0, 0, 0, 0); |
0 | 6833 v536 = a2; |
486 | 6834 DamageMonsterFromParty(8 * v535 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v694); |
0 | 6835 a2 = v536 + 1; |
6836 } | |
6837 while ( v536 + 1 < (signed int)v726 ); | |
6838 } | |
6839 v537 = pGame->GetStru6(); | |
6840 pGame->GetStru6()->_4A8BFC(); | |
6841 goto LABEL_1056; | |
488 | 6842 |
6843 case SPELL_LIGHT_DAY_OF_PROTECTION: | |
0 | 6844 v538 = v12 - 2; |
6845 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
6846 { | |
6847 amount = 5 * v2; | |
6848 v540 = 18000 * v2; | |
6849 } | |
6850 else | |
6851 { | |
6852 amount = 4 * v2; | |
6853 v540 = 14400 * v2; | |
6854 } | |
6855 v730 = v540; | |
6856 LODWORD(v733) = v540; | |
6857 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6858 goto play_sound_and_continue; |
6859 | |
6860 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6861 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6862 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6863 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6864 | |
0 | 6865 v732 = v730 << 7; |
6866 v549 = (double)(v730 << 7) * 0.033333335; | |
6867 *((float *)&v733 + 1) = v549; | |
6868 v712 = (signed __int64)v549; | |
488 | 6869 pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, 0, 0); |
6870 pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6871 pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6872 pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6873 pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6874 pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
0 | 6875 v550 = v2 + 5; |
488 | 6876 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply( |
0 | 6877 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
6878 v731, | |
486 | 6879 v550, 0, 0); |
488 | 6880 |
6881 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0); | |
6882 goto LABEL_1056; | |
0 | 6883 case 86: |
6884 v551 = v12 - 2; | |
6885 if ( !v551 ) | |
6886 goto LABEL_998; | |
6887 v552 = v551 - 1; | |
6888 if ( v552 ) | |
6889 { | |
6890 if ( v552 == 1 ) | |
6891 { | |
6892 amount = 15; | |
6893 HIDWORD(v733) = 20; | |
6894 goto LABEL_1000; | |
6895 } | |
6896 LABEL_998: | |
6897 v678 = 4; | |
6898 } | |
6899 else | |
6900 { | |
6901 v678 = 12; | |
6902 } | |
6903 amount = v678; | |
6904 HIDWORD(v733) = v678; | |
6905 LABEL_1000: | |
6906 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6907 goto play_sound_and_continue; |
0 | 6908 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); |
6909 v732 = (300 * amount * v2 + 60) << 7; | |
6910 v730 = v2 + 5; | |
486 | 6911 v726 = 0; |
89 | 6912 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 6913 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
6914 do | |
6915 { | |
488 | 6916 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6917 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6918 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6919 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6920 | |
89 | 6921 //((SpellBuff *)(v553 + 6056))->Apply( |
488 | 6922 v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
0 | 6923 if ( *(_QWORD *)v553 ) |
6924 v726 = (Player *)1; | |
89 | 6925 ++v553; |
6926 } | |
6927 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 6928 v562 = v731; |
488 | 6929 pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
6930 pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, 0, 0, 0); | |
6931 pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, v730, 0, 0); | |
486 | 6932 if (v726) |
0 | 6933 goto LABEL_1056; |
6934 v732 = (int)y << 7; | |
488 | 6935 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); |
6936 goto LABEL_1056; | |
0 | 6937 case 88: |
6938 amount = 3; | |
6939 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
6940 goto LABEL_200; | |
6941 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6942 goto play_sound_and_continue; |
486 | 6943 a2 = 0; |
0 | 6944 _this = (ItemGen *)&pPlayers[1]; |
6945 do | |
6946 { | |
6947 v563 = 0; | |
6948 do | |
6949 { | |
6950 v564 = _this->uItemID; | |
486 | 6951 *(int *)(v563 + _this->uItemID) = 0; |
0 | 6952 v563 += 8; |
486 | 6953 *(int *)(v563 + v564 - 4) = 0; |
0 | 6954 } |
6955 while ( v563 <= 128 ); | |
6956 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
6957 v566 = (Player **)_this; | |
6958 *(int *)(_this->uItemID + 6460) = v565; | |
6959 v567 = (*v566)->GetMaxMana(); | |
6960 *(int *)(_this->uItemID + 6464) = v567; | |
488 | 6961 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
0 | 6962 ++a2; |
6963 _this = (ItemGen *)((char *)_this + 4); | |
6964 } | |
6965 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
6966 v571 = pPlayer; | |
6967 v572 = (char *)&pPlayer->sAgeModifier; | |
6968 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
6969 *(short *)v572 = 120; | |
6970 else | |
6971 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
6972 sRecoveryTime += -5 * v2; | |
6973 ++v571->uNumDivineInterventionCastsThisDay; | |
6974 goto LABEL_1056; | |
6975 case 89: | |
6976 v573 = v12 - 2; | |
6977 if ( v573 ) | |
6978 { | |
6979 v574 = v573 - 1; | |
6980 if ( v574 ) | |
6981 { | |
6982 if ( v574 == 1 ) | |
6983 v575 = 5 * v2; | |
6984 else | |
6985 v575 = 2 * v2; | |
6986 } | |
6987 else | |
6988 { | |
6989 v575 = 4 * v2; | |
6990 } | |
6991 } | |
6992 else | |
6993 { | |
6994 v575 = 3 * v2; | |
6995 } | |
6996 amount = v575; | |
6997 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6998 goto play_sound_and_continue; |
6999 v576 = v3->spell_target_pid; | |
486 | 7000 if (!v576) |
0 | 7001 { |
7002 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
488 | 7003 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
0 | 7004 if ( *((_QWORD *)v585 + 14) ) |
7005 { | |
7006 ((Player *)v585)->SetCondition(0x11u, 1); | |
7007 v587 = ((Player *)v585)->GetSexByVoice(); | |
7008 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7009 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7010 } | |
488 | 7011 goto play_sound_and_continue; |
0 | 7012 } |
7013 v577 = (Player *)(v576 >> 3); | |
7014 v726 = v577; | |
7015 if ( v577 == (Player *)-1 ) | |
7016 { | |
7017 v66 = pGlobalTXT_LocalizationStrings[496]; | |
7018 goto LABEL_201; | |
7019 } | |
7020 v578 = (int)&pActors[(int)v577]; | |
7021 v721 = v578; | |
486 | 7022 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) |
0 | 7023 goto LABEL_200; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7024 ++a1.uType; |
0 | 7025 a1.stru_24.Reset(); |
7026 a1.field_48 = v3->spellnum; | |
7027 a1.field_4C = v2; | |
7028 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7029 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 7030 a1.uAttributes = 0; |
7031 a1.uSectorID = 0; | |
7032 a1.uSpriteFrameID = 0; | |
0 | 7033 v580 = v3->uPlayerID; |
7034 a1.field_60_distance_related_prolly_lod = 0; | |
7035 v581 = v721; | |
7036 v580 *= 8; | |
303 | 7037 LOBYTE(v580) = v580 | OBJECT_Player; |
486 | 7038 a1.uFacing = 0; |
303 | 7039 a1.field_58_pid = v580; |
0 | 7040 a1.uSoundID = LOWORD(v3->field_10); |
7041 a1.vPosition.x = *(short *)(v721 + 142); | |
7042 a1.vPosition.y = *(short *)(v721 + 144); | |
7043 v732 = *(short *)(v721 + 138); | |
7044 v582 = 8 * (int)v726; | |
7045 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
486 | 7046 LOBYTE(v582) = 8 * (char)v726 | OBJECT_Actor; |
0 | 7047 a1.field_5C = v582; |
486 | 7048 a1.Create(0, 0, 0, 0); |
0 | 7049 if ( *(char *)(v581 + 52) > amount ) |
488 | 7050 goto play_sound_and_continue; |
0 | 7051 Actor::Resurrect((unsigned int)v726); |
7052 *(char *)(v581 + 61) = 0; | |
7053 *(char *)(v581 + 53) = 0; | |
7054 *(char *)(v581 + 54) = 0; | |
7055 *(char *)(v581 + 55) = 0; | |
7056 *(char *)(v581 + 56) = 0; | |
7057 *(char *)(v581 + 57) = 0; | |
7058 *(int *)(v581 + 712) = 9999; | |
7059 *(char *)(v581 + 38) &= 0xF7u; | |
486 | 7060 *(int *)(v581 + 708) = 0; |
0 | 7061 ((SpellBuff *)(v581 + 356))->Reset(); |
7062 ((SpellBuff *)(v581 + 228))->Reset(); | |
7063 ((SpellBuff *)(v581 + 404))->Reset(); | |
7064 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7065 *(short *)(v581 + 40) = 10 * amount; | |
7066 goto LABEL_1056; | |
7067 case 91: | |
7068 v588 = v12 - 1; | |
7069 amount = 16; | |
7070 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7071 { | |
7072 if ( v590 == 1 ) | |
486 | 7073 LODWORD(v733) = 0; |
0 | 7074 } |
7075 else | |
7076 { | |
7077 LODWORD(v733) = 3600 * v2; | |
7078 } | |
7079 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7080 goto play_sound_and_continue; |
0 | 7081 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; |
7082 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7083 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7084 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7085 || *(char *)(HIDWORD(v733) + 20) & 2 | |
486 | 7086 || *(int *)(HIDWORD(v733) + 12) != 0 |
7087 || *(int *)(HIDWORD(v733) + 4) != 0 | |
0 | 7088 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 |
377 | 7089 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) |
0 | 7090 goto LABEL_199; |
7091 v592 = HIDWORD(v733); | |
7092 v14 = v731 == 4; | |
7093 *(int *)(HIDWORD(v733) + 12) = 16; | |
7094 if ( !v14 ) | |
7095 { | |
7096 v732 = (int)v733 << 7; | |
7097 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7098 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7099 *(int *)(v592 + 20) |= 8u; | |
7100 } | |
7101 *(char *)(v592 + 20) |= 0x80u; | |
7102 goto LABEL_1055; | |
7103 case 93: | |
7104 v593 = v12 - 2; | |
7105 if ( !v593 ) | |
7106 goto LABEL_1062; | |
7107 v594 = v593 - 1; | |
7108 if ( v594 ) | |
7109 { | |
7110 if ( v594 == 1 ) | |
7111 amount = 9; | |
7112 else | |
7113 LABEL_1062: | |
7114 amount = 5; | |
7115 } | |
7116 else | |
7117 { | |
7118 amount = 7; | |
7119 } | |
7120 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7121 goto play_sound_and_continue; |
0 | 7122 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); |
7123 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7124 a1.stru_24.Reset(); | |
7125 a1.field_48 = v3->spellnum; | |
7126 a1.field_4C = v2; | |
7127 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7128 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 7129 a1.vPosition.x = pParty->vPosition.x; |
7130 a1.vPosition.y = pParty->vPosition.y; | |
486 | 7131 a1.uAttributes = 0; |
0 | 7132 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
7133 a1.uSectorID = pIndoor->GetSector( | |
7134 pParty->vPosition.x, | |
7135 pParty->vPosition.y, | |
7136 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
486 | 7137 a1.uSpriteFrameID = 0; |
0 | 7138 v595 = 8 * v3->uPlayerID; |
303 | 7139 LOBYTE(v595) = v595 | OBJECT_Player; |
7140 a1.field_58_pid = v595; | |
0 | 7141 a1.field_5C = a2; |
7142 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7143 a1.uSoundID = LOWORD(v3->field_10); | |
7144 if ( pParty->bTurnBasedModeOn == 1 ) | |
7145 LOBYTE(a1.uAttributes) |= 4u; | |
7146 v596 = (signed int)v726 / -2; | |
7147 y = (char *)((signed int)v726 / 2); | |
7148 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7149 { | |
7150 v597 = v715.uYawAngle; | |
7151 do | |
7152 { | |
7153 a1.uFacing = v596 + v597; | |
7154 if ( a1.Create( | |
7155 v596 + v597, | |
7156 v715.uPitchAngle, | |
7157 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7158 v3->uPlayerID + 1) != -1 | |
7159 && pParty->bTurnBasedModeOn == 1 ) | |
7160 ++pTurnEngine->field_1C; | |
7161 v596 += v732; | |
7162 } | |
7163 while ( v596 <= (signed int)y ); | |
7164 } | |
7165 goto LABEL_1056; | |
7166 case 94: | |
7167 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7168 goto play_sound_and_continue; |
0 | 7169 if ( v731 == 1 || v731 == 2 ) |
7170 { | |
7171 v598 = 180 * v2; | |
7172 goto LABEL_1081; | |
7173 } | |
7174 if ( v731 == 3 ) | |
7175 { | |
7176 v598 = 300 * v2; | |
7177 LABEL_1081: | |
7178 LODWORD(v733) = v598; | |
7179 goto LABEL_1082; | |
7180 } | |
7181 if ( v731 == 4 ) | |
7182 LODWORD(v733) = 29030400; | |
7183 LABEL_1082: | |
7184 v599 = a2 >> 3; | |
141 | 7185 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7186 goto LABEL_1056; |
7187 v730 = 836 * v599; | |
7188 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
488 | 7189 goto play_sound_and_continue; |
90 | 7190 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
0 | 7191 goto LABEL_200; |
90 | 7192 pActors[v599].pActorBuffs[9].Reset(); |
7193 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7194 v732 = (int)v733 << 7; |
90 | 7195 pActors[v599].pActorBuffs[12].Apply( |
0 | 7196 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 7197 v731, 0, 0, 0); |
0 | 7198 a1.stru_24.Reset(); |
7199 a1.field_48 = v3->spellnum; | |
7200 a1.field_4C = v2; | |
7201 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7202 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 7203 v61 = v599; |
0 | 7204 LABEL_1086: |
90 | 7205 v600 = pActors[v61].vPosition.y; |
7206 v601 = pActors[v61].vPosition.x; | |
0 | 7207 a1.uObjectDescID = v60; |
7208 a1.vPosition.x = v601; | |
90 | 7209 v602 = pActors[v61].uActorHeight; |
7210 v603 = pActors[v61].vPosition.z; | |
0 | 7211 a1.vPosition.y = v600; |
7212 v676 = v603 + v602; | |
7213 v665 = v600; | |
7214 a1.vPosition.z = v603 + v602; | |
7215 v657 = v601; | |
7216 LABEL_1087: | |
486 | 7217 a1.uAttributes = 0; |
0 | 7218 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); |
486 | 7219 a1.uSpriteFrameID = 0; |
0 | 7220 v604 = 8 * v3->uPlayerID; |
303 | 7221 LOBYTE(v604) = v604 | OBJECT_Player; |
7222 a1.field_58_pid = v604; | |
0 | 7223 a1.field_5C = a2; |
7224 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7225 a1.uFacing = LOWORD(v715.uYawAngle); | |
7226 LOWORD(v604) = LOWORD(v3->field_10); | |
7227 LOBYTE(a1.uAttributes) |= 0x80u; | |
7228 a1.uSoundID = v604; | |
486 | 7229 a1.Create(0, 0, 0, v3->uPlayerID + 1); |
0 | 7230 goto LABEL_1056; |
7231 case 96: | |
7232 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7233 goto play_sound_and_continue; |
486 | 7234 HIDWORD(v733) = 0; |
521 | 7235 memset(&achievedAwardsIndex, 0, 4000); |
486 | 7236 _this = 0; |
0 | 7237 v605 = (char *)pParty->pHirelings; |
7238 do | |
7239 { | |
486 | 7240 if ( *(int *)v605) |
0 | 7241 { |
7242 v606 = HIDWORD(v733)++; | |
521 | 7243 achievedAwardsIndex[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7244 } |
7245 _this = (ItemGen *)((char *)_this + 1); | |
7246 v605 += 76; | |
7247 } | |
7248 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
486 | 7249 _this = 0; |
7250 if ( (signed int)pNPCStats->uNumNewNPCs > 0) | |
0 | 7251 { |
7252 v730 = (int)pNPCStats->pNewNPCData; | |
7253 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7254 do | |
7255 { | |
7256 if ( *(char *)(v730 + 8) & 0x80 | |
486 | 7257 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) |
7258 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
0 | 7259 { |
7260 v607 = HIDWORD(v733); | |
7261 HIDWORD(v733) += 4; | |
7262 *(int *)v607 = (int)_this + 3; | |
7263 } | |
7264 _this = (ItemGen *)((char *)_this + 1); | |
7265 v730 += 76; | |
7266 } | |
7267 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7268 } | |
7269 v608 = v3->uPlayerID_2; | |
7270 if ( v608 != 4 && v608 != 5 | |
486 | 7271 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) |
0 | 7272 || v609 >= 3 ) |
7273 goto LABEL_200; | |
7274 v610 = 76 * v609; | |
486 | 7275 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; |
0 | 7276 v611 = pIconsFrameTable->FindIcon("spell96"); |
488 | 7277 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611); |
0 | 7278 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; |
89 | 7279 v612 = pParty->pPlayers; |
0 | 7280 do |
7281 { | |
89 | 7282 v612->sHealth = v612->GetMaxHealth(); |
7283 v612->sMana = v612->GetMaxMana(); | |
7284 ++v612; | |
7285 } | |
7286 while ( v612 <= &pParty->pPlayers[3] ); | |
7287 v613 = &pOutdoor->ddm; | |
0 | 7288 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7289 v613 = &pIndoor->dlv; |
7290 v613->uReputation += 15; | |
7291 if ( v613->uReputation > 10000 ) | |
7292 v613->uReputation = 10000; | |
488 | 7293 LODWORD(v727) = 1; |
7294 goto play_sound_and_continue; | |
0 | 7295 case 95: |
486 | 7296 if ( v12 <= 0 ) |
0 | 7297 goto LABEL_1119; |
7298 if ( v12 <= 3 ) | |
7299 { | |
7300 v614 = 300 * (v2 + 12); | |
7301 } | |
7302 else | |
7303 { | |
7304 if ( v12 != 4 ) | |
7305 goto LABEL_1119; | |
7306 v614 = 900 * (v2 + 4); | |
7307 } | |
7308 LODWORD(v733) = v614; | |
7309 LABEL_1119: | |
7310 v615 = v2 + 5; | |
7311 amount = v615; | |
7312 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7313 goto play_sound_and_continue; |
0 | 7314 if ( v731 != 3 && v731 != 4 ) |
7315 { | |
488 | 7316 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
7317 | |
0 | 7318 v732 = (int)v733 << 7; |
488 | 7319 |
7320 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); | |
7321 goto LABEL_1056; | |
0 | 7322 } |
486 | 7323 a2 = 0; |
0 | 7324 v732 = (int)v733 << 7; |
7325 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7326 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7327 do |
7328 { | |
488 | 7329 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
7330 v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | |
0 | 7331 ++a2; |
112 | 7332 ++v619; |
7333 } | |
7334 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7335 goto LABEL_1056; |
7336 case 99: | |
7337 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7338 goto play_sound_and_continue; |
486 | 7339 v726 = 0; |
0 | 7340 pGame->GetIndoorCamera(); |
7341 v623 = (signed __int64)GetPickDepth(); | |
7342 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
486 | 7343 v709 = 0; |
7344 v708 = 0; | |
7345 v707 = 0; | |
0 | 7346 a1.stru_24.Reset(); |
7347 a1.field_48 = v3->spellnum; | |
7348 a1.field_4C = v2; | |
7349 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7350 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 7351 a1.uAttributes = 0; |
7352 a1.uSectorID = 0; | |
7353 a1.uSpriteFrameID = 0; | |
0 | 7354 v624 = v3->uPlayerID; |
7355 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 7356 a1.uFacing = 0; |
0 | 7357 v624 *= 8; |
303 | 7358 LOBYTE(v624) = v624 | OBJECT_Player; |
7359 a1.field_58_pid = v624; | |
0 | 7360 a1.uSoundID = LOWORD(v3->field_10); |
486 | 7361 a2 = 0; |
7362 if ( SHIDWORD(v733) > 0 ) | |
0 | 7363 { |
7364 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7365 do | |
7366 { | |
7367 v625 = dword_50BF30[a2]; | |
7368 a1.vPosition.x = pActors[v625].vPosition.x; | |
7369 a1.vPosition.y = pActors[v625].vPosition.y; | |
7370 v732 = pActors[v625].uActorHeight; | |
7371 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7372 v626 = 8 * dword_50BF30[a2]; | |
486 | 7373 LOBYTE(v626) = v626 | OBJECT_Actor; |
0 | 7374 a1.field_5C = v626; |
486 | 7375 v627 = a1.Create(0, 0, 0, 0); |
0 | 7376 v628 = a2; |
7377 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7378 a2 = v628 + 1; | |
7379 } | |
7380 while ( v628 + 1 < SHIDWORD(v733) ); | |
7381 } | |
486 | 7382 v730 = 0; |
0 | 7383 v629 = 1; |
7384 do | |
7385 { | |
7386 v630 = pPlayers[v629]; | |
7387 if ( !v630->pConditions[2] | |
7388 && !v630->pConditions[12] | |
7389 && !v630->pConditions[13] | |
7390 && !v630->pConditions[14] | |
7391 && !v630->pConditions[15] | |
7392 && !v630->pConditions[16] ) | |
7393 { | |
7394 v631 = v730++; | |
7395 v681[v631] = v629; | |
7396 } | |
7397 ++v629; | |
7398 } | |
7399 while ( v629 <= 4 ); | |
7400 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
486 | 7401 HIDWORD(v733) = 0; |
7402 if ( v730 > 0 ) | |
0 | 7403 { |
7404 do | |
7405 { | |
7406 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7407 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7408 v633->sHealth += v732; | |
7409 v726 = *(Player **)v632; | |
7410 v634 = v726->GetMaxHealth(); | |
7411 if ( v726->sHealth > v634 ) | |
7412 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7413 v635 = HIDWORD(v733); | |
488 | 7414 |
7415 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, WORD2(v733)); | |
0 | 7416 HIDWORD(v733) = v635 + 1; |
7417 } | |
7418 while ( v635 + 1 < v730 ); | |
7419 } | |
486 | 7420 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); |
0 | 7421 goto LABEL_1056; |
7422 case 98: | |
7423 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7424 { | |
7425 v66 = pGlobalTXT_LocalizationStrings[499]; | |
7426 goto LABEL_201; | |
7427 } | |
7428 v640 = v12 - 2; | |
7429 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7430 amount = 3; | |
486 | 7431 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) |
0 | 7432 goto LABEL_200; |
7433 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7434 goto play_sound_and_continue; |
349 | 7435 pParty->armageddon_timer = 256; |
0 | 7436 pParty->field_16140 = v2; |
7437 ++pPlayer->uNumArmageddonCasts; | |
7438 if ( pParty->bTurnBasedModeOn == 1 ) | |
7439 ++pTurnEngine->field_1C; | |
7440 v726 = (Player *)50; | |
7441 do | |
7442 { | |
7443 v642 = rand() % 4096 - 2048; | |
7444 v643 = rand(); | |
7445 v721 = v642 + pParty->vPosition.x; | |
7446 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
486 | 7447 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0); |
0 | 7448 v644 = rand(); |
486 | 7449 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0); |
0 | 7450 v726 = (Player *)((char *)v726 - 1); |
7451 } | |
7452 while ( *(float *)&v726 != 0.0 ); | |
7453 goto LABEL_1056; | |
7454 default: | |
488 | 7455 goto play_sound_and_continue; |
0 | 7456 } |
7457 while ( 2 ) | |
7458 { | |
7459 if ( v731 == 4 ) | |
7460 { | |
7461 if ( *((_QWORD *)v222 + 2) ) | |
7462 { | |
486 | 7463 *((int *)v222 + 4) = 0; |
7464 *((int *)v222 + 5) = 0; | |
0 | 7465 goto LABEL_439; |
7466 } | |
7467 } | |
7468 else | |
7469 { | |
7470 v732 = amount << 7; | |
7471 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7472 2u, | |
7473 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7474 v222 = (char *)HIDWORD(v733); | |
7475 if ( v223 ) | |
7476 LABEL_439: | |
486 | 7477 ((Player *)v222)->PlaySound(SPEECH_103, 0); |
0 | 7478 } |
7479 v222 += 6972; | |
7480 HIDWORD(v733) = (int)v222; | |
7481 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7482 goto LABEL_1056; | |
7483 continue; | |
7484 } | |
7485 } | |
7486 //----- (0042EB42) -------------------------------------------------------- | |
7487 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7488 { | |
7489 unsigned int v2; // edx@1 | |
7490 signed int v3; // eax@1 | |
7491 char *v4; // ecx@2 | |
7492 | |
7493 v2 = this->uNumObjects; | |
7494 v3 = 0; | |
7495 if ( (signed int)this->uNumObjects <= 0 ) | |
7496 { | |
7497 LABEL_5: | |
7498 LOWORD(v3) = 0; | |
7499 } | |
7500 else | |
7501 { | |
7502 v4 = (char *)&this->pObjects->uObjectID; | |
7503 while ( uItemID != *(short *)v4 ) | |
7504 { | |
7505 ++v3; | |
7506 v4 += 56; | |
7507 if ( v3 >= (signed int)v2 ) | |
7508 goto LABEL_5; | |
7509 } | |
7510 } | |
7511 return v3; | |
7512 } | |
7513 | |
7514 | |
7515 | |
7516 //----- (0042EB78) -------------------------------------------------------- | |
7517 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7518 { | |
7519 return 8 * this->pIcons[uIconID].uAnimLength; | |
7520 } | |
7521 | |
437 | 7522 |
7523 const wchar_t *UIMessage2String(UIMessageType msg) | |
7524 { | |
7525 #define CASE(xxx) case xxx: _swprintf(b, L"%03X/%s", msg, L#xxx); return b; | |
7526 static wchar_t b[256]; // bad for threads | |
7527 switch (msg) | |
7528 { | |
7529 CASE(UIMSG_SelectSpell) | |
7530 CASE(UIMSG_ChangeGameState) | |
7531 CASE(UIMSG_Attack) | |
7532 CASE(UIMSG_PlayArcomage) | |
7533 CASE(UIMSG_MainMenu_ShowPartyCreationWnd) | |
7534 CASE(UIMSG_MainMenu_ShowLoadWindow) | |
7535 CASE(UIMSG_ShowCredits) | |
7536 CASE(UIMSG_ExitToWindows) | |
7537 CASE(UIMSG_PlayerCreationChangeName) | |
7538 CASE(UIMSG_PlayerCreationClickPlus) | |
7539 CASE(UIMSG_PlayerCreationClickMinus) | |
7540 CASE(UIMSG_PlayerCreationSelectActiveSkill) | |
7541 CASE(UIMSG_PlayerCreationSelectClass) | |
7542 CASE(UIMSG_PlayerCreationClickOK) | |
7543 CASE(UIMSG_PlayerCreationClickReset) | |
7544 CASE(UIMSG_AutonotesBook) | |
7545 CASE(UIMSG_PlayerCreationRemoveUpSkill) | |
7546 CASE(UIMSG_PlayerCreationRemoveDownSkill) | |
7547 CASE(UIMSG_SPellbook_ShowHightlightedSpellInfo) | |
7548 CASE(UIMSG_LoadGame) | |
7549 CASE(UIMSG_SaveGame) | |
7550 CASE(UIMSG_ShowStatus_DateTime) | |
7551 CASE(UIMSG_ShowStatus_ManaHP) | |
7552 CASE(UIMSG_ShowStatus_Player) | |
7553 CASE(UIMSG_Wait5Minutes) | |
7554 CASE(UIMSG_Wait1Hour) | |
7555 CASE(UIMSG_ShowStatus_Food) | |
7556 CASE(UIMSG_ShowStatus_Funds) | |
7557 CASE(UIMSG_QuickReference) | |
7558 CASE(UIMSG_GameMenuButton) | |
7559 CASE(UIMSG_AlreadyResting) | |
7560 CASE(UIMSG_SelectCharacter) | |
7561 CASE(UIMSG_ChangeSoundVolume) | |
7562 CASE(UIMSG_ChangeMusicVolume) | |
7563 CASE(UIMSG_Escape) | |
7564 CASE(UIMSG_PlayerCreation_SelectAttribute) | |
7565 CASE(UIMSG_InventoryLeftClick) | |
7566 CASE(UIMSG_SkillUp) | |
7567 CASE(UIMSG_GameMenu_ReturnToGame) | |
7568 CASE(UIMSG_StartNewGame) | |
7569 CASE(UIMSG_Game_OpenLoadGameDialog) | |
7570 CASE(UIMSG_Game_OpenSaveGameDialog) | |
7571 CASE(UIMSG_Game_OpenOptionsDialog) | |
7572 CASE(UIMSG_SetGraphicsMode) | |
7573 CASE(UIMSG_Quit) | |
7574 CASE(UIMSG_StartHireling1Dialogue) | |
7575 CASE(UIMSG_StartHireling2Dialogue) | |
7576 CASE(UIMSG_SelectDialogueOption) | |
7577 CASE(UIMSG_CastSpellFromBook) | |
7578 CASE(UIMSG_PlayerCreation_VoicePrev) | |
7579 CASE(UIMSG_PlayerCreation_VoiceNext) | |
7580 CASE(UIMSG_StartNPCDialogue) | |
7581 CASE(UIMSG_ArrowUp) | |
7582 CASE(UIMSG_DownArrow) | |
7583 CASE(UIMSG_LoadSlot) | |
7584 CASE(UIMSG_SelectLoadSlot) | |
7585 CASE(UIMSG_Cancel) | |
7586 CASE(UIMSG_ExitRest) | |
7587 CASE(UIMSG_PlayerCreation_FacePrev) | |
7588 CASE(UIMSG_PlayerCreation_FaceNext) | |
7589 CASE(UIMSG_CycleCharacters) | |
7590 CASE(UIMSG_SetTurnSpeed) | |
7591 CASE(UIMSG_ToggleWalkSound) | |
7592 CASE(UIMSG_ChangeVoiceVolume) | |
7593 CASE(UIMSG_ToggleShowDamage) | |
7594 CASE(UIMSG_ScrollNPCPanel) | |
7595 CASE(UIMSG_ShowFinalWindow) | |
7596 CASE(UIMSG_OpenQuestBook) | |
7597 CASE(UIMSG_OpenAutonotes) | |
7598 CASE(UIMSG_OpenMapBook) | |
7599 CASE(UIMSG_OpenCalendar) | |
7600 CASE(UIMSG_OpenHistoryBook) | |
7601 CASE(UIMSG_ToggleAlwaysRun) | |
7602 CASE(UIMSG_ToggleFlipOnExit) | |
7603 CASE(UIMSG_Game_Action) | |
7604 CASE(UIMSG_OpenRestUI) | |
7605 CASE(UIMSG_TransitionUI_Confirm) | |
7606 CASE(UIMSG_OpenKeyMappingOptions) | |
7607 CASE(UIMSG_SelectKeyPage1) | |
7608 CASE(UIMSG_SelectKeyPage2) | |
7609 CASE(UIMSG_ResetKeyMapping) | |
7610 CASE(UIMSG_ChangeKeyButton) | |
7611 CASE(UIMSG_OpenVideoOptions) | |
7612 CASE(UIMSG_ToggleBloodsplats) | |
7613 CASE(UIMSG_ToggleColoredLights) | |
7614 CASE(UIMSG_ToggleTint) | |
7615 default: | |
7616 _swprintf(b, L"UIMSG_%03X", msg); return b; | |
7617 }; | |
7618 #undef CASE | |
7619 } | |
7620 | |
7621 | |
0 | 7622 //----- (0042EB8D) -------------------------------------------------------- |
437 | 7623 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |
0 | 7624 { |
482 | 7625 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); |
0 | 7626 if (uNumMessages < 40) |
7627 { | |
437 | 7628 files[uNumMessages] = file; |
7629 lines[uNumMessages] = line; | |
7630 | |
0 | 7631 pMessages[uNumMessages].eType = msg; |
7632 pMessages[uNumMessages].param = param; | |
7633 pMessages[uNumMessages++].field_8 = a4; | |
7634 } | |
7635 } | |
7636 | |
7637 //----- (0042EBBE) -------------------------------------------------------- | |
7638 int __fastcall sub_42EBBE(int a1, int a2) | |
7639 { | |
7640 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7641 } | |
7642 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7643 | |
7644 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 7645 int stru193_math::Sin(int angle) |
0 | 7646 { |
323 | 7647 return Cos(angle - this->uIntegerHalfPi); |
0 | 7648 } |
7649 | |
7650 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 7651 void _42ECB5_PlayerAttacksActor() |
0 | 7652 { |
271 | 7653 //unsigned int v0; // ebx@1 |
7654 //Player *v1; // esi@1 | |
7655 //bool result; // eax@1 | |
295 | 7656 //int v3; // edi@2 |
271 | 7657 //unsigned int v4; // eax@7 |
0 | 7658 char *v5; // eax@8 |
271 | 7659 //int v6; // ecx@9 |
7660 //signed int v7; // eax@16 | |
295 | 7661 //Actor *v8; // edi@20 |
0 | 7662 unsigned int v9; // ecx@21 |
295 | 7663 //char *v10; // eax@26 |
0 | 7664 char *v11; // eax@26 |
7665 unsigned int v12; // eax@47 | |
295 | 7666 //char *v13; // eax@47 |
7667 //char *v14; // eax@47 | |
7668 //unsigned int v15; // ebx@54 | |
7669 //int v16; // [sp-10h] [bp-4Ch]@24 | |
7670 //int v17; // [sp-10h] [bp-4Ch]@44 | |
7671 //unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7672 //unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7673 //__int16 v20; // [sp-8h] [bp-44h]@24 | |
7674 //__int16 v21; // [sp-8h] [bp-44h]@44 | |
7675 //int v22; // [sp-4h] [bp-40h]@24 | |
7676 //int v23; // [sp-4h] [bp-40h]@44 | |
0 | 7677 SoundID v24; // [sp-4h] [bp-40h]@58 |
295 | 7678 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 |
271 | 7679 //unsigned int a2; // [sp+18h] [bp-24h]@20 |
7680 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
295 | 7681 //int v28; // [sp+20h] [bp-1Ch]@9 |
271 | 7682 //unsigned int *v28b; |
295 | 7683 //int v29; // [sp+24h] [bp-18h]@16 |
7684 //int v30; // [sp+28h] [bp-14h]@16 | |
271 | 7685 //int v31; // [sp+2Ch] [bp-10h]@4 |
295 | 7686 //int v32; // [sp+30h] [bp-Ch]@7 |
271 | 7687 //int v33; // [sp+34h] [bp-8h]@7 |
295 | 7688 //int v34; // [sp+38h] [bp-4h]@17 |
0 | 7689 |
271 | 7690 //v0 = uActiveCharacter; |
7691 //v27 = 6972 * uActiveCharacter; | |
7692 //v1 = &pParty->pPlayers[uActiveCharacter-1]; | |
7693 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); | |
7694 auto player = &pParty->pPlayers[uActiveCharacter - 1]; | |
7695 if (!player->CanAct()) | |
7696 return; | |
7697 | |
7698 pStru277->_427D48(uActiveCharacter); | |
295 | 7699 //v3 = 0; |
271 | 7700 if (pParty->Invisible()) |
7701 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
7702 | |
7703 //v31 = player->pEquipment.uBow; | |
7704 int bow_idx = player->pEquipment.uBow; | |
7705 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) | |
7706 bow_idx = 0; | |
7707 | |
295 | 7708 //v32 = 0; |
7709 int wand_item_id = 0; | |
271 | 7710 //v33 = 0; |
7711 //v4 = v1->pEquipment.uMainHand; | |
7712 int laser_weapon_item_id = 0; | |
7713 | |
7714 int main_hand_idx = player->pEquipment.uMainHand; | |
7715 if (main_hand_idx) | |
0 | 7716 { |
271 | 7717 auto item = &player->pInventoryItems[main_hand_idx - 1]; |
112 | 7718 //v5 = (char *)v1 + 36 * v4; |
271 | 7719 if (!item->Broken()) |
7720 { | |
7721 //v28b = &v1->pInventoryItems[v4].uItemID; | |
7722 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
295 | 7723 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND) |
0 | 7724 { |
295 | 7725 if (item->uNumCharges <= 0) |
7726 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 7727 else |
295 | 7728 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 7729 } |
271 | 7730 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
7731 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 7732 } |
271 | 7733 } |
7734 | |
295 | 7735 //v30 = 0; |
7736 //v29 = 0; | |
7737 //v28 = 0; | |
271 | 7738 //v7 = pMouse->uPointingObjectID; |
7739 | |
7740 int target_pid = pMouse->uPointingObjectID; | |
7741 int target_type = target_pid & 7, | |
7742 target_id = target_pid >> 3; | |
7743 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) | |
7744 { | |
7745 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
7746 target_type = target_pid & 7; | |
7747 target_id = target_pid >> 3; | |
7748 } | |
295 | 7749 |
7750 auto actor = &pActors[target_id]; | |
7751 int actor_distance = 0; | |
271 | 7752 if (target_type == OBJECT_Actor) |
7753 { | |
295 | 7754 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
7755 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
7756 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
7757 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
7758 if (actor_distance < 0) | |
7759 actor_distance = 0; | |
7760 } | |
7761 | |
7762 bool shooting_bow = false, | |
7763 shotting_laser = false, | |
7764 shooting_wand = false; | |
7765 if (laser_weapon_item_id) | |
7766 { | |
7767 shotting_laser = true; | |
490 | 7768 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); |
295 | 7769 } |
7770 else if (wand_item_id) | |
7771 { | |
7772 shooting_wand = true; | |
7773 | |
7774 int main_hand_idx = player->pEquipment.uMainHand; | |
490 | 7775 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItems[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); |
295 | 7776 |
7777 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | |
7778 player->pEquipment.uMainHand = 0; | |
7779 } | |
303 | 7780 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 7781 { |
303 | 7782 Vec3_int_ a3; |
7783 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
7784 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
7785 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
7786 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
7787 | |
7788 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); | |
305 | 7789 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) |
295 | 7790 _42FA66_do_explosive_impact( |
7791 actor->vPosition.x, | |
7792 actor->vPosition.y, | |
7793 actor->vPosition.z + actor->uActorHeight / 2, | |
7794 0, 512, uActiveCharacter); | |
303 | 7795 } |
7796 else if (bow_idx) | |
7797 { | |
7798 shooting_bow = true; | |
490 | 7799 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0); |
295 | 7800 } |
7801 else | |
7802 { | |
303 | 7803 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
7804 } | |
7805 | |
7806 if (!pParty->bTurnBasedModeOn) | |
7807 { | |
7808 int recovery = player->GetAttackRecoveryTime(0); | |
7809 if (recovery < 30 ) | |
7810 recovery = 30; | |
7811 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); | |
295 | 7812 } |
7813 | |
7814 | |
7815 int v34 = 0; | |
7816 if (shooting_wand) | |
7817 return; | |
7818 else if (shooting_bow) | |
7819 { | |
7820 v34 = 5; | |
7821 player->PlaySound(SPEECH_50, 0); | |
7822 } | |
7823 if (shotting_laser) | |
7824 v34 = 7; | |
7825 else | |
7826 { | |
7827 int main_hand_idx = player->pEquipment.uMainHand; | |
7828 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) | |
7829 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType; | |
7830 pTurnEngine->_40471C(); | |
7831 } | |
7832 | |
7833 switch (v34) | |
7834 { | |
7835 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
7836 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
7837 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
7838 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
7839 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
7840 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
7841 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
7842 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
7843 } | |
0 | 7844 } |
7845 | |
7846 //----- (0042F184) -------------------------------------------------------- | |
295 | 7847 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 7848 { |
7849 int v4; // edi@1 | |
7850 stru319 *v5; // esi@1 | |
7851 int v6; // eax@2 | |
7852 int v7; // eax@4 | |
7853 int result; // eax@5 | |
7854 int *v9; // edx@8 | |
7855 signed int v10; // ebx@10 | |
7856 int v11; // edi@11 | |
7857 Actor *v12; // esi@12 | |
7858 unsigned __int16 v13; // ax@12 | |
7859 int v14; // eax@22 | |
7860 char v15; // zf@30 | |
7861 int v16; // esi@32 | |
7862 int v17; // ecx@34 | |
7863 stru319 *v18; // eax@39 | |
7864 int v19; // edx@39 | |
7865 int v20; // ecx@41 | |
7866 unsigned __int16 v21; // ax@42 | |
7867 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
7868 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
7869 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
7870 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
7871 int *v26; // [sp+18h] [bp-14h]@8 | |
7872 int v27; // [sp+1Ch] [bp-10h]@10 | |
7873 int *v28; // [sp+20h] [bp-Ch]@10 | |
7874 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
7875 int v30; // [sp+28h] [bp-4h]@6 | |
7876 int i; // [sp+38h] [bp+Ch]@33 | |
7877 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
7878 | |
7879 v4 = 0; | |
7880 v5 = this; | |
7881 v24 = this; | |
7882 if ( pRenderer->pRenderD3D ) | |
7883 { | |
7884 v6 = a3 != 0; | |
7885 if ( a4 ) | |
7886 LOBYTE(v6) = v6 | 8; | |
295 | 7887 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 7888 if ( v7 != -1 ) |
7889 return (unsigned __int16)v7; | |
295 | 7890 else return 0; |
0 | 7891 } |
7892 else | |
7893 { | |
7894 v30 = 0; | |
7895 if ( pRenderer->pActiveZBuffer ) | |
7896 { | |
7897 v29 = viewparams->uScreenX; | |
7898 v23 = viewparams->uScreenZ; | |
7899 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) | |
7900 { | |
7901 v25 = viewparams->uScreenW - viewparams->uScreenY; | |
7902 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
7903 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY]; | |
7904 do | |
7905 { | |
7906 if ( (signed int)v29 < (signed int)v23 ) | |
7907 { | |
7908 v28 = v9; | |
7909 v10 = v4; | |
7910 v27 = v23 - v29; | |
7911 do | |
7912 { | |
7913 v22 = *v28; | |
7914 v11 = *v28 & 0xFFFF; | |
141 | 7915 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 7916 { |
7917 v12 = &pActors[(unsigned int)v11 >> 3]; | |
7918 v13 = v12->uAIState; | |
7919 if ( v13 != 5 ) | |
7920 { | |
7921 if ( v13 != 4 | |
7922 && v13 != 11 | |
7923 && v13 != 19 | |
7924 && v13 != 17 | |
7925 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
7926 { | |
7927 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
295 | 7928 && v22 <= pick_depth << 16 ) |
0 | 7929 { |
7930 v14 = 0; | |
7931 if ( v10 > 0 ) | |
7932 { | |
7933 do | |
7934 { | |
7935 if ( dword_50BDA0[v14] == v11 ) | |
7936 break; | |
7937 ++v14; | |
7938 } | |
7939 while ( v14 < v30 ); | |
7940 } | |
7941 if ( v14 == v30 && v10 < 100 ) | |
7942 { | |
7943 ++v30; | |
7944 dword_50BC10[v10] = v22; | |
7945 dword_50BDA0[v10] = v11; | |
7946 ++v10; | |
7947 } | |
7948 } | |
7949 } | |
7950 } | |
7951 } | |
7952 ++v28; | |
7953 --v27; | |
7954 } | |
7955 while ( v27 ); | |
7956 v4 = v30; | |
7957 v5 = v24; | |
7958 } | |
7959 v9 = v26 + 640; | |
7960 v15 = v25-- == 1; | |
7961 v26 += 640; | |
7962 } | |
7963 while ( !v15 ); | |
7964 } | |
7965 if ( v4 > 0 ) | |
7966 { | |
7967 v32 = 1; | |
7968 v16 = (int)dword_50BC10; | |
7969 do | |
7970 { | |
7971 for ( i = v32; i < v4; ++i ) | |
7972 { | |
7973 v17 = dword_50BC10[i]; | |
7974 if ( v17 < *(int *)v16 ) | |
7975 { | |
7976 dword_50BC10[i] = *(int *)v16; | |
7977 *(int *)v16 = v17; | |
7978 } | |
7979 } | |
7980 ++v32; | |
7981 v16 += 4; | |
7982 } | |
7983 while ( v32 - 1 < v4 ); | |
7984 v5 = v24; | |
7985 if ( v4 > 0 ) | |
7986 { | |
7987 v18 = v24; | |
7988 v19 = v4; | |
7989 do | |
7990 { | |
7991 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
7992 v18 += 4; | |
7993 --v19; | |
7994 } | |
7995 while ( v19 ); | |
7996 } | |
7997 } | |
7998 v20 = 0; | |
7999 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
8000 { | |
8001 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8002 if ( v21 != 4 && v21 != 5 ) | |
8003 break; | |
8004 } | |
8005 if ( v20 != v4 ) | |
8006 { | |
8007 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8008 LOBYTE(result) = result | 3; | |
8009 return result; | |
8010 } | |
8011 } | |
8012 } | |
8013 return 0; | |
8014 } | |
8015 | |
8016 | |
8017 //----- (0042F3D6) -------------------------------------------------------- | |
8018 void InitializeTurnBasedAnimations(void *_this) | |
8019 { | |
8020 unsigned int *v1; // edi@1 | |
8021 | |
8022 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8023 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8024 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8025 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8026 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8027 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8028 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8029 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8030 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8031 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8032 v1 = pIconIDs_Turn; | |
8033 do | |
8034 { | |
8035 pIconsFrameTable->InitializeAnimation(*v1); | |
8036 ++v1; | |
8037 } | |
8038 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8039 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8040 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8041 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8042 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8043 } | |
8044 | |
8045 //----- (0042F4DA) -------------------------------------------------------- | |
8046 signed int __cdecl sub_42F4DA() | |
8047 { | |
8048 signed int v0; // edi@1 | |
82 | 8049 Actor *v1; // esi@4 |
0 | 8050 int v2; // ebx@5 |
8051 int v3; // eax@5 | |
8052 int v4; // ebx@5 | |
8053 unsigned int v5; // ecx@5 | |
8054 int v6; // edx@6 | |
8055 unsigned int v7; // edx@8 | |
8056 unsigned int v8; // edx@10 | |
8057 __int16 v9; // ax@12 | |
8058 signed int result; // eax@20 | |
8059 int v11; // [sp+Ch] [bp-10h]@5 | |
8060 int v12; // [sp+10h] [bp-Ch]@5 | |
8061 signed int v13; // [sp+14h] [bp-8h]@3 | |
8062 | |
8063 v0 = 5120; | |
8064 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8065 v0 = 2560; | |
8066 v13 = 0; | |
8067 if ( (signed int)uNumActors <= 0 ) | |
8068 { | |
8069 LABEL_20: | |
8070 result = 0; | |
8071 } | |
8072 else | |
8073 { | |
82 | 8074 v1 = pActors; |
0 | 8075 while ( 1 ) |
8076 { | |
82 | 8077 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8078 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8079 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8080 v3 = v2; |
8081 v4 = v11; | |
8082 v5 = v12; | |
8083 if ( v3 < v11 ) | |
8084 { | |
8085 v6 = v3; | |
8086 v3 = v11; | |
8087 v4 = v6; | |
8088 } | |
8089 if ( v3 < v12 ) | |
8090 { | |
8091 v7 = v3; | |
8092 v3 = v12; | |
8093 v5 = v7; | |
8094 } | |
8095 if ( v4 < (signed int)v5 ) | |
8096 { | |
8097 v8 = v5; | |
8098 v5 = v4; | |
8099 v4 = v8; | |
8100 } | |
8101 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8102 { | |
82 | 8103 v9 = v1->uAIState; |
8104 if ( v1->uAIState != 5 ) | |
0 | 8105 { |
8106 if ( v9 != 4 | |
8107 && v9 != 11 | |
8108 && v9 != 19 | |
8109 && v9 != 17 | |
82 | 8110 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8111 break; |
8112 } | |
8113 } | |
8114 ++v13; | |
82 | 8115 ++v1; |
0 | 8116 if ( v13 >= (signed int)uNumActors ) |
8117 goto LABEL_20; | |
8118 } | |
8119 result = 1; | |
8120 } | |
8121 return result; | |
8122 } | |
8123 | |
8124 //----- (0042F7EB) -------------------------------------------------------- | |
8125 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) | |
8126 { | |
8127 unsigned int v9; // edi@1 | |
8128 signed int v10; // edx@3 | |
8129 char *v11; // ecx@4 | |
8130 unsigned __int16 v12; // ax@7 | |
8131 unsigned int v13; // edx@9 | |
8132 char *v14; // ecx@10 | |
8133 int v15; // esi@17 | |
8134 int v16; // eax@18 | |
8135 int v17; // edi@20 | |
8136 int v18; // esi@20 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8137 //SpriteObject a1a; // [sp+Ch] [bp-78h]@1 |
0 | 8138 int v21; // [sp+7Ch] [bp-8h]@1 |
8139 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8140 | |
8141 v9 = uSpriteID; | |
8142 v21 = x; | |
8143 v22 = uSpriteID; | |
8144 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8145 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
|
8146 //SpriteObject::SpriteObject(&a1a); |
0 | 8147 a1a.stru_24.Reset(); |
8148 | |
8149 if ( a9 ) | |
8150 { | |
8151 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8152 v9 = v22; | |
8153 } | |
8154 v10 = 0; | |
8155 a1a.field_50 = 0; | |
8156 a1a.field_4C = 0; | |
8157 a1a.field_48 = 0; | |
8158 a1a.field_54 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8159 a1a.uType = v9; |
0 | 8160 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
8161 { | |
8162 LABEL_7: | |
8163 v12 = 0; | |
8164 } | |
8165 else | |
8166 { | |
8167 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8168 while ( (short)v9 != *(short *)v11 ) | |
8169 { | |
8170 ++v10; | |
8171 v11 += 56; | |
8172 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8173 goto LABEL_7; | |
8174 } | |
8175 v12 = v10; | |
8176 } | |
8177 a1a.uObjectDescID = v12; | |
8178 a1a.vPosition.z = z; | |
8179 a1a.vPosition.x = v21; | |
8180 a1a.vPosition.y = y; | |
8181 a1a.uSoundID = 0; | |
8182 a1a.uAttributes = attributes; | |
8183 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8184 a1a.uSpriteFrameID = 0; | |
303 | 8185 a1a.field_58_pid = 0; |
0 | 8186 a1a.field_5C = 0; |
8187 if ( !(a1a.uAttributes & 0x10) ) | |
8188 { | |
8189 v13 = 0; | |
222 | 8190 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
0 | 8191 { |
8192 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8193 while ( *(short *)v14 != v9 ) | |
8194 { | |
8195 ++v13; | |
8196 v14 += 48; | |
222 | 8197 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount ) |
0 | 8198 goto LABEL_16; |
8199 } | |
8200 a1a.stru_24.uItemID = v13; | |
8201 } | |
8202 } | |
8203 LABEL_16: | |
8204 if ( a7 ) | |
8205 { | |
8206 v15 = count; | |
8207 if ( count > 0 ) | |
8208 { | |
8209 do | |
8210 { | |
8211 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8212 v16 = rand(); | |
8213 a1a.Create( | |
8214 (signed __int16)a1a.uFacing, | |
8215 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8216 a4, | |
8217 0); | |
8218 --v15; | |
8219 } | |
8220 while ( v15 ); | |
8221 } | |
8222 } | |
8223 else | |
8224 { | |
8225 v17 = count; | |
8226 v18 = stru_5C6E00->uIntegerHalfPi; | |
8227 a1a.uFacing = 0; | |
8228 if ( count > 0 ) | |
8229 { | |
8230 do | |
8231 { | |
8232 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8233 --v17; | |
8234 } | |
8235 while ( v17 ); | |
8236 } | |
8237 } | |
8238 return 1; | |
8239 } | |
8240 | |
8241 //----- (0042F960) -------------------------------------------------------- | |
8242 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8243 { | |
8244 int v3; // ebx@1 | |
8245 int v4; // edi@1 | |
8246 signed int v5; // edx@1 | |
8247 char *v6; // ecx@2 | |
8248 unsigned __int16 v7; // ax@5 | |
8249 signed int v8; // eax@6 | |
8250 signed int v9; // eax@7 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8251 //SpriteObject a1; // [sp+Ch] [bp-70h]@1 |
0 | 8252 |
8253 v3 = x; | |
8254 v4 = y; | |
8255 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8256 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
|
8257 //SpriteObject::SpriteObject(&a1); |
0 | 8258 a1.stru_24.Reset(); |
8259 | |
8260 v5 = 0; | |
8261 a1.field_50 = 0; | |
8262 a1.field_4C = 0; | |
8263 a1.field_48 = 0; | |
8264 a1.field_54 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8265 a1.uType = 800; |
0 | 8266 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
8267 { | |
8268 LABEL_5: | |
8269 v7 = 0; | |
8270 } | |
8271 else | |
8272 { | |
8273 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8274 while ( *(short *)v6 != 800 ) | |
8275 { | |
8276 ++v5; | |
8277 v6 += 56; | |
8278 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8279 goto LABEL_5; | |
8280 } | |
8281 v7 = v5; | |
8282 } | |
8283 a1.uObjectDescID = v7; | |
8284 a1.vPosition.x = v3; | |
8285 a1.vPosition.y = v4; | |
8286 a1.vPosition.z = z; | |
8287 a1.uSoundID = 0; | |
8288 a1.uAttributes = 0; | |
8289 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8290 a1.uSpriteFrameID = 0; | |
303 | 8291 a1.field_58_pid = 0; |
0 | 8292 a1.field_5C = 0; |
8293 v8 = a1.Create(0, 0, 0, 0); | |
8294 if ( v8 != -1 ) | |
8295 { | |
8296 v9 = 8 * v8; | |
8297 LOBYTE(v9) = v9 | 2; | |
8298 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8299 } | |
8300 } | |
8301 | |
8302 //----- (0042FA22) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8303 SpriteObject *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8304 { |
8305 size_t v0; // edx@1 | |
8306 int v1; // ebp@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8307 SpriteObject *result; // eax@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8308 SpriteObject *v3; // ebx@1 |
0 | 8309 |
8310 v0 = 0; | |
8311 v1 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8312 //result = (char *)&pSpriteObjects[0].uObjectDescID; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8313 result = pSpriteObjects; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8314 v3 = pSpriteObjects; |
0 | 8315 do |
8316 { | |
79 | 8317 if ( result->uObjectDescID ) |
0 | 8318 { |
8319 if ( v1 != v0 ) | |
8320 { | |
79 | 8321 memcpy(v3, result, 0x70u); |
8322 result->uObjectDescID = 0; | |
0 | 8323 } |
8324 ++v0; | |
79 | 8325 ++v3;// = (char *)v3 + 112; |
0 | 8326 } |
79 | 8327 ++result;// += 112; |
0 | 8328 ++v1; |
8329 } | |
79 | 8330 //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
|
8331 while( result <= &pSpriteObjects[999] ); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8332 uNumSpriteObjects = v0; |
0 | 8333 return result; |
8334 } | |
8335 | |
8336 //----- (0042FA66) -------------------------------------------------------- | |
8337 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8338 { | |
8339 int v6; // edi@1 | |
8340 int v7; // esi@1 | |
8341 char *v8; // ecx@2 | |
8342 unsigned __int16 v9; // ax@5 | |
8343 int v10; // eax@10 | |
8344 signed int result; // eax@11 | |
8345 __int16 v12; // ax@12 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8346 //SpriteObject a1a; // [sp+Ch] [bp-74h]@1 |
0 | 8347 int v14; // [sp+7Ch] [bp-4h]@1 |
8348 | |
8349 v6 = a1; | |
8350 v7 = a2; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8351 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
|
8352 //SpriteObject::SpriteObject(&a1a); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8353 a1a.uType = 600; |
0 | 8354 a1a.stru_24.Reset(); |
8355 | |
8356 a1a.field_48 = 6; | |
8357 a1a.field_4C = 8; | |
8358 a1a.field_50 = 3; | |
8359 v14 = 0; | |
8360 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8361 { | |
8362 LABEL_5: | |
8363 v9 = 0; | |
8364 } | |
8365 else | |
8366 { | |
8367 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8368 while ( (short)a1a.uType != *(short *)v8 ) |
0 | 8369 { |
8370 ++v14; | |
8371 v8 += 56; | |
8372 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8373 goto LABEL_5; | |
8374 } | |
8375 v9 = v14; | |
8376 } | |
8377 a1a.uObjectDescID = v9; | |
8378 a1a.vPosition.x = v6; | |
8379 a1a.vPosition.y = v7; | |
8380 a1a.vPosition.z = a3; | |
8381 a1a.uAttributes = 0; | |
8382 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8383 a1a.uSpriteFrameID = 0; | |
8384 a1a.field_5C = 0; | |
8385 a1a.field_60_distance_related_prolly_lod = 0; | |
8386 a1a.uFacing = 0; | |
8387 a1a.uSoundID = 0; | |
8388 if ( a6 >= 1 || a6 <= 4 ) | |
8389 { | |
8390 v10 = 8 * a6 - 8; | |
303 | 8391 LOBYTE(v10) = v10 | OBJECT_Player; |
8392 a1a.field_58_pid = v10; | |
0 | 8393 } |
8394 else | |
8395 { | |
303 | 8396 a1a.field_58_pid = 0; |
0 | 8397 } |
8398 result = a1a.Create(0, 0, 0, 0); | |
8399 if ( result != -1 ) | |
8400 { | |
8401 v12 = 8 * result; | |
8402 LOBYTE(v12) = v12 | 2; | |
8403 result = stru_50FE08.Add( | |
8404 v12, | |
8405 a5, | |
8406 SLOWORD(a1a.vPosition.x), | |
8407 SLOWORD(a1a.vPosition.y), | |
8408 SLOWORD(a1a.vPosition.z), | |
8409 0, | |
8410 0); | |
8411 } | |
8412 return result; | |
8413 } | |
8414 | |
8415 | |
8416 | |
8417 //----- (0042FB5C) -------------------------------------------------------- | |
8418 bool __fastcall sub_42FB5C(signed int a1) | |
8419 { | |
8420 int v1; // ecx@3 | |
8421 int v2; // ecx@4 | |
8422 int v3; // ecx@5 | |
8423 int v4; // ecx@6 | |
8424 int v5; // ecx@7 | |
8425 int v6; // ecx@8 | |
8426 char v7; // zf@9 | |
8427 | |
8428 if ( a1 > 39 ) | |
8429 { | |
8430 if ( a1 > 77 ) | |
8431 { | |
8432 if ( a1 == 80 ) | |
8433 return 0; | |
8434 if ( a1 > 84 ) | |
8435 { | |
8436 if ( a1 <= 86 ) | |
8437 return 0; | |
8438 v7 = a1 == 95; | |
8439 goto LABEL_20; | |
8440 } | |
8441 } | |
8442 else | |
8443 { | |
8444 if ( a1 == 77 ) | |
8445 return 0; | |
8446 if ( a1 >= 46 ) | |
8447 { | |
8448 if ( a1 <= 47 || a1 == 51 ) | |
8449 return 0; | |
8450 v7 = a1 == 73; | |
8451 goto LABEL_20; | |
8452 } | |
8453 } | |
8454 return 1; | |
8455 } | |
8456 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8457 return 1; | |
8458 v2 = v1 - 3; | |
8459 if ( !v2 ) | |
8460 return 0; | |
8461 v3 = v2 - 1; | |
8462 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8463 return 1; | |
8464 v5 = v4 - 8; | |
8465 if ( !v5 ) | |
8466 return 0; | |
8467 v6 = v5 - 1; | |
8468 if ( !v6 ) | |
8469 return 1; | |
8470 v7 = v6 == 20; | |
8471 LABEL_20: | |
8472 if ( !v7 ) | |
8473 return 1; | |
8474 return 0; | |
8475 } | |
8476 | |
8477 //----- (0042FBDD) -------------------------------------------------------- | |
8478 void __cdecl sub_42FBDD() | |
8479 { | |
388 | 8480 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 8481 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
8482 pRenderer->Present(); | |
8483 } | |
8484 | |
8485 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8486 void __cdecl CloseWindowBackground() |
0 | 8487 { |
388 | 8488 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 8489 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
8490 pRenderer->Present(); | |
8491 } | |
8492 | |
8493 //----- (0042FC4E) -------------------------------------------------------- | |
8494 void __cdecl ProcessInputActions() | |
8495 { | |
8496 ActionQueue *pActionQueue; // esi@7 | |
8497 Keyboard *v3; // ecx@8 | |
8498 char v4; // al@9 | |
8499 ActionQueue *v5; // ecx@19 | |
8500 Player *v6; // ecx@86 | |
8501 Player *v7; // esi@100 | |
8502 char v8; // bl@100 | |
8503 unsigned __int16 v9; // ax@102 | |
8504 int v10; // eax@103 | |
8505 unsigned int v11; // eax@127 | |
8506 signed int v12; // esi@157 | |
8507 Keyboard *v13; // ecx@158 | |
8508 char v14; // al@159 | |
8509 unsigned int v15; // eax@168 | |
8510 void *v16; // esi@177 | |
8511 int v17; // [sp-14h] [bp-1Ch]@8 | |
8512 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8513 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
271 | 8514 //__int16 v20; // [sp-14h] [bp-1Ch]@60 |
0 | 8515 int v21; // [sp-14h] [bp-1Ch]@68 |
8516 int v22; // [sp-Ch] [bp-14h]@158 | |
8517 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8518 int v24; // [sp+4h] [bp-4h]@87 | |
8519 | |
8520 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8521 auto pKeyboard = pGame->pKeyboardInstance; | |
8522 if (!bAlwaysRun) | |
8523 { | |
8524 if (pKeyboard->IsShiftHeld()) | |
8525 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8526 else | |
8527 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8528 } | |
8529 else | |
8530 { | |
8531 if (pKeyboard->IsShiftHeld()) | |
8532 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8533 else | |
8534 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8535 } | |
8536 | |
140 | 8537 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
486 | 8538 //LABEL_6: |
0 | 8539 if ( !pEventTimer->bPaused ) |
8540 { | |
8541 inputAction = (InputAction)0; | |
8542 pActionQueue = pPartyActionQueue; | |
8543 while ( 1 ) | |
8544 { | |
8545 v3 = pGame->pKeyboardInstance; | |
8546 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8547 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8548 v4 = v3->WasKeyPressed(v17); | |
8549 else | |
8550 v4 = v3->IsKeyBeingHeld(v17); | |
8551 if ( v4 ) | |
8552 { | |
8553 switch ( inputAction ) | |
8554 { | |
8555 case INPUT_MoveForward: | |
271 | 8556 if (pCurrentScreen != SCREEN_GAME) |
0 | 8557 break; |
8558 if (!pParty->bTurnBasedModeOn) | |
163 | 8559 //goto _do_move_forward; |
0 | 8560 { |
8561 v5 = pActionQueue; | |
140 | 8562 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8563 partyAction = PARTY_RunForward; |
8564 else | |
8565 partyAction = PARTY_WalkForward; | |
163 | 8566 //goto _add_action_and_continue; |
8567 v5->Add(partyAction); | |
8568 break; | |
8569 } | |
8570 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8571 { | |
8572 pTurnEngine->uActionPointsLeft -= 26; | |
8573 //_do_move_forward: | |
8574 v5 = pActionQueue; | |
8575 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8576 partyAction = PARTY_RunForward; | |
8577 else | |
8578 partyAction = PARTY_WalkForward; | |
8579 //goto _add_action_and_continue; | |
8580 v5->Add(partyAction); | |
8581 break; | |
0 | 8582 } |
8583 break; | |
8584 case INPUT_MoveBackwards: | |
17 | 8585 //__debugbreak(); |
271 | 8586 if (pCurrentScreen != SCREEN_GAME) |
0 | 8587 break; |
8588 if (!pParty->bTurnBasedModeOn) | |
17 | 8589 //goto _do_move_backwards; |
8590 { | |
8591 v5 = pActionQueue; | |
8592 if ( pParty->uFlags2 & 2 ) | |
8593 partyAction = PARTY_RunBackward; | |
8594 else | |
8595 partyAction = PARTY_WalkBackward; | |
163 | 8596 //goto _add_action_and_continue; |
8597 v5->Add(partyAction); | |
8598 break; | |
17 | 8599 } |
0 | 8600 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8601 { | |
8602 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8603 //_do_move_backwards: |
0 | 8604 v5 = pActionQueue; |
8605 if ( pParty->uFlags2 & 2 ) | |
8606 partyAction = PARTY_RunBackward; | |
8607 else | |
8608 partyAction = PARTY_WalkBackward; | |
163 | 8609 //goto _add_action_and_continue; |
8610 v5->Add(partyAction); | |
8611 break; | |
0 | 8612 } |
8613 break; | |
8614 case INPUT_StrafeLeft: | |
17 | 8615 //__debugbreak(); |
271 | 8616 if (pCurrentScreen != SCREEN_GAME) |
0 | 8617 break; |
8618 if (!pParty->bTurnBasedModeOn) | |
17 | 8619 //goto _do_strafe_left; |
8620 { | |
8621 partyAction = PARTY_StrafeLeft; | |
163 | 8622 //goto _add_action_and_continue_; |
8623 v5 = pActionQueue; | |
8624 v5->Add(partyAction); | |
8625 break; | |
17 | 8626 } |
0 | 8627 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8628 break; | |
8629 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8630 //_do_strafe_left: |
0 | 8631 partyAction = PARTY_StrafeLeft; |
163 | 8632 //goto _add_action_and_continue_; |
8633 v5 = pActionQueue; | |
8634 v5->Add(partyAction); | |
8635 break; | |
0 | 8636 case INPUT_StrafeRight: |
17 | 8637 //__debugbreak(); |
271 | 8638 if (pCurrentScreen != SCREEN_GAME) |
0 | 8639 break; |
8640 if (!pParty->bTurnBasedModeOn) | |
17 | 8641 //goto _do_strafe_right; |
8642 { | |
8643 partyAction = PARTY_StrafeRight; | |
163 | 8644 //goto _add_action_and_continue_; |
8645 v5 = pActionQueue; | |
8646 v5->Add(partyAction); | |
8647 break; | |
17 | 8648 } |
0 | 8649 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8650 break; | |
8651 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8652 //_do_strafe_right: |
0 | 8653 partyAction = PARTY_StrafeRight; |
163 | 8654 //goto _add_action_and_continue_; |
8655 v5 = pActionQueue; | |
8656 v5->Add(partyAction); | |
8657 break; | |
0 | 8658 case INPUT_TurnLeft: |
271 | 8659 if (pCurrentScreen != SCREEN_GAME) |
0 | 8660 break; |
8661 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
8662 { | |
8663 if (pParty->bTurnBasedModeOn) | |
8664 { | |
8665 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8666 break; | |
8667 pTurnEngine->uActionPointsLeft -= 26; | |
8668 } | |
8669 partyAction_ = PARTY_StrafeLeft; | |
8670 } | |
8671 else | |
8672 { | |
8673 if ( pParty->uFlags2 & 2 ) | |
8674 partyAction_ = PARTY_FastTurnLeft; | |
8675 else | |
8676 partyAction_ = PARTY_TurnLeft; | |
8677 } | |
8678 pActionQueue->Add(partyAction_); | |
8679 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8680 { | |
271 | 8681 pWeather->OnPlayerTurn(10); |
0 | 8682 } |
8683 break; | |
8684 case INPUT_TurnRight: | |
271 | 8685 if (pCurrentScreen != SCREEN_GAME) |
0 | 8686 break; |
8687 if ( GetAsyncKeyState(17) ) // strafing | |
8688 { | |
8689 if (pParty->bTurnBasedModeOn) | |
8690 { | |
8691 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8692 break; | |
8693 pTurnEngine->uActionPointsLeft -= 26; | |
8694 } | |
271 | 8695 v21 = PARTY_StrafeRight; |
0 | 8696 } |
8697 else | |
8698 { | |
8699 if ( pParty->uFlags2 & 2 ) | |
271 | 8700 v21 = PARTY_FastTurnRight; |
0 | 8701 else |
271 | 8702 v21 = PARTY_TurnRight; |
0 | 8703 } |
8704 pActionQueue->Add((PartyAction)v21); | |
8705 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8706 { | |
271 | 8707 pWeather->OnPlayerTurn(-10); |
0 | 8708 } |
8709 break; | |
8710 case INPUT_Jump: | |
17 | 8711 //__debugbreak(); |
271 | 8712 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 8713 break; |
8714 partyAction = (PartyAction)12; | |
163 | 8715 //goto _add_action_and_continue_; |
8716 v5 = pActionQueue; | |
8717 v5->Add(partyAction); | |
8718 break; | |
0 | 8719 case INPUT_Yell: |
187 | 8720 if (!pCurrentScreen && uActiveCharacter) |
0 | 8721 { |
8722 pParty->Yell(); | |
187 | 8723 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 8724 } |
187 | 8725 break; |
0 | 8726 case INPUT_Pass: |
17 | 8727 //__debugbreak(); |
0 | 8728 if ( pCurrentScreen ) |
8729 break; | |
8730 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 8731 //goto LABEL_118; |
8732 { | |
8733 pTurnEngine->field_18 |= 8u; | |
8734 break; | |
8735 } | |
0 | 8736 if ( uActiveCharacter ) |
8737 { | |
8738 v6 = pPlayers[uActiveCharacter]; | |
8739 if ( !v6->uTimeToRecovery ) | |
8740 { | |
8741 v24 = v6->GetAttackRecoveryTime(0); | |
8742 if ( !pParty->bTurnBasedModeOn ) | |
8743 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
8744 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
8745 pStru277->_427D48(uActiveCharacter); | |
8746 pTurnEngine->_40471C(); | |
8747 } | |
8748 } | |
8749 break; | |
8750 case INPUT_Combat: | |
17 | 8751 //__debugbreak(); |
271 | 8752 if (pCurrentScreen == SCREEN_GAME) |
0 | 8753 { |
8754 if (pParty->bTurnBasedModeOn) | |
8755 { | |
141 | 8756 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 8757 { |
8758 pParty->bTurnBasedModeOn = 0; | |
8759 pTurnEngine->End(true); | |
8760 } | |
8761 } | |
8762 else | |
8763 { | |
8764 pTurnEngine->Start(); | |
8765 pParty->bTurnBasedModeOn = true; | |
8766 } | |
8767 } | |
8768 break; | |
8769 case INPUT_CastReady: | |
17 | 8770 //__debugbreak(); |
271 | 8771 if (pCurrentScreen != SCREEN_GAME) |
0 | 8772 break; |
8773 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 8774 //goto LABEL_118; |
8775 { | |
8776 pTurnEngine->field_18 |= 8u; | |
8777 break; | |
8778 } | |
0 | 8779 if ( !uActiveCharacter ) |
8780 break; | |
8781 v7 = pPlayers[uActiveCharacter]; | |
8782 v8 = v7->uQuickSpell; | |
8783 if ( !v8 | |
8784 || bUnderwater | |
8785 || ((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)), | |
8786 v10 > v7->sMana) ) | |
8787 { | |
8788 pActionQueue = pPartyActionQueue; | |
8789 LABEL_120: | |
437 | 8790 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); |
8791 break; | |
8792 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 8793 { |
271 | 8794 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; |
163 | 8795 //goto _send_message; |
8796 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8797 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8798 ++pMessageQueue_50CBD0->uNumMessages; | |
8799 break; | |
437 | 8800 }*/ |
0 | 8801 } |
8802 else | |
8803 { | |
8804 pActionQueue = pPartyActionQueue; | |
8805 if ( dword_50C9E8 < 40 ) | |
8806 { | |
8807 dword_50C9EC[3 * dword_50C9E8] = 25; | |
437 | 8808 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8809 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 8810 ++dword_50C9E8; |
8811 } | |
8812 } | |
8813 break; | |
8814 case INPUT_Attack: | |
17 | 8815 //__debugbreak(); |
271 | 8816 if (pCurrentScreen != SCREEN_GAME) |
0 | 8817 break; |
8818 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
8819 goto LABEL_120; | |
17 | 8820 //LABEL_118: |
0 | 8821 pTurnEngine->field_18 |= 8u; |
8822 break; | |
8823 case INPUT_EventTrigger: | |
271 | 8824 if (pCurrentScreen == SCREEN_GAME) |
0 | 8825 { |
437 | 8826 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 8827 break; |
271 | 8828 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action; |
163 | 8829 //goto _send_message; |
8830 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8831 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8832 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 8833 break;*/ |
8834 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
163 | 8835 break; |
0 | 8836 } |
151 | 8837 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 8838 { |
8839 v11 = pMessageQueue_50CBD0->uNumMessages; | |
8840 if ( pMessageQueue_50CBD0->uNumMessages ) | |
8841 { | |
437 | 8842 v11 = 0; |
8843 pMessageQueue_50CBD0->uNumMessages = 0; | |
0 | 8844 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
8845 { | |
8846 v11 = 1; | |
8847 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 8848 //LABEL_132: |
271 | 8849 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 8850 //_send_message: |
0 | 8851 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
8852 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8853 ++pMessageQueue_50CBD0->uNumMessages; | |
8854 break; | |
8855 } | |
437 | 8856 break; |
0 | 8857 } |
437 | 8858 /*if ( (signed int)v11 < 40 ) |
163 | 8859 //goto LABEL_132; |
8860 { | |
271 | 8861 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 8862 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
8863 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8864 ++pMessageQueue_50CBD0->uNumMessages; | |
8865 break; | |
437 | 8866 }*/ |
8867 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 8868 } |
8869 break; | |
8870 case INPUT_CharCycle: | |
17 | 8871 //__debugbreak(); |
151 | 8872 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 8873 || dword_50C9E8 >= 40 ) |
8874 break; | |
8875 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 8876 //goto LABEL_155; |
437 | 8877 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8878 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 8879 ++dword_50C9E8; |
8880 break; | |
0 | 8881 case INPUT_LookUp: |
17 | 8882 //__debugbreak(); |
0 | 8883 if ( pEventTimer->bPaused ) |
8884 break; | |
8885 partyAction = (PartyAction)7; | |
163 | 8886 //goto _add_action_and_continue_; |
8887 v5 = pActionQueue; | |
8888 v5->Add(partyAction); | |
8889 break; | |
0 | 8890 case INPUT_CenterView: |
17 | 8891 //__debugbreak(); |
0 | 8892 if ( pEventTimer->bPaused ) |
8893 break; | |
8894 partyAction = (PartyAction)9; | |
163 | 8895 //goto _add_action_and_continue_; |
8896 v5 = pActionQueue; | |
8897 v5->Add(partyAction); | |
8898 break; | |
0 | 8899 case INPUT_LookDown: |
17 | 8900 //__debugbreak(); |
0 | 8901 if ( pEventTimer->bPaused ) |
8902 break; | |
8903 partyAction = (PartyAction)8; | |
163 | 8904 //goto _add_action_and_continue_; |
8905 v5 = pActionQueue; | |
8906 v5->Add(partyAction); | |
8907 break; | |
0 | 8908 case INPUT_FlyUp: |
17 | 8909 //__debugbreak(); |
0 | 8910 if ( pCurrentScreen |
8911 || pEventTimer->bPaused ) | |
8912 break; | |
8913 partyAction = (PartyAction)13; | |
163 | 8914 //goto _add_action_and_continue_; |
8915 v5 = pActionQueue; | |
8916 v5->Add(partyAction); | |
8917 break; | |
0 | 8918 case INPUT_Land: |
17 | 8919 //__debugbreak(); |
0 | 8920 if ( pCurrentScreen |
8921 || pEventTimer->bPaused ) | |
8922 break; | |
8923 partyAction = (PartyAction)15; | |
163 | 8924 //goto _add_action_and_continue_; |
8925 v5 = pActionQueue; | |
8926 v5->Add(partyAction); | |
8927 break; | |
0 | 8928 case INPUT_FlyDown: |
17 | 8929 //__debugbreak(); |
0 | 8930 if ( !pCurrentScreen |
8931 && !pEventTimer->bPaused ) | |
8932 { | |
8933 partyAction = (PartyAction)14; | |
163 | 8934 //_add_action_and_continue_: |
0 | 8935 v5 = pActionQueue; |
163 | 8936 //_add_action_and_continue: |
0 | 8937 v5->Add(partyAction); |
8938 } | |
8939 break; | |
8940 case INPUT_ZoomIn: | |
17 | 8941 //__debugbreak(); |
0 | 8942 if ( dword_50C9E8 >= 40 ) |
8943 break; | |
8944 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 8945 //goto LABEL_155; |
437 | 8946 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8947 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 8948 ++dword_50C9E8; |
8949 break; | |
0 | 8950 case INPUT_ZoomOut: |
17 | 8951 //__debugbreak(); |
0 | 8952 if ( dword_50C9E8 < 40 ) |
8953 { | |
8954 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 8955 //LABEL_155: |
437 | 8956 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8957 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 8958 ++dword_50C9E8; |
8959 } | |
8960 break; | |
8961 case INPUT_AlwaysRun: | |
8962 bAlwaysRun = bAlwaysRun == 0; | |
8963 break; | |
17 | 8964 default: |
8965 //__debugbreak(); | |
8966 break; | |
0 | 8967 } |
8968 } | |
8969 inputAction = (InputAction)((int)inputAction + 1); | |
8970 if ( (signed int)inputAction >= 30 ) | |
8971 goto LABEL_176; | |
8972 } | |
8973 } | |
8974 v12 = 0; | |
8975 do | |
8976 { | |
8977 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
8978 v13 = pGame->pKeyboardInstance; | |
8979 if ( pKeyActionMap->pToggleTypes[v12] ) | |
8980 v14 = v13->WasKeyPressed(v22); | |
8981 else | |
8982 v14 = v13->IsKeyBeingHeld(v22); | |
8983 if ( v14 && v12 == 9 ) | |
8984 { | |
8985 if ( !pCurrentScreen ) | |
8986 { | |
437 | 8987 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 8988 goto LABEL_175; |
8989 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 8990 //goto LABEL_174; |
8991 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8992 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 8993 ++pMessageQueue_50CBD0->uNumMessages;*/ |
8994 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
17 | 8995 goto LABEL_175; |
0 | 8996 } |
151 | 8997 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
8998 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 8999 { |
9000 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9001 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9002 { | |
9003 v15 = 0; | |
9004 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9005 { | |
9006 v15 = 1; | |
437 | 9007 pMessageQueue_50CBD0->uNumMessages = 0; |
17 | 9008 //goto LABEL_173; |
437 | 9009 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape; |
17 | 9010 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9011 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9012 ++pMessageQueue_50CBD0->uNumMessages; | |
9013 goto LABEL_175; | |
0 | 9014 } |
9015 pMessageQueue_50CBD0->uNumMessages = 0; | |
9016 } | |
437 | 9017 /*if ( (signed int)v15 >= 40 ) |
0 | 9018 goto LABEL_175; |
17 | 9019 //LABEL_173: |
0 | 9020 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9021 //LABEL_174: |
0 | 9022 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9023 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9024 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9025 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 9026 goto LABEL_175; |
9027 } | |
9028 } | |
9029 LABEL_175: | |
9030 ++v12; | |
9031 } | |
9032 while ( v12 < 30 ); | |
9033 LABEL_176: | |
9034 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9035 { | |
9036 AsyncKeyboard::LeaveCriticalSection(); | |
9037 v16 = pAsyncKeyboard; | |
9038 AsyncKeyboard::EnterCriticalSection(); | |
9039 memset((char *)v16 + 521, 0, 0x100u); | |
9040 AsyncKeyboard::LeaveCriticalSection(); | |
9041 } | |
9042 } | |
9043 |