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