Mercurial > mm7
annotate mm7_6.cpp @ 751:6005142abce0
monster init refactored
author | Gloval |
---|---|
date | Sat, 23 Mar 2013 00:20:16 +0400 |
parents | 6daaa2f18d0d |
children | d170f23f70d1 b27dd658ea77 |
rev | line source |
---|---|
0 | 1 #include "MM7.h" |
2 | |
3 #include "MapInfo.h" | |
4 #include "Game.h" | |
5 #include "GUIWindow.h" | |
6 #include "GUIFont.h" | |
7 #include "GUIButton.h" | |
8 #include "GUIProgressBar.h" | |
9 #include "Party.h" | |
10 #include "AudioPlayer.h" | |
11 #include "Outdoor.h" | |
12 #include "IndoorCamera.h" | |
13 #include "Overlays.h" | |
14 #include "Monsters.h" | |
15 #include "Arcomage.h" | |
16 #include "LOD.h" | |
17 #include "Actor.h" | |
18 #include "Allocator.h" | |
19 #include "Events.h" | |
20 #include "Viewport.h" | |
21 #include "FrameTableInc.h" | |
22 #include "Math.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
23 #include "SpriteObject.h" |
0 | 24 #include "ObjectList.h" |
25 #include "Chest.h" | |
26 #include "PaletteManager.h" | |
27 #include "DecorationList.h" | |
28 #include "SaveLoad.h" | |
29 #include "stru123.h" | |
30 #include "Time.h" | |
31 #include "IconFrameTable.h" | |
32 #include "Awards.h" | |
33 #include "Autonotes.h" | |
34 #include "stru160.h" | |
35 #include "stru279.h" | |
36 #include "TurnEngine.h" | |
37 #include "stru277.h" | |
38 #include "Weather.h" | |
39 #include "stru272.h" | |
40 #include "stru298.h" | |
189 | 41 #include "texts.h" |
0 | 42 #include "StorylineTextTable.h" |
43 #include "Events2D.h" | |
370 | 44 #include "Log.h" |
0 | 45 |
46 #include "mm7_data.h" | |
47 | |
48 | |
49 | |
50 //----- (00424EE0) -------------------------------------------------------- | |
51 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID) | |
52 { | |
53 unsigned int v1; // edx@1 | |
54 double v2; // st7@1 | |
55 signed int v3; // edi@1 | |
56 char *v4; // esi@4 | |
57 char *v5; // ecx@4 | |
58 unsigned int v6; // eax@4 | |
59 char *v7; // edx@4 | |
60 double v8; // st6@10 | |
61 double v9; // st5@10 | |
62 double v10; // st6@11 | |
63 unsigned __int8 v11; // c2@15 | |
64 unsigned __int8 v12; // c3@15 | |
65 void *v13; // edi@22 | |
66 char *v14; // eax@22 | |
67 double v15; // st6@22 | |
68 char *v16; // ecx@22 | |
69 signed int result; // eax@24 | |
70 unsigned int v18; // [sp+8h] [bp-2Ch]@4 | |
71 bool v19; // [sp+Ch] [bp-28h]@6 | |
72 char *v20; // [sp+10h] [bp-24h]@4 | |
73 char *v21; // [sp+14h] [bp-20h]@4 | |
74 signed int v22; // [sp+18h] [bp-1Ch]@1 | |
75 char *v23; // [sp+1Ch] [bp-18h]@4 | |
76 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4 | |
77 char *v25; // [sp+24h] [bp-10h]@4 | |
78 char *v26; // [sp+28h] [bp-Ch]@4 | |
79 char *v27; // [sp+2Ch] [bp-8h]@4 | |
80 char *v28; // [sp+30h] [bp-4h]@4 | |
81 | |
82 v1 = uVertexID; | |
83 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
84 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
85 v3 = 0; | |
86 v22 = 0; | |
87 if ( array_50AC10[0].vWorldViewPosition.x <= v2 ) | |
88 v3 = 1; | |
89 if ( (signed int)(uVertexID + 1) <= 1 ) | |
90 return 0; | |
91 v4 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
92 v5 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
93 v6 = v1; | |
94 v23 = (char *)&array_507D30[0].flt_2C; | |
168 | 95 v26 = (char *)&array_507D30[0]._rhw; |
0 | 96 v24 = array_507D30; |
97 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
98 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
99 v25 = (char *)&array_507D30[0].vWorldViewPosition; | |
100 v27 = (char *)&array_507D30[0].v; | |
101 v28 = (char *)&array_507D30[0].u; | |
102 v7 = (char *)&array_50AC10[0].v; | |
103 v18 = v6; | |
104 do | |
105 { | |
106 v19 = v2 >= *((float *)v7 + 5); | |
107 if ( v3 != v19 ) | |
108 { | |
109 if ( v19 ) | |
110 { | |
111 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7)); | |
112 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6); | |
113 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5); | |
114 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1); | |
115 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7; | |
116 } | |
117 else | |
118 { | |
119 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5)); | |
120 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6); | |
121 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7); | |
122 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11); | |
123 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12); | |
124 } | |
125 *(float *)v27 = v9; | |
126 *(float *)v25 = v2; | |
127 *(float *)v26 = 1.0 / v2; | |
128 if ( v3 ) | |
129 { | |
130 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) ) | |
131 { | |
132 v11 = 0; | |
133 v12 = *(float *)v4 == *((float *)v7 - 5); | |
134 goto LABEL_19; | |
135 } | |
136 } | |
137 else | |
138 { | |
139 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) ) | |
140 { | |
141 v11 = 0; | |
142 v12 = *(float *)v4 == *((float *)v7 + 7); | |
143 LABEL_19: | |
144 if ( v12 | v11 ) | |
145 goto LABEL_21; | |
146 goto LABEL_20; | |
147 } | |
148 } | |
149 LABEL_20: | |
150 v26 += 48; | |
151 ++v24; | |
152 v25 += 48; | |
153 v27 += 48; | |
154 v28 += 48; | |
155 v5 += 48; | |
156 v4 += 48; | |
157 ++v22; | |
158 v23 += 48; | |
159 v21 = v5; | |
160 v20 = v4; | |
161 } | |
162 LABEL_21: | |
163 if ( v19 ) | |
164 { | |
165 v13 = v24; | |
166 v14 = v26; | |
167 v21 += 48; | |
168 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001); | |
169 v20 += 48; | |
170 ++v22; | |
171 v28 += 48; | |
172 v27 += 48; | |
173 v25 += 48; | |
174 ++v24; | |
175 v26 += 48; | |
176 memcpy(v13, v7 + 8, 0x30u); | |
177 v16 = v23; | |
178 v23 += 48; | |
179 v4 = v20; | |
180 *(float *)v14 = v15; | |
181 *(int *)v16 = *((int *)v7 + 13); | |
182 v5 = v21; | |
183 } | |
184 v3 = v19; | |
185 v7 += 48; | |
186 --v18; | |
187 } | |
188 while ( v18 ); | |
189 result = v22; | |
190 if ( v22 < 3 ) | |
191 return 0; | |
192 return result; | |
193 } | |
194 | |
195 //----- (004250FE) -------------------------------------------------------- | |
196 signed int __fastcall sr_4250FE(unsigned int uVertexID) | |
197 { | |
198 unsigned int v1; // edx@1 | |
199 char *v2; // edi@5 | |
200 char *v3; // esi@5 | |
201 char *v4; // ecx@5 | |
202 int v5; // ebx@6 | |
203 double v6; // st6@11 | |
204 double v7; // st5@11 | |
205 double v8; // st6@12 | |
206 unsigned __int8 v9; // c2@16 | |
207 unsigned __int8 v10; // c3@16 | |
208 void *v11; // edi@23 | |
209 double v12; // st6@23 | |
210 char *v13; // ecx@23 | |
211 char v14; // zf@24 | |
212 signed int result; // eax@25 | |
213 unsigned int v16; // [sp+8h] [bp-28h]@5 | |
214 bool v17; // [sp+Ch] [bp-24h]@2 | |
215 bool v18; // [sp+10h] [bp-20h]@7 | |
216 char *v19; // [sp+14h] [bp-1Ch]@5 | |
217 char *v20; // [sp+18h] [bp-18h]@5 | |
218 signed int v21; // [sp+1Ch] [bp-14h]@1 | |
219 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5 | |
220 char *v23; // [sp+24h] [bp-Ch]@5 | |
221 char *v24; // [sp+28h] [bp-8h]@5 | |
222 char *v25; // [sp+2Ch] [bp-4h]@5 | |
223 | |
224 v1 = uVertexID; | |
225 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
226 v21 = 0; | |
227 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0; | |
228 if ( (signed int)(uVertexID + 1) <= 1 ) | |
229 return 0; | |
230 v2 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
231 v3 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 232 v24 = (char *)&array_507D30[0]._rhw; |
0 | 233 v22 = array_507D30; |
234 v19 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
235 v20 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
236 v23 = (char *)&array_507D30[0].vWorldViewPosition; | |
237 v25 = (char *)&array_507D30[0].flt_2C; | |
238 v4 = (char *)&array_50AC10[0].vWorldViewPosition; | |
239 v16 = v1; | |
240 do | |
241 { | |
242 v5 = (int)(v4 + 48); | |
243 v18 = *((float *)v4 + 12) >= 8.0; | |
244 if ( v17 != v18 ) | |
245 { | |
246 if ( v18 ) | |
247 { | |
248 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4); | |
249 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1); | |
250 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2); | |
251 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8); | |
252 } | |
253 else | |
254 { | |
255 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5); | |
256 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13); | |
257 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14); | |
258 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20); | |
259 } | |
260 *(float *)v25 = v7; | |
261 *(float *)v23 = 8.0; | |
262 *(int *)v24 = 0x3E000000u; | |
263 if ( v17 ) | |
264 { | |
265 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) ) | |
266 { | |
267 v9 = 0; | |
268 v10 = *(float *)v2 == *((float *)v4 + 2); | |
269 goto LABEL_20; | |
270 } | |
271 } | |
272 else | |
273 { | |
274 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) ) | |
275 { | |
276 v9 = 0; | |
277 v10 = *(float *)v2 == *((float *)v4 + 14); | |
278 LABEL_20: | |
279 if ( v10 | v9 ) | |
280 goto LABEL_22; | |
281 goto LABEL_21; | |
282 } | |
283 } | |
284 LABEL_21: | |
285 ++v22; | |
286 v23 += 48; | |
287 v25 += 48; | |
288 v3 += 48; | |
289 v2 += 48; | |
290 ++v21; | |
291 v24 += 48; | |
292 v20 = v3; | |
293 v19 = v2; | |
294 } | |
295 LABEL_22: | |
296 if ( v18 ) | |
297 { | |
298 v11 = v22; | |
299 v20 += 48; | |
300 v19 += 48; | |
301 v12 = 1.0 / (*(float *)v5 + 0.0000001); | |
302 ++v21; | |
303 v25 += 48; | |
304 v23 += 48; | |
305 ++v22; | |
306 memcpy(v11, v4 + 36, 0x30u); | |
307 v13 = v24; | |
308 v24 += 48; | |
309 v3 = v20; | |
310 v2 = v19; | |
311 *(float *)v13 = v12; | |
312 } | |
313 v14 = v16-- == 1; | |
314 v17 = v18; | |
315 v4 = (char *)v5; | |
316 } | |
317 while ( !v14 ); | |
318 result = v21; | |
319 if ( v21 < 3 ) | |
320 return 0; | |
321 return result; | |
322 } | |
323 | |
324 //----- (004252E8) -------------------------------------------------------- | |
325 signed int __fastcall sr_4252E8(unsigned int uVertexID) | |
326 { | |
327 unsigned int v1; // edx@1 | |
328 double v2; // st7@1 | |
329 char *v3; // edi@5 | |
330 char *v4; // esi@5 | |
331 char *v5; // ecx@5 | |
332 int v6; // ebx@6 | |
333 double v7; // st6@11 | |
334 double v8; // st5@11 | |
335 double v9; // st6@12 | |
336 unsigned __int8 v10; // c2@16 | |
337 unsigned __int8 v11; // c3@16 | |
338 void *v12; // edi@23 | |
339 double v13; // st6@23 | |
340 char *v14; // ecx@23 | |
341 char v15; // zf@24 | |
342 signed int result; // eax@25 | |
343 unsigned int v17; // [sp+8h] [bp-28h]@5 | |
344 bool v18; // [sp+Ch] [bp-24h]@2 | |
345 bool v19; // [sp+10h] [bp-20h]@7 | |
346 char *v20; // [sp+14h] [bp-1Ch]@5 | |
347 char *v21; // [sp+18h] [bp-18h]@5 | |
348 signed int v22; // [sp+1Ch] [bp-14h]@1 | |
349 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5 | |
350 char *v24; // [sp+24h] [bp-Ch]@5 | |
351 char *v25; // [sp+28h] [bp-8h]@5 | |
352 char *v26; // [sp+2Ch] [bp-4h]@5 | |
353 | |
354 v1 = uVertexID; | |
355 v2 = (double)pOutdoorCamera->shading_dist_mist; | |
356 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
357 v22 = 0; | |
358 v18 = array_50AC10[0].vWorldViewPosition.x <= v2; | |
359 if ( (signed int)(uVertexID + 1) <= 1 ) | |
360 return 0; | |
361 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
362 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
168 | 363 v25 = (char *)&array_507D30[0]._rhw; |
0 | 364 v23 = array_507D30; |
365 v20 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
366 v21 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
367 v24 = (char *)&array_507D30[0].vWorldViewPosition; | |
368 v26 = (char *)&array_507D30[0].flt_2C; | |
369 v5 = (char *)&array_50AC10[0].vWorldViewPosition; | |
370 v17 = v1; | |
371 do | |
372 { | |
373 v6 = (int)(v5 + 48); | |
374 v19 = v2 >= *((float *)v5 + 12); | |
375 if ( v18 != v19 ) | |
376 { | |
377 if ( v19 ) | |
378 { | |
379 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5); | |
380 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1); | |
381 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2); | |
382 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8); | |
383 } | |
384 else | |
385 { | |
386 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6); | |
387 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13); | |
388 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14); | |
389 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20); | |
390 } | |
391 *(float *)v26 = v8; | |
392 *(float *)v24 = v2; | |
393 *(float *)v25 = 1.0 / v2; | |
394 if ( v18 ) | |
395 { | |
396 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) ) | |
397 { | |
398 v10 = 0; | |
399 v11 = *(float *)v3 == *((float *)v5 + 2); | |
400 goto LABEL_20; | |
401 } | |
402 } | |
403 else | |
404 { | |
405 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) ) | |
406 { | |
407 v10 = 0; | |
408 v11 = *(float *)v3 == *((float *)v5 + 14); | |
409 LABEL_20: | |
410 if ( v11 | v10 ) | |
411 goto LABEL_22; | |
412 goto LABEL_21; | |
413 } | |
414 } | |
415 LABEL_21: | |
416 ++v23; | |
417 v24 += 48; | |
418 v26 += 48; | |
419 v4 += 48; | |
420 v3 += 48; | |
421 ++v22; | |
422 v25 += 48; | |
423 v21 = v4; | |
424 v20 = v3; | |
425 } | |
426 LABEL_22: | |
427 if ( v19 ) | |
428 { | |
429 v12 = v23; | |
430 v21 += 48; | |
431 v20 += 48; | |
432 v13 = 1.0 / (*(float *)v6 + 0.0000001); | |
433 ++v22; | |
434 v26 += 48; | |
435 v24 += 48; | |
436 ++v23; | |
437 memcpy(v12, v5 + 36, 0x30u); | |
438 v14 = v25; | |
439 v25 += 48; | |
440 v4 = v21; | |
441 v3 = v20; | |
442 *(float *)v14 = v13; | |
443 } | |
444 v15 = v17-- == 1; | |
445 v18 = v19; | |
446 v5 = (char *)v6; | |
447 } | |
448 while ( !v15 ); | |
449 result = v22; | |
450 if ( v22 < 3 ) | |
451 return 0; | |
452 return result; | |
453 } | |
454 | |
455 | |
456 | |
457 //----- (004361EF) -------------------------------------------------------- | |
458 IndoorCameraD3D::IndoorCameraD3D() | |
459 { | |
460 IndoorCameraD3D *v1; // esi@1 | |
735 | 461 //double v2; // st7@1 |
462 //double v3; // st6@1 | |
463 //double v4; // st5@1 | |
464 //double v5; // st7@1 | |
465 //double v6; // st6@1 | |
466 //double v7; // st5@1 | |
0 | 467 |
468 v1 = this; | |
469 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4); | |
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14); | |
471 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24); | |
472 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum, | |
473 24, | |
474 6, | |
475 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
476 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/ | |
735 | 477 //v2 = 0;//(double)pBLVRenderParams->vPartyPos.z; |
478 //v3 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
479 //v4 = 0;//(double)pBLVRenderParams->vPartyPos.x; | |
0 | 480 v1->field_108 = 0.0; |
735 | 481 v1->blv_party_x = 0; |
482 v1->blv_party_y = 0; | |
483 v1->blv_party_z = 0; | |
484 //v5 = 0;//(double)pBLVRenderParams->vPartyPos.z; | |
485 //v6 = 0;//(double)pBLVRenderParams->vPartyPos.y; | |
486 //v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300); | |
0 | 487 v1->field_138 = 0.0; |
735 | 488 v1->blv_party_x_2 = 300; |
489 v1->blv_party_y_2 = 0; | |
490 v1->blv_party_z_2 = 0; | |
0 | 491 v1->field_168 = 0.0; |
492 v1->field_198 = 0.0; | |
493 v1->field_1C8 = 0.0; | |
494 v1->field_1F8 = 0.0; | |
495 v1->field_228 = 0.0; | |
496 v1->field_258 = 0.0; | |
497 v1->field_288 = 0.0; | |
498 v1->field_2B8 = 0.0; | |
499 v1->field_2E8 = 0.0; | |
500 v1->field_2BC = 0.0; | |
501 v1->field_2C0 = 0.0; | |
502 v1->field_2C4 = 0.0; | |
503 v1->field_318 = 0.0; | |
504 v1->field_2EC = 0.0; | |
505 v1->field_2F0 = 0.0; | |
506 v1->field_2F4 = 0.0; | |
507 v1->field_348 = 0.0; | |
508 v1->field_31C = 0.0; | |
509 v1->field_320 = 0.0; | |
510 v1->field_324 = 0.0; | |
511 v1->field_378 = 0.0; | |
512 v1->field_34C = 0.0; | |
513 v1->field_350 = 0.0; | |
514 v1->field_354 = 0.0; | |
515 for (uint i = 0; i < 16384; ++i) | |
516 { | |
517 list_0037C[i].field_0 = 0; | |
518 list_0037C[i].flt_30 = 0.0f; | |
519 } | |
520 | |
521 list_0037C_size = 0; | |
522 for (uint i = 0; i < 256; ++i) | |
523 list_E0380[i].mm7__vector_000004_size = 0; | |
524 /*v10 = v1->list_E0380; | |
525 v12 = 256; | |
526 do | |
527 { | |
528 v10->mm7__vector_000004_size = 0; | |
529 //mm7__vector_constructor( | |
530 // v10->mm7__vector_000004, | |
531 // 48, | |
532 // 64, | |
533 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1); | |
534 //++v10; | |
535 --v12; | |
536 } | |
537 while ( v12 );*/ | |
538 list_E0380_size = 0; | |
539 //v1->vdestructor_ptr = &stru8_pvdtor; | |
540 } | |
541 | |
542 | |
543 //----- (004254D2) -------------------------------------------------------- | |
544 int __fastcall sr_4254D2(signed int a1) | |
545 { | |
546 signed int v1; // ebx@2 | |
547 int v2; // ecx@2 | |
548 int result; // eax@11 | |
549 double v4; // ST74_8@12 | |
550 bool v5; // edi@12 | |
551 char *v6; // esi@13 | |
552 char *v7; // ebx@13 | |
553 double v8; // st7@15 | |
554 double v9; // st7@16 | |
555 double v10; // st6@16 | |
556 double v11; // st7@17 | |
557 float v12; // eax@18 | |
558 double v13; // ST4C_8@19 | |
559 double v14; // ST10_8@19 | |
560 double v15; // ST28_8@20 | |
561 double v16; // ST34_8@20 | |
562 char v17; // zf@20 | |
563 double v18; // ST18_8@21 | |
564 double v19; // ST3C_8@21 | |
565 double v20; // ST44_8@22 | |
566 double v21; // ST54_8@22 | |
567 void *v22; // edi@26 | |
568 double v23; // ST54_8@29 | |
569 bool v24; // esi@29 | |
570 char *v25; // edi@30 | |
571 char *v26; // ebx@30 | |
572 bool v27; // ecx@32 | |
573 double v28; // st7@33 | |
574 double v29; // st7@34 | |
575 double v30; // st6@34 | |
576 double v31; // st7@35 | |
577 double v32; // ST44_8@37 | |
578 double v33; // ST3C_8@37 | |
579 double v34; // ST18_8@38 | |
580 double v35; // ST34_8@38 | |
581 char v36; // zf@38 | |
582 double v37; // ST28_8@39 | |
583 double v38; // ST10_8@39 | |
584 double v39; // ST20_8@40 | |
585 double v40; // ST5C_8@40 | |
586 void *v41; // edi@44 | |
587 double v42; // ST5C_8@47 | |
588 bool v43; // edi@47 | |
589 char *v44; // esi@48 | |
590 char *v45; // ebx@48 | |
591 bool v46; // ecx@49 | |
592 double v47; // st6@50 | |
593 double v48; // st6@51 | |
594 double v49; // st5@51 | |
595 double v50; // st6@52 | |
596 double v51; // ST20_8@54 | |
597 double v52; // ST54_8@54 | |
598 double v53; // ST44_8@55 | |
599 double v54; // ST3C_8@55 | |
600 char v55; // zf@55 | |
601 double v56; // ST18_8@56 | |
602 double v57; // ST34_8@56 | |
603 double v58; // ST28_8@57 | |
604 double v59; // ST10_8@57 | |
605 void *v60; // edi@61 | |
606 double v61; // ST5C_8@64 | |
607 bool v62; // edi@64 | |
608 char *v63; // esi@65 | |
609 char *v64; // ebx@65 | |
610 bool v65; // ecx@66 | |
611 double v66; // st6@67 | |
612 double v67; // st6@68 | |
613 double v68; // st5@68 | |
614 double v69; // st6@69 | |
615 double v70; // ST20_8@71 | |
616 double v71; // ST54_8@71 | |
617 double v72; // ST44_8@72 | |
618 double v73; // ST3C_8@72 | |
619 char v74; // zf@72 | |
620 double v75; // ST18_8@73 | |
621 double v76; // ST34_8@73 | |
622 double v77; // ST28_8@74 | |
623 double v78; // ST10_8@74 | |
624 void *v79; // edi@78 | |
625 int v80; // ebx@81 | |
626 char *v81; // ecx@82 | |
627 signed int v82; // esi@82 | |
628 float v83; // ST78_4@83 | |
629 double v84; // ST5C_8@83 | |
630 float v85; // eax@84 | |
631 double v86; // ST20_8@85 | |
632 double v87; // ST54_8@88 | |
633 float v88; // eax@89 | |
634 double v89; // ST44_8@90 | |
635 unsigned __int8 v90; // sf@94 | |
636 unsigned __int8 v91; // of@94 | |
637 int v92; // edx@97 | |
638 int v93; // esi@97 | |
639 int v94; // edi@97 | |
640 int v95; // eax@97 | |
641 int v96; // eax@104 | |
642 double v97; // [sp+4Ch] [bp-8Ch]@32 | |
643 double v98; // [sp+54h] [bp-84h]@49 | |
644 double v99; // [sp+54h] [bp-84h]@66 | |
645 float v100; // [sp+5Ch] [bp-7Ch]@1 | |
646 float v101; // [sp+60h] [bp-78h]@1 | |
647 float v102; // [sp+64h] [bp-74h]@1 | |
648 double v103; // [sp+6Ch] [bp-6Ch]@14 | |
649 float v104; // [sp+A8h] [bp-30h]@1 | |
650 signed int v105; // [sp+A8h] [bp-30h]@96 | |
651 bool v106; // [sp+ACh] [bp-2Ch]@14 | |
652 bool v107; // [sp+ACh] [bp-2Ch]@32 | |
653 bool v108; // [sp+ACh] [bp-2Ch]@49 | |
654 bool v109; // [sp+ACh] [bp-2Ch]@66 | |
655 signed int v110; // [sp+B0h] [bp-28h]@12 | |
656 char *v111; // [sp+B8h] [bp-20h]@30 | |
657 signed int v112; // [sp+B8h] [bp-20h]@48 | |
658 signed int v113; // [sp+B8h] [bp-20h]@65 | |
659 char *v114; // [sp+BCh] [bp-1Ch]@13 | |
660 signed int v115; // [sp+BCh] [bp-1Ch]@29 | |
661 signed int v116; // [sp+BCh] [bp-1Ch]@64 | |
662 signed int v117; // [sp+C0h] [bp-18h]@1 | |
663 char *v118; // [sp+C0h] [bp-18h]@30 | |
664 char *v119; // [sp+C0h] [bp-18h]@48 | |
665 char *v120; // [sp+C0h] [bp-18h]@65 | |
666 char *v121; // [sp+C4h] [bp-14h]@13 | |
667 char *v122; // [sp+C4h] [bp-14h]@30 | |
668 signed int v123; // [sp+C4h] [bp-14h]@47 | |
669 char *v124; // [sp+C8h] [bp-10h]@30 | |
670 char *v125; // [sp+C8h] [bp-10h]@48 | |
671 char *v126; // [sp+C8h] [bp-10h]@65 | |
672 signed int v127; // [sp+CCh] [bp-Ch]@2 | |
673 char *v128; // [sp+CCh] [bp-Ch]@13 | |
674 char *v129; // [sp+CCh] [bp-Ch]@30 | |
675 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48 | |
676 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65 | |
677 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13 | |
678 char *v133; // [sp+D0h] [bp-8h]@30 | |
679 char *v134; // [sp+D0h] [bp-8h]@48 | |
680 char *v135; // [sp+D0h] [bp-8h]@65 | |
681 signed int v136; // [sp+D4h] [bp-4h]@1 | |
682 char *v137; // [sp+D4h] [bp-4h]@13 | |
683 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30 | |
684 char *v139; // [sp+D4h] [bp-4h]@48 | |
685 char *v140; // [sp+D4h] [bp-4h]@65 | |
686 | |
693 | 687 v101 = (double)(signed int)pViewport->uViewportTL_X; |
688 v100 = (double)(signed int)pViewport->uViewportBR_X; | |
0 | 689 v117 = a1; |
690 v136 = 1; | |
693 | 691 v104 = (double)(signed int)pViewport->uViewportTL_Y; |
692 v102 = (double)(pViewport->uViewportBR_Y + 1); | |
0 | 693 if ( a1 <= 0 ) |
694 return v117; | |
695 v127 = a1; | |
696 v1 = a1; | |
697 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2)); | |
698 v2 = 0; | |
699 do | |
700 { | |
701 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 ) | |
702 v136 = 0; | |
703 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 ) | |
704 v136 = 0; | |
705 ++v2; | |
706 --v127; | |
707 } | |
708 while ( v127 ); | |
709 if ( v136 ) | |
710 return v117; | |
711 v110 = 0; | |
712 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1])); | |
713 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15; | |
693 | 714 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportTL_X; |
0 | 715 if ( v117 < 1 ) |
716 goto LABEL_112; | |
717 v6 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
718 v132 = array_50A2B0; | |
719 v137 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
720 v128 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
721 v121 = (char *)&array_50A2B0[0].flt_2C; | |
168 | 722 v114 = (char *)&array_50A2B0[0]._rhw; |
0 | 723 v7 = (char *)&array_50AC10[0].flt_2C; |
724 do | |
725 { | |
726 v103 = *((float *)v7 + 7) + 6.7553994e15; | |
693 | 727 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportTL_X; |
0 | 728 if ( !(v5 ^ v106) ) |
729 goto LABEL_25; | |
730 v8 = v101; | |
693 | 731 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportTL_X ) |
0 | 732 { |
733 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5)); | |
734 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4); | |
735 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3); | |
736 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7; | |
737 } | |
738 else | |
739 { | |
740 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7)); | |
741 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8); | |
742 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9); | |
743 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12); | |
744 } | |
745 *(float *)v121 = v10; | |
746 *(int *)v137 = LODWORD(v101); | |
747 LODWORD(v12) = *(int *)v6; | |
748 if ( v5 ) | |
749 { | |
750 v13 = v12 + 6.7553994e15; | |
751 v14 = *((float *)v7 - 4) + 6.7553994e15; | |
752 if ( LODWORD(v13) == LODWORD(v14) ) | |
753 { | |
754 v15 = *(float *)v137 + 6.7553994e15; | |
755 v16 = *((float *)v7 - 5) + 6.7553994e15; | |
756 v17 = LODWORD(v15) == LODWORD(v16); | |
757 goto LABEL_23; | |
758 } | |
759 } | |
760 else | |
761 { | |
762 v18 = v12 + 6.7553994e15; | |
763 v19 = *((float *)v7 + 8) + 6.7553994e15; | |
764 if ( LODWORD(v18) == LODWORD(v19) ) | |
765 { | |
766 v20 = *(float *)v137 + 6.7553994e15; | |
767 v21 = *((float *)v7 + 7) + 6.7553994e15; | |
768 v17 = LODWORD(v20) == LODWORD(v21); | |
769 LABEL_23: | |
770 if ( v17 ) | |
771 goto LABEL_25; | |
772 goto LABEL_24; | |
773 } | |
774 } | |
775 LABEL_24: | |
776 v121 += 48; | |
777 v114 += 48; | |
778 v6 += 48; | |
779 ++v110; | |
780 ++v132; | |
781 v128 = v6; | |
782 v137 += 48; | |
783 LABEL_25: | |
784 if ( v106 ) | |
785 { | |
786 v22 = v132; | |
787 v128 += 48; | |
788 ++v110; | |
789 v114 += 48; | |
790 v121 += 48; | |
791 v137 += 48; | |
792 ++v132; | |
793 memcpy(v22, v7 + 4, 0x30u); | |
794 v6 = v128; | |
795 } | |
796 v5 = v106; | |
797 v7 += 48; | |
798 --v117; | |
799 } | |
800 while ( v117 ); | |
801 if ( v110 < 3 | |
802 || (v115 = 0, | |
803 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])), | |
804 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15, | |
693 | 805 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportBR_X, |
0 | 806 v110 < 1) ) |
807 goto LABEL_112; | |
168 | 808 v25 = (char *)&array_509950[0]._rhw; |
0 | 809 v138 = array_509950; |
810 v129 = (char *)&array_50A2B0[0].vWorldViewProjX; | |
811 v118 = (char *)&array_50A2B0[0].vWorldViewProjY; | |
812 v133 = (char *)&array_509950[0].vWorldViewProjX; | |
813 v122 = (char *)&array_509950[0].vWorldViewProjY; | |
814 v124 = (char *)&array_509950[0].flt_2C; | |
168 | 815 v111 = (char *)&array_509950[0]._rhw; |
0 | 816 v26 = (char *)&array_50A2B0[0].flt_2C; |
817 while ( 2 ) | |
818 { | |
819 v97 = *((float *)v26 + 7) + 6.7553994e15; | |
693 | 820 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportBR_X; |
821 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportBR_X; | |
0 | 822 if ( v24 != v27 ) |
823 { | |
824 v28 = v100; | |
693 | 825 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportBR_X ) |
0 | 826 { |
827 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5)); | |
828 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4); | |
829 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3); | |
830 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26; | |
831 } | |
832 else | |
833 { | |
834 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7)); | |
835 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8); | |
836 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9); | |
837 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12); | |
838 } | |
839 *(float *)v124 = v30; | |
840 *(int *)v133 = LODWORD(v100); | |
841 if ( v24 ) | |
842 { | |
843 v32 = *(float *)v122 + 6.7553994e15; | |
844 v33 = *((float *)v26 - 4) + 6.7553994e15; | |
845 if ( LODWORD(v32) == LODWORD(v33) ) | |
846 { | |
847 v34 = *(float *)v133 + 6.7553994e15; | |
848 v35 = *((float *)v26 - 5) + 6.7553994e15; | |
849 v36 = LODWORD(v34) == LODWORD(v35); | |
850 goto LABEL_41; | |
851 } | |
852 goto LABEL_42; | |
853 } | |
854 v37 = *(float *)v118 + 6.7553994e15; | |
855 v38 = *((float *)v26 + 8) + 6.7553994e15; | |
856 if ( LODWORD(v37) != LODWORD(v38) ) | |
857 goto LABEL_42; | |
858 v39 = *(float *)v129 + 6.7553994e15; | |
859 v40 = *((float *)v26 + 7) + 6.7553994e15; | |
860 v36 = LODWORD(v39) == LODWORD(v40); | |
861 LABEL_41: | |
862 if ( !v36 ) | |
863 { | |
864 LABEL_42: | |
865 v129 += 48; | |
866 v118 += 48; | |
867 v133 += 48; | |
868 v122 += 48; | |
869 v124 += 48; | |
870 v111 += 48; | |
871 ++v115; | |
872 ++v138; | |
873 } | |
874 } | |
875 if ( v27 ) | |
876 { | |
877 v41 = v138; | |
878 ++v115; | |
879 v111 += 48; | |
880 v124 += 48; | |
881 v122 += 48; | |
882 v133 += 48; | |
883 v118 += 48; | |
884 v129 += 48; | |
885 ++v138; | |
886 memcpy(v41, v26 + 4, 0x30u); | |
887 } | |
888 v24 = v107; | |
889 v26 += 48; | |
890 --v110; | |
891 if ( v110 ) | |
892 { | |
893 v25 = v111; | |
894 continue; | |
895 } | |
896 break; | |
897 } | |
898 if ( v115 < 3 | |
899 || (v123 = 0, | |
900 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])), | |
901 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15, | |
693 | 902 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportTL_Y, |
0 | 903 v115 < 1) ) |
904 goto LABEL_112; | |
905 v44 = (char *)&array_508FF0[0].vWorldViewProjX; | |
906 v130 = array_508FF0; | |
907 v119 = (char *)&array_508FF0[0].vWorldViewProjX; | |
908 v139 = (char *)&array_508FF0[0].vWorldViewProjY; | |
909 v125 = (char *)&array_508FF0[0].flt_2C; | |
168 | 910 v134 = (char *)&array_508FF0[0]._rhw; |
0 | 911 v45 = (char *)&array_509950[0].flt_2C; |
912 v112 = v115; | |
913 while ( 2 ) | |
914 { | |
915 v98 = *((float *)v45 + 8) + 6.7553994e15; | |
693 | 916 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportTL_Y; |
917 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportTL_Y; | |
0 | 918 if ( v43 != v46 ) |
919 { | |
920 v47 = v104; | |
693 | 921 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportTL_Y ) |
0 | 922 { |
923 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4)); | |
924 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5); | |
925 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3); | |
926 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45; | |
927 } | |
928 else | |
929 { | |
930 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8)); | |
931 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7); | |
932 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9); | |
933 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12); | |
934 } | |
935 *(float *)v125 = v49; | |
936 *(float *)v139 = v104; | |
937 if ( v43 ) | |
938 { | |
939 v51 = v104 + 6.7553994e15; | |
940 v52 = *((float *)v45 - 4) + 6.7553994e15; | |
941 if ( LODWORD(v51) == LODWORD(v52) ) | |
942 { | |
943 v53 = *(float *)v44 + 6.7553994e15; | |
944 v54 = *((float *)v45 - 5) + 6.7553994e15; | |
945 v55 = LODWORD(v53) == LODWORD(v54); | |
946 goto LABEL_58; | |
947 } | |
948 goto LABEL_59; | |
949 } | |
950 v56 = v104 + 6.7553994e15; | |
951 v57 = *((float *)v45 + 8) + 6.7553994e15; | |
952 if ( LODWORD(v56) != LODWORD(v57) ) | |
953 goto LABEL_59; | |
954 v58 = *(float *)v44 + 6.7553994e15; | |
955 v59 = *((float *)v45 + 7) + 6.7553994e15; | |
956 v55 = LODWORD(v58) == LODWORD(v59); | |
957 LABEL_58: | |
958 if ( !v55 ) | |
959 { | |
960 LABEL_59: | |
961 v139 += 48; | |
962 v125 += 48; | |
963 v134 += 48; | |
964 v44 += 48; | |
965 ++v123; | |
966 ++v130; | |
967 v119 = v44; | |
968 } | |
969 } | |
970 if ( v46 ) | |
971 { | |
972 v60 = v130; | |
973 v119 += 48; | |
974 ++v123; | |
975 v134 += 48; | |
976 v125 += 48; | |
977 v139 += 48; | |
978 ++v130; | |
979 memcpy(v60, v45 + 4, 0x30u); | |
980 v44 = v119; | |
981 } | |
982 v43 = v108; | |
983 v45 += 48; | |
984 --v112; | |
985 if ( v112 ) | |
986 continue; | |
987 break; | |
988 } | |
989 if ( v123 < 3 | |
990 || (v116 = 0, | |
991 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])), | |
992 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15, | |
693 | 993 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportBR_Y, |
0 | 994 v123 < 1) ) |
995 goto LABEL_112; | |
996 v63 = (char *)&array_508690[0].vWorldViewProjX; | |
997 v131 = array_508690; | |
998 v120 = (char *)&array_508690[0].vWorldViewProjX; | |
999 v140 = (char *)&array_508690[0].vWorldViewProjY; | |
1000 v126 = (char *)&array_508690[0].flt_2C; | |
168 | 1001 v135 = (char *)&array_508690[0]._rhw; |
0 | 1002 v64 = (char *)&array_508FF0[0].flt_2C; |
1003 v113 = v123; | |
1004 while ( 2 ) | |
1005 { | |
1006 v99 = *((float *)v64 + 8) + 6.7553994e15; | |
693 | 1007 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportBR_Y; |
1008 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportBR_Y; | |
0 | 1009 if ( v62 != v65 ) |
1010 { | |
1011 v66 = v102; | |
693 | 1012 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportBR_Y ) |
0 | 1013 { |
1014 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4)); | |
1015 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5); | |
1016 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3); | |
1017 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64; | |
1018 } | |
1019 else | |
1020 { | |
1021 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8)); | |
1022 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7); | |
1023 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9); | |
1024 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12); | |
1025 } | |
1026 *(float *)v126 = v68; | |
1027 *(float *)v140 = v102; | |
1028 if ( v62 ) | |
1029 { | |
1030 v70 = v102 + 6.7553994e15; | |
1031 v71 = *((float *)v64 - 4) + 6.7553994e15; | |
1032 if ( LODWORD(v70) == LODWORD(v71) ) | |
1033 { | |
1034 v72 = *(float *)v63 + 6.7553994e15; | |
1035 v73 = *((float *)v64 - 5) + 6.7553994e15; | |
1036 v74 = LODWORD(v72) == LODWORD(v73); | |
1037 goto LABEL_75; | |
1038 } | |
1039 goto LABEL_76; | |
1040 } | |
1041 v75 = v102 + 6.7553994e15; | |
1042 v76 = *((float *)v64 + 8) + 6.7553994e15; | |
1043 if ( LODWORD(v75) != LODWORD(v76) ) | |
1044 goto LABEL_76; | |
1045 v77 = *(float *)v63 + 6.7553994e15; | |
1046 v78 = *((float *)v64 + 7) + 6.7553994e15; | |
1047 v74 = LODWORD(v77) == LODWORD(v78); | |
1048 LABEL_75: | |
1049 if ( !v74 ) | |
1050 { | |
1051 LABEL_76: | |
1052 v140 += 48; | |
1053 v126 += 48; | |
1054 v135 += 48; | |
1055 v63 += 48; | |
1056 ++v116; | |
1057 ++v131; | |
1058 v120 = v63; | |
1059 } | |
1060 } | |
1061 if ( v65 ) | |
1062 { | |
1063 v79 = v131; | |
1064 v120 += 48; | |
1065 ++v116; | |
1066 v135 += 48; | |
1067 v126 += 48; | |
1068 v140 += 48; | |
1069 ++v131; | |
1070 memcpy(v79, v64 + 4, 0x30u); | |
1071 v63 = v120; | |
1072 } | |
1073 v62 = v109; | |
1074 v64 += 48; | |
1075 --v113; | |
1076 if ( v113 ) | |
1077 continue; | |
1078 break; | |
1079 } | |
1080 if ( v116 < 3 ) | |
1081 goto LABEL_112; | |
1082 v80 = v116; | |
1083 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116])); | |
1084 if ( v116 > 0 ) | |
1085 { | |
1086 v81 = (char *)&array_508690[0].vWorldViewProjX; | |
1087 v82 = v116; | |
1088 do | |
1089 { | |
1090 LODWORD(v83) = *(int *)v81; | |
1091 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2); | |
1092 v84 = v83 + 6.7553994e15; | |
693 | 1093 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportBR_X ) |
0 | 1094 { |
1095 v86 = *(float *)v81 + 6.7553994e15; | |
693 | 1096 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportTL_X ) |
0 | 1097 goto LABEL_88; |
1098 v85 = v101; | |
1099 } | |
1100 else | |
1101 { | |
1102 v85 = v100; | |
1103 } | |
1104 *(int *)v81 = LODWORD(v85); | |
1105 LABEL_88: | |
1106 v87 = *((float *)v81 + 1) + 6.7553994e15; | |
693 | 1107 if ( SLODWORD(v87) > (signed int)pViewport->uViewportBR_Y ) |
0 | 1108 { |
1109 v88 = v102; | |
1110 LABEL_92: | |
1111 *((int *)v81 + 1) = LODWORD(v88); | |
1112 goto LABEL_93; | |
1113 } | |
1114 v89 = *((float *)v81 + 1) + 6.7553994e15; | |
693 | 1115 if ( SLODWORD(v89) < (signed int)pViewport->uViewportTL_Y ) |
0 | 1116 { |
1117 v88 = v104; | |
1118 goto LABEL_92; | |
1119 } | |
1120 LABEL_93: | |
1121 v81 += 48; | |
1122 --v82; | |
1123 } | |
1124 while ( v82 ); | |
1125 } | |
1126 v91 = __OFSUB__(v116, 3); | |
1127 v90 = v116 - 3 < 0; | |
1128 if ( v116 > 3 ) | |
1129 { | |
1130 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1])); | |
1131 if ( v116 > 0 ) | |
1132 { | |
1133 v105 = 1; | |
1134 do | |
1135 { | |
1136 v92 = v105; | |
1137 v93 = v105 - 1; | |
1138 v94 = v105 + 1; | |
1139 v95 = v105 + 1; | |
1140 if ( v105 - 1 >= v80 ) | |
1141 v93 -= v80; | |
1142 if ( v105 >= v80 ) | |
1143 v92 = v105 - v80; | |
1144 if ( v94 >= v80 ) | |
1145 v95 = v94 - v80; | |
1146 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1147 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY) | |
1148 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX) | |
1149 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 ) | |
1150 { | |
1151 ++v105; | |
1152 } | |
1153 else | |
1154 { | |
1155 v96 = v105; | |
1156 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) ) | |
1157 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2)); | |
1158 --v80; | |
1159 } | |
1160 } | |
1161 while ( v105 - 1 < v80 ); | |
1162 } | |
1163 v91 = __OFSUB__(v80, 3); | |
1164 v90 = v80 - 3 < 0; | |
1165 } | |
1166 if ( v90 ^ v91 ) | |
1167 LABEL_112: | |
1168 result = 0; | |
1169 else | |
1170 result = v80; | |
1171 return result; | |
1172 } | |
1173 | |
1174 //----- (0042620A) -------------------------------------------------------- | |
1175 bool __thiscall sr_42620A(RenderVertexSoft *p) | |
1176 { | |
1177 __int16 v1; // fps@1 | |
1178 unsigned __int8 v2; // c0@2 | |
1179 char v3; // c2@2 | |
1180 unsigned __int8 v4; // c3@2 | |
1181 bool result; // eax@2 | |
1182 unsigned __int8 v6; // c0@4 | |
1183 char v7; // c2@4 | |
1184 unsigned __int8 v8; // c3@4 | |
1185 unsigned __int8 v9; // c0@6 | |
1186 char v10; // c2@6 | |
1187 unsigned __int8 v11; // c3@6 | |
1188 double v12; // st6@7 | |
1189 float v13; // ST04_4@7 | |
1190 float v14; // ST00_4@7 | |
1191 double v15; // st7@7 | |
1192 double v16; // st6@8 | |
1193 float v17; // ST04_4@8 | |
1194 float v18; // ST00_4@8 | |
1195 double v19; // st7@8 | |
1196 | |
1197 //UNDEF(v1); | |
1198 if ( p->vWorldViewPosition.x < 300.0 | |
1199 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
1200 v3 = 0, | |
1201 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
1202 BYTE1(result) = HIBYTE(v1), | |
1203 !(v2 | v4)) ) | |
1204 { | |
1205 if ( p->vWorldViewPosition.x < 300.0 ) | |
1206 { | |
1207 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
1208 v7 = 0; | |
1209 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
1210 BYTE1(result) = HIBYTE(v1); | |
1211 if ( !(v6 | v8) ) | |
1212 { | |
1213 LOBYTE(result) = 0; | |
1214 return result; | |
1215 } | |
1216 } | |
1217 v9 = 300.0 < p->vWorldViewPosition.x; | |
1218 v10 = 0; | |
1219 v11 = 300.0 == p->vWorldViewPosition.x; | |
1220 BYTE1(result) = HIBYTE(v1); | |
1221 if ( v9 | v11 ) | |
1222 { | |
1223 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
1224 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
1225 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
1226 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
1227 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
1228 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
1229 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
1230 } | |
1231 else | |
1232 { | |
1233 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
1234 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
1235 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
1236 v15 = 300.0 - p->vWorldViewPosition.x; | |
1237 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
1238 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
1239 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
1240 } | |
1241 } | |
1242 LOBYTE(result) = 1; | |
1243 return result; | |
1244 } | |
1245 | |
1246 | |
1247 | |
1248 | |
1249 //----- (004268E3) -------------------------------------------------------- | |
1250 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor) | |
1251 { | |
1252 unsigned int v1; // eax@1 | |
1253 unsigned int v2; // edx@1 | |
1254 int v3; // eax@1 | |
1255 int v4; // edx@1 | |
1256 unsigned int v5; // ecx@1 | |
1257 | |
1258 v1 = uColor >> 9; | |
1259 v2 = uColor >> 6; | |
1260 LOWORD(v1) = (uColor >> 9) & 0x7C00; | |
1261 LOWORD(v2) = (uColor >> 6) & 0x3E0; | |
1262 v3 = v2 | v1; | |
1263 v4 = (unsigned __int8)uColor >> 3; | |
1264 v5 = uColor >> 16; | |
1265 LOWORD(v5) = v5 & 0x8000; | |
1266 return v5 | v4 | v3; | |
1267 } | |
1268 | |
1269 //----- (0042690D) -------------------------------------------------------- | |
1270 int __fastcall _42690D_colors_cvt(unsigned int a1) | |
1271 { | |
1272 unsigned int v1; // eax@1 | |
1273 unsigned int v2; // edx@1 | |
1274 | |
1275 v1 = a1 >> 8; | |
1276 v2 = a1 >> 5; | |
1277 LOWORD(v1) = (a1 >> 8) & 0xF800; | |
1278 LOWORD(v2) = (a1 >> 5) & 0x7E0; | |
1279 return ((unsigned __int8)a1 >> 3) | v2 | v1; | |
1280 } | |
1281 | |
1282 //----- (00426947) -------------------------------------------------------- | |
1283 void __cdecl sub_426947() | |
1284 { | |
1285 dword_50C968 = 0; | |
1286 dword_50C994 = 0; | |
1287 dword_50C998_turnbased_icon_1A = 0; | |
1288 } | |
1289 // 50C968: using guessed type int dword_50C968; | |
1290 // 50C994: using guessed type int dword_50C994; | |
1291 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A; | |
1292 | |
1293 | |
1294 | |
1295 //----- (004269A2) -------------------------------------------------------- | |
1296 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1) | |
1297 { | |
89 | 1298 //unsigned __int64 v1; // qax@1 |
1299 Player *v1; | |
1300 int v1b; | |
0 | 1301 signed int v2; // ecx@1 |
82 | 1302 int *v3; // esi@1 |
0 | 1303 bool v4; // edi@6 |
82 | 1304 int *v5; // edi@10 |
1305 Player *v6; // esi@10 | |
0 | 1306 int v7; // eax@13 |
1307 unsigned __int8 v8; // cf@13 | |
89 | 1308 int v10[4]; // [sp+Ch] [bp-14h]@1 |
0 | 1309 int v11; // [sp+1Ch] [bp-4h]@10 |
1310 | |
89 | 1311 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1); |
1312 v1 = pParty->pPlayers; | |
1313 v1b = a1; | |
0 | 1314 v2 = 0; |
89 | 1315 v3 = v10; |
0 | 1316 do |
1317 { | |
89 | 1318 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8)) |
0 | 1319 && !*(int *)HIDWORD(v1) |
1320 && !*(_QWORD *)(HIDWORD(v1) + 8) | |
89 | 1321 && !*(_QWORD *)(HIDWORD(v1) + 16);*/ |
1322 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13])) | |
1323 && !v1->pConditions[14] | |
1324 && !v1->pConditions[15] | |
1325 && !v1->pConditions[16]; | |
82 | 1326 *v3 = v4; |
89 | 1327 //HIDWORD(v1) += 6972; |
1328 ++v1; | |
0 | 1329 v2 += v4; |
82 | 1330 ++v3; |
0 | 1331 } |
89 | 1332 while ( v1 <= &pParty->pPlayers[3] ); |
0 | 1333 if ( v2 ) |
1334 { | |
89 | 1335 v1b = v1b / v2; |
1336 v5 = v10; | |
82 | 1337 v6 = pParty->pPlayers;//[0].uExperience; |
89 | 1338 v11 = v1b; |
0 | 1339 do |
1340 { | |
82 | 1341 if ( *v5 ) |
0 | 1342 { |
1343 if ( v11 ) | |
1344 { | |
82 | 1345 LOBYTE(v7) = v6->GetLearningPercent(); |
89 | 1346 v1b = v11 + v11 * v7 / 100; |
1347 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience)); | |
1348 //need review | |
1349 LODWORD(v6->uExperience) += v1b; | |
1350 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8; | |
82 | 1351 if ( v6->uExperience > 4000000000i64 ) |
0 | 1352 { |
82 | 1353 HIDWORD(v6->uExperience) = 0; |
1354 LODWORD(v6->uExperience) = -294967296; | |
0 | 1355 } |
1356 } | |
1357 } | |
82 | 1358 ++v6; |
1359 ++v5; | |
0 | 1360 } |
82 | 1361 while ( v6 <= &pParty->pPlayers[3] ); |
0 | 1362 } |
89 | 1363 return v1b; |
0 | 1364 } |
1365 | |
1366 //----- (00426A5A) -------------------------------------------------------- | |
1367 void stru319::LootActor(Actor *pActor) | |
1368 { | |
1369 signed int v2; // edi@1 | |
1370 char v3; // zf@1 | |
1371 unsigned int v4; // eax@13 | |
1372 unsigned int v5; // esi@13 | |
1373 int v6; // eax@14 | |
1374 unsigned __int8 v7; // al@30 | |
1375 Party *v8; // esi@34 | |
1376 char *v9; // [sp-4h] [bp-3Ch]@10 | |
1377 char *v10; // [sp-4h] [bp-3Ch]@31 | |
1378 char *v11; // [sp-4h] [bp-3Ch]@38 | |
1379 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 | |
1380 int v13; // [sp+30h] [bp-8h]@1 | |
1381 int v14; // [sp+34h] [bp-4h]@1 | |
1382 | |
1383 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1384 Dst.Reset(); | |
1385 v2 = 0; | |
1386 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; | |
1387 v13 = 0; | |
1388 v14 = 0; | |
1389 if ( v3 ) | |
1390 { | |
1391 if ( !pActor->pMonsterInfo.uTreasureDiceRolls ) | |
1392 goto LABEL_9; | |
1393 do | |
1394 { | |
1395 ++v2; | |
1396 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; | |
1397 } | |
1398 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); | |
1399 } | |
1400 else | |
1401 { | |
1402 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 ) | |
1403 goto LABEL_9; | |
377 | 1404 v14 = pActor->array_000234[3].uSpecEnchantmentType; |
0 | 1405 pActor->array_000234[3].Reset(); |
1406 } | |
1407 if ( v14 ) | |
1408 { | |
1409 party_finds_gold(v14, 0); | |
1410 viewparams->bRedrawGameUI = 1; | |
1411 } | |
1412 LABEL_9: | |
1413 if ( pActor->uCarriedItemID ) | |
1414 { | |
1415 Dst.Reset(); | |
1416 Dst.uItemID = pActor->uCarriedItemID; | |
1417 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1418 if ( v14 ) | |
721 | 1419 sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9); |
0 | 1420 else |
721 | 1421 sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9); |
0 | 1422 ShowStatusBarString(pTmpBuf2, 2u); |
1423 v4 = Dst.uItemID; | |
1424 v5 = Dst.uItemID; | |
1425 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 ) | |
1426 { | |
1427 v5 = Dst.uItemID; | |
1428 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1; | |
1429 Dst.uNumCharges = v6; | |
1430 Dst.uMaxCharges = v6; | |
1431 v4 = Dst.uItemID; | |
1432 } | |
1433 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) | |
570 | 1434 Dst.uEnchantmentType = 2 * rand() % 4 + 2; |
0 | 1435 pItemsTable->SetSpecialBonus(&Dst); |
1436 if ( !pParty->AddItem(&Dst) ) | |
1437 pParty->SetHoldingItem(&Dst); | |
1438 pActor->uCarriedItemID = 0; | |
1439 if ( pActor->array_000234[0].uItemID ) | |
1440 { | |
1441 if ( !pParty->AddItem(pActor->array_000234) ) | |
1442 { | |
1443 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1444 pParty->SetHoldingItem(pActor->array_000234); | |
1445 } | |
1446 pActor->array_000234[0].Reset(); | |
1447 } | |
1448 if ( pActor->array_000234[1].uItemID ) | |
1449 { | |
1450 if ( !pParty->AddItem(&pActor->array_000234[1]) ) | |
1451 { | |
1452 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1453 pParty->SetHoldingItem(&pActor->array_000234[1]); | |
1454 } | |
1455 pActor->array_000234[1].Reset(); | |
1456 } | |
1457 LABEL_55: | |
1458 pActor->Remove(); | |
1459 return; | |
1460 } | |
1461 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) | |
1462 { | |
1463 if ( pActor->array_000234[3].uItemID ) | |
1464 { | |
1465 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); | |
1466 pActor->array_000234[3].Reset(); | |
1467 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1468 if ( v14 ) | |
721 | 1469 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11); |
0 | 1470 else |
721 | 1471 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11); |
0 | 1472 ShowStatusBarString(pTmpBuf2, 2u); |
1473 if ( !pParty->AddItem(&Dst) ) | |
1474 pParty->SetHoldingItem(&Dst); | |
1475 v13 = 1; | |
1476 } | |
1477 goto LABEL_44; | |
1478 } | |
1479 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) | |
1480 { | |
1481 LABEL_44: | |
1482 v8 = pParty; | |
1483 goto LABEL_45; | |
1484 } | |
1485 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); | |
1486 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; | |
1487 if ( v14 ) | |
721 | 1488 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10); |
0 | 1489 else |
721 | 1490 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10); |
0 | 1491 ShowStatusBarString(pTmpBuf2, 2u); |
1492 v8 = pParty; | |
1493 if ( !pParty->AddItem(&Dst) ) | |
1494 pParty->SetHoldingItem(&Dst); | |
1495 v13 = 1; | |
1496 LABEL_45: | |
1497 if ( pActor->array_000234[0].uItemID ) | |
1498 { | |
1499 if ( !v8->AddItem(pActor->array_000234) ) | |
1500 { | |
1501 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1502 v8->SetHoldingItem(pActor->array_000234); | |
1503 v13 = 1; | |
1504 } | |
1505 pActor->array_000234[0].Reset(); | |
1506 } | |
1507 if ( pActor->array_000234[1].uItemID ) | |
1508 { | |
1509 if ( !v8->AddItem(&pActor->array_000234[1]) ) | |
1510 { | |
1511 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
1512 v8->SetHoldingItem(&pActor->array_000234[1]); | |
1513 v13 = 1; | |
1514 } | |
1515 pActor->array_000234[1].Reset(); | |
1516 } | |
1517 if ( !v13 || rand() % 100 < 90 ) | |
1518 goto LABEL_55; | |
1519 } | |
1520 | |
1521 //----- (00426E10) -------------------------------------------------------- | |
1522 int stru319::which_player_would_attack(Actor *pActor) | |
1523 { | |
1524 signed int v2; // ebx@1 | |
1525 int v3; // ecx@2 | |
1526 signed int v4; // edx@3 | |
1527 char v5; // zf@3 | |
1528 unsigned int v6; // eax@3 | |
1529 int v7; // eax@6 | |
1530 int v8; // eax@7 | |
1531 int v9; // eax@8 | |
1532 int v10; // eax@9 | |
1533 int v11; // eax@10 | |
1534 int v12; // eax@11 | |
1535 int v13; // esi@35 | |
1536 signed int v14; // edi@37 | |
1537 enum CHARACTER_RACE v15; // eax@44 | |
1538 Player *v16; // ecx@47 | |
1539 unsigned __int8 v17; // sf@50 | |
1540 unsigned __int8 v18; // of@50 | |
1541 int v19; // esi@52 | |
1542 Player *v20; // ecx@53 | |
1543 int result; // eax@57 | |
1544 int v22[16]; // [sp+8h] [bp-140h]@3 | |
1545 int v23[60]; // [sp+48h] [bp-100h]@48 | |
1546 int v24; // [sp+138h] [bp-10h]@2 | |
1547 int v25; // [sp+13Ch] [bp-Ch]@1 | |
1548 int v26; // [sp+140h] [bp-8h]@1 | |
1549 int v27; // [sp+144h] [bp-4h]@1 | |
1550 | |
1551 v27 = -1; | |
1552 v26 = -1; | |
1553 v25 = -1; | |
1554 v2 = 0; | |
1555 if ( pActor->pMonsterInfo.uAttackPreference ) | |
1556 { | |
1557 v3 = 0; | |
1558 v24 = 0; | |
1559 do | |
1560 { | |
1561 v4 = 1; | |
1562 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); | |
1563 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; | |
1564 v22[v3] = v6; | |
1565 if ( !v5 ) | |
1566 { | |
1567 if ( (signed int)v6 > 128 ) | |
1568 { | |
1569 switch ( v6 ) | |
1570 { | |
1571 case 0x100u: | |
1572 v27 = 8; | |
1573 break; | |
1574 case 0x200u: | |
1575 v25 = 0; | |
1576 break; | |
1577 case 0x400u: | |
1578 v25 = 1; | |
1579 break; | |
1580 case 0x800u: | |
1581 v26 = 0; | |
1582 break; | |
1583 case 0x1000u: | |
1584 v26 = 1; | |
1585 break; | |
1586 case 0x2000u: | |
1587 v26 = 3; | |
1588 break; | |
1589 case 0x4000u: | |
1590 v26 = 2; | |
1591 break; | |
1592 } | |
1593 } | |
1594 else | |
1595 { | |
1596 if ( v6 == 128 ) | |
1597 { | |
1598 v27 = 4; | |
1599 } | |
1600 else | |
1601 { | |
1602 v7 = v6 - 1; | |
1603 if ( v7 ) | |
1604 { | |
1605 v8 = v7 - 1; | |
1606 if ( v8 ) | |
1607 { | |
1608 v9 = v8 - 2; | |
1609 if ( v9 ) | |
1610 { | |
1611 v10 = v9 - 4; | |
1612 if ( v10 ) | |
1613 { | |
1614 v11 = v10 - 8; | |
1615 if ( v11 ) | |
1616 { | |
1617 v12 = v11 - 16; | |
1618 if ( v12 ) | |
1619 { | |
1620 if ( v12 == 32 ) | |
1621 v27 = 20; | |
1622 } | |
1623 else | |
1624 { | |
1625 v27 = 32; | |
1626 } | |
1627 } | |
1628 else | |
1629 { | |
1630 v27 = 24; | |
1631 } | |
1632 } | |
1633 else | |
1634 { | |
1635 v27 = 28; | |
1636 } | |
1637 } | |
1638 else | |
1639 { | |
1640 v27 = 16; | |
1641 } | |
1642 } | |
1643 else | |
1644 { | |
1645 v27 = 12; | |
1646 } | |
1647 } | |
1648 else | |
1649 { | |
1650 v27 = 0; | |
1651 } | |
1652 } | |
1653 } | |
1654 v2 = 0; | |
1655 v13 = 0; | |
1656 while ( 1 ) | |
1657 { | |
1658 v14 = 0; | |
135 | 1659 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType ) |
0 | 1660 v14 = v4; |
1661 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) | |
1662 v14 = v4; | |
1663 if ( v26 != -1 ) | |
1664 { | |
1665 v15 = pPlayers[v13 + 1]->GetRace(); | |
1666 if ( v26 == v15 ) | |
1667 v14 = 1; | |
1668 } | |
1669 if ( v14 == 1 ) | |
1670 { | |
1671 v16 = pPlayers[v13 + 1]; | |
1672 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) | |
1673 v23[v2++] = v13; | |
1674 } | |
1675 ++v13; | |
1676 if ( v13 >= 4 ) | |
1677 break; | |
1678 v4 = 1; | |
1679 } | |
1680 } | |
1681 v3 = v24 + 1; | |
1682 v18 = __OFSUB__(v24 + 1, 15); | |
1683 v17 = v24++ - 14 < 0; | |
1684 } | |
1685 while ( v17 ^ v18 ); | |
1686 if ( v2 ) | |
1687 goto LABEL_61; | |
1688 } | |
1689 v19 = 0; | |
1690 do | |
1691 { | |
1692 v20 = pPlayers[v19 + 1]; | |
1693 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) | |
1694 v23[v2++] = v19; | |
1695 ++v19; | |
1696 } | |
1697 while ( v19 < 4 ); | |
1698 if ( v2 ) | |
1699 LABEL_61: | |
1700 result = v23[rand() % v2]; | |
1701 else | |
1702 result = 0; | |
1703 return result; | |
1704 } | |
1705 | |
1706 | |
1707 //----- (0042704B) -------------------------------------------------------- | |
1708 bool stru319::special_ability_use_check(Actor *pActor, int a2) | |
1709 { | |
1710 stru319 *v3; // edi@1 | |
1711 signed int v4; // ebx@5 | |
1712 signed int v5; // edi@5 | |
1713 | |
1714 v3 = this; | |
1715 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
1716 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
1717 && rand() % 100 < 5 ) | |
1718 pActor->_44FD29(a2); | |
1719 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); | |
1720 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); | |
1721 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
1722 return 2; | |
1723 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
1724 return 3; | |
1725 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance; | |
1726 } | |
1727 | |
1728 //----- (00427102) -------------------------------------------------------- | |
1729 int stru319::_427102(Actor *pActor, signed int a2) | |
1730 { | |
1731 unsigned __int8 v3; // cf@11 | |
1732 unsigned __int8 v4; // zf@11 | |
1733 SpellBuff *v6; // ecx@46 | |
89 | 1734 Player *v7; // esi@49 |
0 | 1735 signed int v8; // edx@50 |
89 | 1736 SpellBuff *v9; // ecx@50 |
0 | 1737 |
597 | 1738 switch(a2) |
0 | 1739 { |
597 | 1740 case 77: |
1741 { | |
1742 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP ) | |
1743 return 0; | |
1744 return 1; | |
1745 } | |
1746 case 80: | |
1747 { | |
1748 v6 = pParty->pPartyBuffs; | |
1749 while ( (signed __int64)v6->uExpireTime <= 0 ) | |
1750 { | |
1751 ++v6; | |
1752 if ( v6 > &pParty->pPartyBuffs[19] ) | |
1753 { | |
1754 v7 = pParty->pPlayers;//[0].pPlayerBuffs; | |
1755 v8 = 0; | |
1756 v9 = v7->pPlayerBuffs; | |
1757 while ( v9->uExpireTime <= 0i64 ) | |
1758 { | |
1759 ++v8; | |
1760 ++v9; | |
1761 if ( v8 >= 24 ) | |
1762 { | |
1763 ++v7; | |
1764 if ( v7 <= &pParty->pPlayers[3] ) | |
1765 { | |
1766 v8 = 0; | |
1767 v9 = v7->pPlayerBuffs; | |
1768 } | |
1769 else | |
1770 return 0; | |
1771 } | |
1772 } | |
1773 return 1; | |
1774 } | |
1775 } | |
1776 return 1; | |
1777 } | |
1778 case 85: | |
1779 { | |
1780 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 ) | |
1781 return 1; | |
1782 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 ) | |
1783 return 0; | |
1784 v3 = 0; | |
1785 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0; | |
1786 break; | |
1787 } | |
1788 case 86: | |
1789 { | |
0 | 1790 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 ) |
597 | 1791 return 1; |
0 | 1792 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 ) |
597 | 1793 return 0; |
0 | 1794 v3 = 0; |
1795 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0; | |
597 | 1796 break; |
1797 } | |
1798 case 95: | |
1799 { | |
1800 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 ) | |
1801 return 1; | |
0 | 1802 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 ) |
597 | 1803 return 0; |
0 | 1804 v3 = 0; |
1805 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0; | |
597 | 1806 break; |
1807 } | |
1808 case 73: | |
1809 { | |
1810 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 ) | |
1811 return 1; | |
1812 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 ) | |
1813 return 0; | |
1814 v3 = 0; | |
1815 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0; | |
1816 break; | |
1817 } | |
1818 case 5: | |
1819 { | |
1820 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 ) | |
1821 return 1; | |
1822 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 ) | |
1823 return 0; | |
1824 v3 = 0; | |
1825 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0; | |
1826 break; | |
1827 } | |
1828 case 17: | |
1829 { | |
1830 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 ) | |
1831 return 1; | |
1832 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 ) | |
1833 return 0; | |
1834 v3 = 0; | |
1835 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0; | |
1836 break; | |
1837 } | |
1838 case 38: | |
89 | 1839 { |
597 | 1840 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 ) |
1841 return 1; | |
1842 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 ) | |
1843 return 0; | |
1844 v3 = 0; | |
1845 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0; | |
1846 } | |
1847 case 46: | |
1848 { | |
1849 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 ) | |
89 | 1850 return 1; |
597 | 1851 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 ) |
1852 return 0; | |
1853 v3 = 0; | |
1854 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0; | |
1855 break; | |
1856 } | |
1857 case 47: | |
1858 { | |
1859 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 ) | |
1860 return 1; | |
1861 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 ) | |
1862 return 0; | |
1863 v3 = 0; | |
1864 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0; | |
1865 break; | |
1866 } | |
1867 case 51: | |
1868 { | |
1869 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 ) | |
1870 return 1; | |
1871 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 ) | |
1872 { | |
89 | 1873 v3 = 0; |
1874 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0; | |
1875 } | |
1876 else | |
597 | 1877 return 0; |
1878 break; | |
1879 } | |
1880 default: | |
89 | 1881 { |
597 | 1882 return 1; |
89 | 1883 } |
0 | 1884 } |
1885 if ( !(v3 | v4) ) | |
1886 return 0; | |
1887 return 1; | |
1888 } | |
1889 | |
1890 //----- (004272F5) -------------------------------------------------------- | |
1891 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
1892 { | |
1893 signed int v5; // esi@1 | |
1894 signed int v6; // edi@1 | |
1895 int v7; // esi@8 | |
1896 int v8; // eax@9 | |
1897 int v9; // edx@11 | |
1898 int v10; // edx@13 | |
1899 int v11; // esi@13 | |
1900 unsigned __int8 v12; // sf@13 | |
1901 unsigned __int8 v13; // of@13 | |
1902 int v14; // edx@14 | |
1903 int v15; // eax@14 | |
1904 signed int result; // eax@17 | |
1905 | |
1906 v5 = pActor->pMonsterInfo.uAC; | |
1907 v6 = 0; | |
1908 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 ) | |
1909 v5 /= 2; | |
1910 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1911 v6 = pActor->pActorBuffs[15].uPower; | |
1912 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 ) | |
1913 v6 = pActor->pActorBuffs[16].uPower; | |
1914 v7 = v6 + v5; | |
1915 if ( a3 ) | |
1916 v8 = pPlayer->GetRangedAttack(); | |
1917 else | |
1918 v8 = pPlayer->GetActualAttack(0); | |
1919 v9 = rand() % (v7 + 2 * v8 + 30); | |
1920 if ( a3 == 2 ) | |
1921 { | |
1922 v14 = a4 + v9; | |
1923 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1924 } | |
1925 else | |
1926 { | |
1927 if ( a3 != 3 ) | |
1928 { | |
1929 v10 = a4 + v9; | |
1930 v11 = v7 + 15; | |
1931 v13 = __OFSUB__(v10, v11); | |
1932 v12 = v10 - v11 < 0; | |
1933 goto LABEL_16; | |
1934 } | |
1935 v14 = a4 + v9; | |
1936 v15 = 2 * v7 + 30; | |
1937 } | |
1938 v13 = __OFSUB__(v14, v15); | |
1939 v12 = v14 - v15 < 0; | |
1940 LABEL_16: | |
1941 if ( v12 ^ v13 ) | |
1942 result = 0; | |
1943 else | |
1944 result = 1; | |
1945 return result; | |
1946 } | |
1947 | |
1948 //----- (004273BB) -------------------------------------------------------- | |
1949 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
1950 { | |
1951 Actor *v5; // ecx@1 | |
1952 signed int v6; // ebx@1 | |
1953 signed int v7; // esi@1 | |
1954 unsigned __int8 v8; // zf@1 | |
1955 unsigned __int8 v9; // sf@1 | |
1956 int v10; // ebx@10 | |
1957 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
1958 | |
1959 v5 = a2; | |
1960 v6 = a2->pMonsterInfo.uAC; | |
1961 v7 = 0; | |
1962 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0; | |
1963 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0; | |
1964 a2a = 0; | |
1965 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) ) | |
1966 v6 /= 2; | |
1967 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 ) | |
1968 v7 = v5->pActorBuffs[14].uPower; | |
1969 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 ) | |
1970 v7 = v5->pActorBuffs[16].uPower; | |
1971 v10 = v7 + v6; | |
1972 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1973 a2a = pActor->pActorBuffs[14].uPower; | |
1974 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a ) | |
1975 a2a = pActor->pActorBuffs[17].uPower; | |
1976 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1977 { | |
1978 a2a += pActor->pActorBuffs[11].uPower; | |
1979 pActor->pActorBuffs[11].Reset(); | |
1980 } | |
1981 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
1982 } | |
1983 | |
1984 //----- (004274AD) -------------------------------------------------------- | |
1985 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
1986 { | |
1987 signed int v3; // edi@1 | |
1988 signed int v4; // esi@8 | |
1989 int v5; // esi@8 | |
1990 | |
1991 v3 = 0; | |
1992 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
1993 v3 = pActor->pActorBuffs[14].uPower; | |
1994 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 ) | |
1995 v3 = pActor->pActorBuffs[17].uPower; | |
1996 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 ) | |
1997 { | |
1998 v3 += pActor->pActorBuffs[11].uPower; | |
1999 pActor->pActorBuffs[11].Reset(); | |
2000 } | |
2001 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
2002 v5 = rand() % v4 + 1; | |
2003 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
2004 } | |
2005 | |
2006 //----- (00427546) -------------------------------------------------------- | |
2007 int stru319::_427546(int a2) | |
2008 { | |
2009 int result; // eax@2 | |
2010 | |
2011 if ( a2 >= 0 ) | |
2012 { | |
2013 if ( a2 >= 1 ) | |
2014 result = (a2 >= 2) + 2; | |
2015 else | |
2016 result = 1; | |
2017 } | |
2018 else | |
2019 { | |
2020 result = 0; | |
2021 } | |
2022 return result; | |
2023 } | |
2024 | |
2025 //----- (0042756B) -------------------------------------------------------- | |
2026 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
2027 { | |
2028 int v4; // edx@1 | |
2029 int v5; // ecx@1 | |
2030 signed int v6; // eax@4 | |
2031 signed int result; // eax@17 | |
2032 signed int v8; // esi@18 | |
2033 | |
2034 v4 = 0; | |
2035 v5 = 0; | |
2036 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 ) | |
2037 v5 = pActor->pActorBuffs[14].uPower; | |
2038 switch ( a2 ) | |
2039 { | |
2040 case 4: | |
2041 v6 = pActor->pMonsterInfo.uResPhysical; | |
2042 break; | |
2043 case 0: | |
2044 v6 = pActor->pMonsterInfo.uResFire; | |
2045 goto LABEL_12; | |
2046 case 1: | |
2047 v6 = pActor->pMonsterInfo.uResAir; | |
2048 goto LABEL_12; | |
2049 case 2: | |
2050 v6 = pActor->pMonsterInfo.uResWater; | |
2051 goto LABEL_12; | |
2052 case 3: | |
2053 v6 = pActor->pMonsterInfo.uResEarth; | |
2054 goto LABEL_12; | |
2055 case 6: | |
2056 v6 = pActor->pMonsterInfo.uResSpirit; | |
2057 break; | |
2058 case 7: | |
2059 v6 = pActor->pMonsterInfo.uResMind; | |
2060 goto LABEL_12; | |
2061 case 8: | |
2062 v6 = pActor->pMonsterInfo.uResBody; | |
2063 LABEL_12: | |
2064 v4 = v5; | |
2065 break; | |
2066 case 9: | |
2067 v6 = pActor->pMonsterInfo.uResLight; | |
2068 break; | |
2069 case 10: | |
2070 v6 = pActor->pMonsterInfo.uResDark; | |
2071 break; | |
2072 default: | |
2073 v6 = 0; | |
2074 break; | |
2075 } | |
2076 if ( v6 < 200 ) | |
2077 { | |
2078 v8 = v4 + v6 + 30; | |
2079 if ( rand() % v8 >= 30 ) | |
2080 { | |
2081 a3 >>= 1; | |
2082 if ( rand() % v8 >= 30 ) | |
2083 { | |
2084 a3 >>= 1; | |
2085 if ( rand() % v8 >= 30 ) | |
2086 { | |
2087 a3 >>= 1; | |
2088 if ( rand() % v8 >= 30 ) | |
2089 a3 >>= 1; | |
2090 } | |
2091 } | |
2092 } | |
2093 result = a3; | |
2094 } | |
2095 else | |
2096 { | |
2097 result = 0; | |
2098 } | |
2099 return result; | |
2100 } | |
2101 | |
2102 //----- (00427662) -------------------------------------------------------- | |
2103 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
2104 { | |
2105 Actor *v3; // edi@2 | |
2106 signed int v4; // esi@2 | |
2107 bool result; // eax@13 | |
2108 | |
2109 switch ( uType ) | |
2110 { | |
2111 case 0u: | |
2112 v3 = pActor; | |
2113 v4 = pActor->pMonsterInfo.uResFire; | |
2114 goto LABEL_12; | |
2115 case 1u: | |
2116 v3 = pActor; | |
2117 v4 = pActor->pMonsterInfo.uResAir; | |
2118 goto LABEL_12; | |
2119 case 2u: | |
2120 v3 = pActor; | |
2121 v4 = pActor->pMonsterInfo.uResWater; | |
2122 goto LABEL_12; | |
2123 case 3u: | |
2124 v3 = pActor; | |
2125 v4 = pActor->pMonsterInfo.uResEarth; | |
2126 goto LABEL_12; | |
2127 case 7u: | |
2128 v3 = pActor; | |
2129 v4 = pActor->pMonsterInfo.uResMind; | |
2130 goto LABEL_12; | |
2131 case 6u: | |
2132 v3 = pActor; | |
2133 v4 = pActor->pMonsterInfo.uResSpirit; | |
2134 goto LABEL_12; | |
2135 case 8u: | |
2136 v3 = pActor; | |
2137 v4 = pActor->pMonsterInfo.uResBody; | |
2138 goto LABEL_12; | |
2139 case 9u: | |
2140 v3 = pActor; | |
2141 v4 = pActor->pMonsterInfo.uResLight; | |
2142 goto LABEL_12; | |
2143 case 0xAu: | |
2144 v3 = pActor; | |
2145 v4 = pActor->pMonsterInfo.uResDark; | |
2146 goto LABEL_12; | |
2147 case 4u: | |
2148 v3 = pActor; | |
2149 v4 = pActor->pMonsterInfo.uResPhysical; | |
2150 LABEL_12: | |
2151 if ( v4 < 200 ) | |
2152 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30; | |
2153 else | |
2154 result = 0; | |
2155 break; | |
2156 default: | |
2157 result = 1; | |
2158 break; | |
2159 } | |
2160 return result; | |
2161 } | |
2162 | |
2163 | |
2164 //----- (00427769) -------------------------------------------------------- | |
2165 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
2166 { | |
2167 bool result; // eax@2 | |
2168 | |
710 | 2169 __debugbreak(); // refactor |
0 | 2170 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) |
2171 result = 1; | |
2172 else | |
2173 result = 0; | |
2174 return result; | |
2175 } | |
2176 | |
2177 //----- (0042777D) -------------------------------------------------------- | |
319 | 2178 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) |
0 | 2179 { |
370 | 2180 //bool result; // eax@2 |
486 | 2181 //__int16 v6; // bx@4 |
437 | 2182 //Player *v7; // eax@4 |
486 | 2183 //char v8; // zf@12 |
0 | 2184 unsigned __int16 v9; // cx@16 |
2185 unsigned int v10; // eax@18 | |
2186 unsigned __int8 v11; // sf@18 | |
2187 unsigned __int8 v12; // of@18 | |
2188 unsigned __int16 v13; // cx@21 | |
2189 unsigned int v14; // eax@23 | |
486 | 2190 //stru277 *v15; // esi@27 |
2191 //stru277 *v16; // eax@28 | |
0 | 2192 GUIWindow *v17; // eax@43 |
2193 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | |
2194 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | |
2195 unsigned int v20; // [sp-28h] [bp-40h]@44 | |
2196 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | |
2197 unsigned int v22; // [sp-20h] [bp-38h]@44 | |
2198 int v23; // [sp-1Ch] [bp-34h]@44 | |
2199 int v24; // [sp-18h] [bp-30h]@44 | |
2200 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | |
2201 unsigned int v26; // [sp-10h] [bp-28h]@43 | |
2202 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | |
2203 char *v28; // [sp-8h] [bp-20h]@43 | |
2204 Texture *v29; // [sp-4h] [bp-1Ch]@43 | |
486 | 2205 //__int16 a3a; // [sp+10h] [bp-8h]@1 |
2206 //__int16 a2a; // [sp+14h] [bp-4h]@1 | |
2207 | |
2208 //a3a = uPlayerID; | |
2209 //a2a = a1; | |
370 | 2210 |
2211 //if ( pParty->bTurnBasedModeOn != 1 | |
2212 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | |
2213 if (pParty->bTurnBasedModeOn) | |
0 | 2214 { |
370 | 2215 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) |
2216 return; | |
2217 } | |
2218 | |
2219 | |
486 | 2220 //v6 = a5; |
437 | 2221 //v7 = &pParty->pPlayers[uPlayerID]; |
2222 assert(uPlayerID < 4); | |
2223 auto player = &pParty->pPlayers[uPlayerID]; | |
0 | 2224 if ( !(a5 & 0x10) ) |
2225 { | |
2226 switch ( a1 ) | |
2227 { | |
486 | 2228 case SPELL_SPIRIT_FATE: |
2229 case SPELL_BODY_FIRST_AID: | |
2230 case SPELL_DARK_REANIMATE: | |
2231 //HIBYTE(v6) = HIBYTE(a5) | 1; | |
2232 a5 |= 0x0100; | |
0 | 2233 break; |
486 | 2234 |
2235 case SPELL_FIRE_FIRE_AURA: | |
2236 case SPELL_WATER_RECHARGE_ITEM: | |
2237 case SPELL_WATER_ENCHANT_ITEM: | |
2238 case SPELL_DARK_VAMPIRIC_WEAPON: | |
2239 //LOBYTE(v6) = a5 | 0x80; | |
2240 a5 |= 0x0080; | |
0 | 2241 break; |
486 | 2242 |
2243 case SPELL_FIRE_FIRE_BOLT: | |
2244 case SPELL_FIRE_FIREBALL: | |
2245 case SPELL_FIRE_INCINERATE: | |
2246 case SPELL_AIR_LIGHNING_BOLT: | |
2247 case SPELL_AIR_IMPLOSION: | |
2248 case SPELL_WATER_POISON_SPRAY: | |
2249 case SPELL_WATER_ICE_BOLT: | |
2250 case SPELL_WATER_ACID_BURST: | |
2251 case SPELL_WATER_ICE_BLAST: | |
2252 case SPELL_EARTH_STUN: | |
2253 case SPELL_EARTH_SLOW: | |
2254 case SPELL_EARTH_DEADLY_SWARM: | |
2255 case SPELL_EARTH_BLADES: | |
2256 case SPELL_EARTH_MASS_DISTORTION: | |
2257 case SPELL_SPIRIT_SPIRIT_LASH: | |
2258 case SPELL_MIND_MIND_BLAST: | |
2259 case SPELL_MIND_CHARM: | |
2260 case SPELL_MIND_PSYCHIC_SHOCK: | |
2261 case SPELL_BODY_HARM: | |
2262 case SPELL_BODY_FLYING_FIST: | |
2263 case SPELL_LIGHT_LIGHT_BOLT: | |
2264 case SPELL_LIGHT_DESTROY_UNDEAD: | |
2265 case SPELL_LIGHT_SUNRAY: | |
2266 case SPELL_DARK_TOXIC_CLOUD: | |
2267 case SPELL_DARK_SHRINKING_RAY: | |
2268 case SPELL_DARK_SHARPMETAL: | |
2269 case SPELL_DARK_DRAGON_BREATH: | |
0 | 2270 if ( !a6 ) |
486 | 2271 a5 |= 0x0008; |
0 | 2272 break; |
486 | 2273 case SPELL_MIND_TELEPATHY: |
2274 case SPELL_MIND_BERSERK: | |
2275 case SPELL_MIND_ENSLAVE: | |
2276 case SPELL_LIGHT_PARALYZE: | |
2277 case SPELL_DARK_CONTROL_UNDEAD: | |
2278 //LABEL_9: | |
2279 //v6 = a5 | 8; | |
2280 a5 |= 0x0008; | |
0 | 2281 break; |
486 | 2282 |
2283 case SPELL_EARTH_TELEKINESIS: | |
2284 a5 |= 0x0040; | |
2285 break; | |
2286 | |
2287 case SPELL_SPIRIT_BLESS: | |
2288 if (a4 && ~a4 & 0x01C0) | |
2289 goto LABEL_25; | |
2290 else if ((player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0); | |
0 | 2291 goto LABEL_25; |
2292 break; | |
486 | 2293 |
2294 case SPELL_SPIRIT_PRESERVATION: | |
0 | 2295 v9 = a4; |
2296 if ( !a4 ) | |
437 | 2297 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT]; |
0 | 2298 goto LABEL_18; |
486 | 2299 |
2300 case SPELL_DARK_PAIN_REFLECTION: | |
0 | 2301 v9 = a4; |
2302 if ( !a4 ) | |
437 | 2303 v9 = player->pActiveSkills[PLAYER_SKILL_DARK]; |
0 | 2304 LABEL_18: |
2305 v10 = SkillToMastery(v9); | |
2306 v12 = __OFSUB__(v10, 3); | |
2307 v11 = ((v10 - 3) & 0x80000000u) != 0; | |
2308 goto LABEL_24; | |
486 | 2309 |
2310 case SPELL_BODY_HAMMERHANDS: | |
0 | 2311 v13 = a4; |
2312 if ( !a4 ) | |
437 | 2313 v13 = player->pActiveSkills[PLAYER_SKILL_BODY]; |
0 | 2314 v14 = SkillToMastery(v13); |
2315 v12 = __OFSUB__(v14, 4); | |
2316 v11 = ((v14 - 4) & 0x80000000u) != 0; | |
2317 LABEL_24: | |
2318 if ( v11 ^ v12 ) | |
2319 goto LABEL_25; | |
2320 break; | |
486 | 2321 |
2322 case SPELL_EARTH_STONE_TO_FLESH: | |
2323 case SPELL_SPIRIT_REMOVE_CURSE: | |
2324 case SPELL_SPIRIT_RAISE_DEAD: | |
2325 case SPELL_SPIRIT_RESSURECTION: | |
2326 case SPELL_MIND_REMOVE_FEAR: | |
2327 case SPELL_MIND_CURE_PARALYSIS: | |
2328 case SPELL_MIND_CURE_INSANITY: | |
2329 case SPELL_BODY_CURE_WEAKNESS: | |
2330 case SPELL_BODY_REGENERATION: | |
2331 case SPELL_BODY_CURE_POISON: | |
2332 case SPELL_BODY_CURE_DISEASE: | |
0 | 2333 LABEL_25: |
486 | 2334 //v6 = a5 | 2; |
2335 a5 |= 0x0002; | |
0 | 2336 break; |
486 | 2337 |
2338 case SPELL_DARK_SACRIFICE: | |
2339 //HIBYTE(v6) = HIBYTE(a5) | 2; | |
2340 a5 |= 0x0200; | |
0 | 2341 break; |
2342 default: | |
2343 break; | |
2344 } | |
2345 } | |
370 | 2346 |
486 | 2347 |
2348 if (a5 & 0x3CA) | |
0 | 2349 { |
486 | 2350 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); |
2351 for (uint i = 0; i < 10; ++i) | |
2352 if (pStru277[i].field_8 & 0x3CA) | |
2353 { | |
2354 pStru277[i].spellnum = 0; | |
2355 break; | |
2356 } | |
0 | 2357 } |
486 | 2358 |
2359 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); | |
2360 for (uint i = 0; i < 10; ++i) | |
0 | 2361 { |
486 | 2362 auto spell = pStru277 + i; |
2363 if (!spell->spellnum) | |
2364 continue; | |
2365 | |
2366 spell->spellnum = 0; | |
2367 if (spell->field_8 & 0x3CA) | |
0 | 2368 { |
486 | 2369 pGUIWindow_Settings->Release(); |
2370 pGUIWindow_Settings = nullptr; | |
2371 pMouse->SetCursorBitmap("MICON1"); | |
2372 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2373 unk_50C9A0 = 0; | |
2374 back_to_game(); | |
0 | 2375 } |
2376 } | |
486 | 2377 |
2378 int result = pStru277->PushStru277(a1, uPlayerID, a4, a5, a6); | |
0 | 2379 if ( result != -1 ) |
2380 { | |
486 | 2381 if ( a5 & 2 ) |
0 | 2382 { |
2383 if ( pGUIWindow_Settings ) | |
319 | 2384 return; |
0 | 2385 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2386 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | |
2387 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | |
2388 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | |
2389 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | |
319 | 2390 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2391 return; | |
0 | 2392 } |
486 | 2393 if ( a5 & 8 ) |
0 | 2394 { |
2395 if ( pGUIWindow_Settings ) | |
319 | 2396 return; |
0 | 2397 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2398 v29 = 0; | |
2399 v28 = ""; | |
2400 v27 = 0; | |
2401 v26 = 0; | |
2402 v25 = 70; | |
2403 LABEL_44: | |
2404 v24 = 0; | |
2405 v23 = 1; | |
2406 v22 = 344; | |
2407 v21 = 460; | |
2408 v20 = 8; | |
2409 v19 = 8; | |
2410 pGUIWindow_Settings = v17; | |
2411 v18 = v17; | |
2412 LABEL_56: | |
2413 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
319 | 2414 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2415 return; | |
0 | 2416 } |
486 | 2417 if ( a5 & 0x40 ) |
0 | 2418 { |
2419 if ( pGUIWindow_Settings ) | |
319 | 2420 return; |
0 | 2421 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2422 v29 = 0; | |
2423 v28 = ""; | |
2424 v27 = 0; | |
2425 v26 = 0; | |
2426 v25 = 190; | |
2427 goto LABEL_44; | |
2428 } | |
486 | 2429 if ( (char)a5 < 0 ) |
0 | 2430 { |
2431 if ( pGUIWindow_Settings ) | |
319 | 2432 return; |
0 | 2433 ++pIcons_LOD->uTexturePacksCount; |
2434 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2435 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2436 pGUIWindow_Settings = pStru277[result].sub_4219BE(); | |
2437 unk_50C9A0 = 1; | |
2438 some_active_character = uActiveCharacter; | |
319 | 2439 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2440 return; | |
0 | 2441 } |
486 | 2442 if ( HIBYTE(a5) & 1 ) |
0 | 2443 { |
2444 if ( pGUIWindow_Settings ) | |
319 | 2445 return; |
2446 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | |
0 | 2447 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); |
2448 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | |
2449 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | |
2450 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | |
423 | 2451 pGUIWindow_Settings->CreateButton(8, 8, 460, 344, 1, 0, 140, 0, 0, "", NULL); |
2452 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
0 | 2453 } |
486 | 2454 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) |
0 | 2455 { |
319 | 2456 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
0 | 2457 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( |
2458 0x1D5u, | |
2459 0xB2u, | |
319 | 2460 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), |
2461 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
0 | 2462 1, |
2463 0, | |
2464 0xBCu, | |
2465 0, | |
2466 0, | |
2467 "", | |
319 | 2468 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), |
0 | 2469 0); |
2470 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | |
2471 0x272u, | |
2472 0xB2u, | |
319 | 2473 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), |
2474 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
0 | 2475 1, |
2476 0, | |
2477 0xBCu, | |
2478 1u, | |
2479 0, | |
2480 "", | |
319 | 2481 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), |
0 | 2482 0); |
2483 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | |
319 | 2484 pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0); |
0 | 2485 } |
2486 } | |
2487 } | |
2488 | |
2489 | |
2490 | |
2491 //----- (00427D48) -------------------------------------------------------- | |
2492 void stru277::_427D48(unsigned int uPlayerID) | |
2493 { | |
2494 stru277 *v2; // esi@1 | |
2495 signed int v3; // ebx@1 | |
2496 | |
2497 v2 = this; | |
2498 v3 = 10; | |
2499 do | |
2500 { | |
2501 if ( v2->spellnum ) | |
2502 { | |
2503 if ( v2->field_8 & 0x3CA ) | |
2504 { | |
2505 v2->spellnum = 0; | |
2506 pGUIWindow_Settings->Release(); | |
2507 pGUIWindow_Settings = 0; | |
2508 pMouse->SetCursorBitmap("MICON1"); | |
2509 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2510 unk_50C9A0 = 0; | |
2511 back_to_game(); | |
2512 } | |
2513 } | |
2514 ++v2; | |
2515 --v3; | |
2516 } | |
2517 while ( v3 ); | |
2518 } | |
2519 | |
2520 //----- (00427DA0) -------------------------------------------------------- | |
488 | 2521 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int a6) |
0 | 2522 { |
2523 unsigned int result; // eax@1 | |
2524 stru277 *v7; // edx@1 | |
2525 stru277 *v8; // ecx@5 | |
2526 | |
2527 result = 0; | |
2528 v7 = this; | |
2529 while ( v7->spellnum ) | |
2530 { | |
2531 ++result; | |
2532 ++v7; | |
2533 if ( (signed int)result >= 10 ) | |
2534 goto LABEL_8; | |
2535 } | |
2536 v8 = &this[result]; | |
2537 v8->spellnum = a2; | |
2538 v8->uPlayerID = uPlayerID; | |
2539 if ( a5 & 0x10 ) | |
2540 v8->uPlayerID_2 = uPlayerID; | |
2541 v8->field_6 = 0; | |
488 | 2542 v8->spell_target_pid = 0; |
0 | 2543 v8->field_8 = a5; |
488 | 2544 v8->forced_spell_skill_level = skill_level; |
0 | 2545 v8->field_10 = a6; |
2546 LABEL_8: | |
2547 if ( result == 10 ) | |
2548 result = -1; | |
2549 return result; | |
2550 } | |
2551 | |
2552 //----- (00427E01) -------------------------------------------------------- | |
2553 void stru277::_427E01_cast_spell() | |
2554 { | |
486 | 2555 //int v1; // esi@1 |
0 | 2556 int v2; // edi@1 |
2557 stru277 *v3; // ebx@2 | |
488 | 2558 //signed int v4; // eax@8 |
2559 //__int16 v5; // ax@9 | |
0 | 2560 signed int v6; // eax@14 |
488 | 2561 //__int16 v7; // ax@23 |
2562 //__int16 v8; // ax@24 | |
2563 //char v9; // al@44 | |
2564 //int v10; // eax@45 | |
0 | 2565 unsigned __int16 v11; // cx@45 |
2566 signed int v12; // ecx@48 | |
490 | 2567 //int v13; // eax@53 |
0 | 2568 unsigned __int8 v14; // zf@53 |
488 | 2569 //unsigned int v15; // edx@53 |
2570 //signed int v16; // eax@53 | |
0 | 2571 Player *v17; // esi@70 |
2572 int v18; // eax@72 | |
2573 int v19; // eax@74 | |
2574 char *v20; // eax@74 | |
2575 signed int i; // esi@76 | |
2576 int v22; // eax@88 | |
2577 __int16 v23; // ax@88 | |
488 | 2578 //int v24; // ecx@93 |
2579 //int v25; // ecx@94 | |
2580 //signed __int64 v26; // qax@100 | |
2581 //char *v27; // ecx@100 | |
2582 //unsigned __int64 v28; // qax@102 | |
0 | 2583 int v29; // ecx@105 |
2584 int v30; // ecx@106 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
2585 //int v31; // eax@112 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
2586 //int v32; // eax@112 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
2587 //char *v33; // edx@113 |
0 | 2588 int v34; // eax@121 |
2589 int v35; // eax@123 | |
2590 int v36; // edx@125 | |
2591 int v37; // eax@129 | |
2592 signed int v38; // edi@129 | |
2593 signed int v39; // eax@129 | |
2594 int v40; // ecx@129 | |
2595 int v41; // eax@129 | |
2596 signed int v42; // eax@129 | |
2597 int *v43; // ecx@129 | |
2598 int v44; // eax@132 | |
2599 int v45; // ecx@132 | |
2600 int v46; // eax@132 | |
2601 unsigned int v47; // edx@133 | |
2602 int v48; // eax@137 | |
2603 int v49; // eax@137 | |
2604 int v50; // eax@141 | |
2605 int v51; // eax@146 | |
2606 __int16 v52; // ax@153 | |
2607 int v53; // eax@153 | |
2608 signed __int64 v54; // qax@164 | |
2609 int v55; // edi@164 | |
488 | 2610 //stru6 *v56; // eax@165 |
0 | 2611 int v57; // eax@169 |
2612 signed __int64 v58; // qax@177 | |
2613 int v59; // edi@177 | |
2614 unsigned __int16 v60; // ax@184 | |
2615 int v61; // ecx@184 | |
2616 int v62; // eax@186 | |
2617 int v63; // ecx@187 | |
2618 int v64; // ecx@188 | |
2619 int v65; // ecx@189 | |
710 | 2620 //const char *v66; // ecx@200 |
2621 //unsigned int v67; // edx@201 | |
0 | 2622 char v68; // al@207 |
89 | 2623 ItemGen *v69; // esi@211 |
0 | 2624 int v70; // ecx@214 |
2625 int v71; // ecx@215 | |
2626 int v72; // ecx@216 | |
488 | 2627 //__int16 v73; // ST1C_2@222 |
2628 //__int16 v74; // ST18_2@222 | |
2629 //stru6 *v75; // eax@222 | |
0 | 2630 int v76; // ecx@223 |
2631 int v77; // ecx@224 | |
2632 int v78; // ecx@225 | |
2633 int v79; // eax@227 | |
488 | 2634 //int v80; // eax@232 |
2635 //__int16 v81; // ST18_2@245 | |
2636 //stru6 *v82; // eax@245 | |
0 | 2637 signed int v83; // edi@245 |
488 | 2638 //__int16 v84; // ST18_2@245 |
2639 //stru6 *v85; // eax@245 | |
2640 //__int16 v86; // ST18_2@245 | |
2641 //stru6 *v87; // eax@245 | |
2642 //__int16 v88; // ST18_2@245 | |
2643 //stru6 *v89; // eax@245 | |
0 | 2644 double v90; // st7@245 |
2645 int v91; // eax@250 | |
89 | 2646 Player *v92; // eax@255 |
488 | 2647 //__int16 v93; // ST18_2@260 |
2648 //stru6 *v94; // eax@260 | |
2649 //__int16 v95; // ST18_2@260 | |
2650 //stru6 *v96; // eax@260 | |
2651 //__int16 v97; // ST18_2@260 | |
2652 //stru6 *v98; // eax@260 | |
2653 //__int16 v99; // ST18_2@260 | |
2654 //stru6 *v100; // eax@260 | |
0 | 2655 int v101; // ecx@261 |
2656 int v102; // ecx@262 | |
2657 int v103; // ecx@263 | |
2658 int v104; // eax@265 | |
2659 int v105; // edi@271 | |
488 | 2660 //__int16 v106; // ST18_2@272 |
2661 //stru6 *v107; // eax@272 | |
0 | 2662 __int16 v108; // ST1C_2@274 |
2663 __int16 v109; // ST18_2@274 | |
2664 stru6 *v110; // eax@274 | |
2665 int v111; // eax@274 | |
2666 Actor *v112; // esi@278 | |
2667 int v113; // eax@278 | |
2668 int v114; // ebx@278 | |
2669 unsigned int v115; // ecx@278 | |
2670 int v116; // edx@279 | |
2671 int v117; // edx@281 | |
2672 int v118; // edx@283 | |
2673 int v119; // edi@286 | |
2674 int v120; // eax@286 | |
2675 int v121; // eax@286 | |
2676 signed int v122; // eax@286 | |
2677 int v123; // ecx@288 | |
2678 int v124; // ecx@289 | |
2679 int v125; // ecx@290 | |
2680 int v126; // eax@292 | |
2681 int v127; // eax@296 | |
488 | 2682 //__int16 v128; // ST18_2@303 |
2683 //stru6 *v129; // eax@303 | |
2684 //__int16 v130; // ST18_2@303 | |
2685 //stru6 *v131; // eax@303 | |
2686 //__int16 v132; // ST18_2@303 | |
2687 //stru6 *v133; // eax@303 | |
2688 //__int16 v134; // ST18_2@303 | |
2689 //stru6 *v135; // eax@303 | |
2690 //unsigned __int64 v136; // qax@304 | |
2691 //char *v137; // ecx@304 | |
0 | 2692 int v138; // ecx@305 |
2693 int v139; // ecx@306 | |
2694 int v140; // eax@308 | |
488 | 2695 //__int16 v141; // ST18_2@311 |
2696 //stru6 *v142; // eax@311 | |
2697 //__int16 v143; // ST18_2@311 | |
2698 //stru6 *v144; // eax@311 | |
2699 //__int16 v145; // ST18_2@311 | |
2700 //stru6 *v146; // eax@311 | |
2701 //__int16 v147; // ST18_2@311 | |
2702 //stru6 *v148; // eax@311 | |
0 | 2703 int v149; // ecx@312 |
2704 int v150; // ecx@313 | |
2705 int v151; // ecx@314 | |
2706 signed int v152; // eax@322 | |
2707 int v153; // ecx@322 | |
2708 int v154; // eax@322 | |
2709 int v155; // eax@323 | |
2710 int v156; // eax@323 | |
2711 int v157; // eax@326 | |
2712 double v158; // st7@326 | |
2713 double v159; // st6@326 | |
2714 signed __int64 v160; // qtt@334 | |
2715 int v161; // eax@339 | |
2716 int v162; // edi@340 | |
2717 int v163; // eax@340 | |
2718 signed int v164; // eax@340 | |
2719 signed int v165; // edi@340 | |
488 | 2720 //stru6 *v166; // eax@340 |
2721 //stru6 *v167; // eax@340 | |
0 | 2722 signed int v168; // edi@343 |
2723 int v169; // eax@344 | |
2724 int v170; // ecx@346 | |
2725 int v171; // ecx@347 | |
2726 int v172; // ecx@348 | |
2727 int v173; // edi@350 | |
2728 signed int v174; // edi@355 | |
488 | 2729 //__int16 v175; // ST18_2@357 |
2730 //stru6 *v176; // eax@357 | |
2731 //__int16 v177; // ST18_2@357 | |
2732 //stru6 *v178; // eax@357 | |
2733 //__int16 v179; // ST18_2@357 | |
2734 //stru6 *v180; // eax@357 | |
2735 //__int16 v181; // ST18_2@357 | |
2736 //stru6 *v182; // eax@357 | |
2737 //signed __int64 v183; // qax@357 | |
0 | 2738 int v184; // ecx@358 |
2739 int v185; // ecx@359 | |
2740 int v186; // ecx@360 | |
2741 int v187; // eax@367 | |
2742 int v188; // esi@369 | |
2743 int v189; // edi@369 | |
710 | 2744 //const char *v190; // ecx@377 |
0 | 2745 signed int v191; // edi@379 |
2746 int v192; // ecx@382 | |
2747 int v193; // ecx@383 | |
2748 int v194; // ecx@384 | |
2749 int v195; // eax@386 | |
2750 int v196; // eax@387 | |
488 | 2751 //__int16 v197; // ST18_2@395 |
2752 //stru6 *v198; // eax@395 | |
2753 //__int16 v199; // ST18_2@395 | |
2754 //stru6 *v200; // eax@395 | |
2755 //__int16 v201; // ST18_2@395 | |
2756 //stru6 *v202; // eax@395 | |
2757 //__int16 v203; // ST18_2@395 | |
2758 //stru6 *v204; // eax@395 | |
0 | 2759 signed int v205; // edi@405 |
2760 int v206; // eax@407 | |
2761 __int16 v207; // cx@407 | |
2762 int v208; // eax@411 | |
2763 signed int v209; // ecx@412 | |
2764 int v210; // edx@412 | |
2765 signed int v211; // ecx@412 | |
2766 int v212; // eax@413 | |
2767 int v213; // eax@413 | |
2768 int v214; // eax@413 | |
2769 int v215; // eax@415 | |
2770 double v216; // st7@415 | |
2771 double v217; // st6@415 | |
2772 signed __int64 v218; // qtt@423 | |
2773 int v219; // ecx@425 | |
2774 int v220; // ecx@426 | |
2775 int v221; // edi@428 | |
2776 char *v222; // edi@434 | |
2777 char v223; // al@438 | |
2778 int v224; // ecx@442 | |
2779 int v225; // ecx@443 | |
2780 int v226; // eax@451 | |
2781 int v227; // esi@453 | |
2782 unsigned int v228; // edi@454 | |
2783 int v229; // edi@466 | |
488 | 2784 //__int16 v230; // ST18_2@469 |
2785 //stru6 *v231; // eax@469 | |
2786 //signed int v232; // esi@469 | |
2787 //__int16 v233; // ST18_2@469 | |
2788 //stru6 *v234; // eax@469 | |
2789 //__int16 v235; // ST18_2@469 | |
2790 //stru6 *v236; // eax@469 | |
2791 //__int16 v237; // ST18_2@469 | |
2792 //stru6 *v238; // eax@469 | |
0 | 2793 __int16 v239; // ST1C_2@469 |
2794 char *v240; // ecx@472 | |
2795 double v241; // st7@478 | |
2796 signed __int64 v242; // qax@484 | |
2797 char *v243; // ecx@484 | |
2798 char *v244; // eax@488 | |
2799 int v245; // edi@492 | |
2800 int v246; // eax@492 | |
2801 char *v247; // eax@497 | |
2802 char v248; // al@497 | |
2803 char v249; // cf@500 | |
2804 float v250; // esi@507 | |
2805 char v251; // al@507 | |
2806 int v252; // edx@510 | |
2807 int m; // esi@510 | |
2808 int v254; // eax@513 | |
2809 int v255; // esi@513 | |
2810 int v256; // ecx@513 | |
2811 int v257; // edx@514 | |
2812 int v258; // ecx@514 | |
2813 char v259; // al@516 | |
2814 int v260; // eax@518 | |
2815 int v261; // esi@519 | |
2816 int v262; // edx@521 | |
2817 int v263; // ecx@521 | |
2818 int v264; // esi@521 | |
2819 int v265; // edx@521 | |
2820 int *ii; // eax@522 | |
2821 int v267; // eax@524 | |
2822 int v268; // eax@524 | |
2823 int v269; // eax@526 | |
2824 char *v270; // eax@531 | |
2825 char v271; // al@531 | |
2826 char v272; // cf@534 | |
2827 float v273; // esi@541 | |
2828 char v274; // al@541 | |
2829 int v275; // edx@544 | |
2830 int k; // esi@544 | |
2831 int v277; // edx@548 | |
2832 int v278; // ecx@548 | |
2833 char v279; // al@550 | |
2834 int v280; // eax@552 | |
2835 int v281; // esi@553 | |
2836 int v282; // edx@555 | |
2837 int v283; // ecx@555 | |
2838 int v284; // esi@555 | |
2839 int v285; // edx@555 | |
2840 int *l; // eax@556 | |
2841 int v287; // eax@558 | |
2842 int v288; // eax@558 | |
2843 ItemGen *v289; // eax@560 | |
2844 signed int v290; // eax@560 | |
2845 unsigned __int8 v291; // al@564 | |
2846 char v292; // al@573 | |
2847 int v293; // eax@575 | |
2848 ItemGen *v294; // esi@575 | |
2849 int v295; // edx@575 | |
2850 int kk; // edi@575 | |
2851 int v297; // edx@579 | |
2852 int v298; // ecx@579 | |
2853 char v299; // al@581 | |
2854 int v300; // eax@583 | |
2855 int v301; // edi@584 | |
2856 int v302; // edx@586 | |
2857 int v303; // ecx@586 | |
2858 int v304; // edi@586 | |
2859 int v305; // edx@586 | |
2860 int *jj; // eax@587 | |
2861 int v307; // eax@589 | |
2862 int v308; // eax@589 | |
2863 char *v309; // ecx@593 | |
2864 char v310; // sf@593 | |
2865 unsigned __int8 v311; // of@593 | |
2866 char v312; // cl@597 | |
488 | 2867 char v313; // al@606pGame->GetStru6() |
0 | 2868 int v314; // edx@607 |
2869 int j; // esi@607 | |
2870 unsigned int v316; // eax@613 | |
2871 const char *v317; // ecx@617 | |
2872 Player *v318; // ecx@619 | |
2873 unsigned int v319; // edi@627 | |
2874 int v320; // ecx@629 | |
2875 int v321; // ecx@630 | |
2876 int v322; // edi@632 | |
2877 int v323; // edi@635 | |
2878 char *v324; // eax@635 | |
2879 Player *v325; // ecx@640 | |
2880 int v326; // eax@643 | |
2881 int v327; // eax@648 | |
2882 int v328; // ecx@651 | |
2883 int v329; // ecx@652 | |
2884 int v330; // edi@654 | |
488 | 2885 //__int16 v331; // ST18_2@658 |
2886 //stru6 *v332; // eax@658 | |
2887 //__int16 v333; // ST18_2@658 | |
2888 //stru6 *v334; // eax@658 | |
2889 //__int16 v335; // ST18_2@658 | |
2890 //stru6 *v336; // eax@658 | |
2891 //__int16 v337; // ST18_2@658 | |
2892 //stru6 *v338; // eax@658 | |
0 | 2893 int v339; // ecx@659 |
2894 int v340; // ecx@660 | |
2895 int v341; // eax@663 | |
2896 signed int v342; // edi@668 | |
2897 signed int v343; // edi@670 | |
2898 unsigned __int64 v344; // ST08_8@670 | |
488 | 2899 //__int16 v345; // ST1C_2@671 |
2900 //__int16 v346; // ST18_2@671 | |
2901 //stru6 *v347; // eax@671 | |
0 | 2902 int v348; // ecx@672 |
2903 int v349; // ecx@673 | |
2904 int v350; // edi@676 | |
2905 Player *v351; // edi@680 | |
488 | 2906 //__int16 v352; // ST18_2@685 |
2907 //stru6 *v353; // eax@685 | |
0 | 2908 int v354; // ecx@686 |
2909 int v355; // ecx@687 | |
2910 int v356; // eax@689 | |
112 | 2911 Player *v357; // edi@694 |
488 | 2912 //unsigned __int16 v358; // ST1C_2@695 |
2913 //__int16 v359; // ST18_2@695 | |
2914 //stru6 *v360; // eax@695 | |
2915 //__int16 v361; // ST1C_2@697 | |
2916 //__int16 v362; // ST18_2@697 | |
2917 //stru6 *v363; // eax@697 | |
0 | 2918 int v364; // ecx@698 |
2919 int v365; // ecx@699 | |
2920 int v366; // eax@701 | |
488 | 2921 //stru6 *v367; // eax@704 |
0 | 2922 int v368; // eax@704 |
2923 Actor *v369; // edi@705 | |
2924 int v370; // eax@706 | |
2925 int v371; // ecx@709 | |
2926 int v372; // ecx@710 | |
2927 int v373; // eax@715 | |
2928 int v374; // eax@717 | |
112 | 2929 Player *v375; // edi@717 |
0 | 2930 int v376; // eax@717 |
2931 Player *v377; // ecx@719 | |
2932 int v378; // ecx@721 | |
2933 int v379; // ecx@722 | |
2934 int v380; // eax@724 | |
2935 int v381; // edi@727 | |
2936 int v382; // ecx@727 | |
2937 Player *v383; // eax@728 | |
2938 int v384; // eax@733 | |
2939 int v385; // edi@736 | |
2940 signed int v386; // eax@736 | |
2941 Player *v387; // edi@738 | |
2942 int v388; // edi@740 | |
488 | 2943 //unsigned __int16 v389; // ST1C_2@740 |
2944 //__int16 v390; // ST18_2@740 | |
2945 //stru6 *v391; // eax@740 | |
0 | 2946 int v392; // ecx@742 |
2947 int v393; // ecx@743 | |
2948 int v394; // ecx@744 | |
2949 int v395; // edi@747 | |
2950 int v396; // eax@752 | |
2951 int v397; // eax@757 | |
2952 int v398; // eax@757 | |
2953 int v399; // eax@757 | |
2954 char *v400; // esi@757 | |
488 | 2955 //Game *v401; // ecx@759 |
2956 //__int16 v402; // ST1C_2@759 | |
2957 //__int16 v403; // ST18_2@759 | |
2958 //stru6 *v404; // eax@759 | |
0 | 2959 int v405; // ecx@761 |
2960 int v406; // ecx@762 | |
2961 int v407; // edi@765 | |
488 | 2962 //__int16 v408; // ST1C_2@769 |
2963 //__int16 v409; // ST18_2@769 | |
2964 //stru6 *v410; // eax@769 | |
0 | 2965 int v411; // ecx@772 |
2966 int v412; // ecx@773 | |
2967 int v413; // edi@775 | |
488 | 2968 //__int16 v414; // ST1C_2@781 |
2969 //__int16 v415; // ST18_2@781 | |
2970 //stru6 *v416; // eax@781 | |
0 | 2971 int v417; // eax@787 |
2972 int v418; // ecx@789 | |
2973 __int16 v419; // ax@791 | |
2974 signed int v420; // eax@793 | |
2975 int v421; // edx@793 | |
2976 const char *v422; // eax@801 | |
2977 int v423; // ecx@808 | |
2978 int v424; // ecx@809 | |
2979 int v425; // eax@811 | |
2980 signed int v426; // eax@815 | |
2981 signed int v427; // eax@820 | |
2982 int v428; // ecx@825 | |
2983 int v429; // ecx@826 | |
2984 int v430; // eax@828 | |
488 | 2985 //stru6 *v431; // eax@831 |
0 | 2986 int v432; // eax@831 |
2987 Actor *v433; // edi@832 | |
2988 int v434; // eax@833 | |
2989 int v435; // ecx@837 | |
2990 int v436; // ecx@838 | |
488 | 2991 //__int16 v437; // ST1C_2@843 |
2992 //__int16 v438; // ST18_2@843 | |
2993 //stru6 *v439; // eax@843 | |
0 | 2994 int v440; // eax@843 |
2995 int v441; // eax@847 | |
2996 int v442; // ecx@850 | |
2997 int v443; // ecx@851 | |
2998 int v444; // eax@853 | |
2999 signed int v445; // edi@857 | |
3000 int v446; // ecx@862 | |
3001 LevelDecoration *v447; // edi@864 | |
3002 __int16 v448; // ax@864 | |
3003 char *v449; // esi@870 | |
3004 int v450; // eax@870 | |
3005 int v451; // ecx@875 | |
3006 int v452; // ecx@876 | |
3007 int v453; // edi@878 | |
488 | 3008 //__int16 v454; // ST1C_2@884 |
3009 //__int16 v455; // ST18_2@884 | |
3010 //stru6 *v456; // eax@884 | |
0 | 3011 int v457; // ecx@887 |
3012 int v458; // ecx@888 | |
3013 int v459; // eax@890 | |
3014 signed int v460; // eax@895 | |
3015 Actor *v461; // eax@897 | |
3016 unsigned __int16 v462; // cx@897 | |
3017 signed int v463; // edx@897 | |
3018 int v464; // ecx@905 | |
3019 int v465; // ecx@906 | |
3020 int v466; // edi@909 | |
488 | 3021 //__int16 v467; // ST1C_2@913 |
3022 //__int16 v468; // ST18_2@913 | |
3023 //stru6 *v469; // eax@913 | |
0 | 3024 int v470; // edi@913 |
3025 int v471; // eax@917 | |
3026 int v472; // eax@917 | |
3027 char *v473; // esi@918 | |
488 | 3028 //__int16 v474; // ST18_2@920 |
3029 //stru6 *v475; // eax@920 | |
3030 //__int16 v476; // ST18_2@920 | |
3031 //stru6 *v477; // eax@920 | |
3032 //__int16 v478; // ST18_2@920 | |
3033 //stru6 *v479; // eax@920 | |
3034 //__int16 v480; // ST18_2@920 | |
3035 //stru6 *v481; // eax@920 | |
3036 //__int16 v482; // ST18_2@923 | |
3037 //stru6 *v483; // eax@923 | |
3038 //__int16 v484; // ST18_2@923 | |
3039 //stru6 *v485; // eax@923 | |
3040 //__int16 v486; // ST18_2@923 | |
3041 //stru6 *v487; // eax@923 | |
3042 //__int16 v488; // ST18_2@923 | |
3043 //stru6 *v489; // eax@923 | |
3044 //__int16 v490; // ST1C_2@924 | |
3045 //__int16 v491; // ST18_2@924 | |
3046 //stru6 *v492; // eax@924 | |
0 | 3047 int v493; // ecx@925 |
3048 int v494; // ecx@926 | |
488 | 3049 //__int16 v495; // ST1C_2@931 |
3050 //__int16 v496; // ST18_2@931 | |
3051 //stru6 *v497; // eax@931 | |
0 | 3052 int v498; // edi@931 |
3053 int v499; // eax@935 | |
3054 int v500; // eax@935 | |
3055 Player *v501; // edi@939 | |
488 | 3056 //__int16 v502; // ST18_2@940 |
3057 //stru6 *v503; // eax@940 | |
3058 //stru6 *v504; // eax@943 | |
0 | 3059 int v505; // eax@943 |
3060 int v506; // eax@943 | |
3061 int v507; // edi@944 | |
3062 int v508; // eax@944 | |
3063 signed int v509; // eax@944 | |
3064 signed int v510; // edi@944 | |
3065 Actor *v511; // edi@946 | |
3066 int v512; // eax@946 | |
3067 SpellBuff *v513; // edi@946 | |
3068 int v514; // ecx@950 | |
3069 int v515; // ecx@951 | |
3070 int v516; // eax@953 | |
3071 int v517; // eax@956 | |
90 | 3072 Actor *v518; // edx@957 |
0 | 3073 __int16 v519; // cx@958 |
3074 int v520; // ecx@968 | |
3075 int v521; // ecx@969 | |
3076 int v522; // eax@971 | |
488 | 3077 //__int16 v523; // ST18_2@975 |
3078 //stru6 *v524; // eax@975 | |
3079 //__int16 v525; // ST18_2@975 | |
3080 //stru6 *v526; // eax@975 | |
3081 //__int16 v527; // ST18_2@975 | |
3082 //stru6 *v528; // eax@975 | |
3083 //__int16 v529; // ST18_2@975 | |
3084 //stru6 *v530; // eax@975 | |
0 | 3085 int v531; // eax@982 |
3086 int v532; // eax@982 | |
3087 int v533; // edi@983 | |
3088 int v534; // eax@983 | |
3089 signed int v535; // eax@983 | |
3090 signed int v536; // edi@983 | |
3091 stru6 *v537; // eax@984 | |
3092 int v538; // ecx@985 | |
3093 int v539; // ecx@986 | |
3094 int v540; // eax@988 | |
488 | 3095 //__int16 v541; // ST18_2@991 |
3096 //stru6 *v542; // eax@991 | |
3097 //__int16 v543; // ST18_2@991 | |
3098 //stru6 *v544; // eax@991 | |
3099 //__int16 v545; // ST18_2@991 | |
3100 //stru6 *v546; // eax@991 | |
3101 //__int16 v547; // ST18_2@991 | |
0 | 3102 stru6 *v548; // eax@991 |
3103 double v549; // st7@991 | |
3104 unsigned __int16 v550; // di@991 | |
3105 int v551; // ecx@993 | |
3106 int v552; // ecx@994 | |
89 | 3107 Player *v553; // edi@1001 |
488 | 3108 //__int16 v554; // ST18_2@1002 |
3109 //stru6 *v555; // eax@1002 | |
3110 //__int16 v556; // ST18_2@1002 | |
3111 //stru6 *v557; // eax@1002 | |
3112 //__int16 v558; // ST18_2@1002 | |
3113 //stru6 *v559; // eax@1002 | |
3114 //__int16 v560; // ST18_2@1002 | |
3115 //stru6 *v561; // eax@1002 | |
0 | 3116 unsigned __int16 v562; // di@1005 |
3117 signed int v563; // eax@1010 | |
3118 unsigned int v564; // ecx@1011 | |
3119 signed int v565; // eax@1012 | |
3120 Player **v566; // ecx@1012 | |
3121 int v567; // eax@1012 | |
488 | 3122 //unsigned __int16 v568; // ST1C_2@1012 |
3123 //__int16 v569; // ST18_2@1012 | |
3124 //stru6 *v570; // eax@1012 | |
0 | 3125 Player *v571; // eax@1013 |
3126 char *v572; // ecx@1013 | |
3127 int v573; // ecx@1017 | |
3128 int v574; // ecx@1018 | |
3129 int v575; // eax@1020 | |
3130 signed int v576; // eax@1025 | |
3131 Player *v577; // eax@1026 | |
3132 int v578; // eax@1028 | |
3133 __int16 v579; // ax@1029 | |
3134 int v580; // eax@1031 | |
3135 int v581; // edi@1031 | |
3136 int v582; // eax@1031 | |
488 | 3137 //__int16 v583; // ST1C_2@1034 |
3138 //__int16 v584; // ST18_2@1034 | |
0 | 3139 char *v585; // esi@1034 |
488 | 3140 //stru6 *v586; // eax@1034 |
0 | 3141 signed int v587; // eax@1035 |
3142 int v588; // ecx@1036 | |
3143 int v589; // ecx@1037 | |
3144 int v590; // ecx@1038 | |
3145 char v591; // al@1048 | |
3146 int v592; // esi@1052 | |
3147 int v593; // ecx@1057 | |
3148 int v594; // ecx@1058 | |
3149 int v595; // eax@1064 | |
3150 int v596; // esi@1066 | |
3151 unsigned int v597; // edi@1067 | |
3152 int v598; // eax@1079 | |
3153 signed int v599; // eax@1082 | |
3154 int v600; // edi@1086 | |
3155 int v601; // edx@1086 | |
3156 int v602; // eax@1086 | |
3157 int v603; // ecx@1086 | |
3158 int v604; // eax@1087 | |
3159 char *v605; // eax@1089 | |
3160 int v606; // edx@1091 | |
3161 int v607; // ecx@1100 | |
3162 __int16 v608; // ax@1102 | |
3163 signed int v609; // eax@1104 | |
3164 int v610; // edi@1106 | |
3165 unsigned int v611; // eax@1106 | |
89 | 3166 Player *v612; // edi@1106 |
3167 DDM_DLV_Header *v613; // eax@1108 | |
0 | 3168 int v614; // eax@1116 |
3169 int v615; // edi@1119 | |
488 | 3170 //__int16 v616; // ST1C_2@1122 |
3171 //__int16 v617; // ST18_2@1122 | |
3172 //stru6 *v618; // eax@1122 | |
112 | 3173 Player *v619; // edi@1123 |
488 | 3174 //unsigned __int16 v620; // ST1C_2@1124 |
3175 //__int16 v621; // ST18_2@1124 | |
3176 //stru6 *v622; // eax@1124 | |
0 | 3177 signed __int64 v623; // qax@1127 |
3178 int v624; // eax@1127 | |
3179 int v625; // edi@1129 | |
3180 int v626; // eax@1129 | |
3181 signed int v627; // eax@1129 | |
3182 signed int v628; // edi@1129 | |
3183 int v629; // ecx@1130 | |
3184 Player *v630; // eax@1131 | |
3185 int v631; // eax@1137 | |
3186 int v632; // edi@1140 | |
3187 Player *v633; // eax@1140 | |
3188 signed int v634; // eax@1140 | |
3189 int v635; // edi@1142 | |
488 | 3190 //unsigned __int16 v636; // ST1C_2@1142 |
3191 //__int16 v637; // ST18_2@1142 | |
3192 //stru6 *v638; // eax@1142 | |
3193 //stru6 *v639; // eax@1143 | |
0 | 3194 int v640; // ecx@1146 |
3195 int v641; // ecx@1147 | |
3196 int v642; // edi@1156 | |
3197 int v643; // eax@1156 | |
3198 int v644; // eax@1156 | |
3199 signed int v645; // eax@1158 | |
488 | 3200 //Player *v646; // ebx@1169 |
3201 //int v647; // edi@1169 | |
3202 //signed int v648; // ST1C_4@1170 | |
3203 //Player *v649; // ecx@1170 | |
3204 //unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | |
3205 //unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | |
3206 //unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | |
3207 //unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | |
0 | 3208 int v654; // [sp-4h] [bp-E88h]@124 |
488 | 3209 //unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 |
0 | 3210 unsigned int v656; // [sp-4h] [bp-E88h]@639 |
3211 int v657; // [sp-4h] [bp-E88h]@807 | |
488 | 3212 //int v658; // [sp+0h] [bp-E84h]@100 |
0 | 3213 int v659; // [sp+0h] [bp-E84h]@123 |
3214 int v660; // [sp+0h] [bp-E84h]@146 | |
3215 Actor *v661; // [sp+0h] [bp-E84h]@164 | |
488 | 3216 //int v662; // [sp+0h] [bp-E84h]@304 |
0 | 3217 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 |
3218 const char *v664; // [sp+0h] [bp-E84h]@802 | |
3219 int v665; // [sp+0h] [bp-E84h]@807 | |
3220 int v666; // [sp+4h] [bp-E80h]@12 | |
3221 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | |
488 | 3222 //unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 |
0 | 3223 int v669; // [sp+4h] [bp-E80h]@123 |
3224 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | |
3225 int v671; // [sp+4h] [bp-E80h]@146 | |
3226 unsigned int v672; // [sp+4h] [bp-E80h]@164 | |
488 | 3227 //unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 |
0 | 3228 __int16 v674; // [sp+4h] [bp-E80h]@684 |
3229 const char *v675; // [sp+4h] [bp-E80h]@800 | |
3230 int v676; // [sp+4h] [bp-E80h]@807 | |
3231 int v677; // [sp+4h] [bp-E80h]@861 | |
3232 int v678; // [sp+4h] [bp-E80h]@997 | |
3233 int v679; // [sp+14h] [bp-E70h]@515 | |
3234 AIDirection a3; // [sp+C94h] [bp-1F0h]@21 | |
3235 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 | |
3236 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 | |
3237 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | |
3238 int v684; // [sp+D04h] [bp-180h]@416 | |
3239 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | |
3240 int x; // [sp+D20h] [bp-164h]@327 | |
3241 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | |
3242 int v688; // [sp+D2Ch] [bp-158h]@943 | |
3243 int v689; // [sp+D30h] [bp-154h]@943 | |
3244 int v690; // [sp+D34h] [bp-150h]@943 | |
3245 int v691; // [sp+D38h] [bp-14Ch]@137 | |
3246 int v692; // [sp+D3Ch] [bp-148h]@137 | |
3247 int v693; // [sp+D40h] [bp-144h]@137 | |
3248 int v694; // [sp+D44h] [bp-140h]@982 | |
3249 int v695; // [sp+D48h] [bp-13Ch]@982 | |
3250 int v696; // [sp+D4Ch] [bp-138h]@982 | |
3251 int v697; // [sp+D50h] [bp-134h]@129 | |
3252 int v698; // [sp+D54h] [bp-130h]@129 | |
3253 int v699; // [sp+D58h] [bp-12Ch]@129 | |
3254 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | |
3255 int v701; // [sp+D68h] [bp-11Ch]@286 | |
3256 int v702; // [sp+D6Ch] [bp-118h]@286 | |
3257 int v703; // [sp+D70h] [bp-114h]@286 | |
3258 int v704; // [sp+D74h] [bp-110h]@132 | |
3259 int v705; // [sp+D78h] [bp-10Ch]@132 | |
3260 int v706; // [sp+D7Ch] [bp-108h]@132 | |
3261 int v707; // [sp+D80h] [bp-104h]@1127 | |
3262 int v708; // [sp+D84h] [bp-100h]@1127 | |
3263 int v709; // [sp+D88h] [bp-FCh]@1127 | |
3264 char v710; // [sp+D8Ch] [bp-F8h]@1156 | |
3265 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | |
3266 __int64 v712; // [sp+D94h] [bp-F0h]@991 | |
3267 int v713; // [sp+D9Ch] [bp-E8h]@324 | |
3268 int n; // [sp+DA0h] [bp-E4h]@1 | |
3269 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | |
3270 int v716; // [sp+DC0h] [bp-C4h]@272 | |
3271 __int64 v717; // [sp+DC4h] [bp-C0h]@271 | |
3272 float v718; // [sp+DCCh] [bp-B8h]@176 | |
3273 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53 | |
3274 char *y; // [sp+DD4h] [bp-B0h]@325 | |
3275 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
|
3276 //SpriteObject a1; // [sp+DDCh] [bp-A8h]@1 |
0 | 3277 int v723; // [sp+E4Ch] [bp-38h]@1 |
3278 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | |
3279 float v725; // [sp+E54h] [bp-30h]@23 | |
3280 Player *v726; // [sp+E58h] [bp-2Ch]@131 | |
90 | 3281 int v726b; |
0 | 3282 float v727; // [sp+E5Ch] [bp-28h]@1 |
3283 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | |
3284 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | |
3285 int v730; // [sp+E68h] [bp-1Ch]@53 | |
89 | 3286 Player *v730b; |
3287 ItemGen *v730c; | |
0 | 3288 int v731; // [sp+E6Ch] [bp-18h]@48 |
3289 signed int v732; // [sp+E70h] [bp-14h]@325 | |
3290 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1 | |
3291 signed int a2; // [sp+E7Ch] [bp-8h]@14 | |
3292 int amount; // [sp+E80h] [bp-4h]@1 | |
3293 | |
3294 auto ecx0 = this; | |
3295 | |
3296 v711 = ecx0; | |
3297 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3298 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
|
3299 //SpriteObject::SpriteObject(&a1); |
0 | 3300 |
486 | 3301 //v1 = 0; |
0 | 3302 v2 = 0; |
3303 amount = 0; | |
3304 LODWORD(v733) = 0; | |
3305 v723 = 0; | |
3306 v727 = 0.0; | |
3307 n = 0; | |
3308 while ( 1 ) | |
3309 { | |
3310 v3 = &v711[n]; | |
3311 HIDWORD(v733) = (int)v3; | |
486 | 3312 if ( v3->spellnum == 0 ) |
0 | 3313 goto LABEL_1166; |
486 | 3314 |
3315 if (pParty->Invisible()) | |
3316 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
3317 | |
0 | 3318 if ( v3->field_8 & 0x3CA ) |
3319 { | |
3320 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | |
3321 v711->_427D48(1u); | |
3322 goto LABEL_1166; | |
3323 } | |
3324 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | |
488 | 3325 |
3326 a2 = v3->spell_target_pid; | |
3327 if (!a2) | |
0 | 3328 { |
488 | 3329 if (v3->spellnum == SPELL_LIGHT_DESTROY_UNDEAD || |
3330 v3->spellnum == SPELL_SPIRIT_TURN_UNDEAD || | |
3331 v3->spellnum == SPELL_DARK_CONTROL_UNDEAD ) | |
3332 v666 = 1; | |
3333 else | |
3334 v666 = 0; | |
3335 | |
3336 a2 = stru_50C198.FindClosestActor(5120, 1, v666); | |
3337 v6 = pMouse->uPointingObjectID; | |
3338 if ( pMouse->uPointingObjectID && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) | |
3339 a2 = pMouse->uPointingObjectID; | |
0 | 3340 } |
488 | 3341 |
3342 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3343 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
|
3344 if (a1.uType) |
0 | 3345 { |
141 | 3346 if ( (a2 & 7) == OBJECT_Actor) |
0 | 3347 { |
141 | 3348 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
0 | 3349 v2 = v723; |
3350 } | |
3351 else | |
3352 { | |
3353 v715.uYawAngle = pParty->sRotationY; | |
3354 v715.uPitchAngle = pParty->sRotationX; | |
3355 } | |
3356 } | |
488 | 3357 |
486 | 3358 LODWORD(v725) = 0; |
3359 _this = 0; | |
488 | 3360 if (v3->forced_spell_skill_level) |
3361 { | |
3362 v11 = v3->forced_spell_skill_level; | |
3363 v723 = v11 & 0x3F; | |
3364 v2 = v723; | |
3365 } | |
3366 else | |
0 | 3367 { |
488 | 3368 //v667 = PLAYER_SKILL_STAFF; |
3369 if (v3->spellnum < SPELL_AIR_WIZARD_EYE) | |
3370 v667 = PLAYER_SKILL_FIRE; | |
3371 else if (v3->spellnum < SPELL_WATER_AWAKEN) | |
3372 v667 = PLAYER_SKILL_AIR; | |
3373 else if (v3->spellnum < SPELL_EARTH_STUN) | |
3374 v667 = PLAYER_SKILL_WATER; | |
3375 else if (v3->spellnum < SPELL_SPIRIT_DETECT_LIFE) | |
3376 v667 = PLAYER_SKILL_EARTH; | |
3377 else if (v3->spellnum < SPELL_MIND_REMOVE_FEAR) | |
3378 v667 = PLAYER_SKILL_SPIRIT; | |
3379 else if (v3->spellnum < SPELL_BODY_CURE_WEAKNESS) | |
3380 v667 = PLAYER_SKILL_MIND; | |
3381 else if (v3->spellnum < SPELL_LIGHT_LIGHT_BOLT) | |
3382 v667 = PLAYER_SKILL_BODY; | |
3383 else if (v3->spellnum < SPELL_DARK_REANIMATE) | |
3384 v667 = PLAYER_SKILL_LIGHT; | |
3385 else if (v3->spellnum < SPELL_BOW_ARROW) | |
3386 v667 = PLAYER_SKILL_DARK; | |
3387 else if (v3->spellnum == SPELL_BOW_ARROW) | |
3388 v667 = PLAYER_SKILL_BOW; | |
3389 else assert(false && "Unknown spell"); | |
3390 | |
0 | 3391 LODWORD(v725) = v667; |
488 | 3392 v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F; |
3393 v2 = v723; | |
3394 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | |
0 | 3395 } |
488 | 3396 |
0 | 3397 if ( HIBYTE(v11) & 1 ) |
3398 { | |
3399 v12 = 4; | |
3400 v731 = 4; | |
3401 } | |
3402 else | |
3403 { | |
3404 if ( (v11 & 0x80u) == 0 ) | |
3405 { | |
3406 v731 = ((v11 & 0x40) != 0) + 1; | |
3407 } | |
3408 else | |
3409 { | |
3410 v731 = 3; | |
3411 } | |
3412 v12 = v731; | |
3413 } | |
488 | 3414 |
3415 v730 = v3->spellnum; | |
3416 if (v3->forced_spell_skill_level) | |
486 | 3417 uRequiredMana = 0; |
488 | 3418 else |
3419 uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v12 - 1]; | |
3420 sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v12 - 1]; | |
3421 | |
3422 if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || | |
490 | 3423 LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) |
486 | 3424 uRequiredMana = 0; |
488 | 3425 |
3426 if (v3->spellnum >= PLAYER_SKILL_BOW || pPlayer->sMana >= uRequiredMana) | |
0 | 3427 break; |
488 | 3428 |
3429 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points" | |
0 | 3430 LABEL_203: |
486 | 3431 v3->spellnum = 0; |
0 | 3432 LABEL_1166: |
3433 ++n; | |
3434 if ( n >= 10 ) | |
3435 return; | |
3436 } | |
488 | 3437 |
3438 if (pPlayer->Cursed() && v730 < SPELL_BOW_ARROW) | |
3439 if (rand() % 100 < 50) | |
3440 { | |
3441 if ( pParty->bTurnBasedModeOn == 0 ) | |
3442 { | |
3443 //v646 = pPlayer; | |
3444 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
3445 //v647 = n; | |
3446 } | |
3447 else | |
3448 { | |
3449 //v647 = n; | |
3450 //v646 = pPlayer; | |
3451 //v648 = sRecoveryTime; | |
3452 //v649 = pPlayer; | |
3453 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | |
3454 pPlayer->SetRecoveryTime(sRecoveryTime); | |
3455 pTurnEngine->_40471C(); | |
3456 } | |
3457 | |
3458 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); // "Spell failed" | |
3459 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
3460 v711[n].spellnum = 0; | |
3461 pPlayer->sMana -= uRequiredMana; | |
3462 return; | |
3463 } | |
3464 | |
0 | 3465 switch ( v3->spellnum ) |
3466 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3467 case SPELL_101: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3468 assert(false && "Unknown spell effect #101 (prolly flaming bow arrow"); |
488 | 3469 case SPELL_BOW_ARROW: |
0 | 3470 v17 = pPlayer; |
3471 _this = (ItemGen *)1; | |
488 | 3472 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 ) |
0 | 3473 _this = (ItemGen *)2; |
3474 sRecoveryTime = v17->GetAttackRecoveryTime(1); | |
3475 a1.stru_24.Reset(); | |
3476 v18 = v3->spellnum; | |
3477 a1.field_4C = v2; | |
3478 a1.field_48 = v18; | |
3479 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3480 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3481 if ( v17->WearsItem(510, 2) ) |
3482 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); | |
3483 a1.vPosition.x = pParty->vPosition.x; | |
3484 a1.vPosition.y = pParty->vPosition.y; | |
3485 a1.uAttributes = 0; | |
3486 a1.uSpriteFrameID = 0; | |
3487 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
3488 v19 = 8 * v3->uPlayerID; | |
303 | 3489 LOBYTE(v19) = v19 | OBJECT_Player; |
3490 a1.field_58_pid = v19; | |
0 | 3491 a1.field_5C = a2; |
3492 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3493 a1.uFacing = LOWORD(v715.uYawAngle); | |
3494 a1.uSoundID = LOWORD(v3->field_10); | |
3495 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | |
3496 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24)); | |
3497 a1.uAttributes = 256; | |
3498 if ( pParty->bTurnBasedModeOn == 1 ) | |
3499 a1.uAttributes = 260; | |
3500 for ( i = 0; i < (signed int)this; ++i ) | |
3501 { | |
3502 if ( i ) | |
3503 a1.vPosition.z += 32; | |
3504 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); | |
3505 if ( a1.Create( | |
3506 v715.uYawAngle, | |
3507 v715.uPitchAngle, | |
3508 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3509 v3->uPlayerID + 1) != -1 | |
3510 && pParty->bTurnBasedModeOn == 1 ) | |
3511 ++pTurnEngine->field_1C; | |
3512 } | |
488 | 3513 goto play_sound_and_continue; |
3514 | |
490 | 3515 case SPELL_LASER_PROJECTILE: |
0 | 3516 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); |
3517 a1.stru_24.Reset(); | |
3518 a1.field_48 = v3->spellnum; | |
3519 a1.field_4C = v723; | |
3520 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3521 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3522 a1.vPosition.x = pParty->vPosition.x; |
3523 a1.vPosition.y = pParty->vPosition.y; | |
3524 a1.uAttributes = 0; | |
3525 a1.uSpriteFrameID = 0; | |
3526 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3527 v22 = 8 * v3->uPlayerID; | |
303 | 3528 LOBYTE(v22) = v22 | OBJECT_Player; |
3529 a1.field_58_pid = v22; | |
0 | 3530 a1.field_5C = a2; |
3531 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3532 a1.uFacing = LOWORD(v715.uYawAngle); | |
3533 a1.uSoundID = LOWORD(v3->field_10); | |
3534 memcpy( | |
3535 &a1.stru_24, | |
3536 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36 | |
3537 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand | |
3538 + 5], | |
3539 sizeof(a1.stru_24)); | |
3540 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z); | |
3541 HIBYTE(a1.uAttributes) |= 1u; | |
3542 a1.uSectorID = v23; | |
3543 if ( pParty->bTurnBasedModeOn == 1 ) | |
3544 LOBYTE(a1.uAttributes) |= 4u; | |
3545 if ( a1.Create( | |
3546 v715.uYawAngle, | |
3547 v715.uPitchAngle, | |
3548 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
3549 v3->uPlayerID + 1) != -1 | |
3550 && pParty->bTurnBasedModeOn == 1 ) | |
3551 ++pTurnEngine->field_1C; | |
488 | 3552 goto play_sound_and_continue; |
3553 | |
3554 case SPELL_FIRE_TORCH_LIGHT: | |
0 | 3555 LODWORD(v733) = 3600 * v2; |
488 | 3556 |
3557 switch (v12) | |
3558 { | |
3559 case 1: amount = 2; break; | |
3560 case 2: amount = 3; break; | |
3561 case 3: | |
3562 case 4: amount = 4; break; | |
3563 default: | |
3564 assert(false); | |
3565 } | |
3566 | |
0 | 3567 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
488 | 3568 goto play_sound_and_continue; |
3569 | |
3570 pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * v2 * 4.2666669), v731, amount, 0, 0); | |
3571 goto LABEL_1056; | |
3572 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3573 case SPELL_FIRE_FIRE_SPIKE: |
0 | 3574 v29 = v12 - 2; |
3575 if ( v29 ) | |
3576 { | |
3577 v30 = v29 - 1; | |
3578 if ( v30 ) | |
3579 { | |
3580 if ( v30 == 1 ) | |
3581 amount = 9; | |
3582 else | |
3583 amount = 3; | |
3584 } | |
3585 else | |
3586 { | |
3587 amount = 7; | |
3588 } | |
3589 } | |
3590 else | |
3591 { | |
3592 amount = 5; | |
3593 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3594 //v31 = v3->uPlayerID; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3595 //v32 = 8 * v31; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3596 //LOBYTE(v32) = v32 | OBJECT_Player; |
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 //if ( (signed int)uNumSpriteObjects > 0 ) |
486 | 3599 HIDWORD(v733) = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3600 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
|
3601 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3602 auto object = pSpriteObjects + i; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3603 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
|
3604 ++HIDWORD(v733); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3605 /*v33 = (char *)&pSpriteObjects[0].field_48; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3606 v730 = uNumSpriteObjects; |
0 | 3607 do |
3608 { | |
486 | 3609 if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) |
0 | 3610 ++HIDWORD(v733); |
3611 v33 += 112; | |
3612 --v730; | |
3613 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3614 while ( v730 );*/ |
0 | 3615 } |
3616 if ( SHIDWORD(v733) > amount ) | |
710 | 3617 { |
3618 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
3619 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
3620 goto LABEL_203; | |
3621 } | |
0 | 3622 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
488 | 3623 goto play_sound_and_continue; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3624 |
0 | 3625 a1.stru_24.Reset(); |
3626 a1.field_48 = v3->spellnum; | |
3627 a1.field_4C = v2; | |
3628 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3629 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3630 a1.vPosition.y = pParty->vPosition.y; |
3631 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3632 a1.uAttributes = 0; |
0 | 3633 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3634 a1.uSectorID = pIndoor->GetSector( | |
3635 pParty->vPosition.x, | |
3636 pParty->vPosition.y, | |
3637 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3638 a1.uSpriteFrameID = 0; |
0 | 3639 v34 = 8 * v3->uPlayerID; |
303 | 3640 LOBYTE(v34) = v34 | OBJECT_Player; |
3641 a1.field_58_pid = v34; | |
0 | 3642 a1.field_5C = a2; |
3643 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3644 a1.uFacing = LOWORD(v715.uYawAngle); | |
3645 a1.uSoundID = LOWORD(v3->field_10); | |
3646 if ( pParty->bTurnBasedModeOn == 1 ) | |
3647 LOBYTE(a1.uAttributes) |= 4u; | |
3648 v669 = v3->uPlayerID + 1; | |
3649 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3650 v35 = pParty->sRotationX + 10; | |
3651 goto LABEL_124; | |
710 | 3652 |
0 | 3653 case 20: |
3654 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3655 goto play_sound_and_continue; |
486 | 3656 if (!a2) |
710 | 3657 { |
3658 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
3659 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
3660 goto LABEL_203; | |
3661 } | |
141 | 3662 if ( (a2 & 7) != OBJECT_Actor) |
0 | 3663 goto LABEL_1056; |
486 | 3664 v699 = 0; |
3665 v698 = 0; | |
3666 v697 = 0; | |
0 | 3667 a1.stru_24.Reset(); |
3668 a1.field_48 = v3->spellnum; | |
3669 a1.field_4C = v2; | |
3670 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3671 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 3672 a1.uAttributes = 0; |
3673 a1.uSectorID = 0; | |
3674 a1.uSpriteFrameID = 0; | |
0 | 3675 v37 = v3->uPlayerID; |
3676 a1.field_60_distance_related_prolly_lod = 0; | |
3677 v37 *= 8; | |
303 | 3678 LOBYTE(v37) = v37 | OBJECT_Player; |
486 | 3679 a1.uFacing = 0; |
303 | 3680 a1.field_58_pid = v37; |
0 | 3681 v38 = a2 >> 3; |
3682 a1.uSoundID = LOWORD(v3->field_10); | |
3683 v39 = a2 >> 3; | |
3684 a1.vPosition.x = pActors[v39].vPosition.x; | |
3685 v40 = pActors[v39].vPosition.y; | |
3686 a1.vPosition.z = pActors[v39].vPosition.z; | |
3687 v41 = 8 * (a2 >> 3); | |
3688 a1.vPosition.y = v40; | |
486 | 3689 LOBYTE(v41) = v41 | OBJECT_Actor; |
0 | 3690 a1.field_5C = v41; |
486 | 3691 v42 = a1.Create(0, 0, 0, 0); |
0 | 3692 v43 = &v697; |
3693 goto LABEL_133; | |
3694 case 44: | |
3695 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3696 goto play_sound_and_continue; |
0 | 3697 v726 = (Player *)(a2 >> 3); |
3698 HIDWORD(v733) = 836 * (a2 >> 3); | |
90 | 3699 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
0 | 3700 goto LABEL_1056; |
90 | 3701 pActors[a2 >> 3].pActorBuffs[10].Apply( |
486 | 3702 pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); |
3703 v706 = 0; | |
3704 v705 = 0; | |
3705 v704 = 0; | |
0 | 3706 a1.stru_24.Reset(); |
3707 a1.field_48 = v3->spellnum; | |
3708 a1.field_4C = v2; | |
3709 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3710 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 3711 a1.uAttributes = 0; |
3712 a1.uSectorID = 0; | |
3713 a1.uSpriteFrameID = 0; | |
0 | 3714 v44 = v3->uPlayerID; |
3715 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 3716 a1.uFacing = 0; |
0 | 3717 v44 *= 8; |
303 | 3718 LOBYTE(v44) = v44 | OBJECT_Player; |
0 | 3719 v38 = (signed int)v726; |
303 | 3720 a1.field_58_pid = v44; |
0 | 3721 a1.uSoundID = LOWORD(v3->field_10); |
3722 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | |
3723 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | |
3724 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | |
3725 v46 = 8 * (int)v726; | |
3726 a1.vPosition.y = v45; | |
486 | 3727 LOBYTE(v46) = 8 * (char)v726 | OBJECT_Actor; |
0 | 3728 a1.field_5C = v46; |
486 | 3729 v42 = a1.Create(0, 0, 0, 0); |
0 | 3730 v43 = &v704; |
3731 LABEL_133: | |
3732 v670 = (Vec3_int_ *)v43; | |
3733 v47 = v38; | |
3734 goto LABEL_139; | |
3735 case 79: | |
486 | 3736 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || (a2 & 7) != OBJECT_Actor) |
488 | 3737 goto play_sound_and_continue; |
0 | 3738 v730 = a2 >> 3; |
486 | 3739 v693 = 0; |
0 | 3740 HIDWORD(v733) = (int)&pActors[a2 >> 3]; |
486 | 3741 v692 = 0; |
3742 v691 = 0; | |
0 | 3743 a1.stru_24.Reset(); |
3744 a1.field_48 = v3->spellnum; | |
3745 a1.field_4C = v2; | |
3746 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3747 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3748 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); |
3749 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | |
3750 v48 = *(short *)(HIDWORD(v733) + 138); | |
3751 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
486 | 3752 a1.uAttributes = 0; |
0 | 3753 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); |
486 | 3754 a1.uSpriteFrameID = 0; |
0 | 3755 v49 = 8 * v3->uPlayerID; |
303 | 3756 LOBYTE(v49) = v49 | OBJECT_Player; |
3757 a1.field_58_pid = v49; | |
0 | 3758 a1.field_5C = a2; |
3759 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3760 a1.uFacing = LOWORD(v715.uYawAngle); | |
3761 LOWORD(v49) = LOWORD(v3->field_10); | |
3762 LOBYTE(a1.uAttributes) |= 0x80u; | |
3763 a1.uSoundID = v49; | |
486 | 3764 v726 = (Player *)a1.Create(0, 0, 0, 0); |
0 | 3765 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) |
710 | 3766 { |
3767 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
3768 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
3769 goto LABEL_203; | |
3770 } | |
0 | 3771 v47 = v730; |
3772 v670 = (Vec3_int_ *)&v691; | |
3773 v42 = (signed int)v726; | |
3774 LABEL_139: | |
3775 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | |
3776 goto LABEL_1056; | |
573 | 3777 case SPELL_FIRE_FIRE_BOLT: |
0 | 3778 case 6: |
3779 case 11: | |
3780 case 18: | |
3781 case 26: | |
3782 case 32: | |
3783 case 34: | |
3784 case 37: | |
3785 case 57: | |
3786 case 65: | |
3787 case 70: | |
3788 case 78: | |
3789 case 97: | |
3790 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3791 goto play_sound_and_continue; |
0 | 3792 a1.stru_24.Reset(); |
3793 a1.field_48 = v3->spellnum; | |
3794 a1.field_4C = v2; | |
3795 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3796 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3797 a1.vPosition.y = pParty->vPosition.y; |
3798 a1.vPosition.x = pParty->vPosition.x; | |
486 | 3799 a1.uAttributes = 0; |
0 | 3800 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3801 a1.uSectorID = pIndoor->GetSector( | |
3802 pParty->vPosition.x, | |
3803 pParty->vPosition.y, | |
3804 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3805 a1.uSpriteFrameID = 0; |
0 | 3806 v50 = 8 * v3->uPlayerID; |
303 | 3807 LOBYTE(v50) = v50 | OBJECT_Player; |
3808 a1.field_58_pid = v50; | |
0 | 3809 a1.field_5C = a2; |
3810 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3811 a1.uFacing = LOWORD(v715.uYawAngle); | |
3812 a1.uSoundID = LOWORD(v3->field_10); | |
3813 if ( pParty->bTurnBasedModeOn == 1 ) | |
3814 LOBYTE(a1.uAttributes) |= 4u; | |
3815 if ( v3->spellnum == 18 ) | |
3816 LOBYTE(a1.uAttributes) |= 0x40u; | |
3817 goto LABEL_156; | |
3818 case 29: | |
3819 case 39: | |
3820 case 76: | |
3821 case 90: | |
3822 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3823 goto play_sound_and_continue; |
0 | 3824 a1.stru_24.Reset(); |
3825 a1.field_48 = v3->spellnum; | |
3826 a1.field_4C = v2; | |
3827 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3828 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3829 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
3830 a1.vPosition.y = pParty->vPosition.y; | |
3831 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | |
3832 v660 = pParty->vPosition.y; | |
3833 goto LABEL_153; | |
3834 case 87: | |
3835 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | |
3836 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | |
710 | 3837 { |
3838 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
3839 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
3840 goto LABEL_203; | |
3841 } | |
0 | 3842 if ( pPlayer->CanCastSpell(uRequiredMana) ) |
3843 goto LABEL_152; | |
488 | 3844 goto play_sound_and_continue; |
0 | 3845 case 81: |
3846 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3847 goto play_sound_and_continue; |
486 | 3848 if ( !a2 |
141 | 3849 || (a2 & 7) != OBJECT_Actor |
0 | 3850 || (v730 = a2 >> 3, |
3851 v721 = (int)&pActors[a2 >> 3], | |
3852 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | |
3853 goto LABEL_1056; | |
486 | 3854 Actor::AI_Stand(v730, 4u, 0x80u, 0); |
0 | 3855 v726 = (Player *)(23040 * v2); |
3856 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3857 v55 = v721; | |
486 | 3858 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0); |
0 | 3859 *(char *)(v55 + 38) |= 8u; |
486 | 3860 *(short *)(v55 + 148) = 0; |
3861 v672 = 0; | |
3862 *(short *)(v55 + 150) = 0; | |
0 | 3863 v661 = (Actor *)v55; |
3864 goto LABEL_165; | |
3865 case 35: | |
3866 if ( v12 == 2 ) | |
3867 { | |
3868 v57 = 300 * v2; | |
3869 } | |
3870 else | |
3871 { | |
3872 if ( v12 == 3 ) | |
3873 { | |
3874 amount = 4; | |
3875 v57 = 300 * v2; | |
3876 goto LABEL_174; | |
3877 } | |
3878 if ( v12 == 4 ) | |
3879 { | |
3880 v57 = 300 * v2; | |
3881 amount = 8; | |
3882 goto LABEL_174; | |
3883 } | |
3884 v57 = 180 * v2; | |
3885 } | |
3886 amount = 2; | |
3887 LABEL_174: | |
3888 LODWORD(v733) = v57; | |
3889 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3890 goto play_sound_and_continue; |
141 | 3891 if ( (a2 & 7) != OBJECT_Actor |
0 | 3892 || (v721 = 836 * (a2 >> 3), |
90 | 3893 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3894 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | |
0 | 3895 goto LABEL_1056; |
3896 v726 = (Player *)(23040 * v2); | |
3897 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | |
3898 v59 = v721; | |
112 | 3899 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3900 pActors[a2 >> 3].pActorBuffs[7].Apply( | |
3901 pParty->uTimePlayed + (signed int)v58, | |
0 | 3902 v731, |
3903 amount, | |
486 | 3904 0, |
3905 0); | |
0 | 3906 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; |
486 | 3907 v672 = 0; |
0 | 3908 v661 = (Actor *)LODWORD(v718); |
3909 goto LABEL_165; | |
3910 case 60: | |
3911 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3912 goto play_sound_and_continue; |
0 | 3913 v730 = 836 * (a2 >> 3); |
90 | 3914 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) |
0 | 3915 goto LABEL_1056; |
3916 LODWORD(v733) = 300 * v2; | |
3917 if ( v731 == 2 ) | |
3918 { | |
3919 LODWORD(v733) = 600 * v2; | |
3920 } | |
3921 else | |
3922 { | |
3923 if ( v731 == 3 ) | |
3924 LODWORD(v733) = 29030400; | |
3925 } | |
112 | 3926 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3927 pActors[a2 >> 3].pActorBuffs[9].Reset(); | |
3928 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | |
3929 pActors[a2 >> 3].pActorBuffs[12].Reset(); | |
3930 v726 = (Player *)((int)v733 << 7); | |
3931 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | |
3932 pActors[a2 >> 3].pActorBuffs[1].Apply( | |
0 | 3933 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 3934 v731, 0, 0, 0); |
0 | 3935 a1.stru_24.Reset(); |
3936 a1.field_48 = v3->spellnum; | |
3937 a1.field_4C = v2; | |
3938 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3939 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 3940 v61 = a2 >> 3; |
0 | 3941 goto LABEL_1086; |
3942 case 92: | |
3943 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3944 goto play_sound_and_continue; |
0 | 3945 a1.stru_24.Reset(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
3946 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 3947 a1.vPosition.x = pParty->vPosition.x; |
3948 a1.vPosition.y = pParty->vPosition.y; | |
486 | 3949 a1.uAttributes = 0; |
0 | 3950 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3951 a1.uSectorID = pIndoor->GetSector( | |
3952 pParty->vPosition.x, | |
3953 pParty->vPosition.y, | |
3954 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 3955 a1.uSpriteFrameID = 0; |
0 | 3956 v62 = 8 * v3->uPlayerID; |
303 | 3957 LOBYTE(v62) = v62 | OBJECT_Player; |
3958 a1.field_58_pid = v62; | |
0 | 3959 a1.field_5C = a2; |
3960 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
3961 a1.uFacing = LOWORD(v715.uYawAngle); | |
3962 a1.uSoundID = LOWORD(v3->field_10); | |
3963 a1.field_50 = v731; | |
3964 a1.field_48 = 3; | |
3965 a1.field_4C = 300 * v2; | |
3966 goto LABEL_154; | |
3967 case 4: | |
3968 v63 = v12 - 1; | |
3969 if ( !v63 ) | |
3970 { | |
3971 amount = 10; | |
3972 goto LABEL_195; | |
3973 } | |
3974 v64 = v63 - 1; | |
3975 if ( !v64 ) | |
3976 { | |
3977 amount = 11; | |
3978 goto LABEL_195; | |
3979 } | |
3980 v65 = v64 - 1; | |
3981 if ( !v65 ) | |
3982 { | |
3983 amount = 12; | |
3984 LABEL_195: | |
3985 LODWORD(v733) = 3600 * v2; | |
3986 goto LABEL_196; | |
3987 } | |
3988 if ( v65 == 1 ) | |
3989 { | |
486 | 3990 LODWORD(v733) = 0; |
0 | 3991 amount = 12; |
3992 } | |
3993 LABEL_196: | |
3994 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 3995 goto play_sound_and_continue; |
89 | 3996 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
3997 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | |
3998 v730c->UpdateTempBonus(pParty->uTimePlayed); | |
3999 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | |
4000 { | |
315 | 4001 if (!v730c->Broken()) |
0 | 4002 { |
486 | 4003 if (!v730c->uSpecEnchantmentType) |
0 | 4004 { |
570 | 4005 if (!v730c->uEnchantmentType) |
0 | 4006 { |
4007 v68 = BYTE4(v726->pConditions[3]); | |
4008 if ( !v68 || v68 == 1 || v68 == 2 ) | |
4009 { | |
377 | 4010 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
0 | 4011 { |
89 | 4012 v69 = v730c; |
0 | 4013 v14 = v731 == 4; |
4014 *(int *)(v730 + 12) = amount; | |
4015 if ( !v14 ) | |
4016 { | |
4017 v726 = (Player *)((int)v733 << 7); | |
4018 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | |
4019 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | |
4020 * 0.033333335); | |
4021 *(int *)(v69 + 20) |= 8u; | |
4022 } | |
4023 *(int *)(v69 + 20) |= 0x10u; | |
4024 LABEL_1055: | |
4025 dword_50C9A8 = 256; | |
4026 LABEL_1056: | |
4027 LODWORD(v727) = 1; | |
488 | 4028 play_sound_and_continue: |
0 | 4029 if ( v3->field_8 & 0x20 ) |
4030 { | |
4031 LABEL_1162: | |
4032 if ( v727 != 0.0 ) | |
4033 pAudioPlayer->PlaySound( | |
4034 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
4035 0, | |
4036 0, | |
4037 -1, | |
4038 0, | |
4039 v3->field_10, | |
4040 0, | |
4041 0); | |
4042 } | |
4043 else | |
4044 { | |
4045 if ( sRecoveryTime < 0 ) | |
4046 sRecoveryTime = 0; | |
4047 if ( pParty->bTurnBasedModeOn ) | |
4048 { | |
4049 v645 = sRecoveryTime; | |
4050 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime; | |
4051 pPlayer->SetRecoveryTime(v645); | |
4052 if ( !some_active_character ) | |
4053 pTurnEngine->_40471C(); | |
4054 } | |
4055 else | |
4056 { | |
4057 pPlayer->SetRecoveryTime( | |
4058 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
4059 } | |
4060 if ( v727 != 0.0 ) | |
4061 { | |
187 | 4062 pPlayer->PlaySound(SPEECH_49, 0); |
0 | 4063 goto LABEL_1162; |
4064 } | |
4065 } | |
4066 v3->spellnum = 0; | |
486 | 4067 //v1 = 0; |
0 | 4068 LABEL_1165: |
4069 v2 = v723; | |
4070 goto LABEL_1166; | |
4071 } | |
4072 } | |
4073 } | |
4074 } | |
4075 } | |
4076 } | |
710 | 4077 |
0 | 4078 dword_50C9D0 = 113; |
486 | 4079 dword_50C9D4 = 0; |
0 | 4080 dword_50C9D8 = 1; |
710 | 4081 |
4082 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
486 | 4083 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 4084 goto LABEL_203; |
488 | 4085 |
4086 case SPELL_BODY_REGENERATION: | |
0 | 4087 v70 = v12 - 1; |
4088 LODWORD(v733) = 3600 * v2; | |
4089 if ( v70 && (v71 = v70 - 1) != 0 ) | |
4090 { | |
4091 v72 = v71 - 1; | |
4092 if ( v72 ) | |
4093 { | |
4094 if ( v72 == 1 ) | |
4095 amount = 10; | |
4096 } | |
4097 else | |
4098 { | |
4099 amount = 3; | |
4100 } | |
4101 } | |
4102 else | |
4103 { | |
4104 amount = 1; | |
4105 } | |
4106 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4107 goto play_sound_and_continue; |
4108 | |
4109 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
4110 | |
4111 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); | |
4112 goto LABEL_1056; | |
4113 | |
4114 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
4115 case SPELL_AIR_PROTECTION_FROM_AIR: | |
4116 case SPELL_WATER_PROTECTION_FROM_WATER: | |
4117 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
4118 case SPELL_MIND_PROTECTION_FROM_MIND: | |
4119 case SPELL_BODY_PROTECTION_FROM_BODY: | |
0 | 4120 v76 = v12 - 1; |
4121 LODWORD(v733) = 3600 * v2; | |
4122 if ( v76 ) | |
4123 { | |
4124 v77 = v76 - 1; | |
4125 if ( v77 ) | |
4126 { | |
4127 v78 = v77 - 1; | |
4128 if ( v78 ) | |
4129 { | |
4130 if ( v78 != 1 ) | |
4131 goto LABEL_232; | |
4132 v79 = 4 * v2; | |
4133 } | |
4134 else | |
4135 { | |
4136 v79 = 3 * v2; | |
4137 } | |
4138 } | |
4139 else | |
4140 { | |
4141 v79 = 2 * v2; | |
4142 } | |
4143 amount = v79; | |
4144 } | |
4145 else | |
4146 { | |
4147 amount = v2; | |
4148 } | |
4149 LABEL_232: | |
488 | 4150 //v80 = v3->spellnum; |
4151 switch (v3->spellnum) | |
4152 { | |
4153 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
4154 LODWORD(v725) = PARTY_BUFF_RESIST_FIRE; | |
0 | 4155 break; |
488 | 4156 case SPELL_AIR_PROTECTION_FROM_AIR: |
4157 LODWORD(v725) = PARTY_BUFF_RESIST_AIR; | |
0 | 4158 break; |
488 | 4159 case SPELL_WATER_PROTECTION_FROM_WATER: |
4160 LODWORD(v725) = PARTY_BUFF_RESIST_WATER; | |
4161 break; | |
4162 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
4163 LODWORD(v725) = PARTY_BUFF_RESIST_EARTH; | |
0 | 4164 break; |
488 | 4165 case SPELL_MIND_PROTECTION_FROM_MIND: |
4166 LODWORD(v725) = PARTY_BUFF_RESIST_MIND; | |
0 | 4167 break; |
488 | 4168 case SPELL_BODY_PROTECTION_FROM_BODY: |
4169 LODWORD(v725) = PARTY_BUFF_RESIST_BODY; | |
0 | 4170 break; |
4171 default: | |
488 | 4172 assert(false); |
4173 goto LABEL_1166; | |
0 | 4174 } |
4175 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4176 goto play_sound_and_continue; |
4177 | |
4178 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4179 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4180 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4181 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4182 v83 = 1; |
488 | 4183 |
0 | 4184 v90 = (double)(signed int)v733 * 4.2666669; |
488 | 4185 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); |
4186 LODWORD(v727) = 1; | |
4187 goto play_sound_and_continue; | |
4188 | |
4189 case SPELL_FIRE_HASTE: | |
486 | 4190 if ( v12 <= 0 ) |
0 | 4191 goto LABEL_254; |
4192 if ( v12 <= 2 ) | |
4193 { | |
4194 v91 = 60 * (v2 + 60); | |
4195 } | |
4196 else | |
4197 { | |
4198 if ( v12 == 3 ) | |
4199 { | |
4200 v91 = 180 * (v2 + 20); | |
4201 } | |
4202 else | |
4203 { | |
4204 if ( v12 != 4 ) | |
4205 goto LABEL_254; | |
4206 v91 = 240 * (v2 + 15); | |
4207 } | |
4208 } | |
4209 LODWORD(v733) = v91; | |
4210 LABEL_254: | |
4211 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4212 { | |
89 | 4213 v92 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 4214 LODWORD(v727) = 1; |
4215 do | |
4216 { | |
89 | 4217 if ( v92->pConditions ) |
486 | 4218 LODWORD(v727) = 0; |
89 | 4219 ++v92; |
0 | 4220 } |
89 | 4221 while ( v92 <= &pParty->pPlayers[3] ); |
486 | 4222 if (LODWORD(v727)) |
0 | 4223 { |
4224 v726 = (Player *)((int)v733 << 7); | |
488 | 4225 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
4226 | |
4227 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4228 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4229 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4230 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4231 } |
4232 } | |
488 | 4233 goto play_sound_and_continue; |
4234 | |
4235 case SPELL_SPIRIT_BLESS: | |
0 | 4236 v101 = v12 - 1; |
4237 if ( v101 && (v102 = v101 - 1) != 0 ) | |
4238 { | |
4239 v103 = v102 - 1; | |
4240 if ( v103 ) | |
4241 { | |
4242 if ( v103 != 1 ) | |
4243 goto LABEL_269; | |
4244 v104 = 3600 * (v2 + 1); | |
4245 } | |
4246 else | |
4247 { | |
4248 v104 = 900 * (v2 + 4); | |
4249 } | |
4250 } | |
4251 else | |
4252 { | |
4253 v104 = 300 * (v2 + 12); | |
4254 } | |
4255 LODWORD(v733) = v104; | |
4256 LABEL_269: | |
4257 amount = v2 + 5; | |
4258 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4259 goto play_sound_and_continue; |
0 | 4260 if ( v731 == 1 ) |
4261 { | |
4262 v108 = v3->uPlayerID_2; | |
4263 v109 = v3->spellnum; | |
4264 v110 = pGame->GetStru6(); | |
4265 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | |
486 | 4266 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, 0, 65536); |
488 | 4267 //v668 = 0; |
0 | 4268 v716 = v111; |
488 | 4269 //v658 = v111; |
4270 //v653 = amount; | |
0 | 4271 v726 = (Player *)((int)v733 << 7); |
488 | 4272 //v651 = 1; |
4273 //v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
4274 //v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS]; | |
4275 //LABEL_103: | |
4276 //HIDWORD(v650) = HIDWORD(v28); | |
4277 //LABEL_104: | |
4278 //LODWORD(v650) = v28; | |
4279 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); | |
4280 goto LABEL_1056; | |
0 | 4281 } |
4282 v105 = 0; | |
4283 v726 = (Player *)((int)v733 << 7); | |
4284 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
89 | 4285 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
0 | 4286 do |
4287 { | |
488 | 4288 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v105); |
486 | 4289 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536); |
4290 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | |
89 | 4291 ++v730b; |
0 | 4292 ++v105; |
4293 } | |
89 | 4294 while ( v730b <= &pParty->pPlayers[3] ); |
0 | 4295 goto LABEL_1056; |
488 | 4296 |
0 | 4297 case 52: |
486 | 4298 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && (a2 & 7) == OBJECT_Actor) |
0 | 4299 { |
4300 v730 = a2 >> 3; | |
4301 v112 = &pActors[a2 >> 3]; | |
4302 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | |
4303 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | |
4304 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | |
4305 _this = (ItemGen *)v113; | |
4306 v114 = v721; | |
4307 v115 = (unsigned int)v726; | |
4308 if ( v113 < v721 ) | |
4309 { | |
4310 v116 = v113; | |
4311 v113 = v721; | |
4312 v114 = v116; | |
4313 } | |
4314 if ( v113 < (signed int)v726 ) | |
4315 { | |
4316 v117 = v113; | |
4317 v113 = (int)v726; | |
4318 v115 = v117; | |
4319 } | |
4320 if ( v114 < (signed int)v115 ) | |
4321 { | |
4322 v118 = v115; | |
4323 v115 = v114; | |
4324 v114 = v118; | |
4325 } | |
4326 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | |
4327 if ( (double)(signed int)this <= 307.2 ) | |
4328 { | |
4329 v703 = 0; | |
4330 v702 = 0; | |
4331 v701 = 0; | |
4332 a1.stru_24.Reset(); | |
4333 v119 = HIDWORD(v733); | |
4334 a1.field_48 = *(int *)HIDWORD(v733); | |
4335 a1.field_4C = v723; | |
4336 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4337 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4338 a1.uAttributes = 0; |
4339 a1.uSectorID = 0; | |
4340 a1.uSpriteFrameID = 0; | |
4341 v120 = 8 * *(short *)(v119 + 2); | |
303 | 4342 LOBYTE(v120) = v120 | OBJECT_Player; |
0 | 4343 a1.field_60_distance_related_prolly_lod = 0; |
303 | 4344 a1.field_58_pid = v120; |
0 | 4345 a1.uFacing = 0; |
4346 a1.uSoundID = *(short *)(v119 + 16); | |
4347 a1.vPosition.x = v112->vPosition.x; | |
4348 a1.vPosition.y = v112->vPosition.y; | |
4349 v726 = (Player *)v112->uActorHeight; | |
4350 v121 = 8 * a2; | |
4351 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4352 LOBYTE(v121) = 8 * a2 | 3; | |
4353 a1.field_5C = v121; | |
4354 v122 = a1.Create(0, 0, 0, 0); | |
4355 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | |
4356 LODWORD(v727) = 1; | |
4357 } | |
4358 else | |
4359 { | |
4360 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
4361 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4362 *(int *)HIDWORD(v733) = 0; | |
4363 } | |
4364 v3 = (stru277 *)HIDWORD(v733); | |
4365 } | |
488 | 4366 goto play_sound_and_continue; |
4367 | |
4368 case SPELL_AIR_SHIELD: | |
4369 case SPELL_EARTH_STONESKIN: | |
4370 case SPELL_SPIRIT_HEROISM: | |
0 | 4371 v123 = v12 - 1; |
4372 if ( v123 && (v124 = v123 - 1) != 0 ) | |
4373 { | |
4374 v125 = v124 - 1; | |
4375 if ( v125 ) | |
4376 { | |
4377 if ( v125 != 1 ) | |
4378 goto LABEL_296; | |
4379 v126 = 3600 * (v2 + 1); | |
4380 } | |
4381 else | |
4382 { | |
4383 v126 = 900 * (v2 + 4); | |
4384 } | |
4385 } | |
4386 else | |
4387 { | |
4388 v126 = 300 * (v2 + 12); | |
4389 } | |
4390 LODWORD(v733) = v126; | |
4391 LABEL_296: | |
4392 v127 = v3->spellnum; | |
4393 if ( v127 == 17 ) | |
4394 { | |
486 | 4395 amount = 0; |
0 | 4396 LODWORD(v725) = 14; |
4397 } | |
4398 else | |
4399 { | |
4400 if ( v127 == 38 ) | |
4401 { | |
4402 LODWORD(v725) = 15; | |
4403 amount = v2 + 5; | |
4404 } | |
4405 else | |
4406 { | |
4407 if ( v127 != 51 ) | |
4408 goto LABEL_1166; | |
4409 LODWORD(v725) = 9; | |
4410 amount = v2 + 5; | |
4411 } | |
4412 } | |
4413 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4414 goto play_sound_and_continue; |
4415 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4416 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4417 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4418 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4419 v83 = 1; |
4420 v726 = (Player *)((int)v733 << 7); | |
4421 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | |
488 | 4422 //LABEL_304: |
4423 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); | |
4424 LODWORD(v727) = v83; | |
4425 goto play_sound_and_continue; | |
4426 | |
4427 case SPELL_FIRE_IMMOLATION: | |
0 | 4428 v138 = v12 - 2; |
4429 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | |
4430 v140 = 600 * v2; | |
4431 else | |
4432 v140 = 60 * v2; | |
4433 LODWORD(v733) = v140; | |
4434 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4435 goto play_sound_and_continue; |
4436 | |
4437 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
4438 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4439 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4440 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
4441 | |
0 | 4442 v726 = (Player *)((int)v733 << 7); |
488 | 4443 |
4444 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | |
4445 goto LABEL_1056; | |
4446 | |
0 | 4447 case 9: |
4448 v149 = v12 - 1; | |
4449 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | |
4450 { | |
4451 if ( v151 == 1 ) | |
4452 _this = (ItemGen *)20; | |
4453 } | |
4454 else | |
4455 { | |
4456 _this = (ItemGen *)16; | |
4457 } | |
4458 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4459 { | |
710 | 4460 ShowStatusBarString(pGlobalTXT_LocalizationStrings[491], 2); // Can't cast Meteor Shower indoors! |
4461 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4462 goto LABEL_203; | |
0 | 4463 } |
4464 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4465 goto play_sound_and_continue; |
0 | 4466 LODWORD(v725) = a2 & 7; |
141 | 4467 if ( (a2 & 7) == OBJECT_Actor) |
0 | 4468 { |
4469 v152 = a2 >> 3; | |
4470 uRequiredMana = pActors[v152].vPosition.x; | |
4471 v153 = pActors[v152].vPosition.y; | |
4472 v154 = pActors[v152].vPosition.z; | |
4473 LODWORD(v727) = v153; | |
4474 } | |
4475 else | |
4476 { | |
323 | 4477 v155 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4478 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155); |
323 | 4479 v156 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4480 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); |
4481 v154 = pParty->vPosition.z; | |
4482 } | |
4483 HIDWORD(v733) = v154; | |
4484 v713 = v154 + 2500; | |
486 | 4485 v721 = 0; |
4486 LODWORD(v718) = 0; | |
4487 if ( (signed int)this > 0 ) | |
0 | 4488 { |
4489 *(float *)&y = (double)SHIDWORD(v733); | |
4490 *(float *)&v732 = (double)v713; | |
4491 v730 = LODWORD(v725) == 3 ? a2 : 0; | |
4492 v726 = (Player *)this; | |
4493 do | |
4494 { | |
4495 v157 = rand(); | |
4496 v158 = (double)SLODWORD(v718); | |
4497 v718 = v158; | |
4498 v159 = (double)v721; | |
4499 *(float *)&v721 = v159; | |
4500 a2 = v157 % 1000; | |
4501 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | |
4502 v725 = v159 * v159; | |
4503 *(float *)&_this = v158 * v158; | |
4504 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | |
4505 { | |
486 | 4506 LODWORD(v687) = 0; |
4507 HIDWORD(v687) = 0; | |
0 | 4508 } |
4509 else | |
4510 { | |
4511 x = (signed __int64)sqrt(*(float *)&_this + v725); | |
4512 v687 = __PAIR__( | |
4513 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)), | |
4514 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); | |
4515 } | |
4516 a1.stru_24.Reset(); | |
4517 a1.field_48 = v3->spellnum; | |
4518 a1.field_4C = v2; | |
4519 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4520 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 4521 a1.uAttributes = 0; |
0 | 4522 a1.vPosition.x = uRequiredMana; |
4523 a1.vPosition.y = LODWORD(v727); | |
486 | 4524 a1.uSectorID = 0; |
0 | 4525 a1.vPosition.z = a2 + v713; |
486 | 4526 a1.uSpriteFrameID = 0; |
303 | 4527 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4528 a1.field_5C = v730; |
4529 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | |
4530 a1.uFacing = v687; | |
4531 a1.uSoundID = LOWORD(v3->field_10); | |
4532 if ( pParty->bTurnBasedModeOn == 1 ) | |
4533 a1.uAttributes = 4; | |
4534 if ( a1.Create( | |
4535 v687, | |
4536 SHIDWORD(v687), | |
4537 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4538 0) != -1 |
0 | 4539 && pParty->bTurnBasedModeOn == 1 ) |
4540 ++pTurnEngine->field_1C; | |
4541 LODWORD(v718) = rand() % 1024 - 512; | |
4542 v160 = rand(); | |
4543 v14 = v726 == (Player *)1; | |
4544 v726 = (Player *)((char *)v726 - 1); | |
4545 v721 = (unsigned __int64)(v160 % 1024) - 512; | |
4546 } | |
4547 while ( !v14 ); | |
4548 } | |
4549 goto LABEL_1056; | |
4550 case 10: | |
710 | 4551 //v67 = 2; |
0 | 4552 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
4553 { | |
710 | 4554 ShowStatusBarString(pGlobalTXT_LocalizationStrings[492], 2); // Can't cast Inferno outdoors! |
4555 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4556 goto LABEL_203; | |
0 | 4557 } |
4558 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4559 goto play_sound_and_continue; |
0 | 4560 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
486 | 4561 v700.z = 0; |
4562 v700.y = 0; | |
4563 v700.x = 0; | |
0 | 4564 a1.stru_24.Reset(); |
4565 a1.field_48 = v3->spellnum; | |
4566 a1.field_4C = v2; | |
4567 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4568 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 4569 a1.uAttributes = 0; |
4570 a1.uSectorID = 0; | |
4571 a1.uSpriteFrameID = 0; | |
0 | 4572 v161 = v3->uPlayerID; |
4573 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 4574 a1.uFacing = 0; |
0 | 4575 v161 *= 8; |
303 | 4576 LOBYTE(v161) = v161 | OBJECT_Player; |
4577 a1.field_58_pid = v161; | |
0 | 4578 a1.uSoundID = LOWORD(v3->field_10); |
486 | 4579 a2 = 0; |
4580 if ( (signed int)v726 > 0 ) | |
0 | 4581 { |
4582 do | |
4583 { | |
4584 v162 = dword_50BF30[a2]; | |
4585 a1.vPosition.x = pActors[v162].vPosition.x; | |
4586 a1.vPosition.y = pActors[v162].vPosition.y; | |
4587 v732 = pActors[v162].uActorHeight; | |
4588 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
4589 v163 = 8 * dword_50BF30[a2]; | |
486 | 4590 LOBYTE(v163) = v163 | OBJECT_Actor; |
0 | 4591 a1.field_5C = v163; |
486 | 4592 v164 = a1.Create(0, 0, 0, 0); |
0 | 4593 v165 = a2; |
4594 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | |
488 | 4595 pGame->GetStru6()->_4A81CA(&a1); |
4596 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | |
0 | 4597 a2 = v165 + 1; |
4598 } | |
4599 while ( v165 + 1 < (signed int)v726 ); | |
4600 } | |
4601 goto LABEL_1056; | |
488 | 4602 |
4603 case SPELL_AIR_WIZARD_EYE: | |
0 | 4604 LODWORD(v733) = 3600 * v2; |
4605 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4606 goto play_sound_and_continue; |
0 | 4607 v168 = 0; |
4608 do | |
4609 { | |
486 | 4610 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536); |
0 | 4611 v716 = v169; |
4612 } | |
4613 while ( v168 < 4 ); | |
488 | 4614 |
0 | 4615 v732 = (int)v733 << 7; |
488 | 4616 |
4617 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | |
4618 goto LABEL_1056; | |
4619 | |
4620 case SPELL_AIR_FEATHER_FALL: | |
0 | 4621 v170 = v12 - 1; |
4622 if ( !v170 ) | |
4623 { | |
4624 v173 = 300 * v2; | |
4625 goto LABEL_353; | |
4626 } | |
4627 v171 = v170 - 1; | |
4628 if ( !v171 ) | |
4629 { | |
4630 v173 = 600 * v2; | |
4631 goto LABEL_353; | |
4632 } | |
4633 v172 = v171 - 1; | |
4634 if ( !v172 || v172 == 1 ) | |
4635 { | |
4636 v173 = 3600 * v2; | |
4637 LABEL_353: | |
4638 LODWORD(v733) = v173; | |
4639 } | |
4640 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4641 goto play_sound_and_continue; |
0 | 4642 v174 = 0; |
4643 do | |
486 | 4644 pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536); |
0 | 4645 while ( v174 < 4 ); |
488 | 4646 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4647 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4648 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4649 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4650 v83 = 1; |
4651 v732 = (int)v733 << 7; | |
488 | 4652 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); |
4653 LODWORD(v727) = v83; | |
4654 goto play_sound_and_continue; | |
4655 | |
4656 case SPELL_AIR_SPARKS: | |
0 | 4657 v184 = v12 - 1; |
4658 if ( v184 ) | |
4659 { | |
4660 v185 = v184 - 1; | |
4661 if ( v185 ) | |
4662 { | |
4663 v186 = v185 - 1; | |
4664 if ( v186 ) | |
4665 { | |
4666 if ( v186 == 1 ) | |
4667 amount = 9; | |
4668 } | |
4669 else | |
4670 { | |
4671 amount = 7; | |
4672 } | |
4673 } | |
4674 else | |
4675 { | |
4676 amount = 5; | |
4677 } | |
4678 } | |
4679 else | |
4680 { | |
4681 amount = 3; | |
4682 } | |
4683 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4684 goto play_sound_and_continue; |
0 | 4685 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); |
4686 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4687 a1.stru_24.Reset(); | |
4688 a1.field_48 = v3->spellnum; | |
4689 a1.field_4C = v2; | |
4690 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4691 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4692 a1.vPosition.y = pParty->vPosition.y; |
4693 a1.vPosition.x = pParty->vPosition.x; | |
486 | 4694 a1.uAttributes = 0; |
0 | 4695 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
4696 a1.uSectorID = pIndoor->GetSector( | |
4697 pParty->vPosition.x, | |
4698 pParty->vPosition.y, | |
4699 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 4700 a1.uSpriteFrameID = 0; |
0 | 4701 v187 = 8 * v3->uPlayerID; |
303 | 4702 LOBYTE(v187) = v187 | OBJECT_Player; |
4703 a1.field_58_pid = v187; | |
0 | 4704 a1.field_5C = a2; |
4705 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4706 a1.uSoundID = LOWORD(v3->field_10); | |
4707 if ( pParty->bTurnBasedModeOn == 1 ) | |
4708 LOBYTE(a1.uAttributes) |= 4u; | |
4709 v188 = (signed int)v726 / -2; | |
4710 v189 = (signed int)v726 / 2; | |
4711 while ( v188 <= v189 ) | |
4712 { | |
4713 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | |
4714 if ( a1.Create( | |
4715 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | |
4716 v715.uPitchAngle, | |
4717 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
4718 v3->uPlayerID + 1) != -1 | |
4719 && pParty->bTurnBasedModeOn == 1 ) | |
4720 ++pTurnEngine->field_1C; | |
4721 v188 += v732; | |
4722 } | |
4723 goto LABEL_1056; | |
4724 case 16: | |
569 | 4725 if ( pParty->uFlags & PARTY_FLAGS_1_FALLING) |
4726 { | |
710 | 4727 ShowStatusBarString(pGlobalTXT_LocalizationStrings[493], 2); // Can't cast Jump while airborne! |
4728 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4729 goto play_sound_and_continue; | |
0 | 4730 } |
4731 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4732 goto play_sound_and_continue; |
0 | 4733 v191 = 0; |
4734 do | |
486 | 4735 pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536); |
0 | 4736 while ( v191 < 4 ); |
4737 BYTE1(pParty->uFlags) |= 1u; | |
4738 pParty->uFallSpeed = 1000; | |
4739 goto LABEL_1056; | |
488 | 4740 |
4741 case SPELL_AIR_INVISIBILITY: | |
0 | 4742 v192 = v12 - 1; |
4743 if ( !v192 ) | |
4744 { | |
4745 amount = v2; | |
4746 goto LABEL_391; | |
4747 } | |
4748 v193 = v192 - 1; | |
4749 if ( !v193 ) | |
4750 { | |
4751 v196 = 2 * v2; | |
4752 LABEL_389: | |
4753 amount = v196; | |
4754 LABEL_391: | |
4755 v195 = 600 * v2; | |
4756 goto LABEL_392; | |
4757 } | |
4758 v194 = v193 - 1; | |
4759 if ( !v194 ) | |
4760 { | |
4761 v196 = 3 * v2; | |
4762 goto LABEL_389; | |
4763 } | |
4764 if ( v194 != 1 ) | |
4765 goto LABEL_393; | |
4766 amount = 4 * v2; | |
4767 v195 = 3600 * v2; | |
4768 LABEL_392: | |
4769 LODWORD(v733) = v195; | |
4770 LABEL_393: | |
710 | 4771 if (pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW)) |
4772 { | |
4773 ShowStatusBarString(pGlobalTXT_LocalizationStrings[638], 2); // There are hostile creatures nearby! | |
4774 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4775 goto LABEL_203; | |
0 | 4776 } |
4777 if ( pPlayer->CanCastSpell(uRequiredMana) ) | |
4778 { | |
488 | 4779 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4780 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
4781 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
4782 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 4783 v83 = 1; |
4784 v732 = (int)v733 << 7; | |
488 | 4785 |
4786 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 | 4787 LODWORD(v727) = v83; |
4788 } | |
488 | 4789 goto play_sound_and_continue; |
710 | 4790 |
0 | 4791 case 21: |
4792 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4793 { | |
710 | 4794 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2); // Can not cast Fly indoors! |
486 | 4795 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
488 | 4796 goto play_sound_and_continue; |
0 | 4797 } |
4798 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
4799 { | |
710 | 4800 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
4801 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4802 goto play_sound_and_continue; | |
0 | 4803 } |
4804 LODWORD(v733) = 3600 * v2; | |
486 | 4805 if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) ) |
0 | 4806 amount = 1; |
4807 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4808 goto play_sound_and_continue; |
0 | 4809 v205 = 0; |
4810 do | |
486 | 4811 pOtherOverlayList->_4418B1(2090, v205++ + 100, 0, 65536); |
0 | 4812 while ( v205 < 4 ); |
486 | 4813 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); |
0 | 4814 v207 = v3->uPlayerID + 1; |
4815 v716 = v206; | |
488 | 4816 |
0 | 4817 v732 = (int)v733 << 7; |
488 | 4818 |
4819 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207); | |
0 | 4820 goto LABEL_1056; |
488 | 4821 |
0 | 4822 case 22: |
710 | 4823 //v67 = 2; |
0 | 4824 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
4825 { | |
710 | 4826 ShowStatusBarString(pGlobalTXT_LocalizationStrings[495], 2); // Can't cast Starburst indoors! |
4827 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
4828 goto LABEL_203; | |
0 | 4829 } |
4830 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4831 goto play_sound_and_continue; |
0 | 4832 v208 = a2 & 7; |
4833 LODWORD(v725) = a2 & 7; | |
4834 if ( v208 == 3 ) | |
4835 { | |
4836 v209 = a2 >> 3; | |
4837 LODWORD(v718) = pActors[v209].vPosition.x; | |
4838 v210 = pActors[v209].vPosition.y; | |
4839 v211 = pActors[v209].vPosition.z; | |
4840 v713 = v210; | |
4841 } | |
4842 else | |
4843 { | |
323 | 4844 v212 = stru_5C6E00->Cos(pParty->sRotationY); |
0 | 4845 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212); |
323 | 4846 v213 = stru_5C6E00->Sin(pParty->sRotationY); |
0 | 4847 v214 = sub_42EBBE(2048, v213); |
4848 v211 = pParty->vPosition.z; | |
4849 v713 = pParty->vPosition.y + v214; | |
4850 v208 = LODWORD(v725); | |
4851 } | |
4852 v726 = (Player *)v211; | |
486 | 4853 HIDWORD(v733) = 0; |
0 | 4854 *(float *)&v732 = (double)v211; |
4855 LODWORD(v725) = v211 + 2500; | |
486 | 4856 v721 = 0; |
0 | 4857 *(float *)&y = (double)(v211 + 2500); |
4858 v730 = v208 == 3 ? a2 : 0; | |
4859 a2 = 20; | |
4860 do | |
4861 { | |
4862 v215 = rand(); | |
4863 v216 = (double)v721; | |
4864 v727 = v216; | |
4865 v217 = (double)SHIDWORD(v733); | |
4866 *(float *)&uRequiredMana = v217; | |
4867 _this = (ItemGen *)(v215 % 1000); | |
4868 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | |
4869 *(float *)&v721 = v217 * v217; | |
4870 *(float *)&v726 = v216 * v216; | |
4871 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | |
4872 { | |
486 | 4873 LODWORD(v685) = 0; |
4874 HIDWORD(v685) = 0; | |
0 | 4875 } |
4876 else | |
4877 { | |
4878 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | |
4879 v685 = __PAIR__( | |
4880 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | |
4881 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | |
4882 } | |
4883 a1.stru_24.Reset(); | |
4884 a1.field_48 = v3->spellnum; | |
4885 a1.field_4C = v2; | |
4886 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4887 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 4888 a1.uAttributes = 0; |
0 | 4889 a1.vPosition.x = LODWORD(v718); |
4890 a1.vPosition.y = v713; | |
486 | 4891 a1.uSectorID = 0; |
0 | 4892 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); |
486 | 4893 a1.uSpriteFrameID = 0; |
303 | 4894 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
0 | 4895 a1.field_5C = v730; |
4896 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | |
4897 a1.uFacing = v685; | |
4898 a1.uSoundID = LOWORD(v3->field_10); | |
4899 if ( pParty->bTurnBasedModeOn == 1 ) | |
4900 a1.uAttributes = 4; | |
4901 if ( a1.Create( | |
4902 v685, | |
4903 SHIDWORD(v685), | |
4904 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
486 | 4905 0) != -1 |
0 | 4906 && pParty->bTurnBasedModeOn == 1 ) |
4907 ++pTurnEngine->field_1C; | |
4908 v721 = rand() % 1024 - 512; | |
4909 v218 = rand(); | |
4910 v14 = a2-- == 1; | |
4911 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | |
4912 } | |
4913 while ( !v14 ); | |
4914 goto LABEL_1056; | |
4915 case 23: | |
4916 v219 = v12 - 2; | |
4917 if ( v219 ) | |
4918 { | |
4919 v220 = v219 - 1; | |
4920 if ( v220 ) | |
4921 { | |
4922 if ( v220 == 1 ) | |
4923 { | |
486 | 4924 amount = 0; |
0 | 4925 goto LABEL_433; |
4926 } | |
4927 v221 = 180 * v2; | |
4928 } | |
4929 else | |
4930 { | |
4931 v221 = 86400 * v2; | |
4932 } | |
4933 } | |
4934 else | |
4935 { | |
4936 v221 = 3600 * v2; | |
4937 } | |
4938 amount = v221; | |
4939 LABEL_433: | |
4940 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4941 goto play_sound_and_continue; |
0 | 4942 v222 = (char *)pParty->pPlayers; |
4943 HIDWORD(v733) = (int)(char *)&pParty + 2508; | |
4944 break; | |
4945 case 24: | |
4946 v224 = v12 - 2; | |
4947 if ( v224 ) | |
4948 { | |
4949 v225 = v224 - 1; | |
4950 if ( v225 ) | |
4951 { | |
4952 if ( v225 == 1 ) | |
4953 amount = 7; | |
4954 else | |
4955 amount = 1; | |
4956 } | |
4957 else | |
4958 { | |
4959 amount = 5; | |
4960 } | |
4961 } | |
4962 else | |
4963 { | |
4964 amount = 3; | |
4965 } | |
4966 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 4967 goto play_sound_and_continue; |
0 | 4968 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; |
4969 if ( amount == 1 ) | |
4970 { | |
4971 LABEL_152: | |
4972 a1.stru_24.Reset(); | |
4973 a1.field_48 = v3->spellnum; | |
4974 a1.field_50 = v731; | |
4975 a1.field_4C = v2; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
4976 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 4977 a1.vPosition.y = pParty->vPosition.y; |
4978 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4979 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | |
4980 v660 = pParty->vPosition.y; | |
4981 LABEL_153: | |
486 | 4982 a1.uAttributes = 0; |
0 | 4983 a1.vPosition.x = pParty->vPosition.x; |
4984 a1.vPosition.z = v51; | |
4985 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | |
486 | 4986 a1.uSpriteFrameID = 0; |
0 | 4987 a1.uSectorID = v52; |
4988 v53 = 8 * v3->uPlayerID; | |
303 | 4989 LOBYTE(v53) = v53 | OBJECT_Player; |
4990 a1.field_58_pid = v53; | |
0 | 4991 a1.field_5C = a2; |
4992 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
4993 a1.uFacing = LOWORD(v715.uYawAngle); | |
4994 a1.uSoundID = LOWORD(v3->field_10); | |
4995 LABEL_154: | |
4996 if ( pParty->bTurnBasedModeOn == 1 ) | |
4997 LOBYTE(a1.uAttributes) |= 4u; | |
4998 LABEL_156: | |
4999 v669 = v3->uPlayerID + 1; | |
5000 v36 = v715.uYawAngle; | |
5001 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5002 v654 = v715.uPitchAngle; | |
5003 LABEL_157: | |
5004 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
5005 ++pTurnEngine->field_1C; | |
5006 } | |
5007 else | |
5008 { | |
5009 v732 = SHIDWORD(v733) / (amount - 1); | |
5010 a1.stru_24.Reset(); | |
5011 a1.field_48 = v3->spellnum; | |
5012 a1.field_4C = v2; | |
5013 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5014 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 5015 a1.vPosition.y = pParty->vPosition.y; |
5016 a1.vPosition.x = pParty->vPosition.x; | |
486 | 5017 a1.uAttributes = 0; |
0 | 5018 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5019 a1.uSectorID = pIndoor->GetSector( | |
5020 pParty->vPosition.x, | |
5021 pParty->vPosition.y, | |
5022 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 5023 a1.uSpriteFrameID = 0; |
0 | 5024 v226 = 8 * v3->uPlayerID; |
303 | 5025 LOBYTE(v226) = v226 | OBJECT_Player; |
5026 a1.field_58_pid = v226; | |
0 | 5027 a1.field_5C = a2; |
5028 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5029 a1.uSoundID = LOWORD(v3->field_10); | |
5030 if ( pParty->bTurnBasedModeOn == 1 ) | |
5031 LOBYTE(a1.uAttributes) |= 4u; | |
5032 v227 = SHIDWORD(v733) / -2; | |
5033 y = (char *)(SHIDWORD(v733) / 2); | |
5034 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 ) | |
5035 { | |
5036 v228 = v715.uYawAngle; | |
5037 do | |
5038 { | |
5039 a1.uFacing = v227 + v228; | |
5040 if ( a1.Create( | |
5041 v227 + v228, | |
5042 v715.uPitchAngle, | |
5043 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
5044 v3->uPlayerID + 1) != -1 | |
5045 && pParty->bTurnBasedModeOn == 1 ) | |
5046 ++pTurnEngine->field_1C; | |
5047 v227 += v732; | |
5048 } | |
5049 while ( v227 <= (signed int)y ); | |
5050 } | |
5051 } | |
5052 goto LABEL_1056; | |
5053 case 27: | |
5054 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | |
710 | 5055 { |
5056 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
5057 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
5058 goto play_sound_and_continue; | |
5059 } | |
0 | 5060 if ( v731 == 2 || v731 != 3 && v731 != 4 ) |
5061 v229 = 600 * v2; | |
5062 else | |
5063 v229 = 3600 * v2; | |
5064 LODWORD(v733) = v229; | |
5065 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5066 goto play_sound_and_continue; |
486 | 5067 v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); |
488 | 5068 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
5069 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
5070 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
5071 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 5072 v239 = v3->uPlayerID + 1; |
5073 v732 = v229 << 7; | |
5074 pParty->pPartyBuffs[18].Apply( | |
5075 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | |
5076 v731, | |
5077 amount, | |
5078 v716, | |
5079 v239); | |
5080 if ( v731 == 4 ) | |
5081 pParty->pPartyBuffs[18].uFlags = 1; | |
488 | 5082 LODWORD(v727) = 1; |
5083 goto play_sound_and_continue; | |
710 | 5084 |
0 | 5085 case 28: |
5086 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5087 goto play_sound_and_continue; |
0 | 5088 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
5089 y = v240; | |
5090 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) | |
710 | 5091 { |
5092 dword_50C9D0 = 113; | |
5093 dword_50C9D4 = 0; | |
5094 dword_50C9D8 = 1; | |
5095 | |
5096 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
5097 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
5098 goto LABEL_203; | |
5099 } | |
0 | 5100 if ( v731 == 1 || v731 == 2 ) |
5101 { | |
5102 v241 = (double)v723 * 0.0099999998 + 0.5; | |
5103 } | |
5104 else | |
5105 { | |
5106 if ( v731 == 3 ) | |
5107 { | |
5108 v241 = (double)v723 * 0.0099999998 + 0.69999999; | |
5109 } | |
5110 else | |
5111 { | |
5112 if ( v731 != 4 ) | |
5113 { | |
5114 v241 = 0.0; | |
5115 goto LABEL_484; | |
5116 } | |
5117 v241 = (double)v723 * 0.0099999998 + 0.80000001; | |
5118 } | |
5119 } | |
5120 if ( v241 > 1.0 ) | |
5121 v241 = 1.0; | |
5122 LABEL_484: | |
5123 v732 = (unsigned __int8)v240[25]; | |
5124 v242 = (signed __int64)((double)v732 * v241); | |
5125 v243 = y; | |
5126 y[25] = v242; | |
5127 *((int *)v243 + 4) = (unsigned __int8)v242; | |
486 | 5128 if ( (unsigned __int8)v242 <= 0 ) |
5129 { | |
5130 *(int *)v243 = 0; | |
0 | 5131 dword_50C9D0 = 113; |
486 | 5132 dword_50C9D4 = 0; |
0 | 5133 dword_50C9D8 = 1; |
5134 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | |
486 | 5135 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5136 v3->spellnum = 0; | |
0 | 5137 goto LABEL_1165; |
5138 } | |
5139 *((int *)v243 + 5) |= 0x40u; | |
5140 goto LABEL_1055; | |
5141 case 30: | |
5142 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5143 goto play_sound_and_continue; |
486 | 5144 uRequiredMana = 0; |
0 | 5145 HIDWORD(v733) = 10 * v2; |
5146 v730 = 1; | |
5147 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
5148 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5149 if ( v731 == 1 ) | |
5150 { | |
5151 v245 = (int)&v244[36 * a2 + 532]; | |
5152 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | |
5153 v311 = __OFSUB__(*(int *)v245, 134); | |
5154 v14 = *(int *)v245 == 134; | |
5155 v310 = *(int *)v245 - 134 < 0; | |
5156 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | |
5157 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | |
5158 { | |
486 | 5159 if ( *(int *)&v244[36 * a2 + 544] == 0 ) |
0 | 5160 { |
486 | 5161 if ( *(int *)&v244[36 * a2 + 536] == 0 ) |
0 | 5162 { |
486 | 5163 if ( *(int *)&v244[36 * a2 + 540] == 0 ) |
0 | 5164 { |
5165 v312 = v309[28]; | |
5166 if ( v312 ) | |
5167 { | |
5168 if ( v312 != 1 ) | |
5169 { | |
5170 if ( v312 != 2 ) | |
5171 { | |
5172 _this = (ItemGen *)&v244[36 * a2 + 552]; | |
5173 if ( !(v244[36 * a2 + 552] & 2) ) | |
5174 { | |
5175 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | |
5176 { | |
5177 uRequiredMana = 1; | |
486 | 5178 v730 = 0; |
0 | 5179 } |
5180 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5181 uRequiredMana = 1; | |
486 | 5182 if (!uRequiredMana) |
0 | 5183 { |
5184 v313 = *(char *)(LODWORD(v725) + 28); | |
5185 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | |
5186 { | |
224 | 5187 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5188 *(int *)(v245 + 4) = 0; |
222 | 5189 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5190 + 1]; |
5191 ; | |
222 | 5192 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5193 + 1] ) |
5194 { | |
5195 ++*(int *)(v245 + 4); | |
5196 if ( j >= v314 ) | |
5197 break; | |
5198 } | |
5199 v254 = rand(); | |
224 | 5200 v255 = 10;//pItemsTable->field_116D8[17]; |
5201 v256 = 10;//pItemsTable->field_116D8[16]; | |
0 | 5202 LABEL_611: |
5203 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | |
5204 LABEL_612: | |
5205 _this->uItemID |= 0x20u; | |
5206 goto LABEL_1055; | |
5207 } | |
5208 goto LABEL_615; | |
5209 } | |
5210 LABEL_613: | |
5211 v316 = _this->uItemID; | |
5212 if ( !(BYTE1(v316) & 2) ) | |
5213 { | |
5214 LOBYTE(v316) = v316 | 2; | |
5215 _this->uItemID = v316; | |
5216 } | |
5217 } | |
5218 } | |
5219 } | |
5220 } | |
5221 } | |
5222 } | |
5223 } | |
5224 } | |
5225 LABEL_616: | |
486 | 5226 if ( LODWORD(v727) == 0 ) |
0 | 5227 { |
5228 v317 = pGlobalTXT_LocalizationStrings[428]; | |
486 | 5229 if ( v730 == 0 ) |
0 | 5230 v317 = pGlobalTXT_LocalizationStrings[585]; |
5231 ShowStatusBarString(v317, 2u); | |
486 | 5232 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
0 | 5233 v318 = v726; |
486 | 5234 v3->spellnum = 0; |
5235 v318->PlaySound(SPEECH_43, 0); | |
0 | 5236 } |
488 | 5237 goto play_sound_and_continue; |
0 | 5238 } |
5239 if ( v731 != 2 ) | |
5240 { | |
5241 if ( v731 == 3 ) | |
5242 { | |
5243 v245 = (int)&v244[36 * a2 + 532]; | |
5244 v269 = *(int *)v245; | |
5245 if ( *(int *)v245 > 134 | |
486 | 5246 || *(int *)(v245 + 12) != 0 |
5247 || *(int *)(v245 + 4) != 0 | |
5248 || *(int *)(v245 + 8) != 0 | |
0 | 5249 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) |
5250 goto LABEL_616; | |
5251 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | |
5252 LODWORD(v725) = (int)v270; | |
5253 v271 = v270[28]; | |
5254 if ( v271 && v271 != 1 && v271 != 2 ) | |
5255 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2; | |
5256 else | |
5257 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | |
5258 if ( v272 ) | |
5259 { | |
5260 uRequiredMana = 1; | |
486 | 5261 v730 = 0; |
0 | 5262 } |
5263 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5264 uRequiredMana = 1; | |
486 | 5265 if (uRequiredMana) |
0 | 5266 goto LABEL_613; |
5267 v273 = v725; | |
5268 v274 = *(char *)(LODWORD(v725) + 28); | |
5269 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 ) | |
5270 { | |
5271 if ( rand() % 100 < 80 | |
5272 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | |
5273 { | |
224 | 5274 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5275 *(int *)(v245 + 4) = 0; |
222 | 5276 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5277 ; |
222 | 5278 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5279 + 1] ) |
5280 { | |
5281 ++*(int *)(v245 + 4); | |
5282 if ( k >= v275 ) | |
5283 break; | |
5284 } | |
5285 v254 = rand(); | |
224 | 5286 v255 = 10;//pItemsTable->field_116D8[19]; |
5287 v256 = 10;//pItemsTable->field_116D8[18]; | |
0 | 5288 goto LABEL_611; |
5289 } | |
222 | 5290 v277 = pItemsTable->pSpecialEnchantments_count; |
0 | 5291 v278 = 0; |
5292 v725 = 0.0; | |
5293 HIDWORD(v733) = 0; | |
222 | 5294 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5295 { |
5296 v730 = (int)&v679; | |
5297 do | |
5298 { | |
222 | 5299 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement); |
0 | 5300 if ( !v279 || v279 == 1 ) |
5301 { | |
222 | 5302 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5303 + 4] |
5304 + v278 * 28); | |
5305 LODWORD(v725) += v280; | |
5306 if ( v280 ) | |
5307 { | |
5308 v281 = v730; | |
5309 v730 += 4; | |
5310 *(int *)v281 = HIDWORD(v733); | |
5311 } | |
5312 } | |
5313 ++HIDWORD(v733); | |
5314 ++v278; | |
5315 } | |
5316 while ( SHIDWORD(v733) < v277 ); | |
5317 } | |
5318 v282 = rand() % SLODWORD(v725); | |
5319 v283 = v679; | |
5320 *(int *)(v245 + 12) = v679; | |
222 | 5321 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5322 v285 = v282 + 1; |
5323 if ( v284 < v285 ) | |
5324 { | |
5325 for ( l = &v679; ; l = (int *)v732 ) | |
5326 { | |
5327 v287 = (int)(l + 1); | |
5328 v732 = v287; | |
5329 v288 = *(int *)v287; | |
5330 *(int *)(v245 + 12) = v288; | |
222 | 5331 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5332 + 4]; |
5333 if ( v284 >= v285 ) | |
5334 break; | |
5335 } | |
5336 } | |
5337 goto LABEL_525; | |
5338 } | |
5339 } | |
5340 else | |
5341 { | |
5342 if ( v731 != 4 | |
5343 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | |
486 | 5344 || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 |
570 | 5345 || v726->pInventoryItems[a2].uEnchantmentType != 0 |
486 | 5346 || v726->pInventoryItems[a2]._bonus_strength != 0 |
315 | 5347 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) |
0 | 5348 goto LABEL_616; |
5349 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | |
5350 LODWORD(v725) = (int)v247; | |
5351 v248 = v247[28]; | |
5352 if ( v248 && v248 != 1 && v248 != 2 ) | |
5353 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2; | |
5354 else | |
5355 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | |
5356 if ( v249 ) | |
5357 { | |
5358 uRequiredMana = 1; | |
486 | 5359 v730 = 0; |
0 | 5360 } |
5361 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5362 uRequiredMana = 1; | |
486 | 5363 if (uRequiredMana) |
0 | 5364 goto LABEL_613; |
5365 v250 = v725; | |
5366 v251 = *(char *)(LODWORD(v725) + 28); | |
5367 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 ) | |
5368 { | |
5369 if ( rand() % 100 < 80 | |
5370 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | |
5371 { | |
224 | 5372 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
0 | 5373 *(int *)(v245 + 4) = 0; |
222 | 5374 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
0 | 5375 ; |
222 | 5376 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5377 + 1] ) |
5378 { | |
5379 ++*(int *)(v245 + 4); | |
5380 if ( m >= v252 ) | |
5381 break; | |
5382 } | |
5383 v254 = rand(); | |
224 | 5384 v255 = 10;// pItemsTable->field_116D8[21]; |
5385 v256 = 10;//pItemsTable->field_116D8[20]; | |
0 | 5386 goto LABEL_611; |
5387 } | |
222 | 5388 v257 = pItemsTable->pSpecialEnchantments_count; |
0 | 5389 v258 = 0; |
5390 v725 = 0.0; | |
5391 HIDWORD(v733) = 0; | |
222 | 5392 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5393 { |
5394 v730 = (int)&v679; | |
5395 do | |
5396 { | |
222 | 5397 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
0 | 5398 if ( !v259 || v259 == 1 ) |
5399 { | |
222 | 5400 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5401 + 4] |
5402 + v258 * 28); | |
5403 LODWORD(v725) += v260; | |
5404 if ( v260 ) | |
5405 { | |
5406 v261 = v730; | |
5407 v730 += 4; | |
5408 *(int *)v261 = HIDWORD(v733); | |
5409 } | |
5410 } | |
5411 ++HIDWORD(v733); | |
5412 ++v258; | |
5413 } | |
5414 while ( SHIDWORD(v733) < v257 ); | |
5415 } | |
5416 v262 = rand() % SLODWORD(v725); | |
5417 v263 = v679; | |
5418 *(int *)(v245 + 12) = v679; | |
222 | 5419 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
0 | 5420 v265 = v262 + 1; |
5421 if ( v264 < v265 ) | |
5422 { | |
5423 for ( ii = &v679; ; ii = (int *)v732 ) | |
5424 { | |
5425 v267 = (int)(ii + 1); | |
5426 v732 = v267; | |
5427 v268 = *(int *)v267; | |
5428 *(int *)(v245 + 12) = v268; | |
222 | 5429 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
0 | 5430 + 4]; |
5431 if ( v264 >= v265 ) | |
5432 break; | |
5433 } | |
5434 } | |
5435 LABEL_525: | |
5436 ++*(int *)(v245 + 12); | |
5437 goto LABEL_612; | |
5438 } | |
5439 } | |
5440 LABEL_615: | |
486 | 5441 //v1 = 0; |
0 | 5442 goto LABEL_616; |
5443 } | |
5444 v289 = (ItemGen *)&v244[36 * a2 + 532]; | |
5445 _this = v289; | |
5446 v290 = v289->uItemID; | |
5447 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | |
5448 if ( v290 > 134 | |
486 | 5449 || _this->uSpecEnchantmentType != 0 |
570 | 5450 || _this->uEnchantmentType != 0 |
486 | 5451 || _this->_bonus_strength != 0 |
0 | 5452 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 |
5453 || v291 == 1 | |
5454 || v291 == 2 | |
315 | 5455 || _this->Broken()) |
0 | 5456 goto LABEL_616; |
5457 if ( _this->GetValue() < 0x1C2 ) | |
5458 uRequiredMana = 1; | |
5459 if ( rand() % 100 >= SHIDWORD(v733) ) | |
5460 uRequiredMana = 1; | |
486 | 5461 if ( uRequiredMana != 0 ) |
710 | 5462 { |
5463 dword_50C9D0 = 113; | |
5464 dword_50C9D4 = 0; | |
5465 dword_50C9D8 = 1; | |
5466 | |
5467 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
5468 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
5469 goto LABEL_203; | |
5470 } | |
0 | 5471 v292 = *(char *)(LODWORD(v725) + 28); |
5472 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | |
5473 { | |
5474 v2 = v723; | |
486 | 5475 //v1 = 0; |
710 | 5476 |
5477 dword_50C9D0 = 113; | |
5478 dword_50C9D4 = 0; | |
5479 dword_50C9D8 = 1; | |
5480 | |
5481 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
5482 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
5483 goto LABEL_203; | |
0 | 5484 } |
5485 if ( rand() % 100 >= 80 ) | |
5486 { | |
222 | 5487 v297 = pItemsTable->pSpecialEnchantments_count; |
0 | 5488 v294 = _this; |
5489 v298 = 0; | |
5490 v725 = 0.0; | |
5491 HIDWORD(v733) = 0; | |
222 | 5492 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
0 | 5493 { |
5494 v730 = (int)&v679; | |
5495 do | |
5496 { | |
222 | 5497 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement); |
0 | 5498 if ( !v299 || v299 == 1 ) |
5499 { | |
222 | 5500 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4] |
0 | 5501 + v298 * 28); |
5502 LODWORD(v725) += v300; | |
5503 if ( v300 ) | |
5504 { | |
5505 v301 = v730; | |
5506 v730 += 4; | |
5507 *(int *)v301 = HIDWORD(v733); | |
5508 } | |
5509 } | |
5510 ++HIDWORD(v733); | |
5511 ++v298; | |
5512 } | |
5513 while ( SHIDWORD(v733) < v297 ); | |
5514 } | |
5515 v302 = rand() % SLODWORD(v725); | |
5516 v303 = v679; | |
377 | 5517 v294->uSpecEnchantmentType = v679; |
222 | 5518 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5519 v305 = v302 + 1; |
5520 if ( v304 < v305 ) | |
5521 { | |
5522 for ( jj = &v679; ; jj = (int *)v732 ) | |
5523 { | |
5524 v307 = (int)(jj + 1); | |
5525 v732 = v307; | |
5526 v308 = *(int *)v307; | |
377 | 5527 v294->uSpecEnchantmentType = v308; |
222 | 5528 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
0 | 5529 if ( v304 >= v305 ) |
5530 break; | |
5531 } | |
5532 } | |
377 | 5533 ++v294->uSpecEnchantmentType; |
0 | 5534 } |
5535 else | |
5536 { | |
5537 v293 = rand(); | |
5538 v294 = _this; | |
224 | 5539 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
570 | 5540 _this->uEnchantmentType = 0; |
222 | 5541 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; |
0 | 5542 ; |
570 | 5543 kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType |
0 | 5544 + 1] ) |
5545 { | |
570 | 5546 ++v294->uEnchantmentType; |
0 | 5547 if ( kk >= v295 ) |
5548 break; | |
5549 } | |
224 | 5550 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5551 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | |
0 | 5552 } |
5553 v294->uAttributes |= 0x20u; | |
5554 goto LABEL_1055; | |
710 | 5555 case SPELL_WATER_TOWN_PORTAL: |
0 | 5556 amount = 10 * v2; |
5557 if ( pPlayer->sMana < (signed int)uRequiredMana ) | |
488 | 5558 goto play_sound_and_continue; |
710 | 5559 if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) |
5560 { | |
5561 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
5562 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
5563 goto LABEL_203; | |
5564 } | |
5565 town_portal_caster_id = LOBYTE(v3->uPlayerID); | |
5566 pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastTownPortal, 0, 0); | |
0 | 5567 goto LABEL_1056; |
5568 case 33: | |
5569 LODWORD(v733) = 604800 * v2; | |
5570 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | |
710 | 5571 { |
5572 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
5573 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
5574 goto LABEL_203; | |
5575 } | |
0 | 5576 v319 = uRequiredMana; |
5577 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | |
5578 { | |
5579 pEventTimer->Pause(); | |
486 | 5580 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, 0, 0); |
0 | 5581 qword_506350 = (signed int)v733; |
5582 _506348_current_lloyd_playerid = v3->uPlayerID; | |
5583 ::uRequiredMana = v319; | |
5584 ::sRecoveryTime = sRecoveryTime; | |
5585 dword_50633C = v3->field_10; | |
5586 dword_506338 = v3->spellnum; | |
5587 LOBYTE(v3->field_8) |= 0x20u; | |
5588 } | |
488 | 5589 goto play_sound_and_continue; |
0 | 5590 case 40: |
5591 v320 = v12 - 2; | |
5592 if ( !v320 ) | |
5593 goto LABEL_632; | |
5594 v321 = v320 - 1; | |
5595 if ( v321 ) | |
5596 { | |
5597 if ( v321 == 1 ) | |
5598 goto LABEL_634; | |
5599 LABEL_632: | |
5600 v322 = 3600 * v2; | |
5601 } | |
5602 else | |
5603 { | |
5604 v322 = 86400 * v2; | |
5605 } | |
5606 amount = v322; | |
5607 LABEL_634: | |
5608 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5609 goto play_sound_and_continue; |
0 | 5610 v323 = v3->uPlayerID_2; |
5611 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | |
5612 if ( !pParty->pPlayers[v323].pConditions[15] ) | |
5613 goto LABEL_1056; | |
5614 if ( v731 == 4 ) | |
5615 goto LABEL_637; | |
5616 v732 = amount << 7; | |
5617 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
5618 v656 = 15; | |
5619 goto LABEL_640; | |
5620 case 41: | |
5621 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5622 goto play_sound_and_continue; |
0 | 5623 a1.stru_24.Reset(); |
5624 a1.field_48 = v3->spellnum; | |
5625 a1.field_4C = v2; | |
5626 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5627 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 5628 a1.vPosition.y = pParty->vPosition.y; |
5629 a1.vPosition.x = pParty->vPosition.x; | |
486 | 5630 a1.uAttributes = 0; |
0 | 5631 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5632 a1.uSectorID = pIndoor->GetSector( | |
5633 pParty->vPosition.x, | |
5634 pParty->vPosition.y, | |
5635 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | |
486 | 5636 a1.uSpriteFrameID = 0; |
0 | 5637 v326 = 8 * v3->uPlayerID; |
303 | 5638 LOBYTE(v326) = v326 | OBJECT_Player; |
5639 a1.field_58_pid = v326; | |
0 | 5640 a1.field_5C = a2; |
5641 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
5642 a1.uFacing = LOWORD(pParty->sRotationY); | |
5643 a1.uSoundID = LOWORD(v3->field_10); | |
5644 if ( pParty->bTurnBasedModeOn == 1 ) | |
5645 LOBYTE(a1.uAttributes) |= 4u; | |
5646 v669 = v3->uPlayerID + 1; | |
5647 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
5648 v654 = pParty->sRotationX; | |
5649 goto LABEL_125; | |
5650 case 43: | |
5651 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
710 | 5652 { |
5653 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
5654 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
5655 goto LABEL_203; | |
5656 } | |
0 | 5657 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
488 | 5658 goto play_sound_and_continue; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5659 a1.uType = 4090; |
0 | 5660 a1.stru_24.Reset(); |
5661 a1.field_48 = v3->spellnum; | |
5662 a1.field_4C = v2; | |
5663 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5664 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 5665 a1.vPosition.x = pParty->vPosition.x; |
5666 a1.vPosition.y = pParty->vPosition.y; | |
486 | 5667 a1.uAttributes = 0; |
5668 a1.uSectorID = 0; | |
5669 a1.uSpriteFrameID = 0; | |
0 | 5670 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5671 v327 = 8 * v3->uPlayerID; | |
303 | 5672 LOBYTE(v327) = v327 | OBJECT_Player; |
0 | 5673 a1.field_60_distance_related_prolly_lod = 0; |
303 | 5674 a1.field_58_pid = v327; |
0 | 5675 a1.field_5C = a2; |
5676 a1.uFacing = LOWORD(pParty->sRotationY); | |
5677 a1.uSoundID = LOWORD(v3->field_10); | |
5678 if ( pParty->bTurnBasedModeOn == 1 ) | |
5679 a1.uAttributes = 4; | |
486 | 5680 v669 = 0; |
0 | 5681 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5682 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
5683 LABEL_124: | |
5684 v654 = v35; | |
5685 LABEL_125: | |
5686 v36 = pParty->sRotationY; | |
5687 goto LABEL_157; | |
488 | 5688 |
5689 case SPELL_SPIRIT_DETECT_LIFE: | |
0 | 5690 v328 = v12 - 2; |
5691 if ( v328 ) | |
5692 { | |
5693 v329 = v328 - 1; | |
5694 if ( v329 && v329 != 1 ) | |
5695 v330 = 600 * v2; | |
5696 else | |
5697 v330 = 3600 * v2; | |
5698 } | |
5699 else | |
5700 { | |
5701 v330 = 1800 * v2; | |
5702 } | |
5703 LODWORD(v733) = v330; | |
5704 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5705 goto play_sound_and_continue; |
5706 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
5707 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
5708 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
5709 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 5710 v83 = 1; |
488 | 5711 |
0 | 5712 v732 = (int)v733 << 7; |
488 | 5713 |
5714 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); | |
5715 LODWORD(v727) = v83; | |
5716 | |
5717 goto play_sound_and_continue; | |
5718 | |
5719 case SPELL_SPIRIT_FATE: | |
0 | 5720 LODWORD(v733) = 300; |
5721 v339 = v12 - 2; | |
5722 if ( v339 ) | |
5723 { | |
5724 v340 = v339 - 1; | |
5725 if ( v340 ) | |
5726 { | |
5727 if ( v340 != 1 ) | |
5728 { | |
5729 amount = v2; | |
5730 goto LABEL_667; | |
5731 } | |
5732 v341 = 6 * v2; | |
5733 } | |
5734 else | |
5735 { | |
5736 v341 = 4 * v2; | |
5737 } | |
5738 } | |
5739 else | |
5740 { | |
5741 v341 = 2 * v2; | |
5742 } | |
5743 amount = v341; | |
5744 LABEL_667: | |
5745 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5746 goto play_sound_and_continue; |
5747 v342 = v3->spell_target_pid; | |
486 | 5748 if ( v342 == 0 ) |
0 | 5749 { |
488 | 5750 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5751 | |
5752 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0); | |
5753 goto LABEL_1056; | |
0 | 5754 } |
141 | 5755 if ( (v342 & 7) == OBJECT_Actor) |
0 | 5756 { |
5757 v343 = v342 >> 3; | |
486 | 5758 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32); |
0 | 5759 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; |
486 | 5760 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0); |
0 | 5761 BYTE2(pActors[v343].uAttributes) |= 8u; |
486 | 5762 v672 = 0; |
0 | 5763 v661 = &pActors[v343]; |
5764 LABEL_165: | |
5765 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | |
5766 } | |
5767 goto LABEL_1056; | |
488 | 5768 |
0 | 5769 case 49: |
5770 v348 = v12 - 2; | |
5771 if ( !v348 ) | |
5772 goto LABEL_677; | |
5773 v349 = v348 - 1; | |
5774 if ( v349 ) | |
5775 { | |
5776 if ( v349 == 1 ) | |
5777 { | |
486 | 5778 amount = 0; |
0 | 5779 goto LABEL_679; |
5780 } | |
5781 LABEL_677: | |
5782 v350 = 3600 * v2; | |
5783 } | |
5784 else | |
5785 { | |
5786 v350 = 86400 * v2; | |
5787 } | |
5788 amount = v350; | |
5789 LABEL_679: | |
5790 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5791 goto play_sound_and_continue; |
0 | 5792 v351 = &pParty->pPlayers[v3->uPlayerID_2]; |
5793 if ( !v351->pConditions[0] ) | |
5794 goto LABEL_1056; | |
5795 if ( v731 == 4 ) | |
5796 { | |
486 | 5797 LODWORD(v351->pConditions[0]) = 0; |
5798 HIDWORD(v351->pConditions[0]) = 0; | |
0 | 5799 goto LABEL_904; |
5800 } | |
5801 v732 = amount << 7; | |
5802 v351->DiscardConditionIfLastsLongerThan( | |
486 | 5803 0, |
0 | 5804 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); |
5805 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | |
5806 goto LABEL_1056; | |
5807 v674 = v3->uPlayerID_2; | |
5808 goto LABEL_685; | |
488 | 5809 case SPELL_SPIRIT_PRESERVATION: |
0 | 5810 v354 = v12 - 2; |
5811 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | |
5812 v356 = 900 * (v2 + 4); | |
5813 else | |
5814 v356 = 300 * (v2 + 12); | |
5815 LODWORD(v733) = v356; | |
5816 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5817 goto play_sound_and_continue; |
0 | 5818 if ( v731 == 1 || v731 == 2 ) |
5819 { | |
488 | 5820 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5821 | |
0 | 5822 v732 = (int)v733 << 7; |
488 | 5823 |
5824 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); | |
5825 goto LABEL_1056; | |
0 | 5826 } |
486 | 5827 a2 = 0; |
0 | 5828 v732 = (int)v733 << 7; |
5829 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 5830 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
0 | 5831 do |
5832 { | |
488 | 5833 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
5834 v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); | |
0 | 5835 ++a2; |
112 | 5836 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5837 } | |
5838 while ( v357 <= &pParty->pPlayers[3] ); | |
0 | 5839 goto LABEL_1056; |
5840 case 48: | |
5841 v364 = v12 - 2; | |
5842 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | |
5843 v366 = 60 * (v2 + 3); | |
5844 else | |
5845 v366 = 300 * v2 + 180; | |
5846 LODWORD(v733) = v366; | |
5847 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5848 goto play_sound_and_continue; |
0 | 5849 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
5850 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
|
5851 ++a1.uType; |
0 | 5852 a1.stru_24.Reset(); |
5853 a1.field_48 = v3->spellnum; | |
5854 a1.field_4C = v2; | |
5855 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
5856 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 5857 a1.uAttributes = 0; |
5858 a1.uSectorID = 0; | |
5859 a1.uSpriteFrameID = 0; | |
0 | 5860 v368 = v3->uPlayerID; |
5861 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 5862 a1.uFacing = 0; |
0 | 5863 v368 *= 8; |
303 | 5864 LOBYTE(v368) = v368 | OBJECT_Player; |
5865 a1.field_58_pid = v368; | |
0 | 5866 a1.uSoundID = LOWORD(v3->field_10); |
486 | 5867 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 5868 { |
5869 v369 = &pActors[dword_50BF30[a2]]; | |
5870 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
5871 { | |
5872 a1.vPosition.x = v369->vPosition.x; | |
5873 a1.vPosition.y = v369->vPosition.y; | |
5874 v732 = v369->uActorHeight; | |
5875 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
5876 v370 = 8 * dword_50BF30[a2]; | |
486 | 5877 LOBYTE(v370) = v370 | OBJECT_Actor; |
0 | 5878 a1.field_5C = v370; |
486 | 5879 a1.Create(0, 0, 0, 0); |
0 | 5880 v732 = (int)v733 << 7; |
5881 v369->pActorBuffs[4].Apply( | |
5882 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
486 | 5883 v731, 0, 0, 0); |
0 | 5884 } |
5885 } | |
5886 goto LABEL_1056; | |
5887 case 53: | |
5888 v371 = v12 - 2; | |
5889 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | |
486 | 5890 amount = 0; |
0 | 5891 else |
5892 amount = 86400 * v2; | |
5893 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5894 goto play_sound_and_continue; |
486 | 5895 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, 0, 65536); |
0 | 5896 v373 = v3->uPlayerID_2; |
5897 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | |
5898 goto LABEL_1056; | |
5899 v14 = v731 == 4; | |
5900 pParty->pPlayers[v373].sHealth = 1; | |
5901 if ( v14 ) | |
5902 { | |
5903 v374 = v3->uPlayerID_2; | |
486 | 5904 LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0; |
5905 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0; | |
0 | 5906 v376 = v3->uPlayerID_2; |
486 | 5907 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0; |
5908 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0; | |
0 | 5909 } |
5910 else | |
5911 { | |
5912 v732 = amount << 7; | |
5913 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
5914 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5915 0xEu, | |
5916 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5917 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
5918 0xDu, | |
5919 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
5920 } | |
112 | 5921 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 5922 goto LABEL_720; |
5923 case 54: | |
5924 v378 = v12 - 2; | |
5925 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) | |
5926 v380 = 4 * v2; | |
5927 else | |
5928 v380 = 3 * v2; | |
5929 amount = v380; | |
5930 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 5931 goto play_sound_and_continue; |
0 | 5932 v381 = 0; |
5933 HIDWORD(v733) = amount; | |
5934 v730 = 0; | |
5935 v382 = 1; | |
5936 do | |
5937 { | |
5938 v383 = pPlayers[v382]; | |
5939 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] ) | |
5940 v682[v381++] = v382; | |
5941 ++v382; | |
5942 } | |
5943 while ( v382 <= 4 ); | |
5944 v384 = 0; | |
5945 v730 = v381; | |
486 | 5946 if ( v381 > 0 ) |
0 | 5947 { |
5948 do | |
5949 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | |
5950 while ( v384 < v381 ); | |
5951 } | |
5952 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | |
486 | 5953 HIDWORD(v733) = 0; |
5954 if ( v381 > 0 ) | |
0 | 5955 { |
5956 do | |
5957 { | |
5958 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | |
5959 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | |
5960 v726 = *(Player **)v385; | |
5961 v386 = v726->GetMaxHealth(); | |
5962 if ( v726->sHealth > v386 ) | |
5963 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | |
5964 v387 = *(Player **)v385; | |
486 | 5965 if ( v387->sHealth > 0 ) |
0 | 5966 { |
486 | 5967 LODWORD(v387->pConditions[13]) = 0; |
5968 HIDWORD(v387->pConditions[13]) = 0; | |
0 | 5969 } |
5970 v388 = HIDWORD(v733); | |
488 | 5971 |
5972 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, LOWORD(v682[HIDWORD(v733)]) - 1); | |
0 | 5973 HIDWORD(v733) = v388 + 1; |
5974 } | |
5975 while ( v388 + 1 < v730 ); | |
5976 } | |
5977 goto LABEL_1056; | |
488 | 5978 |
0 | 5979 case 55: |
5980 v392 = v12 - 1; | |
5981 if ( !v392 ) | |
5982 { | |
5983 v395 = 180 * v2; | |
5984 goto LABEL_750; | |
5985 } | |
5986 v393 = v392 - 1; | |
5987 if ( !v393 ) | |
5988 { | |
5989 v395 = 10800 * v2; | |
5990 goto LABEL_750; | |
5991 } | |
5992 v394 = v393 - 1; | |
5993 if ( !v394 ) | |
5994 { | |
5995 v395 = 259200 * v2; | |
5996 LABEL_750: | |
5997 amount = v395; | |
5998 goto LABEL_751; | |
5999 } | |
6000 if ( v394 == 1 ) | |
486 | 6001 amount = 0; |
0 | 6002 LABEL_751: |
6003 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6004 goto play_sound_and_continue; |
0 | 6005 v396 = v3->uPlayerID_2; |
6006 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | |
6007 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | |
6008 { | |
6009 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | |
486 | 6010 pParty->pPlayers[v396].PlaySound(SPEECH_25, 0); |
0 | 6011 if ( v731 == 4 ) |
6012 { | |
6013 v397 = v3->uPlayerID_2; | |
486 | 6014 LODWORD(pParty->pPlayers[v397].pConditions[16]) = 0; |
6015 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = 0; | |
0 | 6016 v398 = v3->uPlayerID_2; |
486 | 6017 LODWORD(pParty->pPlayers[v398].pConditions[14]) = 0; |
6018 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = 0; | |
0 | 6019 v399 = v3->uPlayerID_2; |
486 | 6020 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0; |
6021 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0; | |
0 | 6022 } |
6023 else | |
6024 { | |
6025 v732 = amount << 7; | |
6026 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6027 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6028 0x10u, | |
6029 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6030 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6031 0xEu, | |
6032 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6033 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6034 0xDu, | |
6035 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6036 } | |
6037 v83 = 1; | |
112 | 6038 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
488 | 6039 |
0 | 6040 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; |
488 | 6041 |
6042 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6043 } |
6044 else | |
6045 { | |
6046 v83 = 1; | |
6047 } | |
488 | 6048 LODWORD(v727) = v83; |
6049 goto play_sound_and_continue; | |
6050 | |
0 | 6051 case 61: |
6052 v405 = v12 - 2; | |
6053 if ( !v405 ) | |
6054 goto LABEL_766; | |
6055 v406 = v405 - 1; | |
6056 if ( v406 ) | |
6057 { | |
6058 if ( v406 == 1 ) | |
6059 { | |
486 | 6060 amount = 0; |
0 | 6061 goto LABEL_768; |
6062 } | |
6063 LABEL_766: | |
6064 v407 = 3600 * v2; | |
6065 } | |
6066 else | |
6067 { | |
6068 v407 = 86400 * v2; | |
6069 } | |
6070 amount = v407; | |
6071 LABEL_768: | |
6072 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6073 goto play_sound_and_continue; |
6074 | |
6075 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6076 v323 = v3->uPlayerID_2; |
6077 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | |
6078 if ( !pParty->pPlayers[v323].pConditions[12] ) | |
6079 goto LABEL_1056; | |
6080 if ( v731 == 4 ) | |
6081 goto LABEL_637; | |
6082 v732 = amount << 7; | |
6083 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6084 v656 = 12; | |
6085 goto LABEL_640; | |
6086 case 56: | |
6087 v411 = v12 - 2; | |
6088 if ( v411 ) | |
6089 { | |
6090 v412 = v411 - 1; | |
6091 if ( v412 ) | |
6092 { | |
6093 if ( v412 == 1 ) | |
6094 { | |
486 | 6095 amount = 0; |
0 | 6096 goto LABEL_780; |
6097 } | |
6098 v413 = 180 * v2; | |
6099 } | |
6100 else | |
6101 { | |
6102 v413 = 86400 * v2; | |
6103 } | |
6104 } | |
6105 else | |
6106 { | |
6107 v413 = 3600 * v2; | |
6108 } | |
6109 amount = v413; | |
6110 LABEL_780: | |
6111 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6112 goto play_sound_and_continue; |
6113 | |
6114 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6115 v323 = v3->uPlayerID_2; |
6116 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | |
6117 if ( !pParty->pPlayers[v323].pConditions[3] ) | |
6118 goto LABEL_1056; | |
6119 if ( v731 == 4 ) | |
6120 goto LABEL_637; | |
6121 v732 = amount << 7; | |
6122 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6123 v656 = 3; | |
6124 goto LABEL_640; | |
6125 case 59: | |
6126 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6127 goto play_sound_and_continue; |
486 | 6128 if ( a2 == 0 || (a2 & 7) != OBJECT_Actor) |
0 | 6129 goto LABEL_1056; |
6130 v417 = (int)&pActors[a2 >> 3]; | |
6131 v730 = v417; | |
6132 if ( !(*(char *)(v417 + 38) & 0x80) ) | |
6133 { | |
6134 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | |
6135 v417 = v730; | |
6136 } | |
6137 v418 = *(int *)(v417 + 672); | |
486 | 6138 HIDWORD(v733) = 0; |
0 | 6139 if ( pItemsTable->pItems[v418].uEquipType == 18 ) |
6140 HIDWORD(v733) = *(int *)(v417 + 684); | |
6141 | |
6142 //ItemGen::ItemGen(&v683); | |
6143 v683.Reset(); | |
6144 | |
6145 v419 = *(short *)(v730 + 180); | |
486 | 6146 if (v419) |
0 | 6147 { |
6148 v683.uItemID = v419; | |
6149 goto LABEL_799; | |
6150 } | |
6151 v420 = 0; | |
6152 v421 = v730 + 564; | |
486 | 6153 while ( !*(int *)v421 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) |
0 | 6154 { |
6155 ++v420; | |
6156 v421 += 36; | |
6157 if ( v420 >= 4 ) | |
6158 goto LABEL_799; | |
6159 } | |
6160 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | |
6161 v2 = v723; | |
486 | 6162 //v1 = 0; |
0 | 6163 LABEL_799: |
486 | 6164 if ( HIDWORD(v733) != 0 ) |
0 | 6165 { |
6166 v675 = (const char *)HIDWORD(v733); | |
486 | 6167 if (v683.uItemID) |
0 | 6168 { |
6169 v422 = v683.GetDisplayName(); | |
6170 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | |
6171 goto LABEL_807; | |
6172 } | |
6173 v664 = "%d gold"; | |
6174 goto LABEL_803; | |
6175 } | |
486 | 6176 if (v683.uItemID) |
0 | 6177 { |
6178 v675 = v683.GetDisplayName(); | |
6179 v664 = "(%s)"; | |
6180 LABEL_803: | |
6181 sprintf(pTmpBuf2, v664, v675); | |
6182 goto LABEL_807; | |
6183 } | |
6184 strcpy(pTmpBuf2, "nothing"); | |
6185 LABEL_807: | |
6186 ShowStatusBarString(pTmpBuf2, 2u); | |
6187 a1.stru_24.Reset(); | |
6188 a1.field_48 = v3->spellnum; | |
6189 a1.field_4C = v2; | |
6190 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6191 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 6192 a1.vPosition.x = *(short *)(v730 + 142); |
6193 a1.vPosition.y = *(short *)(v730 + 144); | |
6194 v676 = *(short *)(v730 + 138); | |
6195 v665 = a1.vPosition.y; | |
6196 a1.vPosition.z = *(short *)(v730 + 138); | |
6197 v657 = a1.vPosition.x; | |
6198 goto LABEL_1087; | |
6199 case 62: | |
6200 v423 = v12 - 2; | |
6201 if ( !v423 ) | |
6202 goto LABEL_813; | |
6203 v424 = v423 - 1; | |
6204 if ( v424 ) | |
6205 { | |
6206 if ( v424 == 1 ) | |
6207 v425 = 3600 * v2; | |
6208 else | |
6209 LABEL_813: | |
6210 v425 = 300 * v2; | |
6211 } | |
6212 else | |
6213 { | |
6214 v425 = 600 * v2; | |
6215 } | |
6216 amount = v425; | |
6217 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6218 goto play_sound_and_continue; |
0 | 6219 v426 = a2 >> 3; |
141 | 6220 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6221 goto LABEL_1056; |
6222 v730 = 836 * v426; | |
6223 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | |
6224 { | |
90 | 6225 pActors[v426].pActorBuffs[1].Reset(); |
6226 pActors[v426].pActorBuffs[12].Reset(); | |
0 | 6227 v732 = amount << 7; |
90 | 6228 pActors[v426].pActorBuffs[9].Apply( |
0 | 6229 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6230 v731, 0, 0, 0); |
90 | 6231 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
0 | 6232 } |
6233 a1.stru_24.Reset(); | |
6234 a1.field_48 = v3->spellnum; | |
6235 a1.field_4C = v2; | |
6236 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6237 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 6238 v61 = v426; |
0 | 6239 goto LABEL_1086; |
6240 case 66: | |
6241 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6242 goto play_sound_and_continue; |
0 | 6243 amount = 600 * v2; |
6244 v427 = a2 >> 3; | |
141 | 6245 if ( (a2 & 7) != OBJECT_Actor) |
0 | 6246 goto LABEL_1056; |
6247 v730 = 836 * v427; | |
6248 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
488 | 6249 goto play_sound_and_continue; |
90 | 6250 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6251 { | |
6252 pActors[v427].pActorBuffs[9].Reset(); | |
6253 pActors[v427].pActorBuffs[1].Reset(); | |
0 | 6254 v732 = amount << 7; |
90 | 6255 pActors[v427].pActorBuffs[12].Apply( |
0 | 6256 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
486 | 6257 v731, 0, 0, 0); |
0 | 6258 } |
6259 a1.stru_24.Reset(); | |
6260 a1.field_48 = v3->spellnum; | |
6261 a1.field_4C = v2; | |
6262 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6263 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 6264 v61 = v427; |
0 | 6265 goto LABEL_1086; |
6266 case 63: | |
6267 v428 = v12 - 2; | |
6268 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | |
6269 v430 = 300 * v2; | |
6270 else | |
6271 v430 = 180 * v2; | |
6272 amount = v430; | |
6273 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6274 goto play_sound_and_continue; |
0 | 6275 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
6276 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
|
6277 ++a1.uType; |
0 | 6278 a1.stru_24.Reset(); |
6279 a1.field_48 = v3->spellnum; | |
6280 a1.field_4C = v2; | |
6281 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6282 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 6283 a1.uAttributes = 0; |
6284 a1.uSectorID = 0; | |
6285 a1.uSpriteFrameID = 0; | |
0 | 6286 v432 = v3->uPlayerID; |
6287 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6288 a1.uFacing = 0; |
0 | 6289 v432 *= 8; |
303 | 6290 LOBYTE(v432) = v432 | OBJECT_Player; |
6291 a1.field_58_pid = v432; | |
0 | 6292 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6293 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
0 | 6294 { |
6295 v433 = &pActors[dword_50BF30[a2]]; | |
6296 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
6297 break; | |
6298 a1.vPosition.x = v433->vPosition.x; | |
6299 a1.vPosition.y = v433->vPosition.y; | |
6300 v732 = v433->uActorHeight; | |
6301 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6302 v434 = 8 * dword_50BF30[a2]; | |
486 | 6303 LOBYTE(v434) = v434 | OBJECT_Actor; |
0 | 6304 a1.field_5C = v434; |
486 | 6305 a1.Create(0, 0, 0, 0); |
0 | 6306 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) |
6307 { | |
6308 v732 = amount << 7; | |
6309 v433->pActorBuffs[4].Apply( | |
6310 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
486 | 6311 v731, 0, 0, 0); |
0 | 6312 } |
6313 } | |
6314 goto LABEL_1056; | |
6315 case 64: | |
6316 v435 = v12 - 2; | |
6317 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | |
486 | 6318 amount = 0; |
0 | 6319 else |
6320 amount = 86400 * v2; | |
6321 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6322 goto play_sound_and_continue; |
6323 | |
6324 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6325 v440 = v3->uPlayerID_2; |
6326 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | |
6327 { | |
6328 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | |
486 | 6329 pParty->pPlayers[v440].PlaySound(SPEECH_25, 0); |
0 | 6330 if ( v731 == 4 ) |
6331 { | |
6332 v441 = v3->uPlayerID_2; | |
486 | 6333 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; |
6334 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; | |
0 | 6335 } |
6336 else | |
6337 { | |
6338 v732 = amount << 7; | |
6339 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6340 5u, | |
6341 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | |
6342 } | |
6343 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | |
6344 LABEL_720: | |
486 | 6345 v377->SetCondition(1, 0); |
0 | 6346 } |
6347 goto LABEL_1056; | |
6348 case 42: | |
6349 v442 = v12 - 2; | |
6350 if ( !v442 ) | |
6351 goto LABEL_855; | |
6352 v443 = v442 - 1; | |
6353 if ( v443 ) | |
6354 { | |
6355 if ( v443 == 1 ) | |
6356 v444 = 4 * v2; | |
6357 else | |
6358 LABEL_855: | |
6359 v444 = 2 * v2; | |
6360 } | |
6361 else | |
6362 { | |
6363 v444 = 3 * v2; | |
6364 } | |
6365 amount = v444; | |
6366 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6367 goto play_sound_and_continue; |
0 | 6368 v445 = a2 >> 3; |
141 | 6369 if ( (a2 & 7) == OBJECT_Item) |
0 | 6370 { |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6371 v449 = (char *)&pSpriteObjects[v445].stru_24; |
0 | 6372 v450 = *(int *)v449; |
6373 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | |
6374 { | |
6375 party_finds_gold(*((int *)v449 + 3), 0); | |
6376 viewparams->bRedrawGameUI = 1; | |
6377 } | |
6378 else | |
6379 { | |
721 | 6380 sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
0 | 6381 ShowStatusBarString(pTmpBuf2, 2u); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6382 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
|
6383 pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24); |
0 | 6384 } |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6385 SpriteObject::OnInteraction(v445); |
0 | 6386 } |
6387 else | |
6388 { | |
141 | 6389 if ( (a2 & 7) == OBJECT_Actor) |
0 | 6390 { |
6391 stru_50C198.LootActor(&pActors[v445]); | |
6392 } | |
6393 else | |
6394 { | |
141 | 6395 if ( (a2 & 7) != OBJECT_Decoration) |
0 | 6396 { |
141 | 6397 if ( (a2 & 7) != OBJECT_BModel) |
0 | 6398 goto LABEL_1056; |
6399 dword_507CD8 = 1; | |
6400 v677 = 1; | |
6401 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6402 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | |
6403 else | |
6404 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | |
6405 goto LABEL_866; | |
6406 } | |
6407 v447 = &pLevelDecorations[v445]; | |
6408 dword_507CD8 = 1; | |
6409 v448 = v447->field_16_event_id; | |
486 | 6410 if (v448) |
0 | 6411 { |
6412 v677 = 1; | |
6413 v446 = v448; | |
6414 LABEL_866: | |
6415 EventProcessor(v446, a2, v677); | |
6416 goto LABEL_1056; | |
6417 } | |
6418 if ( v447->IsInteractive() ) | |
6419 { | |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
6420 activeLevelDecoration = v447; |
0 | 6421 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
|
6422 activeLevelDecoration = NULL; |
0 | 6423 } |
6424 } | |
6425 } | |
6426 goto LABEL_1056; | |
6427 case 67: | |
6428 v451 = v12 - 2; | |
6429 if ( v451 ) | |
6430 { | |
6431 v452 = v451 - 1; | |
6432 if ( v452 ) | |
6433 { | |
6434 if ( v452 == 1 ) | |
6435 { | |
486 | 6436 amount = 0; |
0 | 6437 goto LABEL_883; |
6438 } | |
6439 v453 = 180 * v2; | |
6440 } | |
6441 else | |
6442 { | |
6443 v453 = 86400 * v2; | |
6444 } | |
6445 } | |
6446 else | |
6447 { | |
6448 v453 = 3600 * v2; | |
6449 } | |
6450 amount = v453; | |
6451 LABEL_883: | |
6452 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6453 goto play_sound_and_continue; |
6454 | |
6455 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6456 v323 = v3->uPlayerID_2; |
6457 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | |
6458 if ( !pParty->pPlayers[v323].pConditions[1] ) | |
6459 goto LABEL_1056; | |
6460 if ( v731 == 4 ) | |
6461 { | |
6462 LABEL_637: | |
486 | 6463 *(int *)v324 = 0; |
6464 *((int *)v324 + 1) = 0; | |
0 | 6465 goto LABEL_1056; |
6466 } | |
6467 v732 = amount << 7; | |
6468 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | |
6469 v656 = 1; | |
6470 LABEL_640: | |
6471 v325 = &pParty->pPlayers[v323]; | |
6472 goto LABEL_641; | |
6473 case 68: | |
6474 v457 = v12 - 2; | |
6475 if ( v457 ) | |
6476 { | |
6477 v458 = v457 - 1; | |
6478 if ( v458 ) | |
6479 { | |
6480 if ( v458 == 1 ) | |
6481 v459 = 5 * v2 + 5; | |
6482 else | |
6483 v459 = 2 * v2 + 5; | |
6484 } | |
6485 else | |
6486 { | |
6487 v459 = 4 * v2 + 5; | |
6488 } | |
6489 } | |
6490 else | |
6491 { | |
6492 v459 = 3 * v2 + 5; | |
6493 } | |
6494 amount = v459; | |
6495 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6496 goto play_sound_and_continue; |
6497 v460 = v3->spell_target_pid; | |
486 | 6498 if (!v460) |
0 | 6499 { |
6500 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | |
6501 LABEL_904: | |
6502 v674 = v3->uPlayerID_2; | |
6503 LABEL_685: | |
488 | 6504 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v674); |
0 | 6505 } |
6506 else | |
6507 { | |
141 | 6508 if ( (v460 & 7) == OBJECT_Actor) |
0 | 6509 { |
6510 v461 = &pActors[v460 >> 3]; | |
6511 v462 = v461->uAIState; | |
6512 v463 = v461->pMonsterInfo.uHP; | |
6513 if ( v462 != 5 ) | |
6514 { | |
6515 if ( v462 != 4 ) | |
6516 { | |
6517 if ( v462 != 19 ) | |
6518 { | |
6519 if ( v462 != 11 ) | |
6520 { | |
6521 v461->sCurrentHP += amount; | |
6522 if ( v461->sCurrentHP > v463 ) | |
6523 v461->sCurrentHP = v463; | |
6524 } | |
6525 } | |
6526 } | |
6527 } | |
6528 } | |
6529 } | |
6530 goto LABEL_1056; | |
6531 case 72: | |
6532 v464 = v12 - 2; | |
6533 if ( !v464 ) | |
6534 goto LABEL_910; | |
6535 v465 = v464 - 1; | |
6536 if ( v465 ) | |
6537 { | |
6538 if ( v465 == 1 ) | |
6539 { | |
486 | 6540 amount = 0; |
0 | 6541 goto LABEL_912; |
6542 } | |
6543 LABEL_910: | |
6544 v466 = 3600 * v2; | |
6545 } | |
6546 else | |
6547 { | |
6548 v466 = 86400 * v2; | |
6549 } | |
6550 amount = v466; | |
6551 LABEL_912: | |
6552 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6553 goto play_sound_and_continue; |
6554 | |
6555 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6556 v470 = v3->uPlayerID_2; |
6557 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | |
6558 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | |
6559 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | |
6560 goto LABEL_1056; | |
6561 if ( v731 == 4 ) | |
6562 { | |
486 | 6563 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; |
6564 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; | |
0 | 6565 v471 = v3->uPlayerID_2; |
486 | 6566 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; |
6567 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; | |
0 | 6568 v472 = v3->uPlayerID_2; |
486 | 6569 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; |
6570 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; | |
0 | 6571 goto LABEL_1056; |
6572 } | |
6573 v732 = amount << 7; | |
6574 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6575 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | |
6576 6u, | |
6577 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6578 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6579 8u, | |
6580 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6581 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6582 v656 = 10; | |
6583 goto LABEL_937; | |
488 | 6584 |
6585 | |
0 | 6586 case 75: |
6587 amount = v2; | |
6588 LODWORD(v733) = 3600 * v2; | |
6589 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6590 goto play_sound_and_continue; |
6591 | |
6592 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6593 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6594 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6595 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6596 | |
0 | 6597 v732 = (int)v733 << 7; |
488 | 6598 |
6599 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | |
6600 goto LABEL_1056; | |
6601 | |
0 | 6602 case 73: |
6603 LODWORD(v733) = 3600 * v2; | |
6604 amount = v2; | |
6605 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6606 goto play_sound_and_continue; |
0 | 6607 if ( v731 == 4 ) |
6608 { | |
488 | 6609 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6610 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6611 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6612 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 6613 v732 = (int)v733 << 7; |
6614 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
488 | 6615 pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6616 pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6617 pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | |
6618 | |
6619 pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, v2, v2, 0); | |
6620 goto LABEL_1056; | |
6621 //goto LABEL_104; | |
6622 } | |
6623 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
6624 | |
0 | 6625 v732 = (int)v733 << 7; |
488 | 6626 |
6627 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); | |
6628 goto LABEL_1056; | |
0 | 6629 case 74: |
6630 v493 = v12 - 2; | |
6631 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | |
486 | 6632 amount = 0; |
0 | 6633 else |
6634 amount = 86400 * v2; | |
6635 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6636 goto play_sound_and_continue; |
6637 | |
6638 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
0 | 6639 v498 = v3->uPlayerID_2; |
6640 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | |
6641 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | |
6642 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | |
6643 goto LABEL_1056; | |
6644 if ( v731 == 4 ) | |
6645 { | |
486 | 6646 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; |
6647 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; | |
0 | 6648 v499 = v3->uPlayerID_2; |
486 | 6649 LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0; |
6650 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0; | |
0 | 6651 v500 = v3->uPlayerID_2; |
486 | 6652 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; |
6653 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; | |
0 | 6654 } |
6655 else | |
6656 { | |
6657 v732 = amount << 7; | |
6658 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | |
6659 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | |
6660 7u, | |
6661 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6662 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6663 9u, | |
6664 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | |
6665 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); | |
6666 v656 = 11; | |
6667 LABEL_937: | |
112 | 6668 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
0 | 6669 LABEL_641: |
6670 v325->DiscardConditionIfLastsLongerThan(v656, v663); | |
6671 } | |
6672 goto LABEL_1056; | |
6673 case 77: | |
486 | 6674 { |
0 | 6675 amount = 5 * v2 + 10; |
6676 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6677 goto play_sound_and_continue; |
0 | 6678 v501 = pParty->pPlayers; |
486 | 6679 int v1 = 0; |
0 | 6680 do |
6681 { | |
488 | 6682 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v1); |
0 | 6683 v501->Heal(amount); |
6684 ++v501; | |
6685 ++v1; | |
6686 } | |
6687 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | |
6688 goto LABEL_1056; | |
486 | 6689 } |
0 | 6690 case 80: |
6691 sRecoveryTime -= v2; | |
6692 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6693 goto play_sound_and_continue; |
6694 | |
0 | 6695 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); |
6696 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
|
6697 ++a1.uType; |
0 | 6698 HIDWORD(v733) = v505; |
486 | 6699 v690 = 0; |
6700 v689 = 0; | |
6701 v688 = 0; | |
0 | 6702 a1.stru_24.Reset(); |
6703 a1.field_48 = v3->spellnum; | |
6704 a1.field_4C = v2; | |
6705 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6706 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 6707 a1.uAttributes = 0; |
6708 a1.uSectorID = 0; | |
6709 a1.uSpriteFrameID = 0; | |
0 | 6710 v506 = v3->uPlayerID; |
6711 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6712 a1.uFacing = 0; |
0 | 6713 v506 *= 8; |
303 | 6714 LOBYTE(v506) = v506 | OBJECT_Player; |
6715 a1.field_58_pid = v506; | |
0 | 6716 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6717 a2 = 0; |
6718 if ( SHIDWORD(v733) > 0 ) | |
0 | 6719 { |
6720 do | |
6721 { | |
6722 v507 = dword_50BF30[a2]; | |
6723 a1.vPosition.x = pActors[v507].vPosition.x; | |
6724 a1.vPosition.y = pActors[v507].vPosition.y; | |
6725 v732 = pActors[v507].uActorHeight; | |
6726 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6727 v508 = 8 * dword_50BF30[a2]; | |
486 | 6728 LOBYTE(v508) = v508 | OBJECT_Actor; |
0 | 6729 a1.field_5C = v508; |
486 | 6730 v509 = a1.Create(0, 0, 0, 0); |
0 | 6731 v510 = a2; |
486 | 6732 DamageMonsterFromParty(8 * v509 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v688); |
0 | 6733 a2 = v510 + 1; |
6734 } | |
6735 while ( v510 + 1 < SHIDWORD(v733) ); | |
6736 } | |
486 | 6737 for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 ) |
0 | 6738 { |
6739 v511 = &pActors[dword_50BF30[a2]]; | |
6740 a1.vPosition.x = v511->vPosition.x; | |
6741 a1.vPosition.y = v511->vPosition.y; | |
6742 v732 = v511->uActorHeight; | |
6743 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6744 v512 = 8 * dword_50BF30[a2]; | |
486 | 6745 LOBYTE(v512) = v512 | OBJECT_Actor; |
0 | 6746 a1.field_5C = v512; |
486 | 6747 a1.Create(0, 0, 0, 0); |
0 | 6748 v513 = v511->pActorBuffs; |
6749 v726 = (Player *)22; | |
6750 do | |
6751 { | |
6752 v513->Reset(); | |
6753 ++v513; | |
6754 v726 = (Player *)((char *)v726 - 1); | |
6755 } | |
6756 while ( *(float *)&v726 != 0.0 ); | |
6757 } | |
6758 goto LABEL_1056; | |
6759 case 82: | |
6760 v514 = v12 - 2; | |
6761 if ( !v514 ) | |
6762 goto LABEL_955; | |
6763 v515 = v514 - 1; | |
6764 if ( v515 ) | |
6765 { | |
6766 if ( v515 == 1 ) | |
6767 { | |
6768 v516 = 900 * v2; | |
6769 amount = 5; | |
6770 } | |
6771 else | |
6772 { | |
6773 LABEL_955: | |
6774 v516 = 300 * v2; | |
6775 amount = 1; | |
6776 } | |
6777 } | |
6778 else | |
6779 { | |
6780 v516 = 900 * v2; | |
6781 amount = 3; | |
6782 } | |
486 | 6783 v733 = __PAIR__(0, v516); |
0 | 6784 v517 = 8 * v3->uPlayerID; |
6785 LOBYTE(v517) = v517 | 4; | |
486 | 6786 if ( (signed int)uNumActors > 0 ) |
0 | 6787 { |
90 | 6788 v518 = pActors;//[0].uAIState; |
6789 v726b = uNumActors; | |
0 | 6790 do |
6791 { | |
90 | 6792 v519 = v518->uAIState; |
6793 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | |
0 | 6794 ++HIDWORD(v733); |
90 | 6795 ++v518; |
6796 --v726; | |
0 | 6797 } |
90 | 6798 while ( v726 != 0 ); |
0 | 6799 } |
6800 if ( SHIDWORD(v733) >= amount ) | |
6801 { | |
710 | 6802 ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters! |
6803 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
6804 goto LABEL_203; | |
0 | 6805 } |
6806 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6807 goto play_sound_and_continue; |
0 | 6808 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); |
6809 goto LABEL_1056; | |
6810 case 83: | |
6811 v520 = v12 - 2; | |
6812 if ( !v520 ) | |
6813 goto LABEL_973; | |
6814 v521 = v520 - 1; | |
6815 if ( v521 ) | |
6816 { | |
6817 if ( v521 == 1 ) | |
6818 { | |
6819 LODWORD(v733) = 18000 * v2; | |
6820 v522 = 5 * v2 + 10; | |
6821 } | |
6822 else | |
6823 { | |
6824 LABEL_973: | |
6825 LODWORD(v733) = 10800 * v2; | |
6826 v522 = 3 * v2 + 10; | |
6827 } | |
6828 } | |
6829 else | |
6830 { | |
6831 LODWORD(v733) = 14400 * v2; | |
6832 v522 = 4 * v2 + 10; | |
6833 } | |
6834 amount = v522; | |
6835 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6836 goto play_sound_and_continue; |
6837 | |
6838 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6839 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6840 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6841 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
0 | 6842 v83 = 1; |
488 | 6843 |
0 | 6844 v732 = (int)v733 << 7; |
488 | 6845 |
6846 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); | |
6847 LODWORD(v727) = v83; | |
6848 | |
6849 goto play_sound_and_continue; | |
6850 | |
0 | 6851 case 84: |
710 | 6852 //v67 = 2; |
0 | 6853 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
6854 { | |
710 | 6855 ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors! |
6856 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
6857 goto LABEL_203; | |
0 | 6858 } |
6859 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6860 goto play_sound_and_continue; |
0 | 6861 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
|
6862 ++a1.uType; |
0 | 6863 v726 = (Player *)v531; |
486 | 6864 v696 = 0; |
6865 v695 = 0; | |
6866 v694 = 0; | |
0 | 6867 a1.stru_24.Reset(); |
6868 a1.field_48 = v3->spellnum; | |
6869 a1.field_4C = v2; | |
6870 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
6871 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 6872 a1.uAttributes = 0; |
6873 a1.uSectorID = 0; | |
6874 a1.uSpriteFrameID = 0; | |
0 | 6875 v532 = v3->uPlayerID; |
6876 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 6877 a1.uFacing = 0; |
0 | 6878 v532 *= 8; |
303 | 6879 LOBYTE(v532) = v532 | OBJECT_Player; |
6880 a1.field_58_pid = v532; | |
0 | 6881 a1.uSoundID = LOWORD(v3->field_10); |
486 | 6882 a2 = 0; |
6883 if ( (signed int)v726 > 0 ) | |
0 | 6884 { |
6885 do | |
6886 { | |
6887 v533 = dword_50BF30[a2]; | |
6888 a1.vPosition.x = pActors[v533].vPosition.x; | |
6889 a1.vPosition.y = pActors[v533].vPosition.y; | |
6890 v732 = pActors[v533].uActorHeight; | |
6891 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
6892 v534 = 8 * dword_50BF30[a2]; | |
486 | 6893 LOBYTE(v534) = v534 | OBJECT_Actor; |
0 | 6894 a1.field_5C = v534; |
486 | 6895 v535 = a1.Create(0, 0, 0, 0); |
0 | 6896 v536 = a2; |
486 | 6897 DamageMonsterFromParty(8 * v535 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v694); |
0 | 6898 a2 = v536 + 1; |
6899 } | |
6900 while ( v536 + 1 < (signed int)v726 ); | |
6901 } | |
6902 v537 = pGame->GetStru6(); | |
6903 pGame->GetStru6()->_4A8BFC(); | |
6904 goto LABEL_1056; | |
488 | 6905 |
6906 case SPELL_LIGHT_DAY_OF_PROTECTION: | |
0 | 6907 v538 = v12 - 2; |
6908 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | |
6909 { | |
6910 amount = 5 * v2; | |
6911 v540 = 18000 * v2; | |
6912 } | |
6913 else | |
6914 { | |
6915 amount = 4 * v2; | |
6916 v540 = 14400 * v2; | |
6917 } | |
6918 v730 = v540; | |
6919 LODWORD(v733) = v540; | |
6920 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6921 goto play_sound_and_continue; |
6922 | |
6923 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | |
6924 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6925 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6926 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6927 | |
0 | 6928 v732 = v730 << 7; |
6929 v549 = (double)(v730 << 7) * 0.033333335; | |
6930 *((float *)&v733 + 1) = v549; | |
6931 v712 = (signed __int64)v549; | |
488 | 6932 pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, 0, 0); |
6933 pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6934 pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6935 pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6936 pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
6937 pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); | |
0 | 6938 v550 = v2 + 5; |
488 | 6939 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply( |
0 | 6940 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
6941 v731, | |
486 | 6942 v550, 0, 0); |
488 | 6943 |
6944 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0); | |
6945 goto LABEL_1056; | |
0 | 6946 case 86: |
6947 v551 = v12 - 2; | |
6948 if ( !v551 ) | |
6949 goto LABEL_998; | |
6950 v552 = v551 - 1; | |
6951 if ( v552 ) | |
6952 { | |
6953 if ( v552 == 1 ) | |
6954 { | |
6955 amount = 15; | |
6956 HIDWORD(v733) = 20; | |
6957 goto LABEL_1000; | |
6958 } | |
6959 LABEL_998: | |
6960 v678 = 4; | |
6961 } | |
6962 else | |
6963 { | |
6964 v678 = 12; | |
6965 } | |
6966 amount = v678; | |
6967 HIDWORD(v733) = v678; | |
6968 LABEL_1000: | |
6969 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 6970 goto play_sound_and_continue; |
0 | 6971 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); |
6972 v732 = (300 * amount * v2 + 60) << 7; | |
6973 v730 = v2 + 5; | |
486 | 6974 v726 = 0; |
89 | 6975 v553 = pParty->pPlayers;//[0].pConditions[1]; |
0 | 6976 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
6977 do | |
6978 { | |
488 | 6979 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6980 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | |
6981 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | |
6982 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | |
6983 | |
89 | 6984 //((SpellBuff *)(v553 + 6056))->Apply( |
488 | 6985 v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
0 | 6986 if ( *(_QWORD *)v553 ) |
6987 v726 = (Player *)1; | |
89 | 6988 ++v553; |
6989 } | |
6990 while ( v553 <= &pParty->pPlayers[3] ); | |
0 | 6991 v562 = v731; |
488 | 6992 pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
6993 pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, 0, 0, 0); | |
6994 pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, v730, 0, 0); | |
486 | 6995 if (v726) |
0 | 6996 goto LABEL_1056; |
6997 v732 = (int)y << 7; | |
488 | 6998 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); |
6999 goto LABEL_1056; | |
0 | 7000 case 88: |
7001 amount = 3; | |
7002 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | |
710 | 7003 { |
7004 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
7005 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
7006 goto LABEL_203; | |
7007 } | |
0 | 7008 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
488 | 7009 goto play_sound_and_continue; |
486 | 7010 a2 = 0; |
0 | 7011 _this = (ItemGen *)&pPlayers[1]; |
7012 do | |
7013 { | |
7014 v563 = 0; | |
7015 do | |
7016 { | |
7017 v564 = _this->uItemID; | |
486 | 7018 *(int *)(v563 + _this->uItemID) = 0; |
0 | 7019 v563 += 8; |
486 | 7020 *(int *)(v563 + v564 - 4) = 0; |
0 | 7021 } |
7022 while ( v563 <= 128 ); | |
7023 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | |
7024 v566 = (Player **)_this; | |
7025 *(int *)(_this->uItemID + 6460) = v565; | |
7026 v567 = (*v566)->GetMaxMana(); | |
7027 *(int *)(_this->uItemID + 6464) = v567; | |
488 | 7028 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
0 | 7029 ++a2; |
7030 _this = (ItemGen *)((char *)_this + 4); | |
7031 } | |
7032 while ( (signed int)this < (signed int)&qword_A750D8 ); | |
7033 v571 = pPlayer; | |
7034 v572 = (char *)&pPlayer->sAgeModifier; | |
7035 if ( pPlayer->sAgeModifier + 10 >= 120 ) | |
7036 *(short *)v572 = 120; | |
7037 else | |
7038 *(short *)v572 = pPlayer->sAgeModifier + 10; | |
7039 sRecoveryTime += -5 * v2; | |
7040 ++v571->uNumDivineInterventionCastsThisDay; | |
7041 goto LABEL_1056; | |
7042 case 89: | |
7043 v573 = v12 - 2; | |
7044 if ( v573 ) | |
7045 { | |
7046 v574 = v573 - 1; | |
7047 if ( v574 ) | |
7048 { | |
7049 if ( v574 == 1 ) | |
7050 v575 = 5 * v2; | |
7051 else | |
7052 v575 = 2 * v2; | |
7053 } | |
7054 else | |
7055 { | |
7056 v575 = 4 * v2; | |
7057 } | |
7058 } | |
7059 else | |
7060 { | |
7061 v575 = 3 * v2; | |
7062 } | |
7063 amount = v575; | |
7064 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7065 goto play_sound_and_continue; |
7066 v576 = v3->spell_target_pid; | |
486 | 7067 if (!v576) |
0 | 7068 { |
7069 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | |
488 | 7070 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
0 | 7071 if ( *((_QWORD *)v585 + 14) ) |
7072 { | |
7073 ((Player *)v585)->SetCondition(0x11u, 1); | |
7074 v587 = ((Player *)v585)->GetSexByVoice(); | |
7075 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); | |
7076 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | |
7077 } | |
488 | 7078 goto play_sound_and_continue; |
0 | 7079 } |
7080 v577 = (Player *)(v576 >> 3); | |
7081 v726 = v577; | |
7082 if ( v577 == (Player *)-1 ) | |
7083 { | |
710 | 7084 ShowStatusBarString(pGlobalTXT_LocalizationStrings[496], 2); // No valid target exists! |
7085 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
7086 goto LABEL_203; | |
0 | 7087 } |
7088 v578 = (int)&pActors[(int)v577]; | |
7089 v721 = v578; | |
486 | 7090 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) |
710 | 7091 { |
7092 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
7093 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
7094 goto LABEL_203; | |
7095 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7096 ++a1.uType; |
0 | 7097 a1.stru_24.Reset(); |
7098 a1.field_48 = v3->spellnum; | |
7099 a1.field_4C = v2; | |
7100 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7101 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 7102 a1.uAttributes = 0; |
7103 a1.uSectorID = 0; | |
7104 a1.uSpriteFrameID = 0; | |
0 | 7105 v580 = v3->uPlayerID; |
7106 a1.field_60_distance_related_prolly_lod = 0; | |
7107 v581 = v721; | |
7108 v580 *= 8; | |
303 | 7109 LOBYTE(v580) = v580 | OBJECT_Player; |
486 | 7110 a1.uFacing = 0; |
303 | 7111 a1.field_58_pid = v580; |
0 | 7112 a1.uSoundID = LOWORD(v3->field_10); |
7113 a1.vPosition.x = *(short *)(v721 + 142); | |
7114 a1.vPosition.y = *(short *)(v721 + 144); | |
7115 v732 = *(short *)(v721 + 138); | |
7116 v582 = 8 * (int)v726; | |
7117 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
486 | 7118 LOBYTE(v582) = 8 * (char)v726 | OBJECT_Actor; |
0 | 7119 a1.field_5C = v582; |
486 | 7120 a1.Create(0, 0, 0, 0); |
0 | 7121 if ( *(char *)(v581 + 52) > amount ) |
488 | 7122 goto play_sound_and_continue; |
0 | 7123 Actor::Resurrect((unsigned int)v726); |
7124 *(char *)(v581 + 61) = 0; | |
7125 *(char *)(v581 + 53) = 0; | |
7126 *(char *)(v581 + 54) = 0; | |
7127 *(char *)(v581 + 55) = 0; | |
7128 *(char *)(v581 + 56) = 0; | |
7129 *(char *)(v581 + 57) = 0; | |
7130 *(int *)(v581 + 712) = 9999; | |
7131 *(char *)(v581 + 38) &= 0xF7u; | |
486 | 7132 *(int *)(v581 + 708) = 0; |
0 | 7133 ((SpellBuff *)(v581 + 356))->Reset(); |
7134 ((SpellBuff *)(v581 + 228))->Reset(); | |
7135 ((SpellBuff *)(v581 + 404))->Reset(); | |
7136 if ( *(short *)(v581 + 40) > 10 * amount ) | |
7137 *(short *)(v581 + 40) = 10 * amount; | |
7138 goto LABEL_1056; | |
7139 case 91: | |
7140 v588 = v12 - 1; | |
7141 amount = 16; | |
7142 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | |
7143 { | |
7144 if ( v590 == 1 ) | |
486 | 7145 LODWORD(v733) = 0; |
0 | 7146 } |
7147 else | |
7148 { | |
7149 LODWORD(v733) = 3600 * v2; | |
7150 } | |
7151 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7152 goto play_sound_and_continue; |
0 | 7153 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; |
7154 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | |
7155 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | |
7156 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | |
7157 || *(char *)(HIDWORD(v733) + 20) & 2 | |
486 | 7158 || *(int *)(HIDWORD(v733) + 12) != 0 |
7159 || *(int *)(HIDWORD(v733) + 4) != 0 | |
0 | 7160 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 |
377 | 7161 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) |
710 | 7162 { |
7163 dword_50C9D0 = 113; | |
7164 dword_50C9D4 = 0; | |
7165 dword_50C9D8 = 1; | |
7166 | |
7167 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
7168 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
7169 goto LABEL_203; | |
7170 } | |
0 | 7171 v592 = HIDWORD(v733); |
7172 v14 = v731 == 4; | |
7173 *(int *)(HIDWORD(v733) + 12) = 16; | |
7174 if ( !v14 ) | |
7175 { | |
7176 v732 = (int)v733 << 7; | |
7177 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | |
7178 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7179 *(int *)(v592 + 20) |= 8u; | |
7180 } | |
7181 *(char *)(v592 + 20) |= 0x80u; | |
7182 goto LABEL_1055; | |
7183 case 93: | |
7184 v593 = v12 - 2; | |
7185 if ( !v593 ) | |
7186 goto LABEL_1062; | |
7187 v594 = v593 - 1; | |
7188 if ( v594 ) | |
7189 { | |
7190 if ( v594 == 1 ) | |
7191 amount = 9; | |
7192 else | |
7193 LABEL_1062: | |
7194 amount = 5; | |
7195 } | |
7196 else | |
7197 { | |
7198 amount = 7; | |
7199 } | |
7200 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7201 goto play_sound_and_continue; |
0 | 7202 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); |
7203 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7204 a1.stru_24.Reset(); | |
7205 a1.field_48 = v3->spellnum; | |
7206 a1.field_4C = v2; | |
7207 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7208 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
0 | 7209 a1.vPosition.x = pParty->vPosition.x; |
7210 a1.vPosition.y = pParty->vPosition.y; | |
486 | 7211 a1.uAttributes = 0; |
0 | 7212 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
7213 a1.uSectorID = pIndoor->GetSector( | |
7214 pParty->vPosition.x, | |
7215 pParty->vPosition.y, | |
7216 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | |
486 | 7217 a1.uSpriteFrameID = 0; |
0 | 7218 v595 = 8 * v3->uPlayerID; |
303 | 7219 LOBYTE(v595) = v595 | OBJECT_Player; |
7220 a1.field_58_pid = v595; | |
0 | 7221 a1.field_5C = a2; |
7222 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7223 a1.uSoundID = LOWORD(v3->field_10); | |
7224 if ( pParty->bTurnBasedModeOn == 1 ) | |
7225 LOBYTE(a1.uAttributes) |= 4u; | |
7226 v596 = (signed int)v726 / -2; | |
7227 y = (char *)((signed int)v726 / 2); | |
7228 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | |
7229 { | |
7230 v597 = v715.uYawAngle; | |
7231 do | |
7232 { | |
7233 a1.uFacing = v596 + v597; | |
7234 if ( a1.Create( | |
7235 v596 + v597, | |
7236 v715.uPitchAngle, | |
7237 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
7238 v3->uPlayerID + 1) != -1 | |
7239 && pParty->bTurnBasedModeOn == 1 ) | |
7240 ++pTurnEngine->field_1C; | |
7241 v596 += v732; | |
7242 } | |
7243 while ( v596 <= (signed int)y ); | |
7244 } | |
7245 goto LABEL_1056; | |
7246 case 94: | |
7247 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7248 goto play_sound_and_continue; |
0 | 7249 if ( v731 == 1 || v731 == 2 ) |
7250 { | |
7251 v598 = 180 * v2; | |
7252 goto LABEL_1081; | |
7253 } | |
7254 if ( v731 == 3 ) | |
7255 { | |
7256 v598 = 300 * v2; | |
7257 LABEL_1081: | |
7258 LODWORD(v733) = v598; | |
7259 goto LABEL_1082; | |
7260 } | |
7261 if ( v731 == 4 ) | |
7262 LODWORD(v733) = 29030400; | |
7263 LABEL_1082: | |
7264 v599 = a2 >> 3; | |
141 | 7265 if ( (a2 & 7) != OBJECT_Actor) |
0 | 7266 goto LABEL_1056; |
7267 v730 = 836 * v599; | |
7268 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
488 | 7269 goto play_sound_and_continue; |
90 | 7270 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
710 | 7271 { |
7272 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
7273 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
7274 goto LABEL_203; | |
7275 } | |
90 | 7276 pActors[v599].pActorBuffs[9].Reset(); |
7277 pActors[v599].pActorBuffs[1].Reset(); | |
0 | 7278 v732 = (int)v733 << 7; |
90 | 7279 pActors[v599].pActorBuffs[12].Apply( |
0 | 7280 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
486 | 7281 v731, 0, 0, 0); |
0 | 7282 a1.stru_24.Reset(); |
7283 a1.field_48 = v3->spellnum; | |
7284 a1.field_4C = v2; | |
7285 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7286 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
90 | 7287 v61 = v599; |
0 | 7288 LABEL_1086: |
90 | 7289 v600 = pActors[v61].vPosition.y; |
7290 v601 = pActors[v61].vPosition.x; | |
0 | 7291 a1.uObjectDescID = v60; |
7292 a1.vPosition.x = v601; | |
90 | 7293 v602 = pActors[v61].uActorHeight; |
7294 v603 = pActors[v61].vPosition.z; | |
0 | 7295 a1.vPosition.y = v600; |
7296 v676 = v603 + v602; | |
7297 v665 = v600; | |
7298 a1.vPosition.z = v603 + v602; | |
7299 v657 = v601; | |
7300 LABEL_1087: | |
486 | 7301 a1.uAttributes = 0; |
0 | 7302 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); |
486 | 7303 a1.uSpriteFrameID = 0; |
0 | 7304 v604 = 8 * v3->uPlayerID; |
303 | 7305 LOBYTE(v604) = v604 | OBJECT_Player; |
7306 a1.field_58_pid = v604; | |
0 | 7307 a1.field_5C = a2; |
7308 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | |
7309 a1.uFacing = LOWORD(v715.uYawAngle); | |
7310 LOWORD(v604) = LOWORD(v3->field_10); | |
7311 LOBYTE(a1.uAttributes) |= 0x80u; | |
7312 a1.uSoundID = v604; | |
486 | 7313 a1.Create(0, 0, 0, v3->uPlayerID + 1); |
0 | 7314 goto LABEL_1056; |
7315 case 96: | |
7316 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7317 goto play_sound_and_continue; |
486 | 7318 HIDWORD(v733) = 0; |
521 | 7319 memset(&achievedAwardsIndex, 0, 4000); |
486 | 7320 _this = 0; |
0 | 7321 v605 = (char *)pParty->pHirelings; |
7322 do | |
7323 { | |
486 | 7324 if ( *(int *)v605) |
0 | 7325 { |
7326 v606 = HIDWORD(v733)++; | |
521 | 7327 achievedAwardsIndex[v606] = (int)((char *)&_this->uItemID + 1); |
0 | 7328 } |
7329 _this = (ItemGen *)((char *)_this + 1); | |
7330 v605 += 76; | |
7331 } | |
7332 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | |
486 | 7333 _this = 0; |
7334 if ( (signed int)pNPCStats->uNumNewNPCs > 0) | |
0 | 7335 { |
7336 v730 = (int)pNPCStats->pNewNPCData; | |
7337 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | |
7338 do | |
7339 { | |
7340 if ( *(char *)(v730 + 8) & 0x80 | |
486 | 7341 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) |
7342 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | |
0 | 7343 { |
7344 v607 = HIDWORD(v733); | |
7345 HIDWORD(v733) += 4; | |
7346 *(int *)v607 = (int)_this + 3; | |
7347 } | |
7348 _this = (ItemGen *)((char *)_this + 1); | |
7349 v730 += 76; | |
7350 } | |
7351 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | |
7352 } | |
7353 v608 = v3->uPlayerID_2; | |
7354 if ( v608 != 4 && v608 != 5 | |
486 | 7355 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) |
0 | 7356 || v609 >= 3 ) |
710 | 7357 { |
7358 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
7359 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
7360 goto LABEL_203; | |
7361 } | |
0 | 7362 v610 = 76 * v609; |
486 | 7363 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; |
0 | 7364 v611 = pIconsFrameTable->FindIcon("spell96"); |
488 | 7365 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611); |
0 | 7366 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; |
89 | 7367 v612 = pParty->pPlayers; |
0 | 7368 do |
7369 { | |
89 | 7370 v612->sHealth = v612->GetMaxHealth(); |
7371 v612->sMana = v612->GetMaxMana(); | |
7372 ++v612; | |
7373 } | |
7374 while ( v612 <= &pParty->pPlayers[3] ); | |
7375 v613 = &pOutdoor->ddm; | |
0 | 7376 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
89 | 7377 v613 = &pIndoor->dlv; |
7378 v613->uReputation += 15; | |
7379 if ( v613->uReputation > 10000 ) | |
7380 v613->uReputation = 10000; | |
488 | 7381 LODWORD(v727) = 1; |
7382 goto play_sound_and_continue; | |
0 | 7383 case 95: |
486 | 7384 if ( v12 <= 0 ) |
0 | 7385 goto LABEL_1119; |
7386 if ( v12 <= 3 ) | |
7387 { | |
7388 v614 = 300 * (v2 + 12); | |
7389 } | |
7390 else | |
7391 { | |
7392 if ( v12 != 4 ) | |
7393 goto LABEL_1119; | |
7394 v614 = 900 * (v2 + 4); | |
7395 } | |
7396 LODWORD(v733) = v614; | |
7397 LABEL_1119: | |
7398 v615 = v2 + 5; | |
7399 amount = v615; | |
7400 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7401 goto play_sound_and_continue; |
0 | 7402 if ( v731 != 3 && v731 != 4 ) |
7403 { | |
488 | 7404 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
7405 | |
0 | 7406 v732 = (int)v733 << 7; |
488 | 7407 |
7408 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); | |
7409 goto LABEL_1056; | |
0 | 7410 } |
486 | 7411 a2 = 0; |
0 | 7412 v732 = (int)v733 << 7; |
7413 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
112 | 7414 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
0 | 7415 do |
7416 { | |
488 | 7417 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
7418 v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | |
0 | 7419 ++a2; |
112 | 7420 ++v619; |
7421 } | |
7422 while ( v619 <= &pParty->pPlayers[3] ); | |
0 | 7423 goto LABEL_1056; |
7424 case 99: | |
7425 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | |
488 | 7426 goto play_sound_and_continue; |
486 | 7427 v726 = 0; |
0 | 7428 pGame->GetIndoorCamera(); |
7429 v623 = (signed __int64)GetPickDepth(); | |
7430 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | |
486 | 7431 v709 = 0; |
7432 v708 = 0; | |
7433 v707 = 0; | |
0 | 7434 a1.stru_24.Reset(); |
7435 a1.field_48 = v3->spellnum; | |
7436 a1.field_4C = v2; | |
7437 a1.field_50 = v731; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
7438 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
486 | 7439 a1.uAttributes = 0; |
7440 a1.uSectorID = 0; | |
7441 a1.uSpriteFrameID = 0; | |
0 | 7442 v624 = v3->uPlayerID; |
7443 a1.field_60_distance_related_prolly_lod = 0; | |
486 | 7444 a1.uFacing = 0; |
0 | 7445 v624 *= 8; |
303 | 7446 LOBYTE(v624) = v624 | OBJECT_Player; |
7447 a1.field_58_pid = v624; | |
0 | 7448 a1.uSoundID = LOWORD(v3->field_10); |
486 | 7449 a2 = 0; |
7450 if ( SHIDWORD(v733) > 0 ) | |
0 | 7451 { |
7452 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | |
7453 do | |
7454 { | |
7455 v625 = dword_50BF30[a2]; | |
7456 a1.vPosition.x = pActors[v625].vPosition.x; | |
7457 a1.vPosition.y = pActors[v625].vPosition.y; | |
7458 v732 = pActors[v625].uActorHeight; | |
7459 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | |
7460 v626 = 8 * dword_50BF30[a2]; | |
486 | 7461 LOBYTE(v626) = v626 | OBJECT_Actor; |
0 | 7462 a1.field_5C = v626; |
486 | 7463 v627 = a1.Create(0, 0, 0, 0); |
0 | 7464 v628 = a2; |
7465 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | |
7466 a2 = v628 + 1; | |
7467 } | |
7468 while ( v628 + 1 < SHIDWORD(v733) ); | |
7469 } | |
486 | 7470 v730 = 0; |
0 | 7471 v629 = 1; |
7472 do | |
7473 { | |
7474 v630 = pPlayers[v629]; | |
7475 if ( !v630->pConditions[2] | |
7476 && !v630->pConditions[12] | |
7477 && !v630->pConditions[13] | |
7478 && !v630->pConditions[14] | |
7479 && !v630->pConditions[15] | |
7480 && !v630->pConditions[16] ) | |
7481 { | |
7482 v631 = v730++; | |
7483 v681[v631] = v629; | |
7484 } | |
7485 ++v629; | |
7486 } | |
7487 while ( v629 <= 4 ); | |
7488 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | |
486 | 7489 HIDWORD(v733) = 0; |
7490 if ( v730 > 0 ) | |
0 | 7491 { |
7492 do | |
7493 { | |
7494 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | |
7495 v633 = pPlayers[v681[HIDWORD(v733)]]; | |
7496 v633->sHealth += v732; | |
7497 v726 = *(Player **)v632; | |
7498 v634 = v726->GetMaxHealth(); | |
7499 if ( v726->sHealth > v634 ) | |
7500 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | |
7501 v635 = HIDWORD(v733); | |
488 | 7502 |
7503 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, WORD2(v733)); | |
0 | 7504 HIDWORD(v733) = v635 + 1; |
7505 } | |
7506 while ( v635 + 1 < v730 ); | |
7507 } | |
486 | 7508 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); |
0 | 7509 goto LABEL_1056; |
7510 case 98: | |
7511 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
7512 { | |
710 | 7513 ShowStatusBarString(pGlobalTXT_LocalizationStrings[499], 2); // Can't cast Armageddon indoors! |
7514 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
7515 goto LABEL_203; | |
0 | 7516 } |
7517 v640 = v12 - 2; | |
7518 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | |
7519 amount = 3; | |
486 | 7520 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) |
710 | 7521 { |
7522 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | |
7523 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
7524 goto LABEL_203; | |
7525 } | |
0 | 7526 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
488 | 7527 goto play_sound_and_continue; |
349 | 7528 pParty->armageddon_timer = 256; |
0 | 7529 pParty->field_16140 = v2; |
7530 ++pPlayer->uNumArmageddonCasts; | |
7531 if ( pParty->bTurnBasedModeOn == 1 ) | |
7532 ++pTurnEngine->field_1C; | |
7533 v726 = (Player *)50; | |
7534 do | |
7535 { | |
7536 v642 = rand() % 4096 - 2048; | |
7537 v643 = rand(); | |
7538 v721 = v642 + pParty->vPosition.x; | |
7539 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | |
486 | 7540 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0); |
0 | 7541 v644 = rand(); |
486 | 7542 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0); |
0 | 7543 v726 = (Player *)((char *)v726 - 1); |
7544 } | |
7545 while ( *(float *)&v726 != 0.0 ); | |
7546 goto LABEL_1056; | |
7547 default: | |
488 | 7548 goto play_sound_and_continue; |
0 | 7549 } |
7550 while ( 2 ) | |
7551 { | |
7552 if ( v731 == 4 ) | |
7553 { | |
7554 if ( *((_QWORD *)v222 + 2) ) | |
7555 { | |
486 | 7556 *((int *)v222 + 4) = 0; |
7557 *((int *)v222 + 5) = 0; | |
0 | 7558 goto LABEL_439; |
7559 } | |
7560 } | |
7561 else | |
7562 { | |
7563 v732 = amount << 7; | |
7564 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | |
7565 2u, | |
7566 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | |
7567 v222 = (char *)HIDWORD(v733); | |
7568 if ( v223 ) | |
7569 LABEL_439: | |
486 | 7570 ((Player *)v222)->PlaySound(SPEECH_103, 0); |
0 | 7571 } |
7572 v222 += 6972; | |
7573 HIDWORD(v733) = (int)v222; | |
7574 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | |
7575 goto LABEL_1056; | |
7576 continue; | |
7577 } | |
7578 } | |
7579 //----- (0042EB42) -------------------------------------------------------- | |
7580 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | |
7581 { | |
7582 unsigned int v2; // edx@1 | |
7583 signed int v3; // eax@1 | |
7584 char *v4; // ecx@2 | |
7585 | |
7586 v2 = this->uNumObjects; | |
7587 v3 = 0; | |
7588 if ( (signed int)this->uNumObjects <= 0 ) | |
7589 { | |
7590 LABEL_5: | |
7591 LOWORD(v3) = 0; | |
7592 } | |
7593 else | |
7594 { | |
7595 v4 = (char *)&this->pObjects->uObjectID; | |
7596 while ( uItemID != *(short *)v4 ) | |
7597 { | |
7598 ++v3; | |
7599 v4 += 56; | |
7600 if ( v3 >= (signed int)v2 ) | |
7601 goto LABEL_5; | |
7602 } | |
7603 } | |
7604 return v3; | |
7605 } | |
7606 | |
7607 | |
7608 | |
7609 //----- (0042EB78) -------------------------------------------------------- | |
7610 int IconFrameTable::GetIconAnimLength(unsigned int uIconID) | |
7611 { | |
7612 return 8 * this->pIcons[uIconID].uAnimLength; | |
7613 } | |
7614 | |
437 | 7615 |
7616 const wchar_t *UIMessage2String(UIMessageType msg) | |
7617 { | |
7618 #define CASE(xxx) case xxx: _swprintf(b, L"%03X/%s", msg, L#xxx); return b; | |
7619 static wchar_t b[256]; // bad for threads | |
7620 switch (msg) | |
7621 { | |
7622 CASE(UIMSG_SelectSpell) | |
7623 CASE(UIMSG_ChangeGameState) | |
7624 CASE(UIMSG_Attack) | |
7625 CASE(UIMSG_PlayArcomage) | |
7626 CASE(UIMSG_MainMenu_ShowPartyCreationWnd) | |
7627 CASE(UIMSG_MainMenu_ShowLoadWindow) | |
7628 CASE(UIMSG_ShowCredits) | |
7629 CASE(UIMSG_ExitToWindows) | |
7630 CASE(UIMSG_PlayerCreationChangeName) | |
7631 CASE(UIMSG_PlayerCreationClickPlus) | |
7632 CASE(UIMSG_PlayerCreationClickMinus) | |
7633 CASE(UIMSG_PlayerCreationSelectActiveSkill) | |
7634 CASE(UIMSG_PlayerCreationSelectClass) | |
7635 CASE(UIMSG_PlayerCreationClickOK) | |
7636 CASE(UIMSG_PlayerCreationClickReset) | |
7637 CASE(UIMSG_AutonotesBook) | |
7638 CASE(UIMSG_PlayerCreationRemoveUpSkill) | |
7639 CASE(UIMSG_PlayerCreationRemoveDownSkill) | |
7640 CASE(UIMSG_SPellbook_ShowHightlightedSpellInfo) | |
7641 CASE(UIMSG_LoadGame) | |
7642 CASE(UIMSG_SaveGame) | |
7643 CASE(UIMSG_ShowStatus_DateTime) | |
7644 CASE(UIMSG_ShowStatus_ManaHP) | |
7645 CASE(UIMSG_ShowStatus_Player) | |
7646 CASE(UIMSG_Wait5Minutes) | |
7647 CASE(UIMSG_Wait1Hour) | |
7648 CASE(UIMSG_ShowStatus_Food) | |
7649 CASE(UIMSG_ShowStatus_Funds) | |
7650 CASE(UIMSG_QuickReference) | |
7651 CASE(UIMSG_GameMenuButton) | |
7652 CASE(UIMSG_AlreadyResting) | |
7653 CASE(UIMSG_SelectCharacter) | |
7654 CASE(UIMSG_ChangeSoundVolume) | |
7655 CASE(UIMSG_ChangeMusicVolume) | |
7656 CASE(UIMSG_Escape) | |
7657 CASE(UIMSG_PlayerCreation_SelectAttribute) | |
7658 CASE(UIMSG_InventoryLeftClick) | |
7659 CASE(UIMSG_SkillUp) | |
7660 CASE(UIMSG_GameMenu_ReturnToGame) | |
7661 CASE(UIMSG_StartNewGame) | |
7662 CASE(UIMSG_Game_OpenLoadGameDialog) | |
7663 CASE(UIMSG_Game_OpenSaveGameDialog) | |
7664 CASE(UIMSG_Game_OpenOptionsDialog) | |
7665 CASE(UIMSG_SetGraphicsMode) | |
7666 CASE(UIMSG_Quit) | |
7667 CASE(UIMSG_StartHireling1Dialogue) | |
7668 CASE(UIMSG_StartHireling2Dialogue) | |
651 | 7669 CASE(UIMSG_SelectNPCDialogueOption) |
437 | 7670 CASE(UIMSG_CastSpellFromBook) |
7671 CASE(UIMSG_PlayerCreation_VoicePrev) | |
7672 CASE(UIMSG_PlayerCreation_VoiceNext) | |
7673 CASE(UIMSG_StartNPCDialogue) | |
7674 CASE(UIMSG_ArrowUp) | |
7675 CASE(UIMSG_DownArrow) | |
7676 CASE(UIMSG_LoadSlot) | |
7677 CASE(UIMSG_SelectLoadSlot) | |
7678 CASE(UIMSG_Cancel) | |
7679 CASE(UIMSG_ExitRest) | |
7680 CASE(UIMSG_PlayerCreation_FacePrev) | |
7681 CASE(UIMSG_PlayerCreation_FaceNext) | |
7682 CASE(UIMSG_CycleCharacters) | |
7683 CASE(UIMSG_SetTurnSpeed) | |
7684 CASE(UIMSG_ToggleWalkSound) | |
7685 CASE(UIMSG_ChangeVoiceVolume) | |
7686 CASE(UIMSG_ToggleShowDamage) | |
7687 CASE(UIMSG_ScrollNPCPanel) | |
7688 CASE(UIMSG_ShowFinalWindow) | |
7689 CASE(UIMSG_OpenQuestBook) | |
7690 CASE(UIMSG_OpenAutonotes) | |
7691 CASE(UIMSG_OpenMapBook) | |
7692 CASE(UIMSG_OpenCalendar) | |
7693 CASE(UIMSG_OpenHistoryBook) | |
7694 CASE(UIMSG_ToggleAlwaysRun) | |
7695 CASE(UIMSG_ToggleFlipOnExit) | |
7696 CASE(UIMSG_Game_Action) | |
7697 CASE(UIMSG_OpenRestUI) | |
7698 CASE(UIMSG_TransitionUI_Confirm) | |
7699 CASE(UIMSG_OpenKeyMappingOptions) | |
7700 CASE(UIMSG_SelectKeyPage1) | |
7701 CASE(UIMSG_SelectKeyPage2) | |
7702 CASE(UIMSG_ResetKeyMapping) | |
7703 CASE(UIMSG_ChangeKeyButton) | |
7704 CASE(UIMSG_OpenVideoOptions) | |
7705 CASE(UIMSG_ToggleBloodsplats) | |
7706 CASE(UIMSG_ToggleColoredLights) | |
7707 CASE(UIMSG_ToggleTint) | |
7708 default: | |
7709 _swprintf(b, L"UIMSG_%03X", msg); return b; | |
7710 }; | |
7711 #undef CASE | |
7712 } | |
7713 | |
7714 | |
0 | 7715 //----- (0042EB8D) -------------------------------------------------------- |
437 | 7716 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |
0 | 7717 { |
482 | 7718 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); |
0 | 7719 if (uNumMessages < 40) |
7720 { | |
437 | 7721 files[uNumMessages] = file; |
7722 lines[uNumMessages] = line; | |
7723 | |
0 | 7724 pMessages[uNumMessages].eType = msg; |
7725 pMessages[uNumMessages].param = param; | |
7726 pMessages[uNumMessages++].field_8 = a4; | |
7727 } | |
7728 } | |
7729 | |
7730 //----- (0042EBBE) -------------------------------------------------------- | |
7731 int __fastcall sub_42EBBE(int a1, int a2) | |
7732 { | |
7733 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16; | |
7734 } | |
7735 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int); | |
7736 | |
7737 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 7738 int stru193_math::Sin(int angle) |
0 | 7739 { |
323 | 7740 return Cos(angle - this->uIntegerHalfPi); |
0 | 7741 } |
7742 | |
7743 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 7744 void _42ECB5_PlayerAttacksActor() |
0 | 7745 { |
271 | 7746 //unsigned int v0; // ebx@1 |
7747 //Player *v1; // esi@1 | |
7748 //bool result; // eax@1 | |
295 | 7749 //int v3; // edi@2 |
271 | 7750 //unsigned int v4; // eax@7 |
0 | 7751 char *v5; // eax@8 |
271 | 7752 //int v6; // ecx@9 |
7753 //signed int v7; // eax@16 | |
295 | 7754 //Actor *v8; // edi@20 |
0 | 7755 unsigned int v9; // ecx@21 |
295 | 7756 //char *v10; // eax@26 |
0 | 7757 char *v11; // eax@26 |
7758 unsigned int v12; // eax@47 | |
295 | 7759 //char *v13; // eax@47 |
7760 //char *v14; // eax@47 | |
7761 //unsigned int v15; // ebx@54 | |
7762 //int v16; // [sp-10h] [bp-4Ch]@24 | |
7763 //int v17; // [sp-10h] [bp-4Ch]@44 | |
7764 //unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
7765 //unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
7766 //__int16 v20; // [sp-8h] [bp-44h]@24 | |
7767 //__int16 v21; // [sp-8h] [bp-44h]@44 | |
7768 //int v22; // [sp-4h] [bp-40h]@24 | |
7769 //int v23; // [sp-4h] [bp-40h]@44 | |
0 | 7770 SoundID v24; // [sp-4h] [bp-40h]@58 |
295 | 7771 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 |
271 | 7772 //unsigned int a2; // [sp+18h] [bp-24h]@20 |
7773 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
295 | 7774 //int v28; // [sp+20h] [bp-1Ch]@9 |
271 | 7775 //unsigned int *v28b; |
295 | 7776 //int v29; // [sp+24h] [bp-18h]@16 |
7777 //int v30; // [sp+28h] [bp-14h]@16 | |
271 | 7778 //int v31; // [sp+2Ch] [bp-10h]@4 |
295 | 7779 //int v32; // [sp+30h] [bp-Ch]@7 |
271 | 7780 //int v33; // [sp+34h] [bp-8h]@7 |
295 | 7781 //int v34; // [sp+38h] [bp-4h]@17 |
0 | 7782 |
271 | 7783 //v0 = uActiveCharacter; |
7784 //v27 = 6972 * uActiveCharacter; | |
7785 //v1 = &pParty->pPlayers[uActiveCharacter-1]; | |
7786 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); | |
7787 auto player = &pParty->pPlayers[uActiveCharacter - 1]; | |
7788 if (!player->CanAct()) | |
7789 return; | |
7790 | |
7791 pStru277->_427D48(uActiveCharacter); | |
295 | 7792 //v3 = 0; |
271 | 7793 if (pParty->Invisible()) |
7794 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
7795 | |
7796 //v31 = player->pEquipment.uBow; | |
7797 int bow_idx = player->pEquipment.uBow; | |
7798 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) | |
7799 bow_idx = 0; | |
7800 | |
295 | 7801 //v32 = 0; |
7802 int wand_item_id = 0; | |
271 | 7803 //v33 = 0; |
7804 //v4 = v1->pEquipment.uMainHand; | |
7805 int laser_weapon_item_id = 0; | |
7806 | |
7807 int main_hand_idx = player->pEquipment.uMainHand; | |
7808 if (main_hand_idx) | |
0 | 7809 { |
271 | 7810 auto item = &player->pInventoryItems[main_hand_idx - 1]; |
112 | 7811 //v5 = (char *)v1 + 36 * v4; |
271 | 7812 if (!item->Broken()) |
7813 { | |
7814 //v28b = &v1->pInventoryItems[v4].uItemID; | |
7815 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
295 | 7816 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND) |
0 | 7817 { |
295 | 7818 if (item->uNumCharges <= 0) |
7819 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 7820 else |
295 | 7821 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 7822 } |
271 | 7823 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
7824 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 7825 } |
271 | 7826 } |
7827 | |
295 | 7828 //v30 = 0; |
7829 //v29 = 0; | |
7830 //v28 = 0; | |
271 | 7831 //v7 = pMouse->uPointingObjectID; |
7832 | |
7833 int target_pid = pMouse->uPointingObjectID; | |
7834 int target_type = target_pid & 7, | |
7835 target_id = target_pid >> 3; | |
7836 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) | |
7837 { | |
7838 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
7839 target_type = target_pid & 7; | |
7840 target_id = target_pid >> 3; | |
7841 } | |
295 | 7842 |
7843 auto actor = &pActors[target_id]; | |
7844 int actor_distance = 0; | |
271 | 7845 if (target_type == OBJECT_Actor) |
7846 { | |
295 | 7847 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
7848 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
7849 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
7850 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
7851 if (actor_distance < 0) | |
7852 actor_distance = 0; | |
7853 } | |
7854 | |
7855 bool shooting_bow = false, | |
7856 shotting_laser = false, | |
7857 shooting_wand = false; | |
7858 if (laser_weapon_item_id) | |
7859 { | |
7860 shotting_laser = true; | |
490 | 7861 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); |
295 | 7862 } |
7863 else if (wand_item_id) | |
7864 { | |
7865 shooting_wand = true; | |
7866 | |
7867 int main_hand_idx = player->pEquipment.uMainHand; | |
490 | 7868 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItems[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); |
295 | 7869 |
7870 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | |
7871 player->pEquipment.uMainHand = 0; | |
7872 } | |
303 | 7873 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 7874 { |
303 | 7875 Vec3_int_ a3; |
7876 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
7877 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
7878 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
7879 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
7880 | |
7881 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); | |
305 | 7882 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) |
295 | 7883 _42FA66_do_explosive_impact( |
7884 actor->vPosition.x, | |
7885 actor->vPosition.y, | |
7886 actor->vPosition.z + actor->uActorHeight / 2, | |
7887 0, 512, uActiveCharacter); | |
303 | 7888 } |
7889 else if (bow_idx) | |
7890 { | |
7891 shooting_bow = true; | |
490 | 7892 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0); |
295 | 7893 } |
7894 else | |
7895 { | |
303 | 7896 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
7897 } | |
7898 | |
7899 if (!pParty->bTurnBasedModeOn) | |
7900 { | |
7901 int recovery = player->GetAttackRecoveryTime(0); | |
7902 if (recovery < 30 ) | |
7903 recovery = 30; | |
7904 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); | |
295 | 7905 } |
7906 | |
7907 | |
7908 int v34 = 0; | |
7909 if (shooting_wand) | |
7910 return; | |
7911 else if (shooting_bow) | |
7912 { | |
7913 v34 = 5; | |
7914 player->PlaySound(SPEECH_50, 0); | |
7915 } | |
7916 if (shotting_laser) | |
7917 v34 = 7; | |
7918 else | |
7919 { | |
7920 int main_hand_idx = player->pEquipment.uMainHand; | |
7921 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) | |
7922 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType; | |
7923 pTurnEngine->_40471C(); | |
7924 } | |
7925 | |
7926 switch (v34) | |
7927 { | |
7928 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
7929 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
7930 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
7931 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
7932 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
7933 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
7934 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
7935 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
7936 } | |
0 | 7937 } |
7938 | |
7939 //----- (0042F184) -------------------------------------------------------- | |
295 | 7940 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 7941 { |
7942 int v4; // edi@1 | |
7943 stru319 *v5; // esi@1 | |
7944 int v6; // eax@2 | |
7945 int v7; // eax@4 | |
7946 int result; // eax@5 | |
7947 int *v9; // edx@8 | |
7948 signed int v10; // ebx@10 | |
7949 int v11; // edi@11 | |
7950 Actor *v12; // esi@12 | |
7951 unsigned __int16 v13; // ax@12 | |
7952 int v14; // eax@22 | |
7953 char v15; // zf@30 | |
7954 int v16; // esi@32 | |
7955 int v17; // ecx@34 | |
7956 stru319 *v18; // eax@39 | |
7957 int v19; // edx@39 | |
7958 int v20; // ecx@41 | |
7959 unsigned __int16 v21; // ax@42 | |
7960 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
7961 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
7962 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
7963 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
7964 int *v26; // [sp+18h] [bp-14h]@8 | |
7965 int v27; // [sp+1Ch] [bp-10h]@10 | |
7966 int *v28; // [sp+20h] [bp-Ch]@10 | |
7967 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
7968 int v30; // [sp+28h] [bp-4h]@6 | |
7969 int i; // [sp+38h] [bp+Ch]@33 | |
7970 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
7971 | |
7972 v4 = 0; | |
7973 v5 = this; | |
7974 v24 = this; | |
7975 if ( pRenderer->pRenderD3D ) | |
7976 { | |
7977 v6 = a3 != 0; | |
7978 if ( a4 ) | |
7979 LOBYTE(v6) = v6 | 8; | |
295 | 7980 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 7981 if ( v7 != -1 ) |
7982 return (unsigned __int16)v7; | |
295 | 7983 else return 0; |
0 | 7984 } |
7985 else | |
7986 { | |
7987 v30 = 0; | |
7988 if ( pRenderer->pActiveZBuffer ) | |
7989 { | |
692 | 7990 v29 = viewparams->uScreen_topL_X; |
7991 v23 = viewparams->uScreen_BttmR_X; | |
7992 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y ) | |
0 | 7993 { |
692 | 7994 v25 = viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y; |
7995 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y]; | |
7996 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y]; | |
0 | 7997 do |
7998 { | |
7999 if ( (signed int)v29 < (signed int)v23 ) | |
8000 { | |
8001 v28 = v9; | |
8002 v10 = v4; | |
8003 v27 = v23 - v29; | |
8004 do | |
8005 { | |
8006 v22 = *v28; | |
8007 v11 = *v28 & 0xFFFF; | |
141 | 8008 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
0 | 8009 { |
8010 v12 = &pActors[(unsigned int)v11 >> 3]; | |
8011 v13 = v12->uAIState; | |
8012 if ( v13 != 5 ) | |
8013 { | |
8014 if ( v13 != 4 | |
8015 && v13 != 11 | |
8016 && v13 != 19 | |
8017 && v13 != 17 | |
8018 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | |
8019 { | |
8020 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
295 | 8021 && v22 <= pick_depth << 16 ) |
0 | 8022 { |
8023 v14 = 0; | |
8024 if ( v10 > 0 ) | |
8025 { | |
8026 do | |
8027 { | |
8028 if ( dword_50BDA0[v14] == v11 ) | |
8029 break; | |
8030 ++v14; | |
8031 } | |
8032 while ( v14 < v30 ); | |
8033 } | |
8034 if ( v14 == v30 && v10 < 100 ) | |
8035 { | |
8036 ++v30; | |
8037 dword_50BC10[v10] = v22; | |
8038 dword_50BDA0[v10] = v11; | |
8039 ++v10; | |
8040 } | |
8041 } | |
8042 } | |
8043 } | |
8044 } | |
8045 ++v28; | |
8046 --v27; | |
8047 } | |
8048 while ( v27 ); | |
8049 v4 = v30; | |
8050 v5 = v24; | |
8051 } | |
8052 v9 = v26 + 640; | |
8053 v15 = v25-- == 1; | |
8054 v26 += 640; | |
8055 } | |
8056 while ( !v15 ); | |
8057 } | |
8058 if ( v4 > 0 ) | |
8059 { | |
8060 v32 = 1; | |
8061 v16 = (int)dword_50BC10; | |
8062 do | |
8063 { | |
8064 for ( i = v32; i < v4; ++i ) | |
8065 { | |
8066 v17 = dword_50BC10[i]; | |
8067 if ( v17 < *(int *)v16 ) | |
8068 { | |
8069 dword_50BC10[i] = *(int *)v16; | |
8070 *(int *)v16 = v17; | |
8071 } | |
8072 } | |
8073 ++v32; | |
8074 v16 += 4; | |
8075 } | |
8076 while ( v32 - 1 < v4 ); | |
8077 v5 = v24; | |
8078 if ( v4 > 0 ) | |
8079 { | |
8080 v18 = v24; | |
8081 v19 = v4; | |
8082 do | |
8083 { | |
8084 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF; | |
8085 v18 += 4; | |
8086 --v19; | |
8087 } | |
8088 while ( v19 ); | |
8089 } | |
8090 } | |
8091 v20 = 0; | |
8092 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
8093 { | |
8094 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
8095 if ( v21 != 4 && v21 != 5 ) | |
8096 break; | |
8097 } | |
8098 if ( v20 != v4 ) | |
8099 { | |
8100 result = 8 * *(int *)&v5[4 * v20].field_0; | |
8101 LOBYTE(result) = result | 3; | |
8102 return result; | |
8103 } | |
8104 } | |
8105 } | |
8106 return 0; | |
8107 } | |
8108 | |
8109 | |
8110 //----- (0042F3D6) -------------------------------------------------------- | |
8111 void InitializeTurnBasedAnimations(void *_this) | |
8112 { | |
8113 unsigned int *v1; // edi@1 | |
8114 | |
8115 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
8116 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
8117 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
8118 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
8119 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
8120 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
8121 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
8122 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
8123 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
8124 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
8125 v1 = pIconIDs_Turn; | |
8126 do | |
8127 { | |
8128 pIconsFrameTable->InitializeAnimation(*v1); | |
8129 ++v1; | |
8130 } | |
8131 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
8132 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
8133 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
8134 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
8135 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
8136 } | |
8137 | |
8138 //----- (0042F4DA) -------------------------------------------------------- | |
8139 signed int __cdecl sub_42F4DA() | |
8140 { | |
8141 signed int v0; // edi@1 | |
82 | 8142 Actor *v1; // esi@4 |
0 | 8143 int v2; // ebx@5 |
8144 int v3; // eax@5 | |
8145 int v4; // ebx@5 | |
8146 unsigned int v5; // ecx@5 | |
8147 int v6; // edx@6 | |
8148 unsigned int v7; // edx@8 | |
8149 unsigned int v8; // edx@10 | |
8150 __int16 v9; // ax@12 | |
8151 signed int result; // eax@20 | |
8152 int v11; // [sp+Ch] [bp-10h]@5 | |
8153 int v12; // [sp+10h] [bp-Ch]@5 | |
8154 signed int v13; // [sp+14h] [bp-8h]@3 | |
8155 | |
8156 v0 = 5120; | |
8157 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
8158 v0 = 2560; | |
8159 v13 = 0; | |
8160 if ( (signed int)uNumActors <= 0 ) | |
8161 { | |
8162 LABEL_20: | |
8163 result = 0; | |
8164 } | |
8165 else | |
8166 { | |
82 | 8167 v1 = pActors; |
0 | 8168 while ( 1 ) |
8169 { | |
82 | 8170 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x); |
8171 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y); | |
8172 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z); | |
0 | 8173 v3 = v2; |
8174 v4 = v11; | |
8175 v5 = v12; | |
8176 if ( v3 < v11 ) | |
8177 { | |
8178 v6 = v3; | |
8179 v3 = v11; | |
8180 v4 = v6; | |
8181 } | |
8182 if ( v3 < v12 ) | |
8183 { | |
8184 v7 = v3; | |
8185 v3 = v12; | |
8186 v5 = v7; | |
8187 } | |
8188 if ( v4 < (signed int)v5 ) | |
8189 { | |
8190 v8 = v5; | |
8191 v5 = v4; | |
8192 v4 = v8; | |
8193 } | |
8194 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 ) | |
8195 { | |
82 | 8196 v9 = v1->uAIState; |
8197 if ( v1->uAIState != 5 ) | |
0 | 8198 { |
8199 if ( v9 != 4 | |
8200 && v9 != 11 | |
8201 && v9 != 19 | |
8202 && v9 != 17 | |
82 | 8203 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) ) |
0 | 8204 break; |
8205 } | |
8206 } | |
8207 ++v13; | |
82 | 8208 ++v1; |
0 | 8209 if ( v13 >= (signed int)uNumActors ) |
8210 goto LABEL_20; | |
8211 } | |
8212 result = 1; | |
8213 } | |
8214 return result; | |
8215 } | |
8216 | |
8217 //----- (0042F7EB) -------------------------------------------------------- | |
8218 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) | |
8219 { | |
8220 unsigned int v9; // edi@1 | |
8221 signed int v10; // edx@3 | |
8222 char *v11; // ecx@4 | |
8223 unsigned __int16 v12; // ax@7 | |
8224 unsigned int v13; // edx@9 | |
8225 char *v14; // ecx@10 | |
8226 int v15; // esi@17 | |
8227 int v16; // eax@18 | |
8228 int v17; // edi@20 | |
8229 int v18; // esi@20 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8230 //SpriteObject a1a; // [sp+Ch] [bp-78h]@1 |
0 | 8231 int v21; // [sp+7Ch] [bp-8h]@1 |
8232 unsigned int v22; // [sp+80h] [bp-4h]@1 | |
8233 | |
8234 v9 = uSpriteID; | |
8235 v21 = x; | |
8236 v22 = uSpriteID; | |
8237 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8238 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
|
8239 //SpriteObject::SpriteObject(&a1a); |
0 | 8240 a1a.stru_24.Reset(); |
8241 | |
8242 if ( a9 ) | |
8243 { | |
8244 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24)); | |
8245 v9 = v22; | |
8246 } | |
8247 v10 = 0; | |
8248 a1a.field_50 = 0; | |
8249 a1a.field_4C = 0; | |
8250 a1a.field_48 = 0; | |
8251 a1a.field_54 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8252 a1a.uType = v9; |
0 | 8253 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
8254 { | |
8255 LABEL_7: | |
8256 v12 = 0; | |
8257 } | |
8258 else | |
8259 { | |
8260 v11 = (char *)&pObjectList->pObjects->uObjectID; | |
8261 while ( (short)v9 != *(short *)v11 ) | |
8262 { | |
8263 ++v10; | |
8264 v11 += 56; | |
8265 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
8266 goto LABEL_7; | |
8267 } | |
8268 v12 = v10; | |
8269 } | |
8270 a1a.uObjectDescID = v12; | |
8271 a1a.vPosition.z = z; | |
8272 a1a.vPosition.x = v21; | |
8273 a1a.vPosition.y = y; | |
8274 a1a.uSoundID = 0; | |
8275 a1a.uAttributes = attributes; | |
8276 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | |
8277 a1a.uSpriteFrameID = 0; | |
303 | 8278 a1a.field_58_pid = 0; |
0 | 8279 a1a.field_5C = 0; |
8280 if ( !(a1a.uAttributes & 0x10) ) | |
8281 { | |
8282 v13 = 0; | |
222 | 8283 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
0 | 8284 { |
8285 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | |
8286 while ( *(short *)v14 != v9 ) | |
8287 { | |
8288 ++v13; | |
8289 v14 += 48; | |
222 | 8290 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount ) |
0 | 8291 goto LABEL_16; |
8292 } | |
8293 a1a.stru_24.uItemID = v13; | |
8294 } | |
8295 } | |
8296 LABEL_16: | |
8297 if ( a7 ) | |
8298 { | |
8299 v15 = count; | |
8300 if ( count > 0 ) | |
8301 { | |
8302 do | |
8303 { | |
8304 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
8305 v16 = rand(); | |
8306 a1a.Create( | |
8307 (signed __int16)a1a.uFacing, | |
8308 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1), | |
8309 a4, | |
8310 0); | |
8311 --v15; | |
8312 } | |
8313 while ( v15 ); | |
8314 } | |
8315 } | |
8316 else | |
8317 { | |
8318 v17 = count; | |
8319 v18 = stru_5C6E00->uIntegerHalfPi; | |
8320 a1a.uFacing = 0; | |
8321 if ( count > 0 ) | |
8322 { | |
8323 do | |
8324 { | |
8325 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0); | |
8326 --v17; | |
8327 } | |
8328 while ( v17 ); | |
8329 } | |
8330 } | |
8331 return 1; | |
8332 } | |
8333 | |
8334 //----- (0042F960) -------------------------------------------------------- | |
8335 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
8336 { | |
8337 int v3; // ebx@1 | |
8338 int v4; // edi@1 | |
8339 signed int v5; // edx@1 | |
8340 char *v6; // ecx@2 | |
8341 unsigned __int16 v7; // ax@5 | |
8342 signed int v8; // eax@6 | |
8343 signed int v9; // eax@7 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8344 //SpriteObject a1; // [sp+Ch] [bp-70h]@1 |
0 | 8345 |
8346 v3 = x; | |
8347 v4 = y; | |
8348 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8349 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
|
8350 //SpriteObject::SpriteObject(&a1); |
0 | 8351 a1.stru_24.Reset(); |
8352 | |
8353 v5 = 0; | |
8354 a1.field_50 = 0; | |
8355 a1.field_4C = 0; | |
8356 a1.field_48 = 0; | |
8357 a1.field_54 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8358 a1.uType = 800; |
0 | 8359 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
8360 { | |
8361 LABEL_5: | |
8362 v7 = 0; | |
8363 } | |
8364 else | |
8365 { | |
8366 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
8367 while ( *(short *)v6 != 800 ) | |
8368 { | |
8369 ++v5; | |
8370 v6 += 56; | |
8371 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
8372 goto LABEL_5; | |
8373 } | |
8374 v7 = v5; | |
8375 } | |
8376 a1.uObjectDescID = v7; | |
8377 a1.vPosition.x = v3; | |
8378 a1.vPosition.y = v4; | |
8379 a1.vPosition.z = z; | |
8380 a1.uSoundID = 0; | |
8381 a1.uAttributes = 0; | |
8382 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
8383 a1.uSpriteFrameID = 0; | |
303 | 8384 a1.field_58_pid = 0; |
0 | 8385 a1.field_5C = 0; |
8386 v8 = a1.Create(0, 0, 0, 0); | |
8387 if ( v8 != -1 ) | |
8388 { | |
8389 v9 = 8 * v8; | |
8390 LOBYTE(v9) = v9 | 2; | |
8391 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
8392 } | |
8393 } | |
8394 | |
8395 //----- (0042FA22) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8396 SpriteObject *__cdecl sub_42FA22_mess_with_laying_item_list() |
0 | 8397 { |
8398 size_t v0; // edx@1 | |
8399 int v1; // ebp@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8400 SpriteObject *result; // eax@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8401 SpriteObject *v3; // ebx@1 |
0 | 8402 |
8403 v0 = 0; | |
8404 v1 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8405 //result = (char *)&pSpriteObjects[0].uObjectDescID; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8406 result = pSpriteObjects; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8407 v3 = pSpriteObjects; |
0 | 8408 do |
8409 { | |
79 | 8410 if ( result->uObjectDescID ) |
0 | 8411 { |
8412 if ( v1 != v0 ) | |
8413 { | |
79 | 8414 memcpy(v3, result, 0x70u); |
8415 result->uObjectDescID = 0; | |
0 | 8416 } |
8417 ++v0; | |
79 | 8418 ++v3;// = (char *)v3 + 112; |
0 | 8419 } |
79 | 8420 ++result;// += 112; |
0 | 8421 ++v1; |
8422 } | |
79 | 8423 //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
|
8424 while( result <= &pSpriteObjects[999] ); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8425 uNumSpriteObjects = v0; |
0 | 8426 return result; |
8427 } | |
8428 | |
8429 //----- (0042FA66) -------------------------------------------------------- | |
8430 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) | |
8431 { | |
8432 int v6; // edi@1 | |
8433 int v7; // esi@1 | |
8434 char *v8; // ecx@2 | |
8435 unsigned __int16 v9; // ax@5 | |
8436 int v10; // eax@10 | |
8437 signed int result; // eax@11 | |
8438 __int16 v12; // ax@12 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8439 //SpriteObject a1a; // [sp+Ch] [bp-74h]@1 |
0 | 8440 int v14; // [sp+7Ch] [bp-4h]@1 |
8441 | |
8442 v6 = a1; | |
8443 v7 = a2; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8444 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
|
8445 //SpriteObject::SpriteObject(&a1a); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8446 a1a.uType = 600; |
0 | 8447 a1a.stru_24.Reset(); |
8448 | |
8449 a1a.field_48 = 6; | |
8450 a1a.field_4C = 8; | |
8451 a1a.field_50 = 3; | |
8452 v14 = 0; | |
8453 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
8454 { | |
8455 LABEL_5: | |
8456 v9 = 0; | |
8457 } | |
8458 else | |
8459 { | |
8460 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
8461 while ( (short)a1a.uType != *(short *)v8 ) |
0 | 8462 { |
8463 ++v14; | |
8464 v8 += 56; | |
8465 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
8466 goto LABEL_5; | |
8467 } | |
8468 v9 = v14; | |
8469 } | |
8470 a1a.uObjectDescID = v9; | |
8471 a1a.vPosition.x = v6; | |
8472 a1a.vPosition.y = v7; | |
8473 a1a.vPosition.z = a3; | |
8474 a1a.uAttributes = 0; | |
8475 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
8476 a1a.uSpriteFrameID = 0; | |
8477 a1a.field_5C = 0; | |
8478 a1a.field_60_distance_related_prolly_lod = 0; | |
8479 a1a.uFacing = 0; | |
8480 a1a.uSoundID = 0; | |
8481 if ( a6 >= 1 || a6 <= 4 ) | |
8482 { | |
8483 v10 = 8 * a6 - 8; | |
303 | 8484 LOBYTE(v10) = v10 | OBJECT_Player; |
8485 a1a.field_58_pid = v10; | |
0 | 8486 } |
8487 else | |
8488 { | |
303 | 8489 a1a.field_58_pid = 0; |
0 | 8490 } |
8491 result = a1a.Create(0, 0, 0, 0); | |
8492 if ( result != -1 ) | |
8493 { | |
8494 v12 = 8 * result; | |
8495 LOBYTE(v12) = v12 | 2; | |
8496 result = stru_50FE08.Add( | |
8497 v12, | |
8498 a5, | |
8499 SLOWORD(a1a.vPosition.x), | |
8500 SLOWORD(a1a.vPosition.y), | |
8501 SLOWORD(a1a.vPosition.z), | |
8502 0, | |
8503 0); | |
8504 } | |
8505 return result; | |
8506 } | |
8507 | |
8508 | |
8509 | |
8510 //----- (0042FB5C) -------------------------------------------------------- | |
8511 bool __fastcall sub_42FB5C(signed int a1) | |
8512 { | |
8513 int v1; // ecx@3 | |
8514 int v2; // ecx@4 | |
8515 int v3; // ecx@5 | |
8516 int v4; // ecx@6 | |
8517 int v5; // ecx@7 | |
8518 int v6; // ecx@8 | |
8519 char v7; // zf@9 | |
8520 | |
8521 if ( a1 > 39 ) | |
8522 { | |
8523 if ( a1 > 77 ) | |
8524 { | |
8525 if ( a1 == 80 ) | |
8526 return 0; | |
8527 if ( a1 > 84 ) | |
8528 { | |
8529 if ( a1 <= 86 ) | |
8530 return 0; | |
8531 v7 = a1 == 95; | |
8532 goto LABEL_20; | |
8533 } | |
8534 } | |
8535 else | |
8536 { | |
8537 if ( a1 == 77 ) | |
8538 return 0; | |
8539 if ( a1 >= 46 ) | |
8540 { | |
8541 if ( a1 <= 47 || a1 == 51 ) | |
8542 return 0; | |
8543 v7 = a1 == 73; | |
8544 goto LABEL_20; | |
8545 } | |
8546 } | |
8547 return 1; | |
8548 } | |
8549 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
8550 return 1; | |
8551 v2 = v1 - 3; | |
8552 if ( !v2 ) | |
8553 return 0; | |
8554 v3 = v2 - 1; | |
8555 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
8556 return 1; | |
8557 v5 = v4 - 8; | |
8558 if ( !v5 ) | |
8559 return 0; | |
8560 v6 = v5 - 1; | |
8561 if ( !v6 ) | |
8562 return 1; | |
8563 v7 = v6 == 20; | |
8564 LABEL_20: | |
8565 if ( !v7 ) | |
8566 return 1; | |
8567 return 0; | |
8568 } | |
8569 | |
8570 //----- (0042FBDD) -------------------------------------------------------- | |
8571 void __cdecl sub_42FBDD() | |
8572 { | |
388 | 8573 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 8574 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
8575 pRenderer->Present(); | |
8576 } | |
8577 | |
8578 //----- (0042FC15) -------------------------------------------------------- | |
11 | 8579 void __cdecl CloseWindowBackground() |
0 | 8580 { |
388 | 8581 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 8582 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
8583 pRenderer->Present(); | |
8584 } | |
8585 | |
8586 //----- (0042FC4E) -------------------------------------------------------- | |
8587 void __cdecl ProcessInputActions() | |
8588 { | |
8589 ActionQueue *pActionQueue; // esi@7 | |
8590 Keyboard *v3; // ecx@8 | |
8591 char v4; // al@9 | |
8592 ActionQueue *v5; // ecx@19 | |
8593 Player *v6; // ecx@86 | |
8594 Player *v7; // esi@100 | |
8595 char v8; // bl@100 | |
8596 unsigned __int16 v9; // ax@102 | |
8597 int v10; // eax@103 | |
8598 unsigned int v11; // eax@127 | |
8599 signed int v12; // esi@157 | |
8600 Keyboard *v13; // ecx@158 | |
8601 char v14; // al@159 | |
8602 unsigned int v15; // eax@168 | |
8603 void *v16; // esi@177 | |
8604 int v17; // [sp-14h] [bp-1Ch]@8 | |
8605 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
8606 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 | |
271 | 8607 //__int16 v20; // [sp-14h] [bp-1Ch]@60 |
0 | 8608 int v21; // [sp-14h] [bp-1Ch]@68 |
8609 int v22; // [sp-Ch] [bp-14h]@158 | |
8610 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
8611 int v24; // [sp+4h] [bp-4h]@87 | |
8612 | |
8613 pGame->pKeyboardInstance->EnterCriticalSection(); | |
8614 auto pKeyboard = pGame->pKeyboardInstance; | |
8615 if (!bAlwaysRun) | |
8616 { | |
8617 if (pKeyboard->IsShiftHeld()) | |
8618 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8619 else | |
8620 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8621 } | |
8622 else | |
8623 { | |
8624 if (pKeyboard->IsShiftHeld()) | |
8625 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
8626 else | |
8627 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
8628 } | |
8629 | |
140 | 8630 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
486 | 8631 //LABEL_6: |
0 | 8632 if ( !pEventTimer->bPaused ) |
8633 { | |
8634 inputAction = (InputAction)0; | |
8635 pActionQueue = pPartyActionQueue; | |
8636 while ( 1 ) | |
8637 { | |
8638 v3 = pGame->pKeyboardInstance; | |
8639 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | |
8640 if ( pKeyActionMap->pToggleTypes[inputAction] ) | |
8641 v4 = v3->WasKeyPressed(v17); | |
8642 else | |
8643 v4 = v3->IsKeyBeingHeld(v17); | |
8644 if ( v4 ) | |
8645 { | |
8646 switch ( inputAction ) | |
8647 { | |
8648 case INPUT_MoveForward: | |
271 | 8649 if (pCurrentScreen != SCREEN_GAME) |
0 | 8650 break; |
8651 if (!pParty->bTurnBasedModeOn) | |
163 | 8652 //goto _do_move_forward; |
0 | 8653 { |
8654 v5 = pActionQueue; | |
140 | 8655 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 8656 partyAction = PARTY_RunForward; |
8657 else | |
8658 partyAction = PARTY_WalkForward; | |
163 | 8659 //goto _add_action_and_continue; |
8660 v5->Add(partyAction); | |
8661 break; | |
8662 } | |
8663 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) | |
8664 { | |
8665 pTurnEngine->uActionPointsLeft -= 26; | |
8666 //_do_move_forward: | |
8667 v5 = pActionQueue; | |
8668 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
8669 partyAction = PARTY_RunForward; | |
8670 else | |
8671 partyAction = PARTY_WalkForward; | |
8672 //goto _add_action_and_continue; | |
8673 v5->Add(partyAction); | |
8674 break; | |
0 | 8675 } |
8676 break; | |
8677 case INPUT_MoveBackwards: | |
17 | 8678 //__debugbreak(); |
271 | 8679 if (pCurrentScreen != SCREEN_GAME) |
0 | 8680 break; |
8681 if (!pParty->bTurnBasedModeOn) | |
17 | 8682 //goto _do_move_backwards; |
8683 { | |
8684 v5 = pActionQueue; | |
8685 if ( pParty->uFlags2 & 2 ) | |
8686 partyAction = PARTY_RunBackward; | |
8687 else | |
8688 partyAction = PARTY_WalkBackward; | |
163 | 8689 //goto _add_action_and_continue; |
8690 v5->Add(partyAction); | |
8691 break; | |
17 | 8692 } |
0 | 8693 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
8694 { | |
8695 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8696 //_do_move_backwards: |
0 | 8697 v5 = pActionQueue; |
8698 if ( pParty->uFlags2 & 2 ) | |
8699 partyAction = PARTY_RunBackward; | |
8700 else | |
8701 partyAction = PARTY_WalkBackward; | |
163 | 8702 //goto _add_action_and_continue; |
8703 v5->Add(partyAction); | |
8704 break; | |
0 | 8705 } |
8706 break; | |
8707 case INPUT_StrafeLeft: | |
17 | 8708 //__debugbreak(); |
271 | 8709 if (pCurrentScreen != SCREEN_GAME) |
0 | 8710 break; |
8711 if (!pParty->bTurnBasedModeOn) | |
17 | 8712 //goto _do_strafe_left; |
8713 { | |
8714 partyAction = PARTY_StrafeLeft; | |
163 | 8715 //goto _add_action_and_continue_; |
8716 v5 = pActionQueue; | |
8717 v5->Add(partyAction); | |
8718 break; | |
17 | 8719 } |
0 | 8720 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8721 break; | |
8722 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8723 //_do_strafe_left: |
0 | 8724 partyAction = PARTY_StrafeLeft; |
163 | 8725 //goto _add_action_and_continue_; |
8726 v5 = pActionQueue; | |
8727 v5->Add(partyAction); | |
8728 break; | |
0 | 8729 case INPUT_StrafeRight: |
17 | 8730 //__debugbreak(); |
271 | 8731 if (pCurrentScreen != SCREEN_GAME) |
0 | 8732 break; |
8733 if (!pParty->bTurnBasedModeOn) | |
17 | 8734 //goto _do_strafe_right; |
8735 { | |
8736 partyAction = PARTY_StrafeRight; | |
163 | 8737 //goto _add_action_and_continue_; |
8738 v5 = pActionQueue; | |
8739 v5->Add(partyAction); | |
8740 break; | |
17 | 8741 } |
0 | 8742 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
8743 break; | |
8744 pTurnEngine->uActionPointsLeft -= 26; | |
17 | 8745 //_do_strafe_right: |
0 | 8746 partyAction = PARTY_StrafeRight; |
163 | 8747 //goto _add_action_and_continue_; |
8748 v5 = pActionQueue; | |
8749 v5->Add(partyAction); | |
8750 break; | |
0 | 8751 case INPUT_TurnLeft: |
271 | 8752 if (pCurrentScreen != SCREEN_GAME) |
0 | 8753 break; |
8754 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
8755 { | |
8756 if (pParty->bTurnBasedModeOn) | |
8757 { | |
8758 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8759 break; | |
8760 pTurnEngine->uActionPointsLeft -= 26; | |
8761 } | |
8762 partyAction_ = PARTY_StrafeLeft; | |
8763 } | |
8764 else | |
8765 { | |
8766 if ( pParty->uFlags2 & 2 ) | |
8767 partyAction_ = PARTY_FastTurnLeft; | |
8768 else | |
8769 partyAction_ = PARTY_TurnLeft; | |
8770 } | |
8771 pActionQueue->Add(partyAction_); | |
8772 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8773 { | |
271 | 8774 pWeather->OnPlayerTurn(10); |
0 | 8775 } |
8776 break; | |
8777 case INPUT_TurnRight: | |
271 | 8778 if (pCurrentScreen != SCREEN_GAME) |
0 | 8779 break; |
8780 if ( GetAsyncKeyState(17) ) // strafing | |
8781 { | |
8782 if (pParty->bTurnBasedModeOn) | |
8783 { | |
8784 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | |
8785 break; | |
8786 pTurnEngine->uActionPointsLeft -= 26; | |
8787 } | |
271 | 8788 v21 = PARTY_StrafeRight; |
0 | 8789 } |
8790 else | |
8791 { | |
8792 if ( pParty->uFlags2 & 2 ) | |
271 | 8793 v21 = PARTY_FastTurnRight; |
0 | 8794 else |
271 | 8795 v21 = PARTY_TurnRight; |
0 | 8796 } |
8797 pActionQueue->Add((PartyAction)v21); | |
8798 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) | |
8799 { | |
271 | 8800 pWeather->OnPlayerTurn(-10); |
0 | 8801 } |
8802 break; | |
8803 case INPUT_Jump: | |
17 | 8804 //__debugbreak(); |
271 | 8805 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 8806 break; |
8807 partyAction = (PartyAction)12; | |
163 | 8808 //goto _add_action_and_continue_; |
8809 v5 = pActionQueue; | |
8810 v5->Add(partyAction); | |
8811 break; | |
0 | 8812 case INPUT_Yell: |
187 | 8813 if (!pCurrentScreen && uActiveCharacter) |
0 | 8814 { |
8815 pParty->Yell(); | |
187 | 8816 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 8817 } |
187 | 8818 break; |
0 | 8819 case INPUT_Pass: |
17 | 8820 //__debugbreak(); |
0 | 8821 if ( pCurrentScreen ) |
8822 break; | |
8823 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 8824 //goto LABEL_118; |
8825 { | |
8826 pTurnEngine->field_18 |= 8u; | |
8827 break; | |
8828 } | |
0 | 8829 if ( uActiveCharacter ) |
8830 { | |
8831 v6 = pPlayers[uActiveCharacter]; | |
8832 if ( !v6->uTimeToRecovery ) | |
8833 { | |
8834 v24 = v6->GetAttackRecoveryTime(0); | |
8835 if ( !pParty->bTurnBasedModeOn ) | |
8836 pPlayers[uActiveCharacter]->SetRecoveryTime( | |
8837 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
8838 pStru277->_427D48(uActiveCharacter); | |
8839 pTurnEngine->_40471C(); | |
8840 } | |
8841 } | |
8842 break; | |
8843 case INPUT_Combat: | |
17 | 8844 //__debugbreak(); |
271 | 8845 if (pCurrentScreen == SCREEN_GAME) |
0 | 8846 { |
8847 if (pParty->bTurnBasedModeOn) | |
8848 { | |
141 | 8849 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
0 | 8850 { |
8851 pParty->bTurnBasedModeOn = 0; | |
8852 pTurnEngine->End(true); | |
8853 } | |
8854 } | |
8855 else | |
8856 { | |
8857 pTurnEngine->Start(); | |
8858 pParty->bTurnBasedModeOn = true; | |
8859 } | |
8860 } | |
8861 break; | |
8862 case INPUT_CastReady: | |
17 | 8863 //__debugbreak(); |
271 | 8864 if (pCurrentScreen != SCREEN_GAME) |
0 | 8865 break; |
8866 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) | |
17 | 8867 //goto LABEL_118; |
8868 { | |
8869 pTurnEngine->field_18 |= 8u; | |
8870 break; | |
8871 } | |
0 | 8872 if ( !uActiveCharacter ) |
8873 break; | |
8874 v7 = pPlayers[uActiveCharacter]; | |
8875 v8 = v7->uQuickSpell; | |
8876 if ( !v8 | |
8877 || bUnderwater | |
8878 || ((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)), | |
8879 v10 > v7->sMana) ) | |
8880 { | |
8881 pActionQueue = pPartyActionQueue; | |
8882 LABEL_120: | |
437 | 8883 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); |
8884 break; | |
8885 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 8886 { |
271 | 8887 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; |
163 | 8888 //goto _send_message; |
8889 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8890 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8891 ++pMessageQueue_50CBD0->uNumMessages; | |
8892 break; | |
437 | 8893 }*/ |
0 | 8894 } |
8895 else | |
8896 { | |
8897 pActionQueue = pPartyActionQueue; | |
8898 if ( dword_50C9E8 < 40 ) | |
8899 { | |
8900 dword_50C9EC[3 * dword_50C9E8] = 25; | |
437 | 8901 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8902 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 8903 ++dword_50C9E8; |
8904 } | |
8905 } | |
8906 break; | |
8907 case INPUT_Attack: | |
17 | 8908 //__debugbreak(); |
271 | 8909 if (pCurrentScreen != SCREEN_GAME) |
0 | 8910 break; |
8911 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) | |
8912 goto LABEL_120; | |
17 | 8913 //LABEL_118: |
0 | 8914 pTurnEngine->field_18 |= 8u; |
8915 break; | |
8916 case INPUT_EventTrigger: | |
271 | 8917 if (pCurrentScreen == SCREEN_GAME) |
0 | 8918 { |
437 | 8919 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 8920 break; |
271 | 8921 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action; |
163 | 8922 //goto _send_message; |
8923 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
8924 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8925 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 8926 break;*/ |
8927 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
163 | 8928 break; |
0 | 8929 } |
151 | 8930 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 8931 { |
8932 v11 = pMessageQueue_50CBD0->uNumMessages; | |
8933 if ( pMessageQueue_50CBD0->uNumMessages ) | |
8934 { | |
437 | 8935 v11 = 0; |
8936 pMessageQueue_50CBD0->uNumMessages = 0; | |
0 | 8937 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
8938 { | |
8939 v11 = 1; | |
8940 pMessageQueue_50CBD0->uNumMessages = 1; | |
163 | 8941 //LABEL_132: |
271 | 8942 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 8943 //_send_message: |
0 | 8944 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
8945 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8946 ++pMessageQueue_50CBD0->uNumMessages; | |
8947 break; | |
8948 } | |
437 | 8949 break; |
0 | 8950 } |
437 | 8951 /*if ( (signed int)v11 < 40 ) |
163 | 8952 //goto LABEL_132; |
8953 { | |
271 | 8954 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; |
163 | 8955 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
8956 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
8957 ++pMessageQueue_50CBD0->uNumMessages; | |
8958 break; | |
437 | 8959 }*/ |
8960 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 8961 } |
8962 break; | |
8963 case INPUT_CharCycle: | |
17 | 8964 //__debugbreak(); |
151 | 8965 if ( pCurrentScreen == SCREEN_SPELL_BOOK |
0 | 8966 || dword_50C9E8 >= 40 ) |
8967 break; | |
8968 dword_50C9EC[3 * dword_50C9E8] = 176; | |
163 | 8969 //goto LABEL_155; |
437 | 8970 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
8971 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 8972 ++dword_50C9E8; |
8973 break; | |
0 | 8974 case INPUT_LookUp: |
17 | 8975 //__debugbreak(); |
0 | 8976 if ( pEventTimer->bPaused ) |
8977 break; | |
8978 partyAction = (PartyAction)7; | |
163 | 8979 //goto _add_action_and_continue_; |
8980 v5 = pActionQueue; | |
8981 v5->Add(partyAction); | |
8982 break; | |
0 | 8983 case INPUT_CenterView: |
17 | 8984 //__debugbreak(); |
0 | 8985 if ( pEventTimer->bPaused ) |
8986 break; | |
8987 partyAction = (PartyAction)9; | |
163 | 8988 //goto _add_action_and_continue_; |
8989 v5 = pActionQueue; | |
8990 v5->Add(partyAction); | |
8991 break; | |
0 | 8992 case INPUT_LookDown: |
17 | 8993 //__debugbreak(); |
0 | 8994 if ( pEventTimer->bPaused ) |
8995 break; | |
8996 partyAction = (PartyAction)8; | |
163 | 8997 //goto _add_action_and_continue_; |
8998 v5 = pActionQueue; | |
8999 v5->Add(partyAction); | |
9000 break; | |
0 | 9001 case INPUT_FlyUp: |
17 | 9002 //__debugbreak(); |
0 | 9003 if ( pCurrentScreen |
9004 || pEventTimer->bPaused ) | |
9005 break; | |
9006 partyAction = (PartyAction)13; | |
163 | 9007 //goto _add_action_and_continue_; |
9008 v5 = pActionQueue; | |
9009 v5->Add(partyAction); | |
9010 break; | |
0 | 9011 case INPUT_Land: |
17 | 9012 //__debugbreak(); |
0 | 9013 if ( pCurrentScreen |
9014 || pEventTimer->bPaused ) | |
9015 break; | |
9016 partyAction = (PartyAction)15; | |
163 | 9017 //goto _add_action_and_continue_; |
9018 v5 = pActionQueue; | |
9019 v5->Add(partyAction); | |
9020 break; | |
0 | 9021 case INPUT_FlyDown: |
17 | 9022 //__debugbreak(); |
0 | 9023 if ( !pCurrentScreen |
9024 && !pEventTimer->bPaused ) | |
9025 { | |
9026 partyAction = (PartyAction)14; | |
163 | 9027 //_add_action_and_continue_: |
0 | 9028 v5 = pActionQueue; |
163 | 9029 //_add_action_and_continue: |
0 | 9030 v5->Add(partyAction); |
9031 } | |
9032 break; | |
9033 case INPUT_ZoomIn: | |
17 | 9034 //__debugbreak(); |
0 | 9035 if ( dword_50C9E8 >= 40 ) |
9036 break; | |
9037 dword_50C9EC[3 * dword_50C9E8] = 367; | |
163 | 9038 //goto LABEL_155; |
437 | 9039 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9040 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
163 | 9041 ++dword_50C9E8; |
9042 break; | |
0 | 9043 case INPUT_ZoomOut: |
17 | 9044 //__debugbreak(); |
0 | 9045 if ( dword_50C9E8 < 40 ) |
9046 { | |
9047 dword_50C9EC[3 * dword_50C9E8] = 368; | |
163 | 9048 //LABEL_155: |
437 | 9049 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; |
9050 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; | |
0 | 9051 ++dword_50C9E8; |
9052 } | |
9053 break; | |
9054 case INPUT_AlwaysRun: | |
9055 bAlwaysRun = bAlwaysRun == 0; | |
9056 break; | |
17 | 9057 default: |
9058 //__debugbreak(); | |
9059 break; | |
0 | 9060 } |
9061 } | |
9062 inputAction = (InputAction)((int)inputAction + 1); | |
9063 if ( (signed int)inputAction >= 30 ) | |
9064 goto LABEL_176; | |
9065 } | |
9066 } | |
9067 v12 = 0; | |
9068 do | |
9069 { | |
9070 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12]; | |
9071 v13 = pGame->pKeyboardInstance; | |
9072 if ( pKeyActionMap->pToggleTypes[v12] ) | |
9073 v14 = v13->WasKeyPressed(v22); | |
9074 else | |
9075 v14 = v13->IsKeyBeingHeld(v22); | |
9076 if ( v14 && v12 == 9 ) | |
9077 { | |
9078 if ( !pCurrentScreen ) | |
9079 { | |
437 | 9080 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 9081 goto LABEL_175; |
9082 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; | |
17 | 9083 //goto LABEL_174; |
9084 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
9085 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9086 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9087 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
17 | 9088 goto LABEL_175; |
0 | 9089 } |
151 | 9090 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE |
9091 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
0 | 9092 { |
9093 v15 = pMessageQueue_50CBD0->uNumMessages; | |
9094 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9095 { | |
9096 v15 = 0; | |
9097 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
9098 { | |
9099 v15 = 1; | |
437 | 9100 pMessageQueue_50CBD0->uNumMessages = 0; |
17 | 9101 //goto LABEL_173; |
437 | 9102 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape; |
17 | 9103 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9104 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
9105 ++pMessageQueue_50CBD0->uNumMessages; | |
9106 goto LABEL_175; | |
0 | 9107 } |
9108 pMessageQueue_50CBD0->uNumMessages = 0; | |
9109 } | |
437 | 9110 /*if ( (signed int)v15 >= 40 ) |
0 | 9111 goto LABEL_175; |
17 | 9112 //LABEL_173: |
0 | 9113 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113; |
17 | 9114 //LABEL_174: |
0 | 9115 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
9116 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 9117 ++pMessageQueue_50CBD0->uNumMessages;*/ |
9118 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
0 | 9119 goto LABEL_175; |
9120 } | |
9121 } | |
9122 LABEL_175: | |
9123 ++v12; | |
9124 } | |
9125 while ( v12 < 30 ); | |
9126 LABEL_176: | |
9127 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9128 { | |
9129 AsyncKeyboard::LeaveCriticalSection(); | |
9130 v16 = pAsyncKeyboard; | |
9131 AsyncKeyboard::EnterCriticalSection(); | |
9132 memset((char *)v16 + 521, 0, 0x100u); | |
9133 AsyncKeyboard::LeaveCriticalSection(); | |
9134 } | |
9135 } | |
9136 |