annotate mm7_6.cpp @ 370:7f817679b60e

_42777D_CastSpell_UseWand_ShootArrow
author Nomad
date Fri, 22 Feb 2013 17:47:41 +0200
parents 672b83584b0f
children 243418228760
rev   line source
0
Ritor1
parents:
diff changeset
1 #include "MM7.h"
Ritor1
parents:
diff changeset
2
Ritor1
parents:
diff changeset
3 #include "MapInfo.h"
Ritor1
parents:
diff changeset
4 #include "Game.h"
Ritor1
parents:
diff changeset
5 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
6 #include "GUIFont.h"
Ritor1
parents:
diff changeset
7 #include "GUIButton.h"
Ritor1
parents:
diff changeset
8 #include "GUIProgressBar.h"
Ritor1
parents:
diff changeset
9 #include "Party.h"
Ritor1
parents:
diff changeset
10 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
11 #include "Outdoor.h"
Ritor1
parents:
diff changeset
12 #include "IndoorCamera.h"
Ritor1
parents:
diff changeset
13 #include "Overlays.h"
Ritor1
parents:
diff changeset
14 #include "Monsters.h"
Ritor1
parents:
diff changeset
15 #include "Arcomage.h"
Ritor1
parents:
diff changeset
16 #include "LOD.h"
Ritor1
parents:
diff changeset
17 #include "Actor.h"
Ritor1
parents:
diff changeset
18 #include "Allocator.h"
Ritor1
parents:
diff changeset
19 #include "Events.h"
Ritor1
parents:
diff changeset
20 #include "Viewport.h"
Ritor1
parents:
diff changeset
21 #include "FrameTableInc.h"
Ritor1
parents:
diff changeset
22 #include "Math.h"
Ritor1
parents:
diff changeset
23 #include "LayingItem.h"
Ritor1
parents:
diff changeset
24 #include "ObjectList.h"
Ritor1
parents:
diff changeset
25 #include "Chest.h"
Ritor1
parents:
diff changeset
26 #include "PaletteManager.h"
Ritor1
parents:
diff changeset
27 #include "DecorationList.h"
Ritor1
parents:
diff changeset
28 #include "SaveLoad.h"
Ritor1
parents:
diff changeset
29 #include "stru123.h"
Ritor1
parents:
diff changeset
30 #include "Time.h"
Ritor1
parents:
diff changeset
31 #include "IconFrameTable.h"
Ritor1
parents:
diff changeset
32 #include "stru179.h"
Ritor1
parents:
diff changeset
33 #include "Awards.h"
Ritor1
parents:
diff changeset
34 #include "Autonotes.h"
Ritor1
parents:
diff changeset
35 #include "stru160.h"
Ritor1
parents:
diff changeset
36 #include "stru279.h"
Ritor1
parents:
diff changeset
37 #include "TurnEngine.h"
Ritor1
parents:
diff changeset
38 #include "stru277.h"
Ritor1
parents:
diff changeset
39 #include "Weather.h"
Ritor1
parents:
diff changeset
40 #include "stru272.h"
Ritor1
parents:
diff changeset
41 #include "stru298.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 169
diff changeset
42 #include "texts.h"
0
Ritor1
parents:
diff changeset
43 #include "StorylineTextTable.h"
Ritor1
parents:
diff changeset
44 #include "Events2D.h"
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
45 #include "Log.h"
0
Ritor1
parents:
diff changeset
46
Ritor1
parents:
diff changeset
47 #include "mm7_data.h"
Ritor1
parents:
diff changeset
48
Ritor1
parents:
diff changeset
49
Ritor1
parents:
diff changeset
50
Ritor1
parents:
diff changeset
51 //----- (00424EE0) --------------------------------------------------------
Ritor1
parents:
diff changeset
52 signed int __fastcall sr_424EE0_MakeFanFromTriangle(unsigned int uVertexID)
Ritor1
parents:
diff changeset
53 {
Ritor1
parents:
diff changeset
54 unsigned int v1; // edx@1
Ritor1
parents:
diff changeset
55 double v2; // st7@1
Ritor1
parents:
diff changeset
56 signed int v3; // edi@1
Ritor1
parents:
diff changeset
57 char *v4; // esi@4
Ritor1
parents:
diff changeset
58 char *v5; // ecx@4
Ritor1
parents:
diff changeset
59 unsigned int v6; // eax@4
Ritor1
parents:
diff changeset
60 char *v7; // edx@4
Ritor1
parents:
diff changeset
61 double v8; // st6@10
Ritor1
parents:
diff changeset
62 double v9; // st5@10
Ritor1
parents:
diff changeset
63 double v10; // st6@11
Ritor1
parents:
diff changeset
64 unsigned __int8 v11; // c2@15
Ritor1
parents:
diff changeset
65 unsigned __int8 v12; // c3@15
Ritor1
parents:
diff changeset
66 void *v13; // edi@22
Ritor1
parents:
diff changeset
67 char *v14; // eax@22
Ritor1
parents:
diff changeset
68 double v15; // st6@22
Ritor1
parents:
diff changeset
69 char *v16; // ecx@22
Ritor1
parents:
diff changeset
70 signed int result; // eax@24
Ritor1
parents:
diff changeset
71 unsigned int v18; // [sp+8h] [bp-2Ch]@4
Ritor1
parents:
diff changeset
72 bool v19; // [sp+Ch] [bp-28h]@6
Ritor1
parents:
diff changeset
73 char *v20; // [sp+10h] [bp-24h]@4
Ritor1
parents:
diff changeset
74 char *v21; // [sp+14h] [bp-20h]@4
Ritor1
parents:
diff changeset
75 signed int v22; // [sp+18h] [bp-1Ch]@1
Ritor1
parents:
diff changeset
76 char *v23; // [sp+1Ch] [bp-18h]@4
Ritor1
parents:
diff changeset
77 RenderVertexSoft *v24; // [sp+20h] [bp-14h]@4
Ritor1
parents:
diff changeset
78 char *v25; // [sp+24h] [bp-10h]@4
Ritor1
parents:
diff changeset
79 char *v26; // [sp+28h] [bp-Ch]@4
Ritor1
parents:
diff changeset
80 char *v27; // [sp+2Ch] [bp-8h]@4
Ritor1
parents:
diff changeset
81 char *v28; // [sp+30h] [bp-4h]@4
Ritor1
parents:
diff changeset
82
Ritor1
parents:
diff changeset
83 v1 = uVertexID;
Ritor1
parents:
diff changeset
84 v2 = (double)pOutdoorCamera->shading_dist_mist;
Ritor1
parents:
diff changeset
85 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID]));
Ritor1
parents:
diff changeset
86 v3 = 0;
Ritor1
parents:
diff changeset
87 v22 = 0;
Ritor1
parents:
diff changeset
88 if ( array_50AC10[0].vWorldViewPosition.x <= v2 )
Ritor1
parents:
diff changeset
89 v3 = 1;
Ritor1
parents:
diff changeset
90 if ( (signed int)(uVertexID + 1) <= 1 )
Ritor1
parents:
diff changeset
91 return 0;
Ritor1
parents:
diff changeset
92 v4 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
93 v5 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
94 v6 = v1;
Ritor1
parents:
diff changeset
95 v23 = (char *)&array_507D30[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
96 v26 = (char *)&array_507D30[0]._rhw;
0
Ritor1
parents:
diff changeset
97 v24 = array_507D30;
Ritor1
parents:
diff changeset
98 v20 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
99 v21 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
100 v25 = (char *)&array_507D30[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
101 v27 = (char *)&array_507D30[0].v;
Ritor1
parents:
diff changeset
102 v28 = (char *)&array_507D30[0].u;
Ritor1
parents:
diff changeset
103 v7 = (char *)&array_50AC10[0].v;
Ritor1
parents:
diff changeset
104 v18 = v6;
Ritor1
parents:
diff changeset
105 do
Ritor1
parents:
diff changeset
106 {
Ritor1
parents:
diff changeset
107 v19 = v2 >= *((float *)v7 + 5);
Ritor1
parents:
diff changeset
108 if ( v3 != v19 )
Ritor1
parents:
diff changeset
109 {
Ritor1
parents:
diff changeset
110 if ( v19 )
Ritor1
parents:
diff changeset
111 {
Ritor1
parents:
diff changeset
112 v8 = (v2 - *((float *)v7 - 7)) / (*((float *)v7 + 5) - *((float *)v7 - 7));
Ritor1
parents:
diff changeset
113 *(float *)v5 = (*((float *)v7 + 6) - *((float *)v7 - 6)) * v8 + *((float *)v7 - 6);
Ritor1
parents:
diff changeset
114 *(float *)v4 = (*((float *)v7 + 7) - *((float *)v7 - 5)) * v8 + *((float *)v7 - 5);
Ritor1
parents:
diff changeset
115 *(float *)v28 = (*((float *)v7 + 11) - *((float *)v7 - 1)) * v8 + *((float *)v7 - 1);
Ritor1
parents:
diff changeset
116 v9 = (*((float *)v7 + 12) - *(float *)v7) * v8 + *(float *)v7;
Ritor1
parents:
diff changeset
117 }
Ritor1
parents:
diff changeset
118 else
Ritor1
parents:
diff changeset
119 {
Ritor1
parents:
diff changeset
120 v10 = (v2 - *((float *)v7 + 5)) / (*((float *)v7 - 7) - *((float *)v7 + 5));
Ritor1
parents:
diff changeset
121 *(float *)v5 = (*((float *)v7 - 6) - *((float *)v7 + 6)) * v10 + *((float *)v7 + 6);
Ritor1
parents:
diff changeset
122 *(float *)v4 = (*((float *)v7 - 5) - *((float *)v7 + 7)) * v10 + *((float *)v7 + 7);
Ritor1
parents:
diff changeset
123 *(float *)v28 = (*((float *)v7 - 1) - *((float *)v7 + 11)) * v10 + *((float *)v7 + 11);
Ritor1
parents:
diff changeset
124 v9 = (*(float *)v7 - *((float *)v7 + 12)) * v10 + *((float *)v7 + 12);
Ritor1
parents:
diff changeset
125 }
Ritor1
parents:
diff changeset
126 *(float *)v27 = v9;
Ritor1
parents:
diff changeset
127 *(float *)v25 = v2;
Ritor1
parents:
diff changeset
128 *(float *)v26 = 1.0 / v2;
Ritor1
parents:
diff changeset
129 if ( v3 )
Ritor1
parents:
diff changeset
130 {
Ritor1
parents:
diff changeset
131 if ( v2 == *((float *)v7 - 7) && *(float *)v5 == *((float *)v7 - 6) )
Ritor1
parents:
diff changeset
132 {
Ritor1
parents:
diff changeset
133 v11 = 0;
Ritor1
parents:
diff changeset
134 v12 = *(float *)v4 == *((float *)v7 - 5);
Ritor1
parents:
diff changeset
135 goto LABEL_19;
Ritor1
parents:
diff changeset
136 }
Ritor1
parents:
diff changeset
137 }
Ritor1
parents:
diff changeset
138 else
Ritor1
parents:
diff changeset
139 {
Ritor1
parents:
diff changeset
140 if ( v2 == *((float *)v7 + 5) && *(float *)v5 == *((float *)v7 + 6) )
Ritor1
parents:
diff changeset
141 {
Ritor1
parents:
diff changeset
142 v11 = 0;
Ritor1
parents:
diff changeset
143 v12 = *(float *)v4 == *((float *)v7 + 7);
Ritor1
parents:
diff changeset
144 LABEL_19:
Ritor1
parents:
diff changeset
145 if ( v12 | v11 )
Ritor1
parents:
diff changeset
146 goto LABEL_21;
Ritor1
parents:
diff changeset
147 goto LABEL_20;
Ritor1
parents:
diff changeset
148 }
Ritor1
parents:
diff changeset
149 }
Ritor1
parents:
diff changeset
150 LABEL_20:
Ritor1
parents:
diff changeset
151 v26 += 48;
Ritor1
parents:
diff changeset
152 ++v24;
Ritor1
parents:
diff changeset
153 v25 += 48;
Ritor1
parents:
diff changeset
154 v27 += 48;
Ritor1
parents:
diff changeset
155 v28 += 48;
Ritor1
parents:
diff changeset
156 v5 += 48;
Ritor1
parents:
diff changeset
157 v4 += 48;
Ritor1
parents:
diff changeset
158 ++v22;
Ritor1
parents:
diff changeset
159 v23 += 48;
Ritor1
parents:
diff changeset
160 v21 = v5;
Ritor1
parents:
diff changeset
161 v20 = v4;
Ritor1
parents:
diff changeset
162 }
Ritor1
parents:
diff changeset
163 LABEL_21:
Ritor1
parents:
diff changeset
164 if ( v19 )
Ritor1
parents:
diff changeset
165 {
Ritor1
parents:
diff changeset
166 v13 = v24;
Ritor1
parents:
diff changeset
167 v14 = v26;
Ritor1
parents:
diff changeset
168 v21 += 48;
Ritor1
parents:
diff changeset
169 v15 = 1.0 / (*((float *)v7 + 5) + 0.0000001);
Ritor1
parents:
diff changeset
170 v20 += 48;
Ritor1
parents:
diff changeset
171 ++v22;
Ritor1
parents:
diff changeset
172 v28 += 48;
Ritor1
parents:
diff changeset
173 v27 += 48;
Ritor1
parents:
diff changeset
174 v25 += 48;
Ritor1
parents:
diff changeset
175 ++v24;
Ritor1
parents:
diff changeset
176 v26 += 48;
Ritor1
parents:
diff changeset
177 memcpy(v13, v7 + 8, 0x30u);
Ritor1
parents:
diff changeset
178 v16 = v23;
Ritor1
parents:
diff changeset
179 v23 += 48;
Ritor1
parents:
diff changeset
180 v4 = v20;
Ritor1
parents:
diff changeset
181 *(float *)v14 = v15;
Ritor1
parents:
diff changeset
182 *(int *)v16 = *((int *)v7 + 13);
Ritor1
parents:
diff changeset
183 v5 = v21;
Ritor1
parents:
diff changeset
184 }
Ritor1
parents:
diff changeset
185 v3 = v19;
Ritor1
parents:
diff changeset
186 v7 += 48;
Ritor1
parents:
diff changeset
187 --v18;
Ritor1
parents:
diff changeset
188 }
Ritor1
parents:
diff changeset
189 while ( v18 );
Ritor1
parents:
diff changeset
190 result = v22;
Ritor1
parents:
diff changeset
191 if ( v22 < 3 )
Ritor1
parents:
diff changeset
192 return 0;
Ritor1
parents:
diff changeset
193 return result;
Ritor1
parents:
diff changeset
194 }
Ritor1
parents:
diff changeset
195
Ritor1
parents:
diff changeset
196 //----- (004250FE) --------------------------------------------------------
Ritor1
parents:
diff changeset
197 signed int __fastcall sr_4250FE(unsigned int uVertexID)
Ritor1
parents:
diff changeset
198 {
Ritor1
parents:
diff changeset
199 unsigned int v1; // edx@1
Ritor1
parents:
diff changeset
200 char *v2; // edi@5
Ritor1
parents:
diff changeset
201 char *v3; // esi@5
Ritor1
parents:
diff changeset
202 char *v4; // ecx@5
Ritor1
parents:
diff changeset
203 int v5; // ebx@6
Ritor1
parents:
diff changeset
204 double v6; // st6@11
Ritor1
parents:
diff changeset
205 double v7; // st5@11
Ritor1
parents:
diff changeset
206 double v8; // st6@12
Ritor1
parents:
diff changeset
207 unsigned __int8 v9; // c2@16
Ritor1
parents:
diff changeset
208 unsigned __int8 v10; // c3@16
Ritor1
parents:
diff changeset
209 void *v11; // edi@23
Ritor1
parents:
diff changeset
210 double v12; // st6@23
Ritor1
parents:
diff changeset
211 char *v13; // ecx@23
Ritor1
parents:
diff changeset
212 char v14; // zf@24
Ritor1
parents:
diff changeset
213 signed int result; // eax@25
Ritor1
parents:
diff changeset
214 unsigned int v16; // [sp+8h] [bp-28h]@5
Ritor1
parents:
diff changeset
215 bool v17; // [sp+Ch] [bp-24h]@2
Ritor1
parents:
diff changeset
216 bool v18; // [sp+10h] [bp-20h]@7
Ritor1
parents:
diff changeset
217 char *v19; // [sp+14h] [bp-1Ch]@5
Ritor1
parents:
diff changeset
218 char *v20; // [sp+18h] [bp-18h]@5
Ritor1
parents:
diff changeset
219 signed int v21; // [sp+1Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
220 RenderVertexSoft *v22; // [sp+20h] [bp-10h]@5
Ritor1
parents:
diff changeset
221 char *v23; // [sp+24h] [bp-Ch]@5
Ritor1
parents:
diff changeset
222 char *v24; // [sp+28h] [bp-8h]@5
Ritor1
parents:
diff changeset
223 char *v25; // [sp+2Ch] [bp-4h]@5
Ritor1
parents:
diff changeset
224
Ritor1
parents:
diff changeset
225 v1 = uVertexID;
Ritor1
parents:
diff changeset
226 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID]));
Ritor1
parents:
diff changeset
227 v21 = 0;
Ritor1
parents:
diff changeset
228 v17 = array_50AC10[0].vWorldViewPosition.x >= 8.0;
Ritor1
parents:
diff changeset
229 if ( (signed int)(uVertexID + 1) <= 1 )
Ritor1
parents:
diff changeset
230 return 0;
Ritor1
parents:
diff changeset
231 v2 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
232 v3 = (char *)&array_507D30[0].vWorldViewPosition.y;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
233 v24 = (char *)&array_507D30[0]._rhw;
0
Ritor1
parents:
diff changeset
234 v22 = array_507D30;
Ritor1
parents:
diff changeset
235 v19 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
236 v20 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
237 v23 = (char *)&array_507D30[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
238 v25 = (char *)&array_507D30[0].flt_2C;
Ritor1
parents:
diff changeset
239 v4 = (char *)&array_50AC10[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
240 v16 = v1;
Ritor1
parents:
diff changeset
241 do
Ritor1
parents:
diff changeset
242 {
Ritor1
parents:
diff changeset
243 v5 = (int)(v4 + 48);
Ritor1
parents:
diff changeset
244 v18 = *((float *)v4 + 12) >= 8.0;
Ritor1
parents:
diff changeset
245 if ( v17 != v18 )
Ritor1
parents:
diff changeset
246 {
Ritor1
parents:
diff changeset
247 if ( v18 )
Ritor1
parents:
diff changeset
248 {
Ritor1
parents:
diff changeset
249 v6 = (8.0 - *(float *)v4) / (*(float *)v5 - *(float *)v4);
Ritor1
parents:
diff changeset
250 *(float *)v3 = (*((float *)v4 + 13) - *((float *)v4 + 1)) * v6 + *((float *)v4 + 1);
Ritor1
parents:
diff changeset
251 *(float *)v2 = (*((float *)v4 + 14) - *((float *)v4 + 2)) * v6 + *((float *)v4 + 2);
Ritor1
parents:
diff changeset
252 v7 = (*((float *)v4 + 20) - *((float *)v4 + 8)) * v6 + *((float *)v4 + 8);
Ritor1
parents:
diff changeset
253 }
Ritor1
parents:
diff changeset
254 else
Ritor1
parents:
diff changeset
255 {
Ritor1
parents:
diff changeset
256 v8 = (8.0 - *(float *)v5) / (*(float *)v4 - *(float *)v5);
Ritor1
parents:
diff changeset
257 *(float *)v3 = (*((float *)v4 + 1) - *((float *)v4 + 13)) * v8 + *((float *)v4 + 13);
Ritor1
parents:
diff changeset
258 *(float *)v2 = (*((float *)v4 + 2) - *((float *)v4 + 14)) * v8 + *((float *)v4 + 14);
Ritor1
parents:
diff changeset
259 v7 = (*((float *)v4 + 8) - *((float *)v4 + 20)) * v8 + *((float *)v4 + 20);
Ritor1
parents:
diff changeset
260 }
Ritor1
parents:
diff changeset
261 *(float *)v25 = v7;
Ritor1
parents:
diff changeset
262 *(float *)v23 = 8.0;
Ritor1
parents:
diff changeset
263 *(int *)v24 = 0x3E000000u;
Ritor1
parents:
diff changeset
264 if ( v17 )
Ritor1
parents:
diff changeset
265 {
Ritor1
parents:
diff changeset
266 if ( 8.0 == *(float *)v4 && *(float *)v3 == *((float *)v4 + 1) )
Ritor1
parents:
diff changeset
267 {
Ritor1
parents:
diff changeset
268 v9 = 0;
Ritor1
parents:
diff changeset
269 v10 = *(float *)v2 == *((float *)v4 + 2);
Ritor1
parents:
diff changeset
270 goto LABEL_20;
Ritor1
parents:
diff changeset
271 }
Ritor1
parents:
diff changeset
272 }
Ritor1
parents:
diff changeset
273 else
Ritor1
parents:
diff changeset
274 {
Ritor1
parents:
diff changeset
275 if ( 8.0 == *(float *)v5 && *(float *)v3 == *((float *)v4 + 13) )
Ritor1
parents:
diff changeset
276 {
Ritor1
parents:
diff changeset
277 v9 = 0;
Ritor1
parents:
diff changeset
278 v10 = *(float *)v2 == *((float *)v4 + 14);
Ritor1
parents:
diff changeset
279 LABEL_20:
Ritor1
parents:
diff changeset
280 if ( v10 | v9 )
Ritor1
parents:
diff changeset
281 goto LABEL_22;
Ritor1
parents:
diff changeset
282 goto LABEL_21;
Ritor1
parents:
diff changeset
283 }
Ritor1
parents:
diff changeset
284 }
Ritor1
parents:
diff changeset
285 LABEL_21:
Ritor1
parents:
diff changeset
286 ++v22;
Ritor1
parents:
diff changeset
287 v23 += 48;
Ritor1
parents:
diff changeset
288 v25 += 48;
Ritor1
parents:
diff changeset
289 v3 += 48;
Ritor1
parents:
diff changeset
290 v2 += 48;
Ritor1
parents:
diff changeset
291 ++v21;
Ritor1
parents:
diff changeset
292 v24 += 48;
Ritor1
parents:
diff changeset
293 v20 = v3;
Ritor1
parents:
diff changeset
294 v19 = v2;
Ritor1
parents:
diff changeset
295 }
Ritor1
parents:
diff changeset
296 LABEL_22:
Ritor1
parents:
diff changeset
297 if ( v18 )
Ritor1
parents:
diff changeset
298 {
Ritor1
parents:
diff changeset
299 v11 = v22;
Ritor1
parents:
diff changeset
300 v20 += 48;
Ritor1
parents:
diff changeset
301 v19 += 48;
Ritor1
parents:
diff changeset
302 v12 = 1.0 / (*(float *)v5 + 0.0000001);
Ritor1
parents:
diff changeset
303 ++v21;
Ritor1
parents:
diff changeset
304 v25 += 48;
Ritor1
parents:
diff changeset
305 v23 += 48;
Ritor1
parents:
diff changeset
306 ++v22;
Ritor1
parents:
diff changeset
307 memcpy(v11, v4 + 36, 0x30u);
Ritor1
parents:
diff changeset
308 v13 = v24;
Ritor1
parents:
diff changeset
309 v24 += 48;
Ritor1
parents:
diff changeset
310 v3 = v20;
Ritor1
parents:
diff changeset
311 v2 = v19;
Ritor1
parents:
diff changeset
312 *(float *)v13 = v12;
Ritor1
parents:
diff changeset
313 }
Ritor1
parents:
diff changeset
314 v14 = v16-- == 1;
Ritor1
parents:
diff changeset
315 v17 = v18;
Ritor1
parents:
diff changeset
316 v4 = (char *)v5;
Ritor1
parents:
diff changeset
317 }
Ritor1
parents:
diff changeset
318 while ( !v14 );
Ritor1
parents:
diff changeset
319 result = v21;
Ritor1
parents:
diff changeset
320 if ( v21 < 3 )
Ritor1
parents:
diff changeset
321 return 0;
Ritor1
parents:
diff changeset
322 return result;
Ritor1
parents:
diff changeset
323 }
Ritor1
parents:
diff changeset
324
Ritor1
parents:
diff changeset
325 //----- (004252E8) --------------------------------------------------------
Ritor1
parents:
diff changeset
326 signed int __fastcall sr_4252E8(unsigned int uVertexID)
Ritor1
parents:
diff changeset
327 {
Ritor1
parents:
diff changeset
328 unsigned int v1; // edx@1
Ritor1
parents:
diff changeset
329 double v2; // st7@1
Ritor1
parents:
diff changeset
330 char *v3; // edi@5
Ritor1
parents:
diff changeset
331 char *v4; // esi@5
Ritor1
parents:
diff changeset
332 char *v5; // ecx@5
Ritor1
parents:
diff changeset
333 int v6; // ebx@6
Ritor1
parents:
diff changeset
334 double v7; // st6@11
Ritor1
parents:
diff changeset
335 double v8; // st5@11
Ritor1
parents:
diff changeset
336 double v9; // st6@12
Ritor1
parents:
diff changeset
337 unsigned __int8 v10; // c2@16
Ritor1
parents:
diff changeset
338 unsigned __int8 v11; // c3@16
Ritor1
parents:
diff changeset
339 void *v12; // edi@23
Ritor1
parents:
diff changeset
340 double v13; // st6@23
Ritor1
parents:
diff changeset
341 char *v14; // ecx@23
Ritor1
parents:
diff changeset
342 char v15; // zf@24
Ritor1
parents:
diff changeset
343 signed int result; // eax@25
Ritor1
parents:
diff changeset
344 unsigned int v17; // [sp+8h] [bp-28h]@5
Ritor1
parents:
diff changeset
345 bool v18; // [sp+Ch] [bp-24h]@2
Ritor1
parents:
diff changeset
346 bool v19; // [sp+10h] [bp-20h]@7
Ritor1
parents:
diff changeset
347 char *v20; // [sp+14h] [bp-1Ch]@5
Ritor1
parents:
diff changeset
348 char *v21; // [sp+18h] [bp-18h]@5
Ritor1
parents:
diff changeset
349 signed int v22; // [sp+1Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
350 RenderVertexSoft *v23; // [sp+20h] [bp-10h]@5
Ritor1
parents:
diff changeset
351 char *v24; // [sp+24h] [bp-Ch]@5
Ritor1
parents:
diff changeset
352 char *v25; // [sp+28h] [bp-8h]@5
Ritor1
parents:
diff changeset
353 char *v26; // [sp+2Ch] [bp-4h]@5
Ritor1
parents:
diff changeset
354
Ritor1
parents:
diff changeset
355 v1 = uVertexID;
Ritor1
parents:
diff changeset
356 v2 = (double)pOutdoorCamera->shading_dist_mist;
Ritor1
parents:
diff changeset
357 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID]));
Ritor1
parents:
diff changeset
358 v22 = 0;
Ritor1
parents:
diff changeset
359 v18 = array_50AC10[0].vWorldViewPosition.x <= v2;
Ritor1
parents:
diff changeset
360 if ( (signed int)(uVertexID + 1) <= 1 )
Ritor1
parents:
diff changeset
361 return 0;
Ritor1
parents:
diff changeset
362 v3 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
363 v4 = (char *)&array_507D30[0].vWorldViewPosition.y;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
364 v25 = (char *)&array_507D30[0]._rhw;
0
Ritor1
parents:
diff changeset
365 v23 = array_507D30;
Ritor1
parents:
diff changeset
366 v20 = (char *)&array_507D30[0].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
367 v21 = (char *)&array_507D30[0].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
368 v24 = (char *)&array_507D30[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
369 v26 = (char *)&array_507D30[0].flt_2C;
Ritor1
parents:
diff changeset
370 v5 = (char *)&array_50AC10[0].vWorldViewPosition;
Ritor1
parents:
diff changeset
371 v17 = v1;
Ritor1
parents:
diff changeset
372 do
Ritor1
parents:
diff changeset
373 {
Ritor1
parents:
diff changeset
374 v6 = (int)(v5 + 48);
Ritor1
parents:
diff changeset
375 v19 = v2 >= *((float *)v5 + 12);
Ritor1
parents:
diff changeset
376 if ( v18 != v19 )
Ritor1
parents:
diff changeset
377 {
Ritor1
parents:
diff changeset
378 if ( v19 )
Ritor1
parents:
diff changeset
379 {
Ritor1
parents:
diff changeset
380 v7 = (v2 - *(float *)v5) / (*(float *)v6 - *(float *)v5);
Ritor1
parents:
diff changeset
381 *(float *)v4 = (*((float *)v5 + 13) - *((float *)v5 + 1)) * v7 + *((float *)v5 + 1);
Ritor1
parents:
diff changeset
382 *(float *)v3 = (*((float *)v5 + 14) - *((float *)v5 + 2)) * v7 + *((float *)v5 + 2);
Ritor1
parents:
diff changeset
383 v8 = (*((float *)v5 + 20) - *((float *)v5 + 8)) * v7 + *((float *)v5 + 8);
Ritor1
parents:
diff changeset
384 }
Ritor1
parents:
diff changeset
385 else
Ritor1
parents:
diff changeset
386 {
Ritor1
parents:
diff changeset
387 v9 = (v2 - *(float *)v6) / (*(float *)v5 - *(float *)v6);
Ritor1
parents:
diff changeset
388 *(float *)v4 = (*((float *)v5 + 1) - *((float *)v5 + 13)) * v9 + *((float *)v5 + 13);
Ritor1
parents:
diff changeset
389 *(float *)v3 = (*((float *)v5 + 2) - *((float *)v5 + 14)) * v9 + *((float *)v5 + 14);
Ritor1
parents:
diff changeset
390 v8 = (*((float *)v5 + 8) - *((float *)v5 + 20)) * v9 + *((float *)v5 + 20);
Ritor1
parents:
diff changeset
391 }
Ritor1
parents:
diff changeset
392 *(float *)v26 = v8;
Ritor1
parents:
diff changeset
393 *(float *)v24 = v2;
Ritor1
parents:
diff changeset
394 *(float *)v25 = 1.0 / v2;
Ritor1
parents:
diff changeset
395 if ( v18 )
Ritor1
parents:
diff changeset
396 {
Ritor1
parents:
diff changeset
397 if ( v2 == *(float *)v5 && *(float *)v4 == *((float *)v5 + 1) )
Ritor1
parents:
diff changeset
398 {
Ritor1
parents:
diff changeset
399 v10 = 0;
Ritor1
parents:
diff changeset
400 v11 = *(float *)v3 == *((float *)v5 + 2);
Ritor1
parents:
diff changeset
401 goto LABEL_20;
Ritor1
parents:
diff changeset
402 }
Ritor1
parents:
diff changeset
403 }
Ritor1
parents:
diff changeset
404 else
Ritor1
parents:
diff changeset
405 {
Ritor1
parents:
diff changeset
406 if ( v2 == *(float *)v6 && *(float *)v4 == *((float *)v5 + 13) )
Ritor1
parents:
diff changeset
407 {
Ritor1
parents:
diff changeset
408 v10 = 0;
Ritor1
parents:
diff changeset
409 v11 = *(float *)v3 == *((float *)v5 + 14);
Ritor1
parents:
diff changeset
410 LABEL_20:
Ritor1
parents:
diff changeset
411 if ( v11 | v10 )
Ritor1
parents:
diff changeset
412 goto LABEL_22;
Ritor1
parents:
diff changeset
413 goto LABEL_21;
Ritor1
parents:
diff changeset
414 }
Ritor1
parents:
diff changeset
415 }
Ritor1
parents:
diff changeset
416 LABEL_21:
Ritor1
parents:
diff changeset
417 ++v23;
Ritor1
parents:
diff changeset
418 v24 += 48;
Ritor1
parents:
diff changeset
419 v26 += 48;
Ritor1
parents:
diff changeset
420 v4 += 48;
Ritor1
parents:
diff changeset
421 v3 += 48;
Ritor1
parents:
diff changeset
422 ++v22;
Ritor1
parents:
diff changeset
423 v25 += 48;
Ritor1
parents:
diff changeset
424 v21 = v4;
Ritor1
parents:
diff changeset
425 v20 = v3;
Ritor1
parents:
diff changeset
426 }
Ritor1
parents:
diff changeset
427 LABEL_22:
Ritor1
parents:
diff changeset
428 if ( v19 )
Ritor1
parents:
diff changeset
429 {
Ritor1
parents:
diff changeset
430 v12 = v23;
Ritor1
parents:
diff changeset
431 v21 += 48;
Ritor1
parents:
diff changeset
432 v20 += 48;
Ritor1
parents:
diff changeset
433 v13 = 1.0 / (*(float *)v6 + 0.0000001);
Ritor1
parents:
diff changeset
434 ++v22;
Ritor1
parents:
diff changeset
435 v26 += 48;
Ritor1
parents:
diff changeset
436 v24 += 48;
Ritor1
parents:
diff changeset
437 ++v23;
Ritor1
parents:
diff changeset
438 memcpy(v12, v5 + 36, 0x30u);
Ritor1
parents:
diff changeset
439 v14 = v25;
Ritor1
parents:
diff changeset
440 v25 += 48;
Ritor1
parents:
diff changeset
441 v4 = v21;
Ritor1
parents:
diff changeset
442 v3 = v20;
Ritor1
parents:
diff changeset
443 *(float *)v14 = v13;
Ritor1
parents:
diff changeset
444 }
Ritor1
parents:
diff changeset
445 v15 = v17-- == 1;
Ritor1
parents:
diff changeset
446 v18 = v19;
Ritor1
parents:
diff changeset
447 v5 = (char *)v6;
Ritor1
parents:
diff changeset
448 }
Ritor1
parents:
diff changeset
449 while ( !v15 );
Ritor1
parents:
diff changeset
450 result = v22;
Ritor1
parents:
diff changeset
451 if ( v22 < 3 )
Ritor1
parents:
diff changeset
452 return 0;
Ritor1
parents:
diff changeset
453 return result;
Ritor1
parents:
diff changeset
454 }
Ritor1
parents:
diff changeset
455
Ritor1
parents:
diff changeset
456
Ritor1
parents:
diff changeset
457
Ritor1
parents:
diff changeset
458 //----- (004361EF) --------------------------------------------------------
Ritor1
parents:
diff changeset
459 IndoorCameraD3D::IndoorCameraD3D()
Ritor1
parents:
diff changeset
460 {
Ritor1
parents:
diff changeset
461 IndoorCameraD3D *v1; // esi@1
Ritor1
parents:
diff changeset
462 double v2; // st7@1
Ritor1
parents:
diff changeset
463 double v3; // st6@1
Ritor1
parents:
diff changeset
464 double v4; // st5@1
Ritor1
parents:
diff changeset
465 double v5; // st7@1
Ritor1
parents:
diff changeset
466 double v6; // st6@1
Ritor1
parents:
diff changeset
467 double v7; // st5@1
Ritor1
parents:
diff changeset
468
Ritor1
parents:
diff changeset
469 v1 = this;
Ritor1
parents:
diff changeset
470 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&this->field_4);
Ritor1
parents:
diff changeset
471 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_14);
Ritor1
parents:
diff changeset
472 //IndoorCameraD3D_Vec3::IndoorCameraD3D_Vec3(&v1->field_24);
Ritor1
parents:
diff changeset
473 /*_eh_vector_constructor_iterator_(v1->std__vector_000034_prolly_frustrum,
Ritor1
parents:
diff changeset
474 24,
Ritor1
parents:
diff changeset
475 6,
Ritor1
parents:
diff changeset
476 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4,
Ritor1
parents:
diff changeset
477 (void (__thiscall *)(void *))IndoorCameraD3D_Vec4::dtor);*/
Ritor1
parents:
diff changeset
478 v2 = 0;//(double)pBLVRenderParams->vPartyPos.z;
Ritor1
parents:
diff changeset
479 v3 = 0;//(double)pBLVRenderParams->vPartyPos.y;
Ritor1
parents:
diff changeset
480 v4 = 0;//(double)pBLVRenderParams->vPartyPos.x;
Ritor1
parents:
diff changeset
481 v1->field_108 = 0.0;
Ritor1
parents:
diff changeset
482 v1->field_DC = v4;
Ritor1
parents:
diff changeset
483 v1->field_E0 = v3;
Ritor1
parents:
diff changeset
484 v1->field_E4 = v2;
Ritor1
parents:
diff changeset
485 v5 = 0;//(double)pBLVRenderParams->vPartyPos.z;
Ritor1
parents:
diff changeset
486 v6 = 0;//(double)pBLVRenderParams->vPartyPos.y;
Ritor1
parents:
diff changeset
487 v7 = 300;//(double)(pBLVRenderParams->vPartyPos.x + 300);
Ritor1
parents:
diff changeset
488 v1->field_138 = 0.0;
Ritor1
parents:
diff changeset
489 v1->field_10C = v7;
Ritor1
parents:
diff changeset
490 v1->field_110 = v6;
Ritor1
parents:
diff changeset
491 v1->field_114 = v5;
Ritor1
parents:
diff changeset
492 v1->field_168 = 0.0;
Ritor1
parents:
diff changeset
493 v1->field_198 = 0.0;
Ritor1
parents:
diff changeset
494 v1->field_1C8 = 0.0;
Ritor1
parents:
diff changeset
495 v1->field_1F8 = 0.0;
Ritor1
parents:
diff changeset
496 v1->field_228 = 0.0;
Ritor1
parents:
diff changeset
497 v1->field_258 = 0.0;
Ritor1
parents:
diff changeset
498 v1->field_288 = 0.0;
Ritor1
parents:
diff changeset
499 v1->field_2B8 = 0.0;
Ritor1
parents:
diff changeset
500 v1->field_2E8 = 0.0;
Ritor1
parents:
diff changeset
501 v1->field_2BC = 0.0;
Ritor1
parents:
diff changeset
502 v1->field_2C0 = 0.0;
Ritor1
parents:
diff changeset
503 v1->field_2C4 = 0.0;
Ritor1
parents:
diff changeset
504 v1->field_318 = 0.0;
Ritor1
parents:
diff changeset
505 v1->field_2EC = 0.0;
Ritor1
parents:
diff changeset
506 v1->field_2F0 = 0.0;
Ritor1
parents:
diff changeset
507 v1->field_2F4 = 0.0;
Ritor1
parents:
diff changeset
508 v1->field_348 = 0.0;
Ritor1
parents:
diff changeset
509 v1->field_31C = 0.0;
Ritor1
parents:
diff changeset
510 v1->field_320 = 0.0;
Ritor1
parents:
diff changeset
511 v1->field_324 = 0.0;
Ritor1
parents:
diff changeset
512 v1->field_378 = 0.0;
Ritor1
parents:
diff changeset
513 v1->field_34C = 0.0;
Ritor1
parents:
diff changeset
514 v1->field_350 = 0.0;
Ritor1
parents:
diff changeset
515 v1->field_354 = 0.0;
Ritor1
parents:
diff changeset
516 for (uint i = 0; i < 16384; ++i)
Ritor1
parents:
diff changeset
517 {
Ritor1
parents:
diff changeset
518 list_0037C[i].field_0 = 0;
Ritor1
parents:
diff changeset
519 list_0037C[i].flt_30 = 0.0f;
Ritor1
parents:
diff changeset
520 }
Ritor1
parents:
diff changeset
521
Ritor1
parents:
diff changeset
522 list_0037C_size = 0;
Ritor1
parents:
diff changeset
523 for (uint i = 0; i < 256; ++i)
Ritor1
parents:
diff changeset
524 list_E0380[i].mm7__vector_000004_size = 0;
Ritor1
parents:
diff changeset
525 /*v10 = v1->list_E0380;
Ritor1
parents:
diff changeset
526 v12 = 256;
Ritor1
parents:
diff changeset
527 do
Ritor1
parents:
diff changeset
528 {
Ritor1
parents:
diff changeset
529 v10->mm7__vector_000004_size = 0;
Ritor1
parents:
diff changeset
530 //mm7__vector_constructor(
Ritor1
parents:
diff changeset
531 // v10->mm7__vector_000004,
Ritor1
parents:
diff changeset
532 // 48,
Ritor1
parents:
diff changeset
533 // 64,
Ritor1
parents:
diff changeset
534 // (int (__thiscall *)(int))IndoorCameraD3D_stru1::IndoorCameraD3D_stru1);
Ritor1
parents:
diff changeset
535 //++v10;
Ritor1
parents:
diff changeset
536 --v12;
Ritor1
parents:
diff changeset
537 }
Ritor1
parents:
diff changeset
538 while ( v12 );*/
Ritor1
parents:
diff changeset
539 list_E0380_size = 0;
Ritor1
parents:
diff changeset
540 //v1->vdestructor_ptr = &stru8_pvdtor;
Ritor1
parents:
diff changeset
541 }
Ritor1
parents:
diff changeset
542
Ritor1
parents:
diff changeset
543
Ritor1
parents:
diff changeset
544 //----- (004254D2) --------------------------------------------------------
Ritor1
parents:
diff changeset
545 int __fastcall sr_4254D2(signed int a1)
Ritor1
parents:
diff changeset
546 {
Ritor1
parents:
diff changeset
547 signed int v1; // ebx@2
Ritor1
parents:
diff changeset
548 int v2; // ecx@2
Ritor1
parents:
diff changeset
549 int result; // eax@11
Ritor1
parents:
diff changeset
550 double v4; // ST74_8@12
Ritor1
parents:
diff changeset
551 bool v5; // edi@12
Ritor1
parents:
diff changeset
552 char *v6; // esi@13
Ritor1
parents:
diff changeset
553 char *v7; // ebx@13
Ritor1
parents:
diff changeset
554 double v8; // st7@15
Ritor1
parents:
diff changeset
555 double v9; // st7@16
Ritor1
parents:
diff changeset
556 double v10; // st6@16
Ritor1
parents:
diff changeset
557 double v11; // st7@17
Ritor1
parents:
diff changeset
558 float v12; // eax@18
Ritor1
parents:
diff changeset
559 double v13; // ST4C_8@19
Ritor1
parents:
diff changeset
560 double v14; // ST10_8@19
Ritor1
parents:
diff changeset
561 double v15; // ST28_8@20
Ritor1
parents:
diff changeset
562 double v16; // ST34_8@20
Ritor1
parents:
diff changeset
563 char v17; // zf@20
Ritor1
parents:
diff changeset
564 double v18; // ST18_8@21
Ritor1
parents:
diff changeset
565 double v19; // ST3C_8@21
Ritor1
parents:
diff changeset
566 double v20; // ST44_8@22
Ritor1
parents:
diff changeset
567 double v21; // ST54_8@22
Ritor1
parents:
diff changeset
568 void *v22; // edi@26
Ritor1
parents:
diff changeset
569 double v23; // ST54_8@29
Ritor1
parents:
diff changeset
570 bool v24; // esi@29
Ritor1
parents:
diff changeset
571 char *v25; // edi@30
Ritor1
parents:
diff changeset
572 char *v26; // ebx@30
Ritor1
parents:
diff changeset
573 bool v27; // ecx@32
Ritor1
parents:
diff changeset
574 double v28; // st7@33
Ritor1
parents:
diff changeset
575 double v29; // st7@34
Ritor1
parents:
diff changeset
576 double v30; // st6@34
Ritor1
parents:
diff changeset
577 double v31; // st7@35
Ritor1
parents:
diff changeset
578 double v32; // ST44_8@37
Ritor1
parents:
diff changeset
579 double v33; // ST3C_8@37
Ritor1
parents:
diff changeset
580 double v34; // ST18_8@38
Ritor1
parents:
diff changeset
581 double v35; // ST34_8@38
Ritor1
parents:
diff changeset
582 char v36; // zf@38
Ritor1
parents:
diff changeset
583 double v37; // ST28_8@39
Ritor1
parents:
diff changeset
584 double v38; // ST10_8@39
Ritor1
parents:
diff changeset
585 double v39; // ST20_8@40
Ritor1
parents:
diff changeset
586 double v40; // ST5C_8@40
Ritor1
parents:
diff changeset
587 void *v41; // edi@44
Ritor1
parents:
diff changeset
588 double v42; // ST5C_8@47
Ritor1
parents:
diff changeset
589 bool v43; // edi@47
Ritor1
parents:
diff changeset
590 char *v44; // esi@48
Ritor1
parents:
diff changeset
591 char *v45; // ebx@48
Ritor1
parents:
diff changeset
592 bool v46; // ecx@49
Ritor1
parents:
diff changeset
593 double v47; // st6@50
Ritor1
parents:
diff changeset
594 double v48; // st6@51
Ritor1
parents:
diff changeset
595 double v49; // st5@51
Ritor1
parents:
diff changeset
596 double v50; // st6@52
Ritor1
parents:
diff changeset
597 double v51; // ST20_8@54
Ritor1
parents:
diff changeset
598 double v52; // ST54_8@54
Ritor1
parents:
diff changeset
599 double v53; // ST44_8@55
Ritor1
parents:
diff changeset
600 double v54; // ST3C_8@55
Ritor1
parents:
diff changeset
601 char v55; // zf@55
Ritor1
parents:
diff changeset
602 double v56; // ST18_8@56
Ritor1
parents:
diff changeset
603 double v57; // ST34_8@56
Ritor1
parents:
diff changeset
604 double v58; // ST28_8@57
Ritor1
parents:
diff changeset
605 double v59; // ST10_8@57
Ritor1
parents:
diff changeset
606 void *v60; // edi@61
Ritor1
parents:
diff changeset
607 double v61; // ST5C_8@64
Ritor1
parents:
diff changeset
608 bool v62; // edi@64
Ritor1
parents:
diff changeset
609 char *v63; // esi@65
Ritor1
parents:
diff changeset
610 char *v64; // ebx@65
Ritor1
parents:
diff changeset
611 bool v65; // ecx@66
Ritor1
parents:
diff changeset
612 double v66; // st6@67
Ritor1
parents:
diff changeset
613 double v67; // st6@68
Ritor1
parents:
diff changeset
614 double v68; // st5@68
Ritor1
parents:
diff changeset
615 double v69; // st6@69
Ritor1
parents:
diff changeset
616 double v70; // ST20_8@71
Ritor1
parents:
diff changeset
617 double v71; // ST54_8@71
Ritor1
parents:
diff changeset
618 double v72; // ST44_8@72
Ritor1
parents:
diff changeset
619 double v73; // ST3C_8@72
Ritor1
parents:
diff changeset
620 char v74; // zf@72
Ritor1
parents:
diff changeset
621 double v75; // ST18_8@73
Ritor1
parents:
diff changeset
622 double v76; // ST34_8@73
Ritor1
parents:
diff changeset
623 double v77; // ST28_8@74
Ritor1
parents:
diff changeset
624 double v78; // ST10_8@74
Ritor1
parents:
diff changeset
625 void *v79; // edi@78
Ritor1
parents:
diff changeset
626 int v80; // ebx@81
Ritor1
parents:
diff changeset
627 char *v81; // ecx@82
Ritor1
parents:
diff changeset
628 signed int v82; // esi@82
Ritor1
parents:
diff changeset
629 float v83; // ST78_4@83
Ritor1
parents:
diff changeset
630 double v84; // ST5C_8@83
Ritor1
parents:
diff changeset
631 float v85; // eax@84
Ritor1
parents:
diff changeset
632 double v86; // ST20_8@85
Ritor1
parents:
diff changeset
633 double v87; // ST54_8@88
Ritor1
parents:
diff changeset
634 float v88; // eax@89
Ritor1
parents:
diff changeset
635 double v89; // ST44_8@90
Ritor1
parents:
diff changeset
636 unsigned __int8 v90; // sf@94
Ritor1
parents:
diff changeset
637 unsigned __int8 v91; // of@94
Ritor1
parents:
diff changeset
638 int v92; // edx@97
Ritor1
parents:
diff changeset
639 int v93; // esi@97
Ritor1
parents:
diff changeset
640 int v94; // edi@97
Ritor1
parents:
diff changeset
641 int v95; // eax@97
Ritor1
parents:
diff changeset
642 int v96; // eax@104
Ritor1
parents:
diff changeset
643 double v97; // [sp+4Ch] [bp-8Ch]@32
Ritor1
parents:
diff changeset
644 double v98; // [sp+54h] [bp-84h]@49
Ritor1
parents:
diff changeset
645 double v99; // [sp+54h] [bp-84h]@66
Ritor1
parents:
diff changeset
646 float v100; // [sp+5Ch] [bp-7Ch]@1
Ritor1
parents:
diff changeset
647 float v101; // [sp+60h] [bp-78h]@1
Ritor1
parents:
diff changeset
648 float v102; // [sp+64h] [bp-74h]@1
Ritor1
parents:
diff changeset
649 double v103; // [sp+6Ch] [bp-6Ch]@14
Ritor1
parents:
diff changeset
650 float v104; // [sp+A8h] [bp-30h]@1
Ritor1
parents:
diff changeset
651 signed int v105; // [sp+A8h] [bp-30h]@96
Ritor1
parents:
diff changeset
652 bool v106; // [sp+ACh] [bp-2Ch]@14
Ritor1
parents:
diff changeset
653 bool v107; // [sp+ACh] [bp-2Ch]@32
Ritor1
parents:
diff changeset
654 bool v108; // [sp+ACh] [bp-2Ch]@49
Ritor1
parents:
diff changeset
655 bool v109; // [sp+ACh] [bp-2Ch]@66
Ritor1
parents:
diff changeset
656 signed int v110; // [sp+B0h] [bp-28h]@12
Ritor1
parents:
diff changeset
657 char *v111; // [sp+B8h] [bp-20h]@30
Ritor1
parents:
diff changeset
658 signed int v112; // [sp+B8h] [bp-20h]@48
Ritor1
parents:
diff changeset
659 signed int v113; // [sp+B8h] [bp-20h]@65
Ritor1
parents:
diff changeset
660 char *v114; // [sp+BCh] [bp-1Ch]@13
Ritor1
parents:
diff changeset
661 signed int v115; // [sp+BCh] [bp-1Ch]@29
Ritor1
parents:
diff changeset
662 signed int v116; // [sp+BCh] [bp-1Ch]@64
Ritor1
parents:
diff changeset
663 signed int v117; // [sp+C0h] [bp-18h]@1
Ritor1
parents:
diff changeset
664 char *v118; // [sp+C0h] [bp-18h]@30
Ritor1
parents:
diff changeset
665 char *v119; // [sp+C0h] [bp-18h]@48
Ritor1
parents:
diff changeset
666 char *v120; // [sp+C0h] [bp-18h]@65
Ritor1
parents:
diff changeset
667 char *v121; // [sp+C4h] [bp-14h]@13
Ritor1
parents:
diff changeset
668 char *v122; // [sp+C4h] [bp-14h]@30
Ritor1
parents:
diff changeset
669 signed int v123; // [sp+C4h] [bp-14h]@47
Ritor1
parents:
diff changeset
670 char *v124; // [sp+C8h] [bp-10h]@30
Ritor1
parents:
diff changeset
671 char *v125; // [sp+C8h] [bp-10h]@48
Ritor1
parents:
diff changeset
672 char *v126; // [sp+C8h] [bp-10h]@65
Ritor1
parents:
diff changeset
673 signed int v127; // [sp+CCh] [bp-Ch]@2
Ritor1
parents:
diff changeset
674 char *v128; // [sp+CCh] [bp-Ch]@13
Ritor1
parents:
diff changeset
675 char *v129; // [sp+CCh] [bp-Ch]@30
Ritor1
parents:
diff changeset
676 RenderVertexSoft *v130; // [sp+CCh] [bp-Ch]@48
Ritor1
parents:
diff changeset
677 RenderVertexSoft *v131; // [sp+CCh] [bp-Ch]@65
Ritor1
parents:
diff changeset
678 RenderVertexSoft *v132; // [sp+D0h] [bp-8h]@13
Ritor1
parents:
diff changeset
679 char *v133; // [sp+D0h] [bp-8h]@30
Ritor1
parents:
diff changeset
680 char *v134; // [sp+D0h] [bp-8h]@48
Ritor1
parents:
diff changeset
681 char *v135; // [sp+D0h] [bp-8h]@65
Ritor1
parents:
diff changeset
682 signed int v136; // [sp+D4h] [bp-4h]@1
Ritor1
parents:
diff changeset
683 char *v137; // [sp+D4h] [bp-4h]@13
Ritor1
parents:
diff changeset
684 RenderVertexSoft *v138; // [sp+D4h] [bp-4h]@30
Ritor1
parents:
diff changeset
685 char *v139; // [sp+D4h] [bp-4h]@48
Ritor1
parents:
diff changeset
686 char *v140; // [sp+D4h] [bp-4h]@65
Ritor1
parents:
diff changeset
687
Ritor1
parents:
diff changeset
688 v101 = (double)(signed int)pViewport->uViewportX;
Ritor1
parents:
diff changeset
689 v100 = (double)(signed int)pViewport->uViewportZ;
Ritor1
parents:
diff changeset
690 v117 = a1;
Ritor1
parents:
diff changeset
691 v136 = 1;
Ritor1
parents:
diff changeset
692 v104 = (double)(signed int)pViewport->uViewportY;
Ritor1
parents:
diff changeset
693 v102 = (double)(pViewport->uViewportW + 1);
Ritor1
parents:
diff changeset
694 if ( a1 <= 0 )
Ritor1
parents:
diff changeset
695 return v117;
Ritor1
parents:
diff changeset
696 v127 = a1;
Ritor1
parents:
diff changeset
697 v1 = a1;
Ritor1
parents:
diff changeset
698 memcpy(array_508690, array_50AC10, 4 * ((unsigned int)(48 * a1) >> 2));
Ritor1
parents:
diff changeset
699 v2 = 0;
Ritor1
parents:
diff changeset
700 do
Ritor1
parents:
diff changeset
701 {
Ritor1
parents:
diff changeset
702 if ( array_50AC10[v2].vWorldViewProjX < (double)v101 || array_50AC10[v2].vWorldViewProjX > (double)v100 )
Ritor1
parents:
diff changeset
703 v136 = 0;
Ritor1
parents:
diff changeset
704 if ( *(float *)(v2 * 48 + 5286956) < (double)v104 || *(float *)(v2 * 48 + 5286956) > (double)v102 )
Ritor1
parents:
diff changeset
705 v136 = 0;
Ritor1
parents:
diff changeset
706 ++v2;
Ritor1
parents:
diff changeset
707 --v127;
Ritor1
parents:
diff changeset
708 }
Ritor1
parents:
diff changeset
709 while ( v127 );
Ritor1
parents:
diff changeset
710 if ( v136 )
Ritor1
parents:
diff changeset
711 return v117;
Ritor1
parents:
diff changeset
712 v110 = 0;
Ritor1
parents:
diff changeset
713 memcpy(&array_50AC10[v1], array_50AC10, sizeof(array_50AC10[v1]));
Ritor1
parents:
diff changeset
714 v4 = array_50AC10[0].vWorldViewProjX + 6.7553994e15;
Ritor1
parents:
diff changeset
715 v5 = SLODWORD(v4) >= (signed int)pViewport->uViewportX;
Ritor1
parents:
diff changeset
716 if ( v117 < 1 )
Ritor1
parents:
diff changeset
717 goto LABEL_112;
Ritor1
parents:
diff changeset
718 v6 = (char *)&array_50A2B0[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
719 v132 = array_50A2B0;
Ritor1
parents:
diff changeset
720 v137 = (char *)&array_50A2B0[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
721 v128 = (char *)&array_50A2B0[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
722 v121 = (char *)&array_50A2B0[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
723 v114 = (char *)&array_50A2B0[0]._rhw;
0
Ritor1
parents:
diff changeset
724 v7 = (char *)&array_50AC10[0].flt_2C;
Ritor1
parents:
diff changeset
725 do
Ritor1
parents:
diff changeset
726 {
Ritor1
parents:
diff changeset
727 v103 = *((float *)v7 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
728 v106 = SLODWORD(v103) >= (signed int)pViewport->uViewportX;
Ritor1
parents:
diff changeset
729 if ( !(v5 ^ v106) )
Ritor1
parents:
diff changeset
730 goto LABEL_25;
Ritor1
parents:
diff changeset
731 v8 = v101;
Ritor1
parents:
diff changeset
732 if ( SLODWORD(v103) >= (signed int)pViewport->uViewportX )
Ritor1
parents:
diff changeset
733 {
Ritor1
parents:
diff changeset
734 v9 = (v8 - *((float *)v7 - 5)) / (*((float *)v7 + 7) - *((float *)v7 - 5));
Ritor1
parents:
diff changeset
735 *(float *)v6 = (*((float *)v7 + 8) - *((float *)v7 - 4)) * v9 + *((float *)v7 - 4);
Ritor1
parents:
diff changeset
736 *(float *)v114 = (*((float *)v7 + 9) - *((float *)v7 - 3)) * v9 + *((float *)v7 - 3);
Ritor1
parents:
diff changeset
737 v10 = (*((float *)v7 + 12) - *(float *)v7) * v9 + *(float *)v7;
Ritor1
parents:
diff changeset
738 }
Ritor1
parents:
diff changeset
739 else
Ritor1
parents:
diff changeset
740 {
Ritor1
parents:
diff changeset
741 v11 = (v8 - *((float *)v7 + 7)) / (*((float *)v7 - 5) - *((float *)v7 + 7));
Ritor1
parents:
diff changeset
742 *(float *)v6 = (*((float *)v7 - 4) - *((float *)v7 + 8)) * v11 + *((float *)v7 + 8);
Ritor1
parents:
diff changeset
743 *(float *)v114 = (*((float *)v7 - 3) - *((float *)v7 + 9)) * v11 + *((float *)v7 + 9);
Ritor1
parents:
diff changeset
744 v10 = (*(float *)v7 - *((float *)v7 + 12)) * v11 + *((float *)v7 + 12);
Ritor1
parents:
diff changeset
745 }
Ritor1
parents:
diff changeset
746 *(float *)v121 = v10;
Ritor1
parents:
diff changeset
747 *(int *)v137 = LODWORD(v101);
Ritor1
parents:
diff changeset
748 LODWORD(v12) = *(int *)v6;
Ritor1
parents:
diff changeset
749 if ( v5 )
Ritor1
parents:
diff changeset
750 {
Ritor1
parents:
diff changeset
751 v13 = v12 + 6.7553994e15;
Ritor1
parents:
diff changeset
752 v14 = *((float *)v7 - 4) + 6.7553994e15;
Ritor1
parents:
diff changeset
753 if ( LODWORD(v13) == LODWORD(v14) )
Ritor1
parents:
diff changeset
754 {
Ritor1
parents:
diff changeset
755 v15 = *(float *)v137 + 6.7553994e15;
Ritor1
parents:
diff changeset
756 v16 = *((float *)v7 - 5) + 6.7553994e15;
Ritor1
parents:
diff changeset
757 v17 = LODWORD(v15) == LODWORD(v16);
Ritor1
parents:
diff changeset
758 goto LABEL_23;
Ritor1
parents:
diff changeset
759 }
Ritor1
parents:
diff changeset
760 }
Ritor1
parents:
diff changeset
761 else
Ritor1
parents:
diff changeset
762 {
Ritor1
parents:
diff changeset
763 v18 = v12 + 6.7553994e15;
Ritor1
parents:
diff changeset
764 v19 = *((float *)v7 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
765 if ( LODWORD(v18) == LODWORD(v19) )
Ritor1
parents:
diff changeset
766 {
Ritor1
parents:
diff changeset
767 v20 = *(float *)v137 + 6.7553994e15;
Ritor1
parents:
diff changeset
768 v21 = *((float *)v7 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
769 v17 = LODWORD(v20) == LODWORD(v21);
Ritor1
parents:
diff changeset
770 LABEL_23:
Ritor1
parents:
diff changeset
771 if ( v17 )
Ritor1
parents:
diff changeset
772 goto LABEL_25;
Ritor1
parents:
diff changeset
773 goto LABEL_24;
Ritor1
parents:
diff changeset
774 }
Ritor1
parents:
diff changeset
775 }
Ritor1
parents:
diff changeset
776 LABEL_24:
Ritor1
parents:
diff changeset
777 v121 += 48;
Ritor1
parents:
diff changeset
778 v114 += 48;
Ritor1
parents:
diff changeset
779 v6 += 48;
Ritor1
parents:
diff changeset
780 ++v110;
Ritor1
parents:
diff changeset
781 ++v132;
Ritor1
parents:
diff changeset
782 v128 = v6;
Ritor1
parents:
diff changeset
783 v137 += 48;
Ritor1
parents:
diff changeset
784 LABEL_25:
Ritor1
parents:
diff changeset
785 if ( v106 )
Ritor1
parents:
diff changeset
786 {
Ritor1
parents:
diff changeset
787 v22 = v132;
Ritor1
parents:
diff changeset
788 v128 += 48;
Ritor1
parents:
diff changeset
789 ++v110;
Ritor1
parents:
diff changeset
790 v114 += 48;
Ritor1
parents:
diff changeset
791 v121 += 48;
Ritor1
parents:
diff changeset
792 v137 += 48;
Ritor1
parents:
diff changeset
793 ++v132;
Ritor1
parents:
diff changeset
794 memcpy(v22, v7 + 4, 0x30u);
Ritor1
parents:
diff changeset
795 v6 = v128;
Ritor1
parents:
diff changeset
796 }
Ritor1
parents:
diff changeset
797 v5 = v106;
Ritor1
parents:
diff changeset
798 v7 += 48;
Ritor1
parents:
diff changeset
799 --v117;
Ritor1
parents:
diff changeset
800 }
Ritor1
parents:
diff changeset
801 while ( v117 );
Ritor1
parents:
diff changeset
802 if ( v110 < 3
Ritor1
parents:
diff changeset
803 || (v115 = 0,
Ritor1
parents:
diff changeset
804 memcpy(&array_50A2B0[v110], array_50A2B0, sizeof(array_50A2B0[v110])),
Ritor1
parents:
diff changeset
805 v23 = array_50A2B0[0].vWorldViewProjX + 6.7553994e15,
Ritor1
parents:
diff changeset
806 v24 = SLODWORD(v23) <= (signed int)pViewport->uViewportZ,
Ritor1
parents:
diff changeset
807 v110 < 1) )
Ritor1
parents:
diff changeset
808 goto LABEL_112;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
809 v25 = (char *)&array_509950[0]._rhw;
0
Ritor1
parents:
diff changeset
810 v138 = array_509950;
Ritor1
parents:
diff changeset
811 v129 = (char *)&array_50A2B0[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
812 v118 = (char *)&array_50A2B0[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
813 v133 = (char *)&array_509950[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
814 v122 = (char *)&array_509950[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
815 v124 = (char *)&array_509950[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
816 v111 = (char *)&array_509950[0]._rhw;
0
Ritor1
parents:
diff changeset
817 v26 = (char *)&array_50A2B0[0].flt_2C;
Ritor1
parents:
diff changeset
818 while ( 2 )
Ritor1
parents:
diff changeset
819 {
Ritor1
parents:
diff changeset
820 v97 = *((float *)v26 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
821 v27 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ;
Ritor1
parents:
diff changeset
822 v107 = SLODWORD(v97) <= (signed int)pViewport->uViewportZ;
Ritor1
parents:
diff changeset
823 if ( v24 != v27 )
Ritor1
parents:
diff changeset
824 {
Ritor1
parents:
diff changeset
825 v28 = v100;
Ritor1
parents:
diff changeset
826 if ( SLODWORD(v97) <= (signed int)pViewport->uViewportZ )
Ritor1
parents:
diff changeset
827 {
Ritor1
parents:
diff changeset
828 v29 = (v28 - *((float *)v26 - 5)) / (*((float *)v26 + 7) - *((float *)v26 - 5));
Ritor1
parents:
diff changeset
829 *(float *)v122 = (*((float *)v26 + 8) - *((float *)v26 - 4)) * v29 + *((float *)v26 - 4);
Ritor1
parents:
diff changeset
830 *(float *)v25 = (*((float *)v26 + 9) - *((float *)v26 - 3)) * v29 + *((float *)v26 - 3);
Ritor1
parents:
diff changeset
831 v30 = (*((float *)v26 + 12) - *(float *)v26) * v29 + *(float *)v26;
Ritor1
parents:
diff changeset
832 }
Ritor1
parents:
diff changeset
833 else
Ritor1
parents:
diff changeset
834 {
Ritor1
parents:
diff changeset
835 v31 = (v28 - *((float *)v26 + 7)) / (*((float *)v26 - 5) - *((float *)v26 + 7));
Ritor1
parents:
diff changeset
836 *(float *)v122 = (*((float *)v26 - 4) - *((float *)v26 + 8)) * v31 + *((float *)v26 + 8);
Ritor1
parents:
diff changeset
837 *(float *)v25 = (*((float *)v26 - 3) - *((float *)v26 + 9)) * v31 + *((float *)v26 + 9);
Ritor1
parents:
diff changeset
838 v30 = (*(float *)v26 - *((float *)v26 + 12)) * v31 + *((float *)v26 + 12);
Ritor1
parents:
diff changeset
839 }
Ritor1
parents:
diff changeset
840 *(float *)v124 = v30;
Ritor1
parents:
diff changeset
841 *(int *)v133 = LODWORD(v100);
Ritor1
parents:
diff changeset
842 if ( v24 )
Ritor1
parents:
diff changeset
843 {
Ritor1
parents:
diff changeset
844 v32 = *(float *)v122 + 6.7553994e15;
Ritor1
parents:
diff changeset
845 v33 = *((float *)v26 - 4) + 6.7553994e15;
Ritor1
parents:
diff changeset
846 if ( LODWORD(v32) == LODWORD(v33) )
Ritor1
parents:
diff changeset
847 {
Ritor1
parents:
diff changeset
848 v34 = *(float *)v133 + 6.7553994e15;
Ritor1
parents:
diff changeset
849 v35 = *((float *)v26 - 5) + 6.7553994e15;
Ritor1
parents:
diff changeset
850 v36 = LODWORD(v34) == LODWORD(v35);
Ritor1
parents:
diff changeset
851 goto LABEL_41;
Ritor1
parents:
diff changeset
852 }
Ritor1
parents:
diff changeset
853 goto LABEL_42;
Ritor1
parents:
diff changeset
854 }
Ritor1
parents:
diff changeset
855 v37 = *(float *)v118 + 6.7553994e15;
Ritor1
parents:
diff changeset
856 v38 = *((float *)v26 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
857 if ( LODWORD(v37) != LODWORD(v38) )
Ritor1
parents:
diff changeset
858 goto LABEL_42;
Ritor1
parents:
diff changeset
859 v39 = *(float *)v129 + 6.7553994e15;
Ritor1
parents:
diff changeset
860 v40 = *((float *)v26 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
861 v36 = LODWORD(v39) == LODWORD(v40);
Ritor1
parents:
diff changeset
862 LABEL_41:
Ritor1
parents:
diff changeset
863 if ( !v36 )
Ritor1
parents:
diff changeset
864 {
Ritor1
parents:
diff changeset
865 LABEL_42:
Ritor1
parents:
diff changeset
866 v129 += 48;
Ritor1
parents:
diff changeset
867 v118 += 48;
Ritor1
parents:
diff changeset
868 v133 += 48;
Ritor1
parents:
diff changeset
869 v122 += 48;
Ritor1
parents:
diff changeset
870 v124 += 48;
Ritor1
parents:
diff changeset
871 v111 += 48;
Ritor1
parents:
diff changeset
872 ++v115;
Ritor1
parents:
diff changeset
873 ++v138;
Ritor1
parents:
diff changeset
874 }
Ritor1
parents:
diff changeset
875 }
Ritor1
parents:
diff changeset
876 if ( v27 )
Ritor1
parents:
diff changeset
877 {
Ritor1
parents:
diff changeset
878 v41 = v138;
Ritor1
parents:
diff changeset
879 ++v115;
Ritor1
parents:
diff changeset
880 v111 += 48;
Ritor1
parents:
diff changeset
881 v124 += 48;
Ritor1
parents:
diff changeset
882 v122 += 48;
Ritor1
parents:
diff changeset
883 v133 += 48;
Ritor1
parents:
diff changeset
884 v118 += 48;
Ritor1
parents:
diff changeset
885 v129 += 48;
Ritor1
parents:
diff changeset
886 ++v138;
Ritor1
parents:
diff changeset
887 memcpy(v41, v26 + 4, 0x30u);
Ritor1
parents:
diff changeset
888 }
Ritor1
parents:
diff changeset
889 v24 = v107;
Ritor1
parents:
diff changeset
890 v26 += 48;
Ritor1
parents:
diff changeset
891 --v110;
Ritor1
parents:
diff changeset
892 if ( v110 )
Ritor1
parents:
diff changeset
893 {
Ritor1
parents:
diff changeset
894 v25 = v111;
Ritor1
parents:
diff changeset
895 continue;
Ritor1
parents:
diff changeset
896 }
Ritor1
parents:
diff changeset
897 break;
Ritor1
parents:
diff changeset
898 }
Ritor1
parents:
diff changeset
899 if ( v115 < 3
Ritor1
parents:
diff changeset
900 || (v123 = 0,
Ritor1
parents:
diff changeset
901 memcpy(&array_509950[v115], array_509950, sizeof(array_509950[v115])),
Ritor1
parents:
diff changeset
902 v42 = array_509950[0].vWorldViewProjY + 6.7553994e15,
Ritor1
parents:
diff changeset
903 v43 = SLODWORD(v42) >= (signed int)pViewport->uViewportY,
Ritor1
parents:
diff changeset
904 v115 < 1) )
Ritor1
parents:
diff changeset
905 goto LABEL_112;
Ritor1
parents:
diff changeset
906 v44 = (char *)&array_508FF0[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
907 v130 = array_508FF0;
Ritor1
parents:
diff changeset
908 v119 = (char *)&array_508FF0[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
909 v139 = (char *)&array_508FF0[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
910 v125 = (char *)&array_508FF0[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
911 v134 = (char *)&array_508FF0[0]._rhw;
0
Ritor1
parents:
diff changeset
912 v45 = (char *)&array_509950[0].flt_2C;
Ritor1
parents:
diff changeset
913 v112 = v115;
Ritor1
parents:
diff changeset
914 while ( 2 )
Ritor1
parents:
diff changeset
915 {
Ritor1
parents:
diff changeset
916 v98 = *((float *)v45 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
917 v46 = SLODWORD(v98) >= (signed int)pViewport->uViewportY;
Ritor1
parents:
diff changeset
918 v108 = SLODWORD(v98) >= (signed int)pViewport->uViewportY;
Ritor1
parents:
diff changeset
919 if ( v43 != v46 )
Ritor1
parents:
diff changeset
920 {
Ritor1
parents:
diff changeset
921 v47 = v104;
Ritor1
parents:
diff changeset
922 if ( SLODWORD(v98) >= (signed int)pViewport->uViewportY )
Ritor1
parents:
diff changeset
923 {
Ritor1
parents:
diff changeset
924 v48 = (v47 - *((float *)v45 - 4)) / (*((float *)v45 + 8) - *((float *)v45 - 4));
Ritor1
parents:
diff changeset
925 *(float *)v44 = (*((float *)v45 + 7) - *((float *)v45 - 5)) * v48 + *((float *)v45 - 5);
Ritor1
parents:
diff changeset
926 *(float *)v134 = (*((float *)v45 + 9) - *((float *)v45 - 3)) * v48 + *((float *)v45 - 3);
Ritor1
parents:
diff changeset
927 v49 = (*((float *)v45 + 12) - *(float *)v45) * v48 + *(float *)v45;
Ritor1
parents:
diff changeset
928 }
Ritor1
parents:
diff changeset
929 else
Ritor1
parents:
diff changeset
930 {
Ritor1
parents:
diff changeset
931 v50 = (v47 - *((float *)v45 + 8)) / (*((float *)v45 - 4) - *((float *)v45 + 8));
Ritor1
parents:
diff changeset
932 *(float *)v44 = (*((float *)v45 - 5) - *((float *)v45 + 7)) * v50 + *((float *)v45 + 7);
Ritor1
parents:
diff changeset
933 *(float *)v134 = (*((float *)v45 - 3) - *((float *)v45 + 9)) * v50 + *((float *)v45 + 9);
Ritor1
parents:
diff changeset
934 v49 = (*(float *)v45 - *((float *)v45 + 12)) * v50 + *((float *)v45 + 12);
Ritor1
parents:
diff changeset
935 }
Ritor1
parents:
diff changeset
936 *(float *)v125 = v49;
Ritor1
parents:
diff changeset
937 *(float *)v139 = v104;
Ritor1
parents:
diff changeset
938 if ( v43 )
Ritor1
parents:
diff changeset
939 {
Ritor1
parents:
diff changeset
940 v51 = v104 + 6.7553994e15;
Ritor1
parents:
diff changeset
941 v52 = *((float *)v45 - 4) + 6.7553994e15;
Ritor1
parents:
diff changeset
942 if ( LODWORD(v51) == LODWORD(v52) )
Ritor1
parents:
diff changeset
943 {
Ritor1
parents:
diff changeset
944 v53 = *(float *)v44 + 6.7553994e15;
Ritor1
parents:
diff changeset
945 v54 = *((float *)v45 - 5) + 6.7553994e15;
Ritor1
parents:
diff changeset
946 v55 = LODWORD(v53) == LODWORD(v54);
Ritor1
parents:
diff changeset
947 goto LABEL_58;
Ritor1
parents:
diff changeset
948 }
Ritor1
parents:
diff changeset
949 goto LABEL_59;
Ritor1
parents:
diff changeset
950 }
Ritor1
parents:
diff changeset
951 v56 = v104 + 6.7553994e15;
Ritor1
parents:
diff changeset
952 v57 = *((float *)v45 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
953 if ( LODWORD(v56) != LODWORD(v57) )
Ritor1
parents:
diff changeset
954 goto LABEL_59;
Ritor1
parents:
diff changeset
955 v58 = *(float *)v44 + 6.7553994e15;
Ritor1
parents:
diff changeset
956 v59 = *((float *)v45 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
957 v55 = LODWORD(v58) == LODWORD(v59);
Ritor1
parents:
diff changeset
958 LABEL_58:
Ritor1
parents:
diff changeset
959 if ( !v55 )
Ritor1
parents:
diff changeset
960 {
Ritor1
parents:
diff changeset
961 LABEL_59:
Ritor1
parents:
diff changeset
962 v139 += 48;
Ritor1
parents:
diff changeset
963 v125 += 48;
Ritor1
parents:
diff changeset
964 v134 += 48;
Ritor1
parents:
diff changeset
965 v44 += 48;
Ritor1
parents:
diff changeset
966 ++v123;
Ritor1
parents:
diff changeset
967 ++v130;
Ritor1
parents:
diff changeset
968 v119 = v44;
Ritor1
parents:
diff changeset
969 }
Ritor1
parents:
diff changeset
970 }
Ritor1
parents:
diff changeset
971 if ( v46 )
Ritor1
parents:
diff changeset
972 {
Ritor1
parents:
diff changeset
973 v60 = v130;
Ritor1
parents:
diff changeset
974 v119 += 48;
Ritor1
parents:
diff changeset
975 ++v123;
Ritor1
parents:
diff changeset
976 v134 += 48;
Ritor1
parents:
diff changeset
977 v125 += 48;
Ritor1
parents:
diff changeset
978 v139 += 48;
Ritor1
parents:
diff changeset
979 ++v130;
Ritor1
parents:
diff changeset
980 memcpy(v60, v45 + 4, 0x30u);
Ritor1
parents:
diff changeset
981 v44 = v119;
Ritor1
parents:
diff changeset
982 }
Ritor1
parents:
diff changeset
983 v43 = v108;
Ritor1
parents:
diff changeset
984 v45 += 48;
Ritor1
parents:
diff changeset
985 --v112;
Ritor1
parents:
diff changeset
986 if ( v112 )
Ritor1
parents:
diff changeset
987 continue;
Ritor1
parents:
diff changeset
988 break;
Ritor1
parents:
diff changeset
989 }
Ritor1
parents:
diff changeset
990 if ( v123 < 3
Ritor1
parents:
diff changeset
991 || (v116 = 0,
Ritor1
parents:
diff changeset
992 memcpy(&array_508FF0[v123], array_508FF0, sizeof(array_508FF0[v123])),
Ritor1
parents:
diff changeset
993 v61 = array_508FF0[0].vWorldViewProjY + 6.7553994e15,
Ritor1
parents:
diff changeset
994 v62 = SLODWORD(v61) <= (signed int)pViewport->uViewportW,
Ritor1
parents:
diff changeset
995 v123 < 1) )
Ritor1
parents:
diff changeset
996 goto LABEL_112;
Ritor1
parents:
diff changeset
997 v63 = (char *)&array_508690[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
998 v131 = array_508690;
Ritor1
parents:
diff changeset
999 v120 = (char *)&array_508690[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
1000 v140 = (char *)&array_508690[0].vWorldViewProjY;
Ritor1
parents:
diff changeset
1001 v126 = (char *)&array_508690[0].flt_2C;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 141
diff changeset
1002 v135 = (char *)&array_508690[0]._rhw;
0
Ritor1
parents:
diff changeset
1003 v64 = (char *)&array_508FF0[0].flt_2C;
Ritor1
parents:
diff changeset
1004 v113 = v123;
Ritor1
parents:
diff changeset
1005 while ( 2 )
Ritor1
parents:
diff changeset
1006 {
Ritor1
parents:
diff changeset
1007 v99 = *((float *)v64 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
1008 v65 = SLODWORD(v99) <= (signed int)pViewport->uViewportW;
Ritor1
parents:
diff changeset
1009 v109 = SLODWORD(v99) <= (signed int)pViewport->uViewportW;
Ritor1
parents:
diff changeset
1010 if ( v62 != v65 )
Ritor1
parents:
diff changeset
1011 {
Ritor1
parents:
diff changeset
1012 v66 = v102;
Ritor1
parents:
diff changeset
1013 if ( SLODWORD(v99) <= (signed int)pViewport->uViewportW )
Ritor1
parents:
diff changeset
1014 {
Ritor1
parents:
diff changeset
1015 v67 = (v66 - *((float *)v64 - 4)) / (*((float *)v64 + 8) - *((float *)v64 - 4));
Ritor1
parents:
diff changeset
1016 *(float *)v63 = (*((float *)v64 + 7) - *((float *)v64 - 5)) * v67 + *((float *)v64 - 5);
Ritor1
parents:
diff changeset
1017 *(float *)v135 = (*((float *)v64 + 9) - *((float *)v64 - 3)) * v67 + *((float *)v64 - 3);
Ritor1
parents:
diff changeset
1018 v68 = (*((float *)v64 + 12) - *(float *)v64) * v67 + *(float *)v64;
Ritor1
parents:
diff changeset
1019 }
Ritor1
parents:
diff changeset
1020 else
Ritor1
parents:
diff changeset
1021 {
Ritor1
parents:
diff changeset
1022 v69 = (v66 - *((float *)v64 + 8)) / (*((float *)v64 - 4) - *((float *)v64 + 8));
Ritor1
parents:
diff changeset
1023 *(float *)v63 = (*((float *)v64 - 5) - *((float *)v64 + 7)) * v69 + *((float *)v64 + 7);
Ritor1
parents:
diff changeset
1024 *(float *)v135 = (*((float *)v64 - 3) - *((float *)v64 + 9)) * v69 + *((float *)v64 + 9);
Ritor1
parents:
diff changeset
1025 v68 = (*(float *)v64 - *((float *)v64 + 12)) * v69 + *((float *)v64 + 12);
Ritor1
parents:
diff changeset
1026 }
Ritor1
parents:
diff changeset
1027 *(float *)v126 = v68;
Ritor1
parents:
diff changeset
1028 *(float *)v140 = v102;
Ritor1
parents:
diff changeset
1029 if ( v62 )
Ritor1
parents:
diff changeset
1030 {
Ritor1
parents:
diff changeset
1031 v70 = v102 + 6.7553994e15;
Ritor1
parents:
diff changeset
1032 v71 = *((float *)v64 - 4) + 6.7553994e15;
Ritor1
parents:
diff changeset
1033 if ( LODWORD(v70) == LODWORD(v71) )
Ritor1
parents:
diff changeset
1034 {
Ritor1
parents:
diff changeset
1035 v72 = *(float *)v63 + 6.7553994e15;
Ritor1
parents:
diff changeset
1036 v73 = *((float *)v64 - 5) + 6.7553994e15;
Ritor1
parents:
diff changeset
1037 v74 = LODWORD(v72) == LODWORD(v73);
Ritor1
parents:
diff changeset
1038 goto LABEL_75;
Ritor1
parents:
diff changeset
1039 }
Ritor1
parents:
diff changeset
1040 goto LABEL_76;
Ritor1
parents:
diff changeset
1041 }
Ritor1
parents:
diff changeset
1042 v75 = v102 + 6.7553994e15;
Ritor1
parents:
diff changeset
1043 v76 = *((float *)v64 + 8) + 6.7553994e15;
Ritor1
parents:
diff changeset
1044 if ( LODWORD(v75) != LODWORD(v76) )
Ritor1
parents:
diff changeset
1045 goto LABEL_76;
Ritor1
parents:
diff changeset
1046 v77 = *(float *)v63 + 6.7553994e15;
Ritor1
parents:
diff changeset
1047 v78 = *((float *)v64 + 7) + 6.7553994e15;
Ritor1
parents:
diff changeset
1048 v74 = LODWORD(v77) == LODWORD(v78);
Ritor1
parents:
diff changeset
1049 LABEL_75:
Ritor1
parents:
diff changeset
1050 if ( !v74 )
Ritor1
parents:
diff changeset
1051 {
Ritor1
parents:
diff changeset
1052 LABEL_76:
Ritor1
parents:
diff changeset
1053 v140 += 48;
Ritor1
parents:
diff changeset
1054 v126 += 48;
Ritor1
parents:
diff changeset
1055 v135 += 48;
Ritor1
parents:
diff changeset
1056 v63 += 48;
Ritor1
parents:
diff changeset
1057 ++v116;
Ritor1
parents:
diff changeset
1058 ++v131;
Ritor1
parents:
diff changeset
1059 v120 = v63;
Ritor1
parents:
diff changeset
1060 }
Ritor1
parents:
diff changeset
1061 }
Ritor1
parents:
diff changeset
1062 if ( v65 )
Ritor1
parents:
diff changeset
1063 {
Ritor1
parents:
diff changeset
1064 v79 = v131;
Ritor1
parents:
diff changeset
1065 v120 += 48;
Ritor1
parents:
diff changeset
1066 ++v116;
Ritor1
parents:
diff changeset
1067 v135 += 48;
Ritor1
parents:
diff changeset
1068 v126 += 48;
Ritor1
parents:
diff changeset
1069 v140 += 48;
Ritor1
parents:
diff changeset
1070 ++v131;
Ritor1
parents:
diff changeset
1071 memcpy(v79, v64 + 4, 0x30u);
Ritor1
parents:
diff changeset
1072 v63 = v120;
Ritor1
parents:
diff changeset
1073 }
Ritor1
parents:
diff changeset
1074 v62 = v109;
Ritor1
parents:
diff changeset
1075 v64 += 48;
Ritor1
parents:
diff changeset
1076 --v113;
Ritor1
parents:
diff changeset
1077 if ( v113 )
Ritor1
parents:
diff changeset
1078 continue;
Ritor1
parents:
diff changeset
1079 break;
Ritor1
parents:
diff changeset
1080 }
Ritor1
parents:
diff changeset
1081 if ( v116 < 3 )
Ritor1
parents:
diff changeset
1082 goto LABEL_112;
Ritor1
parents:
diff changeset
1083 v80 = v116;
Ritor1
parents:
diff changeset
1084 memcpy(&array_508690[v116], array_508690, sizeof(array_508690[v116]));
Ritor1
parents:
diff changeset
1085 if ( v116 > 0 )
Ritor1
parents:
diff changeset
1086 {
Ritor1
parents:
diff changeset
1087 v81 = (char *)&array_508690[0].vWorldViewProjX;
Ritor1
parents:
diff changeset
1088 v82 = v116;
Ritor1
parents:
diff changeset
1089 do
Ritor1
parents:
diff changeset
1090 {
Ritor1
parents:
diff changeset
1091 LODWORD(v83) = *(int *)v81;
Ritor1
parents:
diff changeset
1092 *((float *)v81 - 3) = 1.0 / *((float *)v81 + 2);
Ritor1
parents:
diff changeset
1093 v84 = v83 + 6.7553994e15;
Ritor1
parents:
diff changeset
1094 if ( SLODWORD(v84) <= (signed int)pViewport->uViewportZ )
Ritor1
parents:
diff changeset
1095 {
Ritor1
parents:
diff changeset
1096 v86 = *(float *)v81 + 6.7553994e15;
Ritor1
parents:
diff changeset
1097 if ( SLODWORD(v86) >= (signed int)pViewport->uViewportX )
Ritor1
parents:
diff changeset
1098 goto LABEL_88;
Ritor1
parents:
diff changeset
1099 v85 = v101;
Ritor1
parents:
diff changeset
1100 }
Ritor1
parents:
diff changeset
1101 else
Ritor1
parents:
diff changeset
1102 {
Ritor1
parents:
diff changeset
1103 v85 = v100;
Ritor1
parents:
diff changeset
1104 }
Ritor1
parents:
diff changeset
1105 *(int *)v81 = LODWORD(v85);
Ritor1
parents:
diff changeset
1106 LABEL_88:
Ritor1
parents:
diff changeset
1107 v87 = *((float *)v81 + 1) + 6.7553994e15;
Ritor1
parents:
diff changeset
1108 if ( SLODWORD(v87) > (signed int)pViewport->uViewportW )
Ritor1
parents:
diff changeset
1109 {
Ritor1
parents:
diff changeset
1110 v88 = v102;
Ritor1
parents:
diff changeset
1111 LABEL_92:
Ritor1
parents:
diff changeset
1112 *((int *)v81 + 1) = LODWORD(v88);
Ritor1
parents:
diff changeset
1113 goto LABEL_93;
Ritor1
parents:
diff changeset
1114 }
Ritor1
parents:
diff changeset
1115 v89 = *((float *)v81 + 1) + 6.7553994e15;
Ritor1
parents:
diff changeset
1116 if ( SLODWORD(v89) < (signed int)pViewport->uViewportY )
Ritor1
parents:
diff changeset
1117 {
Ritor1
parents:
diff changeset
1118 v88 = v104;
Ritor1
parents:
diff changeset
1119 goto LABEL_92;
Ritor1
parents:
diff changeset
1120 }
Ritor1
parents:
diff changeset
1121 LABEL_93:
Ritor1
parents:
diff changeset
1122 v81 += 48;
Ritor1
parents:
diff changeset
1123 --v82;
Ritor1
parents:
diff changeset
1124 }
Ritor1
parents:
diff changeset
1125 while ( v82 );
Ritor1
parents:
diff changeset
1126 }
Ritor1
parents:
diff changeset
1127 v91 = __OFSUB__(v116, 3);
Ritor1
parents:
diff changeset
1128 v90 = v116 - 3 < 0;
Ritor1
parents:
diff changeset
1129 if ( v116 > 3 )
Ritor1
parents:
diff changeset
1130 {
Ritor1
parents:
diff changeset
1131 memcpy(&array_508690[v116 + 1], &array_508690[1], sizeof(array_508690[v116 + 1]));
Ritor1
parents:
diff changeset
1132 if ( v116 > 0 )
Ritor1
parents:
diff changeset
1133 {
Ritor1
parents:
diff changeset
1134 v105 = 1;
Ritor1
parents:
diff changeset
1135 do
Ritor1
parents:
diff changeset
1136 {
Ritor1
parents:
diff changeset
1137 v92 = v105;
Ritor1
parents:
diff changeset
1138 v93 = v105 - 1;
Ritor1
parents:
diff changeset
1139 v94 = v105 + 1;
Ritor1
parents:
diff changeset
1140 v95 = v105 + 1;
Ritor1
parents:
diff changeset
1141 if ( v105 - 1 >= v80 )
Ritor1
parents:
diff changeset
1142 v93 -= v80;
Ritor1
parents:
diff changeset
1143 if ( v105 >= v80 )
Ritor1
parents:
diff changeset
1144 v92 = v105 - v80;
Ritor1
parents:
diff changeset
1145 if ( v94 >= v80 )
Ritor1
parents:
diff changeset
1146 v95 = v94 - v80;
Ritor1
parents:
diff changeset
1147 if ( (array_508690[v92].vWorldViewProjX - array_508690[v93].vWorldViewProjX)
Ritor1
parents:
diff changeset
1148 * (array_508690[v95].vWorldViewProjY - array_508690[v93].vWorldViewProjY)
Ritor1
parents:
diff changeset
1149 - (array_508690[v95].vWorldViewProjX - array_508690[v93].vWorldViewProjX)
Ritor1
parents:
diff changeset
1150 * (array_508690[v92].vWorldViewProjY - array_508690[v93].vWorldViewProjY) < 0.0 )
Ritor1
parents:
diff changeset
1151 {
Ritor1
parents:
diff changeset
1152 ++v105;
Ritor1
parents:
diff changeset
1153 }
Ritor1
parents:
diff changeset
1154 else
Ritor1
parents:
diff changeset
1155 {
Ritor1
parents:
diff changeset
1156 v96 = v105;
Ritor1
parents:
diff changeset
1157 if ( v105 < v80 || (v96 = v105 - v80, v105 - v80 < v80) )
Ritor1
parents:
diff changeset
1158 memcpy(&array_508690[v96], &array_508690[v96 + 1], 4 * ((unsigned int)(48 * v80 - 48 * v96) >> 2));
Ritor1
parents:
diff changeset
1159 --v80;
Ritor1
parents:
diff changeset
1160 }
Ritor1
parents:
diff changeset
1161 }
Ritor1
parents:
diff changeset
1162 while ( v105 - 1 < v80 );
Ritor1
parents:
diff changeset
1163 }
Ritor1
parents:
diff changeset
1164 v91 = __OFSUB__(v80, 3);
Ritor1
parents:
diff changeset
1165 v90 = v80 - 3 < 0;
Ritor1
parents:
diff changeset
1166 }
Ritor1
parents:
diff changeset
1167 if ( v90 ^ v91 )
Ritor1
parents:
diff changeset
1168 LABEL_112:
Ritor1
parents:
diff changeset
1169 result = 0;
Ritor1
parents:
diff changeset
1170 else
Ritor1
parents:
diff changeset
1171 result = v80;
Ritor1
parents:
diff changeset
1172 return result;
Ritor1
parents:
diff changeset
1173 }
Ritor1
parents:
diff changeset
1174
Ritor1
parents:
diff changeset
1175 //----- (0042620A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1176 bool __thiscall sr_42620A(RenderVertexSoft *p)
Ritor1
parents:
diff changeset
1177 {
Ritor1
parents:
diff changeset
1178 __int16 v1; // fps@1
Ritor1
parents:
diff changeset
1179 unsigned __int8 v2; // c0@2
Ritor1
parents:
diff changeset
1180 char v3; // c2@2
Ritor1
parents:
diff changeset
1181 unsigned __int8 v4; // c3@2
Ritor1
parents:
diff changeset
1182 bool result; // eax@2
Ritor1
parents:
diff changeset
1183 unsigned __int8 v6; // c0@4
Ritor1
parents:
diff changeset
1184 char v7; // c2@4
Ritor1
parents:
diff changeset
1185 unsigned __int8 v8; // c3@4
Ritor1
parents:
diff changeset
1186 unsigned __int8 v9; // c0@6
Ritor1
parents:
diff changeset
1187 char v10; // c2@6
Ritor1
parents:
diff changeset
1188 unsigned __int8 v11; // c3@6
Ritor1
parents:
diff changeset
1189 double v12; // st6@7
Ritor1
parents:
diff changeset
1190 float v13; // ST04_4@7
Ritor1
parents:
diff changeset
1191 float v14; // ST00_4@7
Ritor1
parents:
diff changeset
1192 double v15; // st7@7
Ritor1
parents:
diff changeset
1193 double v16; // st6@8
Ritor1
parents:
diff changeset
1194 float v17; // ST04_4@8
Ritor1
parents:
diff changeset
1195 float v18; // ST00_4@8
Ritor1
parents:
diff changeset
1196 double v19; // st7@8
Ritor1
parents:
diff changeset
1197
Ritor1
parents:
diff changeset
1198 //UNDEF(v1);
Ritor1
parents:
diff changeset
1199 if ( p->vWorldViewPosition.x < 300.0
Ritor1
parents:
diff changeset
1200 || (v2 = 300.0 < p[1].vWorldViewPosition.x,
Ritor1
parents:
diff changeset
1201 v3 = 0,
Ritor1
parents:
diff changeset
1202 v4 = 300.0 == p[1].vWorldViewPosition.x,
Ritor1
parents:
diff changeset
1203 BYTE1(result) = HIBYTE(v1),
Ritor1
parents:
diff changeset
1204 !(v2 | v4)) )
Ritor1
parents:
diff changeset
1205 {
Ritor1
parents:
diff changeset
1206 if ( p->vWorldViewPosition.x < 300.0 )
Ritor1
parents:
diff changeset
1207 {
Ritor1
parents:
diff changeset
1208 v6 = 300.0 < p[1].vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1209 v7 = 0;
Ritor1
parents:
diff changeset
1210 v8 = 300.0 == p[1].vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1211 BYTE1(result) = HIBYTE(v1);
Ritor1
parents:
diff changeset
1212 if ( !(v6 | v8) )
Ritor1
parents:
diff changeset
1213 {
Ritor1
parents:
diff changeset
1214 LOBYTE(result) = 0;
Ritor1
parents:
diff changeset
1215 return result;
Ritor1
parents:
diff changeset
1216 }
Ritor1
parents:
diff changeset
1217 }
Ritor1
parents:
diff changeset
1218 v9 = 300.0 < p->vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1219 v10 = 0;
Ritor1
parents:
diff changeset
1220 v11 = 300.0 == p->vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1221 BYTE1(result) = HIBYTE(v1);
Ritor1
parents:
diff changeset
1222 if ( v9 | v11 )
Ritor1
parents:
diff changeset
1223 {
Ritor1
parents:
diff changeset
1224 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x);
Ritor1
parents:
diff changeset
1225 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16;
Ritor1
parents:
diff changeset
1226 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16;
Ritor1
parents:
diff changeset
1227 v19 = 300.0 - p[1].vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1228 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1229 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y;
Ritor1
parents:
diff changeset
1230 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z;
Ritor1
parents:
diff changeset
1231 }
Ritor1
parents:
diff changeset
1232 else
Ritor1
parents:
diff changeset
1233 {
Ritor1
parents:
diff changeset
1234 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x);
Ritor1
parents:
diff changeset
1235 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12;
Ritor1
parents:
diff changeset
1236 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12;
Ritor1
parents:
diff changeset
1237 v15 = 300.0 - p->vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1238 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x;
Ritor1
parents:
diff changeset
1239 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y;
Ritor1
parents:
diff changeset
1240 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z;
Ritor1
parents:
diff changeset
1241 }
Ritor1
parents:
diff changeset
1242 }
Ritor1
parents:
diff changeset
1243 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
1244 return result;
Ritor1
parents:
diff changeset
1245 }
Ritor1
parents:
diff changeset
1246
Ritor1
parents:
diff changeset
1247
Ritor1
parents:
diff changeset
1248
Ritor1
parents:
diff changeset
1249
Ritor1
parents:
diff changeset
1250 //----- (004268E3) --------------------------------------------------------
Ritor1
parents:
diff changeset
1251 int __fastcall _4268E3_smthn_to_a1r5g5b5(unsigned int uColor)
Ritor1
parents:
diff changeset
1252 {
Ritor1
parents:
diff changeset
1253 unsigned int v1; // eax@1
Ritor1
parents:
diff changeset
1254 unsigned int v2; // edx@1
Ritor1
parents:
diff changeset
1255 int v3; // eax@1
Ritor1
parents:
diff changeset
1256 int v4; // edx@1
Ritor1
parents:
diff changeset
1257 unsigned int v5; // ecx@1
Ritor1
parents:
diff changeset
1258
Ritor1
parents:
diff changeset
1259 v1 = uColor >> 9;
Ritor1
parents:
diff changeset
1260 v2 = uColor >> 6;
Ritor1
parents:
diff changeset
1261 LOWORD(v1) = (uColor >> 9) & 0x7C00;
Ritor1
parents:
diff changeset
1262 LOWORD(v2) = (uColor >> 6) & 0x3E0;
Ritor1
parents:
diff changeset
1263 v3 = v2 | v1;
Ritor1
parents:
diff changeset
1264 v4 = (unsigned __int8)uColor >> 3;
Ritor1
parents:
diff changeset
1265 v5 = uColor >> 16;
Ritor1
parents:
diff changeset
1266 LOWORD(v5) = v5 & 0x8000;
Ritor1
parents:
diff changeset
1267 return v5 | v4 | v3;
Ritor1
parents:
diff changeset
1268 }
Ritor1
parents:
diff changeset
1269
Ritor1
parents:
diff changeset
1270 //----- (0042690D) --------------------------------------------------------
Ritor1
parents:
diff changeset
1271 int __fastcall _42690D_colors_cvt(unsigned int a1)
Ritor1
parents:
diff changeset
1272 {
Ritor1
parents:
diff changeset
1273 unsigned int v1; // eax@1
Ritor1
parents:
diff changeset
1274 unsigned int v2; // edx@1
Ritor1
parents:
diff changeset
1275
Ritor1
parents:
diff changeset
1276 v1 = a1 >> 8;
Ritor1
parents:
diff changeset
1277 v2 = a1 >> 5;
Ritor1
parents:
diff changeset
1278 LOWORD(v1) = (a1 >> 8) & 0xF800;
Ritor1
parents:
diff changeset
1279 LOWORD(v2) = (a1 >> 5) & 0x7E0;
Ritor1
parents:
diff changeset
1280 return ((unsigned __int8)a1 >> 3) | v2 | v1;
Ritor1
parents:
diff changeset
1281 }
Ritor1
parents:
diff changeset
1282
Ritor1
parents:
diff changeset
1283 //----- (00426947) --------------------------------------------------------
Ritor1
parents:
diff changeset
1284 void __cdecl sub_426947()
Ritor1
parents:
diff changeset
1285 {
Ritor1
parents:
diff changeset
1286 dword_50C968 = 0;
Ritor1
parents:
diff changeset
1287 dword_50C994 = 0;
Ritor1
parents:
diff changeset
1288 dword_50C998_turnbased_icon_1A = 0;
Ritor1
parents:
diff changeset
1289 }
Ritor1
parents:
diff changeset
1290 // 50C968: using guessed type int dword_50C968;
Ritor1
parents:
diff changeset
1291 // 50C994: using guessed type int dword_50C994;
Ritor1
parents:
diff changeset
1292 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A;
Ritor1
parents:
diff changeset
1293
Ritor1
parents:
diff changeset
1294
Ritor1
parents:
diff changeset
1295
Ritor1
parents:
diff changeset
1296 //----- (004269A2) --------------------------------------------------------
Ritor1
parents:
diff changeset
1297 int __fastcall sub_4269A2_GivePartyExp(unsigned int a1)
Ritor1
parents:
diff changeset
1298 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1299 //unsigned __int64 v1; // qax@1
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1300 Player *v1;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1301 int v1b;
0
Ritor1
parents:
diff changeset
1302 signed int v2; // ecx@1
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1303 int *v3; // esi@1
0
Ritor1
parents:
diff changeset
1304 bool v4; // edi@6
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1305 int *v5; // edi@10
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1306 Player *v6; // esi@10
0
Ritor1
parents:
diff changeset
1307 int v7; // eax@13
Ritor1
parents:
diff changeset
1308 unsigned __int8 v8; // cf@13
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1309 int v10[4]; // [sp+Ch] [bp-14h]@1
0
Ritor1
parents:
diff changeset
1310 int v11; // [sp+1Ch] [bp-4h]@10
Ritor1
parents:
diff changeset
1311
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1312 //v1 = __PAIR__((int)((char *)&pParty + 2620), a1);
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1313 v1 = pParty->pPlayers;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1314 v1b = a1;
0
Ritor1
parents:
diff changeset
1315 v2 = 0;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1316 v3 = v10;
0
Ritor1
parents:
diff changeset
1317 do
Ritor1
parents:
diff changeset
1318 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1319 /*v4 = !(*(int *)(HIDWORD(v1) - 4) | *(int *)(HIDWORD(v1) - 8))
0
Ritor1
parents:
diff changeset
1320 && !*(int *)HIDWORD(v1)
Ritor1
parents:
diff changeset
1321 && !*(_QWORD *)(HIDWORD(v1) + 8)
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1322 && !*(_QWORD *)(HIDWORD(v1) + 16);*/
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1323 v4 = !(HIDWORD(v1->pConditions[13]) | LODWORD(v1->pConditions[13]))
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1324 && !v1->pConditions[14]
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1325 && !v1->pConditions[15]
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1326 && !v1->pConditions[16];
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1327 *v3 = v4;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1328 //HIDWORD(v1) += 6972;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1329 ++v1;
0
Ritor1
parents:
diff changeset
1330 v2 += v4;
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1331 ++v3;
0
Ritor1
parents:
diff changeset
1332 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1333 while ( v1 <= &pParty->pPlayers[3] );
0
Ritor1
parents:
diff changeset
1334 if ( v2 )
Ritor1
parents:
diff changeset
1335 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1336 v1b = v1b / v2;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1337 v5 = v10;
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1338 v6 = pParty->pPlayers;//[0].uExperience;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1339 v11 = v1b;
0
Ritor1
parents:
diff changeset
1340 do
Ritor1
parents:
diff changeset
1341 {
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1342 if ( *v5 )
0
Ritor1
parents:
diff changeset
1343 {
Ritor1
parents:
diff changeset
1344 if ( v11 )
Ritor1
parents:
diff changeset
1345 {
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1346 LOBYTE(v7) = v6->GetLearningPercent();
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1347 v1b = v11 + v11 * v7 / 100;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1348 //v8 = __CFADD__((int)v1, LODWORD(v6->uExperience));
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1349 //need review
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1350 LODWORD(v6->uExperience) += v1b;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1351 //HIDWORD(v6->uExperience) += HIDWORD(v1) + v8;
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1352 if ( v6->uExperience > 4000000000i64 )
0
Ritor1
parents:
diff changeset
1353 {
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1354 HIDWORD(v6->uExperience) = 0;
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1355 LODWORD(v6->uExperience) = -294967296;
0
Ritor1
parents:
diff changeset
1356 }
Ritor1
parents:
diff changeset
1357 }
Ritor1
parents:
diff changeset
1358 }
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1359 ++v6;
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1360 ++v5;
0
Ritor1
parents:
diff changeset
1361 }
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
1362 while ( v6 <= &pParty->pPlayers[3] );
0
Ritor1
parents:
diff changeset
1363 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1364 return v1b;
0
Ritor1
parents:
diff changeset
1365 }
Ritor1
parents:
diff changeset
1366
Ritor1
parents:
diff changeset
1367 //----- (00426A5A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1368 void stru319::LootActor(Actor *pActor)
Ritor1
parents:
diff changeset
1369 {
Ritor1
parents:
diff changeset
1370 signed int v2; // edi@1
Ritor1
parents:
diff changeset
1371 char v3; // zf@1
Ritor1
parents:
diff changeset
1372 unsigned int v4; // eax@13
Ritor1
parents:
diff changeset
1373 unsigned int v5; // esi@13
Ritor1
parents:
diff changeset
1374 int v6; // eax@14
Ritor1
parents:
diff changeset
1375 unsigned __int8 v7; // al@30
Ritor1
parents:
diff changeset
1376 Party *v8; // esi@34
Ritor1
parents:
diff changeset
1377 char *v9; // [sp-4h] [bp-3Ch]@10
Ritor1
parents:
diff changeset
1378 char *v10; // [sp-4h] [bp-3Ch]@31
Ritor1
parents:
diff changeset
1379 char *v11; // [sp-4h] [bp-3Ch]@38
Ritor1
parents:
diff changeset
1380 ItemGen Dst; // [sp+Ch] [bp-2Ch]@1
Ritor1
parents:
diff changeset
1381 int v13; // [sp+30h] [bp-8h]@1
Ritor1
parents:
diff changeset
1382 int v14; // [sp+34h] [bp-4h]@1
Ritor1
parents:
diff changeset
1383
Ritor1
parents:
diff changeset
1384 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1385 Dst.Reset();
Ritor1
parents:
diff changeset
1386 v2 = 0;
Ritor1
parents:
diff changeset
1387 v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0;
Ritor1
parents:
diff changeset
1388 v13 = 0;
Ritor1
parents:
diff changeset
1389 v14 = 0;
Ritor1
parents:
diff changeset
1390 if ( v3 )
Ritor1
parents:
diff changeset
1391 {
Ritor1
parents:
diff changeset
1392 if ( !pActor->pMonsterInfo.uTreasureDiceRolls )
Ritor1
parents:
diff changeset
1393 goto LABEL_9;
Ritor1
parents:
diff changeset
1394 do
Ritor1
parents:
diff changeset
1395 {
Ritor1
parents:
diff changeset
1396 ++v2;
Ritor1
parents:
diff changeset
1397 v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1;
Ritor1
parents:
diff changeset
1398 }
Ritor1
parents:
diff changeset
1399 while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls );
Ritor1
parents:
diff changeset
1400 }
Ritor1
parents:
diff changeset
1401 else
Ritor1
parents:
diff changeset
1402 {
Ritor1
parents:
diff changeset
1403 if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 )
Ritor1
parents:
diff changeset
1404 goto LABEL_9;
Ritor1
parents:
diff changeset
1405 v14 = pActor->array_000234[3].uAdditionalValue;
Ritor1
parents:
diff changeset
1406 pActor->array_000234[3].Reset();
Ritor1
parents:
diff changeset
1407 }
Ritor1
parents:
diff changeset
1408 if ( v14 )
Ritor1
parents:
diff changeset
1409 {
Ritor1
parents:
diff changeset
1410 party_finds_gold(v14, 0);
Ritor1
parents:
diff changeset
1411 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
1412 }
Ritor1
parents:
diff changeset
1413 LABEL_9:
Ritor1
parents:
diff changeset
1414 if ( pActor->uCarriedItemID )
Ritor1
parents:
diff changeset
1415 {
Ritor1
parents:
diff changeset
1416 Dst.Reset();
Ritor1
parents:
diff changeset
1417 Dst.uItemID = pActor->uCarriedItemID;
Ritor1
parents:
diff changeset
1418 v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
Ritor1
parents:
diff changeset
1419 if ( v14 )
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 169
diff changeset
1420 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[490], v14, v9);
0
Ritor1
parents:
diff changeset
1421 else
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 169
diff changeset
1422 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], v9);
0
Ritor1
parents:
diff changeset
1423 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
1424 v4 = Dst.uItemID;
Ritor1
parents:
diff changeset
1425 v5 = Dst.uItemID;
Ritor1
parents:
diff changeset
1426 if ( pItemsTable->pItems[Dst.uItemID].uEquipType == 12 )
Ritor1
parents:
diff changeset
1427 {
Ritor1
parents:
diff changeset
1428 v5 = Dst.uItemID;
Ritor1
parents:
diff changeset
1429 v6 = rand() % 6 + pItemsTable->pItems[Dst.uItemID].uDamageMod + 1;
Ritor1
parents:
diff changeset
1430 Dst.uNumCharges = v6;
Ritor1
parents:
diff changeset
1431 Dst.uMaxCharges = v6;
Ritor1
parents:
diff changeset
1432 v4 = Dst.uItemID;
Ritor1
parents:
diff changeset
1433 }
Ritor1
parents:
diff changeset
1434 if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 )
Ritor1
parents:
diff changeset
1435 Dst._bonus_type = 2 * rand() % 4 + 2;
Ritor1
parents:
diff changeset
1436 pItemsTable->SetSpecialBonus(&Dst);
Ritor1
parents:
diff changeset
1437 if ( !pParty->AddItem(&Dst) )
Ritor1
parents:
diff changeset
1438 pParty->SetHoldingItem(&Dst);
Ritor1
parents:
diff changeset
1439 pActor->uCarriedItemID = 0;
Ritor1
parents:
diff changeset
1440 if ( pActor->array_000234[0].uItemID )
Ritor1
parents:
diff changeset
1441 {
Ritor1
parents:
diff changeset
1442 if ( !pParty->AddItem(pActor->array_000234) )
Ritor1
parents:
diff changeset
1443 {
Ritor1
parents:
diff changeset
1444 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1445 pParty->SetHoldingItem(pActor->array_000234);
Ritor1
parents:
diff changeset
1446 }
Ritor1
parents:
diff changeset
1447 pActor->array_000234[0].Reset();
Ritor1
parents:
diff changeset
1448 }
Ritor1
parents:
diff changeset
1449 if ( pActor->array_000234[1].uItemID )
Ritor1
parents:
diff changeset
1450 {
Ritor1
parents:
diff changeset
1451 if ( !pParty->AddItem(&pActor->array_000234[1]) )
Ritor1
parents:
diff changeset
1452 {
Ritor1
parents:
diff changeset
1453 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1454 pParty->SetHoldingItem(&pActor->array_000234[1]);
Ritor1
parents:
diff changeset
1455 }
Ritor1
parents:
diff changeset
1456 pActor->array_000234[1].Reset();
Ritor1
parents:
diff changeset
1457 }
Ritor1
parents:
diff changeset
1458 LABEL_55:
Ritor1
parents:
diff changeset
1459 pActor->Remove();
Ritor1
parents:
diff changeset
1460 return;
Ritor1
parents:
diff changeset
1461 }
Ritor1
parents:
diff changeset
1462 if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes )
Ritor1
parents:
diff changeset
1463 {
Ritor1
parents:
diff changeset
1464 if ( pActor->array_000234[3].uItemID )
Ritor1
parents:
diff changeset
1465 {
Ritor1
parents:
diff changeset
1466 memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst));
Ritor1
parents:
diff changeset
1467 pActor->array_000234[3].Reset();
Ritor1
parents:
diff changeset
1468 v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
Ritor1
parents:
diff changeset
1469 if ( v14 )
Ritor1
parents:
diff changeset
1470 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v11);
Ritor1
parents:
diff changeset
1471 else
Ritor1
parents:
diff changeset
1472 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v11);
Ritor1
parents:
diff changeset
1473 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
1474 if ( !pParty->AddItem(&Dst) )
Ritor1
parents:
diff changeset
1475 pParty->SetHoldingItem(&Dst);
Ritor1
parents:
diff changeset
1476 v13 = 1;
Ritor1
parents:
diff changeset
1477 }
Ritor1
parents:
diff changeset
1478 goto LABEL_44;
Ritor1
parents:
diff changeset
1479 }
Ritor1
parents:
diff changeset
1480 if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 )
Ritor1
parents:
diff changeset
1481 {
Ritor1
parents:
diff changeset
1482 LABEL_44:
Ritor1
parents:
diff changeset
1483 v8 = pParty;
Ritor1
parents:
diff changeset
1484 goto LABEL_45;
Ritor1
parents:
diff changeset
1485 }
Ritor1
parents:
diff changeset
1486 pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst);
Ritor1
parents:
diff changeset
1487 v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName;
Ritor1
parents:
diff changeset
1488 if ( v14 )
Ritor1
parents:
diff changeset
1489 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[490], v14, v10);
Ritor1
parents:
diff changeset
1490 else
Ritor1
parents:
diff changeset
1491 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v10);
Ritor1
parents:
diff changeset
1492 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
1493 v8 = pParty;
Ritor1
parents:
diff changeset
1494 if ( !pParty->AddItem(&Dst) )
Ritor1
parents:
diff changeset
1495 pParty->SetHoldingItem(&Dst);
Ritor1
parents:
diff changeset
1496 v13 = 1;
Ritor1
parents:
diff changeset
1497 LABEL_45:
Ritor1
parents:
diff changeset
1498 if ( pActor->array_000234[0].uItemID )
Ritor1
parents:
diff changeset
1499 {
Ritor1
parents:
diff changeset
1500 if ( !v8->AddItem(pActor->array_000234) )
Ritor1
parents:
diff changeset
1501 {
Ritor1
parents:
diff changeset
1502 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1503 v8->SetHoldingItem(pActor->array_000234);
Ritor1
parents:
diff changeset
1504 v13 = 1;
Ritor1
parents:
diff changeset
1505 }
Ritor1
parents:
diff changeset
1506 pActor->array_000234[0].Reset();
Ritor1
parents:
diff changeset
1507 }
Ritor1
parents:
diff changeset
1508 if ( pActor->array_000234[1].uItemID )
Ritor1
parents:
diff changeset
1509 {
Ritor1
parents:
diff changeset
1510 if ( !v8->AddItem(&pActor->array_000234[1]) )
Ritor1
parents:
diff changeset
1511 {
Ritor1
parents:
diff changeset
1512 sub_421B2C_PlaceInInventory_or_DropPickedItem();
Ritor1
parents:
diff changeset
1513 v8->SetHoldingItem(&pActor->array_000234[1]);
Ritor1
parents:
diff changeset
1514 v13 = 1;
Ritor1
parents:
diff changeset
1515 }
Ritor1
parents:
diff changeset
1516 pActor->array_000234[1].Reset();
Ritor1
parents:
diff changeset
1517 }
Ritor1
parents:
diff changeset
1518 if ( !v13 || rand() % 100 < 90 )
Ritor1
parents:
diff changeset
1519 goto LABEL_55;
Ritor1
parents:
diff changeset
1520 }
Ritor1
parents:
diff changeset
1521
Ritor1
parents:
diff changeset
1522 //----- (00426E10) --------------------------------------------------------
Ritor1
parents:
diff changeset
1523 int stru319::which_player_would_attack(Actor *pActor)
Ritor1
parents:
diff changeset
1524 {
Ritor1
parents:
diff changeset
1525 signed int v2; // ebx@1
Ritor1
parents:
diff changeset
1526 int v3; // ecx@2
Ritor1
parents:
diff changeset
1527 signed int v4; // edx@3
Ritor1
parents:
diff changeset
1528 char v5; // zf@3
Ritor1
parents:
diff changeset
1529 unsigned int v6; // eax@3
Ritor1
parents:
diff changeset
1530 int v7; // eax@6
Ritor1
parents:
diff changeset
1531 int v8; // eax@7
Ritor1
parents:
diff changeset
1532 int v9; // eax@8
Ritor1
parents:
diff changeset
1533 int v10; // eax@9
Ritor1
parents:
diff changeset
1534 int v11; // eax@10
Ritor1
parents:
diff changeset
1535 int v12; // eax@11
Ritor1
parents:
diff changeset
1536 int v13; // esi@35
Ritor1
parents:
diff changeset
1537 signed int v14; // edi@37
Ritor1
parents:
diff changeset
1538 enum CHARACTER_RACE v15; // eax@44
Ritor1
parents:
diff changeset
1539 Player *v16; // ecx@47
Ritor1
parents:
diff changeset
1540 unsigned __int8 v17; // sf@50
Ritor1
parents:
diff changeset
1541 unsigned __int8 v18; // of@50
Ritor1
parents:
diff changeset
1542 int v19; // esi@52
Ritor1
parents:
diff changeset
1543 Player *v20; // ecx@53
Ritor1
parents:
diff changeset
1544 int result; // eax@57
Ritor1
parents:
diff changeset
1545 int v22[16]; // [sp+8h] [bp-140h]@3
Ritor1
parents:
diff changeset
1546 int v23[60]; // [sp+48h] [bp-100h]@48
Ritor1
parents:
diff changeset
1547 int v24; // [sp+138h] [bp-10h]@2
Ritor1
parents:
diff changeset
1548 int v25; // [sp+13Ch] [bp-Ch]@1
Ritor1
parents:
diff changeset
1549 int v26; // [sp+140h] [bp-8h]@1
Ritor1
parents:
diff changeset
1550 int v27; // [sp+144h] [bp-4h]@1
Ritor1
parents:
diff changeset
1551
Ritor1
parents:
diff changeset
1552 v27 = -1;
Ritor1
parents:
diff changeset
1553 v26 = -1;
Ritor1
parents:
diff changeset
1554 v25 = -1;
Ritor1
parents:
diff changeset
1555 v2 = 0;
Ritor1
parents:
diff changeset
1556 if ( pActor->pMonsterInfo.uAttackPreference )
Ritor1
parents:
diff changeset
1557 {
Ritor1
parents:
diff changeset
1558 v3 = 0;
Ritor1
parents:
diff changeset
1559 v24 = 0;
Ritor1
parents:
diff changeset
1560 do
Ritor1
parents:
diff changeset
1561 {
Ritor1
parents:
diff changeset
1562 v4 = 1;
Ritor1
parents:
diff changeset
1563 v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3);
Ritor1
parents:
diff changeset
1564 v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0;
Ritor1
parents:
diff changeset
1565 v22[v3] = v6;
Ritor1
parents:
diff changeset
1566 if ( !v5 )
Ritor1
parents:
diff changeset
1567 {
Ritor1
parents:
diff changeset
1568 if ( (signed int)v6 > 128 )
Ritor1
parents:
diff changeset
1569 {
Ritor1
parents:
diff changeset
1570 switch ( v6 )
Ritor1
parents:
diff changeset
1571 {
Ritor1
parents:
diff changeset
1572 case 0x100u:
Ritor1
parents:
diff changeset
1573 v27 = 8;
Ritor1
parents:
diff changeset
1574 break;
Ritor1
parents:
diff changeset
1575 case 0x200u:
Ritor1
parents:
diff changeset
1576 v25 = 0;
Ritor1
parents:
diff changeset
1577 break;
Ritor1
parents:
diff changeset
1578 case 0x400u:
Ritor1
parents:
diff changeset
1579 v25 = 1;
Ritor1
parents:
diff changeset
1580 break;
Ritor1
parents:
diff changeset
1581 case 0x800u:
Ritor1
parents:
diff changeset
1582 v26 = 0;
Ritor1
parents:
diff changeset
1583 break;
Ritor1
parents:
diff changeset
1584 case 0x1000u:
Ritor1
parents:
diff changeset
1585 v26 = 1;
Ritor1
parents:
diff changeset
1586 break;
Ritor1
parents:
diff changeset
1587 case 0x2000u:
Ritor1
parents:
diff changeset
1588 v26 = 3;
Ritor1
parents:
diff changeset
1589 break;
Ritor1
parents:
diff changeset
1590 case 0x4000u:
Ritor1
parents:
diff changeset
1591 v26 = 2;
Ritor1
parents:
diff changeset
1592 break;
Ritor1
parents:
diff changeset
1593 }
Ritor1
parents:
diff changeset
1594 }
Ritor1
parents:
diff changeset
1595 else
Ritor1
parents:
diff changeset
1596 {
Ritor1
parents:
diff changeset
1597 if ( v6 == 128 )
Ritor1
parents:
diff changeset
1598 {
Ritor1
parents:
diff changeset
1599 v27 = 4;
Ritor1
parents:
diff changeset
1600 }
Ritor1
parents:
diff changeset
1601 else
Ritor1
parents:
diff changeset
1602 {
Ritor1
parents:
diff changeset
1603 v7 = v6 - 1;
Ritor1
parents:
diff changeset
1604 if ( v7 )
Ritor1
parents:
diff changeset
1605 {
Ritor1
parents:
diff changeset
1606 v8 = v7 - 1;
Ritor1
parents:
diff changeset
1607 if ( v8 )
Ritor1
parents:
diff changeset
1608 {
Ritor1
parents:
diff changeset
1609 v9 = v8 - 2;
Ritor1
parents:
diff changeset
1610 if ( v9 )
Ritor1
parents:
diff changeset
1611 {
Ritor1
parents:
diff changeset
1612 v10 = v9 - 4;
Ritor1
parents:
diff changeset
1613 if ( v10 )
Ritor1
parents:
diff changeset
1614 {
Ritor1
parents:
diff changeset
1615 v11 = v10 - 8;
Ritor1
parents:
diff changeset
1616 if ( v11 )
Ritor1
parents:
diff changeset
1617 {
Ritor1
parents:
diff changeset
1618 v12 = v11 - 16;
Ritor1
parents:
diff changeset
1619 if ( v12 )
Ritor1
parents:
diff changeset
1620 {
Ritor1
parents:
diff changeset
1621 if ( v12 == 32 )
Ritor1
parents:
diff changeset
1622 v27 = 20;
Ritor1
parents:
diff changeset
1623 }
Ritor1
parents:
diff changeset
1624 else
Ritor1
parents:
diff changeset
1625 {
Ritor1
parents:
diff changeset
1626 v27 = 32;
Ritor1
parents:
diff changeset
1627 }
Ritor1
parents:
diff changeset
1628 }
Ritor1
parents:
diff changeset
1629 else
Ritor1
parents:
diff changeset
1630 {
Ritor1
parents:
diff changeset
1631 v27 = 24;
Ritor1
parents:
diff changeset
1632 }
Ritor1
parents:
diff changeset
1633 }
Ritor1
parents:
diff changeset
1634 else
Ritor1
parents:
diff changeset
1635 {
Ritor1
parents:
diff changeset
1636 v27 = 28;
Ritor1
parents:
diff changeset
1637 }
Ritor1
parents:
diff changeset
1638 }
Ritor1
parents:
diff changeset
1639 else
Ritor1
parents:
diff changeset
1640 {
Ritor1
parents:
diff changeset
1641 v27 = 16;
Ritor1
parents:
diff changeset
1642 }
Ritor1
parents:
diff changeset
1643 }
Ritor1
parents:
diff changeset
1644 else
Ritor1
parents:
diff changeset
1645 {
Ritor1
parents:
diff changeset
1646 v27 = 12;
Ritor1
parents:
diff changeset
1647 }
Ritor1
parents:
diff changeset
1648 }
Ritor1
parents:
diff changeset
1649 else
Ritor1
parents:
diff changeset
1650 {
Ritor1
parents:
diff changeset
1651 v27 = 0;
Ritor1
parents:
diff changeset
1652 }
Ritor1
parents:
diff changeset
1653 }
Ritor1
parents:
diff changeset
1654 }
Ritor1
parents:
diff changeset
1655 v2 = 0;
Ritor1
parents:
diff changeset
1656 v13 = 0;
Ritor1
parents:
diff changeset
1657 while ( 1 )
Ritor1
parents:
diff changeset
1658 {
Ritor1
parents:
diff changeset
1659 v14 = 0;
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 112
diff changeset
1660 if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType )
0
Ritor1
parents:
diff changeset
1661 v14 = v4;
Ritor1
parents:
diff changeset
1662 if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex )
Ritor1
parents:
diff changeset
1663 v14 = v4;
Ritor1
parents:
diff changeset
1664 if ( v26 != -1 )
Ritor1
parents:
diff changeset
1665 {
Ritor1
parents:
diff changeset
1666 v15 = pPlayers[v13 + 1]->GetRace();
Ritor1
parents:
diff changeset
1667 if ( v26 == v15 )
Ritor1
parents:
diff changeset
1668 v14 = 1;
Ritor1
parents:
diff changeset
1669 }
Ritor1
parents:
diff changeset
1670 if ( v14 == 1 )
Ritor1
parents:
diff changeset
1671 {
Ritor1
parents:
diff changeset
1672 v16 = pPlayers[v13 + 1];
Ritor1
parents:
diff changeset
1673 if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) )
Ritor1
parents:
diff changeset
1674 v23[v2++] = v13;
Ritor1
parents:
diff changeset
1675 }
Ritor1
parents:
diff changeset
1676 ++v13;
Ritor1
parents:
diff changeset
1677 if ( v13 >= 4 )
Ritor1
parents:
diff changeset
1678 break;
Ritor1
parents:
diff changeset
1679 v4 = 1;
Ritor1
parents:
diff changeset
1680 }
Ritor1
parents:
diff changeset
1681 }
Ritor1
parents:
diff changeset
1682 v3 = v24 + 1;
Ritor1
parents:
diff changeset
1683 v18 = __OFSUB__(v24 + 1, 15);
Ritor1
parents:
diff changeset
1684 v17 = v24++ - 14 < 0;
Ritor1
parents:
diff changeset
1685 }
Ritor1
parents:
diff changeset
1686 while ( v17 ^ v18 );
Ritor1
parents:
diff changeset
1687 if ( v2 )
Ritor1
parents:
diff changeset
1688 goto LABEL_61;
Ritor1
parents:
diff changeset
1689 }
Ritor1
parents:
diff changeset
1690 v19 = 0;
Ritor1
parents:
diff changeset
1691 do
Ritor1
parents:
diff changeset
1692 {
Ritor1
parents:
diff changeset
1693 v20 = pPlayers[v19 + 1];
Ritor1
parents:
diff changeset
1694 if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) )
Ritor1
parents:
diff changeset
1695 v23[v2++] = v19;
Ritor1
parents:
diff changeset
1696 ++v19;
Ritor1
parents:
diff changeset
1697 }
Ritor1
parents:
diff changeset
1698 while ( v19 < 4 );
Ritor1
parents:
diff changeset
1699 if ( v2 )
Ritor1
parents:
diff changeset
1700 LABEL_61:
Ritor1
parents:
diff changeset
1701 result = v23[rand() % v2];
Ritor1
parents:
diff changeset
1702 else
Ritor1
parents:
diff changeset
1703 result = 0;
Ritor1
parents:
diff changeset
1704 return result;
Ritor1
parents:
diff changeset
1705 }
Ritor1
parents:
diff changeset
1706
Ritor1
parents:
diff changeset
1707
Ritor1
parents:
diff changeset
1708 //----- (0042704B) --------------------------------------------------------
Ritor1
parents:
diff changeset
1709 bool stru319::special_ability_use_check(Actor *pActor, int a2)
Ritor1
parents:
diff changeset
1710 {
Ritor1
parents:
diff changeset
1711 stru319 *v3; // edi@1
Ritor1
parents:
diff changeset
1712 signed int v4; // ebx@5
Ritor1
parents:
diff changeset
1713 signed int v5; // edi@5
Ritor1
parents:
diff changeset
1714
Ritor1
parents:
diff changeset
1715 v3 = this;
Ritor1
parents:
diff changeset
1716 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2
Ritor1
parents:
diff changeset
1717 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u
Ritor1
parents:
diff changeset
1718 && rand() % 100 < 5 )
Ritor1
parents:
diff changeset
1719 pActor->_44FD29(a2);
Ritor1
parents:
diff changeset
1720 v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID);
Ritor1
parents:
diff changeset
1721 v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID);
Ritor1
parents:
diff changeset
1722 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance )
Ritor1
parents:
diff changeset
1723 return 2;
Ritor1
parents:
diff changeset
1724 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance )
Ritor1
parents:
diff changeset
1725 return 3;
Ritor1
parents:
diff changeset
1726 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance;
Ritor1
parents:
diff changeset
1727 }
Ritor1
parents:
diff changeset
1728
Ritor1
parents:
diff changeset
1729 //----- (00427102) --------------------------------------------------------
Ritor1
parents:
diff changeset
1730 int stru319::_427102(Actor *pActor, signed int a2)
Ritor1
parents:
diff changeset
1731 {
Ritor1
parents:
diff changeset
1732 unsigned __int8 v3; // cf@11
Ritor1
parents:
diff changeset
1733 unsigned __int8 v4; // zf@11
Ritor1
parents:
diff changeset
1734 SpellBuff *v6; // ecx@46
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1735 Player *v7; // esi@49
0
Ritor1
parents:
diff changeset
1736 signed int v8; // edx@50
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1737 SpellBuff *v9; // ecx@50
0
Ritor1
parents:
diff changeset
1738
Ritor1
parents:
diff changeset
1739 if ( a2 > 73 )
Ritor1
parents:
diff changeset
1740 {
Ritor1
parents:
diff changeset
1741 if ( a2 == 77 )
Ritor1
parents:
diff changeset
1742 {
Ritor1
parents:
diff changeset
1743 if ( pActor->sCurrentHP >= (signed int)pActor->pMonsterInfo.uHP )
Ritor1
parents:
diff changeset
1744 return 0;
Ritor1
parents:
diff changeset
1745 return 1;
Ritor1
parents:
diff changeset
1746 }
Ritor1
parents:
diff changeset
1747 if ( a2 == 80 )
Ritor1
parents:
diff changeset
1748 {
Ritor1
parents:
diff changeset
1749 v6 = pParty->pPartyBuffs;
Ritor1
parents:
diff changeset
1750 while ( (signed __int64)v6->uExpireTime <= 0 )
Ritor1
parents:
diff changeset
1751 {
Ritor1
parents:
diff changeset
1752 ++v6;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1753 if ( v6 > &pParty->pPartyBuffs[19] )
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1754 {
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1755 v7 = pParty->pPlayers;//[0].pPlayerBuffs;
0
Ritor1
parents:
diff changeset
1756 v8 = 0;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1757 v9 = v7->pPlayerBuffs;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1758 while ( v9->uExpireTime <= 0i64 )
0
Ritor1
parents:
diff changeset
1759 {
Ritor1
parents:
diff changeset
1760 ++v8;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1761 ++v9;
0
Ritor1
parents:
diff changeset
1762 if ( v8 >= 24 )
Ritor1
parents:
diff changeset
1763 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1764 ++v7;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1765 if ( v7 <= &pParty->pPlayers[3] )
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1766 {
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1767 v8 = 0;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1768 v9 = v7->pPlayerBuffs;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1769 }
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1770 else
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1771 return 0;
0
Ritor1
parents:
diff changeset
1772 }
Ritor1
parents:
diff changeset
1773 }
Ritor1
parents:
diff changeset
1774 return 1;
Ritor1
parents:
diff changeset
1775 }
Ritor1
parents:
diff changeset
1776 }
Ritor1
parents:
diff changeset
1777 return 1;
Ritor1
parents:
diff changeset
1778 }
Ritor1
parents:
diff changeset
1779 if ( a2 == 85 )
Ritor1
parents:
diff changeset
1780 {
Ritor1
parents:
diff changeset
1781 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) < 0 )
Ritor1
parents:
diff changeset
1782 return 1;
Ritor1
parents:
diff changeset
1783 if ( SHIDWORD(pActor->pActorBuffs[13].uExpireTime) > 0 )
Ritor1
parents:
diff changeset
1784 return 0;
Ritor1
parents:
diff changeset
1785 v3 = 0;
Ritor1
parents:
diff changeset
1786 v4 = LODWORD(pActor->pActorBuffs[13].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1787 }
Ritor1
parents:
diff changeset
1788 else
Ritor1
parents:
diff changeset
1789 {
Ritor1
parents:
diff changeset
1790 if ( a2 == 86 )
Ritor1
parents:
diff changeset
1791 {
Ritor1
parents:
diff changeset
1792 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) < 0 )
Ritor1
parents:
diff changeset
1793 return 1;
Ritor1
parents:
diff changeset
1794 if ( SHIDWORD(pActor->pActorBuffs[14].uExpireTime) > 0 )
Ritor1
parents:
diff changeset
1795 return 0;
Ritor1
parents:
diff changeset
1796 v3 = 0;
Ritor1
parents:
diff changeset
1797 v4 = LODWORD(pActor->pActorBuffs[14].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1798 }
Ritor1
parents:
diff changeset
1799 else
Ritor1
parents:
diff changeset
1800 {
Ritor1
parents:
diff changeset
1801 if ( a2 != 95 || SHIDWORD(pActor->pActorBuffs[20].uExpireTime) < 0 )
Ritor1
parents:
diff changeset
1802 return 1;
Ritor1
parents:
diff changeset
1803 if ( SHIDWORD(pActor->pActorBuffs[20].uExpireTime) > 0 )
Ritor1
parents:
diff changeset
1804 return 0;
Ritor1
parents:
diff changeset
1805 v3 = 0;
Ritor1
parents:
diff changeset
1806 v4 = LODWORD(pActor->pActorBuffs[20].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1807 }
Ritor1
parents:
diff changeset
1808 }
Ritor1
parents:
diff changeset
1809 }
Ritor1
parents:
diff changeset
1810 else
Ritor1
parents:
diff changeset
1811 {
Ritor1
parents:
diff changeset
1812 if ( a2 == 73 )
Ritor1
parents:
diff changeset
1813 {
Ritor1
parents:
diff changeset
1814 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) < 0 )
Ritor1
parents:
diff changeset
1815 return 1;
Ritor1
parents:
diff changeset
1816 if ( SHIDWORD(pActor->pActorBuffs[21].uExpireTime) > 0 )
Ritor1
parents:
diff changeset
1817 return 0;
Ritor1
parents:
diff changeset
1818 v3 = 0;
Ritor1
parents:
diff changeset
1819 v4 = LODWORD(pActor->pActorBuffs[21].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1820 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1821 else if ( a2 == 5 )
0
Ritor1
parents:
diff changeset
1822 {
Ritor1
parents:
diff changeset
1823 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) < 0 )
Ritor1
parents:
diff changeset
1824 return 1;
Ritor1
parents:
diff changeset
1825 if ( SHIDWORD(pActor->pActorBuffs[19].uExpireTime) > 0 )
Ritor1
parents:
diff changeset
1826 return 0;
Ritor1
parents:
diff changeset
1827 v3 = 0;
Ritor1
parents:
diff changeset
1828 v4 = LODWORD(pActor->pActorBuffs[19].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1829 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1830 else if ( a2 == 17 )
0
Ritor1
parents:
diff changeset
1831 {
Ritor1
parents:
diff changeset
1832 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) < 0 )
Ritor1
parents:
diff changeset
1833 return 1;
Ritor1
parents:
diff changeset
1834 if ( SHIDWORD(pActor->pActorBuffs[15].uExpireTime) > 0 )
Ritor1
parents:
diff changeset
1835 return 0;
Ritor1
parents:
diff changeset
1836 v3 = 0;
Ritor1
parents:
diff changeset
1837 v4 = LODWORD(pActor->pActorBuffs[15].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1838 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1839 else if ( a2 == 38 )
0
Ritor1
parents:
diff changeset
1840 {
Ritor1
parents:
diff changeset
1841 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) < 0 )
Ritor1
parents:
diff changeset
1842 return 1;
Ritor1
parents:
diff changeset
1843 if ( SHIDWORD(pActor->pActorBuffs[16].uExpireTime) > 0 )
Ritor1
parents:
diff changeset
1844 return 0;
Ritor1
parents:
diff changeset
1845 v3 = 0;
Ritor1
parents:
diff changeset
1846 v4 = LODWORD(pActor->pActorBuffs[16].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1847 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1848 else if ( a2 == 46 )
0
Ritor1
parents:
diff changeset
1849 {
Ritor1
parents:
diff changeset
1850 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) < 0 )
Ritor1
parents:
diff changeset
1851 return 1;
Ritor1
parents:
diff changeset
1852 if ( SHIDWORD(pActor->pActorBuffs[17].uExpireTime) > 0 )
Ritor1
parents:
diff changeset
1853 return 0;
Ritor1
parents:
diff changeset
1854 v3 = 0;
Ritor1
parents:
diff changeset
1855 v4 = LODWORD(pActor->pActorBuffs[17].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1856 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1857 else
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1858 {
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1859 if ( a2 != 47 )
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1860 {
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1861 if ( a2 != 51 || SHIDWORD(pActor->pActorBuffs[18].uExpireTime) < 0 )
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1862 return 1;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1863 if ( SHIDWORD(pActor->pActorBuffs[18].uExpireTime) <= 0 )
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1864 {
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1865 v3 = 0;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1866 v4 = LODWORD(pActor->pActorBuffs[18].uExpireTime) == 0;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1867 }
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1868 else
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1869 return 0;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1870 }
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1871 else
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1872 {
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1873 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) < 0 )
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1874 return 1;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1875 if ( SHIDWORD(pActor->pActorBuffs[11].uExpireTime) > 0 )
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1876 return 0;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1877 v3 = 0;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1878 v4 = LODWORD(pActor->pActorBuffs[11].uExpireTime) == 0;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1879 }
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
1880 }
0
Ritor1
parents:
diff changeset
1881 }
Ritor1
parents:
diff changeset
1882 if ( !(v3 | v4) )
Ritor1
parents:
diff changeset
1883 return 0;
Ritor1
parents:
diff changeset
1884 return 1;
Ritor1
parents:
diff changeset
1885 }
Ritor1
parents:
diff changeset
1886
Ritor1
parents:
diff changeset
1887 //----- (004272F5) --------------------------------------------------------
Ritor1
parents:
diff changeset
1888 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4)
Ritor1
parents:
diff changeset
1889 {
Ritor1
parents:
diff changeset
1890 signed int v5; // esi@1
Ritor1
parents:
diff changeset
1891 signed int v6; // edi@1
Ritor1
parents:
diff changeset
1892 int v7; // esi@8
Ritor1
parents:
diff changeset
1893 int v8; // eax@9
Ritor1
parents:
diff changeset
1894 int v9; // edx@11
Ritor1
parents:
diff changeset
1895 int v10; // edx@13
Ritor1
parents:
diff changeset
1896 int v11; // esi@13
Ritor1
parents:
diff changeset
1897 unsigned __int8 v12; // sf@13
Ritor1
parents:
diff changeset
1898 unsigned __int8 v13; // of@13
Ritor1
parents:
diff changeset
1899 int v14; // edx@14
Ritor1
parents:
diff changeset
1900 int v15; // eax@14
Ritor1
parents:
diff changeset
1901 signed int result; // eax@17
Ritor1
parents:
diff changeset
1902
Ritor1
parents:
diff changeset
1903 v5 = pActor->pMonsterInfo.uAC;
Ritor1
parents:
diff changeset
1904 v6 = 0;
Ritor1
parents:
diff changeset
1905 if ( (signed __int64)pActor->pActorBuffs[8].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1906 v5 /= 2;
Ritor1
parents:
diff changeset
1907 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1908 v6 = pActor->pActorBuffs[15].uPower;
Ritor1
parents:
diff changeset
1909 if ( (signed __int64)pActor->pActorBuffs[16].uExpireTime > 0 && pActor->pActorBuffs[16].uPower > v6 )
Ritor1
parents:
diff changeset
1910 v6 = pActor->pActorBuffs[16].uPower;
Ritor1
parents:
diff changeset
1911 v7 = v6 + v5;
Ritor1
parents:
diff changeset
1912 if ( a3 )
Ritor1
parents:
diff changeset
1913 v8 = pPlayer->GetRangedAttack();
Ritor1
parents:
diff changeset
1914 else
Ritor1
parents:
diff changeset
1915 v8 = pPlayer->GetActualAttack(0);
Ritor1
parents:
diff changeset
1916 v9 = rand() % (v7 + 2 * v8 + 30);
Ritor1
parents:
diff changeset
1917 if ( a3 == 2 )
Ritor1
parents:
diff changeset
1918 {
Ritor1
parents:
diff changeset
1919 v14 = a4 + v9;
Ritor1
parents:
diff changeset
1920 v15 = ((v7 + 15) >> 1) + v7 + 15;
Ritor1
parents:
diff changeset
1921 }
Ritor1
parents:
diff changeset
1922 else
Ritor1
parents:
diff changeset
1923 {
Ritor1
parents:
diff changeset
1924 if ( a3 != 3 )
Ritor1
parents:
diff changeset
1925 {
Ritor1
parents:
diff changeset
1926 v10 = a4 + v9;
Ritor1
parents:
diff changeset
1927 v11 = v7 + 15;
Ritor1
parents:
diff changeset
1928 v13 = __OFSUB__(v10, v11);
Ritor1
parents:
diff changeset
1929 v12 = v10 - v11 < 0;
Ritor1
parents:
diff changeset
1930 goto LABEL_16;
Ritor1
parents:
diff changeset
1931 }
Ritor1
parents:
diff changeset
1932 v14 = a4 + v9;
Ritor1
parents:
diff changeset
1933 v15 = 2 * v7 + 30;
Ritor1
parents:
diff changeset
1934 }
Ritor1
parents:
diff changeset
1935 v13 = __OFSUB__(v14, v15);
Ritor1
parents:
diff changeset
1936 v12 = v14 - v15 < 0;
Ritor1
parents:
diff changeset
1937 LABEL_16:
Ritor1
parents:
diff changeset
1938 if ( v12 ^ v13 )
Ritor1
parents:
diff changeset
1939 result = 0;
Ritor1
parents:
diff changeset
1940 else
Ritor1
parents:
diff changeset
1941 result = 1;
Ritor1
parents:
diff changeset
1942 return result;
Ritor1
parents:
diff changeset
1943 }
Ritor1
parents:
diff changeset
1944
Ritor1
parents:
diff changeset
1945 //----- (004273BB) --------------------------------------------------------
Ritor1
parents:
diff changeset
1946 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4)
Ritor1
parents:
diff changeset
1947 {
Ritor1
parents:
diff changeset
1948 Actor *v5; // ecx@1
Ritor1
parents:
diff changeset
1949 signed int v6; // ebx@1
Ritor1
parents:
diff changeset
1950 signed int v7; // esi@1
Ritor1
parents:
diff changeset
1951 unsigned __int8 v8; // zf@1
Ritor1
parents:
diff changeset
1952 unsigned __int8 v9; // sf@1
Ritor1
parents:
diff changeset
1953 int v10; // ebx@10
Ritor1
parents:
diff changeset
1954 signed int a2a; // [sp+18h] [bp+Ch]@1
Ritor1
parents:
diff changeset
1955
Ritor1
parents:
diff changeset
1956 v5 = a2;
Ritor1
parents:
diff changeset
1957 v6 = a2->pMonsterInfo.uAC;
Ritor1
parents:
diff changeset
1958 v7 = 0;
Ritor1
parents:
diff changeset
1959 v8 = HIDWORD(a2->pActorBuffs[8].uExpireTime) == 0;
Ritor1
parents:
diff changeset
1960 v9 = SHIDWORD(a2->pActorBuffs[8].uExpireTime) < 0;
Ritor1
parents:
diff changeset
1961 a2a = 0;
Ritor1
parents:
diff changeset
1962 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[8].uExpireTime) > 0) )
Ritor1
parents:
diff changeset
1963 v6 /= 2;
Ritor1
parents:
diff changeset
1964 if ( (signed __int64)v5->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1965 v7 = v5->pActorBuffs[14].uPower;
Ritor1
parents:
diff changeset
1966 if ( (signed __int64)v5->pActorBuffs[16].uExpireTime > 0 && v5->pActorBuffs[16].uPower > v7 )
Ritor1
parents:
diff changeset
1967 v7 = v5->pActorBuffs[16].uPower;
Ritor1
parents:
diff changeset
1968 v10 = v7 + v6;
Ritor1
parents:
diff changeset
1969 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1970 a2a = pActor->pActorBuffs[14].uPower;
Ritor1
parents:
diff changeset
1971 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > a2a )
Ritor1
parents:
diff changeset
1972 a2a = pActor->pActorBuffs[17].uPower;
Ritor1
parents:
diff changeset
1973 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1974 {
Ritor1
parents:
diff changeset
1975 a2a += pActor->pActorBuffs[11].uPower;
Ritor1
parents:
diff changeset
1976 pActor->pActorBuffs[11].Reset();
Ritor1
parents:
diff changeset
1977 }
Ritor1
parents:
diff changeset
1978 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5;
Ritor1
parents:
diff changeset
1979 }
Ritor1
parents:
diff changeset
1980
Ritor1
parents:
diff changeset
1981 //----- (004274AD) --------------------------------------------------------
Ritor1
parents:
diff changeset
1982 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer)
Ritor1
parents:
diff changeset
1983 {
Ritor1
parents:
diff changeset
1984 signed int v3; // edi@1
Ritor1
parents:
diff changeset
1985 signed int v4; // esi@8
Ritor1
parents:
diff changeset
1986 int v5; // esi@8
Ritor1
parents:
diff changeset
1987
Ritor1
parents:
diff changeset
1988 v3 = 0;
Ritor1
parents:
diff changeset
1989 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1990 v3 = pActor->pActorBuffs[14].uPower;
Ritor1
parents:
diff changeset
1991 if ( (signed __int64)pActor->pActorBuffs[17].uExpireTime > 0 && pActor->pActorBuffs[17].uPower > v3 )
Ritor1
parents:
diff changeset
1992 v3 = pActor->pActorBuffs[17].uPower;
Ritor1
parents:
diff changeset
1993 if ( (signed __int64)pActor->pActorBuffs[11].uExpireTime > 0 )
Ritor1
parents:
diff changeset
1994 {
Ritor1
parents:
diff changeset
1995 v3 += pActor->pActorBuffs[11].uPower;
Ritor1
parents:
diff changeset
1996 pActor->pActorBuffs[11].Reset();
Ritor1
parents:
diff changeset
1997 }
Ritor1
parents:
diff changeset
1998 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10;
Ritor1
parents:
diff changeset
1999 v5 = rand() % v4 + 1;
Ritor1
parents:
diff changeset
2000 return v3 + v5 > pPlayer->GetActualAC() + 5;
Ritor1
parents:
diff changeset
2001 }
Ritor1
parents:
diff changeset
2002
Ritor1
parents:
diff changeset
2003 //----- (00427546) --------------------------------------------------------
Ritor1
parents:
diff changeset
2004 int stru319::_427546(int a2)
Ritor1
parents:
diff changeset
2005 {
Ritor1
parents:
diff changeset
2006 int result; // eax@2
Ritor1
parents:
diff changeset
2007
Ritor1
parents:
diff changeset
2008 if ( a2 >= 0 )
Ritor1
parents:
diff changeset
2009 {
Ritor1
parents:
diff changeset
2010 if ( a2 >= 1 )
Ritor1
parents:
diff changeset
2011 result = (a2 >= 2) + 2;
Ritor1
parents:
diff changeset
2012 else
Ritor1
parents:
diff changeset
2013 result = 1;
Ritor1
parents:
diff changeset
2014 }
Ritor1
parents:
diff changeset
2015 else
Ritor1
parents:
diff changeset
2016 {
Ritor1
parents:
diff changeset
2017 result = 0;
Ritor1
parents:
diff changeset
2018 }
Ritor1
parents:
diff changeset
2019 return result;
Ritor1
parents:
diff changeset
2020 }
Ritor1
parents:
diff changeset
2021
Ritor1
parents:
diff changeset
2022 //----- (0042756B) --------------------------------------------------------
Ritor1
parents:
diff changeset
2023 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3)
Ritor1
parents:
diff changeset
2024 {
Ritor1
parents:
diff changeset
2025 int v4; // edx@1
Ritor1
parents:
diff changeset
2026 int v5; // ecx@1
Ritor1
parents:
diff changeset
2027 signed int v6; // eax@4
Ritor1
parents:
diff changeset
2028 signed int result; // eax@17
Ritor1
parents:
diff changeset
2029 signed int v8; // esi@18
Ritor1
parents:
diff changeset
2030
Ritor1
parents:
diff changeset
2031 v4 = 0;
Ritor1
parents:
diff changeset
2032 v5 = 0;
Ritor1
parents:
diff changeset
2033 if ( (signed __int64)pActor->pActorBuffs[14].uExpireTime > 0 )
Ritor1
parents:
diff changeset
2034 v5 = pActor->pActorBuffs[14].uPower;
Ritor1
parents:
diff changeset
2035 switch ( a2 )
Ritor1
parents:
diff changeset
2036 {
Ritor1
parents:
diff changeset
2037 case 4:
Ritor1
parents:
diff changeset
2038 v6 = pActor->pMonsterInfo.uResPhysical;
Ritor1
parents:
diff changeset
2039 break;
Ritor1
parents:
diff changeset
2040 case 0:
Ritor1
parents:
diff changeset
2041 v6 = pActor->pMonsterInfo.uResFire;
Ritor1
parents:
diff changeset
2042 goto LABEL_12;
Ritor1
parents:
diff changeset
2043 case 1:
Ritor1
parents:
diff changeset
2044 v6 = pActor->pMonsterInfo.uResAir;
Ritor1
parents:
diff changeset
2045 goto LABEL_12;
Ritor1
parents:
diff changeset
2046 case 2:
Ritor1
parents:
diff changeset
2047 v6 = pActor->pMonsterInfo.uResWater;
Ritor1
parents:
diff changeset
2048 goto LABEL_12;
Ritor1
parents:
diff changeset
2049 case 3:
Ritor1
parents:
diff changeset
2050 v6 = pActor->pMonsterInfo.uResEarth;
Ritor1
parents:
diff changeset
2051 goto LABEL_12;
Ritor1
parents:
diff changeset
2052 case 6:
Ritor1
parents:
diff changeset
2053 v6 = pActor->pMonsterInfo.uResSpirit;
Ritor1
parents:
diff changeset
2054 break;
Ritor1
parents:
diff changeset
2055 case 7:
Ritor1
parents:
diff changeset
2056 v6 = pActor->pMonsterInfo.uResMind;
Ritor1
parents:
diff changeset
2057 goto LABEL_12;
Ritor1
parents:
diff changeset
2058 case 8:
Ritor1
parents:
diff changeset
2059 v6 = pActor->pMonsterInfo.uResBody;
Ritor1
parents:
diff changeset
2060 LABEL_12:
Ritor1
parents:
diff changeset
2061 v4 = v5;
Ritor1
parents:
diff changeset
2062 break;
Ritor1
parents:
diff changeset
2063 case 9:
Ritor1
parents:
diff changeset
2064 v6 = pActor->pMonsterInfo.uResLight;
Ritor1
parents:
diff changeset
2065 break;
Ritor1
parents:
diff changeset
2066 case 10:
Ritor1
parents:
diff changeset
2067 v6 = pActor->pMonsterInfo.uResDark;
Ritor1
parents:
diff changeset
2068 break;
Ritor1
parents:
diff changeset
2069 default:
Ritor1
parents:
diff changeset
2070 v6 = 0;
Ritor1
parents:
diff changeset
2071 break;
Ritor1
parents:
diff changeset
2072 }
Ritor1
parents:
diff changeset
2073 if ( v6 < 200 )
Ritor1
parents:
diff changeset
2074 {
Ritor1
parents:
diff changeset
2075 v8 = v4 + v6 + 30;
Ritor1
parents:
diff changeset
2076 if ( rand() % v8 >= 30 )
Ritor1
parents:
diff changeset
2077 {
Ritor1
parents:
diff changeset
2078 a3 >>= 1;
Ritor1
parents:
diff changeset
2079 if ( rand() % v8 >= 30 )
Ritor1
parents:
diff changeset
2080 {
Ritor1
parents:
diff changeset
2081 a3 >>= 1;
Ritor1
parents:
diff changeset
2082 if ( rand() % v8 >= 30 )
Ritor1
parents:
diff changeset
2083 {
Ritor1
parents:
diff changeset
2084 a3 >>= 1;
Ritor1
parents:
diff changeset
2085 if ( rand() % v8 >= 30 )
Ritor1
parents:
diff changeset
2086 a3 >>= 1;
Ritor1
parents:
diff changeset
2087 }
Ritor1
parents:
diff changeset
2088 }
Ritor1
parents:
diff changeset
2089 }
Ritor1
parents:
diff changeset
2090 result = a3;
Ritor1
parents:
diff changeset
2091 }
Ritor1
parents:
diff changeset
2092 else
Ritor1
parents:
diff changeset
2093 {
Ritor1
parents:
diff changeset
2094 result = 0;
Ritor1
parents:
diff changeset
2095 }
Ritor1
parents:
diff changeset
2096 return result;
Ritor1
parents:
diff changeset
2097 }
Ritor1
parents:
diff changeset
2098
Ritor1
parents:
diff changeset
2099 //----- (00427662) --------------------------------------------------------
Ritor1
parents:
diff changeset
2100 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType)
Ritor1
parents:
diff changeset
2101 {
Ritor1
parents:
diff changeset
2102 Actor *v3; // edi@2
Ritor1
parents:
diff changeset
2103 signed int v4; // esi@2
Ritor1
parents:
diff changeset
2104 bool result; // eax@13
Ritor1
parents:
diff changeset
2105
Ritor1
parents:
diff changeset
2106 switch ( uType )
Ritor1
parents:
diff changeset
2107 {
Ritor1
parents:
diff changeset
2108 case 0u:
Ritor1
parents:
diff changeset
2109 v3 = pActor;
Ritor1
parents:
diff changeset
2110 v4 = pActor->pMonsterInfo.uResFire;
Ritor1
parents:
diff changeset
2111 goto LABEL_12;
Ritor1
parents:
diff changeset
2112 case 1u:
Ritor1
parents:
diff changeset
2113 v3 = pActor;
Ritor1
parents:
diff changeset
2114 v4 = pActor->pMonsterInfo.uResAir;
Ritor1
parents:
diff changeset
2115 goto LABEL_12;
Ritor1
parents:
diff changeset
2116 case 2u:
Ritor1
parents:
diff changeset
2117 v3 = pActor;
Ritor1
parents:
diff changeset
2118 v4 = pActor->pMonsterInfo.uResWater;
Ritor1
parents:
diff changeset
2119 goto LABEL_12;
Ritor1
parents:
diff changeset
2120 case 3u:
Ritor1
parents:
diff changeset
2121 v3 = pActor;
Ritor1
parents:
diff changeset
2122 v4 = pActor->pMonsterInfo.uResEarth;
Ritor1
parents:
diff changeset
2123 goto LABEL_12;
Ritor1
parents:
diff changeset
2124 case 7u:
Ritor1
parents:
diff changeset
2125 v3 = pActor;
Ritor1
parents:
diff changeset
2126 v4 = pActor->pMonsterInfo.uResMind;
Ritor1
parents:
diff changeset
2127 goto LABEL_12;
Ritor1
parents:
diff changeset
2128 case 6u:
Ritor1
parents:
diff changeset
2129 v3 = pActor;
Ritor1
parents:
diff changeset
2130 v4 = pActor->pMonsterInfo.uResSpirit;
Ritor1
parents:
diff changeset
2131 goto LABEL_12;
Ritor1
parents:
diff changeset
2132 case 8u:
Ritor1
parents:
diff changeset
2133 v3 = pActor;
Ritor1
parents:
diff changeset
2134 v4 = pActor->pMonsterInfo.uResBody;
Ritor1
parents:
diff changeset
2135 goto LABEL_12;
Ritor1
parents:
diff changeset
2136 case 9u:
Ritor1
parents:
diff changeset
2137 v3 = pActor;
Ritor1
parents:
diff changeset
2138 v4 = pActor->pMonsterInfo.uResLight;
Ritor1
parents:
diff changeset
2139 goto LABEL_12;
Ritor1
parents:
diff changeset
2140 case 0xAu:
Ritor1
parents:
diff changeset
2141 v3 = pActor;
Ritor1
parents:
diff changeset
2142 v4 = pActor->pMonsterInfo.uResDark;
Ritor1
parents:
diff changeset
2143 goto LABEL_12;
Ritor1
parents:
diff changeset
2144 case 4u:
Ritor1
parents:
diff changeset
2145 v3 = pActor;
Ritor1
parents:
diff changeset
2146 v4 = pActor->pMonsterInfo.uResPhysical;
Ritor1
parents:
diff changeset
2147 LABEL_12:
Ritor1
parents:
diff changeset
2148 if ( v4 < 200 )
Ritor1
parents:
diff changeset
2149 result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30;
Ritor1
parents:
diff changeset
2150 else
Ritor1
parents:
diff changeset
2151 result = 0;
Ritor1
parents:
diff changeset
2152 break;
Ritor1
parents:
diff changeset
2153 default:
Ritor1
parents:
diff changeset
2154 result = 1;
Ritor1
parents:
diff changeset
2155 break;
Ritor1
parents:
diff changeset
2156 }
Ritor1
parents:
diff changeset
2157 return result;
Ritor1
parents:
diff changeset
2158 }
Ritor1
parents:
diff changeset
2159
Ritor1
parents:
diff changeset
2160
Ritor1
parents:
diff changeset
2161 //----- (00427769) --------------------------------------------------------
Ritor1
parents:
diff changeset
2162 bool __fastcall sub_427769_spell(unsigned int uSpellID)
Ritor1
parents:
diff changeset
2163 {
Ritor1
parents:
diff changeset
2164 bool result; // eax@2
Ritor1
parents:
diff changeset
2165
Ritor1
parents:
diff changeset
2166 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC )
Ritor1
parents:
diff changeset
2167 result = 1;
Ritor1
parents:
diff changeset
2168 else
Ritor1
parents:
diff changeset
2169 result = 0;
Ritor1
parents:
diff changeset
2170 return result;
Ritor1
parents:
diff changeset
2171 }
Ritor1
parents:
diff changeset
2172
Ritor1
parents:
diff changeset
2173 //----- (0042777D) --------------------------------------------------------
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2174 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6)
0
Ritor1
parents:
diff changeset
2175 {
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2176 //bool result; // eax@2
0
Ritor1
parents:
diff changeset
2177 __int16 v6; // bx@4
Ritor1
parents:
diff changeset
2178 Player *v7; // eax@4
Ritor1
parents:
diff changeset
2179 char v8; // zf@12
Ritor1
parents:
diff changeset
2180 unsigned __int16 v9; // cx@16
Ritor1
parents:
diff changeset
2181 unsigned int v10; // eax@18
Ritor1
parents:
diff changeset
2182 unsigned __int8 v11; // sf@18
Ritor1
parents:
diff changeset
2183 unsigned __int8 v12; // of@18
Ritor1
parents:
diff changeset
2184 unsigned __int16 v13; // cx@21
Ritor1
parents:
diff changeset
2185 unsigned int v14; // eax@23
Ritor1
parents:
diff changeset
2186 stru277 *v15; // esi@27
Ritor1
parents:
diff changeset
2187 stru277 *v16; // eax@28
Ritor1
parents:
diff changeset
2188 GUIWindow *v17; // eax@43
Ritor1
parents:
diff changeset
2189 GUIWindow *v18; // [sp-30h] [bp-48h]@44
Ritor1
parents:
diff changeset
2190 unsigned int v19; // [sp-2Ch] [bp-44h]@44
Ritor1
parents:
diff changeset
2191 unsigned int v20; // [sp-28h] [bp-40h]@44
Ritor1
parents:
diff changeset
2192 unsigned int v21; // [sp-24h] [bp-3Ch]@44
Ritor1
parents:
diff changeset
2193 unsigned int v22; // [sp-20h] [bp-38h]@44
Ritor1
parents:
diff changeset
2194 int v23; // [sp-1Ch] [bp-34h]@44
Ritor1
parents:
diff changeset
2195 int v24; // [sp-18h] [bp-30h]@44
Ritor1
parents:
diff changeset
2196 unsigned int v25; // [sp-14h] [bp-2Ch]@43
Ritor1
parents:
diff changeset
2197 unsigned int v26; // [sp-10h] [bp-28h]@43
Ritor1
parents:
diff changeset
2198 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43
Ritor1
parents:
diff changeset
2199 char *v28; // [sp-8h] [bp-20h]@43
Ritor1
parents:
diff changeset
2200 Texture *v29; // [sp-4h] [bp-1Ch]@43
Ritor1
parents:
diff changeset
2201 __int16 a3a; // [sp+10h] [bp-8h]@1
Ritor1
parents:
diff changeset
2202 __int16 a2a; // [sp+14h] [bp-4h]@1
Ritor1
parents:
diff changeset
2203
Ritor1
parents:
diff changeset
2204 a3a = uPlayerID;
Ritor1
parents:
diff changeset
2205 a2a = a1;
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2206
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2207 //if ( pParty->bTurnBasedModeOn != 1
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2208 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 )
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2209 if (pParty->bTurnBasedModeOn)
0
Ritor1
parents:
diff changeset
2210 {
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2211 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3)
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2212 return;
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2213 }
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2214
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2215
0
Ritor1
parents:
diff changeset
2216 v6 = a5;
Ritor1
parents:
diff changeset
2217 v7 = &pParty->pPlayers[uPlayerID];
Ritor1
parents:
diff changeset
2218 if ( !(a5 & 0x10) )
Ritor1
parents:
diff changeset
2219 {
Ritor1
parents:
diff changeset
2220 switch ( a1 )
Ritor1
parents:
diff changeset
2221 {
Ritor1
parents:
diff changeset
2222 case 47:
Ritor1
parents:
diff changeset
2223 case 68:
Ritor1
parents:
diff changeset
2224 case 89:
Ritor1
parents:
diff changeset
2225 HIBYTE(v6) = HIBYTE(a5) | 1;
Ritor1
parents:
diff changeset
2226 break;
Ritor1
parents:
diff changeset
2227 case 4:
Ritor1
parents:
diff changeset
2228 case 28:
Ritor1
parents:
diff changeset
2229 case 30:
Ritor1
parents:
diff changeset
2230 case 91:
Ritor1
parents:
diff changeset
2231 LOBYTE(v6) = a5 | 0x80;
Ritor1
parents:
diff changeset
2232 break;
Ritor1
parents:
diff changeset
2233 case 2:
Ritor1
parents:
diff changeset
2234 case 6:
Ritor1
parents:
diff changeset
2235 case 11:
Ritor1
parents:
diff changeset
2236 case 18:
Ritor1
parents:
diff changeset
2237 case 20:
Ritor1
parents:
diff changeset
2238 case 24:
Ritor1
parents:
diff changeset
2239 case 26:
Ritor1
parents:
diff changeset
2240 case 29:
Ritor1
parents:
diff changeset
2241 case 32:
Ritor1
parents:
diff changeset
2242 case 34:
Ritor1
parents:
diff changeset
2243 case 35:
Ritor1
parents:
diff changeset
2244 case 37:
Ritor1
parents:
diff changeset
2245 case 39:
Ritor1
parents:
diff changeset
2246 case 44:
Ritor1
parents:
diff changeset
2247 case 52:
Ritor1
parents:
diff changeset
2248 case 57:
Ritor1
parents:
diff changeset
2249 case 60:
Ritor1
parents:
diff changeset
2250 case 65:
Ritor1
parents:
diff changeset
2251 case 70:
Ritor1
parents:
diff changeset
2252 case 76:
Ritor1
parents:
diff changeset
2253 case 78:
Ritor1
parents:
diff changeset
2254 case 79:
Ritor1
parents:
diff changeset
2255 case 87:
Ritor1
parents:
diff changeset
2256 case 90:
Ritor1
parents:
diff changeset
2257 case 92:
Ritor1
parents:
diff changeset
2258 case 93:
Ritor1
parents:
diff changeset
2259 case 97:
Ritor1
parents:
diff changeset
2260 if ( !a6 )
Ritor1
parents:
diff changeset
2261 goto LABEL_9;
Ritor1
parents:
diff changeset
2262 break;
Ritor1
parents:
diff changeset
2263 case 59:
Ritor1
parents:
diff changeset
2264 case 62:
Ritor1
parents:
diff changeset
2265 case 66:
Ritor1
parents:
diff changeset
2266 case 81:
Ritor1
parents:
diff changeset
2267 case 94:
Ritor1
parents:
diff changeset
2268 LABEL_9:
Ritor1
parents:
diff changeset
2269 v6 = a5 | 8;
Ritor1
parents:
diff changeset
2270 break;
Ritor1
parents:
diff changeset
2271 case 42:
Ritor1
parents:
diff changeset
2272 v6 = a5 | 0x40;
Ritor1
parents:
diff changeset
2273 break;
Ritor1
parents:
diff changeset
2274 case 46:
Ritor1
parents:
diff changeset
2275 if ( a4 )
Ritor1
parents:
diff changeset
2276 v8 = (a4 & 0x1C0) == 0;
Ritor1
parents:
diff changeset
2277 else
Ritor1
parents:
diff changeset
2278 v8 = (v7->pActiveSkills[16] & 0x1C0) == 0;
Ritor1
parents:
diff changeset
2279 if ( v8 )
Ritor1
parents:
diff changeset
2280 goto LABEL_25;
Ritor1
parents:
diff changeset
2281 break;
Ritor1
parents:
diff changeset
2282 case 50:
Ritor1
parents:
diff changeset
2283 v9 = a4;
Ritor1
parents:
diff changeset
2284 if ( !a4 )
Ritor1
parents:
diff changeset
2285 v9 = v7->pActiveSkills[16];
Ritor1
parents:
diff changeset
2286 goto LABEL_18;
Ritor1
parents:
diff changeset
2287 case 95:
Ritor1
parents:
diff changeset
2288 v9 = a4;
Ritor1
parents:
diff changeset
2289 if ( !a4 )
Ritor1
parents:
diff changeset
2290 v9 = v7->pActiveSkills[20];
Ritor1
parents:
diff changeset
2291 LABEL_18:
Ritor1
parents:
diff changeset
2292 v10 = SkillToMastery(v9);
Ritor1
parents:
diff changeset
2293 v12 = __OFSUB__(v10, 3);
Ritor1
parents:
diff changeset
2294 v11 = ((v10 - 3) & 0x80000000u) != 0;
Ritor1
parents:
diff changeset
2295 goto LABEL_24;
Ritor1
parents:
diff changeset
2296 case 73:
Ritor1
parents:
diff changeset
2297 v13 = a4;
Ritor1
parents:
diff changeset
2298 if ( !a4 )
Ritor1
parents:
diff changeset
2299 v13 = v7->pActiveSkills[18];
Ritor1
parents:
diff changeset
2300 v14 = SkillToMastery(v13);
Ritor1
parents:
diff changeset
2301 v12 = __OFSUB__(v14, 4);
Ritor1
parents:
diff changeset
2302 v11 = ((v14 - 4) & 0x80000000u) != 0;
Ritor1
parents:
diff changeset
2303 LABEL_24:
Ritor1
parents:
diff changeset
2304 if ( v11 ^ v12 )
Ritor1
parents:
diff changeset
2305 goto LABEL_25;
Ritor1
parents:
diff changeset
2306 break;
Ritor1
parents:
diff changeset
2307 case 40:
Ritor1
parents:
diff changeset
2308 case 49:
Ritor1
parents:
diff changeset
2309 case 53:
Ritor1
parents:
diff changeset
2310 case 55:
Ritor1
parents:
diff changeset
2311 case 56:
Ritor1
parents:
diff changeset
2312 case 61:
Ritor1
parents:
diff changeset
2313 case 64:
Ritor1
parents:
diff changeset
2314 case 67:
Ritor1
parents:
diff changeset
2315 case 71:
Ritor1
parents:
diff changeset
2316 case 72:
Ritor1
parents:
diff changeset
2317 case 74:
Ritor1
parents:
diff changeset
2318 LABEL_25:
Ritor1
parents:
diff changeset
2319 v6 = a5 | 2;
Ritor1
parents:
diff changeset
2320 break;
Ritor1
parents:
diff changeset
2321 case 96:
Ritor1
parents:
diff changeset
2322 HIBYTE(v6) = HIBYTE(a5) | 2;
Ritor1
parents:
diff changeset
2323 break;
Ritor1
parents:
diff changeset
2324 default:
Ritor1
parents:
diff changeset
2325 break;
Ritor1
parents:
diff changeset
2326 }
Ritor1
parents:
diff changeset
2327 }
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2328
0
Ritor1
parents:
diff changeset
2329 v15 = pStru277;
Ritor1
parents:
diff changeset
2330 if ( v6 & 0x3CA )
Ritor1
parents:
diff changeset
2331 {
Ritor1
parents:
diff changeset
2332 v16 = pStru277;
Ritor1
parents:
diff changeset
2333 while ( !(v16->field_8 & 0x3CA) )
Ritor1
parents:
diff changeset
2334 {
Ritor1
parents:
diff changeset
2335 ++v16;
Ritor1
parents:
diff changeset
2336 if ( (signed int)v16 >= (signed int)&unk_50C190 )
Ritor1
parents:
diff changeset
2337 goto LABEL_33;
Ritor1
parents:
diff changeset
2338 }
Ritor1
parents:
diff changeset
2339 v16->spellnum = 0;
Ritor1
parents:
diff changeset
2340 }
Ritor1
parents:
diff changeset
2341 do
Ritor1
parents:
diff changeset
2342 {
Ritor1
parents:
diff changeset
2343 LABEL_33:
Ritor1
parents:
diff changeset
2344 if ( v15->spellnum )
Ritor1
parents:
diff changeset
2345 {
Ritor1
parents:
diff changeset
2346 v8 = (v15->field_8 & 0x3CA) == 0;
Ritor1
parents:
diff changeset
2347 v15->spellnum = 0;
Ritor1
parents:
diff changeset
2348 if ( !v8 )
Ritor1
parents:
diff changeset
2349 {
Ritor1
parents:
diff changeset
2350 pGUIWindow_Settings->Release();
Ritor1
parents:
diff changeset
2351 pGUIWindow_Settings = 0;
Ritor1
parents:
diff changeset
2352 pMouse->SetCursorBitmap("MICON1");
Ritor1
parents:
diff changeset
2353 GameUI_StatusBar_TimedStringTimeLeft = 0;
Ritor1
parents:
diff changeset
2354 unk_50C9A0 = 0;
Ritor1
parents:
diff changeset
2355 back_to_game();
Ritor1
parents:
diff changeset
2356 }
Ritor1
parents:
diff changeset
2357 }
Ritor1
parents:
diff changeset
2358 ++v15;
Ritor1
parents:
diff changeset
2359 }
Ritor1
parents:
diff changeset
2360 while ( (signed int)v15 < (signed int)&unk_50C190 );
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 349
diff changeset
2361 int result = pStru277->PushStru277(a2a, a3a, a4, v6, a6);
0
Ritor1
parents:
diff changeset
2362 if ( result != -1 )
Ritor1
parents:
diff changeset
2363 {
Ritor1
parents:
diff changeset
2364 if ( v6 & 2 )
Ritor1
parents:
diff changeset
2365 {
Ritor1
parents:
diff changeset
2366 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2367 return;
0
Ritor1
parents:
diff changeset
2368 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
Ritor1
parents:
diff changeset
2369 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0);
Ritor1
parents:
diff changeset
2370 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0);
Ritor1
parents:
diff changeset
2371 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0);
Ritor1
parents:
diff changeset
2372 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0);
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2373 sub_421B2C_PlaceInInventory_or_DropPickedItem();
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2374 return;
0
Ritor1
parents:
diff changeset
2375 }
Ritor1
parents:
diff changeset
2376 if ( v6 & 8 )
Ritor1
parents:
diff changeset
2377 {
Ritor1
parents:
diff changeset
2378 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2379 return;
0
Ritor1
parents:
diff changeset
2380 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
Ritor1
parents:
diff changeset
2381 v29 = 0;
Ritor1
parents:
diff changeset
2382 v28 = "";
Ritor1
parents:
diff changeset
2383 v27 = 0;
Ritor1
parents:
diff changeset
2384 v26 = 0;
Ritor1
parents:
diff changeset
2385 v25 = 70;
Ritor1
parents:
diff changeset
2386 LABEL_44:
Ritor1
parents:
diff changeset
2387 v24 = 0;
Ritor1
parents:
diff changeset
2388 v23 = 1;
Ritor1
parents:
diff changeset
2389 v22 = 344;
Ritor1
parents:
diff changeset
2390 v21 = 460;
Ritor1
parents:
diff changeset
2391 v20 = 8;
Ritor1
parents:
diff changeset
2392 v19 = 8;
Ritor1
parents:
diff changeset
2393 pGUIWindow_Settings = v17;
Ritor1
parents:
diff changeset
2394 v18 = v17;
Ritor1
parents:
diff changeset
2395 LABEL_56:
Ritor1
parents:
diff changeset
2396 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29);
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2397 sub_421B2C_PlaceInInventory_or_DropPickedItem();
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2398 return;
0
Ritor1
parents:
diff changeset
2399 }
Ritor1
parents:
diff changeset
2400 if ( v6 & 0x40 )
Ritor1
parents:
diff changeset
2401 {
Ritor1
parents:
diff changeset
2402 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2403 return;
0
Ritor1
parents:
diff changeset
2404 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
Ritor1
parents:
diff changeset
2405 v29 = 0;
Ritor1
parents:
diff changeset
2406 v28 = "";
Ritor1
parents:
diff changeset
2407 v27 = 0;
Ritor1
parents:
diff changeset
2408 v26 = 0;
Ritor1
parents:
diff changeset
2409 v25 = 190;
Ritor1
parents:
diff changeset
2410 goto LABEL_44;
Ritor1
parents:
diff changeset
2411 }
Ritor1
parents:
diff changeset
2412 if ( (char)v6 < 0 )
Ritor1
parents:
diff changeset
2413 {
Ritor1
parents:
diff changeset
2414 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2415 return;
0
Ritor1
parents:
diff changeset
2416 ++pIcons_LOD->uTexturePacksCount;
Ritor1
parents:
diff changeset
2417 if ( !pIcons_LOD->uNumPrevLoadedFiles )
Ritor1
parents:
diff changeset
2418 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
Ritor1
parents:
diff changeset
2419 pGUIWindow_Settings = pStru277[result].sub_4219BE();
Ritor1
parents:
diff changeset
2420 unk_50C9A0 = 1;
Ritor1
parents:
diff changeset
2421 some_active_character = uActiveCharacter;
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2422 sub_421B2C_PlaceInInventory_or_DropPickedItem();
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2423 return;
0
Ritor1
parents:
diff changeset
2424 }
Ritor1
parents:
diff changeset
2425 if ( HIBYTE(v6) & 1 )
Ritor1
parents:
diff changeset
2426 {
Ritor1
parents:
diff changeset
2427 if ( pGUIWindow_Settings )
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2428 return;
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2429 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
0
Ritor1
parents:
diff changeset
2430 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0);
Ritor1
parents:
diff changeset
2431 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0);
Ritor1
parents:
diff changeset
2432 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0);
Ritor1
parents:
diff changeset
2433 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0);
Ritor1
parents:
diff changeset
2434 v29 = 0;
Ritor1
parents:
diff changeset
2435 v28 = "";
Ritor1
parents:
diff changeset
2436 v27 = 0;
Ritor1
parents:
diff changeset
2437 v26 = 0;
Ritor1
parents:
diff changeset
2438 v25 = 140;
Ritor1
parents:
diff changeset
2439 v24 = 0;
Ritor1
parents:
diff changeset
2440 v23 = 1;
Ritor1
parents:
diff changeset
2441 v22 = 344;
Ritor1
parents:
diff changeset
2442 v21 = 460;
Ritor1
parents:
diff changeset
2443 v20 = 8;
Ritor1
parents:
diff changeset
2444 v19 = 8;
Ritor1
parents:
diff changeset
2445 v18 = pGUIWindow_Settings;
Ritor1
parents:
diff changeset
2446 goto LABEL_56;
Ritor1
parents:
diff changeset
2447 }
Ritor1
parents:
diff changeset
2448 if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings )
Ritor1
parents:
diff changeset
2449 {
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2450 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
0
Ritor1
parents:
diff changeset
2451 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton(
Ritor1
parents:
diff changeset
2452 0x1D5u,
Ritor1
parents:
diff changeset
2453 0xB2u,
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2454 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24),
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2455 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26),
0
Ritor1
parents:
diff changeset
2456 1,
Ritor1
parents:
diff changeset
2457 0,
Ritor1
parents:
diff changeset
2458 0xBCu,
Ritor1
parents:
diff changeset
2459 0,
Ritor1
parents:
diff changeset
2460 0,
Ritor1
parents:
diff changeset
2461 "",
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2462 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0),
0
Ritor1
parents:
diff changeset
2463 0);
Ritor1
parents:
diff changeset
2464 pBtn_NPCRight = pGUIWindow_Settings->CreateButton(
Ritor1
parents:
diff changeset
2465 0x272u,
Ritor1
parents:
diff changeset
2466 0xB2u,
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2467 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24),
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2468 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26),
0
Ritor1
parents:
diff changeset
2469 1,
Ritor1
parents:
diff changeset
2470 0,
Ritor1
parents:
diff changeset
2471 0xBCu,
Ritor1
parents:
diff changeset
2472 1u,
Ritor1
parents:
diff changeset
2473 0,
Ritor1
parents:
diff changeset
2474 "",
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2475 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0),
0
Ritor1
parents:
diff changeset
2476 0);
Ritor1
parents:
diff changeset
2477 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0);
319
5a66be213cff Actor::Die
Nomad
parents: 315
diff changeset
2478 pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0);
0
Ritor1
parents:
diff changeset
2479 }
Ritor1
parents:
diff changeset
2480 }
Ritor1
parents:
diff changeset
2481 }
Ritor1
parents:
diff changeset
2482
Ritor1
parents:
diff changeset
2483
Ritor1
parents:
diff changeset
2484
Ritor1
parents:
diff changeset
2485 //----- (00427D48) --------------------------------------------------------
Ritor1
parents:
diff changeset
2486 void stru277::_427D48(unsigned int uPlayerID)
Ritor1
parents:
diff changeset
2487 {
Ritor1
parents:
diff changeset
2488 stru277 *v2; // esi@1
Ritor1
parents:
diff changeset
2489 signed int v3; // ebx@1
Ritor1
parents:
diff changeset
2490
Ritor1
parents:
diff changeset
2491 v2 = this;
Ritor1
parents:
diff changeset
2492 v3 = 10;
Ritor1
parents:
diff changeset
2493 do
Ritor1
parents:
diff changeset
2494 {
Ritor1
parents:
diff changeset
2495 if ( v2->spellnum )
Ritor1
parents:
diff changeset
2496 {
Ritor1
parents:
diff changeset
2497 if ( v2->field_8 & 0x3CA )
Ritor1
parents:
diff changeset
2498 {
Ritor1
parents:
diff changeset
2499 v2->spellnum = 0;
Ritor1
parents:
diff changeset
2500 pGUIWindow_Settings->Release();
Ritor1
parents:
diff changeset
2501 pGUIWindow_Settings = 0;
Ritor1
parents:
diff changeset
2502 pMouse->SetCursorBitmap("MICON1");
Ritor1
parents:
diff changeset
2503 GameUI_StatusBar_TimedStringTimeLeft = 0;
Ritor1
parents:
diff changeset
2504 unk_50C9A0 = 0;
Ritor1
parents:
diff changeset
2505 back_to_game();
Ritor1
parents:
diff changeset
2506 }
Ritor1
parents:
diff changeset
2507 }
Ritor1
parents:
diff changeset
2508 ++v2;
Ritor1
parents:
diff changeset
2509 --v3;
Ritor1
parents:
diff changeset
2510 }
Ritor1
parents:
diff changeset
2511 while ( v3 );
Ritor1
parents:
diff changeset
2512 }
Ritor1
parents:
diff changeset
2513
Ritor1
parents:
diff changeset
2514 //----- (00427DA0) --------------------------------------------------------
Ritor1
parents:
diff changeset
2515 unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6)
Ritor1
parents:
diff changeset
2516 {
Ritor1
parents:
diff changeset
2517 unsigned int result; // eax@1
Ritor1
parents:
diff changeset
2518 stru277 *v7; // edx@1
Ritor1
parents:
diff changeset
2519 stru277 *v8; // ecx@5
Ritor1
parents:
diff changeset
2520
Ritor1
parents:
diff changeset
2521 result = 0;
Ritor1
parents:
diff changeset
2522 v7 = this;
Ritor1
parents:
diff changeset
2523 while ( v7->spellnum )
Ritor1
parents:
diff changeset
2524 {
Ritor1
parents:
diff changeset
2525 ++result;
Ritor1
parents:
diff changeset
2526 ++v7;
Ritor1
parents:
diff changeset
2527 if ( (signed int)result >= 10 )
Ritor1
parents:
diff changeset
2528 goto LABEL_8;
Ritor1
parents:
diff changeset
2529 }
Ritor1
parents:
diff changeset
2530 v8 = &this[result];
Ritor1
parents:
diff changeset
2531 v8->spellnum = a2;
Ritor1
parents:
diff changeset
2532 v8->uPlayerID = uPlayerID;
Ritor1
parents:
diff changeset
2533 if ( a5 & 0x10 )
Ritor1
parents:
diff changeset
2534 v8->uPlayerID_2 = uPlayerID;
Ritor1
parents:
diff changeset
2535 v8->field_6 = 0;
Ritor1
parents:
diff changeset
2536 *(int *)&v8->field_C = 0;
Ritor1
parents:
diff changeset
2537 v8->field_8 = a5;
Ritor1
parents:
diff changeset
2538 v8->field_A = a4;
Ritor1
parents:
diff changeset
2539 v8->field_10 = a6;
Ritor1
parents:
diff changeset
2540 LABEL_8:
Ritor1
parents:
diff changeset
2541 if ( result == 10 )
Ritor1
parents:
diff changeset
2542 result = -1;
Ritor1
parents:
diff changeset
2543 return result;
Ritor1
parents:
diff changeset
2544 }
Ritor1
parents:
diff changeset
2545
Ritor1
parents:
diff changeset
2546 //----- (00427E01) --------------------------------------------------------
Ritor1
parents:
diff changeset
2547 void stru277::_427E01_cast_spell()
Ritor1
parents:
diff changeset
2548 {
Ritor1
parents:
diff changeset
2549 int v1; // esi@1
Ritor1
parents:
diff changeset
2550 int v2; // edi@1
Ritor1
parents:
diff changeset
2551 stru277 *v3; // ebx@2
Ritor1
parents:
diff changeset
2552 signed int v4; // eax@8
Ritor1
parents:
diff changeset
2553 __int16 v5; // ax@9
Ritor1
parents:
diff changeset
2554 signed int v6; // eax@14
Ritor1
parents:
diff changeset
2555 __int16 v7; // ax@23
Ritor1
parents:
diff changeset
2556 __int16 v8; // ax@24
Ritor1
parents:
diff changeset
2557 char v9; // al@44
Ritor1
parents:
diff changeset
2558 int v10; // eax@45
Ritor1
parents:
diff changeset
2559 unsigned __int16 v11; // cx@45
Ritor1
parents:
diff changeset
2560 signed int v12; // ecx@48
Ritor1
parents:
diff changeset
2561 int v13; // eax@53
Ritor1
parents:
diff changeset
2562 unsigned __int8 v14; // zf@53
Ritor1
parents:
diff changeset
2563 unsigned int v15; // edx@53
Ritor1
parents:
diff changeset
2564 signed int v16; // eax@53
Ritor1
parents:
diff changeset
2565 Player *v17; // esi@70
Ritor1
parents:
diff changeset
2566 int v18; // eax@72
Ritor1
parents:
diff changeset
2567 int v19; // eax@74
Ritor1
parents:
diff changeset
2568 char *v20; // eax@74
Ritor1
parents:
diff changeset
2569 signed int i; // esi@76
Ritor1
parents:
diff changeset
2570 int v22; // eax@88
Ritor1
parents:
diff changeset
2571 __int16 v23; // ax@88
Ritor1
parents:
diff changeset
2572 int v24; // ecx@93
Ritor1
parents:
diff changeset
2573 int v25; // ecx@94
Ritor1
parents:
diff changeset
2574 signed __int64 v26; // qax@100
Ritor1
parents:
diff changeset
2575 char *v27; // ecx@100
Ritor1
parents:
diff changeset
2576 unsigned __int64 v28; // qax@102
Ritor1
parents:
diff changeset
2577 int v29; // ecx@105
Ritor1
parents:
diff changeset
2578 int v30; // ecx@106
Ritor1
parents:
diff changeset
2579 int v31; // eax@112
Ritor1
parents:
diff changeset
2580 int v32; // eax@112
Ritor1
parents:
diff changeset
2581 char *v33; // edx@113
Ritor1
parents:
diff changeset
2582 int v34; // eax@121
Ritor1
parents:
diff changeset
2583 int v35; // eax@123
Ritor1
parents:
diff changeset
2584 int v36; // edx@125
Ritor1
parents:
diff changeset
2585 int v37; // eax@129
Ritor1
parents:
diff changeset
2586 signed int v38; // edi@129
Ritor1
parents:
diff changeset
2587 signed int v39; // eax@129
Ritor1
parents:
diff changeset
2588 int v40; // ecx@129
Ritor1
parents:
diff changeset
2589 int v41; // eax@129
Ritor1
parents:
diff changeset
2590 signed int v42; // eax@129
Ritor1
parents:
diff changeset
2591 int *v43; // ecx@129
Ritor1
parents:
diff changeset
2592 int v44; // eax@132
Ritor1
parents:
diff changeset
2593 int v45; // ecx@132
Ritor1
parents:
diff changeset
2594 int v46; // eax@132
Ritor1
parents:
diff changeset
2595 unsigned int v47; // edx@133
Ritor1
parents:
diff changeset
2596 int v48; // eax@137
Ritor1
parents:
diff changeset
2597 int v49; // eax@137
Ritor1
parents:
diff changeset
2598 int v50; // eax@141
Ritor1
parents:
diff changeset
2599 int v51; // eax@146
Ritor1
parents:
diff changeset
2600 __int16 v52; // ax@153
Ritor1
parents:
diff changeset
2601 int v53; // eax@153
Ritor1
parents:
diff changeset
2602 signed __int64 v54; // qax@164
Ritor1
parents:
diff changeset
2603 int v55; // edi@164
Ritor1
parents:
diff changeset
2604 stru6 *v56; // eax@165
Ritor1
parents:
diff changeset
2605 int v57; // eax@169
Ritor1
parents:
diff changeset
2606 signed __int64 v58; // qax@177
Ritor1
parents:
diff changeset
2607 int v59; // edi@177
Ritor1
parents:
diff changeset
2608 unsigned __int16 v60; // ax@184
Ritor1
parents:
diff changeset
2609 int v61; // ecx@184
Ritor1
parents:
diff changeset
2610 int v62; // eax@186
Ritor1
parents:
diff changeset
2611 int v63; // ecx@187
Ritor1
parents:
diff changeset
2612 int v64; // ecx@188
Ritor1
parents:
diff changeset
2613 int v65; // ecx@189
Ritor1
parents:
diff changeset
2614 const char *v66; // ecx@200
Ritor1
parents:
diff changeset
2615 unsigned int v67; // edx@201
Ritor1
parents:
diff changeset
2616 char v68; // al@207
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
2617 ItemGen *v69; // esi@211
0
Ritor1
parents:
diff changeset
2618 int v70; // ecx@214
Ritor1
parents:
diff changeset
2619 int v71; // ecx@215
Ritor1
parents:
diff changeset
2620 int v72; // ecx@216
Ritor1
parents:
diff changeset
2621 __int16 v73; // ST1C_2@222
Ritor1
parents:
diff changeset
2622 __int16 v74; // ST18_2@222
Ritor1
parents:
diff changeset
2623 stru6 *v75; // eax@222
Ritor1
parents:
diff changeset
2624 int v76; // ecx@223
Ritor1
parents:
diff changeset
2625 int v77; // ecx@224
Ritor1
parents:
diff changeset
2626 int v78; // ecx@225
Ritor1
parents:
diff changeset
2627 int v79; // eax@227
Ritor1
parents:
diff changeset
2628 int v80; // eax@232
Ritor1
parents:
diff changeset
2629 __int16 v81; // ST18_2@245
Ritor1
parents:
diff changeset
2630 stru6 *v82; // eax@245
Ritor1
parents:
diff changeset
2631 signed int v83; // edi@245
Ritor1
parents:
diff changeset
2632 __int16 v84; // ST18_2@245
Ritor1
parents:
diff changeset
2633 stru6 *v85; // eax@245
Ritor1
parents:
diff changeset
2634 __int16 v86; // ST18_2@245
Ritor1
parents:
diff changeset
2635 stru6 *v87; // eax@245
Ritor1
parents:
diff changeset
2636 __int16 v88; // ST18_2@245
Ritor1
parents:
diff changeset
2637 stru6 *v89; // eax@245
Ritor1
parents:
diff changeset
2638 double v90; // st7@245
Ritor1
parents:
diff changeset
2639 int v91; // eax@250
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
2640 Player *v92; // eax@255
0
Ritor1
parents:
diff changeset
2641 __int16 v93; // ST18_2@260
Ritor1
parents:
diff changeset
2642 stru6 *v94; // eax@260
Ritor1
parents:
diff changeset
2643 __int16 v95; // ST18_2@260
Ritor1
parents:
diff changeset
2644 stru6 *v96; // eax@260
Ritor1
parents:
diff changeset
2645 __int16 v97; // ST18_2@260
Ritor1
parents:
diff changeset
2646 stru6 *v98; // eax@260
Ritor1
parents:
diff changeset
2647 __int16 v99; // ST18_2@260
Ritor1
parents:
diff changeset
2648 stru6 *v100; // eax@260
Ritor1
parents:
diff changeset
2649 int v101; // ecx@261
Ritor1
parents:
diff changeset
2650 int v102; // ecx@262
Ritor1
parents:
diff changeset
2651 int v103; // ecx@263
Ritor1
parents:
diff changeset
2652 int v104; // eax@265
Ritor1
parents:
diff changeset
2653 int v105; // edi@271
Ritor1
parents:
diff changeset
2654 __int16 v106; // ST18_2@272
Ritor1
parents:
diff changeset
2655 stru6 *v107; // eax@272
Ritor1
parents:
diff changeset
2656 __int16 v108; // ST1C_2@274
Ritor1
parents:
diff changeset
2657 __int16 v109; // ST18_2@274
Ritor1
parents:
diff changeset
2658 stru6 *v110; // eax@274
Ritor1
parents:
diff changeset
2659 int v111; // eax@274
Ritor1
parents:
diff changeset
2660 Actor *v112; // esi@278
Ritor1
parents:
diff changeset
2661 int v113; // eax@278
Ritor1
parents:
diff changeset
2662 int v114; // ebx@278
Ritor1
parents:
diff changeset
2663 unsigned int v115; // ecx@278
Ritor1
parents:
diff changeset
2664 int v116; // edx@279
Ritor1
parents:
diff changeset
2665 int v117; // edx@281
Ritor1
parents:
diff changeset
2666 int v118; // edx@283
Ritor1
parents:
diff changeset
2667 int v119; // edi@286
Ritor1
parents:
diff changeset
2668 int v120; // eax@286
Ritor1
parents:
diff changeset
2669 int v121; // eax@286
Ritor1
parents:
diff changeset
2670 signed int v122; // eax@286
Ritor1
parents:
diff changeset
2671 int v123; // ecx@288
Ritor1
parents:
diff changeset
2672 int v124; // ecx@289
Ritor1
parents:
diff changeset
2673 int v125; // ecx@290
Ritor1
parents:
diff changeset
2674 int v126; // eax@292
Ritor1
parents:
diff changeset
2675 int v127; // eax@296
Ritor1
parents:
diff changeset
2676 __int16 v128; // ST18_2@303
Ritor1
parents:
diff changeset
2677 stru6 *v129; // eax@303
Ritor1
parents:
diff changeset
2678 __int16 v130; // ST18_2@303
Ritor1
parents:
diff changeset
2679 stru6 *v131; // eax@303
Ritor1
parents:
diff changeset
2680 __int16 v132; // ST18_2@303
Ritor1
parents:
diff changeset
2681 stru6 *v133; // eax@303
Ritor1
parents:
diff changeset
2682 __int16 v134; // ST18_2@303
Ritor1
parents:
diff changeset
2683 stru6 *v135; // eax@303
Ritor1
parents:
diff changeset
2684 unsigned __int64 v136; // qax@304
Ritor1
parents:
diff changeset
2685 char *v137; // ecx@304
Ritor1
parents:
diff changeset
2686 int v138; // ecx@305
Ritor1
parents:
diff changeset
2687 int v139; // ecx@306
Ritor1
parents:
diff changeset
2688 int v140; // eax@308
Ritor1
parents:
diff changeset
2689 __int16 v141; // ST18_2@311
Ritor1
parents:
diff changeset
2690 stru6 *v142; // eax@311
Ritor1
parents:
diff changeset
2691 __int16 v143; // ST18_2@311
Ritor1
parents:
diff changeset
2692 stru6 *v144; // eax@311
Ritor1
parents:
diff changeset
2693 __int16 v145; // ST18_2@311
Ritor1
parents:
diff changeset
2694 stru6 *v146; // eax@311
Ritor1
parents:
diff changeset
2695 __int16 v147; // ST18_2@311
Ritor1
parents:
diff changeset
2696 stru6 *v148; // eax@311
Ritor1
parents:
diff changeset
2697 int v149; // ecx@312
Ritor1
parents:
diff changeset
2698 int v150; // ecx@313
Ritor1
parents:
diff changeset
2699 int v151; // ecx@314
Ritor1
parents:
diff changeset
2700 signed int v152; // eax@322
Ritor1
parents:
diff changeset
2701 int v153; // ecx@322
Ritor1
parents:
diff changeset
2702 int v154; // eax@322
Ritor1
parents:
diff changeset
2703 int v155; // eax@323
Ritor1
parents:
diff changeset
2704 int v156; // eax@323
Ritor1
parents:
diff changeset
2705 int v157; // eax@326
Ritor1
parents:
diff changeset
2706 double v158; // st7@326
Ritor1
parents:
diff changeset
2707 double v159; // st6@326
Ritor1
parents:
diff changeset
2708 signed __int64 v160; // qtt@334
Ritor1
parents:
diff changeset
2709 int v161; // eax@339
Ritor1
parents:
diff changeset
2710 int v162; // edi@340
Ritor1
parents:
diff changeset
2711 int v163; // eax@340
Ritor1
parents:
diff changeset
2712 signed int v164; // eax@340
Ritor1
parents:
diff changeset
2713 signed int v165; // edi@340
Ritor1
parents:
diff changeset
2714 stru6 *v166; // eax@340
Ritor1
parents:
diff changeset
2715 stru6 *v167; // eax@340
Ritor1
parents:
diff changeset
2716 signed int v168; // edi@343
Ritor1
parents:
diff changeset
2717 int v169; // eax@344
Ritor1
parents:
diff changeset
2718 int v170; // ecx@346
Ritor1
parents:
diff changeset
2719 int v171; // ecx@347
Ritor1
parents:
diff changeset
2720 int v172; // ecx@348
Ritor1
parents:
diff changeset
2721 int v173; // edi@350
Ritor1
parents:
diff changeset
2722 signed int v174; // edi@355
Ritor1
parents:
diff changeset
2723 __int16 v175; // ST18_2@357
Ritor1
parents:
diff changeset
2724 stru6 *v176; // eax@357
Ritor1
parents:
diff changeset
2725 __int16 v177; // ST18_2@357
Ritor1
parents:
diff changeset
2726 stru6 *v178; // eax@357
Ritor1
parents:
diff changeset
2727 __int16 v179; // ST18_2@357
Ritor1
parents:
diff changeset
2728 stru6 *v180; // eax@357
Ritor1
parents:
diff changeset
2729 __int16 v181; // ST18_2@357
Ritor1
parents:
diff changeset
2730 stru6 *v182; // eax@357
Ritor1
parents:
diff changeset
2731 signed __int64 v183; // qax@357
Ritor1
parents:
diff changeset
2732 int v184; // ecx@358
Ritor1
parents:
diff changeset
2733 int v185; // ecx@359
Ritor1
parents:
diff changeset
2734 int v186; // ecx@360
Ritor1
parents:
diff changeset
2735 int v187; // eax@367
Ritor1
parents:
diff changeset
2736 int v188; // esi@369
Ritor1
parents:
diff changeset
2737 int v189; // edi@369
Ritor1
parents:
diff changeset
2738 const char *v190; // ecx@377
Ritor1
parents:
diff changeset
2739 signed int v191; // edi@379
Ritor1
parents:
diff changeset
2740 int v192; // ecx@382
Ritor1
parents:
diff changeset
2741 int v193; // ecx@383
Ritor1
parents:
diff changeset
2742 int v194; // ecx@384
Ritor1
parents:
diff changeset
2743 int v195; // eax@386
Ritor1
parents:
diff changeset
2744 int v196; // eax@387
Ritor1
parents:
diff changeset
2745 __int16 v197; // ST18_2@395
Ritor1
parents:
diff changeset
2746 stru6 *v198; // eax@395
Ritor1
parents:
diff changeset
2747 __int16 v199; // ST18_2@395
Ritor1
parents:
diff changeset
2748 stru6 *v200; // eax@395
Ritor1
parents:
diff changeset
2749 __int16 v201; // ST18_2@395
Ritor1
parents:
diff changeset
2750 stru6 *v202; // eax@395
Ritor1
parents:
diff changeset
2751 __int16 v203; // ST18_2@395
Ritor1
parents:
diff changeset
2752 stru6 *v204; // eax@395
Ritor1
parents:
diff changeset
2753 signed int v205; // edi@405
Ritor1
parents:
diff changeset
2754 int v206; // eax@407
Ritor1
parents:
diff changeset
2755 __int16 v207; // cx@407
Ritor1
parents:
diff changeset
2756 int v208; // eax@411
Ritor1
parents:
diff changeset
2757 signed int v209; // ecx@412
Ritor1
parents:
diff changeset
2758 int v210; // edx@412
Ritor1
parents:
diff changeset
2759 signed int v211; // ecx@412
Ritor1
parents:
diff changeset
2760 int v212; // eax@413
Ritor1
parents:
diff changeset
2761 int v213; // eax@413
Ritor1
parents:
diff changeset
2762 int v214; // eax@413
Ritor1
parents:
diff changeset
2763 int v215; // eax@415
Ritor1
parents:
diff changeset
2764 double v216; // st7@415
Ritor1
parents:
diff changeset
2765 double v217; // st6@415
Ritor1
parents:
diff changeset
2766 signed __int64 v218; // qtt@423
Ritor1
parents:
diff changeset
2767 int v219; // ecx@425
Ritor1
parents:
diff changeset
2768 int v220; // ecx@426
Ritor1
parents:
diff changeset
2769 int v221; // edi@428
Ritor1
parents:
diff changeset
2770 char *v222; // edi@434
Ritor1
parents:
diff changeset
2771 char v223; // al@438
Ritor1
parents:
diff changeset
2772 int v224; // ecx@442
Ritor1
parents:
diff changeset
2773 int v225; // ecx@443
Ritor1
parents:
diff changeset
2774 int v226; // eax@451
Ritor1
parents:
diff changeset
2775 int v227; // esi@453
Ritor1
parents:
diff changeset
2776 unsigned int v228; // edi@454
Ritor1
parents:
diff changeset
2777 int v229; // edi@466
Ritor1
parents:
diff changeset
2778 __int16 v230; // ST18_2@469
Ritor1
parents:
diff changeset
2779 stru6 *v231; // eax@469
Ritor1
parents:
diff changeset
2780 signed int v232; // esi@469
Ritor1
parents:
diff changeset
2781 __int16 v233; // ST18_2@469
Ritor1
parents:
diff changeset
2782 stru6 *v234; // eax@469
Ritor1
parents:
diff changeset
2783 __int16 v235; // ST18_2@469
Ritor1
parents:
diff changeset
2784 stru6 *v236; // eax@469
Ritor1
parents:
diff changeset
2785 __int16 v237; // ST18_2@469
Ritor1
parents:
diff changeset
2786 stru6 *v238; // eax@469
Ritor1
parents:
diff changeset
2787 __int16 v239; // ST1C_2@469
Ritor1
parents:
diff changeset
2788 char *v240; // ecx@472
Ritor1
parents:
diff changeset
2789 double v241; // st7@478
Ritor1
parents:
diff changeset
2790 signed __int64 v242; // qax@484
Ritor1
parents:
diff changeset
2791 char *v243; // ecx@484
Ritor1
parents:
diff changeset
2792 char *v244; // eax@488
Ritor1
parents:
diff changeset
2793 int v245; // edi@492
Ritor1
parents:
diff changeset
2794 int v246; // eax@492
Ritor1
parents:
diff changeset
2795 char *v247; // eax@497
Ritor1
parents:
diff changeset
2796 char v248; // al@497
Ritor1
parents:
diff changeset
2797 char v249; // cf@500
Ritor1
parents:
diff changeset
2798 float v250; // esi@507
Ritor1
parents:
diff changeset
2799 char v251; // al@507
Ritor1
parents:
diff changeset
2800 int v252; // edx@510
Ritor1
parents:
diff changeset
2801 int m; // esi@510
Ritor1
parents:
diff changeset
2802 int v254; // eax@513
Ritor1
parents:
diff changeset
2803 int v255; // esi@513
Ritor1
parents:
diff changeset
2804 int v256; // ecx@513
Ritor1
parents:
diff changeset
2805 int v257; // edx@514
Ritor1
parents:
diff changeset
2806 int v258; // ecx@514
Ritor1
parents:
diff changeset
2807 char v259; // al@516
Ritor1
parents:
diff changeset
2808 int v260; // eax@518
Ritor1
parents:
diff changeset
2809 int v261; // esi@519
Ritor1
parents:
diff changeset
2810 int v262; // edx@521
Ritor1
parents:
diff changeset
2811 int v263; // ecx@521
Ritor1
parents:
diff changeset
2812 int v264; // esi@521
Ritor1
parents:
diff changeset
2813 int v265; // edx@521
Ritor1
parents:
diff changeset
2814 int *ii; // eax@522
Ritor1
parents:
diff changeset
2815 int v267; // eax@524
Ritor1
parents:
diff changeset
2816 int v268; // eax@524
Ritor1
parents:
diff changeset
2817 int v269; // eax@526
Ritor1
parents:
diff changeset
2818 char *v270; // eax@531
Ritor1
parents:
diff changeset
2819 char v271; // al@531
Ritor1
parents:
diff changeset
2820 char v272; // cf@534
Ritor1
parents:
diff changeset
2821 float v273; // esi@541
Ritor1
parents:
diff changeset
2822 char v274; // al@541
Ritor1
parents:
diff changeset
2823 int v275; // edx@544
Ritor1
parents:
diff changeset
2824 int k; // esi@544
Ritor1
parents:
diff changeset
2825 int v277; // edx@548
Ritor1
parents:
diff changeset
2826 int v278; // ecx@548
Ritor1
parents:
diff changeset
2827 char v279; // al@550
Ritor1
parents:
diff changeset
2828 int v280; // eax@552
Ritor1
parents:
diff changeset
2829 int v281; // esi@553
Ritor1
parents:
diff changeset
2830 int v282; // edx@555
Ritor1
parents:
diff changeset
2831 int v283; // ecx@555
Ritor1
parents:
diff changeset
2832 int v284; // esi@555
Ritor1
parents:
diff changeset
2833 int v285; // edx@555
Ritor1
parents:
diff changeset
2834 int *l; // eax@556
Ritor1
parents:
diff changeset
2835 int v287; // eax@558
Ritor1
parents:
diff changeset
2836 int v288; // eax@558
Ritor1
parents:
diff changeset
2837 ItemGen *v289; // eax@560
Ritor1
parents:
diff changeset
2838 signed int v290; // eax@560
Ritor1
parents:
diff changeset
2839 unsigned __int8 v291; // al@564
Ritor1
parents:
diff changeset
2840 char v292; // al@573
Ritor1
parents:
diff changeset
2841 int v293; // eax@575
Ritor1
parents:
diff changeset
2842 ItemGen *v294; // esi@575
Ritor1
parents:
diff changeset
2843 int v295; // edx@575
Ritor1
parents:
diff changeset
2844 int kk; // edi@575
Ritor1
parents:
diff changeset
2845 int v297; // edx@579
Ritor1
parents:
diff changeset
2846 int v298; // ecx@579
Ritor1
parents:
diff changeset
2847 char v299; // al@581
Ritor1
parents:
diff changeset
2848 int v300; // eax@583
Ritor1
parents:
diff changeset
2849 int v301; // edi@584
Ritor1
parents:
diff changeset
2850 int v302; // edx@586
Ritor1
parents:
diff changeset
2851 int v303; // ecx@586
Ritor1
parents:
diff changeset
2852 int v304; // edi@586
Ritor1
parents:
diff changeset
2853 int v305; // edx@586
Ritor1
parents:
diff changeset
2854 int *jj; // eax@587
Ritor1
parents:
diff changeset
2855 int v307; // eax@589
Ritor1
parents:
diff changeset
2856 int v308; // eax@589
Ritor1
parents:
diff changeset
2857 char *v309; // ecx@593
Ritor1
parents:
diff changeset
2858 char v310; // sf@593
Ritor1
parents:
diff changeset
2859 unsigned __int8 v311; // of@593
Ritor1
parents:
diff changeset
2860 char v312; // cl@597
Ritor1
parents:
diff changeset
2861 char v313; // al@606
Ritor1
parents:
diff changeset
2862 int v314; // edx@607
Ritor1
parents:
diff changeset
2863 int j; // esi@607
Ritor1
parents:
diff changeset
2864 unsigned int v316; // eax@613
Ritor1
parents:
diff changeset
2865 const char *v317; // ecx@617
Ritor1
parents:
diff changeset
2866 Player *v318; // ecx@619
Ritor1
parents:
diff changeset
2867 unsigned int v319; // edi@627
Ritor1
parents:
diff changeset
2868 int v320; // ecx@629
Ritor1
parents:
diff changeset
2869 int v321; // ecx@630
Ritor1
parents:
diff changeset
2870 int v322; // edi@632
Ritor1
parents:
diff changeset
2871 int v323; // edi@635
Ritor1
parents:
diff changeset
2872 char *v324; // eax@635
Ritor1
parents:
diff changeset
2873 Player *v325; // ecx@640
Ritor1
parents:
diff changeset
2874 int v326; // eax@643
Ritor1
parents:
diff changeset
2875 int v327; // eax@648
Ritor1
parents:
diff changeset
2876 int v328; // ecx@651
Ritor1
parents:
diff changeset
2877 int v329; // ecx@652
Ritor1
parents:
diff changeset
2878 int v330; // edi@654
Ritor1
parents:
diff changeset
2879 __int16 v331; // ST18_2@658
Ritor1
parents:
diff changeset
2880 stru6 *v332; // eax@658
Ritor1
parents:
diff changeset
2881 __int16 v333; // ST18_2@658
Ritor1
parents:
diff changeset
2882 stru6 *v334; // eax@658
Ritor1
parents:
diff changeset
2883 __int16 v335; // ST18_2@658
Ritor1
parents:
diff changeset
2884 stru6 *v336; // eax@658
Ritor1
parents:
diff changeset
2885 __int16 v337; // ST18_2@658
Ritor1
parents:
diff changeset
2886 stru6 *v338; // eax@658
Ritor1
parents:
diff changeset
2887 int v339; // ecx@659
Ritor1
parents:
diff changeset
2888 int v340; // ecx@660
Ritor1
parents:
diff changeset
2889 int v341; // eax@663
Ritor1
parents:
diff changeset
2890 signed int v342; // edi@668
Ritor1
parents:
diff changeset
2891 signed int v343; // edi@670
Ritor1
parents:
diff changeset
2892 unsigned __int64 v344; // ST08_8@670
Ritor1
parents:
diff changeset
2893 __int16 v345; // ST1C_2@671
Ritor1
parents:
diff changeset
2894 __int16 v346; // ST18_2@671
Ritor1
parents:
diff changeset
2895 stru6 *v347; // eax@671
Ritor1
parents:
diff changeset
2896 int v348; // ecx@672
Ritor1
parents:
diff changeset
2897 int v349; // ecx@673
Ritor1
parents:
diff changeset
2898 int v350; // edi@676
Ritor1
parents:
diff changeset
2899 Player *v351; // edi@680
Ritor1
parents:
diff changeset
2900 __int16 v352; // ST18_2@685
Ritor1
parents:
diff changeset
2901 stru6 *v353; // eax@685
Ritor1
parents:
diff changeset
2902 int v354; // ecx@686
Ritor1
parents:
diff changeset
2903 int v355; // ecx@687
Ritor1
parents:
diff changeset
2904 int v356; // eax@689
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
2905 Player *v357; // edi@694
0
Ritor1
parents:
diff changeset
2906 unsigned __int16 v358; // ST1C_2@695
Ritor1
parents:
diff changeset
2907 __int16 v359; // ST18_2@695
Ritor1
parents:
diff changeset
2908 stru6 *v360; // eax@695
Ritor1
parents:
diff changeset
2909 __int16 v361; // ST1C_2@697
Ritor1
parents:
diff changeset
2910 __int16 v362; // ST18_2@697
Ritor1
parents:
diff changeset
2911 stru6 *v363; // eax@697
Ritor1
parents:
diff changeset
2912 int v364; // ecx@698
Ritor1
parents:
diff changeset
2913 int v365; // ecx@699
Ritor1
parents:
diff changeset
2914 int v366; // eax@701
Ritor1
parents:
diff changeset
2915 stru6 *v367; // eax@704
Ritor1
parents:
diff changeset
2916 int v368; // eax@704
Ritor1
parents:
diff changeset
2917 Actor *v369; // edi@705
Ritor1
parents:
diff changeset
2918 int v370; // eax@706
Ritor1
parents:
diff changeset
2919 int v371; // ecx@709
Ritor1
parents:
diff changeset
2920 int v372; // ecx@710
Ritor1
parents:
diff changeset
2921 int v373; // eax@715
Ritor1
parents:
diff changeset
2922 int v374; // eax@717
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
2923 Player *v375; // edi@717
0
Ritor1
parents:
diff changeset
2924 int v376; // eax@717
Ritor1
parents:
diff changeset
2925 Player *v377; // ecx@719
Ritor1
parents:
diff changeset
2926 int v378; // ecx@721
Ritor1
parents:
diff changeset
2927 int v379; // ecx@722
Ritor1
parents:
diff changeset
2928 int v380; // eax@724
Ritor1
parents:
diff changeset
2929 int v381; // edi@727
Ritor1
parents:
diff changeset
2930 int v382; // ecx@727
Ritor1
parents:
diff changeset
2931 Player *v383; // eax@728
Ritor1
parents:
diff changeset
2932 int v384; // eax@733
Ritor1
parents:
diff changeset
2933 int v385; // edi@736
Ritor1
parents:
diff changeset
2934 signed int v386; // eax@736
Ritor1
parents:
diff changeset
2935 Player *v387; // edi@738
Ritor1
parents:
diff changeset
2936 int v388; // edi@740
Ritor1
parents:
diff changeset
2937 unsigned __int16 v389; // ST1C_2@740
Ritor1
parents:
diff changeset
2938 __int16 v390; // ST18_2@740
Ritor1
parents:
diff changeset
2939 stru6 *v391; // eax@740
Ritor1
parents:
diff changeset
2940 int v392; // ecx@742
Ritor1
parents:
diff changeset
2941 int v393; // ecx@743
Ritor1
parents:
diff changeset
2942 int v394; // ecx@744
Ritor1
parents:
diff changeset
2943 int v395; // edi@747
Ritor1
parents:
diff changeset
2944 int v396; // eax@752
Ritor1
parents:
diff changeset
2945 int v397; // eax@757
Ritor1
parents:
diff changeset
2946 int v398; // eax@757
Ritor1
parents:
diff changeset
2947 int v399; // eax@757
Ritor1
parents:
diff changeset
2948 char *v400; // esi@757
Ritor1
parents:
diff changeset
2949 Game *v401; // ecx@759
Ritor1
parents:
diff changeset
2950 __int16 v402; // ST1C_2@759
Ritor1
parents:
diff changeset
2951 __int16 v403; // ST18_2@759
Ritor1
parents:
diff changeset
2952 stru6 *v404; // eax@759
Ritor1
parents:
diff changeset
2953 int v405; // ecx@761
Ritor1
parents:
diff changeset
2954 int v406; // ecx@762
Ritor1
parents:
diff changeset
2955 int v407; // edi@765
Ritor1
parents:
diff changeset
2956 __int16 v408; // ST1C_2@769
Ritor1
parents:
diff changeset
2957 __int16 v409; // ST18_2@769
Ritor1
parents:
diff changeset
2958 stru6 *v410; // eax@769
Ritor1
parents:
diff changeset
2959 int v411; // ecx@772
Ritor1
parents:
diff changeset
2960 int v412; // ecx@773
Ritor1
parents:
diff changeset
2961 int v413; // edi@775
Ritor1
parents:
diff changeset
2962 __int16 v414; // ST1C_2@781
Ritor1
parents:
diff changeset
2963 __int16 v415; // ST18_2@781
Ritor1
parents:
diff changeset
2964 stru6 *v416; // eax@781
Ritor1
parents:
diff changeset
2965 int v417; // eax@787
Ritor1
parents:
diff changeset
2966 int v418; // ecx@789
Ritor1
parents:
diff changeset
2967 __int16 v419; // ax@791
Ritor1
parents:
diff changeset
2968 signed int v420; // eax@793
Ritor1
parents:
diff changeset
2969 int v421; // edx@793
Ritor1
parents:
diff changeset
2970 const char *v422; // eax@801
Ritor1
parents:
diff changeset
2971 int v423; // ecx@808
Ritor1
parents:
diff changeset
2972 int v424; // ecx@809
Ritor1
parents:
diff changeset
2973 int v425; // eax@811
Ritor1
parents:
diff changeset
2974 signed int v426; // eax@815
Ritor1
parents:
diff changeset
2975 signed int v427; // eax@820
Ritor1
parents:
diff changeset
2976 int v428; // ecx@825
Ritor1
parents:
diff changeset
2977 int v429; // ecx@826
Ritor1
parents:
diff changeset
2978 int v430; // eax@828
Ritor1
parents:
diff changeset
2979 stru6 *v431; // eax@831
Ritor1
parents:
diff changeset
2980 int v432; // eax@831
Ritor1
parents:
diff changeset
2981 Actor *v433; // edi@832
Ritor1
parents:
diff changeset
2982 int v434; // eax@833
Ritor1
parents:
diff changeset
2983 int v435; // ecx@837
Ritor1
parents:
diff changeset
2984 int v436; // ecx@838
Ritor1
parents:
diff changeset
2985 __int16 v437; // ST1C_2@843
Ritor1
parents:
diff changeset
2986 __int16 v438; // ST18_2@843
Ritor1
parents:
diff changeset
2987 stru6 *v439; // eax@843
Ritor1
parents:
diff changeset
2988 int v440; // eax@843
Ritor1
parents:
diff changeset
2989 int v441; // eax@847
Ritor1
parents:
diff changeset
2990 int v442; // ecx@850
Ritor1
parents:
diff changeset
2991 int v443; // ecx@851
Ritor1
parents:
diff changeset
2992 int v444; // eax@853
Ritor1
parents:
diff changeset
2993 signed int v445; // edi@857
Ritor1
parents:
diff changeset
2994 int v446; // ecx@862
Ritor1
parents:
diff changeset
2995 LevelDecoration *v447; // edi@864
Ritor1
parents:
diff changeset
2996 __int16 v448; // ax@864
Ritor1
parents:
diff changeset
2997 char *v449; // esi@870
Ritor1
parents:
diff changeset
2998 int v450; // eax@870
Ritor1
parents:
diff changeset
2999 int v451; // ecx@875
Ritor1
parents:
diff changeset
3000 int v452; // ecx@876
Ritor1
parents:
diff changeset
3001 int v453; // edi@878
Ritor1
parents:
diff changeset
3002 __int16 v454; // ST1C_2@884
Ritor1
parents:
diff changeset
3003 __int16 v455; // ST18_2@884
Ritor1
parents:
diff changeset
3004 stru6 *v456; // eax@884
Ritor1
parents:
diff changeset
3005 int v457; // ecx@887
Ritor1
parents:
diff changeset
3006 int v458; // ecx@888
Ritor1
parents:
diff changeset
3007 int v459; // eax@890
Ritor1
parents:
diff changeset
3008 signed int v460; // eax@895
Ritor1
parents:
diff changeset
3009 Actor *v461; // eax@897
Ritor1
parents:
diff changeset
3010 unsigned __int16 v462; // cx@897
Ritor1
parents:
diff changeset
3011 signed int v463; // edx@897
Ritor1
parents:
diff changeset
3012 int v464; // ecx@905
Ritor1
parents:
diff changeset
3013 int v465; // ecx@906
Ritor1
parents:
diff changeset
3014 int v466; // edi@909
Ritor1
parents:
diff changeset
3015 __int16 v467; // ST1C_2@913
Ritor1
parents:
diff changeset
3016 __int16 v468; // ST18_2@913
Ritor1
parents:
diff changeset
3017 stru6 *v469; // eax@913
Ritor1
parents:
diff changeset
3018 int v470; // edi@913
Ritor1
parents:
diff changeset
3019 int v471; // eax@917
Ritor1
parents:
diff changeset
3020 int v472; // eax@917
Ritor1
parents:
diff changeset
3021 char *v473; // esi@918
Ritor1
parents:
diff changeset
3022 __int16 v474; // ST18_2@920
Ritor1
parents:
diff changeset
3023 stru6 *v475; // eax@920
Ritor1
parents:
diff changeset
3024 __int16 v476; // ST18_2@920
Ritor1
parents:
diff changeset
3025 stru6 *v477; // eax@920
Ritor1
parents:
diff changeset
3026 __int16 v478; // ST18_2@920
Ritor1
parents:
diff changeset
3027 stru6 *v479; // eax@920
Ritor1
parents:
diff changeset
3028 __int16 v480; // ST18_2@920
Ritor1
parents:
diff changeset
3029 stru6 *v481; // eax@920
Ritor1
parents:
diff changeset
3030 __int16 v482; // ST18_2@923
Ritor1
parents:
diff changeset
3031 stru6 *v483; // eax@923
Ritor1
parents:
diff changeset
3032 __int16 v484; // ST18_2@923
Ritor1
parents:
diff changeset
3033 stru6 *v485; // eax@923
Ritor1
parents:
diff changeset
3034 __int16 v486; // ST18_2@923
Ritor1
parents:
diff changeset
3035 stru6 *v487; // eax@923
Ritor1
parents:
diff changeset
3036 __int16 v488; // ST18_2@923
Ritor1
parents:
diff changeset
3037 stru6 *v489; // eax@923
Ritor1
parents:
diff changeset
3038 __int16 v490; // ST1C_2@924
Ritor1
parents:
diff changeset
3039 __int16 v491; // ST18_2@924
Ritor1
parents:
diff changeset
3040 stru6 *v492; // eax@924
Ritor1
parents:
diff changeset
3041 int v493; // ecx@925
Ritor1
parents:
diff changeset
3042 int v494; // ecx@926
Ritor1
parents:
diff changeset
3043 __int16 v495; // ST1C_2@931
Ritor1
parents:
diff changeset
3044 __int16 v496; // ST18_2@931
Ritor1
parents:
diff changeset
3045 stru6 *v497; // eax@931
Ritor1
parents:
diff changeset
3046 int v498; // edi@931
Ritor1
parents:
diff changeset
3047 int v499; // eax@935
Ritor1
parents:
diff changeset
3048 int v500; // eax@935
Ritor1
parents:
diff changeset
3049 Player *v501; // edi@939
Ritor1
parents:
diff changeset
3050 __int16 v502; // ST18_2@940
Ritor1
parents:
diff changeset
3051 stru6 *v503; // eax@940
Ritor1
parents:
diff changeset
3052 stru6 *v504; // eax@943
Ritor1
parents:
diff changeset
3053 int v505; // eax@943
Ritor1
parents:
diff changeset
3054 int v506; // eax@943
Ritor1
parents:
diff changeset
3055 int v507; // edi@944
Ritor1
parents:
diff changeset
3056 int v508; // eax@944
Ritor1
parents:
diff changeset
3057 signed int v509; // eax@944
Ritor1
parents:
diff changeset
3058 signed int v510; // edi@944
Ritor1
parents:
diff changeset
3059 Actor *v511; // edi@946
Ritor1
parents:
diff changeset
3060 int v512; // eax@946
Ritor1
parents:
diff changeset
3061 SpellBuff *v513; // edi@946
Ritor1
parents:
diff changeset
3062 int v514; // ecx@950
Ritor1
parents:
diff changeset
3063 int v515; // ecx@951
Ritor1
parents:
diff changeset
3064 int v516; // eax@953
Ritor1
parents:
diff changeset
3065 int v517; // eax@956
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
3066 Actor *v518; // edx@957
0
Ritor1
parents:
diff changeset
3067 __int16 v519; // cx@958
Ritor1
parents:
diff changeset
3068 int v520; // ecx@968
Ritor1
parents:
diff changeset
3069 int v521; // ecx@969
Ritor1
parents:
diff changeset
3070 int v522; // eax@971
Ritor1
parents:
diff changeset
3071 __int16 v523; // ST18_2@975
Ritor1
parents:
diff changeset
3072 stru6 *v524; // eax@975
Ritor1
parents:
diff changeset
3073 __int16 v525; // ST18_2@975
Ritor1
parents:
diff changeset
3074 stru6 *v526; // eax@975
Ritor1
parents:
diff changeset
3075 __int16 v527; // ST18_2@975
Ritor1
parents:
diff changeset
3076 stru6 *v528; // eax@975
Ritor1
parents:
diff changeset
3077 __int16 v529; // ST18_2@975
Ritor1
parents:
diff changeset
3078 stru6 *v530; // eax@975
Ritor1
parents:
diff changeset
3079 int v531; // eax@982
Ritor1
parents:
diff changeset
3080 int v532; // eax@982
Ritor1
parents:
diff changeset
3081 int v533; // edi@983
Ritor1
parents:
diff changeset
3082 int v534; // eax@983
Ritor1
parents:
diff changeset
3083 signed int v535; // eax@983
Ritor1
parents:
diff changeset
3084 signed int v536; // edi@983
Ritor1
parents:
diff changeset
3085 stru6 *v537; // eax@984
Ritor1
parents:
diff changeset
3086 int v538; // ecx@985
Ritor1
parents:
diff changeset
3087 int v539; // ecx@986
Ritor1
parents:
diff changeset
3088 int v540; // eax@988
Ritor1
parents:
diff changeset
3089 __int16 v541; // ST18_2@991
Ritor1
parents:
diff changeset
3090 stru6 *v542; // eax@991
Ritor1
parents:
diff changeset
3091 __int16 v543; // ST18_2@991
Ritor1
parents:
diff changeset
3092 stru6 *v544; // eax@991
Ritor1
parents:
diff changeset
3093 __int16 v545; // ST18_2@991
Ritor1
parents:
diff changeset
3094 stru6 *v546; // eax@991
Ritor1
parents:
diff changeset
3095 __int16 v547; // ST18_2@991
Ritor1
parents:
diff changeset
3096 stru6 *v548; // eax@991
Ritor1
parents:
diff changeset
3097 double v549; // st7@991
Ritor1
parents:
diff changeset
3098 unsigned __int16 v550; // di@991
Ritor1
parents:
diff changeset
3099 int v551; // ecx@993
Ritor1
parents:
diff changeset
3100 int v552; // ecx@994
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
3101 Player *v553; // edi@1001
0
Ritor1
parents:
diff changeset
3102 __int16 v554; // ST18_2@1002
Ritor1
parents:
diff changeset
3103 stru6 *v555; // eax@1002
Ritor1
parents:
diff changeset
3104 __int16 v556; // ST18_2@1002
Ritor1
parents:
diff changeset
3105 stru6 *v557; // eax@1002
Ritor1
parents:
diff changeset
3106 __int16 v558; // ST18_2@1002
Ritor1
parents:
diff changeset
3107 stru6 *v559; // eax@1002
Ritor1
parents:
diff changeset
3108 __int16 v560; // ST18_2@1002
Ritor1
parents:
diff changeset
3109 stru6 *v561; // eax@1002
Ritor1
parents:
diff changeset
3110 unsigned __int16 v562; // di@1005
Ritor1
parents:
diff changeset
3111 signed int v563; // eax@1010
Ritor1
parents:
diff changeset
3112 unsigned int v564; // ecx@1011
Ritor1
parents:
diff changeset
3113 signed int v565; // eax@1012
Ritor1
parents:
diff changeset
3114 Player **v566; // ecx@1012
Ritor1
parents:
diff changeset
3115 int v567; // eax@1012
Ritor1
parents:
diff changeset
3116 unsigned __int16 v568; // ST1C_2@1012
Ritor1
parents:
diff changeset
3117 __int16 v569; // ST18_2@1012
Ritor1
parents:
diff changeset
3118 stru6 *v570; // eax@1012
Ritor1
parents:
diff changeset
3119 Player *v571; // eax@1013
Ritor1
parents:
diff changeset
3120 char *v572; // ecx@1013
Ritor1
parents:
diff changeset
3121 int v573; // ecx@1017
Ritor1
parents:
diff changeset
3122 int v574; // ecx@1018
Ritor1
parents:
diff changeset
3123 int v575; // eax@1020
Ritor1
parents:
diff changeset
3124 signed int v576; // eax@1025
Ritor1
parents:
diff changeset
3125 Player *v577; // eax@1026
Ritor1
parents:
diff changeset
3126 int v578; // eax@1028
Ritor1
parents:
diff changeset
3127 __int16 v579; // ax@1029
Ritor1
parents:
diff changeset
3128 int v580; // eax@1031
Ritor1
parents:
diff changeset
3129 int v581; // edi@1031
Ritor1
parents:
diff changeset
3130 int v582; // eax@1031
Ritor1
parents:
diff changeset
3131 __int16 v583; // ST1C_2@1034
Ritor1
parents:
diff changeset
3132 __int16 v584; // ST18_2@1034
Ritor1
parents:
diff changeset
3133 char *v585; // esi@1034
Ritor1
parents:
diff changeset
3134 stru6 *v586; // eax@1034
Ritor1
parents:
diff changeset
3135 signed int v587; // eax@1035
Ritor1
parents:
diff changeset
3136 int v588; // ecx@1036
Ritor1
parents:
diff changeset
3137 int v589; // ecx@1037
Ritor1
parents:
diff changeset
3138 int v590; // ecx@1038
Ritor1
parents:
diff changeset
3139 char v591; // al@1048
Ritor1
parents:
diff changeset
3140 int v592; // esi@1052
Ritor1
parents:
diff changeset
3141 int v593; // ecx@1057
Ritor1
parents:
diff changeset
3142 int v594; // ecx@1058
Ritor1
parents:
diff changeset
3143 int v595; // eax@1064
Ritor1
parents:
diff changeset
3144 int v596; // esi@1066
Ritor1
parents:
diff changeset
3145 unsigned int v597; // edi@1067
Ritor1
parents:
diff changeset
3146 int v598; // eax@1079
Ritor1
parents:
diff changeset
3147 signed int v599; // eax@1082
Ritor1
parents:
diff changeset
3148 int v600; // edi@1086
Ritor1
parents:
diff changeset
3149 int v601; // edx@1086
Ritor1
parents:
diff changeset
3150 int v602; // eax@1086
Ritor1
parents:
diff changeset
3151 int v603; // ecx@1086
Ritor1
parents:
diff changeset
3152 int v604; // eax@1087
Ritor1
parents:
diff changeset
3153 char *v605; // eax@1089
Ritor1
parents:
diff changeset
3154 int v606; // edx@1091
Ritor1
parents:
diff changeset
3155 int v607; // ecx@1100
Ritor1
parents:
diff changeset
3156 __int16 v608; // ax@1102
Ritor1
parents:
diff changeset
3157 signed int v609; // eax@1104
Ritor1
parents:
diff changeset
3158 int v610; // edi@1106
Ritor1
parents:
diff changeset
3159 unsigned int v611; // eax@1106
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
3160 Player *v612; // edi@1106
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
3161 DDM_DLV_Header *v613; // eax@1108
0
Ritor1
parents:
diff changeset
3162 int v614; // eax@1116
Ritor1
parents:
diff changeset
3163 int v615; // edi@1119
Ritor1
parents:
diff changeset
3164 __int16 v616; // ST1C_2@1122
Ritor1
parents:
diff changeset
3165 __int16 v617; // ST18_2@1122
Ritor1
parents:
diff changeset
3166 stru6 *v618; // eax@1122
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3167 Player *v619; // edi@1123
0
Ritor1
parents:
diff changeset
3168 unsigned __int16 v620; // ST1C_2@1124
Ritor1
parents:
diff changeset
3169 __int16 v621; // ST18_2@1124
Ritor1
parents:
diff changeset
3170 stru6 *v622; // eax@1124
Ritor1
parents:
diff changeset
3171 signed __int64 v623; // qax@1127
Ritor1
parents:
diff changeset
3172 int v624; // eax@1127
Ritor1
parents:
diff changeset
3173 int v625; // edi@1129
Ritor1
parents:
diff changeset
3174 int v626; // eax@1129
Ritor1
parents:
diff changeset
3175 signed int v627; // eax@1129
Ritor1
parents:
diff changeset
3176 signed int v628; // edi@1129
Ritor1
parents:
diff changeset
3177 int v629; // ecx@1130
Ritor1
parents:
diff changeset
3178 Player *v630; // eax@1131
Ritor1
parents:
diff changeset
3179 int v631; // eax@1137
Ritor1
parents:
diff changeset
3180 int v632; // edi@1140
Ritor1
parents:
diff changeset
3181 Player *v633; // eax@1140
Ritor1
parents:
diff changeset
3182 signed int v634; // eax@1140
Ritor1
parents:
diff changeset
3183 int v635; // edi@1142
Ritor1
parents:
diff changeset
3184 unsigned __int16 v636; // ST1C_2@1142
Ritor1
parents:
diff changeset
3185 __int16 v637; // ST18_2@1142
Ritor1
parents:
diff changeset
3186 stru6 *v638; // eax@1142
Ritor1
parents:
diff changeset
3187 stru6 *v639; // eax@1143
Ritor1
parents:
diff changeset
3188 int v640; // ecx@1146
Ritor1
parents:
diff changeset
3189 int v641; // ecx@1147
Ritor1
parents:
diff changeset
3190 int v642; // edi@1156
Ritor1
parents:
diff changeset
3191 int v643; // eax@1156
Ritor1
parents:
diff changeset
3192 int v644; // eax@1156
Ritor1
parents:
diff changeset
3193 signed int v645; // eax@1158
Ritor1
parents:
diff changeset
3194 Player *v646; // ebx@1169
Ritor1
parents:
diff changeset
3195 int v647; // edi@1169
Ritor1
parents:
diff changeset
3196 signed int v648; // ST1C_4@1170
Ritor1
parents:
diff changeset
3197 Player *v649; // ecx@1170
Ritor1
parents:
diff changeset
3198 unsigned __int64 v650; // [sp-10h] [bp-E94h]@103
Ritor1
parents:
diff changeset
3199 unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100
Ritor1
parents:
diff changeset
3200 unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304
Ritor1
parents:
diff changeset
3201 unsigned __int16 v653; // [sp-4h] [bp-E88h]@100
Ritor1
parents:
diff changeset
3202 int v654; // [sp-4h] [bp-E88h]@124
Ritor1
parents:
diff changeset
3203 unsigned __int16 v655; // [sp-4h] [bp-E88h]@304
Ritor1
parents:
diff changeset
3204 unsigned int v656; // [sp-4h] [bp-E88h]@639
Ritor1
parents:
diff changeset
3205 int v657; // [sp-4h] [bp-E88h]@807
Ritor1
parents:
diff changeset
3206 int v658; // [sp+0h] [bp-E84h]@100
Ritor1
parents:
diff changeset
3207 int v659; // [sp+0h] [bp-E84h]@123
Ritor1
parents:
diff changeset
3208 int v660; // [sp+0h] [bp-E84h]@146
Ritor1
parents:
diff changeset
3209 Actor *v661; // [sp+0h] [bp-E84h]@164
Ritor1
parents:
diff changeset
3210 int v662; // [sp+0h] [bp-E84h]@304
Ritor1
parents:
diff changeset
3211 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639
Ritor1
parents:
diff changeset
3212 const char *v664; // [sp+0h] [bp-E84h]@802
Ritor1
parents:
diff changeset
3213 int v665; // [sp+0h] [bp-E84h]@807
Ritor1
parents:
diff changeset
3214 int v666; // [sp+4h] [bp-E80h]@12
Ritor1
parents:
diff changeset
3215 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25
Ritor1
parents:
diff changeset
3216 unsigned __int8 v668; // [sp+4h] [bp-E80h]@100
Ritor1
parents:
diff changeset
3217 int v669; // [sp+4h] [bp-E80h]@123
Ritor1
parents:
diff changeset
3218 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133
Ritor1
parents:
diff changeset
3219 int v671; // [sp+4h] [bp-E80h]@146
Ritor1
parents:
diff changeset
3220 unsigned int v672; // [sp+4h] [bp-E80h]@164
Ritor1
parents:
diff changeset
3221 unsigned __int8 v673; // [sp+4h] [bp-E80h]@304
Ritor1
parents:
diff changeset
3222 __int16 v674; // [sp+4h] [bp-E80h]@684
Ritor1
parents:
diff changeset
3223 const char *v675; // [sp+4h] [bp-E80h]@800
Ritor1
parents:
diff changeset
3224 int v676; // [sp+4h] [bp-E80h]@807
Ritor1
parents:
diff changeset
3225 int v677; // [sp+4h] [bp-E80h]@861
Ritor1
parents:
diff changeset
3226 int v678; // [sp+4h] [bp-E80h]@997
Ritor1
parents:
diff changeset
3227 int v679; // [sp+14h] [bp-E70h]@515
Ritor1
parents:
diff changeset
3228 AIDirection a3; // [sp+C94h] [bp-1F0h]@21
Ritor1
parents:
diff changeset
3229 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137
Ritor1
parents:
diff changeset
3230 int v682[4]; // [sp+CC0h] [bp-1C4h]@731
Ritor1
parents:
diff changeset
3231 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791
Ritor1
parents:
diff changeset
3232 int v684; // [sp+D04h] [bp-180h]@416
Ritor1
parents:
diff changeset
3233 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416
Ritor1
parents:
diff changeset
3234 int x; // [sp+D20h] [bp-164h]@327
Ritor1
parents:
diff changeset
3235 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327
Ritor1
parents:
diff changeset
3236 int v688; // [sp+D2Ch] [bp-158h]@943
Ritor1
parents:
diff changeset
3237 int v689; // [sp+D30h] [bp-154h]@943
Ritor1
parents:
diff changeset
3238 int v690; // [sp+D34h] [bp-150h]@943
Ritor1
parents:
diff changeset
3239 int v691; // [sp+D38h] [bp-14Ch]@137
Ritor1
parents:
diff changeset
3240 int v692; // [sp+D3Ch] [bp-148h]@137
Ritor1
parents:
diff changeset
3241 int v693; // [sp+D40h] [bp-144h]@137
Ritor1
parents:
diff changeset
3242 int v694; // [sp+D44h] [bp-140h]@982
Ritor1
parents:
diff changeset
3243 int v695; // [sp+D48h] [bp-13Ch]@982
Ritor1
parents:
diff changeset
3244 int v696; // [sp+D4Ch] [bp-138h]@982
Ritor1
parents:
diff changeset
3245 int v697; // [sp+D50h] [bp-134h]@129
Ritor1
parents:
diff changeset
3246 int v698; // [sp+D54h] [bp-130h]@129
Ritor1
parents:
diff changeset
3247 int v699; // [sp+D58h] [bp-12Ch]@129
Ritor1
parents:
diff changeset
3248 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339
Ritor1
parents:
diff changeset
3249 int v701; // [sp+D68h] [bp-11Ch]@286
Ritor1
parents:
diff changeset
3250 int v702; // [sp+D6Ch] [bp-118h]@286
Ritor1
parents:
diff changeset
3251 int v703; // [sp+D70h] [bp-114h]@286
Ritor1
parents:
diff changeset
3252 int v704; // [sp+D74h] [bp-110h]@132
Ritor1
parents:
diff changeset
3253 int v705; // [sp+D78h] [bp-10Ch]@132
Ritor1
parents:
diff changeset
3254 int v706; // [sp+D7Ch] [bp-108h]@132
Ritor1
parents:
diff changeset
3255 int v707; // [sp+D80h] [bp-104h]@1127
Ritor1
parents:
diff changeset
3256 int v708; // [sp+D84h] [bp-100h]@1127
Ritor1
parents:
diff changeset
3257 int v709; // [sp+D88h] [bp-FCh]@1127
Ritor1
parents:
diff changeset
3258 char v710; // [sp+D8Ch] [bp-F8h]@1156
Ritor1
parents:
diff changeset
3259 stru277 *v711; // [sp+D90h] [bp-F4h]@1
Ritor1
parents:
diff changeset
3260 __int64 v712; // [sp+D94h] [bp-F0h]@991
Ritor1
parents:
diff changeset
3261 int v713; // [sp+D9Ch] [bp-E8h]@324
Ritor1
parents:
diff changeset
3262 int n; // [sp+DA0h] [bp-E4h]@1
Ritor1
parents:
diff changeset
3263 AIDirection v715; // [sp+DA4h] [bp-E0h]@21
Ritor1
parents:
diff changeset
3264 int v716; // [sp+DC0h] [bp-C4h]@272
Ritor1
parents:
diff changeset
3265 __int64 v717; // [sp+DC4h] [bp-C0h]@271
Ritor1
parents:
diff changeset
3266 float v718; // [sp+DCCh] [bp-B8h]@176
Ritor1
parents:
diff changeset
3267 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53
Ritor1
parents:
diff changeset
3268 char *y; // [sp+DD4h] [bp-B0h]@325
Ritor1
parents:
diff changeset
3269 int v721; // [sp+DD8h] [bp-ACh]@163
Ritor1
parents:
diff changeset
3270 //LayingItem a1; // [sp+DDCh] [bp-A8h]@1
Ritor1
parents:
diff changeset
3271 int v723; // [sp+E4Ch] [bp-38h]@1
Ritor1
parents:
diff changeset
3272 ItemGen *_this; // [sp+E50h] [bp-34h]@23
Ritor1
parents:
diff changeset
3273 float v725; // [sp+E54h] [bp-30h]@23
Ritor1
parents:
diff changeset
3274 Player *v726; // [sp+E58h] [bp-2Ch]@131
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
3275 int v726b;
0
Ritor1
parents:
diff changeset
3276 float v727; // [sp+E5Ch] [bp-28h]@1
Ritor1
parents:
diff changeset
3277 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53
Ritor1
parents:
diff changeset
3278 Player *pPlayer; // [sp+E64h] [bp-20h]@8
Ritor1
parents:
diff changeset
3279 int v730; // [sp+E68h] [bp-1Ch]@53
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
3280 Player *v730b;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
3281 ItemGen *v730c;
0
Ritor1
parents:
diff changeset
3282 int v731; // [sp+E6Ch] [bp-18h]@48
Ritor1
parents:
diff changeset
3283 signed int v732; // [sp+E70h] [bp-14h]@325
Ritor1
parents:
diff changeset
3284 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1
Ritor1
parents:
diff changeset
3285 signed int a2; // [sp+E7Ch] [bp-8h]@14
Ritor1
parents:
diff changeset
3286 int amount; // [sp+E80h] [bp-4h]@1
Ritor1
parents:
diff changeset
3287
Ritor1
parents:
diff changeset
3288 auto ecx0 = this;
Ritor1
parents:
diff changeset
3289
Ritor1
parents:
diff changeset
3290 v711 = ecx0;
Ritor1
parents:
diff changeset
3291
Ritor1
parents:
diff changeset
3292 LayingItem a1; // [sp+DDCh] [bp-A8h]@1
Ritor1
parents:
diff changeset
3293 //LayingItem::LayingItem(&a1);
Ritor1
parents:
diff changeset
3294
Ritor1
parents:
diff changeset
3295 v1 = 0;
Ritor1
parents:
diff changeset
3296 v2 = 0;
Ritor1
parents:
diff changeset
3297 amount = 0;
Ritor1
parents:
diff changeset
3298 LODWORD(v733) = 0;
Ritor1
parents:
diff changeset
3299 v723 = 0;
Ritor1
parents:
diff changeset
3300 v727 = 0.0;
Ritor1
parents:
diff changeset
3301 n = 0;
Ritor1
parents:
diff changeset
3302 while ( 1 )
Ritor1
parents:
diff changeset
3303 {
Ritor1
parents:
diff changeset
3304 v3 = &v711[n];
Ritor1
parents:
diff changeset
3305 HIDWORD(v733) = (int)v3;
Ritor1
parents:
diff changeset
3306 if ( v3->spellnum == (short)v1 )
Ritor1
parents:
diff changeset
3307 goto LABEL_1166;
Ritor1
parents:
diff changeset
3308 if ( pParty->pPartyBuffs[11].NotExpired() )
Ritor1
parents:
diff changeset
3309 pParty->pPartyBuffs[11].Reset();
Ritor1
parents:
diff changeset
3310 if ( v3->field_8 & 0x3CA )
Ritor1
parents:
diff changeset
3311 {
Ritor1
parents:
diff changeset
3312 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() )
Ritor1
parents:
diff changeset
3313 v711->_427D48(1u);
Ritor1
parents:
diff changeset
3314 goto LABEL_1166;
Ritor1
parents:
diff changeset
3315 }
Ritor1
parents:
diff changeset
3316 pPlayer = &pParty->pPlayers[v3->uPlayerID];
Ritor1
parents:
diff changeset
3317 v4 = *(int *)&v3->field_C;
Ritor1
parents:
diff changeset
3318 if ( v4 != v1 )
Ritor1
parents:
diff changeset
3319 goto LABEL_18;
Ritor1
parents:
diff changeset
3320 v5 = v3->spellnum;
Ritor1
parents:
diff changeset
3321 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 )
Ritor1
parents:
diff changeset
3322 v666 = 1;
Ritor1
parents:
diff changeset
3323 else
Ritor1
parents:
diff changeset
3324 v666 = v1;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
3325 a2 = stru_50C198.FindClosestActor(5120, 1, v666);
0
Ritor1
parents:
diff changeset
3326 v6 = pMouse->uPointingObjectID;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
3327 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() )
0
Ritor1
parents:
diff changeset
3328 {
Ritor1
parents:
diff changeset
3329 v4 = pMouse->uPointingObjectID;
Ritor1
parents:
diff changeset
3330 LABEL_18:
Ritor1
parents:
diff changeset
3331 a2 = v4;
Ritor1
parents:
diff changeset
3332 }
Ritor1
parents:
diff changeset
3333 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType;
Ritor1
parents:
diff changeset
3334 if ( (short)a1.uItemType != (short)v1 )
Ritor1
parents:
diff changeset
3335 {
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
3336 if ( (a2 & 7) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
3337 {
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
3338 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715));
0
Ritor1
parents:
diff changeset
3339 v2 = v723;
Ritor1
parents:
diff changeset
3340 v1 = 0;
Ritor1
parents:
diff changeset
3341 }
Ritor1
parents:
diff changeset
3342 else
Ritor1
parents:
diff changeset
3343 {
Ritor1
parents:
diff changeset
3344 v715.uYawAngle = pParty->sRotationY;
Ritor1
parents:
diff changeset
3345 v715.uPitchAngle = pParty->sRotationX;
Ritor1
parents:
diff changeset
3346 }
Ritor1
parents:
diff changeset
3347 }
Ritor1
parents:
diff changeset
3348 v7 = v3->field_A;
Ritor1
parents:
diff changeset
3349 LODWORD(v725) = v1;
Ritor1
parents:
diff changeset
3350 _this = (ItemGen *)v1;
Ritor1
parents:
diff changeset
3351 if ( v7 == (short)v1 )
Ritor1
parents:
diff changeset
3352 {
Ritor1
parents:
diff changeset
3353 v8 = v3->spellnum;
Ritor1
parents:
diff changeset
3354 if ( v3->spellnum >= 12 )
Ritor1
parents:
diff changeset
3355 {
Ritor1
parents:
diff changeset
3356 if ( v8 >= 23 )
Ritor1
parents:
diff changeset
3357 {
Ritor1
parents:
diff changeset
3358 if ( v8 >= 34 )
Ritor1
parents:
diff changeset
3359 {
Ritor1
parents:
diff changeset
3360 if ( v8 >= 45 )
Ritor1
parents:
diff changeset
3361 {
Ritor1
parents:
diff changeset
3362 if ( v8 >= 56 )
Ritor1
parents:
diff changeset
3363 {
Ritor1
parents:
diff changeset
3364 if ( v8 >= 67 )
Ritor1
parents:
diff changeset
3365 {
Ritor1
parents:
diff changeset
3366 if ( v8 >= 78 )
Ritor1
parents:
diff changeset
3367 {
Ritor1
parents:
diff changeset
3368 if ( v8 >= 89 )
Ritor1
parents:
diff changeset
3369 {
Ritor1
parents:
diff changeset
3370 if ( v8 >= 100 )
Ritor1
parents:
diff changeset
3371 {
Ritor1
parents:
diff changeset
3372 if ( v8 != 100 )
Ritor1
parents:
diff changeset
3373 {
Ritor1
parents:
diff changeset
3374 LABEL_45:
Ritor1
parents:
diff changeset
3375 HIWORD(v10) = HIWORD(pPlayer);
Ritor1
parents:
diff changeset
3376 v11 = pPlayer->pActiveSkills[LODWORD(v725)];
Ritor1
parents:
diff changeset
3377 goto LABEL_47;
Ritor1
parents:
diff changeset
3378 }
Ritor1
parents:
diff changeset
3379 v667 = (PLAYER_SKILL_TYPE)5;
Ritor1
parents:
diff changeset
3380 }
Ritor1
parents:
diff changeset
3381 else
Ritor1
parents:
diff changeset
3382 {
Ritor1
parents:
diff changeset
3383 v667 = (PLAYER_SKILL_TYPE)20;
Ritor1
parents:
diff changeset
3384 }
Ritor1
parents:
diff changeset
3385 }
Ritor1
parents:
diff changeset
3386 else
Ritor1
parents:
diff changeset
3387 {
Ritor1
parents:
diff changeset
3388 v667 = (PLAYER_SKILL_TYPE)19;
Ritor1
parents:
diff changeset
3389 }
Ritor1
parents:
diff changeset
3390 }
Ritor1
parents:
diff changeset
3391 else
Ritor1
parents:
diff changeset
3392 {
Ritor1
parents:
diff changeset
3393 v667 = (PLAYER_SKILL_TYPE)18;
Ritor1
parents:
diff changeset
3394 }
Ritor1
parents:
diff changeset
3395 }
Ritor1
parents:
diff changeset
3396 else
Ritor1
parents:
diff changeset
3397 {
Ritor1
parents:
diff changeset
3398 v667 = (PLAYER_SKILL_TYPE)17;
Ritor1
parents:
diff changeset
3399 }
Ritor1
parents:
diff changeset
3400 }
Ritor1
parents:
diff changeset
3401 else
Ritor1
parents:
diff changeset
3402 {
Ritor1
parents:
diff changeset
3403 v667 = (PLAYER_SKILL_TYPE)16;
Ritor1
parents:
diff changeset
3404 }
Ritor1
parents:
diff changeset
3405 }
Ritor1
parents:
diff changeset
3406 else
Ritor1
parents:
diff changeset
3407 {
Ritor1
parents:
diff changeset
3408 v667 = (PLAYER_SKILL_TYPE)15;
Ritor1
parents:
diff changeset
3409 }
Ritor1
parents:
diff changeset
3410 }
Ritor1
parents:
diff changeset
3411 else
Ritor1
parents:
diff changeset
3412 {
Ritor1
parents:
diff changeset
3413 v667 = (PLAYER_SKILL_TYPE)14;
Ritor1
parents:
diff changeset
3414 }
Ritor1
parents:
diff changeset
3415 }
Ritor1
parents:
diff changeset
3416 else
Ritor1
parents:
diff changeset
3417 {
Ritor1
parents:
diff changeset
3418 v667 = (PLAYER_SKILL_TYPE)13;
Ritor1
parents:
diff changeset
3419 }
Ritor1
parents:
diff changeset
3420 }
Ritor1
parents:
diff changeset
3421 else
Ritor1
parents:
diff changeset
3422 {
Ritor1
parents:
diff changeset
3423 v667 = (PLAYER_SKILL_TYPE)12;
Ritor1
parents:
diff changeset
3424 }
Ritor1
parents:
diff changeset
3425 LODWORD(v725) = v667;
Ritor1
parents:
diff changeset
3426 v9 = pPlayer->GetActualSkillLevel(v667);
Ritor1
parents:
diff changeset
3427 v723 = v9 & 0x3F;
Ritor1
parents:
diff changeset
3428 v2 = v9 & 0x3F;
Ritor1
parents:
diff changeset
3429 goto LABEL_45;
Ritor1
parents:
diff changeset
3430 }
Ritor1
parents:
diff changeset
3431 v11 = v7;
Ritor1
parents:
diff changeset
3432 v10 = v7 & 0x3F;
Ritor1
parents:
diff changeset
3433 v723 = v10;
Ritor1
parents:
diff changeset
3434 v2 = v10;
Ritor1
parents:
diff changeset
3435 LABEL_47:
Ritor1
parents:
diff changeset
3436 if ( HIBYTE(v11) & 1 )
Ritor1
parents:
diff changeset
3437 {
Ritor1
parents:
diff changeset
3438 v12 = 4;
Ritor1
parents:
diff changeset
3439 v731 = 4;
Ritor1
parents:
diff changeset
3440 }
Ritor1
parents:
diff changeset
3441 else
Ritor1
parents:
diff changeset
3442 {
Ritor1
parents:
diff changeset
3443 if ( (v11 & 0x80u) == 0 )
Ritor1
parents:
diff changeset
3444 {
Ritor1
parents:
diff changeset
3445 v10 = ((v11 & 0x40) != 0) + 1;
Ritor1
parents:
diff changeset
3446 v731 = ((v11 & 0x40) != 0) + 1;
Ritor1
parents:
diff changeset
3447 }
Ritor1
parents:
diff changeset
3448 else
Ritor1
parents:
diff changeset
3449 {
Ritor1
parents:
diff changeset
3450 v731 = 3;
Ritor1
parents:
diff changeset
3451 }
Ritor1
parents:
diff changeset
3452 v12 = v731;
Ritor1
parents:
diff changeset
3453 }
Ritor1
parents:
diff changeset
3454 LOWORD(v10) = v3->spellnum;
Ritor1
parents:
diff changeset
3455 v730 = v10;
Ritor1
parents:
diff changeset
3456 v13 = v12 + 10 * (signed __int16)v10;
Ritor1
parents:
diff changeset
3457 v14 = v3->field_A == (short)v1;
Ritor1
parents:
diff changeset
3458 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing
Ritor1
parents:
diff changeset
3459 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2);
Ritor1
parents:
diff changeset
3460 uRequiredMana = v15;
Ritor1
parents:
diff changeset
3461 sRecoveryTime = v16;
Ritor1
parents:
diff changeset
3462 if ( !v14 )
Ritor1
parents:
diff changeset
3463 uRequiredMana = v1;
Ritor1
parents:
diff changeset
3464 if ( pParty->uCurrentHour == v1 )
Ritor1
parents:
diff changeset
3465 {
Ritor1
parents:
diff changeset
3466 if ( pParty->uCurrentMinute != v1 )
Ritor1
parents:
diff changeset
3467 goto LABEL_62;
Ritor1
parents:
diff changeset
3468 if ( LODWORD(v725) == 20 )
Ritor1
parents:
diff changeset
3469 goto LABEL_61;
Ritor1
parents:
diff changeset
3470 }
Ritor1
parents:
diff changeset
3471 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == v1 && LODWORD(v725) == 19 )
Ritor1
parents:
diff changeset
3472 LABEL_61:
Ritor1
parents:
diff changeset
3473 uRequiredMana = v1;
Ritor1
parents:
diff changeset
3474 LABEL_62:
Ritor1
parents:
diff changeset
3475 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 )
Ritor1
parents:
diff changeset
3476 break;
Ritor1
parents:
diff changeset
3477 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u);
Ritor1
parents:
diff changeset
3478 LABEL_203:
Ritor1
parents:
diff changeset
3479 v3->spellnum = v1;
Ritor1
parents:
diff changeset
3480 LABEL_1166:
Ritor1
parents:
diff changeset
3481 ++n;
Ritor1
parents:
diff changeset
3482 if ( n >= 10 )
Ritor1
parents:
diff changeset
3483 return;
Ritor1
parents:
diff changeset
3484 }
Ritor1
parents:
diff changeset
3485 if ( !pPlayer->pConditions[0] || (signed __int16)v730 >= 100 )
Ritor1
parents:
diff changeset
3486 goto LABEL_69;
Ritor1
parents:
diff changeset
3487 if ( rand() % 100 >= 50 )
Ritor1
parents:
diff changeset
3488 {
Ritor1
parents:
diff changeset
3489 v12 = v731;
Ritor1
parents:
diff changeset
3490 LABEL_69:
Ritor1
parents:
diff changeset
3491 switch ( v3->spellnum )
Ritor1
parents:
diff changeset
3492 {
Ritor1
parents:
diff changeset
3493 case 100:
Ritor1
parents:
diff changeset
3494 case 101:
Ritor1
parents:
diff changeset
3495 v17 = pPlayer;
Ritor1
parents:
diff changeset
3496 _this = (ItemGen *)1;
Ritor1
parents:
diff changeset
3497 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[5]) >= 3 )
Ritor1
parents:
diff changeset
3498 _this = (ItemGen *)2;
Ritor1
parents:
diff changeset
3499 sRecoveryTime = v17->GetAttackRecoveryTime(1);
Ritor1
parents:
diff changeset
3500 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3501 v18 = v3->spellnum;
Ritor1
parents:
diff changeset
3502 a1.field_4C = v2;
Ritor1
parents:
diff changeset
3503 a1.field_48 = v18;
Ritor1
parents:
diff changeset
3504 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3505 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
3506 if ( v17->WearsItem(510, 2) )
Ritor1
parents:
diff changeset
3507 a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u);
Ritor1
parents:
diff changeset
3508 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
3509 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
3510 a1.uAttributes = 0;
Ritor1
parents:
diff changeset
3511 a1.uSpriteFrameID = 0;
Ritor1
parents:
diff changeset
3512 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
3513 v19 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3514 LOBYTE(v19) = v19 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3515 a1.field_58_pid = v19;
0
Ritor1
parents:
diff changeset
3516 a1.field_5C = a2;
Ritor1
parents:
diff changeset
3517 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
3518 a1.uFacing = LOWORD(v715.uYawAngle);
Ritor1
parents:
diff changeset
3519 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
3520 v20 = (char *)&pParty->pPlayers[v3->uPlayerID];
Ritor1
parents:
diff changeset
3521 memcpy(&a1.stru_24, &v20[36 * *((int *)v20 + 1620) + 496], sizeof(a1.stru_24));
Ritor1
parents:
diff changeset
3522 a1.uAttributes = 256;
Ritor1
parents:
diff changeset
3523 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
3524 a1.uAttributes = 260;
Ritor1
parents:
diff changeset
3525 for ( i = 0; i < (signed int)this; ++i )
Ritor1
parents:
diff changeset
3526 {
Ritor1
parents:
diff changeset
3527 if ( i )
Ritor1
parents:
diff changeset
3528 a1.vPosition.z += 32;
Ritor1
parents:
diff changeset
3529 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z);
Ritor1
parents:
diff changeset
3530 if ( a1.Create(
Ritor1
parents:
diff changeset
3531 v715.uYawAngle,
Ritor1
parents:
diff changeset
3532 v715.uPitchAngle,
Ritor1
parents:
diff changeset
3533 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
Ritor1
parents:
diff changeset
3534 v3->uPlayerID + 1) != -1
Ritor1
parents:
diff changeset
3535 && pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
3536 ++pTurnEngine->field_1C;
Ritor1
parents:
diff changeset
3537 }
Ritor1
parents:
diff changeset
3538 goto LABEL_83;
Ritor1
parents:
diff changeset
3539 case 102:
Ritor1
parents:
diff changeset
3540 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0);
Ritor1
parents:
diff changeset
3541 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3542 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
3543 a1.field_4C = v723;
Ritor1
parents:
diff changeset
3544 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3545 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
3546 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
3547 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
3548 a1.uAttributes = 0;
Ritor1
parents:
diff changeset
3549 a1.uSpriteFrameID = 0;
Ritor1
parents:
diff changeset
3550 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
Ritor1
parents:
diff changeset
3551 v22 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3552 LOBYTE(v22) = v22 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3553 a1.field_58_pid = v22;
0
Ritor1
parents:
diff changeset
3554 a1.field_5C = a2;
Ritor1
parents:
diff changeset
3555 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
3556 a1.uFacing = LOWORD(v715.uYawAngle);
Ritor1
parents:
diff changeset
3557 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
3558 memcpy(
Ritor1
parents:
diff changeset
3559 &a1.stru_24,
Ritor1
parents:
diff changeset
3560 &pParty->pPlayers[v3->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36
Ritor1
parents:
diff changeset
3561 * pParty->pPlayers[v3->uPlayerID].pEquipment.uMainHand
Ritor1
parents:
diff changeset
3562 + 5],
Ritor1
parents:
diff changeset
3563 sizeof(a1.stru_24));
Ritor1
parents:
diff changeset
3564 v23 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, a1.vPosition.z);
Ritor1
parents:
diff changeset
3565 HIBYTE(a1.uAttributes) |= 1u;
Ritor1
parents:
diff changeset
3566 a1.uSectorID = v23;
Ritor1
parents:
diff changeset
3567 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
3568 LOBYTE(a1.uAttributes) |= 4u;
Ritor1
parents:
diff changeset
3569 if ( a1.Create(
Ritor1
parents:
diff changeset
3570 v715.uYawAngle,
Ritor1
parents:
diff changeset
3571 v715.uPitchAngle,
Ritor1
parents:
diff changeset
3572 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
Ritor1
parents:
diff changeset
3573 v3->uPlayerID + 1) != -1
Ritor1
parents:
diff changeset
3574 && pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
3575 ++pTurnEngine->field_1C;
Ritor1
parents:
diff changeset
3576 goto LABEL_83;
Ritor1
parents:
diff changeset
3577 case 1:
Ritor1
parents:
diff changeset
3578 LODWORD(v733) = 3600 * v2;
Ritor1
parents:
diff changeset
3579 v24 = v12 - 2;
Ritor1
parents:
diff changeset
3580 if ( v24 )
Ritor1
parents:
diff changeset
3581 {
Ritor1
parents:
diff changeset
3582 v25 = v24 - 1;
Ritor1
parents:
diff changeset
3583 if ( v25 && v25 != 1 )
Ritor1
parents:
diff changeset
3584 amount = 2;
Ritor1
parents:
diff changeset
3585 else
Ritor1
parents:
diff changeset
3586 amount = 4;
Ritor1
parents:
diff changeset
3587 }
Ritor1
parents:
diff changeset
3588 else
Ritor1
parents:
diff changeset
3589 {
Ritor1
parents:
diff changeset
3590 amount = 3;
Ritor1
parents:
diff changeset
3591 }
Ritor1
parents:
diff changeset
3592 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3593 goto LABEL_83;
Ritor1
parents:
diff changeset
3594 v668 = v1;
Ritor1
parents:
diff changeset
3595 v658 = v1;
Ritor1
parents:
diff changeset
3596 v653 = amount;
Ritor1
parents:
diff changeset
3597 v651 = v731;
Ritor1
parents:
diff changeset
3598 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669);
Ritor1
parents:
diff changeset
3599 v27 = (char *)&pParty->pPartyBuffs[16];
Ritor1
parents:
diff changeset
3600 goto LABEL_101;
Ritor1
parents:
diff changeset
3601 case 7:
Ritor1
parents:
diff changeset
3602 v29 = v12 - 2;
Ritor1
parents:
diff changeset
3603 if ( v29 )
Ritor1
parents:
diff changeset
3604 {
Ritor1
parents:
diff changeset
3605 v30 = v29 - 1;
Ritor1
parents:
diff changeset
3606 if ( v30 )
Ritor1
parents:
diff changeset
3607 {
Ritor1
parents:
diff changeset
3608 if ( v30 == 1 )
Ritor1
parents:
diff changeset
3609 amount = 9;
Ritor1
parents:
diff changeset
3610 else
Ritor1
parents:
diff changeset
3611 amount = 3;
Ritor1
parents:
diff changeset
3612 }
Ritor1
parents:
diff changeset
3613 else
Ritor1
parents:
diff changeset
3614 {
Ritor1
parents:
diff changeset
3615 amount = 7;
Ritor1
parents:
diff changeset
3616 }
Ritor1
parents:
diff changeset
3617 }
Ritor1
parents:
diff changeset
3618 else
Ritor1
parents:
diff changeset
3619 {
Ritor1
parents:
diff changeset
3620 amount = 5;
Ritor1
parents:
diff changeset
3621 }
Ritor1
parents:
diff changeset
3622 v31 = v3->uPlayerID;
Ritor1
parents:
diff changeset
3623 HIDWORD(v733) = v1;
Ritor1
parents:
diff changeset
3624 v32 = 8 * v31;
Ritor1
parents:
diff changeset
3625 LOBYTE(v32) = v32 | 4;
Ritor1
parents:
diff changeset
3626 if ( (signed int)uNumLayingItems > v1 )
Ritor1
parents:
diff changeset
3627 {
Ritor1
parents:
diff changeset
3628 v33 = (char *)&pLayingItems[0].field_48;
Ritor1
parents:
diff changeset
3629 v730 = uNumLayingItems;
Ritor1
parents:
diff changeset
3630 do
Ritor1
parents:
diff changeset
3631 {
Ritor1
parents:
diff changeset
3632 if ( *((short *)v33 - 36) != (short)v1 && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 )
Ritor1
parents:
diff changeset
3633 ++HIDWORD(v733);
Ritor1
parents:
diff changeset
3634 v33 += 112;
Ritor1
parents:
diff changeset
3635 --v730;
Ritor1
parents:
diff changeset
3636 }
Ritor1
parents:
diff changeset
3637 while ( v730 );
Ritor1
parents:
diff changeset
3638 }
Ritor1
parents:
diff changeset
3639 if ( SHIDWORD(v733) > amount )
Ritor1
parents:
diff changeset
3640 goto LABEL_200;
Ritor1
parents:
diff changeset
3641 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3642 goto LABEL_83;
Ritor1
parents:
diff changeset
3643 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3644 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
3645 a1.field_4C = v2;
Ritor1
parents:
diff changeset
3646 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3647 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
3648 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
3649 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
3650 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
3651 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
3652 a1.uSectorID = pIndoor->GetSector(
Ritor1
parents:
diff changeset
3653 pParty->vPosition.x,
Ritor1
parents:
diff changeset
3654 pParty->vPosition.y,
Ritor1
parents:
diff changeset
3655 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
Ritor1
parents:
diff changeset
3656 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
3657 v34 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3658 LOBYTE(v34) = v34 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3659 a1.field_58_pid = v34;
0
Ritor1
parents:
diff changeset
3660 a1.field_5C = a2;
Ritor1
parents:
diff changeset
3661 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
3662 a1.uFacing = LOWORD(v715.uYawAngle);
Ritor1
parents:
diff changeset
3663 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
3664 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
3665 LOBYTE(a1.uAttributes) |= 4u;
Ritor1
parents:
diff changeset
3666 v669 = v3->uPlayerID + 1;
Ritor1
parents:
diff changeset
3667 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
Ritor1
parents:
diff changeset
3668 v35 = pParty->sRotationX + 10;
Ritor1
parents:
diff changeset
3669 goto LABEL_124;
Ritor1
parents:
diff changeset
3670 case 20:
Ritor1
parents:
diff changeset
3671 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3672 goto LABEL_83;
Ritor1
parents:
diff changeset
3673 if ( a2 == v1 )
Ritor1
parents:
diff changeset
3674 goto LABEL_200;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
3675 if ( (a2 & 7) != OBJECT_Actor)
0
Ritor1
parents:
diff changeset
3676 goto LABEL_1056;
Ritor1
parents:
diff changeset
3677 v699 = v1;
Ritor1
parents:
diff changeset
3678 v698 = v1;
Ritor1
parents:
diff changeset
3679 v697 = v1;
Ritor1
parents:
diff changeset
3680 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3681 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
3682 a1.field_4C = v2;
Ritor1
parents:
diff changeset
3683 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3684 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
3685 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
3686 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
3687 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
3688 v37 = v3->uPlayerID;
Ritor1
parents:
diff changeset
3689 a1.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
3690 v37 *= 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3691 LOBYTE(v37) = v37 | OBJECT_Player;
0
Ritor1
parents:
diff changeset
3692 a1.uFacing = v1;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3693 a1.field_58_pid = v37;
0
Ritor1
parents:
diff changeset
3694 v38 = a2 >> 3;
Ritor1
parents:
diff changeset
3695 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
3696 v39 = a2 >> 3;
Ritor1
parents:
diff changeset
3697 a1.vPosition.x = pActors[v39].vPosition.x;
Ritor1
parents:
diff changeset
3698 v40 = pActors[v39].vPosition.y;
Ritor1
parents:
diff changeset
3699 a1.vPosition.z = pActors[v39].vPosition.z;
Ritor1
parents:
diff changeset
3700 v41 = 8 * (a2 >> 3);
Ritor1
parents:
diff changeset
3701 a1.vPosition.y = v40;
Ritor1
parents:
diff changeset
3702 LOBYTE(v41) = v41 | 3;
Ritor1
parents:
diff changeset
3703 a1.field_5C = v41;
Ritor1
parents:
diff changeset
3704 v42 = a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
3705 v43 = &v697;
Ritor1
parents:
diff changeset
3706 goto LABEL_133;
Ritor1
parents:
diff changeset
3707 case 44:
Ritor1
parents:
diff changeset
3708 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3709 goto LABEL_83;
Ritor1
parents:
diff changeset
3710 v726 = (Player *)(a2 >> 3);
Ritor1
parents:
diff changeset
3711 HIDWORD(v733) = 836 * (a2 >> 3);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
3712 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) )
0
Ritor1
parents:
diff changeset
3713 goto LABEL_1056;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
3714 pActors[a2 >> 3].pActorBuffs[10].Apply(
0
Ritor1
parents:
diff changeset
3715 pMiscTimer->uTotalGameTimeElapsed + 128,
Ritor1
parents:
diff changeset
3716 v1,
Ritor1
parents:
diff changeset
3717 v1,
Ritor1
parents:
diff changeset
3718 v1,
Ritor1
parents:
diff changeset
3719 v1);
Ritor1
parents:
diff changeset
3720 v706 = v1;
Ritor1
parents:
diff changeset
3721 v705 = v1;
Ritor1
parents:
diff changeset
3722 v704 = v1;
Ritor1
parents:
diff changeset
3723 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3724 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
3725 a1.field_4C = v2;
Ritor1
parents:
diff changeset
3726 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3727 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
3728 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
3729 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
3730 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
3731 v44 = v3->uPlayerID;
Ritor1
parents:
diff changeset
3732 a1.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
3733 a1.uFacing = v1;
Ritor1
parents:
diff changeset
3734 v44 *= 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3735 LOBYTE(v44) = v44 | OBJECT_Player;
0
Ritor1
parents:
diff changeset
3736 v38 = (signed int)v726;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3737 a1.field_58_pid = v44;
0
Ritor1
parents:
diff changeset
3738 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
3739 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733));
Ritor1
parents:
diff changeset
3740 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733));
Ritor1
parents:
diff changeset
3741 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733));
Ritor1
parents:
diff changeset
3742 v46 = 8 * (int)v726;
Ritor1
parents:
diff changeset
3743 a1.vPosition.y = v45;
Ritor1
parents:
diff changeset
3744 LOBYTE(v46) = 8 * (char)v726 | 3;
Ritor1
parents:
diff changeset
3745 a1.field_5C = v46;
Ritor1
parents:
diff changeset
3746 v42 = a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
3747 v43 = &v704;
Ritor1
parents:
diff changeset
3748 LABEL_133:
Ritor1
parents:
diff changeset
3749 v670 = (Vec3_int_ *)v43;
Ritor1
parents:
diff changeset
3750 v47 = v38;
Ritor1
parents:
diff changeset
3751 goto LABEL_139;
Ritor1
parents:
diff changeset
3752 case 79:
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
3753 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != OBJECT_Actor)
0
Ritor1
parents:
diff changeset
3754 goto LABEL_83;
Ritor1
parents:
diff changeset
3755 v730 = a2 >> 3;
Ritor1
parents:
diff changeset
3756 v693 = v1;
Ritor1
parents:
diff changeset
3757 HIDWORD(v733) = (int)&pActors[a2 >> 3];
Ritor1
parents:
diff changeset
3758 v692 = v1;
Ritor1
parents:
diff changeset
3759 v691 = v1;
Ritor1
parents:
diff changeset
3760 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3761 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
3762 a1.field_4C = v2;
Ritor1
parents:
diff changeset
3763 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3764 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
3765 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142);
Ritor1
parents:
diff changeset
3766 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144);
Ritor1
parents:
diff changeset
3767 v48 = *(short *)(HIDWORD(v733) + 138);
Ritor1
parents:
diff changeset
3768 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138);
Ritor1
parents:
diff changeset
3769 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
3770 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48);
Ritor1
parents:
diff changeset
3771 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
3772 v49 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3773 LOBYTE(v49) = v49 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3774 a1.field_58_pid = v49;
0
Ritor1
parents:
diff changeset
3775 a1.field_5C = a2;
Ritor1
parents:
diff changeset
3776 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
3777 a1.uFacing = LOWORD(v715.uYawAngle);
Ritor1
parents:
diff changeset
3778 LOWORD(v49) = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
3779 LOBYTE(a1.uAttributes) |= 0x80u;
Ritor1
parents:
diff changeset
3780 a1.uSoundID = v49;
Ritor1
parents:
diff changeset
3781 v726 = (Player *)a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
3782 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) )
Ritor1
parents:
diff changeset
3783 goto LABEL_200;
Ritor1
parents:
diff changeset
3784 v47 = v730;
Ritor1
parents:
diff changeset
3785 v670 = (Vec3_int_ *)&v691;
Ritor1
parents:
diff changeset
3786 v42 = (signed int)v726;
Ritor1
parents:
diff changeset
3787 LABEL_139:
Ritor1
parents:
diff changeset
3788 DamageMonsterFromParty(8 * v42 | 2, v47, v670);
Ritor1
parents:
diff changeset
3789 goto LABEL_1056;
Ritor1
parents:
diff changeset
3790 case 2:
Ritor1
parents:
diff changeset
3791 case 6:
Ritor1
parents:
diff changeset
3792 case 11:
Ritor1
parents:
diff changeset
3793 case 18:
Ritor1
parents:
diff changeset
3794 case 26:
Ritor1
parents:
diff changeset
3795 case 32:
Ritor1
parents:
diff changeset
3796 case 34:
Ritor1
parents:
diff changeset
3797 case 37:
Ritor1
parents:
diff changeset
3798 case 57:
Ritor1
parents:
diff changeset
3799 case 65:
Ritor1
parents:
diff changeset
3800 case 70:
Ritor1
parents:
diff changeset
3801 case 78:
Ritor1
parents:
diff changeset
3802 case 97:
Ritor1
parents:
diff changeset
3803 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3804 goto LABEL_83;
Ritor1
parents:
diff changeset
3805 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3806 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
3807 a1.field_4C = v2;
Ritor1
parents:
diff changeset
3808 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3809 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
3810 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
3811 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
3812 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
3813 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
3814 a1.uSectorID = pIndoor->GetSector(
Ritor1
parents:
diff changeset
3815 pParty->vPosition.x,
Ritor1
parents:
diff changeset
3816 pParty->vPosition.y,
Ritor1
parents:
diff changeset
3817 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
Ritor1
parents:
diff changeset
3818 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
3819 v50 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3820 LOBYTE(v50) = v50 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3821 a1.field_58_pid = v50;
0
Ritor1
parents:
diff changeset
3822 a1.field_5C = a2;
Ritor1
parents:
diff changeset
3823 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
3824 a1.uFacing = LOWORD(v715.uYawAngle);
Ritor1
parents:
diff changeset
3825 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
3826 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
3827 LOBYTE(a1.uAttributes) |= 4u;
Ritor1
parents:
diff changeset
3828 if ( v3->spellnum == 18 )
Ritor1
parents:
diff changeset
3829 LOBYTE(a1.uAttributes) |= 0x40u;
Ritor1
parents:
diff changeset
3830 goto LABEL_156;
Ritor1
parents:
diff changeset
3831 case 29:
Ritor1
parents:
diff changeset
3832 case 39:
Ritor1
parents:
diff changeset
3833 case 76:
Ritor1
parents:
diff changeset
3834 case 90:
Ritor1
parents:
diff changeset
3835 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3836 goto LABEL_83;
Ritor1
parents:
diff changeset
3837 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3838 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
3839 a1.field_4C = v2;
Ritor1
parents:
diff changeset
3840 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3841 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
3842 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
Ritor1
parents:
diff changeset
3843 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
3844 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
Ritor1
parents:
diff changeset
3845 v660 = pParty->vPosition.y;
Ritor1
parents:
diff changeset
3846 goto LABEL_153;
Ritor1
parents:
diff changeset
3847 case 87:
Ritor1
parents:
diff changeset
3848 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor
Ritor1
parents:
diff changeset
3849 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) )
Ritor1
parents:
diff changeset
3850 goto LABEL_200;
Ritor1
parents:
diff changeset
3851 if ( pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3852 goto LABEL_152;
Ritor1
parents:
diff changeset
3853 goto LABEL_83;
Ritor1
parents:
diff changeset
3854 case 81:
Ritor1
parents:
diff changeset
3855 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3856 goto LABEL_83;
Ritor1
parents:
diff changeset
3857 if ( a2 == v1
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
3858 || (a2 & 7) != OBJECT_Actor
0
Ritor1
parents:
diff changeset
3859 || (v730 = a2 >> 3,
Ritor1
parents:
diff changeset
3860 v721 = (int)&pActors[a2 >> 3],
Ritor1
parents:
diff changeset
3861 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) )
Ritor1
parents:
diff changeset
3862 goto LABEL_1056;
Ritor1
parents:
diff changeset
3863 Actor::_403EB6(v730, 4u, 0x80u, (AIDirection *)v1);
Ritor1
parents:
diff changeset
3864 v726 = (Player *)(23040 * v2);
Ritor1
parents:
diff changeset
3865 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335);
Ritor1
parents:
diff changeset
3866 v55 = v721;
Ritor1
parents:
diff changeset
3867 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, v1, v1, v1);
Ritor1
parents:
diff changeset
3868 *(char *)(v55 + 38) |= 8u;
Ritor1
parents:
diff changeset
3869 *(short *)(v55 + 148) = v1;
Ritor1
parents:
diff changeset
3870 v672 = v1;
Ritor1
parents:
diff changeset
3871 *(short *)(v55 + 150) = v1;
Ritor1
parents:
diff changeset
3872 v661 = (Actor *)v55;
Ritor1
parents:
diff changeset
3873 goto LABEL_165;
Ritor1
parents:
diff changeset
3874 case 35:
Ritor1
parents:
diff changeset
3875 if ( v12 == 2 )
Ritor1
parents:
diff changeset
3876 {
Ritor1
parents:
diff changeset
3877 v57 = 300 * v2;
Ritor1
parents:
diff changeset
3878 }
Ritor1
parents:
diff changeset
3879 else
Ritor1
parents:
diff changeset
3880 {
Ritor1
parents:
diff changeset
3881 if ( v12 == 3 )
Ritor1
parents:
diff changeset
3882 {
Ritor1
parents:
diff changeset
3883 amount = 4;
Ritor1
parents:
diff changeset
3884 v57 = 300 * v2;
Ritor1
parents:
diff changeset
3885 goto LABEL_174;
Ritor1
parents:
diff changeset
3886 }
Ritor1
parents:
diff changeset
3887 if ( v12 == 4 )
Ritor1
parents:
diff changeset
3888 {
Ritor1
parents:
diff changeset
3889 v57 = 300 * v2;
Ritor1
parents:
diff changeset
3890 amount = 8;
Ritor1
parents:
diff changeset
3891 goto LABEL_174;
Ritor1
parents:
diff changeset
3892 }
Ritor1
parents:
diff changeset
3893 v57 = 180 * v2;
Ritor1
parents:
diff changeset
3894 }
Ritor1
parents:
diff changeset
3895 amount = 2;
Ritor1
parents:
diff changeset
3896 LABEL_174:
Ritor1
parents:
diff changeset
3897 LODWORD(v733) = v57;
Ritor1
parents:
diff changeset
3898 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3899 goto LABEL_83;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
3900 if ( (a2 & 7) != OBJECT_Actor
0
Ritor1
parents:
diff changeset
3901 || (v721 = 836 * (a2 >> 3),
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
3902 LODWORD(v718) = (int)&pActors[a2 >> 3],
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
3903 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) )
0
Ritor1
parents:
diff changeset
3904 goto LABEL_1056;
Ritor1
parents:
diff changeset
3905 v726 = (Player *)(23040 * v2);
Ritor1
parents:
diff changeset
3906 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335);
Ritor1
parents:
diff changeset
3907 v59 = v721;
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3908 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply(
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3909 pActors[a2 >> 3].pActorBuffs[7].Apply(
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3910 pParty->uTimePlayed + (signed int)v58,
0
Ritor1
parents:
diff changeset
3911 v731,
Ritor1
parents:
diff changeset
3912 amount,
Ritor1
parents:
diff changeset
3913 v1,
Ritor1
parents:
diff changeset
3914 v1);
Ritor1
parents:
diff changeset
3915 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u;
Ritor1
parents:
diff changeset
3916 v672 = v1;
Ritor1
parents:
diff changeset
3917 v661 = (Actor *)LODWORD(v718);
Ritor1
parents:
diff changeset
3918 goto LABEL_165;
Ritor1
parents:
diff changeset
3919 case 60:
Ritor1
parents:
diff changeset
3920 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3921 goto LABEL_83;
Ritor1
parents:
diff changeset
3922 v730 = 836 * (a2 >> 3);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
3923 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) )
0
Ritor1
parents:
diff changeset
3924 goto LABEL_1056;
Ritor1
parents:
diff changeset
3925 LODWORD(v733) = 300 * v2;
Ritor1
parents:
diff changeset
3926 if ( v731 == 2 )
Ritor1
parents:
diff changeset
3927 {
Ritor1
parents:
diff changeset
3928 LODWORD(v733) = 600 * v2;
Ritor1
parents:
diff changeset
3929 }
Ritor1
parents:
diff changeset
3930 else
Ritor1
parents:
diff changeset
3931 {
Ritor1
parents:
diff changeset
3932 if ( v731 == 3 )
Ritor1
parents:
diff changeset
3933 LODWORD(v733) = 29030400;
Ritor1
parents:
diff changeset
3934 }
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3935 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset();
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3936 pActors[a2 >> 3].pActorBuffs[9].Reset();
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3937 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset();
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3938 pActors[a2 >> 3].pActorBuffs[12].Reset();
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3939 v726 = (Player *)((int)v733 << 7);
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3940 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply(
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
3941 pActors[a2 >> 3].pActorBuffs[1].Apply(
0
Ritor1
parents:
diff changeset
3942 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
Ritor1
parents:
diff changeset
3943 v731,
Ritor1
parents:
diff changeset
3944 v1,
Ritor1
parents:
diff changeset
3945 v1,
Ritor1
parents:
diff changeset
3946 v1);
Ritor1
parents:
diff changeset
3947 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3948 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
3949 a1.field_4C = v2;
Ritor1
parents:
diff changeset
3950 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3951 v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
3952 v61 = a2 >> 3;
0
Ritor1
parents:
diff changeset
3953 goto LABEL_1086;
Ritor1
parents:
diff changeset
3954 case 92:
Ritor1
parents:
diff changeset
3955 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
3956 goto LABEL_83;
Ritor1
parents:
diff changeset
3957 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
3958 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
3959 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
3960 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
3961 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
3962 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
3963 a1.uSectorID = pIndoor->GetSector(
Ritor1
parents:
diff changeset
3964 pParty->vPosition.x,
Ritor1
parents:
diff changeset
3965 pParty->vPosition.y,
Ritor1
parents:
diff changeset
3966 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
Ritor1
parents:
diff changeset
3967 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
3968 v62 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3969 LOBYTE(v62) = v62 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
3970 a1.field_58_pid = v62;
0
Ritor1
parents:
diff changeset
3971 a1.field_5C = a2;
Ritor1
parents:
diff changeset
3972 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
3973 a1.uFacing = LOWORD(v715.uYawAngle);
Ritor1
parents:
diff changeset
3974 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
3975 a1.field_50 = v731;
Ritor1
parents:
diff changeset
3976 a1.field_48 = 3;
Ritor1
parents:
diff changeset
3977 a1.field_4C = 300 * v2;
Ritor1
parents:
diff changeset
3978 goto LABEL_154;
Ritor1
parents:
diff changeset
3979 case 4:
Ritor1
parents:
diff changeset
3980 v63 = v12 - 1;
Ritor1
parents:
diff changeset
3981 if ( !v63 )
Ritor1
parents:
diff changeset
3982 {
Ritor1
parents:
diff changeset
3983 amount = 10;
Ritor1
parents:
diff changeset
3984 goto LABEL_195;
Ritor1
parents:
diff changeset
3985 }
Ritor1
parents:
diff changeset
3986 v64 = v63 - 1;
Ritor1
parents:
diff changeset
3987 if ( !v64 )
Ritor1
parents:
diff changeset
3988 {
Ritor1
parents:
diff changeset
3989 amount = 11;
Ritor1
parents:
diff changeset
3990 goto LABEL_195;
Ritor1
parents:
diff changeset
3991 }
Ritor1
parents:
diff changeset
3992 v65 = v64 - 1;
Ritor1
parents:
diff changeset
3993 if ( !v65 )
Ritor1
parents:
diff changeset
3994 {
Ritor1
parents:
diff changeset
3995 amount = 12;
Ritor1
parents:
diff changeset
3996 LABEL_195:
Ritor1
parents:
diff changeset
3997 LODWORD(v733) = 3600 * v2;
Ritor1
parents:
diff changeset
3998 goto LABEL_196;
Ritor1
parents:
diff changeset
3999 }
Ritor1
parents:
diff changeset
4000 if ( v65 == 1 )
Ritor1
parents:
diff changeset
4001 {
Ritor1
parents:
diff changeset
4002 LODWORD(v733) = v1;
Ritor1
parents:
diff changeset
4003 amount = 12;
Ritor1
parents:
diff changeset
4004 }
Ritor1
parents:
diff changeset
4005 LABEL_196:
Ritor1
parents:
diff changeset
4006 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4007 goto LABEL_83;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4008 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2];
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4009 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4010 v730c->UpdateTempBonus(pParty->uTimePlayed);
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4011 if ( v730c->uItemID < 64 || v730c->uItemID > 65 )
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4012 {
315
2a09e1d6fc8f Some 0041D895 GameUI_DrawItemInfo overhaul
Nomad
parents: 305
diff changeset
4013 if (!v730c->Broken())
0
Ritor1
parents:
diff changeset
4014 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4015 if ( v730c->uAdditionalValue == v1 )
0
Ritor1
parents:
diff changeset
4016 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4017 if ( v730c->_bonus_type == v1 )
0
Ritor1
parents:
diff changeset
4018 {
Ritor1
parents:
diff changeset
4019 v68 = BYTE4(v726->pConditions[3]);
Ritor1
parents:
diff changeset
4020 if ( !v68 || v68 == 1 || v68 == 2 )
Ritor1
parents:
diff changeset
4021 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4022 if ( !pItemsTable->_456D5E_is_some_material(v730c) )
0
Ritor1
parents:
diff changeset
4023 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4024 v69 = v730c;
0
Ritor1
parents:
diff changeset
4025 v14 = v731 == 4;
Ritor1
parents:
diff changeset
4026 *(int *)(v730 + 12) = amount;
Ritor1
parents:
diff changeset
4027 if ( !v14 )
Ritor1
parents:
diff changeset
4028 {
Ritor1
parents:
diff changeset
4029 v726 = (Player *)((int)v733 << 7);
Ritor1
parents:
diff changeset
4030 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed
Ritor1
parents:
diff changeset
4031 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7)
Ritor1
parents:
diff changeset
4032 * 0.033333335);
Ritor1
parents:
diff changeset
4033 *(int *)(v69 + 20) |= 8u;
Ritor1
parents:
diff changeset
4034 }
Ritor1
parents:
diff changeset
4035 *(int *)(v69 + 20) |= 0x10u;
Ritor1
parents:
diff changeset
4036 LABEL_1055:
Ritor1
parents:
diff changeset
4037 dword_50C9A8 = 256;
Ritor1
parents:
diff changeset
4038 LABEL_1056:
Ritor1
parents:
diff changeset
4039 LODWORD(v727) = 1;
Ritor1
parents:
diff changeset
4040 LABEL_83:
Ritor1
parents:
diff changeset
4041 if ( v3->field_8 & 0x20 )
Ritor1
parents:
diff changeset
4042 {
Ritor1
parents:
diff changeset
4043 LABEL_1162:
Ritor1
parents:
diff changeset
4044 if ( v727 != 0.0 )
Ritor1
parents:
diff changeset
4045 pAudioPlayer->PlaySound(
Ritor1
parents:
diff changeset
4046 (SoundID)word_4EE088_sound_ids[v3->spellnum],
Ritor1
parents:
diff changeset
4047 0,
Ritor1
parents:
diff changeset
4048 0,
Ritor1
parents:
diff changeset
4049 -1,
Ritor1
parents:
diff changeset
4050 0,
Ritor1
parents:
diff changeset
4051 v3->field_10,
Ritor1
parents:
diff changeset
4052 0,
Ritor1
parents:
diff changeset
4053 0);
Ritor1
parents:
diff changeset
4054 }
Ritor1
parents:
diff changeset
4055 else
Ritor1
parents:
diff changeset
4056 {
Ritor1
parents:
diff changeset
4057 if ( sRecoveryTime < 0 )
Ritor1
parents:
diff changeset
4058 sRecoveryTime = 0;
Ritor1
parents:
diff changeset
4059 if ( pParty->bTurnBasedModeOn )
Ritor1
parents:
diff changeset
4060 {
Ritor1
parents:
diff changeset
4061 v645 = sRecoveryTime;
Ritor1
parents:
diff changeset
4062 pParty->pTurnBasedPlayerRecoveryTimes[v3->uPlayerID] = sRecoveryTime;
Ritor1
parents:
diff changeset
4063 pPlayer->SetRecoveryTime(v645);
Ritor1
parents:
diff changeset
4064 if ( !some_active_character )
Ritor1
parents:
diff changeset
4065 pTurnEngine->_40471C();
Ritor1
parents:
diff changeset
4066 }
Ritor1
parents:
diff changeset
4067 else
Ritor1
parents:
diff changeset
4068 {
Ritor1
parents:
diff changeset
4069 pPlayer->SetRecoveryTime(
Ritor1
parents:
diff changeset
4070 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
Ritor1
parents:
diff changeset
4071 }
Ritor1
parents:
diff changeset
4072 if ( v727 != 0.0 )
Ritor1
parents:
diff changeset
4073 {
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
4074 pPlayer->PlaySound(SPEECH_49, 0);
0
Ritor1
parents:
diff changeset
4075 goto LABEL_1162;
Ritor1
parents:
diff changeset
4076 }
Ritor1
parents:
diff changeset
4077 }
Ritor1
parents:
diff changeset
4078 v3->spellnum = 0;
Ritor1
parents:
diff changeset
4079 v1 = 0;
Ritor1
parents:
diff changeset
4080 LABEL_1165:
Ritor1
parents:
diff changeset
4081 v2 = v723;
Ritor1
parents:
diff changeset
4082 goto LABEL_1166;
Ritor1
parents:
diff changeset
4083 }
Ritor1
parents:
diff changeset
4084 }
Ritor1
parents:
diff changeset
4085 }
Ritor1
parents:
diff changeset
4086 }
Ritor1
parents:
diff changeset
4087 }
Ritor1
parents:
diff changeset
4088 }
Ritor1
parents:
diff changeset
4089 LABEL_199:
Ritor1
parents:
diff changeset
4090 dword_50C9D0 = 113;
Ritor1
parents:
diff changeset
4091 dword_50C9D4 = v1;
Ritor1
parents:
diff changeset
4092 dword_50C9D8 = 1;
Ritor1
parents:
diff changeset
4093 LABEL_200:
Ritor1
parents:
diff changeset
4094 v66 = pGlobalTXT_LocalizationStrings[428];
Ritor1
parents:
diff changeset
4095 LABEL_201:
Ritor1
parents:
diff changeset
4096 v67 = 2;
Ritor1
parents:
diff changeset
4097 LABEL_202:
Ritor1
parents:
diff changeset
4098 ShowStatusBarString(v66, v67);
Ritor1
parents:
diff changeset
4099 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1);
Ritor1
parents:
diff changeset
4100 goto LABEL_203;
Ritor1
parents:
diff changeset
4101 case 71:
Ritor1
parents:
diff changeset
4102 v70 = v12 - 1;
Ritor1
parents:
diff changeset
4103 LODWORD(v733) = 3600 * v2;
Ritor1
parents:
diff changeset
4104 if ( v70 && (v71 = v70 - 1) != 0 )
Ritor1
parents:
diff changeset
4105 {
Ritor1
parents:
diff changeset
4106 v72 = v71 - 1;
Ritor1
parents:
diff changeset
4107 if ( v72 )
Ritor1
parents:
diff changeset
4108 {
Ritor1
parents:
diff changeset
4109 if ( v72 == 1 )
Ritor1
parents:
diff changeset
4110 amount = 10;
Ritor1
parents:
diff changeset
4111 }
Ritor1
parents:
diff changeset
4112 else
Ritor1
parents:
diff changeset
4113 {
Ritor1
parents:
diff changeset
4114 amount = 3;
Ritor1
parents:
diff changeset
4115 }
Ritor1
parents:
diff changeset
4116 }
Ritor1
parents:
diff changeset
4117 else
Ritor1
parents:
diff changeset
4118 {
Ritor1
parents:
diff changeset
4119 amount = 1;
Ritor1
parents:
diff changeset
4120 }
Ritor1
parents:
diff changeset
4121 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4122 goto LABEL_83;
Ritor1
parents:
diff changeset
4123 v73 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
4124 v74 = v3->spellnum;
Ritor1
parents:
diff changeset
4125 v75 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4126 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73);
Ritor1
parents:
diff changeset
4127 v668 = v1;
Ritor1
parents:
diff changeset
4128 v658 = v1;
Ritor1
parents:
diff changeset
4129 v653 = amount;
Ritor1
parents:
diff changeset
4130 v651 = v731;
Ritor1
parents:
diff changeset
4131 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669);
Ritor1
parents:
diff changeset
4132 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12];
Ritor1
parents:
diff changeset
4133 goto LABEL_103;
Ritor1
parents:
diff changeset
4134 case 3:
Ritor1
parents:
diff changeset
4135 case 14:
Ritor1
parents:
diff changeset
4136 case 25:
Ritor1
parents:
diff changeset
4137 case 36:
Ritor1
parents:
diff changeset
4138 case 58:
Ritor1
parents:
diff changeset
4139 case 69:
Ritor1
parents:
diff changeset
4140 v76 = v12 - 1;
Ritor1
parents:
diff changeset
4141 LODWORD(v733) = 3600 * v2;
Ritor1
parents:
diff changeset
4142 if ( v76 )
Ritor1
parents:
diff changeset
4143 {
Ritor1
parents:
diff changeset
4144 v77 = v76 - 1;
Ritor1
parents:
diff changeset
4145 if ( v77 )
Ritor1
parents:
diff changeset
4146 {
Ritor1
parents:
diff changeset
4147 v78 = v77 - 1;
Ritor1
parents:
diff changeset
4148 if ( v78 )
Ritor1
parents:
diff changeset
4149 {
Ritor1
parents:
diff changeset
4150 if ( v78 != 1 )
Ritor1
parents:
diff changeset
4151 goto LABEL_232;
Ritor1
parents:
diff changeset
4152 v79 = 4 * v2;
Ritor1
parents:
diff changeset
4153 }
Ritor1
parents:
diff changeset
4154 else
Ritor1
parents:
diff changeset
4155 {
Ritor1
parents:
diff changeset
4156 v79 = 3 * v2;
Ritor1
parents:
diff changeset
4157 }
Ritor1
parents:
diff changeset
4158 }
Ritor1
parents:
diff changeset
4159 else
Ritor1
parents:
diff changeset
4160 {
Ritor1
parents:
diff changeset
4161 v79 = 2 * v2;
Ritor1
parents:
diff changeset
4162 }
Ritor1
parents:
diff changeset
4163 amount = v79;
Ritor1
parents:
diff changeset
4164 }
Ritor1
parents:
diff changeset
4165 else
Ritor1
parents:
diff changeset
4166 {
Ritor1
parents:
diff changeset
4167 amount = v2;
Ritor1
parents:
diff changeset
4168 }
Ritor1
parents:
diff changeset
4169 LABEL_232:
Ritor1
parents:
diff changeset
4170 v80 = v3->spellnum;
Ritor1
parents:
diff changeset
4171 switch ( v80 )
Ritor1
parents:
diff changeset
4172 {
Ritor1
parents:
diff changeset
4173 case 3:
Ritor1
parents:
diff changeset
4174 LODWORD(v725) = 6;
Ritor1
parents:
diff changeset
4175 break;
Ritor1
parents:
diff changeset
4176 case 14:
Ritor1
parents:
diff changeset
4177 LODWORD(v725) = v1;
Ritor1
parents:
diff changeset
4178 break;
Ritor1
parents:
diff changeset
4179 case 25:
Ritor1
parents:
diff changeset
4180 LODWORD(v725) = 17;
Ritor1
parents:
diff changeset
4181 break;
Ritor1
parents:
diff changeset
4182 case 36:
Ritor1
parents:
diff changeset
4183 LODWORD(v725) = 4;
Ritor1
parents:
diff changeset
4184 break;
Ritor1
parents:
diff changeset
4185 case 58:
Ritor1
parents:
diff changeset
4186 LODWORD(v725) = 12;
Ritor1
parents:
diff changeset
4187 break;
Ritor1
parents:
diff changeset
4188 default:
Ritor1
parents:
diff changeset
4189 if ( v80 != 69 )
Ritor1
parents:
diff changeset
4190 goto LABEL_1166;
Ritor1
parents:
diff changeset
4191 LODWORD(v725) = 1;
Ritor1
parents:
diff changeset
4192 break;
Ritor1
parents:
diff changeset
4193 }
Ritor1
parents:
diff changeset
4194 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4195 goto LABEL_83;
Ritor1
parents:
diff changeset
4196 v81 = v3->spellnum;
Ritor1
parents:
diff changeset
4197 v82 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4198 pGame->GetStru6()->SetPlayerBuffAnim(v81, v1);
Ritor1
parents:
diff changeset
4199 v83 = 1;
Ritor1
parents:
diff changeset
4200 v84 = v3->spellnum;
Ritor1
parents:
diff changeset
4201 v85 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4202 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1u);
Ritor1
parents:
diff changeset
4203 v86 = v3->spellnum;
Ritor1
parents:
diff changeset
4204 v87 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4205 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2u);
Ritor1
parents:
diff changeset
4206 v88 = v3->spellnum;
Ritor1
parents:
diff changeset
4207 v89 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4208 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3u);
Ritor1
parents:
diff changeset
4209 v90 = (double)(signed int)v733 * 4.2666669;
Ritor1
parents:
diff changeset
4210 goto LABEL_304;
Ritor1
parents:
diff changeset
4211 case 5:
Ritor1
parents:
diff changeset
4212 if ( v12 <= v1 )
Ritor1
parents:
diff changeset
4213 goto LABEL_254;
Ritor1
parents:
diff changeset
4214 if ( v12 <= 2 )
Ritor1
parents:
diff changeset
4215 {
Ritor1
parents:
diff changeset
4216 v91 = 60 * (v2 + 60);
Ritor1
parents:
diff changeset
4217 }
Ritor1
parents:
diff changeset
4218 else
Ritor1
parents:
diff changeset
4219 {
Ritor1
parents:
diff changeset
4220 if ( v12 == 3 )
Ritor1
parents:
diff changeset
4221 {
Ritor1
parents:
diff changeset
4222 v91 = 180 * (v2 + 20);
Ritor1
parents:
diff changeset
4223 }
Ritor1
parents:
diff changeset
4224 else
Ritor1
parents:
diff changeset
4225 {
Ritor1
parents:
diff changeset
4226 if ( v12 != 4 )
Ritor1
parents:
diff changeset
4227 goto LABEL_254;
Ritor1
parents:
diff changeset
4228 v91 = 240 * (v2 + 15);
Ritor1
parents:
diff changeset
4229 }
Ritor1
parents:
diff changeset
4230 }
Ritor1
parents:
diff changeset
4231 LODWORD(v733) = v91;
Ritor1
parents:
diff changeset
4232 LABEL_254:
Ritor1
parents:
diff changeset
4233 if ( pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4234 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4235 v92 = pParty->pPlayers;//[0].pConditions[1];
0
Ritor1
parents:
diff changeset
4236 LODWORD(v727) = 1;
Ritor1
parents:
diff changeset
4237 do
Ritor1
parents:
diff changeset
4238 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4239 if ( v92->pConditions )
0
Ritor1
parents:
diff changeset
4240 LODWORD(v727) = v1;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4241 ++v92;
0
Ritor1
parents:
diff changeset
4242 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4243 while ( v92 <= &pParty->pPlayers[3] );
0
Ritor1
parents:
diff changeset
4244 if ( LODWORD(v727) != v1 )
Ritor1
parents:
diff changeset
4245 {
Ritor1
parents:
diff changeset
4246 v726 = (Player *)((int)v733 << 7);
Ritor1
parents:
diff changeset
4247 pParty->pPartyBuffs[8].Apply(
Ritor1
parents:
diff changeset
4248 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
Ritor1
parents:
diff changeset
4249 v731,
Ritor1
parents:
diff changeset
4250 v1,
Ritor1
parents:
diff changeset
4251 v1,
Ritor1
parents:
diff changeset
4252 v1);
Ritor1
parents:
diff changeset
4253 v93 = v3->spellnum;
Ritor1
parents:
diff changeset
4254 v94 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4255 pGame->GetStru6()->SetPlayerBuffAnim(v93, v1);
Ritor1
parents:
diff changeset
4256 v95 = v3->spellnum;
Ritor1
parents:
diff changeset
4257 v96 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4258 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1u);
Ritor1
parents:
diff changeset
4259 v97 = v3->spellnum;
Ritor1
parents:
diff changeset
4260 v98 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4261 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2u);
Ritor1
parents:
diff changeset
4262 v99 = v3->spellnum;
Ritor1
parents:
diff changeset
4263 v100 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4264 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3u);
Ritor1
parents:
diff changeset
4265 }
Ritor1
parents:
diff changeset
4266 }
Ritor1
parents:
diff changeset
4267 goto LABEL_83;
Ritor1
parents:
diff changeset
4268 case 46:
Ritor1
parents:
diff changeset
4269 v101 = v12 - 1;
Ritor1
parents:
diff changeset
4270 if ( v101 && (v102 = v101 - 1) != 0 )
Ritor1
parents:
diff changeset
4271 {
Ritor1
parents:
diff changeset
4272 v103 = v102 - 1;
Ritor1
parents:
diff changeset
4273 if ( v103 )
Ritor1
parents:
diff changeset
4274 {
Ritor1
parents:
diff changeset
4275 if ( v103 != 1 )
Ritor1
parents:
diff changeset
4276 goto LABEL_269;
Ritor1
parents:
diff changeset
4277 v104 = 3600 * (v2 + 1);
Ritor1
parents:
diff changeset
4278 }
Ritor1
parents:
diff changeset
4279 else
Ritor1
parents:
diff changeset
4280 {
Ritor1
parents:
diff changeset
4281 v104 = 900 * (v2 + 4);
Ritor1
parents:
diff changeset
4282 }
Ritor1
parents:
diff changeset
4283 }
Ritor1
parents:
diff changeset
4284 else
Ritor1
parents:
diff changeset
4285 {
Ritor1
parents:
diff changeset
4286 v104 = 300 * (v2 + 12);
Ritor1
parents:
diff changeset
4287 }
Ritor1
parents:
diff changeset
4288 LODWORD(v733) = v104;
Ritor1
parents:
diff changeset
4289 LABEL_269:
Ritor1
parents:
diff changeset
4290 amount = v2 + 5;
Ritor1
parents:
diff changeset
4291 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4292 goto LABEL_83;
Ritor1
parents:
diff changeset
4293 if ( v731 == 1 )
Ritor1
parents:
diff changeset
4294 {
Ritor1
parents:
diff changeset
4295 v108 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
4296 v109 = v3->spellnum;
Ritor1
parents:
diff changeset
4297 v110 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4298 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108);
Ritor1
parents:
diff changeset
4299 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, v1, 65536);
Ritor1
parents:
diff changeset
4300 v668 = v1;
Ritor1
parents:
diff changeset
4301 v716 = v111;
Ritor1
parents:
diff changeset
4302 v658 = v111;
Ritor1
parents:
diff changeset
4303 v653 = amount;
Ritor1
parents:
diff changeset
4304 v726 = (Player *)((int)v733 << 7);
Ritor1
parents:
diff changeset
4305 v651 = 1;
Ritor1
parents:
diff changeset
4306 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
4307 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[1];
Ritor1
parents:
diff changeset
4308 goto LABEL_103;
Ritor1
parents:
diff changeset
4309 }
Ritor1
parents:
diff changeset
4310 v105 = 0;
Ritor1
parents:
diff changeset
4311 v726 = (Player *)((int)v733 << 7);
Ritor1
parents:
diff changeset
4312 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4313 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1];
0
Ritor1
parents:
diff changeset
4314 do
Ritor1
parents:
diff changeset
4315 {
Ritor1
parents:
diff changeset
4316 v106 = v3->spellnum;
Ritor1
parents:
diff changeset
4317 v107 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4318 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105);
Ritor1
parents:
diff changeset
4319 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, v1, 65536);
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4320 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1);
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4321 ++v730b;
0
Ritor1
parents:
diff changeset
4322 ++v105;
Ritor1
parents:
diff changeset
4323 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4324 while ( v730b <= &pParty->pPlayers[3] );
0
Ritor1
parents:
diff changeset
4325 goto LABEL_1056;
Ritor1
parents:
diff changeset
4326 case 52:
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
4327 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
4328 {
Ritor1
parents:
diff changeset
4329 v730 = a2 >> 3;
Ritor1
parents:
diff changeset
4330 v112 = &pActors[a2 >> 3];
Ritor1
parents:
diff changeset
4331 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z);
Ritor1
parents:
diff changeset
4332 v721 = abs(v112->vPosition.y - pParty->vPosition.y);
Ritor1
parents:
diff changeset
4333 v113 = abs(v112->vPosition.x - pParty->vPosition.x);
Ritor1
parents:
diff changeset
4334 _this = (ItemGen *)v113;
Ritor1
parents:
diff changeset
4335 v114 = v721;
Ritor1
parents:
diff changeset
4336 v115 = (unsigned int)v726;
Ritor1
parents:
diff changeset
4337 if ( v113 < v721 )
Ritor1
parents:
diff changeset
4338 {
Ritor1
parents:
diff changeset
4339 v116 = v113;
Ritor1
parents:
diff changeset
4340 v113 = v721;
Ritor1
parents:
diff changeset
4341 v114 = v116;
Ritor1
parents:
diff changeset
4342 }
Ritor1
parents:
diff changeset
4343 if ( v113 < (signed int)v726 )
Ritor1
parents:
diff changeset
4344 {
Ritor1
parents:
diff changeset
4345 v117 = v113;
Ritor1
parents:
diff changeset
4346 v113 = (int)v726;
Ritor1
parents:
diff changeset
4347 v115 = v117;
Ritor1
parents:
diff changeset
4348 }
Ritor1
parents:
diff changeset
4349 if ( v114 < (signed int)v115 )
Ritor1
parents:
diff changeset
4350 {
Ritor1
parents:
diff changeset
4351 v118 = v115;
Ritor1
parents:
diff changeset
4352 v115 = v114;
Ritor1
parents:
diff changeset
4353 v114 = v118;
Ritor1
parents:
diff changeset
4354 }
Ritor1
parents:
diff changeset
4355 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113);
Ritor1
parents:
diff changeset
4356 if ( (double)(signed int)this <= 307.2 )
Ritor1
parents:
diff changeset
4357 {
Ritor1
parents:
diff changeset
4358 v703 = 0;
Ritor1
parents:
diff changeset
4359 v702 = 0;
Ritor1
parents:
diff changeset
4360 v701 = 0;
Ritor1
parents:
diff changeset
4361 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
4362 v119 = HIDWORD(v733);
Ritor1
parents:
diff changeset
4363 a1.field_48 = *(int *)HIDWORD(v733);
Ritor1
parents:
diff changeset
4364 a1.field_4C = v723;
Ritor1
parents:
diff changeset
4365 a1.field_50 = v731;
Ritor1
parents:
diff changeset
4366 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
4367 a1.uAttributes = 0;
Ritor1
parents:
diff changeset
4368 a1.uSectorID = 0;
Ritor1
parents:
diff changeset
4369 a1.uSpriteFrameID = 0;
Ritor1
parents:
diff changeset
4370 v120 = 8 * *(short *)(v119 + 2);
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
4371 LOBYTE(v120) = v120 | OBJECT_Player;
0
Ritor1
parents:
diff changeset
4372 a1.field_60_distance_related_prolly_lod = 0;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
4373 a1.field_58_pid = v120;
0
Ritor1
parents:
diff changeset
4374 a1.uFacing = 0;
Ritor1
parents:
diff changeset
4375 a1.uSoundID = *(short *)(v119 + 16);
Ritor1
parents:
diff changeset
4376 a1.vPosition.x = v112->vPosition.x;
Ritor1
parents:
diff changeset
4377 a1.vPosition.y = v112->vPosition.y;
Ritor1
parents:
diff changeset
4378 v726 = (Player *)v112->uActorHeight;
Ritor1
parents:
diff changeset
4379 v121 = 8 * a2;
Ritor1
parents:
diff changeset
4380 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548);
Ritor1
parents:
diff changeset
4381 LOBYTE(v121) = 8 * a2 | 3;
Ritor1
parents:
diff changeset
4382 a1.field_5C = v121;
Ritor1
parents:
diff changeset
4383 v122 = a1.Create(0, 0, 0, 0);
Ritor1
parents:
diff changeset
4384 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701);
Ritor1
parents:
diff changeset
4385 LODWORD(v727) = 1;
Ritor1
parents:
diff changeset
4386 }
Ritor1
parents:
diff changeset
4387 else
Ritor1
parents:
diff changeset
4388 {
Ritor1
parents:
diff changeset
4389 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u);
Ritor1
parents:
diff changeset
4390 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
4391 *(int *)HIDWORD(v733) = 0;
Ritor1
parents:
diff changeset
4392 }
Ritor1
parents:
diff changeset
4393 v3 = (stru277 *)HIDWORD(v733);
Ritor1
parents:
diff changeset
4394 }
Ritor1
parents:
diff changeset
4395 goto LABEL_83;
Ritor1
parents:
diff changeset
4396 case 17:
Ritor1
parents:
diff changeset
4397 case 38:
Ritor1
parents:
diff changeset
4398 case 51:
Ritor1
parents:
diff changeset
4399 v123 = v12 - 1;
Ritor1
parents:
diff changeset
4400 if ( v123 && (v124 = v123 - 1) != 0 )
Ritor1
parents:
diff changeset
4401 {
Ritor1
parents:
diff changeset
4402 v125 = v124 - 1;
Ritor1
parents:
diff changeset
4403 if ( v125 )
Ritor1
parents:
diff changeset
4404 {
Ritor1
parents:
diff changeset
4405 if ( v125 != 1 )
Ritor1
parents:
diff changeset
4406 goto LABEL_296;
Ritor1
parents:
diff changeset
4407 v126 = 3600 * (v2 + 1);
Ritor1
parents:
diff changeset
4408 }
Ritor1
parents:
diff changeset
4409 else
Ritor1
parents:
diff changeset
4410 {
Ritor1
parents:
diff changeset
4411 v126 = 900 * (v2 + 4);
Ritor1
parents:
diff changeset
4412 }
Ritor1
parents:
diff changeset
4413 }
Ritor1
parents:
diff changeset
4414 else
Ritor1
parents:
diff changeset
4415 {
Ritor1
parents:
diff changeset
4416 v126 = 300 * (v2 + 12);
Ritor1
parents:
diff changeset
4417 }
Ritor1
parents:
diff changeset
4418 LODWORD(v733) = v126;
Ritor1
parents:
diff changeset
4419 LABEL_296:
Ritor1
parents:
diff changeset
4420 v127 = v3->spellnum;
Ritor1
parents:
diff changeset
4421 if ( v127 == 17 )
Ritor1
parents:
diff changeset
4422 {
Ritor1
parents:
diff changeset
4423 amount = v1;
Ritor1
parents:
diff changeset
4424 LODWORD(v725) = 14;
Ritor1
parents:
diff changeset
4425 }
Ritor1
parents:
diff changeset
4426 else
Ritor1
parents:
diff changeset
4427 {
Ritor1
parents:
diff changeset
4428 if ( v127 == 38 )
Ritor1
parents:
diff changeset
4429 {
Ritor1
parents:
diff changeset
4430 LODWORD(v725) = 15;
Ritor1
parents:
diff changeset
4431 amount = v2 + 5;
Ritor1
parents:
diff changeset
4432 }
Ritor1
parents:
diff changeset
4433 else
Ritor1
parents:
diff changeset
4434 {
Ritor1
parents:
diff changeset
4435 if ( v127 != 51 )
Ritor1
parents:
diff changeset
4436 goto LABEL_1166;
Ritor1
parents:
diff changeset
4437 LODWORD(v725) = 9;
Ritor1
parents:
diff changeset
4438 amount = v2 + 5;
Ritor1
parents:
diff changeset
4439 }
Ritor1
parents:
diff changeset
4440 }
Ritor1
parents:
diff changeset
4441 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4442 goto LABEL_83;
Ritor1
parents:
diff changeset
4443 v128 = v3->spellnum;
Ritor1
parents:
diff changeset
4444 v129 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4445 pGame->GetStru6()->SetPlayerBuffAnim(v128, v1);
Ritor1
parents:
diff changeset
4446 v83 = 1;
Ritor1
parents:
diff changeset
4447 v130 = v3->spellnum;
Ritor1
parents:
diff changeset
4448 v131 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4449 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1u);
Ritor1
parents:
diff changeset
4450 v132 = v3->spellnum;
Ritor1
parents:
diff changeset
4451 v133 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4452 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2u);
Ritor1
parents:
diff changeset
4453 v134 = v3->spellnum;
Ritor1
parents:
diff changeset
4454 v135 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4455 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3u);
Ritor1
parents:
diff changeset
4456 v726 = (Player *)((int)v733 << 7);
Ritor1
parents:
diff changeset
4457 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335;
Ritor1
parents:
diff changeset
4458 LABEL_304:
Ritor1
parents:
diff changeset
4459 v673 = v1;
Ritor1
parents:
diff changeset
4460 v662 = v1;
Ritor1
parents:
diff changeset
4461 v655 = amount;
Ritor1
parents:
diff changeset
4462 v652 = v731;
Ritor1
parents:
diff changeset
4463 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90;
Ritor1
parents:
diff changeset
4464 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)];
Ritor1
parents:
diff changeset
4465 goto LABEL_977;
Ritor1
parents:
diff changeset
4466 case 8:
Ritor1
parents:
diff changeset
4467 v138 = v12 - 2;
Ritor1
parents:
diff changeset
4468 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 )
Ritor1
parents:
diff changeset
4469 v140 = 600 * v2;
Ritor1
parents:
diff changeset
4470 else
Ritor1
parents:
diff changeset
4471 v140 = 60 * v2;
Ritor1
parents:
diff changeset
4472 LODWORD(v733) = v140;
Ritor1
parents:
diff changeset
4473 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4474 goto LABEL_83;
Ritor1
parents:
diff changeset
4475 v141 = v3->spellnum;
Ritor1
parents:
diff changeset
4476 v142 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4477 pGame->GetStru6()->SetPlayerBuffAnim(v141, v1);
Ritor1
parents:
diff changeset
4478 v143 = v3->spellnum;
Ritor1
parents:
diff changeset
4479 v144 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4480 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1u);
Ritor1
parents:
diff changeset
4481 v145 = v3->spellnum;
Ritor1
parents:
diff changeset
4482 v146 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4483 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2u);
Ritor1
parents:
diff changeset
4484 v147 = v3->spellnum;
Ritor1
parents:
diff changeset
4485 v148 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4486 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3u);
Ritor1
parents:
diff changeset
4487 v668 = v1;
Ritor1
parents:
diff changeset
4488 v726 = (Player *)((int)v733 << 7);
Ritor1
parents:
diff changeset
4489 v658 = v1;
Ritor1
parents:
diff changeset
4490 v653 = v2;
Ritor1
parents:
diff changeset
4491 v651 = v731;
Ritor1
parents:
diff changeset
4492 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
4493 v27 = (char *)&pParty->pPartyBuffs[10];
Ritor1
parents:
diff changeset
4494 goto LABEL_102;
Ritor1
parents:
diff changeset
4495 case 9:
Ritor1
parents:
diff changeset
4496 v149 = v12 - 1;
Ritor1
parents:
diff changeset
4497 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 )
Ritor1
parents:
diff changeset
4498 {
Ritor1
parents:
diff changeset
4499 if ( v151 == 1 )
Ritor1
parents:
diff changeset
4500 _this = (ItemGen *)20;
Ritor1
parents:
diff changeset
4501 }
Ritor1
parents:
diff changeset
4502 else
Ritor1
parents:
diff changeset
4503 {
Ritor1
parents:
diff changeset
4504 _this = (ItemGen *)16;
Ritor1
parents:
diff changeset
4505 }
Ritor1
parents:
diff changeset
4506 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
4507 {
Ritor1
parents:
diff changeset
4508 v66 = pGlobalTXT_LocalizationStrings[491];
Ritor1
parents:
diff changeset
4509 goto LABEL_201;
Ritor1
parents:
diff changeset
4510 }
Ritor1
parents:
diff changeset
4511 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4512 goto LABEL_83;
Ritor1
parents:
diff changeset
4513 LODWORD(v725) = a2 & 7;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
4514 if ( (a2 & 7) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
4515 {
Ritor1
parents:
diff changeset
4516 v152 = a2 >> 3;
Ritor1
parents:
diff changeset
4517 uRequiredMana = pActors[v152].vPosition.x;
Ritor1
parents:
diff changeset
4518 v153 = pActors[v152].vPosition.y;
Ritor1
parents:
diff changeset
4519 v154 = pActors[v152].vPosition.z;
Ritor1
parents:
diff changeset
4520 LODWORD(v727) = v153;
Ritor1
parents:
diff changeset
4521 }
Ritor1
parents:
diff changeset
4522 else
Ritor1
parents:
diff changeset
4523 {
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
4524 v155 = stru_5C6E00->Cos(pParty->sRotationY);
0
Ritor1
parents:
diff changeset
4525 uRequiredMana = pParty->vPosition.x + sub_42EBBE(2048, v155);
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
4526 v156 = stru_5C6E00->Sin(pParty->sRotationY);
0
Ritor1
parents:
diff changeset
4527 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156);
Ritor1
parents:
diff changeset
4528 v154 = pParty->vPosition.z;
Ritor1
parents:
diff changeset
4529 }
Ritor1
parents:
diff changeset
4530 HIDWORD(v733) = v154;
Ritor1
parents:
diff changeset
4531 v713 = v154 + 2500;
Ritor1
parents:
diff changeset
4532 v721 = v1;
Ritor1
parents:
diff changeset
4533 LODWORD(v718) = v1;
Ritor1
parents:
diff changeset
4534 if ( (signed int)this > v1 )
Ritor1
parents:
diff changeset
4535 {
Ritor1
parents:
diff changeset
4536 *(float *)&y = (double)SHIDWORD(v733);
Ritor1
parents:
diff changeset
4537 *(float *)&v732 = (double)v713;
Ritor1
parents:
diff changeset
4538 v730 = LODWORD(v725) == 3 ? a2 : 0;
Ritor1
parents:
diff changeset
4539 v726 = (Player *)this;
Ritor1
parents:
diff changeset
4540 do
Ritor1
parents:
diff changeset
4541 {
Ritor1
parents:
diff changeset
4542 v157 = rand();
Ritor1
parents:
diff changeset
4543 v158 = (double)SLODWORD(v718);
Ritor1
parents:
diff changeset
4544 v718 = v158;
Ritor1
parents:
diff changeset
4545 v159 = (double)v721;
Ritor1
parents:
diff changeset
4546 *(float *)&v721 = v159;
Ritor1
parents:
diff changeset
4547 a2 = v157 % 1000;
Ritor1
parents:
diff changeset
4548 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732;
Ritor1
parents:
diff changeset
4549 v725 = v159 * v159;
Ritor1
parents:
diff changeset
4550 *(float *)&_this = v158 * v158;
Ritor1
parents:
diff changeset
4551 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 )
Ritor1
parents:
diff changeset
4552 {
Ritor1
parents:
diff changeset
4553 LODWORD(v687) = v1;
Ritor1
parents:
diff changeset
4554 HIDWORD(v687) = v1;
Ritor1
parents:
diff changeset
4555 }
Ritor1
parents:
diff changeset
4556 else
Ritor1
parents:
diff changeset
4557 {
Ritor1
parents:
diff changeset
4558 x = (signed __int64)sqrt(*(float *)&_this + v725);
Ritor1
parents:
diff changeset
4559 v687 = __PAIR__(
Ritor1
parents:
diff changeset
4560 stru_5C6E00->Atan2(x, (signed __int64)*((float *)&v733 + 1)),
Ritor1
parents:
diff changeset
4561 stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721));
Ritor1
parents:
diff changeset
4562 }
Ritor1
parents:
diff changeset
4563 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
4564 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
4565 a1.field_4C = v2;
Ritor1
parents:
diff changeset
4566 a1.field_50 = v731;
Ritor1
parents:
diff changeset
4567 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
4568 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
4569 a1.vPosition.x = uRequiredMana;
Ritor1
parents:
diff changeset
4570 a1.vPosition.y = LODWORD(v727);
Ritor1
parents:
diff changeset
4571 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
4572 a1.vPosition.z = a2 + v713;
Ritor1
parents:
diff changeset
4573 a1.uSpriteFrameID = v1;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
4574 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player;
0
Ritor1
parents:
diff changeset
4575 a1.field_5C = v730;
Ritor1
parents:
diff changeset
4576 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500);
Ritor1
parents:
diff changeset
4577 a1.uFacing = v687;
Ritor1
parents:
diff changeset
4578 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
4579 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
4580 a1.uAttributes = 4;
Ritor1
parents:
diff changeset
4581 if ( a1.Create(
Ritor1
parents:
diff changeset
4582 v687,
Ritor1
parents:
diff changeset
4583 SHIDWORD(v687),
Ritor1
parents:
diff changeset
4584 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
Ritor1
parents:
diff changeset
4585 v1) != -1
Ritor1
parents:
diff changeset
4586 && pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
4587 ++pTurnEngine->field_1C;
Ritor1
parents:
diff changeset
4588 LODWORD(v718) = rand() % 1024 - 512;
Ritor1
parents:
diff changeset
4589 v160 = rand();
Ritor1
parents:
diff changeset
4590 v14 = v726 == (Player *)1;
Ritor1
parents:
diff changeset
4591 v726 = (Player *)((char *)v726 - 1);
Ritor1
parents:
diff changeset
4592 v721 = (unsigned __int64)(v160 % 1024) - 512;
Ritor1
parents:
diff changeset
4593 }
Ritor1
parents:
diff changeset
4594 while ( !v14 );
Ritor1
parents:
diff changeset
4595 }
Ritor1
parents:
diff changeset
4596 goto LABEL_1056;
Ritor1
parents:
diff changeset
4597 case 10:
Ritor1
parents:
diff changeset
4598 v67 = 2;
Ritor1
parents:
diff changeset
4599 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
Ritor1
parents:
diff changeset
4600 {
Ritor1
parents:
diff changeset
4601 v66 = pGlobalTXT_LocalizationStrings[492];
Ritor1
parents:
diff changeset
4602 goto LABEL_202;
Ritor1
parents:
diff changeset
4603 }
Ritor1
parents:
diff changeset
4604 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4605 goto LABEL_83;
Ritor1
parents:
diff changeset
4606 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096);
Ritor1
parents:
diff changeset
4607 v700.z = v1;
Ritor1
parents:
diff changeset
4608 v700.y = v1;
Ritor1
parents:
diff changeset
4609 v700.x = v1;
Ritor1
parents:
diff changeset
4610 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
4611 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
4612 a1.field_4C = v2;
Ritor1
parents:
diff changeset
4613 a1.field_50 = v731;
Ritor1
parents:
diff changeset
4614 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
4615 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
4616 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
4617 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
4618 v161 = v3->uPlayerID;
Ritor1
parents:
diff changeset
4619 a1.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
4620 a1.uFacing = v1;
Ritor1
parents:
diff changeset
4621 v161 *= 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
4622 LOBYTE(v161) = v161 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
4623 a1.field_58_pid = v161;
0
Ritor1
parents:
diff changeset
4624 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
4625 a2 = v1;
Ritor1
parents:
diff changeset
4626 if ( (signed int)v726 > v1 )
Ritor1
parents:
diff changeset
4627 {
Ritor1
parents:
diff changeset
4628 do
Ritor1
parents:
diff changeset
4629 {
Ritor1
parents:
diff changeset
4630 v162 = dword_50BF30[a2];
Ritor1
parents:
diff changeset
4631 a1.vPosition.x = pActors[v162].vPosition.x;
Ritor1
parents:
diff changeset
4632 a1.vPosition.y = pActors[v162].vPosition.y;
Ritor1
parents:
diff changeset
4633 v732 = pActors[v162].uActorHeight;
Ritor1
parents:
diff changeset
4634 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548);
Ritor1
parents:
diff changeset
4635 v163 = 8 * dword_50BF30[a2];
Ritor1
parents:
diff changeset
4636 LOBYTE(v163) = v163 | 3;
Ritor1
parents:
diff changeset
4637 a1.field_5C = v163;
Ritor1
parents:
diff changeset
4638 v164 = a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
4639 v165 = a2;
Ritor1
parents:
diff changeset
4640 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700);
Ritor1
parents:
diff changeset
4641 v166 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4642 v166->_4A81CA(&a1);
Ritor1
parents:
diff changeset
4643 v167 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4644 v167->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u);
Ritor1
parents:
diff changeset
4645 a2 = v165 + 1;
Ritor1
parents:
diff changeset
4646 }
Ritor1
parents:
diff changeset
4647 while ( v165 + 1 < (signed int)v726 );
Ritor1
parents:
diff changeset
4648 }
Ritor1
parents:
diff changeset
4649 goto LABEL_1056;
Ritor1
parents:
diff changeset
4650 case 12:
Ritor1
parents:
diff changeset
4651 LODWORD(v733) = 3600 * v2;
Ritor1
parents:
diff changeset
4652 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4653 goto LABEL_83;
Ritor1
parents:
diff changeset
4654 v168 = 0;
Ritor1
parents:
diff changeset
4655 do
Ritor1
parents:
diff changeset
4656 {
Ritor1
parents:
diff changeset
4657 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, v1, 65536);
Ritor1
parents:
diff changeset
4658 v716 = v169;
Ritor1
parents:
diff changeset
4659 }
Ritor1
parents:
diff changeset
4660 while ( v168 < 4 );
Ritor1
parents:
diff changeset
4661 v668 = v1;
Ritor1
parents:
diff changeset
4662 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
4663 v658 = v1;
Ritor1
parents:
diff changeset
4664 v653 = v1;
Ritor1
parents:
diff changeset
4665 v651 = v731;
Ritor1
parents:
diff changeset
4666 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
4667 goto LABEL_992;
Ritor1
parents:
diff changeset
4668 case 13:
Ritor1
parents:
diff changeset
4669 v170 = v12 - 1;
Ritor1
parents:
diff changeset
4670 if ( !v170 )
Ritor1
parents:
diff changeset
4671 {
Ritor1
parents:
diff changeset
4672 v173 = 300 * v2;
Ritor1
parents:
diff changeset
4673 goto LABEL_353;
Ritor1
parents:
diff changeset
4674 }
Ritor1
parents:
diff changeset
4675 v171 = v170 - 1;
Ritor1
parents:
diff changeset
4676 if ( !v171 )
Ritor1
parents:
diff changeset
4677 {
Ritor1
parents:
diff changeset
4678 v173 = 600 * v2;
Ritor1
parents:
diff changeset
4679 goto LABEL_353;
Ritor1
parents:
diff changeset
4680 }
Ritor1
parents:
diff changeset
4681 v172 = v171 - 1;
Ritor1
parents:
diff changeset
4682 if ( !v172 || v172 == 1 )
Ritor1
parents:
diff changeset
4683 {
Ritor1
parents:
diff changeset
4684 v173 = 3600 * v2;
Ritor1
parents:
diff changeset
4685 LABEL_353:
Ritor1
parents:
diff changeset
4686 LODWORD(v733) = v173;
Ritor1
parents:
diff changeset
4687 }
Ritor1
parents:
diff changeset
4688 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4689 goto LABEL_83;
Ritor1
parents:
diff changeset
4690 v174 = 0;
Ritor1
parents:
diff changeset
4691 do
Ritor1
parents:
diff changeset
4692 pOtherOverlayList->_4418B1(2010, v174++ + 100, v1, 65536);
Ritor1
parents:
diff changeset
4693 while ( v174 < 4 );
Ritor1
parents:
diff changeset
4694 v175 = v3->spellnum;
Ritor1
parents:
diff changeset
4695 v176 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4696 pGame->GetStru6()->SetPlayerBuffAnim(v175, v1);
Ritor1
parents:
diff changeset
4697 v83 = 1;
Ritor1
parents:
diff changeset
4698 v177 = v3->spellnum;
Ritor1
parents:
diff changeset
4699 v178 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4700 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1u);
Ritor1
parents:
diff changeset
4701 v179 = v3->spellnum;
Ritor1
parents:
diff changeset
4702 v180 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4703 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2u);
Ritor1
parents:
diff changeset
4704 v181 = v3->spellnum;
Ritor1
parents:
diff changeset
4705 v182 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4706 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3u);
Ritor1
parents:
diff changeset
4707 v673 = v1;
Ritor1
parents:
diff changeset
4708 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
4709 v662 = v1;
Ritor1
parents:
diff changeset
4710 v655 = v1;
Ritor1
parents:
diff changeset
4711 v652 = v731;
Ritor1
parents:
diff changeset
4712 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
4713 v137 = (char *)&pParty->pPartyBuffs[5];
Ritor1
parents:
diff changeset
4714 goto LABEL_976;
Ritor1
parents:
diff changeset
4715 case 15:
Ritor1
parents:
diff changeset
4716 v184 = v12 - 1;
Ritor1
parents:
diff changeset
4717 if ( v184 )
Ritor1
parents:
diff changeset
4718 {
Ritor1
parents:
diff changeset
4719 v185 = v184 - 1;
Ritor1
parents:
diff changeset
4720 if ( v185 )
Ritor1
parents:
diff changeset
4721 {
Ritor1
parents:
diff changeset
4722 v186 = v185 - 1;
Ritor1
parents:
diff changeset
4723 if ( v186 )
Ritor1
parents:
diff changeset
4724 {
Ritor1
parents:
diff changeset
4725 if ( v186 == 1 )
Ritor1
parents:
diff changeset
4726 amount = 9;
Ritor1
parents:
diff changeset
4727 }
Ritor1
parents:
diff changeset
4728 else
Ritor1
parents:
diff changeset
4729 {
Ritor1
parents:
diff changeset
4730 amount = 7;
Ritor1
parents:
diff changeset
4731 }
Ritor1
parents:
diff changeset
4732 }
Ritor1
parents:
diff changeset
4733 else
Ritor1
parents:
diff changeset
4734 {
Ritor1
parents:
diff changeset
4735 amount = 5;
Ritor1
parents:
diff changeset
4736 }
Ritor1
parents:
diff changeset
4737 }
Ritor1
parents:
diff changeset
4738 else
Ritor1
parents:
diff changeset
4739 {
Ritor1
parents:
diff changeset
4740 amount = 3;
Ritor1
parents:
diff changeset
4741 }
Ritor1
parents:
diff changeset
4742 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4743 goto LABEL_83;
Ritor1
parents:
diff changeset
4744 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
Ritor1
parents:
diff changeset
4745 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1);
Ritor1
parents:
diff changeset
4746 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
4747 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
4748 a1.field_4C = v2;
Ritor1
parents:
diff changeset
4749 a1.field_50 = v731;
Ritor1
parents:
diff changeset
4750 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
4751 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
4752 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
4753 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
4754 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
4755 a1.uSectorID = pIndoor->GetSector(
Ritor1
parents:
diff changeset
4756 pParty->vPosition.x,
Ritor1
parents:
diff changeset
4757 pParty->vPosition.y,
Ritor1
parents:
diff changeset
4758 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
Ritor1
parents:
diff changeset
4759 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
4760 v187 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
4761 LOBYTE(v187) = v187 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
4762 a1.field_58_pid = v187;
0
Ritor1
parents:
diff changeset
4763 a1.field_5C = a2;
Ritor1
parents:
diff changeset
4764 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
4765 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
4766 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
4767 LOBYTE(a1.uAttributes) |= 4u;
Ritor1
parents:
diff changeset
4768 v188 = (signed int)v726 / -2;
Ritor1
parents:
diff changeset
4769 v189 = (signed int)v726 / 2;
Ritor1
parents:
diff changeset
4770 while ( v188 <= v189 )
Ritor1
parents:
diff changeset
4771 {
Ritor1
parents:
diff changeset
4772 a1.uFacing = v188 + LOWORD(v715.uYawAngle);
Ritor1
parents:
diff changeset
4773 if ( a1.Create(
Ritor1
parents:
diff changeset
4774 (signed __int16)(v188 + LOWORD(v715.uYawAngle)),
Ritor1
parents:
diff changeset
4775 v715.uPitchAngle,
Ritor1
parents:
diff changeset
4776 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
Ritor1
parents:
diff changeset
4777 v3->uPlayerID + 1) != -1
Ritor1
parents:
diff changeset
4778 && pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
4779 ++pTurnEngine->field_1C;
Ritor1
parents:
diff changeset
4780 v188 += v732;
Ritor1
parents:
diff changeset
4781 }
Ritor1
parents:
diff changeset
4782 goto LABEL_1056;
Ritor1
parents:
diff changeset
4783 case 16:
Ritor1
parents:
diff changeset
4784 if ( pParty->uFlags & 8 )
Ritor1
parents:
diff changeset
4785 {
Ritor1
parents:
diff changeset
4786 v190 = pGlobalTXT_LocalizationStrings[493];
Ritor1
parents:
diff changeset
4787 goto LABEL_462;
Ritor1
parents:
diff changeset
4788 }
Ritor1
parents:
diff changeset
4789 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4790 goto LABEL_83;
Ritor1
parents:
diff changeset
4791 v191 = 0;
Ritor1
parents:
diff changeset
4792 do
Ritor1
parents:
diff changeset
4793 pOtherOverlayList->_4418B1(2040, v191++ + 100, v1, 65536);
Ritor1
parents:
diff changeset
4794 while ( v191 < 4 );
Ritor1
parents:
diff changeset
4795 BYTE1(pParty->uFlags) |= 1u;
Ritor1
parents:
diff changeset
4796 pParty->uFallSpeed = 1000;
Ritor1
parents:
diff changeset
4797 goto LABEL_1056;
Ritor1
parents:
diff changeset
4798 case 19:
Ritor1
parents:
diff changeset
4799 v192 = v12 - 1;
Ritor1
parents:
diff changeset
4800 if ( !v192 )
Ritor1
parents:
diff changeset
4801 {
Ritor1
parents:
diff changeset
4802 amount = v2;
Ritor1
parents:
diff changeset
4803 goto LABEL_391;
Ritor1
parents:
diff changeset
4804 }
Ritor1
parents:
diff changeset
4805 v193 = v192 - 1;
Ritor1
parents:
diff changeset
4806 if ( !v193 )
Ritor1
parents:
diff changeset
4807 {
Ritor1
parents:
diff changeset
4808 v196 = 2 * v2;
Ritor1
parents:
diff changeset
4809 LABEL_389:
Ritor1
parents:
diff changeset
4810 amount = v196;
Ritor1
parents:
diff changeset
4811 LABEL_391:
Ritor1
parents:
diff changeset
4812 v195 = 600 * v2;
Ritor1
parents:
diff changeset
4813 goto LABEL_392;
Ritor1
parents:
diff changeset
4814 }
Ritor1
parents:
diff changeset
4815 v194 = v193 - 1;
Ritor1
parents:
diff changeset
4816 if ( !v194 )
Ritor1
parents:
diff changeset
4817 {
Ritor1
parents:
diff changeset
4818 v196 = 3 * v2;
Ritor1
parents:
diff changeset
4819 goto LABEL_389;
Ritor1
parents:
diff changeset
4820 }
Ritor1
parents:
diff changeset
4821 if ( v194 != 1 )
Ritor1
parents:
diff changeset
4822 goto LABEL_393;
Ritor1
parents:
diff changeset
4823 amount = 4 * v2;
Ritor1
parents:
diff changeset
4824 v195 = 3600 * v2;
Ritor1
parents:
diff changeset
4825 LABEL_392:
Ritor1
parents:
diff changeset
4826 LODWORD(v733) = v195;
Ritor1
parents:
diff changeset
4827 LABEL_393:
Ritor1
parents:
diff changeset
4828 if ( pParty->uFlags & 0x30 )
Ritor1
parents:
diff changeset
4829 {
Ritor1
parents:
diff changeset
4830 v66 = pGlobalTXT_LocalizationStrings[638];
Ritor1
parents:
diff changeset
4831 goto LABEL_201;
Ritor1
parents:
diff changeset
4832 }
Ritor1
parents:
diff changeset
4833 if ( pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4834 {
Ritor1
parents:
diff changeset
4835 v197 = v3->spellnum;
Ritor1
parents:
diff changeset
4836 v198 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4837 pGame->GetStru6()->SetPlayerBuffAnim(v197, v1);
Ritor1
parents:
diff changeset
4838 v83 = 1;
Ritor1
parents:
diff changeset
4839 v199 = v3->spellnum;
Ritor1
parents:
diff changeset
4840 v200 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4841 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1u);
Ritor1
parents:
diff changeset
4842 v201 = v3->spellnum;
Ritor1
parents:
diff changeset
4843 v202 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4844 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2u);
Ritor1
parents:
diff changeset
4845 v203 = v3->spellnum;
Ritor1
parents:
diff changeset
4846 v204 = pGame->GetStru6();
Ritor1
parents:
diff changeset
4847 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3u);
Ritor1
parents:
diff changeset
4848 v673 = v1;
Ritor1
parents:
diff changeset
4849 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
4850 v662 = v1;
Ritor1
parents:
diff changeset
4851 v655 = amount;
Ritor1
parents:
diff changeset
4852 v652 = v731;
Ritor1
parents:
diff changeset
4853 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
4854 v137 = (char *)&pParty->pPartyBuffs[11];
Ritor1
parents:
diff changeset
4855 LABEL_976:
Ritor1
parents:
diff changeset
4856 v136 = pParty->uTimePlayed + v183;
Ritor1
parents:
diff changeset
4857 LABEL_977:
Ritor1
parents:
diff changeset
4858 ((SpellBuff *)v137)->Apply(v136, v652, v655, v662, v673);
Ritor1
parents:
diff changeset
4859 LABEL_978:
Ritor1
parents:
diff changeset
4860 LODWORD(v727) = v83;
Ritor1
parents:
diff changeset
4861 }
Ritor1
parents:
diff changeset
4862 goto LABEL_83;
Ritor1
parents:
diff changeset
4863 case 21:
Ritor1
parents:
diff changeset
4864 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
4865 {
Ritor1
parents:
diff changeset
4866 v190 = pGlobalTXT_LocalizationStrings[494];
Ritor1
parents:
diff changeset
4867 LABEL_462:
Ritor1
parents:
diff changeset
4868 ShowStatusBarString(v190, 2u);
Ritor1
parents:
diff changeset
4869 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1);
Ritor1
parents:
diff changeset
4870 goto LABEL_83;
Ritor1
parents:
diff changeset
4871 }
Ritor1
parents:
diff changeset
4872 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() )
Ritor1
parents:
diff changeset
4873 {
Ritor1
parents:
diff changeset
4874 LABEL_461:
Ritor1
parents:
diff changeset
4875 v190 = pGlobalTXT_LocalizationStrings[428];
Ritor1
parents:
diff changeset
4876 goto LABEL_462;
Ritor1
parents:
diff changeset
4877 }
Ritor1
parents:
diff changeset
4878 LODWORD(v733) = 3600 * v2;
Ritor1
parents:
diff changeset
4879 if ( v731 == 2 || v731 == 3 || (amount = v1, v731 != 4) )
Ritor1
parents:
diff changeset
4880 amount = 1;
Ritor1
parents:
diff changeset
4881 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4882 goto LABEL_83;
Ritor1
parents:
diff changeset
4883 v205 = 0;
Ritor1
parents:
diff changeset
4884 do
Ritor1
parents:
diff changeset
4885 pOtherOverlayList->_4418B1(2090, v205++ + 100, v1, 65536);
Ritor1
parents:
diff changeset
4886 while ( v205 < 4 );
Ritor1
parents:
diff changeset
4887 v206 = pOtherOverlayList->_4418B1(10008, 203, v1, 65536);
Ritor1
parents:
diff changeset
4888 v207 = v3->uPlayerID + 1;
Ritor1
parents:
diff changeset
4889 v716 = v206;
Ritor1
parents:
diff changeset
4890 v668 = v207;
Ritor1
parents:
diff changeset
4891 v658 = v206;
Ritor1
parents:
diff changeset
4892 v653 = amount;
Ritor1
parents:
diff changeset
4893 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
4894 v651 = v731;
Ritor1
parents:
diff changeset
4895 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
4896 v27 = (char *)&pParty->pPartyBuffs[7];
Ritor1
parents:
diff changeset
4897 LABEL_101:
Ritor1
parents:
diff changeset
4898 v26 = (signed int)v26;
Ritor1
parents:
diff changeset
4899 LABEL_102:
Ritor1
parents:
diff changeset
4900 v28 = pParty->uTimePlayed + v26;
Ritor1
parents:
diff changeset
4901 LABEL_103:
Ritor1
parents:
diff changeset
4902 HIDWORD(v650) = HIDWORD(v28);
Ritor1
parents:
diff changeset
4903 LABEL_104:
Ritor1
parents:
diff changeset
4904 LODWORD(v650) = v28;
Ritor1
parents:
diff changeset
4905 ((SpellBuff *)v27)->Apply(v650, v651, v653, v658, v668);
Ritor1
parents:
diff changeset
4906 goto LABEL_1056;
Ritor1
parents:
diff changeset
4907 case 22:
Ritor1
parents:
diff changeset
4908 v67 = 2;
Ritor1
parents:
diff changeset
4909 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
4910 {
Ritor1
parents:
diff changeset
4911 v66 = pGlobalTXT_LocalizationStrings[495];
Ritor1
parents:
diff changeset
4912 goto LABEL_202;
Ritor1
parents:
diff changeset
4913 }
Ritor1
parents:
diff changeset
4914 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
4915 goto LABEL_83;
Ritor1
parents:
diff changeset
4916 v208 = a2 & 7;
Ritor1
parents:
diff changeset
4917 LODWORD(v725) = a2 & 7;
Ritor1
parents:
diff changeset
4918 if ( v208 == 3 )
Ritor1
parents:
diff changeset
4919 {
Ritor1
parents:
diff changeset
4920 v209 = a2 >> 3;
Ritor1
parents:
diff changeset
4921 LODWORD(v718) = pActors[v209].vPosition.x;
Ritor1
parents:
diff changeset
4922 v210 = pActors[v209].vPosition.y;
Ritor1
parents:
diff changeset
4923 v211 = pActors[v209].vPosition.z;
Ritor1
parents:
diff changeset
4924 v713 = v210;
Ritor1
parents:
diff changeset
4925 }
Ritor1
parents:
diff changeset
4926 else
Ritor1
parents:
diff changeset
4927 {
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
4928 v212 = stru_5C6E00->Cos(pParty->sRotationY);
0
Ritor1
parents:
diff changeset
4929 LODWORD(v718) = pParty->vPosition.x + sub_42EBBE(2048, v212);
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
4930 v213 = stru_5C6E00->Sin(pParty->sRotationY);
0
Ritor1
parents:
diff changeset
4931 v214 = sub_42EBBE(2048, v213);
Ritor1
parents:
diff changeset
4932 v211 = pParty->vPosition.z;
Ritor1
parents:
diff changeset
4933 v713 = pParty->vPosition.y + v214;
Ritor1
parents:
diff changeset
4934 v208 = LODWORD(v725);
Ritor1
parents:
diff changeset
4935 }
Ritor1
parents:
diff changeset
4936 v726 = (Player *)v211;
Ritor1
parents:
diff changeset
4937 HIDWORD(v733) = v1;
Ritor1
parents:
diff changeset
4938 *(float *)&v732 = (double)v211;
Ritor1
parents:
diff changeset
4939 LODWORD(v725) = v211 + 2500;
Ritor1
parents:
diff changeset
4940 v721 = v1;
Ritor1
parents:
diff changeset
4941 *(float *)&y = (double)(v211 + 2500);
Ritor1
parents:
diff changeset
4942 v730 = v208 == 3 ? a2 : 0;
Ritor1
parents:
diff changeset
4943 a2 = 20;
Ritor1
parents:
diff changeset
4944 do
Ritor1
parents:
diff changeset
4945 {
Ritor1
parents:
diff changeset
4946 v215 = rand();
Ritor1
parents:
diff changeset
4947 v216 = (double)v721;
Ritor1
parents:
diff changeset
4948 v727 = v216;
Ritor1
parents:
diff changeset
4949 v217 = (double)SHIDWORD(v733);
Ritor1
parents:
diff changeset
4950 *(float *)&uRequiredMana = v217;
Ritor1
parents:
diff changeset
4951 _this = (ItemGen *)(v215 % 1000);
Ritor1
parents:
diff changeset
4952 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y;
Ritor1
parents:
diff changeset
4953 *(float *)&v721 = v217 * v217;
Ritor1
parents:
diff changeset
4954 *(float *)&v726 = v216 * v216;
Ritor1
parents:
diff changeset
4955 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 )
Ritor1
parents:
diff changeset
4956 {
Ritor1
parents:
diff changeset
4957 LODWORD(v685) = v1;
Ritor1
parents:
diff changeset
4958 HIDWORD(v685) = v1;
Ritor1
parents:
diff changeset
4959 }
Ritor1
parents:
diff changeset
4960 else
Ritor1
parents:
diff changeset
4961 {
Ritor1
parents:
diff changeset
4962 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721);
Ritor1
parents:
diff changeset
4963 v685 = __PAIR__(
Ritor1
parents:
diff changeset
4964 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)),
Ritor1
parents:
diff changeset
4965 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana));
Ritor1
parents:
diff changeset
4966 }
Ritor1
parents:
diff changeset
4967 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
4968 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
4969 a1.field_4C = v2;
Ritor1
parents:
diff changeset
4970 a1.field_50 = v731;
Ritor1
parents:
diff changeset
4971 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
4972 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
4973 a1.vPosition.x = LODWORD(v718);
Ritor1
parents:
diff changeset
4974 a1.vPosition.y = v713;
Ritor1
parents:
diff changeset
4975 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
4976 a1.vPosition.z = (int)((char *)_this + LODWORD(v725));
Ritor1
parents:
diff changeset
4977 a1.uSpriteFrameID = v1;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
4978 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player;
0
Ritor1
parents:
diff changeset
4979 a1.field_5C = v730;
Ritor1
parents:
diff changeset
4980 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges);
Ritor1
parents:
diff changeset
4981 a1.uFacing = v685;
Ritor1
parents:
diff changeset
4982 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
4983 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
4984 a1.uAttributes = 4;
Ritor1
parents:
diff changeset
4985 if ( a1.Create(
Ritor1
parents:
diff changeset
4986 v685,
Ritor1
parents:
diff changeset
4987 SHIDWORD(v685),
Ritor1
parents:
diff changeset
4988 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
Ritor1
parents:
diff changeset
4989 v1) != -1
Ritor1
parents:
diff changeset
4990 && pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
4991 ++pTurnEngine->field_1C;
Ritor1
parents:
diff changeset
4992 v721 = rand() % 1024 - 512;
Ritor1
parents:
diff changeset
4993 v218 = rand();
Ritor1
parents:
diff changeset
4994 v14 = a2-- == 1;
Ritor1
parents:
diff changeset
4995 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512;
Ritor1
parents:
diff changeset
4996 }
Ritor1
parents:
diff changeset
4997 while ( !v14 );
Ritor1
parents:
diff changeset
4998 goto LABEL_1056;
Ritor1
parents:
diff changeset
4999 case 23:
Ritor1
parents:
diff changeset
5000 v219 = v12 - 2;
Ritor1
parents:
diff changeset
5001 if ( v219 )
Ritor1
parents:
diff changeset
5002 {
Ritor1
parents:
diff changeset
5003 v220 = v219 - 1;
Ritor1
parents:
diff changeset
5004 if ( v220 )
Ritor1
parents:
diff changeset
5005 {
Ritor1
parents:
diff changeset
5006 if ( v220 == 1 )
Ritor1
parents:
diff changeset
5007 {
Ritor1
parents:
diff changeset
5008 amount = v1;
Ritor1
parents:
diff changeset
5009 goto LABEL_433;
Ritor1
parents:
diff changeset
5010 }
Ritor1
parents:
diff changeset
5011 v221 = 180 * v2;
Ritor1
parents:
diff changeset
5012 }
Ritor1
parents:
diff changeset
5013 else
Ritor1
parents:
diff changeset
5014 {
Ritor1
parents:
diff changeset
5015 v221 = 86400 * v2;
Ritor1
parents:
diff changeset
5016 }
Ritor1
parents:
diff changeset
5017 }
Ritor1
parents:
diff changeset
5018 else
Ritor1
parents:
diff changeset
5019 {
Ritor1
parents:
diff changeset
5020 v221 = 3600 * v2;
Ritor1
parents:
diff changeset
5021 }
Ritor1
parents:
diff changeset
5022 amount = v221;
Ritor1
parents:
diff changeset
5023 LABEL_433:
Ritor1
parents:
diff changeset
5024 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5025 goto LABEL_83;
Ritor1
parents:
diff changeset
5026 v222 = (char *)pParty->pPlayers;
Ritor1
parents:
diff changeset
5027 HIDWORD(v733) = (int)(char *)&pParty + 2508;
Ritor1
parents:
diff changeset
5028 break;
Ritor1
parents:
diff changeset
5029 case 24:
Ritor1
parents:
diff changeset
5030 v224 = v12 - 2;
Ritor1
parents:
diff changeset
5031 if ( v224 )
Ritor1
parents:
diff changeset
5032 {
Ritor1
parents:
diff changeset
5033 v225 = v224 - 1;
Ritor1
parents:
diff changeset
5034 if ( v225 )
Ritor1
parents:
diff changeset
5035 {
Ritor1
parents:
diff changeset
5036 if ( v225 == 1 )
Ritor1
parents:
diff changeset
5037 amount = 7;
Ritor1
parents:
diff changeset
5038 else
Ritor1
parents:
diff changeset
5039 amount = 1;
Ritor1
parents:
diff changeset
5040 }
Ritor1
parents:
diff changeset
5041 else
Ritor1
parents:
diff changeset
5042 {
Ritor1
parents:
diff changeset
5043 amount = 5;
Ritor1
parents:
diff changeset
5044 }
Ritor1
parents:
diff changeset
5045 }
Ritor1
parents:
diff changeset
5046 else
Ritor1
parents:
diff changeset
5047 {
Ritor1
parents:
diff changeset
5048 amount = 3;
Ritor1
parents:
diff changeset
5049 }
Ritor1
parents:
diff changeset
5050 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5051 goto LABEL_83;
Ritor1
parents:
diff changeset
5052 HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
Ritor1
parents:
diff changeset
5053 if ( amount == 1 )
Ritor1
parents:
diff changeset
5054 {
Ritor1
parents:
diff changeset
5055 LABEL_152:
Ritor1
parents:
diff changeset
5056 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
5057 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
5058 a1.field_50 = v731;
Ritor1
parents:
diff changeset
5059 a1.field_4C = v2;
Ritor1
parents:
diff changeset
5060 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
5061 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
5062 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
5063 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
5064 v660 = pParty->vPosition.y;
Ritor1
parents:
diff changeset
5065 LABEL_153:
Ritor1
parents:
diff changeset
5066 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
5067 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
5068 a1.vPosition.z = v51;
Ritor1
parents:
diff changeset
5069 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671);
Ritor1
parents:
diff changeset
5070 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
5071 a1.uSectorID = v52;
Ritor1
parents:
diff changeset
5072 v53 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5073 LOBYTE(v53) = v53 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5074 a1.field_58_pid = v53;
0
Ritor1
parents:
diff changeset
5075 a1.field_5C = a2;
Ritor1
parents:
diff changeset
5076 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
5077 a1.uFacing = LOWORD(v715.uYawAngle);
Ritor1
parents:
diff changeset
5078 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
5079 LABEL_154:
Ritor1
parents:
diff changeset
5080 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
5081 LOBYTE(a1.uAttributes) |= 4u;
Ritor1
parents:
diff changeset
5082 LABEL_156:
Ritor1
parents:
diff changeset
5083 v669 = v3->uPlayerID + 1;
Ritor1
parents:
diff changeset
5084 v36 = v715.uYawAngle;
Ritor1
parents:
diff changeset
5085 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
Ritor1
parents:
diff changeset
5086 v654 = v715.uPitchAngle;
Ritor1
parents:
diff changeset
5087 LABEL_157:
Ritor1
parents:
diff changeset
5088 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
5089 ++pTurnEngine->field_1C;
Ritor1
parents:
diff changeset
5090 }
Ritor1
parents:
diff changeset
5091 else
Ritor1
parents:
diff changeset
5092 {
Ritor1
parents:
diff changeset
5093 v732 = SHIDWORD(v733) / (amount - 1);
Ritor1
parents:
diff changeset
5094 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
5095 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
5096 a1.field_4C = v2;
Ritor1
parents:
diff changeset
5097 a1.field_50 = v731;
Ritor1
parents:
diff changeset
5098 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
5099 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
5100 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
5101 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
5102 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
5103 a1.uSectorID = pIndoor->GetSector(
Ritor1
parents:
diff changeset
5104 pParty->vPosition.x,
Ritor1
parents:
diff changeset
5105 pParty->vPosition.y,
Ritor1
parents:
diff changeset
5106 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
Ritor1
parents:
diff changeset
5107 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
5108 v226 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5109 LOBYTE(v226) = v226 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5110 a1.field_58_pid = v226;
0
Ritor1
parents:
diff changeset
5111 a1.field_5C = a2;
Ritor1
parents:
diff changeset
5112 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
5113 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
5114 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
5115 LOBYTE(a1.uAttributes) |= 4u;
Ritor1
parents:
diff changeset
5116 v227 = SHIDWORD(v733) / -2;
Ritor1
parents:
diff changeset
5117 y = (char *)(SHIDWORD(v733) / 2);
Ritor1
parents:
diff changeset
5118 if ( SHIDWORD(v733) / -2 <= SHIDWORD(v733) / 2 )
Ritor1
parents:
diff changeset
5119 {
Ritor1
parents:
diff changeset
5120 v228 = v715.uYawAngle;
Ritor1
parents:
diff changeset
5121 do
Ritor1
parents:
diff changeset
5122 {
Ritor1
parents:
diff changeset
5123 a1.uFacing = v227 + v228;
Ritor1
parents:
diff changeset
5124 if ( a1.Create(
Ritor1
parents:
diff changeset
5125 v227 + v228,
Ritor1
parents:
diff changeset
5126 v715.uPitchAngle,
Ritor1
parents:
diff changeset
5127 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
Ritor1
parents:
diff changeset
5128 v3->uPlayerID + 1) != -1
Ritor1
parents:
diff changeset
5129 && pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
5130 ++pTurnEngine->field_1C;
Ritor1
parents:
diff changeset
5131 v227 += v732;
Ritor1
parents:
diff changeset
5132 }
Ritor1
parents:
diff changeset
5133 while ( v227 <= (signed int)y );
Ritor1
parents:
diff changeset
5134 }
Ritor1
parents:
diff changeset
5135 }
Ritor1
parents:
diff changeset
5136 goto LABEL_1056;
Ritor1
parents:
diff changeset
5137 case 27:
Ritor1
parents:
diff changeset
5138 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() )
Ritor1
parents:
diff changeset
5139 goto LABEL_461;
Ritor1
parents:
diff changeset
5140 if ( v731 == 2 || v731 != 3 && v731 != 4 )
Ritor1
parents:
diff changeset
5141 v229 = 600 * v2;
Ritor1
parents:
diff changeset
5142 else
Ritor1
parents:
diff changeset
5143 v229 = 3600 * v2;
Ritor1
parents:
diff changeset
5144 LODWORD(v733) = v229;
Ritor1
parents:
diff changeset
5145 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5146 goto LABEL_83;
Ritor1
parents:
diff changeset
5147 v716 = pOtherOverlayList->_4418B1(10005, 201, v1, 65536);
Ritor1
parents:
diff changeset
5148 v230 = v3->spellnum;
Ritor1
parents:
diff changeset
5149 v231 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5150 pGame->GetStru6()->SetPlayerBuffAnim(v230, v1);
Ritor1
parents:
diff changeset
5151 v232 = 1;
Ritor1
parents:
diff changeset
5152 v233 = v3->spellnum;
Ritor1
parents:
diff changeset
5153 v234 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5154 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1u);
Ritor1
parents:
diff changeset
5155 v235 = v3->spellnum;
Ritor1
parents:
diff changeset
5156 v236 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5157 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2u);
Ritor1
parents:
diff changeset
5158 v237 = v3->spellnum;
Ritor1
parents:
diff changeset
5159 v238 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5160 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3u);
Ritor1
parents:
diff changeset
5161 v239 = v3->uPlayerID + 1;
Ritor1
parents:
diff changeset
5162 v732 = v229 << 7;
Ritor1
parents:
diff changeset
5163 pParty->pPartyBuffs[18].Apply(
Ritor1
parents:
diff changeset
5164 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335),
Ritor1
parents:
diff changeset
5165 v731,
Ritor1
parents:
diff changeset
5166 amount,
Ritor1
parents:
diff changeset
5167 v716,
Ritor1
parents:
diff changeset
5168 v239);
Ritor1
parents:
diff changeset
5169 if ( v731 == 4 )
Ritor1
parents:
diff changeset
5170 pParty->pPartyBuffs[18].uFlags = 1;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
5171 LODWORD(v727) = v232;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
5172 goto LABEL_83;
0
Ritor1
parents:
diff changeset
5173 case 28:
Ritor1
parents:
diff changeset
5174 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5175 goto LABEL_83;
Ritor1
parents:
diff changeset
5176 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2];
Ritor1
parents:
diff changeset
5177 y = v240;
Ritor1
parents:
diff changeset
5178 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 )
Ritor1
parents:
diff changeset
5179 goto LABEL_199;
Ritor1
parents:
diff changeset
5180 if ( v731 == 1 || v731 == 2 )
Ritor1
parents:
diff changeset
5181 {
Ritor1
parents:
diff changeset
5182 v241 = (double)v723 * 0.0099999998 + 0.5;
Ritor1
parents:
diff changeset
5183 }
Ritor1
parents:
diff changeset
5184 else
Ritor1
parents:
diff changeset
5185 {
Ritor1
parents:
diff changeset
5186 if ( v731 == 3 )
Ritor1
parents:
diff changeset
5187 {
Ritor1
parents:
diff changeset
5188 v241 = (double)v723 * 0.0099999998 + 0.69999999;
Ritor1
parents:
diff changeset
5189 }
Ritor1
parents:
diff changeset
5190 else
Ritor1
parents:
diff changeset
5191 {
Ritor1
parents:
diff changeset
5192 if ( v731 != 4 )
Ritor1
parents:
diff changeset
5193 {
Ritor1
parents:
diff changeset
5194 v241 = 0.0;
Ritor1
parents:
diff changeset
5195 goto LABEL_484;
Ritor1
parents:
diff changeset
5196 }
Ritor1
parents:
diff changeset
5197 v241 = (double)v723 * 0.0099999998 + 0.80000001;
Ritor1
parents:
diff changeset
5198 }
Ritor1
parents:
diff changeset
5199 }
Ritor1
parents:
diff changeset
5200 if ( v241 > 1.0 )
Ritor1
parents:
diff changeset
5201 v241 = 1.0;
Ritor1
parents:
diff changeset
5202 LABEL_484:
Ritor1
parents:
diff changeset
5203 v732 = (unsigned __int8)v240[25];
Ritor1
parents:
diff changeset
5204 v242 = (signed __int64)((double)v732 * v241);
Ritor1
parents:
diff changeset
5205 v243 = y;
Ritor1
parents:
diff changeset
5206 y[25] = v242;
Ritor1
parents:
diff changeset
5207 *((int *)v243 + 4) = (unsigned __int8)v242;
Ritor1
parents:
diff changeset
5208 if ( (unsigned __int8)v242 <= v1 )
Ritor1
parents:
diff changeset
5209 {
Ritor1
parents:
diff changeset
5210 *(int *)v243 = v1;
Ritor1
parents:
diff changeset
5211 dword_50C9D0 = 113;
Ritor1
parents:
diff changeset
5212 dword_50C9D4 = v1;
Ritor1
parents:
diff changeset
5213 dword_50C9D8 = 1;
Ritor1
parents:
diff changeset
5214 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u);
Ritor1
parents:
diff changeset
5215 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1);
Ritor1
parents:
diff changeset
5216 v3->spellnum = v1;
Ritor1
parents:
diff changeset
5217 goto LABEL_1165;
Ritor1
parents:
diff changeset
5218 }
Ritor1
parents:
diff changeset
5219 *((int *)v243 + 5) |= 0x40u;
Ritor1
parents:
diff changeset
5220 goto LABEL_1055;
Ritor1
parents:
diff changeset
5221 case 30:
Ritor1
parents:
diff changeset
5222 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5223 goto LABEL_83;
Ritor1
parents:
diff changeset
5224 uRequiredMana = v1;
Ritor1
parents:
diff changeset
5225 HIDWORD(v733) = 10 * v2;
Ritor1
parents:
diff changeset
5226 v730 = 1;
Ritor1
parents:
diff changeset
5227 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2];
Ritor1
parents:
diff changeset
5228 v726 = &pParty->pPlayers[v3->uPlayerID_2];
Ritor1
parents:
diff changeset
5229 if ( v731 == 1 )
Ritor1
parents:
diff changeset
5230 {
Ritor1
parents:
diff changeset
5231 v245 = (int)&v244[36 * a2 + 532];
Ritor1
parents:
diff changeset
5232 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName;
Ritor1
parents:
diff changeset
5233 v311 = __OFSUB__(*(int *)v245, 134);
Ritor1
parents:
diff changeset
5234 v14 = *(int *)v245 == 134;
Ritor1
parents:
diff changeset
5235 v310 = *(int *)v245 - 134 < 0;
Ritor1
parents:
diff changeset
5236 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4;
Ritor1
parents:
diff changeset
5237 if ( (unsigned __int8)(v310 ^ v311) | v14 )
Ritor1
parents:
diff changeset
5238 {
Ritor1
parents:
diff changeset
5239 if ( *(int *)&v244[36 * a2 + 544] == v1 )
Ritor1
parents:
diff changeset
5240 {
Ritor1
parents:
diff changeset
5241 if ( *(int *)&v244[36 * a2 + 536] == v1 )
Ritor1
parents:
diff changeset
5242 {
Ritor1
parents:
diff changeset
5243 if ( *(int *)&v244[36 * a2 + 540] == v1 )
Ritor1
parents:
diff changeset
5244 {
Ritor1
parents:
diff changeset
5245 v312 = v309[28];
Ritor1
parents:
diff changeset
5246 if ( v312 )
Ritor1
parents:
diff changeset
5247 {
Ritor1
parents:
diff changeset
5248 if ( v312 != 1 )
Ritor1
parents:
diff changeset
5249 {
Ritor1
parents:
diff changeset
5250 if ( v312 != 2 )
Ritor1
parents:
diff changeset
5251 {
Ritor1
parents:
diff changeset
5252 _this = (ItemGen *)&v244[36 * a2 + 552];
Ritor1
parents:
diff changeset
5253 if ( !(v244[36 * a2 + 552] & 2) )
Ritor1
parents:
diff changeset
5254 {
Ritor1
parents:
diff changeset
5255 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 )
Ritor1
parents:
diff changeset
5256 {
Ritor1
parents:
diff changeset
5257 uRequiredMana = 1;
Ritor1
parents:
diff changeset
5258 v730 = v1;
Ritor1
parents:
diff changeset
5259 }
Ritor1
parents:
diff changeset
5260 if ( rand() % 100 >= SHIDWORD(v733) )
Ritor1
parents:
diff changeset
5261 uRequiredMana = 1;
Ritor1
parents:
diff changeset
5262 if ( uRequiredMana == v1 )
Ritor1
parents:
diff changeset
5263 {
Ritor1
parents:
diff changeset
5264 v313 = *(char *)(LODWORD(v725) + 28);
Ritor1
parents:
diff changeset
5265 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 )
Ritor1
parents:
diff changeset
5266 {
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5267 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType];
0
Ritor1
parents:
diff changeset
5268 *(int *)(v245 + 4) = 0;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5269 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
0
Ritor1
parents:
diff changeset
5270 + 1];
Ritor1
parents:
diff changeset
5271 ;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5272 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
0
Ritor1
parents:
diff changeset
5273 + 1] )
Ritor1
parents:
diff changeset
5274 {
Ritor1
parents:
diff changeset
5275 ++*(int *)(v245 + 4);
Ritor1
parents:
diff changeset
5276 if ( j >= v314 )
Ritor1
parents:
diff changeset
5277 break;
Ritor1
parents:
diff changeset
5278 }
Ritor1
parents:
diff changeset
5279 v254 = rand();
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5280 v255 = 10;//pItemsTable->field_116D8[17];
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5281 v256 = 10;//pItemsTable->field_116D8[16];
0
Ritor1
parents:
diff changeset
5282 LABEL_611:
Ritor1
parents:
diff changeset
5283 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1);
Ritor1
parents:
diff changeset
5284 LABEL_612:
Ritor1
parents:
diff changeset
5285 _this->uItemID |= 0x20u;
Ritor1
parents:
diff changeset
5286 goto LABEL_1055;
Ritor1
parents:
diff changeset
5287 }
Ritor1
parents:
diff changeset
5288 goto LABEL_615;
Ritor1
parents:
diff changeset
5289 }
Ritor1
parents:
diff changeset
5290 LABEL_613:
Ritor1
parents:
diff changeset
5291 v316 = _this->uItemID;
Ritor1
parents:
diff changeset
5292 if ( !(BYTE1(v316) & 2) )
Ritor1
parents:
diff changeset
5293 {
Ritor1
parents:
diff changeset
5294 LOBYTE(v316) = v316 | 2;
Ritor1
parents:
diff changeset
5295 _this->uItemID = v316;
Ritor1
parents:
diff changeset
5296 }
Ritor1
parents:
diff changeset
5297 }
Ritor1
parents:
diff changeset
5298 }
Ritor1
parents:
diff changeset
5299 }
Ritor1
parents:
diff changeset
5300 }
Ritor1
parents:
diff changeset
5301 }
Ritor1
parents:
diff changeset
5302 }
Ritor1
parents:
diff changeset
5303 }
Ritor1
parents:
diff changeset
5304 }
Ritor1
parents:
diff changeset
5305 LABEL_616:
Ritor1
parents:
diff changeset
5306 if ( LODWORD(v727) == v1 )
Ritor1
parents:
diff changeset
5307 {
Ritor1
parents:
diff changeset
5308 v317 = pGlobalTXT_LocalizationStrings[428];
Ritor1
parents:
diff changeset
5309 if ( v730 == v1 )
Ritor1
parents:
diff changeset
5310 v317 = pGlobalTXT_LocalizationStrings[585];
Ritor1
parents:
diff changeset
5311 ShowStatusBarString(v317, 2u);
Ritor1
parents:
diff changeset
5312 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1);
Ritor1
parents:
diff changeset
5313 v318 = v726;
Ritor1
parents:
diff changeset
5314 v3->spellnum = v1;
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
5315 v318->PlaySound(SPEECH_43, v1);
0
Ritor1
parents:
diff changeset
5316 }
Ritor1
parents:
diff changeset
5317 goto LABEL_83;
Ritor1
parents:
diff changeset
5318 }
Ritor1
parents:
diff changeset
5319 if ( v731 != 2 )
Ritor1
parents:
diff changeset
5320 {
Ritor1
parents:
diff changeset
5321 if ( v731 == 3 )
Ritor1
parents:
diff changeset
5322 {
Ritor1
parents:
diff changeset
5323 v245 = (int)&v244[36 * a2 + 532];
Ritor1
parents:
diff changeset
5324 v269 = *(int *)v245;
Ritor1
parents:
diff changeset
5325 if ( *(int *)v245 > 134
Ritor1
parents:
diff changeset
5326 || *(int *)(v245 + 12) != v1
Ritor1
parents:
diff changeset
5327 || *(int *)(v245 + 4) != v1
Ritor1
parents:
diff changeset
5328 || *(int *)(v245 + 8) != v1
Ritor1
parents:
diff changeset
5329 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) )
Ritor1
parents:
diff changeset
5330 goto LABEL_616;
Ritor1
parents:
diff changeset
5331 v270 = (char *)&pItemsTable->pItems[v269].pIconName;
Ritor1
parents:
diff changeset
5332 LODWORD(v725) = (int)v270;
Ritor1
parents:
diff changeset
5333 v271 = v270[28];
Ritor1
parents:
diff changeset
5334 if ( v271 && v271 != 1 && v271 != 2 )
Ritor1
parents:
diff changeset
5335 v272 = ((ItemGen *)v245)->GetValue() < 0x1C2;
Ritor1
parents:
diff changeset
5336 else
Ritor1
parents:
diff changeset
5337 v272 = ((ItemGen *)v245)->GetValue() < 0xFA;
Ritor1
parents:
diff changeset
5338 if ( v272 )
Ritor1
parents:
diff changeset
5339 {
Ritor1
parents:
diff changeset
5340 uRequiredMana = 1;
Ritor1
parents:
diff changeset
5341 v730 = v1;
Ritor1
parents:
diff changeset
5342 }
Ritor1
parents:
diff changeset
5343 if ( rand() % 100 >= SHIDWORD(v733) )
Ritor1
parents:
diff changeset
5344 uRequiredMana = 1;
Ritor1
parents:
diff changeset
5345 if ( uRequiredMana != v1 )
Ritor1
parents:
diff changeset
5346 goto LABEL_613;
Ritor1
parents:
diff changeset
5347 v273 = v725;
Ritor1
parents:
diff changeset
5348 v274 = *(char *)(LODWORD(v725) + 28);
Ritor1
parents:
diff changeset
5349 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 )
Ritor1
parents:
diff changeset
5350 {
Ritor1
parents:
diff changeset
5351 if ( rand() % 100 < 80
Ritor1
parents:
diff changeset
5352 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) )
Ritor1
parents:
diff changeset
5353 {
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5354 v275 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType];
0
Ritor1
parents:
diff changeset
5355 *(int *)(v245 + 4) = 0;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5356 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1];
0
Ritor1
parents:
diff changeset
5357 ;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5358 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
0
Ritor1
parents:
diff changeset
5359 + 1] )
Ritor1
parents:
diff changeset
5360 {
Ritor1
parents:
diff changeset
5361 ++*(int *)(v245 + 4);
Ritor1
parents:
diff changeset
5362 if ( k >= v275 )
Ritor1
parents:
diff changeset
5363 break;
Ritor1
parents:
diff changeset
5364 }
Ritor1
parents:
diff changeset
5365 v254 = rand();
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5366 v255 = 10;//pItemsTable->field_116D8[19];
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5367 v256 = 10;//pItemsTable->field_116D8[18];
0
Ritor1
parents:
diff changeset
5368 goto LABEL_611;
Ritor1
parents:
diff changeset
5369 }
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5370 v277 = pItemsTable->pSpecialEnchantments_count;
0
Ritor1
parents:
diff changeset
5371 v278 = 0;
Ritor1
parents:
diff changeset
5372 v725 = 0.0;
Ritor1
parents:
diff changeset
5373 HIDWORD(v733) = 0;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5374 if ( pItemsTable->pSpecialEnchantments_count > 0 )
0
Ritor1
parents:
diff changeset
5375 {
Ritor1
parents:
diff changeset
5376 v730 = (int)&v679;
Ritor1
parents:
diff changeset
5377 do
Ritor1
parents:
diff changeset
5378 {
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5379 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement);
0
Ritor1
parents:
diff changeset
5380 if ( !v279 || v279 == 1 )
Ritor1
parents:
diff changeset
5381 {
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5382 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
0
Ritor1
parents:
diff changeset
5383 + 4]
Ritor1
parents:
diff changeset
5384 + v278 * 28);
Ritor1
parents:
diff changeset
5385 LODWORD(v725) += v280;
Ritor1
parents:
diff changeset
5386 if ( v280 )
Ritor1
parents:
diff changeset
5387 {
Ritor1
parents:
diff changeset
5388 v281 = v730;
Ritor1
parents:
diff changeset
5389 v730 += 4;
Ritor1
parents:
diff changeset
5390 *(int *)v281 = HIDWORD(v733);
Ritor1
parents:
diff changeset
5391 }
Ritor1
parents:
diff changeset
5392 }
Ritor1
parents:
diff changeset
5393 ++HIDWORD(v733);
Ritor1
parents:
diff changeset
5394 ++v278;
Ritor1
parents:
diff changeset
5395 }
Ritor1
parents:
diff changeset
5396 while ( SHIDWORD(v733) < v277 );
Ritor1
parents:
diff changeset
5397 }
Ritor1
parents:
diff changeset
5398 v282 = rand() % SLODWORD(v725);
Ritor1
parents:
diff changeset
5399 v283 = v679;
Ritor1
parents:
diff changeset
5400 *(int *)(v245 + 12) = v679;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5401 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4];
0
Ritor1
parents:
diff changeset
5402 v285 = v282 + 1;
Ritor1
parents:
diff changeset
5403 if ( v284 < v285 )
Ritor1
parents:
diff changeset
5404 {
Ritor1
parents:
diff changeset
5405 for ( l = &v679; ; l = (int *)v732 )
Ritor1
parents:
diff changeset
5406 {
Ritor1
parents:
diff changeset
5407 v287 = (int)(l + 1);
Ritor1
parents:
diff changeset
5408 v732 = v287;
Ritor1
parents:
diff changeset
5409 v288 = *(int *)v287;
Ritor1
parents:
diff changeset
5410 *(int *)(v245 + 12) = v288;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5411 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
0
Ritor1
parents:
diff changeset
5412 + 4];
Ritor1
parents:
diff changeset
5413 if ( v284 >= v285 )
Ritor1
parents:
diff changeset
5414 break;
Ritor1
parents:
diff changeset
5415 }
Ritor1
parents:
diff changeset
5416 }
Ritor1
parents:
diff changeset
5417 goto LABEL_525;
Ritor1
parents:
diff changeset
5418 }
Ritor1
parents:
diff changeset
5419 }
Ritor1
parents:
diff changeset
5420 else
Ritor1
parents:
diff changeset
5421 {
Ritor1
parents:
diff changeset
5422 if ( v731 != 4
Ritor1
parents:
diff changeset
5423 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134)
Ritor1
parents:
diff changeset
5424 || v726->pInventoryItems[a2].uAdditionalValue != v1
Ritor1
parents:
diff changeset
5425 || v726->pInventoryItems[a2]._bonus_type != v1
Ritor1
parents:
diff changeset
5426 || v726->pInventoryItems[a2]._bonus_strength != v1
315
2a09e1d6fc8f Some 0041D895 GameUI_DrawItemInfo overhaul
Nomad
parents: 305
diff changeset
5427 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) )
0
Ritor1
parents:
diff changeset
5428 goto LABEL_616;
Ritor1
parents:
diff changeset
5429 v247 = (char *)&pItemsTable->pItems[v246].pIconName;
Ritor1
parents:
diff changeset
5430 LODWORD(v725) = (int)v247;
Ritor1
parents:
diff changeset
5431 v248 = v247[28];
Ritor1
parents:
diff changeset
5432 if ( v248 && v248 != 1 && v248 != 2 )
Ritor1
parents:
diff changeset
5433 v249 = v726->pInventoryItems[a2].GetValue() < 0x1C2;
Ritor1
parents:
diff changeset
5434 else
Ritor1
parents:
diff changeset
5435 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA;
Ritor1
parents:
diff changeset
5436 if ( v249 )
Ritor1
parents:
diff changeset
5437 {
Ritor1
parents:
diff changeset
5438 uRequiredMana = 1;
Ritor1
parents:
diff changeset
5439 v730 = v1;
Ritor1
parents:
diff changeset
5440 }
Ritor1
parents:
diff changeset
5441 if ( rand() % 100 >= SHIDWORD(v733) )
Ritor1
parents:
diff changeset
5442 uRequiredMana = 1;
Ritor1
parents:
diff changeset
5443 if ( uRequiredMana != v1 )
Ritor1
parents:
diff changeset
5444 goto LABEL_613;
Ritor1
parents:
diff changeset
5445 v250 = v725;
Ritor1
parents:
diff changeset
5446 v251 = *(char *)(LODWORD(v725) + 28);
Ritor1
parents:
diff changeset
5447 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 )
Ritor1
parents:
diff changeset
5448 {
Ritor1
parents:
diff changeset
5449 if ( rand() % 100 < 80
Ritor1
parents:
diff changeset
5450 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) )
Ritor1
parents:
diff changeset
5451 {
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5452 v252 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType];
0
Ritor1
parents:
diff changeset
5453 *(int *)(v245 + 4) = 0;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5454 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1];
0
Ritor1
parents:
diff changeset
5455 ;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5456 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType
0
Ritor1
parents:
diff changeset
5457 + 1] )
Ritor1
parents:
diff changeset
5458 {
Ritor1
parents:
diff changeset
5459 ++*(int *)(v245 + 4);
Ritor1
parents:
diff changeset
5460 if ( m >= v252 )
Ritor1
parents:
diff changeset
5461 break;
Ritor1
parents:
diff changeset
5462 }
Ritor1
parents:
diff changeset
5463 v254 = rand();
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5464 v255 = 10;// pItemsTable->field_116D8[21];
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5465 v256 = 10;//pItemsTable->field_116D8[20];
0
Ritor1
parents:
diff changeset
5466 goto LABEL_611;
Ritor1
parents:
diff changeset
5467 }
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5468 v257 = pItemsTable->pSpecialEnchantments_count;
0
Ritor1
parents:
diff changeset
5469 v258 = 0;
Ritor1
parents:
diff changeset
5470 v725 = 0.0;
Ritor1
parents:
diff changeset
5471 HIDWORD(v733) = 0;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5472 if ( pItemsTable->pSpecialEnchantments_count > 0 )
0
Ritor1
parents:
diff changeset
5473 {
Ritor1
parents:
diff changeset
5474 v730 = (int)&v679;
Ritor1
parents:
diff changeset
5475 do
Ritor1
parents:
diff changeset
5476 {
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5477 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement);
0
Ritor1
parents:
diff changeset
5478 if ( !v259 || v259 == 1 )
Ritor1
parents:
diff changeset
5479 {
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5480 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
0
Ritor1
parents:
diff changeset
5481 + 4]
Ritor1
parents:
diff changeset
5482 + v258 * 28);
Ritor1
parents:
diff changeset
5483 LODWORD(v725) += v260;
Ritor1
parents:
diff changeset
5484 if ( v260 )
Ritor1
parents:
diff changeset
5485 {
Ritor1
parents:
diff changeset
5486 v261 = v730;
Ritor1
parents:
diff changeset
5487 v730 += 4;
Ritor1
parents:
diff changeset
5488 *(int *)v261 = HIDWORD(v733);
Ritor1
parents:
diff changeset
5489 }
Ritor1
parents:
diff changeset
5490 }
Ritor1
parents:
diff changeset
5491 ++HIDWORD(v733);
Ritor1
parents:
diff changeset
5492 ++v258;
Ritor1
parents:
diff changeset
5493 }
Ritor1
parents:
diff changeset
5494 while ( SHIDWORD(v733) < v257 );
Ritor1
parents:
diff changeset
5495 }
Ritor1
parents:
diff changeset
5496 v262 = rand() % SLODWORD(v725);
Ritor1
parents:
diff changeset
5497 v263 = v679;
Ritor1
parents:
diff changeset
5498 *(int *)(v245 + 12) = v679;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5499 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4];
0
Ritor1
parents:
diff changeset
5500 v265 = v262 + 1;
Ritor1
parents:
diff changeset
5501 if ( v264 < v265 )
Ritor1
parents:
diff changeset
5502 {
Ritor1
parents:
diff changeset
5503 for ( ii = &v679; ; ii = (int *)v732 )
Ritor1
parents:
diff changeset
5504 {
Ritor1
parents:
diff changeset
5505 v267 = (int)(ii + 1);
Ritor1
parents:
diff changeset
5506 v732 = v267;
Ritor1
parents:
diff changeset
5507 v268 = *(int *)v267;
Ritor1
parents:
diff changeset
5508 *(int *)(v245 + 12) = v268;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5509 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType
0
Ritor1
parents:
diff changeset
5510 + 4];
Ritor1
parents:
diff changeset
5511 if ( v264 >= v265 )
Ritor1
parents:
diff changeset
5512 break;
Ritor1
parents:
diff changeset
5513 }
Ritor1
parents:
diff changeset
5514 }
Ritor1
parents:
diff changeset
5515 LABEL_525:
Ritor1
parents:
diff changeset
5516 ++*(int *)(v245 + 12);
Ritor1
parents:
diff changeset
5517 goto LABEL_612;
Ritor1
parents:
diff changeset
5518 }
Ritor1
parents:
diff changeset
5519 }
Ritor1
parents:
diff changeset
5520 LABEL_615:
Ritor1
parents:
diff changeset
5521 v1 = 0;
Ritor1
parents:
diff changeset
5522 goto LABEL_616;
Ritor1
parents:
diff changeset
5523 }
Ritor1
parents:
diff changeset
5524 v289 = (ItemGen *)&v244[36 * a2 + 532];
Ritor1
parents:
diff changeset
5525 _this = v289;
Ritor1
parents:
diff changeset
5526 v290 = v289->uItemID;
Ritor1
parents:
diff changeset
5527 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4;
Ritor1
parents:
diff changeset
5528 if ( v290 > 134
Ritor1
parents:
diff changeset
5529 || _this->uAdditionalValue != v1
Ritor1
parents:
diff changeset
5530 || _this->_bonus_type != v1
Ritor1
parents:
diff changeset
5531 || _this->_bonus_strength != v1
Ritor1
parents:
diff changeset
5532 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0
Ritor1
parents:
diff changeset
5533 || v291 == 1
Ritor1
parents:
diff changeset
5534 || v291 == 2
315
2a09e1d6fc8f Some 0041D895 GameUI_DrawItemInfo overhaul
Nomad
parents: 305
diff changeset
5535 || _this->Broken())
0
Ritor1
parents:
diff changeset
5536 goto LABEL_616;
Ritor1
parents:
diff changeset
5537 if ( _this->GetValue() < 0x1C2 )
Ritor1
parents:
diff changeset
5538 uRequiredMana = 1;
Ritor1
parents:
diff changeset
5539 if ( rand() % 100 >= SHIDWORD(v733) )
Ritor1
parents:
diff changeset
5540 uRequiredMana = 1;
Ritor1
parents:
diff changeset
5541 if ( uRequiredMana != v1 )
Ritor1
parents:
diff changeset
5542 goto LABEL_199;
Ritor1
parents:
diff changeset
5543 v292 = *(char *)(LODWORD(v725) + 28);
Ritor1
parents:
diff changeset
5544 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) )
Ritor1
parents:
diff changeset
5545 {
Ritor1
parents:
diff changeset
5546 v2 = v723;
Ritor1
parents:
diff changeset
5547 v1 = 0;
Ritor1
parents:
diff changeset
5548 goto LABEL_199;
Ritor1
parents:
diff changeset
5549 }
Ritor1
parents:
diff changeset
5550 if ( rand() % 100 >= 80 )
Ritor1
parents:
diff changeset
5551 {
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5552 v297 = pItemsTable->pSpecialEnchantments_count;
0
Ritor1
parents:
diff changeset
5553 v294 = _this;
Ritor1
parents:
diff changeset
5554 v298 = 0;
Ritor1
parents:
diff changeset
5555 v725 = 0.0;
Ritor1
parents:
diff changeset
5556 HIDWORD(v733) = 0;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5557 if ( pItemsTable->pSpecialEnchantments_count > 0 )
0
Ritor1
parents:
diff changeset
5558 {
Ritor1
parents:
diff changeset
5559 v730 = (int)&v679;
Ritor1
parents:
diff changeset
5560 do
Ritor1
parents:
diff changeset
5561 {
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5562 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement);
0
Ritor1
parents:
diff changeset
5563 if ( !v299 || v299 == 1 )
Ritor1
parents:
diff changeset
5564 {
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5565 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]
0
Ritor1
parents:
diff changeset
5566 + v298 * 28);
Ritor1
parents:
diff changeset
5567 LODWORD(v725) += v300;
Ritor1
parents:
diff changeset
5568 if ( v300 )
Ritor1
parents:
diff changeset
5569 {
Ritor1
parents:
diff changeset
5570 v301 = v730;
Ritor1
parents:
diff changeset
5571 v730 += 4;
Ritor1
parents:
diff changeset
5572 *(int *)v301 = HIDWORD(v733);
Ritor1
parents:
diff changeset
5573 }
Ritor1
parents:
diff changeset
5574 }
Ritor1
parents:
diff changeset
5575 ++HIDWORD(v733);
Ritor1
parents:
diff changeset
5576 ++v298;
Ritor1
parents:
diff changeset
5577 }
Ritor1
parents:
diff changeset
5578 while ( SHIDWORD(v733) < v297 );
Ritor1
parents:
diff changeset
5579 }
Ritor1
parents:
diff changeset
5580 v302 = rand() % SLODWORD(v725);
Ritor1
parents:
diff changeset
5581 v303 = v679;
Ritor1
parents:
diff changeset
5582 v294->uAdditionalValue = v679;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5583 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
0
Ritor1
parents:
diff changeset
5584 v305 = v302 + 1;
Ritor1
parents:
diff changeset
5585 if ( v304 < v305 )
Ritor1
parents:
diff changeset
5586 {
Ritor1
parents:
diff changeset
5587 for ( jj = &v679; ; jj = (int *)v732 )
Ritor1
parents:
diff changeset
5588 {
Ritor1
parents:
diff changeset
5589 v307 = (int)(jj + 1);
Ritor1
parents:
diff changeset
5590 v732 = v307;
Ritor1
parents:
diff changeset
5591 v308 = *(int *)v307;
Ritor1
parents:
diff changeset
5592 v294->uAdditionalValue = v308;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5593 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4];
0
Ritor1
parents:
diff changeset
5594 if ( v304 >= v305 )
Ritor1
parents:
diff changeset
5595 break;
Ritor1
parents:
diff changeset
5596 }
Ritor1
parents:
diff changeset
5597 }
Ritor1
parents:
diff changeset
5598 ++v294->uAdditionalValue;
Ritor1
parents:
diff changeset
5599 }
Ritor1
parents:
diff changeset
5600 else
Ritor1
parents:
diff changeset
5601 {
Ritor1
parents:
diff changeset
5602 v293 = rand();
Ritor1
parents:
diff changeset
5603 v294 = _this;
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5604 v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType];
0
Ritor1
parents:
diff changeset
5605 _this->_bonus_type = 0;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5606 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1];
0
Ritor1
parents:
diff changeset
5607 ;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
5608 kk += pItemsTable->pEnchantments[v294->_bonus_type].to_item[pItemsTable->pItems[v294->uItemID].uEquipType
0
Ritor1
parents:
diff changeset
5609 + 1] )
Ritor1
parents:
diff changeset
5610 {
Ritor1
parents:
diff changeset
5611 ++v294->_bonus_type;
Ritor1
parents:
diff changeset
5612 if ( kk >= v295 )
Ritor1
parents:
diff changeset
5613 break;
Ritor1
parents:
diff changeset
5614 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5615 v294->_bonus_strength = 10//pItemsTable->field_116D8[18]
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
5616 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1);
0
Ritor1
parents:
diff changeset
5617 }
Ritor1
parents:
diff changeset
5618 v294->uAttributes |= 0x20u;
Ritor1
parents:
diff changeset
5619 goto LABEL_1055;
Ritor1
parents:
diff changeset
5620 case 31:
Ritor1
parents:
diff changeset
5621 amount = 10 * v2;
Ritor1
parents:
diff changeset
5622 if ( pPlayer->sMana < (signed int)uRequiredMana )
Ritor1
parents:
diff changeset
5623 goto LABEL_83;
Ritor1
parents:
diff changeset
5624 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 )
Ritor1
parents:
diff changeset
5625 goto LABEL_200;
Ritor1
parents:
diff changeset
5626 byte_50C0C0 = LOBYTE(v3->uPlayerID);
Ritor1
parents:
diff changeset
5627 pMessageQueue_50CBD0->SendMessage((UIMessageType)195, v1, v1);
Ritor1
parents:
diff changeset
5628 goto LABEL_1056;
Ritor1
parents:
diff changeset
5629 case 33:
Ritor1
parents:
diff changeset
5630 LODWORD(v733) = 604800 * v2;
Ritor1
parents:
diff changeset
5631 if ( !_strcmpi(pCurrentMapName, "d05.blv") )
Ritor1
parents:
diff changeset
5632 goto LABEL_200;
Ritor1
parents:
diff changeset
5633 v319 = uRequiredMana;
Ritor1
parents:
diff changeset
5634 if ( pPlayer->sMana >= (signed int)uRequiredMana )
Ritor1
parents:
diff changeset
5635 {
Ritor1
parents:
diff changeset
5636 pEventTimer->Pause();
Ritor1
parents:
diff changeset
5637 pMessageQueue_50CBD0->SendMessage((UIMessageType)177, v1, v1);
Ritor1
parents:
diff changeset
5638 qword_506350 = (signed int)v733;
Ritor1
parents:
diff changeset
5639 _506348_current_lloyd_playerid = v3->uPlayerID;
Ritor1
parents:
diff changeset
5640 ::uRequiredMana = v319;
Ritor1
parents:
diff changeset
5641 ::sRecoveryTime = sRecoveryTime;
Ritor1
parents:
diff changeset
5642 dword_50633C = v3->field_10;
Ritor1
parents:
diff changeset
5643 dword_506338 = v3->spellnum;
Ritor1
parents:
diff changeset
5644 LOBYTE(v3->field_8) |= 0x20u;
Ritor1
parents:
diff changeset
5645 }
Ritor1
parents:
diff changeset
5646 goto LABEL_83;
Ritor1
parents:
diff changeset
5647 case 40:
Ritor1
parents:
diff changeset
5648 v320 = v12 - 2;
Ritor1
parents:
diff changeset
5649 if ( !v320 )
Ritor1
parents:
diff changeset
5650 goto LABEL_632;
Ritor1
parents:
diff changeset
5651 v321 = v320 - 1;
Ritor1
parents:
diff changeset
5652 if ( v321 )
Ritor1
parents:
diff changeset
5653 {
Ritor1
parents:
diff changeset
5654 if ( v321 == 1 )
Ritor1
parents:
diff changeset
5655 goto LABEL_634;
Ritor1
parents:
diff changeset
5656 LABEL_632:
Ritor1
parents:
diff changeset
5657 v322 = 3600 * v2;
Ritor1
parents:
diff changeset
5658 }
Ritor1
parents:
diff changeset
5659 else
Ritor1
parents:
diff changeset
5660 {
Ritor1
parents:
diff changeset
5661 v322 = 86400 * v2;
Ritor1
parents:
diff changeset
5662 }
Ritor1
parents:
diff changeset
5663 amount = v322;
Ritor1
parents:
diff changeset
5664 LABEL_634:
Ritor1
parents:
diff changeset
5665 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5666 goto LABEL_83;
Ritor1
parents:
diff changeset
5667 v323 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
5668 v324 = (char *)&pParty->pPlayers[v323].pConditions[15];
Ritor1
parents:
diff changeset
5669 if ( !pParty->pPlayers[v323].pConditions[15] )
Ritor1
parents:
diff changeset
5670 goto LABEL_1056;
Ritor1
parents:
diff changeset
5671 if ( v731 == 4 )
Ritor1
parents:
diff changeset
5672 goto LABEL_637;
Ritor1
parents:
diff changeset
5673 v732 = amount << 7;
Ritor1
parents:
diff changeset
5674 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
Ritor1
parents:
diff changeset
5675 v656 = 15;
Ritor1
parents:
diff changeset
5676 goto LABEL_640;
Ritor1
parents:
diff changeset
5677 case 41:
Ritor1
parents:
diff changeset
5678 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5679 goto LABEL_83;
Ritor1
parents:
diff changeset
5680 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
5681 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
5682 a1.field_4C = v2;
Ritor1
parents:
diff changeset
5683 a1.field_50 = v731;
Ritor1
parents:
diff changeset
5684 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
5685 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
5686 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
5687 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
5688 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
5689 a1.uSectorID = pIndoor->GetSector(
Ritor1
parents:
diff changeset
5690 pParty->vPosition.x,
Ritor1
parents:
diff changeset
5691 pParty->vPosition.y,
Ritor1
parents:
diff changeset
5692 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
Ritor1
parents:
diff changeset
5693 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
5694 v326 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5695 LOBYTE(v326) = v326 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5696 a1.field_58_pid = v326;
0
Ritor1
parents:
diff changeset
5697 a1.field_5C = a2;
Ritor1
parents:
diff changeset
5698 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
5699 a1.uFacing = LOWORD(pParty->sRotationY);
Ritor1
parents:
diff changeset
5700 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
5701 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
5702 LOBYTE(a1.uAttributes) |= 4u;
Ritor1
parents:
diff changeset
5703 v669 = v3->uPlayerID + 1;
Ritor1
parents:
diff changeset
5704 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
Ritor1
parents:
diff changeset
5705 v654 = pParty->sRotationX;
Ritor1
parents:
diff changeset
5706 goto LABEL_125;
Ritor1
parents:
diff changeset
5707 case 43:
Ritor1
parents:
diff changeset
5708 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
5709 goto LABEL_200;
Ritor1
parents:
diff changeset
5710 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5711 goto LABEL_83;
Ritor1
parents:
diff changeset
5712 a1.uItemType = 4090;
Ritor1
parents:
diff changeset
5713 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
5714 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
5715 a1.field_4C = v2;
Ritor1
parents:
diff changeset
5716 a1.field_50 = v731;
Ritor1
parents:
diff changeset
5717 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
5718 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
5719 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
5720 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
5721 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
5722 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
5723 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
Ritor1
parents:
diff changeset
5724 v327 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5725 LOBYTE(v327) = v327 | OBJECT_Player;
0
Ritor1
parents:
diff changeset
5726 a1.field_60_distance_related_prolly_lod = 0;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5727 a1.field_58_pid = v327;
0
Ritor1
parents:
diff changeset
5728 a1.field_5C = a2;
Ritor1
parents:
diff changeset
5729 a1.uFacing = LOWORD(pParty->sRotationY);
Ritor1
parents:
diff changeset
5730 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
5731 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
5732 a1.uAttributes = 4;
Ritor1
parents:
diff changeset
5733 v669 = v1;
Ritor1
parents:
diff changeset
5734 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
Ritor1
parents:
diff changeset
5735 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
Ritor1
parents:
diff changeset
5736 LABEL_124:
Ritor1
parents:
diff changeset
5737 v654 = v35;
Ritor1
parents:
diff changeset
5738 LABEL_125:
Ritor1
parents:
diff changeset
5739 v36 = pParty->sRotationY;
Ritor1
parents:
diff changeset
5740 goto LABEL_157;
Ritor1
parents:
diff changeset
5741 case 45:
Ritor1
parents:
diff changeset
5742 v328 = v12 - 2;
Ritor1
parents:
diff changeset
5743 if ( v328 )
Ritor1
parents:
diff changeset
5744 {
Ritor1
parents:
diff changeset
5745 v329 = v328 - 1;
Ritor1
parents:
diff changeset
5746 if ( v329 && v329 != 1 )
Ritor1
parents:
diff changeset
5747 v330 = 600 * v2;
Ritor1
parents:
diff changeset
5748 else
Ritor1
parents:
diff changeset
5749 v330 = 3600 * v2;
Ritor1
parents:
diff changeset
5750 }
Ritor1
parents:
diff changeset
5751 else
Ritor1
parents:
diff changeset
5752 {
Ritor1
parents:
diff changeset
5753 v330 = 1800 * v2;
Ritor1
parents:
diff changeset
5754 }
Ritor1
parents:
diff changeset
5755 LODWORD(v733) = v330;
Ritor1
parents:
diff changeset
5756 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5757 goto LABEL_83;
Ritor1
parents:
diff changeset
5758 v331 = v3->spellnum;
Ritor1
parents:
diff changeset
5759 v332 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5760 pGame->GetStru6()->SetPlayerBuffAnim(v331, v1);
Ritor1
parents:
diff changeset
5761 v83 = 1;
Ritor1
parents:
diff changeset
5762 v333 = v3->spellnum;
Ritor1
parents:
diff changeset
5763 v334 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5764 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1u);
Ritor1
parents:
diff changeset
5765 v335 = v3->spellnum;
Ritor1
parents:
diff changeset
5766 v336 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5767 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2u);
Ritor1
parents:
diff changeset
5768 v337 = v3->spellnum;
Ritor1
parents:
diff changeset
5769 v338 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5770 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3u);
Ritor1
parents:
diff changeset
5771 v673 = v1;
Ritor1
parents:
diff changeset
5772 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
5773 v662 = v1;
Ritor1
parents:
diff changeset
5774 v655 = v1;
Ritor1
parents:
diff changeset
5775 v652 = v731;
Ritor1
parents:
diff changeset
5776 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
5777 v137 = (char *)&pParty->pPartyBuffs[3];
Ritor1
parents:
diff changeset
5778 goto LABEL_976;
Ritor1
parents:
diff changeset
5779 case 47:
Ritor1
parents:
diff changeset
5780 LODWORD(v733) = 300;
Ritor1
parents:
diff changeset
5781 v339 = v12 - 2;
Ritor1
parents:
diff changeset
5782 if ( v339 )
Ritor1
parents:
diff changeset
5783 {
Ritor1
parents:
diff changeset
5784 v340 = v339 - 1;
Ritor1
parents:
diff changeset
5785 if ( v340 )
Ritor1
parents:
diff changeset
5786 {
Ritor1
parents:
diff changeset
5787 if ( v340 != 1 )
Ritor1
parents:
diff changeset
5788 {
Ritor1
parents:
diff changeset
5789 amount = v2;
Ritor1
parents:
diff changeset
5790 goto LABEL_667;
Ritor1
parents:
diff changeset
5791 }
Ritor1
parents:
diff changeset
5792 v341 = 6 * v2;
Ritor1
parents:
diff changeset
5793 }
Ritor1
parents:
diff changeset
5794 else
Ritor1
parents:
diff changeset
5795 {
Ritor1
parents:
diff changeset
5796 v341 = 4 * v2;
Ritor1
parents:
diff changeset
5797 }
Ritor1
parents:
diff changeset
5798 }
Ritor1
parents:
diff changeset
5799 else
Ritor1
parents:
diff changeset
5800 {
Ritor1
parents:
diff changeset
5801 v341 = 2 * v2;
Ritor1
parents:
diff changeset
5802 }
Ritor1
parents:
diff changeset
5803 amount = v341;
Ritor1
parents:
diff changeset
5804 LABEL_667:
Ritor1
parents:
diff changeset
5805 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5806 goto LABEL_83;
Ritor1
parents:
diff changeset
5807 v342 = *(int *)&v3->field_C;
Ritor1
parents:
diff changeset
5808 if ( v342 == v1 )
Ritor1
parents:
diff changeset
5809 {
Ritor1
parents:
diff changeset
5810 v345 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
5811 v346 = v3->spellnum;
Ritor1
parents:
diff changeset
5812 v347 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5813 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345);
Ritor1
parents:
diff changeset
5814 v668 = v1;
Ritor1
parents:
diff changeset
5815 v658 = v1;
Ritor1
parents:
diff changeset
5816 v653 = amount;
Ritor1
parents:
diff changeset
5817 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280;
Ritor1
parents:
diff changeset
5818 v651 = v731;
Ritor1
parents:
diff changeset
5819 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32);
Ritor1
parents:
diff changeset
5820 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4];
Ritor1
parents:
diff changeset
5821 goto LABEL_104;
Ritor1
parents:
diff changeset
5822 }
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
5823 if ( (v342 & 7) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
5824 {
Ritor1
parents:
diff changeset
5825 v343 = v342 >> 3;
Ritor1
parents:
diff changeset
5826 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32);
Ritor1
parents:
diff changeset
5827 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280;
Ritor1
parents:
diff changeset
5828 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1);
Ritor1
parents:
diff changeset
5829 BYTE2(pActors[v343].uAttributes) |= 8u;
Ritor1
parents:
diff changeset
5830 v672 = v1;
Ritor1
parents:
diff changeset
5831 v661 = &pActors[v343];
Ritor1
parents:
diff changeset
5832 LABEL_165:
Ritor1
parents:
diff changeset
5833 v56 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5834 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672);
Ritor1
parents:
diff changeset
5835 }
Ritor1
parents:
diff changeset
5836 goto LABEL_1056;
Ritor1
parents:
diff changeset
5837 case 49:
Ritor1
parents:
diff changeset
5838 v348 = v12 - 2;
Ritor1
parents:
diff changeset
5839 if ( !v348 )
Ritor1
parents:
diff changeset
5840 goto LABEL_677;
Ritor1
parents:
diff changeset
5841 v349 = v348 - 1;
Ritor1
parents:
diff changeset
5842 if ( v349 )
Ritor1
parents:
diff changeset
5843 {
Ritor1
parents:
diff changeset
5844 if ( v349 == 1 )
Ritor1
parents:
diff changeset
5845 {
Ritor1
parents:
diff changeset
5846 amount = v1;
Ritor1
parents:
diff changeset
5847 goto LABEL_679;
Ritor1
parents:
diff changeset
5848 }
Ritor1
parents:
diff changeset
5849 LABEL_677:
Ritor1
parents:
diff changeset
5850 v350 = 3600 * v2;
Ritor1
parents:
diff changeset
5851 }
Ritor1
parents:
diff changeset
5852 else
Ritor1
parents:
diff changeset
5853 {
Ritor1
parents:
diff changeset
5854 v350 = 86400 * v2;
Ritor1
parents:
diff changeset
5855 }
Ritor1
parents:
diff changeset
5856 amount = v350;
Ritor1
parents:
diff changeset
5857 LABEL_679:
Ritor1
parents:
diff changeset
5858 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5859 goto LABEL_83;
Ritor1
parents:
diff changeset
5860 v351 = &pParty->pPlayers[v3->uPlayerID_2];
Ritor1
parents:
diff changeset
5861 if ( !v351->pConditions[0] )
Ritor1
parents:
diff changeset
5862 goto LABEL_1056;
Ritor1
parents:
diff changeset
5863 if ( v731 == 4 )
Ritor1
parents:
diff changeset
5864 {
Ritor1
parents:
diff changeset
5865 LODWORD(v351->pConditions[0]) = v1;
Ritor1
parents:
diff changeset
5866 HIDWORD(v351->pConditions[0]) = v1;
Ritor1
parents:
diff changeset
5867 goto LABEL_904;
Ritor1
parents:
diff changeset
5868 }
Ritor1
parents:
diff changeset
5869 v732 = amount << 7;
Ritor1
parents:
diff changeset
5870 v351->DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
5871 v1,
Ritor1
parents:
diff changeset
5872 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
Ritor1
parents:
diff changeset
5873 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) )
Ritor1
parents:
diff changeset
5874 goto LABEL_1056;
Ritor1
parents:
diff changeset
5875 v674 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
5876 goto LABEL_685;
Ritor1
parents:
diff changeset
5877 case 50:
Ritor1
parents:
diff changeset
5878 v354 = v12 - 2;
Ritor1
parents:
diff changeset
5879 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 )
Ritor1
parents:
diff changeset
5880 v356 = 900 * (v2 + 4);
Ritor1
parents:
diff changeset
5881 else
Ritor1
parents:
diff changeset
5882 v356 = 300 * (v2 + 12);
Ritor1
parents:
diff changeset
5883 LODWORD(v733) = v356;
Ritor1
parents:
diff changeset
5884 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5885 goto LABEL_83;
Ritor1
parents:
diff changeset
5886 if ( v731 == 1 || v731 == 2 )
Ritor1
parents:
diff changeset
5887 {
Ritor1
parents:
diff changeset
5888 v361 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
5889 v362 = v3->spellnum;
Ritor1
parents:
diff changeset
5890 v363 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5891 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361);
Ritor1
parents:
diff changeset
5892 v668 = v1;
Ritor1
parents:
diff changeset
5893 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
5894 v658 = v1;
Ritor1
parents:
diff changeset
5895 v653 = v1;
Ritor1
parents:
diff changeset
5896 v651 = v731;
Ritor1
parents:
diff changeset
5897 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
5898 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11];
Ritor1
parents:
diff changeset
5899 goto LABEL_103;
Ritor1
parents:
diff changeset
5900 }
Ritor1
parents:
diff changeset
5901 a2 = v1;
Ritor1
parents:
diff changeset
5902 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
5903 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
5904 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11];
0
Ritor1
parents:
diff changeset
5905 do
Ritor1
parents:
diff changeset
5906 {
Ritor1
parents:
diff changeset
5907 v358 = a2;
Ritor1
parents:
diff changeset
5908 v359 = v3->spellnum;
Ritor1
parents:
diff changeset
5909 v360 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5910 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358);
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
5911 v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, v1, v1, v1);
0
Ritor1
parents:
diff changeset
5912 ++a2;
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
5913 ++v357;// = (SpellBuff *)((char *)v357 + 6972);
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
5914 }
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
5915 while ( v357 <= &pParty->pPlayers[3] );
0
Ritor1
parents:
diff changeset
5916 goto LABEL_1056;
Ritor1
parents:
diff changeset
5917 case 48:
Ritor1
parents:
diff changeset
5918 v364 = v12 - 2;
Ritor1
parents:
diff changeset
5919 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 )
Ritor1
parents:
diff changeset
5920 v366 = 60 * (v2 + 3);
Ritor1
parents:
diff changeset
5921 else
Ritor1
parents:
diff changeset
5922 v366 = 300 * v2 + 180;
Ritor1
parents:
diff changeset
5923 LODWORD(v733) = v366;
Ritor1
parents:
diff changeset
5924 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5925 goto LABEL_83;
Ritor1
parents:
diff changeset
5926 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096);
Ritor1
parents:
diff changeset
5927 v367 = pGame->GetStru6();
Ritor1
parents:
diff changeset
5928 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u);
Ritor1
parents:
diff changeset
5929 ++a1.uItemType;
Ritor1
parents:
diff changeset
5930 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
5931 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
5932 a1.field_4C = v2;
Ritor1
parents:
diff changeset
5933 a1.field_50 = v731;
Ritor1
parents:
diff changeset
5934 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
5935 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
5936 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
5937 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
5938 v368 = v3->uPlayerID;
Ritor1
parents:
diff changeset
5939 a1.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
5940 a1.uFacing = v1;
Ritor1
parents:
diff changeset
5941 v368 *= 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5942 LOBYTE(v368) = v368 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
5943 a1.field_58_pid = v368;
0
Ritor1
parents:
diff changeset
5944 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
5945 for ( a2 = v1; a2 < (signed int)v726; ++a2 )
Ritor1
parents:
diff changeset
5946 {
Ritor1
parents:
diff changeset
5947 v369 = &pActors[dword_50BF30[a2]];
Ritor1
parents:
diff changeset
5948 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
Ritor1
parents:
diff changeset
5949 {
Ritor1
parents:
diff changeset
5950 a1.vPosition.x = v369->vPosition.x;
Ritor1
parents:
diff changeset
5951 a1.vPosition.y = v369->vPosition.y;
Ritor1
parents:
diff changeset
5952 v732 = v369->uActorHeight;
Ritor1
parents:
diff changeset
5953 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548);
Ritor1
parents:
diff changeset
5954 v370 = 8 * dword_50BF30[a2];
Ritor1
parents:
diff changeset
5955 LOBYTE(v370) = v370 | 3;
Ritor1
parents:
diff changeset
5956 a1.field_5C = v370;
Ritor1
parents:
diff changeset
5957 a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
5958 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
5959 v369->pActorBuffs[4].Apply(
Ritor1
parents:
diff changeset
5960 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
Ritor1
parents:
diff changeset
5961 v731,
Ritor1
parents:
diff changeset
5962 v1,
Ritor1
parents:
diff changeset
5963 v1,
Ritor1
parents:
diff changeset
5964 v1);
Ritor1
parents:
diff changeset
5965 }
Ritor1
parents:
diff changeset
5966 }
Ritor1
parents:
diff changeset
5967 goto LABEL_1056;
Ritor1
parents:
diff changeset
5968 case 53:
Ritor1
parents:
diff changeset
5969 v371 = v12 - 2;
Ritor1
parents:
diff changeset
5970 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 )
Ritor1
parents:
diff changeset
5971 amount = v1;
Ritor1
parents:
diff changeset
5972 else
Ritor1
parents:
diff changeset
5973 amount = 86400 * v2;
Ritor1
parents:
diff changeset
5974 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
5975 goto LABEL_83;
Ritor1
parents:
diff changeset
5976 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, v1, 65536);
Ritor1
parents:
diff changeset
5977 v373 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
5978 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) )
Ritor1
parents:
diff changeset
5979 goto LABEL_1056;
Ritor1
parents:
diff changeset
5980 v14 = v731 == 4;
Ritor1
parents:
diff changeset
5981 pParty->pPlayers[v373].sHealth = 1;
Ritor1
parents:
diff changeset
5982 if ( v14 )
Ritor1
parents:
diff changeset
5983 {
Ritor1
parents:
diff changeset
5984 v374 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
5985 LODWORD(pParty->pPlayers[v374].pConditions[14]) = v1;
Ritor1
parents:
diff changeset
5986 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = v1;
Ritor1
parents:
diff changeset
5987 v376 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
5988 LODWORD(pParty->pPlayers[v376].pConditions[13]) = v1;
Ritor1
parents:
diff changeset
5989 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = v1;
Ritor1
parents:
diff changeset
5990 }
Ritor1
parents:
diff changeset
5991 else
Ritor1
parents:
diff changeset
5992 {
Ritor1
parents:
diff changeset
5993 v732 = amount << 7;
Ritor1
parents:
diff changeset
5994 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
Ritor1
parents:
diff changeset
5995 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
5996 0xEu,
Ritor1
parents:
diff changeset
5997 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
Ritor1
parents:
diff changeset
5998 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
5999 0xDu,
Ritor1
parents:
diff changeset
6000 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
Ritor1
parents:
diff changeset
6001 }
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
6002 v377 = &pParty->pPlayers[v3->uPlayerID_2];
0
Ritor1
parents:
diff changeset
6003 goto LABEL_720;
Ritor1
parents:
diff changeset
6004 case 54:
Ritor1
parents:
diff changeset
6005 v378 = v12 - 2;
Ritor1
parents:
diff changeset
6006 if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 )
Ritor1
parents:
diff changeset
6007 v380 = 4 * v2;
Ritor1
parents:
diff changeset
6008 else
Ritor1
parents:
diff changeset
6009 v380 = 3 * v2;
Ritor1
parents:
diff changeset
6010 amount = v380;
Ritor1
parents:
diff changeset
6011 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6012 goto LABEL_83;
Ritor1
parents:
diff changeset
6013 v381 = 0;
Ritor1
parents:
diff changeset
6014 HIDWORD(v733) = amount;
Ritor1
parents:
diff changeset
6015 v730 = 0;
Ritor1
parents:
diff changeset
6016 v382 = 1;
Ritor1
parents:
diff changeset
6017 do
Ritor1
parents:
diff changeset
6018 {
Ritor1
parents:
diff changeset
6019 v383 = pPlayers[v382];
Ritor1
parents:
diff changeset
6020 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] )
Ritor1
parents:
diff changeset
6021 v682[v381++] = v382;
Ritor1
parents:
diff changeset
6022 ++v382;
Ritor1
parents:
diff changeset
6023 }
Ritor1
parents:
diff changeset
6024 while ( v382 <= 4 );
Ritor1
parents:
diff changeset
6025 v384 = 0;
Ritor1
parents:
diff changeset
6026 v730 = v381;
Ritor1
parents:
diff changeset
6027 if ( v381 > v1 )
Ritor1
parents:
diff changeset
6028 {
Ritor1
parents:
diff changeset
6029 do
Ritor1
parents:
diff changeset
6030 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth;
Ritor1
parents:
diff changeset
6031 while ( v384 < v381 );
Ritor1
parents:
diff changeset
6032 }
Ritor1
parents:
diff changeset
6033 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730);
Ritor1
parents:
diff changeset
6034 HIDWORD(v733) = v1;
Ritor1
parents:
diff changeset
6035 if ( v381 > v1 )
Ritor1
parents:
diff changeset
6036 {
Ritor1
parents:
diff changeset
6037 do
Ritor1
parents:
diff changeset
6038 {
Ritor1
parents:
diff changeset
6039 v385 = 4 * v682[HIDWORD(v733)] + 10965188;
Ritor1
parents:
diff changeset
6040 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732;
Ritor1
parents:
diff changeset
6041 v726 = *(Player **)v385;
Ritor1
parents:
diff changeset
6042 v386 = v726->GetMaxHealth();
Ritor1
parents:
diff changeset
6043 if ( v726->sHealth > v386 )
Ritor1
parents:
diff changeset
6044 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth();
Ritor1
parents:
diff changeset
6045 v387 = *(Player **)v385;
Ritor1
parents:
diff changeset
6046 if ( v387->sHealth > v1 )
Ritor1
parents:
diff changeset
6047 {
Ritor1
parents:
diff changeset
6048 LODWORD(v387->pConditions[13]) = v1;
Ritor1
parents:
diff changeset
6049 HIDWORD(v387->pConditions[13]) = v1;
Ritor1
parents:
diff changeset
6050 }
Ritor1
parents:
diff changeset
6051 v388 = HIDWORD(v733);
Ritor1
parents:
diff changeset
6052 v389 = LOWORD(v682[HIDWORD(v733)]) - 1;
Ritor1
parents:
diff changeset
6053 v390 = v3->spellnum;
Ritor1
parents:
diff changeset
6054 v391 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6055 pGame->GetStru6()->SetPlayerBuffAnim(v390, v389);
Ritor1
parents:
diff changeset
6056 HIDWORD(v733) = v388 + 1;
Ritor1
parents:
diff changeset
6057 }
Ritor1
parents:
diff changeset
6058 while ( v388 + 1 < v730 );
Ritor1
parents:
diff changeset
6059 }
Ritor1
parents:
diff changeset
6060 goto LABEL_1056;
Ritor1
parents:
diff changeset
6061 case 55:
Ritor1
parents:
diff changeset
6062 v392 = v12 - 1;
Ritor1
parents:
diff changeset
6063 if ( !v392 )
Ritor1
parents:
diff changeset
6064 {
Ritor1
parents:
diff changeset
6065 v395 = 180 * v2;
Ritor1
parents:
diff changeset
6066 goto LABEL_750;
Ritor1
parents:
diff changeset
6067 }
Ritor1
parents:
diff changeset
6068 v393 = v392 - 1;
Ritor1
parents:
diff changeset
6069 if ( !v393 )
Ritor1
parents:
diff changeset
6070 {
Ritor1
parents:
diff changeset
6071 v395 = 10800 * v2;
Ritor1
parents:
diff changeset
6072 goto LABEL_750;
Ritor1
parents:
diff changeset
6073 }
Ritor1
parents:
diff changeset
6074 v394 = v393 - 1;
Ritor1
parents:
diff changeset
6075 if ( !v394 )
Ritor1
parents:
diff changeset
6076 {
Ritor1
parents:
diff changeset
6077 v395 = 259200 * v2;
Ritor1
parents:
diff changeset
6078 LABEL_750:
Ritor1
parents:
diff changeset
6079 amount = v395;
Ritor1
parents:
diff changeset
6080 goto LABEL_751;
Ritor1
parents:
diff changeset
6081 }
Ritor1
parents:
diff changeset
6082 if ( v394 == 1 )
Ritor1
parents:
diff changeset
6083 amount = v1;
Ritor1
parents:
diff changeset
6084 LABEL_751:
Ritor1
parents:
diff changeset
6085 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6086 goto LABEL_83;
Ritor1
parents:
diff changeset
6087 v396 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6088 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16])
Ritor1
parents:
diff changeset
6089 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) )
Ritor1
parents:
diff changeset
6090 {
Ritor1
parents:
diff changeset
6091 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) )
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
6092 pParty->pPlayers[v396].PlaySound(SPEECH_25, v1);
0
Ritor1
parents:
diff changeset
6093 if ( v731 == 4 )
Ritor1
parents:
diff changeset
6094 {
Ritor1
parents:
diff changeset
6095 v397 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6096 LODWORD(pParty->pPlayers[v397].pConditions[16]) = v1;
Ritor1
parents:
diff changeset
6097 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = v1;
Ritor1
parents:
diff changeset
6098 v398 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6099 LODWORD(pParty->pPlayers[v398].pConditions[14]) = v1;
Ritor1
parents:
diff changeset
6100 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = v1;
Ritor1
parents:
diff changeset
6101 v399 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6102 LODWORD(pParty->pPlayers[v399].pConditions[13]) = v1;
Ritor1
parents:
diff changeset
6103 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = v1;
Ritor1
parents:
diff changeset
6104 }
Ritor1
parents:
diff changeset
6105 else
Ritor1
parents:
diff changeset
6106 {
Ritor1
parents:
diff changeset
6107 v732 = amount << 7;
Ritor1
parents:
diff changeset
6108 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
Ritor1
parents:
diff changeset
6109 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
6110 0x10u,
Ritor1
parents:
diff changeset
6111 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
Ritor1
parents:
diff changeset
6112 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
6113 0xEu,
Ritor1
parents:
diff changeset
6114 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
Ritor1
parents:
diff changeset
6115 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
6116 0xDu,
Ritor1
parents:
diff changeset
6117 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
Ritor1
parents:
diff changeset
6118 }
Ritor1
parents:
diff changeset
6119 v83 = 1;
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
6120 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1);
0
Ritor1
parents:
diff changeset
6121 v401 = pGame;
Ritor1
parents:
diff changeset
6122 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1;
Ritor1
parents:
diff changeset
6123 v402 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6124 v403 = v3->spellnum;
Ritor1
parents:
diff changeset
6125 v404 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6126 pGame->GetStru6()->SetPlayerBuffAnim(v403, v402);
Ritor1
parents:
diff changeset
6127 }
Ritor1
parents:
diff changeset
6128 else
Ritor1
parents:
diff changeset
6129 {
Ritor1
parents:
diff changeset
6130 v83 = 1;
Ritor1
parents:
diff changeset
6131 }
Ritor1
parents:
diff changeset
6132 goto LABEL_978;
Ritor1
parents:
diff changeset
6133 case 61:
Ritor1
parents:
diff changeset
6134 v405 = v12 - 2;
Ritor1
parents:
diff changeset
6135 if ( !v405 )
Ritor1
parents:
diff changeset
6136 goto LABEL_766;
Ritor1
parents:
diff changeset
6137 v406 = v405 - 1;
Ritor1
parents:
diff changeset
6138 if ( v406 )
Ritor1
parents:
diff changeset
6139 {
Ritor1
parents:
diff changeset
6140 if ( v406 == 1 )
Ritor1
parents:
diff changeset
6141 {
Ritor1
parents:
diff changeset
6142 amount = v1;
Ritor1
parents:
diff changeset
6143 goto LABEL_768;
Ritor1
parents:
diff changeset
6144 }
Ritor1
parents:
diff changeset
6145 LABEL_766:
Ritor1
parents:
diff changeset
6146 v407 = 3600 * v2;
Ritor1
parents:
diff changeset
6147 }
Ritor1
parents:
diff changeset
6148 else
Ritor1
parents:
diff changeset
6149 {
Ritor1
parents:
diff changeset
6150 v407 = 86400 * v2;
Ritor1
parents:
diff changeset
6151 }
Ritor1
parents:
diff changeset
6152 amount = v407;
Ritor1
parents:
diff changeset
6153 LABEL_768:
Ritor1
parents:
diff changeset
6154 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6155 goto LABEL_83;
Ritor1
parents:
diff changeset
6156 v408 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6157 v409 = v3->spellnum;
Ritor1
parents:
diff changeset
6158 v410 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6159 pGame->GetStru6()->SetPlayerBuffAnim(v409, v408);
Ritor1
parents:
diff changeset
6160 v323 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6161 v324 = (char *)&pParty->pPlayers[v323].pConditions[12];
Ritor1
parents:
diff changeset
6162 if ( !pParty->pPlayers[v323].pConditions[12] )
Ritor1
parents:
diff changeset
6163 goto LABEL_1056;
Ritor1
parents:
diff changeset
6164 if ( v731 == 4 )
Ritor1
parents:
diff changeset
6165 goto LABEL_637;
Ritor1
parents:
diff changeset
6166 v732 = amount << 7;
Ritor1
parents:
diff changeset
6167 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
Ritor1
parents:
diff changeset
6168 v656 = 12;
Ritor1
parents:
diff changeset
6169 goto LABEL_640;
Ritor1
parents:
diff changeset
6170 case 56:
Ritor1
parents:
diff changeset
6171 v411 = v12 - 2;
Ritor1
parents:
diff changeset
6172 if ( v411 )
Ritor1
parents:
diff changeset
6173 {
Ritor1
parents:
diff changeset
6174 v412 = v411 - 1;
Ritor1
parents:
diff changeset
6175 if ( v412 )
Ritor1
parents:
diff changeset
6176 {
Ritor1
parents:
diff changeset
6177 if ( v412 == 1 )
Ritor1
parents:
diff changeset
6178 {
Ritor1
parents:
diff changeset
6179 amount = v1;
Ritor1
parents:
diff changeset
6180 goto LABEL_780;
Ritor1
parents:
diff changeset
6181 }
Ritor1
parents:
diff changeset
6182 v413 = 180 * v2;
Ritor1
parents:
diff changeset
6183 }
Ritor1
parents:
diff changeset
6184 else
Ritor1
parents:
diff changeset
6185 {
Ritor1
parents:
diff changeset
6186 v413 = 86400 * v2;
Ritor1
parents:
diff changeset
6187 }
Ritor1
parents:
diff changeset
6188 }
Ritor1
parents:
diff changeset
6189 else
Ritor1
parents:
diff changeset
6190 {
Ritor1
parents:
diff changeset
6191 v413 = 3600 * v2;
Ritor1
parents:
diff changeset
6192 }
Ritor1
parents:
diff changeset
6193 amount = v413;
Ritor1
parents:
diff changeset
6194 LABEL_780:
Ritor1
parents:
diff changeset
6195 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6196 goto LABEL_83;
Ritor1
parents:
diff changeset
6197 v414 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6198 v415 = v3->spellnum;
Ritor1
parents:
diff changeset
6199 v416 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6200 pGame->GetStru6()->SetPlayerBuffAnim(v415, v414);
Ritor1
parents:
diff changeset
6201 v323 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6202 v324 = (char *)&pParty->pPlayers[v323].pConditions[3];
Ritor1
parents:
diff changeset
6203 if ( !pParty->pPlayers[v323].pConditions[3] )
Ritor1
parents:
diff changeset
6204 goto LABEL_1056;
Ritor1
parents:
diff changeset
6205 if ( v731 == 4 )
Ritor1
parents:
diff changeset
6206 goto LABEL_637;
Ritor1
parents:
diff changeset
6207 v732 = amount << 7;
Ritor1
parents:
diff changeset
6208 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
Ritor1
parents:
diff changeset
6209 v656 = 3;
Ritor1
parents:
diff changeset
6210 goto LABEL_640;
Ritor1
parents:
diff changeset
6211 case 59:
Ritor1
parents:
diff changeset
6212 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6213 goto LABEL_83;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
6214 if ( a2 == v1 || (a2 & 7) != OBJECT_Actor)
0
Ritor1
parents:
diff changeset
6215 goto LABEL_1056;
Ritor1
parents:
diff changeset
6216 v417 = (int)&pActors[a2 >> 3];
Ritor1
parents:
diff changeset
6217 v730 = v417;
Ritor1
parents:
diff changeset
6218 if ( !(*(char *)(v417 + 38) & 0x80) )
Ritor1
parents:
diff changeset
6219 {
Ritor1
parents:
diff changeset
6220 ((Actor *)v417)->SetRandomGoldIfTheresNoItem();
Ritor1
parents:
diff changeset
6221 v417 = v730;
Ritor1
parents:
diff changeset
6222 }
Ritor1
parents:
diff changeset
6223 v418 = *(int *)(v417 + 672);
Ritor1
parents:
diff changeset
6224 HIDWORD(v733) = v1;
Ritor1
parents:
diff changeset
6225 if ( pItemsTable->pItems[v418].uEquipType == 18 )
Ritor1
parents:
diff changeset
6226 HIDWORD(v733) = *(int *)(v417 + 684);
Ritor1
parents:
diff changeset
6227
Ritor1
parents:
diff changeset
6228 //ItemGen::ItemGen(&v683);
Ritor1
parents:
diff changeset
6229 v683.Reset();
Ritor1
parents:
diff changeset
6230
Ritor1
parents:
diff changeset
6231 v419 = *(short *)(v730 + 180);
Ritor1
parents:
diff changeset
6232 if ( v419 != (short)v1 )
Ritor1
parents:
diff changeset
6233 {
Ritor1
parents:
diff changeset
6234 v683.uItemID = v419;
Ritor1
parents:
diff changeset
6235 goto LABEL_799;
Ritor1
parents:
diff changeset
6236 }
Ritor1
parents:
diff changeset
6237 v420 = 0;
Ritor1
parents:
diff changeset
6238 v421 = v730 + 564;
Ritor1
parents:
diff changeset
6239 while ( *(int *)v421 == v1 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 )
Ritor1
parents:
diff changeset
6240 {
Ritor1
parents:
diff changeset
6241 ++v420;
Ritor1
parents:
diff changeset
6242 v421 += 36;
Ritor1
parents:
diff changeset
6243 if ( v420 >= 4 )
Ritor1
parents:
diff changeset
6244 goto LABEL_799;
Ritor1
parents:
diff changeset
6245 }
Ritor1
parents:
diff changeset
6246 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683));
Ritor1
parents:
diff changeset
6247 v2 = v723;
Ritor1
parents:
diff changeset
6248 v1 = 0;
Ritor1
parents:
diff changeset
6249 LABEL_799:
Ritor1
parents:
diff changeset
6250 if ( HIDWORD(v733) != v1 )
Ritor1
parents:
diff changeset
6251 {
Ritor1
parents:
diff changeset
6252 v675 = (const char *)HIDWORD(v733);
Ritor1
parents:
diff changeset
6253 if ( v683.uItemID != v1 )
Ritor1
parents:
diff changeset
6254 {
Ritor1
parents:
diff changeset
6255 v422 = v683.GetDisplayName();
Ritor1
parents:
diff changeset
6256 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675);
Ritor1
parents:
diff changeset
6257 goto LABEL_807;
Ritor1
parents:
diff changeset
6258 }
Ritor1
parents:
diff changeset
6259 v664 = "%d gold";
Ritor1
parents:
diff changeset
6260 goto LABEL_803;
Ritor1
parents:
diff changeset
6261 }
Ritor1
parents:
diff changeset
6262 if ( v683.uItemID != v1 )
Ritor1
parents:
diff changeset
6263 {
Ritor1
parents:
diff changeset
6264 v675 = v683.GetDisplayName();
Ritor1
parents:
diff changeset
6265 v664 = "(%s)";
Ritor1
parents:
diff changeset
6266 LABEL_803:
Ritor1
parents:
diff changeset
6267 sprintf(pTmpBuf2, v664, v675);
Ritor1
parents:
diff changeset
6268 goto LABEL_807;
Ritor1
parents:
diff changeset
6269 }
Ritor1
parents:
diff changeset
6270 strcpy(pTmpBuf2, "nothing");
Ritor1
parents:
diff changeset
6271 LABEL_807:
Ritor1
parents:
diff changeset
6272 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
6273 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
6274 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
6275 a1.field_4C = v2;
Ritor1
parents:
diff changeset
6276 a1.field_50 = v731;
Ritor1
parents:
diff changeset
6277 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
6278 a1.vPosition.x = *(short *)(v730 + 142);
Ritor1
parents:
diff changeset
6279 a1.vPosition.y = *(short *)(v730 + 144);
Ritor1
parents:
diff changeset
6280 v676 = *(short *)(v730 + 138);
Ritor1
parents:
diff changeset
6281 v665 = a1.vPosition.y;
Ritor1
parents:
diff changeset
6282 a1.vPosition.z = *(short *)(v730 + 138);
Ritor1
parents:
diff changeset
6283 v657 = a1.vPosition.x;
Ritor1
parents:
diff changeset
6284 goto LABEL_1087;
Ritor1
parents:
diff changeset
6285 case 62:
Ritor1
parents:
diff changeset
6286 v423 = v12 - 2;
Ritor1
parents:
diff changeset
6287 if ( !v423 )
Ritor1
parents:
diff changeset
6288 goto LABEL_813;
Ritor1
parents:
diff changeset
6289 v424 = v423 - 1;
Ritor1
parents:
diff changeset
6290 if ( v424 )
Ritor1
parents:
diff changeset
6291 {
Ritor1
parents:
diff changeset
6292 if ( v424 == 1 )
Ritor1
parents:
diff changeset
6293 v425 = 3600 * v2;
Ritor1
parents:
diff changeset
6294 else
Ritor1
parents:
diff changeset
6295 LABEL_813:
Ritor1
parents:
diff changeset
6296 v425 = 300 * v2;
Ritor1
parents:
diff changeset
6297 }
Ritor1
parents:
diff changeset
6298 else
Ritor1
parents:
diff changeset
6299 {
Ritor1
parents:
diff changeset
6300 v425 = 600 * v2;
Ritor1
parents:
diff changeset
6301 }
Ritor1
parents:
diff changeset
6302 amount = v425;
Ritor1
parents:
diff changeset
6303 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6304 goto LABEL_83;
Ritor1
parents:
diff changeset
6305 v426 = a2 >> 3;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
6306 if ( (a2 & 7) != OBJECT_Actor)
0
Ritor1
parents:
diff changeset
6307 goto LABEL_1056;
Ritor1
parents:
diff changeset
6308 v730 = 836 * v426;
Ritor1
parents:
diff changeset
6309 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) )
Ritor1
parents:
diff changeset
6310 {
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6311 pActors[v426].pActorBuffs[1].Reset();
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6312 pActors[v426].pActorBuffs[12].Reset();
0
Ritor1
parents:
diff changeset
6313 v732 = amount << 7;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6314 pActors[v426].pActorBuffs[9].Apply(
0
Ritor1
parents:
diff changeset
6315 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
Ritor1
parents:
diff changeset
6316 v731,
Ritor1
parents:
diff changeset
6317 v1,
Ritor1
parents:
diff changeset
6318 v1,
Ritor1
parents:
diff changeset
6319 v1);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6320 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
0
Ritor1
parents:
diff changeset
6321 }
Ritor1
parents:
diff changeset
6322 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
6323 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
6324 a1.field_4C = v2;
Ritor1
parents:
diff changeset
6325 a1.field_50 = v731;
Ritor1
parents:
diff changeset
6326 v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6327 v61 = v426;
0
Ritor1
parents:
diff changeset
6328 goto LABEL_1086;
Ritor1
parents:
diff changeset
6329 case 66:
Ritor1
parents:
diff changeset
6330 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6331 goto LABEL_83;
Ritor1
parents:
diff changeset
6332 amount = 600 * v2;
Ritor1
parents:
diff changeset
6333 v427 = a2 >> 3;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
6334 if ( (a2 & 7) != OBJECT_Actor)
0
Ritor1
parents:
diff changeset
6335 goto LABEL_1056;
Ritor1
parents:
diff changeset
6336 v730 = 836 * v427;
Ritor1
parents:
diff changeset
6337 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
Ritor1
parents:
diff changeset
6338 goto LABEL_83;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6339 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) )
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6340 {
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6341 pActors[v427].pActorBuffs[9].Reset();
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6342 pActors[v427].pActorBuffs[1].Reset();
0
Ritor1
parents:
diff changeset
6343 v732 = amount << 7;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6344 pActors[v427].pActorBuffs[12].Apply(
0
Ritor1
parents:
diff changeset
6345 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
Ritor1
parents:
diff changeset
6346 v731,
Ritor1
parents:
diff changeset
6347 v1,
Ritor1
parents:
diff changeset
6348 v1,
Ritor1
parents:
diff changeset
6349 v1);
Ritor1
parents:
diff changeset
6350 }
Ritor1
parents:
diff changeset
6351 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
6352 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
6353 a1.field_4C = v2;
Ritor1
parents:
diff changeset
6354 a1.field_50 = v731;
Ritor1
parents:
diff changeset
6355 v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6356 v61 = v427;
0
Ritor1
parents:
diff changeset
6357 goto LABEL_1086;
Ritor1
parents:
diff changeset
6358 case 63:
Ritor1
parents:
diff changeset
6359 v428 = v12 - 2;
Ritor1
parents:
diff changeset
6360 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 )
Ritor1
parents:
diff changeset
6361 v430 = 300 * v2;
Ritor1
parents:
diff changeset
6362 else
Ritor1
parents:
diff changeset
6363 v430 = 180 * v2;
Ritor1
parents:
diff changeset
6364 amount = v430;
Ritor1
parents:
diff changeset
6365 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6366 goto LABEL_83;
Ritor1
parents:
diff changeset
6367 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096);
Ritor1
parents:
diff changeset
6368 v431 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6369 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u);
Ritor1
parents:
diff changeset
6370 ++a1.uItemType;
Ritor1
parents:
diff changeset
6371 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
6372 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
6373 a1.field_4C = v2;
Ritor1
parents:
diff changeset
6374 a1.field_50 = v731;
Ritor1
parents:
diff changeset
6375 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
6376 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
6377 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
6378 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
6379 v432 = v3->uPlayerID;
Ritor1
parents:
diff changeset
6380 a1.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
6381 a1.uFacing = v1;
Ritor1
parents:
diff changeset
6382 v432 *= 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
6383 LOBYTE(v432) = v432 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
6384 a1.field_58_pid = v432;
0
Ritor1
parents:
diff changeset
6385 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
6386 for ( a2 = v1; a2 < (signed int)v726; ++a2 )
Ritor1
parents:
diff changeset
6387 {
Ritor1
parents:
diff changeset
6388 v433 = &pActors[dword_50BF30[a2]];
Ritor1
parents:
diff changeset
6389 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
Ritor1
parents:
diff changeset
6390 break;
Ritor1
parents:
diff changeset
6391 a1.vPosition.x = v433->vPosition.x;
Ritor1
parents:
diff changeset
6392 a1.vPosition.y = v433->vPosition.y;
Ritor1
parents:
diff changeset
6393 v732 = v433->uActorHeight;
Ritor1
parents:
diff changeset
6394 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548);
Ritor1
parents:
diff changeset
6395 v434 = 8 * dword_50BF30[a2];
Ritor1
parents:
diff changeset
6396 LOBYTE(v434) = v434 | 3;
Ritor1
parents:
diff changeset
6397 a1.field_5C = v434;
Ritor1
parents:
diff changeset
6398 a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
6399 if ( stru_50C198.GetMagicalResistance(v433, 7u) )
Ritor1
parents:
diff changeset
6400 {
Ritor1
parents:
diff changeset
6401 v732 = amount << 7;
Ritor1
parents:
diff changeset
6402 v433->pActorBuffs[4].Apply(
Ritor1
parents:
diff changeset
6403 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
Ritor1
parents:
diff changeset
6404 v731,
Ritor1
parents:
diff changeset
6405 v1,
Ritor1
parents:
diff changeset
6406 v1,
Ritor1
parents:
diff changeset
6407 v1);
Ritor1
parents:
diff changeset
6408 }
Ritor1
parents:
diff changeset
6409 }
Ritor1
parents:
diff changeset
6410 goto LABEL_1056;
Ritor1
parents:
diff changeset
6411 case 64:
Ritor1
parents:
diff changeset
6412 v435 = v12 - 2;
Ritor1
parents:
diff changeset
6413 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 )
Ritor1
parents:
diff changeset
6414 amount = v1;
Ritor1
parents:
diff changeset
6415 else
Ritor1
parents:
diff changeset
6416 amount = 86400 * v2;
Ritor1
parents:
diff changeset
6417 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6418 goto LABEL_83;
Ritor1
parents:
diff changeset
6419 v437 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6420 v438 = v3->spellnum;
Ritor1
parents:
diff changeset
6421 v439 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6422 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437);
Ritor1
parents:
diff changeset
6423 v440 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6424 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) )
Ritor1
parents:
diff changeset
6425 {
Ritor1
parents:
diff changeset
6426 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) )
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
6427 pParty->pPlayers[v440].PlaySound(SPEECH_25, v1);
0
Ritor1
parents:
diff changeset
6428 if ( v731 == 4 )
Ritor1
parents:
diff changeset
6429 {
Ritor1
parents:
diff changeset
6430 v441 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6431 LODWORD(pParty->pPlayers[v441].pConditions[5]) = v1;
Ritor1
parents:
diff changeset
6432 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = v1;
Ritor1
parents:
diff changeset
6433 }
Ritor1
parents:
diff changeset
6434 else
Ritor1
parents:
diff changeset
6435 {
Ritor1
parents:
diff changeset
6436 v732 = amount << 7;
Ritor1
parents:
diff changeset
6437 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
6438 5u,
Ritor1
parents:
diff changeset
6439 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
Ritor1
parents:
diff changeset
6440 }
Ritor1
parents:
diff changeset
6441 v377 = &pParty->pPlayers[v3->uPlayerID_2];
Ritor1
parents:
diff changeset
6442 LABEL_720:
Ritor1
parents:
diff changeset
6443 v377->SetCondition(1u, v1);
Ritor1
parents:
diff changeset
6444 }
Ritor1
parents:
diff changeset
6445 goto LABEL_1056;
Ritor1
parents:
diff changeset
6446 case 42:
Ritor1
parents:
diff changeset
6447 v442 = v12 - 2;
Ritor1
parents:
diff changeset
6448 if ( !v442 )
Ritor1
parents:
diff changeset
6449 goto LABEL_855;
Ritor1
parents:
diff changeset
6450 v443 = v442 - 1;
Ritor1
parents:
diff changeset
6451 if ( v443 )
Ritor1
parents:
diff changeset
6452 {
Ritor1
parents:
diff changeset
6453 if ( v443 == 1 )
Ritor1
parents:
diff changeset
6454 v444 = 4 * v2;
Ritor1
parents:
diff changeset
6455 else
Ritor1
parents:
diff changeset
6456 LABEL_855:
Ritor1
parents:
diff changeset
6457 v444 = 2 * v2;
Ritor1
parents:
diff changeset
6458 }
Ritor1
parents:
diff changeset
6459 else
Ritor1
parents:
diff changeset
6460 {
Ritor1
parents:
diff changeset
6461 v444 = 3 * v2;
Ritor1
parents:
diff changeset
6462 }
Ritor1
parents:
diff changeset
6463 amount = v444;
Ritor1
parents:
diff changeset
6464 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6465 goto LABEL_83;
Ritor1
parents:
diff changeset
6466 v445 = a2 >> 3;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
6467 if ( (a2 & 7) == OBJECT_Item)
0
Ritor1
parents:
diff changeset
6468 {
Ritor1
parents:
diff changeset
6469 v449 = (char *)&pLayingItems[v445].stru_24;
Ritor1
parents:
diff changeset
6470 v450 = *(int *)v449;
Ritor1
parents:
diff changeset
6471 if ( pItemsTable->pItems[v450].uEquipType == 18 )
Ritor1
parents:
diff changeset
6472 {
Ritor1
parents:
diff changeset
6473 party_finds_gold(*((int *)v449 + 3), 0);
Ritor1
parents:
diff changeset
6474 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
6475 }
Ritor1
parents:
diff changeset
6476 else
Ritor1
parents:
diff changeset
6477 {
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 169
diff changeset
6478 sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName);
0
Ritor1
parents:
diff changeset
6479 ShowStatusBarString(pTmpBuf2, 2u);
Ritor1
parents:
diff changeset
6480 if ( !pParty->AddItem(&pLayingItems[v445].stru_24) )
Ritor1
parents:
diff changeset
6481 pParty->SetHoldingItem(&pLayingItems[v445].stru_24);
Ritor1
parents:
diff changeset
6482 }
Ritor1
parents:
diff changeset
6483 LayingItem::_42F933(v445);
Ritor1
parents:
diff changeset
6484 }
Ritor1
parents:
diff changeset
6485 else
Ritor1
parents:
diff changeset
6486 {
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
6487 if ( (a2 & 7) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
6488 {
Ritor1
parents:
diff changeset
6489 stru_50C198.LootActor(&pActors[v445]);
Ritor1
parents:
diff changeset
6490 }
Ritor1
parents:
diff changeset
6491 else
Ritor1
parents:
diff changeset
6492 {
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
6493 if ( (a2 & 7) != OBJECT_Decoration)
0
Ritor1
parents:
diff changeset
6494 {
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
6495 if ( (a2 & 7) != OBJECT_BModel)
0
Ritor1
parents:
diff changeset
6496 goto LABEL_1056;
Ritor1
parents:
diff changeset
6497 dword_507CD8 = 1;
Ritor1
parents:
diff changeset
6498 v677 = 1;
Ritor1
parents:
diff changeset
6499 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
6500 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID;
Ritor1
parents:
diff changeset
6501 else
Ritor1
parents:
diff changeset
6502 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID;
Ritor1
parents:
diff changeset
6503 goto LABEL_866;
Ritor1
parents:
diff changeset
6504 }
Ritor1
parents:
diff changeset
6505 v447 = &pLevelDecorations[v445];
Ritor1
parents:
diff changeset
6506 dword_507CD8 = 1;
Ritor1
parents:
diff changeset
6507 v448 = v447->field_16_event_id;
Ritor1
parents:
diff changeset
6508 if ( v448 != (short)v1 )
Ritor1
parents:
diff changeset
6509 {
Ritor1
parents:
diff changeset
6510 v677 = 1;
Ritor1
parents:
diff changeset
6511 v446 = v448;
Ritor1
parents:
diff changeset
6512 LABEL_866:
Ritor1
parents:
diff changeset
6513 EventProcessor(v446, a2, v677);
Ritor1
parents:
diff changeset
6514 goto LABEL_1056;
Ritor1
parents:
diff changeset
6515 }
Ritor1
parents:
diff changeset
6516 if ( v447->IsInteractive() )
Ritor1
parents:
diff changeset
6517 {
Ritor1
parents:
diff changeset
6518 _5C3420_pDecoration = v447;
Ritor1
parents:
diff changeset
6519 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1);
Ritor1
parents:
diff changeset
6520 _5C3420_pDecoration = (LevelDecoration *)v1;
Ritor1
parents:
diff changeset
6521 }
Ritor1
parents:
diff changeset
6522 }
Ritor1
parents:
diff changeset
6523 }
Ritor1
parents:
diff changeset
6524 goto LABEL_1056;
Ritor1
parents:
diff changeset
6525 case 67:
Ritor1
parents:
diff changeset
6526 v451 = v12 - 2;
Ritor1
parents:
diff changeset
6527 if ( v451 )
Ritor1
parents:
diff changeset
6528 {
Ritor1
parents:
diff changeset
6529 v452 = v451 - 1;
Ritor1
parents:
diff changeset
6530 if ( v452 )
Ritor1
parents:
diff changeset
6531 {
Ritor1
parents:
diff changeset
6532 if ( v452 == 1 )
Ritor1
parents:
diff changeset
6533 {
Ritor1
parents:
diff changeset
6534 amount = v1;
Ritor1
parents:
diff changeset
6535 goto LABEL_883;
Ritor1
parents:
diff changeset
6536 }
Ritor1
parents:
diff changeset
6537 v453 = 180 * v2;
Ritor1
parents:
diff changeset
6538 }
Ritor1
parents:
diff changeset
6539 else
Ritor1
parents:
diff changeset
6540 {
Ritor1
parents:
diff changeset
6541 v453 = 86400 * v2;
Ritor1
parents:
diff changeset
6542 }
Ritor1
parents:
diff changeset
6543 }
Ritor1
parents:
diff changeset
6544 else
Ritor1
parents:
diff changeset
6545 {
Ritor1
parents:
diff changeset
6546 v453 = 3600 * v2;
Ritor1
parents:
diff changeset
6547 }
Ritor1
parents:
diff changeset
6548 amount = v453;
Ritor1
parents:
diff changeset
6549 LABEL_883:
Ritor1
parents:
diff changeset
6550 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6551 goto LABEL_83;
Ritor1
parents:
diff changeset
6552 v454 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6553 v455 = v3->spellnum;
Ritor1
parents:
diff changeset
6554 v456 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6555 pGame->GetStru6()->SetPlayerBuffAnim(v455, v454);
Ritor1
parents:
diff changeset
6556 v323 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6557 v324 = (char *)&pParty->pPlayers[v323].pConditions[1];
Ritor1
parents:
diff changeset
6558 if ( !pParty->pPlayers[v323].pConditions[1] )
Ritor1
parents:
diff changeset
6559 goto LABEL_1056;
Ritor1
parents:
diff changeset
6560 if ( v731 == 4 )
Ritor1
parents:
diff changeset
6561 {
Ritor1
parents:
diff changeset
6562 LABEL_637:
Ritor1
parents:
diff changeset
6563 *(int *)v324 = v1;
Ritor1
parents:
diff changeset
6564 *((int *)v324 + 1) = v1;
Ritor1
parents:
diff changeset
6565 goto LABEL_1056;
Ritor1
parents:
diff changeset
6566 }
Ritor1
parents:
diff changeset
6567 v732 = amount << 7;
Ritor1
parents:
diff changeset
6568 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
Ritor1
parents:
diff changeset
6569 v656 = 1;
Ritor1
parents:
diff changeset
6570 LABEL_640:
Ritor1
parents:
diff changeset
6571 v325 = &pParty->pPlayers[v323];
Ritor1
parents:
diff changeset
6572 goto LABEL_641;
Ritor1
parents:
diff changeset
6573 case 68:
Ritor1
parents:
diff changeset
6574 v457 = v12 - 2;
Ritor1
parents:
diff changeset
6575 if ( v457 )
Ritor1
parents:
diff changeset
6576 {
Ritor1
parents:
diff changeset
6577 v458 = v457 - 1;
Ritor1
parents:
diff changeset
6578 if ( v458 )
Ritor1
parents:
diff changeset
6579 {
Ritor1
parents:
diff changeset
6580 if ( v458 == 1 )
Ritor1
parents:
diff changeset
6581 v459 = 5 * v2 + 5;
Ritor1
parents:
diff changeset
6582 else
Ritor1
parents:
diff changeset
6583 v459 = 2 * v2 + 5;
Ritor1
parents:
diff changeset
6584 }
Ritor1
parents:
diff changeset
6585 else
Ritor1
parents:
diff changeset
6586 {
Ritor1
parents:
diff changeset
6587 v459 = 4 * v2 + 5;
Ritor1
parents:
diff changeset
6588 }
Ritor1
parents:
diff changeset
6589 }
Ritor1
parents:
diff changeset
6590 else
Ritor1
parents:
diff changeset
6591 {
Ritor1
parents:
diff changeset
6592 v459 = 3 * v2 + 5;
Ritor1
parents:
diff changeset
6593 }
Ritor1
parents:
diff changeset
6594 amount = v459;
Ritor1
parents:
diff changeset
6595 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6596 goto LABEL_83;
Ritor1
parents:
diff changeset
6597 v460 = *(int *)&v3->field_C;
Ritor1
parents:
diff changeset
6598 if ( v460 == v1 )
Ritor1
parents:
diff changeset
6599 {
Ritor1
parents:
diff changeset
6600 pParty->pPlayers[v3->uPlayerID_2].Heal(amount);
Ritor1
parents:
diff changeset
6601 LABEL_904:
Ritor1
parents:
diff changeset
6602 v674 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6603 LABEL_685:
Ritor1
parents:
diff changeset
6604 v352 = v3->spellnum;
Ritor1
parents:
diff changeset
6605 v353 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6606 pGame->GetStru6()->SetPlayerBuffAnim(v352, v674);
Ritor1
parents:
diff changeset
6607 }
Ritor1
parents:
diff changeset
6608 else
Ritor1
parents:
diff changeset
6609 {
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
6610 if ( (v460 & 7) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
6611 {
Ritor1
parents:
diff changeset
6612 v461 = &pActors[v460 >> 3];
Ritor1
parents:
diff changeset
6613 v462 = v461->uAIState;
Ritor1
parents:
diff changeset
6614 v463 = v461->pMonsterInfo.uHP;
Ritor1
parents:
diff changeset
6615 if ( v462 != 5 )
Ritor1
parents:
diff changeset
6616 {
Ritor1
parents:
diff changeset
6617 if ( v462 != 4 )
Ritor1
parents:
diff changeset
6618 {
Ritor1
parents:
diff changeset
6619 if ( v462 != 19 )
Ritor1
parents:
diff changeset
6620 {
Ritor1
parents:
diff changeset
6621 if ( v462 != 11 )
Ritor1
parents:
diff changeset
6622 {
Ritor1
parents:
diff changeset
6623 v461->sCurrentHP += amount;
Ritor1
parents:
diff changeset
6624 if ( v461->sCurrentHP > v463 )
Ritor1
parents:
diff changeset
6625 v461->sCurrentHP = v463;
Ritor1
parents:
diff changeset
6626 }
Ritor1
parents:
diff changeset
6627 }
Ritor1
parents:
diff changeset
6628 }
Ritor1
parents:
diff changeset
6629 }
Ritor1
parents:
diff changeset
6630 }
Ritor1
parents:
diff changeset
6631 }
Ritor1
parents:
diff changeset
6632 goto LABEL_1056;
Ritor1
parents:
diff changeset
6633 case 72:
Ritor1
parents:
diff changeset
6634 v464 = v12 - 2;
Ritor1
parents:
diff changeset
6635 if ( !v464 )
Ritor1
parents:
diff changeset
6636 goto LABEL_910;
Ritor1
parents:
diff changeset
6637 v465 = v464 - 1;
Ritor1
parents:
diff changeset
6638 if ( v465 )
Ritor1
parents:
diff changeset
6639 {
Ritor1
parents:
diff changeset
6640 if ( v465 == 1 )
Ritor1
parents:
diff changeset
6641 {
Ritor1
parents:
diff changeset
6642 amount = v1;
Ritor1
parents:
diff changeset
6643 goto LABEL_912;
Ritor1
parents:
diff changeset
6644 }
Ritor1
parents:
diff changeset
6645 LABEL_910:
Ritor1
parents:
diff changeset
6646 v466 = 3600 * v2;
Ritor1
parents:
diff changeset
6647 }
Ritor1
parents:
diff changeset
6648 else
Ritor1
parents:
diff changeset
6649 {
Ritor1
parents:
diff changeset
6650 v466 = 86400 * v2;
Ritor1
parents:
diff changeset
6651 }
Ritor1
parents:
diff changeset
6652 amount = v466;
Ritor1
parents:
diff changeset
6653 LABEL_912:
Ritor1
parents:
diff changeset
6654 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6655 goto LABEL_83;
Ritor1
parents:
diff changeset
6656 v467 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6657 v468 = v3->spellnum;
Ritor1
parents:
diff changeset
6658 v469 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6659 pGame->GetStru6()->SetPlayerBuffAnim(v468, v467);
Ritor1
parents:
diff changeset
6660 v470 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6661 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6]))
Ritor1
parents:
diff changeset
6662 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8]))
Ritor1
parents:
diff changeset
6663 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) )
Ritor1
parents:
diff changeset
6664 goto LABEL_1056;
Ritor1
parents:
diff changeset
6665 if ( v731 == 4 )
Ritor1
parents:
diff changeset
6666 {
Ritor1
parents:
diff changeset
6667 LODWORD(pParty->pPlayers[v470].pConditions[6]) = v1;
Ritor1
parents:
diff changeset
6668 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = v1;
Ritor1
parents:
diff changeset
6669 v471 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6670 LODWORD(pParty->pPlayers[v471].pConditions[8]) = v1;
Ritor1
parents:
diff changeset
6671 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = v1;
Ritor1
parents:
diff changeset
6672 v472 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6673 LODWORD(pParty->pPlayers[v472].pConditions[10]) = v1;
Ritor1
parents:
diff changeset
6674 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = v1;
Ritor1
parents:
diff changeset
6675 goto LABEL_1056;
Ritor1
parents:
diff changeset
6676 }
Ritor1
parents:
diff changeset
6677 v732 = amount << 7;
Ritor1
parents:
diff changeset
6678 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
Ritor1
parents:
diff changeset
6679 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
6680 6u,
Ritor1
parents:
diff changeset
6681 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
Ritor1
parents:
diff changeset
6682 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
6683 8u,
Ritor1
parents:
diff changeset
6684 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
Ritor1
parents:
diff changeset
6685 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2);
Ritor1
parents:
diff changeset
6686 v656 = 10;
Ritor1
parents:
diff changeset
6687 goto LABEL_937;
Ritor1
parents:
diff changeset
6688 case 75:
Ritor1
parents:
diff changeset
6689 amount = v2;
Ritor1
parents:
diff changeset
6690 LODWORD(v733) = 3600 * v2;
Ritor1
parents:
diff changeset
6691 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6692 goto LABEL_83;
Ritor1
parents:
diff changeset
6693 v474 = v3->spellnum;
Ritor1
parents:
diff changeset
6694 v475 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6695 pGame->GetStru6()->SetPlayerBuffAnim(v474, v1);
Ritor1
parents:
diff changeset
6696 v476 = v3->spellnum;
Ritor1
parents:
diff changeset
6697 v477 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6698 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1u);
Ritor1
parents:
diff changeset
6699 v478 = v3->spellnum;
Ritor1
parents:
diff changeset
6700 v479 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6701 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2u);
Ritor1
parents:
diff changeset
6702 v480 = v3->spellnum;
Ritor1
parents:
diff changeset
6703 v481 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6704 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3u);
Ritor1
parents:
diff changeset
6705 v668 = v1;
Ritor1
parents:
diff changeset
6706 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
6707 v658 = v1;
Ritor1
parents:
diff changeset
6708 v653 = v2;
Ritor1
parents:
diff changeset
6709 v651 = v731;
Ritor1
parents:
diff changeset
6710 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
6711 v27 = (char *)&pParty->pPartyBuffs[13];
Ritor1
parents:
diff changeset
6712 goto LABEL_101;
Ritor1
parents:
diff changeset
6713 case 73:
Ritor1
parents:
diff changeset
6714 LODWORD(v733) = 3600 * v2;
Ritor1
parents:
diff changeset
6715 amount = v2;
Ritor1
parents:
diff changeset
6716 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6717 goto LABEL_83;
Ritor1
parents:
diff changeset
6718 if ( v731 == 4 )
Ritor1
parents:
diff changeset
6719 {
Ritor1
parents:
diff changeset
6720 v482 = v3->spellnum;
Ritor1
parents:
diff changeset
6721 v483 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6722 pGame->GetStru6()->SetPlayerBuffAnim(v482, v1);
Ritor1
parents:
diff changeset
6723 v484 = v3->spellnum;
Ritor1
parents:
diff changeset
6724 v485 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6725 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1u);
Ritor1
parents:
diff changeset
6726 v486 = v3->spellnum;
Ritor1
parents:
diff changeset
6727 v487 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6728 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2u);
Ritor1
parents:
diff changeset
6729 v488 = v3->spellnum;
Ritor1
parents:
diff changeset
6730 v489 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6731 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3u);
Ritor1
parents:
diff changeset
6732 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
6733 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
6734 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1);
Ritor1
parents:
diff changeset
6735 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1);
Ritor1
parents:
diff changeset
6736 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1);
Ritor1
parents:
diff changeset
6737 v668 = v1;
Ritor1
parents:
diff changeset
6738 v658 = v2;
Ritor1
parents:
diff changeset
6739 v653 = v2;
Ritor1
parents:
diff changeset
6740 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717;
Ritor1
parents:
diff changeset
6741 v651 = 4;
Ritor1
parents:
diff changeset
6742 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32;
Ritor1
parents:
diff changeset
6743 v27 = (char *)&pParty->pPlayers[3].pPlayerBuffs[6];
Ritor1
parents:
diff changeset
6744 goto LABEL_104;
Ritor1
parents:
diff changeset
6745 }
Ritor1
parents:
diff changeset
6746 v490 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6747 v491 = v3->spellnum;
Ritor1
parents:
diff changeset
6748 v492 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6749 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490);
Ritor1
parents:
diff changeset
6750 v668 = v1;
Ritor1
parents:
diff changeset
6751 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
6752 v658 = v2;
Ritor1
parents:
diff changeset
6753 v653 = v2;
Ritor1
parents:
diff changeset
6754 v651 = v731;
Ritor1
parents:
diff changeset
6755 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
6756 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6];
Ritor1
parents:
diff changeset
6757 goto LABEL_103;
Ritor1
parents:
diff changeset
6758 case 74:
Ritor1
parents:
diff changeset
6759 v493 = v12 - 2;
Ritor1
parents:
diff changeset
6760 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 )
Ritor1
parents:
diff changeset
6761 amount = v1;
Ritor1
parents:
diff changeset
6762 else
Ritor1
parents:
diff changeset
6763 amount = 86400 * v2;
Ritor1
parents:
diff changeset
6764 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6765 goto LABEL_83;
Ritor1
parents:
diff changeset
6766 v495 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6767 v496 = v3->spellnum;
Ritor1
parents:
diff changeset
6768 v497 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6769 pGame->GetStru6()->SetPlayerBuffAnim(v496, v495);
Ritor1
parents:
diff changeset
6770 v498 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6771 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7]))
Ritor1
parents:
diff changeset
6772 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9]))
Ritor1
parents:
diff changeset
6773 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) )
Ritor1
parents:
diff changeset
6774 goto LABEL_1056;
Ritor1
parents:
diff changeset
6775 if ( v731 == 4 )
Ritor1
parents:
diff changeset
6776 {
Ritor1
parents:
diff changeset
6777 LODWORD(pParty->pPlayers[v498].pConditions[7]) = v1;
Ritor1
parents:
diff changeset
6778 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = v1;
Ritor1
parents:
diff changeset
6779 v499 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6780 LODWORD(pParty->pPlayers[v499].pConditions[9]) = v1;
Ritor1
parents:
diff changeset
6781 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = v1;
Ritor1
parents:
diff changeset
6782 v500 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
6783 LODWORD(pParty->pPlayers[v500].pConditions[11]) = v1;
Ritor1
parents:
diff changeset
6784 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = v1;
Ritor1
parents:
diff changeset
6785 }
Ritor1
parents:
diff changeset
6786 else
Ritor1
parents:
diff changeset
6787 {
Ritor1
parents:
diff changeset
6788 v732 = amount << 7;
Ritor1
parents:
diff changeset
6789 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
Ritor1
parents:
diff changeset
6790 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
6791 7u,
Ritor1
parents:
diff changeset
6792 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
Ritor1
parents:
diff changeset
6793 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
6794 9u,
Ritor1
parents:
diff changeset
6795 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
Ritor1
parents:
diff changeset
6796 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2);
Ritor1
parents:
diff changeset
6797 v656 = 11;
Ritor1
parents:
diff changeset
6798 LABEL_937:
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
6799 v325 = &pParty->pPlayers[v3->uPlayerID_2];
0
Ritor1
parents:
diff changeset
6800 LABEL_641:
Ritor1
parents:
diff changeset
6801 v325->DiscardConditionIfLastsLongerThan(v656, v663);
Ritor1
parents:
diff changeset
6802 }
Ritor1
parents:
diff changeset
6803 goto LABEL_1056;
Ritor1
parents:
diff changeset
6804 case 77:
Ritor1
parents:
diff changeset
6805 amount = 5 * v2 + 10;
Ritor1
parents:
diff changeset
6806 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6807 goto LABEL_83;
Ritor1
parents:
diff changeset
6808 v501 = pParty->pPlayers;
Ritor1
parents:
diff changeset
6809 do
Ritor1
parents:
diff changeset
6810 {
Ritor1
parents:
diff changeset
6811 v502 = v3->spellnum;
Ritor1
parents:
diff changeset
6812 v503 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6813 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1);
Ritor1
parents:
diff changeset
6814 v501->Heal(amount);
Ritor1
parents:
diff changeset
6815 ++v501;
Ritor1
parents:
diff changeset
6816 ++v1;
Ritor1
parents:
diff changeset
6817 }
Ritor1
parents:
diff changeset
6818 while ( (signed int)v501 < (signed int)pParty->pHirelings );
Ritor1
parents:
diff changeset
6819 goto LABEL_1056;
Ritor1
parents:
diff changeset
6820 case 80:
Ritor1
parents:
diff changeset
6821 sRecoveryTime -= v2;
Ritor1
parents:
diff changeset
6822 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6823 goto LABEL_83;
Ritor1
parents:
diff changeset
6824 v504 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6825 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u);
Ritor1
parents:
diff changeset
6826 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096);
Ritor1
parents:
diff changeset
6827 ++a1.uItemType;
Ritor1
parents:
diff changeset
6828 HIDWORD(v733) = v505;
Ritor1
parents:
diff changeset
6829 v690 = v1;
Ritor1
parents:
diff changeset
6830 v689 = v1;
Ritor1
parents:
diff changeset
6831 v688 = v1;
Ritor1
parents:
diff changeset
6832 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
6833 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
6834 a1.field_4C = v2;
Ritor1
parents:
diff changeset
6835 a1.field_50 = v731;
Ritor1
parents:
diff changeset
6836 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
6837 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
6838 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
6839 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
6840 v506 = v3->uPlayerID;
Ritor1
parents:
diff changeset
6841 a1.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
6842 a1.uFacing = v1;
Ritor1
parents:
diff changeset
6843 v506 *= 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
6844 LOBYTE(v506) = v506 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
6845 a1.field_58_pid = v506;
0
Ritor1
parents:
diff changeset
6846 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
6847 a2 = v1;
Ritor1
parents:
diff changeset
6848 if ( SHIDWORD(v733) > v1 )
Ritor1
parents:
diff changeset
6849 {
Ritor1
parents:
diff changeset
6850 do
Ritor1
parents:
diff changeset
6851 {
Ritor1
parents:
diff changeset
6852 v507 = dword_50BF30[a2];
Ritor1
parents:
diff changeset
6853 a1.vPosition.x = pActors[v507].vPosition.x;
Ritor1
parents:
diff changeset
6854 a1.vPosition.y = pActors[v507].vPosition.y;
Ritor1
parents:
diff changeset
6855 v732 = pActors[v507].uActorHeight;
Ritor1
parents:
diff changeset
6856 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548);
Ritor1
parents:
diff changeset
6857 v508 = 8 * dword_50BF30[a2];
Ritor1
parents:
diff changeset
6858 LOBYTE(v508) = v508 | 3;
Ritor1
parents:
diff changeset
6859 a1.field_5C = v508;
Ritor1
parents:
diff changeset
6860 v509 = a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
6861 v510 = a2;
Ritor1
parents:
diff changeset
6862 DamageMonsterFromParty(8 * v509 | 2, dword_50BF30[a2], (Vec3_int_ *)&v688);
Ritor1
parents:
diff changeset
6863 a2 = v510 + 1;
Ritor1
parents:
diff changeset
6864 }
Ritor1
parents:
diff changeset
6865 while ( v510 + 1 < SHIDWORD(v733) );
Ritor1
parents:
diff changeset
6866 }
Ritor1
parents:
diff changeset
6867 for ( a2 = v1; a2 < SHIDWORD(v733); ++a2 )
Ritor1
parents:
diff changeset
6868 {
Ritor1
parents:
diff changeset
6869 v511 = &pActors[dword_50BF30[a2]];
Ritor1
parents:
diff changeset
6870 a1.vPosition.x = v511->vPosition.x;
Ritor1
parents:
diff changeset
6871 a1.vPosition.y = v511->vPosition.y;
Ritor1
parents:
diff changeset
6872 v732 = v511->uActorHeight;
Ritor1
parents:
diff changeset
6873 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548);
Ritor1
parents:
diff changeset
6874 v512 = 8 * dword_50BF30[a2];
Ritor1
parents:
diff changeset
6875 LOBYTE(v512) = v512 | 3;
Ritor1
parents:
diff changeset
6876 a1.field_5C = v512;
Ritor1
parents:
diff changeset
6877 a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
6878 v513 = v511->pActorBuffs;
Ritor1
parents:
diff changeset
6879 v726 = (Player *)22;
Ritor1
parents:
diff changeset
6880 do
Ritor1
parents:
diff changeset
6881 {
Ritor1
parents:
diff changeset
6882 v513->Reset();
Ritor1
parents:
diff changeset
6883 ++v513;
Ritor1
parents:
diff changeset
6884 v726 = (Player *)((char *)v726 - 1);
Ritor1
parents:
diff changeset
6885 }
Ritor1
parents:
diff changeset
6886 while ( *(float *)&v726 != 0.0 );
Ritor1
parents:
diff changeset
6887 }
Ritor1
parents:
diff changeset
6888 goto LABEL_1056;
Ritor1
parents:
diff changeset
6889 case 82:
Ritor1
parents:
diff changeset
6890 v514 = v12 - 2;
Ritor1
parents:
diff changeset
6891 if ( !v514 )
Ritor1
parents:
diff changeset
6892 goto LABEL_955;
Ritor1
parents:
diff changeset
6893 v515 = v514 - 1;
Ritor1
parents:
diff changeset
6894 if ( v515 )
Ritor1
parents:
diff changeset
6895 {
Ritor1
parents:
diff changeset
6896 if ( v515 == 1 )
Ritor1
parents:
diff changeset
6897 {
Ritor1
parents:
diff changeset
6898 v516 = 900 * v2;
Ritor1
parents:
diff changeset
6899 amount = 5;
Ritor1
parents:
diff changeset
6900 }
Ritor1
parents:
diff changeset
6901 else
Ritor1
parents:
diff changeset
6902 {
Ritor1
parents:
diff changeset
6903 LABEL_955:
Ritor1
parents:
diff changeset
6904 v516 = 300 * v2;
Ritor1
parents:
diff changeset
6905 amount = 1;
Ritor1
parents:
diff changeset
6906 }
Ritor1
parents:
diff changeset
6907 }
Ritor1
parents:
diff changeset
6908 else
Ritor1
parents:
diff changeset
6909 {
Ritor1
parents:
diff changeset
6910 v516 = 900 * v2;
Ritor1
parents:
diff changeset
6911 amount = 3;
Ritor1
parents:
diff changeset
6912 }
Ritor1
parents:
diff changeset
6913 v733 = __PAIR__(v1, v516);
Ritor1
parents:
diff changeset
6914 v517 = 8 * v3->uPlayerID;
Ritor1
parents:
diff changeset
6915 LOBYTE(v517) = v517 | 4;
Ritor1
parents:
diff changeset
6916 if ( (signed int)uNumActors > v1 )
Ritor1
parents:
diff changeset
6917 {
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6918 v518 = pActors;//[0].uAIState;
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6919 v726b = uNumActors;
0
Ritor1
parents:
diff changeset
6920 do
Ritor1
parents:
diff changeset
6921 {
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6922 v519 = v518->uAIState;
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6923 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID )
0
Ritor1
parents:
diff changeset
6924 ++HIDWORD(v733);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6925 ++v518;
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6926 --v726;
0
Ritor1
parents:
diff changeset
6927 }
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
6928 while ( v726 != 0 );
0
Ritor1
parents:
diff changeset
6929 }
Ritor1
parents:
diff changeset
6930 if ( SHIDWORD(v733) >= amount )
Ritor1
parents:
diff changeset
6931 {
Ritor1
parents:
diff changeset
6932 v66 = pGlobalTXT_LocalizationStrings[648];
Ritor1
parents:
diff changeset
6933 goto LABEL_201;
Ritor1
parents:
diff changeset
6934 }
Ritor1
parents:
diff changeset
6935 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6936 goto LABEL_83;
Ritor1
parents:
diff changeset
6937 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733);
Ritor1
parents:
diff changeset
6938 goto LABEL_1056;
Ritor1
parents:
diff changeset
6939 case 83:
Ritor1
parents:
diff changeset
6940 v520 = v12 - 2;
Ritor1
parents:
diff changeset
6941 if ( !v520 )
Ritor1
parents:
diff changeset
6942 goto LABEL_973;
Ritor1
parents:
diff changeset
6943 v521 = v520 - 1;
Ritor1
parents:
diff changeset
6944 if ( v521 )
Ritor1
parents:
diff changeset
6945 {
Ritor1
parents:
diff changeset
6946 if ( v521 == 1 )
Ritor1
parents:
diff changeset
6947 {
Ritor1
parents:
diff changeset
6948 LODWORD(v733) = 18000 * v2;
Ritor1
parents:
diff changeset
6949 v522 = 5 * v2 + 10;
Ritor1
parents:
diff changeset
6950 }
Ritor1
parents:
diff changeset
6951 else
Ritor1
parents:
diff changeset
6952 {
Ritor1
parents:
diff changeset
6953 LABEL_973:
Ritor1
parents:
diff changeset
6954 LODWORD(v733) = 10800 * v2;
Ritor1
parents:
diff changeset
6955 v522 = 3 * v2 + 10;
Ritor1
parents:
diff changeset
6956 }
Ritor1
parents:
diff changeset
6957 }
Ritor1
parents:
diff changeset
6958 else
Ritor1
parents:
diff changeset
6959 {
Ritor1
parents:
diff changeset
6960 LODWORD(v733) = 14400 * v2;
Ritor1
parents:
diff changeset
6961 v522 = 4 * v2 + 10;
Ritor1
parents:
diff changeset
6962 }
Ritor1
parents:
diff changeset
6963 amount = v522;
Ritor1
parents:
diff changeset
6964 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6965 goto LABEL_83;
Ritor1
parents:
diff changeset
6966 v523 = v3->spellnum;
Ritor1
parents:
diff changeset
6967 v524 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6968 pGame->GetStru6()->SetPlayerBuffAnim(v523, v1);
Ritor1
parents:
diff changeset
6969 v83 = 1;
Ritor1
parents:
diff changeset
6970 v525 = v3->spellnum;
Ritor1
parents:
diff changeset
6971 v526 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6972 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1u);
Ritor1
parents:
diff changeset
6973 v527 = v3->spellnum;
Ritor1
parents:
diff changeset
6974 v528 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6975 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2u);
Ritor1
parents:
diff changeset
6976 v529 = v3->spellnum;
Ritor1
parents:
diff changeset
6977 v530 = pGame->GetStru6();
Ritor1
parents:
diff changeset
6978 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3u);
Ritor1
parents:
diff changeset
6979 v673 = v1;
Ritor1
parents:
diff changeset
6980 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
6981 v662 = v1;
Ritor1
parents:
diff changeset
6982 v655 = amount;
Ritor1
parents:
diff changeset
6983 v652 = v731;
Ritor1
parents:
diff changeset
6984 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
6985 v137 = (char *)&pParty->pPartyBuffs[2];
Ritor1
parents:
diff changeset
6986 goto LABEL_976;
Ritor1
parents:
diff changeset
6987 case 84:
Ritor1
parents:
diff changeset
6988 v67 = 2;
Ritor1
parents:
diff changeset
6989 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
Ritor1
parents:
diff changeset
6990 {
Ritor1
parents:
diff changeset
6991 v66 = pGlobalTXT_LocalizationStrings[497];
Ritor1
parents:
diff changeset
6992 goto LABEL_202;
Ritor1
parents:
diff changeset
6993 }
Ritor1
parents:
diff changeset
6994 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
6995 goto LABEL_83;
Ritor1
parents:
diff changeset
6996 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096);
Ritor1
parents:
diff changeset
6997 ++a1.uItemType;
Ritor1
parents:
diff changeset
6998 v726 = (Player *)v531;
Ritor1
parents:
diff changeset
6999 v696 = v1;
Ritor1
parents:
diff changeset
7000 v695 = v1;
Ritor1
parents:
diff changeset
7001 v694 = v1;
Ritor1
parents:
diff changeset
7002 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
7003 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
7004 a1.field_4C = v2;
Ritor1
parents:
diff changeset
7005 a1.field_50 = v731;
Ritor1
parents:
diff changeset
7006 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
7007 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
7008 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
7009 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
7010 v532 = v3->uPlayerID;
Ritor1
parents:
diff changeset
7011 a1.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
7012 a1.uFacing = v1;
Ritor1
parents:
diff changeset
7013 v532 *= 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7014 LOBYTE(v532) = v532 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7015 a1.field_58_pid = v532;
0
Ritor1
parents:
diff changeset
7016 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
7017 a2 = v1;
Ritor1
parents:
diff changeset
7018 if ( (signed int)v726 > v1 )
Ritor1
parents:
diff changeset
7019 {
Ritor1
parents:
diff changeset
7020 do
Ritor1
parents:
diff changeset
7021 {
Ritor1
parents:
diff changeset
7022 v533 = dword_50BF30[a2];
Ritor1
parents:
diff changeset
7023 a1.vPosition.x = pActors[v533].vPosition.x;
Ritor1
parents:
diff changeset
7024 a1.vPosition.y = pActors[v533].vPosition.y;
Ritor1
parents:
diff changeset
7025 v732 = pActors[v533].uActorHeight;
Ritor1
parents:
diff changeset
7026 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548);
Ritor1
parents:
diff changeset
7027 v534 = 8 * dword_50BF30[a2];
Ritor1
parents:
diff changeset
7028 LOBYTE(v534) = v534 | 3;
Ritor1
parents:
diff changeset
7029 a1.field_5C = v534;
Ritor1
parents:
diff changeset
7030 v535 = a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
7031 v536 = a2;
Ritor1
parents:
diff changeset
7032 DamageMonsterFromParty(8 * v535 | 2, dword_50BF30[a2], (Vec3_int_ *)&v694);
Ritor1
parents:
diff changeset
7033 a2 = v536 + 1;
Ritor1
parents:
diff changeset
7034 }
Ritor1
parents:
diff changeset
7035 while ( v536 + 1 < (signed int)v726 );
Ritor1
parents:
diff changeset
7036 }
Ritor1
parents:
diff changeset
7037 v537 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7038 pGame->GetStru6()->_4A8BFC();
Ritor1
parents:
diff changeset
7039 goto LABEL_1056;
Ritor1
parents:
diff changeset
7040 case 85:
Ritor1
parents:
diff changeset
7041 v538 = v12 - 2;
Ritor1
parents:
diff changeset
7042 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 )
Ritor1
parents:
diff changeset
7043 {
Ritor1
parents:
diff changeset
7044 amount = 5 * v2;
Ritor1
parents:
diff changeset
7045 v540 = 18000 * v2;
Ritor1
parents:
diff changeset
7046 }
Ritor1
parents:
diff changeset
7047 else
Ritor1
parents:
diff changeset
7048 {
Ritor1
parents:
diff changeset
7049 amount = 4 * v2;
Ritor1
parents:
diff changeset
7050 v540 = 14400 * v2;
Ritor1
parents:
diff changeset
7051 }
Ritor1
parents:
diff changeset
7052 v730 = v540;
Ritor1
parents:
diff changeset
7053 LODWORD(v733) = v540;
Ritor1
parents:
diff changeset
7054 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7055 goto LABEL_83;
Ritor1
parents:
diff changeset
7056 v541 = v3->spellnum;
Ritor1
parents:
diff changeset
7057 v542 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7058 pGame->GetStru6()->SetPlayerBuffAnim(v541, v1);
Ritor1
parents:
diff changeset
7059 v543 = v3->spellnum;
Ritor1
parents:
diff changeset
7060 v544 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7061 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1u);
Ritor1
parents:
diff changeset
7062 v545 = v3->spellnum;
Ritor1
parents:
diff changeset
7063 v546 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7064 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2u);
Ritor1
parents:
diff changeset
7065 v547 = v3->spellnum;
Ritor1
parents:
diff changeset
7066 v548 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7067 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3u);
Ritor1
parents:
diff changeset
7068 v732 = v730 << 7;
Ritor1
parents:
diff changeset
7069 v549 = (double)(v730 << 7) * 0.033333335;
Ritor1
parents:
diff changeset
7070 *((float *)&v733 + 1) = v549;
Ritor1
parents:
diff changeset
7071 v712 = (signed __int64)v549;
Ritor1
parents:
diff changeset
7072 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, v1, v1);
Ritor1
parents:
diff changeset
7073 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1);
Ritor1
parents:
diff changeset
7074 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1);
Ritor1
parents:
diff changeset
7075 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1);
Ritor1
parents:
diff changeset
7076 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1);
Ritor1
parents:
diff changeset
7077 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1);
Ritor1
parents:
diff changeset
7078 v550 = v2 + 5;
Ritor1
parents:
diff changeset
7079 pParty->pPartyBuffs[ 5].Apply(
Ritor1
parents:
diff changeset
7080 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)),
Ritor1
parents:
diff changeset
7081 v731,
Ritor1
parents:
diff changeset
7082 v550,
Ritor1
parents:
diff changeset
7083 v1,
Ritor1
parents:
diff changeset
7084 v1);
Ritor1
parents:
diff changeset
7085 v668 = v1;
Ritor1
parents:
diff changeset
7086 v658 = v1;
Ritor1
parents:
diff changeset
7087 v653 = v550;
Ritor1
parents:
diff changeset
7088 v651 = v731;
Ritor1
parents:
diff changeset
7089 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1));
Ritor1
parents:
diff changeset
7090 LABEL_992:
Ritor1
parents:
diff changeset
7091 v27 = (char *)&pParty->pPartyBuffs[19];
Ritor1
parents:
diff changeset
7092 goto LABEL_103;
Ritor1
parents:
diff changeset
7093 case 86:
Ritor1
parents:
diff changeset
7094 v551 = v12 - 2;
Ritor1
parents:
diff changeset
7095 if ( !v551 )
Ritor1
parents:
diff changeset
7096 goto LABEL_998;
Ritor1
parents:
diff changeset
7097 v552 = v551 - 1;
Ritor1
parents:
diff changeset
7098 if ( v552 )
Ritor1
parents:
diff changeset
7099 {
Ritor1
parents:
diff changeset
7100 if ( v552 == 1 )
Ritor1
parents:
diff changeset
7101 {
Ritor1
parents:
diff changeset
7102 amount = 15;
Ritor1
parents:
diff changeset
7103 HIDWORD(v733) = 20;
Ritor1
parents:
diff changeset
7104 goto LABEL_1000;
Ritor1
parents:
diff changeset
7105 }
Ritor1
parents:
diff changeset
7106 LABEL_998:
Ritor1
parents:
diff changeset
7107 v678 = 4;
Ritor1
parents:
diff changeset
7108 }
Ritor1
parents:
diff changeset
7109 else
Ritor1
parents:
diff changeset
7110 {
Ritor1
parents:
diff changeset
7111 v678 = 12;
Ritor1
parents:
diff changeset
7112 }
Ritor1
parents:
diff changeset
7113 amount = v678;
Ritor1
parents:
diff changeset
7114 HIDWORD(v733) = v678;
Ritor1
parents:
diff changeset
7115 LABEL_1000:
Ritor1
parents:
diff changeset
7116 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7117 goto LABEL_83;
Ritor1
parents:
diff changeset
7118 y = (char *)(60 * (v2 * HIDWORD(v733) + 60));
Ritor1
parents:
diff changeset
7119 v732 = (300 * amount * v2 + 60) << 7;
Ritor1
parents:
diff changeset
7120 v730 = v2 + 5;
Ritor1
parents:
diff changeset
7121 v726 = (Player *)v1;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7122 v553 = pParty->pPlayers;//[0].pConditions[1];
0
Ritor1
parents:
diff changeset
7123 *((float *)&v733 + 1) = (double)v732 * 0.033333335;
Ritor1
parents:
diff changeset
7124 do
Ritor1
parents:
diff changeset
7125 {
Ritor1
parents:
diff changeset
7126 v554 = v3->spellnum;
Ritor1
parents:
diff changeset
7127 v555 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7128 pGame->GetStru6()->SetPlayerBuffAnim(v554, v1);
Ritor1
parents:
diff changeset
7129 v556 = v3->spellnum;
Ritor1
parents:
diff changeset
7130 v557 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7131 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1u);
Ritor1
parents:
diff changeset
7132 v558 = v3->spellnum;
Ritor1
parents:
diff changeset
7133 v559 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7134 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2u);
Ritor1
parents:
diff changeset
7135 v560 = v3->spellnum;
Ritor1
parents:
diff changeset
7136 v561 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7137 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3u);
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7138 //((SpellBuff *)(v553 + 6056))->Apply(
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7139 v553->pPlayerBuffs[4].Apply(
0
Ritor1
parents:
diff changeset
7140 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)),
Ritor1
parents:
diff changeset
7141 v731,
Ritor1
parents:
diff changeset
7142 v730,
Ritor1
parents:
diff changeset
7143 v1,
Ritor1
parents:
diff changeset
7144 v1);
Ritor1
parents:
diff changeset
7145 if ( *(_QWORD *)v553 )
Ritor1
parents:
diff changeset
7146 v726 = (Player *)1;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7147 ++v553;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7148 }
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7149 while ( v553 <= &pParty->pPlayers[3] );
0
Ritor1
parents:
diff changeset
7150 v562 = v731;
Ritor1
parents:
diff changeset
7151 pParty->pPartyBuffs[9].Apply(
Ritor1
parents:
diff changeset
7152 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)),
Ritor1
parents:
diff changeset
7153 v731,
Ritor1
parents:
diff changeset
7154 v730,
Ritor1
parents:
diff changeset
7155 v1,
Ritor1
parents:
diff changeset
7156 v1);
Ritor1
parents:
diff changeset
7157 pParty->pPartyBuffs[14].Apply(
Ritor1
parents:
diff changeset
7158 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)),
Ritor1
parents:
diff changeset
7159 v562,
Ritor1
parents:
diff changeset
7160 v1,
Ritor1
parents:
diff changeset
7161 v1,
Ritor1
parents:
diff changeset
7162 v1);
Ritor1
parents:
diff changeset
7163 pParty->pPartyBuffs[15].Apply(
Ritor1
parents:
diff changeset
7164 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)),
Ritor1
parents:
diff changeset
7165 v562,
Ritor1
parents:
diff changeset
7166 v730,
Ritor1
parents:
diff changeset
7167 v1,
Ritor1
parents:
diff changeset
7168 v1);
Ritor1
parents:
diff changeset
7169 if ( v726 != (Player *)v1 )
Ritor1
parents:
diff changeset
7170 goto LABEL_1056;
Ritor1
parents:
diff changeset
7171 v668 = v1;
Ritor1
parents:
diff changeset
7172 v732 = (int)y << 7;
Ritor1
parents:
diff changeset
7173 v658 = v1;
Ritor1
parents:
diff changeset
7174 v653 = v730;
Ritor1
parents:
diff changeset
7175 v651 = v562;
Ritor1
parents:
diff changeset
7176 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335
Ritor1
parents:
diff changeset
7177 + (double)(signed __int64)pParty->uTimePlayed);
Ritor1
parents:
diff changeset
7178 v27 = (char *)&pParty->pPartyBuffs[8];
Ritor1
parents:
diff changeset
7179 goto LABEL_103;
Ritor1
parents:
diff changeset
7180 case 88:
Ritor1
parents:
diff changeset
7181 amount = 3;
Ritor1
parents:
diff changeset
7182 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u )
Ritor1
parents:
diff changeset
7183 goto LABEL_200;
Ritor1
parents:
diff changeset
7184 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7185 goto LABEL_83;
Ritor1
parents:
diff changeset
7186 a2 = v1;
Ritor1
parents:
diff changeset
7187 _this = (ItemGen *)&pPlayers[1];
Ritor1
parents:
diff changeset
7188 do
Ritor1
parents:
diff changeset
7189 {
Ritor1
parents:
diff changeset
7190 v563 = 0;
Ritor1
parents:
diff changeset
7191 do
Ritor1
parents:
diff changeset
7192 {
Ritor1
parents:
diff changeset
7193 v564 = _this->uItemID;
Ritor1
parents:
diff changeset
7194 *(int *)(v563 + _this->uItemID) = v1;
Ritor1
parents:
diff changeset
7195 v563 += 8;
Ritor1
parents:
diff changeset
7196 *(int *)(v563 + v564 - 4) = v1;
Ritor1
parents:
diff changeset
7197 }
Ritor1
parents:
diff changeset
7198 while ( v563 <= 128 );
Ritor1
parents:
diff changeset
7199 v565 = ((Player *)_this->uItemID)->GetMaxHealth();
Ritor1
parents:
diff changeset
7200 v566 = (Player **)_this;
Ritor1
parents:
diff changeset
7201 *(int *)(_this->uItemID + 6460) = v565;
Ritor1
parents:
diff changeset
7202 v567 = (*v566)->GetMaxMana();
Ritor1
parents:
diff changeset
7203 v568 = a2;
Ritor1
parents:
diff changeset
7204 *(int *)(_this->uItemID + 6464) = v567;
Ritor1
parents:
diff changeset
7205 v569 = v3->spellnum;
Ritor1
parents:
diff changeset
7206 v570 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7207 pGame->GetStru6()->SetPlayerBuffAnim(v569, v568);
Ritor1
parents:
diff changeset
7208 ++a2;
Ritor1
parents:
diff changeset
7209 _this = (ItemGen *)((char *)_this + 4);
Ritor1
parents:
diff changeset
7210 }
Ritor1
parents:
diff changeset
7211 while ( (signed int)this < (signed int)&qword_A750D8 );
Ritor1
parents:
diff changeset
7212 v571 = pPlayer;
Ritor1
parents:
diff changeset
7213 v572 = (char *)&pPlayer->sAgeModifier;
Ritor1
parents:
diff changeset
7214 if ( pPlayer->sAgeModifier + 10 >= 120 )
Ritor1
parents:
diff changeset
7215 *(short *)v572 = 120;
Ritor1
parents:
diff changeset
7216 else
Ritor1
parents:
diff changeset
7217 *(short *)v572 = pPlayer->sAgeModifier + 10;
Ritor1
parents:
diff changeset
7218 sRecoveryTime += -5 * v2;
Ritor1
parents:
diff changeset
7219 ++v571->uNumDivineInterventionCastsThisDay;
Ritor1
parents:
diff changeset
7220 goto LABEL_1056;
Ritor1
parents:
diff changeset
7221 case 89:
Ritor1
parents:
diff changeset
7222 v573 = v12 - 2;
Ritor1
parents:
diff changeset
7223 if ( v573 )
Ritor1
parents:
diff changeset
7224 {
Ritor1
parents:
diff changeset
7225 v574 = v573 - 1;
Ritor1
parents:
diff changeset
7226 if ( v574 )
Ritor1
parents:
diff changeset
7227 {
Ritor1
parents:
diff changeset
7228 if ( v574 == 1 )
Ritor1
parents:
diff changeset
7229 v575 = 5 * v2;
Ritor1
parents:
diff changeset
7230 else
Ritor1
parents:
diff changeset
7231 v575 = 2 * v2;
Ritor1
parents:
diff changeset
7232 }
Ritor1
parents:
diff changeset
7233 else
Ritor1
parents:
diff changeset
7234 {
Ritor1
parents:
diff changeset
7235 v575 = 4 * v2;
Ritor1
parents:
diff changeset
7236 }
Ritor1
parents:
diff changeset
7237 }
Ritor1
parents:
diff changeset
7238 else
Ritor1
parents:
diff changeset
7239 {
Ritor1
parents:
diff changeset
7240 v575 = 3 * v2;
Ritor1
parents:
diff changeset
7241 }
Ritor1
parents:
diff changeset
7242 amount = v575;
Ritor1
parents:
diff changeset
7243 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7244 goto LABEL_83;
Ritor1
parents:
diff changeset
7245 v576 = *(int *)&v3->field_C;
Ritor1
parents:
diff changeset
7246 if ( v576 == v1 )
Ritor1
parents:
diff changeset
7247 {
Ritor1
parents:
diff changeset
7248 v583 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
7249 v584 = v3->spellnum;
Ritor1
parents:
diff changeset
7250 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2];
Ritor1
parents:
diff changeset
7251 v586 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7252 pGame->GetStru6()->SetPlayerBuffAnim(v584, v583);
Ritor1
parents:
diff changeset
7253 if ( *((_QWORD *)v585 + 14) )
Ritor1
parents:
diff changeset
7254 {
Ritor1
parents:
diff changeset
7255 ((Player *)v585)->SetCondition(0x11u, 1);
Ritor1
parents:
diff changeset
7256 v587 = ((Player *)v585)->GetSexByVoice();
Ritor1
parents:
diff changeset
7257 ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23);
Ritor1
parents:
diff changeset
7258 *((_QWORD *)v585 + 17) = pParty->uTimePlayed;
Ritor1
parents:
diff changeset
7259 }
Ritor1
parents:
diff changeset
7260 goto LABEL_83;
Ritor1
parents:
diff changeset
7261 }
Ritor1
parents:
diff changeset
7262 v577 = (Player *)(v576 >> 3);
Ritor1
parents:
diff changeset
7263 v726 = v577;
Ritor1
parents:
diff changeset
7264 if ( v577 == (Player *)-1 )
Ritor1
parents:
diff changeset
7265 {
Ritor1
parents:
diff changeset
7266 v66 = pGlobalTXT_LocalizationStrings[496];
Ritor1
parents:
diff changeset
7267 goto LABEL_201;
Ritor1
parents:
diff changeset
7268 }
Ritor1
parents:
diff changeset
7269 v578 = (int)&pActors[(int)v577];
Ritor1
parents:
diff changeset
7270 v721 = v578;
Ritor1
parents:
diff changeset
7271 if ( *(short *)(v578 + 40) > (signed __int16)v1 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 )
Ritor1
parents:
diff changeset
7272 goto LABEL_200;
Ritor1
parents:
diff changeset
7273 ++a1.uItemType;
Ritor1
parents:
diff changeset
7274 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
7275 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
7276 a1.field_4C = v2;
Ritor1
parents:
diff changeset
7277 a1.field_50 = v731;
Ritor1
parents:
diff changeset
7278 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
7279 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
7280 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
7281 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
7282 v580 = v3->uPlayerID;
Ritor1
parents:
diff changeset
7283 a1.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
7284 v581 = v721;
Ritor1
parents:
diff changeset
7285 v580 *= 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7286 LOBYTE(v580) = v580 | OBJECT_Player;
0
Ritor1
parents:
diff changeset
7287 a1.uFacing = v1;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7288 a1.field_58_pid = v580;
0
Ritor1
parents:
diff changeset
7289 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
7290 a1.vPosition.x = *(short *)(v721 + 142);
Ritor1
parents:
diff changeset
7291 a1.vPosition.y = *(short *)(v721 + 144);
Ritor1
parents:
diff changeset
7292 v732 = *(short *)(v721 + 138);
Ritor1
parents:
diff changeset
7293 v582 = 8 * (int)v726;
Ritor1
parents:
diff changeset
7294 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548);
Ritor1
parents:
diff changeset
7295 LOBYTE(v582) = 8 * (char)v726 | 3;
Ritor1
parents:
diff changeset
7296 a1.field_5C = v582;
Ritor1
parents:
diff changeset
7297 a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
7298 if ( *(char *)(v581 + 52) > amount )
Ritor1
parents:
diff changeset
7299 goto LABEL_83;
Ritor1
parents:
diff changeset
7300 Actor::Resurrect((unsigned int)v726);
Ritor1
parents:
diff changeset
7301 *(char *)(v581 + 61) = 0;
Ritor1
parents:
diff changeset
7302 *(char *)(v581 + 53) = 0;
Ritor1
parents:
diff changeset
7303 *(char *)(v581 + 54) = 0;
Ritor1
parents:
diff changeset
7304 *(char *)(v581 + 55) = 0;
Ritor1
parents:
diff changeset
7305 *(char *)(v581 + 56) = 0;
Ritor1
parents:
diff changeset
7306 *(char *)(v581 + 57) = 0;
Ritor1
parents:
diff changeset
7307 *(int *)(v581 + 712) = 9999;
Ritor1
parents:
diff changeset
7308 *(char *)(v581 + 38) &= 0xF7u;
Ritor1
parents:
diff changeset
7309 *(int *)(v581 + 708) = v1;
Ritor1
parents:
diff changeset
7310 ((SpellBuff *)(v581 + 356))->Reset();
Ritor1
parents:
diff changeset
7311 ((SpellBuff *)(v581 + 228))->Reset();
Ritor1
parents:
diff changeset
7312 ((SpellBuff *)(v581 + 404))->Reset();
Ritor1
parents:
diff changeset
7313 if ( *(short *)(v581 + 40) > 10 * amount )
Ritor1
parents:
diff changeset
7314 *(short *)(v581 + 40) = 10 * amount;
Ritor1
parents:
diff changeset
7315 goto LABEL_1056;
Ritor1
parents:
diff changeset
7316 case 91:
Ritor1
parents:
diff changeset
7317 v588 = v12 - 1;
Ritor1
parents:
diff changeset
7318 amount = 16;
Ritor1
parents:
diff changeset
7319 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 )
Ritor1
parents:
diff changeset
7320 {
Ritor1
parents:
diff changeset
7321 if ( v590 == 1 )
Ritor1
parents:
diff changeset
7322 LODWORD(v733) = v1;
Ritor1
parents:
diff changeset
7323 }
Ritor1
parents:
diff changeset
7324 else
Ritor1
parents:
diff changeset
7325 {
Ritor1
parents:
diff changeset
7326 LODWORD(v733) = 3600 * v2;
Ritor1
parents:
diff changeset
7327 }
Ritor1
parents:
diff changeset
7328 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7329 goto LABEL_83;
Ritor1
parents:
diff changeset
7330 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040;
Ritor1
parents:
diff changeset
7331 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName;
Ritor1
parents:
diff changeset
7332 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed);
Ritor1
parents:
diff changeset
7333 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65
Ritor1
parents:
diff changeset
7334 || *(char *)(HIDWORD(v733) + 20) & 2
Ritor1
parents:
diff changeset
7335 || *(int *)(HIDWORD(v733) + 12) != v1
Ritor1
parents:
diff changeset
7336 || *(int *)(HIDWORD(v733) + 4) != v1
Ritor1
parents:
diff changeset
7337 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2
Ritor1
parents:
diff changeset
7338 || pItemsTable->_456D5E_is_some_material((ItemGen *)HIDWORD(v733)) )
Ritor1
parents:
diff changeset
7339 goto LABEL_199;
Ritor1
parents:
diff changeset
7340 v592 = HIDWORD(v733);
Ritor1
parents:
diff changeset
7341 v14 = v731 == 4;
Ritor1
parents:
diff changeset
7342 *(int *)(HIDWORD(v733) + 12) = 16;
Ritor1
parents:
diff changeset
7343 if ( !v14 )
Ritor1
parents:
diff changeset
7344 {
Ritor1
parents:
diff changeset
7345 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
7346 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed
Ritor1
parents:
diff changeset
7347 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
7348 *(int *)(v592 + 20) |= 8u;
Ritor1
parents:
diff changeset
7349 }
Ritor1
parents:
diff changeset
7350 *(char *)(v592 + 20) |= 0x80u;
Ritor1
parents:
diff changeset
7351 goto LABEL_1055;
Ritor1
parents:
diff changeset
7352 case 93:
Ritor1
parents:
diff changeset
7353 v593 = v12 - 2;
Ritor1
parents:
diff changeset
7354 if ( !v593 )
Ritor1
parents:
diff changeset
7355 goto LABEL_1062;
Ritor1
parents:
diff changeset
7356 v594 = v593 - 1;
Ritor1
parents:
diff changeset
7357 if ( v594 )
Ritor1
parents:
diff changeset
7358 {
Ritor1
parents:
diff changeset
7359 if ( v594 == 1 )
Ritor1
parents:
diff changeset
7360 amount = 9;
Ritor1
parents:
diff changeset
7361 else
Ritor1
parents:
diff changeset
7362 LABEL_1062:
Ritor1
parents:
diff changeset
7363 amount = 5;
Ritor1
parents:
diff changeset
7364 }
Ritor1
parents:
diff changeset
7365 else
Ritor1
parents:
diff changeset
7366 {
Ritor1
parents:
diff changeset
7367 amount = 7;
Ritor1
parents:
diff changeset
7368 }
Ritor1
parents:
diff changeset
7369 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7370 goto LABEL_83;
Ritor1
parents:
diff changeset
7371 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
Ritor1
parents:
diff changeset
7372 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1);
Ritor1
parents:
diff changeset
7373 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
7374 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
7375 a1.field_4C = v2;
Ritor1
parents:
diff changeset
7376 a1.field_50 = v731;
Ritor1
parents:
diff changeset
7377 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
7378 a1.vPosition.x = pParty->vPosition.x;
Ritor1
parents:
diff changeset
7379 a1.vPosition.y = pParty->vPosition.y;
Ritor1
parents:
diff changeset
7380 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
7381 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
Ritor1
parents:
diff changeset
7382 a1.uSectorID = pIndoor->GetSector(
Ritor1
parents:
diff changeset
7383 pParty->vPosition.x,
Ritor1
parents:
diff changeset
7384 pParty->vPosition.y,
Ritor1
parents:
diff changeset
7385 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2);
Ritor1
parents:
diff changeset
7386 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
7387 v595 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7388 LOBYTE(v595) = v595 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7389 a1.field_58_pid = v595;
0
Ritor1
parents:
diff changeset
7390 a1.field_5C = a2;
Ritor1
parents:
diff changeset
7391 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
7392 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
7393 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
7394 LOBYTE(a1.uAttributes) |= 4u;
Ritor1
parents:
diff changeset
7395 v596 = (signed int)v726 / -2;
Ritor1
parents:
diff changeset
7396 y = (char *)((signed int)v726 / 2);
Ritor1
parents:
diff changeset
7397 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 )
Ritor1
parents:
diff changeset
7398 {
Ritor1
parents:
diff changeset
7399 v597 = v715.uYawAngle;
Ritor1
parents:
diff changeset
7400 do
Ritor1
parents:
diff changeset
7401 {
Ritor1
parents:
diff changeset
7402 a1.uFacing = v596 + v597;
Ritor1
parents:
diff changeset
7403 if ( a1.Create(
Ritor1
parents:
diff changeset
7404 v596 + v597,
Ritor1
parents:
diff changeset
7405 v715.uPitchAngle,
Ritor1
parents:
diff changeset
7406 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
Ritor1
parents:
diff changeset
7407 v3->uPlayerID + 1) != -1
Ritor1
parents:
diff changeset
7408 && pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
7409 ++pTurnEngine->field_1C;
Ritor1
parents:
diff changeset
7410 v596 += v732;
Ritor1
parents:
diff changeset
7411 }
Ritor1
parents:
diff changeset
7412 while ( v596 <= (signed int)y );
Ritor1
parents:
diff changeset
7413 }
Ritor1
parents:
diff changeset
7414 goto LABEL_1056;
Ritor1
parents:
diff changeset
7415 case 94:
Ritor1
parents:
diff changeset
7416 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7417 goto LABEL_83;
Ritor1
parents:
diff changeset
7418 if ( v731 == 1 || v731 == 2 )
Ritor1
parents:
diff changeset
7419 {
Ritor1
parents:
diff changeset
7420 v598 = 180 * v2;
Ritor1
parents:
diff changeset
7421 goto LABEL_1081;
Ritor1
parents:
diff changeset
7422 }
Ritor1
parents:
diff changeset
7423 if ( v731 == 3 )
Ritor1
parents:
diff changeset
7424 {
Ritor1
parents:
diff changeset
7425 v598 = 300 * v2;
Ritor1
parents:
diff changeset
7426 LABEL_1081:
Ritor1
parents:
diff changeset
7427 LODWORD(v733) = v598;
Ritor1
parents:
diff changeset
7428 goto LABEL_1082;
Ritor1
parents:
diff changeset
7429 }
Ritor1
parents:
diff changeset
7430 if ( v731 == 4 )
Ritor1
parents:
diff changeset
7431 LODWORD(v733) = 29030400;
Ritor1
parents:
diff changeset
7432 LABEL_1082:
Ritor1
parents:
diff changeset
7433 v599 = a2 >> 3;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
7434 if ( (a2 & 7) != OBJECT_Actor)
0
Ritor1
parents:
diff changeset
7435 goto LABEL_1056;
Ritor1
parents:
diff changeset
7436 v730 = 836 * v599;
Ritor1
parents:
diff changeset
7437 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
Ritor1
parents:
diff changeset
7438 goto LABEL_83;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
7439 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) )
0
Ritor1
parents:
diff changeset
7440 goto LABEL_200;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
7441 pActors[v599].pActorBuffs[9].Reset();
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
7442 pActors[v599].pActorBuffs[1].Reset();
0
Ritor1
parents:
diff changeset
7443 v732 = (int)v733 << 7;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
7444 pActors[v599].pActorBuffs[12].Apply(
0
Ritor1
parents:
diff changeset
7445 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
Ritor1
parents:
diff changeset
7446 v731,
Ritor1
parents:
diff changeset
7447 v1,
Ritor1
parents:
diff changeset
7448 v1,
Ritor1
parents:
diff changeset
7449 v1);
Ritor1
parents:
diff changeset
7450 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
7451 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
7452 a1.field_4C = v2;
Ritor1
parents:
diff changeset
7453 a1.field_50 = v731;
Ritor1
parents:
diff changeset
7454 v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
7455 v61 = v599;
0
Ritor1
parents:
diff changeset
7456 LABEL_1086:
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
7457 v600 = pActors[v61].vPosition.y;
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
7458 v601 = pActors[v61].vPosition.x;
0
Ritor1
parents:
diff changeset
7459 a1.uObjectDescID = v60;
Ritor1
parents:
diff changeset
7460 a1.vPosition.x = v601;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
7461 v602 = pActors[v61].uActorHeight;
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
7462 v603 = pActors[v61].vPosition.z;
0
Ritor1
parents:
diff changeset
7463 a1.vPosition.y = v600;
Ritor1
parents:
diff changeset
7464 v676 = v603 + v602;
Ritor1
parents:
diff changeset
7465 v665 = v600;
Ritor1
parents:
diff changeset
7466 a1.vPosition.z = v603 + v602;
Ritor1
parents:
diff changeset
7467 v657 = v601;
Ritor1
parents:
diff changeset
7468 LABEL_1087:
Ritor1
parents:
diff changeset
7469 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
7470 a1.uSectorID = pIndoor->GetSector(v657, v665, v676);
Ritor1
parents:
diff changeset
7471 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
7472 v604 = 8 * v3->uPlayerID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7473 LOBYTE(v604) = v604 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7474 a1.field_58_pid = v604;
0
Ritor1
parents:
diff changeset
7475 a1.field_5C = a2;
Ritor1
parents:
diff changeset
7476 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
Ritor1
parents:
diff changeset
7477 a1.uFacing = LOWORD(v715.uYawAngle);
Ritor1
parents:
diff changeset
7478 LOWORD(v604) = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
7479 LOBYTE(a1.uAttributes) |= 0x80u;
Ritor1
parents:
diff changeset
7480 a1.uSoundID = v604;
Ritor1
parents:
diff changeset
7481 a1.Create(0, v1, v1, v3->uPlayerID + 1);
Ritor1
parents:
diff changeset
7482 goto LABEL_1056;
Ritor1
parents:
diff changeset
7483 case 96:
Ritor1
parents:
diff changeset
7484 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7485 goto LABEL_83;
Ritor1
parents:
diff changeset
7486 HIDWORD(v733) = v1;
Ritor1
parents:
diff changeset
7487 memset(&pStru179, v1, 0xFA0u);
Ritor1
parents:
diff changeset
7488 _this = (ItemGen *)v1;
Ritor1
parents:
diff changeset
7489 v605 = (char *)pParty->pHirelings;
Ritor1
parents:
diff changeset
7490 do
Ritor1
parents:
diff changeset
7491 {
Ritor1
parents:
diff changeset
7492 if ( *(int *)v605 != v1 )
Ritor1
parents:
diff changeset
7493 {
Ritor1
parents:
diff changeset
7494 v606 = HIDWORD(v733)++;
81
377535d6e366 structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents: 79
diff changeset
7495 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1);
0
Ritor1
parents:
diff changeset
7496 }
Ritor1
parents:
diff changeset
7497 _this = (ItemGen *)((char *)_this + 1);
Ritor1
parents:
diff changeset
7498 v605 += 76;
Ritor1
parents:
diff changeset
7499 }
Ritor1
parents:
diff changeset
7500 while ( (signed int)v605 < (signed int)&pParty->pPickedItem );
Ritor1
parents:
diff changeset
7501 _this = (ItemGen *)v1;
Ritor1
parents:
diff changeset
7502 if ( (signed int)pNPCStats->uNumNewNPCs > v1 )
Ritor1
parents:
diff changeset
7503 {
Ritor1
parents:
diff changeset
7504 v730 = (int)pNPCStats->pNewNPCData;
Ritor1
parents:
diff changeset
7505 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152;
Ritor1
parents:
diff changeset
7506 do
Ritor1
parents:
diff changeset
7507 {
Ritor1
parents:
diff changeset
7508 if ( *(char *)(v730 + 8) & 0x80
Ritor1
parents:
diff changeset
7509 && (pParty->pHirelings[0].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[0].pName))
Ritor1
parents:
diff changeset
7510 && (pParty->pHirelings[1].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) )
Ritor1
parents:
diff changeset
7511 {
Ritor1
parents:
diff changeset
7512 v607 = HIDWORD(v733);
Ritor1
parents:
diff changeset
7513 HIDWORD(v733) += 4;
Ritor1
parents:
diff changeset
7514 *(int *)v607 = (int)_this + 3;
Ritor1
parents:
diff changeset
7515 }
Ritor1
parents:
diff changeset
7516 _this = (ItemGen *)((char *)_this + 1);
Ritor1
parents:
diff changeset
7517 v730 += 76;
Ritor1
parents:
diff changeset
7518 }
Ritor1
parents:
diff changeset
7519 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs );
Ritor1
parents:
diff changeset
7520 }
Ritor1
parents:
diff changeset
7521 v608 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
7522 if ( v608 != 4 && v608 != 5
Ritor1
parents:
diff changeset
7523 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= v1)
Ritor1
parents:
diff changeset
7524 || v609 >= 3 )
Ritor1
parents:
diff changeset
7525 goto LABEL_200;
Ritor1
parents:
diff changeset
7526 v610 = 76 * v609;
Ritor1
parents:
diff changeset
7527 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = v1;
Ritor1
parents:
diff changeset
7528 v611 = pIconsFrameTable->FindIcon("spell96");
Ritor1
parents:
diff changeset
7529 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(
Ritor1
parents:
diff changeset
7530 v611);
Ritor1
parents:
diff changeset
7531 v232 = 1;
Ritor1
parents:
diff changeset
7532 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7533 v612 = pParty->pPlayers;
0
Ritor1
parents:
diff changeset
7534 do
Ritor1
parents:
diff changeset
7535 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7536 v612->sHealth = v612->GetMaxHealth();
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7537 v612->sMana = v612->GetMaxMana();
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7538 ++v612;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7539 }
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7540 while ( v612 <= &pParty->pPlayers[3] );
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7541 v613 = &pOutdoor->ddm;
0
Ritor1
parents:
diff changeset
7542 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7543 v613 = &pIndoor->dlv;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7544 v613->uReputation += 15;
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7545 if ( v613->uReputation > 10000 )
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
7546 v613->uReputation = 10000;
0
Ritor1
parents:
diff changeset
7547 LODWORD(v727) = v232;
Ritor1
parents:
diff changeset
7548 goto LABEL_83;
Ritor1
parents:
diff changeset
7549 case 95:
Ritor1
parents:
diff changeset
7550 if ( v12 <= v1 )
Ritor1
parents:
diff changeset
7551 goto LABEL_1119;
Ritor1
parents:
diff changeset
7552 if ( v12 <= 3 )
Ritor1
parents:
diff changeset
7553 {
Ritor1
parents:
diff changeset
7554 v614 = 300 * (v2 + 12);
Ritor1
parents:
diff changeset
7555 }
Ritor1
parents:
diff changeset
7556 else
Ritor1
parents:
diff changeset
7557 {
Ritor1
parents:
diff changeset
7558 if ( v12 != 4 )
Ritor1
parents:
diff changeset
7559 goto LABEL_1119;
Ritor1
parents:
diff changeset
7560 v614 = 900 * (v2 + 4);
Ritor1
parents:
diff changeset
7561 }
Ritor1
parents:
diff changeset
7562 LODWORD(v733) = v614;
Ritor1
parents:
diff changeset
7563 LABEL_1119:
Ritor1
parents:
diff changeset
7564 v615 = v2 + 5;
Ritor1
parents:
diff changeset
7565 amount = v615;
Ritor1
parents:
diff changeset
7566 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7567 goto LABEL_83;
Ritor1
parents:
diff changeset
7568 if ( v731 != 3 && v731 != 4 )
Ritor1
parents:
diff changeset
7569 {
Ritor1
parents:
diff changeset
7570 v616 = v3->uPlayerID_2;
Ritor1
parents:
diff changeset
7571 v617 = v3->spellnum;
Ritor1
parents:
diff changeset
7572 v618 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7573 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616);
Ritor1
parents:
diff changeset
7574 v668 = v1;
Ritor1
parents:
diff changeset
7575 v658 = v716;
Ritor1
parents:
diff changeset
7576 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
7577 v653 = v615;
Ritor1
parents:
diff changeset
7578 v651 = v731;
Ritor1
parents:
diff changeset
7579 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
7580 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10];
Ritor1
parents:
diff changeset
7581 goto LABEL_103;
Ritor1
parents:
diff changeset
7582 }
Ritor1
parents:
diff changeset
7583 a2 = v1;
Ritor1
parents:
diff changeset
7584 v732 = (int)v733 << 7;
Ritor1
parents:
diff changeset
7585 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
7586 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10];
0
Ritor1
parents:
diff changeset
7587 do
Ritor1
parents:
diff changeset
7588 {
Ritor1
parents:
diff changeset
7589 v620 = a2;
Ritor1
parents:
diff changeset
7590 v621 = v3->spellnum;
Ritor1
parents:
diff changeset
7591 v622 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7592 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620);
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
7593 v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1);
0
Ritor1
parents:
diff changeset
7594 ++a2;
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
7595 ++v619;
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
7596 }
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
7597 while ( v619 <= &pParty->pPlayers[3] );
0
Ritor1
parents:
diff changeset
7598 goto LABEL_1056;
Ritor1
parents:
diff changeset
7599 case 99:
Ritor1
parents:
diff changeset
7600 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7601 goto LABEL_83;
Ritor1
parents:
diff changeset
7602 v726 = (Player *)v1;
Ritor1
parents:
diff changeset
7603 pGame->GetIndoorCamera();
Ritor1
parents:
diff changeset
7604 v623 = (signed __int64)GetPickDepth();
Ritor1
parents:
diff changeset
7605 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623);
Ritor1
parents:
diff changeset
7606 v709 = v1;
Ritor1
parents:
diff changeset
7607 v708 = v1;
Ritor1
parents:
diff changeset
7608 v707 = v1;
Ritor1
parents:
diff changeset
7609 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
7610 a1.field_48 = v3->spellnum;
Ritor1
parents:
diff changeset
7611 a1.field_4C = v2;
Ritor1
parents:
diff changeset
7612 a1.field_50 = v731;
Ritor1
parents:
diff changeset
7613 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
Ritor1
parents:
diff changeset
7614 a1.uAttributes = v1;
Ritor1
parents:
diff changeset
7615 a1.uSectorID = v1;
Ritor1
parents:
diff changeset
7616 a1.uSpriteFrameID = v1;
Ritor1
parents:
diff changeset
7617 v624 = v3->uPlayerID;
Ritor1
parents:
diff changeset
7618 a1.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
7619 a1.uFacing = v1;
Ritor1
parents:
diff changeset
7620 v624 *= 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7621 LOBYTE(v624) = v624 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7622 a1.field_58_pid = v624;
0
Ritor1
parents:
diff changeset
7623 a1.uSoundID = LOWORD(v3->field_10);
Ritor1
parents:
diff changeset
7624 a2 = v1;
Ritor1
parents:
diff changeset
7625 if ( SHIDWORD(v733) > v1 )
Ritor1
parents:
diff changeset
7626 {
Ritor1
parents:
diff changeset
7627 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25));
Ritor1
parents:
diff changeset
7628 do
Ritor1
parents:
diff changeset
7629 {
Ritor1
parents:
diff changeset
7630 v625 = dword_50BF30[a2];
Ritor1
parents:
diff changeset
7631 a1.vPosition.x = pActors[v625].vPosition.x;
Ritor1
parents:
diff changeset
7632 a1.vPosition.y = pActors[v625].vPosition.y;
Ritor1
parents:
diff changeset
7633 v732 = pActors[v625].uActorHeight;
Ritor1
parents:
diff changeset
7634 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548);
Ritor1
parents:
diff changeset
7635 v626 = 8 * dword_50BF30[a2];
Ritor1
parents:
diff changeset
7636 LOBYTE(v626) = v626 | 3;
Ritor1
parents:
diff changeset
7637 a1.field_5C = v626;
Ritor1
parents:
diff changeset
7638 v627 = a1.Create(0, v1, v1, v1);
Ritor1
parents:
diff changeset
7639 v628 = a2;
Ritor1
parents:
diff changeset
7640 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707);
Ritor1
parents:
diff changeset
7641 a2 = v628 + 1;
Ritor1
parents:
diff changeset
7642 }
Ritor1
parents:
diff changeset
7643 while ( v628 + 1 < SHIDWORD(v733) );
Ritor1
parents:
diff changeset
7644 }
Ritor1
parents:
diff changeset
7645 v730 = v1;
Ritor1
parents:
diff changeset
7646 v629 = 1;
Ritor1
parents:
diff changeset
7647 do
Ritor1
parents:
diff changeset
7648 {
Ritor1
parents:
diff changeset
7649 v630 = pPlayers[v629];
Ritor1
parents:
diff changeset
7650 if ( !v630->pConditions[2]
Ritor1
parents:
diff changeset
7651 && !v630->pConditions[12]
Ritor1
parents:
diff changeset
7652 && !v630->pConditions[13]
Ritor1
parents:
diff changeset
7653 && !v630->pConditions[14]
Ritor1
parents:
diff changeset
7654 && !v630->pConditions[15]
Ritor1
parents:
diff changeset
7655 && !v630->pConditions[16] )
Ritor1
parents:
diff changeset
7656 {
Ritor1
parents:
diff changeset
7657 v631 = v730++;
Ritor1
parents:
diff changeset
7658 v681[v631] = v629;
Ritor1
parents:
diff changeset
7659 }
Ritor1
parents:
diff changeset
7660 ++v629;
Ritor1
parents:
diff changeset
7661 }
Ritor1
parents:
diff changeset
7662 while ( v629 <= 4 );
Ritor1
parents:
diff changeset
7663 v732 = (signed __int64)((double)(signed int)v726 / (double)v730);
Ritor1
parents:
diff changeset
7664 HIDWORD(v733) = v1;
Ritor1
parents:
diff changeset
7665 if ( v730 > v1 )
Ritor1
parents:
diff changeset
7666 {
Ritor1
parents:
diff changeset
7667 do
Ritor1
parents:
diff changeset
7668 {
Ritor1
parents:
diff changeset
7669 v632 = 4 * v681[HIDWORD(v733)] + 10965188;
Ritor1
parents:
diff changeset
7670 v633 = pPlayers[v681[HIDWORD(v733)]];
Ritor1
parents:
diff changeset
7671 v633->sHealth += v732;
Ritor1
parents:
diff changeset
7672 v726 = *(Player **)v632;
Ritor1
parents:
diff changeset
7673 v634 = v726->GetMaxHealth();
Ritor1
parents:
diff changeset
7674 if ( v726->sHealth > v634 )
Ritor1
parents:
diff changeset
7675 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth();
Ritor1
parents:
diff changeset
7676 v635 = HIDWORD(v733);
Ritor1
parents:
diff changeset
7677 v636 = WORD2(v733);
Ritor1
parents:
diff changeset
7678 v637 = v3->spellnum;
Ritor1
parents:
diff changeset
7679 v638 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7680 pGame->GetStru6()->SetPlayerBuffAnim(v637, v636);
Ritor1
parents:
diff changeset
7681 HIDWORD(v733) = v635 + 1;
Ritor1
parents:
diff changeset
7682 }
Ritor1
parents:
diff changeset
7683 while ( v635 + 1 < v730 );
Ritor1
parents:
diff changeset
7684 }
Ritor1
parents:
diff changeset
7685 v639 = pGame->GetStru6();
Ritor1
parents:
diff changeset
7686 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(v1, 0x40u);
Ritor1
parents:
diff changeset
7687 goto LABEL_1056;
Ritor1
parents:
diff changeset
7688 case 98:
Ritor1
parents:
diff changeset
7689 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
7690 {
Ritor1
parents:
diff changeset
7691 v66 = pGlobalTXT_LocalizationStrings[499];
Ritor1
parents:
diff changeset
7692 goto LABEL_201;
Ritor1
parents:
diff changeset
7693 }
Ritor1
parents:
diff changeset
7694 v640 = v12 - 2;
Ritor1
parents:
diff changeset
7695 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) )
Ritor1
parents:
diff changeset
7696 amount = 3;
349
672b83584b0f GetActorTintColor
Nomad
parents: 323
diff changeset
7697 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > v1 )
0
Ritor1
parents:
diff changeset
7698 goto LABEL_200;
Ritor1
parents:
diff changeset
7699 if ( !pPlayer->CanCastSpell(uRequiredMana) )
Ritor1
parents:
diff changeset
7700 goto LABEL_83;
349
672b83584b0f GetActorTintColor
Nomad
parents: 323
diff changeset
7701 pParty->armageddon_timer = 256;
0
Ritor1
parents:
diff changeset
7702 pParty->field_16140 = v2;
Ritor1
parents:
diff changeset
7703 ++pPlayer->uNumArmageddonCasts;
Ritor1
parents:
diff changeset
7704 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
7705 ++pTurnEngine->field_1C;
Ritor1
parents:
diff changeset
7706 v726 = (Player *)50;
Ritor1
parents:
diff changeset
7707 do
Ritor1
parents:
diff changeset
7708 {
Ritor1
parents:
diff changeset
7709 v642 = rand() % 4096 - 2048;
Ritor1
parents:
diff changeset
7710 v643 = rand();
Ritor1
parents:
diff changeset
7711 v721 = v642 + pParty->vPosition.x;
Ritor1
parents:
diff changeset
7712 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048);
Ritor1
parents:
diff changeset
7713 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1);
Ritor1
parents:
diff changeset
7714 v644 = rand();
Ritor1
parents:
diff changeset
7715 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1);
Ritor1
parents:
diff changeset
7716 v726 = (Player *)((char *)v726 - 1);
Ritor1
parents:
diff changeset
7717 }
Ritor1
parents:
diff changeset
7718 while ( *(float *)&v726 != 0.0 );
Ritor1
parents:
diff changeset
7719 goto LABEL_1056;
Ritor1
parents:
diff changeset
7720 default:
Ritor1
parents:
diff changeset
7721 goto LABEL_83;
Ritor1
parents:
diff changeset
7722 }
Ritor1
parents:
diff changeset
7723 while ( 2 )
Ritor1
parents:
diff changeset
7724 {
Ritor1
parents:
diff changeset
7725 if ( v731 == 4 )
Ritor1
parents:
diff changeset
7726 {
Ritor1
parents:
diff changeset
7727 if ( *((_QWORD *)v222 + 2) )
Ritor1
parents:
diff changeset
7728 {
Ritor1
parents:
diff changeset
7729 *((int *)v222 + 4) = v1;
Ritor1
parents:
diff changeset
7730 *((int *)v222 + 5) = v1;
Ritor1
parents:
diff changeset
7731 goto LABEL_439;
Ritor1
parents:
diff changeset
7732 }
Ritor1
parents:
diff changeset
7733 }
Ritor1
parents:
diff changeset
7734 else
Ritor1
parents:
diff changeset
7735 {
Ritor1
parents:
diff changeset
7736 v732 = amount << 7;
Ritor1
parents:
diff changeset
7737 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan(
Ritor1
parents:
diff changeset
7738 2u,
Ritor1
parents:
diff changeset
7739 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335));
Ritor1
parents:
diff changeset
7740 v222 = (char *)HIDWORD(v733);
Ritor1
parents:
diff changeset
7741 if ( v223 )
Ritor1
parents:
diff changeset
7742 LABEL_439:
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
7743 ((Player *)v222)->PlaySound(SPEECH_103, v1);
0
Ritor1
parents:
diff changeset
7744 }
Ritor1
parents:
diff changeset
7745 v222 += 6972;
Ritor1
parents:
diff changeset
7746 HIDWORD(v733) = (int)v222;
Ritor1
parents:
diff changeset
7747 if ( (signed int)v222 >= (signed int)pParty->pHirelings )
Ritor1
parents:
diff changeset
7748 goto LABEL_1056;
Ritor1
parents:
diff changeset
7749 continue;
Ritor1
parents:
diff changeset
7750 }
Ritor1
parents:
diff changeset
7751 }
Ritor1
parents:
diff changeset
7752 if ( pParty->bTurnBasedModeOn == v1 )
Ritor1
parents:
diff changeset
7753 {
Ritor1
parents:
diff changeset
7754 v646 = pPlayer;
Ritor1
parents:
diff changeset
7755 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333));
Ritor1
parents:
diff changeset
7756 v647 = n;
Ritor1
parents:
diff changeset
7757 }
Ritor1
parents:
diff changeset
7758 else
Ritor1
parents:
diff changeset
7759 {
Ritor1
parents:
diff changeset
7760 v647 = n;
Ritor1
parents:
diff changeset
7761 v646 = pPlayer;
Ritor1
parents:
diff changeset
7762 v648 = sRecoveryTime;
Ritor1
parents:
diff changeset
7763 v649 = pPlayer;
Ritor1
parents:
diff changeset
7764 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100;
Ritor1
parents:
diff changeset
7765 v649->SetRecoveryTime(v648);
Ritor1
parents:
diff changeset
7766 pTurnEngine->_40471C();
Ritor1
parents:
diff changeset
7767 }
Ritor1
parents:
diff changeset
7768 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u);
Ritor1
parents:
diff changeset
7769 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1);
Ritor1
parents:
diff changeset
7770 v711[v647].spellnum = v1;
Ritor1
parents:
diff changeset
7771 v646->sMana -= uRequiredMana;
Ritor1
parents:
diff changeset
7772 }
Ritor1
parents:
diff changeset
7773 //----- (0042EB42) --------------------------------------------------------
Ritor1
parents:
diff changeset
7774 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID)
Ritor1
parents:
diff changeset
7775 {
Ritor1
parents:
diff changeset
7776 unsigned int v2; // edx@1
Ritor1
parents:
diff changeset
7777 signed int v3; // eax@1
Ritor1
parents:
diff changeset
7778 char *v4; // ecx@2
Ritor1
parents:
diff changeset
7779
Ritor1
parents:
diff changeset
7780 v2 = this->uNumObjects;
Ritor1
parents:
diff changeset
7781 v3 = 0;
Ritor1
parents:
diff changeset
7782 if ( (signed int)this->uNumObjects <= 0 )
Ritor1
parents:
diff changeset
7783 {
Ritor1
parents:
diff changeset
7784 LABEL_5:
Ritor1
parents:
diff changeset
7785 LOWORD(v3) = 0;
Ritor1
parents:
diff changeset
7786 }
Ritor1
parents:
diff changeset
7787 else
Ritor1
parents:
diff changeset
7788 {
Ritor1
parents:
diff changeset
7789 v4 = (char *)&this->pObjects->uObjectID;
Ritor1
parents:
diff changeset
7790 while ( uItemID != *(short *)v4 )
Ritor1
parents:
diff changeset
7791 {
Ritor1
parents:
diff changeset
7792 ++v3;
Ritor1
parents:
diff changeset
7793 v4 += 56;
Ritor1
parents:
diff changeset
7794 if ( v3 >= (signed int)v2 )
Ritor1
parents:
diff changeset
7795 goto LABEL_5;
Ritor1
parents:
diff changeset
7796 }
Ritor1
parents:
diff changeset
7797 }
Ritor1
parents:
diff changeset
7798 return v3;
Ritor1
parents:
diff changeset
7799 }
Ritor1
parents:
diff changeset
7800
Ritor1
parents:
diff changeset
7801
Ritor1
parents:
diff changeset
7802
Ritor1
parents:
diff changeset
7803 //----- (0042EB78) --------------------------------------------------------
Ritor1
parents:
diff changeset
7804 int IconFrameTable::GetIconAnimLength(unsigned int uIconID)
Ritor1
parents:
diff changeset
7805 {
Ritor1
parents:
diff changeset
7806 return 8 * this->pIcons[uIconID].uAnimLength;
Ritor1
parents:
diff changeset
7807 }
Ritor1
parents:
diff changeset
7808
Ritor1
parents:
diff changeset
7809 //----- (0042EB8D) --------------------------------------------------------
Ritor1
parents:
diff changeset
7810 void GUIMessageQueue::SendMessage(UIMessageType msg, int param, unsigned int a4)
Ritor1
parents:
diff changeset
7811 {
Ritor1
parents:
diff changeset
7812 if (uNumMessages < 40)
Ritor1
parents:
diff changeset
7813 {
Ritor1
parents:
diff changeset
7814 pMessages[uNumMessages].eType = msg;
Ritor1
parents:
diff changeset
7815 pMessages[uNumMessages].param = param;
Ritor1
parents:
diff changeset
7816 pMessages[uNumMessages++].field_8 = a4;
Ritor1
parents:
diff changeset
7817 }
Ritor1
parents:
diff changeset
7818 }
Ritor1
parents:
diff changeset
7819
Ritor1
parents:
diff changeset
7820 //----- (0042EBBE) --------------------------------------------------------
Ritor1
parents:
diff changeset
7821 int __fastcall sub_42EBBE(int a1, int a2)
Ritor1
parents:
diff changeset
7822 {
Ritor1
parents:
diff changeset
7823 return (unsigned __int64)(a2 * (signed __int64)a1) >> 16;
Ritor1
parents:
diff changeset
7824 }
Ritor1
parents:
diff changeset
7825 // 42EBBE: using guessed type int __fastcall sub_42EBBE(int, int);
Ritor1
parents:
diff changeset
7826
Ritor1
parents:
diff changeset
7827 //----- (0042EBDB) --------------------------------------------------------
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
7828 int stru193_math::Sin(int angle)
0
Ritor1
parents:
diff changeset
7829 {
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
7830 return Cos(angle - this->uIntegerHalfPi);
0
Ritor1
parents:
diff changeset
7831 }
Ritor1
parents:
diff changeset
7832
Ritor1
parents:
diff changeset
7833 //----- (0042ECB5) --------------------------------------------------------
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7834 void _42ECB5_PlayerAttacksActor()
0
Ritor1
parents:
diff changeset
7835 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7836 //unsigned int v0; // ebx@1
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7837 //Player *v1; // esi@1
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7838 //bool result; // eax@1
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7839 //int v3; // edi@2
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7840 //unsigned int v4; // eax@7
0
Ritor1
parents:
diff changeset
7841 char *v5; // eax@8
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7842 //int v6; // ecx@9
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7843 //signed int v7; // eax@16
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7844 //Actor *v8; // edi@20
0
Ritor1
parents:
diff changeset
7845 unsigned int v9; // ecx@21
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7846 //char *v10; // eax@26
0
Ritor1
parents:
diff changeset
7847 char *v11; // eax@26
Ritor1
parents:
diff changeset
7848 unsigned int v12; // eax@47
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7849 //char *v13; // eax@47
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7850 //char *v14; // eax@47
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7851 //unsigned int v15; // ebx@54
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7852 //int v16; // [sp-10h] [bp-4Ch]@24
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7853 //int v17; // [sp-10h] [bp-4Ch]@44
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7854 //unsigned int v18; // [sp-Ch] [bp-48h]@24
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7855 //unsigned int v19; // [sp-Ch] [bp-48h]@44
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7856 //__int16 v20; // [sp-8h] [bp-44h]@24
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7857 //__int16 v21; // [sp-8h] [bp-44h]@44
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7858 //int v22; // [sp-4h] [bp-40h]@24
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7859 //int v23; // [sp-4h] [bp-40h]@44
0
Ritor1
parents:
diff changeset
7860 SoundID v24; // [sp-4h] [bp-40h]@58
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7861 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7862 //unsigned int a2; // [sp+18h] [bp-24h]@20
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7863 //unsigned int v27; // [sp+1Ch] [bp-20h]@1
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7864 //int v28; // [sp+20h] [bp-1Ch]@9
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7865 //unsigned int *v28b;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7866 //int v29; // [sp+24h] [bp-18h]@16
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7867 //int v30; // [sp+28h] [bp-14h]@16
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7868 //int v31; // [sp+2Ch] [bp-10h]@4
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7869 //int v32; // [sp+30h] [bp-Ch]@7
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7870 //int v33; // [sp+34h] [bp-8h]@7
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7871 //int v34; // [sp+38h] [bp-4h]@17
0
Ritor1
parents:
diff changeset
7872
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7873 //v0 = uActiveCharacter;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7874 //v27 = 6972 * uActiveCharacter;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7875 //v1 = &pParty->pPlayers[uActiveCharacter-1];
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7876 //result = pParty->pPlayers[uActiveCharacter-1].CanAct();
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7877 auto player = &pParty->pPlayers[uActiveCharacter - 1];
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7878 if (!player->CanAct())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7879 return;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7880
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7881 pStru277->_427D48(uActiveCharacter);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7882 //v3 = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7883 if (pParty->Invisible())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7884 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7885
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7886 //v31 = player->pEquipment.uBow;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7887 int bow_idx = player->pEquipment.uBow;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7888 if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7889 bow_idx = 0;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7890
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7891 //v32 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7892 int wand_item_id = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7893 //v33 = 0;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7894 //v4 = v1->pEquipment.uMainHand;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7895 int laser_weapon_item_id = 0;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7896
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7897 int main_hand_idx = player->pEquipment.uMainHand;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7898 if (main_hand_idx)
0
Ritor1
parents:
diff changeset
7899 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7900 auto item = &player->pInventoryItems[main_hand_idx - 1];
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
7901 //v5 = (char *)v1 + 36 * v4;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7902 if (!item->Broken())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7903 {
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7904 //v28b = &v1->pInventoryItems[v4].uItemID;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7905 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7906 if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND)
0
Ritor1
parents:
diff changeset
7907 {
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7908 if (item->uNumCharges <= 0)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7909 player->pEquipment.uMainHand = 0; // wand discharged - unequip
0
Ritor1
parents:
diff changeset
7910 else
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7911 wand_item_id = item->uItemID;//*((int *)v5 + 124);
0
Ritor1
parents:
diff changeset
7912 }
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7913 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE)
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7914 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124);
0
Ritor1
parents:
diff changeset
7915 }
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7916 }
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7917
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7918 //v30 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7919 //v29 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7920 //v28 = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7921 //v7 = pMouse->uPointingObjectID;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7922
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7923 int target_pid = pMouse->uPointingObjectID;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7924 int target_type = target_pid & 7,
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7925 target_id = target_pid >> 3;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7926 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7927 {
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7928 target_pid = stru_50C198.FindClosestActor(5120, 0, 0);
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7929 target_type = target_pid & 7;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7930 target_id = target_pid >> 3;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7931 }
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7932
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7933 auto actor = &pActors[target_id];
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7934 int actor_distance = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7935 if (target_type == OBJECT_Actor)
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
7936 {
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7937 int distance_x = actor->vPosition.x - pParty->vPosition.x,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7938 distance_y = actor->vPosition.y - pParty->vPosition.y,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7939 distance_z = actor->vPosition.z - pParty->vPosition.z;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7940 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7941 if (actor_distance < 0)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7942 actor_distance = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7943 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7944
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7945 bool shooting_bow = false,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7946 shotting_laser = false,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7947 shooting_wand = false;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7948 if (laser_weapon_item_id)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7949 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7950 shotting_laser = true;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7951 _42777D_CastSpell_UseWand_ShootArrow(102, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8);
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7952 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7953 else if (wand_item_id)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7954 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7955 shooting_wand = true;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7956
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7957 int main_hand_idx = player->pEquipment.uMainHand;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7958 _42777D_CastSpell_UseWand_ShootArrow(*((int *)&pSpellDatas[66].field_8 + player->pInventoryItems[main_hand_idx - 1].uItemID), uActiveCharacter - 1, 8, 0, uActiveCharacter + 8);
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7959
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7960 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7961 player->pEquipment.uMainHand = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7962 }
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7963 else if (target_type == OBJECT_Actor && actor_distance <= 407.2)
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7964 {
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7965 Vec3_int_ a3;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7966 a3.x = actor->vPosition.x - pParty->vPosition.x;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7967 a3.y = actor->vPosition.y - pParty->vPosition.y;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7968 a3.z = actor->vPosition.z - pParty->vPosition.z;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7969 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z);
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7970
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7971 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3);
305
cc8e4dc397ec MonsterPopup_Draw crash fix
Nomad
parents: 303
diff changeset
7972 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0))
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7973 _42FA66_do_explosive_impact(
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7974 actor->vPosition.x,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7975 actor->vPosition.y,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7976 actor->vPosition.z + actor->uActorHeight / 2,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7977 0, 512, uActiveCharacter);
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7978 }
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7979 else if (bow_idx)
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7980 {
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7981 shooting_bow = true;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7982 _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7983 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7984 else
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7985 {
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7986 ; // actor out of range or no actor; no ranged weapon so melee attacking air
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7987 }
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7988
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7989 if (!pParty->bTurnBasedModeOn)
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7990 {
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7991 int recovery = player->GetAttackRecoveryTime(0);
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7992 if (recovery < 30 )
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7993 recovery = 30;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
7994 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333));
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7995 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7996
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7997
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7998 int v34 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
7999 if (shooting_wand)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8000 return;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8001 else if (shooting_bow)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8002 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8003 v34 = 5;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8004 player->PlaySound(SPEECH_50, 0);
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8005 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8006 if (shotting_laser)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8007 v34 = 7;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8008 else
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8009 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8010 int main_hand_idx = player->pEquipment.uMainHand;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8011 if (player->HasItemEquipped(EQUIP_TWO_HANDED))
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8012 v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8013 pTurnEngine->_40471C();
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8014 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8015
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8016 switch (v34)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8017 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8018 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8019 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8020 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8021 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8022 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8023 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8024 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8025 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8026 }
0
Ritor1
parents:
diff changeset
8027 }
Ritor1
parents:
diff changeset
8028
Ritor1
parents:
diff changeset
8029 //----- (0042F184) --------------------------------------------------------
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8030 int stru319::FindClosestActor(int pick_depth, int a3, int a4)
0
Ritor1
parents:
diff changeset
8031 {
Ritor1
parents:
diff changeset
8032 int v4; // edi@1
Ritor1
parents:
diff changeset
8033 stru319 *v5; // esi@1
Ritor1
parents:
diff changeset
8034 int v6; // eax@2
Ritor1
parents:
diff changeset
8035 int v7; // eax@4
Ritor1
parents:
diff changeset
8036 int result; // eax@5
Ritor1
parents:
diff changeset
8037 int *v9; // edx@8
Ritor1
parents:
diff changeset
8038 signed int v10; // ebx@10
Ritor1
parents:
diff changeset
8039 int v11; // edi@11
Ritor1
parents:
diff changeset
8040 Actor *v12; // esi@12
Ritor1
parents:
diff changeset
8041 unsigned __int16 v13; // ax@12
Ritor1
parents:
diff changeset
8042 int v14; // eax@22
Ritor1
parents:
diff changeset
8043 char v15; // zf@30
Ritor1
parents:
diff changeset
8044 int v16; // esi@32
Ritor1
parents:
diff changeset
8045 int v17; // ecx@34
Ritor1
parents:
diff changeset
8046 stru319 *v18; // eax@39
Ritor1
parents:
diff changeset
8047 int v19; // edx@39
Ritor1
parents:
diff changeset
8048 int v20; // ecx@41
Ritor1
parents:
diff changeset
8049 unsigned __int16 v21; // ax@42
Ritor1
parents:
diff changeset
8050 unsigned int v22; // [sp+8h] [bp-24h]@11
Ritor1
parents:
diff changeset
8051 unsigned int v23; // [sp+Ch] [bp-20h]@7
Ritor1
parents:
diff changeset
8052 stru319 *v24; // [sp+10h] [bp-1Ch]@1
Ritor1
parents:
diff changeset
8053 unsigned int v25; // [sp+14h] [bp-18h]@8
Ritor1
parents:
diff changeset
8054 int *v26; // [sp+18h] [bp-14h]@8
Ritor1
parents:
diff changeset
8055 int v27; // [sp+1Ch] [bp-10h]@10
Ritor1
parents:
diff changeset
8056 int *v28; // [sp+20h] [bp-Ch]@10
Ritor1
parents:
diff changeset
8057 unsigned int v29; // [sp+24h] [bp-8h]@7
Ritor1
parents:
diff changeset
8058 int v30; // [sp+28h] [bp-4h]@6
Ritor1
parents:
diff changeset
8059 int i; // [sp+38h] [bp+Ch]@33
Ritor1
parents:
diff changeset
8060 signed int v32; // [sp+3Ch] [bp+10h]@32
Ritor1
parents:
diff changeset
8061
Ritor1
parents:
diff changeset
8062 v4 = 0;
Ritor1
parents:
diff changeset
8063 v5 = this;
Ritor1
parents:
diff changeset
8064 v24 = this;
Ritor1
parents:
diff changeset
8065 if ( pRenderer->pRenderD3D )
Ritor1
parents:
diff changeset
8066 {
Ritor1
parents:
diff changeset
8067 v6 = a3 != 0;
Ritor1
parents:
diff changeset
8068 if ( a4 )
Ritor1
parents:
diff changeset
8069 LOBYTE(v6) = v6 | 8;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8070 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1);
0
Ritor1
parents:
diff changeset
8071 if ( v7 != -1 )
Ritor1
parents:
diff changeset
8072 return (unsigned __int16)v7;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8073 else return 0;
0
Ritor1
parents:
diff changeset
8074 }
Ritor1
parents:
diff changeset
8075 else
Ritor1
parents:
diff changeset
8076 {
Ritor1
parents:
diff changeset
8077 v30 = 0;
Ritor1
parents:
diff changeset
8078 if ( pRenderer->pActiveZBuffer )
Ritor1
parents:
diff changeset
8079 {
Ritor1
parents:
diff changeset
8080 v29 = viewparams->uScreenX;
Ritor1
parents:
diff changeset
8081 v23 = viewparams->uScreenZ;
Ritor1
parents:
diff changeset
8082 if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW )
Ritor1
parents:
diff changeset
8083 {
Ritor1
parents:
diff changeset
8084 v25 = viewparams->uScreenW - viewparams->uScreenY;
Ritor1
parents:
diff changeset
8085 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY];
Ritor1
parents:
diff changeset
8086 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreenX + 640 * viewparams->uScreenY];
Ritor1
parents:
diff changeset
8087 do
Ritor1
parents:
diff changeset
8088 {
Ritor1
parents:
diff changeset
8089 if ( (signed int)v29 < (signed int)v23 )
Ritor1
parents:
diff changeset
8090 {
Ritor1
parents:
diff changeset
8091 v28 = v9;
Ritor1
parents:
diff changeset
8092 v10 = v4;
Ritor1
parents:
diff changeset
8093 v27 = v23 - v29;
Ritor1
parents:
diff changeset
8094 do
Ritor1
parents:
diff changeset
8095 {
Ritor1
parents:
diff changeset
8096 v22 = *v28;
Ritor1
parents:
diff changeset
8097 v11 = *v28 & 0xFFFF;
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
8098 if ( (*(char *)v28 & 7) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
8099 {
Ritor1
parents:
diff changeset
8100 v12 = &pActors[(unsigned int)v11 >> 3];
Ritor1
parents:
diff changeset
8101 v13 = v12->uAIState;
Ritor1
parents:
diff changeset
8102 if ( v13 != 5 )
Ritor1
parents:
diff changeset
8103 {
Ritor1
parents:
diff changeset
8104 if ( v13 != 4
Ritor1
parents:
diff changeset
8105 && v13 != 11
Ritor1
parents:
diff changeset
8106 && v13 != 19
Ritor1
parents:
diff changeset
8107 && v13 != 17
Ritor1
parents:
diff changeset
8108 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) )
Ritor1
parents:
diff changeset
8109 {
Ritor1
parents:
diff changeset
8110 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD))
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
8111 && v22 <= pick_depth << 16 )
0
Ritor1
parents:
diff changeset
8112 {
Ritor1
parents:
diff changeset
8113 v14 = 0;
Ritor1
parents:
diff changeset
8114 if ( v10 > 0 )
Ritor1
parents:
diff changeset
8115 {
Ritor1
parents:
diff changeset
8116 do
Ritor1
parents:
diff changeset
8117 {
Ritor1
parents:
diff changeset
8118 if ( dword_50BDA0[v14] == v11 )
Ritor1
parents:
diff changeset
8119 break;
Ritor1
parents:
diff changeset
8120 ++v14;
Ritor1
parents:
diff changeset
8121 }
Ritor1
parents:
diff changeset
8122 while ( v14 < v30 );
Ritor1
parents:
diff changeset
8123 }
Ritor1
parents:
diff changeset
8124 if ( v14 == v30 && v10 < 100 )
Ritor1
parents:
diff changeset
8125 {
Ritor1
parents:
diff changeset
8126 ++v30;
Ritor1
parents:
diff changeset
8127 dword_50BC10[v10] = v22;
Ritor1
parents:
diff changeset
8128 dword_50BDA0[v10] = v11;
Ritor1
parents:
diff changeset
8129 ++v10;
Ritor1
parents:
diff changeset
8130 }
Ritor1
parents:
diff changeset
8131 }
Ritor1
parents:
diff changeset
8132 }
Ritor1
parents:
diff changeset
8133 }
Ritor1
parents:
diff changeset
8134 }
Ritor1
parents:
diff changeset
8135 ++v28;
Ritor1
parents:
diff changeset
8136 --v27;
Ritor1
parents:
diff changeset
8137 }
Ritor1
parents:
diff changeset
8138 while ( v27 );
Ritor1
parents:
diff changeset
8139 v4 = v30;
Ritor1
parents:
diff changeset
8140 v5 = v24;
Ritor1
parents:
diff changeset
8141 }
Ritor1
parents:
diff changeset
8142 v9 = v26 + 640;
Ritor1
parents:
diff changeset
8143 v15 = v25-- == 1;
Ritor1
parents:
diff changeset
8144 v26 += 640;
Ritor1
parents:
diff changeset
8145 }
Ritor1
parents:
diff changeset
8146 while ( !v15 );
Ritor1
parents:
diff changeset
8147 }
Ritor1
parents:
diff changeset
8148 if ( v4 > 0 )
Ritor1
parents:
diff changeset
8149 {
Ritor1
parents:
diff changeset
8150 v32 = 1;
Ritor1
parents:
diff changeset
8151 v16 = (int)dword_50BC10;
Ritor1
parents:
diff changeset
8152 do
Ritor1
parents:
diff changeset
8153 {
Ritor1
parents:
diff changeset
8154 for ( i = v32; i < v4; ++i )
Ritor1
parents:
diff changeset
8155 {
Ritor1
parents:
diff changeset
8156 v17 = dword_50BC10[i];
Ritor1
parents:
diff changeset
8157 if ( v17 < *(int *)v16 )
Ritor1
parents:
diff changeset
8158 {
Ritor1
parents:
diff changeset
8159 dword_50BC10[i] = *(int *)v16;
Ritor1
parents:
diff changeset
8160 *(int *)v16 = v17;
Ritor1
parents:
diff changeset
8161 }
Ritor1
parents:
diff changeset
8162 }
Ritor1
parents:
diff changeset
8163 ++v32;
Ritor1
parents:
diff changeset
8164 v16 += 4;
Ritor1
parents:
diff changeset
8165 }
Ritor1
parents:
diff changeset
8166 while ( v32 - 1 < v4 );
Ritor1
parents:
diff changeset
8167 v5 = v24;
Ritor1
parents:
diff changeset
8168 if ( v4 > 0 )
Ritor1
parents:
diff changeset
8169 {
Ritor1
parents:
diff changeset
8170 v18 = v24;
Ritor1
parents:
diff changeset
8171 v19 = v4;
Ritor1
parents:
diff changeset
8172 do
Ritor1
parents:
diff changeset
8173 {
Ritor1
parents:
diff changeset
8174 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10 - (char *)v24].field_0 >> 3) & 0x1FFF;
Ritor1
parents:
diff changeset
8175 v18 += 4;
Ritor1
parents:
diff changeset
8176 --v19;
Ritor1
parents:
diff changeset
8177 }
Ritor1
parents:
diff changeset
8178 while ( v19 );
Ritor1
parents:
diff changeset
8179 }
Ritor1
parents:
diff changeset
8180 }
Ritor1
parents:
diff changeset
8181 v20 = 0;
Ritor1
parents:
diff changeset
8182 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 )
Ritor1
parents:
diff changeset
8183 {
Ritor1
parents:
diff changeset
8184 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState;
Ritor1
parents:
diff changeset
8185 if ( v21 != 4 && v21 != 5 )
Ritor1
parents:
diff changeset
8186 break;
Ritor1
parents:
diff changeset
8187 }
Ritor1
parents:
diff changeset
8188 if ( v20 != v4 )
Ritor1
parents:
diff changeset
8189 {
Ritor1
parents:
diff changeset
8190 result = 8 * *(int *)&v5[4 * v20].field_0;
Ritor1
parents:
diff changeset
8191 LOBYTE(result) = result | 3;
Ritor1
parents:
diff changeset
8192 return result;
Ritor1
parents:
diff changeset
8193 }
Ritor1
parents:
diff changeset
8194 }
Ritor1
parents:
diff changeset
8195 }
Ritor1
parents:
diff changeset
8196 return 0;
Ritor1
parents:
diff changeset
8197 }
Ritor1
parents:
diff changeset
8198
Ritor1
parents:
diff changeset
8199
Ritor1
parents:
diff changeset
8200 //----- (0042F3D6) --------------------------------------------------------
Ritor1
parents:
diff changeset
8201 void InitializeTurnBasedAnimations(void *_this)
Ritor1
parents:
diff changeset
8202 {
Ritor1
parents:
diff changeset
8203 unsigned int *v1; // edi@1
Ritor1
parents:
diff changeset
8204
Ritor1
parents:
diff changeset
8205 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0");
Ritor1
parents:
diff changeset
8206 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1");
Ritor1
parents:
diff changeset
8207 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2");
Ritor1
parents:
diff changeset
8208 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3");
Ritor1
parents:
diff changeset
8209 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4");
Ritor1
parents:
diff changeset
8210 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop");
Ritor1
parents:
diff changeset
8211 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour");
Ritor1
parents:
diff changeset
8212 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart");
Ritor1
parents:
diff changeset
8213 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1");
Ritor1
parents:
diff changeset
8214 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11");
Ritor1
parents:
diff changeset
8215 v1 = pIconIDs_Turn;
Ritor1
parents:
diff changeset
8216 do
Ritor1
parents:
diff changeset
8217 {
Ritor1
parents:
diff changeset
8218 pIconsFrameTable->InitializeAnimation(*v1);
Ritor1
parents:
diff changeset
8219 ++v1;
Ritor1
parents:
diff changeset
8220 }
Ritor1
parents:
diff changeset
8221 while ( (signed int)v1 < (signed int)&uIconID_TurnStop );
Ritor1
parents:
diff changeset
8222 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour);
Ritor1
parents:
diff changeset
8223 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop);
Ritor1
parents:
diff changeset
8224 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart);
Ritor1
parents:
diff changeset
8225 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame);
Ritor1
parents:
diff changeset
8226 }
Ritor1
parents:
diff changeset
8227
Ritor1
parents:
diff changeset
8228 //----- (0042F4DA) --------------------------------------------------------
Ritor1
parents:
diff changeset
8229 signed int __cdecl sub_42F4DA()
Ritor1
parents:
diff changeset
8230 {
Ritor1
parents:
diff changeset
8231 signed int v0; // edi@1
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8232 Actor *v1; // esi@4
0
Ritor1
parents:
diff changeset
8233 int v2; // ebx@5
Ritor1
parents:
diff changeset
8234 int v3; // eax@5
Ritor1
parents:
diff changeset
8235 int v4; // ebx@5
Ritor1
parents:
diff changeset
8236 unsigned int v5; // ecx@5
Ritor1
parents:
diff changeset
8237 int v6; // edx@6
Ritor1
parents:
diff changeset
8238 unsigned int v7; // edx@8
Ritor1
parents:
diff changeset
8239 unsigned int v8; // edx@10
Ritor1
parents:
diff changeset
8240 __int16 v9; // ax@12
Ritor1
parents:
diff changeset
8241 signed int result; // eax@20
Ritor1
parents:
diff changeset
8242 int v11; // [sp+Ch] [bp-10h]@5
Ritor1
parents:
diff changeset
8243 int v12; // [sp+10h] [bp-Ch]@5
Ritor1
parents:
diff changeset
8244 signed int v13; // [sp+14h] [bp-8h]@3
Ritor1
parents:
diff changeset
8245
Ritor1
parents:
diff changeset
8246 v0 = 5120;
Ritor1
parents:
diff changeset
8247 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
8248 v0 = 2560;
Ritor1
parents:
diff changeset
8249 v13 = 0;
Ritor1
parents:
diff changeset
8250 if ( (signed int)uNumActors <= 0 )
Ritor1
parents:
diff changeset
8251 {
Ritor1
parents:
diff changeset
8252 LABEL_20:
Ritor1
parents:
diff changeset
8253 result = 0;
Ritor1
parents:
diff changeset
8254 }
Ritor1
parents:
diff changeset
8255 else
Ritor1
parents:
diff changeset
8256 {
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8257 v1 = pActors;
0
Ritor1
parents:
diff changeset
8258 while ( 1 )
Ritor1
parents:
diff changeset
8259 {
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8260 v2 = abs(v1->vInitialPosition.x - pParty->vPosition.x);
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8261 v11 = abs(v1->vInitialPosition.y - pParty->vPosition.y);
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8262 v12 = abs(v1->vInitialPosition.z - pParty->vPosition.z);
0
Ritor1
parents:
diff changeset
8263 v3 = v2;
Ritor1
parents:
diff changeset
8264 v4 = v11;
Ritor1
parents:
diff changeset
8265 v5 = v12;
Ritor1
parents:
diff changeset
8266 if ( v3 < v11 )
Ritor1
parents:
diff changeset
8267 {
Ritor1
parents:
diff changeset
8268 v6 = v3;
Ritor1
parents:
diff changeset
8269 v3 = v11;
Ritor1
parents:
diff changeset
8270 v4 = v6;
Ritor1
parents:
diff changeset
8271 }
Ritor1
parents:
diff changeset
8272 if ( v3 < v12 )
Ritor1
parents:
diff changeset
8273 {
Ritor1
parents:
diff changeset
8274 v7 = v3;
Ritor1
parents:
diff changeset
8275 v3 = v12;
Ritor1
parents:
diff changeset
8276 v5 = v7;
Ritor1
parents:
diff changeset
8277 }
Ritor1
parents:
diff changeset
8278 if ( v4 < (signed int)v5 )
Ritor1
parents:
diff changeset
8279 {
Ritor1
parents:
diff changeset
8280 v8 = v5;
Ritor1
parents:
diff changeset
8281 v5 = v4;
Ritor1
parents:
diff changeset
8282 v4 = v8;
Ritor1
parents:
diff changeset
8283 }
Ritor1
parents:
diff changeset
8284 if ( (signed int)(((unsigned int)(11 * v4) >> 5) + (v5 >> 2) + v3) < v0 )
Ritor1
parents:
diff changeset
8285 {
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8286 v9 = v1->uAIState;
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8287 if ( v1->uAIState != 5 )
0
Ritor1
parents:
diff changeset
8288 {
Ritor1
parents:
diff changeset
8289 if ( v9 != 4
Ritor1
parents:
diff changeset
8290 && v9 != 11
Ritor1
parents:
diff changeset
8291 && v9 != 19
Ritor1
parents:
diff changeset
8292 && v9 != 17
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8293 && (BYTE2(v1->uAttributes) & 8 || ((Actor *)nullptr)->GetActorsRelation( v1)) )
0
Ritor1
parents:
diff changeset
8294 break;
Ritor1
parents:
diff changeset
8295 }
Ritor1
parents:
diff changeset
8296 }
Ritor1
parents:
diff changeset
8297 ++v13;
82
1faa29fd4c2d many type, memory, boundary fixes
zipi
parents: 81
diff changeset
8298 ++v1;
0
Ritor1
parents:
diff changeset
8299 if ( v13 >= (signed int)uNumActors )
Ritor1
parents:
diff changeset
8300 goto LABEL_20;
Ritor1
parents:
diff changeset
8301 }
Ritor1
parents:
diff changeset
8302 result = 1;
Ritor1
parents:
diff changeset
8303 }
Ritor1
parents:
diff changeset
8304 return result;
Ritor1
parents:
diff changeset
8305 }
Ritor1
parents:
diff changeset
8306
Ritor1
parents:
diff changeset
8307 //----- (0042F5ED) --------------------------------------------------------
Ritor1
parents:
diff changeset
8308 int LayingItem::Create(int yaw, int pitch, int a4, int a5)
Ritor1
parents:
diff changeset
8309 {
Ritor1
parents:
diff changeset
8310 LayingItem *v5; // eax@1
Ritor1
parents:
diff changeset
8311 signed int v6; // ebx@2
Ritor1
parents:
diff changeset
8312 char *v7; // ecx@2
Ritor1
parents:
diff changeset
8313 signed int result; // eax@6
Ritor1
parents:
diff changeset
8314 LayingItem *v9; // ebx@7
Ritor1
parents:
diff changeset
8315 int v10; // edx@11
Ritor1
parents:
diff changeset
8316 int v11; // edi@18
Ritor1
parents:
diff changeset
8317 __int16 v12; // ax@18
Ritor1
parents:
diff changeset
8318 int v13; // ST2C_4@20
Ritor1
parents:
diff changeset
8319 int v14; // eax@20
Ritor1
parents:
diff changeset
8320 int v15; // [sp-28h] [bp-38h]@14
Ritor1
parents:
diff changeset
8321 int v16; // [sp-24h] [bp-34h]@11
Ritor1
parents:
diff changeset
8322 Vec3_int_ v17; // [sp-20h] [bp-30h]@11
Ritor1
parents:
diff changeset
8323 int *v18; // [sp-14h] [bp-24h]@11
Ritor1
parents:
diff changeset
8324 int *v19; // [sp-10h] [bp-20h]@11
Ritor1
parents:
diff changeset
8325 int *v20; // [sp-Ch] [bp-1Ch]@11
Ritor1
parents:
diff changeset
8326 signed int v21; // [sp+8h] [bp-8h]@2
Ritor1
parents:
diff changeset
8327 int angle; // [sp+Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
8328 int a4a; // [sp+1Ch] [bp+Ch]@20
Ritor1
parents:
diff changeset
8329 int a4b; // [sp+1Ch] [bp+Ch]@20
Ritor1
parents:
diff changeset
8330 int a5a; // [sp+20h] [bp+10h]@20
Ritor1
parents:
diff changeset
8331
Ritor1
parents:
diff changeset
8332 auto a1 = this;
Ritor1
parents:
diff changeset
8333 angle = yaw;
Ritor1
parents:
diff changeset
8334 v5 = a1;
Ritor1
parents:
diff changeset
8335 if ( !a1->uObjectDescID )
Ritor1
parents:
diff changeset
8336 return -1;
Ritor1
parents:
diff changeset
8337 v6 = 0;
Ritor1
parents:
diff changeset
8338 v7 = (char *)&pLayingItems[0].uObjectDescID;
Ritor1
parents:
diff changeset
8339 v21 = 0;
Ritor1
parents:
diff changeset
8340 do
Ritor1
parents:
diff changeset
8341 {
Ritor1
parents:
diff changeset
8342 if ( !*(short *)v7 )
Ritor1
parents:
diff changeset
8343 break;
Ritor1
parents:
diff changeset
8344 v7 += 112;
Ritor1
parents:
diff changeset
8345 ++v6;
Ritor1
parents:
diff changeset
8346 v21 = v6;
Ritor1
parents:
diff changeset
8347 }
Ritor1
parents:
diff changeset
8348 while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) );
Ritor1
parents:
diff changeset
8349 if ( v6 >= 1000 )
Ritor1
parents:
diff changeset
8350 return -1;
Ritor1
parents:
diff changeset
8351 *(int *)&v5->field_62[2] = v5->vPosition.x;
Ritor1
parents:
diff changeset
8352 *(int *)&v5->field_62[6] = v5->vPosition.y;
Ritor1
parents:
diff changeset
8353 v9 = &pLayingItems[v6];
Ritor1
parents:
diff changeset
8354 *(int *)&v5->field_62[10] = v5->vPosition.z;
Ritor1
parents:
diff changeset
8355 memcpy(v9, v5, 0x70u);
Ritor1
parents:
diff changeset
8356 if ( a5 == 1 )
Ritor1
parents:
diff changeset
8357 {
Ritor1
parents:
diff changeset
8358 v20 = &v9->vPosition.z;
Ritor1
parents:
diff changeset
8359 v19 = &v9->vPosition.y;
Ritor1
parents:
diff changeset
8360 v18 = (int *)&v9->vPosition;
Ritor1
parents:
diff changeset
8361 v17.z = v5->vPosition.z;
Ritor1
parents:
diff changeset
8362 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x;
Ritor1
parents:
diff changeset
8363 v16 = 0;
Ritor1
parents:
diff changeset
8364 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing;
Ritor1
parents:
diff changeset
8365 goto LABEL_16;
Ritor1
parents:
diff changeset
8366 }
Ritor1
parents:
diff changeset
8367 if ( a5 == 2 )
Ritor1
parents:
diff changeset
8368 {
Ritor1
parents:
diff changeset
8369 v20 = &v9->vPosition.z;
Ritor1
parents:
diff changeset
8370 v19 = &v9->vPosition.y;
Ritor1
parents:
diff changeset
8371 v18 = (int *)&v9->vPosition;
Ritor1
parents:
diff changeset
8372 v17.z = v5->vPosition.z;
Ritor1
parents:
diff changeset
8373 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x;
Ritor1
parents:
diff changeset
8374 v16 = 0;
Ritor1
parents:
diff changeset
8375 v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing;
Ritor1
parents:
diff changeset
8376 goto LABEL_14;
Ritor1
parents:
diff changeset
8377 }
Ritor1
parents:
diff changeset
8378 if ( a5 == 3 )
Ritor1
parents:
diff changeset
8379 {
Ritor1
parents:
diff changeset
8380 v20 = &v9->vPosition.z;
Ritor1
parents:
diff changeset
8381 v19 = &v9->vPosition.y;
Ritor1
parents:
diff changeset
8382 v18 = (int *)&v9->vPosition;
Ritor1
parents:
diff changeset
8383 v17.z = v5->vPosition.z;
Ritor1
parents:
diff changeset
8384 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x;
Ritor1
parents:
diff changeset
8385 v16 = 0;
Ritor1
parents:
diff changeset
8386 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi;
Ritor1
parents:
diff changeset
8387 LABEL_14:
Ritor1
parents:
diff changeset
8388 v15 = 8;
Ritor1
parents:
diff changeset
8389 LABEL_17:
Ritor1
parents:
diff changeset
8390 Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20);
Ritor1
parents:
diff changeset
8391 goto LABEL_18;
Ritor1
parents:
diff changeset
8392 }
Ritor1
parents:
diff changeset
8393 if ( a5 == 4 )
Ritor1
parents:
diff changeset
8394 {
Ritor1
parents:
diff changeset
8395 v20 = &v9->vPosition.z;
Ritor1
parents:
diff changeset
8396 v19 = &v9->vPosition.y;
Ritor1
parents:
diff changeset
8397 v18 = (int *)&v9->vPosition;
Ritor1
parents:
diff changeset
8398 v17.z = v5->vPosition.z;
Ritor1
parents:
diff changeset
8399 *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x;
Ritor1
parents:
diff changeset
8400 v16 = 0;
Ritor1
parents:
diff changeset
8401 v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi;
Ritor1
parents:
diff changeset
8402 LABEL_16:
Ritor1
parents:
diff changeset
8403 v15 = 24;
Ritor1
parents:
diff changeset
8404 goto LABEL_17;
Ritor1
parents:
diff changeset
8405 }
Ritor1
parents:
diff changeset
8406 LABEL_18:
Ritor1
parents:
diff changeset
8407 v11 = a4;
Ritor1
parents:
diff changeset
8408 v12 = 0;
Ritor1
parents:
diff changeset
8409 if ( a4 )
Ritor1
parents:
diff changeset
8410 {
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
8411 a4a = stru_5C6E00->Cos(angle);
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
8412 v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16;
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
8413 a4b = stru_5C6E00->Sin(angle);
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
8414 a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16;
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
8415 v14 = stru_5C6E00->Sin(pitch);
0
Ritor1
parents:
diff changeset
8416 v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16;
Ritor1
parents:
diff changeset
8417 v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16;
Ritor1
parents:
diff changeset
8418 v12 = (unsigned int)(v14 * v11) >> 16;
Ritor1
parents:
diff changeset
8419 }
Ritor1
parents:
diff changeset
8420 else
Ritor1
parents:
diff changeset
8421 {
Ritor1
parents:
diff changeset
8422 v9->vVelocity.y = 0;
Ritor1
parents:
diff changeset
8423 v9->vVelocity.x = 0;
Ritor1
parents:
diff changeset
8424 }
Ritor1
parents:
diff changeset
8425 v9->vVelocity.z = v12;
Ritor1
parents:
diff changeset
8426 result = v21;
Ritor1
parents:
diff changeset
8427 if ( v21 >= (signed int)uNumLayingItems )
Ritor1
parents:
diff changeset
8428 uNumLayingItems = v21 + 1;
Ritor1
parents:
diff changeset
8429 return result;
Ritor1
parents:
diff changeset
8430 }
Ritor1
parents:
diff changeset
8431
Ritor1
parents:
diff changeset
8432 //----- (0042F7EB) --------------------------------------------------------
Ritor1
parents:
diff changeset
8433 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)
Ritor1
parents:
diff changeset
8434 {
Ritor1
parents:
diff changeset
8435 unsigned int v9; // edi@1
Ritor1
parents:
diff changeset
8436 signed int v10; // edx@3
Ritor1
parents:
diff changeset
8437 char *v11; // ecx@4
Ritor1
parents:
diff changeset
8438 unsigned __int16 v12; // ax@7
Ritor1
parents:
diff changeset
8439 unsigned int v13; // edx@9
Ritor1
parents:
diff changeset
8440 char *v14; // ecx@10
Ritor1
parents:
diff changeset
8441 int v15; // esi@17
Ritor1
parents:
diff changeset
8442 int v16; // eax@18
Ritor1
parents:
diff changeset
8443 int v17; // edi@20
Ritor1
parents:
diff changeset
8444 int v18; // esi@20
Ritor1
parents:
diff changeset
8445 //LayingItem a1a; // [sp+Ch] [bp-78h]@1
Ritor1
parents:
diff changeset
8446 int v21; // [sp+7Ch] [bp-8h]@1
Ritor1
parents:
diff changeset
8447 unsigned int v22; // [sp+80h] [bp-4h]@1
Ritor1
parents:
diff changeset
8448
Ritor1
parents:
diff changeset
8449 v9 = uSpriteID;
Ritor1
parents:
diff changeset
8450 v21 = x;
Ritor1
parents:
diff changeset
8451 v22 = uSpriteID;
Ritor1
parents:
diff changeset
8452
Ritor1
parents:
diff changeset
8453 LayingItem a1a; // [sp+Ch] [bp-78h]@1
Ritor1
parents:
diff changeset
8454 //LayingItem::LayingItem(&a1a);
Ritor1
parents:
diff changeset
8455 a1a.stru_24.Reset();
Ritor1
parents:
diff changeset
8456
Ritor1
parents:
diff changeset
8457 if ( a9 )
Ritor1
parents:
diff changeset
8458 {
Ritor1
parents:
diff changeset
8459 memcpy(&a1a.stru_24, a9, sizeof(a1a.stru_24));
Ritor1
parents:
diff changeset
8460 v9 = v22;
Ritor1
parents:
diff changeset
8461 }
Ritor1
parents:
diff changeset
8462 v10 = 0;
Ritor1
parents:
diff changeset
8463 a1a.field_50 = 0;
Ritor1
parents:
diff changeset
8464 a1a.field_4C = 0;
Ritor1
parents:
diff changeset
8465 a1a.field_48 = 0;
Ritor1
parents:
diff changeset
8466 a1a.field_54 = 0;
Ritor1
parents:
diff changeset
8467 a1a.uItemType = v9;
Ritor1
parents:
diff changeset
8468 if ( (signed int)pObjectList->uNumObjects <= 0 )
Ritor1
parents:
diff changeset
8469 {
Ritor1
parents:
diff changeset
8470 LABEL_7:
Ritor1
parents:
diff changeset
8471 v12 = 0;
Ritor1
parents:
diff changeset
8472 }
Ritor1
parents:
diff changeset
8473 else
Ritor1
parents:
diff changeset
8474 {
Ritor1
parents:
diff changeset
8475 v11 = (char *)&pObjectList->pObjects->uObjectID;
Ritor1
parents:
diff changeset
8476 while ( (short)v9 != *(short *)v11 )
Ritor1
parents:
diff changeset
8477 {
Ritor1
parents:
diff changeset
8478 ++v10;
Ritor1
parents:
diff changeset
8479 v11 += 56;
Ritor1
parents:
diff changeset
8480 if ( v10 >= (signed int)pObjectList->uNumObjects )
Ritor1
parents:
diff changeset
8481 goto LABEL_7;
Ritor1
parents:
diff changeset
8482 }
Ritor1
parents:
diff changeset
8483 v12 = v10;
Ritor1
parents:
diff changeset
8484 }
Ritor1
parents:
diff changeset
8485 a1a.uObjectDescID = v12;
Ritor1
parents:
diff changeset
8486 a1a.vPosition.z = z;
Ritor1
parents:
diff changeset
8487 a1a.vPosition.x = v21;
Ritor1
parents:
diff changeset
8488 a1a.vPosition.y = y;
Ritor1
parents:
diff changeset
8489 a1a.uSoundID = 0;
Ritor1
parents:
diff changeset
8490 a1a.uAttributes = attributes;
Ritor1
parents:
diff changeset
8491 a1a.uSectorID = pIndoor->GetSector(v21, y, z);
Ritor1
parents:
diff changeset
8492 a1a.uSpriteFrameID = 0;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
8493 a1a.field_58_pid = 0;
0
Ritor1
parents:
diff changeset
8494 a1a.field_5C = 0;
Ritor1
parents:
diff changeset
8495 if ( !(a1a.uAttributes & 0x10) )
Ritor1
parents:
diff changeset
8496 {
Ritor1
parents:
diff changeset
8497 v13 = 0;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
8498 if ( (signed int)pItemsTable->uAllItemsCount > 0 )
0
Ritor1
parents:
diff changeset
8499 {
Ritor1
parents:
diff changeset
8500 v14 = (char *)&pItemsTable->pItems[0].uSpriteID;
Ritor1
parents:
diff changeset
8501 while ( *(short *)v14 != v9 )
Ritor1
parents:
diff changeset
8502 {
Ritor1
parents:
diff changeset
8503 ++v13;
Ritor1
parents:
diff changeset
8504 v14 += 48;
222
8113753ed2ae more item init fixing
Gloval
parents: 190
diff changeset
8505 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount )
0
Ritor1
parents:
diff changeset
8506 goto LABEL_16;
Ritor1
parents:
diff changeset
8507 }
Ritor1
parents:
diff changeset
8508 a1a.stru_24.uItemID = v13;
Ritor1
parents:
diff changeset
8509 }
Ritor1
parents:
diff changeset
8510 }
Ritor1
parents:
diff changeset
8511 LABEL_16:
Ritor1
parents:
diff changeset
8512 if ( a7 )
Ritor1
parents:
diff changeset
8513 {
Ritor1
parents:
diff changeset
8514 v15 = count;
Ritor1
parents:
diff changeset
8515 if ( count > 0 )
Ritor1
parents:
diff changeset
8516 {
Ritor1
parents:
diff changeset
8517 do
Ritor1
parents:
diff changeset
8518 {
Ritor1
parents:
diff changeset
8519 a1a.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi;
Ritor1
parents:
diff changeset
8520 v16 = rand();
Ritor1
parents:
diff changeset
8521 a1a.Create(
Ritor1
parents:
diff changeset
8522 (signed __int16)a1a.uFacing,
Ritor1
parents:
diff changeset
8523 ((signed int)stru_5C6E00->uIntegerHalfPi >> 1) + (v16 % (signed int)stru_5C6E00->uIntegerHalfPi >> 1),
Ritor1
parents:
diff changeset
8524 a4,
Ritor1
parents:
diff changeset
8525 0);
Ritor1
parents:
diff changeset
8526 --v15;
Ritor1
parents:
diff changeset
8527 }
Ritor1
parents:
diff changeset
8528 while ( v15 );
Ritor1
parents:
diff changeset
8529 }
Ritor1
parents:
diff changeset
8530 }
Ritor1
parents:
diff changeset
8531 else
Ritor1
parents:
diff changeset
8532 {
Ritor1
parents:
diff changeset
8533 v17 = count;
Ritor1
parents:
diff changeset
8534 v18 = stru_5C6E00->uIntegerHalfPi;
Ritor1
parents:
diff changeset
8535 a1a.uFacing = 0;
Ritor1
parents:
diff changeset
8536 if ( count > 0 )
Ritor1
parents:
diff changeset
8537 {
Ritor1
parents:
diff changeset
8538 do
Ritor1
parents:
diff changeset
8539 {
Ritor1
parents:
diff changeset
8540 a1a.Create((signed __int16)a1a.uFacing, v18, a4, 0);
Ritor1
parents:
diff changeset
8541 --v17;
Ritor1
parents:
diff changeset
8542 }
Ritor1
parents:
diff changeset
8543 while ( v17 );
Ritor1
parents:
diff changeset
8544 }
Ritor1
parents:
diff changeset
8545 }
Ritor1
parents:
diff changeset
8546 return 1;
Ritor1
parents:
diff changeset
8547 }
Ritor1
parents:
diff changeset
8548
Ritor1
parents:
diff changeset
8549 //----- (0042F960) --------------------------------------------------------
Ritor1
parents:
diff changeset
8550 void __fastcall sub_42F960_create_object(int x, int y, int z)
Ritor1
parents:
diff changeset
8551 {
Ritor1
parents:
diff changeset
8552 int v3; // ebx@1
Ritor1
parents:
diff changeset
8553 int v4; // edi@1
Ritor1
parents:
diff changeset
8554 signed int v5; // edx@1
Ritor1
parents:
diff changeset
8555 char *v6; // ecx@2
Ritor1
parents:
diff changeset
8556 unsigned __int16 v7; // ax@5
Ritor1
parents:
diff changeset
8557 signed int v8; // eax@6
Ritor1
parents:
diff changeset
8558 signed int v9; // eax@7
Ritor1
parents:
diff changeset
8559 //LayingItem a1; // [sp+Ch] [bp-70h]@1
Ritor1
parents:
diff changeset
8560
Ritor1
parents:
diff changeset
8561 v3 = x;
Ritor1
parents:
diff changeset
8562 v4 = y;
Ritor1
parents:
diff changeset
8563
Ritor1
parents:
diff changeset
8564 LayingItem a1; // [sp+Ch] [bp-70h]@1
Ritor1
parents:
diff changeset
8565 //LayingItem::LayingItem(&a1);
Ritor1
parents:
diff changeset
8566 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
8567
Ritor1
parents:
diff changeset
8568 v5 = 0;
Ritor1
parents:
diff changeset
8569 a1.field_50 = 0;
Ritor1
parents:
diff changeset
8570 a1.field_4C = 0;
Ritor1
parents:
diff changeset
8571 a1.field_48 = 0;
Ritor1
parents:
diff changeset
8572 a1.field_54 = 0;
Ritor1
parents:
diff changeset
8573 a1.uItemType = 800;
Ritor1
parents:
diff changeset
8574 if ( (signed int)pObjectList->uNumObjects <= 0 )
Ritor1
parents:
diff changeset
8575 {
Ritor1
parents:
diff changeset
8576 LABEL_5:
Ritor1
parents:
diff changeset
8577 v7 = 0;
Ritor1
parents:
diff changeset
8578 }
Ritor1
parents:
diff changeset
8579 else
Ritor1
parents:
diff changeset
8580 {
Ritor1
parents:
diff changeset
8581 v6 = (char *)&pObjectList->pObjects->uObjectID;
Ritor1
parents:
diff changeset
8582 while ( *(short *)v6 != 800 )
Ritor1
parents:
diff changeset
8583 {
Ritor1
parents:
diff changeset
8584 ++v5;
Ritor1
parents:
diff changeset
8585 v6 += 56;
Ritor1
parents:
diff changeset
8586 if ( v5 >= (signed int)pObjectList->uNumObjects )
Ritor1
parents:
diff changeset
8587 goto LABEL_5;
Ritor1
parents:
diff changeset
8588 }
Ritor1
parents:
diff changeset
8589 v7 = v5;
Ritor1
parents:
diff changeset
8590 }
Ritor1
parents:
diff changeset
8591 a1.uObjectDescID = v7;
Ritor1
parents:
diff changeset
8592 a1.vPosition.x = v3;
Ritor1
parents:
diff changeset
8593 a1.vPosition.y = v4;
Ritor1
parents:
diff changeset
8594 a1.vPosition.z = z;
Ritor1
parents:
diff changeset
8595 a1.uSoundID = 0;
Ritor1
parents:
diff changeset
8596 a1.uAttributes = 0;
Ritor1
parents:
diff changeset
8597 a1.uSectorID = pIndoor->GetSector(v3, v4, z);
Ritor1
parents:
diff changeset
8598 a1.uSpriteFrameID = 0;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
8599 a1.field_58_pid = 0;
0
Ritor1
parents:
diff changeset
8600 a1.field_5C = 0;
Ritor1
parents:
diff changeset
8601 v8 = a1.Create(0, 0, 0, 0);
Ritor1
parents:
diff changeset
8602 if ( v8 != -1 )
Ritor1
parents:
diff changeset
8603 {
Ritor1
parents:
diff changeset
8604 v9 = 8 * v8;
Ritor1
parents:
diff changeset
8605 LOBYTE(v9) = v9 | 2;
Ritor1
parents:
diff changeset
8606 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
8607 }
Ritor1
parents:
diff changeset
8608 }
Ritor1
parents:
diff changeset
8609
Ritor1
parents:
diff changeset
8610 //----- (0042FA22) --------------------------------------------------------
79
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8611 LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list()
0
Ritor1
parents:
diff changeset
8612 {
Ritor1
parents:
diff changeset
8613 size_t v0; // edx@1
Ritor1
parents:
diff changeset
8614 int v1; // ebp@1
79
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8615 LayingItem *result; // eax@1
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8616 LayingItem *v3; // ebx@1
0
Ritor1
parents:
diff changeset
8617
Ritor1
parents:
diff changeset
8618 v0 = 0;
Ritor1
parents:
diff changeset
8619 v1 = 0;
79
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8620 //result = (char *)&pLayingItems[0].uObjectDescID;
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8621 result = pLayingItems;
0
Ritor1
parents:
diff changeset
8622 v3 = pLayingItems;
Ritor1
parents:
diff changeset
8623 do
Ritor1
parents:
diff changeset
8624 {
79
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8625 if ( result->uObjectDescID )
0
Ritor1
parents:
diff changeset
8626 {
Ritor1
parents:
diff changeset
8627 if ( v1 != v0 )
Ritor1
parents:
diff changeset
8628 {
79
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8629 memcpy(v3, result, 0x70u);
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8630 result->uObjectDescID = 0;
0
Ritor1
parents:
diff changeset
8631 }
Ritor1
parents:
diff changeset
8632 ++v0;
79
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8633 ++v3;// = (char *)v3 + 112;
0
Ritor1
parents:
diff changeset
8634 }
79
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8635 ++result;// += 112;
0
Ritor1
parents:
diff changeset
8636 ++v1;
Ritor1
parents:
diff changeset
8637 }
79
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8638 //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) );
6ad816231528 structure fixes, death crash fix
zipi
parents: 42
diff changeset
8639 while( result <= &pLayingItems[999] );
0
Ritor1
parents:
diff changeset
8640 uNumLayingItems = v0;
Ritor1
parents:
diff changeset
8641 return result;
Ritor1
parents:
diff changeset
8642 }
Ritor1
parents:
diff changeset
8643
Ritor1
parents:
diff changeset
8644 //----- (0042FA66) --------------------------------------------------------
Ritor1
parents:
diff changeset
8645 int __fastcall _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6)
Ritor1
parents:
diff changeset
8646 {
Ritor1
parents:
diff changeset
8647 int v6; // edi@1
Ritor1
parents:
diff changeset
8648 int v7; // esi@1
Ritor1
parents:
diff changeset
8649 char *v8; // ecx@2
Ritor1
parents:
diff changeset
8650 unsigned __int16 v9; // ax@5
Ritor1
parents:
diff changeset
8651 int v10; // eax@10
Ritor1
parents:
diff changeset
8652 signed int result; // eax@11
Ritor1
parents:
diff changeset
8653 __int16 v12; // ax@12
Ritor1
parents:
diff changeset
8654 //LayingItem a1a; // [sp+Ch] [bp-74h]@1
Ritor1
parents:
diff changeset
8655 int v14; // [sp+7Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
8656
Ritor1
parents:
diff changeset
8657 v6 = a1;
Ritor1
parents:
diff changeset
8658 v7 = a2;
Ritor1
parents:
diff changeset
8659 LayingItem a1a; // [sp+Ch] [bp-74h]@1
Ritor1
parents:
diff changeset
8660 //LayingItem::LayingItem(&a1a);
Ritor1
parents:
diff changeset
8661 a1a.uItemType = 600;
Ritor1
parents:
diff changeset
8662 a1a.stru_24.Reset();
Ritor1
parents:
diff changeset
8663
Ritor1
parents:
diff changeset
8664 a1a.field_48 = 6;
Ritor1
parents:
diff changeset
8665 a1a.field_4C = 8;
Ritor1
parents:
diff changeset
8666 a1a.field_50 = 3;
Ritor1
parents:
diff changeset
8667 v14 = 0;
Ritor1
parents:
diff changeset
8668 if ( (signed int)pObjectList->uNumObjects <= 0 )
Ritor1
parents:
diff changeset
8669 {
Ritor1
parents:
diff changeset
8670 LABEL_5:
Ritor1
parents:
diff changeset
8671 v9 = 0;
Ritor1
parents:
diff changeset
8672 }
Ritor1
parents:
diff changeset
8673 else
Ritor1
parents:
diff changeset
8674 {
Ritor1
parents:
diff changeset
8675 v8 = (char *)&pObjectList->pObjects->uObjectID;
Ritor1
parents:
diff changeset
8676 while ( (short)a1a.uItemType != *(short *)v8 )
Ritor1
parents:
diff changeset
8677 {
Ritor1
parents:
diff changeset
8678 ++v14;
Ritor1
parents:
diff changeset
8679 v8 += 56;
Ritor1
parents:
diff changeset
8680 if ( v14 >= (signed int)pObjectList->uNumObjects )
Ritor1
parents:
diff changeset
8681 goto LABEL_5;
Ritor1
parents:
diff changeset
8682 }
Ritor1
parents:
diff changeset
8683 v9 = v14;
Ritor1
parents:
diff changeset
8684 }
Ritor1
parents:
diff changeset
8685 a1a.uObjectDescID = v9;
Ritor1
parents:
diff changeset
8686 a1a.vPosition.x = v6;
Ritor1
parents:
diff changeset
8687 a1a.vPosition.y = v7;
Ritor1
parents:
diff changeset
8688 a1a.vPosition.z = a3;
Ritor1
parents:
diff changeset
8689 a1a.uAttributes = 0;
Ritor1
parents:
diff changeset
8690 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3);
Ritor1
parents:
diff changeset
8691 a1a.uSpriteFrameID = 0;
Ritor1
parents:
diff changeset
8692 a1a.field_5C = 0;
Ritor1
parents:
diff changeset
8693 a1a.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
8694 a1a.uFacing = 0;
Ritor1
parents:
diff changeset
8695 a1a.uSoundID = 0;
Ritor1
parents:
diff changeset
8696 if ( a6 >= 1 || a6 <= 4 )
Ritor1
parents:
diff changeset
8697 {
Ritor1
parents:
diff changeset
8698 v10 = 8 * a6 - 8;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
8699 LOBYTE(v10) = v10 | OBJECT_Player;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
8700 a1a.field_58_pid = v10;
0
Ritor1
parents:
diff changeset
8701 }
Ritor1
parents:
diff changeset
8702 else
Ritor1
parents:
diff changeset
8703 {
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
8704 a1a.field_58_pid = 0;
0
Ritor1
parents:
diff changeset
8705 }
Ritor1
parents:
diff changeset
8706 result = a1a.Create(0, 0, 0, 0);
Ritor1
parents:
diff changeset
8707 if ( result != -1 )
Ritor1
parents:
diff changeset
8708 {
Ritor1
parents:
diff changeset
8709 v12 = 8 * result;
Ritor1
parents:
diff changeset
8710 LOBYTE(v12) = v12 | 2;
Ritor1
parents:
diff changeset
8711 result = stru_50FE08.Add(
Ritor1
parents:
diff changeset
8712 v12,
Ritor1
parents:
diff changeset
8713 a5,
Ritor1
parents:
diff changeset
8714 SLOWORD(a1a.vPosition.x),
Ritor1
parents:
diff changeset
8715 SLOWORD(a1a.vPosition.y),
Ritor1
parents:
diff changeset
8716 SLOWORD(a1a.vPosition.z),
Ritor1
parents:
diff changeset
8717 0,
Ritor1
parents:
diff changeset
8718 0);
Ritor1
parents:
diff changeset
8719 }
Ritor1
parents:
diff changeset
8720 return result;
Ritor1
parents:
diff changeset
8721 }
Ritor1
parents:
diff changeset
8722
Ritor1
parents:
diff changeset
8723
Ritor1
parents:
diff changeset
8724
Ritor1
parents:
diff changeset
8725 //----- (0042FB5C) --------------------------------------------------------
Ritor1
parents:
diff changeset
8726 bool __fastcall sub_42FB5C(signed int a1)
Ritor1
parents:
diff changeset
8727 {
Ritor1
parents:
diff changeset
8728 int v1; // ecx@3
Ritor1
parents:
diff changeset
8729 int v2; // ecx@4
Ritor1
parents:
diff changeset
8730 int v3; // ecx@5
Ritor1
parents:
diff changeset
8731 int v4; // ecx@6
Ritor1
parents:
diff changeset
8732 int v5; // ecx@7
Ritor1
parents:
diff changeset
8733 int v6; // ecx@8
Ritor1
parents:
diff changeset
8734 char v7; // zf@9
Ritor1
parents:
diff changeset
8735
Ritor1
parents:
diff changeset
8736 if ( a1 > 39 )
Ritor1
parents:
diff changeset
8737 {
Ritor1
parents:
diff changeset
8738 if ( a1 > 77 )
Ritor1
parents:
diff changeset
8739 {
Ritor1
parents:
diff changeset
8740 if ( a1 == 80 )
Ritor1
parents:
diff changeset
8741 return 0;
Ritor1
parents:
diff changeset
8742 if ( a1 > 84 )
Ritor1
parents:
diff changeset
8743 {
Ritor1
parents:
diff changeset
8744 if ( a1 <= 86 )
Ritor1
parents:
diff changeset
8745 return 0;
Ritor1
parents:
diff changeset
8746 v7 = a1 == 95;
Ritor1
parents:
diff changeset
8747 goto LABEL_20;
Ritor1
parents:
diff changeset
8748 }
Ritor1
parents:
diff changeset
8749 }
Ritor1
parents:
diff changeset
8750 else
Ritor1
parents:
diff changeset
8751 {
Ritor1
parents:
diff changeset
8752 if ( a1 == 77 )
Ritor1
parents:
diff changeset
8753 return 0;
Ritor1
parents:
diff changeset
8754 if ( a1 >= 46 )
Ritor1
parents:
diff changeset
8755 {
Ritor1
parents:
diff changeset
8756 if ( a1 <= 47 || a1 == 51 )
Ritor1
parents:
diff changeset
8757 return 0;
Ritor1
parents:
diff changeset
8758 v7 = a1 == 73;
Ritor1
parents:
diff changeset
8759 goto LABEL_20;
Ritor1
parents:
diff changeset
8760 }
Ritor1
parents:
diff changeset
8761 }
Ritor1
parents:
diff changeset
8762 return 1;
Ritor1
parents:
diff changeset
8763 }
Ritor1
parents:
diff changeset
8764 if ( a1 == 39 || (v1 = a1 - 2) == 0 )
Ritor1
parents:
diff changeset
8765 return 1;
Ritor1
parents:
diff changeset
8766 v2 = v1 - 3;
Ritor1
parents:
diff changeset
8767 if ( !v2 )
Ritor1
parents:
diff changeset
8768 return 0;
Ritor1
parents:
diff changeset
8769 v3 = v2 - 1;
Ritor1
parents:
diff changeset
8770 if ( !v3 || (v4 = v3 - 3) == 0 )
Ritor1
parents:
diff changeset
8771 return 1;
Ritor1
parents:
diff changeset
8772 v5 = v4 - 8;
Ritor1
parents:
diff changeset
8773 if ( !v5 )
Ritor1
parents:
diff changeset
8774 return 0;
Ritor1
parents:
diff changeset
8775 v6 = v5 - 1;
Ritor1
parents:
diff changeset
8776 if ( !v6 )
Ritor1
parents:
diff changeset
8777 return 1;
Ritor1
parents:
diff changeset
8778 v7 = v6 == 20;
Ritor1
parents:
diff changeset
8779 LABEL_20:
Ritor1
parents:
diff changeset
8780 if ( !v7 )
Ritor1
parents:
diff changeset
8781 return 1;
Ritor1
parents:
diff changeset
8782 return 0;
Ritor1
parents:
diff changeset
8783 }
Ritor1
parents:
diff changeset
8784
Ritor1
parents:
diff changeset
8785 //----- (0042FBDD) --------------------------------------------------------
Ritor1
parents:
diff changeset
8786 void __cdecl sub_42FBDD()
Ritor1
parents:
diff changeset
8787 {
Ritor1
parents:
diff changeset
8788 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
8789 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]);
Ritor1
parents:
diff changeset
8790 pRenderer->Present();
Ritor1
parents:
diff changeset
8791 }
Ritor1
parents:
diff changeset
8792
Ritor1
parents:
diff changeset
8793 //----- (0042FC15) --------------------------------------------------------
11
66319a734368 16.01.13(work)
Ritor1
parents: 0
diff changeset
8794 void __cdecl CloseWindowBackground()
0
Ritor1
parents:
diff changeset
8795 {
Ritor1
parents:
diff changeset
8796 pAudioPlayer->PlaySound((SoundID)75, -2, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
8797 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]);
Ritor1
parents:
diff changeset
8798 pRenderer->Present();
Ritor1
parents:
diff changeset
8799 }
Ritor1
parents:
diff changeset
8800
Ritor1
parents:
diff changeset
8801 //----- (0042FC4E) --------------------------------------------------------
Ritor1
parents:
diff changeset
8802 void __cdecl ProcessInputActions()
Ritor1
parents:
diff changeset
8803 {
Ritor1
parents:
diff changeset
8804 ActionQueue *pActionQueue; // esi@7
Ritor1
parents:
diff changeset
8805 Keyboard *v3; // ecx@8
Ritor1
parents:
diff changeset
8806 char v4; // al@9
Ritor1
parents:
diff changeset
8807 ActionQueue *v5; // ecx@19
Ritor1
parents:
diff changeset
8808 Player *v6; // ecx@86
Ritor1
parents:
diff changeset
8809 Player *v7; // esi@100
Ritor1
parents:
diff changeset
8810 char v8; // bl@100
Ritor1
parents:
diff changeset
8811 unsigned __int16 v9; // ax@102
Ritor1
parents:
diff changeset
8812 int v10; // eax@103
Ritor1
parents:
diff changeset
8813 unsigned int v11; // eax@127
Ritor1
parents:
diff changeset
8814 signed int v12; // esi@157
Ritor1
parents:
diff changeset
8815 Keyboard *v13; // ecx@158
Ritor1
parents:
diff changeset
8816 char v14; // al@159
Ritor1
parents:
diff changeset
8817 unsigned int v15; // eax@168
Ritor1
parents:
diff changeset
8818 void *v16; // esi@177
Ritor1
parents:
diff changeset
8819 int v17; // [sp-14h] [bp-1Ch]@8
Ritor1
parents:
diff changeset
8820 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20
Ritor1
parents:
diff changeset
8821 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8822 //__int16 v20; // [sp-14h] [bp-1Ch]@60
0
Ritor1
parents:
diff changeset
8823 int v21; // [sp-14h] [bp-1Ch]@68
Ritor1
parents:
diff changeset
8824 int v22; // [sp-Ch] [bp-14h]@158
Ritor1
parents:
diff changeset
8825 InputAction inputAction; // [sp+0h] [bp-8h]@7
Ritor1
parents:
diff changeset
8826 int v24; // [sp+4h] [bp-4h]@87
Ritor1
parents:
diff changeset
8827
Ritor1
parents:
diff changeset
8828 pGame->pKeyboardInstance->EnterCriticalSection();
Ritor1
parents:
diff changeset
8829 auto pKeyboard = pGame->pKeyboardInstance;
Ritor1
parents:
diff changeset
8830 if (!bAlwaysRun)
Ritor1
parents:
diff changeset
8831 {
Ritor1
parents:
diff changeset
8832 if (pKeyboard->IsShiftHeld())
Ritor1
parents:
diff changeset
8833 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
8834 else
Ritor1
parents:
diff changeset
8835 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
8836 }
Ritor1
parents:
diff changeset
8837 else
Ritor1
parents:
diff changeset
8838 {
Ritor1
parents:
diff changeset
8839 if (pKeyboard->IsShiftHeld())
Ritor1
parents:
diff changeset
8840 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
8841 else
Ritor1
parents:
diff changeset
8842 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
8843 }
Ritor1
parents:
diff changeset
8844
140
f4d7a9a8c363 Walk/run and other actions
Nomad
parents: 135
diff changeset
8845 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
0
Ritor1
parents:
diff changeset
8846 LABEL_6:
Ritor1
parents:
diff changeset
8847 if ( !pEventTimer->bPaused )
Ritor1
parents:
diff changeset
8848 {
Ritor1
parents:
diff changeset
8849 inputAction = (InputAction)0;
Ritor1
parents:
diff changeset
8850 pActionQueue = pPartyActionQueue;
Ritor1
parents:
diff changeset
8851 while ( 1 )
Ritor1
parents:
diff changeset
8852 {
Ritor1
parents:
diff changeset
8853 v3 = pGame->pKeyboardInstance;
Ritor1
parents:
diff changeset
8854 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction];
Ritor1
parents:
diff changeset
8855 if ( pKeyActionMap->pToggleTypes[inputAction] )
Ritor1
parents:
diff changeset
8856 v4 = v3->WasKeyPressed(v17);
Ritor1
parents:
diff changeset
8857 else
Ritor1
parents:
diff changeset
8858 v4 = v3->IsKeyBeingHeld(v17);
Ritor1
parents:
diff changeset
8859 if ( v4 )
Ritor1
parents:
diff changeset
8860 {
Ritor1
parents:
diff changeset
8861 switch ( inputAction )
Ritor1
parents:
diff changeset
8862 {
Ritor1
parents:
diff changeset
8863 case INPUT_MoveForward:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8864 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8865 break;
Ritor1
parents:
diff changeset
8866 if (!pParty->bTurnBasedModeOn)
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8867 //goto _do_move_forward;
0
Ritor1
parents:
diff changeset
8868 {
Ritor1
parents:
diff changeset
8869 v5 = pActionQueue;
140
f4d7a9a8c363 Walk/run and other actions
Nomad
parents: 135
diff changeset
8870 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
0
Ritor1
parents:
diff changeset
8871 partyAction = PARTY_RunForward;
Ritor1
parents:
diff changeset
8872 else
Ritor1
parents:
diff changeset
8873 partyAction = PARTY_WalkForward;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8874 //goto _add_action_and_continue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8875 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8876 break;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8877 }
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8878 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8879 {
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8880 pTurnEngine->uActionPointsLeft -= 26;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8881 //_do_move_forward:
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8882 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8883 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8884 partyAction = PARTY_RunForward;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8885 else
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8886 partyAction = PARTY_WalkForward;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8887 //goto _add_action_and_continue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8888 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8889 break;
0
Ritor1
parents:
diff changeset
8890 }
Ritor1
parents:
diff changeset
8891 break;
Ritor1
parents:
diff changeset
8892 case INPUT_MoveBackwards:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8893 //__debugbreak();
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8894 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8895 break;
Ritor1
parents:
diff changeset
8896 if (!pParty->bTurnBasedModeOn)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8897 //goto _do_move_backwards;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8898 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8899 v5 = pActionQueue;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8900 if ( pParty->uFlags2 & 2 )
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8901 partyAction = PARTY_RunBackward;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8902 else
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8903 partyAction = PARTY_WalkBackward;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8904 //goto _add_action_and_continue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8905 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8906 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8907 }
0
Ritor1
parents:
diff changeset
8908 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
Ritor1
parents:
diff changeset
8909 {
Ritor1
parents:
diff changeset
8910 pTurnEngine->uActionPointsLeft -= 26;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8911 //_do_move_backwards:
0
Ritor1
parents:
diff changeset
8912 v5 = pActionQueue;
Ritor1
parents:
diff changeset
8913 if ( pParty->uFlags2 & 2 )
Ritor1
parents:
diff changeset
8914 partyAction = PARTY_RunBackward;
Ritor1
parents:
diff changeset
8915 else
Ritor1
parents:
diff changeset
8916 partyAction = PARTY_WalkBackward;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8917 //goto _add_action_and_continue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8918 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8919 break;
0
Ritor1
parents:
diff changeset
8920 }
Ritor1
parents:
diff changeset
8921 break;
Ritor1
parents:
diff changeset
8922 case INPUT_StrafeLeft:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8923 //__debugbreak();
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8924 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8925 break;
Ritor1
parents:
diff changeset
8926 if (!pParty->bTurnBasedModeOn)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8927 //goto _do_strafe_left;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8928 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8929 partyAction = PARTY_StrafeLeft;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8930 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8931 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8932 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8933 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8934 }
0
Ritor1
parents:
diff changeset
8935 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
Ritor1
parents:
diff changeset
8936 break;
Ritor1
parents:
diff changeset
8937 pTurnEngine->uActionPointsLeft -= 26;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8938 //_do_strafe_left:
0
Ritor1
parents:
diff changeset
8939 partyAction = PARTY_StrafeLeft;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8940 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8941 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8942 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8943 break;
0
Ritor1
parents:
diff changeset
8944 case INPUT_StrafeRight:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8945 //__debugbreak();
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8946 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8947 break;
Ritor1
parents:
diff changeset
8948 if (!pParty->bTurnBasedModeOn)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8949 //goto _do_strafe_right;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8950 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8951 partyAction = PARTY_StrafeRight;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8952 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8953 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8954 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8955 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8956 }
0
Ritor1
parents:
diff changeset
8957 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
Ritor1
parents:
diff changeset
8958 break;
Ritor1
parents:
diff changeset
8959 pTurnEngine->uActionPointsLeft -= 26;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
8960 //_do_strafe_right:
0
Ritor1
parents:
diff changeset
8961 partyAction = PARTY_StrafeRight;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8962 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8963 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8964 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
8965 break;
0
Ritor1
parents:
diff changeset
8966 case INPUT_TurnLeft:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8967 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8968 break;
Ritor1
parents:
diff changeset
8969 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing
Ritor1
parents:
diff changeset
8970 {
Ritor1
parents:
diff changeset
8971 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
8972 {
Ritor1
parents:
diff changeset
8973 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
Ritor1
parents:
diff changeset
8974 break;
Ritor1
parents:
diff changeset
8975 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
8976 }
Ritor1
parents:
diff changeset
8977 partyAction_ = PARTY_StrafeLeft;
Ritor1
parents:
diff changeset
8978 }
Ritor1
parents:
diff changeset
8979 else
Ritor1
parents:
diff changeset
8980 {
Ritor1
parents:
diff changeset
8981 if ( pParty->uFlags2 & 2 )
Ritor1
parents:
diff changeset
8982 partyAction_ = PARTY_FastTurnLeft;
Ritor1
parents:
diff changeset
8983 else
Ritor1
parents:
diff changeset
8984 partyAction_ = PARTY_TurnLeft;
Ritor1
parents:
diff changeset
8985 }
Ritor1
parents:
diff changeset
8986 pActionQueue->Add(partyAction_);
Ritor1
parents:
diff changeset
8987 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
Ritor1
parents:
diff changeset
8988 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8989 pWeather->OnPlayerTurn(10);
0
Ritor1
parents:
diff changeset
8990 }
Ritor1
parents:
diff changeset
8991 break;
Ritor1
parents:
diff changeset
8992 case INPUT_TurnRight:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
8993 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
8994 break;
Ritor1
parents:
diff changeset
8995 if ( GetAsyncKeyState(17) ) // strafing
Ritor1
parents:
diff changeset
8996 {
Ritor1
parents:
diff changeset
8997 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
8998 {
Ritor1
parents:
diff changeset
8999 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
Ritor1
parents:
diff changeset
9000 break;
Ritor1
parents:
diff changeset
9001 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
9002 }
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9003 v21 = PARTY_StrafeRight;
0
Ritor1
parents:
diff changeset
9004 }
Ritor1
parents:
diff changeset
9005 else
Ritor1
parents:
diff changeset
9006 {
Ritor1
parents:
diff changeset
9007 if ( pParty->uFlags2 & 2 )
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9008 v21 = PARTY_FastTurnRight;
0
Ritor1
parents:
diff changeset
9009 else
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9010 v21 = PARTY_TurnRight;
0
Ritor1
parents:
diff changeset
9011 }
Ritor1
parents:
diff changeset
9012 pActionQueue->Add((PartyAction)v21);
Ritor1
parents:
diff changeset
9013 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
Ritor1
parents:
diff changeset
9014 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9015 pWeather->OnPlayerTurn(-10);
0
Ritor1
parents:
diff changeset
9016 }
Ritor1
parents:
diff changeset
9017 break;
Ritor1
parents:
diff changeset
9018 case INPUT_Jump:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9019 //__debugbreak();
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9020 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn)
0
Ritor1
parents:
diff changeset
9021 break;
Ritor1
parents:
diff changeset
9022 partyAction = (PartyAction)12;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9023 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9024 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9025 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9026 break;
0
Ritor1
parents:
diff changeset
9027 case INPUT_Yell:
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
9028 if (!pCurrentScreen && uActiveCharacter)
0
Ritor1
parents:
diff changeset
9029 {
Ritor1
parents:
diff changeset
9030 pParty->Yell();
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
9031 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0);
0
Ritor1
parents:
diff changeset
9032 }
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
9033 break;
0
Ritor1
parents:
diff changeset
9034 case INPUT_Pass:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9035 //__debugbreak();
0
Ritor1
parents:
diff changeset
9036 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
9037 break;
Ritor1
parents:
diff changeset
9038 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9039 //goto LABEL_118;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9040 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9041 pTurnEngine->field_18 |= 8u;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9042 break;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9043 }
0
Ritor1
parents:
diff changeset
9044 if ( uActiveCharacter )
Ritor1
parents:
diff changeset
9045 {
Ritor1
parents:
diff changeset
9046 v6 = pPlayers[uActiveCharacter];
Ritor1
parents:
diff changeset
9047 if ( !v6->uTimeToRecovery )
Ritor1
parents:
diff changeset
9048 {
Ritor1
parents:
diff changeset
9049 v24 = v6->GetAttackRecoveryTime(0);
Ritor1
parents:
diff changeset
9050 if ( !pParty->bTurnBasedModeOn )
Ritor1
parents:
diff changeset
9051 pPlayers[uActiveCharacter]->SetRecoveryTime(
Ritor1
parents:
diff changeset
9052 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333));
Ritor1
parents:
diff changeset
9053 pStru277->_427D48(uActiveCharacter);
Ritor1
parents:
diff changeset
9054 pTurnEngine->_40471C();
Ritor1
parents:
diff changeset
9055 }
Ritor1
parents:
diff changeset
9056 }
Ritor1
parents:
diff changeset
9057 break;
Ritor1
parents:
diff changeset
9058 case INPUT_Combat:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9059 //__debugbreak();
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9060 if (pCurrentScreen == SCREEN_GAME)
0
Ritor1
parents:
diff changeset
9061 {
Ritor1
parents:
diff changeset
9062 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
9063 {
141
cca78efb377e Constants -> enums
Nomad
parents: 140
diff changeset
9064 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player)
0
Ritor1
parents:
diff changeset
9065 {
Ritor1
parents:
diff changeset
9066 pParty->bTurnBasedModeOn = 0;
Ritor1
parents:
diff changeset
9067 pTurnEngine->End(true);
Ritor1
parents:
diff changeset
9068 }
Ritor1
parents:
diff changeset
9069 }
Ritor1
parents:
diff changeset
9070 else
Ritor1
parents:
diff changeset
9071 {
Ritor1
parents:
diff changeset
9072 pTurnEngine->Start();
Ritor1
parents:
diff changeset
9073 pParty->bTurnBasedModeOn = true;
Ritor1
parents:
diff changeset
9074 }
Ritor1
parents:
diff changeset
9075 }
Ritor1
parents:
diff changeset
9076 break;
Ritor1
parents:
diff changeset
9077 case INPUT_CastReady:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9078 //__debugbreak();
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9079 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
9080 break;
Ritor1
parents:
diff changeset
9081 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9082 //goto LABEL_118;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9083 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9084 pTurnEngine->field_18 |= 8u;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9085 break;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9086 }
0
Ritor1
parents:
diff changeset
9087 if ( !uActiveCharacter )
Ritor1
parents:
diff changeset
9088 break;
Ritor1
parents:
diff changeset
9089 v7 = pPlayers[uActiveCharacter];
Ritor1
parents:
diff changeset
9090 v8 = v7->uQuickSpell;
Ritor1
parents:
diff changeset
9091 if ( !v8
Ritor1
parents:
diff changeset
9092 || bUnderwater
Ritor1
parents:
diff changeset
9093 || ((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)),
Ritor1
parents:
diff changeset
9094 v10 > v7->sMana) )
Ritor1
parents:
diff changeset
9095 {
Ritor1
parents:
diff changeset
9096 pActionQueue = pPartyActionQueue;
Ritor1
parents:
diff changeset
9097 LABEL_120:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9098
0
Ritor1
parents:
diff changeset
9099 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
Ritor1
parents:
diff changeset
9100 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9101 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9102 //goto _send_message;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9103 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9104 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9105 ++pMessageQueue_50CBD0->uNumMessages;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9106 break;
0
Ritor1
parents:
diff changeset
9107 }
Ritor1
parents:
diff changeset
9108 }
Ritor1
parents:
diff changeset
9109 else
Ritor1
parents:
diff changeset
9110 {
Ritor1
parents:
diff changeset
9111 pActionQueue = pPartyActionQueue;
Ritor1
parents:
diff changeset
9112 if ( dword_50C9E8 < 40 )
Ritor1
parents:
diff changeset
9113 {
Ritor1
parents:
diff changeset
9114 dword_50C9EC[3 * dword_50C9E8] = 25;
Ritor1
parents:
diff changeset
9115 dword_50C9F0[3 * dword_50C9E8] = 0;
Ritor1
parents:
diff changeset
9116 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
Ritor1
parents:
diff changeset
9117 ++dword_50C9E8;
Ritor1
parents:
diff changeset
9118 }
Ritor1
parents:
diff changeset
9119 }
Ritor1
parents:
diff changeset
9120 break;
Ritor1
parents:
diff changeset
9121 case INPUT_Attack:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9122 //__debugbreak();
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9123 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
9124 break;
Ritor1
parents:
diff changeset
9125 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3)
Ritor1
parents:
diff changeset
9126 goto LABEL_120;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9127 //LABEL_118:
0
Ritor1
parents:
diff changeset
9128 pTurnEngine->field_18 |= 8u;
Ritor1
parents:
diff changeset
9129 break;
Ritor1
parents:
diff changeset
9130 case INPUT_EventTrigger:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9131 if (pCurrentScreen == SCREEN_GAME)
0
Ritor1
parents:
diff changeset
9132 {
Ritor1
parents:
diff changeset
9133 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
Ritor1
parents:
diff changeset
9134 break;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9135 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9136 //goto _send_message;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9137 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9138 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9139 ++pMessageQueue_50CBD0->uNumMessages;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9140 break;
0
Ritor1
parents:
diff changeset
9141 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 141
diff changeset
9142 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE )
0
Ritor1
parents:
diff changeset
9143 {
Ritor1
parents:
diff changeset
9144 v11 = pMessageQueue_50CBD0->uNumMessages;
Ritor1
parents:
diff changeset
9145 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
9146 {
Ritor1
parents:
diff changeset
9147 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
Ritor1
parents:
diff changeset
9148 {
Ritor1
parents:
diff changeset
9149 v11 = 1;
Ritor1
parents:
diff changeset
9150 pMessageQueue_50CBD0->uNumMessages = 1;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9151 //LABEL_132:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9152 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9153 //_send_message:
0
Ritor1
parents:
diff changeset
9154 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
Ritor1
parents:
diff changeset
9155 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
Ritor1
parents:
diff changeset
9156 ++pMessageQueue_50CBD0->uNumMessages;
Ritor1
parents:
diff changeset
9157 break;
Ritor1
parents:
diff changeset
9158 }
Ritor1
parents:
diff changeset
9159 v11 = 0;
Ritor1
parents:
diff changeset
9160 pMessageQueue_50CBD0->uNumMessages = 0;
Ritor1
parents:
diff changeset
9161 }
Ritor1
parents:
diff changeset
9162 if ( (signed int)v11 < 40 )
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9163 //goto LABEL_132;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9164 {
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
9165 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9166 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9167 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9168 ++pMessageQueue_50CBD0->uNumMessages;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9169 break;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9170 }
0
Ritor1
parents:
diff changeset
9171 }
Ritor1
parents:
diff changeset
9172 break;
Ritor1
parents:
diff changeset
9173 case INPUT_CharCycle:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9174 //__debugbreak();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 141
diff changeset
9175 if ( pCurrentScreen == SCREEN_SPELL_BOOK
0
Ritor1
parents:
diff changeset
9176 || dword_50C9E8 >= 40 )
Ritor1
parents:
diff changeset
9177 break;
Ritor1
parents:
diff changeset
9178 dword_50C9EC[3 * dword_50C9E8] = 176;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9179 //goto LABEL_155;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9180 dword_50C9F0[3 * dword_50C9E8] = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9181 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9182 ++dword_50C9E8;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9183 break;
0
Ritor1
parents:
diff changeset
9184 case INPUT_LookUp:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9185 //__debugbreak();
0
Ritor1
parents:
diff changeset
9186 if ( pEventTimer->bPaused )
Ritor1
parents:
diff changeset
9187 break;
Ritor1
parents:
diff changeset
9188 partyAction = (PartyAction)7;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9189 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9190 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9191 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9192 break;
0
Ritor1
parents:
diff changeset
9193 case INPUT_CenterView:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9194 //__debugbreak();
0
Ritor1
parents:
diff changeset
9195 if ( pEventTimer->bPaused )
Ritor1
parents:
diff changeset
9196 break;
Ritor1
parents:
diff changeset
9197 partyAction = (PartyAction)9;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9198 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9199 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9200 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9201 break;
0
Ritor1
parents:
diff changeset
9202 case INPUT_LookDown:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9203 //__debugbreak();
0
Ritor1
parents:
diff changeset
9204 if ( pEventTimer->bPaused )
Ritor1
parents:
diff changeset
9205 break;
Ritor1
parents:
diff changeset
9206 partyAction = (PartyAction)8;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9207 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9208 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9209 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9210 break;
0
Ritor1
parents:
diff changeset
9211 case INPUT_FlyUp:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9212 //__debugbreak();
0
Ritor1
parents:
diff changeset
9213 if ( pCurrentScreen
Ritor1
parents:
diff changeset
9214 || pEventTimer->bPaused )
Ritor1
parents:
diff changeset
9215 break;
Ritor1
parents:
diff changeset
9216 partyAction = (PartyAction)13;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9217 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9218 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9219 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9220 break;
0
Ritor1
parents:
diff changeset
9221 case INPUT_Land:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9222 //__debugbreak();
0
Ritor1
parents:
diff changeset
9223 if ( pCurrentScreen
Ritor1
parents:
diff changeset
9224 || pEventTimer->bPaused )
Ritor1
parents:
diff changeset
9225 break;
Ritor1
parents:
diff changeset
9226 partyAction = (PartyAction)15;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9227 //goto _add_action_and_continue_;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9228 v5 = pActionQueue;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9229 v5->Add(partyAction);
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9230 break;
0
Ritor1
parents:
diff changeset
9231 case INPUT_FlyDown:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9232 //__debugbreak();
0
Ritor1
parents:
diff changeset
9233 if ( !pCurrentScreen
Ritor1
parents:
diff changeset
9234 && !pEventTimer->bPaused )
Ritor1
parents:
diff changeset
9235 {
Ritor1
parents:
diff changeset
9236 partyAction = (PartyAction)14;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9237 //_add_action_and_continue_:
0
Ritor1
parents:
diff changeset
9238 v5 = pActionQueue;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9239 //_add_action_and_continue:
0
Ritor1
parents:
diff changeset
9240 v5->Add(partyAction);
Ritor1
parents:
diff changeset
9241 }
Ritor1
parents:
diff changeset
9242 break;
Ritor1
parents:
diff changeset
9243 case INPUT_ZoomIn:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9244 //__debugbreak();
0
Ritor1
parents:
diff changeset
9245 if ( dword_50C9E8 >= 40 )
Ritor1
parents:
diff changeset
9246 break;
Ritor1
parents:
diff changeset
9247 dword_50C9EC[3 * dword_50C9E8] = 367;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9248 //goto LABEL_155;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9249 dword_50C9F0[3 * dword_50C9E8] = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9250 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9251 ++dword_50C9E8;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9252 break;
0
Ritor1
parents:
diff changeset
9253 case INPUT_ZoomOut:
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9254 //__debugbreak();
0
Ritor1
parents:
diff changeset
9255 if ( dword_50C9E8 < 40 )
Ritor1
parents:
diff changeset
9256 {
Ritor1
parents:
diff changeset
9257 dword_50C9EC[3 * dword_50C9E8] = 368;
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
9258 //LABEL_155:
0
Ritor1
parents:
diff changeset
9259 dword_50C9F0[3 * dword_50C9E8] = 0;
Ritor1
parents:
diff changeset
9260 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = 0;
Ritor1
parents:
diff changeset
9261 ++dword_50C9E8;
Ritor1
parents:
diff changeset
9262 }
Ritor1
parents:
diff changeset
9263 break;
Ritor1
parents:
diff changeset
9264 case INPUT_AlwaysRun:
Ritor1
parents:
diff changeset
9265 bAlwaysRun = bAlwaysRun == 0;
Ritor1
parents:
diff changeset
9266 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9267 default:
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9268 //__debugbreak();
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9269 break;
0
Ritor1
parents:
diff changeset
9270 }
Ritor1
parents:
diff changeset
9271 }
Ritor1
parents:
diff changeset
9272 inputAction = (InputAction)((int)inputAction + 1);
Ritor1
parents:
diff changeset
9273 if ( (signed int)inputAction >= 30 )
Ritor1
parents:
diff changeset
9274 goto LABEL_176;
Ritor1
parents:
diff changeset
9275 }
Ritor1
parents:
diff changeset
9276 }
Ritor1
parents:
diff changeset
9277 v12 = 0;
Ritor1
parents:
diff changeset
9278 do
Ritor1
parents:
diff changeset
9279 {
Ritor1
parents:
diff changeset
9280 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12];
Ritor1
parents:
diff changeset
9281 v13 = pGame->pKeyboardInstance;
Ritor1
parents:
diff changeset
9282 if ( pKeyActionMap->pToggleTypes[v12] )
Ritor1
parents:
diff changeset
9283 v14 = v13->WasKeyPressed(v22);
Ritor1
parents:
diff changeset
9284 else
Ritor1
parents:
diff changeset
9285 v14 = v13->IsKeyBeingHeld(v22);
Ritor1
parents:
diff changeset
9286 if ( v14 && v12 == 9 )
Ritor1
parents:
diff changeset
9287 {
Ritor1
parents:
diff changeset
9288 if ( !pCurrentScreen )
Ritor1
parents:
diff changeset
9289 {
Ritor1
parents:
diff changeset
9290 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
Ritor1
parents:
diff changeset
9291 goto LABEL_175;
Ritor1
parents:
diff changeset
9292 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9293 //goto LABEL_174;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9294 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9295 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9296 ++pMessageQueue_50CBD0->uNumMessages;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9297 goto LABEL_175;
0
Ritor1
parents:
diff changeset
9298 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 141
diff changeset
9299 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE
9abdd40a107b pCurrentScreen
Ritor1
parents: 141
diff changeset
9300 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
0
Ritor1
parents:
diff changeset
9301 {
Ritor1
parents:
diff changeset
9302 v15 = pMessageQueue_50CBD0->uNumMessages;
Ritor1
parents:
diff changeset
9303 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
9304 {
Ritor1
parents:
diff changeset
9305 v15 = 0;
Ritor1
parents:
diff changeset
9306 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
Ritor1
parents:
diff changeset
9307 {
Ritor1
parents:
diff changeset
9308 v15 = 1;
Ritor1
parents:
diff changeset
9309 pMessageQueue_50CBD0->uNumMessages = 1;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9310 //goto LABEL_173;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9311 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9312 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9313 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9314 ++pMessageQueue_50CBD0->uNumMessages;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9315 goto LABEL_175;
0
Ritor1
parents:
diff changeset
9316 }
Ritor1
parents:
diff changeset
9317 pMessageQueue_50CBD0->uNumMessages = 0;
Ritor1
parents:
diff changeset
9318 }
Ritor1
parents:
diff changeset
9319 if ( (signed int)v15 >= 40 )
Ritor1
parents:
diff changeset
9320 goto LABEL_175;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9321 //LABEL_173:
0
Ritor1
parents:
diff changeset
9322 pMessageQueue_50CBD0->pMessages[v15].eType = (UIMessageType)113;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
9323 //LABEL_174:
0
Ritor1
parents:
diff changeset
9324 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
Ritor1
parents:
diff changeset
9325 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
Ritor1
parents:
diff changeset
9326 ++pMessageQueue_50CBD0->uNumMessages;
Ritor1
parents:
diff changeset
9327 goto LABEL_175;
Ritor1
parents:
diff changeset
9328 }
Ritor1
parents:
diff changeset
9329 }
Ritor1
parents:
diff changeset
9330 LABEL_175:
Ritor1
parents:
diff changeset
9331 ++v12;
Ritor1
parents:
diff changeset
9332 }
Ritor1
parents:
diff changeset
9333 while ( v12 < 30 );
Ritor1
parents:
diff changeset
9334 LABEL_176:
Ritor1
parents:
diff changeset
9335 if (pGame->pKeyboardInstance->bUsingAsynKeyboard)
Ritor1
parents:
diff changeset
9336 {
Ritor1
parents:
diff changeset
9337 AsyncKeyboard::LeaveCriticalSection();
Ritor1
parents:
diff changeset
9338 v16 = pAsyncKeyboard;
Ritor1
parents:
diff changeset
9339 AsyncKeyboard::EnterCriticalSection();
Ritor1
parents:
diff changeset
9340 memset((char *)v16 + 521, 0, 0x100u);
Ritor1
parents:
diff changeset
9341 AsyncKeyboard::LeaveCriticalSection();
Ritor1
parents:
diff changeset
9342 }
Ritor1
parents:
diff changeset
9343 }
Ritor1
parents:
diff changeset
9344